summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.bzrignore9
-rw-r--r--BUILD/Makefile.am1
-rwxr-xr-xBUILD/compile-irix-mips64-mipspro84
-rwxr-xr-xBUILD/compile-pentium-debug-max2
-rwxr-xr-xBUILD/compile-pentium-max2
-rw-r--r--BitKeeper/etc/config1
-rw-r--r--BitKeeper/etc/logging_ok13
-rwxr-xr-xBitKeeper/triggers/post-commit26
-rwxr-xr-xBitKeeper/triggers/pre-delta11
-rwxr-xr-xBuild-tools/Bootstrap2
-rwxr-xr-xBuild-tools/Do-compile13
-rwxr-xr-xBuild-tools/Do-pkg13
-rwxr-xr-xBuild-tools/Do-rpm19
-rwxr-xr-xBuild-tools/Do-win-build124
-rwxr-xr-xBuild-tools/mysql-copyright8
-rw-r--r--[-rwxr-xr-x]Docs/README.1st0
-rw-r--r--Docs/manual.ja.texi38699
-rw-r--r--Docs/manual_toc.html9
-rw-r--r--Docs/section.Infolinks.texi880
-rw-r--r--Docs/section.Testimonials.texi31
-rw-r--r--Docs/section.Users.texi414
-rwxr-xr-xVC++Files/InstallShield/4.0.XX-classic/File Groups/Clients and Tools.fgl1
-rwxr-xr-xVC++Files/InstallShield/4.0.XX-classic/File Groups/Development.fgl1
-rwxr-xr-xVC++Files/InstallShield/4.0.XX-classic/File Groups/Servers.fgl1
-rwxr-xr-xVC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.rul.old (renamed from VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.rul)0
-rwxr-xr-xVC++Files/InstallShield/4.0.XX-classic/Script Files/setup.rul641
-rwxr-xr-xVC++Files/InstallShield/4.0.XX-gpl/File Groups/Clients and Tools.fgl1
-rwxr-xr-xVC++Files/InstallShield/4.0.XX-gpl/File Groups/Development.fgl1
-rwxr-xr-xVC++Files/InstallShield/4.0.XX-gpl/File Groups/Servers.fgl12
-rwxr-xr-xVC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.rul.old (renamed from VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.rul)0
-rwxr-xr-xVC++Files/InstallShield/4.0.XX-gpl/Script Files/setup.rul641
-rwxr-xr-xVC++Files/InstallShield/4.0.XX-pro/File Groups/Clients and Tools.fgl1
-rwxr-xr-xVC++Files/InstallShield/4.0.XX-pro/File Groups/Development.fgl1
-rwxr-xr-xVC++Files/InstallShield/4.0.XX-pro/File Groups/Servers.fgl1
-rwxr-xr-xVC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.rul.old (renamed from VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.rul)0
-rwxr-xr-xVC++Files/InstallShield/4.0.XX-pro/Script Files/setup.rul641
-rw-r--r--VC++Files/client/mysqlclient.dsp30
-rw-r--r--VC++Files/comp_err/comp_err.dsp18
-rw-r--r--VC++Files/innobase/innobase.dsp12
-rwxr-xr-xVC++Files/libmysql/libmysql.def94
-rw-r--r--VC++Files/libmysql/libmysql.dsp8
-rw-r--r--VC++Files/libmysqld/libmysqld.dsp8
-rw-r--r--VC++Files/my_print_defaults/my_print_defaults.dsp25
-rwxr-xr-xVC++Files/myisam_ftdump/myisam_ftdump.dsp103
-rw-r--r--VC++Files/myisampack/myisampack.dsp18
-rw-r--r--VC++Files/mysql.dsw28
-rw-r--r--VC++Files/mysqldemb/mysqldemb.dsp8
-rw-r--r--VC++Files/mysqlserver/mysqlserver.dsp4
-rw-r--r--VC++Files/mysys/mysys.dsp44
-rw-r--r--VC++Files/sql/mysqld.dsp122
-rw-r--r--VC++Files/strings/MASM6x/strings.dsp12
-rw-r--r--VC++Files/strings/noMASM/strings.dsp70
-rw-r--r--VC++Files/strings/strings.dsp12
-rw-r--r--acinclude.m42
-rw-r--r--client/Makefile.am21
-rw-r--r--client/client_priv.h1
-rw-r--r--client/mysql.cc117
-rw-r--r--client/mysqladmin.c36
-rw-r--r--client/mysqldump.c160
-rw-r--r--client/mysqltest.c297
-rwxr-xr-xconfig.guess554
-rwxr-xr-xconfig.sub301
-rw-r--r--configure.in83
-rw-r--r--extra/replace.c41
-rw-r--r--heap/hp_delete.c31
-rw-r--r--heap/hp_extra.c33
-rw-r--r--heap/hp_hash.c41
-rw-r--r--heap/hp_info.c14
-rw-r--r--heap/hp_write.c3
-rw-r--r--include/config-win.h3
-rw-r--r--include/errmsg.h45
-rw-r--r--include/ft_global.h3
-rw-r--r--include/heap.h1
-rw-r--r--include/m_ctype.h75
-rw-r--r--include/m_string.h10
-rw-r--r--include/my_base.h20
-rw-r--r--include/my_global.h43
-rw-r--r--include/my_handler.h2
-rw-r--r--include/my_pthread.h5
-rw-r--r--include/my_sys.h55
-rw-r--r--include/my_tree.h4
-rw-r--r--include/myisam.h4
-rw-r--r--include/mysql.h153
-rw-r--r--include/mysql_com.h3
-rw-r--r--include/mysql_version.h.in5
-rw-r--r--include/mysqld_error.h185
-rw-r--r--include/sql_common.h2
-rw-r--r--innobase/Makefile.am4
-rw-r--r--innobase/btr/btr0btr.c78
-rw-r--r--innobase/btr/btr0cur.c119
-rw-r--r--innobase/btr/btr0pcur.c4
-rw-r--r--innobase/btr/btr0sea.c135
-rw-r--r--innobase/btr/ts/isql.c312
-rw-r--r--innobase/btr/ts/makefile16
-rw-r--r--innobase/btr/ts/trash/TSIT.C483
-rw-r--r--innobase/btr/ts/trash/tsbtrold5.c798
-rw-r--r--innobase/btr/ts/trash/tscli.c2263
-rw-r--r--innobase/btr/ts/tsbtr97.c5080
-rw-r--r--innobase/btr/ts/tsbtrfull.c4925
-rw-r--r--innobase/btr/ts/tsbtrins.c802
-rw-r--r--innobase/btr/ts/tscli.c3380
-rw-r--r--innobase/btr/ts/tsrecv.c4909
-rw-r--r--innobase/btr/ts/tsrecv97.c4909
-rw-r--r--innobase/btr/ts/tss.c397
-rw-r--r--innobase/btr/ts/tssrv.c535
-rw-r--r--innobase/buf/buf0buf.c29
-rw-r--r--innobase/buf/buf0flu.c13
-rw-r--r--innobase/buf/buf0lru.c42
-rw-r--r--innobase/buf/ts/makefile20
-rw-r--r--innobase/buf/ts/tsbuf.c885
-rw-r--r--innobase/buf/ts/tsos.c185
-rw-r--r--innobase/com/Makefile.am24
-rw-r--r--innobase/com/com0com.c345
-rw-r--r--innobase/com/com0shm.c1163
-rw-r--r--innobase/com/makefilewin12
-rw-r--r--innobase/com/ts/makefile19
-rw-r--r--innobase/com/ts/tscli.c96
-rw-r--r--innobase/com/ts/tscom.c94
-rw-r--r--innobase/configure.in5
-rw-r--r--innobase/cry/makefilewin12
-rw-r--r--innobase/data/data0data.c421
-rw-r--r--innobase/data/data0type.c91
-rw-r--r--innobase/dict/dict0boot.c25
-rw-r--r--innobase/dict/dict0crea.c178
-rw-r--r--innobase/dict/dict0dict.c714
-rw-r--r--innobase/dict/dict0load.c31
-rw-r--r--innobase/dict/dict0mem.c6
-rw-r--r--innobase/dict/ts/makefile16
-rw-r--r--innobase/dict/ts/tsdict.c73
-rw-r--r--innobase/dyn/ts/makefile12
-rw-r--r--innobase/dyn/ts/tsdyn.c57
-rw-r--r--innobase/fil/fil0fil.c12
-rw-r--r--innobase/fil/ts/makefile15
-rw-r--r--innobase/fil/ts/tsfil.c329
-rw-r--r--innobase/fsp/fsp0fsp.c125
-rw-r--r--innobase/fsp/trash/FSP0FSP.C3100
-rw-r--r--innobase/fsp/ts/del.c891
-rw-r--r--innobase/fsp/ts/makefile16
-rw-r--r--innobase/fsp/ts/tsfsp.c1234
-rw-r--r--innobase/ha/ha0ha.c36
-rw-r--r--innobase/ha/hash0hash.c38
-rw-r--r--innobase/ha/ts/makefile12
-rw-r--r--innobase/ha/ts/tsha.c120
-rw-r--r--innobase/ibuf/ibuf0ibuf.c30
-rw-r--r--innobase/include/Makefile.am9
-rw-r--r--innobase/include/btr0btr.ic3
-rw-r--r--innobase/include/btr0cur.h21
-rw-r--r--innobase/include/btr0sea.h37
-rw-r--r--innobase/include/btr0sea.ic6
-rw-r--r--innobase/include/buf0buf.h5
-rw-r--r--innobase/include/buf0buf.ic23
-rw-r--r--innobase/include/buf0flu.ic4
-rw-r--r--innobase/include/com0com.h125
-rw-r--r--innobase/include/com0com.ic7
-rw-r--r--innobase/include/com0shm.h103
-rw-r--r--innobase/include/com0shm.ic7
-rw-r--r--innobase/include/data0data.h92
-rw-r--r--innobase/include/data0data.ic25
-rw-r--r--innobase/include/data0type.h142
-rw-r--r--innobase/include/data0type.ic68
-rw-r--r--innobase/include/dict0crea.h24
-rw-r--r--innobase/include/dict0dict.h35
-rw-r--r--innobase/include/dict0dict.ic10
-rw-r--r--innobase/include/dict0mem.h17
-rw-r--r--innobase/include/fut0fut.ic2
-rw-r--r--innobase/include/ha0ha.ic8
-rw-r--r--innobase/include/hash0hash.h75
-rw-r--r--innobase/include/hash0hash.ic8
-rw-r--r--innobase/include/ib_odbc.h149
-rw-r--r--innobase/include/ibuf0ibuf.h9
-rw-r--r--innobase/include/lock0lock.h8
-rw-r--r--innobase/include/lock0lock.ic2
-rw-r--r--innobase/include/log0log.h4
-rw-r--r--innobase/include/log0log.ic10
-rw-r--r--innobase/include/mach0data.h19
-rw-r--r--innobase/include/mach0data.ic38
-rw-r--r--innobase/include/mem0dbg.h18
-rw-r--r--innobase/include/mem0dbg.ic2
-rw-r--r--innobase/include/mem0mem.ic52
-rw-r--r--innobase/include/mtr0log.h10
-rw-r--r--innobase/include/mtr0mtr.h25
-rw-r--r--innobase/include/odbc0odbc.h20
-rw-r--r--innobase/include/os0file.h61
-rw-r--r--innobase/include/os0proc.h31
-rw-r--r--innobase/include/os0thread.h7
-rw-r--r--innobase/include/page0cur.h5
-rw-r--r--innobase/include/pars0pars.h31
-rw-r--r--innobase/include/que0que.h25
-rw-r--r--innobase/include/que0que.ic18
-rw-r--r--innobase/include/rem0cmp.ic18
-rw-r--r--innobase/include/row0ins.h5
-rw-r--r--innobase/include/row0mysql.h21
-rw-r--r--innobase/include/row0row.h25
-rw-r--r--innobase/include/row0upd.h5
-rw-r--r--innobase/include/row0upd.ic2
-rw-r--r--innobase/include/srv0srv.h29
-rw-r--r--innobase/include/srv0start.h10
-rw-r--r--innobase/include/sync0rw.h14
-rw-r--r--innobase/include/sync0rw.ic45
-rw-r--r--innobase/include/sync0sync.h23
-rw-r--r--innobase/include/sync0sync.ic13
-rw-r--r--innobase/include/trx0rseg.ic8
-rw-r--r--innobase/include/trx0sys.ic22
-rw-r--r--innobase/include/trx0trx.h19
-rw-r--r--innobase/include/trx0undo.h14
-rw-r--r--innobase/include/trx0undo.ic4
-rw-r--r--innobase/include/univold.i164
-rw-r--r--innobase/include/univoldmysql.i181
-rw-r--r--innobase/include/usr0sess.h261
-rw-r--r--innobase/include/usr0sess.ic24
-rw-r--r--innobase/include/usr0types.h2
-rw-r--r--innobase/include/ut0dbg.h23
-rw-r--r--innobase/include/ut0mem.h18
-rw-r--r--innobase/include/ut0rnd.ic8
-rw-r--r--innobase/lock/lock0lock.c284
-rw-r--r--innobase/log/log0log.c128
-rw-r--r--innobase/log/log0recv.c60
-rw-r--r--innobase/log/trash/log0trsh.c648
-rw-r--r--innobase/mach/ts/makefile12
-rw-r--r--innobase/mach/ts/tsmach.c158
-rw-r--r--innobase/mem/mem0dbg.c197
-rw-r--r--innobase/mem/mem0mem.c4
-rw-r--r--innobase/mem/mem0pool.c14
-rw-r--r--innobase/mem/ts/makefile12
-rw-r--r--innobase/mem/ts/tsmem.c497
-rw-r--r--innobase/mtr/mtr0log.c13
-rw-r--r--innobase/mtr/mtr0mtr.c4
-rw-r--r--innobase/mtr/ts/makefile8
-rw-r--r--innobase/mtr/ts/tsbuf.c531
-rw-r--r--innobase/mtr/ts/tsmtr.c158
-rw-r--r--innobase/odbc/Makefile.am24
-rw-r--r--innobase/odbc/makefilewin7
-rw-r--r--innobase/odbc/odbc0dummy.c62
-rw-r--r--innobase/odbc/odbc0odbc.c714
-rw-r--r--innobase/os/os0file.c215
-rw-r--r--innobase/os/os0fileold.c1956
-rw-r--r--innobase/os/os0proc.c77
-rw-r--r--innobase/os/os0trash.c43
-rw-r--r--innobase/os/ts/makefile20
-rw-r--r--innobase/os/ts/tsos.c793
-rw-r--r--innobase/os/ts/tsosaux.c83
-rw-r--r--innobase/page/page0cur.c9
-rw-r--r--innobase/page/page0page.c32
-rw-r--r--innobase/page/ts/makefile16
-rw-r--r--innobase/page/ts/tspage.c705
-rw-r--r--innobase/pars/lexyy.c2
-rw-r--r--innobase/pars/pars0pars.c258
-rw-r--r--innobase/que/que0que.c340
-rw-r--r--innobase/read/read0read.c12
-rw-r--r--innobase/rem/rem0cmp.c59
-rw-r--r--innobase/rem/rem0rec.c4
-rw-r--r--innobase/rem/ts/makefile16
-rw-r--r--innobase/rem/ts/tsrem.c464
-rw-r--r--innobase/row/row0ins.c93
-rw-r--r--innobase/row/row0mysql.c165
-rw-r--r--innobase/row/row0purge.c6
-rw-r--r--innobase/row/row0row.c59
-rw-r--r--innobase/row/row0sel.c19
-rw-r--r--innobase/row/row0undo.c2
-rw-r--r--innobase/row/row0upd.c23
-rw-r--r--innobase/row/row0vers.c8
-rw-r--r--innobase/row/ts/makefile16
-rw-r--r--innobase/row/ts/tstcur.c1087
-rw-r--r--innobase/srv/srv0que.c2
-rw-r--r--innobase/srv/srv0srv.c990
-rw-r--r--innobase/srv/srv0start.c102
-rw-r--r--innobase/srv/ts/makefile15
-rw-r--r--innobase/srv/ts/tsdbc.c118
-rw-r--r--innobase/srv/ts/tssrv.c39
-rw-r--r--innobase/sync/sync0arr.c36
-rw-r--r--innobase/sync/sync0rw.c50
-rw-r--r--innobase/sync/sync0sync.c131
-rw-r--r--innobase/sync/ts/makefile14
-rw-r--r--innobase/sync/ts/tssync.c1366
-rw-r--r--innobase/thr/thr0loc.c12
-rw-r--r--innobase/thr/ts/makefile14
-rw-r--r--innobase/thr/ts/tsthr.c131
-rw-r--r--innobase/trx/trx0purge.c37
-rw-r--r--innobase/trx/trx0rec.c47
-rw-r--r--innobase/trx/trx0roll.c32
-rw-r--r--innobase/trx/trx0rseg.c11
-rw-r--r--innobase/trx/trx0sys.c25
-rw-r--r--innobase/trx/trx0trx.c122
-rw-r--r--innobase/trx/trx0undo.c107
-rw-r--r--innobase/trx/ts/makefile16
-rw-r--r--innobase/trx/ts/tstrx.c1663
-rw-r--r--innobase/trx/ts/tsttrxold.c1089
-rw-r--r--innobase/usr/usr0sess.c1116
-rw-r--r--innobase/ut/ts/makefile12
-rw-r--r--innobase/ut/ts/tsut.c347
-rw-r--r--innobase/ut/ut0dbg.c7
-rw-r--r--innobase/ut/ut0mem.c48
-rw-r--r--isam/isamchk.c2
-rw-r--r--libmysql/Makefile.shared7
-rw-r--r--libmysql/client_settings.h8
-rw-r--r--libmysql/errmsg.c19
-rw-r--r--libmysql/libmysql.c1198
-rw-r--r--libmysql/libmysql.def25
-rw-r--r--libmysql/manager.c2
-rw-r--r--libmysqld/Makefile.am4
-rw-r--r--libmysqld/emb_qcache.cc1
-rw-r--r--libmysqld/lib_sql.cc66
-rwxr-xr-xltconfig3
-rw-r--r--ltmain.sh2728
-rw-r--r--man/Makefile.am21
-rw-r--r--man/isamchk.1.in (renamed from man/isamchk.1)41
-rw-r--r--man/isamlog.1.in (renamed from man/isamlog.1)42
-rw-r--r--man/mysql.1.in (renamed from man/mysql.1)58
-rw-r--r--man/mysql_fix_privilege_tables.1.in (renamed from man/mysql_fix_privilege_tables.1)22
-rw-r--r--man/mysql_zap.134
-rw-r--r--man/mysql_zap.1.in52
-rw-r--r--man/mysqlaccess.1.in (renamed from man/mysqlaccess.1)41
-rw-r--r--man/mysqladmin.1.in (renamed from man/mysqladmin.1)45
-rw-r--r--man/mysqld.1.in (renamed from man/mysqld.1)44
-rw-r--r--man/mysqld_multi.1.in (renamed from man/mysqld_multi.1)42
-rw-r--r--man/mysqld_safe.1.in (renamed from man/mysqld_safe.1)37
-rw-r--r--man/mysqldump.1.in (renamed from man/mysqldump.1)41
-rw-r--r--man/mysqlshow.1.in (renamed from man/mysqlshow.1)41
-rw-r--r--man/perror.1.in (renamed from man/perror.1)41
-rw-r--r--man/replace.1.in (renamed from man/replace.1)41
-rw-r--r--myisam/Makefile.am6
-rw-r--r--myisam/ft_boolean_search.c64
-rw-r--r--myisam/ft_nlq_search.c12
-rw-r--r--myisam/ft_parser.c62
-rw-r--r--myisam/ft_static.c2
-rw-r--r--myisam/ft_stopwords.c2
-rw-r--r--myisam/ft_update.c4
-rw-r--r--myisam/mi_check.c53
-rw-r--r--myisam/mi_create.c8
-rw-r--r--myisam/mi_dynrec.c144
-rw-r--r--myisam/mi_extra.c31
-rw-r--r--myisam/mi_locking.c15
-rw-r--r--myisam/mi_rnext.c64
-rw-r--r--myisam/mi_rprev.c23
-rw-r--r--myisam/mi_search.c124
-rw-r--r--myisam/mi_unique.c2
-rw-r--r--myisam/mi_write.c6
-rw-r--r--myisam/myisam_ftdump.c (renamed from myisam/ft_dump.c)32
-rw-r--r--myisam/myisamchk.c4
-rw-r--r--myisam/myisamdef.h6
-rw-r--r--myisam/myisamlog.c39
-rw-r--r--mysql-test/include/have_sjis.inc4
-rw-r--r--mysql-test/include/system_db_struct.inc12
-rw-r--r--mysql-test/install_test_db.sh33
-rw-r--r--mysql-test/mysql-test-run.sh78
-rw-r--r--mysql-test/r/alter_table.result70
-rw-r--r--mysql-test/r/auto_increment.result8
-rw-r--r--mysql-test/r/bdb-crash.result7
-rw-r--r--mysql-test/r/bdb.result25
-rw-r--r--mysql-test/r/bigint.result3
-rw-r--r--mysql-test/r/binary.result33
-rw-r--r--mysql-test/r/cast.result18
-rw-r--r--mysql-test/r/compare.result24
-rw-r--r--mysql-test/r/create.result94
-rw-r--r--mysql-test/r/ctype_collate.result16
-rw-r--r--mysql-test/r/ctype_cp1251.result32
-rw-r--r--mysql-test/r/ctype_create.result15
-rw-r--r--mysql-test/r/ctype_mb.result6
-rw-r--r--mysql-test/r/ctype_sjis.result43
-rw-r--r--mysql-test/r/ctype_tis620.result2788
-rw-r--r--mysql-test/r/ctype_ujis.result28
-rw-r--r--mysql-test/r/ctype_utf8.result83
-rw-r--r--mysql-test/r/date_formats.result113
-rw-r--r--mysql-test/r/delete.result8
-rw-r--r--mysql-test/r/derived.result14
-rw-r--r--mysql-test/r/drop.result1
-rw-r--r--mysql-test/r/drop_temp_table.result8
-rw-r--r--mysql-test/r/endspace.result196
-rw-r--r--mysql-test/r/fulltext.result16
-rw-r--r--mysql-test/r/fulltext_var.result33
-rw-r--r--mysql-test/r/func_compress.result4
-rw-r--r--mysql-test/r/func_gconcat.result113
-rw-r--r--mysql-test/r/func_group.result2
-rw-r--r--mysql-test/r/func_if.result6
-rw-r--r--mysql-test/r/func_like.result15
-rw-r--r--mysql-test/r/func_math.result18
-rw-r--r--mysql-test/r/func_misc.result7
-rw-r--r--mysql-test/r/func_sapdb.result25
-rw-r--r--mysql-test/r/func_str.result75
-rw-r--r--mysql-test/r/func_test.result3
-rw-r--r--mysql-test/r/func_time.result36
-rw-r--r--mysql-test/r/gis-rtree.result40
-rw-r--r--mysql-test/r/gis.result212
-rw-r--r--mysql-test/r/grant.result45
-rw-r--r--mysql-test/r/grant2.result3
-rw-r--r--mysql-test/r/grant_cache.result59
-rw-r--r--mysql-test/r/handler.result18
-rw-r--r--mysql-test/r/have_sjis.require2
-rw-r--r--mysql-test/r/heap_btree.result17
-rw-r--r--mysql-test/r/innodb.result41
-rw-r--r--mysql-test/r/insert.result239
-rw-r--r--mysql-test/r/insert_select.result34
-rw-r--r--mysql-test/r/insert_update.result38
-rw-r--r--mysql-test/r/join.result6
-rw-r--r--mysql-test/r/join_outer.result12
-rw-r--r--mysql-test/r/key.result33
-rw-r--r--mysql-test/r/loaddata.result34
-rw-r--r--mysql-test/r/lock.result4
-rw-r--r--mysql-test/r/lowercase0.require3
-rw-r--r--mysql-test/r/lowercase2.require2
-rw-r--r--mysql-test/r/lowercase_table.result18
-rw-r--r--mysql-test/r/lowercase_table2.result123
-rw-r--r--mysql-test/r/lowercase_table3.result10
-rw-r--r--mysql-test/r/lowercase_table_qcache.result24
-rw-r--r--mysql-test/r/metadata.result62
-rw-r--r--mysql-test/r/multi_update.result39
-rw-r--r--mysql-test/r/myisam-blob.result44
-rw-r--r--mysql-test/r/myisam.result94
-rw-r--r--mysql-test/r/mysqldump.result112
-rw-r--r--mysql-test/r/negation_elimination.result4
-rw-r--r--mysql-test/r/null.result22
-rw-r--r--mysql-test/r/null_key.result2
-rw-r--r--mysql-test/r/order_by.result48
-rw-r--r--mysql-test/r/query_cache.result32
-rw-r--r--mysql-test/r/raid.result1
-rw-r--r--mysql-test/r/range.result16
-rw-r--r--mysql-test/r/rename.result14
-rw-r--r--mysql-test/r/repair_part1.result15
-rw-r--r--mysql-test/r/rpl000002.result18
-rw-r--r--mysql-test/r/rpl000009.result12
-rw-r--r--mysql-test/r/rpl_error_ignored_table.result26
-rw-r--r--mysql-test/r/rpl_heap.result29
-rw-r--r--mysql-test/r/rpl_insert_id.result2
-rw-r--r--mysql-test/r/rpl_multi_delete.result22
-rw-r--r--mysql-test/r/rpl_optimize.result27
-rw-r--r--mysql-test/r/rpl_relayrotate.result15
-rw-r--r--mysql-test/r/rpl_temporary.result15
-rw-r--r--mysql-test/r/rpl_trunc_binlog.result2
-rw-r--r--mysql-test/r/rpl_until.result2
-rw-r--r--mysql-test/r/select.result28
-rw-r--r--mysql-test/r/select_found.result18
-rw-r--r--mysql-test/r/show_check.result173
-rw-r--r--mysql-test/r/subselect.result154
-rw-r--r--mysql-test/r/subselect2.result4
-rw-r--r--mysql-test/r/subselect_innodb.result2
-rw-r--r--mysql-test/r/symlink.result4
-rw-r--r--mysql-test/r/synchronization.result162
-rw-r--r--mysql-test/r/system_mysql_db.result123
-rw-r--r--mysql-test/r/system_mysql_db_refs.result67
-rw-r--r--mysql-test/r/timezone.result6
-rw-r--r--mysql-test/r/true.require2
-rw-r--r--mysql-test/r/type_blob.result34
-rw-r--r--mysql-test/r/type_datetime.result10
-rw-r--r--mysql-test/r/type_decimal.result110
-rw-r--r--mysql-test/r/type_enum.result4
-rw-r--r--mysql-test/r/type_float.result4
-rw-r--r--mysql-test/r/type_ranges.result72
-rw-r--r--mysql-test/r/type_time.result8
-rw-r--r--mysql-test/r/type_timestamp.result215
-rw-r--r--mysql-test/r/type_uint.result2
-rw-r--r--mysql-test/r/type_year.result8
-rw-r--r--mysql-test/r/union.result79
-rw-r--r--mysql-test/r/variables.result37
-rw-r--r--mysql-test/r/warnings.result98
-rw-r--r--mysql-test/std_data/init_file.dat1
-rw-r--r--mysql-test/t/alter_table.test75
-rw-r--r--mysql-test/t/bdb-crash.test11
-rw-r--r--mysql-test/t/bdb.test14
-rw-r--r--mysql-test/t/bigint.test3
-rw-r--r--mysql-test/t/binary.test15
-rw-r--r--mysql-test/t/case.test8
-rw-r--r--mysql-test/t/cast.test4
-rw-r--r--mysql-test/t/compare.test17
-rw-r--r--mysql-test/t/create.test81
-rw-r--r--mysql-test/t/ctype_collate.test14
-rw-r--r--mysql-test/t/ctype_cp1251.test17
-rw-r--r--mysql-test/t/ctype_create.test14
-rw-r--r--mysql-test/t/ctype_sjis.test34
-rw-r--r--mysql-test/t/ctype_tis620-master.opt1
-rw-r--r--mysql-test/t/ctype_tis620.test54
-rw-r--r--mysql-test/t/ctype_ujis.test20
-rw-r--r--mysql-test/t/ctype_utf8.test44
-rw-r--r--mysql-test/t/date_formats.test31
-rw-r--r--mysql-test/t/delete.test4
-rw-r--r--mysql-test/t/derived.test16
-rw-r--r--mysql-test/t/drop.test2
-rw-r--r--mysql-test/t/endspace.test96
-rw-r--r--mysql-test/t/fulltext.test13
-rw-r--r--mysql-test/t/fulltext_var.test22
-rw-r--r--mysql-test/t/func_gconcat.test81
-rw-r--r--mysql-test/t/func_group.test1
-rw-r--r--mysql-test/t/func_if.test6
-rw-r--r--mysql-test/t/func_in.test6
-rw-r--r--mysql-test/t/func_like.test18
-rw-r--r--mysql-test/t/func_math.test21
-rw-r--r--mysql-test/t/func_misc.test4
-rw-r--r--mysql-test/t/func_sapdb.test6
-rw-r--r--mysql-test/t/func_str.test124
-rw-r--r--mysql-test/t/func_test.test13
-rw-r--r--mysql-test/t/func_time.test18
-rw-r--r--mysql-test/t/gis-rtree.test36
-rw-r--r--mysql-test/t/gis.test201
-rw-r--r--mysql-test/t/grant.test33
-rw-r--r--mysql-test/t/grant2.test1
-rw-r--r--mysql-test/t/grant_cache.test20
-rw-r--r--mysql-test/t/handler.test16
-rw-r--r--mysql-test/t/heap_btree.test9
-rw-r--r--mysql-test/t/init_file-master.opt1
-rw-r--r--mysql-test/t/init_file.test7
-rw-r--r--mysql-test/t/innodb.test45
-rw-r--r--mysql-test/t/insert.test52
-rw-r--r--mysql-test/t/insert_select.test31
-rw-r--r--mysql-test/t/insert_update.test22
-rw-r--r--mysql-test/t/key.test13
-rw-r--r--mysql-test/t/key_cache.test4
-rw-r--r--mysql-test/t/lock.test4
-rw-r--r--mysql-test/t/lock_tables_lost_commit.test2
-rw-r--r--mysql-test/t/lowercase_table.test26
-rw-r--r--mysql-test/t/lowercase_table2.test91
-rw-r--r--mysql-test/t/lowercase_table3-master.opt1
-rw-r--r--mysql-test/t/lowercase_table3.test37
-rw-r--r--mysql-test/t/lowercase_table_qcache-master.opt1
-rw-r--r--mysql-test/t/lowercase_table_qcache.test29
-rw-r--r--mysql-test/t/metadata.test35
-rw-r--r--mysql-test/t/multi_update.test36
-rw-r--r--mysql-test/t/myisam-blob-master.opt1
-rw-r--r--mysql-test/t/myisam-blob.test41
-rw-r--r--mysql-test/t/myisam.test69
-rw-r--r--mysql-test/t/mysqlbinlog.test5
-rw-r--r--mysql-test/t/mysqldump.test29
-rw-r--r--mysql-test/t/order_by.test42
-rw-r--r--mysql-test/t/query_cache.test24
-rw-r--r--mysql-test/t/raid.test1
-rw-r--r--mysql-test/t/range.test20
-rw-r--r--mysql-test/t/rename.test24
-rw-r--r--mysql-test/t/repair_part1.test12
-rw-r--r--mysql-test/t/row.test14
-rw-r--r--mysql-test/t/rpl000002.test15
-rw-r--r--mysql-test/t/rpl000009.test15
-rw-r--r--mysql-test/t/rpl_error_ignored_table-slave.opt2
-rw-r--r--mysql-test/t/rpl_error_ignored_table.test30
-rw-r--r--mysql-test/t/rpl_heap.test47
-rw-r--r--mysql-test/t/rpl_insert_id.test2
-rw-r--r--mysql-test/t/rpl_multi_delete-slave.opt1
-rw-r--r--mysql-test/t/rpl_multi_delete.test23
-rw-r--r--mysql-test/t/rpl_optimize.test43
-rw-r--r--mysql-test/t/rpl_relayrotate-master.opt1
-rw-r--r--mysql-test/t/rpl_relayrotate.test21
-rw-r--r--mysql-test/t/rpl_temporary.test13
-rw-r--r--mysql-test/t/rpl_until.test10
-rw-r--r--mysql-test/t/select.test16
-rw-r--r--mysql-test/t/select_found.test28
-rw-r--r--mysql-test/t/show_check.test162
-rw-r--r--mysql-test/t/subselect.test126
-rw-r--r--mysql-test/t/subselect_innodb.test2
-rw-r--r--mysql-test/t/symlink.test2
-rw-r--r--mysql-test/t/synchronization.test33
-rw-r--r--mysql-test/t/system_mysql_db.test8
-rw-r--r--mysql-test/t/system_mysql_db_fix-master.opt1
-rw-r--r--mysql-test/t/system_mysql_db_fix.test78
-rw-r--r--mysql-test/t/system_mysql_db_refs.test101
-rw-r--r--mysql-test/t/timezone.test9
-rw-r--r--mysql-test/t/type_blob.test16
-rw-r--r--mysql-test/t/type_timestamp.test144
-rw-r--r--mysql-test/t/type_year.test9
-rw-r--r--mysql-test/t/union.test40
-rw-r--r--mysql-test/t/update.test1
-rw-r--r--mysql-test/t/user_var.test4
-rw-r--r--mysql-test/t/variables.test40
-rw-r--r--mysys/COPYING.LIB481
-rw-r--r--mysys/Makefile.am13
-rw-r--r--mysys/charset-def.c1
-rw-r--r--mysys/charset.c29
-rw-r--r--mysys/charset2html.c34
-rw-r--r--mysys/default.c8
-rw-r--r--mysys/hash.c8
-rw-r--r--mysys/mf_iocache.c11
-rw-r--r--mysys/mf_keycache.c6
-rw-r--r--mysys/mf_pack.c30
-rw-r--r--mysys/mf_soundex.c4
-rw-r--r--mysys/mf_tempdir.c4
-rw-r--r--mysys/mf_tempfile.c13
-rw-r--r--mysys/my_alloc.c66
-rw-r--r--mysys/my_div.c2
-rw-r--r--mysys/my_dup.c2
-rw-r--r--mysys/my_file.c147
-rw-r--r--mysys/my_fopen.c8
-rw-r--r--mysys/my_gethwaddr.c130
-rw-r--r--mysys/my_getopt.c23
-rw-r--r--mysys/my_getsystime.c48
-rw-r--r--mysys/my_handler.c81
-rw-r--r--mysys/my_init.c11
-rw-r--r--mysys/my_new.cc4
-rw-r--r--mysys/my_open.c4
-rw-r--r--mysys/my_static.c4
-rw-r--r--mysys/my_static.h2
-rw-r--r--mysys/my_tempnam.c11
-rw-r--r--mysys/my_thr_init.c2
-rw-r--r--mysys/mysys_priv.h5
-rw-r--r--mysys/test_fn.c3
-rw-r--r--mysys/tree.c26
-rw-r--r--mytest-old.c169
-rwxr-xr-xnetware/BUILD/compile-linux-tools5
-rwxr-xr-xnetware/BUILD/compile-netware-END2
-rwxr-xr-xnetware/BUILD/mwenv8
-rwxr-xr-xnetware/BUILD/nwbootstrap10
-rw-r--r--netware/Makefile.am55
-rw-r--r--netware/isamchk.def1
-rw-r--r--netware/my_manage.c770
-rw-r--r--netware/myisamchk.def1
-rw-r--r--netware/myisamlog.def1
-rw-r--r--netware/myisampack.def1
-rw-r--r--netware/mysql_test_run.c787
-rw-r--r--netware/mysqlbinlog.def1
-rw-r--r--netware/mysqlcheck.def1
-rw-r--r--netware/mysqld_safe.c4
-rw-r--r--netware/mysqldump.def1
-rw-r--r--netware/mysqlimport.def1
-rw-r--r--pstack/bucomm.h6
-rw-r--r--pstack/budbg.h6
-rw-r--r--pstack/pstack.c3
-rw-r--r--regex/regcomp.c24
-rw-r--r--scripts/Makefile.am2
-rw-r--r--scripts/make_binary_distribution.sh4
-rw-r--r--scripts/make_win_binary_distribution.sh178
-rw-r--r--scripts/mysql_config.sh13
-rw-r--r--scripts/mysql_create_system_tables.sh2
-rw-r--r--scripts/mysql_fix_privilege_tables.sh55
-rw-r--r--scripts/mysql_fix_privilege_tables.sql65
-rw-r--r--scripts/mysql_install_db.sh4
-rw-r--r--scripts/mysql_zap.sh6
-rw-r--r--scripts/mysqlaccess.sh3
-rw-r--r--scripts/mysqlbug.sh4
-rw-r--r--scripts/mysqld_multi.sh59
-rw-r--r--scripts/mysqld_safe.sh14
-rw-r--r--scripts/mysqlhotcopy.sh5
-rw-r--r--sql-bench/crash-me.sh2
-rw-r--r--sql-bench/limits/mysql-4.0.cfg7050
-rw-r--r--sql-bench/limits/mysql.cfg318
-rw-r--r--sql-common/client.c231
-rw-r--r--sql/derror.cc4
-rw-r--r--sql/field.cc389
-rw-r--r--sql/field.h40
-rw-r--r--sql/field_conv.cc14
-rw-r--r--sql/filesort.cc67
-rw-r--r--sql/gen_lex_hash.cc1
-rw-r--r--sql/gstream.cc177
-rw-r--r--sql/gstream.h41
-rw-r--r--sql/ha_berkeley.cc86
-rw-r--r--sql/ha_berkeley.h11
-rw-r--r--sql/ha_heap.cc21
-rw-r--r--sql/ha_heap.h2
-rw-r--r--sql/ha_innodb.cc270
-rw-r--r--sql/ha_innodb.h3
-rw-r--r--sql/ha_isam.cc11
-rw-r--r--sql/ha_isam.h3
-rw-r--r--sql/ha_isammrg.cc4
-rw-r--r--sql/ha_isammrg.h2
-rw-r--r--sql/ha_myisam.cc46
-rw-r--r--sql/ha_myisam.h6
-rw-r--r--sql/ha_myisammrg.cc12
-rw-r--r--sql/ha_myisammrg.h2
-rw-r--r--sql/handler.cc160
-rw-r--r--sql/handler.h17
-rw-r--r--sql/hostname.cc3
-rw-r--r--sql/init.cc5
-rw-r--r--sql/item.cc245
-rw-r--r--sql/item.h228
-rw-r--r--sql/item_cmpfunc.cc285
-rw-r--r--sql/item_cmpfunc.h56
-rw-r--r--sql/item_create.cc17
-rw-r--r--sql/item_create.h2
-rw-r--r--sql/item_func.cc197
-rw-r--r--sql/item_func.h49
-rw-r--r--sql/item_geofunc.cc477
-rw-r--r--sql/item_geofunc.h2
-rw-r--r--sql/item_row.cc20
-rw-r--r--sql/item_strfunc.cc221
-rw-r--r--sql/item_strfunc.h63
-rw-r--r--sql/item_subselect.cc329
-rw-r--r--sql/item_subselect.h25
-rw-r--r--sql/item_sum.cc453
-rw-r--r--sql/item_sum.h145
-rw-r--r--sql/item_timefunc.cc332
-rw-r--r--sql/item_timefunc.h104
-rw-r--r--sql/item_uniq.h5
-rw-r--r--sql/key.cc4
-rw-r--r--sql/lex.h8
-rw-r--r--sql/lex_symbol.h9
-rw-r--r--sql/lock.cc59
-rw-r--r--sql/log.cc45
-rw-r--r--sql/log_event.h10
-rw-r--r--sql/mf_iocache.cc6
-rw-r--r--sql/mysql_priv.h112
-rw-r--r--sql/mysqld.cc455
-rw-r--r--sql/nt_servc.cc2
-rw-r--r--sql/opt_range.cc56
-rw-r--r--sql/protocol.cc7
-rw-r--r--sql/protocol.h5
-rw-r--r--sql/repl_failsafe.cc22
-rw-r--r--sql/set_var.h74
-rw-r--r--sql/share/charsets/Index.xml3
-rw-r--r--sql/share/czech/errmsg.txt21
-rw-r--r--sql/share/danish/errmsg.txt38
-rw-r--r--sql/share/dutch/errmsg.txt38
-rw-r--r--sql/share/english/errmsg.txt45
-rw-r--r--sql/share/estonian/errmsg.txt36
-rw-r--r--sql/share/french/errmsg.txt21
-rw-r--r--sql/share/german/errmsg.txt17
-rw-r--r--sql/share/greek/errmsg.txt21
-rw-r--r--sql/share/hungarian/errmsg.txt21
-rw-r--r--sql/share/italian/errmsg.txt23
-rw-r--r--sql/share/japanese/errmsg.txt21
-rw-r--r--sql/share/korean/errmsg.txt21
-rw-r--r--sql/share/norwegian-ny/errmsg.txt21
-rw-r--r--sql/share/norwegian/errmsg.txt21
-rw-r--r--sql/share/polish/errmsg.txt21
-rw-r--r--sql/share/portuguese/errmsg.txt19
-rw-r--r--sql/share/romanian/errmsg.txt21
-rw-r--r--sql/share/russian/errmsg.txt27
-rw-r--r--sql/share/serbian/errmsg.txt18
-rw-r--r--sql/share/slovak/errmsg.txt21
-rw-r--r--sql/share/spanish/errmsg.txt113
-rw-r--r--sql/share/swedish/errmsg.txt29
-rw-r--r--sql/share/ukrainian/errmsg.txt27
-rw-r--r--sql/slave.cc97
-rw-r--r--sql/slave.h52
-rw-r--r--sql/spatial.cc1800
-rw-r--r--sql/spatial.h494
-rw-r--r--sql/sql_acl.cc108
-rw-r--r--sql/sql_acl.h6
-rw-r--r--sql/sql_analyse.cc2
-rw-r--r--sql/sql_base.cc357
-rw-r--r--sql/sql_cache.cc77
-rw-r--r--sql/sql_cache.h1
-rw-r--r--sql/sql_class.cc56
-rw-r--r--sql/sql_class.h139
-rw-r--r--sql/sql_db.cc137
-rw-r--r--sql/sql_delete.cc7
-rw-r--r--sql/sql_derived.cc9
-rw-r--r--sql/sql_handler.cc15
-rw-r--r--sql/sql_help.cc34
-rw-r--r--sql/sql_insert.cc127
-rw-r--r--sql/sql_lex.cc86
-rw-r--r--sql/sql_lex.h11
-rw-r--r--sql/sql_list.h7
-rw-r--r--sql/sql_load.cc52
-rw-r--r--sql/sql_olap.cc4
-rw-r--r--sql/sql_parse.cc514
-rw-r--r--sql/sql_prepare.cc913
-rw-r--r--sql/sql_rename.cc73
-rw-r--r--sql/sql_repl.cc2
-rw-r--r--sql/sql_repl.h2
-rw-r--r--sql/sql_select.cc288
-rw-r--r--sql/sql_select.h2
-rw-r--r--sql/sql_show.cc276
-rw-r--r--sql/sql_string.cc79
-rw-r--r--sql/sql_string.h17
-rw-r--r--sql/sql_table.cc389
-rw-r--r--sql/sql_test.cc12
-rw-r--r--sql/sql_udf.cc19
-rw-r--r--sql/sql_union.cc78
-rw-r--r--sql/sql_update.cc70
-rw-r--r--sql/sql_yacc.yy301
-rw-r--r--sql/structs.h14
-rw-r--r--sql/table.cc49
-rw-r--r--sql/table.h25
-rw-r--r--sql/time.cc103
-rw-r--r--sql/unireg.cc13
-rw-r--r--strings/Makefile.am8
-rw-r--r--strings/atof.c207
-rw-r--r--strings/ctype-big5.c106
-rw-r--r--strings/ctype-bin.c159
-rw-r--r--strings/ctype-czech.c309
-rw-r--r--strings/ctype-euc_kr.c8
-rw-r--r--strings/ctype-extra.c1
-rw-r--r--strings/ctype-gb2312.c8
-rw-r--r--strings/ctype-gbk.c98
-rw-r--r--strings/ctype-latin1.c139
-rw-r--r--strings/ctype-mb.c25
-rw-r--r--strings/ctype-simple.c190
-rw-r--r--strings/ctype-sjis.c146
-rw-r--r--strings/ctype-tis620.c317
-rw-r--r--strings/ctype-uca.c7042
-rw-r--r--strings/ctype-ucs2.c212
-rw-r--r--strings/ctype-ujis.c37
-rw-r--r--strings/ctype-utf8.c110
-rw-r--r--strings/ctype-win1250ch.c259
-rw-r--r--strings/strto.c2
-rw-r--r--strings/strtod.c132
-rw-r--r--strings/uca-dump.c276
-rw-r--r--support-files/Makefile.am1
-rw-r--r--support-files/MySQL-shared-compat.spec.sh4
-rw-r--r--support-files/my-innodb-heavy-4G.cnf.sh8
-rw-r--r--support-files/mysql.server.sh8
-rw-r--r--support-files/mysql.spec.sh25
-rw-r--r--tests/client_test.c504
-rw-r--r--tests/grant.pl62
-rw-r--r--tests/grant.res242
-rw-r--r--tests/thread_test.c2
790 files changed, 46720 insertions, 108874 deletions
diff --git a/.bzrignore b/.bzrignore
index 2e4fafa52fd..1126bd3e42b 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -250,6 +250,7 @@ client/thimble
client/thread_test
client_test
cmd-line-utils/libedit/common.h
+cmd-line-utils/libedit/makelist
comon.h
config.cache
config.h
@@ -361,6 +362,7 @@ libmysqld/item_func.cc
libmysqld/item_geofunc.cc
libmysqld/item_row.cc
libmysqld/item_strfunc.cc
+libmysqld/item_subselect.cc
libmysqld/item_sum.cc
libmysqld/item_timefunc.cc
libmysqld/item_uniq.cc
@@ -402,6 +404,7 @@ libmysqld/sql_command
libmysqld/sql_crypt.cc
libmysqld/sql_db.cc
libmysqld/sql_delete.cc
+libmysqld/sql_derived.cc
libmysqld/sql_do.cc
libmysqld/sql_handler.cc
libmysqld/sql_help.cc
@@ -443,6 +446,7 @@ linked_libmysqldex_sources
linked_server_sources
linked_tools_sources
locked
+man/*.1
mit-pthreads/config.flags
mit-pthreads/include/bits
mit-pthreads/include/pthread/machdep.h
@@ -465,6 +469,7 @@ myisam/mi_test2
myisam/mi_test3
myisam/mi_test_all
myisam/myisam.log
+myisam/myisam_ftdump
myisam/myisamchk
myisam/myisamlog
myisam/myisampack
@@ -496,6 +501,7 @@ mysql-test/std_data/*.pem
mysql-test/var/*
mysql.kdevprj
mysql.proj
+mysql_priv.h
mysqld.S
mysqld.sym
mysys/#mf_iocache.c#
@@ -506,6 +512,7 @@ mysys/main.cc
mysys/ste5KbMa
mysys/test_charset
mysys/test_dir
+mysys/test_gethwaddr
mysys/test_io_cache
mysys/test_thr_alarm
mysys/test_thr_lock
@@ -524,6 +531,7 @@ scripts/fill_help_tables
scripts/fill_help_tables.sql
scripts/make_binary_distribution
scripts/make_sharedlib_distribution
+scripts/make_win_binary_distribution
scripts/make_win_src_distribution
scripts/msql2mysql
scripts/mysql_config
@@ -647,4 +655,3 @@ vio/test-ssl
vio/test-sslclient
vio/test-sslserver
vio/viotest-ssl
-mysql_priv.h
diff --git a/BUILD/Makefile.am b/BUILD/Makefile.am
index 9c1ab24fde7..2414d4f3a44 100644
--- a/BUILD/Makefile.am
+++ b/BUILD/Makefile.am
@@ -37,6 +37,7 @@ EXTRA_DIST = FINISH.sh \
compile-pentium-pgcc \
compile-solaris-sparc \
compile-solaris-sparc-debug \
+ compile-irix-mips64-mipspro \
compile-solaris-sparc-forte \
compile-solaris-sparc-purify
diff --git a/BUILD/compile-irix-mips64-mipspro b/BUILD/compile-irix-mips64-mipspro
new file mode 100755
index 00000000000..d8107ad73c0
--- /dev/null
+++ b/BUILD/compile-irix-mips64-mipspro
@@ -0,0 +1,84 @@
+#!/bin/sh
+
+if [ ! -f "sql/mysqld.cc" ]; then
+ echo "You must run this script from the MySQL top-level directory."
+ exit 1
+fi
+
+cflags="-64 -mips4"
+
+if [ "$#" != 0 ]; then
+ case "$1" in
+ --help)
+ echo "Usage: $0 [options]"
+ echo "Options:"
+ echo "--help print this message"
+ echo "-32 build 32-bit binary"
+ echo "-64 build 64-bit binary [default]"
+ exit 0
+ ;;
+ -64)
+ echo "Building 64-bit binary"
+ ;;
+ -32)
+ echo "Building 32-bit binary"
+ cflags=""
+ ;;
+ *)
+ echo "$0: invalid option '$1'; use --help to show usage"
+ exit 1
+ ;;
+ esac
+else
+ echo "Building 64-bit binary"
+fi
+
+set -x
+make distclean
+aclocal
+autoheader
+libtoolize --automake --force
+automake --force --add-missing
+autoconf
+
+(cd bdb/dist && sh s_all)
+(cd innobase && aclocal && autoheader && aclocal && automake && autoconf)
+
+# C options:
+# -apo - auto-parallize for multiprocessors (implies -mp)
+# -mp - generate multiprocessor code
+# These two common optimization options apparently use 'sproc' model of
+# threading, which is not compatible with PTHREADS: don't add them unless you
+# know what you're doing.
+#
+# -c99 - enable C features standardized in C99, such as long long,
+# strtoll, stroull etc.
+# This option is vital to compile MySQL.
+# -woff - turn off some warnings
+# -64 - generate 64 bit object (implies -mips4)
+# -mips4 - produce code for MIPS R10000, MIPS R12000 and further 64 bit
+# processors
+# -OPT:Olimit=0 - no limits exists to size of function for compiler to optimize
+# it
+nowarn="-woff 1064,1188,1460,1552,1681,1682,3303"
+cflags="$cflags $nowarn -O3 -c99 -OPT:Olimit=0"
+
+# C++ only options:
+# -LANG:exceptions=OFF - don't generate exception handling code
+# MySQL doesn't use exceptions.
+# -LANG:std=OFF - don't link standard C++ library, such as
+# <iostream>, <complex>, etc.
+# -LANG:libc_in_namespace_std=OFF - libstdc functions can be
+# declared in namespace 'std', when included
+# into C++ code. Switch this feature off.
+# This option is vital to compile MySQL
+
+cxxflags="$cflags -LANG:exceptions=OFF -LANG:std=OFF"
+cxxflags="$cxxflags -LANG:libc_in_namespace_std=OFF"
+
+CC=cc CXX=CC CFLAGS="$cflags" CXXFLAGS="$cxxflags" \
+./configure --prefix=/usr/local/mysql --disable-shared \
+ --with-extra-charsets=complex --enable-thread-safe-client \
+ --without-extra-tools --disable-dependency-tracking
+
+make
diff --git a/BUILD/compile-pentium-debug-max b/BUILD/compile-pentium-debug-max
index f8cf19b2132..9c3c80c3382 100755
--- a/BUILD/compile-pentium-debug-max
+++ b/BUILD/compile-pentium-debug-max
@@ -8,6 +8,6 @@ c_warnings="$c_warnings $debug_extra_warnings"
cxx_warnings="$cxx_warnings $debug_extra_warnings"
extra_configs="$pentium_configs $debug_configs"
-extra_configs="$extra_configs --with-berkeley-db --with-innodb --without-isam --with-embedded-server --with-openssl --with-raid"
+extra_configs="$extra_configs --with-berkeley-db --with-innodb --without-isam --with-embedded-server --with-openssl --with-raid --with-vio"
. "$path/FINISH.sh"
diff --git a/BUILD/compile-pentium-max b/BUILD/compile-pentium-max
index a1a256f949f..4563f5ae827 100755
--- a/BUILD/compile-pentium-max
+++ b/BUILD/compile-pentium-max
@@ -9,6 +9,6 @@ extra_configs="$pentium_configs"
extra_configs="$extra_configs --with-innodb --with-berkeley-db \
--with-embedded-server --enable-thread-safe-client \
- --with-openssl --with-vio"
+ --with-openssl --with-vio --with-raid"
. "$path/FINISH.sh"
diff --git a/BitKeeper/etc/config b/BitKeeper/etc/config
index ea30f368b52..c609fcdbd49 100644
--- a/BitKeeper/etc/config
+++ b/BitKeeper/etc/config
@@ -71,3 +71,4 @@ hours:
[arjen:]checkout:get
[nick:]checkout:get
checkout:edit
+eoln:unix
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok
index b8607af3b3c..6c00b91b13f 100644
--- a/BitKeeper/etc/logging_ok
+++ b/BitKeeper/etc/logging_ok
@@ -2,6 +2,7 @@ Administrador@light.
Administrator@co3064164-a.
Administrator@co3064164-a.rochd1.qld.optushome.com.au
Administrator@fred.
+Greg@greg-laptop.
Miguel@light.local
Sinisa@sinisa.nasamreza.org
WAX@sergbook.mysql.com
@@ -10,6 +11,7 @@ administrador@light.hegel.local
ahlentz@co3064164-a.rochd1.qld.optusnet.com.au
akishkin@work.mysql.com
antony@ltantony.rdg.cyberkinetica.homeunix.net
+arjen@bitbike.com
arjen@co3064164-a.bitbike.com
arjen@fred.bitbike.com
arjen@george.bitbike.com
@@ -26,6 +28,7 @@ carsten@tsort.bitbybit.dk
davida@isil.mysql.com
dlenev@brandersnatch.localdomain
dlenev@build.mysql.com
+dlenev@jabberwock.localdomain
dlenev@mysql.com
gerberb@ou800.zenez.com
gluh@gluh.(none)
@@ -36,6 +39,7 @@ guilhem@mysql.com
gweir@build.mysql.com
gweir@work.mysql.com
harrison@mysql.com
+harry@corona.lordblink.com
heikki@donna.mysql.fi
heikki@hundin.mysql.fi
heikki@rescue.
@@ -47,6 +51,8 @@ hf@deer.mysql.r18.ru
hf@genie.(none)
igor@hundin.mysql.fi
igor@rurik.mysql.com
+ingo@mysql.com
+jani@a80-186-24-72.elisa-laajakaista.fi
jani@dsl-jkl1657.dial.inet.fi
jani@dsl-kpogw4gb5.dial.inet.fi
jani@hynda.(none)
@@ -58,8 +64,10 @@ jani@rhols221.arenanet.fi
jani@ua126d19.elisa.omakaista.fi
jani@ua141d10.elisa.omakaista.fi
jani@ua167d18.elisa.omakaista.fi
+jani@ua72d24.elisa.omakaista.fi
jcole@abel.spaceapes.com
jcole@main.burghcom.com
+jcole@mugatu.jcole.us
jcole@mugatu.spaceapes.com
jcole@sarvik.tfr.cafe.ee
jcole@tetra.spaceapes.com
@@ -69,6 +77,7 @@ konstantin@mysql.com
kostja@oak.local
lenz@kallisto.mysql.com
lenz@mysql.com
+marko@hundin.mysql.fi
miguel@hegel.(none)
miguel@hegel.br
miguel@hegel.local
@@ -94,6 +103,7 @@ monty@work.mysql.com
mwagner@cash.mwagner.org
mwagner@evoq.mwagner.org
mwagner@work.mysql.com
+mydev@mysql.com
mysql@home.(none)
mysqldev@build.mysql2.com
nick@mysql.com
@@ -123,8 +133,10 @@ root@x3.internalnet
salle@banica.(none)
salle@geopard.(none)
salle@geopard.online.bg
+salle@vafla.home
salle@vafla.online.bg
sasha@mysql.sashanet.com
+serg@build.mysql.com
serg@build.mysql2.com
serg@serg.mylan
serg@serg.mysql.com
@@ -146,6 +158,7 @@ tonu@hundin.mysql.fi
tonu@volk.internalnet
tonu@x153.internalnet
tonu@x3.internalnet
+ulli@morbus.(none)
venu@hundin.mysql.fi
venu@myvenu.com
venu@work.mysql.com
diff --git a/BitKeeper/triggers/post-commit b/BitKeeper/triggers/post-commit
index 873c9665faf..47afc77118a 100755
--- a/BitKeeper/triggers/post-commit
+++ b/BitKeeper/triggers/post-commit
@@ -1,12 +1,11 @@
#!/bin/sh
#shift
-TO=dev-public@mysql.com
FROM=$USER@mysql.com
INTERNALS=internals@lists.mysql.com
DOCS=docs-commit@mysql.com
LIMIT=10000
-REPOV=5.0
+VERSION="5.0"
if [ "$REAL_EMAIL" = "" ]
then
@@ -21,17 +20,24 @@ if [ "$BK_STATUS" = OK ]
then
CHANGESET=`bk -R prs -r+ -h -d':P:::I:' ChangeSet`
+BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/ BUG#\1/p'`
+if [ "$BUG" = "" ]
+then
+ TO=dev-public@mysql.com
+else
+ TO=dev-bugs@mysql.com
+fi
#++
-# dev-public@
+# dev-public@ / dev-bugs@
#--
echo "Commit successful, notifying developers at $TO"
(
cat <<EOF
-List-ID: <bk.mysql-$REPOV>
+List-ID: <bk.mysql-$VERSION>
From: $FROM
To: $TO
-Subject: bk commit - $REPOV tree ($CHANGESET)
+Subject: bk commit - $VERSION tree ($CHANGESET)$BUG
EOF
bk changes -v -r+
@@ -44,13 +50,13 @@ EOF
echo "Notifying internals list at $INTERNALS"
(
cat <<EOF
-List-ID: <bk.mysql-$REPOV>
+List-ID: <bk.mysql-$VERSION>
From: $FROM
To: $INTERNALS
-Subject: bk commit into $REPOV tree ($CHANGESET)
+Subject: bk commit into $VERSION tree ($CHANGESET)
Below is the list of changes that have just been committed into a local
-$REPOV repository of $USER. When $USER does a push these changes will
+$VERSION repository of $USER. When $USER does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
@@ -71,10 +77,10 @@ EOF
echo "Notifying docs list at $DOCS"
(
cat <<EOF
-List-ID: <bk.mysql-$REPOV>
+List-ID: <bk.mysql-$VERSION>
From: $FROM
To: $DOCS
-Subject: bk commit - $REPOV tree (Manual) ($CHANGESET)
+Subject: bk commit - $VERSION tree (Manual) ($CHANGESET)
EOF
bk changes -v -r+
diff --git a/BitKeeper/triggers/pre-delta b/BitKeeper/triggers/pre-delta
new file mode 100755
index 00000000000..e22ae9ce940
--- /dev/null
+++ b/BitKeeper/triggers/pre-delta
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+if [ `tail -c1 $BK_FILE` ]
+then
+ echo "File $BK_FILE does not end with a new-line character!"
+ echo ""
+ echo "Checkin FAILED!"
+ echo "Fix the problem and retry."
+ exit 1
+fi
+
diff --git a/Build-tools/Bootstrap b/Build-tools/Bootstrap
index 930d053b113..a46d83ca91c 100755
--- a/Build-tools/Bootstrap
+++ b/Build-tools/Bootstrap
@@ -257,7 +257,7 @@ if (defined $opt_changelog)
$msg= "Adding $target_dir/ChangeLog";
$msg.= " (down to revision $opt_changelog)" if $opt_changelog ne "";
&logger($msg);
- $command= "bk changes -v";
+ $command= "bk changes -mv";
$command.= " -r" if ($opt_changelog ne "" || $opt_revision);
$command.= $opt_changelog if $opt_changelog ne "";
$command.= ".." if ($opt_changelog ne "" && !$opt_revision);
diff --git a/Build-tools/Do-compile b/Build-tools/Do-compile
index 2039c2f1c5a..021100b038c 100755
--- a/Build-tools/Do-compile
+++ b/Build-tools/Do-compile
@@ -282,7 +282,7 @@ if ($opt_stage <= 3)
{
my $flags= "";
log_timestamp();
- log_system("rm -fr mysql-3* mysql-4* $pwd/$host/*.tar.gz");
+ log_system("rm -fr mysql-{3,4,5}* $pwd/$host/mysql*.t*gz");
# No need to add the debug symbols, if the binaries are not stripped (saves space)
unless ($opt_with_debug || $opt_no_strip)
{
@@ -291,7 +291,7 @@ if ($opt_stage <= 3)
$flags.= "--no-strip" if ($opt_no_strip || $opt_with_debug);
check_system("scripts/make_binary_distribution --tmp=$opt_tmp --suffix=$opt_suffix $flags",".tar.gz created");
- safe_system("mv mysql*.tar.gz $pwd/$host");
+ safe_system("mv mysql*.t*gz $pwd/$host");
if (-f "client/.libs/mysqladmin")
{
safe_system("cp client/.libs/mysqladmin $pwd/$host/bin");
@@ -303,11 +303,8 @@ if ($opt_stage <= 3)
safe_system("$make clean") if ($opt_with_small_disk);
}
-$tar_file=<$pwd/$host/*.tar.gz>;
-if (!defined($tar_file))
-{
- $tar_file=<$pwd/$host/*.tgz>;
-}
+$tar_file=<$pwd/$host/mysql*.t*gz>;
+abort ("Could not find tarball!") unless ($tar_file);
#
# Unpack the binary distribution
@@ -320,7 +317,7 @@ if ($opt_stage <= 4 && !$opt_no_test)
safe_system("gunzip < $tar_file | $tar xf -");
}
-$tar_file =~ /(mysql[^\/]*)\.tar/;
+$tar_file =~ /(mysql[^\/]*)\.(tar\.gz|tgz)/;
$ver=$1;
$test_dir="$pwd/$host/test/$ver";
$ENV{"LD_LIBRARY_PATH"}= ("$test_dir/lib" .
diff --git a/Build-tools/Do-pkg b/Build-tools/Do-pkg
index 4d0f120c6e3..2fd1946ed0e 100755
--- a/Build-tools/Do-pkg
+++ b/Build-tools/Do-pkg
@@ -61,6 +61,12 @@ else
}
$PM= "/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker";
+# Try another location on 10.3.3
+unless (-e "$PM")
+{
+ $PM= "/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker";
+}
+
$TMP= $ENV{TMPDIR};
$TMP eq "" ? $TMP= $TMP . "/PKGBUILD.$$": $TMP= "/tmp/PKGBUILD.$$";
$PKGROOT= "$TMP/PMROOT";
@@ -79,6 +85,9 @@ $BUILDDIR= "$PWD/$HOST";
$SRCBASEDIR= <$BUILDDIR/mysql*-$VERSION>;
$SUPFILEDIR= <$SRCBASEDIR/support-files/MacOSX>;
$TAR= <$BUILDDIR/$NAME-apple-darwin*-powerpc.tar.gz>;
+$TAR =~ /.*\/$NAME(.*)\.tar\.gz$/;
+$ARCH= $1;
+$NAME= $NAME . $ARCH;
$INFO= <$SUPFILEDIR/Info.plist>;
$DESC= <$SUPFILEDIR/Description.plist>;
$SI_INFO= <$SUPFILEDIR/StartupItem.Info.plist>;
@@ -167,7 +176,7 @@ unless (-f "$RESOURCE_DIR/License.txt");
&logger("Extracting $TAR to $PKGROOT");
&run_command("gnutar zxf $TAR -C $PKGROOT", "Unable to extract $TAR!");
&run_command("cd $PKGROOT ; ln -s mysql* ./mysql", "Unable to create symlink!");
-&run_command("chown -R root.wheel $PKGROOT/*", "Cannot chown $PKGROOT!");
+&run_command("chown -R root:wheel $PKGROOT/*", "Cannot chown $PKGROOT!");
# Now build the PGK using PackageMaker
# The "|| true" is a nasty hack to work around a problem with Package Maker
@@ -196,7 +205,7 @@ unless ($opt_skip_si)
copy("$SI_PARAMS", "$PKGROOT/MySQL/")
or &abort("Error copying $SI_PARAMS!");
chmod(0644, "$PKGROOT/MySQL/" . basename("$SI_PARAMS"));
- &run_command("chown -R root.wheel $PKGROOT/*", "Cannot chown $PKGROOT!");
+ &run_command("chown -R root:wheel $PKGROOT/*", "Cannot chown $PKGROOT!");
copy("$SI_POST", "$RESOURCE_DIR/postinstall")
or &abort("Error copying $SI_POST!");
chmod(0644, "$RESOURCE_DIR/postinstall");
diff --git a/Build-tools/Do-rpm b/Build-tools/Do-rpm
index a216a3ba5dc..7da8b022031 100755
--- a/Build-tools/Do-rpm
+++ b/Build-tools/Do-rpm
@@ -115,10 +115,12 @@ if (defined $opt_log)
if (-x "/usr/bin/rpmbuild")
{
$RPM= "/usr/bin/rpmbuild";
+ $RMSOURCE= "--rmsource --rmspec";
}
else
{
$RPM= "/bin/rpm";
+ $RMSOURCE= "--rmspec";
}
if ($RPM)
@@ -177,7 +179,7 @@ $ENV{MYSQL_BUILD_CXX}=$opt_cxx if ($opt_cxx);
$command= "$RPM";
$command.= " -v" if ($opt_verbose);
$command.= " -ba";
-$command.= " --clean" if $opt_clean;
+$command.= " --clean $RMSOURCE" if $opt_clean;
$command.= " $SPECDIR/";
$command.= basename($SPECFILE);
&logger("Building RPM.");
@@ -188,7 +190,7 @@ $command.= basename($SPECFILE);
#
$command= "mv";
$command.= " -v " if ($opt_verbose);
-$command.= "$SRCRPMDIR/MySQL*$VERSION*.src.rpm $PWD";
+$command.= " $SRCRPMDIR/MySQL*$VERSION*.src.rpm $PWD";
&logger("Moving source RPM to current dir.");
&run_command($command, "Error moving source RPM!");
@@ -198,19 +200,6 @@ $command.= " $RPMDIR/$RPMARCH/MySQL*$VERSION*.$RPMARCH.rpm $PWD";
&logger("Moving binary RPMs to current dir.");
&run_command($command, "Error moving binary RPMs!");
-#
-# Clean up
-#
-if ($opt_clean)
-{
- &logger("Removing spec file and source package");
- unless ($opt_dry_run)
- {
- unlink("$SPECDIR/" . basename($SPECFILE));
- unlink("$SOURCEDIR/$SOURCEFILE");
- }
-}
-
&logger("SUCCESS: RPM files successfully created.") unless ($opt_dry_run);
exit 0;
diff --git a/Build-tools/Do-win-build b/Build-tools/Do-win-build
new file mode 100755
index 00000000000..a78b091a737
--- /dev/null
+++ b/Build-tools/Do-win-build
@@ -0,0 +1,124 @@
+#!/usr/bin/perl -w
+
+use Getopt::Long;
+
+$opt_help=0;
+$opt_tarball=$opt_builddir=$opt_suffix="";
+
+GetOptions(
+ "help",
+ "tarball=s",
+ "builddir=s",
+ "suffix=s"
+) || print_help();
+
+print_help() if ($opt_help);
+
+chomp($MSDEV=`which msdev`);
+
+if (!$opt_builddir) {
+ $opt_builddir = "/cygdrive/c/mysql-win-build";
+}
+
+$opt_tarball =~ /(mysql[^\/]*)-win-src\.tar/;
+$mysqlver=$1;
+$basedir = "$opt_builddir/$mysqlver";
+$scriptdir = `pwd`;
+
+# Make sure build dir exists
+mkdir($opt_builddir);
+# Clean out any previous build
+system("rm -rf $basedir");
+
+# Unpack in the script directory
+system("tar -zxvf $opt_tarball");
+# Move to the build directory
+system("mv $mysqlver $opt_builddir");
+
+if (!chdir($basedir))
+{
+ print "Do-win-build error: Could not change to $basedir";
+ exit 1;
+}
+
+# Check whether this is a classic edition build
+if ($opt_suffix =~ /-classic/)
+{
+ # Blank out ha_innodb.cpp
+ chmod 0644, 'sql/ha_innodb.cpp';
+ open(OUT, '>', 'sql/ha_innodb.cpp');
+ close(OUT);
+
+ # Remove HAVE_INNOBASE_DB from the requisite project files
+ for $dspfile ('libmysqld/libmysqld.dsp', 'mysqldemb/mysqldemb.dsp', 'mysqlserver/mysqlserver.dsp', 'sql/mysqld.dsp', 'sql/mysqldmax.dsp')
+ {
+ open(IN, '<', $dspfile);
+ open(OUT, '>', "$dspfile.tmp");
+ while (readline IN)
+ {
+ s/\D \"HAVE_INNOBASE_DB\" //g;
+ print OUT $_;
+ }
+ close(IN);
+ close(OUT);
+ unlink $dspfile;
+ rename "$dspfile.tmp", $dspfile;
+ }
+}
+
+# Perform compilation
+system("\"$MSDEV\" mysql.dsw /MAKE \"ALL\" /OUT $mysqlver-build.log");
+
+# Package binary
+system("./scripts/make_win_binary_distribution --suffix=$opt_suffix");
+
+# Copy log back to script directory
+system("cp $mysqlver$suffix-build.log $scriptdir");
+
+# Move binary package to script directory
+system("mv *.zip $scriptdir");
+
+#
+# Print a help text message
+#
+sub print_help
+{
+ print <<EOF;
+Usage: Do-compile-win [options] source-tarball
+
+Unpacks a Windows source distribution on the local machine and
+compiles it using VC++ 6.0.
+
+This script is intended for Cygwin Perl. You must have a working
+MSDEV.EXE in your path for compilation, as well as the following:
+
+sed
+tar (GNU tar)
+which
+
+
+Options:
+
+--help
+Print this text.
+
+--builddir=<dir>
+Set the Cygwin path to build under; the tarball will actually
+be moved to <builddir>/mysql-<version>/tarball and extracted under
+<builddir>/mysql-<version>/build.
+Default: /cygdrive/c/mysql-win-build
+
+--suffix=<suffix>
+If specified, the resulting binary will have the specified suffix
+in its name. If the suffix is "-classic", the project files will
+be stripped of all occurrences of HAVE_INNOBASE_DB and
+ha_innodb.cpp will be blanked out, to create classic edition
+server binaries.
+
+--tarball=<file>
+Windows source tarball to use for this build. Must be of the form
+mysql[com]-x.x.x-win-src.tar.gz (REQUIRED)
+
+EOF
+ exit 1;
+}
diff --git a/Build-tools/mysql-copyright b/Build-tools/mysql-copyright
index a798ee7ab65..004476ff92c 100755
--- a/Build-tools/mysql-copyright
+++ b/Build-tools/mysql-copyright
@@ -101,8 +101,12 @@ sub main
unlink("$destdir/PUBLIC", "$destdir/README");
copy("$WD/Docs/MySQLEULA.txt", "$destdir");
- # remove readline subdir
- `rm -rf $destdir/cmd-line-utils/readline`;
+ # 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)`;
# fix file copyrights
&fix_usage_copyright();
diff --git a/Docs/README.1st b/Docs/README.1st
index 980c043224a..980c043224a 100755..100644
--- a/Docs/README.1st
+++ b/Docs/README.1st
diff --git a/Docs/manual.ja.texi b/Docs/manual.ja.texi
deleted file mode 100644
index 2a0b0fbf34b..00000000000
--- a/Docs/manual.ja.texi
+++ /dev/null
@@ -1,38699 +0,0 @@
-\input texinfo @c -*-texinfo-*-
-@c Copyright 1997, 1998, 1999, 2000 TcX AB, Detron HB and MySQL Finland AB
-@c
-@c *********************************************************
-@c Note that @node names are used on our Website.
-@c So do not change node names without checking
-@c Makefile.am and SitePages first.
-@c *********************************************************
-@c
-@c %**start of header
-@setfilename mysql.info
-@c We want the types in the same index
-@syncodeindex tp fn
-@c Get version info. This file is generated by the Makefile!!
-@include include.texi
-@ifclear tex-debug
-@c This removes the black squares in the right margin
-@finalout
-@end ifclear
-@c Set background for HTML
-@set _body_tags BGCOLOR=#FFFFFF TEXT=#000000 LINK=#101090 VLINK=#7030B0
-@c @set _body_tags BGCOLOR=silver TEXT=#000000 LINK=#101090 VLINK=#7030B0
-@c Set some style elements for the manual in HTML form. 'suggested'
-@c natural language colours: aqua, black, blue, fuchsia, gray, green,
-@c lime, maroon, navy, olive, purple, red, silver, teal, white, and
-@c yellow. From Steeve Buehler <ahr@YogElements.com>
-@set _extra_head <style> code {color:purple} tt {color:green} samp {color:navy} pre {color:maroon} </style>
-@settitle @strong{MySQL} Reference Manual for version @value{mysql_version}.
-@c We want single-sided heading format, with chapters on new pages. To
-@c get double-sided format change 'on' below to 'odd'
-@setchapternewpage on
-@paragraphindent 0
-@c %**end of header
-
-@ifinfo
-@format
-START-INFO-DIR-ENTRY
-* mysql: (mysql). @strong{MySQL} documentation.
-END-INFO-DIR-ENTRY
-@end format
-@end ifinfo
-
-@titlepage
-@sp 10
-@center @titlefont{@strong{MySQL} Reference Manual}
-@sp 10
-@center Copyright @copyright{} 1997, 1998, 1999, 2000 TcX AB, Detron HB and MySQL Finland AB
-@end titlepage
-
-@c This should be added. The HTML conversion also needs a MySQL version
-@c number somewhere.
-
-@iftex
-@c change this to double if you want formatting for double-sided
-@c printing
-@headings single
-@everyheading @thispage @| @| @thischapter
-@everyfooting @| @| Version: @value{mysql_version} Printed: @today{}
-@end iftex
-
-@node Top, Introduction, (dir), (dir)
-
-@c @ifhtml
-@c <IMG SRC="Images/mysql-logo.gif">
-@c <!--Image doesn't exist. Can't find suitable replacement. (Matt) -->
-@c @end ifhtml
-
-@ifinfo
-This is a manual for @strong{MySQL}. This version is about the
-@value{mysql_version} version of @strong{MySQL}. For a @strong{3.20}
-version see the relevant distribution.
-@end ifinfo
-
-@menu
-* Introduction:: General Information about @strong{MySQL}
-* Questions:: @strong{MySQL} mailing lists and how to ask questions or report errors (bugs)
-* Licensing and Support:: @strong{MySQL} licensing and support
-* Installing:: Installing @strong{MySQL}
-* Compatibility:: How standards-compatible is @strong{MySQL}?
-* Privilege system:: The @strong{MySQL} access privilege system
-* Reference:: @strong{MySQL} language reference
-* Table types:: @strong{MySQL} table types
-* Tutorial:: @strong{MySQL} Tutorial
-* Server:: @strong{MySQL} Server
-* Replication:: Replication
-* Performance:: Getting maximum performance from @strong{MySQL}
-* MySQL Benchmarks:: The @strong{MySQL} benchmark suite
-* Tools:: @strong{MySQL} Utilities
-* Maintenance:: Maintaining a @strong{MySQL} installation
-* Adding functions:: Adding new functions to @strong{MySQL}
-* Adding procedures:: Adding new procedures to @strong{MySQL}
-* ODBC:: @strong{MySQL} ODBC Support
-* Common programs:: Using @strong{MySQL} with some common programs
-* Problems:: Problems
-* Common problems:: Solving some common problems with @strong{MySQL}
-* Clients:: @strong{MySQL} client tools and APIs
-* Comparisons:: How does @strong{MySQL} compare with other databases?
-* MySQL internals:: @strong{MySQL} internals
-* Environment variables:: @strong{MySQL} environment variables
-* Users:: Some @strong{MySQL} users
-* Contrib:: Contributed programs
-* Credits:: Contributors to @strong{MySQL}
-* News:: @strong{MySQL} change history
-* Bugs:: Known errors and design deficiencies in @strong{MySQL}
-* TODO:: List of things we want to add to @strong{MySQL} in the future (The TODO)
-* Porting:: Comments on porting to other systems
-* Regexp:: Description of @strong{MySQL} regular expression syntax
-* Unireg:: What is Unireg?
-* Public license:: The @strong{MySQL} server license
-* Win license:: The @strong{MySQL} license for Microsoft operating systems
-* Function Index:: SQL command, type and function index
-* Concept Index:: Concept Index
-
-@end menu
-
-@cindex Overview
-@cindex General Information
-@node Introduction, Questions, Top, Top
-@chapter @strong{MySQL} ¤Ë¤Ä¤¤¤Æ¤Î°ìÈ̾ðÊó
-
-@menu
-* What-is:: @strong{MySQL} ¤È¤Ï²¿¤«¡©
-* Manual-info:: ¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Ë¤Ä¤¤¤Æ
-* History:: @strong{MySQL} ¤ÎÎò»Ë
-* MySQL-Books:: Books about MySQL
-* Features:: @strong{MySQL}¤Î¼ç¤Êµ¡Ç½
-* Stability:: @strong{MySQL} ¤Ï¤É¤ì¤¯¤é¤¤°ÂÄ꤫¡©
-* Year 2000 compliance:: 2000 ǯÂбþ
-* General-SQL:: °ìÈÌŪ¤Ê SQL ¾ðÊó¤È¥Á¥å¡¼¥È¥ê¥¢¥ë
-* Useful Links:: ÊØÍø¤Ê @strong{MySQL} ´ØÏ¢¥ê¥ó¥¯
-@end menu
-
-¤³¤ì¤Ï @strong{MySQL} ¤Î¥ê¥Õ¥¡¥ì¥ó¥¹¥Þ¥Ë¥å¥¢¥ë¤Ç¤¹; ¤³¤ì¤Ï
-@strong{MySQL} ¥Ð¡¼¥¸¥ç¥ó @value{mysql_version} ¤Ë¤Ä¤¤¤Æµ­½Ò¤·¤Æ¤¤¤Þ¤¹¡£
-
-@strong{MySQL} ¤ÏȯŸÃæ¤Ê¤Î¤Ç¡¢¥Þ¥Ë¥å¥¢¥ë¤ÏÉÑÈˤ˹¹¿·¤µ¤ì¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢
-¥ª¥ó¥é¥¤¥ó¤Ç»²¾È¤·¤Ê¤¤¸Â¤ê¡¢¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤¬´ü¸ÂÀÚ¤ì¤Ç¤¢¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£
-¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤ÎºÇ¿·¥Ð¡¼¥¸¥ç¥ó¤Ï @uref{http://www.mysql.com/doc.html} ¤Ë¿
-ÍͤʷÁ¼°¤ÇÃÖ¤¤¤Æ¤¢¤ê¤Þ¤¹¡£¥Þ¥Ë¥å¥¢¥ëÆâ¤Î¾ðÊó¤ò¸«¤Ä¤±¤ë¤Ä¤é¤¤»þ´Ö¤ò»ý¤Ä¤Ê¤é¡¢
-¸¡º÷²Äǽ PHP ¥Ð¡¼¥¸¥ç¥ó @uref{http://www.mysql.com/php/manual.php3} ¤ò»î¤¹
-¤³¤È¤¬²Äǽ¤Ç¤¹¡£
-
-@strong{MySQL} ¤Ï¤È¤Æ¤â¹â®¤Ç¡¢¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¡¢¥Þ¥ë¥Á¥æ¡¼¥¶¡¢´è¾æ¤Ê SQL
-(Structured Query Language)¥Ç¡¼¥¿¥Ù¡¼¥¹¥µ¡¼¥Ð¤Ç¤¹¡£
-
-Unix ¤È OS/2 ¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç¤Ï @strong{MySQL} ¤Ï´ðËÜŪ¤Ë̵½þ¤Ç¤¢¤ê¡¢Microsoft
-¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç¤Ï¡¢30Æü¤Î»îÍÑ´ü´Ö¤ò²á¤®¤Æ»ÈÍѤ¹¤ë¾ì¹ç¤Ë @strong{MySQL} ¥é¥¤¥»¥ó¥¹¤ò
-Çã¤ï¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó. @xref{Licensing and Support}.
-
-@uref{http://www.mysql.com/, @strong{MySQL} ¥Û¡¼¥à¥Ú¡¼¥¸}¤Ï @strong{MySQL}
-¤Ë¤Ä¤¤¤Æ¤ÎºÇ¿·¾ðÊó¤òÄ󶡤·¤Æ¤¤¤Þ¤¹¡£
-
-¼¡¤Î¥ê¥¹¥È¤Ï¥Þ¥Ë¥å¥¢¥ë¤Î¤¤¤¯¤Ä¤«¤ÎÍ­ÍѤʥ»¥¯¥·¥ç¥ó¤òÀâÌÀ¤·¤Æ¤¤¤Þ¤¹:
-
-@itemize @bullet
-@item
-@strong{MySQL} ¤ÎǽÎϤÎÀâÌÀ¤Ë¤Ä¤¤¤Æ¤Ï¡¢@ref{Features} ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-¥¤¥ó¥¹¥È¡¼¥ëÊýË¡¤Ë¤Ä¤¤¤Æ¤Ï @ref{Installing} ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-@strong{MySQL} ¤ò¿·¤·¤¤¥Þ¥·¥ó¤ä OS ¤Ë°Ü¹Ô¤¹¤ë¤¿¤á¤Î¥Ò¥ó¥È¤Ë¤Ä¤¤¤Æ¤Ï
-@ref{Porting} ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-3.21 ¥ê¥ê¡¼¥¹¤«¤é¤Î¥¢¥Ã¥×¥°¥ì¡¼¥É¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï¡¢
-@ref{Upgrading-from-3.21} ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-@strong{MySQL} ƳÆþ¤Î¥Á¥å¡¼¥È¥ê¥¢¥ë¤Ë¤Ä¤¤¤Æ¤Ï¡¢@ref{Tutorial} ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-SQL ¤ÎÎã¤È¥Ù¥ó¥Á¥Þ¡¼¥¯¾ðÊó¤Ë¤Ä¤¤¤Æ¤Ï¥Ù¥ó¥Á¥Þ¡¼¥­¥ó¥°¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò»²¾È
-¤·¤Æ¤¯¤À¤µ¤¤¡£(@file{sql-bench} ¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¹)
-
-@item
-¿·¤·¤¤µ¡Ç½¤È¥Ð¥°½¤Àµ¤ÎÍúÎò¤Ë¤Ä¤¤¤Æ¤Ï @ref{News} ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-¸½ºßÃΤé¤ì¤Æ¤¤¤ë¥Ð¥°¤È̵¤¤µ¡Ç½¤Î°ìÍ÷¤Ë¤Ä¤¤¤Æ¤Ï @ref{Bugs} ¤ò»²¾È¤·¤Æ¤¯¤À
-¤µ¤¤¡£
-
-@item
-¾­Íè¤Î·×²è¤Ë¤Ä¤¤¤Æ¤Ï @ref{TODO} ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-¤³¤Î¥×¥í¥¸¥§¥¯¥È¤Ø¤ÎÁ´¤Æ¤Î¹×¸¥¼Ô¤Î¥ê¥¹¥È¤Ë¤Ä¤¤¤Æ¤Ï @ref{Credits} ¤ò»²¾È¤·¤Æ¤¯¤À
-¤µ¤¤¡£
-@end itemize
-
-@strong{½ÅÍ×:}
-
-@c if the @email is at the beginning of a line the texi2html fails
-¥¨¥é¡¼(¥Ð¥°)¥ì¥Ý¡¼¥È¡¢¼ÁÌä¡¢¥³¥á¥ó¥È¤Ï
-¥á¡¼¥ê¥ó¥°¥ê¥¹¥È @email{mysql@@lists.mysql.com} ¤ËÁ÷¤Ã¤Æ¤¯¤À¤µ¤¤¡£@xref{Bug reports}¡£
-¥Ð¥°¥ì¥Ý¡¼¥È¤òÀ¸À®¤¹¤ë¤¿¤á¤Ë¤Ï @code{mysqlbug} ¥¹¥¯¥ê¥×¥È¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£
-@c FIX! RPMs are also binary
-¥½¡¼¥¹¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ç¤Ï¡¢@code{mysqlbug} ¥¹¥¯¥ê¥×¥È¤Ï @file{scripts} ¥Ç¥£¥ì¥¯¥È¥ê
-¤Ë¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¥Ð¥¤¥Ê¥ê¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ç¤Ï¡¢@code{mysqlbug} ¤Ï
-@file{bin} ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@c FIX! Remeber to create the alias!
-¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Ø¤ÎÄɲäޤ¿¤Ï½¤Àµ¤Ë´ØÏ¢¤¹¤ëÄó°Æ¤¬¤¢¤ë¾ì¹ç¤Ï¡¢¤½¤ì¤é¤ò
-@strong{MySQL} ¥Þ¥Ë¥å¥¢¥ë¥Á¡¼¥à (@email{docs@@mysql.com})¤Ë
-Á÷¤Ã¤Æ¤¯¤À¤µ¤¤¡£
-
-@cindex @strong{MySQL}, what it is
-@node What-is, Manual-info, Introduction, Introduction
-@section @strong{MySQL} ¤È¤Ï²¿¤«¡©
-
-@strong{MySQL} ¤ÏËÜÅö¤Ë¥Þ¥ë¥Á¥æ¡¼¥¶¡¢¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Î SQL
-¥Ç¡¼¥¿¥Ù¡¼¥¹¥µ¡¼¥Ð¤Ç¤¹¡£SQL ¤ÏÀ¤³¦¤Ç¤â¤Ã¤È¤â¥Ý¥Ô¥å¥é¡¼¤Ê
-¥Ç¡¼¥¿¥Ù¡¼¥¹¸À¸ì¤Ç¤¹¡£@strong{MySQL} ¤Ï¡¢¥µ¡¼¥Ð¥Ç¡¼¥â¥ó @code{mysqld} ¤È
-¿¤¯¤Î¼ïÎà¤Î¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤È¥é¥¤¥Ö¥é¥ê¤«¤é¤Ê¤ë¥¯¥é¥¤¥¢¥ó¥È/¥µ¡¼
-¥Ð¼ÂÁõ¤Ç¤¹¡£
-
-SQL¤Ï¡¢¾ðÊó¤òÊݸ¤·¡¢¹¹¿·¤·¡¢¤½¤·¤Æ¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤ò´Êñ¤Ë¤¹¤ë¤¿¤á¤Ëɸ½à²½¤µ¤ì¤¿¸À¸ì¤Ç¤¹¡£
-Î㤨¤Ð¡¢¤¢¤Ê¤¿¤Ï¡¢¾¦ÉÊ°ÆÆâ¤ò¸¡º÷¤¹¤ë¤¿¤á¤ËSQL¤ò»È¤Ã¤Æ¡¢
-¥¦¥§¥Ö¥µ¥¤¥È¤Ë´Ø¤¹¤ë¥«¥¹¥¿¥Þ¡¼¾ðÊó¤òÃßÀѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@strong{MySQL} ¤Ï¡¢¥í¥°¤ä¼Ì¿¿¤òÊݸ¤µ¤»¤ë¤Ë¤â¡¢½½Ê¬¤Ë¤Ï¤ä¤¯¡¢¥Õ¥ì¥­¥·¥Ö¥ë¤Ç¤¹¡£
-
-@strong{MySQL} ¤Î¼ç¤ÊÌÜŪ¤Ï¹â®¤Ç´è¾æ¤Ç´Êñ¤Ë»ÈÍѤǤ­¤ë¤³¤È¤Ç¤¹¡£
-@strong{MySQL} ¤ÏÆȼ«¤Ë³«È¯¤µ¤ì¤Þ¤·¤¿¡£²æ¡¹¤Ï¡¢¤È¤Æ¤âÂ礭¤Ê¥Ç¡¼¥¿
-¥Ù¡¼¥¹¤ò¡¢Â¾¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ù¥ó¥À¤¬²æ¡¹¤ËÄ󶡤¹¤ë¤â¤Î¤è¤ê¤â®¤¯¡¢½ÅÍ×ÅÙ¤Î
-½ç¤Ë½èÍý¤Ç¤­¤ë SQL ¥µ¡¼¥Ð¤òɬÍפȤ·¤Æ¤¤¤¿¤«¤é¤Ç¤¹¡£²æ¡¹¤Ï¡¢10,000 ¥Æ¡¼
-¥Ö¥ë¤ò´Þ¤à 40 °Ê¾å¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î´Ä¶­¤Ç 1996 ǯ¤«¤é @strong{MySQL} ¤ò»È
-ÍѤ·¤Æ¤¤¤Þ¤¹¡£¤½¤Î¥Æ¡¼¥Ö¥ë¤Î 500 ¥Æ¡¼¥Ö¥ë°Ê¾å¤Ï 700Ëü°Ê¾å¤Î¥ì¥³¡¼¥É¤ò»ý¤Á¤Þ¤¹¡£
-¤³¤ì¤ÏÌó100¥®¥¬¥Ð¥¤¥È¤Î¡¢´ð´´¶È̳¤Î¥Ç¡¼¥¿¤Ç¤¹¡£
-
-@strong{MySQL} ¤¬ºîÀ®¤µ¤ì¤ë¾å¤Ç¤Î´ðËܤϡ¢²¿Ç¯¤â¤Î´Ö¡¢À½ÉʴĶ­¤Î¹â¤¤Í×µá
-¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤¿¥ë¡¼¥Á¥ó¤Î¥»¥Ã¥È¤Ç¤¹¡£@strong{MySQL} ¤Ï¤Þ¤À³«È¯Ãæ¤Ç¤¹¤¬¡¢
-Ë­É٤ǤȤƤâÍ­ÍѤʴؿô¥»¥Ã¥È¤ò´û¤ËÄ󶡤·¤Æ¤¤¤Þ¤¹¡£
-
-@cindex How to pronounce @strong{MySQL}
-@cindex @strong{MySQL}, how to pronounce
-@strong{MySQL} ¤Î¸ø¼°¤Êȯ²»¤Ï ``My Ess Que Ell'' ¤Ç¤¹(MY-SEQUEL ¤Ç¤Ï¤¢¤ê
-¤Þ¤»¤ó)¡£
-
-@cindex Manual information
-@node Manual-info, History, What-is, Introduction
-@section ¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Ë¤Ä¤¤¤Æ
-
-¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Ï°Ê²¼¤ÎÊý¡¹¤Ë¤è¤êÌõ¤µ¤ì¤Þ¤·¤¿
-(¥Ï¥ó¥É¥ë̾¤À¤±½ñ¤­¤Þ¤¹¡£·É¾Îά¡£ËÝÌõ¥µ¡¼¥Ð¡¼¤ËÅÐÏ¿¤·¤¿½ç :) )¡§
-
-@itemize @bullet
-@item ̱ÅÍ
-@item hama
-@item dale
-@item kippara
-@item kenji
-@item aoki
-@item tok21108
-@item ¤³¤à¤é
-@item tamori
-@end itemize
-
-@menu
-* Manual conventions:: Conventions used in this manual
-@end menu
-
-¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Ï¸½ºß Texinfo, ¥×¥ì¡¼¥ó¥Æ¥­¥¹¥È, Info, HTML,
-PostScript, PDF ¥Ð¡¼¥¸¥ç¥ó
-¤¬¤¢¤ê¤Þ¤¹¡£¥µ¥¤¥º¤¬Â礭¤¤¤¿¤á Postscript ¤È PDF ¥Ð¡¼¥¸¥ç¥ó¤Ï
-@strong{MySQL} ¤Î¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ë¤Ï´Þ¤Þ¤ì¤Æ¤¤¤Þ¤»¤ó¤¬¡¢Ê̤˥À¥¦¥ó
-¥í¡¼¥É¤¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£@uref{http://www.mysql.com/}.
-
-¥×¥é¥¤¥Þ¥ê¥É¥­¥å¥á¥ó¥È¤Ï Texinfo ¥Õ¥¡¥¤¥ë¤Ç¤¹¡£HTML ¥Ð¡¼¥¸¥ç¥ó¤Ï
-@code{texi2html} ¤ÎÊѹ¹¤µ¤ì¤¿¥Ð¡¼¥¸¥ç¥ó¤Ç¼«Æ°Åª¤ËÄ󶡤µ¤ì¤Þ¤¹¡£¥×¥ì¡¼¥ó
-¥Æ¥­¥¹¥È¤È Info ¥Ð¡¼¥¸¥ç¥ó¤Ï @code{makeinfo} ¤ÇÄ󶡤µ¤ì¤Þ¤¹¡£PostScript
-¥Ð¡¼¥¸¥ç¥ó¤Ï @code{texi2dvi} ¤È @code{divps} ¤ò»ÈÍѤ·¤ÆÄ󶡤µ¤ì¤Þ¤¹¡£PDF
-¥Ð¡¼¥¸¥ç¥ó¤Ï Ghostscript ¥æ¡¼¥Æ¥£¥ê¥Æ¥£ @code{ps2pdf} ¤ÇÄ󶡤µ¤ì¤Þ¤¹¡£
-
-¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Ï David Axmark, Michael (Monty) Widenius, Paul DuBois,
-¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¡¢°Ý»ý¤µ¤ì¤Æ¤¤¤Þ¤¹¡£Â¾¤Î¹×¸¥¼Ô¤Ë¤Ä¤¤¤Æ¤Ï
-@ref{Credits} ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@node Manual conventions, , Manual-info, Manual-info
-@subsection ¤³¤Î¥Þ¥Ë¥å¥¢¥ëÃæ¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ëɽµ­
-
-¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤ÏÆÃÄê¤Î°õºþ¾å¤Îɽµ­¤ò»ÈÍѤ·¤Æ¤¤¤Þ¤¹:
-
-@table @asis
-@item @code{constant}
-¸ÇÄêÉý¥Õ¥©¥ó¥È¤Ï¼¡¤Î¤â¤Î¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£¥³¥Þ¥ó¥É̾, ¥ª¥×¥·¥ç¥ó; SQL ¥¹¥Æ¡¼
-¥È¥á¥ó¥È; ¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾, ¥Æ¡¼¥Ö¥ë̾, ¥Õ¥£¡¼¥ë¥É̾; C ¤È Perl ¥³¡¼¥É; ´Ä¶­ÊÑ¿ô¡£
-Îã: ``@code{mysqladmin} ¤¬¤É¤Î¤è¤¦¤ËÆ°ºî¤¹¤ë¤«¤ò¸«¤ë¤¿¤á¤Ë¤Ï¡¢
-@code{--help} ¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤Æµ¯Æ°¤·¤Æ¤¯¤À¤µ¤¤¡£''
-
-@item @file{filename}
-°úÍÑÉä¤Ç³ç¤é¤ì¤¿¸ÇÄêÉý¥Õ¥©¥ó¥È¤Ï¥Õ¥¡¥¤¥ë̾¤È¥Ñ¥¹Ì¾¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£Îã: ``
-¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ï @file{/usr/local} ¥Ç¥£¥ì¥¯¥È¥êÇÛ²¼¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Þ¤¹¡£''
-
-@item @samp{c}
-°úÍÑÉä¤Ç³ç¤é¤ì¤¿¸ÇÄêÉý¥Õ¥©¥ó¥È¤Ïʸ»ú¥·¡¼¥±¥ó¥¹¤ò¼¨¤¹¤¿¤á¤Ë¤â»ÈÍѤµ¤ì¤Þ¤¹¡£
-Îã: ``¥ï¥¤¥ë¥É¥«¡¼¥É¤ò»ØÄꤹ¤ë¤¿¤á¤Ë¤Ï¡¢@samp{%} ʸ»ú¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£''
-
-@item @emph{italic}
-¥¤¥¿¥ê¥Ã¥¯¥Õ¥©¥ó¥È¤Ï¶¯Ä´¤Î¤¿¤á¤Ë»ÈÍѤµ¤ì¤Þ¤¹, @emph{¤³¤Î¤è¤¦¤Ë}¡£
-
-@item @strong{boldface}
-¥Ü¡¼¥ë¥É¥Õ¥©¥ó¥È¤Ï¥¢¥¯¥»¥¹¸¢Ì¾(Î㤨¤Ð¡¢``@strong{process} ¸¢¤òÍưפË
-Í¿¤¨¤Ê¤¤¤Ç¤¯¤À¤µ¤¤'')¤È¡¢@strong{Æä˶¯¤¤¶¯Ä´}¤òÅÁ¤¨¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£
-@end table
-
-¥³¥Þ¥ó¥É¤¬ÆÃÄê¤Î¥×¥í¥°¥é¥à¤Ë¤è¤Ã¤Æ¼Â¹Ô¤µ¤ì¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¤³¤È¤òɽ¤¹»þ¡¢
-¥³¥Þ¥ó¥É¤È¶¦¤Ëɽ¼¨¤µ¤ì¤ë¥×¥í¥ó¥×¥È¤Ë¤è¤Ã¤Æ¡¢¤½¤Î¥×¥í¥°¥é¥à¤òɽ¤·¤Þ¤¹¡£Î㤨¤Ð¡¢
-@code{shell>} ¤Ï¡¢¤¢¤Ê¤¿¤Î¥í¥°¥¤¥ó¥·¥§¥ë¤«¤é¼Â¹Ô¤¹¤ë¥³¥Þ¥ó¥É¤òɽ¤·¡¢
-@code{mysql>} ¤Ï @code{mysql} ¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤«¤é¼Â¹Ô¤¹¤ë¥³¥Þ¥ó¥É¤òɽ¤·¤Þ¤¹:
-
-@example
-shell> type a shell command here
-mysql> type a mysql command here
-@end example
-
-¥·¥§¥ë¥³¥Þ¥ó¥É¤Ï Bourne ¥·¥§¥ë¹½Ê¸¤Ç¼¨¤µ¤ì¤Þ¤¹¡£@code{csh} ·Á¼°¤Î¥·¥§
-¥ë¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤ï¤º¤«¤ËÊѹ¹¤·¤Æ¥³¥Þ¥ó¥É¤òȯ¹Ô¤¹¤ëɬÍפ¬¤¢¤ë¤Ç¤·¤ç
-¤¦¡£Î㤨¤Ð¡¢´Ä¶­ÊÑ¿ô¤òÀßÄꤷ¤Æ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¥·¡¼¥±¥ó¥¹¤Ï¡¢Bourne ¥·¥§
-¥ë¹½Ê¸¤Ç¤Ï¼¡¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹:
-
-@example
-shell> VARNAME=value some_command
-@end example
-
-@code{csh} ¤Ç¤Ï¡¢¼¡¤Î¤è¤¦¤Ê¥·¡¼¥±¥ó¥¹¤ò¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤:
-
-@example
-shell> setenv VARNAME value
-shell> some_command
-@end example
-
-¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾, ¥Æ¡¼¥Ö¥ë̾, ¥Õ¥£¡¼¥ë¥É̾¤Ï¥³¥Þ¥ó¥É¤ÎÃæ¤ÇÃÖ´¹¤·¤Ê¤±¤ì¤Ð¤¤¤±¤Ê¤¤
-¤³¤È¤¬¤è¤¯¤¢¤ê¤Þ¤¹¡£¤³¤Î¤è¤¦¤ÊÃÖ´¹¤¬É¬Íפʤ³¤È¤ò¼¨¤¹¤¿¤á¤Ë¡¢¤³¤Î¥Þ¥Ë¥å¥¢
-¥ë¤Ï @code{db_name}, @code{tbl_name}, @code{col_name} ¤ò»ÈÍѤ·¤Þ¤¹¡£
-Î㤨¤Ð¡¢¼¡¤Î¤è¤¦¤Ê¥¹¥Æ¡¼¥È¥á¥ó¥È¤ò¸«¤¿¾ì¹ç:
-
-@example
-mysql> SELECT col_name FROM db_name.tbl_name;
-@end example
-
-¤³¤ì¤Ï¡¢Æ±ÍͤΥ¹¥Æ¡¼¥È¥á¥ó¥È¤òÆþÎϤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¤ª¤½¤é¤¯¼¡¤Î¤è¤¦¤Ë¡¢¤¢¤Ê
-¤¿¼«¿È¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾, ¥Æ¡¼¥Ö¥ë̾, ¥Õ¥£¡¼¥ë¥É̾¤ò¶¡µë¤¹¤ë¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹:
-
-@example
-mysql> SELECT author_name FROM biblio_db.author_list;
-@end example
-
-SQL ¥¹¥Æ¡¼¥È¥á¥ó¥È¤ÏÂçʸ»ú¤Ç¤â¾®Ê¸»ú¤Ç¤âµ­½Ò¤Ç¤­¤Þ¤¹¡£¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤¬
-SQL ¥¹¥Æ¡¼¥È¥á¥ó¥È¤ò¼¨¤¹¤È¤­¤Ï¡¢ÆÃÊ̤ʥ­¡¼¥ï¡¼¥É¤òÀâÌÀ¤·¤Æ¤¤¤ë»þ¤Ë¤Ï(¤½
-¤ì¤ò¶¯Ä´¤¹¤ë¤¿¤á¤Ë)¤½¤Î¥­¡¼¥ï¡¼¥É¤ËÂçʸ»ú¤¬»ÈÍѤµ¤ì¡¢»Ä¤ê¤Î¥¹¥Æ¡¼¥È¥á¥ó
-¥È¤Ë¾®Ê¸»ú¤¬»ÈÍѤµ¤ì¤Þ¤¹¡£ Î㤨¤Ð¡¢@code{SELECT} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤ÎÀâÌÀÃæ
-¤Ë¤Ï¼¡¤¬¸«¤é¤ì¤ë¤Ç¤·¤ç¤¦:
-
-@example
-mysql> SELECT count(*) FROM tbl_name;
-@end example
-
-°ìÊý¡¢@code{COUNT()} ´Ø¿ô¤ÎÀâÌÀÃæ¤Ç¤Ï¡¢¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ï¼¡¤Î¤è¤¦¤Ë½ñ¤«¤ì
-¤Þ¤¹:
-
-@example
-mysql> select COUNT(*) from tbl_name;
-@end example
-
-ÆÃÊ̤ʶ¯Ä´¤¬°Õ¿Þ¤µ¤ì¤Ê¤¤¾ì¹ç¡¢Á´¤Æ¤Î¥­¡¼¥ï¡¼¥É¤ÏÂçʸ»ú¤Ç½ñ¤«¤ì¤Þ¤¹¡£
-
-¹½Ê¸¤ÎÀâÌÀÃæ¤Ç¤Ï¡¢³Ñ³ç¸Ì(@samp{[} ¤È @samp{]})¤Ï¥ª¥×¥·¥ç¥ó¤Îñ¸ì¤äÀá¤Ç¤¢
-¤ë¤³¤È¤ò¼¨¤¹¤¿¤á¤Ë»ÈÍѤµ¤ì¤Þ¤¹:
-
-@example
-DROP TABLE [IF EXISTS] tbl_name
-@end example
-
-¹½Ê¸Í×ÁǤ¬¤¤¤¯¤Ä¤«¤Î¤â¤Î¤«¤é¤Ê¤ë¾ì¹ç¡¢¿âľ¥Ð¡¼(@samp{|})¤Ç¶èÀÚ¤é¤ì¤Þ¤¹¡£
-ÁªÂò¥»¥Ã¥È¤«¤é°ì¤Ä¤Î¥á¥ó¥Ð¤òÁª¤Ö¤³¤È¤¬¤Ç¤­¤ë¤È¤­¤Ï¡¢³Ñ³ç¸ÌÃæ¤Ë¥ê¥¹¥È¤µ¤ì
-¤Þ¤¹¡£
-(@samp{[} and @samp{]}):
-
-@example
-TRIM([[BOTH | LEADING | TRAILING] [remstr] FROM] str)
-@end example
-
-ÁªÂò¥»¥Ã¥È¤«¤é°ì¤Ä¤Î¥á¥ó¥Ð¤òÁª¤ÖɬÍפ¬¤¢¤ë¤È¤­¤Ï¡¢Çȳç¸Ì(@samp{@{}
-¤È @samp{@}})Ãæ¤Ë¥ê¥¹¥È¤µ¤ì¤Þ¤¹:
-
-@example
-@{DESCRIBE | DESC@} tbl_name @{col_name | wild@}
-@end example
-
-@cindex @strong{MySQL} version
-@node History, MySQL-Books, Manual-info, Introduction
-@section @strong{MySQL} ¤ÎÎò»Ë
-
-²æ¡¹¼«¿È¤Î®¤¯¤ÆÄã¥ì¥Ù¥ë¤Ê (ISAM) ¥ë¡¼¥Á¥ó¤ò»ÈÍѤ¹¤ë¡¢²æ¡¹¤Î¥Æ¡¼¥Ö¥ë¤Ø
-Àܳ¤¹¤ë¤¿¤á¤Ë¡¢ ²æ¡¹¤Ï°ìÅÙ
-@code{mSQL} ¤ò»ÈÍѤ¹¤ë¤Ä¤â¤ê¤Ç¤·¤¿¡£¤·¤«¤·¡¢¤¤¤¯¤Ä¤«¤Î¥Æ¥¹¥È¤Î¸å¡¢²æ¡¹¤Ï
-@code{mSQL} ¤Ï²æ¡¹¤¬É¬ÍפȤ¹¤ë¤Û¤É¹â®¤Ç¤Ï¤Ê¤¯¡¢½ÀÆðÅÙ¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¤È¤Î
-·ëÏÀ¤Ë»ê¤ê¤Þ¤·¤¿¡£¤³¤Î·ë²Ì¡¢@code{mSQL} ¤È¤Û¤È¤ó¤ÉƱ¤¸ API ¥¤¥ó¥¿¥Õ¥§¡¼
-¥¹¤ò»ý¤Ä¡¢²æ¡¹¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¿·¤·¤¤ SQL ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ëµ¢·ë¤·¤Þ¤·¤¿¡£
-¤³¤Î API ¤Ï¥µ¡¼¥É¥Ñ¡¼¥Æ¥£¥³¡¼¥É¤Î°Ü¿¢¤ò´Êñ¤Ë¤¹¤ë¤¿¤á¤ËÁªÂò¤µ¤ì¤Þ¤·¤¿¡£
-
-@strong{MySQL} ¤Î̾Á°¤ÎͳÍè¤Ï´°Á´¤Ë¤ÏÌÀ¤é¤«¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£²æ¡¹¤Î¥Ù¡¼¥¹
-¥Ç¥£¥ì¥¯¥È¥ê¤È¿¤¯¤Î¥é¥¤¥Ö¥é¥ê¤È¥Ä¡¼¥ë¤ÏÀÜƬ¼­ ``my'' ¤ò 10 ǯ°Ê¾å¤â»È¤Ã
-¤Æ¤¤¤Þ¤¹¡£¤·¤«¤·¡¢Monty ¤Î̼(²¿Ç¯¤«¼ã¤¤)¤â My ¤È¤¤¤¦Ì¾Á°¤Ç¤¹¡£¤½¤Î¤¿¤á¡¢
-¤³¤Î2¤Ä¤Î¤É¤Á¤é¤¬ @strong{MySQL} ¤Ë̾Á°¤òÍ¿¤¨¤¿¤«¤Ï¡¢²æ¡¹¤Ë¤È¤Ã¤Æ¤â̤¤À
-Ææ¤Ç¤¹¡£
-
-@node MySQL-Books, Features, History, Introduction
-@section Books about MySQL
-
-While this manual is still the right place for up to date techical
-information, its primary goal is to contain everything there is to know
-about @strong{MySQL}. And it is sometimes nice to have a bound book to read
-in bed or while you travel. Here are a list of books about @strong{MySQL} (in
-English).
-
-@multitable @columnfractions .3 .7
-@item Title @tab @uref{http://www2.newriders.com/cfm/prod_book.cfm?RecordID=584,MySQL}
-@item Publisher @tab New Riders
-@item Author @tab Paul DuBois
-@item Pub Date @tab 1st Edition December 1999
-@item ISBN @tab 0735709211
-@item Pages @tab 800
-@item Price @tab $49.99 US
-@item Downloadable examples @tab @uref{http://mysql.com/Contrib/Examples/samp_db.tar.gz, @code{samp_db.tar.gz}}
-@item Errata @tab @uref{http://www.mysql.com/pauls-mysql-book-errata.html, are available here}
-@end multitable
-Foreword by Michael ``Monty'' Widenius, @strong{MySQL} Moderator
-
-In @strong{MySQL}, Paul DuBois provides you with a comprehensive guide to
-one of the most popular relational database systems. Paul has
-contributed to the online documentation for @strong{MySQL}, and is an
-active member of the @strong{MySQL} community. The principal @strong{MySQL}
-developer, Monty Widenius, and a network of his fellow developers
-reviewed the manuscript, providing Paul with the kind of insight
-no one else could supply.
-
-Instead of merely giving you a general overview of @strong{MySQL}, Paul
-teaches you how to make the most of its capabilities. Through two
-sample database applications that run throughout the book, he
-gives you solutions to problems you're sure to face. He helps you
-integrate @strong{MySQL} efficiently with third-party tools, such as PHP
-and Perl, enabling you to generate dynamic Web pages through
-database queries. He teaches you to write programs that access
-@strong{MySQL} databases, and also provides a comprehensive set of
-references to column types, operators, functions, SQL syntax,
-@strong{MySQL} programming, C API, Perl @code{DBI}, and PHP API.
-@strong{MySQL} simply gives you the kind of information you won't find
-anywhere else.
-
-If you use @strong{MySQL}, this book provides you with:
-@itemize @bullet
-@item
-An introduction to @strong{MySQL} and SQL
-@item
-Coverage of @strong{MySQL}'s data types and how to use them
-@item
-Thorough treatment of how to write client programs in C
-@item
-A guide to using the Perl @code{DBI} and PHP APIs for developing
-command-line and Web-based applications
-@item
-Tips on administrative issues such as user accounts, backup,
-crash recovery, and security
-@item
-Help in choosing an ISP for @strong{MySQL} access
-@item
-A comprehensive reference for @strong{MySQL}'s data types, operators,
-functions, and SQL statements and utilities
-@item
-Complete reference guides for @strong{MySQL}'s C API, the Perl @code{DBI} API,
-and PHP's @strong{MySQL}-related functions
-@end itemize
-
-@multitable @columnfractions .3 .7
-@item Title @tab @uref{http://www.oreilly.com/catalog/msql/noframes.html,MySQL & mSQL}
-@item Publisher @tab O'Reilly
-@item Authors @tab Randy Jay Yarger, George Reese & Tim King
-@item Pub Date @tab 1st Edition July 1999
-@item ISBN @tab 1-56592-434-7, Order Number: 4347
-@item Pages @tab 506
-@item Price @tab $34.95
-@end multitable
-
-This book teaches you how to use @strong{MySQL} and @code{mSQL}, two popular and
-robust database products that support key subsets of SQL on both Linux
-and UNIX systems. Anyone who knows basic C, Java, Perl, or Python can
-write a program to interact with a database, either as a stand-alone
-application or through a Web page. This book takes you through the
-whole process, from installation and configuration to programming
-interfaces and basic administration. Includes ample tutorial
-material.
-
-@multitable @columnfractions .3 .7
-@item Title @tab @uref{http://shop.barnesandnoble.com/bookSearch/isbnInquiry.asp?isbn=0672319144,Sams Teach Yourself MySQL in 21 Days}
-@item Publisher @tab Sams
-@item Authors @tab Mark Maslakowski and Tony Butcher
-@item Pub Date @tab June 2000
-@item ISBN @tab 0672319144
-@item Pages @tab N/A
-@item Price @tab $39.99
-@end multitable
-
-Sams Teach Yourself @strong{MySQL} in 21 Days is for intermediate Linux users
-who want to move into databases. A large share of the audience to be web
-developers needing a database to store large amounts of information that can
-be retrieved via the Web. Sams Teach Yourself @strong{MySQL} in 21 Days is a
-practical, step-by-step tutorial. The reader will learn to design and employ
-this open source database technology into his/her web site using practical,
-hands-on examples to follow.
-
-@multitable @columnfractions .3 .7
-@item Title @tab @uref{http://shop.barnesandnoble.com/bookSearch/isbnInquiry.asp?isbn=0761524452,E-Commerce Solutions with MySQL}
-@item Publisher @tab Prima
-@item Authors @tab N/A
-@item Pub Date @tab September 2000
-@item ISBN @tab 0761524452
-@item Pages @tab 500
-@item Price @tab $39.99
-@end multitable
-
-No description available.
-
-@multitable @columnfractions .3 .7
-@item Title @tab @uref{http://shop.barnesandnoble.com/bookSearch/isbnInquiry.asp?isbn=1861004281,Professional MySQL Programming}
-@item Publisher @tab Wrox
-@item Authors @tab N/A
-@item Pub Date @tab July 2000
-@item ISBN @tab 1861004281
-@item Pages @tab 1000
-@item Price @tab $49.99
-@end multitable
-
-No description available.
-
-@multitable @columnfractions .3 .7
-@item Title @tab @uref{http://shop.barnesandnoble.com/bookSearch/isbnInquiry.asp?isbn=0672317842,PHP3 and MySQL Web Development}
-@item Publisher @tab N/A
-@item Authors @tab William Jason Gilmore
-@item Pub Date @tab October 2000
-@item ISBN @tab 672317842
-@item Pages @tab N/A
-@item Price @tab $39.99
-@end multitable
-
-No description available.
-
-@node Features, Stability, MySQL-Books, Introduction
-@section @strong{MySQL}¤Î¼ç¤Êµ¡Ç½
-
-@strong{MySQL} ¤Î½ÅÍפÊÆÃħ¤Î¤¤¤¯¤Ä¤«¤ò°Ê²¼¤Î¹àÌܤˤ¢¤²¤Þ¤¹¡§
-
-@c This list is too technical and should be divided into one feature
-@c list comparable to commercial competition and a very technical on
-@c with max limits (from crash-me) and so on.
-@itemize @bullet
-@item
-¥«¡¼¥Í¥ë¥¹¥ì¥Ã¥É¤ò»ÈÍѤ¹¤ë´°Á´¤Ê¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¡£¤³¤ì¤ÏÍ­¸ú¤Ç¤¢¤ì¤Ð´Êñ¤Ë
-Ê£¿ô¤Î CPU ¤ò»ÈÍѤǤ­¤ë¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£
-
-@item
-C, C++, Ruby, Eiffel, Java, Perl, PHP, Python ¤½¤·¤Æ Tcl API¡£@xref{Clients}¡£
-
-@item
-¿¤¯¤Î¼ïÎà¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤ÇÆ°ºî¤·¤Þ¤¹¡£@xref{Which OS}¡£
-
-@item
-¿¤¯¤Î¥Õ¥£¡¼¥ë¥É·¿: 1, 2, 3, 4, 8 ¥Ð¥¤¥ÈŤÎÉä¹æÉÕ¤­/Éä¹æ̵¤·À°¿ô,
-@code{FLOAT}, @code{DOUBLE}, @code{CHAR}, @code{VARCHAR}, @code{TEXT},
-@code{BLOB}, @code{DATE}, @code{TIME}, @code{DATETIME}, @code{TIMESTAMP},
-@code{YEAR}, @code{SET}, @code{ENUM} ·¿¡£@xref{Column types}¡£
-
-@item
-ºÇŬ²½¤µ¤ì¤¿ one-sweep multi-join ¤ò»ÈÍѤ¹¤ë¤È¤Æ¤â®¤¤·ë¹ç¡£
-
-@item
-¥¯¥¨¥ê¤Î @code{SELECT} ¤È @code{WHERE} ÉôÆâ¤Ç¤ÎÁ´¤Æ¤Î±é»»»Ò¤È´Ø¿ô¤Î¥µ¥Ý¡¼
-¥È¡£Îã:
-@example
-mysql> SELECT CONCAT(first_name, " ", last_name) FROM tbl_name
- WHERE income/dependents > 10000 AND age > 30;
-@end example
-
-@item
-SQL ´Ø¿ô¤Ï¹âÅ٤˺ÇŬ²½¤µ¤ì¤¿¥¯¥é¥¹¥é¥¤¥Ö¥é¥ê¤òÄ̤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤Æ¡¢¤½¤ì
-¤¬ÆÀ¤ë¤³¤È¤Î¤Ç¤­¤ë¤Î¤ÈƱ¤¸¤¯¤é¤¤Â®¤¤¤Î¤Ç¤¹¡ª ÉáÄÌ¡¢¥¯¥¨¥ê¤Î½é´ü²½¤Î¸å¤Ë
-¤Ï¡¢Á´¤¯¥á¥â¥ê³ä¤êÅö¤Æ¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-
-@item
-SQL @code{GROUP BY} ¤È @code{ORDER BY} Àá¤Î´°Á´¤Ê¥µ¥Ý¡¼¥È¡£¥°¥ë¡¼¥×´Ø¿ô
-(@code{COUNT()}, @code{COUNT(DISTINCT)}, @code{AVG()}, @code{STD()}, @code{SUM()}, @code{MAX()},
-@code{MIN()}) ¤Î¥µ¥Ý¡¼¥È¡£
-
-@item
-ANSI SQL ¤È ODBC ¹½Ê¸¤Ç¤Î @code{LEFT OUTER JOIN} ¤Î¥µ¥Ý¡¼¥È¡£
-
-@item
-Ʊ°ì¥¯¥¨¥êÆâ¤Ë°Û¤Ê¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¤Î¥Æ¡¼¥Ö¥ë¤òº®ºß¤Ç¤­¤Þ¤¹ (¥Ð¡¼¥¸¥ç¥ó
-3.22)¡£
-
-@item
-¤È¤Æ¤â½ÀÆð¤Ç°ÂÁ´¤Ê Æø¢¥·¥¹¥Æ¥à ¤È¥Ñ¥¹¥ï¡¼¥É¥·¥¹¥Æ¥à¡£
-¥Û¥¹¥È¥Ù¡¼¥¹¤Î¾ÚÌÀ¤¬²Äǽ¤Ç¤¹¡£
-¥µ¡¼¥Ð¤ËÀܳ¤¹¤ë»þ¤ÎÁ´¤Æ¤Î¥Ñ¥¹¥ï¡¼¥É¥È¥é¥Õ¥£¥Ã¥¯¤Ï°Å¹æ²½¤µ¤ì¤Æ¤¤¤ë¤¿¤á¥Ñ
-¥¹¥ï¡¼¥É¤Ï°ÂÁ´¤Ç¤¹¡£
-
-@item
-Windows95 ¤Î ODBC (Open-DataBase-Connectivity) (¥½¡¼¥¹¤Ä¤­)¡£Á´¤Æ¤Î ODBC
-2.5 ´Ø¿ô¤È¾¤Î¿¤¯¡£¤¢¤Ê¤¿¤Î @strong{MySQL} ¥µ¡¼¥Ð¤ËÀܳ¤¹¤ë¤¿¤á¤Ë¡¢Î㤨
-¤Ð Access ¤ò»ÈÍѤǤ­¤Þ¤¹¡£@xref{ODBC}¡£
-
-@item
-¥¤¥ó¥Ç¥Ã¥¯¥¹°µ½Ì¤Ä¤­¤Î¤È¤Æ¤â®¤¤ B-tree ¥Ç¥£¥¹¥¯¥Æ¡¼¥Ö¥ë¡£
-
-@item
-¥Æ¡¼¥Ö¥ëËè¤Ë 16 ¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬µö¤µ¤ì¤Þ¤¹¡£³Æ¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï 1 ¤«¤é 16 ¸Ä
-¤Î¥Õ¥£¡¼¥ë¥É¤Þ¤¿¤Ï¥Õ¥£¡¼¥ë¥É¤Î°ìÉô¤«¤é¤Ê¤ê¤Þ¤¹¡£ºÇÂ祤¥ó¥Ç¥Ã¥¯¥¹Ä¹¤Ï 256 ¥Ð¥¤¥È¤Ç¤¹
-(¤³¤ì¤Ï @strong{MySQL} ¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤ËÊѹ¹¤Ç¤­¤Þ¤¹)¡£¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï
-@code{CHAR} ¤Þ¤¿¤Ï @code{VARCHAR} ¥Õ¥£¡¼¥ë¥É¤ÎÀèƬÉôʬ¤ò»ÈÍѤǤ­¤Þ¤¹¡£
-
-@item
-¸ÇÄêĹ¤È²ÄÊÑĹ¤Î¥ì¥³¡¼¥É¡£
-
-@item
-°ì»þ¥Æ¡¼¥Ö¥ë¤È¤·¤Æ»ÈÍѤµ¤ì¤ë¥á¥â¥êÆâ¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¡£
-
-@item
-Â礭¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÁàºî¡£²æ¡¹¤Ï¡¢50,000,000 ¥ì¥³¡¼¥É¤ò´Þ¤à¤¤¤¯¤Ä¤«¤Î¥Ç¡¼
-¥¿¥Ù¡¼¥¹¤Ç @strong{MySQL} ¤ò»ÈÍѤ·¤Æ¤¤¤Þ¤¹¡£
-
-@item
-Á´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤Ï¥Ç¥Õ¥©¥ë¥ÈÃͤò»ý¤Á¤Þ¤¹¡£ ¥Æ¡¼¥Ö¥ë¹àÌܤΥµ¥Ö¥»¥Ã¥È¤òÁÞÆþ¤¹¤ë¤¿
-¤á¤Ë @code{INSERT} ¤ò»ÈÍѤǤ­¡¢ÌÀ¼¨Åª¤ËÃͤ¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤¥Õ¥£¡¼¥ë¥É¤Ï¤½¤Î¥Ç
-¥Õ¥©¥ë¥ÈÃͤ¬ÀßÄꤵ¤ì¤Þ¤¹¡£
-
-@item
-²ÄÈÂÀ­¤Î¤¿¤á¤Ë GNU Automake, Autoconf, @code{libtool} ¤ò»ÈÍѤ·¤Æ¤¤¤Þ¤¹¡£
-
-@item
-C ¤È C++ ¤Ç½ñ¤«¤ì¤Æ¤¤¤Þ¤¹¡£¹­ÈϤʼïÎà¤Î¥³¥ó¥Ñ¥¤¥é¤Ç¥Æ¥¹¥È¤µ¤ì¤Æ¤Þ¤¹¡£
-
-@item
-¤È¤Æ¤â®¤¤¥¹¥ì¥Ã¥É¥Ù¡¼¥¹¤Î¥á¥â¥ê³ä¤êÅö¤Æ¥·¥¹¥Æ¥à¡£
-
-@item
-¥á¥â¥ê¥ê¡¼¥¯¤¬¤¢¤ê¤Þ¤»¤ó¡£»ÔÈΤΥá¥â¥ê¥ê¡¼¥¯¸¡½ÐÀ½ÉÊ(@code{purify})¤Ç¥Æ
-¥¹¥È¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-
-@item
-@code{myisamchk} ¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£¤³¤ì¤Ï¡¢¥Æ¡¼¥Ö¥ë¸¡ºº¡¢ºÇŬ²½¡¢½¤Éü¤Î¤¿¤á
-¤Î¤È¤Æ¤â®¤¤¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ç¤¹¡£@xref{Maintenance}¡£
-
-@item
-°Û¤Ê¤ë¥­¥ã¥é¥¯¥¿¥»¥Ã¥È¤Î´°Á´¤Ê¥µ¥Ý¡¼¥È¡£ISO-8859-1 (Latin1), big5, ujis ¤Ê¤É¡£
-Î㤨¤Ð¡¢¥¹¥«¥ó¥¸¥Ê¥Ó
-¥¢¸ìʸ»ú @ringaccent{a}, @"a ¤½¤·¤Æ @"o ¤Ï¥Æ¡¼¥Ö¥ë̾¤ä¥Õ¥£¡¼¥ë¥É̾¤È¤·¤Æµö¤µ¤ì
-¤Þ¤¹¡£
-
-@item
-Á´¤Æ¤Î¥Ç¡¼¥¿¤Ï ÁªÂò¤µ¤ì¤¿¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È¤Î·Á¼°¤ÇÊݸ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£Ä̾ïʸ»úÎó¥Õ¥£¡¼¥ë¥É
-¤ÎÁ´¤Æ¤ÎÈæ³Ó¤Ï¥±¡¼¥¹Èó°Í¸¤Ç¤¹¡£
-
-@item
-¥½¡¼¥È¤Ï¡¢@strong{MySQL} ¥µ¡¼¥Ð¡¼µ¯Æ°»þ¤Ë¡¢ÁªÂò¤µ¤ì¤¿¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È¤Ë
-¤Ë½¾¤Ã¤Æ¹Ô¤Ê¤ï¤ì¤Þ¤¹¡£(¥Ç¥Õ¥©¥ë¥È¤Ï¡¢¥¹¥¦¥§¡¼¥Ç¥ó¸ì¤ÎÊýË¡)¡£
-¥½¡¼¥¹Æâ¤Ë¿·¤·¤¤¥½¡¼¥È½ç½øÇÛÎó¤òÄɲ乤뤳¤È¤Ç¡¢¤³
-¤ì¤ÏÊѹ¹²Äǽ¤Ç¤¹¡£¤È¤Æ¤âÀè¿ÊŪ¤Ê¥½¡¼¥È¤ÎÎã¤ò¸«¤ë¤Ë¤Ï¡¢Czech ¥½¡¼¥È¥³¡¼¥É
-¤ò¸«¤Æ¤¯¤À¤µ¤¤¡£ @strong{MySQL} ¤Ï¿¤¯¤Î¼ïÎà¤Î¥­¥ã¥é¥¯¥¿¥»¥Ã¥È¤ò¥µ¥Ý¡¼¥È
-¤·¡¢¥³¥ó¥Ñ¥¤¥ë»þ¤ä¼Â¹Ô»þ¤Ë»ØÄê¤Ç¤­¤Þ¤¹¡£
-
-@item
-SQL92 ɸ½à¤Ë¤¢¤ë¤è¤¦¤Ê¥Æ¡¼¥Ö¥ë¤È¥Õ¥£¡¼¥ë¥É¤Î¥¨¥¤¥ê¥¢¥¹Ì¾¡£
-
-@item
-@code{DELETE}, @code{INSERT}, @code{REPLACE}, @code{UPDATE} ¤Ï
-Êѹ¹¤µ¤ì¤¿(±Æ¶Á¤ò¼õ¤±¤¿)¹Ô¤Î¿ô¤òÊÖ¤·¤Þ¤¹¡£
-¥µ¡¼¥ÐÀܳ»þ¤Ë¥Õ¥é¥°¤òÀßÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¢Âå¤ï¤ê¤ËŬ¹ç¤·¤¿¥ì¥³¡¼¥É¿ô¤òÊÖ¤¹
-¤³¤È¤â²Äǽ¤Ç¤¹¡£
-
-@item
-´Ø¿ô̾¤Ï¥Æ¡¼¥Ö¥ë̾¤ä¥Õ¥£¡¼¥ë¥É̾¤È¾×Æͤ·¤Þ¤»¤ó¡£Î㤨¤Ð @code{ABS} ¤ÏÀµ¤·¤¤¥Õ¥£¡¼¥ë¥É
-̾¤Ç¤¹¡£À©¸Â¤Ï¡¢´Ø¿ô¸Æ¤Ó½Ð¤·¤Ë¡¢´Ø¿ô̾¤È¤½¤ì¤Ë³¤¯ @samp{(} ¤Î´Ö¤Ë¶õÇò¤¬
-µö¤µ¤ì¤Ê¤¤¤³¤È¤À¤±¤Ç¤¹¡£@xref{Reserved words}¡£
-
-@item
-Á´¤Æ¤Î @strong{MySQL} ¥×¥í¥°¥é¥à¤Ï¥ª¥ó¥é¥¤¥ó¥Ø¥ë¥×¤òÆÀ¤ë¤¿¤á¤Ë¡¢
-@code{--help} ¤È @code{-?} ¥ª¥×¥·¥ç¥ó¤Ç¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@item
-¥µ¡¼¥Ð¤Ï¿¤¯¤Î¸À¸ì¤Ç¥¯¥é¥¤¥¢¥ó¥È¤Ø¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òÄ󶡤Ǥ­¤Þ¤¹¡£
-@xref{Languages}¡£
-
-@item
-¥¯¥é¥¤¥¢¥ó¥È¤Ï¡¢TCP/IP Àܳ¤Þ¤¿¤Ï Unix ¥½¥±¥Ã¥È¡¢¤¢¤ë¤¤¤Ï NT ¤Î¾ì¹ç¤Ï
-¥Í¡¼¥à¥É¥Ñ¥¤¥×¤ò»ÈÍѤ·¤Æ @strong{MySQL} ¥µ¡¼¥Ð¤ÈÀܳ¤·¤Þ¤¹¡£
-
-@item
-@strong{MySQL} ¸ÇÍ­¤Î @code{SHOW} ¥³¥Þ¥ó¥É¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¡¢¥Æ¡¼¥Ö¥ë¡¢¥¤¥ó
-¥Ç¥Ã¥¯¥¹¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤ò¼è½Ð¤¹¤¿¤á¤Ë»ÈÍѤǤ­¤Þ¤¹¡£@code{EXPLAIN} ¥³¥Þ¥ó
-¥É¤Ï¥ª¥×¥Æ¥£¥Þ¥¤¥¶¤¬¤É¤Î¤è¤¦¤Ë¥¯¥¨¥ê¤ò²òÀϤ¹¤ë¤«¤ò·èÄꤹ¤ë¤¿¤á¤Ë»ÈÍÑ
-¤Ç¤­¤Þ¤¹¡£
-@end itemize
-
-@cindex Stability
-@node Stability, Year 2000 compliance, Features, Introduction
-@section @strong{MySQL} ¤Ï¤É¤ì¤¯¤é¤¤°ÂÄ꤫¡©
-
-¤³¤ÎÀá¤Ç¤Ï¡¢``@strong{MySQL} ¤Ï¤É¤ì¤¯¤é¤¤°ÂÄ꤫¡©'' ¤È ``»ä¤Ï¤³¤Î¥×¥í¥¸¥§
-¥¯¥È¤Ç @strong{MySQL} ¤Ë°Í¸¤Ç¤­¤ë¤«¡©'' ¤È¤¤¤¦¼ÁÌä¤Ë¤Ä¤¤¤Æ²óÅú¤·¤Þ¤¹¡£
-
-²æ¡¹¤Ï¤³¤³¤Ç¡¢¤¤¤¯¤Ä¤«¤ÎÌäÂê¤òÌÀ¤é¤«¤Ë¤·¡¢Â¿¤¯¤Î¿Í¤Ë´Ø·¸¤¹¤ë¤È»×¤ï¤ì¤ë¤µ
-¤é¤Ë½ÅÍפʼÁÌä¤Î¤¤¤¯¤Ä¤«¤ò²óÅú¤¹¤ë¤³¤È¤ò»î¤ß¤Þ¤¹¡£¤³¤ÎÀá¤Ï¡¢¥á¡¼¥ê¥ó¥°¥ê
-¥¹¥È(¤½¤³¤Ç¤Ï¤È¤Æ¤â³èȯ¤Ë¥Ð¥°¤¬Êó¹ð¤µ¤ì¤Æ¤¤¤Þ¤¹)¤«¤é¼è¤ê¹þ¤Þ¤ì¤¿¾ðÊ󤬰ì
-½ï¤ËÃÖ¤«¤ì¤Æ¤¤¤Þ¤¹¡£
-
-TcX ¤Ç¤Ï¡¢@strong{MySQL} ¤Ï 1996 Ã溢¤«¤é²æ¡¹¤Î¥×¥í¥¸¥§¥¯¥È¤Ç²¿¤ÎÌäÂê¤â
-¤Ê¤¯Æ°¤¤¤Æ¤¤¤Þ¤·¤¿¡£¹­¤¯¸ø¤Ë¥ê¥ê¡¼¥¹¤µ¤ì¤¿»þ¡¢²æ¡¹¤Ï¡¢@strong{MySQL} Æâ
-¤Ë ``¥Æ¥¹¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¥³¡¼¥É'' ¤ÎÉôʬ¤¬¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤Þ¤·¤¿¡£¤³¤ì¤Ï¡¢
-²æ¡¹¤È¤Ï°Û¤Ê¤ëÊýË¡¤Ç¥¯¥¨¥ê¤òºîÀ®¤¹¤ë¿·¤·¤¤¥æ¡¼¥¶¤Ë¤è¤Ã¤Æ¤¹¤°¤Ë¸«¤Ä¤±¤é¤ì¤Þ¤·¤¿¡£
-¿·¤·¤¤³Æ¥ê¥ê¡¼¥¹¤Ï¡¢(¿¤¯¤Î¿·¤·¤¤µ¡Ç½¤ò»ý¤Ã¤Æ¤¤¤ë¤Î¤Ë)Á°¤Î¤â¤Î¤è¤ê¤âÌäÂê
-¤Ï¾¯¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£¤½¤·¤Æ¼¡¤Î¥ê¥ê¡¼¥¹¤Î°ì¤Ä¤ò ``°ÂÄê'' ¤È¸Æ¤Ö¤³¤È¤¬¤Ç¤­¤ë¤è
-¤¦¤Ë²æ¡¹¤Ï˾¤ó¤Ç¤¤¤Þ¤¹¡£
-
-@strong{MySQL} ¤Î³Æ¥ê¥ê¡¼¥¹¤Ï¼ÂÍÑŪ¤Ç¡¢¥æ¡¼¥¶¤¬ ``¥°¥ì¥¤¥¾¡¼¥ó'' ¤«¤é¤Î
-¥³¡¼¥É¤Î»ÈÍѤò³«»Ï¤¹¤ë»þ¤Ë¤À¤±ÌäÂ꤬¤¢¤ê¤Þ¤¹¡£ÅöÁ³¡¢³°Éô¤Î¥æ¡¼¥¶¤Ï¡¢²¿¤¬
-¥°¥ì¥¤¥¾¡¼¥ó¤«¤òÃΤ뤳¤È¤¬¤Ç¤­¤Þ¤»¤ó; ¤³¤ÎÀá¤Ç¸½ºßÃΤé¤ì¤Æ¤¤¤ë¤³¤ì¤é¤ò¼¨
-¤·¤Æ¤ß¤Þ¤¹¡£
-ÀâÌÀ¤Ï @strong{MySQL} ¤Î 3.22.x ¥Ð¡¼¥¸¥ç¥ó¤Ç°·¤ï¤ì¤Þ¤¹¡£ÃΤé¤ì¤Æ¤¤¤ÆÊó¹ð
-¤µ¤ì¤Æ¤¤¤ë¥Ð¥°¤ÏÁ´¤ÆºÇ¿·¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç½¤Àµ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£bugs Àá¤Ë
-½ñ¤«¤ì¤Æ¤¤¤ë¥Ð¥°¤Ï½ü¤­¤Þ¤¹¡£¤½¤ì¤é¤Ï ``Àß·×'' ´ØÏ¢¤Î¤â¤Î¤Ç¤¹¡£@xref{Bugs}.
-
-@strong{MySQL} ¤ÏÊ£¿ô¤Î³¬ÁؤÈÍÍ¡¹¤ÊÆÈΩ¥â¥¸¥å¡¼¥ë¤Ç½ñ¤«¤ì¤Æ¤¤¤Þ¤¹¡£¤³¤ì
-¤é¤Î¥â¥¸¥å¡¼¥ë¤Ï¡¢¤½¤ì¤¾¤ì¤¬¤É¤Î¤è¤¦¤Ë¥Æ¥¹¥È¤µ¤ì¤Æ¤¤¤ë¤«¤È¤È¤â¤Ë¼¡¤Ë¥ê¥¹
-¥È¤µ¤ì¤Æ¤¤¤Þ¤¹:
-
-@table @strong
-@item ISAM ¥Æ¡¼¥Ö¥ë½èÍý --- °ÂÄê
-¤³¤ì¤Ï @strong{MySQL} 3.22 ¤È¤½¤ì°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤ª¤¤¤Æ¡¢
-Á´¤Æ¤Î¥Ç¡¼¥¿¤ÎÊݸ¤È¸¡º÷¤ò´ÉÍý¤·¤Þ¤¹¡£Á´¤Æ¤Î @strong{MySQL} ¥ê¥ê¡¼¥¹¤Ç¤Ï¡¢
-¤³¤Î¥³¡¼¥ÉÆâ¤Ë¤Ï(Êó¹ð¤µ¤ì¤¿)¥Ð¥°¤Ï°ì¤Ä¤â¤¢¤ê¤Þ¤»¤ó¡£ÉÔÀµ¤Ê¥Æ¡¼¥Ö¥ë¤òÆÀ¤ë
-Í£°ì¤ÎÊýË¡¤Ï¡¢¹¹¿·¤ÎÅÓÃæ¤Ë¤¢¤ë¥µ¡¼¥Ð¤ò»¦¤¹¤³¤È¤À¤±¤Ç¤¹¡£¤½¤·¤Æ³Æ¥¯¥¨¥ê´Ö
-¤ÇÁ´¤Æ¤Î¥Ç¡¼¥¿¤Ï¥Ç¥£¥¹¥¯¤Ë¥Õ¥é¥Ã¥·¥å¤µ¤ì¤ë¤¿¤á¡¢¤¤¤«¤Ê¤ë¥Ç¡¼¥¿¤â
-½¤Éü³°¤ÎÇ˲õ¤¬µ¯¤³¤ë¤È¤¤¤¦¤³¤È¤Ï¤Þ¤º¤Ê¤¤¤Ç¤·¤ç¤¦¡£
-@strong{MySQL} Æâ¤Î¥Ð¥°¤Î¤¿¤á¤Ë¥Ç¡¼¥¿¤¬
-¼º¤ï¤ì¤¿¤È¤¤¤¦¥Ð¥°¥ì¥Ý¡¼¥È¤Ï°ì¤Ä¤â¤¢¤ê¤Þ¤»¤ó¡£
-
-@item The MyISAM table handler --- Beta
-¤³¤ì¤Ï @strong{MySQL} 3.23 ¤Ç¤Î¿·µ¡Ç½¤Ç¤¹.
-¤³¤ì¤Ï ISAM ¥Æ¡¼¥Ö¥ë¤Î¥³¡¼¥É¤ò¸µ¤Ë³ÈÄ¥¤µ¤ì¤Æ¤¤¤Þ¤¹¤¬¡¢
-¿¤¯¤ÎÊØÍø¤Êµ¡Ç½¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£
-
-@item ¥Ñ¡¼¥µ¤Èñ¸ì²òÀÏ --- °ÂÄê
-¤³¤Î¥·¥¹¥Æ¥àÆâ¤Ë¤ÏŤ¤´Ö¥Ð¥°¤Ï°ì¤Ä¤âÊó¹ð¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£
-
-@item C ¥¯¥é¥¤¥¢¥ó¥È¥³¡¼¥É --- °ÂÄê
-ÃΤé¤ì¤Æ¤¤¤ëÌäÂê¤Ï¤¢¤ê¤Þ¤»¤ó¡£3.20 ¥ê¥ê¡¼¥¹¤Î½é´ü¤Ë¤Ï¡¢Á÷¿®/¼õ¿®¥Ð¥Ã¥Õ¥¡
-¥µ¥¤¥º¤Ë¤¤¤¯¤Ä¤«¤ÎÀ©¸Â¤¬¤¢¤ê¤Þ¤·¤¿¡£3.21.x °Ê¹ß¡¢¥Ð¥Ã¥Õ¥¡¤Ï¥Ç¥Õ¥©¥ë¥È¤Î
-24M ¤Þ¤ÇưŪ¤ËÂ礭¤¯¤Ê¤ê¤Þ¤¹¡£
-
-@item ɸ½à¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à --- °ÂÄê
-¤³¤ì¤é¤Ï @code{mysql}, @code{mysqladmin}, @code{mysqlshow},
-@code{mysqldump}, @code{mysqlimport} ¤ò´Þ¤ß¤Þ¤¹.
-
-@item ´ðËÜŪ¤Ê SQL --- °ÂÄê
-´ðËÜŪ¤Ê SQL µ¡Ç½¥·¥¹¥Æ¥à¤Èʸ»úÎóÀá¤ÈưŪ¥á¥â¥ê½èÍý¡£¤³¤Î¥·¥¹¥Æ¥à¤Ë¤ÏÊó
-¹ð¤µ¤ì¤¿¥Ð¥°¤Ï°ì¤Ä¤â¤¢¤ê¤Þ¤»¤ó¡£
-
-@item ¥¯¥¨¥ê¥ª¥×¥Æ¥£¥Þ¥¤¥¶ --- °ÂÄê
-
-@item ÈÏ°Ï¥ª¥×¥Æ¥£¥Þ¥¤¥¶ --- °ÂÄê
-
-@item ·ë¹ç¥ª¥×¥Æ¥£¥Þ¥¤¥¶ --- °ÂÄê
-
-@item ¥í¥Ã¥¯ --- ¥¬¥ó¥Þ
-¤³¤ì¤Ï¤È¤Æ¤â¥·¥¹¥Æ¥à¤Ë°Í¸¤·¤Æ¤¤¤Þ¤¹¡£¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤³¤ì¤Ï¡¢É¸
-½à OS ¥í¥Ã¥¯ (fcntl) ¤ò»ÈÍѤ¹¤ë¤¿¤áÂ礭¤ÊÌäÂ꤬¤¢¤ê¤Þ¤¹¡£¤³¤ì¤é¤Î¾ì¹ç¤Ç
-¤Ï¡¢@strong{MySQL} ¥Ç¡¼¥â¥ó¤ò @code{--skip-locking} ¥Õ¥é¥°¤Ä¤­¤ÇÆ°¤«¤¹¤Ù
-¤­¤Ç¤¹¡£ÃΤé¤ì¤Æ¤¤¤ëÌäÂê¤Ï¡¢¤¤¤¯¤Ä¤«¤Î Linux ¥·¥¹¥Æ¥à¤È NFS ¥Þ¥¦¥ó¥È¤µ¤ì
-¤¿¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à»ÈÍÑ»þ¤Î SunOS ¤Ç¤¹¡£
-
-@item Linux ¥¹¥ì¥Ã¥É --- ¥¬¥ó¥Þ
-@code{fcntl()} ¥³¡¼¥ë¤Ç¤À¤±ÌäÂ꤬¸«¤Ä¤«¤Ã¤Æ¤¤¤Þ¤¹¡£¤³¤ì¤Ï @code{mysqld}
-¤Ø¤Î @w{@code{--skip-locking}} ¥ª¥×¥·¥ç¥ó¤Î»ÈÍѤǽ¤Àµ¤Ç¤­¤Þ¤¹¡£²¿¿Í¤«¤Ï
-0.5 ¥ê¥ê¡¼¥¹¤Ç lockup ÌäÂê¤òÊó¹ð¤·¤Þ¤·¤¿¡£1000°Ê¾å¤ÎƱ»þÀܳ¤ò»ÈÍѤ¹¤ëͽ
-Äê¤Ç¤¢¤ì¤Ð¡¢LinuxThreads ¤òºÆ¥³¥ó¥Ñ¥¤¥ë¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤·¤«¤·¡¢¥Ç¥Õ¥©
-¥ë¥È¤Î LinuxThread ¤Ç¤â¿¤¯¤ÎÀܳ¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ï²Äǽ¤Ç¤¹(¤·¤«¤· 1021 °Ê
-¾å¤Ë¤Ê¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤)¡£¥Ç¥Õ¥©¥ë¥È¤Î 2MB ¤Î¥¹¥¿¥Ã¥¯¶õ´Ö¤Ï¡¢¥¢¥×
-¥ê¥±¡¼¥·¥ç¥ó¤òÉÔ°ÂÄê¤Ë¤·¤Þ¤¹¡£¤½¤·¤Æ 1021 ¸Ä¤Î¥¢¥¤¥É¥ëÀܳ¤ÎÀ¸À®¸å¤Ë
-coredump ¤ò°ú¤­µ¯¤³¤·¤Þ¤¹¡£¾Ü¤·¤¯¤Ï Linux Notes ¤ò¤´Í÷¤¯¤À¤µ¤¤¡£
-
-@item Solaris 2.5+ pthread --- °ÂÄê
-²æ¡¹¤Ï¡¢²æ¡¹¤ÎÁ´¤Æ¤ÎÀ½ÉʤǤ³¤ì¤ò»ÈÍѤ·¤Æ¤¤¤Þ¤¹¡£
-
-@item MIT ¥¹¥ì¥Ã¥É (¾¤Î¥·¥¹¥Æ¥à) --- ¥¬¥ó¥Þ
-3.20.15 ¤«¤éÊó¹ð¤µ¤ì¤¿¥Ð¥°¤Ï¤¢¤ê¤Þ¤»¤ó¡£3.20.15 ¤«¤éÃΤé¤ì¤¿¥Ð¥°¤Ï¤¢¤ê¤Þ
-¤»¤ó¡£¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤¤¤¯¤Ä¤«¤ÎÁàºî¤¬ÃÙ¤¯¤Ê¤ë¤È¤¤¤¦
-``misfeature'' ¤¬¤¢¤ê¤Þ¤¹(1/20 ÉäΠsleep ¤¬³Æ¥¯¥¨¥ê´Ö¤Ç¹Ô¤Ê¤ï¤ì¤Þ¤¹)¡£
-¤â¤Á¤í¤ó¡¢MIT ¥¹¥ì¥Ã¥É¤Ï¤¹¤Ù¤Æ¤ò¾¯¤·ÃÙ¤¯¤·¤Þ¤¹¡£¤·¤«¤·¥¤¥ó¥Ç¥Ã¥¯¥¹¥Ù¡¼¥¹
-¤Î @code{SELECT} ¤Ç¤Ï¡¢¥¹¥Æ¡¼¥È¥á¥ó¥È¤ÏÄ̾ï°ìÅ٤Υե졼¥à¤Ç¹Ô¤ï¤ì¤ë¤¿¤á¡¢
-mutex locking/thread juggling ¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-
-@item ¾¤Î¥¹¥ì¥Ã¥É¼ÂÁõ --- ¥¢¥ë¥Õ¥¡ - ¥Ù¡¼¥¿
-¾¤Î¥·¥¹¥Æ¥à¤Ø¤Î°Ü¹Ô¤Ï¤Þ¤À¤È¤Æ¤â¿·¤·¤¯¡¢Â¿Ê¬ @strong{MySQL} ¤Ë¡¢¤·¤«¤·°ì
-ÈÖ¿¤¤¤Î¤Ï¥¹¥ì¥Ã¥É¼ÂÁõ¼«¿È¤Ë¡¢Â¿¤¯¤Î¥Ð¥°¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£
-
-@item @code{LOAD DATA...}, @code{INSERT ... SELECT} --- °ÂÄê
-²¿¿Í¤«¤Ï¤³¤ì¤Ë¥Ð¥°¤ò¸«¤Ä¤±¤¿¤È¹Í¤¨¤Þ¤·¤¿¤¬¡¢¤½¤ì¤Ï·ë¶É¸í²ò¤Ç¤·¤¿¡£ÌäÂê¤Î
-Êó¹ð¤ÎÁ°¤Ë¥Þ¥Ë¥å¥¢¥ë¤òÎɤ¯¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡ª
-
-@item @code{ALTER TABLE} --- °ÂÄê
-3.22.12 ¤Ç¾¯¤·Êѹ¹¤·¤Þ¤·¤¿¡£
-
-@item DBD --- °ÂÄê
-¸½ºß¡¢Jochen Wiedmann
-@email{wiedmann@@neckar-alb.de}
-¤Ë¤è¤Ã¤Æ¥á¥ó¥Æ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£´¶¼Õ¡ª
-
-@item @code{mysqlaccess} --- ¥¬¥ó¥Þ
-@email{Yves.Carlier@@rug.ac.be}
-¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¥á¥ó¥Æ¤µ¤ì¤Æ¤Þ¤¹¡£´¶¼Õ¡ª
-
-@item @code{GRANT} --- ¥¬¥ó¥Þ
-@strong{MySQL} 3.22.12 ¤ÇÂ礭¤ÊÊѹ¹¤¬¹Ô¤Ê¤ï¤ì¤Þ¤·¤¿¡£
-
-@item @strong{MyODBC} (uses ODBC SDK 2.5) --- ¥¬¥ó¥Þ
-¤¤¤¯¤Ä¤«¤Î¥×¥í¥°¥é¥à¤Ç¤Á¤ã¤ó¤ÈÆ°ºî¤·¤Æ¤¤¤ë¤è¤¦¤Ë¸«¤¨¤Þ¤¹¡£
-@end table
-
-TcX ¤ÏÂå¶â¤ò»Ùʧ¤Ã¤¿¸ÜµÒ¤Î¤¿¤á¤Ë email ¥µ¥Ý¡¼¥È¤òÄ󶡤·¤Æ¤¤¤Þ¤¹¡£¤·¤«¤·
-@strong{MySQL} ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤ÏÄ̾Á´¤Æ¤Î°ìÈÌŪ¤Ê¼ÁÌä¤Ë²óÅú¤òÄ󶡤·
-¤Æ¤¤¤Þ¤¹¡£¥Ð¥°¤ÏÄ̾魯¤°¤Ë¥Ñ¥Ã¥Á¤Ç½¤Àµ¤µ¤ì¡¢¿¼¹ï¤Ê¥Ð¥°¤Ë¤Ï¡¢¤Û¤È¤ó¤É¤¤¤Ä
-¤â¿·¤·¤¤¥ê¥ê¡¼¥¹¤¬¤¢¤ê¤Þ¤¹¡£
-
-@cindex Year 2000 compliance
-@node Year 2000 compliance, General-SQL, Stability, Introduction
-@section 2000 ǯÂбþ
-
-@strong{MySQL} ¼«¿È¤Ï 2000 ǯÌäÂê(Y2K)¤ËÂФ·¤Æ²¿¤ÎÌäÂê¤â»ý¤Ã¤Æ¤¤¤Þ¤»¤ó:
-
-@itemize @bullet
-@item
-@strong{MySQL} ¤Ï Unix »þ´Ö´Ø¿ô¤ò»ÈÍѤ·¡¢@code{2069} ǯ¤Þ¤ÇÆüÉդˤϲ¿¤Î
-ÌäÂê¤â¤¢¤ê¤Þ¤»¤ó; Á´¤Æ¤Î2·å¤Îǯ¤Ï @code{1970} ¤«¤é @code{2069} ¤ÎÈϰϤË
-¤¢¤ë¤È¸«¤Ê¤µ¤ì¤Þ¤¹¡£¤³¤ì¤Ï¡¢@code{year} ¥Õ¥£¡¼¥ë¥ÉÆâ¤Ë @code{01} ¤ò³ÊǼ¤¹¤ë¾ì
-¹ç¡¢@strong{MySQL} ¤Ï¤½¤ì¤ò @code{2001} ¤È¤·¤Æ°·¤¦¤È¤¤¤¦¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£
-
-@item
-Á´¤Æ¤Î @strong{MySQL} ÆüÉÕ´Ø¿ô¤Ï°ì¤Ä¤Î¥Õ¥¡¥¤¥ë @file{sql/time.cc} ¤Ë³ÊǼ
-¤µ¤ì¡¢2000ǯ°ÂÁ´¤Ë¤È¤Æ¤âÃí°Õ¿¼¤¯¥³¡¼¥É²½¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-
-@item
-@strong{MySQL} 3.22 °Ê¹ß¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢¿·¤·¤¤ @code{YEAR} ¥Õ¥£¡¼¥ë¥É·¿¤Ï
-@code{0} ¤È @code{1901} ¤«¤é @code{2155} ¤Þ¤Ç¤Îǯ¤ò1¥Ð¥¤¥È¤Ç³ÊǼ¤Ç¤­¡¢2
-·å¤Þ¤¿¤Ï4·å¤Çɽ¼¨¤Ç¤­¤Þ¤¹¡£
-@end itemize
-
-2000ǯ°ÂÁ´¤Ç¤Ê¤¤ÊýË¡¤Ç @strong{MySQL} ¤ò»ÈÍѤ¹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤ÏÌäÂê
-¤Ë¤Ê¤ê¤Þ¤¹¡£Î㤨¤Ð¡¢Â¿¤¯¤Î¸Å¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï4·åÃͤǤϤʤ¯2·åÃÍ(¤³¤ì
-¤ÏÛ£Ëæ¤Ç¤¹)¤ò»ÈÍѤ·¤Æǯ¤ò³ÊǼ¤·Áàºî¤·¤Þ¤¹¡£¤³¤ÎÌäÂê¤Ï¡¢@code{00} ¤Þ¤¿¤Ï
-@code{99} ¤Î¤è¤¦¤ÊÃͤò ``·ç¤±¤Æ¤¤¤ë'' ÃͤÎɽ¤ï¤ì¤È¤·¤Æ»ÈÍѤ¹¤ë¥¢¥×¥ê¥±¡¼
-¥·¥ç¥ó¤Ë¤è¤Ã¤Æºî¤é¤ì¤Þ¤¹¡£
-
-¤¢¤¤¤Ë¤¯¡¢¤³¤ì¤é¤ÎÌäÂê¤ò½¤Àµ¤¹¤ë¤Î¤Ïº¤Æñ¤Ç¤¹¡£ÍÍ¡¹¤Ê¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬ÍÍ¡¹
-¤Ê¥×¥í¥°¥é¥à¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤Æ¤¤¤Æ¡¢¤½¤Î³Æ¡¹¤¬´·½¬¤ÈÆüÉÕÁàºî´Ø¿ô¤ÎÍÍ¡¹¤ÊÁÈ
-¤ß¹ç¤ï¤»¤ò»ÈÍѤ¹¤ë¤«¤é¤Ç¤¹¡£
-
-¤³¤ì¤Ï¡¢MySQL ¤¬ 2030 ǯ¤Þ¤Ç¤ÎÆüÉդ˲¿¤ÎÌäÂê¤â¤Ê¤¤¤³¤È¤ò¼¨¤¹´Êñ¤Ê¥Æ¥¹¥È
-¤Ç¤¹¡ª
-
-@example
-mysql> DROP TABLE IF EXISTS y2k;
-mysql> CREATE TABLE y2k (date date, date_time datetime, time_stamp timestamp);
-mysql> INSERT INTO y2k VALUES ("1998-12-31","1998-12-31 23:59:59",19981231235959);
-mysql> INSERT INTO y2k VALUES ("1999-01-01","1999-01-01 00:00:00",19990101000000);
-mysql> INSERT INTO y2k VALUES ("1999-09-09","1999-09-09 23:59:59",19990909235959);
-mysql> INSERT INTO y2k VALUES ("2000-01-01","2000-01-01 00:00:00",20000101000000);
-mysql> INSERT INTO y2k VALUES ("2000-02-28","2000-02-28 00:00:00",20000228000000);
-mysql> INSERT INTO y2k VALUES ("2000-02-29","2000-02-29 00:00:00",20000229000000);
-mysql> INSERT INTO y2k VALUES ("2000-03-01","2000-03-01 00:00:00",20000301000000);
-mysql> INSERT INTO y2k VALUES ("2000-12-31","2000-12-31 23:59:59",20001231235959);
-mysql> INSERT INTO y2k VALUES ("2001-01-01","2001-01-01 00:00:00",20010101000000);
-mysql> INSERT INTO y2k VALUES ("2004-12-31","2004-12-31 23:59:59",20041231235959);
-mysql> INSERT INTO y2k VALUES ("2005-01-01","2005-01-01 00:00:00",20050101000000);
-mysql> INSERT INTO y2k VALUES ("2030-01-01","2030-01-01 00:00:00",20300101000000);
-mysql> INSERT INTO y2k VALUES ("2050-01-01","2050-01-01 00:00:00",20500101000000);
-mysql> SELECT * FROM y2k;
-+------------+---------------------+----------------+
-| date | date_time | time_stamp |
-+------------+---------------------+----------------+
-| 1998-12-31 | 1998-12-31 23:59:59 | 19981231235959 |
-| 1999-01-01 | 1999-01-01 00:00:00 | 19990101000000 |
-| 1999-09-09 | 1999-09-09 23:59:59 | 19990909235959 |
-| 2000-01-01 | 2000-01-01 00:00:00 | 20000101000000 |
-| 2000-02-28 | 2000-02-28 00:00:00 | 20000228000000 |
-| 2000-02-29 | 2000-02-29 00:00:00 | 20000229000000 |
-| 2000-03-01 | 2000-03-01 00:00:00 | 20000301000000 |
-| 2000-12-31 | 2000-12-31 23:59:59 | 20001231235959 |
-| 2001-01-01 | 2001-01-01 00:00:00 | 20010101000000 |
-| 2004-12-31 | 2004-12-31 23:59:59 | 20041231235959 |
-| 2005-01-01 | 2005-01-01 00:00:00 | 20050101000000 |
-| 2030-01-01 | 2030-01-01 00:00:00 | 20300101000000 |
-| 2050-01-01 | 2050-01-01 00:00:00 | 00000000000000 |
-+------------+---------------------+----------------+
-
-13 rows in set (0.00 sec)
-@end example
-
-¤³¤ì¤Ï¡¢@code{DATE} ¤È @code{DATETIME} ·¿¤Ï̤Íè¤Î¤¤¤«¤Ê¤ëÆüÉդˤª¤¤¤Æ
-ÌäÂê¤Î¤Ê¤¤¤³¤È¤ò¤ò¤·¤á¤·¤Þ¤¹ (¤³¤ì¤éÆüÉÕ¤Ï 9999 ǯ¤Þ¤Ç°·¤¨¤Þ¤¹)
-
-@code{TIMESTAMP} ·¿¤Ï¡¢»þ¹ï¤òÊݸ¤·¤Þ¤¹¤¬¡¢@code{2030-01-01} ¤Þ¤Ç¤Ç¤¹¡£
-@code{TIMESTAMP} ¤Ï 32-bit ¥Þ¥·¥ó¤Ç¤Ï @code{1970} ¤«¤é @code{2030} ¤ÎÈϰϤǤ¹¡£
-64-bit ¥Þ¥·¥ó¤Ç¤Ï¡¢ @code{2106} ǯ¤Þ¤Ç°·¤¨¤ì¤Þ¤¹¡£
-
-@strong{MySQL} ¤Ï 2000ǯÂбþ¤Ç¤¹¤¬¡¢Û£Ëæ¤Ç¤Ê¤¤ÆþÎϤòÄ󶡤¹¤ë¤Î¤Ï¤¢¤Ê¤¿¤Î
-ÀÕǤ¤Ç¤¹¡£Û£Ëæ¤ÊÆüÉÕ¤ÎÆþÎϥǡ¼¥¿¡Ê2·å¤Îǯ¤ÎÃ͡ˤΰ·¤¤¤Ë¤Ä¤¤¤Æ¤Î
-@strong{MySQL} ¤Îµ¬Â§¤Ë¤Ä¤¤¤Æ¤Ï @ref{Y2K issues} ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@node General-SQL, Useful Links, Year 2000 compliance, Introduction
-@section °ìÈÌŪ¤Ê SQL ¾ðÊó¤È¥Á¥å¡¼¥È¥ê¥¢¥ë
-
-¤³¤ÎËÜ¤Ï @strong{MySQL} ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤Î¿ô¿Í¤Ë¤è¤Ã¤Æ¿ä¾©¤µ¤ì¤Æ¤¤¤Þ¤¹:
-
-@example
-Judith S. Bowman, Sandra L. Emerson and Marcy Darnovsky
-The Practical SQL Handbook: Using Structured Query Language
-Second Edition
-Addison-Wesley
-ISBN 0-201-62623-3
-http://www.awl.com
-@end example
-
-¤³¤ÎËܤâ @strong{MySQL} ¥æ¡¼¥¶¡¼¤Ë¤¤¤¯¤Ä¤«¤Î¿äÁ¦¤ò¼õ¤±¤Æ¤¤¤Þ¤¹:
-
-@example
-Martin Gruber
-Understanding SQL
-ISBN 0-89588-644-8
-Publisher Sybex 510 523 8233
-Alameda, CA USA
-@end example
-
-SQL ¥Á¥å¡¼¥È¥ê¥¢¥ë¤¬¥Í¥Ã¥È¾å¤Ë¤¢¤ê¤Þ¤¹
-@url{http://www.geocities.com/SiliconValley/Vista/2207/sql1.html}
-
-SQL in 21 Tagen (online book in German language):
-@url{http://www.mut.de/leseecke/buecher/sql/inhalt.htm}
-
-@node Useful Links, , General-SQL, Introduction
-@section ÊØÍø¤Ê @strong{MySQL} ´ØÏ¢¥ê¥ó¥¯
-
-¼¡¤Î¥ê¥ó¥¯°Ê³°¤Ë¤â¡¢Â¿¤¯¤Î @strong{MySQL} ¥×¥í¥°¥é¥à¡¢¥Ä¡¼¥ë¡¢API ¤ò
-@uref{http://www.mysql.com/Contrib/, Contrib directory} ¤«¤é¸«¤Ä¤±¤Æ¥À¥¦
-¥ó¥í¡¼¥É¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@subheading Tutorials
-@itemize @bullet
-
-@item @uref{http://www.devshed.com/resource/advanced/mysql/index.html, A
-beginner's tutoral of how to start using @strong{MySQL}}
-
-@item @uref{http://www.analysisandsolutions.com/code/mybasic.htm}
-Beginners @strong{MySQL} Tutorial on how to install and set up
-@strong{MySQL} on a Windows machine.
-
-@item @uref{http://www.devshed.com/Server_Side/MySQL/, A lot of @strong{MySQL} tutorials}
-
-@item @uref{http://www.linuxplanet.com/linuxplanet/tutorials/1046/1/,
-Setting Up a @strong{MySQL}-Based Website}
-
-@item @uref{http://www.hotwired.com/webmonkey/backend/tutorials/tutorial1.html, @strong{MySQL}-Perl tutorial}
-
-@item @uref{http://www.iserver.com/support/contrib/perl5/modules.html,Installing new Perl modules that require locally installed modules}
-
-@item @uref{http://www.hotwired.com/webmonkey/databases/tutorials/tutorial4.html, PHP/@strong{MySQL} Tutorial}
-
-@item @uref{http://www.useractive.com/, Hands on tutorial for @strong{MySQL}}
-@end itemize
-
-@subheading Porting MySQL / Using MySQL on different systems
-@itemize @bullet
-@item @uref{http://xclave.macnn.com/MySQL/,The MacOS Xclave}.
-Running @strong{MySQL} on MacOSX
-@item @uref{http://www.prnet.de/RegEx/mysql.html, MySql for MacOSX Server}
-@item @uref{http://www.lilback.com/macsql/, Client libraries for the Macintosh}
-@end itemize
-
-@subheading Perl related links
-@itemize @bullet
-@item
-@c Added 991122
-@uref{http://haven.e-cactus.com/dbi_mysql, Perl DBI with @strong{MySQL} FAQ}
-@end itemize
-
-@subheading MySQL discussion forums
-@itemize @bullet
-@item
-@uref{http://www.weberdev.com/, Examples using @strong{MySQL}; (check Top 20)}
-@item
-@uref{http://futurerealm.com/forum/futureforum.htm, FutureForum Web Discussion Software}
-@end itemize
-
-@c We should get longer descriptions for things in this category!
-@subheading Commercial applications that support MySQL
-@itemize @bullet
-@item
-@uref{http://www.supportwizard.com/, SupportWizard; Interactive helpdesk
-on the web (This product includes a licensed copy of @strong{MySQL})}
-@item
-@uref{http://www.stweb.org/, StWeb}
-StWeb - Stratos Web and Application server - an easy-to-use, cross
-platform, Internet/Intranet development and deployment system for
-development of web-enabled applications. The standard version of StWeb
-has a native interface to @strong{MySQL} database.
-@item
-@uref{http://www.rightnowtech.com/, Right Now Web; Web automation for customer service}
-@item
-@uref{http://www.ecker-software.de, Win32 GUI client}
-A Win32 GUI client by David Ecker.
-@item
-@uref{http://www.icaap.org/Bazaar/, Bazaar; Interactive Discussion Forums with web interface}
-@item
-@uref{http://www.phonesweep.com/, PhoneSweepT} is the world's first
-commercial Telephone Scanner. Many break-ins in recent years have come
-not through the Internet, but through unauthorized dial-up
-modems. PhoneSweep lets you find these modems by repeatedly placing
-phone calls to every phone number that your organization
-controls. PhoneSweep has a built-in expert system that can recognize
-more than 250 different kinds of remote-access programs, including
-Carbon Copy(TM), pcANYWHERET(TM), and Windows NT RAS. All information is stored
-in the SQL database. It then generates a comprehensive report detailing
-which services were discovered on which dial-up numbers in your
-organization.
-@end itemize
-
-@subheading SQL ¥¯¥é¥¤¥¢¥ó¥È/Report writers
-
-@itemize @bullet
-@item
-@uref{http://www.urbanresearch.com/software/utils/urbsql/index.html,
-@strong{MySQL} Editor/Utility for MS Windows Platforms.}
-@item
-@uref{http://www.xnot.com/kmysql, KDE @strong{MySQL} client}
-@item
-@c EMAIL: bilhaut_f@mail.cpod.fr (Frik Bilhaut)
-@uref{http://www.penguinpowered.com/~kmysql, KMySQL}
-KMySQL is a database client for KDE that primarily supports @strong{MySQL}.
-@item
-@uref{http://www.icaap.org/software/kiosk/, Kiosk; a @strong{MySQL} client for
-database management}. Written in Perl. Will be a part of Bazaar.
-@item
-@uref{http://www.geocities.com/SiliconValley/Ridge/4280/GenericReportWriter/grwhome.html, A free report writer in Java}
-@item
-@uref{http://futurerealm.com/opensource/futuresql.htm, FutureSQL Web Database Administration Tool}.
-FutureSQL by Peter F. Brown, is a Free, Open Source Rapid Application
-Development web database administration tool, written in Perl,
-using @strong{MySQL}. It uses @code{DBI:DBD} and @code{CGI.pm}.
-
-FutureSQL allows one to easily setup config files to view, edit, delete
-and otherwise process records from a @strong{MySQL} database. It uses a data
-dictionary, configuration files and templates, and allows "pre-processing"
-and "post-processing" on both fields, records and operations.
-@item
-@uref{http://www.javaframework.de,MySQLExport}
-Export of @strong{MySQL} create statements and data in a lot of
-different formats (SQL, HTML, CVS, text, ZIP, GZIP...)
-@end itemize
-
-@subheading @strong{MySQL} ¤ò¥µ¥Ý¡¼¥È¤¹¤ë Web ³«È¯¥Ä¡¼¥ë
-
-@itemize @bullet
-@item
-@uref{http://www.php.net/, PHP: A server-side HTML-embedded scripting
-language}
-@item
-@uref{http://www.midgard-project.org, The Midgard Application Server; a
-powerful Web development environment based on @strong{MySQL} and PHP}
-@item
-@uref{http://www.smartworker.org, SmartWorker is a platform for web application development}
-@item
-@uref{http://xsp.lentus.se/, XSP: e(X)tendible (S)erver (P)ages and is a
-HTML embedded tag language written in Java (previously known as XTAGS)}
-@uref{http://www.dbServ.de/, dbServ} is an extension to a web server to
-integrate databases output into your HTML code. You may use any HTML
-function in your output. Only the client will stop you. It works as
-standalone server or as JAVA servlet.
-@item
-@uref{http://www.chilisoft.com/, Platform independent ASP from Chili!Soft}
-@c @item
-@c no answer from server 990830
-@c @uref{http://www.voicenet.com/~zellert/tjFM, A JDBC driver for @strong{MySQL}}
-@item
-@uref{http://www.wernhart.priv.at/php/, @strong{MySQL} + PHP demos}
-@item
-@uref{http://www.dbwww.com/, ForwardSQL: HTML interface to manipulate @strong{MySQL} databases}
-@item
-@uref{http://www.daa.com.au/~james/www-sql/, WWW-SQL: Display database
-information}
-@item
-@uref{http://www.minivend.com/minivend/, Minivend: A Web shopping cart}
-@item
-@uref{http://www.heitml.com/, HeiTML: A server-side extension of HTML and
-a 4GL language at the same time}
-@item
-@uref{http://www.metahtml.com/, Metahtml: A Dynamic Programming Language
-for WWW Applications}
-@item
-@uref{http://www.binevolve.com/, VelocityGen for Perl and Tcl}
-@item
-@uref{http://hawkeye.net/, Hawkeye Internet Server Suite}
-@item
-@uref{http://www.fastflow.com/, Network Database Connection For Linux}
-@item
-@uref{http://www.wdbi.net/,
-WDBI: Web browser as a universal front end to databases which supports
-@strong{MySQL} well.}
-@item
-@uref{http://www.webgroove.com/, WebGroove Script: HTML compiler and server-side scripting language}
-@item
-@uref{http://www.ihtml.com/, A server-side web site scripting language}
-@item
-@uref{ftp://ftp.igc.apc.org/pub/myodbc/README, How to use @strong{MySQL} with ColdFusion on Solaris}
-@item
-@uref{http://calistra.com/MySQL/,Calistra's ODBC @strong{MySQL} Administrator}
-@item
-@uref{http://www.webmerger.com, Webmerger}
-This CGI tool interprets files and generates dynamic output
-based on a set of simple tags. Ready-to-run drivers for @strong{MySQL} and PostgreSQL
-through ODBC.
-@item
-@uref{http://phpclub.unet.ru/index_e.php3, PHPclub}. Tips and tricks for PHP
-@item
-@uref{http://www.penguinservices.com/scripts, @strong{MySQL} and Perl Scripts}
-@item
-@uref{http://www.widgetchuck.com, The Widgetchuck; Web Site Tools and Gadgets}
-@item
-@uref{http://www.adcycle.com/, AdCycle} advertising management software
-@item
-@uref{http://www.bidsystems.com/pwPage, pwPage} provides an extremely
-fast and simple approach to the creation of database forms. That is,
-if a database table exists and an HTML page has been constructed using
-a few simple guidelines, pwPage can be immediately used for table data
-selections, insertions, updates, deletions and selectable table content
-reviewing.
-@item
-@uref{http://www.omnis-software.com/products/studio/studio.html, OMNIS}
-OMNIS Studio is a rapid application development (RAD) tool.
-@end itemize
-
-@subheading Database design tools with MySQL support
-@itemize @bullet
-@item
-@uref{http://www.mysql.com/dezign/index.html, "DeZign for
-databases" is a database development tool using an
-entity relationship diagram (ERD).}
-@end itemize
-
-@subheading @strong{MySQL} ¥Ä¡¼¥ë¤Ç¤Î Web ¥µ¡¼¥Ð
-
-@itemize @bullet
-@item
-@uref{http://bourbon.netvision.net.il/mysql/mod_auth_mysql/, An Apache
-authentication module}
-@item
-@uref{http://www.roxen.com/, The Roxen Challenger Web server}
-@end itemize
-
-@subheading Extensions for other programs
-@itemize @bullet
-@item
-@uref{http://www.seawood.org/msql_bind/, @strong{MySQL} support for BIND
-(The Internet Domain Name Server)}
-@item
-@uref{http://www.inet-interactive.com/sendmail, @strong{MySQL} support for
-Sendmail and Procmail}
-@end itemize
-
-@subheading Using @code{MySQL} with other programs
-
-@itemize @bullet
-@item
-@uref{http://www.iserver.com/support/addonhelp/database/mysql/msaccess.html, Using @strong{MySQL} with Access}
-@item
-@uref{http://www.iserver.com/support/contrib/perl5/modules.html,Installing new Perl modules that require locally installed modules}
-@end itemize
-
-@subheading ODBC related links
-
-@itemize @bullet
-@item
-@uref{http://www.iodbc.org/,Popular iODBC Driver Manager (libiodbc) now available in Open Source format}
-@item
-@uref{http://users.ids.net/~bjepson/freeODBC/,The FreeODBC Pages}
-@item
-@uref{http:/http://genix.net/unixODBC/,unixodbc}
-The unixODBC Project goals are to develop and promote unixODBC to be the
-definitive standard for ODBC on the Linux platform.
-This is to include GUI support for KDE.
-@end itemize
-
-@subheading @strong{API} ´ØÏ¢¥ê¥ó¥¯
-
-@itemize @bullet
-@item
-@uref{http://www.amedea.cz/mysqlx/index.html, MySQL COM extension}
-With this COM objects You can use MySQL also on Windows platform with ASP
-pages or Delphi, Visual Basic, Visual C++, ... languages.
-@item
-@uref{http://www.jppp.com, www.jppp.com}
-Partially implemented TDataset-compatible components for @strong{MySQL}.
-@item
-@uref{http://www.riverstyx.net/qpopmysql/,qpopmysql}
-A patch to allow POP3 authentication from a @strong{MySQL} database.
-There's also a link to Paul Khavkine's patch for Procmail to allow
-any MTA to deliver to users in a @strong{MySQL} database.
-@item
-@uref{http://www.pbc.ottawa.on.ca,Visual Basic class generator for Active X}
-@item
-@uref{http://www.lilback.com/macsql/, Client libraries for the Macintosh}
-@c @item
-@c @uref{http://tfdec1.fys.kuleuven.ac.be/~michael/fpc-linux/mysql,
-@c @strong{MySQL} binding to Free Pascal}
-@item
-@uref{http://www.dedecker.net/jessie/scmdb/, SCMDB}.
-SCMDB is an add-on for SCM that ports the mysql C library to scheme (SCM).
-With this library scheme developers can make connections to a mySQL
-database and use embedded SQL in their programs.
-@end itemize
-
-
-@subheading ¾¤Î @strong{MySQL} ´ØÏ¢¥ê¥ó¥¯
-
-@itemize @bullet
-@item
-@uref{http://www.wix.com/mysql-hosting, Registry of Web providers who
-support @strong{MySQL}}
-@item
-@uref{http://www.softagency.co.jp/mysql/index.en.phtml, Links about using
-@strong{MySQL} in Japan/Asia}
-@item
-@uref{http://www.open.com.au/products.html, Commercial Web defect tracking
-system}
-@item
-@uref{http://www.stonekeep.com/pts/, PTS: Project Tracking System}
-@item
-@uref{http://tomato.nvgc.vt.edu/~hroberts/mot, Job and software tracking
-system}
-@c @item
-@c Error 404 990830
-@c @uref{http://home.wxs.nl/cgi-bin/planeteers/pgidszoek.cgi, Full-text search engine using @strong{MySQL}}
-@item
-@uref{http://www.cynergi.net/non-secure/exportsql/, ExportSQL: A script
-to export data from Access95+}
-@item
-@uref{http://SAL.KachinaTech.COM/H/1/MYSQL.html, SAL (Scientific
-Applications on Linux) @strong{MySQL} entry}
-@item
-@c Removed 990510
-@c @item
-@c @uref{http://www.cgishop.com/bin/mysqllist, @strong{MySQL} Apps and
-@c Utilities Listing}
-@c @uref{http://www.luth.se/~goggi/proj/mysql/man/mysql.pdf, The
-@c @strong{MySQL} reference manual in Adobe PDF format}
-@item
-@uref{http://www.infotech-nj.com/itech/index.shtml, A consulting company
-which mentions @strong{MySQL} in the right company}
-@item
-@uref{http://www.pmpcs.com/, PMP Computer Solutions. Database developers using
-@strong{MySQL} and @code{mSQL}}
-@item
-@uref{http://www.aewa.org, Airborne Early Warning Association }
-@item
-@uref{http://abattoir.cc.ndsu.nodak.edu/~nem/mysql/udf/, @strong{MySQL} UDF Registry}
-@item
-@uref{http://21ccs.com/~gboersm/y2kmatrix/, Y2K tester}
-@end itemize
-
-@subheading SQL ¤È¥Ç¡¼¥¿¥Ù¡¼¥¹¥¤¥ó¥¿¥Õ¥§¡¼¥¹
-@itemize @bullet
-@item
-@uref{http://java.sun.com/products/jdbc/, The JDBC database access API}
-@item
-@uref{http://www.gagme.com/mysql, Patch for @code{mSQL} Tcl}
-@item
-@uref{http://www.amsoft.ru/easysql/, EasySQL: An ODBC-like driver manager}
-@item
-@uref{http://www.lightlink.com/hessling/rexxsql.html, A REXX interface to SQL databases}
-@item
-@uref{http://www.binevolve.com/~tdarugar/tcl-sql, Tcl interface}
-@end itemize
-
-@subheading Îã¤È¥½¡¼¥¹
-
-@itemize @bullet
-@item
-@c Added 990601
-@c EMAIL: thuss@little6.com (Todd Huss)
-@uref{http://www.little6.com/about/linux/, Little6 Inc} An online contract and job finding site that is powered by @strong{MySQL}, PHP3 and Linux.
-@item
-@c Added 990521
-@c EMAIL: nh@delec.com (Hillbrecht Nicole)
-@uref{http://www.delec.com/is/products/prep/examples/BookShelf/index.html, DELECis} A tool which makes it very easy to create an automatically generated table documentation. They have used @strong{MySQL} as an example.
-@c @item
-@c Added 990531. Removed 000201 -> No answer from server
-@c EMAIL: sfambro@hotmail.com (Steve Fambro)
-@c @uref{http://shredder.elen.utah.edu/steve.html, Steve Fambro}
-@c Uses @strong{MySQL} and webmerger. There is an employee database, and a
-@c license plate database with all of the registered Utah vehicles (over
-@c 1.2 million). The License plate field is indexed.....so the *searches*
-@c are instantaneous.
-@item
-@c Added 990521
-@c EMAIL: info@worldrecords.com (Jim Rota)
-@uref{http://www.worldrecords.com, World Records} A search engine for information about music that uses @strong{MySQL} and PHP.
-@item
-@uref{http://www.webtechniques.com/archives/1998/01/note/,
-A Contact Database using @strong{MySQL} and PHP}
-@item
-@uref{http://modems.rosenet.net/mysql/, Web based interface and Community Calender with PHP}
-@item
-@uref{http://www.odbsoft.com/cook/sources.htm, Perl package to generate html from a SQL table structure and for generating SQL statements from an html form.}
-@item
-@uref{http://www.gusnet.cx/proj/telsql/,Basic telephone database using @code{DBI}/@code{DBD}}.
-@item
-@uref{http://www.productivity.org/projects/mysql/, @strong{TmySQL}; A library to use @strong{MySQL} with Delphi}
-@item
-@uref{http://tecfa.unige.ch/guides/java/staf2x/ex/jdbc/coffee-break, JDBC examples by Daniel K. Schneider}
-@item
-@uref{http://www.spade.com/linux/howto/PostgreSQL-HOWTO-41.html,SQL BNF}
-@item
-@uref{http://www.ooc.com/, Object Oriented Concepts Inc; CORBA applications with examples in source}
-@item
-@uref{http://www.pbc.ottawa.on.ca/,DBWiz; Includes an example of how to manage own cursors in VB}
-@item
-@uref{http://keilor.cs.umass.edu/pluribus/, Pluribus}
-Pluribus, is a free search engine that learns to improve
-the quality of its results over time. Pluribus works by recording
-which pages a user prefers among those returned for a query. A user
-votes for a page by selecting it; Pluribus then uses that knowledge
-to improve the quality of the results when someone else submits the
-same (or similar) query. Uses PHP and @strong{MySQL}.
-@item
-@c EMAIL: paul@sword.damocles.com (Paul Bannister)
-@uref{http://www.stopbit.com/, Stopbit}
-A technology news site using @strong{MySQL} and PHP
-@item
-@c Added 990604
-@c EMAIL: ah@dybdahl.dk
-@uref{http://www.jokes2000.com/scripts/, Example scripts at Jokes2000}
-@item
-@uref{http://www.linuxsupportline.com/~kalendar/ KDE based calendar manager}
-The calendar manager has both single user (file based) and multi user
-(@strong{MySQL} database) support.
-@item
-@uref{http://tim.desert.net/~tim/imger/,Example of storing/retrieving images with @strong{MySQL} and CGI}
-@item
-@uref{http://www.penguinservices.com/scripts, Online shopping cart system}
-@end itemize
-
-@subheading °ìÈÌŪ¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹¥ê¥ó¥¯
-@itemize @bullet
-@item
-@uref{http://www.pcslink.com/~ej/dbweb.html, Database Jump Site}
-@item
-@uref{http://black.hole-in-the.net/guy/webdb/, Homepage of the webdb-l
-(Web Databases) mailing list.}
-@item
-@uref{http://www.symbolstone.org/technology/perl/DBI/index.html,
-Perl @code{DBI}/@code{DBD} modules homepage}
-@item
-@uref{http://www.student.uni-koeln.de/cygwin/, Cygwin tools. UNIX on top of Windows}
-@item
-@uref{http://dbasecentral.com/, dbasecentral.com; Development and distribution of powerful and easy-to-use database applications and systems.}
-@item
-@uref{http://www.Tek-Tips.com, Tek-Tips Forums} Tek-Tips Forums are 800+
-independent peer-to-peer non-commercial support forums for Computer
-Professionals. Features include automatic e-mail notification of
-responses, a links library, and member confidentiality guaranteed.
-@end itemize
-
-@strong{MySQL} ¤ò»ÈÍѤ·¤¿Â¿¤¯¤Î web ¥Ú¡¼¥¸¤â¤¢¤ê¤Þ¤¹¡£@xref{Users}¡£¤³¤Î
-¥ê¥¹¥È¤ØÄɲäǤ­¤ë¤â¤Î¤ò @email{webmaster@@mysql.com} ¤ËÁ÷¤Ã¤Æ¤¯¤À¤µ¤¤¡£
-We now require that you show a
-@strong{MySQL} logo somewhere (It is okay to have it on a ``used tools'' page
-or something similar) to be added.
-
-@cindex Reporting errors
-@cindex @strong{MySQL} mailing lists
-@node Questions, Licensing and Support, Introduction, Top
-@chapter @strong{MySQL} ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤È¼ÁÌä¤ò¤¹¤ëÊýË¡¤Þ¤¿¤Ï¥¨¥é¡¼(¥Ð¥°)¤òÊó¹ð¤¹¤ëÊýË¡
-
-@menu
-* Mailing-list:: @strong{MySQL} ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È
-* Asking questions:: ¼ÁÌä¤ä¥Ð¥°¤ÎÊó¹ð
-* Bug reports:: ¥Ð¥°¤äÌäÂê¤òÊó¹ð¤¹¤ëÊýË¡
-* Answering questions:: ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤Ç¼ÁÌä¤ËÅú¤¨¤ë¤¿¤á¤Î¥¬¥¤¥É¥é¥¤¥ó
-@end menu
-
-@node Mailing-list, Asking questions, Questions, Questions
-@section @strong{MySQL} ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È
-
-¥á¥¤¥ó @strong{MySQL} ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤ò¹ØÆɤ¹¤ë¤Ë¤Ï¡¢¥á¥Ã¥»¡¼¥¸¤ò
-ÅŻҥ᡼¥ë¥¢¥É¥ì¥¹ @email{mysql-subscribe@@lists.mysql.com} ¤ËÁ÷¤Ã¤Æ¤¯¤À¤µ¤¤¡£
-
-¥á¥¤¥ó @strong{MySQL} ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤Î¹ØÆɤÎÃæ»ß¤Ï¡¢¥á¥Ã¥»¡¼¥¸¤ò
-ÅŻҥ᡼¥ë¥¢¥É¥ì¥¹ @email{mysql-unsubscribe@@lists.mysql.com} ¤ËÁ÷¤Ã¤Æ¤¯¤À¤µ¤¤¡£
-
-¥á¥Ã¥»¡¼¥¸¤òÁ÷¤ëÀè¤Î¥¢¥É¥ì¥¹¤À¤±¤¬½ÅÍפǤ¹¡£¥á¥Ã¥»¡¼¥¸¤Î¥µ¥Ö¥¸¥§¥¯¥È¤È
-ËÜʸ¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£
-
-@c the last two addresses in this paragraph are NOT @email because they
-@c shouldn't be live links.
-¤â¤·¡¢¤¢¤Ê¤¿¤Î¥ê¥×¥é¥¤¥¢¥É¥ì¥¹¤¬ÂÅÅö¤Êʪ¤Ç¤Ê¤¤¾ì¹ç¡¢¥¢¥É¥ì¥¹¤òÌÀ³Î¤Ë»ØÄꤹ¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
-subscribe ¤¢¤ë¤¤¤Ï unsubscribe ¤Î¤¢¤È¤Ë¥Ï¥¤¥Õ¥ó¤òÉÕ¤±¡¢¤½¤Î¤¢¤È¤Ë¤¢¤Ê¤¿¤Î
-¥¢¥É¥ì¥¹¤òµ­½Ò¤·¤Þ¤¹¡£¤¿¤À¤· @samp{@@} ʸ»ú¤Ï @samp{=} ¤ËÃÖ¤­ÊѤ¨¤Æ½ñ¤­¤Þ¤¹¡£
-Î㤨¤Ð¡¢ @code{john@@host.domain} ¤Ç¹ØÆɤ·¤¿¤¤¾ì¹ç¡¢
- @code{mysql-subscribe-john=host.domain@@lists.mysql.com} °¸¤Ë¥á¥Ã¥»¡¼¥¸¤òÁ÷¤ê¤Þ¤¹¡£
-
-@email{mysql-subscribe@@lists.mysql.com} ¤ä @email{mysql-unsubscribe@@lists.mysql.com}
-¤Ø¤Î¥á¡¼¥ë¤Ï ezmlm ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¥×¥í¥»¥Ã¥µ¤Ë¤è¤Ã¤Æ¼«Æ°Åª¤Ë½èÍý¤µ¤ì¤Þ¤¹¡£
-ezmlm ¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï @uref{http://www.ezmlm.org, The ezmlm Website}.
-
-Ëܥ᡼¥ê¥ó¥°¥ê¥¹¥È¤Ø¤ÎÅê¹Æ¤ò¹Ô¤¦¤Ë¤Ï¡¢@code{mysql@@lists.mysql.com} ¤Ë¥á¥Ã¥»¡¼¥¸¤òÁ÷¤ê¤Þ¤¹¡£
-¤·¤«¤·¡¢subscribe ¤¢¤ë¤¤¤Ï unsubscribe ¤Î¥á¡¼¥ë¤ò
- @email{mysql@@lists.mysql.com} ¤Ë@emph{Á÷¤é¤Ê¤¤¤Ç¤¯¤À¤µ¤¤}¡£
-¤³¤ì¤é¤Î¥¢¥É¥ì¥¹¤ØÁ÷¤é¤ì¤¿¥á¡¼¥ë¤Ï¡¢²¿Àé¤â¤Î¥æ¡¼¥¶¡¼¤ËÇÛÁ÷¤µ¤ì¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
-
-¤¢¤Ê¤¿¤Î¥í¡¼¥«¥ë¥µ¥¤¥È¤¬Â¿¤¯¤Î @email{mysql@@lists.mysql.com} ¹ØÆɼԤò»ý¤Ä¤³¤È¤â
-¤¢¤ê¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢¥í¡¼¥«¥ë¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤òºî¤ê¡¢@code{lists.mysql.com} ¤«¤é¤Î
-°ì¤Ä¤Î¥á¥Ã¥»¡¼¥¸¤¬¤½¤Î¥µ¥¤¥È¤ËÁ÷¤é¤ì¡¢¥í¡¼¥«¥ë¤Ê¥ê¥¹¥È¤ÇÊ£¼Ì¤µ¤ì¤ë¤è¤¦¤Ë
-¤·¤Æ¤¯¤À¤µ¤¤¡£¤³¤Î¾ì¹ç¡¢¥í¡¼¥«¥ë¤Î @strong{MySQL} ¥ê¥¹¥È¤Ø¤ÎÄɲäȺï½ü¤Ï¡¢
-¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à´ÉÍý¼Ô¤ËÌ䤤¹ç¤ï¤»¤Æ²¼¤µ¤¤¡£
-
-¼¡¤Î @strong{MySQL} ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤¬¤¢¤ê¤Þ¤¹:
-
-@table @code
-@item announce
-¤³¤ì¤Ï @strong{MySQL} ¤È´ØÏ¢¥×¥í¥°¥é¥à¤Î¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Î¥¢¥Ê¥¦¥ó¥¹¤Î¤¿
-¤á¤Ç¤¹¡£¤³¤ì¤Ï¡¢Á´¤Æ¤Î @strong{MySQL} ¥æ¡¼¥¶¤¬Æþ¤ë¤Ù¤­¤È²æ¡¹¤¬¹Í¤¨¤ë¾¯¤Ê
-¤¤Î̤Υꥹ¥È¤Ç¤¹¡£
-
-@item mysql
-°ìÈ̤Π@strong{MySQL} µÄÏÀ¤Î¤¿¤á¤Î¼ç¤Ê¥ê¥¹¥È¤Ç¤¹¡£¤µ¤é¤ËÀìÌçŪ¤Ê¥ê¥¹¥È¤Ë
-¹Ô¤¯¤Ù¤­¤â¤Î¤â¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£´Ö°ã¤Ã¤¿¥ê¥¹¥È¤ËÅê¹Æ¤·¤Æ¤â¡¢Åú
-¤òÆÀ¤é¤ì¤Ê¤¤¤Ç¤·¤ç¤¦¡ª
-
-@item mysql-digest
-¥À¥¤¥¸¥§¥¹¥È·Á¼°¤Î @code{mysql} ¥ê¥¹¥È¤Ç¤¹¡£¤³¤ì¤Ï¡¢°ìÆü¤Ë°ì²ó¡¢°ì¤Ä¤ÎÂç
-¤­¤Ê¥á¡¼¥ë¤¬Á÷¤é¤ì¤ë¤³¤È¤Ç¸Ä¡¹¤Î¥á¥Ã¥»¡¼¥¸Á´¤Æ¤¬ÆÀ¤é¤ì¤ë¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£
-
-@item bugs
-¤³¤Î¥ê¥¹¥È¤Ë¤Ï¡¢´°Á´¤ÇºÆ¸½²Äǽ¤Ê¥Ð¥°¥ì¥Ý¡¼¥È¤À¤±¤ò¡¢@code{mysqlbug} ¤ò»È
-ÍѤ·¤ÆÅê¹Æ¤¹¤Ù¤­¤Ç¤¹(Windows ¾å¤Ç¼Â¹Ô¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢OS ¤È
-@strong{MySQL} ¥Ð¡¼¥¸¥ç¥ó¤Îµ­½Ò¤ò´Þ¤á¤ë¤Ù¤­¤Ç¤¹)¡£¤Ç¤­¤ì¤Ð¡¢Åê¹ÆÁ°¤Ë
-@strong{MySQL} ¤ÎºÇ¿·¤Î°ÂÄê¥Ð¡¼¥¸¥ç¥ó¤«³«È¯¥Ð¡¼¥¸¥ç¥ó¤ò»ÈÍѤ·¤ÆÌäÂê¤ò¥Æ
-¥¹¥È¤¹¤Ù¤­¤Ç¤¹¡ª ´Þ¤á¤é¤ì¤¿¥Æ¥¹¥È¥±¡¼¥¹¾å¤Ç¡¢'mysql test < script' ¤ò»È
-ÍѤ¹¤ë¤³¤È¤Ç¡¢Ã¯¤â¤¬¥Ð¥°¤òºÆ¸½¤Ç¤­¤ë¤Ù¤­¤Ç¤¹¡£¤³¤Î¥ê¥¹¥È¤ËÅê¹Æ¤µ¤ì¤¿Á´¤Æ
-¤Î¥Ð¥°¤Ï¡¢¼¡¤Î @strong{MySQL} ¥ê¥ê¡¼¥¹¤Ç½¤Àµ¤µ¤ì¤ë¤«¥É¥­¥å¥á¥ó¥È²½¤µ¤ì¤Þ
-¤¹¡ª ¾®¤µ¤Ê¥³¡¼¥É¤ÎÊѹ¹¤À¤±¤Ç¤¹¤á¤Ð¡¢²æ¡¹¤Ï¤³¤ÎÌäÂê¤ò½¤Àµ¤¹¤ë¥Ñ¥Ã¥Á¤ÎÅê
-¹Æ¤â¹Ô¤Ê¤¤¤Þ¤¹¡£
-
-@item bugs-digest
-¥À¥¤¥¸¥§¥¹¥È·Á¼°¤Î @code{bugs} ¥ê¥¹¥È¤Ç¤¹¡£
-
-@item developer
-@strong{MySQL} ¥³¡¼¥É¤òÆ°¤«¤¹¿Í¤Î¤¿¤á¤Î¥ê¥¹¥È¡£¤³¤Î¥ê¥¹¥È¤Ç¤Ï
-@strong{MySQL} ³«È¯¤ÎµÄÏÀ¤È¥Ñ¥Ã¥Á¤ÎÅê¹Æ¤â²Äǽ¤Ç¤¹¡£
-
-@item developer-digest
-@code{developer} ¥ê¥¹¥È¤Î¥À¥¤¥¸¥§¥¹¥È¥Ð¡¼¥¸¥ç¥ó¡£
-
-@item java
-@strong{MySQL} ¤È Java ¤Ë¤Ä¤¤¤Æ¤ÎµÄÏÀ¡£Â¿¤¯¤Ï JDBC ¥É¥é¥¤¥Ð¤Ë¤Ä¤¤¤Æ¤Ç¤¹¡£
-
-@item java-digest
-@code{java} ¥ê¥¹¥È¤Î¥À¥¤¥¸¥§¥¹¥È¥Ð¡¼¥¸¥ç¥ó¡£
-
-@item win32
-Windows NT ¤Î¤è¤¦¤Ê Microsoft OS ¾å¤Î @strong{MySQL} ¤Ë´ØÏ¢¤¹¤ëÁ´¤Æ¡£
-
-@item win32-digest
-@code{win32} ¥ê¥¹¥È¤Î¥À¥¤¥¸¥§¥¹¥È¥Ð¡¼¥¸¥ç¥ó¡£
-
-@item myodbc
-ODBC ¤Ç @strong{MySQL} ¤Ø¤ÎÀܳ¤Ë´ØÏ¢¤¹¤ëÁ´¤Æ¡£
-
-@item myodbc-digest
-@code{myodbc} ¥ê¥¹¥È¤Î¥À¥¤¥¸¥§¥¹¥È¥Ð¡¼¥¸¥ç¥ó¡£
-
-@item msql-mysql-modules
-@strong{MySQL} ¤Ç¥µ¥Ý¡¼¥È¤¹¤ë Perl ¤Ë¤Ä¤¤¤Æ¤Î¥ê¥¹¥È¡£
-
-@item msql-mysql-modules-digest
-@code{msql-mysql-modules} ¥ê¥¹¥È¤Î¥À¥¤¥¸¥§¥¹¥È¥Ð¡¼¥¸¥ç¥ó¡£
-@end table
-
-¾å½Ò¤·¤¿¤Î¤ÈƱ¤¸ÊýË¡¤ÇÁ´¤Æ¤Î¥ê¥¹¥È¤Î¹ØÆɤޤ¿¤Ï¹ØÆÉÃæ»ß¤¬¤Ç¤­¤Þ¤¹¡£¤¢¤Ê¤¿
-¤Î¹ØÆɤޤ¿¤Ï¹ØÆÉÃæ»ß¤Î¥á¥Ã¥»¡¼¥¸¤Ï¡¢@code{mysql} ¤Ç¤Ï¤Ê¤¯Å¬Àڤʥ᡼¥ê¥ó¥°¥ê¥¹
-¥È¤ËÁ÷¤Ã¤Æ¤¯¤À¤µ¤¤¡£Î㤨¤Ð¡¢ @code{myodbc} ¥ê¥¹¥È¤ò¹ØÆɤޤ¿¤Ï¹ØÆÉÃæ»ß¤¹¤ë¤Ë¤Ï¡¢
-@email{myodbc-subscribe@@lists.mysql.com} ¤Þ¤¿¤Ï
-@email{myodbc-unsubscribe@@lists.mysql.com} ¤Ë¥á¡¼¥ë¤òÁ÷¤ê¤Þ¤¹¡£
-
-
-@cindex Net etiquette
-@node Asking questions, Bug reports, Mailing-list, Questions
-@section ¼ÁÌä¤Þ¤¿¤Ï¥Ð¥°Êó¹ð
-
-¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤Ø¼ÁÌä¤ò¿Ò¤Í¤ëÁ°¤Ë¡¢°Ê²¼¤Î¼ê½ç¤òƧ¤ó¤Ç¤¯¤À¤µ¤¤¡§
-
-@itemize @bullet
-@item
-@strong{MySQL} ¤Î¥ª¥ó¥é¥¤¥ó¥Þ¥Ë¥å¥¢¥ë¤òÄ´¤Ù¤ë¤³¤È¤«¤é¤Ï¤¸¤á¤Þ¤¹¡§
-
-@example
-@uref{http://www.mysql.com/Manual_chapter/manual_toc.html}
-@end example
-
-²æ¡¹¤Ï¡¢¿·¤·¤¯¸«¤Ä¤«¤Ã¤¿ÌäÂê¤Î²ò·è¤Ç¥Þ¥Ë¥å¥¢¥ë¤òÉÑÈˤ˹¹¿·¤¹¤ë¤³¤È¤Ç¡¢¤½¤ì¤ò
-ºÇ¿·¤ËÊÝ»ý¤·¤è¤¦¤È¤·¤Æ¤¤¤Þ¤¹¡ª
-
-@item
-@strong{MySQL} ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¥¢¡¼¥«¥¤¥Ö¤ò¸¡º÷¤·¤Þ¤¹¡§
-
-@example
-@uref{http://www.mysql.com/doc.html}
-@end example
-
-@item
-@uref{http://www.mysql.com/}
-¤ÎÁ´¤Æ¤Î Web ¥Ú¡¼¥¸(¥Þ¥Ë¥å¥¢¥ë¤â´Þ¤à)¤ò¸¡º÷¤¹¤ë¤¿¤á¤Ë
-@uref{http://www.mysql.com/search.html} ¤â»ÈÍѤǤ­¤Þ¤¹¡£
-@end itemize
-
-¤³¤³¤Ç²óÅú¤¬¸«¤Ä¤±¤é¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢¶á¤¯¤Î @strong{MySQL} ½ÏÎý¼Ô¤È¤È¤â
-¤ËÄ´¤Ù¤Æ²¼¤µ¤¤¡£¤Þ¤À¤¢¤Ê¤¿¤Î¼ÁÌä¤Î²óÅú¤¬¸«¤Ä¤±¤é¤ì¤Ê¤±¤ì¤Ð¡¢Àè¤Ë¿Ê¤ß¡¢¼¡
-¤Î¥»¥¯¥·¥ç¥ó¤Î @email{mysql@@lists.mysql.com} ¤Ø¥á¡¼¥ë¤òÁ÷¤ëÊýË¡¤Ë¤Ä¤¤¤Æ¤òÆɤó¤Ç
-¤¯¤À¤µ¤¤¡£
-
-@cindex Bug reports
-@cindex Reporting bugs
-@node Bug reports, Answering questions, Asking questions, Questions
-@section ¥Ð¥°¤äÌäÂê¤òÊó¹ð¤¹¤ëÊýË¡
-
-Îɤ¤¥Ð¥°¥ì¥Ý¡¼¥È¤ò½ñ¤¯¤Î¤ÏǦÂѤ¬Íפê¤Þ¤¹¤¬¡¢¤½¤ì¤òºÇ½é¤ËÀµ¤·¤¯¹Ô¤Ê¤¦¤³¤È
-¤Ï²æ¡¹¤È¤¢¤Ê¤¿¤«¤é»þ´Ö¤òÀáÌó¤·¤Þ¤¹¡£
-¤½¤Î¥Ð¥°¤Ë¤Ä¤¤¤Æ¤Î´°Á´¤Ê¥Æ¥¹¥È¥±¡¼¥¹¤ò´Þ¤àÎɤ¤¥Ð¥°¥ì¥Ý¡¼¥È¤Ï¡¢¼¡¤Î¥ê¥ê¡¼
-¥¹¤Ç¤½¤ì¤¬½¤Àµ¤µ¤ì¤ë²ÄǽÀ­¤¬¤È¤Æ¤â¹â¤¯¤Ê¤ê¤Þ¤¹¡£
-¤³¤ÎÀá¤Ç¤Ï¡¢¤«¤Ê¤ê¤Î¡¢¤Þ¤¿¤ÏÁ´¤¯²æ¡¹
-¤Î½õ¤±¤Ë¤Ê¤é¤Ê¤¤¤³¤È¤Ë¤¢¤Ê¤¿¤Î»þ´Ö¤òϲÈñ¤·¤Ê¤¤¤è¤¦¤Ë¡¢¤¢¤Ê¤¿¤¬¥ì¥Ý¡¼¥È¤ò
-Àµ¤·¤¯½ñ¤¯¤³¤È¤ò¼ê½õ¤±¤·¤Þ¤¹¡£
-
-²æ¡¹¤Ï¡¢¥Ð¥°¥ì¥Ý¡¼¥È¤Þ¤¿²Äǽ¤Ê¤é¤ÐÁ´¤Æ¤ÎÌäÂê¤Ë¤Ä¤¤¤Æ¤Î¥ì¥Ý¡¼¥È¤ÎºîÀ®¤Ë
-@code{mysqlbug} ¥¹¥¯¥ê¥×¥È¤ò»ÈÍѤ¹¤ë¤³¤È¤ò¾©Î夷¤Þ¤¹¡£@code{mysqlbug} ¤Ï
-¥½¡¼¥¹ÇÛÉÛÆâ¤Î @file{scripts} ¥Ç¥£¥ì¥¯¥È¥ê¡¢¤Þ¤¿¤Ï¡¢¥Ð¥¤¥Ê¥êÇÛÉۤǤÏ
-@strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¥Ç¥£¥ì¥¯¥È¥êÇÛ²¼¤Î @file{bin} ¥Ç¥£¥ì¥¯
-¥È¥ê¤«¤é¸«¤Ä¤±¤é¤ì¤Þ¤¹¡£@code{mysqlbug} ¤ò»ÈÍѤǤ­¤Ê¤¤¾ì¹ç¤Ï¡¢¤³¤ÎÀá¤Ëµó
-¤²¤é¤ì¤Æ¤¤¤ëÁ´¤Æ¤ÎɬÍפʾðÊó¤ò´Þ¤á¤ë¤Ù¤­¤Ç¤¹¡£
-
-@code{mysqlbug} ¥¹¥¯¥ê¥×¥È¤Ï¡¢²¼µ­¤Î¿¤¯¤Î¾ðÊó¤ò¼«Æ°Åª¤Ë¸«¤Ä¤±½Ð¤¹¤³¤È¤Ç¡¢
-¥ì¥Ý¡¼¥È¤ÎºîÀ®¤ò¼ê½õ¤±¤·¤Þ¤¹¡£¤·¤«¤·¡¢½ÅÍפʲ¿¤«¤¬Â­¤ê¤Ê¤¤¾ì¹ç¡¢¤¢¤Ê¤¿¤Î
-¥á¥Ã¥»¡¼¥¸¤Ë¤½¤ì¤ò´Þ¤á¤Æ¤¯¤À¤µ¤¤¡ª ¤³¤ÎÀá¤ò¿µ½Å¤ËÆɤó¤Ç¡¢¤³¤³¤Ç½Ò¤Ù¤é¤ì
-¤Æ¤¤¤ëÁ´¤Æ¤Î¾ðÊ󤬥ì¥Ý¡¼¥ÈÃæ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤³¤È¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-¥Ð¥°¤òÌÀ³Î¤Ë¼¨¤¹¥Æ¥¹¥È¥±¡¼¥¹¤òºî¤ë¤³¤È¤¬¤Ç¤­¤ì¤Ð¡¢
-@email{bugs@@list.mysql.com} ¥ê¥¹¥È¤Ë¤½¤ì¤òÅê¹Æ¤·¤Æ¤¯¤À¤µ¤¤¡£Ãí°Õ: ¤³¤Î
-¥ê¥¹¥È¤Ë¤Ï¡¢´°Á´¤ÇºÆ¸½²Äǽ¤Ê¥Ð¥°¾ðÊó¤ò @code{mysqlbug} ¥¹¥¯¥ê¥×¥È¤ò»ÈÍÑ
-¤·¤ÆÅê¹Æ¤¹¤Ù¤­¤Ç¤¹(Windows ¾å¤Ç¼Â¹Ô¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢OS ¤È
-@strong{MySQL} ¥Ð¡¼¥¸¥ç¥ó¤Îµ­½Ò¤ò´Þ¤á¤ë¤Ù¤­¤Ç¤¹)¡£¤Ç¤­¤ì¤Ð¡¢Åê¹ÆÁ°¤Ë
-@strong{MySQL} ¤ÎºÇ¿·¤Î°ÂÄê¥Ð¡¼¥¸¥ç¥ó¤«³«È¯¥Ð¡¼¥¸¥ç¥ó¤ò»ÈÍѤ·¤ÆÌäÂê¤ò¥Æ
-¥¹¥È¤¹¤Ù¤­¤Ç¤¹¡ª ´Þ¤á¤é¤ì¤¿¥Æ¥¹¥È¥±¡¼¥¹¾å¤Ç¡¢'mysql test < script' ¤ò»È
-ÍѤ¹¤ë¤³¤È¤Ç¡¢¤Þ¤¿¤Ï¡¢¥Ð¥°¥ì¥Ý¡¼¥È¤Ë´Þ¤á¤é¤ì¤¿¥·¥§¥ë/Perl¥¹¥¯¥ê¥×¥È¤ò¼Â
-¹Ô¤¹¤ë¤³¤È¤Ç¡¢Ã¯¤â¤¬¥Ð¥°¤òºÆ¸½¤Ç¤­¤ë¤Ù¤­¤Ç¤¹¡£¤³¤Î¥ê¥¹¥È¤ËÅê¹Æ¤µ¤ì¤¿Á´¤Æ
-¤Î¥Ð¥°¤Ï¡¢¼¡¤Î @strong{MySQL} ¥ê¥ê¡¼¥¹¤Ç½¤Àµ¤µ¤ì¤ë¤«¥É¥­¥å¥á¥ó¥È²½¤µ¤ì¤Þ
-¤¹¡ª ¾®¤µ¤Ê¥³¡¼¥É¤ÎÊѹ¹¤À¤±¤Ç¤¹¤á¤Ð¡¢²æ¡¹¤Ï¤³¤ÎÌäÂê¤ò½¤Àµ¤¹¤ë¥Ñ¥Ã¥Á¤ÎÅê
-¹Æ¤â¹Ô¤Ê¤¤¤Þ¤¹¡£
-
-¿¤¹¤®¤ë¾ðÊó¤ò´Þ¤à¥á¥Ã¥»¡¼¥¸¤ËÅú¤¨¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤¹¤¬¡¢¾¯¤Ê¤¹¤®¤ë¾ðÊó¤ò´Þ
-¤à¤â¤Î¤Ë¤Ï¤Ç¤­¤Ê¤¤¤È¤¤¤¦¤³¤È¤ò³Ð¤¨¤Æ¤¤¤Æ¤¯¤À¤µ¤¤¡£¤·¤Ð¤·¤Ð¿Í¤Ï»ö¼Â¤ò¾Ê¤¤
-¤Æ¤·¤Þ¤¤¤Þ¤¹¡£ÌäÂê¤Î¸¶°ø¤ò¤ï¤«¤Ã¤Æ¤¤¤ë¤È»×¤¤¡¢¤¤¤¯¤Ä¤«¤Î¾ÜºÙ¤ò½ÅÂç¤Ç¤Ê¤¤
-¤È¸«¤Ê¤·¤Æ¤·¤Þ¤¦¤«¤é¤Ç¤¹¡£Îɤ¤¸¶Â§¤Ï: ²¿¤«¤ò¸À¤ª¤¦¤«Ì¤ä¿¤È¤­¤Ë¤Ï¡¢¸À¤Ã
-¤Æ¤¯¤À¤µ¤¤¡ª ºÇ½é¤Ë¤¢¤Ê¤¿¤¬½½Ê¬¤Ê¾ðÊó¤ò´Þ¤á¤Ê¤«¤Ã¤¿¤¿¤á¤Ë¡¢ºÆ¤Ó¼ÁÌ䤷¤Æ
-²óÅú¤òÂԤĤ³¤È¤ò¶¯Íפµ¤ì¤ë¤è¤ê¡¢¿ô¹Ô¤ò¤¢¤Ê¤¿¤Î¥ì¥Ý¡¼¥È¤Ë½ñ¤¯Êý¤¬ÀéÇÜ®¤¯
-¤ÆÌÂÏǤǤϤ¢¤ê¤Þ¤»¤ó¡£
-
-Îɤ¯¤¢¤ë´Ö°ã¤¤¤Ï¡¢»ÈÍѤ·¤Æ¤¤¤ë @strong{MySQL} ÇÛÉۤΥС¼¥¸¥ç¥óÈÖ¹æ¤ò¼¨¤µ
-¤Ê¤¤¡¢¤Þ¤¿¤Ï @strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤ò(¥×¥é¥Ã
-¥È¥Õ¥©¡¼¥à¤Î¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤ò´Þ¤á¤Æ)¼¨¤µ¤Ê¤¤»ö¤Ç¤¹¡£¤³¤ì¤Ï¤È¤Æ¤â´ØÏ¢¤·¤¿
-¾ðÊó¤Ç¡¢100 ¤Î¥Ð¥°¥ì¥Ý¡¼¥È¤Î¤¦¤Á 99 ¤Î¾ì¹ç¡¢¤³¤Î¾ðÊ󤬤ʤ¤¤ÈÌò¤ËΩ¤Á¤Þ¤»
-¤ó¡ª ²æ¡¹¤Ï ``²¿¸Î»ä¤Ç¤ÏÆ°ºî¤·¤Ê¤¤¤Î¡©'' ¤Î¤è¤¦¤Ê¼ÁÌä¤ò¤È¤Æ¤âÎɤ¯¼õ¤±¤Þ
-¤¹¡£¤½¤·¤Æ²æ¡¹¤Ï¡¢Í׵ᤵ¤ì¤¿µ¡Ç½¤Ï¤½¤Î @strong{MySQL} ¥Ð¡¼¥¸¥ç¥ó¤Ë¼ÂÁõ¤µ
-¤ì¤Æ¤¤¤Ê¤¤¡¢¤Þ¤¿¤Ï¡¢¥ì¥Ý¡¼¥ÈÃæ¤Ë½Ò¤Ù¤é¤ì¤Æ¤¤¤ë¥Ð¥°¤Ï¿·¤·¤¤
-@strong{MySQL} ¥Ð¡¼¥¸¥ç¥ó¤Ç´û¤Ë½¤Àµ¤µ¤ì¤Æ¤¤¤ë¤Ç¤¢¤ë¤³¤È¤ò¸«¤Ä¤±¤Þ¤¹¡£»þ¡¹¡¢
-¥¨¥é¡¼¤Ï¥×¥é¥Ã¥È¥Õ¥©¡¼¥à°Í¸¤Ç¡¢¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤È¥×¥é¥Ã¥È¥Õ¥©¡¼
-¥à¤Î¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òÃΤé¤Ê¤¤¤³¤È¤Ë¤Ï¡¢²¿¤â½¤Àµ¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£
-
-ÌäÂê¤Ë´ØÏ¢¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥³¥ó¥Ñ¥¤¥é¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤âÍ¿¤¨¤ë¤³¤È¤ò˺¤ì¤Ê¤¤
-¤Ç¤¯¤À¤µ¤¤¡£¤·¤Ð¤·¤Ð¿Í¤Ï¥³¥ó¥Ñ¥¤¥é¤Î¥Ð¥°¤ò¸«¤Ä¤±¤Æ¡¢ÌäÂê¤Ï
-@strong{MySQL} ¤Ë´ØÏ¢¤·¤Æ¤¤¤ë¤È¹Í¤¨¤Þ¤¹¡£Â¿¤¯¤Î¥³¥ó¥Ñ¥¤¥é¤Ï¤¤¤Ä¤â³«È¯Ãæ
-¤Ç¡¢¥Ð¡¼¥¸¥ç¥ó¤ò¾å¤²¤ë¤³¤È¤Ë¤è¤Ã¤Æ¤è¤êÎɤ¤¥Ð¡¼¥¸¥ç¥ó¤Ë¤Ê¤ê¤Þ¤¹¡£ÌäÂ꤬¥³
-¥ó¥Ñ¥¤¥é¤Ë°Í¸¤·¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò³ÎÄꤹ¤ë¤Ë¤Ï¡¢¤É¤Î¥³¥ó¥Ñ¥¤¥é¤¬»ÈÍѤµ¤ì¤Æ
-¤¤¤ë¤«¤òÃΤ뤳¤È¤¬É¬ÍפǤ¹¡£Á´¤Æ¤Î¥³¥ó¥Ñ¥¤¥ë¤ÎÌäÂê¤Ï¥Ð¥°¥ì¥Ý¡¼¥È¤È¤ß¤Ê¤µ
-¤ì¡¢¤½¤ì¤Ë½¾¤Ã¤ÆÊó¹ð¤µ¤ì¤ë¤Ù¤­¤Ç¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-ºÇ¤âÌò¤ËΩ¤Ä¤Î¤Ï¡¢ÌäÂê¤ÎÎɤ¤ÀâÌÀ¤¬¥Ð¥°¥ì¥Ý¡¼¥È¤Ë´Þ¤á¤é¤ì¤ë¤³¤È¤Ç¤¹¡£¤Ä¤Þ
-¤ê¡¢ÌäÂê¤ËƳ¤«¤ì¤ëÁ´¤Æ¤Î¹Ô¤Ê¤Ã¤¿¤³¤È¤ÎÎã¤È¡¢Àµ³Î¤Ëµ­½Ò¤µ¤ì¤¿ÌäÂꤽ¤ì¼«¿È
-¤Ç¤¹¡£Îɤ¤¥Ð¥°¥ì¥Ý¡¼¥È¤Ï¡¢¥Ð¥°¤äÌäÂê¤òºÆ¸½¤¹¤ëÊýË¡¤ò¼¨¤¹´°Á´¤ÊÎã¤ò´Þ¤à¤â
-¤Î¤Ç¤¹¡£
-
-ÌäÂ꤬¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òÍ¿¤¨¤ë¾ì¹ç¡¢¤½¤ì¤ò¥ì¥Ý¡¼¥È¤Ë´Þ¤á¤ë¤³¤È¤Ï¤È¤Æ¤â½Å
-ÍפǤ¹¡ª ²æ¡¹¤¬¥×¥í¥°¥é¥à¤ò»ÈÍѤ¹¤ë¥¢¡¼¥«¥¤¥Ö¤«¤é²¿¤«¤ò¸¡º÷¤·¤è¤¦¤È¤¹¤ë
-¾ì¹ç¡¢¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Ï¥×¥í¥°¥é¥à¤¬Í¿¤¨¤¿¤â¤Î¤ÈÀµ³Î¤Ë°ìÃפ¹¤ëÊý¤¬Îɤ¤¤Ç
-¤¹(Âçʸ»ú¾®Ê¸»ú¤â¼é¤é¤ì¤ë¤Ù¤­¤Ç¤¹¡ª)¡£¤É¤Î¤è¤¦¤Ê¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤À¤Ã¤¿¤«
-¤ò³Ð¤¨¤ë¤Ê¤ó¤Æ¤³¤È¤Ï¤·¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡¨¥ì¥Ý¡¼¥È¤Ë´°Á´¤Ê¥á¥Ã¥»¡¼¥¸¤ò¥³¥Ô¡¼
-¤·Ä¥¤ê¤Ä¤±¤Æ¤¯¤À¤µ¤¤¡£
-
-MyODBC ¤Ç¤ÎÌäÂ꤬¤¢¤ë¾ì¹ç¡¢MyODBC ¥È¥ì¡¼¥¹¥Õ¥¡¥¤¥ë¤ÎÀ¸À®¤ò»î¤ß¤ë¤Ù¤­¤Ç¤¹¡£
-@xref{MyODBC bug report}¡£
-
-¤¢¤Ê¤¿¤Î¥ì¥Ý¡¼¥È¤òÆɤ࿤¯¤Î¿Í¤¬ 80·å¥Ç¥£¥¹¥×¥ì¥¤¤ò»ÈÍѤ·¤Æ¤¤¤ë¤È¤¤¤¦¤³
-¤È¤ò³Ð¤¨¤Æ¤ª¤¤¤Æ²¼¤µ¤¤¡£½¾¤Ã¤Æ¡¢@code{mysql} ¥³¥Þ¥ó¥É¥é¥¤¥ó¥Ä¡¼¥ë¤ò»ÈÍÑ
-¤·¤Æ¥ì¥Ý¡¼¥È¤Þ¤¿¤Ï¥µ¥ó¥×¥ë¤òÀ¸À®¤¹¤ë»þ¡¢¤½¤Î¤è¤¦¤Ê¥Ç¥£¥¹¥×¥ì¥¤¤ÎÍ­¸úÉý¤ò
-Ķ¤¨¤ë½ÐÎÏ(Î㤨¤Ð¡¢@code{EXPLAIN SELECT} ¥¹¥Æ¡¼¥È¥á¥ó¥È; ¸å½Ò¤Î¥µ¥ó¥×¥ë
-¤ò¸«¤Æ¤¯¤À¤µ¤¤)¤Ë¤Ï¡¢@code{--vertical} ¥ª¥×¥·¥ç¥ó(¤Þ¤¿¤Ï @code{\G} ¥¹¥Æ¡¼
-¥È¥á¥ó¥È½ªÃ¼)¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£
-
-¼¡¤Î¾ðÊó¤ò¥ì¥Ý¡¼¥È¤Ë´Þ¤á¤Æ¤¯¤À¤µ¤¤:
-
-@itemize @bullet
-@item
-»ÈÍѤ·¤Æ¤¤¤ë @strong{MySQL} ÇÛÉۤΥС¼¥¸¥ç¥óÈÖ¹æ (Î㤨¤Ð @strong{MySQL}
-3.22.22)¡£¤É¤Î¥Ð¡¼¥¸¥ç¥ó¤òÆ°¤«¤·¤Æ¤¤¤ë¤«¤Ï @code{mysqladmin version} ¤Î
-¼Â¹Ô¤Ç¸«¤Ä¤±¤é¤ì¤Þ¤¹¡£@code{mysqladmin} ¤Ï @strong{MySQL} ¤Î¥¤¥ó¥¹¥È¡¼¥ë
-¥Ç¥£¥ì¥¯¥È¥êÇÛ²¼¤Î @file{bin} ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¸«¤Ä¤±¤é¤ì¤Þ¤¹¡£
-
-@item
-¤¢¤Ê¤¿¤¬ºî¶È¤·¤Æ¤¤¤ë¥Þ¥·¥ó¤Î¥á¡¼¥«¡¼¤È¥â¥Ç¥ë¡£
-
-@item
-¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à̾¤È¥Ð¡¼¥¸¥ç¥ó¡£Â¿¤¯¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Ç
-¤Ï¡¢Unix ¥³¥Þ¥ó¥É @code{uname -a} ¤Î¼Â¹Ô¤Ë¤è¤Ã¤Æ¤³¤Î¾ðÊó¤¬ÆÀ¤é¤ì¤Þ¤¹¡£
-
-@item
-»þ¤Ë¤Ï¥á¥â¥ê(¼Â¥á¥â¥ê¤È²¾ÁÛ¥á¥â¥ê)¤ÎÎ̤â´Ø·¸¤·¤Þ¤¹¡£µ¿¤ï¤·¤±¤ì¤Ð¡¢¤½¤ì¤ò
-´Þ¤á¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-@strong{MySQL} ¤Î¥½¡¼¥¹ÇÛÉÛ¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢»ÈÍѤ·¤¿¥³¥ó¥Ñ¥¤¥é¤Î̾
-Á°¤È¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤Ë¤Ä¤Æ¤Î¾ðÊó¤âɬÍפǤ¹¡£¥Ð¥¤¥Ê¥êÇÛÉۤξì¹ç¤Ï¡¢ÇÛÉÛ̾¤¬
-ɬÍפǤ¹¡£
-
-@item
-ÌäÂ꤬¥³¥ó¥Ñ¥¤¥ëÃæ¤ËȯÀ¸¤¹¤ë¾ì¹ç¡¢Àµ³Î¤Ê¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤È¡¢¥¨¥é¡¼¤¬È¯À¸
-¤·¤¿¥Õ¥¡¥¤¥ë¤ÎÌäÂê¤Î¥³¡¼¥É¤Î²ó¤ê¤Î¿ô¹Ô¤â´Þ¤á¤Æ²¼¤µ¤¤¡£
-
-@item
-
-²¿¤«¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Æ¡¼¥Ö¥ë¤¬ÌäÂê¤Ë´ØÏ¢¤¹¤ë¾ì¹ç¤Ï¡¢
-@code{mysqldump --no-data db_name tbl_name1 tbl_name2 ...} ¤«¤é¤Î½ÐÎϤò´Þ¤á¤Æ
-¤¯¤À¤µ¤¤¡£¤³¤ì¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹Æâ¤ÎǤ°Õ¤Î¥Æ¡¼¥Ö¥ë¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÆÀ¤ë¤È¤Æ¤â
-´Êñ¤Ç¶¯ÎϤÊÊýË¡¤Ç¡¢²æ¡¹¤¬¤¢¤Ê¤¿¤Î¾õ¶·¤Ë°ìÃפ¹¤ë¤â¤Î¤òÀ¸À®¤¹¤ë¼ê½õ¤±¤Ë¤Ê
-¤ê¤Þ¤¹¡£
-
-@item
-@code{SELECT} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ç¤Î®Å٤˴ؤ¹¤ë¥Ð¥°¤äÌäÂê¤Ç¤Ï¡¢
-@code{EXPLAIN SELECT ...} ¤Î½ÐÎϤȡ¢¾¯¤Ê¤¯¤È¤â @code{SELECT} ¥¹¥Æ¡¼¥È¥á
-¥ó¥È¤¬Í¿¤¨¤ë¹Ô¤Î¿ô¤ò¾ï¤Ë´Þ¤á¤ë¤Ù¤­¤Ç¤¹¡£¤¢¤Ê¤¿¤Î¾õ¶·¤Ë¤Ä¤¤¤Æ¡¢¤è¤ê¿¤¯¤Î
-¾ðÊó¤ò¡¢Ã¯¤«¤¬¤¢¤Ê¤¿¤ò½õ¤±¤é¤ì¤ë¤è¤¦¤Ë¡¢¤è¤êŬÀÚ¤ËÍ¿¤¨¤Æ¤¯¤À¤µ¤¤¡ª Î㤨
-¤Ð¡¢¼¡¤Ï¤È¤Æ¤âÎɤ¤¥Ð¥°¥ì¥Ý¡¼¥È¤ÎÎã¤Ç¤¹¡Ê¤â¤Á¤í¤ó @code{mysqlbug} ¥¹¥¯¥ê¥×¥È¤ÇÅê
-¹Æ¤µ¤ì¤Æ¤Þ¤¹¡Ë:
-
-@code{mysql} ¥³¥Þ¥ó¥É¹Ô¥Ä¡¼¥ëÇÛ²¼¤Ç¤Î¼Â¹ÔÎã(Ãí°Õ: ½ÐÎÏÉý¤¬¥Ç¥£¥¹¥×¥ì¥¤Áõ
-ÃÖ¤Î80·å¤òĶ¤¨¤ë¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ë¤Ï¡¢@code{\G} ¥¹¥Æ¡¼¥È¥á¥ó¥È½ªÃ¼¤ò»ÈÍѤ·
-¤Æ¤¯¤À¤µ¤¤):
-
-@example
-mysql> SHOW VARIABLES;
-mysql> SHOW COLUMNS FROM ...\G
- <output-from-SHOW-COLUMNS>
-mysql> EXPLAIN SELECT ...\G
- <output-from-EXPLAIN>
-mysql> FLUSH STATUS;
-mysql> SELECT ...;
- <A short version of the output from SELECT,
- including the time taken to run the query>
-mysql> SHOW STATUS;
- <output from SHOW STATUS>
-@end example
-
-@item
-ÌäÂê¤ä¥Ð¥°¤¬ @strong{MySQL} ¼Â¹ÔÃæ¤ËȯÀ¸¤¹¤ë¾ì¹ç¡¢¥Ð¥°¤òºÆ¸½¤¹¤ëÆþÎÏ¥¹¥¯
-¥ê¥×¥È¤¬É¬ÍפǤ¹¡£¤³¤Î¥¹¥¯¥ê¥×¥È¤ÏɬÍפʥ½¡¼¥¹¥Õ¥¡¥¤¥ëÁ´¤Æ¤ò´Þ¤á¤ë¤Ù¤­¤Ç
-¤¹¡£¤è¤êÀºÌ©¤Ê¥¹¥¯¥ê¥×¥È¤Ï¤¢¤Ê¤¿¤Î¤Ë»÷¤¿¾õ¶·¤òÎɤ¯ºÆ¸½¤Ç¤­¤Þ¤¹¡£
-
-¤â¤·¥¹¥¯¥ê¥×¥È¤òÄ󶡤¹¤ë¤³¤È¤¬¤Ç¤­¤Ê¤±¤ì¤Ð¡¢¾¯¤Ê¤¯¤È¤â¡¢
-@code{mysqladmin variables extended-status processlist} ¤Î
-½ÐÎÏ·ë²Ì¤ò¥á¡¼¥ë¤Ë¤ò´Þ¤à¤Ù¤­¤Ç¤¹¡£ ¤³¤ì¤Ï¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à¤Î¾ðÊó¤ò
-Ä󶡤·¤Þ¤¹¡ª
-
-@item
-@strong{MySQL} ¤¬¥¯¥¨¥ê¤«¤é°Û¾ï¤Ê·ë²Ì¤òÍ¿¤¨¤ë¤È»×¤¦¾ì¹ç¤Ï¡¢·ë²Ì¤À¤±¤Ç¤Ê
-¤¯¡¢·ë²Ì¤¬¤É¤¦¤Ê¤ë¤Ù¤­¤«¤È¤¤¤¦¤¢¤Ê¤¿¤Î°Õ¸«¤È¡¢¤¢¤Ê¤¿¤Î°Õ¸«¤Î´ðËܤòÀâÌÀ¤¹
-¤ëÍýͳ¤â´Þ¤á¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-ÌäÂê¤Î¥µ¥ó¥×¥ë¤òÄ󶡤¹¤ë»þ¤Ë¡¢¿·¤·¤¤Ì¾Á°¤Ë¤¹¤ë¤è¤ê¤â¡¢¼ÂºÝ¤Î¾õ¶·¤Ç¸ºß¤¹
-¤ë¤Î¤ÈƱ¤¸ÊÑ¿ô̾¤ä¥Æ¡¼¥Ö¥ë̾Åù¤ò»ÈÍѤ·¤¿Êý¤¬Îɤ¤¤Ç¤¹¡£ÌäÂê¤ÏÊÑ¿ô¤ä¥Æ¡¼¥Ö
-¥ëÅù¤Î̾Á°¤Ë´ØÏ¢¤¹¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡ª ¤ª¤½¤é¤¯¤³¤ì¤Ï¤Þ¤ì¤Ê¥±¡¼¥¹¤Ç¤¹¤¬¡¢
-sorry ¤è¤ê¤â safe ¤ÎÊý¤¬Îɤ¤¤Ç¤¹¡£·ë¶É¡¢¼ÂºÝ¤Ë»ý¤Ã¤Æ¤¤¤ë¤¢¤Ê¤¿¤Î¥µ¥ó¥×¥ë
-Ãæ¤ÎƱ¤¸¾õ¶·¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï¤¢¤Ê¤¿¤Ë¤È¤Ã¤Æ¤â´Êñ¤Ç¡¢²æ¡¹¤Ë¤È¤Ã¤Æ¤âÁ´¤Æ¤Î
-°ÕÌ£¤ÇÎɤ¤¤³¤È¤Ç¤¹¡£Â¾¤Î¿Í¤Ë¸«¤»¤¿¤¯¤Ê¤¤¥Ç¡¼¥¿¤ò¤¤¤¯¤Ä¤«»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢
-@code{ftp} ¤ò»ÈÍѤ·¤Æ @uref{ftp://www.mysql.com/pub/mysql/secret/} ¤Ë¥Ç¡¼
-¥¿¤òžÁ÷¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¥Ç¡¼¥¿¤¬ËÜÅö¤ËºÇ¹âµ¡Ì©¤Ç²æ¡¹¤Ë¤µ¤¨¸«¤»¤¿¤¯¤Ê
-¤¤¾ì¹ç¤Ï¡¢Àè¤Ë¿Ê¤ó¤Ç¡¢Â¾¤ÎÊÑ¿ô̾Åù¤ò»ÈÍѤ·¤Æ¥µ¥ó¥×¥ë¤òºî¤Ã¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
-¤·¤«¤·¤³¤ì¤ÏºÇ¸å¤ÎÁªÂò¤È»×¤Ã¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-²Äǽ¤Ê¤é¤Ð¡¢´ØÏ¢¥×¥í¥°¥é¥à¤ËÍ¿¤¨¤é¤ì¤¿Á´¤Æ¤Î¥ª¥×¥·¥ç¥ó¤ò´Þ¤á¤Æ¤¯¤À¤µ¤¤¡£
-Î㤨¤Ð¡¢@code{mysqld} ¥Ç¡¼¥â¥ó³«»Ï»þ¤Ë»ÈÍѤ·¤¿¥ª¥×¥·¥ç¥ó¤È
-@strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¼Â¹Ô¤Ë»ÈÍѤ·¤¿¥ª¥×¥·¥ç¥ó¤ò¼¨¤·¤Æ¤¯
-¤À¤µ¤¤¡£¡£@code{mysqld}, @code{mysql} ¤Þ¤¿¤Ï @code{configure} ¥¹¥¯¥ê¥×¥È
-¤Ø¤Î¥ª¥×¥·¥ç¥ó¤Ï¤·¤Ð¤·¤Ð²óÅú¤Ø¤Î¥­¡¼¤Ë¤Ê¤ê¡¢¤È¤Æ¤â´ØÏ¢¤·¤Æ¤¤¤Þ¤¹¡ª ¤È¤Ë
-¤«¤¯¤½¤ì¤é¤ò´Þ¤á¤ë¤È¤¤¤¦¤Î¤Ï°­¤¤¹Í¤¨¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡ª Perl ¤ä PHP ¤Ê¤É¤Î
-¥â¥¸¥å¡¼¥ë¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢¤½¤ì¤é¤Î¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤â´Þ¤á¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-¿ô¹Ô¤Î¥Æ¥¹¥È¥±¡¼¥¹¤òÄ󶡤Ǥ­¤Ê¤¤¾ì¹ç¡¢¤Þ¤¿¤Ï¥Æ¥¹¥È¥Æ¡¼¥Ö¥ë¤¬¥á¡¼¥ê¥ó¥°¥ê
-¥¹¥È¤Ë¥á¡¼¥ë¤¹¤ë¤Ë¤ÏÂ礭¤¹¤®¤ë(10¹Ô°Ê¾å)¾ì¹ç¡¢@code{mysqldump} ¤ò»ÈÍѤ·
-¤Æ¤¢¤Ê¤¿¤Î¥Æ¡¼¥Ö¥ë¤ò¥À¥ó¥×¤·¡¢¤¢¤Ê¤¿¤ÎÌäÂê¤òÀâÌÀ¤·¤¿ @file{README} ¥Õ¥¡
-¥¤¥ë¤òºî¤ë¤Ù¤­¤Ç¤¹¡£
-
-@code{tar} ¤È @code{gzip} ¤Þ¤¿¤Ï @code{zip} ¤ò»ÈÍѤ·¤Æ¡¢¥Õ¥¡¥¤¥ë¤Î°µ½Ì¥¢¡¼
-¥«¥¤¥Ö¤òÀ¸À®¤·¡¢¤½¤Î¥¢¡¼¥«¥¤¥Ö¤ò @code{ftp} ¤ò»ÈÍѤ·¤Æ
-@uref{ftp://www.mysql.com/pub/mysql/secret/} ¤ËžÁ÷¤·¤Æ¤¯¤À¤µ¤¤¡£¤½¤ì¤«
-¤éÌäÂê¤Îû¤¤ÀâÌÀ¤ò @email{mysql@@lists.mysql.com} ¤ËÁ÷¤Ã¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-¼ÁÌ䤬¸¢¸Â¥·¥¹¥Æ¥à¤Ë´ØÏ¢¤¹¤ë¾ì¹ç¡¢@code{mysqlaccess} ¤Î½ÐÎÏ¡¢
-@code{mysqladmin reload} ¤Î½ÐÎÏ¡¢Àܳ¤·¤è¤¦¤È¤·¤¿»þ¤ËÆÀ¤é¤ì¤¿Á´¤Æ¤Î¥¨¥é¡¼
-¥á¥Ã¥»¡¼¥¸¤ò´Þ¤á¤Æ¤¯¤À¤µ¤¤¡ª ¸¢¸Â¤ò¥Æ¥¹¥È¤¹¤ë»þ¡¢¤Þ¤º @code{mysqlaccess}
-¤ò¼Â¹Ô¤¹¤Ù¤­¤Ç¤¹¡£¤½¤Î¸å¡¢@code{mysqladmin reload version} ¤ò¼Â¹Ô¤·¡¢ºÇ
-¸å¤ËÌäÂ꤬ȯÀ¸¤¹¤ë¥×¥í¥°¥é¥à¤Ç¤ÎÀܳ¤ò»î¤ß¤ë¤Ù¤­¤Ç¤¹¡£@code{mysqlaccess}
-¤Ï@strong{MySQL} ¥¤¥ó¥¹¥È¡¼¥ë¥Ç¥£¥ì¥¯¥È¥êÇÛ²¼¤Î @file{bin} ¥Ç¥£¥ì¥¯¥È¥ê
-¤Ë¸«¤Ä¤±¤é¤ì¤Þ¤¹¡£
-
-@item
-¤¢¤Ê¤¿¤¬¥Ð¥°¤Ë¤Ä¤¤¤Æ¤Î¥Ñ¥Ã¥Á¤ò»ý¤Ã¤Æ¤¤¤ë¤Î¤ÏÎɤ¤»ö¤Ç¤¹¤¬¡¢¤½
-¤Î¥Ñ¥Ã¥Á¤¬¤¹¤Ù¤Æ¡¢²æ¡¹¤¬µá¤á¤Æ¤¤¤ë¤â¤Î¤Ç¡¢¤¢¤Ê¤¿¤Î¥Ñ¥Ã¥Á¤¬½¤Àµ¤¹¤ë¥Ð¥°¤Î
-¥Æ¥¹¥È¾ðÊó¤òÄ󶡤·¤Ê¤¯¤Æ¤â¡¢²æ¡¹¤¬¤½¤ì¤ò»ÈÍѤ¹¤ë¤À¤í¤¦¡¢
-¤È»×¤ï¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£²æ¡¹¤Ï¤¢¤Ê¤¿¤Î¥Ñ¥Ã¥Á¤ËÌäÂê¤ò¸«¤Ä¤±¤ë¤«¤â¤·¤ì¤Þ¤»¤ó
-¤·¡¢¤Þ¤¿¤Ï¡¢¤½¤ì¤òÁ´¤¯Íý²ò¤Ç¤­¤Ê¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¡£¤½¤Î¾ì¹ç¤Ï¤½¤ì¤ò»ÈÍѤÇ
-¤­¤Þ¤»¤ó¡£
-
-¤½¤Î¥Ñ¥Ã¥Á¤Ë°ÕÌ£¤¬¤¢¤ë¤³¤È¤¬Àµ³Î¤Ë³Î¤«¤á¤é¤ì¤Ê¤±¤ì¤Ð¡¢²æ¡¹¤Ï¤½¤ì¤ò»ÈÍѤ·
-¤Þ¤»¤ó¡£¥Æ¥¹¥È¥±¡¼¥¹¤Ï²æ¡¹¤Ë¤³¤Î¼ê½õ¤±¤ò¤·¤Þ¤¹¡£¥Ñ¥Ã¥Á¤¬µ¯¤ê¤¦¤ëÁ´¤Æ¤Î¾õ
-¶·¤ò°·¤¦¤³¤È¤ò¼¨¤·¤Æ¤¯¤À¤µ¤¤¡£¥Ñ¥Ã¥Á¤¬Æ°ºî¤·¤Ê¤¤¶­³¦Àþ¤Î¥±¡¼¥¹(¤½¤ì¤¬µ©
-¤Ç¤â)¤ò¸«¤Ä¤±¤¿¾ì¹ç¡¢¥Ñ¥Ã¥Á¤Ï»ÈÍѤµ¤ì¤Ê¤¤¤Ç¤·¤ç¤¦¡£
-
-@item
-²¿¤¬¥Ð¥°¤«¡¢²¿¸ÎȯÀ¸¤¹¤ë¤Î¤«¡¢²¿¤Ë°Í¸¤·¤Æ¤¤¤ë¤Î¤«¡¢¤Ë¤Ä¤¤¤Æ¤Î¿ä¬¤ÏÄ̾ï
-´Ö°ã¤¤¤Ç¤¹¡£²æ¡¹¤Ç¤µ¤¨¡¢¤Þ¤º¥Ç¥Ð¥Ã¥¬¤ò»ÈÍѤ·¤Æ¥Ð¥°¤Î¼ÂºÝ¤Î¸¶°ø¤ò¸«¤Ä¤±¤Ê
-¤±¤ì¤Ð¡¢¤½¤Î¤³¤È¤Ï¿ä¬¤Ç¤­¤Þ¤»¤ó¡£
-
-@item
-¥á¡¼¥ë¥á¥Ã¥»¡¼¥¸Ãæ¤Ë¡¢¤¢¤Ê¤¿¤¬¥ê¥Õ¥¡¥ì¥ó¥¹¥Þ¥Ë¥å¥¢¥ë¤È¥á¡¼¥ë¥¢¡¼¥«¥¤¥Ö¤ò
-¥Á¥§¥Ã¥¯¤·¤¿¤³¤È¤ò¼¨¤·¤Æ¤¯¤À¤µ¤¤¡£¤½¤¦¤¹¤ì¤Ð¡¢¤¢¤Ê¤¿¤ÎÌäÂê¤ò¤¢¤Ê¤¿¼«¿È¤Ç
-²ò·è¤·¤è¤¦¤È¤·¤¿¤³¤È¤ò¾¤Î¿Í¤¬¤ï¤«¤ê¤Þ¤¹¡£
-
-@item
-@code{¥Ñ¡¼¥¹¥¨¥é¡¼}¤¬È¯À¸¤¹¤ë¾ì¹ç¡¢¹½Ê¸¤ò¸·Ì©¤Ë¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡ª ²¿
-¤¬´Ö°ã¤Ã¤Æ¤¤¤ë¤Î¤«¤ò¸«¤Ä¤±¤é¤ì¤Ê¤±¤ì¤Ð¡¢Â¿Ê¬¡¢»ÈÍѤ·¤Æ¤¤¤ë¥¯¥¨¥ê¤ò
-@strong{MySQL} ¤Î¸½ºß¤Î¥Ð¡¼¥¸¥ç¥ó¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¤È¤¤¤¦¤³¤È¤Ç¤¹¡£¸½
-ºß¤Î¥Ð¡¼¥¸¥ç¥ó¤ò»ÈÍѤ·¤Æ¤¤¤Æ¡¢@uref{http://www.mysql.com/doc.html} ¤Î¥Þ
-¥Ë¥å¥¢¥ë¤¬¤¢¤Ê¤¿¤Î»ÈÍѤ·¤Æ¤¤¤ë¥¯¥¨¥ê¹½Ê¸¤ò¥«¥Ð¡¼¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢¤³¤ì¤Ï
-@strong{MySQL} ¤¬¤¢¤Ê¤¿¤Î¥¯¥¨¥ê¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¤È¤¤¤¦°ÕÌ£¤Ç¤¹¡£¤³¤Î
-¾ì¹ç¡¢¤¢¤Ê¤¿¤ÎÁªÂò¤Ï¡¢¤½¤Î¹½Ê¸¤ò¤¢¤Ê¤¿¼«¿È¤Ç¼ÂÁõ¤¹¤ë¤³¤È¤«¡¢
-@email{mysql-support@@mysql.com} ¤Ë email ¤Ç¤³¤ì¤ò¼ÂÁõ¤¹¤ë¤è¤¦¤Ë¿½¤·¹þ¤à¤³
-¤È¤Ç¤¹¡ª
-
-¥Þ¥Ë¥å¥¢¥ë¤¬¤¢¤Ê¤¿¤Î»ÈÍѤ·¤Æ¤¤¤ë¹½Ê¸¤ò¥«¥Ð¡¼¤·¤Æ¤¤¤ë¤Î¤Ë@strong{MySQL}
-¤Î¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢Ê¸Ë¡¤¬¼ÂÁõ¤µ¤ì¤¿»þ´ü¤Ë¤Ä¤¤¤Æ
-@strong{MySQL} ¤ÎÊѹ¹ÍúÎò¤ò¥Á¥§¥Ã¥¯¤¹¤Ù¤­¤Ç¤¹¡£@xref{News}¡£¤³¤Î¾ì¹ç¡¢¤è
-¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Î @strong{MySQL} ¤Ø¤Î¥¢¥Ã¥×¥°¥ì¡¼¥É¤òÁªÂò¤Ç¤­¤Þ¤¹¡£
-
-@item
-¤â¤·¤¢¤Ê¤¿¤Î¥Ç¡¼¥¿¤¬°­¤¯¤Ê¤Ã¤¿¤è¤¦¤Ë»×¤¨¤¿¤ê¡¢¤Þ¤¿¤Ï¡¢¤¢¤ëÆÃÄê¤Î
-¥Æ¡¼¥Ö¥ë¤Ë¥¢¥¯¥»¥¹¤¹¤ë»þ¡¢¥¨¥é¡¼¤È¤Ê¤ë¤Ê¤é¡¢
-¤Þ¤ººÇ½é¤Ë¡¢¥Æ¡¼¥Ö¥ë¤ò @code{myisamchk} ¤Ç¸¡ºº¤·¡¢½¤Éü¤ò»î¤ß¤ë¤Ù¤­¤Ç¤¹
-@xref{Maintenance}.
-
-@item
-¤â¤·¤·¤ç¤Ã¤Á¤å¤¦¥Æ¡¼¥Ö¥ë¤¬¥À¥á¤Ë¤Ê¤ë¤è¤¦¤Ê¤é¡¢¤¤¤Ä¡¢¤Ê¤¼µ¯¤³¤ë¤Î¤«¤ò
-õ¤·½Ð¤¹¤Ù¤­¤Ç¤¹¡ª ¤³¤Î¾ì¹ç¡¢@file{mysql-data-directory/'hostname'.err} ¥Õ¥¡¥¤¥ë¤Ë
-²¿¤¬µ¯¤³¤Ã¤Æ¤¤¤ë¤Î¤«´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£ ¤³¤Î¥Õ¥¡¥¤¥ë¤«¤é
-´ØÏ¢¤¹¤ë¾ðÊó¤òÈ´¤­¤À¤·¥Ð¥°¥ì¥Ý¡¼¥È¤Ë´Þ¤á¤Æ¤¯¤À¤µ¤¤¡ª
-Ä̾ @code{mysqld} ¤Ï ¹¹¿·¤ÎºÇÃæ¤Ë kill ¤µ¤ì¤Ê¤¤¸Â¤ê¤Ï
-¥Æ¡¼¥Ö¥ë¤ò@strong{ÀäÂФË}Ç˲õ¤·¤Þ¤»¤ó¡ª ¤â¤·¤Ê¤¼ @code{mysqld} ¤¬»à¤Ì¤Î¤«
-¸«¤Ä¤±¤¿¾ì¹ç¤Ï¡¢²æ¡¹¤¬¤¢¤Ê¤¿¤ËÌäÂê²ò·è¤Î¤¿¤á¤Î½¤Àµ¤òÄ󶡤¹¤ë¤³¤È¤¬¡¢
-¤Ï¤ë¤«¤Ë´Êñ¤Ë¤Ê¤ê¤Þ¤¹!
-@xref{What is crashing}
-
-@item
-²Äǽ¤Ê¾ì¹ç¡¢ºÇ¿·¤Î @strong{MySQL} ¥Ð¡¼¥¸¥ç¥ó¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¡¢¤³¤ì¤ÇÌä
-Â꤬²ò·è¤µ¤ì¤ë¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£Á´¤Æ¤Î @strong{MySQL} ¥Ð¡¼
-¥¸¥ç¥ó¤ÏÄ̤·¤Æ¥Æ¥¹¥È¤µ¤ì¡¢ÌäÂê¤Ê¤·¤ËÆ°ºî¤·¤Þ¤¹¡ª Á´¤Æ¤¬²Äǽ¤Ê¸Â¤ê°ÊÁ°¤È
-¸ß´¹¤¬¤¢¤ë¤è¤¦¤Ëºî¤é¤ì¤Æ¤¤¤Æ¡¢¤¹¤°¤Ë @strong{MySQL} ¥Ð¡¼¥¸¥ç¥ó¤òÀÚ¤êÂؤ¨
-¤ë¤³¤È¤¬¤Ç¤­¤ë¤È²æ¡¹¤Ï¿®¤¸¤Æ¤¤¤Þ¤¹¡ª @xref{Which version}¡£
-@end itemize
-
-¤¢¤Ê¤¿¤¬¥µ¥Ý¡¼¥È¸ÜµÒ¤Ê¤é¡¢¤è¤ê¹â¤¤Í¥Àè½ç°Ì¤Ç¼è¤ê°·¤¦¤¿¤á
-@email{mysql-support@@mysql.com} ¤Ë¥Ð¥°¥ì¥Ý¡¼¥È¤ò¥¯¥í¥¹¥Ý¥¹¥È¤·¤Æ¤¯¤À¤µ¤¤¡£
-ƱÍͤˡ¢Â¾¤Î狼¤¬ÌäÂê¤ò·Ð¸³ºÑ¤ß(¤½¤·¤Æ¤ª¤½¤é¤¯²ò·èºÑ¤ß)¤«¤É¤¦¤«¤òÃΤ뤿
-¤á¤ËŬÀڤʥ᡼¥ê¥ó¥°¥ê¥¹¥È¤Ë¤â¡£
-
-@strong{MyODBC} ¤Î¥Ð¥°Êó¹ð¾å¤Î¾ðÊó¤Ë¤Ä¤¤¤Æ¤Ï¡¢@ref{ODBC Problems} ¤ò»²¾È
-¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-¤¤¤¯¤Ä¤«¤Î°ìÈÌŪ¤ÊÌäÂê¤Î²ò·èË¡¤Î¤¿¤á¤Ë ¢ª @xref{Problems}.
-
-²óÅú¤¬¤¢¤Ê¤¿¤Ë¸Ä¿ÍŪ¤ËÁ÷¤é¤ì¤Æ¡¢¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤ËÁ÷¤é¤ì¤Æ¤¤¤Ê¤¤»þ¡¢²óÅú
-¤òÍ×Ìó¤·¡¢¤¢¤Ê¤¿¤ÎÌäÂê¤Î²ò·è¤Î¼ê½õ¤±¤Ë¤Ê¤Ã¤¿ÊÖ»ö¤Î²¸·Ã¤ò¾¤Î¿Í¤Ë¤âÍ¿¤¨¤ë
-¤¿¤á¤Ë¡¢¤½¤ÎÍ×Ìó¤ò¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤ËÁ÷¿®¤¹¤ë¤³¤È¤Ï¡¢Îɤ¤¥¨¥Á¥±¥Ã¥È¤Ç¤¹¡ª
-
-@cindex Net etiquette
-@node Answering questions, , Bug reports, Questions
-@section ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤Ç¼ÁÌä¤ËÅú¤¨¤ë¤¿¤á¤Î¥¬¥¤¥É¥é¥¤¥ó
-
-¤¢¤Ê¤¿¤Î²óÅú¤¬¹­¤¯´Ø¿´¤ò»ý¤¿¤ì¤ë¤È¹Í¤¨¤é¤ì¤ë¾ì¹ç¡¢¿Ò¤Í¤¿¿Í¤Ë¸Ä¿ÍŪ¤ËľÀÜ
-ÊÖ»ö¤ò¤¹¤ëÂå¤ï¤ê¤Ë¡¢¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤ËÅê¹Æ¤·¤¿¤¤¤È»×¤¦¤Ç¤·¤ç¤¦¡£¥ª¥ê¥¸¥Ê
-¥ë¤ÎÅê¹Æ¼Ô°Ê³°¤Î¿Í¤â¤½¤ì¤«¤é²¸·Ã¤ò¼õ¤±¤é¤ì¤ë¤è¤¦¤Ë½½Ê¬°ìÈÌŪ¤Ë²óÅú¤òºîÀ®
-¤¹¤ë¤³¤È¤ò»î¤ß¤Æ¤¯¤À¤µ¤¤¡£¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤ËÅê¹Æ¤¹¤ë¾ì¹ç¤Ï¡¢¤¢¤Ê¤¿¤Î²óÅú
-¤¬°ÊÁ°¤Î²óÅú¤È½ÅÊ£¤·¤Æ¤¤¤Ê¤¤¤«³Îǧ¤·¤Æ²¼¤µ¤¤¡£
-
-¤¢¤Ê¤¿ÊÖ»ö¤ÎÃæ¤Ç¡¢¼ÁÌä¤ÎËܼÁÉôʬ¤ÎÍ×Ìó¤ò»î¤ß¤Æ¤¯¤À¤µ¤¤¡£¼ÁÌäÁ´ÂΤò°úÍѤ¹
-¤ë¤³¤È¤òµÁ̳¤È´¶¤¸¤Ê¤¤¤Ç²¼¤µ¤¤¡£
-
-HTML ¥â¡¼¥É¤ò ON ¤Ë¤·¤¿¥Ö¥é¥¦¥¶¤«¤é¥á¡¼¥ë¥á¥Ã¥»¡¼¥¸¤òÅê¹Æ¤·¤Ê¤¤¤Ç¤¯¤À¤µ
-¤¤¡ª ¿¤¯¤Î¥æ¡¼¥¶¤Ï¥Ö¥é¥¦¥¶¤Ç¥á¡¼¥ë¤òÆɤó¤Ç¤¤¤Þ¤»¤ó¡ª
-
-@cindex Licensing terms
-@cindex Support terms
-@node Licensing and Support, Installing, Questions, Top
-@chapter @strong{MySQL} ¥é¥¤¥»¥ó¥¹¤È¥µ¥Ý¡¼¥È
-
-(ÌõÃí¡§Àµ³Î¤µ¤ò¤­¤¹¤¿¤á¸¶Ê¸¤òÊ»µ­¤·¤Æ¤¤¤Þ¤¹¡£Ìõʸ¤À¤±¤Ç¤Ê¤¯¸¶Ê¸¤ËÌܤòÄ̤·¤Æ¤¯¤À¤µ¤¤¡£
-¤â¤·°ÕÌ£¤Î¼è°ã¤¤¤ò¸«¤Ä¤±¤¿¤Ê¤é¡¢@email{takeshi@@SoftAgency.co.jp} ¤ËÏ¢Íí¤·¤Æ¤¯¤À¤µ¤¤¡£)
-
-@menu
-* Licensing policy:: @strong{MySQL} licensing policy
-* Licensing policy on Win32::
-* Copyright:: Copyrights used by @strong{MySQL}
-* Commercial use:: Distributing @strong{MySQL} commercially
-* Licensing examples:: Example licensing situations
-* Cost:: @strong{MySQL} licensing and support costs
-* Support:: Types of commercial support
-@end menu
-
-This chapter describes @strong{MySQL} licensing and support arrangements,
-including:
-
-ËÜ¾Ï¤Ç¤Ï @strong{MySQL} ¤Î¥é¥¤¥»¥ó¥¹¤È¥µ¥Ý¡¼¥È·ÀÌó¤Ë¤Ä¤¤¤Æ½Ò¤Ù¤Þ¤¹¡£
-
-@itemize @bullet
-@item
-Our licensing policies for non-Microsoft and Microsoft operating systems
-
-@item
-The copyrights under which @strong{MySQL} is distributed
-(@pxref{Copyright})
-
-@item
-Sample situations illustrating when a license is required
-(@pxref{Licensing examples})
-
-@item
-Licensing and support costs (@pxref{Cost}), and
-support benefits (@pxref{Support})
-@end itemize
-
-
-@itemize @bullet
-@item
-ÈóMicrosoft ¤È Mirosoft ¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤ËÂФ¹¤ë¥é¥¤¥»¥ó¥¹¤Î¥Ý¥ê¥·¡¼
-
-@item
-@strong{MySQL} ÇÛÉۤˤª¤±¤ëÃøºî¸¢
-(@pxref{Copyright})
-
-@item
-¥é¥¤¥»¥ó¥¹¤¬É¬ÍפȤʤë¾ì¹ç¤ÎÎã
-(@pxref{Licensing examples})
-
-@item
-¥é¥¤¥»¥ó¥¹¤È¥µ¥Ý¡¼¥È¤ÎÈñÍÑ (@pxref{Cost}), ¤½¤·¤Æ
-¥µ¥Ý¡¼¥È¤ÎÍø±× (@pxref{Support})
-@end itemize
-
-
-@cindex Licensing policy
-@node Licensing policy, Licensing policy on Win32, Licensing and Support, Licensing and Support
-@section @strong{MySQL} licensing policy
-
-The formal terms of the license for non-Microsoft operating systems such as
-Unix or OS/2 are specified in @ref{Public license}. Basically, our licensing
-policy is as follows:
-
-Unix¤äOS/2¤Ê¤É¤ÎÈó¥Þ¥¤¥¯¥í¥½¥Õ¥È¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Ë¤ª¤±¤ë¥é¥¤¥»¥ó¥¹¤Î
-Àµ¼°¤Ê¾ò¹à¤Ï @ref{Public license}. ¤ËÌÀµ­¤·¤Æ¤¢¤ê¤Þ¤¹¡£
-´ðËÜŪ¤Ë¡¢²æ¡¹¤Î¥é¥¤¥»¥ó¥¹¤Î¥Ý¥ê¥·¡¼¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-For normal internal use, @strong{MySQL} generally costs nothing. You do not
-have to pay us if you do not want to.
-
-@item
-A license is required if:
-
-@itemize @minus
-@item
-You sell the @strong{MySQL} server directly or as a part of another product
-or service
-
-@item
-You charge for installing and maintaining a @strong{MySQL} server at some
-client site
-
-@item
-You include @strong{MySQL} in a distribution that is non-redistributable
-and you charge for some part of that distribution
-@end itemize
-
-@item
-For circumstances under which a @strong{MySQL} license is required, you need
-a license per machine that runs the @code{mysqld} server. However, a
-multiple-CPU machine counts as a single machine, and there is no restriction
-on the number of @strong{MySQL} servers that run on one machine, or on the
-number of clients concurrently connected to a server running on that
-machine!
-
-@item
-You do not need a license to include client code in commercial programs. The
-client access part of @strong{MySQL} is in the public domain. The
-@code{mysql} command line client includes code from the @code{readline}
-library that is under the GNU Public License.
-
-@item
-@cindex @code{myisampack}
-For customers who have purchased 1 license or @strong{MySQL} support, we provide
-additional functionality. Currently, this means we provide the
-@code{myisampack} utility for creating fast compressed read-only
-databases. (The server includes support for reading such databases but
-not the packing tool used to create them.) When support agreements
-generate sufficient revenue, we will release this tool under the same
-license as the @strong{MySQL} server.
-
-@item
-If your use of @strong{MySQL} does not require a license, but you like
-@strong{MySQL} and want to encourage further development, you are certainly
-welcome to purchase a license anyway.
-
-@item
-If you use @strong{MySQL} in a commercial context such that
-you profit by its use, we ask that you further the development of
-@strong{MySQL} by purchasing some level of support. We feel that if
-@strong{MySQL} helps your business, it is reasonable to ask that you help
-@strong{MySQL}. (Otherwise, if you ask us support questions, you are not
-only using for free something into which we've put a lot a work, you're
-asking us to provide free support, too.)
-@end itemize
-
-
-
-@itemize @bullet
-@item
-ÆâÉô¤Ç¤Î»ÈÍѤϡ¢@strong{MySQL} ¤Ë¥³¥¹¥È¤Ï¤«¤«¤ê¤Þ¤»¤ó¡£¤â¤·Ë¾¤Þ¤Ê¤¤¤Î¤Ç¤¢¤ì¤Ð¡¢
-²æ¡¹¤Ë»Ùʧ¤¦É¬ÍפϤ¢¤ê¤Þ¤»¤ó¡£
-
-@item
-¥é¥¤¥»¥ó¥¹¤Ï°Ê²¼¤Ç¤ÏɬÍפǤ¹¡§
-
-@itemize @minus
-@item
-@strong{MySQL} ¤òľÀÜÈÎÇ䤹¤ë¤«¡¢¤Þ¤¿¤Ï¾¤ÎÀ½Éʤ䥵¡¼¥Ó¥¹¤Î°ìÉô¤È¤·¤Æ
- @strong{MySQL} ¤òÈÎÇ䤹¤ë¾ì¹ç
-
-@item
-@strong{MySQL} ¤Î¥¤¥ó¥¹¥È¡¼¥ë¤ä¥á¥ó¥Æ¥Ê¥ó¥¹¥µ¡¼¥Ó¥¹¤ÇÎÁ¶â¤ò¤È¤ë¾ì¹ç¡£
-
-@item
-ºÆÇÛÉÛÉԲĤÎÇÛÉÛʪ¤Ë @strong{MySQL} ¤ò´Þ¤á¡¢¤½¤Î¤Ê¤«¤Î¤¤¤¯¤Ä¤«¤ËÎÁ¶â¤ò¤«¤¹¾ì¹ç
-@end itemize
-
-@item
-@strong{MySQL} ¥é¥¤¥»¥ó¥¹¤¬É¬Íפʾ𶷤Ȥ·¤Æ¡¢@code{mysqld} ¥µ¡¼¥Ð¤ò
-Áö¤é¤»¤ë¥Þ¥·¥ó 1 Âæ¤Ë¤Ä¤­ 1 ¤Ä¤Î¥é¥¤¥»¥ó¥¹¤òɬÍפȤ·¤Þ¤¹.
-¤·¤«¤·¡¢¥Þ¥ë¥Á CPU ¥Þ¥·¥ó¤Ï£±Âæ¤Î¥Þ¥·¥ó¤È¤ß¤Ê¤·¤Þ¤¹¡£
-1Âæ¤Î¥Þ¥·¥ó¾å¤ÇÁö¤é¤»¤ë @strong{MySQL} ¥µ¡¼¥Ð¤Î¿ô¤ËÀ©¸Â¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-¤½¤Î¥Þ¥·¥ó¾å¤ËÁö¤ë¥µ¡¼¥Ð¡¼¤ËÀܳ¤¹¤ë¥¯¥é¥¤¥¢¥ó¥È¤Î¿ô¤Ë¤âÀ©¸Â¤Ï
-¤¢¤ê¤Þ¤»¤ó¡£
-
-@item
-»ÔÈÎ¤Î¥×¥í¥°¥é¥à¤Ë¥¯¥é¥¤¥¢¥ó¥È¥³¡¼¥É¤ò´Þ¤à¤¿¤á¤Ë¡¢¥é¥¤¥»¥ó¥¹¤òɬÍפȤ·¤Þ¤»¤ó¡£
-@strong{MySQL} ¤Î¥¯¥é¥¤¥¢¥ó¥È¥¢¥¯¥»¥¹¤ÎÉôʬ¤Ï¥Ñ¥Ö¥ê¥Ã¥¯¥É¥á¥¤¥ó¤Ç¤¹¡£
-@code{mysql} ¥³¥Þ¥ó¥É¥é¥¤¥ó¥¯¥é¥¤¥¢¥ó¥È¤Ï¡¢GNU Public License ²¼¤Ë¤¢¤ë
-@code{readline} ¤ò´Þ¤ß¤Þ¤¹¡£
-
-@item
-@cindex @code{myisampack}
-For customers who have purchased 1 license or MySQL support, we provide
-additional functionality. Currently, this means we provide the
-@code{myisampack} utility for creating fast compressed read-only
-databases. (The server includes support for reading such databases but
-not the packing tool used to create them.) When support agreements
-generate sufficient revenue, we will release this tool under the same
-license as the @strong{MySQL} server.
-
-@item
-@strong{MySQL} ¤Î»ÈÍѤ˥饤¥»¥ó¥¹¤òɬÍפȤ·¤Ê¤¤¾ì¹ç¤Ç¤â¡¢@strong{MySQL} ¤¬¹¥¤­¤Ç,
-°ìÁؤγ«È¯¤ò¾©Î夷¤¿¤¤¤Ê¤é¤Ð,³Î¤«¤Ë,¤¢¤Ê¤¿¤¬¥é¥¤¥»¥ó¥¹¤ò¹ØÆþ¤¹¤ë»ö¤Ï´¿·Þ¤µ
-¤ì¤Æ¤¤¤Þ¤¹.
-
-@item
-¤¢¤Ê¤¿¤¬¾¦ÍÑ¤Ç @strong{MySQL} ¤ò»ÈÍѤ·¤Æ¤ª¤ê¡¢¤½¤ì¤ÇÍø±×¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤Î¤Ê¤é¡¢
-²æ¡¹¤Ï,¤¢¤Ê¤¿¤¬¤¤¤¯¤Ä¤«¤Î¥µ¥Ý¡¼¥È¤ò¹ØÆþ¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ @strong{MySQL} ¤Î³«È¯¤ò
-Â¥¿Ê¤¹¤ë¤è¤¦¤ËÍê¤ß¤Þ¤¹. ²æ¡¹¤Ï,@strong{MySQL} ¤¬¤¢¤Ê¤¿¤Î¥Ó¥¸¥Í¥¹¤ò½õ¤±¤ë¤Ê¤é¤Ð¡¢
-¤¢¤Ê¤¿¤¬ @strong{MySQL} ¤ò½õ¤±¤ë¤è¤¦¤ËÍê¤à¤Î¤¬Æ»Íý¤Ë¹ç¤¦¤È´¶¤¸¤Þ¤¹.
-¡Ê¤¢¤Ê¤¿¤¬²æ¡¹¤Ë¼ÁÌä¤Î¥µ¥Ý¡¼¥È¤òµá¤á¤ë¤Î¤Ç¤¢¤ì¤Ð¡¢
-²æ¡¹¤¬Â¿¤¯¤ÎÏ«ÎϤò¤Ä¤®¹þ¤ó¤À¤â¤Î¤ò̵½þ¤Ç»ÈÍѤ¹¤ë¤³¤È¤Ï¤ä¤á¤Æ¤¯¤À¤µ¤¤¡£
-̵½þ¤Î¥µ¥Ý¡¼¥È¤ÎÄ󶡤ò²æ¡¹¤ËÍê¤à¤³¤È¤â¤Ç¤¹¡£¡Ë
-@end itemize
-
-If you have any questions as to whether or not a license is required for your
-particular use of @strong{MySQL}, please contact us.
-@xref{Contact information}.
-
-@strong{MySQL} ¤Î»ÈÍѤ˺ݤ·¤Æ¥é¥¤¥»¥ó¥¹¤¬É¬ÍפǤ¢¤ë¤«¤É¤¦¤«¤Ë´Ø¤·¤Æ¤Î¼ÁÌ䤬¤¢¤ë¤Ê¤é¤Ð
-²æ¡¹¤ËÌ䤤¹ç¤ï¤»¤Æ¤¯¤À¤µ¤¤¡£@xref{Contact information}.
-
-If you require a @strong{MySQL} license, the easiest way to pay for it is to
-use the license form on TcX's secure server at
-@url{https://www.mysql.com/license.htmy}. Other forms of payment are discussed
-in @ref{Payment information}.
-
-¤¢¤Ê¤¿¤¬ @strong{MySQL} ¥é¥¤¥»¥ó¥¹¤òɬÍפȤ·¤Æ¤ª¤ê¡¢´Êñ¤Ê»Ùʧ¤¤ÊýË¡¤ò
-˾¤à¤Î¤Ç¤¢¤ì¤Ð¡¢TcX¤Î°ÂÁ´¤Ê¥µ¡¼¥Ð¤Ë¤ª¤±¤ë¥é¥¤¥»¥ó¥¹¥Õ¥©¡¼¥à¤ò»ÈÍѤ¹¤ë
-¤³¤È¤Ç¤¹. @url{https://www.mysql.com/license.htmy}.
-¤Û¤«¤Î»Ùʧ¤¤ÊýË¡¤Ë¤Ä¤¤¤Æ¤Ï @ref{Payment information}.
-¡ÊÆüËܤǤιØÆþ¤Ï @uref{http://www.softagency.co.jp/}. ¡Ë
-
-
-@strong{MySQL} licensing policy
-
-@cindex Licensing on Win32
-@node Licensing policy on Win32, Copyright, Licensing policy, Licensing and Support
-@section MySQL licensing policy on Win32
-
-For use under Microsoft operating systems (Win95/Win98/WinNT/Win2000),
-you need a @strong{MySQL} license after a trial period of 30 days, with
-the exceptions that are listed later. @xref{Win license}.
-
-A shareware version of @strong{MySQL}-Win32, that you can try before
-buying, is available at @uref{http://www.mysql.com/mysql_w32.htmy}. This
-is based on a very late, stable @strong{MySQL} version, but compiled
-with full debugging support, which makes this a lot slower than the
-registered version. After you have registered for a @strong{MySQL}
-license, you will get a password that will enable you to access the
-newest @strong{MySQL}-Win32 version.
-
-Microsoft ¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à(Win95/Win98/WinNT/Win2000)²¼¤Ë¤ª¤±¤ë»ÈÍѤǤϡ¢
-¤¢¤Ê¤¿¤Ï30Æü¤Î¥È¥é¥¤¥¢¥ë´ü´Ö¤Î¸å¤Ë @strong{MySQL} ¥é¥¤¥»¥ó¥¹¤òɬÍפȤ·¤Þ¤¹¡£
-@xref{Win license}.
-
-¤¢¤Ê¤¿¤¬¹ØÆþ¤ÎÁ°¤Ë»î¤ß¤ë¤³¤È¤¬¤Ç¤­¤ë @strong{MySQL}-Win32 ¤Î¥·¥§¥¢¥¦¥§¥¢¥Ð¡¼¥¸¥ç¥ó¤Ï
-@uref{http://www.mysql.com/mysql_w32.htmy}. ¤Ë¤¢¤ê¤Þ¤¹.
-¤³¤ì¤Ï°ÂÄêÈǤΠ@strong{MySQL} ¤ò¥Ù¡¼¥¹¤Ë¥Õ¥ë¡¦¥Ç¥Ð¥Ã¥°¥â¡¼¥É¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¤Æ¤ª¤ê¡¢
-Àµ¼°ÅÐÏ¿ÈǤËÈæ¤Ù¤Æ®ÅÙ¤ÏÃÙ¤¯¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
-¥é¥¤¥»¥ó¥¹Âå¤ò»Ùʧ¤Ã¤¿¸å¤Ë,¤¢¤Ê¤¿¤ÏºÇ¤â¿·¤·¤¤ @strong{MySQL}-Win32 ¥Ð¡¼¥¸¥ç¥ó¤Ë
-¥¢¥¯¥»¥¹¤¹¤ë¤¿¤á¤Î¥Ñ¥¹¥ï¡¼¥É¤òÆÀ¤ë¤Ç¤·¤ç¤¦.
-
-¡ÊÆüËܸìÈÇ @strong{MySQL}-Win32 ¤Îɾ²ÁÈǤȿ½¤·¹þ¤ß¤Ï @uref{http://www.softagency.co.jp/}. ¡Ë
-
-The reason for always requiring a license under Microsoft Windows is
-that because Windows is a highly commercial OS with very high
-development costs (it usually takes 3 times longer to build and test
-things under windows), we see no other alternative than only give the
-latest @strong{MySQL} Windows version to paying customers. If we
-didn't do this we would not be able to keep up development on
-Windows.
-
-We do give free @strong{MySQL} licenses on request in the following cases:
-
-@itemize @bullet
-@item
-Educational purposes, like teaching students.
-@item
-Non-commercial research settings.
-@item
-Churches.
-@item
-Registered charity organizations.
-@item
-Individual students who have database related educational project.
-@item
-People who help us with @strong{MySQL} development in some constructive manner.
-@end itemize
-
-If something of the above applies to you, you can apply for a license by
-sending an email to @email{mysql-licensing@@mysql.com}. This should include
-a full description of for what you need a free @strong{MySQL} license.
-
-As soon as we can afford it we plan to release @strong{MySQL} Win32
-under the same license as @strong{MySQL} under other OS. This will
-however also require that we can find some Windows developers that would
-like to work on @strong{MySQL} development under Windows and build
-windows version for all @strong{MySQL} releases.
-
-
-@cindex Copyright
-@node Copyright, Commercial use, Licensing policy on Win32, Licensing and Support
-@section Copyrights used by @strong{MySQL}
-
-@menu
-* Copyright changes:: Possible future copyright changes
-@end menu
-
-There are several different copyrights on the @strong{MySQL} distribution:
-
-@strong{MySQL} ÇÛÉۤˤª¤±¤ë¡¢¤¤¤¯¤Ä¤«°Û¤Ê¤ë¥³¥Ô¡¼¥é¥¤¥È¤ò¼¨¤·¤Þ¤¹¡§
-
-@enumerate
-@item
-The @strong{MySQL}-specific source needed to build the
-@code{mysqlclient} library and programs in the @file{client} directory
-is in the public domain. Each file that is in the public domain has a
-header which clearly states so. This includes everything in the
-@file{client} directory and some parts of the @code{mysys},
-@code{mystring} and @code{dbug} libraries.
-
-@item
-Some small parts of the source (GNU @code{getopt}) are covered by the
-``GNU LIBRARY LIBRARY GENERAL PUBLIC LICENSE''. See the
-@file{mysys/COPYING.LIB} file.
-
-@item
-Some small parts of the source (GNU @code{readline}) are covered by the
-``GNU GENERAL PUBLIC LICENSE''. See the @file{readline/COPYING} file.
-
-@item
-Some parts of the source (the @code{regexp} library) are covered by a Berkeley
-style copyright.
-
-@item
-The other source needed for the @strong{MySQL} server on non-Microsoft
-platforms is covered by the ``MySQL FREE PUBLIC LICENSE'', which is based on
-the ``Aladdin FREE PUBLIC LICENSE.'' @xref{Public license}. When running
-@strong{MySQL} on any Microsoft operating system, other licensing applies.
-@end enumerate
-
-@enumerate
-@item
-@file{client} ¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Î @code{mysqlclient} ¥é¥¤¥Ö¥é¥ê¤È
-¥×¥í¥°¥é¥à·²¤òºîÀ®¤¹¤ë¤ËɬÍפȤµ¤ì¤ëÆÃÄê¤Î @strong{MySQL} ¤Î¥½¡¼¥¹¤Ï¡¢
-¥Ñ¥Ö¥ê¥Ã¥¯¥É¥á¥¤¥ó¤Ç¤¹¡£
-¤½¤ì¤¾¤ì¤Î¥Ñ¥Ö¥ê¥Ã¥¯¥É¥á¥¤¥ó²¼¤Î¥Õ¥¡¥¤¥ë¤ÎËÁƬ¤Ë¤Ï¡¢¤½¤Î»ö¤òÌÀµ­¤·¤Æ¤¢¤ê¤Þ¤¹¡£
-¤³¤ì¤Ï¡¢@file{client} ¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤ÎÁ´¥Õ¥¡¥¤¥ë¤È¡¢
-@code{mysys}, @code{mystring}, @code{dbug} ¥é¥¤¥Ö¥é¥ê¤Î¤¤¤¯¤Ä¤«¤ò´Þ¤ß¤Þ¤¹¡£
-
-@item
-¥½¡¼¥¹¤Î¤¤¤¯¤Ä¤«¤ÎÉôʬ¤Ï (GNU @code{getopt}) ``GNU LIBRARY GENERAL PUBLIC LICENSE''
- ¤Ë½¾¤Ã¤ÆÊѹ¹¤·¤¿¤â¤Î¤Ç¤¹¡£See the @file{mysys/COPYING.LIB} file.
-
-@item
-¥½¡¼¥¹¤Î¤¤¤¯¤Ä¤«¤ÎÉôʬ¤Ï (GNU @code{readline}) ``GNU GENERAL PUBLIC LICENSE'' ¤Ë½¾¤Ã¤ÆÊѹ¹¤·¤¿¤â¤Î¤Ç¤¹¡£
-See the @file{readline/COPYING} file.
-
-@item
-¥½¡¼¥¹¤Î¤¤¤¯¤Ä¤«¤ÎÉôʬ¤Ï (@code{regexp} library) ¥Ð¡¼¥¯¥ì¥¤¥¹¥¿¥¤¥ë¤Î¥³¥Ô¡¼¥é¥¤¥È¤Ë½¾¤Ã¤ÆÊѹ¹¤·¤¿¤â¤Î¤Ç¤¹¡£
-
-@item
-ÈóMicrosoft ¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Î @strong{MySQL} ¥µ¡¼¥Ð¡¼¤ËɬÍפʥ½¡¼¥¹¤Ï¡¢
- ``MySQL FREE PUBLIC LICENSE'' ²¼¤Ë¤¢¤ê¤Þ¤¹¡£¤³¤Î¥é¥¤¥»¥ó¥¹¤Ï ``Aladdin FREE PUBLIC LICENSE''
- ¤ò¸µ¤Ë¤·¤Æ¤¤¤Þ¤¹ @xref{Public license}¡£
-Microsoft¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¾å¤Ç @strong{MySQL} ¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ï¡¢
-°ã¤¦¥é¥¤¥»¥ó¥¹¤¬Å¬ÍѤµ¤ì¤Þ¤¹¡£@xref{Win license}
-@end enumerate
-
-
-The following points set forth the philosophy behind our copyright policy:
-
-°Ê²¼¤Ë¤ï¤ì¤ï¤ì¤Î¥³¥Ô¡¼¥é¥¤¥È¤Î´ðËÜÍýÇ°¤ò¼¨¤·¤Þ¤¹¡§
-
-
-@itemize @bullet
-@item
-The SQL client library should be totally free so that it can be included in
-commercial products without limitations.
-
-@item
-People who want free access to the software into which we have put a lot of
-work can have it, so long as they do not try to make money directly by
-distributing it for profit.
-
-@item
-People who want the right to keep their own software proprietary, but also
-want the value from our work, can pay for the privilege.
-
-@item
-That means normal in-house use is FREE. But if you use @strong{MySQL} for
-something important to you, you may want to help further its development by
-purchasing a license or a support contract. @xref{Support}.
-@end itemize
-
-
-@itemize @bullet
-@item
-ËÜ SQL client ¥é¥¤¥Ö¥é¥ê¡¼¤Ï̵½þ¤Ç¤¢¤ë¤³¤È¡£
-¤³¤ì¤Ï¾¦ÍѤÎÀ½ÉʤËÂФ·¤Æ¤â̵À©¸Â¤Ç¤¢¤ë¤³¤È¤ò´Þ¤à¡£
-
-@item
-¾¦Çä¤Î¤¿¤á¤ÎÇÛÉÛ¤ò¹Ô¤Ã¤ÆÂвÁ¤òÆÀ¤è¤¦¤È¤·¤Ê¤¤¸Â¤ê¤Ï¡¢
-²æ¡¹¤¬¿ÔÎϤ·¤Æºî¤Ã¤¿ËÜ¥½¥Õ¥È¥¦¥§¥¢¤ËÀ©¸Â¤Ê¤¯¥¢¥¯¥»¥¹¤Ç¤­¤ë¡£
-
-@item
-¼«Ê¬¼«¿È¤Î¥½¥Õ¥È¥¦¥§¥¢¤ÎÆÈÀ긢¤â¤Û¤·¤¤¤¬,²æ¡¹¤Î¥½¥Õ¥È¤ò»ÈÍѤ·¤ÆÂвÁ¤âÆÀ¤¿¤¤¤È
-¹Í¤¨¤Æ¤¤¤ë¿Í¡¹¤Ï,Æø¢¤òÇ㤦¤³¤È¤¬¤Ç¤­¤Þ¤¹.
-
-@item
-¤½¤ì¤Ï,Ä̾ï¤ÎÆâÉô¤Î»ÈÍѤ¬ÌµÎÁ¤Ç¤¢¤ë¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£
-¤·¤«¤·,¤¢¤Ê¤¿¤Ë¤È¤Ã¤Æ²¿¤«½ÅÍפʤâ¤Î¤Ë¤½¤ì¤ò»ÈÍѤ¹¤ë¤Ê¤é¤Ð,
-¤¢¤Ê¤¿¤Ï,¥µ¥Ý¡¼¥È·ÀÌó¤ò¹ØÆþ¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ,
- @strong{MySQL} ¤Î°ìÁؤγ«È¯¤ò¥µ¥Ý¡¼¥È¤·¤¿¤¬¤ë¤«¤â¤·¤ì¤Þ¤»¤ó.
-@end itemize
-
-
-@node Copyright changes, , Copyright, Copyright
-@subsection Possible future copyright changes
-
-We may choose to distribute older versions of @strong{MySQL} with the GPL in
-the future. However, these versions will be identified as @strong{GNU MySQL}.
-Also, all copyright notices in the relevant files will be changed to the
-GPL.
-
-²æ¡¹¤Ï,¾­Íè GPL ¤Ç @strong{MySQL} ¤Îµì¼°¤Î¥Ð¡¼¥¸¥ç¥ó¤òÇÛÉÛ¤¹¤ë»ö¤òÁª¤Ö¤«¤â¤·¤ì¤Þ¤»¤ó.
-¤³¤Î¾ì¹ç,¤³¤ì¤é¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï @strong{GNU MySQL} ¤È¤¹¤ë¤Ä¤â¤ê¤Ç¤¹.
-¤Þ¤¿,´ØÏ¢¥Õ¥¡¥¤¥ë¤ÎÃæ¤Î¤¹¤Ù¤Æ¤ÎÈǸ¢¾ðÊó¤ò GPL ¤ËÊѤ¨¤ë¤Ä¤â¤ê¤Ç¤¹.
-
-
-@node Commercial use, Licensing examples, Copyright, Licensing and Support
-@section Distributing @strong{MySQL} commercially¡¡¾¦ÍÑÇÛÉÛ
-
-This section is a clarification of the license terms that are set forth in
-the ``MySQL FREE PUBLIC LICENSE'' (FPL). @xref{Public license}.
-
-°Ê²¼¤Ë ``MySQL FREE PUBLIC LICENSE'' (FPL) ¤òÌÀ³Î¤Ëµ­¤·¤Þ¤¹.
-@xref{Public license}.
-
-@strong{MySQL} may be @strong{used} freely, including by commercial
-entities for evaluation or unsupported internal use. However,
-@strong{distribution} for commercial purposes of @strong{MySQL}, or
-anything containing or derived from @strong{MySQL} in whole or in part,
-requires a written commercial license from TcX AB, the sole entity
-authorized to grant such licenses.
-
-@strong{MySQL} ¤Î»ÈÍѤˤÏÀ©¸Â¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-¤³¤ì¤Ï¾¦ÍÑÍøÍѤΤ¿¤á¤Îɾ²Á¤ä¡¢ÆâÉô¤ÇÈ󥵥ݡ¼¥È¤Ç»ÈÍѤ¹¤ë¤³¤È¤ò´Þ¤ß¤Þ¤¹¡£
-¤·¤«¤·¼¡¤Î¾ò·ï¤Ç¤Ï TcX AB (¥é¥¤¥»¥ó¥¹¤òÍ¿¤¨¤ë¸¢¸Â¤ò»ý¤ÄÍ£°ì¤Îµ¡´Ø)
-¤Ë¤è¤Ã¤Æµ­ºÜ¤µ¤ì¤¿¾¦Íѥ饤¥»¥ó¥¹¤¬É¬ÍפǤ¹¡£
-@strong{MySQL} ¼«¿È¤ò¾¦ÍÑÌÜŪ¤Ç@strong{ÇÛÉÛ}¤¹¤ë¤³¤È¡£
-@strong{MySQL} ¤Î°ìÉô¡¢¤¢¤ë¤¤¤ÏÁ´Éô¤ò´Þ¤ó¤Àʪ¤ò¾¦ÍÑÌÜŪ¤Ç@strong{ÇÛÉÛ}¤¹¤ë¤³¤È¡£
-@strong{MySQL} ¤òÍøÍѤ·¤Æºî¤Ã¤¿Êª¤Î°ìÉô¡¢¤¢¤ë¤¤¤ÏÁ´Éô¤ò´Þ¤ó¤Àʪ¤ò¾¦ÍÑÌÜŪ¤Ç@strong{ÇÛÉÛ}¤¹¤ë¤³¤È¡£
-
-You may not include @strong{MySQL} ``free'' in a package containing
-anything for which a charge is being made, except as noted below.
-
-¶âÁ¬¤¬È¯À¸¤¹¤ë¤¤¤«¤Ê¤ëʪ¤ÎÃæ¤Ë¤â¡¢@strong{MySQL} ¤ò ``̵½þ'' ¤Ç´Þ¤ó¤Ç¤Ï¤¤¤±¤Þ¤»¤ó¡£
-¤¿¤À¤·¡¢°Ê²¼¤Ï½ü¤­¤Þ¤¹¡£
-
-The intent of the exception provided in the second clause of the license is
-to allow commercial organizations operating an FTP server or a bulletin board
-to distribute @strong{MySQL} freely from it, provided that:
-
-Ëܥ饤¥»¥ó¥¹¤Î£²ÈÖÌܤËÎã³°Á¼ÃÖ¤ò¤â¤¦¤±¤Æ¤¤¤ë°Õ¿Þ¤Ï¡¢±ÄÍøÃÄÂΤ¬±¿±Ä¤·¤Æ¤¤¤ë FTP ¥µ¡¼¥Ð¡¼¡¢
-·Ç¼¨ÈÄÅù¤Ç¡¢¼«Í³¤Ë @strong{MySQL} ¤òÇÛÉÛ¤¹¤ë¤³¤È¤òµö²Ä¤¹¤ë¤¿¤á¤Ç¤¹¡£
-
-@enumerate
-@item
-The organization complies with the other provisions of the FPL, which
-include among other things a requirement to distribute the full source
-code of @strong{MySQL} and of any derived work, and to distribute the
-FPL itself along with @strong{MySQL};
-
-@item
-The only charge for downloading @strong{MySQL} is a charge based on the
-distribution service and not one based on the content of the information
-being retrieved (i.e., the charge would be the same for retrieving a
-random collection of bits of the same size);
-
-@item
-The server or BBS is accessible to the general public, i.e., the phone
-number or IP address is not kept secret, and anyone may obtain access to
-the information (possibly by paying a subscription or access fee that is
-not dependent on or related to purchasing anything else).
-@end enumerate
-
-@enumerate
-@item
-¤½¤ÎÃÄÂÎ¤Ï FPL ¤Î¾¤Î¾ò¹à¤ò¼õ¤±Æþ¤ì¤ë¤³¤È¡£¤½¤ÎÍ×µá¤ÎÃæ¤Ç¤â¤È¤ê¤ï¤±
- @strong{MySQL} ¤È¤¤¤«¤Ê¤ëÇÉÀ¸Êª¤ÎÁ´¥½¡¼¥¹¤ÎÇÛÉۤȡ¢
- @strong{MySQL} ¤È°ì½ï¤Ë FPL ¼«¿È¤òÇÛÉÛ¤¹¤ë¤³¤È¤Ï¼õ¤±Æþ¤ì¤ë¤³¤È¡£
-
-@item
-@strong{MySQL} ¤ò¥À¥¦¥ó¥í¡¼¥É¤¹¤ë¹Ô°Ù¤Ë¤À¤±²Ý¶â¤¹¤ë¾ì¹ç¤Ç¡¢
-¤³¤ÎÃÍÃʤÏÇÛÉÛ¥µ¡¼¥Ó¥¹¤ÎÈñÍѤǤ¢¤ê¡¢¼õ¿®¤¹¤ëÂоÝʪ¤Ë¤è¤Ã¤ÆÊѤï¤é¤Ê¤¤»ö¡£
-(Î㤨¤Ð¡¢¼õ¿®¤¹¤ëʪ¤¬°ã¤Ã¤Æ¤¤¤Æ¤â¼õ¿®Î̤¬Æ±¤¸¤Ç¤¢¤ì¤ÐƱ¤¸ÃÍÃʤǤ¢¤ë¤³¤È¡£)
-
-@item
-¥µ¡¼¥Ð¡¼¡¢BBS ¤Ï°ìÈ̤˸ø³«¤µ¤ì¤Æ¤¤¤Æ¥¢¥¯¥»¥¹²Äǽ¤Ê¤³¤È¡£Î㤨¤Ð¡¢ÅÅÏÃÈÖ¹æ¤ä
-IP¥¢¥É¥ì¥¹¤¬±£¤µ¤ì¤Æ¤ª¤é¤º¡¢¤À¤ì¤â¤¬¤½¤Î¾ðÊó¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤ë¤³¤È¡£
-(¤Ê¤Ë¤«¤òÇ㤦¤È¤¤¤¦¤³¤È¤Ë´ØÏ¢¤·¤¿¤ê°Í¸¤·¤¿¤ê¤·¤Ê¤¤¹ØÆÉÎÁ¤ä¥¢¥¯¥»¥¹ÎÁ¶â¤Ë¤è¤ëʪ¤â²Ä)
-@end enumerate
-
-If you want to distribute software in a commercial context that incorporates
-@strong{MySQL} and you do @strong{not} want to meet these conditions, you
-should contact TcX AB to find out about commercial licensing, which involves
-a payment. The only ways you legally can distribute @strong{MySQL} or
-anything containing @strong{MySQL} are by distributing @strong{MySQL} under
-the requirements of the FPL, or by getting a commercial license from TcX AB.
-
-@strong{MySQL} ¤òÁȤ߹þ¤ó¤À¾¦¶È¥½¥Õ¥È¥¦¥§¥¢¤òÇÛÉÛ¤·¤¿¤¤¤¬,
-¤³¤ì¤é¤Î¾ò·ï¤òËþ¤¿¤·¤¿¤¯@strong{¤Ê¤¤}¤Ê¤é¤Ð,¤¢¤Ê¤¿¤Ï,¾¦¶Èǧ²Ä¤Ë´Ø¤·¤Æ
- TcX AB ¤ËÏ¢Íí¤¹¤ë¤Ù¤­¤Ç¤¹.
-¾¦¶È¥é¥¤¥»¥ó¥¹¤Ï»Ùʧ¤¤¤Ë±Æ¶Á¤·,¥µ¥Ý¡¼¥È¤½¤Î¾¤ÎÍøÅÀ¤ò´Þ¤ß¤Þ¤¹.
-¤³¤ì¤é¤Ï¤¢¤Ê¤¿¤¬ @strong{MySQL} ¼«¿È¤ä @strong{MySQL} ¤ò´Þ¤àʪ¤ò
-¹çˡŪ¤ËÇÛÉÛ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ëÍ£°ì¤ÎÊýË¡¤Ç¤¹:
-FPL¤Î¾ò·ï¤Î²¼¤Ë @strong{MySQL} ¤òÇÛÉÛ¤¹¤ë¤³¤È¤«,
-¤Þ¤¿¤Ï TcX AB ¤«¤é¾¦¶È¥é¥¤¥»¥ó¥¹¤òÆÀ¤ë¤³¤È¤Ë¤è¤Ã¤Æ.
-
-
-@node Licensing examples, Cost, Commercial use, Licensing and Support
-@section Example licensing situations¡¡¥é¥¤¥»¥ó¥¹Îã
-
-@menu
-* Products that use MySQL:: Selling products that use @strong{MySQL}
-* MySQL services:: Selling @strong{MySQL}-related services
-* ISP:: ISP @strong{MySQL} services
-* Web server:: Running a web server using @strong{MySQL}.
-@end menu
-
-This section describes some situations illustrating whether or not you must
-license the @strong{MySQL} server. Generally these examples involve
-providing @strong{MySQL} as part of a product or service that you are selling
-to a customer, or requiring that @strong{MySQL} be used in conjunction with
-your product. In such cases, it is your responsibility to obtain a license
-for the customer if one is necessary. (This requirement is waived if your
-customer already has a @strong{MySQL} license. But the seller must send
-customer information and the license number to TcX, and the license must be a
-full license, not an OEM license.)
-
-¤³¤Î¥»¥¯¥·¥ç¥ó¤Ç¤Ï¡¢¤¢¤Ê¤¿¤¬¤É¤¦¤¤¤Ã¤¿¾õ¶·¤Ç @strong{MySQL} ¥µ¡¼¥Ð¥é¥¤¥»¥ó¥¹¤ò
-ÆÀ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤«Èݤ«¤ò¡¢¤¤¤¯¤Ä¤«ÀâÌÀ¤·¤Þ¤¹¡£
-°ìÈ̤ˤ³¤ì¤é¤ÎÎã¤Ï¡¢
-@strong{MySQL} ¤¬¡¢¤¢¤Ê¤¿¤¬¸ÜµÒ¤ËÇä¤Ã¤Æ¤¤¤ëÀ½Éʤ䥵¡¼¥Ó¥¹¤Î°ìÉô¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¾ì¹ç¤ä¡¢
-¤¢¤Ê¤¿¤ÎÀ½Éʤ¬ @strong{MySQL} ¤Î»ÈÍѤòÍ׵ᤷ¤Æ¤¤¤ë¾ì¹ç¤Ê¤É¤Ç¤¹¡£
-¤³¤Î¤è¤¦¤Ê¾ì¹ç¡¢¸ÜµÒ¤Î¤¿¤á¤Ë¥é¥¤¥»¥ó¥¹¤òÆÀ¤ë¤Î¤Ï¤¢¤Ê¤¿¤ÎÀÕǤ¤Ç¤¹¡£
-¡Ê¤¿¤À¤·¡¢¤¹¤Ç¤Ë¤½¤Î¸ÜµÒ¤¬ @strong{MySQL} ¤Î¥é¥¤¥»¥ó¥¹¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¤Î¤¾¤­¤Þ¤¹¡£
-¤¬¡¢Çä¤ê¼ê¤Ï¸ÜµÒ¤Î¾ðÊó¤È¥é¥¤¥»¥ó¥¹¥Ê¥ó¥Ð¡¼¤òTcX¤ËÁ÷¤ëɬÍפ¬¤¢¤ê¡¢¤«¤Ä¡¢
-¤½¤Î¥é¥¤¥»¥ó¥¹¤ÏOEM¥é¥¤¥»¥ó¥¹¤Ç¤Ï¤Ê¤¯¡¢¥Õ¥ë¥é¥¤¥»¥ó¥¹¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£¡Ë
-
-Note that a single @strong{MySQL} license covers any number of
-CPUs/users/customers/@code{mysqld} servers on a machine!
-
-@strong{MySQL} ¥é¥¤¥»¥ó¥¹°ì¤Ä¤Ç¡¢°ìÂæ¤Î¥Þ¥·¥ó¾å¤Î¡¢
-Á´ CPU¿ô/¥æ¡¼¥¶¡¼¿ô/¸ÜµÒ¿ô/@code{mysqld} ¿ô¤ò¥«¥Ð¡¼¤·¤Þ¤¹¡£
-
-
-@node Products that use MySQL, MySQL services, Licensing examples, Licensing examples
-@subsection Selling products that use @strong{MySQL}
-
-To determine whether or not you need a @strong{MySQL} license when selling
-your application, you should ask whether the proper functioning of your
-application is contingent on the use of @strong{MySQL} and whether you
-include @strong{MySQL} with your product. There are several cases to
-consider:
-
-¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤òÈÎÇ䤹¤ë¤È¤­¡¢¤¢¤Ê¤¿¤¬ @strong{MySQL} ¥é¥¤¥»¥ó¥¹¤ò
-ɬÍפȤ¹¤ë¤«¤É¤¦¤«·èÄꤹ¤ë¤¿¤á¤Ë¤Ï,
-¤¢¤Ê¤¿¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬Å¬Àڤ˵¡Ç½¤¹¤ë¤¿¤á¤Ë¤Ï @strong{MySQL} ¤òɬÍפȤ¹¤ë¤«¤É¤¦¤«¡¢
-À½ÉÊ¤Ë @strong{MySQL} ¤ò´Þ¤à¤«¤É¤¦¤«¤ò¿Ò¤Í¤ë¤Ù¤­¤Ç¤¹. ¹Í¤¨¤¦¤ë¤¤¤¯¤Ä¤«
-¤Î¥±¡¼¥¹¤¬¤¢¤ê¤Þ¤¹:
-
-@itemize @bullet
-@item
-Does your application require @strong{MySQL} to function properly?
-
-If your product requires @strong{MySQL}, you need a license for any machine
-that runs the @code{mysqld} server. For example, if you've designed your
-application around @strong{MySQL}, then you've really made a commercial
-product that requires the engine, so you need a license.
-
-If your application does not require @strong{MySQL}, you need not obtain a
-license. For example, if @strong{MySQL} just added some new optional
-features to your product (such as adding logging to a database if
-@strong{MySQL} is used rather than logging to a text file), it should fall
-within normal use, and a license would not be required.
-
-In other words, you need a license if you sell a product designed
-specifically for use with @strong{MySQL} or that requires the @strong{MySQL}
-server to function at all. This is true whether or not you provide
-@strong{MySQL} for your client as part of your product distribution.
-
-It also depends on what you're doing for the client. Do you plan to provide
-your client with detailed instructions on installing @strong{MySQL} with your
-software? Then your product may be contingent on the use of @strong{MySQL};
-if so, you need to buy a license. If you are simply tying into a database
-that you expect already to have been installed by the time your software is
-purchased, then you probably don't need a license.
-
-@item
-Do you include @strong{MySQL} in a distribution and charge for that
-distribution?
-
-If you include @strong{MySQL} with a distribution that you sell to customers,
-you will need a license for any machine that runs the @code{mysqld} server,
-because in this case you are selling a system that includes @strong{MySQL}.
-
-This is true whether the use of @strong{MySQL} with your product
-is required or optional.
-
-@item
-Do you neither require for your product nor include @strong{MySQL} with it?
-
-Suppose you want to sell a product that is designed generally to use ``some
-database'' and that can be configured to use any of several supported
-alternative database systems (@strong{MySQL}, PostgreSQL, or something
-else). That is, your product does not not require @strong{MySQL}, but can
-support any database with a base level of functionality, and you don't rely
-on anything that only @strong{MySQL} supports. Does one of you owe us money
-if your customer actually does choose to use @strong{MySQL}?
-
-In this case, if you don't provide, obtain or set up @strong{MySQL} for the
-customer should the customer decide to use it, neither of you need a
-license. If you do perform that service, see @ref{MySQL services, ,
-@strong{MySQL} services}.
-@end itemize
-
-@itemize @bullet
-@item
-¤¢¤Ê¤¿¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬Å¬Àڤ˵¡Ç½¤¹¤ë¤¿¤á¤Ë¤Ï¡¢@strong{MySQL} ¤òɬÍפȤ·¤Þ¤¹¤«?
-
-¤¢¤Ê¤¿¤ÎÀ½Éʤ¬ @strong{MySQL} ¤òɬÍפȤ¹¤ë¤Ê¤é¤Ð,@strong{mysqld} ¥µ¡¼¥Ð¤ò
-Áö¤é¤»¤ë¤É¤ó¤Ê¥Þ¥·¥ó¤Ë¤â¥é¥¤¥»¥ó¥¹¤òɬÍפȤ·¤Þ¤¹. Î㤨¤Ð¤¢¤Ê¤¿¤¬
- @strong{MySQL} ¤Î¼þ¤ê¤Ç¼«Ê¬¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤òÀ߷פ·¤¿¤Ê¤é¤Ð¡¢
-ËÜÅö¤Ë¥¨¥ó¥¸¥ó¤òɬÍפȤ¹¤ë¾¦¶ÈÀ½Éʤòºî¤Ã¤¿»ö¤Ë¤Ê¤ë¤Î¤Ç¡¢¥é¥¤¥»¥ó¥¹¤¬É¬ÍפǤ¹.
-
-¤¢¤Ê¤¿¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬ @strong{MySQL} ¤òɬÍפȤ·¤Ê¤¤¤Ê¤é¤Ð,¤¢¤Ê¤¿¤Ï
-¥é¥¤¥»¥ó¥¹¤òÆÀ¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£ Î㤨¤Ð @strong{MySQL} ¤¬¤¿¤À¤¢¤Ê¤¿¤ÎÀ½ÉʤË
-¤¤¤¯¤Ä¤«¤Î¿·¤·¤¤Ç¤°Õ¤ÎÆÃħ¤ò²Ã¤¨¤¿¤Ê¤é¤Ð
-¡Ê¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Ø¤Î¥í¥®¥ó¥°¤è¤ê¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥í¥®¥ó¥°¤Ë @strong{MySQL} ¤¬
-»ÈÍѤµ¤ì¤ë¤è¤¦¤Ê¾ì¹ç¡Ë¡¢¤½¤ì¤ÏÄ̾ï¤Î»ÈÍѲ¼¤Ê¤Î¤Ç¡¢¥é¥¤¥»¥ó¥¹¤ÏɬÍפʤ¤¤Ç¤·¤ç¤¦¡£
-
-¸À¤¤´¹¤¨¤ì¤Ð, @strong{MySQL} ¤È¤È¤â¤Ë»ÈÍѤµ¤ì¤ëÀ½ÉʤòÇä¤ë¾ì¹ç¤ä¡¢
-´°Á´¤Ëµ¡Ç½¤¹¤ë¤¿¤á¤Ë @strong{MySQL} ¤òɬÍפȤ¹¤ë¤Î¤Ç¤¢¤ì¤Ð¡¢
-¥é¥¤¥»¥ó¥¹¤¬É¬ÍפǤ¹¡£¤¢¤Ê¤¿¤¬ @strong{MySQL} ¤òÀ½ÉʤΰìÉô¤È¤·¤Æ
-¸ÜµÒ¤ËÇÛÉÛ¤·¤è¤¦¤¬¤·¤Þ¤¤¤¬¡¢¤³¤Î¾ì¹ç¤Ë¤Ï¥é¥¤¥»¥ó¥¹¤¬É¬ÍפǤ¹¡£
-
-¤Þ¤¿¡¢¤¢¤Ê¤¿¤¬¸ÜµÒ¤Î¤¿¤á¤Ë¤·¤Æ¤¤¤ë»ö¤Ë¤â°Í¤ê¤Þ¤¹¡£
-¤¢¤Ê¤¿¤Ï,¤¢¤Ê¤¿¤Î¥½¥Õ¥È¥¦¥§¥¢¤È¤È¤â¤Ë @strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¡¢
-¸ÜµÒ¤ËÄ󶡤¹¤ë¤Î¤ò·×²è¤·¤Æ¤¤¤Þ¤¹¤«? ¤½¤Î¤Ð¤¢¤¤,¤¢¤Ê¤¿¤ÎÀ½ÉʤÏ
- @strong{MySQL} ¤Î»ÈÍѤò¾ò·ï¤È¤·¤Æ¤¤¤Þ¤¹¤« ¡¨ ¤½¤¦¤À¤È¤¹¤ì¤Ð,
-¤¢¤Ê¤¿¤Ï,¥é¥¤¥»¥ó¥¹¤òÇ㤦ɬÍפ¬¤¢¤ê¤Þ¤¹.
-If you are simply tying into a database
-that you expect already to have been installed by the time your software is
-purchased, then you probably don't need a license.
-
-@item
- @strong{MySQL} ¤òÇÛÉÛʪ¤Ë´Þ¤á¡¢¤½¤ÎÇÛÉÛʪ¤ËÎÁ¶â¤ò¤«¤·¤Þ¤¹¤«¡©
-
-¤â¤·¸ÜµÒ¤ËÇä¤ëÇÛÉÛʪ¤Ë @strong{MySQL} ¤ò´Þ¤á¤ë¤Î¤Ç¤¢¤ì¤Ð¡¢
- @code{mysqld} ¥µ¡¼¥Ð¡¼¤ÎÁö¤ë¤¤¤«¤Ê¤ë¥Þ¥·¥ó¤Ë¥é¥¤¥»¥ó¥¹¤¬É¬ÍפǤ¹¡£
-¤Ê¤¼¤Ê¤é¡¢ @strong{MySQL} ¤ò´Þ¤à¥·¥¹¥Æ¥à¤òÇä¤Ã¤Æ¤¤¤ë¤«¤é¤Ç¤¹¡£
-
-¤³¤ì¤ÏÀ½Éʤ¬ @strong{MySQL} ¤Î»ÈÍѤò
-ɬ¿Ü¤È¤·¤Æ¤¤¤è¤¦¤¬¥ª¥×¥·¥ç¥ó¤È¤·¤Æ¤¤¤è¤¦¤¬¡¢Å¬ÍѤµ¤ì¤Þ¤¹¡£
-
-@item
-¤¢¤Ê¤¿¤ÎÀ½ÉÊ¤Ï @strong{MySQL} ¤ò¤½¤ÎÃæ¤Ë´Þ¤à¤³¤È¤òÍ׵ᤷ¤Þ¤¹¤«¡©
-
-``¤Ê¤ó¤é¤«¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹'' ¤Î»ÈÍѤò¥Ç¥¶¥¤¥ó¤·¤Æ¤¤¤ëÀ½Éʤǡ¢¤³¤ÎÀ½Éʤ¬
-¤¤¤¯¤Ä¤«¤Î¥Ç¡¼¥¿¡¼¥Ù¡¼¥¹¥·¥¹¥Æ¥à
-(@strong{MySQL}, PostgreSQL, or something else) ¤ÎÃ椫¤éÂå¤ï¤ê¤Î¤â¤ò
-»ÈÍѤ¹¤ë¤è¤¦¤ËÄ´À°²Äǽ¤Ç¤­¤ëÀ½ÉÊ¡¢¤³¤¦¤¤¤Ã¤¿Êª¤ò¤¢¤Ê¤¿¤¬
-Çä¤í¤¦¤È¤·¤Æ¤¤¤ë¤È²¾Äꤷ¤Þ¤¹¡£
-¤³¤Î¾ì¹ç¡¢¤¢¤Ê¤¿¤ÎÀ½ÉÊ¤Ï @strong{MySQL} ¤òɬÍפȤ·¤Þ¤»¤ó¤¬¡¢
-¤¤¤«¤Ê¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î´ðËܵ¡Ç½¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤ª¤ê¡¢
- @strong{MySQL} ¤À¤±¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-¤¬¡¢¤â¤·¸ÜµÒ¤¬ @strong{MySQL} ¤Î»ÈÍѤòÁª¤ó¤À¾ì¹ç¤Ë¡¢¤¢¤Ê¤¿¤¬²æ¡¹¤Ë»Ùʧ¤¦µÁ̳¤¬
-¤¢¤ë¤Î¤«¡©
-
-¤³¤Î¾ì¹ç¡¢¤â¤·¤½¤Î¸ÜµÒ¤Î¤¿¤á¤Ë¡¢¤¢¤Ê¤¿¤¬ @strong{MySQL} ¤òÄ󶡤·¤¿¤ê¤¢¤ë¤¤¤Ï¡¢
-Æþ¼ê¤·¤¿¤ê¡¢¥»¥Ã¥È¥¢¥Ã¥×¤·¤¿¤ê¤·¤Æ¤¤¤Ê¤¤¤Ê¤é¤Ð¡¢¤¢¤Ê¤¿¤Ë¥é¥¤¥»¥ó¥¹¤ÏÉÔÍפǤ¹¡£
-¤â¤·¤¢¤Ê¤¿¤¬¸ÜµÒ¤Ë¤³¤¦¤¤¤Ã¤¿¥µ¡¼¥Ó¥¹¤òÄ󶡤¹¤ë¤Ê¤é¡¢@ref{MySQL services, ,
-@strong{MySQL} services}.
-@end itemize
-
-
-@node MySQL services, ISP, Products that use MySQL, Licensing examples
-@subsection Selling @strong{MySQL}-related services¡¡@strong{MySQL} ´ØÏ¢¥µ¡¼¥Ó¥¹¤òÇä¤ë
-
-If you perform @strong{MySQL} installation on a client's machine and any
-money changes hands for the service (directly or indirectly), then you must
-buy a @strong{MySQL} license.
-
-¤â¤· @strong{MySQL} ¤ò¥¯¥é¥¤¥¢¥ó¥È¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¡¢¤½¤Î¥µ¡¼¥Ó¥¹¤Ç¤Ê¤ó¤é¤«¤Î
-Âå²Á¤ò¤¨¤ë¤Ê¤é¤Ð¡ÊľÀÜ¡¢´ÖÀÜÌä¤ï¤º¡Ë¡¢¤¢¤Ê¤¿¤Ï @strong{MySQL} ¥é¥¤¥»¥ó¥¹¤ò
-¹ØÆþ¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-
-If you sell an application for which @strong{MySQL} is not strictly required
-but can be used, a license may be indicated, depending on how @strong{MySQL}
-is set up. Suppose your product neither requires @strong{MySQL} nor includes
-it in your product distribution, but can be configured to use @strong{MySQL}
-for those customers who so desire. (This would be the case, for example, if
-your product can use any of a number of database engines.)
-
-@strong{MySQL} ¤Ï´°Á´¤ËɬÍפȤ¤¤¦¤ï¤±¤Ç¤Ï¤Ê¤¤¤¬,@strong{MySQL} ¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë
-¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤òÈÎÇ䤹¤ë¤Ê¤é¤Ð, @strong{MySQL} ¤ò¥»¥Ã¥È¥¢¥Ã¥×¤¹¤ëÊýË¡¤Ë¤è¤Ã¤Æ,
-¥é¥¤¥»¥ó¥¹¤ÏɬÍפˤʤë¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£¤¢¤Ê¤¿¤ÎÀ½ÉÊÇÛÉÛʪ¤ÎÃæ¤Ë @strong{MySQL} ¤¬
-´Þ¤Þ¤ì¤Æ¤ª¤é¤º¡¢¤Þ¤¿¡¢ @strong{MySQL} ¤òɬÍפȤ·¤Æ¤¤¤Ê¤¤¤¬¡¢
-¤¢¤Ê¤¿¤ÎÀ½ÉʤϸܵҤδõ˾¤Ë¹ç¤ï¤»¤Æ @strong{MySQL} ¤ò»ÈÍѤ¹¤ë¤è¤¦¤ËÄ´À°¤Ç¤­¤ë¤â¤Î¤À¤È
-²¾Äꤷ¤Þ¤¹¡£
-¡ÊÎ㤨¤Ð,¤¢¤Ê¤¿¤ÎÀ½Éʤ¬Â¿¤¯¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥¨¥ó¥¸¥ó¤Î¤É¤ì¤«¤ò»ÈÍѤ¹¤ë¤³¤È¤¬
-¤Ç¤­¤ë¤Ê¤é¤Ð,¤³¤Î¾ì¹ç¤Ë³ºÅö¤¹¤ë¤Ç¤·¤ç¤¦.¡Ë
-
-If the customer obtains and installs @strong{MySQL}, no license is needed.
-If you perform that service for your customer, then a license is needed
-because then you are selling a service that includes @strong{MySQL}.
-
-¤â¤·¸ÜµÒ¼«¿È¤¬ @strong{MySQL} ¤òÆþ¼ê¤·¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤Ê¤é¤Ð¡¢
-¤¢¤Ê¤¿¤Ë¥é¥¤¥»¥ó¥¹¤ÏÉÔÍפǤ¹¡£¤â¤·¤¢¤Ê¤¿¤¬¤½¤¦¤¤¤Ã¤¿¥µ¡¼¥Ó¥¹¤ò¸ÜµÒ¤Ë¹Ô¤¦¤Ê¤é¡¢
-¥é¥¤¥»¥ó¥¹¤ÏɬÍפǤ¹¡£¤Ê¤¼¤Ê¤é¡¢ @strong{MySQL} ¤ò´Þ¤ó¤À¥µ¡¼¥Ó¥¹¤ò¤¢¤Ê¤¿¤¬
-Çä¤ë¤³¤È¤Ë¤Ê¤ë¤«¤é¤Ç¤¹¡£
-
-
-@node ISP, Web server, MySQL services, Licensing examples
-@subsection ISP @strong{MySQL} services
-
-Internet Service Providers (ISPs) often host @strong{MySQL} servers for
-their customers.
-
-If you are an ISP that allows customers to install and administer
-@strong{MySQL} for themselves on your machine with no assistance from you,
-neither you nor your customer need a @strong{MySQL} license. Note that this
-doesn't apply if you are are using Win32; In this case you will always
-need a license for each computer that runs the @strong{MySQL} server.
-
-If you charge for @strong{MySQL} installation and administrative support as
-part of your customer service, then you need a license because you are selling
-a service that includes @strong{MySQL}.
-
-¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥µ¡¼¥Ó¥¹¥×¥í¥Ð¥¤¥À¡¼(ISP) ¤Ï @strong{MySQL} ¥µ¡¼¥Ð¡¼¤ò¼«Ê¬¤Î¤ªµÒ¤Ë
-Ä󶡤¹¤ë¤³¤È¤â¤·¤Ð¤·¤Ð¤Ç¤¹¡£
-
-¤â¤·¤¢¤Ê¤¿¤¬ ISP ¤Ç¡¢¸ÜµÒ¤¬¤¢¤Ê¤¿¤Î¥Þ¥·¥ó¤Ë @strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ´ÉÍý¤¹¤ë»ö¤ò
-µö²Ä¤·¤Æ¤¤¤ë¤Î¤Ç¤¢¤ì¤Ð(¤¢¤Ê¤¿¤Î¼ê½õ¤±¤Ï̵¤·¤Ç)¡¢
-¤¢¤Ê¤¿¤È¸ÜµÒ¤Î¤É¤Á¤é¤Ë¤â @strong{MySQL} ¥é¥¤¥»¥ó¥¹¤ÏÉÔÍפǤ¹¡£
-¤â¤· Win32 ¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Ê¤é¡¢¤³¤ì¤ÏŬÍѤµ¤ì¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-Win32 ¤Î¾ì¹ç¤Ï¡¢@strong{MySQL} ¥µ¡¼¥Ð¡¼¤ò¼Â¹Ô¤¹¤ë¥³¥ó¥Ô¥å¡¼¥¿Ëè¤Ë
-¥é¥¤¥»¥ó¥¹¤¬É¬ÍפǤ¹¡£
-
-¤â¤·¤¢¤Ê¤¿¤¬¸ÜµÒ¥µ¡¼¥Ó¥¹¤È¤·¤Æ @strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·´ÉÍý¤¹¤ë¤³¤È¤ËÎÁ¶â¤ò¤«¤¹¤Ê¤é¡¢
-¤¢¤Ê¤¿¤Ï @strong{MySQL} ¤ò´Þ¤ó¤À¥µ¡¼¥Ó¥¹¤òÇä¤Ã¤Æ¤¤¤ë¤³¤È¤Ë¤Ê¤ë¤Î¤Ç¡¢
-¤¢¤Ê¤¿¤Ï¥é¥¤¥»¥ó¥¹¤¬É¬ÍפǤ¹¡£
-
-
-@node Web server, , ISP, Licensing examples
-@subsection Running a web server using @strong{MySQL}
-
-If you use @strong{MySQL} in conjunction with a web server on Unix, you
-don't have to pay for a license.
-
-This is true even if you run a commercial web server that uses
-@strong{MySQL}, since you are not selling @strong{MySQL} itself. However, in
-this case we would like you to purchase @strong{MySQL} support, because
-@strong{MySQL} is helping your enterprise.
-
-¤â¤·¤¢¤Ê¤¿¤¬ UNIX ¾å¤Ç Web¥µ¡¼¥Ð¡¼ ¤È¤È¤â¤Ë @strong{MySQL} ¤ò»ÈÍѤ¹¤ë¤Ê¤é¡¢
-¥é¥¤¥»¥ó¥¹¤òÇ㤦ɬÍפϤ¢¤ê¤Þ¤»¤ó¡£
-
-¤³¤ì¤Ï¤¿¤È¤¨ @strong{MySQL} ¤ò»ÈÍѤ·¤¿¾¦ÍѤΠWeb¥µ¡¼¥Ð¡¼ ¤òÁö¤é¤»¤Æ¤¤¤Æ¤â¡¢
- @strong{MySQL} ¼«¿È¤òÇä¤Ã¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢¥é¥¤¥»¥ó¥¹¤òÇ㤦ɬÍפϤ¢¤ê¤Þ¤»¤ó¡£
-¤·¤«¤·¤³¤Î¾ì¹ç¡¢²æ¡¹¤Ï¤¢¤Ê¤¿¤¬ @strong{MySQL} ¥µ¥Ý¡¼¥È·ÀÌó¤ò¤¹¤ë¤³¤È¤ò˾¤ß¤Þ¤¹¡£
-¤Ê¤¼¤Ê¤é¡¢@strong{MySQL} ¤Ï¤¢¤Ê¤¿¤Î»ö¶È¤ò½õ¤±¤Æ¤¤¤ë¤«¤é¤Ç¤¹¡£
-
-
-@cindex Costs, licensing and support
-@cindex Licensing costs
-@cindex Support costs
-@node Cost, Support, Licensing examples, Licensing and Support
-@section @strong{MySQL} licensing and support costs
-
-@menu
-* Payment information:: Payment information
-* Contact information:: Contact information
-@end menu
-
-Our current license prices are shown below. All prices are in US
-Dollars. If you pay by credit card, the currency is EURO (European Union Euro)
-so the prices will differ slightly.
-
-¸½ºß¤Î¥é¥¤¥»¥ó¥¹¤Î²Á³Ê¤ò°Ê²¼¤Ë¼¨¤·¤Þ¤¹¡£Á´¤Æ¤Î²Á³Ê¤Ï US ¥É¥ë¤Ç¤¹¡£
-¤â¤·¤¢¤Ê¤¿¤¬¥¯¥ì¥¸¥Ã¥È¥«¡¼¥É¤ÇÇ㤤¤¿¤¤¤Ê¤é¤Ð¡¢ÄÌ²ß¤Ï EURO (European Union Euro)
-¤Ç¤¹¡£¡Ê²Á³Ê¤¬¤ï¤º¤«¤Ë°Û¤Ê¤ë¡Ë
-
-@multitable @columnfractions .25 .2 .3
-@item @strong{Number of licenses} @tab @strong{Price per copy} @tab @strong{Total}
-@item 1 @tab US $200 @tab US $200
-@item 10 pack @tab US $150 @tab US $1500
-@item 50 pack @tab US $120 @tab US $6000
-@end multitable
-
-For high volume (OEM) purchases, the following prices apply:
-
-ÂçÎ̹ØÆþ(OEM ÈÎÇä)¤Î¾ì¹ç¤Ï¡§
-
-@multitable @columnfractions .25 .2 .3 .25
-@item @strong{Number of licenses} @tab @strong{Price per copy} @tab @strong{Minimum at one time} @tab @strong{Minimum payment}
-@item 100-999 @tab US $40 @tab 100 @tab US $4000
-@item 1000-2499 @tab US $25 @tab 200 @tab US $5000
-@item 2500-4999 @tab US $20 @tab 400 @tab US $8000
-@end multitable
-
-For OEM purchases, you must act as the middle-man for eventual problems
-or extension requests from your users. We also require that OEM
-customers have at least an extended email support contract. Note that
-OEM licenses only apply for products where the user doesn't have direct
-access to the @strong{MySQL} server (embedded system). In other words:
-The @strong{MySQL} server should only be used with the application
-that was supplied you.
-
-¡¡OEM ÈÎÇä¤ò¤¹¤ë¾ì¹ç¡¢¥æ¡¼¥¶¡¼¤«¤é¤ÎÌäÂê¤äÍ×˾¤ËÂФ·¤Æ¡¢
-¤¢¤Ê¤¿¤ÏÃçÇã¿Í¤È¤·¤Æ¿¶¤ëÉñ¤ï¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-¤ï¤ì¤ï¤ì¤Ï OEM ¤ÎµÒ¤ËÂФ·¡¢¾¯¤Ê¤¯¤È¤â³ÈÄ¥ÅŻҥ᡼¥ë¥µ¥Ý¡¼¥È·ÀÌó¤òÍ׵ᤷ¤Þ¤¹¡£
-OEM ¥é¥¤¥»¥ó¥¹¤Ï¡¢@strong{MySQL} ¥µ¡¼¥Ð¡¼¤ËľÀÜ¥¢¥¯¥»¥¹¤¹¤ëɬÍפΤʤ¤
-À½ÉʤˤΤßŬÍѤµ¤ì¤Þ¤¹ (ÁȤ߹þ¤ß¥·¥¹¥Æ¥à)¡£ ¤¤¤¦¤Ê¤é¤Ð¡¢
-@strong{MySQL} ¤Ï¡¢¤¿¤À¡¢¤¢¤Ê¤¿¤¬Ä󶡤·¤Æ¤¤¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤È¶¦¤Ë¤Î¤ß
-»ÈÍѤµ¤ì¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-(OEM ¶¡µë¤ò¼õ¤±¤¿ MySQL ¥µ¡¼¥Ð¡¼¥é¥¤¥»¥ó¥¹¤Î¤ß¤òñÂΤÇÇä¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£)
-
-If you have a low-margin high-volume product, you can always talk to us
-about other terms (for example, a percent of the sale price). If you do,
-please be informative about your product, pricing, market and any other
-information that may be relevant.
-
-¡¡¤â¤·¤¢¤Ê¤¿¤¬ÇöÍø¿Çä¤ÎÀ½Éʤò»ý¤Ã¤Æ¤¤¤ë¤Ê¤é¡¢Â¾¤Î¾ò·ï¤Ë¤Ä¤¤¤Æ¤¤¤Ä¤Ç¤â
-²æ¡¹¤ÈÏ䷹礦¤³¤È¤¬¤Ç¤­¤Þ¤¹(Î㤨¤ÐÇäÃͤΥѡ¼¥»¥ó¥Æ¡¼¥¸¤È¤«)¡£
-¤â¤·¤¢¤Ê¤¿¤¬À½ÉʤòÇä¤ê¤¿¤¤¤Ê¤é¡¢
-¤¢¤Ê¤¿¤ÎÀ½ÉÊÀâÌÀ¡¢ÃÍÃÊ¡¢»Ô¾ì¡¢¤½¤Î¾´ØÏ¢¹àÌܤò²æ¡¹¤ËÃΤ餻¤Æ¤¯¤À¤µ¤¤¡£
-
-@cindex @code{myisampack}
-After buying 1 @strong{MySQL} licenses, you will get a personal copy of
-the @code{myisampack} utility. You are not allowed to redistribute this
-utility but you can distribute tables packed with it.
-
-1 @code{MySQL} ¥é¥¤¥»¥ó¥¹¤Î¹ØÆþ¸å¡¢@code{myisampack} ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¡¼¤¬
-¸Ä¿Í¤à¤±¤Ë¥³¥Ô¡¼¤Ç¤­¤Þ¤¹¡£¤³¤ì¤ÎºÆÇÛÉۤϵö²Ä¤µ¤ì¤Þ¤»¤ó¤¬¡¢
-@code{myisampack} ¤Ç¥Ñ¥Ã¥¯¤·¤¿¥Æ¡¼¥Ö¥ë¤ÏÇÛÉۤǤ­¤Þ¤¹¡£
-
-A full-price license is not a support agreement and includes very minimal
-support. This means that we try to answer any relevant question. If the
-answer is in the documentation, we will direct you to the appropriate
-section. If you have not purchased a license or support, we probably will not
-answer at all.
-
-´°Á´¤Ê²Á³Ê¥é¥¤¥»¥ó¥¹¤Ï¥µ¥Ý¡¼¥È¶¨Äê¤Ç¤Ê¤¯,Èó¾ï¤ËºÇ¾®¸Â¤Î¥µ¥Ý¡¼¥È¤ò´Þ¤ß¤Þ¤¹. ¤³¤ì¤Ï,²æ¡¹¤¬
-¤É¤ó¤Ê´ØÏ¢¼ÁÌä¤Ë¤âÅú¤¨¤è¤¦¤È¤¹¤ë»ö¤ò°ÕÌ£¤·¤Þ¤¹. ÊÖ»ö¤¬¥É¥­¥å¥á¥ó¥È¤Ë¤¢¤ë¤Ê¤é¤Ð,
-²æ¡¹¤ÏŬÀڤʥ»¥¯¥·¥ç¥ó¤ò¤¢¤Ê¤¿¼¨¤¹¤Ä¤â¤ê¤Ç¤¹. ¤¢¤Ê¤¿¤¬¥é¥¤¥»¥ó¥¹¤«¥µ¥Ý¡¼¥È¤ò¹ØÆþ
-¤·¤Ê¤«¤Ã¤¿¤Ê¤é¤Ð, ²æ¡¹¤Ï¤¿¤Ö¤óÁ´¤¯Åú¤¨¤ë¤Ä¤â¤ê¤Ï¤¢¤ê¤Þ¤»¤ó.
-
-If you discover what we consider a real bug, we are likely to fix it in
-any case. But if you pay for support we will notify you about the fix
-status instead of just fixing it in a later release.
-
-¤â¤·¤¢¤Ê¤¿¤¬¡¢²æ¡¹¤¬ËÜÅö¤Ë¥Ð¥°¤À¤È¹Í¤¨¤ëʪ¤ò¸«¤Ä¤±¤¿¾ì¹ç¡¢¤¤¤«¤Ê¤ë¾ì¹ç¤Ç¤â
-¤½¤ì¤ò½¤Àµ¤·¤Þ¤¹¡£
-¤·¤«¤·, ¤¢¤Ê¤¿¤¬¥µ¥Ý¡¼¥È¤ò»Ùʧ¤¦¤Ê¤é¤Ð, ¸å¤Î¥ê¥ê¡¼¥¹¤Ç¤½¤ì¤ò½¤Àµ¤¹¤ë»ö¤ÎÂå¤ï¤ê¤Ë¡¢
-²æ¡¹¤Ï½¤Àµ¾õÂ֤˴ؤ·¤Æ¤¢¤Ê¤¿¤ËÄÌÃΤ¹¤ë¤Ä¤â¤ê¤Ç¤¹.
-
-More comprehensive support is sold separately. Descriptions of what each
-level of support includes are given in @ref{Support}. Costs for the various
-types of commercial support are shown below. Support level prices are in
-EURO (European Union Euro). One EURO is about 1.17 USD.
-
-¤è¤êÊñ³çŪ¤Ê¥µ¥Ý¡¼¥È¤ÏÊÌ¡¹¤ËÈÎÇ䤵¤ì¤Þ¤¹. ¤½¤ì¤¾¤ì¤Î¥ì¥Ù¥ë¤Î¥µ¥Ý¡¼¥È¤¬´Þ¤à»ö¤Ë
-´Ø¤¹¤ëµ­½Ò¤Ï @ref{Support}. ¤Ë¤¢¤ê¤Þ¤¹¡£ÍÍ¡¹¤Ê¥¿¥¤¥×¤Î¾¦ÍÑ¥µ¥Ý¡¼¥È¤Î²Á³Ê¤Ï°Ê²¼¤Ë
-¼¨¤·¤Þ¤¹. ¥µ¥Ý¡¼¥È¥ì¥Ù¥ë²Á³Ê¤Ï EURO (European Union Euro) ¤Ç¤¹¡£
-1 EURO ¤Ï¤ª¤è¤½ 1.17 USD ¤Ç¤¹.
-
-@multitable @columnfractions .3 .3
-@item @strong{Type of support} @tab @strong{Cost per year}
-@item Basic email support @tab EURO 170
-@item Extended email support @tab EURO 1000
-@item Login support @tab EURO 2000
-@item Extended login support @tab EURO 5000
-@end multitable
-
-You may upgrade from any
-lower level of support to a higher level of support for the difference
-between the prices of the two support levels.
-
-²¼°Ì¥ì¥Ù¥ë¤Î¥µ¥Ý¡¼¥È¤«¤é¡¢¤½¤ì¤è¤ê¹â¤¤¥ì¥Ù¥ë¤Î¥µ¥Ý¡¼¥È¤Ë¡¢
-2¤Ä¤Î¥µ¥Ý¡¼¥È¤Î²Á³Êº¹Ê¬¤Î»Ùʧ¤¤¤Ç¡¢¥¢¥Ã¥×¥°¥ì¡¼¥É¤¬²Äǽ¤Ç¤¹¡£
-
-
-@cindex Payment information
-@node Payment information, Contact information, Cost, Cost
-@subsection Payment information
-
-Currently we can take SWIFT payments, cheques or credit cards.
-
-¸½ºß,SWIFT»Ùʧ¤¤,¾®ÀÚ¼ê¤Þ¤¿¤Ï¥¯¥ì¥¸¥Ã¥È¥«¡¼¥É¤Ç¤Î»Ùʧ¤¤¤¬¤Ç¤­¤Þ¤¹.
-
-Payment should be made to:
-¿¶¹þÀè¤Ï¡§
-@example
-Postgirot Bank AB
-105 06 STOCKHOLM, SWEDEN
-
-TCX DataKonsult AB
-BOX 6434
-11382 STOCKHOLM, SWEDEN
-
-SWIFT address: PGSI SESS
-Account number: 96 77 06 - 3
-@end example
-
-Specify: license and/or support and your name and email address.
-
-¤¢¤Ê¤¿¤Î¹ØÆþ¥é¥¤¥»¥ó¥¹ ¤«¤Ä/Ëô¤Ï ¥µ¥Ý¡¼¥È¤È,̾Á°¤È E¥á¡¼¥ë¥¢¥É¥ì¥¹¤òµ­½Ò¤Î¤³¤È¡£
-
-In Europe and Japan you can use EuroGiro (that should be less expensive) to the
-same account.
-
-¥è¡¼¥í¥Ã¥Ñ¤ÈÆüËܤǤÏ,¤¢¤Ê¤¿¤Ï»Ùʧ¤¤¤Ë EuroGiro(¤½¤ì¤¬¹â²Á¤Ç¤Ï¤Ê¤¤) ¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹.
-
-If you want to pay by cheque, make it payable to ``MySQL Finland AB'' and
-mail it to the address below:
-
-¤¢¤Ê¤¿¤¬¾®ÀÚ¼ê¤Ë¤è¤Ã¤Æ»Ùʧ¤¤¤¿¤¤¤È»×¤Ã¤Æ¤¤¤ë¤Ê¤é¤Ð,¤½¤ì¤ò ``Monty Program KB'' ¤Ë»Ùʧ¤¤Ëþ´ü¤Ë¤·¤Æ,
-°Ê²¼¤Î¥¢¥É¥ì¥¹¤Ë͹Á÷¤·¤Æ¤¯¤À¤µ¤¤.
-
-@example
-TCX DataKonsult AB
-BOX 6434, Torsgatan 21
-11382 STOCKHOLM, SWEDEN
-@end example
-
-If you want to pay by credit card over the Internet, you can use
-@uref{https://www.tcx.se/license.htmy, TcX's secure license form}.
-
-¥¤¥ó¥¿¡¼¥Í¥Ã¥È¾å¤Ç¥¯¥ì¥¸¥Ã¥È¥«¡¼¥É¤Ç»Ùʧ¤¤¤¿¤¤¤È»×¤Ã¤Æ¤¤¤ë¤Ê¤é¤Ð,
-¤¢¤Ê¤¿¤Ï @uref{https://www.tcx.se/license.htmy, TcX¤Î°ÂÁ´¤Ê¥é¥¤¥»¥ó¥¹¥Õ¥©¡¼¥à} ¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹.
-
-You can also print a copy of the license form, fill it in and send it by fax
-to:
-
-¤Þ¤¿¾å¤Î¥Ú¡¼¥¸¤Î¥³¥Ô¡¼¤ò°õºþ¤·¤Æ½ñ¤­¹þ¤ß,¥Õ¥¡¥Ã¥¯¥¹¤ò»È¤Ã¤Æ°Ê²¼¤Ë¤½¤ì¤òÁ÷¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹.
-
-+46-8-729 69 05
-
-If you want us to bill you, you can use the license form and write ``bill
-us'' in the comment field. You can also mail a message to
-@email{sales@@mysql.com} (@strong{not} @email{mysql@@lists.mysql.com}!)
-with your company information and ask us to bill you.
-
-ÀÁµá½ñ¤òÁ÷¤Ã¤ÆÍߤ·¤¤¾ì¹ç,¤¢¤Ê¤¿¤Ï¥é¥¤¥»¥ó¥¹¥Õ¥©¡¼¥à¤ò»ÈÍѤ·,
-Ãí¼áÍó¤Ë ``ÀÁµá½ñ ´õ˾'' ¤ò½ñ¤¤¤Æ¤¯¤À¤µ¤¤.
-¤¢¤ë¤¤¤Ï,¤¢¤Ê¤¿¤Î²ñ¼Ò¤Î¾ðÊó¤òµ­ºÜ¤·¤¿¥á¥Ã¥»¡¼¥¸¤ò @email{sales@@mysql.com} ¤Ë¤ª¤¯¤ê,
-(@email{mysql@@lists.mysql.com} ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó!)
-ÀÁµá½ñ¤òÁ÷¤ë¤è¤¦¤Ë²æ¡¹¤Ë°ÍÍꤹ¤ë»ö¤â¤Ç¤­¤Þ¤¹¡£
-
-
-@cindex Contact information
-@node Contact information, , Payment information, Cost
-@subsection Contact information
-
-For commercial licensing, or if you have any questions about any of the
-information in this section, please contact the @strong{MySQL} licensing
-team. The much preferred method is by E-Mail to
-@email{mysql-licensing@@mysql.com}. Fax is also possible but handling of
-these may take much longer (Fax +46-8-729 69 05).
-
-¾¦¶Èǧ²Ä¤«ËÜ¥»¥¯¥·¥ç¥ó¤Ë´Ø¤¹¤ë¼ÁÌ䤬¤¢¤ë¤Ê¤é¤Ð,°Ê²¼¤ËÏ¢Íí¤·¤Æ¤¯¤À¤µ¤¤
-
-@example
-David Axmark
-Detron HB
-Kungsgatan 65 B
-753 21 UPPSALA
-SWEDEN
-Voice Phone +46-18-10 22 80 (Timezone GMT+1. Swedish and English spoken)
-@end example
-
-
-@cindex Support, types
-@cindex Types of support
-@node Support, , Cost, Licensing and Support
-@section Types of commercial support
-
-@menu
-* Basic email support:: Basic email support
-* Extended email support:: Extended email support
-* Login support:: Login support
-* Extended login support:: Extended login support
-@end menu
-
-@node Basic email support, Extended email support, Support, Support
-@subsection Basic email support¡¡´ðËÜÅŻҥ᡼¥ë¥µ¥Ý¡¼¥È
-
-Basic email support is a very inexpensive support option and should be
-thought of more as a way to support our development of @strong{MySQL}
-than as a real support option. We at TCX do give a lot of free support
-in all the different @strong{MySQL} lists and the money we get from
-basic eamil support is largely used to make this possible.
-
-´ðËÜÅŻҥ᡼¥ë¥µ¥Ý¡¼¥È¤ÏÈó¾ï¤ËÈñÍѤΤ«¤«¤é¤Ê¤¤¥µ¥Ý¡¼¥È¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ê,
-²æ¡¹¤Î @strong{MySQL} ¤Î³«È¯¤ò¥µ¥Ý¡¼¥È¤¹¤ëËÜÅö¤Î¥µ¥Ý¡¼¥È¥ª¥×¥·¥ç¥ó¤Ç¡¢
-¤è¤ê¤è¤¤ÊýË¡¤È¤·¤Æ¹Í¤¨¤é¤ì¤ë¤Ù¤­¤Ç¤¹.
-
-At this support level, the @strong{MySQL} mailing lists are the preferred
-means of communication. Questions normally should be mailed to the primary
-mailing list (@email{mysql@@lists.mysql.com}) or one of the other regular
-lists (for example, @email{mysql-win32@@lists.mysql.com} for Windows-related
-@strong{MySQL} questions), as someone else already may have experienced and
-solved the problem you have. @xref{Asking questions}.
-
-¤³¤Î¥µ¥Ý¡¼¥È¥ì¥Ù¥ë¤Ç¤Ï, @strong{MySQL} ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤Ï¥³¥ß¥å¥Ë¥±¡¼¥·¥ç¥ó
-¤ò¼è¤ë¤Ë¤Ï¹¥¤Þ¤ì¤ëÊýË¡¤Ç¤¹. Ä̾ï, ¼ÁÌä¤Ï¼çÍפʥ᡼¥ê¥ó¥°¥ê¥¹¥È
-(@email{mysql@@lists.mysql.com}) ¤«Â¾¤Î¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤Î¤É¤ì¤«¤ËÁ÷¿®¤µ¤ì¤ë¤Ù¤­¤Ç¡¢
-¡ÊÎ㤨¤Ð, Windows ¤Ë´ØÏ¢¤¹¤ë @strong{MySQL} ¤Î¼ÁÌä¤Î¤¿¤á¤Î @email{mysql-win32@@lists.mysql.com} ¡Ë
-¤³¤ì¤Ï¾¤Î狼¤¬Æ±¤¸ÌäÂê¤ò·Ð¸³¤·¤Æ, ´û¤Ë²ò·è¤·¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¤«¤é¤Ç¤¹¡£
- @xref{Asking questions}.
-
-However, by purchasing basic email support, you also have access to the
-support address @email{mysql-support@@mysql.com}, which is not available
-as part of the minimal support that you get by purchasing a
-@strong{MySQL} license. This means that for especially critical
-questions, you can cross-post your message to
-@email{mysql-support@@mysql.com}. (If the message contains sensitive
-data, you should post only to @email{mysql-support@@mysql.com}.)
-
-@emph{REMEMBER!} to ALWAYS include your registration number and
-expiration date when you send a message to
-@email{mysql-support@@mysql.com}.
-
-¤·¤«¤·¡¢´ðËÜÅŻҥ᡼¥ë¥µ¥Ý¡¼¥È¤ò¹ØÆþ¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ, ¤¢¤Ê¤¿¤Ï¥µ¥Ý¡¼¥È¥¢¥É¥ì¥¹
-@email{mysql-support@@mysql.com} ¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤¹.
-(¤³¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤ÏºÇ¾®¤Î @strong{MySQL} ¥é¥¤¥»¥ó¥¹¤Î¹ØÆþ¤Ç¤ÏÍøÍÑÉÔ²Äǽ¤Ç¤¹¡£)
-¤³¤ì¤ÏÆä˽ÅÍפʼÁÌä¤Î¤¿¤á¤Ë»ÈÍѤµ¤ì¤Æ¤ª¤ê¡¢¤Þ¤¿¡¢@email{mysql-support@@mysql.com}.
-¤È¥¯¥í¥¹¥Ý¥¹¥È¤¹¤ë¤³¤È¤â²Äǽ¤Ç¤¹¡£
-¡Ê¥á¥Ã¥»¡¼¥¸¤Ëµ¡Ì©¤Î¥Ç¡¼¥¿¤¬´Þ¤Þ¤ì¤ë¾ì¹ç¡¢¤¢¤Ê¤¿¤Ï @email{mysql-support@@mysql.com}.
-¤À¤±¤ËÁ÷¿®¤¹¤ë¤Ù¤­¤Ç¤¹.¡Ë
-
-¥á¥Ã¥»¡¼¥¸¤ò @email{mysql-support@@mysql.com} ¤ËÁ÷¤ë¤È¤­¤Ï¡¢
-¿×®¤Ê±þÅú¤ò³Î¼Â¤Ë¤¹¤ë¤¿¤á¤Ë¡¢É¬¤º¤¢¤Ê¤¿¤ÎÅÐÏ¿ÈÖ¹æ¤ÈËþλÆüÉÕ¤ò½ñ¤­Åº¤¨¤Æ¤¯¤À¤µ¤¤¡£
-
-Note that if you have encountered a critical repeatable bug and follow
-the rules outlined in the manual section of how to report bugs and send
-it to @email{bugs@@lists.mysql.com} we promise to try to fix this as
-soon as possible, independent of your support level! @xref{Bug reports}.
-
-Basic email support includes the following types of service:
-
-´ðËÜÅŻҥ᡼¥ë¥µ¥Ý¡¼¥È¤Ï°Ê²¼¤Î¥µ¡¼¥Ó¥¹¤ò´Þ¤ß¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-If your question is already answered in the manual, we will inform you of the
-correct section in which you can find the answer. If the answer is not in
-the manual, we will point you in the right direction to solve your problem.
-
-@item
-We guarantee a timely answer for your email messages. We can't guarantee
-that we can solve any problem, but at least you will receive an answer if we
-can contact you by email.
-
-@item
-We will help with unexpected problems when you install @strong{MySQL} from a
-binary distribution on supported platforms. This level of support does not
-cover installing @strong{MySQL} from a source distribution. ``Supported''
-platforms are those for which @strong{MySQL} is known to work.
-@xref{Which OS}.
-
-@item
-We will help you with bugs and missing features. Any bugs that are found are
-fixed for the next @strong{MySQL} release. If the bug is critical for
-you, we will mail you a patch for it as soon the bug is fixed. Critical
-bugs always have the highest priority for us, to ensure that they are
-fixed as soon as possible.
-
-@item
-Your suggestions for the further development of @strong{MySQL} will be
-taken into consideration. By taking email support you have already
-helped the further development of @strong{MySQL}. If you want to have
-more input, upgrade to a higher level of support.
-
-@item
-If you want us to help optimize your system, you must upgrade to a
-higher level of support.
-@end itemize
-
-@itemize @bullet
-@item
-¤â¤·¤¢¤Ê¤¿¤Î¼ÁÌ䤬´û¤Ë¥Þ¥Ë¥å¥¢¥ë¤ÇÅú¤¨¤é¤ì¤Æ¤¤¤ë¤Î¤Ç¤¢¤ì¤Ð¡¢
-Åú¤¨¤ò¸«¤Ä¤±¤ì¤ë¤Ç¤¢¤í¤¦Àµ¤·¤¤¥»¥¯¥·¥ç¥ó¤ò¤¢¤Ê¤¿¤Ë¶µ¤¨¤Þ¤¹¡£
-¤â¤·Åú¤¨¤¬¥Þ¥Ë¥å¥¢¥ë¤Ë̵¤±¤ì¤Ð¡¢ÌäÂê²ò·è¤Î¤¿¤á¤ÎÀµ¤·¤¤Êý¸þ¤ò»Ø¤·¼¨¤·¤Þ¤¹¡£
-
-@item
-ÁÇÁᤤÊÖ¿®¤òÊݾÚÃפ·¤Þ¤¹¡£É¬¤º¤·¤â¤É¤ó¤ÊÌäÂê¤â²ò·è¤Ç¤­¤ë¤ÈÊݾڤÏÃפ·¤Þ¤»
-¤ó¤¬¡¢¤¢¤Ê¤¿¤¬ E ¥á¡¼¥ë¤Ç¥³¥ó¥¿¥¯¥È²Äǽ¤Ê¤é¤Ð¾¯¤Ê¤¯¤È¤âÊÖ¿®¤Ï¼õ¤±¼è¤ë¤Ç¤·¤ç
-¤¦¡£
-
-@item
-¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ë¤ª¤¤¤Æ¥Ð¥¤¥Ê¥ê¡¼ÇÛÉÛ·ÁÂÖ¤«¤é
-@strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë»þ¡¢Í½´ü¤·¤Ê¤¤ÌäÂ꤬¸½¤ì¤¿¾ì¹ç¤ª½õ¤±Ãפ·¤Þ¤¹¡£
-¤³¤Î¥ì¥Ù¥ë¤Î¥µ¥Ý¡¼¥È¤Ç¤Ï¥½¡¼¥¹ÇÛÉÛ·ÁÂÖ¤«¤é @strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë
-¤¹¤ë¾ì¹ç¤Ï¤Õ¤¯¤Þ¤ì¤Æ¤ª¤ê¤Þ¤»¤ó¡£``¥µ¥Ý¡¼¥ÈÂоÝ'' ¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤È¤Ï¡¢
- @strong{MySQL} ¤¬Æ°ºî¤¹¤ë¤ÈÃΤé¤ì¤Æ¤¤¤ë¤â¤Î¤Ç¤¹ @xref{Which OS}.
-
-@item
-¥Ð¥°¤ä­¤ê¤Ê¤¤µ¡Ç½¤¬¤¢¤ë¾ì¹ç ¡£¸«ÉÕ¤«¤Ã¤¿¥Ð¥°¤ËÉÕ¤¤¤Æ¤Ï¼¡´ü @strong{MySQL}
-¥ê¥ê¡¼¥¹¤Ë¤ª¤¤¤Æľ¤µ¤ì¤Þ¤¹¡£¤â¤·¤½¤Î¥Ð¥°¤¬¤¢¤Ê¤¿¤Ë¤È¤Ã¤ÆÃ×̿Ū¤Ç¤¢¤ì¤Ð¡¢½¤Àµ¼¡Â褽
-¤Î¥Ð¥°¤ÎÂФ¹¤ë¥Ñ¥Ã¥Á¤ò¥á¡¼¥ë¤Ç¤ªÁ÷¤ê¤·¤Þ¤¹¡£Ã×̿Ū¥Ð¥°¤Ï¾ï¤Ë¹â¤¤Í¥ÀèÅ٤ˤʤꡢ
-²Äǽ¤Ê¸Â¤ê®¤¯¡¢½¤Àµ¤¬¹Ô¤ï¤ì¤Þ¤¹¡£
-
-@item
-¤µ¤é¤Ê¤ë @strong{MySQL} ³«È¯¤Î¤¿¤á¤Ë¤¢¤Ê¤¿¤Î°Õ¸«¤Ï¹Í褵¤ì¤Þ¤¹¡£
-¤¢¤Ê¤¿¤¬ E ¥á¡¼¥ë¥µ¥Ý¡¼¥È¤ò¤ª»ý¤Á¤Ê¤é¤Ð¡¢¤â¤¦´û¤Ë @strong{MySQL} ¤Î¹¹¤Ê¤ë
-³«È¯¤Ø¤Î¼ê½õ¤±¤ò¤µ¤ì¤Æ¤¤¤ë»ö¤Ë¤Ê¤ê¤Þ¤¹¡£¤â¤Ã¤È°Õ¸«¤ò¼è¤êÆþ¤ì¤¿¤¤¤Ê¤é¤Ð¡¢
-¾å°Ì¤Î¥µ¥Ý¡¼¥È¤Ë¥¢¥Ã¥×¥°¥ì¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-¤â¤·¤¢¤Ê¤¿¤¬»ä¶¡¤Ë¤è¤ë¤Î¥·¥¹¥Æ¥à¤ÎºÇŬ²½¤Î¼ê½õ¤±¤ò¤ªË¾¤ß¤Ç¤¢¤ì¤Ð¡¢¹¹¤Ë
-¾å°Ì¤Î¥µ¥Ý¡¼¥È¤Ø¥¢¥Ã¥×¥°¥ì¡¼¥É¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-@item
-@cindex @code{myisampack}
-We include a binary version of the @code{myisampack} packing tool for
-creating fast compressed read-only databases. The current server includes
-support for reading such databases but not the packing tool used to
-create them.
-@end itemize
-
-
-@node Extended email support, Login support, Basic email support, Support
-@subsection Extended email support¡¡³ÈÄ¥ÅŻҥ᡼¥ë¥µ¥Ý¡¼¥È
-
-Extended email support includes everything in basic email support with
-these additions:
-
-@itemize @bullet
-@item
-Your email will be dealt with before mail from basic email support users and
-non-registered users.
-
-@item
-Your suggestions for the further development of @strong{MySQL} will
-receive strong consideration. Simple extensions that suit the basic
-goals of @strong{MySQL} are implemented in a matter of days. By taking
-extended email support you have already helped the further development
-of @strong{MySQL}.
-
-@item
-@item
-Typical questions that are covered by extended email support are:
-
-@itemize @minus
-@item
-We will answer and (within reason) solve questions that relate to possible
-bugs in @strong{MySQL}. As soon as the bug is found and corrected, we
-will mail a patch for it.
-
-@item
-We will help with unexpected problems when you install @strong{MySQL} from a
-source or binary distribution on supported platforms.
-
-@item
-We will answer questions about missing features and offer hints how to work
-around them.
-
-@item
-We will provide hints on optimizing @code{mysqld} for your situation.
-@end itemize
-
-@item
-You are allowed to influence the priority of items on the @strong{MySQL}
-TODO. This will ensure that the features you really need will be implemented
-sooner than they might be otherwise.
-@end itemize
-
-@node Login support, Extended login support, Extended email support, Support
-@subsection Login support¡¡¥í¥°¥¤¥ó¥µ¥Ý¡¼¥È
-
-Login support includes everything in extended email support with
-these additions:
-
-@itemize @bullet
-@item
-Your email will be dealt with even before mail from extended email
-support users.
-
-@item
-Your suggestions for the further development of @strong{MySQL} will
-be taken into very high consideration. Realistic extensions that can be
-implemented in a couple of hours and that suit the basic goals of
-@strong{MySQL} will be implemented as soon as possible.
-
-@item
-If you have a very specific problem, we can try to log in on your system
-to solve the problem ``in place.''
-
-@item
-Like any database vendor, we can't guarantee that we can rescue any data from
-crashed tables, but if the worst happens we will help you rescue as much as
-possible. @strong{MySQL} has proven itself very reliable, but anything is
-possible due to circumstances beyond our control (for example, if your system
-crashes or someone kills the server by executing a @code{kill -9} command).
-
-@item
-We will provide hints on optimizing your system and your queries.
-
-@item
-You are allowed to call a @strong{MySQL} developer (in moderation) and
-discuss your @strong{MySQL}-related problems.
-@end itemize
-
-@node Extended login support, , Login support, Support
-@subsection Extended login support¡¡³ÈÄ¥¥í¥°¥¤¥ó¥µ¥Ý¡¼¥È
-
-Extended login support includes everything in login support with these
-additions:
-
-@itemize @bullet
-@item
-Your email has the highest possible priority.
-
-@item
-We will actively examine your system and help you optimize it and your
-queries. We may also optimize and/or extend @strong{MySQL} to better
-suit your needs.
-
-@item
-You may also request special extensions just for you. For example:
-@example
-mysql> select MY_CALCULATION(col_name1,col_name2) from tbl_name;
-@end example
-
-@item
-We will provide a binary distribution of all important @strong{MySQL}
-releases for your system, as long as we can get an account on a
-similar system. In the worst case, we may require access to your system
-to be able to create a binary distribution.
-
-@item
-If you can provide accommodations and pay for traveler fares, you can even
-get a @strong{MySQL} developer to visit you and offer you help with your
-troubles. Extended login support entitles you to one personal
-encounter per year, but we are as always very flexible towards our customers!
-@end itemize
-
-
-@node Installing, Compatibility, Licensing and Support, Top
-@chapter @strong{MySQL} ¤Î¥¤¥ó¥¹¥È¡¼¥ë
-
-@menu
-* Getting MySQL:: @strong{MySQL} ¤òÆÀ¤ëÊýË¡
-* Which OS:: @strong{MySQL} ¤¬¥µ¥Ý¡¼¥È¤¹¤ë OS
-* Which version:: »ÈÍѤ¹¤ë @strong{MySQL} ¥Ð¡¼¥¸¥ç¥ó
-* Many versions:: ¥¢¥Ã¥×¥Ç¡¼¥È¤¬¥ê¥ê¡¼¥¹¤µ¤ì¤ëÊýË¡¤È»þ
-* Installation layouts:: ¥¤¥ó¥¹¥È¡¼¥ë¥ì¥¤¥¢¥¦¥È
-* Installing binary:: @strong{MySQL} ¥Ð¥¤¥Ê¥êÇÛÉۤΥ¤¥ó¥¹¥È¡¼¥ë
-* Installing source:: @strong{MySQL} ¥½¡¼¥¹ÇÛÉۤΥ¤¥ó¥¹¥È¡¼¥ë
-* Compilation problems:: Problems compiling?
-* MIT-pthreads:: MIT-pthreads ¤Ë´Ø¤·¤Æ
-* Perl support:: Perl installation comments
-* Source install system issues:: System-specific notes
-* Win32:: Win32 notes
-* OS/2:: OS/2 notes
-* TcX binaries:: TcX binaries
-* Post-installation:: ¥¤¥ó¥¹¥È¡¼¥ë¸å¤ÎÀßÄê¤È¥Æ¥¹¥È
-* Upgrade:: @strong{MySQL} ¤Î¥¢¥Ã¥×¥°¥ì¡¼¥É/¥À¥¦¥ó¥°¥ì¡¼¥É»þ¤ËÆÃÊ̤˹Ԥʤ¦¤³¤È¤¬²¿¤«¤¢¤ë¤«¡©
-@end menu
-
-¤³¤Î¾Ï¤Ç¤Ï¡¢¤É¤Î¤è¤¦¤Ë¤·¤Æ @strong{MySQL} ¤òÆÀ¡¢¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤Î¤«¤ò¤Î¤Ù¤Þ¤¹:
-
-@itemize @bullet
-@item
-@strong{MySQL} ¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤ë¥µ¥¤¥È¤Î¥ê¥¹¥È ¢ª
-@ref{Getting MySQL, , Getting @strong{MySQL}}.
-
-@item
-¤É¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤«¤Ï ¢ª @ref{Which OS}.
-
-@item
-@strong{MySQL} ¤Î¤¤¤¯¤Ä¤«¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï¡¢¥Ð¥¤¥Ê¥ê¡¢¥½¡¼¥¹Î¾Êý¤ÎÇÛÉÛʪ¤¬¤¢¤ê¤Þ¤¹¡£
-¤É¤Î¥Ð¡¼¥¸¥ç¥ó¤ò»ÈÍѤ¹¤ë¤Î¤«¡¢¤É¤Î¥¿¥¤¥×¤ò»ÈÍѤ¹¤ë¤«¤ò·è¤á¤ë¤¿¤á¤Ë¤Ï
- ¢ª @ref{Many versions}.
-
-@item
-¥Ð¥¤¥Ê¥ê¤È¥½¡¼¥¹¤Î¥¤¥ó¥¹¥È¡¼¥ë¤Ë¤Ä¤¤¤Æ¤Ï ¢ª
- @ref{Installing binary}, ¤È @ref{Installing source}.
-¤½¤ì¤¾¤ì¤Î¥»¥Ã¥È¤Ë¤Ï¡¢¤¢¤Ê¤¿¤¬½Ð¤¯¤ï¤¹¤«¤â¤·¤ì¤Ê¤¤
-¥·¥¹¥Æ¥à¤ËÆÃÍ­¤ÎÌäÂê¤Î¥»¥¯¥·¥ç¥ó¤¬´Þ¤Þ¤ì¤Þ¤¹¡£
-
-@item
-¥¤¥ó¥¹¥È¡¼¥ë¸å¤Ë¹Ô¤¦¤³¤È¤ÎÀâÌÀ¤Ï ¢ª @ref{Post-installation}.
-@strong{MySQL} ¤Î¥¤¥ó¥¹¥È¡¼¥ë¤Ë¤ª¤¤¤Æ¡¢¥Ð¥¤¥Ê¥ê¤Þ¤¿¤Ï¥½¡¼¥¹ÇÛÉۤˤ«¤«¤ï¤é¤º¡¢
-¤³¤ì¤é¤Î¥×¥í¥·¡¼¥¸¥ã¤ÏŬÍѤ·¤Þ¤¹¡£
-@end itemize
-
-
-@cindex Downloading
-@cindex @strong{MySQL} version
-@cindex Version, latest
-@cindex Getting @strong{MySQL}
-@node Getting MySQL, Which OS, Installing, Installing
-@section @strong{MySQL} ¤òÆÀ¤ëÊýË¡
-
-¸½ºß¤Î¥Ð¡¼¥¸¥ç¥ó¤È¥À¥¦¥ó¥í¡¼¥É¤Î»Ø¼¨¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï
-@uref{http://www.mysql.com/, @strong{MySQL} ¥Û¡¼¥à¥Ú¡¼¥¸} ¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¯
-¤À¤µ¤¤¡£
-
-¤·¤«¤·¡¢TcX ¤Î¥¤¥ó¥¿¡¼¥Í¥Ã¥ÈÀܳ¤Ï¤½¤ó¤Ê¤Ë®¤¯¤¢¤ê¤Þ¤»¤ó; ²¼µ­¤Ë°ìÍ÷¤µ¤ì
-¤¿¥ß¥é¡¼¥µ¥¤¥È¤Î°ì¤Ä¤«¤é¼ÂºÝ¤Ë¥À¥¦¥ó¥í¡¼¥É¤¹¤ë¤³¤È¤ò@emph{¤ª´«¤á¤·¤Þ¤¹}¡£
-
-°­¤¤¤Þ¤¿¤ÏÃÙ¤ì¤Æ¤¤¤ë¥ß¥é¡¼¤Ï @email{webmaster@@mysql.com} ¤ËÊó¹ð¤·¤Æ¤¯¤À¤µ
-¤¤¡£
-
-@c START_OF_MIRROR_LISTING
-
-@strong{¥è¡¼¥í¥Ã¥Ñ:}
-
-@itemize @bullet
-@item
-@c EMAIL: sl@iuinfo.tuwien.ac.at (Tony Sprinzl)
-@image{Flags/austria} Austria [Univ. of Technology/Vienna] @
-@uref{http://gd.tuwien.ac.at/db/mysql/, WWW}
-@uref{ftp://gd.tuwien.ac.at/db/mysql/, FTP}
-@item
-@c EMAIL: delian@naturella.com (Delian Delchev)
-@image{Flags/bulgaria} Bulgaria [Naturella] @
-@uref{http://archive.nat.bg/pub/mirror/mysql/, WWW}
-@uref{ftp://ftp.ntrl.net/pub/mirror/mysql/, FTP}
-@item
-@c Added: 990614
-@c EMAIL: vuksan@veus.hr (Vladimir Vuksan)
-@image{Flags/croatia} Croatia [HULK] @
-@uref{http://ftp.linux.hr/pub/mysql/, WWW}
-@uref{ftp://ftp.linux.hr/pub/mysql/, FTP}
-@item
-@c Added: 990614
-@c EMAIL: kas@informatics.muni.cz (Jan Kasprzak)
-@image{Flags/czech-republic} Czech Republic [Masaryk University in Brno] @
-@uref{http://mysql.linux.cz/index.html, WWW}
-@uref{ftp://ftp.fi.muni.cz/pub/mysql/, FTP}
-@item
-@c Added: 990920
-@c EMAIL: <radek@sopik.cz> (Radek Libovicky)
-@image{Flags/czech-republic} Czech Republic [www.sopik.cz] @
-@uref{http://www.mysql.cz/, WWW}
-@item
-@c Added: 000418
-@c EMAIL: <feela@ipex.cz> (Ondrej Feela Filip)
-@image{Flags/czech-republic} Czech Republic [www.gin.cz] @
-@uref{http://mysql.gin.cz/, WWW}
-@uref{ftp://ftp.gin.cz/pub/MIRRORS/www.mysql.com/, FTP}
-@item
-@c removed 991020 (no DNS entry). New name 991026. Added 991121
-@c Statistics at http://mirror.borsen.dk/
-@c EMAIL: mirrorman@borsen.dk (Michael Kyed)
-@image{Flags/denmark} Denmark [Borsen] @
-@uref{ http://mysql.borsen.dk/, WWW}
-@item
-@c EMAIL: mkp@socsci.auc.dk (Martin Kasper Petersen)
-@image{Flags/denmark} Denmark [SunSITE] @
-@uref{http://SunSITE.auc.dk/mysql/, WWW}
-@uref{ftp://SunSITE.auc.dk/pub/databases/mysql/, FTP}
-@c @item
-@c EMAIL: tonu@tradenet.ee (Samuel)
-@c @image{Flags/estonia} Estonia [Tradenet] @
-@c @uref{http://mysql.tradenet.ee, WWW}
-@item
-@c EMAIL: tonu@spam.ee (Tonu Samuel)
-@image{Flags/estonia} Estonia [OKinteractive] @
-@uref{http://mysql.mirror.ok.ee, WWW}
-@item
-@c Changed 990531
-@c EMAIL: Steeve.Devergne@minet.net (Steeve Devergne)
-@image{Flags/france} France [minet] @
-@uref{http://www.minet.net/devel/mysql/, WWW}
-@item
-@c EMAIL: Jaakko.Hyvatti@eunet.fi
-@image{Flags/finland} Finland [EUnet] @
-@uref{http://mysql.eunet.fi/, WWW}
-@item
-@c Added 990829
-@c EMAIL: tomi.hakala@clinet.fi (Tomi Hakala)
-@image{Flags/finland} Finland [clinet] @
-@uref{ftp://ftp.clinet.fi/mirrors/ftp.mysql.org/pub/mysql/, FTP}
-@item
-@c Added 981208
-@c EMAIL: noel@uni-bonn.de (Noel Koethe)
-@image{Flags/germany} Germany [Bonn University, Bonn] @
-@uref{http://www.wipol.uni-bonn.de/MySQL//, WWW}
-@uref{ftp://ftp.wipol.uni-bonn.de/pub/mirror/MySQL/, FTP}
-@item
-@c EMAIL: th@rz.fh-wolfenbuettel.de (Thorsten Ludewig)
-@image{Flags/germany} Germany [Wolfenbuettel] @
-@uref{http://www.fh-wolfenbuettel.de/ftp/pub/database/mysql/, WWW}
-@uref{ftp://ftp.fh-wolfenbuettel.de/pub/database/mysql/, FTP}
-@item
-@c Ok 980114. Removed 981208 (down > 3 days) ok 981214
-@c EMAIL: straub@gks.de (Hans-Peter Straub)
-@image{Flags/germany} Germany [Staufen] @
-@uref{http://mysql.staufen.de/, WWW}
-@item
-@c Added 990614
-@c EMAIL: thomas.rohde@ecrc.de (Thomas Rohde)
-@image{Flags/germany} Germany [Cable & Wireless] @
-@uref{ftp://ftp.ecrc.net/pub/database/mysql/, FTP}
-@item
-@c Added 981208
-@c EMAIL: christias@noc.ntua.gr (Panagiotis Christias)
-@image{Flags/greece} Greece [NTUA, Athens] @
-@uref{http://www.ntua.gr/mysql/, WWW}
-@uref{ftp://ftp.ntua.gr/pub/databases/mysql/, FTP}
-@c @item
-@c File not found 990730
-@c EMAIL: torlasz@xenia.sote.hu (Laszlo L. Tornoc)
-@c @image{Flags/hungary} Hungary [Xenia] @
-@c @uref{http://xenia.sote.hu/ftp/mirrors/www.mysql.com/, WWW}
-@c @uref{ftp://xenia.sote.hu/pub/mirrors/www.mysql.com/,FTP}
-@item
-@c EMAIL: mirrors@gm.is (Tomas Edwardsson)
-@image{Flags/iceland} Island [GM] @
-@uref{http://mysql.gm.is/, WWW}
-@uref{ftp://ftp.gm.is/pub/mysql, WWW}
-@c @item
-@c Out of date 990906
-@c EMAIL: bourbon@netvision.net.il (Zeev Suraski)
-@c @image{Flags/israel} Israel [Netvision] @
-@c @uref{http://mysql.netvision.net.il/, WWW}
-@c @item
-@c Not working 99.03.06
-@c EMAIL: maruzz@matrice.it (Giovanni Maruzzelli)
-@c @image{Flags/italy} Italy [Matrice] @
-@c @uref{http://www.matrice.it/risorse/mysql/, WWW}
-@item
-@c EMAIL: irena@yacc.it
-@image{Flags/italy} Italy [Teta Srl] @
-@uref{http://www.teta.it/mysql/, WWW}
-@item
-@c Added 991121
-@c EMAIL: nick@iol.ie (Nick Hilliard)
-@image{Flags/ireland} Ireland [Ireland On-Line/Dublin] @
-@uref{http://mysql.iol.ie, WWW}
-@uref{ftp://ftp.iol.ie/pub/mysql, FTP}
-@item
-@c EMAIL: W.Sylwestrzak@icm.edu.pl (Wojtek Sylwestrzak)
-@c mirroring nightly at 05:25
-@image{Flags/poland} Poland [Sunsite] @
-@uref{http://sunsite.icm.edu.pl/mysql/, WWW}
-@uref{ftp://sunsite.icm.edu.pl/pub/unix/mysql/, FTP}
-@c @item
-@c EMAIL: melo@co.telenet.pt (Pedro Melo)
-@c Temp out of service (email from Pedro)
-@c @image{Flags/portugal} Portugal [IP] @
-@c @uref{http://mysql.ip.pt, WWW}
-@item
-@c EMAIL: Equipa de suporte do Leirianet <support@leirianet.pt>
-@image{Flags/portugal} Portugal [lerianet] @
-@uref{http://mysql.leirianet.pt, WWW}
-@uref{ftp://ftp.leirianet.pt/pub/mysql/,FTP}
-@item
-@c EMAIL: kuzmin@dn.ru (Roma Kuzmin)
-@image{Flags/russia} Russia [DirectNet] @
-@uref{http://mysql.directnet.ru, WWW}
-@uref{ftp://ftp.dn.ru/pub/MySQL, FTP}
-@c @item
-@c down 990113
-@c EMAIL: nikkic@cityline.ru (Nikki Chumakov)
-@c @image{Flags/russia} Russia [Cityline] @
-@c @uref{ftp://mysql.cityline.ru/pub/mysql, FTP}
-@c @uref{http://mysql.cityline.ru, WWW}
-@c EMAIL: bar@izhcom.ru (Alexander I Barkov)
-@item
-@image{Flags/russia} Russia [IZHCOM] @
-@uref{http://mysql.udm.net/, WWW}
-@uref{ftp://ftp.izhcom.ru/pub/mysql/,FTP}
-@item
-@c Added 990507
-@c EMAIL: demon@gpad.ac.ru (Dima Sivachenko)
-@image{Flags/russia} Russia [Scientific Center/Chernogolovka] @
-@uref{ftp://ftp.chg.ru/pub/databases/mysql/, FTP}
-@item
-@c EMAIL: sebi@dnttm.ro (Sebastian DEAC)
-@image{Flags/romania} Romania [Timisoara] @
-@uref{http://www.dnttm.ro/mysql, WWW}
-@uref{ftp://ftp.dnttm.ro/pub/mysql, FTP}
-@item
-@c EMAIL: tim@lbi.ro (Bogdan Surdu)
-@image{Flags/romania} Romania [Bucharest] @
-@uref{http://www.lbi.ro/MySQL, WWW}
-@uref{ftp://ftp.lbi.ro/mirrors/ftp.tcx.se, FTP}
-
-@c @item
-@c Removed 20000521 because there is no mirror here.
-@c EMAIL: jips@masterd.es (Juan Ignacio P Sacrist)
-@c @image{Flags/spain} Spain [MasterD]
-@c @uref{http://mysql.masterd.es, WWW}
-
-@item
-@c EMAIL: Patrik.Karen@sdi.slu.se (Patrik Karen)
-@c ftp -> remove old files
-@image{Flags/sweden} Sweden [Sunet] @
-@uref{http://ftp.sunet.se/pub/unix/databases/relational/mysql/, WWW}
-@uref{ftp://ftp.sunet.se/pub/unix/databases/relational/mysql/, FTP}
-
-@item
-@c EMAIL: archive@sunsite.cnlab-switch.ch (Thomas Lenggenhager)
-@image{Flags/switzerland} Switzerland [Sunsite] @
-@uref{http://sunsite.cnlab-switch.ch/ftp/mirror/mysql/, WWW}
-@uref{ftp://sunsite.cnlab-switch.ch/mirror/mysql/, FTP}
-
-@c @item
-@c @c simon@oyster.co.uk (Simon Gornall)
-@c @image{Flags/great-britain} UK [Oyster/UK] @
-@c @uref{ftp://ftp.oyster.co.uk/pub/mysql, FTP}
-
-@item
-@c gareth@omnipotent.net (Gareth Watts)
-@image{Flags/great-britain} UK [Omnipotent/UK] @
-@uref{http://mysql.omnipotent.net/, WWW}
-@uref{ftp://mysql.omnipotent.net/, FTP}
-
-@item
-@c keet@mordor.plig.net (Christiaan Keet)
-@image{Flags/great-britain} UK [PLiG/UK] @
-@uref{http://ftp.plig.org/pub/mysql/, WWW}
-@uref{ftp://ftp.plig.org/pub/mysql/, FTP}
-@c @item
-@c unknown
-@c @image{Flags/great-britain} UK [MicroMuse] @
-@c @uref{ftp://ftp.micromuse.co.uk/pub/packages/unix/databases/mysql/, FTP}
-
-@item
-@c lmjm@icparc.ic.ac.uk (Lee McLoughlin)
-@image{Flags/great-britain} UK [SunSITE] @
-@uref{http://sunsite.org.uk/packages/mysql/, WWW}
-@uref{ftp://sunsite.org.uk/packages/mysql/, FTP}
-
-@item
-@c sander@paco.net (Alexander Ivanov)
-@image{Flags/ukraine} Ukraine [PACO] @
-@uref{http://mysql.paco.net.ua, WWW}
-@uref{ftp://mysql.paco.net.ua/, FTP}
-
-@end itemize
-
-@strong{ËÌ¥¢¥á¥ê¥«:}
-
-@itemize @bullet
-@c @item
-@c Not ok 990101 (only to 981007)
-@c EMAIL: sysop@polarcom.com (Seamus Venasse)
-@c @image{Flags/canada} Canada [Polaris Computing] @
-@c @uref{http://mysql.polaris.ca/, WWW}
-
-@item
-@c Ok 980109
-@c EMAIL: wojtek@tryc.on.ca (Wojtjeck Tryc)
-@image{Flags/canada} Canada [Tryc] @
-@uref{http://web.tryc.on.ca/mysql/, WWW}
-
-@item
-@c not updated 990218. Added again 990918
-@c EMAIL: rhooper@cyberus.ca (Roy Hooper)
-@image{Flags/canada} Canada [Cyberus] @
-@uref{http://mysql.cyberus.ca/, WWW}
-@uref{ftp://mysql.cyberus.ca/, FTP}
-
-@item
-@c EMAIL: mleber@he.net (Mike Leber)
-@c Added 980312
-@image{Flags/usa} USA [Hurricane Electric/San Jose] @
-@uref{http://mysql.he.net, WWW}
-
-@item
-@c EMAIL: meltzer@icsnet.com (Jeffrey Meltzer)
-@c Added 000108
-@image{Flags/usa} USA [Meltzer/New York State] @
-@uref{ftp://ftp.meltzer.org/pub/mysql/, FTP}
-
-@c @item
-@c No such directory 990830
-@c EMAIL: tps@users.buoy.com (Tim Sailer)
-@c @image{Flags/usa} USA [Buoy/New York] @
-@c @uref{http://www.buoy.com/mysql/, WWW}
-
-@c @item
-@c EMAIL: db@hpnc.com (Douglas Bowyer)
-@c Added 980107, removed 981124 because of 'file not found'
-@c @image{Flags/usa} USA [Hypernet Communications/Dallas] @
-@c @uref{http://epsilon.hpnc.com/mysql, WWW}
-
-@c @item @c **********************************
-@c Not updated 980106
-@c EX: twh@iquest.net (Thomas Holt) who no longer works there
-@c @image{Flags/usa} USA [IQuest/Indiana] @
-@c @uref{http://mirrors.iquest.net/mysql/, WWW}
-
-@c @item @c **********************************
-@c Only a partial mirror so we exclude it from the list
-@c EX: lindberg@id.wustl.edu (Fred Lindberg)
-@c @image{Flags/usa} USA [Washington University/St. Louis] @
-@c @uref{ftp://ftp.id.wustl.edu/pub/database/mysql/, FTP}
-
-@c removed 991111 -> no answer
-@c @item
-@c EMAIL: andrew@netcasting.net (Andrew Sawyers)
-@c @image{Flags/usa} USA [Netcasting/West Coast] @
-@c @uref{ftp://ftp.netcasting.net/pub/mysql/, FTP}
-
-@c @item
-@c No mirror! 980809 David
-@c EMAIL: savages@savages.com (Shaun Savage)
-@c @image{Flags/usa} USA [Savages/Oregon] @
-@c @uref{http://mysql.savages.com, WWW}
-
-@item
-@c EMAIL: tcobb@staff.circle.net (Troy Cobb)
-@image{Flags/usa} USA [Circle Net/North Carolina] @
-@uref{http://www.mysql.net, WWW}
-
-@item
-@c EMAIL: paul@gina.net (Paul Vining)
-@c mirrors ftp.sunet.se
-@image{Flags/usa} USA [Gina net/Florida] @
-@uref{http://www.gina.net/mysql/, WWW}
-
-@c Out of date 2000-01-08 (Not updated since 1999-10)
-@c @item
-@c EMAIL: wswanson@pingzero.net (Wylie Swanson)
-@c mirrors mysql.org
-@c @image{Flags/usa} USA [pingzero/Los Angeles] @
-@c @uref{http://mysql.pingzero.net/, WWW}
-
-@item
-@c EMAIL: ftpkeeper@mirror.sit.wisc.edu
-@image{Flags/usa} USA [Wisconsin University/Wisconsin] @
-@uref{http://mirror.sit.wisc.edu/mysql/, WWW}
-@uref{ftp://mirror.sit.wisc.edu/mirrors/mysql/, FTP}
-
-@item
-@c EMAIL: ftp-admin@digex.net
-@image{Flags/usa} USA [DIGEX] @
-@uref{ftp://ftp.digex.net/pub/packages/database/mysql/, FTP}
-
-@item
-@c EMAIL: andrew.sawyers@thelinuxstore.com
-@image{Flags/usa} USA [LinuxWired/Scottsdale, AZ] @
-@uref{http://mysql.linuxwired.net/, WWW}
-@uref{ftp://ftp.linuxwired.net/pub/mirrors/mysql/, FTP}
-
-@end itemize
-
-@strong{Æ¥á¥ê¥«:}
-
-@itemize @bullet
-@item
-@c EMAIL: gaiser@matrix.com.br (Roberto Gaiser)
-@image{Flags/brazil} Brazil [Matrix] @
-@uref{http://mysql.matrix.com.br, WWW}
-@item
-@c jpabuyer@vision.cl
-@image{Flags/chile} Chile [Vision] @
-@uref{http://mysql.vision.cl/, WWW}
-
-@c @item
-@c Removed 990730
-@c @c EMAIL: dan@amerikanclaris.com (Danilo Lotina F.)
-@c @image{Flags/chile} Chile [Amerikanclaris] @
-@c @uref{http://www.labs.amerikanclaris.cl/mysql, WWW}
-@c @uref{ftp://ftp.amerikanclaris.cl/pub/mysql, FTP}
-@end itemize
-
-@strong{¥¢¥¸¥¢:}
-
-@itemize @bullet
-@item
-@c EMAIL: mirnshi@netchina.com.cn (Meng Lingbo)
-@image{Flags/china} China [Freecode] @
-@uref{http://mysql.freecode.com.cn, WWW}
-
-@item
-@c EMAIL: Vincent_Fong@innovator.com.hk (Vincent Fong)
-@image{Flags/china} China [Hong Kong] @
-@uref{http://mysql.islnet.net, WWW}
-
-@item
-@c EMAIL: george@netfirm.net (Hongsheng Zhu)
-@image{Flags/china} China [Netfirm] @
-@uref{http://mysql.netfirm.net, WWW}
-
-@item
-@c EMAIL: ahmlhs@nmsvr.chosun.com (Ho-sun Lee)
-@image{Flags/south-korea} Korea [KREONet] @
-@uref{http://linux.kreonet.re.kr/mysql/, WWW}
-
-@c @item
-@c ftp -> remove old files
-@c EX: ahmlhs@nmsvr.chosun.com (Ho-sun Lee)
-@c @image{Flags/south-korea} Korea [KREONet] @
-@c @uref{ftp://linux.kreonet.re.kr/pub/tools/db/mysql/, FTP}
-
-@item
-@c Ok 980805
-@c EMAIL: takeshi@SoftAgency.co.jp
-@image{Flags/japan} Japan [SoftAgency] @
-@uref{http://www.softagency.co.jp/MySQL, WWW}¡¡¡¡
-@uref{http://www.softagency.co.jp/, ÆüËܸìÈÇMySQL¤Î¥À¥¦¥ó¥í¡¼¥É(WWW) }
-
-@c @item
-@c Ok 980109 Removed 990730
-@c EMAIL: satoshi@HappySize.co.jp (Satoshi TATSUOKA)
-@c @image{Flags/japan} Japan [HappySize] @
-@c @uref{http://www.happysize.co.jp/mysql/, WWW}
-@c @uref{ftp://ftp.happysize.co.jp/pub/mysql/, FTP}
-
-@item
-@c Ok 981204
-@c EMAIL: hiroyuki@nucba.ac.jp (hiroyuki kurimoto)
-@image{Flags/japan} Japan [Nagoya Syouka University] @
-@uref{http://mirror.nucba.ac.jp/mirror/mysql, WWW}
-@uref{ftp://mirror.nucba.ac.jp/mirror/mysql, FTP}
-
-@c @item
-@c Removed 990308
-@c EMAIL: terence@com5.net (Terence Chan)
-@c @image{Flags/singapore} Singapore [Com5 Productions] @
-@c @uref{http://mysql.com5.net, WWW}
-@c @uref{ftp://ftp.com5.net/pub/mysql, FTP}
-
-@item
-@c EMAIL: csy@hjc.edu.sg
-@image{Flags/singapore} Singapore [HJC] @
-@uref{http://mysql.hjc.edu.sg, WWW}
-@uref{ftp://ftp.hjc.edu.sg/mysql, FTP}
-
-@item
-@c 991118: Removed because a user complained about that the page contains
-@c nothing about MySQL. 991119: Added again because it is a mirror again
-@c EMAIL: dean@ht.net.tw (Dean Lin)
-@image{Flags/taiwan} Taiwan [HT] @
-@uref{http://mysql.ht.net.tw, WWW}
-
-@item
-@c EMAIL: linda@ttn.com.tw (Linda Hu)
-@image{Flags/taiwan} Taiwan [TTN] @
-@uref{http://mysql.ttn.net, WWW}
-
-@c @item
-@c Ok 980321 No connect -> removed 990730
-@c EMAIL: tby@ccca.nctu.edu.tw (Bao-Yi Tuang)
-@c @image{Flags/taiwan} Taiwan [NCTU] @
-@c @uref{http://mysql.taconet.com.tw, WWW}
-@c @item
-@c Out of date 990905 (~2 months)
-@c @item @c **********************************
-@c Error 980106
-@c EX: WolfySu@acer.net (Wolfy Su)
-@c @image{Flags/taiwan} Taiwan [Acer] @
-@c @uref{http://mysql.acer.net/, WWW}
-@c @item @c **********************************
-@c files to delete
-@c EX: service@wownet.net
-@c @image{Flags/taiwan} Taiwan [Wownet] @
-@c @uref{ftp://ftp.wownet.net/mysql/, FTP}
-@c @item @c **********************************
-@c No conntact 980106
-@c EX: serge@oneway.net
-@c @image{Flags/taiwan} Taiwan [Oneway] @
-@c @uref{ftp://ftp.oneway.com.tw/pub/mysql/, FTP}
-@end itemize
-
-@strong{¥ª¡¼¥¹¥È¥é¥ê¥¢:}
-
-@itemize @bullet
-@item
-@c Added 980610
-@c EMAIL: jason@dstc.edu.au (Jason Andrade)
-@image{Flags/australia} Australia [AARNet/Queensland] @
-@uref{http://mirror.aarnet.edu.au/mysql, WWW}
-@uref{ftp://mirror.aarnet.edu.au/pub/mysql, FTP}
-
-@c @item
-@c Added 980805. Removed 000102 'no such directory'
-@c EMAIL: sdd@ntccc.tas.gov.au (Scott Donovan)
-@c @image{Flags/australia} Australia [Tas] @
-@c @uref{http://ftp.tas.gov.au/mysql, WWW}
-@c @uref{ftp://ftp.tas.gov.au/pub/mysql, FTP}
-
-@item
-@c Ok 980623
-@c EMAIL: samh@bluep.com (Sam Hadzajlic)
-@image{Flags/australia} Australia [Blue Planet/Melbourne] @
-@uref{http://mysql.bluep.com/, WWW}
-@c removed because ftp was not working 990729 & 30
-@c @uref{ftp://mysql.bluep.com/pub/mirror1/mysql/, FTP}
-
-@item
-@c Added 990531
-@c EMAIL: gavin@itworks.com.au (Gavin Cameron)
-@image{Flags/australia} Australia [ITworks Consulting/Victoria] @
-@uref{http://mysql.itworks.com.au, WWW}
-
-@c @item
-@c 980610 Only the toplevel dir!
-@c EMAIL: lucifer@maths.uq.edu.au (David Conran)
-@c @image{Flags/australia} Australia FTP @
-@c @uref{ftp://ftp.sage-au.org.au/pub/database/mysql, [Sage]}
-@end itemize
-
-@strong{¥¢¥Õ¥ê¥«:}
-
-@itemize @bullet
-
-@item
-@c Ok 981010
-@c EMAIL: nick@mweb.com (Nick Rosenberg)
-@image{Flags/south-africa1} South-Africa [Mweb/] @
-@uref{http://www.mysql.mweb.co.za, WWW}
-
-@item
-@c Ok 981010
-@c EMAIL: oskar@is.co.za (Oskar Pearson)
-@image{Flags/south-africa1} South-Africa [The Internet Solution/Johannesburg] @
-@uref{ftp://ftp.is.co.za/linux/mysql/, FTP}
-
-@end itemize
-
-@c END_OF_MIRROR_LISTING
-
-@node Which OS, Which version, Getting MySQL, Installing
-@section @strong{MySQL} ¤¬¥µ¥Ý¡¼¥È¤¹¤ë OS
-
-²æ¡¹¤Ï GNU Autoconf ¤ò»ÈÍѤ·¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢@strong{MySQL} ¤Ï POSIX ¥¹¥ì¥Ã
-¥É¤È C++ ¥³¥ó¥Ñ¥¤¥é¤¬Æ°ºî¤¹¤ëÁ´¤Æ¤Î¿·¤·¤¤¥·¥¹¥Æ¥à¤Ë°Ü¿¢²Äǽ¤Ç¤¹¡£(¥¯¥é¥¤
-¥¢¥ó¥È¥³¡¼¥É¤Î¥³¥ó¥Ñ¥¤¥ë¤À¤±¤Ï C++ ¤òɬÍפȤ·¤Þ¤¹¤¬¡¢¥¹¥ì¥Ã¥É¤ÏɬÍפǤϤ¢¤ê¤Þ¤»¤ó¡£)
-²æ¡¹¤Ï¼«¿È¤Î¥½¥Õ¥È¥¦¥§¥¢¤ò¡¢ºÇ½é¤Ë Sun Solaris (¸½ºß¤Ï 2.5 & 2.6 & 2.7) ¾å¤Ç¡¢¤è¤ê
-¾®¤µ¤¤ÈÏ°Ï¤Ï RedHat Linux 5.0 ¾å¤Ç¡¢»ÈÍѤ·³«È¯¤·¤Þ¤¹¡£
-
-@strong{MySQL} ¤Ï¼¡¤Î OS/¥¹¥ì¥Ã¥É¥Ñ¥Ã¥±¡¼¥¸¤ÎÁȤ߹ç¤ï¤»¤Ç¡¢¥³¥ó¥Ñ¥¤¥ë¤Î
-À®¸ù¤¬Êó¹ð¤µ¤ì¤Æ¤¤¤Þ¤¹¡£Â¿¤¯¤Î OS ¤Ç¤Ï¡¢¥Í¥¤¥Æ¥£¥Ö¥¹¥ì¥Ã¥É¤ÏºÇ¿·¥Ð¡¼¥¸¥ç
-¥ó¤À¤±¤ÇÆ°ºî¤¹¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@itemize @bullet
-@item
-AIX 4.x with native threads
-@item
-BSDI 2.x with the included MIT-pthreads package
-@item
-BSDI 3.0, 3.1 and 4.x with native threads
-@item
-DEC UNIX 4.x with native threads
-@item
-FreeBSD 2.x with the included MIT-pthreads package
-@item
-FreeBSD 3.x with native threads
-@item
-HP-UX 10.20 with the included MIT-pthreads package
-@item
-HP-UX 11.x with the native threads.
-@item
-Linux 2.0+ with LinuxThreads 0.7.1 or @code{glibc} 2.0.7
-@item
-MacOS X Server
-@item
-NetBSD 1.3/1.4 Intel and NetBSD 1.3 Alpha (Requires GNU make)
-@item
-OpenBSD > 2.5 with native therads. OpenBSD < 2.5 with the included
-MIT-pthreads package
-@item
-OS/2 Warp 3, FixPack 29 and OS/2 Warp 4, FixPack 4
-@item
-SGI Irix 6.x with native threads
-@item
-Solaris 2.5 and above with native threads on SPARC and x86
-@item
-SunOS 4.x with the included MIT-pthreads package
-@item
-SCO OpenServer with a recent port of the FSU Pthreads package
-@item
-SCO UnixWare 7.0.1
-@item
-Tru64 Unix
-@item
-Win95, Win98, NT and Win2000 (the newest version is currently available
-only for users with a @strong{MySQL} license or @strong{MySQL} email
-support). For those who wish to test before they buy, we have released
-@uref{http://www.mysql.com/mysql_w32.htmy,@strong{MySQL} 3.22.33} (an
-older version) as shareware.
-@end itemize
-
-@cindex @strong{MySQL} binary distribution
-@cindex @strong{MySQL} source distribution
-@cindex Release numbers
-@cindex Version, choosing
-@cindex Choosing version
-@node Which version, Many versions, Which OS, Installing
-@section »ÈÍѤ¹¤ë @strong{MySQL} ¥Ð¡¼¥¸¥ç¥ó
-
-make ¤ò¹Ô¤¦Á°¤Ë·è¤á¤ë»ö¤Ï¡¢¤¢¤Ê¤¿¤¬ºÇ¿·¤Î³«È¯¥ê¥ê¡¼¥¹¤ò»ÈÍѤ¹¤ë¤Î¤«¡¢
-¤Þ¤¿¤ÏºÇ¿·¤Î°ÂÄê¥ê¥ê¡¼¥¹¤ò»ÈÍѤ¹¤ë¤Î¤«¤Ç¤¹¡£
-
-@itemize @bullet
-@item
-Ä̾¤¢¤Ê¤¿¤¬ºÇ½é¤Ë @strong{MySQL} ¤ò»È¤¤»Ï¤á¤ë¾ì¹ç¡¢¤Þ¤¿¤Ï¥Ð¥¤¥Ê¥êÇÛÉÛ
-¤¬¤Ê¤¤Â¾¤Î¥·¥¹¥Æ¥à¤Ë @strong{MySQL} ¤ò°Ü¿¢¤·¤è¤¦¤È¤¹¤ë¾ì¹ç¡¢
-²æ¡¹¤Ï³«È¯¥ê¥ê¡¼¥¹ (¸½ºß¤Ï @value{mysql_version}) ¤ÎÁªÂò¤ò
-´«¤á¤Þ¤¹¡£³«È¯¥ê¥ê¡¼¥¹¤Ë¤ÏÉáÄ̤ÏËÜÅö¤Ë°­¤¤¥Ð¥°¤Ï¤¢¤ê¤Þ¤»¤ó¡£¤½¤ì¤Ï¡¢¤¢¤Ê¤¿¤Î¥Þ¥·¥ó¾å¤Ç¡¢
-@code{crash-me} ¤È¥Ù¥ó¥Á¥Þ¡¼¥¯¥Æ¥¹¥È¤Ç´Êñ¤Ë¥Æ¥¹¥È¤Ç¤­¤Þ¤¹¡£
-@xref{Benchmarks}¡£Ãí°Õ: ¤¹¤Ù¤Æ¤Î @strong{MySQL} ¥ê¥ê¡¼¥¹¤Ï¤½¤ì¤¾¤ì¤Î¥ê¥ê¡¼
-¥¹¤ÎÁ°¤Ë @strong{MySQL} ¥Ù¥ó¥Á¥Þ¡¼¥¯¤È¹­ÈϰϤʥƥ¹¥È¥¹¥¤¡¼¥È¤Ç¥Á¥§¥Ã¥¯¤µ¤ì
-¤Þ¤¹¡£
-
-@item
-¤½¤¦¤Ç¤Ê¤¯¤Æ¡¢¸Å¤¤¥·¥¹¥Æ¥à¤Ç¼Â¹Ô¤·¤Æ¤¤¤Æ¥¢¥Ã¥×¥°¥ì¡¼¥É¤·¤¿¤¤¤±¤ì¤É¤â¡¢
-³«È¯ÈǤϻ¤¿¤¯¤Ê¤¤¾ì¹ç¤Ï¡¢¤¢¤Ê¤¿¤¬»ÈÍѤ·¤Æ¤¤¤ëʪ¤ÈƱ¤¸¥Ö¥é¥ó¥ÁÃæ¤Î
-ºÇ¿·¤Î¤â¤Î(¤¢¤Ê¤¿¤¬»ÈÍѤ·¤Æ¤¤¤ëʪ¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Îʪ)¤Ë
-¥¢¥Ã¥×¥°¥ì¡¼¥É¤¹¤Ù¤­¤Ç¤¹¡£ ¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢Ã×̿Ū¤Ê¥Ð¥°¤À¤±¤ò½¤Àµ¤·¡¢
-Èæ³ÓŪ°ÂÁ´¤Ç¾®¤µ¤ÊÊѹ¹¤ò¹Ô¤Ã¤Æ¤¤¤Þ¤¹¡£
-@end itemize
-
-make Á°¤Î£²ÈÖÌܤηèÄê»ö¹à¤Ï¡¢¥½¡¼¥¹ÇÛÉۤȥХ¤¥Ê¥êÇÛÉۤΤɤÁ¤é¤ò»ÈÍѤ¹¤ë¤«¤Ç¤¹:
-
-@itemize @bullet
-@item
-¤¢¤Ê¤¿¤¬¸½ºß¥Ð¥¤¥Ê¥êÇÛÉÛ¤¬Â¸ºß¤¹¤ë¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¾å¤Ç @strong{MySQL} ¤ò
-¼Â¹Ô¤·¤¿¤¤¤Î¤Ê¤é¡¢¤½¤ì¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£Ä̾¥½¡¼¥¹ÇÛÉÛ¤è¤ê¤â¥¤¥ó¥¹¥È¡¼
-¥ë¤Ï´Êñ¤Ç¤¹¡£
-
-@item
-@strong{MySQL} ¤òºî¤ë C ¤È C++ ¥³¡¼¥É¤òÆɤߤ¿¤¤(¤½¤·¤Æ/¤Þ¤¿¤ÏÊѹ¹¤·¤¿¤¤)
-¾ì¹ç¤Ï¥½¡¼¥¹ÇÛÉÛ¤òÆþ¼ê¤¹¤ë¤Ù¤­¤Ç¤¹¡£¥½¡¼¥¹¥³¡¼¥É¤Ï¤¤¤Ä¤Ç¤âµæ¶Ë¤Î¥Þ¥Ë¥å¥¢
-¥ë¤Ç¤¹¡£¥½¡¼¥¹ÇÛÉۤϥХ¤¥Ê¥êÇÛÉÛ¤è¤ê¤â¿¤¯¤Î¥Æ¥¹¥È¤ÈÎã¤â´Þ¤ó¤Ç¤¤¤Þ¤¹¡£
-@end itemize
-
-@strong{MySQL} ¤Î̿̾ˡ¤Ç¤Ï¡¢¥ê¥ê¡¼¥¹ÈÖ¹æ¤Ï3¤Ä¤Î¿ôÃͤȥµ¥Õ¥£¥Ã¥¯¥¹¤«¤é¤Ê
-¤ê¤Þ¤¹¡£Î㤨¤Ð¡¢@code{mysql-3.21.17-beta} ¤Î¤è¤¦¤Ê¥ê¥ê¡¼¥¹Ì¾¤Ï¼¡¤Î¤è¤¦¤Ë
-²ò¼á¤µ¤ì¤Þ¤¹:
-
-@itemize @bullet
-@item
-ºÇ½é¤Î¿ôÃÍ(@code{3})¤Ï¥Õ¥¡¥¤¥ë·Á¼°¤òɽ¤·¤Þ¤¹¡£Á´¤Æ¤Î¥Ð¡¼¥¸¥ç¥ó 3 ¥ê¥ê¡¼
-¥¹¤ÏƱ¤¸¥Õ¥¡¥¤¥ë¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ý¤Á¤Þ¤¹¡£¥Ð¡¼¥¸¥ç¥ó 4 ¤¬¸½¤ì¤¿»þ¡¢Á´¤Æ¤Î
-¥Æ¡¼¥Ö¥ë¤Ï¿·¤·¤¤·Á¼°¤ËÊÑ´¹¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹ (¤³¤Î¤¿¤á¤ÎÎɤ¤¥Ä¡¼¥ë¤Ï¤â¤Á
-¤í¤ó´Þ¤Þ¤ì¤Þ¤¹)¡£
-
-@item
-2ÈÖÌܤοôÃÍ(@code{21})¤Ï¥ê¥ê¡¼¥¹¥ì¥Ù¥ë¤Ç¤¹¡£Ä̾ï¤ÏÆó¤Ä¤«¤éÁªÂò¤·¤Þ¤¹¡£°ì
-¤Ä¤Ï¥ê¥ê¡¼¥¹/°ÂÄê¥Ö¥é¥ó¥Á¤Ç(¸½ºß¤Ï @code{22})¡¢¤â¤¦°ì¤Ä¤Ï³«È¯¥Ö¥é¥ó¥Á¤Ç¤¹(¸½ºß¤Ï @code{23})¡£
-Ä̾ï¤ÏξÊý¤È¤â°ÂÄê¤Ç¤¹¤¬¡¢³«È¯¥Ð¡¼¥¸¥ç¥ó¤Ï¤­¤Þ¤°¤ì¤Ç¡¢¥É¥­¥å¥á¥ó¥È¤¬¤Ê¤¯¡¢¤¤¤¯¤Ä¤«¤Î¥·
-¥¹¥Æ¥à¤Ç¤Ï¥³¥ó¥Ñ¥¤¥ë¤Ë¼ºÇÔ¤·¤Þ¤¹¡£
-
-@item
-3ÈÖÌܤοôÃÍ(@code{17})¤Ï¥ê¥ê¡¼¥¹¥ì¥Ù¥ëÆâ¤Î¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤Ç¤¹¡£¤³¤ì¤Ï¿·¤·
-¤¤ÇÛÉÛ¤ÎÅÙ¤ËÁý²Ã¤·¤Þ¤¹¡£ÉáÄ̤Ϥ¢¤Ê¤¿¤ÎÁªÂò¤·¤¿¥ê¥ê¡¼¥¹¥ì¥Ù¥ë¤ÎºÇ¿·¥Ð¡¼¥¸¥ç
-¥ó¤òµá¤á¤Þ¤¹¡£
-
-@item
-¥µ¥Õ¥£¥Ã¥¯¥¹(@code{beta})¤Ï¥ê¥ê¡¼¥¹¤Î°ÂÄê¥ì¥Ù¥ë¤òɽ¤·¤Þ¤¹:
-
-@itemize @minus
-@item
-@code{alpha} ¤Ï¡¢100% ¥Æ¥¹¥È¤µ¤ì¤Æ¤¤¤Ê¤¤¤¤¤¯¤Ä¤«¤Î¿·¤·¤¤Â礭¤Ê¥³¡¼¥É¥»¥¯
-¥·¥ç¥ó¤¬Â¸ºß¤¹¤ë¤³¤È¤ò¼¨¤·¡¢ÃΤé¤ì¤Æ¤¤¤ë¥Ð¥°¤Ï News Àá¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤Þ¤¹
-(Ä̾ï¤Ï¤¢¤ê¤Þ¤»¤ó)¡£@xref{News}¡£Â¿¤¯¤Î alpha ¥ê¥ê¡¼¥¹¤Ë¤Ï¿·¤·¤¤¥³¥Þ
-¥ó¥É¤È³ÈÄ¥¤â¤¢¤ê¤Þ¤¹¡£
-Â礭¤Ê¥³¡¼¥ÉÊѹ¹¤ò´Þ¤à³«È¯Ãæ¤Î¤â¤Î¤Ï¡¢alpha ¥ê¥ê¡¼¥¹¾å¤Ë¸½¤ì¤Þ¤¹¡£¤·¤«¤·
-Á´¤Æ¥ê¥ê¡¼¥¹Á°¤Ë¥Æ¥¹¥È¤µ¤ì¤Þ¤¹¡£¤½¤ì¤¾¤ì¤Î @code{MySQL} ¥ê¥ê¡¼¥¹¤Ë¤Ï´ûÃÎ
-¤Î¥Ð¥°¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-
-@item
-@code{beta} ¤ÏÁ´¤Æ¤Î¿·¤·¤¤¥³¡¼¥É¤¬¥Æ¥¹¥È¤µ¤ì¤¿¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£Â礭¤Ê¿·
-¤·¤¤¤â¤Î¤ÏÄɲ䵤ì¤Þ¤»¤ó¡£ÃΤé¤ì¤Æ¤¤¤ë¥Ð¥°¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-alpha ¥Ð¡¼¥¸¥ç¥ó¤Ç¡¢¾¯¤Ê¤¯¤È¤â°ì¥«·î´Ö¡¢Ã×̿Ū¤Ê¥Ð¥°¤¬Êó¹ð¤µ¤ì¤Ê¤¯¤Æ¡¢¸Å
-¤¤¥³¥Þ¥ó¥É¤ò¤è¤ê¿®Íê¤Ç¤­¤Ê¤¯¤¹¤ë¤è¤¦¤Ê¿·¤·¤¤µ¡Ç½¤òÄɲ乤ë·×²è¤¬¤Ê¤¤»þ¤Ë¡¢
-alpha ¤«¤é beta ¤Ë¥Ð¡¼¥¸¥ç¥ó¤¬Êѹ¹¤µ¤ì¤Þ¤¹¡£
-
-@item
-@code{gamma} ¤Ï beta ¤¬¤·¤Ð¤é¤¯¤·¤Æ¡¢Àµ¤·¤¯Æ°¤¯¤è¤¦¤Ë¸«¤¨¤ë¤â¤Î¤Ç¤¹¡£
-¾®¤µ¤Ê½¤Àµ¤À¤±¤¬Äɲ䵤ì¤Þ¤¹¡£
-¤³¤ì¤Ï¿¤¯¤Î¾¤Î²ñ¼Ò¤¬¥ê¥ê¡¼¥¹¤È¸Æ¤Ö¤â¤Î¤Ç¤¹¡£
-
-@item
-¥µ¥Õ¥£¥Ã¥¯¥¹¤¬¤Ê¤¤¾ì¹ç¤Ï¡¢Â¿¤¯¤Î°Û¤Ê¤ë¾ì½ê¤Ç¡¢¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¸ÇÍ­¤Î¥Ð¥°
-¤ò½ü¤¤¤Æ¥Ð¥°¥ì¥Ý¡¼¥È¤Ê¤·¤Ç¤½¤Î¥Ð¡¼¥¸¥ç¥ó¤¬¤·¤Ð¤é¤¯¤Î´ÖÆ°ºî¤·¤Æ¤¤¤¿¤³¤È¤ò
-°ÕÌ£¤·¤Þ¤¹¡£ Ã×̿Ū¤Ê¥Ð¥°½¤Àµ¤À¤±¤¬¥ê¥ê¡¼¥¹¤ËŬÍѤµ¤ì¤Þ¤¹¡£
-¤³¤ì¤Ï²æ¡¹¤¬ stable ¥ê¥ê¡¼¥¹¤È¸Æ¤Ö¤â¤Î¤Ç¤¹¡£
-@end itemize
-@end itemize
-
-@strong{MySQL} ¤ÎÁ´¤Æ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï¡¢Èæ³ÓŪ°ÂÁ´¤Ë»ÈÍѤǤ­¤ë¤³¤È¤ò³Î¤«¤á
-¤ë¤¿¤á¡¢²æ¡¹¤Ïɸ½à¥Æ¥¹¥È¤È¥Ù¥ó¥Á¥Þ¡¼¥¯¤òÄ̤·¤Æ³Îǧ¤·¤Æ¤¤¤Þ¤¹¡£É¸½à¥Æ¥¹
-¥È¤Ï°ÊÁ°¤Ë¸«¤Ä¤«¤Ã¤¿Á´¤Æ¤Î¥Ð¥°¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤è¤¦¤Ë³ÈÄ¥¤µ¤ì¤ë¤¿¤á¡¢¥Æ¥¹¥È
-¥¹¥¤¡¼¥È¤Ï¤è¤êÎɤ¯ÊÝ»ý¤µ¤ì¤Þ¤¹¡£
-
-Á´¤Æ¤Î¥ê¥ê¡¼¥¹¤Ï¾¯¤Ê¤¯¤Æ¤â¼¡¤Î¥Æ¥¹¥È¤¬¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤:
-
-@table @asis
-@item ÆâÉô¥Æ¥¹¥È¥¹¥¤¡¼¥È
-¤³¤ì¤Ï¸ÜµÒ¤Î¤¿¤á¤ÎÀ½ÉÊ¥·¥¹¥Æ¥à¤Î°ìÉô¤Ç¤¹¡£Â¿¤¯¤Î¥Æ¡¼¥Ö¥ë¤È²¿É´¤È¤¤¤¦¥á¥¬
-¥Ð¥¤¥È¤Î¥Ç¡¼¥¿¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£
-
-@item @strong{MySQL} ¥Ù¥ó¥Á¥Þ¡¼¥¯¥¹¥¤¡¼¥È
-¤³¤ì¤Ï°ìÈÌŪ¤ÊÈϰϤΥ¯¥¨¥ê¤ò¼Â¹Ô¤·¤Þ¤¹¡£¤³¤ì¤Ï¡¢ºÇŬ²½¤ÎºÇ¿·¥Ð¥Ã¥Á¤¬¼ÂºÝ
-¤Ë¥³¡¼¥É¤ò¤è¤ê®¤¯ºî¤ì¤ë¤«¤É¤¦¤«¤ò³Îǧ¤¹¤ë¥Æ¥¹¥È¤Ç¤â¤¢¤ê¤Þ¤¹¡£
-@xref{Benchmarks}¡£
-
-@item @code{crash-me} ¥Æ¥¹¥È
-¤³¤ì¤Ï¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ëµ¡Ç½¤È¡¢¤½¤ÎµöÍÆÎ̤ÈÀ©¸Â¤ò·èÄꤷ¤è
-¤¦¤È¤·¤Þ¤¹¡£@xref{Benchmarks}¡£
-@end table
-
-¾¤Î¥Æ¥¹¥È¤Ï²æ¡¹¤ÎÆâÉôÀ½ÉʴĶ­¤ÇºÇ¿·¤Î @strong{MySQL} ¥Ð¡¼¥¸¥ç¥ó¤ò²æ¡¹¤¬
-¾¯¤Ê¤¯¤È¤â1¤Ä¤Î¥Þ¥·¥ó¤Ç»ÈÍѤ¹¤ë¤³¤È¤Ç¤¹¡£²æ¡¹¤ÏÆ°ºî¤Î¤¿¤á 100¥®¥¬¥Ð¥¤¥È
-°Ê¾å¤Î¥Ç¡¼¥¿¤ò»ý¤Á¤Þ¤¹¡£
-
-@node Many versions, Installation layouts, Which version, Installing
-@section ¥¢¥Ã¥×¥Ç¡¼¥È¤¬¥ê¥ê¡¼¥¹¤µ¤ì¤ëÊýË¡¤È»þ
-
-@strong{MySQL} ¤Ï TcX ¤Ç¤«¤Ê¤ê®¤¯¿Ê²½¤·¤Æ¤¤¤Æ¡¢²æ¡¹¤Ï¤³¤ì¤ò¾¤Î
-@strong{MySQL} ¥æ¡¼¥¶¤Ë¶¦Í­¤·¤Æ¤â¤é¤¤¤¿¤¤¤Ç¤¹¡£²æ¡¹¤Ï¡¢Â¾¤Î¿Í¤¬É¬ÍפȤ·
-¤Æ¤¤¤ë¤È»×¤ï¤ì¤ë¤È¤Æ¤âÊØÍø¤Êµ¡Ç½¤ò»ý¤Ã¤¿»þ¤Ë¡¢¥ê¥ê¡¼¥¹¤ÎºîÀ®¤ò»î¤ß¤Þ¤¹¡£
-
-²æ¡¹¤Ï¡¢¼ÂÁõ¤¬´Êñ¤Êµ¡Ç½¤òÍ׵᤹¤ë¥æ¡¼¥¶¤Î¼ê½õ¤±¤â»î¤ß¤Þ¤¹¡£²æ¡¹¤Ï¡¢²æ¡¹
-¤Î¥é¥¤¥»¥ó¥¹¥æ¡¼¥¶¤¬µá¤á¤ë¤â¤Î¤Ë¤âÃíÌܤ·¡¢Æä˲桹¤Î³ÈÄ¥ email ¥µ¥Ý¡¼¥È
-¸ÜµÒ¤¬µá¤á¤ë¤â¤Î¤ËÃíÌܤ·¤Æ¡¢Èà¤é¤Î¼ê½õ¤±¤ò»î¤ß¤Þ¤¹¡£
-
-¿·¤·¤¤¥ê¥ê¡¼¥¹¤ò¥À¥¦¥ó¥í¡¼¥É¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£News Àá¤Ï¡¢¿·¤·¤¤¥ê¥ê¡¼
-¥¹¤¬¡¢¤¢¤Ê¤¿¤¬ËÜÅö¤Ëµá¤á¤ë²¿¤«¤ò»ý¤Ã¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò¤¢¤Ê¤¿¤Ë¶µ¤¨¤Þ¤¹¡£
-@xref{News}¡£
-
-²æ¡¹¤Ï @strong{MySQL} ¤Î¹¹¿·»þ¤Ï¼¡¤Î¥Ý¥ê¥·¡¼¤Ë¤·¤¿¤¬¤Ã¤Æ¹Ô¤¤¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-¤½¤ì¤¾¤ì¤Î¥Þ¥¤¥Ê¡¼¥¢¥Ã¥×¥Ç¡¼¥È¤Ç¡¢¥Ð¡¼¥¸¥ç¥óʸ»úÎóÃæ¤ÎºÇ¸å¤Î¿ôÃͤ¬Áý²Ã¤·
-¤Þ¤¹¡£¼çÍפʿ·µ¡Ç½¤äÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤È¤Î¥Þ¥¤¥Ê¡¼¤ÊÈó¸ß´¹¤¬¤¢¤Ã¤¿»þ¤Ë¤Ï¡¢¥Ð¡¼
-¥¸¥ç¥óʸ»úÎóÃæ¤Î2ÈÖÌܤοôÃͤ¬Áý²Ã¤·¤Þ¤¹¡£¥Õ¥¡¥¤¥ë·Á¼°¤¬Êѹ¹¤·¤¿»þ¡¢ºÇ½é
-¤Î¿ôÃͤ¬Áý²Ã¤·¤Þ¤¹¡£
-
-@item
-°ÂÄê¤Ë¥Æ¥¹¥È¤µ¤ì¤¿¥ê¥ê¡¼¥¹¤Ïǯ¤ËÌó 1-2 ²ó¸½¤ì¤Þ¤¹¡£¤·¤«¤·¾®¤µ¤Ê¥Ð¥°¤¬¸«
-¤Ä¤«¤Ã¤¿¾ì¹ç¤Ï¡¢¥Ð¥°¥Õ¥£¥Ã¥¯¥¹¤À¤±¤Î¥ê¥ê¡¼¥¹¤¬¥ê¥ê¡¼¥¹¤µ¤ì¤Þ¤¹¡£
-
-@item
-ºî¶ÈÃæ¤Î¥ê¥ê¡¼¥¹¤ÏÌó 1-8 ½µ´ÖËè¤Ë¸½¤ì¤Þ¤¹¡£
-
-@item
-¤¤¤¯¤Ä¤«¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Î¤¿¤á¤Î¥Ð¥¤¥Ê¥êÇÛÉۤϲ桹¤Ë¤è¤Ã¤Æ¥á¥¸¥ã¡¼¥ê¥ê¡¼
-¥¹¤«¤éºî¤é¤ì¤Þ¤¹¡£Â¾¤Î¿Í¤¬Â¾¤Î¥·¥¹¥Æ¥à¤Î¤¿¤á¤Ë¥Ð¥¤¥Ê¥êÇÛÉÛ¤òºî¤ê¤Þ¤¹¤¬¡¢
-¤ª¤½¤é¤¯ÉÑÈˤǤϤ¢¤ê¤Þ¤»¤ó¡£
-
-@item
-Ä̾¾®¤µ¤Ê¥Ð¥°¤ò¸«¤Ä¤±¤Æ½¤Àµ¤¹¤ë¤È¤¹¤°¤Ë¡¢Í­¸ú¤Ê¥Ñ¥Ã¥Á¤òºî¤ê¤Þ¤¹¡£
-
-@item
-´í¸±¤Ç¤Ï¤Ê¤¤¤±¤ì¤É¤âº¤¤é¤µ¤ì¤ë¥Ð¥°¤Ë¤Ï¡¢²æ¡¹¤ËÃΤ餻¤Æ失¤ì¤ÐÍ­¸ú¤Ê¥Ñ¥Ã
-¥Á¤òºîÀ®¤·¤Þ¤¹¡£¤½¤Î¾¤Î¾ì¹ç¡¢Â礭¤Ê¥Ñ¥Ã¥Á¤ÎÃæ¤Ë¤½¤ì¤é¤Î¿¤¯¤ò·ë¹ç¤·¤Þ¤¹¡£
-
-@item
-¶öÁ³¡¢Ã×̿Ū¤Ê¥Ð¥°¤¬¥ê¥ê¡¼¥¹Ãæ¤Ë¤¢¤ë¾ì¹ç¡¢²æ¡¹¤Ï¿·¤·¤¤¥ê¥ê¡¼¥¹¤ò²Äǽ¤Ê¸Â
-¤ê¤¹¤°¤Ëºî¤ê¤Þ¤¹¡£Â¾¤Î²ñ¼Ò¤â¤½¤¦¤·¤Æ¤â¤é¤¤¤¿¤¤¤Ç¤¹¡£:)
-@end itemize
-
-¸½ºß¤Î°ÂÄê¥ê¥ê¡¼¥¹¤Ï 3.22 ¤Ç¤¹; ²æ¡¹¤Ï¤¹¤Ç¤Ë 3.23 ¤Î³«È¯¤Ë°Ü¹Ô¤·¤Æ¤¤¤Þ¤¹¡£
-¤·¤«¤·¡¢°ÂÄê¥Ð¡¼¥¸¥ç¥ó¤Ç¤â¥Ð¥°¤Ï¤Þ¤À½¤Àµ¤µ¤ì¤Þ¤¹¡£
-²æ¡¹¤Ï¡¢¥Ð¥°½¤Àµ¤È``¹Ô¤Ê¤ï¤Ê¤±¤ì¤Ð¤¤¤±¤Ê¤¤''¤³¤È¤ò̵»ë¤¹¤ë¤è¤¦¤Ê¡¢´°Á´¤Ê
-Åà·ë¤ò¹Í¤¨¤Æ¤¤¤Þ¤»¤ó¡£``´öʬ¤«¤ÎÅà·ë''¤È¤Ï¡¢``¤Û¤È¤ó¤É³Î¼Â¤Ë´û¤ËÆ°ºî¤·¤Æ
-¤¤¤ë¤â¤Î¤Ë±Æ¶Á¤òÍ¿¤¨¤Ê¤¤''¾®¤µ¤Ê¤³¤È¤òÄɲ乤뤫¤â¤·¤ì¤Ê¤¤¤È¤¤¤¦¤³¤È¤ò°Õ
-Ì£¤·¤Þ¤¹¡£
-
-@node Installation layouts, Installing binary, Many versions, Installing
-@section ¥¤¥ó¥¹¥È¡¼¥ë¥ì¥¤¥¢¥¦¥È
-
-¤³¤ÎÀá¤Ç¤Ï¡¢¥Ð¥¤¥Ê¥ê¤È¥½¡¼¥¹ÇÛÉۤΥ¤¥ó¥¹¥È¡¼¥ë¤ÇÀ¸À®¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î
-¥Ç¥Õ¥©¥ë¥È¤Î¥ì¥¤¥¢¥¦¥È¤òÀâÌÀ¤·¤Þ¤¹¡£
-
-¥Ð¥¤¥Ê¥êÇÛÉۤϥ¢¥ó¥Ñ¥Ã¥¯¤¹¤ë¤³¤È¤Ë¤è¤ê¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¡¢¥¤¥ó¥¹¥È¡¼¥ë¾ì½ê
-¤Ï¤¢¤Ê¤¿¤¬ÁªÂò¤·¤¿¾ì½ê(Ä̾ï @file{/usr/local/mysql})¤ÎÃæ¤Î¼¡¤Î¥Ç¥£¥ì¥¯¥È
-¥ê¤òÁªÂò¤·À¸À®¤·¤Þ¤¹:
-
-@multitable @columnfractions .3 .7
-@item @strong{¥Ç¥£¥ì¥¯¥È¥ê} @tab @strong{¥Ç¥£¥ì¥¯¥È¥ê¤ÎÆâÍÆ}
-@item @file{bin} @tab ¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à, @code{mysqld} ¥µ¡¼¥Ð
-@item @file{data} @tab ¥í¥°¥Õ¥¡¥¤¥ë, ¥Ç¡¼¥¿¥Ù¡¼¥¹
-@item @file{include} @tab ¥¤¥ó¥¯¥ë¡¼¥É(¥Ø¥Ã¥À)¥Õ¥¡¥¤¥ë
-@item @file{lib} @tab ¥é¥¤¥Ö¥é¥ê
-@item @file{scripts} @tab @code{mysql_install_db}
-@item @file{share/mysql} @tab ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¥Õ¥¡¥¤¥ë
-@item @file{sql-bench} @tab ¥Ù¥ó¥Á¥Þ¡¼¥¯
-@end multitable
-
-¥½¡¼¥¹ÇÛÉÛ¤Ï configure ¤·¥³¥ó¥Ñ¥¤¥ë¤·¤¿¸å¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Þ¤¹¡£¥Ç¥Õ¥©
-¥ë¥È¤Ç¤Ï¥¤¥ó¥¹¥È¡¼¥ë¥¹¥Æ¥Ã¥×¤Ï @file{/usr/local} ÇÛ²¼¤Î¥Õ¥¡¥¤¥ë¤ò¼¡¤Î¥µ
-¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹:
-
-@multitable @columnfractions .3 .7
-@item @strong{¥Ç¥£¥ì¥¯¥È¥ê} @tab @strong{¥Ç¥£¥ì¥¯¥È¥ê¤ÎÆâÍÆ}
-@item @file{bin} @tab ¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤È¥¹¥¯¥ê¥×¥È
-@item @file{include/mysql} @tab ¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë
-@item @file{info} @tab Info ·Á¼°¤Î¥É¥­¥å¥á¥ó¥È
-@item @file{lib/mysql} @tab ¥é¥¤¥Ö¥é¥ê
-@item @file{libexec} @tab @code{mysqld} ¥µ¡¼¥Ð
-@item @file{share/mysql} @tab ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¥Õ¥¡¥¤¥ë
-@item @file{sql-bench} @tab ¥Ù¥ó¥Á¥Þ¡¼¥¯¤È @code{crash-me} ¥Æ¥¹¥È
-@item @file{var} @tab ¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¥í¥°¥Õ¥¡¥¤¥ë
-@end multitable
-
-¥½¡¼¥¹¥¤¥ó¥¹¥È¡¼¥ë¤Î¥ì¥¤¥¢¥¦¥È¤Ï¥Ð¥¤¥Ê¥ê¥¤¥ó¥¹¥È¡¼¥ë¤È¼¡¤ÎÅÀ¤¬°Û¤Ê¤ê¤Þ¤¹:
-
-@itemize @bullet
-@item
-@code{mysqld} ¥µ¡¼¥Ð¤Ï @file{/bin} ¤Ç¤Ï¤Ê¤¯
-@file{libexec} ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Þ¤¹¡£
-@item
-¥Ç¡¼¥¿¥Ç¥£¥ì¥¯¥È¥ê¤Ï @file{data} ¤Ç¤Ï¤Ê¤¯
-@file{var} ¤Ç¤¹¡£
-@item
-@code{mysql_install_db} ¤Ï @file{/usr/local/mysql/scripts} ¤Ç¤Ï¤Ê¤¯
-@file{/usr/local/bin} ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Þ¤¹¡£
-
-@item
-¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï @file{include/mysql} ¤Ç¡¢
-¥é¥¤¥Ö¥é¥ê¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï @file{lib/mysql} ¤Ç¤¹¡£
-@file{include} ¤ä @file{lib} ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-@end itemize
-
-@node Installing binary, Installing source, Installation layouts, Installing
-@section @strong{MySQL} ¥Ð¥¤¥Ê¥êÇÛÉۤΥ¤¥ó¥¹¥È¡¼¥ë
-
-@menu
-* Linux-RPM:: Linux RPM files
-* Building clients:: Building client programs
-* Binary install system issues:: System-specific issues
-@end menu
-
-¼¡¤Ë¤µ¤é¤Ë¾ÜºÙ¤ÊÀâÌÀ¤ò¹Ô¤Ê¤¤¤Þ¤¹:
-
-@strong{MySQL} ¥Ð¥¤¥Ê¥êÇÛÉÛ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤Ë¤Ï¡¢¼¡¤Î¥Ä¡¼¥ë¤¬É¬ÍפǤ¹:
-
-@itemize @bullet
-@item
-GNU @code{gunzip}¡£ÇÛÉۤο­Ä¹¤Î¤¿¤á¡£
-
-@item
-ŬÀµ¤Ê @code{tar}¡£ÇÛÉۤΟ³«¤Î¤¿¤á¡£GNU @code{tar} ¤ÏÆ°¤¯¤³¤È¤¬ÃΤé¤ì¤Æ
-¤¤¤Þ¤¹¡£
-@end itemize
-
-@cindex RPM
-@cindex RedHat Package Manager
-Linux ¤Ç¤Ï¡¢Âå¤ï¤ê¤Î¥¤¥ó¥¹¥È¡¼¥ëÊýË¡¤È¤·¤Æ RPM (RedHat Package
-Manager) ¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ @xref{Linux-RPM}.
-
-@c texi2html fails to split chapters if I use strong for all of this.
-ÌäÂ꤬µ¯¤­¤¿¤È¤­¤Ï¡¢@email{mysql@@lists.mysql.com} ¤Ë¼ÁÌä¤òÅê¹Æ¤¹¤ë»þ¤Ë
-@code{mysqlbug} ¤ò@strong{¾ï¤Ë»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤}¡£ÌäÂ꤬¥Ð¥°¤Ç¤Ê¤¤¤È¤·¤Æ
-¤â¡¢@code{mysqlbug} ¤Ï¤¢¤Ê¤¿¤ÎÌäÂê¤ò²ò·è¤¹¤ë½õ¤±¤Ë¤Ê¤ë¤Ç¤¢¤í¤¦¥·¥¹¥Æ¥à¾ð
-Êó¤ò¼ý½¸¤·¤Þ¤¹¡£@code{mysqlbug} ¤ò»ÈÍѤ·¤Ê¤¤¤È¡¢¤¢¤Ê¤¿¤ÎÌäÂê¤Î²ò·è¤òÆÀ¤ë
-²ÄǽÀ­¤¬¾®¤µ¤¯¤Ê¤ê¤Þ¤¹¡ª @code{mysqlbug} ¤Ï¡¢ÇÛÉۤΥ¢¥ó¥Ñ¥Ã¥¯¸å¤Ë
-@file{bin} ¥Ç¥£¥ì¥¯¥È¥êÆâ¤Ë¸«¤Ä¤±¤é¤ì¤Þ¤¹¡£@xref{Bug reports}.
-
-@strong{MySQL} ¥Ð¥¤¥Ê¥êÇÛÉÛ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¡¢»ÈÍѤ¹¤ë¤¿¤á¤Ë¹Ô¤Ê¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤
-´ðËÜŪ¤Ê¥³¥Þ¥ó¥É:
-
-@example
-shell> gunzip < mysql-VERSION-OS.tar.gz | tar xvf -
-shell> ln -s mysql-VERSION-OS mysql
-shell> cd mysql
-shell> scripts/mysql_install_db
-shell> bin/safe_mysqld &
-@end example
-
-¤³¤³¤Ç¤µ¤é¤Ë¾ÜºÙ¤ÊÀâÌÀ¤ò³¤±¤Þ¤¹:
-
-¥Ð¥¤¥Ê¥êÇÛÉۤΥ¤¥ó¥¹¥È¡¼¥ë¤Ë¤Ï¡¢¼¡¤Î¥¹¥Æ¥Ã¥×¤Ë½¾¤¤¡¢¤½¤ì¤«¤é ¥¤¥ó¥¹¥È¡¼
-¥ë¸å¤Î¥»¥Ã¥È¥¢¥Ã¥×¤È¥Æ¥¹¥È¤Î¤¿¤á¤Ë @ref{Post-installation} ¤Ë¿Ê¤ó¤Ç¤¯¤À
-¤µ¤¤¡£
-
-@enumerate
-@item
-ÇÛ²¼¤ËÇÛÉÛ¤ò¥¢¥ó¥Ñ¥Ã¥¯¤·¤¿¤¤¥Ç¥£¥ì¥¯¥È¥ê¤òÁª¤ó¤Ç¡¢¤½¤³¤Ë°Ü¤Ã¤Æ¤¯¤À¤µ¤¤¡£
-°Ê²¼¤ÎÎã¤Ç¤Ï¡¢@file{/usr/local} ÇÛ²¼¤ËÇÛÉÛ¤ò¥¢¥ó¥Ñ¥Ã¥¯¤·¡¢@strong{MySQL}
-¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê @file{/usr/local/mysql} ¤òÀ¸À®¤·¤Þ¤¹¡£(¤·
-¤¿¤¬¤Ã¤Æ¡¢°Ê²¼¤Î»Ø¼¨¤Ï @file{/usr/local} ¤Ë¥Õ¥¡¥¤¥ë¤òÀ¸À®¤¹¤ë¥Ñ¡¼¥ß¥Ã¥·¥ç
-¥ó¤ò»ý¤Ã¤Æ¤¤¤ë¤È¤ß¤Ê¤·¤Þ¤¹¡£¥Ç¥£¥ì¥¯¥È¥ê¤¬¥×¥í¥Æ¥¯¥È¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢
-@code{root} ¤Ç¥¤¥ó¥¹¥È¡¼¥ë¤ò¹Ô¤Ê¤¦É¬Íפ¬¤¢¤ê¤Þ¤¹¡£)
-
-@item
-ÇÛÉÛ¥Õ¥¡¥¤¥ë @ref{Getting MySQL, , Getting @strong{MySQL}}. ¤Ë¥ê¥¹¥È¤µ¤ì¤¿¥µ¥¤¥È¤Î°ì¤Ä¤«¤éÆÀ¤Æ¤¯¤À¤µ¤¤¡£
-
-@strong{MySQL} ¥Ð¥¤¥Ê¥êÇÛÉۤϰµ½Ì¤µ¤ì¤¿ @code{tar} ¥¢¡¼¥«¥¤¥Ö¤È¤·¤ÆÄó¶¡
-¤µ¤ì¡¢@file{mysql-VERSION-OS.tar.gz} ¤Î¤è¤¦¤Ê̾Á°¤ò»ý¤Á¤Þ¤¹¡£¤³¤³¤Ç
-@code{VERSION} ¤Ï¿ôÃÍ(Î㤨¤Ð¡¢@code{3.21.15})¤Ç¡¢@code{OS} ¤ÏÇÛÉÛ¤¬°Õ¿Þ
-¤·¤Æ¤¤¤ë¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Î¼ïÎà¤òɽ¤·¤Þ¤¹(Î㤨¤Ð
-@code{pc-linux-gnu-i586})¡£
-
-@item
-ÇÛÉÛ¤ò¥¢¥ó¥Ñ¥Ã¥¯¤·¡¢¥¤¥ó¥¹¥È¡¼¥ë¥Ç¥£¥ì¥¯¥È¥ê¤òÀ¸À®¤·¤Æ¤¯¤À¤µ¤¤:
-
-@example
-shell> gunzip < mysql-VERSION-OS.tar.gz | tar xvf -
-shell> ln -s mysql-VERSION-OS mysql
-@end example
-
-ºÇ½é¤Î¥³¥Þ¥ó¥É¤Ï @file{mysql-VERSION-OS} ¤È¤¤¤¦Ì¾Á°¤Î¥Ç¥£¥ì¥¯¥È¥ê¤òÀ¸À®
-¤·¤Þ¤¹¡£ÆóÈÖÌܤΥ³¥Þ¥ó¥É¤Ï¤½¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òºîÀ®¤·¤Þ
-¤¹¡£¤³¤ì¤Ï¥¤¥ó¥¹¥È¡¼¥ë¥Ç¥£¥ì¥¯¥È¥ê¤ò @file{/usr/local/mysql} ¤È¤·¤Æ¡¢¤è
-¤ê´Êñ¤Ë»²¾È¤µ¤»¤ë¤¿¤á¤Ç¤¹¡£
-
-@item
-¥¤¥ó¥¹¥È¡¼¥ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë°Ü¤Ã¤Æ¤¯¤À¤µ¤¤:
-
-@example
-shell> cd mysql
-@end example
-
-¤¤¤¯¤Ä¤«¤Î¥Õ¥¡¥¤¥ë¤È¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤¬ @code{mysql} ¥Ç¥£¥ì¥¯¥È¥êÃæ¤Ë¸«¤Ä
-¤±¤é¤ì¤Þ¤¹¡£¥¤¥ó¥¹¥È¡¼¥ëÌÜŪ¤ÎºÇ¤â½ÅÍפʤâ¤Î¤Ï @file{bin} ¤È
-@file{scripts} ¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¹¡£
-
-@table @file
-@item bin
-@tindex PATH environment variable
-@tindex Environment variable, PATH
-¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤È¥µ¡¼¥Ð¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£¥·¥§¥ë¤¬
-@strong{MySQL} ¥×¥í¥°¥é¥à¤òÀµ¤·¤¯¸«¤Ä¤±¤é¤ì¤ë¤è¤¦¤Ë¡¢¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î
-¥Õ¥ë¥Ñ¥¹Ì¾¤ò¤¢¤Ê¤¿¤Î @code{PATH} ´Ä¶­ÊÑ¿ô¤ËÄɲ乤٤­¤Ç¤¹¡£@xref{Environment variables}.
-
-@item scripts
-¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï @code{mysql_install_db} ¥¹¥¯¥ê¥×¥È¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£¤³
-¤ì¤Ï¥µ¡¼¥Ð¥¢¥¯¥»¥¹¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò½é´ü²½¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£
-@end table
-
-@item
-@code{mysqlaccess} ¤ò»ÈÍѤ·¡¢¤«¤Ä @strong{MySQL} ÇÛÉÛ¤òÈóɸ½à¤Î¾ì½ê¤Ë»ý
-¤Á¤¿¤¤¾ì¹ç¤Ï¡¢@code{mysqlaccess} ¤¬ @code{mysql} ¥¯¥é¥¤¥¢¥ó¥È¤ò¸«¤Ä¤±¤è
-¤¦¤È¤¹¤ë¾ì½ê¤òÊѹ¹¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£@file{bin/mysqlaccess} ¥¹¥¯¥ê¥×¥È
-¤Î 18 ¹ÔÌÜÉÕ¶á¤òÊÔ½¸¤·¤Æ¤¯¤À¤µ¤¤¡£¼¡¤Î¤è¤¦¤Ê¹Ô¤òõ¤·¤Æ¤¯¤À¤µ¤¤:
-
-@example
-$MYSQL = '/usr/local/bin/mysql'; # path to mysql executable
-@end example
-
-¥Ñ¥¹¤ò @code{mysql} ¤¬¼ÂºÝ¤Ë¥·¥¹¥Æ¥à¾å¤Ë¤ª¤«¤ì¤Æ¤¤¤ë¾ì½ê¤ò¼¨¤¹¤è¤¦¤ËÊѹ¹
-¤·¤Æ¤¯¤À¤µ¤¤¡£¤³¤ì¤ò¹Ô¤Ê¤ï¤Ê¤¤¤È¡¢@code{mysqlaccess} ¼Â¹Ô»þ¤Ë
-@code{broken pipe} ¥¨¥é¡¼¤Ë¤Ê¤ë¤Ç¤·¤ç¤¦¡£
-
-@item
-@strong{MySQL} µö²Ä¥Æ¡¼¥Ö¥ë¤òºîÀ®¤·¤Þ¤¹
- (¤³¤ì¤Ï½é¤á¤Æ @strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤È¤­¤À¤±¹Ô¤¤¤Þ¤¹):
-@example
-shell> scripts/mysql_install_db
-@end example
-
-3.22.10°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Î @strong{MySQL} ¤Ï¡¢@code{mysql_install_db}. ¼Â¹Ô»þ¤Ë
-@strong{MySQL} ¤òµ¯Æ°¤·¤Æ¤¤¤Þ¤·¤¿¤¬¡¢¤â¤Ï¤ä¤³¤ì¤Ïµ¯Æ°¤·¤Ê¤¯¤Ê¤ê¤Þ¤·¤¿
-
-@item
-Perl @code{DBI}/@code{DBD} ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î¥µ¥Ý¡¼¥È¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¤¤
-¾ì¹ç¡¢@ref{Perl support} ¤ò¸«¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-@strong{MySQL} ¤ò¥Þ¥·¥óµ¯Æ°»þ¤Ë¼«Æ°Åª¤Ë³«»Ï¤·¤¿¤¤¾ì¹ç¡¢
-@code{support-files/mysql.server} ¤ò¥·¥¹¥Æ¥à¤Î¥¹¥¿¡¼¥È¥¢¥Ã¥×¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¾ì½ê¤Ë¥³
-¥Ô¡¼¤·¤Æ¤¯¤À¤µ¤¤¡£¤µ¤é¤Ê¤ë¾ðÊó¤Ï @code{support-files/mysql.server} ¥¹¥¯¥ê¥×¥È¼«¿È
-¤ÎÃæ¤È¡¢@ref{Automatic start} ¤Ë¸«¤Ä¤±¤é¤ì¤Þ¤¹¡£
-@end enumerate
-
-Á´¤Æ¤¬¥¢¥ó¥Ñ¥Ã¥¯¤µ¤ì¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¸å¡¢ÇÛÉۤνé´ü²½¤È¥Æ¥¹¥È¤ò¹Ô¤Ê¤¦
-¤Ù¤­¤Ç¤¹¡£
-
-@strong{MySQL} ¥µ¡¼¥Ð¡¼¤Ï°Ê²¼¤Î¥³¥Þ¥ó¥É¤Ç³«»Ï¤Ç¤­¤Þ¤¹¡§
-
-@example
-shell> bin/safe_mysqld &
-@end example
-
-@xref{Post-installation}.
-
-@cindex RPM
-@cindex RedHat Package Manager
-@c This node name is special
-@node Linux-RPM, Building clients, Installing binary, Installing binary
-@subsection Linux RPM notes
-
-¡ÊÌõÃí¡§¤â¤· RedHat °Ê³°¤Î Linux ¤ò»ÈÍѤ·¤Æ¤ª¤ê¡¢.rpm ¤ò¡¢¼«Ê¬¤¬»ÈÍѤ·¤Æ¤¤¤ë
-¥Ñ¥Ã¥±¡¼¥¸´ÉÍý¥·¥¹¥Æ¥à¤Î´ÉÍý²¼¤Ë¤ª¤­¤¿¤¤¾ì¹ç¡¢@strong{alien : http://kitenet.net/programs/alien/} ¤È¤¤¤¦¥Ä¡¼¥ë¤ò
-»ÈÍѤ·¤Þ¤¹¡£¤³¤ì¤Ï RPM(Debian, Slackware) ¤ò¼«Ê¬¤¬»ÈÍѤ·¤Æ¤¤¤ë¥Ñ¥Ã¥±¡¼¥¸¤Î·Á¼°¤ËÊÑ´¹¤·¤Æ¤¯¤ì¤Þ¤¹¡£
-¡Ë
-
-RPM ¤ò»ÈÍѤ·¤Æ @strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤³¤È¤ò¿ä¾©¤·¤Þ¤¹¡£
-@strong{MySQL} RPMS ¤Ï RedHat 5.2 ¤ÇºîÀ®¤·¤Æ¤¤¤Þ¤¹¤¬¡¢
-¾¤Î @code{rpm} ¤È @code{glibc} ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë Linux ¤Ç¤âÆ°ºî¤¹¤ë¤Ç¤·¤ç¤¦¡£
-
-RPM file ¤Ç¤ÎÌäÂê, Î㤨¤Ð @code{Sorry, the host
-'xxxx' could not be looked up} ¤Ï¡¢see @ref{Binary notes-Linux}.
-
-°Ê²¼¤¬»ÈÍѤ¹¤ë¤Ç¤¢¤í¤¦ RPM files ¤Ç¤¹:
-
-@itemize @bullet
-@item @code{MySQL-VERSION.i386.rpm}
-
-@strong{MySQL} ¥µ¡¼¥Ð¡¼¡£
-¤¿¤Àñ¤Ë¾¤Î¥Þ¥·¥ó¾å¤ÇÁö¤Ã¤Æ¤¤¤ë @strong{MySQL} ¥µ¡¼¥Ð¡¼¤ËÀܳ¤¹¤ë¤À¤±¤Ê¤é¡¢
-¤³¤ì¤ÏÉÔÍפǤ·¤ç¤¦¡£
-
-@item @code{MySQL-client-VERSION.i386.rpm}
-
-@strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥Èɸ½à¥×¥í¥°¥é¥à¡£
-¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ï¤Û¤È¤ó¤É¤Î¾ì¹ç¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤³¤È¤Ë¤Ê¤ë¤Ç¤·¤ç¤¦¡£
-
-@item @code{MySQL-bench-VERSION.i386.rpm}
-
-¥Ù¥ó¥Á¥Þ¡¼¥¯¡£perl msql-mysql-modules RPM ¤¬É¬Íס£
-
-@item @code{MySQL-devel-VERSION.i386.rpm}
-
-¾¤Î @strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È(perl¥â¥¸¥å¡¼¥ë¤Î¤è¤¦¤Ê)¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤Î¤ËɬÍפÊ
-¥é¥¤¥Ö¥é¥ê¡¼¤È¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤ò´Þ¤ß¤Þ¤¹¡£
-
-@item @code{MySQL-VERSION.src.rpm}
-
-¾åµ­Á´¤Æ¤Î¥½¡¼¥¹¡£¤³¤ì¤Ï¾¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ãÍÑ¤Ë RPM ¤òºîÀ®¤¹¤ë¾ì¹ç¤Ë¤Î¤ßɬÍפǤ·¤ç¤¦¡£
-(Î㤨¤Ð Alpha or SPARC).
-@end itemize
-
-RPM ¥Ñ¥Ã¥±¡¼¥¸¤Ë´Þ¤Þ¤ì¤ë¥Õ¥¡¥¤¥ë¤ò¤ß¤ë¤Ë¤Ï:
-@example
-shell> rpm -qpl MySQL-VERSION.i386.rpm
-@end example
-
-¥¤¥ó¥¹¥È¡¼¥ë¤ÎºÇ¾®¤ÎÊýË¡¡§
-
-@example
-shell> rpm -i MySQL-VERSION.i386.rpm MySQL-client-VERSION.i386.rpm
-@end example
-
-¥¯¥é¥¤¥¢¥ó¥È¥Ñ¥Ã¥±¡¼¥¸¤À¤±¤ò¥¤¥ó¥¹¥È¡¼¥ë¡§
-
-@example
-shell> rpm -i MySQL-client-VERSION.i386.rpm
-@end example
-
-RPM ¤Ï¥Ç¡¼¥¿¤ò @file{/var/lib/mysql} ¤ËÊݸ¤·¤Þ¤¹¡£
-RPM ¤Ïµ¯Æ°»þ¤Ë¥µ¡¼¥Ð¡¼¤òΩ¤Á¤¢¤²¤ë¤è¤¦¤Ë¡¢@file{/etc/rc.d/} ¤ËÅÐÏ¿¤·¤Þ¤¹¡£
-(This means that if you have performed a previous
-installation, you may want to make a copy of your previously-installed
-@strong{MySQL} startup file if you made any changes to it, so you don't lose
-your changes.)
-
-After installing the RPM file(s), the @file{mysqld} daemon should be running
-and you should now be able to start using @strong{MySQL}.
-@xref{Post-installation}.
-
-If something goes wrong, can find more information in the binary
-installation chapter. @xref{Installing binary}.
-
-@cindex Client programs, building
-@cindex Linking
-@node Building clients, Binary install system issues, Linux-RPM, Installing binary
-@subsection ¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤Î¥Ó¥ë¥É
-
-¼«Ê¬¤Ç½ñ¤¤¤¿¤«¡¢Âè»°¼Ô¤¬ºîÀ®¤·¤¿ @strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¾ì¹ç¡¢
-@code{-lmysqlclient} ¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ·¤Æ¥ê¥ó¥¯¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-¤Þ¤¿ @code{-L} ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æ¡¢¥é¥¤¥Ö¥é¥ê¤¬¤É¤³¤Ë¤¢¤ë¤«»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¾ì¹ç¤â¤¢¤ê¤Þ¤¹¡£
-Î㤨¤Ð¥é¥¤¥Ö¥é¥ê¤¬ @file{/usr/local/mysql/lib} ¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤ë¤Ê¤é¤Ð¡¢
-¥ê¥ó¥¯¤Î»þ¤Ë @code{-L/usr/local/mysql/lib -lmysqlclient} ¤È»ØÄꤷ¤Þ¤¹¡£
-
-@strong{MySQL} ¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ¹¤ë¥¯¥é¥¤¥¢¥ó¥È¤Î¤¿¤á¤Ë¡¢
-¤¢¤Ê¤¿¤¬¤½¤ì¤é¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë»þ¤Ë¤Ï¡¢@code{-I} ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤»ö¤â¤¢¤ê¤Þ¤¹¡£
-(Î㤨¤Ð, @code{-I/usr/local/mysql/include})
-
-
-@node Binary install system issues, , Building clients, Installing binary
-@subsection System ÆÃÍ­¤ÎÌäÂê
-
-@menu
-* Binary notes-Linux:: Linux notes
-* Binary notes-HP-UX:: HP-UX notes
-@end menu
-
-°Ê²¼¤Î¥»¥¯¥·¥ç¥ó¤Ç¤ÏÆÃÄê¤Î¥·¥¹¥Æ¥à¾å¤Ëµ¯¤³¤ë¤Èǧ¤á¤é¤ì¤¿¤¤¤¯¤Ä¤«¤ÎÌäÂê¤Î¤ò¼¨¤·¤Þ¤¹¡£
-
-@node Binary notes-Linux, Binary notes-HP-UX, Binary install system issues, Binary install system issues
-@subsubsection Linux notes
-
-TcX ¤Î¥Ð¥¤¥Ê¥ê¥ê¥ê¡¼¥¹¤Ï @code{-static} ¤Ç¥ê¥ó¥¯¤µ¤ì¤Æ¤ª¤ê¡¢¤³¤ì¤Ï¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à¤¬
-¤É¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¥é¥¤¥Ö¥é¥ê¡¼¤ò»ÈÍѤ·¤Æ¤¤¤ë¤«µ¤¤Ë¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤»¤ó¡£
-¤è¤Ã¤Æ¡¢LinuxThreads ¤â¤³¤Î¾ì¹çɬÍפ¢¤ê¤Þ¤»¤ó¡£
-@code{-static} ¤Ç¥ê¥ó¥¯¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Î¥µ¥¤¥º¤Ï
-¥À¥¤¥Ê¥ß¥Ã¥¯¥ê¥ó¥¯¤µ¤ì¤¿¥×¥í¥°¥é¥à¤è¤êÂ礭¤¯¤Ê¤ê¤Þ¤¹¤¬¡¢¾¯¤·(3-5%)®¤¯¤Ê¤ê¤Þ¤¹¡£
-¤·¤«¤·°ì¤Ä¤ÎÌäÂê¤È¤·¤Æ¡¢¤³¤Î¥¹¥¿¥Æ¥£¥Ã¥¯¥ê¥ó¥¯¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Ç¤Ï¡¢
-¥æ¡¼¥¶¡¼ÄêµÁ´Ø¿ô(UDF)¤¬»ÈÍѤǤ­¤Ê¤¤¤³¤È¤Ç¤¹¡£
-¤â¤· UDF ¤ò»ÈÍѤ¹¤ë(½ñ¤¯)¾ì¹ç(C, C++¤È¤«¤Ç)¡¢¼«Ê¬¼«¿È¤Ç @strong{MySQL} ¤ò
-¥À¥¤¥Ê¥ß¥Ã¥¯¥ê¥ó¥¯¤ò»ÈÍѤ·¤Æ¥³¥ó¥Ñ¥¤¥ë¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-
-¤â¤· @code{glibc2} ¤Ç¤Ï¤Ê¤¯ libc5 ¤Î¥·¥¹¥Æ¥à¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Ê¤é¡¢
-¤³¤Î¥Ð¥¤¥Ê¥ê¥ê¥ê¡¼¥¹¤Ç¤Ï¥Û¥¹¥È̾²ò·è¤Ègetpwnam()¤Ë¤¤¤¯¤Ä¤«ÌäÂ꤬½Ð¤Þ¤¹¡£
-(¤³¤ì¤Ï @code{glibc} ¤¬¥Û¥¹¥È̾²ò·è¤Ègetwpent()¤Ë¤¤¤¯¤Ä¤«¤Î³°Éô¥é¥¤¥Ö¥é¥ê¤Ë
-°Í¸¤·¤Æ¤¤¤ë¤¿¤á¤Ç¡¢¤¿¤È¤¨ @code{-static} ¥ê¥ó¥¯¤·¤Æ¤â²ò·è¤·¤Þ¤»¤ó).
-¤³¤Î¾ì¹ç¡¢@code{mysql_install_db} ¼Â¹Ô»þ¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬½Ð¤ë¤Ç¤·¤ç¤¦¡§
-
-@example
-Sorry, the host 'xxxx' could not be looked up
-@end example
-
-¤¢¤ë¤¤¤Ï¡¢@code{--user} ¥ª¥×¥·¥ç¥ó¤Ç mysqld ¤òµ¯Æ°¤·¤è¤¦¤È¤·¤¿¤È¤­¡¢
-°Ê²¼¤Î¥¨¥é¡¼¤¬½Ð¤ë¾ì¹ç¡§
-
-@example
-getpwnam: No such file or directory
-@end example
-
-¤³¤ÎÌäÂê¤Ï¡¢°Ê²¼¤Î¤¦¤Á¤Î¤É¤ì¤«¤ÎÊýË¡¤Ç²ò·è¤Ç¤­¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-@strong{MySQL} ¥½¡¼¥¹ÇÛÉÛ¤òÆþ¼ê¤·( RPM ¤« @code{tar} )¡¢Âå¤ï¤ê¤Ë
-¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¡£
-
-@item
-@code{mysql_install_db --force} ¤ò¼Â¹Ô¤·¤Þ¤¹; ¤³¤ì¤Ï @code{mysql_install_db} ¤Ë
-¤«¤«¤ì¤Æ¤¤¤ë @code{resolveip} ¥Æ¥¹¥È¤ò¼Â¹Ô¤·¤Þ¤»¤ó¡£
-¤Þ¤¿µö²Ä¥Æ¡¼¥Ö¥ëÆâ¤Ç¥Û¥¹¥È̾¤¬»È¤¨¤Ê¤¯¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡¨
-¥Û¥¹¥È̾¤Ç¤Ê¤¯ IP ¥¢¥É¥ì¥¹¤ÇÅÐÏ¿¤·¤Þ¤¹ (@code{localhost} ¤Ï½ü).
-¤â¤· @code{--force} ¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¤è¤¦¤Ê¸Å¤¤ @strong{MySQL} ¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Ê¤é¡¢
-¥¨¥Ç¥£¥¿¡¼¤Ç¡¢@code{resolveip} ¥Æ¥¹¥È¤ò @code{mysql_install} ¤«¤éºï½ü¤·¤Þ¤¹¡£
-@item
-mysqld ¤ò @code{--user} ¤ÎÂå¤ï¤ê¤Ë @code{su} ¤Çµ¯Æ°¡£
-@end itemize
-
-Linux-Intel binary ¤È @strong{MySQL} RPM ¥ê¥ê¡¼¥¹¤Ï¡¢¤â¤Ã¤È¤â®¤¯¤Ê¤ë¤è¤¦¤Ë
-Ä´À°¤µ¤ì¤Æ¤¤¤Þ¤¹¡£²æ¡¹¤Ï¤â¤Ã¤È¤âÁ᤯°ÂÄꤷ¤¿¥³¥ó¥Ñ¥¤¥é¡¼¤ò¾ï¤Ë»ÈÍѤ·¤Æ¤¤¤Þ¤¹¡£
-
-
-@node Binary notes-HP-UX, , Binary notes-Linux, Binary install system issues
-@subsubsection HP-UX notes
-
-Some of the binary distributions of @strong{MySQL} for HP-UX is
-distributed as an HP depot file and as a tar file. To use the depot
-file you must be running at least HP-UX 10.x to have access to HP's
-software depot tools.
-
-The HP version of @strong{MySQL} was compiled on an HP 9000/8xx server
-under HP-UX 10.20, and uses MIT-pthreads. It is known to work
-well under this configuration.
-@strong{MySQL} 3.22.26 and newer can also be built with HP's native
-thread package.
-
-Other configurations that may work:
-
-@itemize @bullet
-@item
-HP 9000/7xx running HP-UX 10.20+
-@item
-HP 9000/8xx running HP-UX 10.30
-@end itemize
-
-The following configurations almost definitely won't work:
-
-@itemize @bullet
-@item
-HP 9000/7xx or 8xx running HP-UX 10.x where x < 2
-@item
-HP 9000/7xx or 8xx running HP-UX 9.x
-@end itemize
-
-To install the distribution, use one of the
-commands below, where @code{/path/to/depot} is the full path to the depot file:
-
-@itemize @bullet
-@item
-To install everything, including the server, client and development tools:
-
-@example
-shell> /usr/sbin/swinstall -s /path/to/depot mysql.full
-@end example
-
-@item
-To install only the server:
-
-@example
-shell> /usr/sbin/swinstall -s /path/to/depot mysql.server
-@end example
-
-@item
-To install only the client package:
-
-@example
-shell> /usr/sbin/swinstall -s /path/to/depot mysql.client
-@end example
-
-@item
-To install only the development tools:
-
-@example
-shell> /usr/sbin/swinstall -s /path/to/depot mysql.developer
-@end example
-@end itemize
-
-The depot places binaries and libraries in @file{/opt/mysql} and data in
-@file{/var/opt/mysql}. The depot also creates the appropriate entries in
-@file{/sbin/init.d} and @file{/sbin/rc2.d} to start the server automatically
-at boot time. Obviously, this entails being @code{root} to install.
-
-To install the HP-UX tar distribution, you must have a copy of GNU @code{tar}.
-
-@node Installing source, Compilation problems, Installing binary, Installing
-@section @strong{MySQL} ¥½¡¼¥¹ÇÛÉۤΥ¤¥ó¥¹¥È¡¼¥ë
-
-¥½¡¼¥¹¤«¤é @strong{MySQL} ¤òºîÀ®¤·¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤¿¤á¤Ë¤Ï¼¡¤Î¥Ä¡¼¥ë¤¬É¬
-ÍפǤ¹:
-
-@itemize @bullet
-@item
-GNU @code{gunzip}¡£ÇÛÉۤο­Ä¥¤Î¤¿¤á¡£
-
-@item
-ŬÀµ¤Ê @code{tar}¡£ÇÛÉۤΟ³«¤Î¤¿¤á¡£GNU @code{tar} ¤ÏÆ°¤¯¤³¤È¤¬ÃΤé¤ì¤Æ
-¤¤¤Þ¤¹¡£
-
-@item
-ANSI C++ ¥³¥ó¥Ñ¥¤¥é¡£@code{gcc} >= 2.8.1, @code{egcs} >= 1.0.2, SGI C++,
-SunPro C++ ¤ÏƯ¤¯¤³¤È¤¬ÃΤé¤ì¤Æ¤¤¤ë¥³¥ó¥Ñ¥¤¥é¤Î¤¤¤¯¤Ä¤«¤Ç¤¹¡£
-@code{libg++} ¤Ï @code{gcc} »ÈÍÑ»þ¤Ë¤ÏɬÍפǤϤ¢¤ê¤Þ¤»¤ó¡£@code{gcc}
-2.7.x ¤Ï¡¢@file{sql/sql_base.cc} ¤Î¤è¤¦¤Ê¡¢´°Á´¤ËÀµÅö¤Ê C++ ¥Õ¥¡¥¤¥ë¤Î¤¤
-¤¯¤Ä¤«¤ò¥³¥ó¥Ñ¥¤¥ë¤Ç¤­¤Ê¤¤¤È¤¤¤¦¥Ð¥°¤¬¤¢¤ê¤Þ¤¹¡£@code{gcc} 2.7.x ¤À¤±¤·
-¤«¤Ê¤±¤ì¤Ð¡¢@strong{MySQL} ¤ò¥³¥ó¥Ñ¥¤¥ë¤Ç¤­¤ë¤è¤¦¤Ë @code{gcc} ¤ò¥¢¥Ã¥×
-¥°¥ì¡¼¥É¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-@item
-Îɤ¤ @code{make} ¥×¥í¥°¥é¥à¡£GNU @code{make} ¤Ï¾ï¤Ë¿ä¾©¤µ¤ì¡¢»þ¡¹¤ÏɬÍ×
-¤È¤µ¤ì¤Þ¤¹¡£ÌäÂ꤬¤¢¤ì¤Ð GNU @code{make} 3.75 °Ê¾å¤ò»î¤¹¤³¤È¤ò¤ª´«¤á¤·¤Þ
-¤¹¡£
-@end itemize
-
-@c texi2html fails to split chapters if I use strong for all of this.
-ÌäÂ꤬µ¯¤­¤¿¤È¤­¤Ï¡¢@email{mysql@@lists.mysql.com} ¤Ë¼ÁÌä¤òÅê¹Æ¤¹¤ë»þ¤Ë
-@strong{@code{mysqlbug} ¤ò¾ï¤Ë»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤}¡£ÌäÂ꤬¥Ð¥°¤Ç¤Ê¤¤¤È¤·¤Æ
-¤â¡¢@code{mysqlbug} ¤Ï¤¢¤Ê¤¿¤ÎÌäÂê¤ò²ò·è¤¹¤ë½õ¤±¤Ë¤Ê¤ë¤Ç¤¢¤í¤¦¥·¥¹¥Æ¥à¾ð
-Êó¤ò¼ý½¸¤·¤Þ¤¹¡£@code{mysqlbug} ¤ò»ÈÍѤ·¤Ê¤¤¤È¡¢¤¢¤Ê¤¿¤ÎÌäÂê¤Î²ò·è¤òÆÀ¤ë
-²ÄǽÀ­¤¬¾®¤µ¤¯¤Ê¤ê¤Þ¤¹¡ª @code{mysqlbug} ¤Ï¡¢ÇÛÉۤΥ¢¥ó¥Ñ¥Ã¥¯¸å¤Ë
-@file{scripts} ¥Ç¥£¥ì¥¯¥È¥êÆâ¤Ë¸«¤Ä¤±¤é¤ì¤Þ¤¹¡£@xref{Bug reports}¡£
-
-@menu
-* Quick install:: ÁÇÁᤤ¥¤¥ó¥¹¥È¡¼¥ë¤Î³µÍ×
-* Applying patches:: ¥Ñ¥Ã¥Á¤ÎŬÍÑ
-* configure options:: ŵ·¿Åª¤Ê @code{configure} ¥ª¥×¥·¥ç¥ó
-@end menu
-
-@node Quick install, Applying patches, Installing source, Installing source
-@subsection ÁÇÁᤤ¥¤¥ó¥¹¥È¡¼¥ë¤Î³µÍ×
-
-@strong{MySQL} ¤ò¥½¡¼¥¹¤«¤é¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤¿¤á¤Ë¹Ô¤Ê¤ï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤
-´ðËÜŪ¤Ê¥³¥Þ¥ó¥É(from an unpacked @code{tar} file):
-
-@example
-shell> ./configure
-shell> make
-shell> make install
-shell> scripts/mysql_install_db
-shell> /usr/local/mysql/bin/safe_mysqld &
-@end example
-
-RPM ¥½¡¼¥¹¤«¤é³«»Ï¤¹¤ë¾ì¹ç¤Ï¡§
-
-@example
-shell> rpm --rebuild MySQL-VERSION.src.rpm
-@end example
-
-¤³¤ì¤Ï¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤­¤ëRPM¥Ð¥¤¥Ê¥ê¤òºîÀ®¤·¤Þ¤¹
-
-¤â¤· @code{DBI} ¤È @code{Msql-Mysql-modules} Perl ¥â¥¸¥å¡¼¥ë¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤Ê¤é¡¢
-@code{bin/mysql_setpermission} ¥¹¥¯¥ê¥×¥È¤¬»ÈÍѤ¹¤ë¿·¤·¤¤¥æ¡¼¥¶¡¼¤ò
-Äɲ乤뤳¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-¼¡¤Ë¤µ¤é¤Ë¾ÜºÙ¤ÊÀâÌÀ¤ò¹Ô¤Ê¤¤¤Þ¤¹:
-
-¥½¡¼¥¹ÇÛÉۤΥ¤¥ó¥¹¥È¡¼¥ë¤Ë¤Ï¡¢¼¡¤Î¥¹¥Æ¥Ã¥×¤Ë½¾¤¤¡¢¤½¤ì¤«¤é ¥¤¥ó¥¹¥È¡¼¥ë
-¸å¤Î½é´ü²½¤È¥Æ¥¹¥È¤Î¤¿¤á¤Ë @xref{Post-installation} ¤Ë¿Ê¤ó¤Ç¤¯¤À¤µ¤¤¡£
-
-@enumerate
-@item
-ÇÛÉÛ¤ò¥¢¥ó¥Ñ¥Ã¥¯¤·¤¿¤¤¥Ç¥£¥ì¥¯¥È¥ê¤òÁª¤ó¤Ç¡¢¤½¤³¤Ë°Ü¤Ã¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-ÇÛÉÛ¥Õ¥¡¥¤¥ë¤ò @ref{Getting MySQL, , Getting @strong{MySQL}}. ¤Ë¥ê¥¹¥È¤µ¤ì¤¿¥µ¥¤¥È¤Î°ì¤Ä¤«¤éÆÀ¤Æ¤¯¤À¤µ¤¤¡£
-
-@strong{MySQL} ¥½¡¼¥¹ÇÛÉۤϰµ½Ì¤µ¤ì¤¿ @code{tar} ¥¢¡¼¥«¥¤¥Ö¤È¤·¤ÆÄ󶡤µ
-¤ì¡¢@file{mysql-VERSION.tar.gz} ¤Î¤è¤¦¤Ê̾Á°¤ò»ý¤Á¤Þ¤¹¡£¤³¤³¤Ç
-@code{VERSION} ¤Ï @value{mysql_version} ¤Î¤è¤¦¤ÊÈÖ¹æ¤Ç¤¹¡£
-
-@item
-¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤ËÇÛÉÛ¤ò¥¢¥ó¥Ñ¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤:
-@example
-shell> gunzip < mysql-VERSION.tar.gz | tar xvf -
-@end example
-¤³¤Î¥³¥Þ¥ó¥É¤Ï @file{mysql-VERSION} ¤È¤¤¤¦Ì¾Á°¤Î¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·¤Þ¤¹¡£
-
-@item
-¥¢¥ó¥Ñ¥Ã¥¯¤µ¤ì¤¿ÇÛÉۤΥȥåץì¥Ù¥ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë°Ü¤Ã¤Æ¤¯¤À¤µ¤¤:
-@example
-shell> cd mysql-VERSION
-@end example
-
-@item
-¥ê¥ê¡¼¥¹¤ò configure ¤·¡¢Á´¤Æ¤ò¥³¥ó¥Ñ¥¤¥ë¤·¤Æ¤¯¤À¤µ¤¤:
-@example
-shell> ./configure --prefix=/usr/local/mysql
-shell> make
-@end example
-@code{configure} ¤Î¼Â¹Ô»þ¡¢¤¤¤¯¤Ä¤«¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄê¤Ç¤­¤Þ¤¹¡£¥ª¥×¥·¥ç
-¥ó¤Î°ìÍ÷¤Ï @code{./configure --help} ¤ò¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£@ref{configure
-options, , @code{configure} options}, ¤µ¤é¤ËÍ­ÍѤʥª¥×¥·¥ç¥ó¤Î¤¤¤¯¤Ä¤«¤Ë
-¤Ä¤¤¤ÆµÄÏÀ¤·¤Æ¤¤¤Þ¤¹¡£
-
-@code{configure} ¤¬¼ºÇÔ¤·¤Æ¡¢±ç½õ¤òÆÀ¤ë¤¿¤á¤Ë @email{mysql@@lists.mysql.com} ¤Ë¥á¡¼
-¥ë¤òÁ÷¤í¤¦¤È¤¹¤ë¾ì¹ç¡¢@file{config.log} ¤«¤éÌäÂê¤Î²ò·è¤Î¼ê½õ¤±¤Ë¤Ç¤­¤ë¤È
-¹Í¤¨¤é¤ì¤ë¹Ô¤ò´Þ¤á¤Æ¤¯¤À¤µ¤¤¡£@code{configure} ¤¬°Û¾ï½ªÎ»¤¹¤ë¾ì¹ç¡¢
-@code{configure} ¤«¤é¤Î½ÐÎϤκǸå¤Î¿ô¹Ô¤â´Þ¤á¤Æ¤¯¤À¤µ¤¤¡£¥Ð¥°¥ì¥Ý¡¼¥È¤Ï
-@code{mysqlbug} ¥¹¥¯¥ê¥×¥È¤ò»ÈÍѤ·¤ÆÅê¹Æ¤·¤Æ¤¯¤À¤µ¤¤¡£@xref{Bug reports}¡£
-
-¥³¥ó¥Ñ¥¤¥ë¤¬¼ºÇÔ¤¹¤ë¾ì¹ç¡¢¤¤¤¯¤é¤«¤Î¤è¤¯¤¢¤ëÌäÂê¤Ç¤Î¼ê½õ¤±¤Î¤¿¤á¡¢
-@ref{Compilation problems} ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-Á´¤Æ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤¯¤À¤µ¤¤:
-@example
-shell> make install
-@end example
-¤³¤Î¥³¥Þ¥ó¥É¤Ï @code{root} ¤È¤·¤Æ¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-@item
-@strong{MySQL} ¸¢¸Â¥Æ¡¼¥Ö¥ë¤òÀ¸À®¤·¤Æ¤¯¤À¤µ¤¤(°ÊÁ°¤Ë @strong{MySQL} ¤ò¥¤
-¥ó¥¹¥È¡¼¥ë¤·¤Æ¤¤¤Ê¤¤»þ¤Ë¤À¤±É¬ÍפǤ¹):
-@example
-shell> scripts/mysql_install_db
-@end example
-
-Ãí°Õ: 3.22.10 ¤è¤ê¸Å¤¤ @strong{MySQL} ¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢
-@code{mysql_install_db} ¼Â¹Ô»þ¤Ë @strong{MySQL} ¥µ¡¼¥Ð¤¬³«»Ï¤µ¤ì¤Þ¤·¤¿¤¬¡¢
-¤³¤ì¤Ï¤â¤Ï¤ä¿¿¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡ª
-
-@item
-Perl @code{DBI}/@code{DBD} ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î¥µ¥Ý¡¼¥È¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¤¤
-¾ì¹ç¡¢@ref{Perl support} ¤ò¸«¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-@strong{MySQL} ¤ò¥Þ¥·¥óµ¯Æ°»þ¤Ë¼«Æ°Åª¤Ë³«»Ï¤·¤¿¤¤¾ì¹ç¡¢
-@code{support-files/mysql.server} ¤ò¥·¥¹¥Æ¥à¤Î¥¹¥¿¡¼¥È¥¢¥Ã¥×¥Õ¥¡¥¤¥ë¤¬¤¢
-¤ë¾ì½ê¤Ë¥³¥Ô¡¼¤·¤Æ¤¯¤À¤µ¤¤¡£¤µ¤é¤Ê¤ë¾ðÊó¤Ï
-@code{support-files/mysql.server} ¥¹¥¯¥ê¥×¥È¼«¿È¤ÎÃæ¤È¡¢@ref{Automatic
-start} ¤Ë¸«¤Ä¤±¤é¤ì¤Þ¤¹¡£
-@end enumerate
-
-Á´¤Æ¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¸å¡¢ÇÛÉۤνé´ü²½¤È¥Æ¥¹¥È¤ò¹Ô¤Ê¤¦¤Ù¤­¤Ç¤¹¡£
-
-@strong{MySQL} ¥µ¡¼¥Ð¡¼¤ò°Ê²¼¤Î¥³¥Þ¥ó¥É¤Ç³«»Ï¤Ç¤­¤Þ¤¹¡£
-@code{BINDIR} ¤Ï @code{safe_mysqld} ¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê
-(@file{/usr/local/bin} by default) ¤Ç¤¹:
-
-@example
-shell> BINDIR/safe_mysqld &
-@end example
-
-¥³¥Þ¥ó¥É¤¬¤¹¤°¤Ë @code{mysqld daemon ended} ¥¨¥é¡¼¤Ç¼ºÇÔ¤¹¤ë¾ì¹ç¡¢
-@file{mysql-data-directory/'hostname'.err} ¥Õ¥¡¥¤¥ë¤Ë¤Ê¤ó¤é¤«¤Î¾ðÊó¤ò
-¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¤è¤¯¤¢¤ë¤³¤È¤È¤·¤Æ¡¢¤¹¤Ç¤Ë¾¤Î @code{mysqld} ¤¬
-Áö¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ê¤É¤¬¤¢¤ê¤Þ¤¹¡£ @xref{Multiple servers}.
-
-@xref{Post-installation}¡£
-
-@node Applying patches, configure options, Quick install, Installing source
-@subsection ¥Ñ¥Ã¥Á¤ÎŬÍÑ
-
-»þ¡¹¡¢¥Ñ¥Ã¥Á¤Ï¡¢¥á¡¼¥ê¥ó¥°¡¦¥ê¥¹¥È¤Ëή¤µ¤ì¤¿¤ê¡¢¤Þ¤¿¤Ï
-@strong{MySQL} FTP¥µ¥¤¥È¤Î @uref{ftp://www.mysql.com/pub/mysql/Downloads/Patches,¥Ñ¥Ã¥Á¥¨¥ê¥¢} ¤ËÃÖ¤«¤ì¤Þ¤¹¡£
-
-¥á¡¼¥ê¥ó¥°¡¦¥ê¥¹¥È¤«¤é¤Î¥Ñ¥Ã¥Á¤òŬÍѤ¹¤ë¤Ë¤Ï¡¢¥Ñ¥Ã¥Á¤¬ºÜ¤Ã¤Æ¤¤¤ë¥á¥Ã¥»¡¼¥¸¤ò
-¥Õ¥¡¥¤¥ë¤ËÊݸ¤·¤Æ¡¢¤¢¤Ê¤¿¤Î @strong{MySQL} ¥½¡¼¥¹¡¦¥Ä¥ê¡¼¤Î
-°ìÈÖ¾å¤Î¥Ç¥£¥ì¥¯¥È¥ê¡¼¤Ë°ÜÆ°¤·¡¢°Ê²¼¤Î¤è¤¦¤Ë¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Þ¤¹¡§
-
-@example
-shell> patch -p1 < patch-file-name
-shell> rm config.cache
-shell> make clean
-@end example
-
-FTP¥µ¥¤¥È¤ËÃÖ¤«¤ì¤ë¥Ñ¥Ã¥Á¤Ï¡¢¥×¥ì¡¼¥ó¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤È¤·¤Æ¡¢
-¤¢¤ë¤¤¤Ï @code{gzip} ¤Ç°µ½Ì¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤È¤·¤ÆÈÒÉÛ¤µ¤ì¤Þ¤¹¡£
-¥×¥ì¡¼¥ó¥Æ¥­¥¹¥È¤Î¥Ñ¥Ã¥Á¤Î¾ì¹ç¤Ï¡¢¾å¤Ë¼¨¤·¤¿¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤Î
-¥Ñ¥Ã¥Á¤ÈƱÍͤËŬÍѤ·¤Þ¤¹¡£ °µ½Ì¤µ¤ì¤¿¥Ñ¥Ã¥Á¤òŬÍѤ¹¤ë¤Ë¤Ï¡¢
- @strong{MySQL} ¥½¡¼¥¹¡¦¥Ä¥ê¡¼¤Î
-°ìÈÖ¾å¤Î¥Ç¥£¥ì¥¯¥È¥ê¡¼¤Ë°ÜÆ°¤·¡¢°Ê²¼¤Î¤è¤¦¤Ë¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Þ¤¹¡§
-
-@example
-shell> gunzip < patch-file-name.gz | patch -p1
-shell> rm config.cache
-shell> make clean
-@end example
-
-¤½¤ì¤«¤éÄ̾ï¤Î¥½¡¼¥¹¥¤¥ó¥¹¥È¡¼¥ë¤Î»Ø¼¨¤ò @code{./configure} ¥¹¥Æ¥Ã¥×¤«¤é
-»Ï¤á¤Þ¤¹¡£@code{make install} ¥¹¥Æ¥Ã¥×¼Â¹Ô¸å¡¢¤¢¤Ê¤¿¤Î @strong{MySQL} ¥µ¡¼
-¥Ð¤òºÆµ¯Æ°¤·¤Þ¤¹¡£
-
-@code{make install} ¤ò¼Â¹Ô¤¹¤ëÁ°¤Ë¡¢¸½ºßÁö¤Ã¤Æ¤¤¤ë¥µ¡¼¥Ð¡¼¤ò»ß¤á¤ëɬÍפ¬¤¢¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-( @code{mysqladmin shutdown} ¤Ç»ß¤á¤Þ¤¹ )
-¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¸½ºß¼Â¹Ô¤·¤Æ¤¤¤ë¤â¤Î¤ò»ß¤á¤Ê¤¤¸Â¤ê¡¢
-¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤ò¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤­¤Ê¤¤¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
-
-
-@node configure options, , Applying patches, Installing source
-@subsection ŵ·¿Åª¤Ê configure ¥ª¥×¥·¥ç¥ó
-
-@code{configure} ¥¹¥¯¥ê¥×¥È¤Ï @strong{MySQL} ÇÛÉÛ¤ò¤É¤Î¤è¤¦¤Ë¥³¥ó¥Õ¥£¥°
-¤¹¤ë¤«¤òÀ©¸æ¤¹¤ë¤¿¤á¤Î¿¤¯¤Î½èÍý¤òÄ󶡤·¤Þ¤¹¡£Åµ·¿Åª¤Ë¤Ï¡¢
-@code{configure} ¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ·¤Æ¤³¤ì¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£
-¤¤¤¯¤Ä¤«¤Î´Ä¶­ÊÑ¿ô¤ò»ÈÍѤ·¤Æ¤â @code{configure} ¤Ë±Æ¶Á¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­
-¤Þ¤¹¡£ @xref{Environment variables}.
- @code{configure} ¤¬¥µ¥Ý¡¼¥È¤¹¤ë¥ª¥×¥·¥ç¥ó¤Î°ìÍ÷¤Ï¡¢¼¡¤Î¥³¥Þ¥ó¥É¤ò
-¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤:
-
-@example
-shell> ./configure --help
-@end example
-
-Îɤ¯»È¤ï¤ì¤ë @code{configure} ¥ª¥×¥·¥ç¥ó¤Î¤¤¤¯¤Ä¤«°Ê²¼¤ËÀâÌÀ¤·¤Þ¤¹:
-
-@itemize @bullet
-@item
-@strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¥é¥¤¥Ö¥é¥ê¤È¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤À¤±¤ò¥³¥ó
-¥Ñ¥¤¥ë¤¹¤ë¤Ë¤Ï¡¢@code{--without-server} ¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤:
-
-@example
-shell> ./configure --without-server
-@end example
-
-C++ ¥³¥ó¥Ñ¥¤¥é¤¬¤Ê¤±¤ì¤Ð¡¢@code{mysql} ¤Ï¥³¥ó¥Ñ¥¤¥ë¤Ç¤­¤Þ¤»¤ó(¤³¤ì¤Ï C++
-¤òÍ׵᤹¤ë¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤Î°ì¤Ä¤Ç¤¹)¡£¤³¤Î¾ì¹ç¡¢@code{configure}
-¤«¤é C++ ¥³¥ó¥Ñ¥¤¥é¤ò¥Æ¥¹¥È¤¹¤ë¥³¡¼¥É¤òºï½ü¤Ç¤Þ¤¹¡£¤½¤ì¤«¤é
-@code{./configure} ¤ò @code{--without-server} ¥ª¥×¥·¥ç¥ó¤Ä¤­¤Ç¼Â¹Ô¤·¤Æ¤¯
-¤À¤µ¤¤¡£¥³¥ó¥Ñ¥¤¥ë¥¹¥Æ¥Ã¥×¤Ï @code{mysql} ¤ÎºîÀ®¤ò»î¤ß¤Þ¤¹¤¬¡¢
-@file{mysql.cc} ¤Ë¤Ä¤¤¤Æ¤Î·Ù¹ð¤Ï̵»ë¤Ç¤­¤Þ¤¹¡£(@code{make} ¤¬»ß¤Þ¤ë¾ì¹ç¡¢
-¥¨¥é¡¼¤¬È¯À¸¤·¤Æ¤â»Ä¤ê¤ÎºîÀ®¤ò·Ñ³¤¹¤ë¤è¤¦¤Ë @code{make -k} ¤ò»î¤·¤Æ¤¯¤À
-¤µ¤¤¡£)
-
-@item
-¥í¥°¥Õ¥¡¥¤¥ë¤È¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤ò @file{/usr/local/var} ÇÛ²¼¤Ë¤ª
-¤­¤¿¤¯¤Ê¤¤¾ì¹ç¤Ï¡¢¼¡¤Î°ì¤Ä¤Î¤è¤¦¤Ê @code{configure} ¥³¥Þ¥ó¥É¤ò»ÈÍѤ·¤Æ¤¯
-¤À¤µ¤¤:
-@example
-shell> ./configure --prefix=/usr/local/mysql
-shell> ./configure --prefix=/usr/local \
- --localstatedir=/usr/local/mysql/data
-@end example
-ºÇ½é¤Î¥³¥Þ¥ó¥É¤Ï¥¤¥ó¥¹¥È¡¼¥ë¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤òÊѹ¹¤·¡¢¥Ç¥Õ¥©¥ë¥È¤Î
-@file{/usr/local} ¤Ç¤Ï¤Ê¤¯ @file{/usr/local/mysql} ÇÛ²¼¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·
-¤Þ¤¹¡£¼¡¤Î¥³¥Þ¥ó¥É¤Ï¥Ç¥Õ¥©¥ë¥È¤Î¥¤¥ó¥¹¥È¡¼¥ë¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤òÊݸ¤·¤Þ¤¹¤¬¡¢
-¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ç¥Õ¥©¥ë¥È°ÌÃÖ(Ä̾ï¤Ï @file{/usr/local/var})¤ò
-¾å½ñ¤­¤·¡¢@code{/usr/local/mysql/data} ¤ËÊѹ¹¤·¤Þ¤¹¡£
-
-@item
-UNIX ¤ò»ÈÍѤ·¤Æ¤¤¤Æ¡¢¥½¥±¥Ã¥È¤Î°ÌÃÖ¤ò¥Ç¥Õ¥©¥ë¥È°ÌÃÖ(Ä̾ï¤Ï @file{/tmp} ¤Þ¤¿¤Ï
-@file{/var/run})¤Ç¤Ê¤¯Â¾¤Î¤É¤³¤«¤Ë¤·¤¿¤¤¾ì¹ç¤Ï¡¢@code{configure} ¥³¥Þ¥ó
-¥É¤ò¼¡¤Î¤è¤¦¤Ë»ÈÍѤ·¤Þ¤¹:
-@example
-shell> ./configure --with-unix-socket-path=/usr/local/mysql/tmp/mysql.sock
-@end example
-¥Õ¥¡¥¤¥ë̾¤ÏÀäÂХѥ¹Ì¾¤Ç¤Ê¤¤¤È¤¤¤±¤Þ¤»¤ó¡£
-
-@item
-ÀÅŪ¥ê¥ó¥¯¤µ¤ì¤¿¥×¥í¥°¥é¥à¤ò¥³¥ó¥Ñ¥¤¥ë¤·¤¿¤¤¾ì¹ç(Î㤨¤Ð¡¢¥Ð¥¤¥Ê¥êÇÛÉÛ¤ò
-ºîÀ®¤¹¤ë¤¿¤á¡¢¤â¤Ã¤È®¤¯¤¹¤ë¤¿¤á¡¢¤¤¤¯¤Ä¤«¤Î RedHat ÇÛÉۤǤÎÌäÂê¤ò²óÈò¤¹
-¤ë¤¿¤á)¤Ï¡¢¼¡¤Î¤è¤¦¤Ë @code{configure} ¤ò¼Â¹Ô¤·¤Þ¤¹:
-
-@example
-shell> ./configure --with-client-ldflags=-all-static \
- --with-mysqld-ldflags=-all-static
-@end example
-
-@item
-@code{gcc} ¤ò»ÈÍѤ·¤Æ¤¤¤Æ¡¢@code{libg++} ¤ä @code{libstdc++} ¤¬¥¤¥ó¥¹¥È¡¼
-¥ë¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢@code{configure} ¤Ë @code{gcc} ¤ò C++ ¥³¥ó¥Ñ¥¤¥é¤È¤·
-¤Æ»ÈÍѤ¹¤ë¤³¤È¤òÅÁ¤¨¤Æ¤¯¤À¤µ¤¤:
-
-@tindex CC environment variable
-@tindex Environment variable, CC
-@tindex CXX environment variable
-@tindex Environment variable, CXX
-@example
-shell> CC=gcc CXX=gcc ./configure
-@end example
-
-@code{gcc} ¤ò C++ ¥³¥ó¥Ñ¥¤¥é¤È¤·¤Æ»ÈÍѤ¹¤ë»þ¡¢@code{libg++} ¤Þ¤¿¤Ï
-@code{libstdc++} ¤Î¥ê¥ó¥¯¤Ï»î¤ß¤Þ¤»¤ó¡£
-
-¥³¥ó¥Ñ¥¤¥é¤ä¥ê¥ó¥«¤¬¶¦Í­¥é¥¤¥Ö¥é¥ê @file{libmysqlclient.so.#} ¤òÀ¸À®¤Ç¤­
-¤Ê¤¤¤È¤¤¤¦¥¨¥é¡¼¤Ë¤Ê¤ë¾ì¹ç¡¢@code{--disable-shared} ¥ª¥×¥·¥ç¥ó¤ò
-@code{configure} ¤ËÍ¿¤¨¤ë¤³¤È¤Ç¡¢¤³¤ÎÌäÂê¤ò²óÈò¤Ç¤­¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢
-@code{configure} ¤Ï¶¦Í­¥é¥¤¥Ö¥é¥ê @code{libmysqlclient.so.#} ¤òºîÀ®¤·¤Þ
-¤»¤ó¡£
-
-@item
-Èó @code{NULL} ¹àÌÜ(¤¹¤Ê¤ï¤Á¡¢@code{NULL} ¤¬µö¤µ¤ì¤Æ¤¤¤Ê¤¤¹àÌÜ)¤Ë
-@code{DEFAULT} ¹àÌÜÃͤò»ÈÍѤ·¤Ê¤¤¤è¤¦¤Ë @strong{MySQL} ¤ò¥³¥ó¥Õ¥£¥°¤Ç¤­
-¤Þ¤¹¡£¤³¤ì¤Ï¡¢Èó @code{NULL} ÃͤòÍ׵᤹¤ëÁ´¤Æ¤Î¹àÌܤËÃͤòÌÀ¼¨Åª¤Ë»ØÄꤷ
-¤Ê¤±¤ì¤Ð¡¢@code{INSERT} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ï¥¨¥é¡¼¤òÀ¸À®¤·¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥ÈÃÍ
-¤Î»ÈÍѤòÍÞ¤¨¤ë¤Ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ë @code{configure} ¤ò¼Â¹Ô¤·¤Þ¤¹:
-
-@tindex CXXFLAGS environment variable
-@tindex Environment variable, CXXFLAGS
-@example
-shell> CXXFLAGS=-DDONT_USE_DEFAULT_FIELDS ./configure
-@end example
-
-@item
-¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢@strong{MySQL} ¤Ï ISO-8859-1 (Latin1) ʸ»ú¥»¥Ã¥È¤ò»ÈÍѤ·
-¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¥»¥Ã¥È¤òÊѹ¹¤¹¤ë¤Ë¤Ï¡¢@code{--with-charset} ¥ª¥×¥·¥ç¥ó¤ò
-»ÈÍѤ·¤Þ¤¹:
-@example
-shell> ./configure --with-charset=CHARSET
-@end example
-
-@code{CHARSET} ¤Ï¼¡¤Î°ì¤Ä¤Ç¤¹: @code{big5}, @code{cp1251}, @code{cp1257},
-@code{czech}, @code{danish},@code{dec8}, @code{dos}, @code{euc_kr},
-@code{gb2312}, @code{gbk}, @code{german1}, @code{hebrew}, @code{hp8},
-@code{hungarian}, @code{koi8_ru}, @code{koi8_ukr}, @code{latin1}, @code{latin2},
-@code{sjis}, @code{swe7}, @code{tis620}, @code{ujis}, @code{usa7},
-@code{win1251} or @code{win1251ukr}.
-@xref{Character sets}.
-
-Ãí°Õ: ʸ»ú¥»¥Ã¥È¤òÊѹ¹¤·¤¿¤¤¾ì¹ç¤Ï¡¢¥³¥ó¥Õ¥£¥°¥ì¡¼¥·¥ç¥ó´Ö¤Ç @code{make
-distclean} ¤ò¹Ô¤Ê¤¦É¬Íפ¬¤¢¤ê¤Þ¤¹¡ª (3.23.14 °ÊÁ°¤Î¾ì¹ç)
-
-¥µ¡¼¥Ð¤È¥¯¥é¥¤¥¢¥ó¥È´Ö¤Çʸ»ú¤òÊÑ´¹¤·¤¿¤¤¾ì¹ç¤Ï¡¢
-@code{SET OPTION CHARACTER SET} ¥³¥Þ¥ó¥É¤òÄ´¤Ù¤ë¤Ù¤­¤Ç¤¹¡£
-@xref{SET OPTION, , @code{SET OPTION}}.
-
-@cindex @code{myisamchk}
-@strong{·Ù¹ð:} ¥Æ¡¼¥Ö¥ë¤òÀ¸À®¤·¤¿¸å¤Ëʸ»ú¥»¥Ã¥È¤òÊѹ¹¤¹¤ë¾ì¹ç¡¢
-@code{myisamchk -r -q} ¤òÁ´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤Ë¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤½¤¦¤Ç¤Ê
-¤¤¤È¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÏÀµ¤·¤¯¥½¡¼¥È¤µ¤ì¤Þ¤»¤ó¡£(¤³¤ì¤Ï¡¢@strong{MySQL} ¤Î¥¤
-¥ó¥¹¥È¡¼¥ë»þ¡¢¤¤¤¯¤Ä¤«¤Î¥Æ¡¼¥Ö¥ë¤ÎÀ¸À®»þ¡¢°Û¤Ê¤ëʸ»ú¥»¥Ã¥È¤ò»ÈÍѤ·¤Æ
-@strong{MySQL} ¤ÎºÆ¥³¥ó¥Õ¥£¥°»þ¡¢¤½¤·¤ÆºÆ¥¤¥ó¥¹¥È¡¼¥ë»þ¤ËȯÀ¸¤·¤Þ¤¹¡£)
-
-@item
-¥Ç¥Ð¥Ã¥°¥³¡¼¥É¤Ä¤­¤Ç @strong{MySQL} ¤ò¥³¥ó¥Õ¥£¥°¤¹¤ë¤Ë¤Ï¡¢
-@code{--with-debug} ¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ·¤Þ¤¹:
-@example
-shell> ./configure --with-debug
-@end example
-¤³¤ì¤Ë¤è¤ê¡¢¤¤¤¯¤Ä¤«¤Î¥¨¥é¡¼¤ò¸«¤Ä¤±¤é¤ì¤ë°ÂÁ´¤Ê¥á¥â¥ê³ä¤êÅö¤Æ¤¬´Þ¤Þ¤ì¡¢
-²¿¤¬È¯À¸¤·¤Æ¤¤¤ë¤«¤Ë¤Ä¤¤¤Æ¤Î½ÐÎϤòÄ󶡤·¤Þ¤¹¡£
-@xref{Debugging server}.
-
-@item
-¤¢¤Ê¤¿¤Î¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤¬¥¹¥ì¥Ã¥É¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢
-@strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¥é¥¤¥Ö¥é¥ê¤ò
-@code{--with-thread-safe-client} ¤Ç¥¹¥ì¥Ã¥É°ÂÁ´ÍѤ˥³¥ó¥Ñ¥¤¥ë¤¹¤ëɬÍפ¬
-¤¢¤ê¤Þ¤¹; ¤³¤ì¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¤¤¤¯¤Ä¤«¤Î¥¹¥ì¥Ã¥É°ÂÁ´¤Ç¤Ê¤¤´Ø¿ô¤Ç¡¢¥é¥¤
-¥Ö¥é¥ê¤¬¥¹¥ì¥Ã¥É°ÂÁ´´Ø¿ô¥³¡¼¥ë¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£¤³¤ì¤ò¹Ô¤Ê¤¦¤³¤È
-¤Ç¾®¤µ¤Ê¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¥Ú¥Ê¥ë¥Æ¥£¤¬¤¢¤ê¤Þ¤¹¤¬¡¢Ä̾盧¤Î¥ª¥×¥·¥ç¥ó¤Î»ÈÍѤÏ
-´°Á´¤Ë°ÂÁ´¤Ç¤¹¡£
-
-@item
-¸ÇÍ­¤Î¥·¥¹¥Æ¥à¤Ë´Ø·¸¤¹¤ë¥ª¥×¥·¥ç¥ó¤Ë¤Ä¤¤¤Æ¤Ï¡¢¤³¤Î¾Ï¤è¤ê¸å¤Î¥·¥¹¥Æ¥à¸ÇÍ­
-¤ÎÀá¤Ç¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£@xref{Source install system issues}¡£
-@end itemize
-
-@node Compilation problems, MIT-pthreads, Installing source, Installing
-@section ¥³¥ó¥Ñ¥¤¥ë¤ÎÌäÂ꤫¡©
-
-Solaris ¾å¤Ç @code{gcc} ¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢°ìÀÚ·Ù¹ð̵¤¯Á´¤Æ¤Î @strong{MySQL} ¥×¥í¥°¥é¥à¤¬¤­¤ì¤¤¤Ëºî¤ì¤Þ¤¹¡£
-¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Î°ã¤¤¤«¤é·Ù¹ð¤¬½Ð¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
- MIT-pthreads ¤ò»ÈÍѤ·¤¿ºÝ¤Î·Ù¹ð¤Ï @ref{MIT-pthreads} ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-¾¤ÎÌäÂê¤Ï¡¢°Ê²¼¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-¿¤¯¤ÎÌäÂê¤Î²ò·è¤Î¤¿¤á¤Ë¡¢ºÆ configure ¤¬É¬ÍפǤ¹¡£
-¤¢¤Ê¤¿¤¬ºÆ¹½À®¤¹¤ëɬÍפ¬¤¢¤ë¤Ê¤é¤Ð¡¢°Ê²¼¤Ëµ¤¤ò¤Ä¤±¤Æ¤¯¤À¤µ¤¤¡§
-
-@cindex Running @code{configure} after prior invocation
-@cindex @code{configure}, running after prior invocation
-@itemize @bullet
-@item
-¤â¤· @code{configure} ¤ò°ìÅټ¹Ԥ·¤¿¸å¤Ë¼Â¹Ô¤¹¤ë¤Ê¤é¤Ð¡¢ @code{configure} ¤Ï
-Á°¤Ëºî¤Ã¤¿¾ðÊó¤òÍøÍѤ·¤Þ¤¹¡£¤³¤Î¾ðÊó¤Ï @file{config.cache} ¤ËÊݸ¤µ¤ì¤Þ¤¹¡£
- @code{configure} ¤Ïµ¯Æ°»þ¤Ë¤³¤Î¥Õ¥¡¥¤¥ë¤òõ¤·¡¢¤â¤·Â¸ºß¤¹¤ë¤Ê¤é¤Ð¡¢
-¤½¤ÎÃæ¤Î¾ðÊó¤¬Àµ¤·¤¤Êª¤È¤·¤ÆÆɤ߹þ¤ß¤Þ¤¹¡£
-¤³¤ì¤Ï¤¢¤Ê¤¿¤¬ºÆ¥³¥ó¥Õ¥£¥°¤¹¤ë¤Ê¤é¤Ð̵¸ú¤Ë¤Ê¤ê¤Þ¤¹¡£
-@item
-@code{configure} ¤ò¼Â¹Ô¤¹¤ë¤´¤È¤Ë¡¢ @code{make} ¤ò¼Â¹Ô¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-¤·¤«¤·¡¢ºÇ½é¤Ë¡¢Á°¤Î¥Ó¥ë¥É¤Ç¤Ç¤­¤¿¥ª¥Ö¥¸¥§¥¯¥È¤ò¡¢¾Ã¤·¤Æ¤ª¤¤¤Æ¤¯¤À¤µ¤¤¡£
-¤Ê¤¼¤Ê¤é¡¢°ã¤¦¥³¥ó¥Õ¥£¥°¥ª¥×¥·¥ç¥ó¤Ë¤è¤êÀ¸À®¤µ¤ì¤¿¤«¤é¤Ç¤¹¡£
-@end itemize
-
-¸Å¤¤¥³¥ó¥Õ¥£¥°¤ä¥ª¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤Î»ÈÍѤòËɤ°¤¿¤á¡¢
- @code{configure} Á°¤Ë°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡§
-
-@example
-shell> rm config.cache
-shell> make clean
-@end example
-
-¤³¤¦¤¹¤ë¤«¤ï¤ê¤Ë¡¢@code{make distclean} ¤È¤·¤Æ¤â¹½¤¤¤Þ¤»¤ó¡£
-
-°Ê²¼¤Ë¡¢ @strong{MySQL} ¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ëºÝ¤Ëµ¯¤³¤ê¤ä¤¹¤¤ÌäÂê¤ò¤¢¤²¤Æ¤ª¤­¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-@cindex @code{cc1plus} problems
-@cindex @code{fatal signal 11}
-@cindex @code{sql_yacc.cc} problems
-@cindex Internal compiler errors
-@cindex Virtual memory problems while compiling
-@file{sql_yacc.cc} ¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¡¢°Ê²¼¤Î¤è¤¦¤Ê¥¨¥é¡¼¤¬½Ð¤¿¾ì¹ç¡¢
-¥á¥â¥ê¡¼¡¢¥¹¥ï¥Ã¥×¤¬Â­¤ê¤Þ¤»¤ó¡§
-
-@example
-Internal compiler error: program cc1plus got fatal signal 11
- or
-Out of virtual memory
- or
-Virtual memory exhausted
-@end example
-
-¤³¤ÎÌäÂê¤Ï¡¢@code{gcc} ¤¬¥¤¥ó¥é¥¤¥óŸ³«¤Ç @file{sql_yacc.cc} ¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤Î¤Ë¡¢
-¤È¤Æ¤â¿¤¯¤Î¥á¥â¥ê¡¼¤òɬÍפȤ¹¤ë¤«¤é¤Ç¤¹¡£
-¤³¤Î¾ì¹ç¡¢ @code{configure} ¤ò @code{--with-low-memory} ¥ª¥×¥·¥ç¥ó»ØÄê¤Ç¼Â¹Ô¤·¤Þ¤¹¡§
-
-@example
-shell> ./configure --with-low-memory
-@end example
-
-¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢ @code{gcc} ¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Ê¤é @code{-fno-inline} ¥ª¥×¥·¥ç¥ó¤ò
-¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë²Ã¤¨¡¢@code{gcc} °Ê³°¤Ê¤é¤Ð @code{-O0} ¤ò²Ã¤¨¤Þ¤¹¡£
-¿¤¯¤Î¥á¥â¥ê¡¼¤È¥¹¥ï¥Ã¥×¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¸Â¤ê¤Ï¡¢@code{--with-low-memory} ¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£
-¤³¤ÎÌäÂê¤Ï¤±¤Ã¤³¤¦¤Ê¥Ï¡¼¥É¥¦¥§¥¢¹½À®¤Ç¤âµ¯¤³¤ë¤³¤È¤¬ÃΤé¤ì¤Æ¤¤¤Þ¤¹¡£
-Ä̾ @code{--with-low-memory} ¥ª¥×¥·¥ç¥ó¤Ç¤³¤ÎÌäÂê¤Ï²ò·è¤Ç¤­¤Þ¤¹¡£
-
-@item
-ɸ½à¤Ç¤Ï¡¢@code{configure} ¤Ï @code{c++} ¤È¤¤¤¦Ì¾Á°¤Ç¥³¥ó¥Ñ¥¤¥é¡¼¤ò»ÈÍѤ·¡¢
-GNU @code{c++} ¤Ï @code{-lg++} ¤ò»È¤Ã¤Æ¥ê¥ó¥¯¤·¤Þ¤¹¡£
-¤â¤· @code{gcc} ¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Ê¤é¤Ð¡¢¥³¥ó¥Õ¥£¥°»þ¤Ë°Ê²¼¤Î¤è¤¦¤ÊÌäÂ꤬½Ð¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡§
-
-@cindex C++ compiler cannot create executables
-@example
-configure: error: installation or configuration problem:
-C++ compiler cannot create executables.
-@end example
-
-@tindex CXX environment variable
-@tindex Environment variable, CXX
-¤³¤ÎÌäÂê¤Ï¡¢@code{g++}, @code{libg++} ¤¢¤ë¤¤¤Ï @code{libstdc++} ¤Ë´ØÏ¢¤·¤¿¤â¤Î¤Ç¤¹¡£
-
-¸¶°ø¤Î°ì¤Ä¤È¤·¤Æ¹Í¤¨¤é¤ì¤ë¤³¤È¤Ï¡¢ @code{g++} ¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¤«¡¢¤¢¤ë¤¤¤Ï¡¢
-@code{g++} ¤Ï¤¢¤Ã¤Æ¤â @code{libg++} ¤« @code{libstdc++} ¤¬¤Ê¤¤¤È¤¤¤¦»ö¤Ç¤¹¡£
-@file{config.log} ¥Õ¥¡¥¤¥ë¤Ï c++ ¥³¥ó¥Ñ¥¤¥é¤¬Æ°ºî¤·¤Ê¤«¤Ã¤¿Íýͳ¤òµ­Ï¿¤·¤Æ¤¤¤Þ¤¹¡ª
-¤³¤ÎÌäÂê¤ò²ò·è¤¹¤ë¤ËÅö¤¿¤ê¡¢¤¢¤Ê¤¿¤¬»ý¤Ã¤Æ¤¤¤ë C++ ¥³¥ó¥Ñ¥¤¥é¡¼¤ÎÂå¤ï¤ê¤Ë
- @code{gcc} ¤ò»ÈÍѤ·¤Æ¤â¹½¤¤¤Þ¤»¤ó¡£@code{CXX} ´Ä¶­ÊÑ¿ô¤Ë @code{"gcc -O3"} ¤È¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
-Î㤨¤Ð¡§
-
-@tindex CXX environment variable
-@tindex Environment variables, CXX
-@example
-shell> CXX="gcc -O3" ./configure
-@end example
-
-¤³¤ì¤Ï @code{gcc} ¤¬ @code{g++} ¤ÈƱÍÍ¤Ë C++ ¥½¡¼¥¹¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤Î¤ÇÆ°¤­¤Þ¤¹¤¬¡¢
-@code{libg++} ¤« @code{libstdc++} ¤¬É¸½à¤Ç¤Ï¥ê¥ó¥¯¤µ¤ì¤Þ¤»¤ó¡£
-
-¾¤Î²ò·èÊýË¡¤Ï¡¢¤â¤Á¤í¤ó¡¢@code{g++}, @code{libg++}, @code{libstdc++} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤³¤È¤Ç¤¹¡£
-
-@item
-¤â¤·°Ê²¼¤Î¥¨¥é¡¼¤Î¤É¤ì¤«¤¬µ¯¤­¤¿¾ì¹ç¡¢ GNU @code{make} ¤Î¥Ð¡¼¥¸¥ç¥ó¤ò¾å¤²¤Æ¤¯¤À¤µ¤¤¡§
-
-@example
-making all in mit-pthreads
-make: Fatal error in reader: Makefile, line 18:
-Badly formed macro assignment
- or
-make: file `Makefile' line 18: Must be a separator (:
- or
-pthread.h: No such file or directory
-@end example
-
-@cindex Solaris troubleshooting
-@cindex FreeBSD troubleshooting
-@cindex Troubleshooting, Solaris
-@cindex Troubleshooting, FreeBSD
-Solaris ¤È FreeBSD ¤Î @code{make} ¥×¥í¥°¥é¥à¤Ë¤ÏÌäÂ꤬¤¢¤ë¤³¤È¤¬ÃΤé¤ì¤Æ¤¤¤Þ¤¹¡£
-
-GNU @code{make} version 3.75 ¤ÏÆ°ºî³Îǧ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-
-@tindex CC environment variable
-@tindex Environment variable, CC
-@tindex CXX environment variable
-@tindex Environment variable, CXX
-@tindex CFLAGS environment variable
-@tindex Environment variable, CFLAGS
-@tindex CXXFLAGS environment variable
-@tindex Environment variable, CXXFLAGS
-@item
-¤â¤· C,C++ ¤Î¤¿¤á¤Ë¥Õ¥é¥°¤òÍ¿¤¨¤¿¤¤¾ì¹ç¡¢@code{CFLAGS} ¤È @code{CXXFLAGS} ´Ä¶­ÊÑ¿ô¤Ë
-¥Õ¥é¥°¤òÄɲ䷤Ƥ¯¤À¤µ¤¤¡£Æ±Íͤˡ¢ @code{CC} ¤È @code{CXX} ¤Ë¥³¥ó¥Ñ¥¤¥é¡¼Ì¾¤ò
-Í¿¤¨¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
-Î㤨¤Ð¡§
-
-@example
-shell> CC=gcc
-shell> CFLAGS=-O6
-shell> CXX=gcc
-shell> CXXFLAGS=-O6
-shell> export CC CFLAGS CXX CXXFLAGS
-@end example
-
-@ref{TcX binaries} ¤Ë¤Ï¥Õ¥é¥°¤ÎÄêµÁ¤¬¥ê¥¹¥È¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-¿§¡¹¤Ê¥·¥¹¥Æ¥à¾å¤ÇÌò¤ËΩ¤Ä¤È»×¤¤¤Þ¤¹¡£
-
-@item
-°Ê²¼¤Î¤è¤¦¤Ê¥¨¥é¡¼¤Î¾ì¹ç¡¢@code{gcc} ¥³¥ó¥Ñ¥¤¥é¡¼¤ò¥¢¥Ã¥×¥°¥ì¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡§
-
-@example
-client/libmysql.c:273: parse error before `__attribute__'
-@end example
-
-@code{gcc} 2.8.1 ¤ÏÆ°ºî¤¹¤ë¤³¤È¤¬³Îǧ¤µ¤ì¤Æ¤¤¤Þ¤¹¤¬¡¢
-@code{gcc} 2.95.2 °Ê¾å¤ò¤ª´«¤á¤·¤Þ¤¹¡£
-
-@item
-@code{mysqld} ¥³¥ó¥Ñ¥¤¥ë»þ¤Ë°Ê²¼¤Î¤è¤¦¤Ê¥¨¥é¡¼¤¬½Ð¤¿¾ì¹ç¡¢
-@code{configure} ¤¬@code{accept()}, @code{getsockname()}, @code{getpeername()}
-¤ÎºÇ¸å¤Î°ú¿ô¤òÀµ¤·¤¯¸¡½Ð¤·¤Æ¤¤¤Þ¤»¤ó¡§
-
-@example
-cxx: Error: mysqld.cc, line 645: In this statement, the referenced
- type of the pointer value "&length" is "unsigned long", which
- is not compatible with "int".
-new_sock = accept(sock, (struct sockaddr *)&cAddr, &length);
-@end example
-
-¤³¤ì¤ò½¤Àµ¤¹¤ë¤Ë¤Ï¡¢@file{config.h} ¥Õ¥¡¥¤¥ë(@code{configure} ¤Ë¤è¤êºî¤é¤ì¤ë) ¤ò½¤Àµ¤·¤Þ¤¹¡£
-¤¤¤«¤Î¤è¤¦¤Ë¡§
-
-@example
-/* Define as the base type of the last arg to accept */
-#define SOCKET_SIZE_TYPE XXX
-@end example
-
-@code{XXX} ¤ò @code{size_t} ¤« @code{int} (¤¢¤Ê¤¿¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤¬°Í¸¤·¤Æ¤¤¤ë·¿)¤ËÊѤ¨¤Þ¤¹¡£
-(@code{configure} ¤¹¤ë¤ÈËè²ó @file{config.h} ¤Ïºî¤êľ¤µ¤ì¤ë¤Î¤Ç¡¢
-¤³¤Î½¤Àµ¤Ï @code{configure} ¤¹¤ëÅ٤˹Ԥï¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤ËÃí°Õ)
-
-@item
-@file{sql_yacc.cc} ¥Õ¥¡¥¤¥ë¤Ï @file{sql_yacc.yy} ¤«¤éÀ¸À®¤µ¤ì¤Þ¤¹¡£
-Ä̾
-@strong{MySQL} ¤¬´û¤ËÀ¸À®¤µ¤ì¤¿¥³¥Ô¡¼¤È¤È¤â¤Ë¤¢¤ë¤Î¤Ç¡¢
-@file{sql_yacc.cc} ¥Õ¥¡¥¤¥ë¤ò¼«Ê¬¼«¿È¤ÇºîÀ®¤¹¤ë¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-¤·¤«¤·¡¢°Ê²¼¤Î¥¨¥é¡¼¤Î¾ì¹ç¡¢ºÆºîÀ®¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡§
-
-@example
-"sql_yacc.yy", line xxx fatal: default action causes potential...
-@end example
-
-¤³¤ì¤Ï¤¢¤Ê¤¿¤Î @code{yacc} ¤Î¥Ð¡¼¥¸¥ç¥ó¤¬ÉÔ½½Ê¬¤Ç¤¢¤ë¤³¤È¤ò¼¨¤·¤Æ¤¤¤Þ¤¹¡£
-@code{bison} (the GNU version of @code{yacc}) ¤òÂå¤ï¤ê¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ»ÈÍѤ¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-@item
-¤â¤· @code{mysqld} ¤« @strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¤ò¥Ç¥Ð¥Ã¥°¤·¤¿¤¤¤Ê¤é¡¢
-@code{configure} ¤ò @code{--with-debug} ¥ª¥×¥·¥ç¥óÉÕ¤­¤Ç¼Â¹Ô¤·¤Þ¤¹¡£
-¤½¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤·¡¢¿·¤·¤¤¥¯¥é¥¤¥¢¥ó¥È¥é¥¤¥Ö¥é¥ê¡¼¤Ç¥¯¥é¥¤¥¢¥ó¥È¤ò¥ê¥ó¥¯¤·¤Þ¤¹¡£
-@xref{Debugging client}.
-@end itemize
-
-@node MIT-pthreads, Perl support, Compilation problems, Installing
-@section MIT-pthreads ¤Ë´Ø¤·¤Æ
-
-¤³¤Î¥»¥¯¥·¥ç¥ó¤Ç¤ÏMIT-pthreads¤ò»È¤Ã¤Æ¤¤¤ë¤µ¤¤¤Ëµ¯¤³¤ëÌäÂê¤Ë¤Ä¤¤¤Æ¤¤¤¯¤Ä¤«½Ò¤Ù¤Æ
-¤¤¤Þ¤¹¡£
-
-Linux ¤Ç¤Ï¡¢MIT-pthreads ¤ò»ÈÍѤ·¤Æ¤Ï¤Ê¤é¤º¡¢
-LinuxThreads ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤Ù¤­¤Ç¤¹¡ª
-@xref{Linux}.
-
-¤â¤·¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à¤¬ËÜÍè¤Î¥¹¥ì¥Ã¥É¤Î¥µ¥Ý¡¼¥È¤òÄ󶡤·¤Ê¤±¤ì¤Ð¡¢¤¢¤Ê¤¿¤Ï¡¢
-MIT-pthreads¥Ñ¥Ã¥±¡¼¥¸¤ò»È¤Ã¤Æ¡¢@strong{MySQL} ¤ò¹½ÃÛ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-¤³¤ì¤Ë¤Ï¤Û¤È¤ó¤É¤ÎFreeBSD¥·¥¹¥Æ¥à¡¢SunOS4.x,Solaris 2.4¤È¤½¤ì°ÊÁ°¡¢¤Û¤«¤¤¤¯¤Ä¤«
-¤¬´Þ¤Þ¤ì¤Þ¤¹¡£
-@xref{Which OS}.
-
-@itemize @bullet
-@item
-¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¾å¤Ç¤Ï @code{--with-mit-threads} ¥ª¥×¥·¥ç¥ó¤Ç
-@code{configure} ¼Â¹Ô¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢
-MIT-pthreads¤¬»È¤ï¤ì¤ë¤³¤È¤ò¶¯À©¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@example
-shell> ./configure --with-mit-threads
-@end example
-
-MIT-pthreads¤ò»È¤¦»þ¡¢È󥽡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤Ç¹½ÃÛ¤¹¤ë¤³¤È¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤»
-¤ó¡£¤Ê¤¼¤Ê¤é¡¢»ä¤¿¤Á¤Ï¤³¤Î¥³¡¼¥É¤Ø»ä¤¿¤Á¤ÎÊѹ¹¤òºÇ¾®¤Ë¤·¤¿¤¤¤«¤é¤Ç¤¹¡£
-
-@item
-MIT-pthreads¤Ï¡¢Unix¥½¥±¥Ã¥È¼ÂÁõ¤Ë»È¤ï¤ì¤Æ¤¤¤ë @code{AF_UNIX} ¥×¥í¥È¥³¥ë¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤»¤ó¡£
-¤³¤ì¤Ï¡¢¤â¤·¤¢¤Ê¤¿¤¬»È¤Ã¤Æ¤¤¤ë MIT-pthreads ¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ì¤Ð¡¢Á´¤Æ¤ÎÀܳ¤Ï¡¢
-TCP/IP ¤ò»È¤¦(¤Ä¤Þ¤ê¾¯¤·ÃÙ¤¯¤Ê¤ë)¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£
-¤â¤·¡¢¤¢¤Ê¤¿¤¬ @strong{MySQL} ¤ò¹½ÃÛ¤·¤¿¤¢¤È¤Ç¡¢¥í¡¼¥«¥ë¤Î¥µ¡¼¥Ð¡¼¤ËÀܳ¤Ç¤­¤Ê¤¤¤Ê¤é¤Ð¡¢
-¤½¤ì¤Ï¤¢¤Ê¤¿¤Î¥¯¥é¥¤¥¢¥ó¥È¤¬¥Ç¥Õ¥©¥ë¥È¤Ç Unix ¥½¥±¥Ã¥È¤ò»È¤Ã¤Æ
- @code{localhost} ¤ØÀܳ¤·¤è¤¦¤È¤·¤Æ¤¤¤ë¤Î¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-ÌÀ¼¨Åª¤Ë¥í¡¼¥«¥ë¥Û¥¹¥È̾¤ò»ØÄꤹ¤ë¤¿¤á¤Ë¡¢¥Û¥¹¥È̾»ØÄê¤Î¥ª¥×¥·¥ç¥ó
- (@code{-h} ¤« @code{--host}) ¤Ç @code{mysql} ¤ò»ÈÍѤ·¤Æ¡¢TCP/IP Àܳ¤ò»î¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-MIT-pthreads ¤¬»È¤ï¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¥Á¥§¥Ã¥¯¤Ï¥µ¡¼¥Ð¥³¡¼¥É¤ò configure ¤¹¤ë¤È¤­¤Ë
-¤À¤±¹Ô¤ï¤ì¤Þ¤¹¡£¤â¤·¡¢¤¢¤Ê¤¿¤¬ @code{--without-server} ¤ò»È¤Ã¤Æ¥¯¥é¥¤¥¢¥ó¥È¥³¡¼¥É¤Î¤ß¤ò
-¥Ó¥ë¥É¤¹¤ë¤³¤È¤òÀßÄꤷ¤¿¤Ê¤é¤Ð¡¢¥¯¥é¥¤¥¢¥ó¥È¤Ï MIT-othreads ¤¬»È¤ï¤ì¤Æ¤¤¤ë¤«¤¤¤Ê¤¤¤«¡¢
-Unix¥½¥±¥Ã¥ÈÀܳ¤¬¥Ç¥Õ¥©¥ë¥È¤Ç»È¤ï¤ì¤Æ¤¤¤ë¤Î¤«¤ï¤«¤ê¤Þ¤»¤ó¡£¤Ê¤¼¤Ê¤é Unix ¥½¥±¥Ã¥È¤Ï
-MIT-pthreads ²¼¤Ç¤ÏÆ°ºî¤·¤Ê¤¤¤«¤é¤Ç¤¹¡£¤Þ¤¿¡¢¤¢¤Ê¤¿¤Ï¤½¤Î¤è¤¦¤Ê¥¤¥ó¥¹¥¿¥ó¥¹¤Ç¤Ï
- @code{-h} ¤Þ¤¿¤Ï @code{--host} ¤ò»È¤¦É¬Íפ¬¤¢¤ê¤Þ¤¹¡£
-
-@item
- @strong{MySQL} ¤¬ MIT-pthreads ¤ò»È¤Ã¤Æ¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤ë¤È¡¢¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¾å¤ÎÌäÂê¤Î¤¿
-¤á¥·¥¹¥Æ¥à¥í¥Ã¥¯¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¥Ç¥£¥¹¥¨¡¼¥Ö¥ë¤È¤µ¤ì¤Þ¤¹¡£ @code{--use-locking} ¥ª¥×¥·¥ç¥ó
-¤ò»ØÄꤷ¤Æ¥µ¡¼¥Ð¡¼¤ËÅÁ¤¨¤ë¤³¤È¤Ç¡¢¥·¥¹¥Æ¥à¥í¥Ã¥¯¤Ï»È¤¨¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-@item
-¤È¤­¤É¤­(¾¯¤Ê¤¯¤È¤âSolaris¤Ç¤Ï) pthread ¤Î @code{bind()} ¥³¥Þ¥ó¥É¤Ï²¿¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸
-¤Ê¤·¤Ë¥½¥±¥Ã¥È¤Ø¤Î bind ¤Ë¼ºÇÔ¤¹¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£¤³¤ì¤Ï·ë²Ì¤È¤·¤Æ¥µ¡¼¥Ð¡¼¤Ø¤ÎÀܳ
-¼ºÇԤȤʤê¤Þ¤¹¡£¤¿¤È¤¨¤Ð¡¢
-
-@example
-shell> mysqladmin version
-mysqladmin: connect to server at '' failed;
-error: 'Can't connect to mysql server on localhost (146)'
-@end example
-
-¤³¤ì¤ò²ò·è¤¹¤ë¤¿¤á¤Ë @code{mysqld} ¥µ¡¼¥Ð¡¼¤ò½ªÎ»¤·¤Æ¡¢ºÆµ¯Æ°¤·¤Æ¤¯¤À¤µ¤¤¡£¤³
-¤ì¤Ï»ä¤¿¤Á¤¬¥µ¡¼¥Ð¡¼¥À¥¦¥ó¤ò¶¯À©¤·¤Æ¡¢¤¹¤°¤Ë¥ê¥¹¥¿¡¼¥È¤µ¤»¤è¤¦¤È¤·¤¿¤È¤­¤À¤±µ¯¤³
-¤ê¤Þ¤·¤¿¡£
-
-@item
-MIT-pthreads ¤ò»È¤Ã¤Æ¤¤¤ë¤È¡¢@code{sleep()} ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï @code{SIGINT} (break)
-¤Ç¤Ï³ä¤ê¹þ¤ß¤Ç¤­¤Þ¤»¤ó¡£ ¤³¤ì¤Ï¡¡@code{mysqladmin --sleep} ¤òÁö¤é¤»¤Æ¤¤¤ë¤È¤­¤Ë¤À¤±
-µ¯¤³¤ë¤³¤È¤¬¤ï¤«¤Ã¤Æ¤¤¤Þ¤¹¡£
-³ä¤ê¹þ¤ß¤¬È¯À¸¤·¤Æ¥×¥í¥»¥¹¤¬Ää»ß¤¹¤ëÁ°¤Ë¡¢¤¢¤Ê¤¿¤Ï½ªÎ»¤µ¤»¤ë¤¿¤á¤Î @code{sleep()} ¥³¡¼¥ë¤òÂÔ¤¿¤Ê¤¯
-¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-
-@item
-¥ê¥ó¥¯¤·¤Æ¤¤¤ë¤È¤­(¾¯¤Ê¤¯¤È¤âSolaris¤Ç¤Ï)¡¢¤¢¤Ê¤¿¤Ï¤³¤Î¤è¤¦¤Ê warning ¥á¥Ã¥»¡¼¥¸
-¤ò¼õ¤±¼è¤ë¤Ç¤·¤ç¤¦¡£¤³¤ì¤é¤Ï̵»ë¤·¤Æ¤«¤Þ¤¤¤Þ¤»¤ó¡£
-
-@example
-ld: warning: symbol `_iob' has differing sizes:
- (file /my/local/pthreads/lib/libpthread.a(findfp.o) value=0x4;
-file /usr/lib/libc.so value=0x140);
- /my/local/pthreads/lib/libpthread.a(findfp.o) definition taken
-ld: warning: symbol `__iob' has differing sizes:
- (file /my/local/pthreads/lib/libpthread.a(findfp.o) value=0x4;
-file /usr/lib/libc.so value=0x140);
- /my/local/pthreads/lib/libpthread.a(findfp.o) definition taken
-@end example
-
-@item
-¾¤Î¤¤¤¯¤Ä¤«¤Î warnings ¤â¤Þ¤¿Ìµ»ë¤·¤Æ¤«¤Þ¤¤¤Þ¤»¤ó¡£
-
-@example
-implicit declaration of function `int strtoll(...)'
-implicit declaration of function `int strtoul(...)'
-@end example
-
-@item
-»ä¤¿¤Á¤Ï¤Þ¤À MIT-pthread ¤È¤È¤â¤ËÆ°¤¯ @code{readline} ¤ò¼ê¤ËÆþ¤ì¤Æ¤¤¤Þ¤»¤ó(¤³¤ì¤ÏɬÍפǤÏ
-¤Ê¤¤¤Î¤Ç¤¹¤¬¡¢¤ª¤½¤é¤¯Ã¯¤«¤Ë¤Ï¶½Ì£¤¬¤¢¤ë¤Ç¤·¤ç¤¦)¡£
-@end itemize
-
-@node Perl support, Source install system issues, MIT-pthreads, Installing
-@section Perl ¤Î¥¤¥ó¥¹¥È¡¼¥ë¤Ë¤Ä¤¤¤Æ
-
-@menu
-* Perl installation:: Installing Perl on Unix
-* ActiveState Perl:: Installing ActiveState Perl on Win32
-* Win32 Perl:: Installing the @strong{MySQL} Perl distribution on Win32
-* Perl support problems:: Problems using the Perl @code{DBI}/@code{DBD} interface
-@end menu
-
-@node Perl installation, ActiveState Perl, Perl support, Perl support
-@subsection Unix ¤Ø¤Î Perl ¤Î¥¤¥ó¥¹¥È¡¼¥ë
-
-@strong{MySQL} ¤Ï Perl @code{DBI}/@code{DBD} ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£@xref{Perl}.
-@code{DBI}/@code{DBD} ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Î Perl ¤Î¥¯¥é¥¤¥¢¥ó¥È¤Ï¡¢Perl 5.004 °Ê¾å¤¬É¬ÍפǤ¹¡£
-¤³¤ì¤è¤ê¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Î Perl ¤Ç¤¹¤È@emph{Æ°¤­¤Þ¤»¤ó}¡£
-
-@strong{MySQL} Perl ¤Ï¡¢ @strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¡¦¥×¥í¥°¥é¥ß¥ó¥°¡¦¥µ¥Ý¡¼¥È¤¬
-´û¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¤³¤È¤¬¾ò·ï¤Ç¤¹¡£
-¤â¤·¤¢¤Ê¤¿¤¬ RPM ¥Õ¥¡¥¤¥ë¤«¤é @strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¤Î¤Ê¤é¡¢
-¥¯¥é¥¤¥¢¥ó¥È¡¦¥×¥í¥°¥é¥à¤Ï¡¢¥¯¥é¥¤¥¢¥ó¥È RPM ¤Ë¤¢¤ê¤Þ¤¹¡£ ¤¬¡¢
-¥¯¥é¥¤¥¢¥ó¥È¡¦¥×¥í¥°¥é¥ß¥ó¥°¡¦¥µ¥Ý¡¼¥È¤Ï¡¢³«È¯¼Ô¸þ¤± RPM ¤Ë¤¢¤ê¤Þ¤¹¡£
-³«È¯¼Ô¸þ¤± RPM ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¤³¤È¤ò³Î¤«¤á¤Æ²¼¤µ¤¤¡£
-
-¤³¤ì¤é¤Ï 3.22.8 ¤«¤é @strong{MySQL} ÇÛÉۤȤÏʬ¤±¤é¤ì¤ÆÇÛÉÛ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-¤â¤· Perl ¥â¥¸¥å¡¼¥ë¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¤¤¤Ê¤é¡¢@uref{http://www.mysql.com/Contrib} ¤ò
-³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£¤³¤³¤Ë¤ª¤«¤ì¤Æ¤¤¤Þ¤¹¡£
-
-Perl ¤ÎÇÛÉÛʪ¤Ï @code{tar} ¤Ç¥¢¡¼¥«¥¤¥Ö¤µ¤ì¡¢°µ½Ì¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-@file{MODULE-VERSION.tar.gz} ¤È¤¤¤¦Ì¿Ì¾µ¬Â§¤ÇÇÛÉÛ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-(@code{MODULE} ¤Ï¥â¥¸¥å¡¼¥ë̾¡¢@code{VERSION} ¤Ï¥Ð¡¼¥¸¥ç¥óÈÖ¹æ)
-
-@code{Data-Dumper}, @code{DBI}, @code{Msql-Mysql-modules} ¤¬É¬ÍפǤ¹¡£
-¤³¤ì¤ò¼è¤Ã¤Æ¤­¤¿¤é¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¡£
-@code{Data-Dumper} ¥â¥¸¥å¡¼¥ë¤òÎã¤Ë¤·¤Þ¤¹¤¬¡¢Â¾¤âƱÍͤˤǤ­¤Þ¤¹¡£
-
-@enumerate
-@item
-ÇÛÉÛʪ¤ò¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤ËŸ³«¡§
-@example
-shell> gunzip < Data-Dumper-VERSION.tar.gz | tar xvf -
-@end example
-¤³¤ì¤Ï @file{Data-Dumper-VERSION} ¤È¤¤¤¦¥Ç¥£¥ì¥¯¥È¥ê¤òºî¤ê¤Þ¤¹¡£
-
-@item
-Ÿ³«¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÆþ¤ê¤Þ¤¹¡§
-@example
-shell> cd Data-Dumper-VERSION
-@end example
-
-@item
-¥³¥ó¥Ñ¥¤¥ë¡¢¥¤¥ó¥¹¥È¡¼¥ë¡§
-@example
-shell> perl Makefile.PL
-shell> make
-shell> make test
-shell> make install
-@end example
-@end enumerate
-
-¥â¥¸¥å¡¼¥ë¤¬Æ°ºî¤¹¤ë¤«¤ò³Î¤«¤á¤ë¤Î¤Ç @code{make test} ¥³¥Þ¥ó¥É¤Ï½ÅÍפǤ¹¡£
-¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¥³¡¼¥É¤Î¥Æ¥¹¥È¤Î¤¿¤á¤Ë @code{Msql-Mysql-modules} ¤Î
-¥¤¥ó¥¹¥È¡¼¥ëÃæ¤Ë¤³¤ì¤é¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ëºÝ¤Ë¤Ï¡¢
-@strong{MySQL} ¥µ¡¼¥Ð¡¼¤¬²ÔƯ¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-¤Ç¤Ê¤±¤ì¤Ð¡¢¥Æ¥¹¥È¤Ï¼ºÇÔ¤·¤Þ¤¹¡£
-
-¿·¤·¤¤¥ê¥ê¡¼¥¹¤Î @strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¾ì¹ç¤Ë¾ï¤Ë
- @code{Msql-Mysql-modules} ¤òºÆ¹½ÃÛ¡¢ºÆ¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤³¤È¤Ï
-¤¤¤¤¹Í¤¨¤Ç¤¹¡£¤¹¤Ù¤Æ¤Î @code{DBI} ¥¹¥¯¥ê¥×¥È¤¬ @strong{MySQL} ¤Î
-¥¢¥Ã¥×¥°¥ì¡¼¥É¸å¤Ë¥³¥¢¥À¥ó¥×¤¹¤ëÃû¸õ¤Ëµ¤¤Å¤¤¤¿¾ì¹ç¤Ï¡¢ÆäË
-¤½¤¦¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-¤â¤· Perl module ¤òÀµ¤·¤¯¥·¥¹¥Æ¥à¥Ç¥£¥ì¥¯¥È¥ê¡¼¤ä¥í¡¼¥«¥ë¤ÎPerl¥Ç¥£¥ì¥¯¥È¥ê
-¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤­¤Ê¤¤¾ì¹ç¡¢°Ê²¼¤Îʸ¸¥¤¬ÌòΩ¤Á¤Þ¤¹¡§
-
-@example
-@uref{http://www.iserver.com/support/contrib/perl5/modules.html}
-@end example
-
-¤³¤Î¥Ú¡¼¥¸¤Î°Ê²¼¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡§
-@code{Installing New Modules that Require Locally Installed Modules}.
-
-
-@node ActiveState Perl, Win32 Perl, Perl installation, Perl support
-@subsection Win32 ¤Ø¤Î ActiveState Perl ¤Î¥¤¥ó¥¹¥È¡¼¥ë
-
-Win32 ¾å¤Ë¡¢ ActiveState Perl ¤Ë @strong{MySQL} @code{DBD} ¥â¥¸¥å¡¼¥ë¤ò
-¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤Ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡§
-
-@itemize @bullet
-@item Open a DOS shell.
-@item ¤â¤·É¬Íפʤ顢HTTP_proxy ÊÑ¿ô¤ò¥»¥Ã¥È¡£ Î㤨¤Ð
-@code{set HTTP_proxy=my.proxy.com:3128}
-@item PPM ¥×¥í¥°¥é¥à¤Îµ¯Æ°¡§ @code{C:\perl\bin\ppm.pl}
-@item @code{DBI} ¤Î¥¤¥ó¥¹¥È¡¼¥ë(¤â¤·Æþ¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð)¡§ @code{install DBI}
-@item ¤³¤ÎÀ®¸ù¸å¤Ë¡¢ @code{ftp://ftp.de.uu.net/pub/CPAN/authors/id/JWIED/DBD-mysql-1.2212.x86.ppd } ¤ò¥¤¥ó¥¹¥È¡¼¥ë
-@end itemize
-
-The above should work at least with ActiveState Perl 5.6.
-
-¤â¤·¾åµ­¤Î¤è¤¦¤Ë½ÐÍè¤Ê¤±¤ì¤Ð¡¢Âå¤ï¤ê¤Ë @strong{MyODBC} ¥É¥é¥¤¥Ð¡¼¤òÆþ¤ì¡¢
- @strong{MySQL} ¥µ¡¼¥Ð¡¼¤Ë ODBC ·Ðͳ¤ÇÀܳ¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-
-@example
-use DBI;
-$dbh= DBI->connect("DBI:ODBC:$dsn","$user","$password") ||
- die "Got error $DBI::errstr when connecting to $dsn\n";
-@end example
-
-@node Win32 Perl, Perl support problems, ActiveState Perl, Perl support
-@subsection Win32 ¤Ø¤Î @strong{MySQL} Perl ÇÛÉÛʪ¤Î¥¤¥ó¥¹¥È¡¼¥ë
-
-@strong{MySQL} Perl ÇÛÉÛ¤Ï @code{DBI},
-@code{DBD:MySQL} , @code{DBD:ODBC} ¤ò´Þ¤ß¤Þ¤¹¡£
-
-@itemize @bullet
-@item
-@uref{http://www.mysql.com/download.html} ¤«¤é Perl distribution for Win32 ¤ò¼èÆÀ¡£
-@item @code{C:} ¤Ç unzip ¤·¤Þ¤¹¡£ @file{C:\PERL} ¤¬¤Ç¤­¤Þ¤¹¡£
-@item ¤¢¤Ê¤¿¤Î¥Ñ¥¹¤Ë @file{C:\PERL\BIN} ¤ò²Ã¤¨¤Þ¤¹¡£
-@item ¤¢¤Ê¤¿¤Î¥Ñ¥¹¤Ë @file{C:\PERL\BIN\MSWin32-x86-thread} ¤«
-@file{C:\PERL\BIN\MSWin32-x86} ¤ò²Ã¤¨¤Þ¤¹¡£
-@item DOS shell ¤Ç¡¢ @code{perl -v} ¤ò¼Â¹Ô¤·¤Æ @code{perl} ¤ò¥Æ¥¹¥È¤·¤Þ¤¹¡£
-@end itemize
-
-@node Perl support problems, , Win32 Perl, Perl support
-@subsection Perl @code{DBI}/@code{DBD} »ÈÍÑ»þ¤ÎÌäÂê
-
-¤â¤· Perl ¤¬ @code{../mysql/mysql.so} ¥â¥¸¥å¡¼¥ë¤¬¸«¤Ä¤«¤é¤Ê¤¤¤È¥á¥Ã¥»¡¼¥¸¤ò½Ð¤·¤¿¾ì¹ç¡¢
-¥·¥§¥¢¡¼¥É¥é¥¤¥Ö¥é¥ê @file{libmysqlclient.so} ¤ò¼è¤ê¤³¤á¤Ê¤«¤Ã¤¿¤È¹Í¤¨¤é¤ì¤Þ¤¹¡£
-
-°Ê²¼¤Î¤è¤¦¤ÊÊýË¡¤Ç²ò·èÊýË¡¤¬¤¢¤ê¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-@code{Msql-Mysql-modules} ¤Î¥³¥ó¥Ñ¥¤¥ë¤Ç¤Ï¡¢
-@code{perl Makefile.PL} ¤Î¤«¤ï¤ê¤Ë
-@code{perl Makefile.PL -static -config} ¤È¤·¤Þ¤¹¡£
-
-@item
-@code{libmysqlclient.so} ¤ò¾¤Î¥·¥§¥¢¡¼¥É¥é¥¤¥Ö¥é¥ê¤¬¤¢¤ë¤È¤³¤í(@file{/usr/lib} ¤È¤« @file{/lib})¤Ë¥³¥Ô¡¼¤·¤Þ¤¹¡£
-
-@item
-@code{Linux} ¤Î¾ì¹ç¡¢@file{/etc/ld.so.conf} ¥Õ¥¡¥¤¥ë¤Ë¡¢@code{libmysqlclient.so}
- ¤¬¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ò½ñ¤­²Ã¤¨¡¢@code{ldconfig -v} ¤ò¼Â¹Ô¤·¤Þ¤¹¡£
-
-@item
-@tindex LD_RUN_PATH environment variable
-@tindex Environment variable, LD_RUN_PATH
-@code{LD_RUN_PATH} (@code{LD_LIBRARY_PATH}) ´Ä¶­ÊÑ¿ô¤Ë @code{libmysqlclient.so}
- ¤¬¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ò½ñ¤­²Ã¤¨¤Þ¤¹¡£
-@end itemize
-
-¤â¤· @code{DBD-mysql} ¤Ç°Ê²¼¤Î¥¨¥é¡¼¤¬½Ð¤¿¾ì¹ç¡¢
-@code{gcc} (¤¢¤ë¤¤¤Ï¡¢@code{gcc} ¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¸Å¤¤¥Ð¥¤¥Ê¥ê) ¤ò»ÈÍѤ·¤Æ¤¤¤ë¤È
-»×¤ï¤ì¤Þ¤¹¡§
-
-@example
-/usr/bin/perl: can't resolve symbol '__moddi3'
-/usr/bin/perl: can't resolve symbol '__divdi3'
-@end example
-
-@file{mysql.so} ¤òºîÀ®¤¹¤ë»þ¤Î¥ê¥ó¥¯¥³¥Þ¥ó¥É¤Ë
- @code{-L/usr/lib/gcc-lib/... -lgcc} ¤òÄɲ䷤Ƥ¯¤À¤µ¤¤¡£
-(Perl¥¯¥é¥¤¥¢¥ó¥È¤òºî¤ëºÝ¤Î @code{make} ¤Î½ÐÎϤò¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤)
-@code{-L} ¥ª¥×¥·¥ç¥ó¤Ë»ØÄꤹ¤ë¤Î¤Ï¡¢¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥àÆâ¤Î @file{libgcc.a} ¤¬¤¢¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¹¡£
-
-Perl ¤È @strong{MySQL} ¤¬ @code{gcc} ¤ò»ÈÍѤ·¤Æºî¤é¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤â¸¶°ø¤È¤·¤Æ¤¢¤ê¤Þ¤¹¡£
-¤³¤Î¾ì¹ç¡¢Î¾Êý¤ò @code{gcc} ¤Ç¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢¥ß¥¹¥Þ¥Ã¥Á¤òÈò¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-¥À¥¤¥Ê¥ß¥Ã¥¯¥ê¥ó¥¯¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¥·¥¹¥Æ¥à(like SCO)¤ÇPerl¥â¥¸¥å¡¼¥ë¤ò»ÈÍѤ·¤¿¤¤¾ì¹ç¡¢
-@code{DBI} ¤È @code{DBD-mysql} ¤ò´Þ¤à¥¹¥¿¥Æ¥£¥Ã¥¯¤ÎPerl¤òºî¤ë»ö¤â¤Ç¤­¤Þ¤¹¡£
-¤³¤ì¤Ï¡¢¤Þ¤º¡¢ @code{DBI} ¥³¡¼¥É¤¬¥ê¥ó¥¯¤µ¤ì¤Æ¤¤¤ëPerl¤òºî¤Ã¤Æ¸½ºß¤ÎPerl¤Î¾å¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¡£
-¤½¤·¤Æ¡¢ @code{DBD} ¥³¡¼¥É¤ò¤µ¤é¤Ë¥ê¥ó¥¯¤µ¤»¤ëPerl¤òºî¤ê¡¢¤½¤ì¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¡£
-
-SCO¤Ç¤Ï¡¢´Ä¶­ÊÑ¿ô¤ò°Ê²¼¤Î¤è¤¦¤Ë¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡§
-
-@example
-shell> LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/usr/progressive/lib
-or
-shell> LD_LIBRARY_PATH=/usr/lib:/lib:/usr/local/lib:/usr/ccs/lib:/usr/progressive/lib:/usr/skunk/lib
-shell> LIBPATH=/usr/lib:/lib:/usr/local/lib:/usr/ccs/lib:/usr/progressive/lib:/usr/skunk/lib
-shell> MANPATH=scohelp:/usr/man:/usr/local1/man:/usr/local/man:/usr/skunk/man:
-@end example
-
-ºÇ½é¡¢@code{DBI} ¤ò¥¹¥¿¥Æ¥£¥Ã¥¯¥ê¥ó¥¯¤·¤¿Perl¤òºî¤ë¤¿¤á¤Ë¡¢
- @file{perl/DBI} ¥Ç¥£¥ì¥¯¥È¥ê¤Ç°Ê²¼¤Î¤è¤¦¤Ë¼Â¹Ô¤·¤Þ¤¹¡§
-
-@example
-shell> perl Makefile.PL -static -config
-shell> make
-shell> make install
-shell> make perl
-@end example
-
-¤³¤Î¸å¡¢¤¢¤Ê¤¿¤Ï¿·¤·¤¤Perl¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-@code{make perl} ¤ò¤¹¤ë¤È¡¢¥¤¥ó¥¹¥È¡¼¥ëÁàºî¤Ë¼Â¹Ô¤¹¤ë¤ËɬÍ×¤Ê @code{make} ¥³¥Þ¥ó¥É¤ò
-ɽ¼¨¤·¤Þ¤¹¡£
-SCO¤Ç¤Ï¡¢@code{make -f Makefile.aperl inst_perl MAP_TARGET=perl} ¤È¤·¤Þ¤¹¡£
-
-¼¡¤Ë¡¢@code{DBD::mysql} ¤ò¥¹¥¿¥Æ¥£¥Ã¥¯¥ê¥ó¥¯¤·¤¿Perl¤òºî¤ë¤¿¤á¤Ë¡¢
- @file{perl/Mysql-modules} ¥Ç¥£¥ì¥¯¥È¥ê¤Ç°Ê²¼¤Î¤è¤¦¤Ë¼Â¹Ô¤·¤Þ¤¹¡§
-
-@example
-shell> perl Makefile.PL -static -config
-shell> make
-shell> make install
-shell> make perl
-@end example
-
-¤³¤ì¤â¿·¤·¤¤Perl¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-@code{make perl} ¤Î½ÐÎϤϻÈÍѤ¹¤ë¥³¥Þ¥ó¥É¤ò¼¨¤·¤Þ¤¹¡£
-
-@node Source install system issues, Win32, Perl support, Installing
-@section System-specific issue
-
-°Ê²¼¤Î¥»¥¯¥·¥ç¥ó¤Ï¡¢¥½¡¼¥¹ÇÛÉÛ¤«¤é @strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ëºÝ¤Ë
-ÆÃÄê¤Î¥·¥¹¥Æ¥à¾å¤Ëµ¯¤³¤ë¤Èǧ¤á¤é¤ì¤¿ÌäÂê¤Î¤¤¤¯¤Ä¤«¤ò¼¨¤·¤Þ¤¹.
-
-@menu
-* Solaris:: Solaris notes
-* Solaris 2.7:: Solaris 2.7 notes
-* Solaris x86:: Solaris x86 notes
-* SunOS:: SunOS 4 notes
-* Linux:: Linux notes (all Linux versions)
-* Alpha-DEC-Unix:: Alpha-DEC-Unix notes
-* Alpha-DEC-OSF1:: Alpha-DEC-OSF1 notes
-* SGI-Irix:: SGI-Irix notes
-* FreeBSD:: FreeBSD notes
-* NetBSD:: NetBSD notes
-* OpenBSD:: OpenBSD 2.5 notes
-* BSDI:: BSD/OS notes
-* SCO:: SCO notes
-* SCO Unixware:: SCO Unixware 7.0 notes
-* IBM-AIX:: IBM-AIX notes
-* HP-UX 10.20:: HP-UX 10.20 notes
-* HP-UX 11.x::
-* MaxOSX:: MaxOSX notes
-@end menu
-
-@node Solaris, Solaris 2.7, Source install system issues, Source install system issues
-@subsection Solaris notes
-
-Solaris ¤Ç¤Ï @strong{MySQL} ¥½¡¼¥¹¤òŸ³«¤¹¤ë¤È¤­¥È¥é¥Ö¥ë¤¬½Ð¤ë¤Ç¤·¤ç¤¦¡ª
-Solaris ¤Î @code{tar} ¤ÏŤ¤Ì¾Á°¤ò°·¤¨¤º¡¢ @strong{MySQL} ¤òŸ³«¤¹¤ë¾ì¹ç¡¢
-°Ê²¼¤Î¤è¤¦¤Ê¥¨¥é¡¼¤Ë¤Ê¤ê¤Þ¤¹¡§
-
-@example
-x mysql-3.22.12-beta/bench/Results/ATIS-mysql_odbc-NT_4.0-cmp-db2,informix,ms-sql,mysql,oracle,solid,sybase, 0 bytes, 0 tape blocks
-tar: directory checksum error
-@end example
-
-¤³¤Î¾ì¹ç¡¢GNU @code{tar} (@code{gtar}) ¤òŸ³«¤Ë»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
-¥³¥ó¥Ñ¥¤¥ë¤º¤ß¤Î¤â¤Î¤¬°Ê²¼¤Ë¤¢¤ê¤Þ¤¹¡§
-@uref{http://www.mysql.com/Downloads/}.
-
-Sun ¥Í¥¤¥Æ¥£¥Ö¥¹¥ì¥Ã¥É¤Ï Solaris 2.5 °Ê¾å¤ÇÆ°¤­¤Þ¤¹¡£
-2.4 °Ê²¼¤Î¾ì¹ç¡¢@strong{MySQL} ¤Ï»þưŪ¤Ë MIT-pthreads ¤ò»ÈÍѤ·¤Þ¤¹ @xref{MIT-pthreads}.
-
-¤â¤·¡¢configure »þ¤Ë¡¢°Ê²¼¤Î¥¨¥é¡¼¤¬½Ð¤¿¤Ê¤é¡§
-
-@example
-checking for restartable system calls... configure: error can not run test
-programs while cross compiling
-@end example
-
-¤³¤ì¤Ï¥³¥ó¥Ñ¥¤¥é¡¼¤Î¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤Ê¤Ë¤«¤ò´Ö°ã¤Ã¤Æ¤¤¤Þ¤¹!
-¤³¤Î¾ì¹ç¡¢¤¢¤Ê¤¿¤Ï¡¢¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Ø¥³¥ó¥Ñ¥¤¥é¡¼¤ò¥¢¥Ã¥×¥°¥ì¡¼¥É¤¹¤Ù¤­¤Ç¤¹¡£
-°Ê²¼¤Î¹Ô¤ò @code{config.cache} ¥Õ¥¡¥¤¥ë¤ËÄɲ乤뤳¤È¤Ë¤è¤Ã¤Æ¡¢
-¤³¤ÎÌäÂê¤ò²ò·è¤·¤Æ¤â¤«¤Þ¤¤¤Þ¤»¤ó¡§
-
-@example
-ac_cv_sys_restartable_syscalls=$@{ac_cv_sys_restartable_syscalls='no'@}
-@end example
-
-
-¤â¤·¤¢¤Ê¤¿¤¬ SPARC ¤Î Solaris ¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Ê¤é¡¢
-@code{gcc} 2.95.2 ¤ò¿ä¾©¤·¤Þ¤¹¡£
-¤³¤ì¤Ï @uref{ttp://gcc.gnu.org/}. ¤Ç¸«¤Ä¤±¤ì¤Þ¤¹¡£
-@code{egs} 1.1.1 ¤È @code{gcc} 2.8.1 ¤Ï SPARC ¾å¤Ç¤Ï´°Á´¤ËÆ°ºî¤·¤Ê¤¤¤³¤È¤ËÃí°Õ¡ª
-
-@code{gcc} 2.95.2 ¤ò»ÈÍѤ·¤¿¡¢¿ä¾©¤¹¤ë @code{configure} ¤Ï:
-
-@example
-shell> CC=gcc CFLAGS="-O6" \
- CXX=gcc CXXFLAGS="-O6 -felide-constructors -fno-exceptions -fno-rtti" \
- ./configure --prefix=/usr/local/mysql --with-low-memory
-@end example
-
-¤â¤· Sun Workshop 4.2 compiler ¤ò»ÈÍѤ¹¤ë¤Ê¤é¡¢@code{configure} ¤ò°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-
-CC=cc CFLAGS="-xstrconst -Xa -xO4 -native -mt" CXX=CC CXXFLAGS="-xO4 -native -noex -mt" ./configure --prefix=/usr/local/mysql
-
-@example
-shell> CC=cc CFLAGS="-Xa -fast -xO4 -native -xstrconst -mt" \
- CXX=CC CXXFLAGS="-noex -XO4 -mt" \
- ./configure
-@end example
-
-@code{configure} ¥¹¥¯¥ê¥×¥È¤Î¼¡¤Î¹Ô¤ò¡§
-
-@example
-#if !defined(__STDC__) || __STDC__ != 1
-@end example
-
-°Ê²¼¤ËÊѤ¨¤Þ¤¹:
-
-@example
-#if !defined(__STDC__)
-@end example
-
-¤â¤· @code{-Xc} ¥ª¥×¥·¥ç¥ó¤Ç @code{__STDC__} ¤òÍ­¸ú¤Ë¤·¤¿¾ì¹ç¡¢
-Sun compiler ¤Ï Solaris ¤Î @file{pthread.h} ¥Ø¥Ã¥À¡¼¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤Æ
-¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£
-¤³¤ì¤Ï¥µ¥ó¤Î¥Ð¥°¤Ç¤¹(¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤«¥³¥ó¥Ñ¥¤¥é¡¼¤Î¥Ð¥°)
-
-¤â¤· @code{mysqld} ¤òµ¯Æ°»þ¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬½Ð¤¿¾ì¹ç¡¢
-¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤ò³°¤·¤Æ(¥ª¥×¥·¥ç¥ó @code{-mt} ¤ò»ØÄê) Sun compiler ¤ò»È¤Ã¤Æ
- @strong{MySQL} ¤ò¥³¥ó¥Ñ¥¤¥ë¤·Ä¾¤·¤Æ¤¯¤À¤µ¤¤¡§
-
-@example
-libc internal error: _rmutex_unlock: rmutex not held
-@end example
-
-@code{-mt} ¤ò @code{CFLAGS} ¤È @code{CXXFLAGS} ¤Ë²Ã¤¨¤Þ¤¹¡£
-
-@code{gcc} ¤Ç @strong{MySQL} ¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤È¤­¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬½Ð¤¿¾ì¹ç¡¢
-¤³¤ì¤Ï @code{gcc} ¤¬¤¢¤Ê¤¿¤Î Solaris ¤Î¥Ð¡¼¥¸¥ç¥óÍѤËÄ´À°¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡ª
-
-@example
-shell> gcc -O3 -g -O2 -DDBUG_OFF -o thr_alarm ...
-./thr_alarm.c: In function `signal_hand':
-./thr_alarm.c:556: too many arguments to function `sigwait'
-@end example
-
-¤³¤Î¾ì¹ç¡¢¿·¤·¤¤ @code{gcc} ¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¤Þ¤¹¡ª
-¾¯¤Ê¤¯¤È¤â Solaris 2.5 ¤Ç¤Ï¡¢¤Û¤È¤ó¤É¤Î @code{gcc} ¤Î¥Ð¥¤¥Ê¥ê¤Î¥Ð¡¼¥¸¥ç¥ó¤¬¸Å¤¯¡¢
-¥¹¥ì¥Ã¥É¤ò»ÈÍѤ¹¤ë¥×¥í¥°¥é¥à¤Ë¤Ï¤³¤Î¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ï»È¤¨¤Þ¤»¤ó¡ª
-
-Solaris ¤Ï ¥¹¥¿¥Æ¥Ã¥¯¥ê¥ó¥¯¤Î¥·¥¹¥Æ¥à¥é¥¤¥Ö¥é¥ê¡¼¤òÍÑ°Õ¤·¤Æ¤¤¤Þ¤»¤ó
-(@code{libpthreads} and @code{libdl})¡£
-¤½¤Î¤¿¤á¡¢@code{--static} ¥ª¥×¥·¥ç¥ó¤Ç @strong{MySQL} ¤ò¥³¥ó¥Ñ¥¤¥ë¤Ç¤­¤Þ¤»¤ó¡£
-¤â¤·¤³¤ì¤ò»î¤ß¤¿¾ì¹ç¡¢°Ê²¼¤Î¥¨¥é¡¼¤Ë¤Ê¤ê¤Þ¤¹¡§
-
-@example
-ld: fatal: library -ldl: not found
-@end example
-
-¤â¤·Â¿¤¯¤Î¥×¥í¥»¥¹¤¬Â®¤¯ @code{mysqld} ¤ËÀܳ¤ò»î¤ß¤¿¾ì¹ç¡¢
- @strong{MySQL} ¥í¥°¤Ë°Ê²¼¤Î¤è¤¦¤Ë¥¨¥é¡¼¤¬½Ð¤Þ¤¹:
-
-@example
-Error in accept: Protocol error
-@end example
-
-¥µ¡¼¥Ð¡¼¤ò @code{--set-variable back_log=50} ¥ª¥×¥·¥ç¥ó¤Çµ¯Æ°¤¹¤ì¤Ð¡¢¤³¤ÎÌäÂê¤ËÂнè¤Ç¤­¤ë¤Ç¤·¤ç¤¦¡£
-
-¤â¤·¼«Ê¬¤Î @strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤ò¥ê¥ó¥¯¤·¤Æ
-¼Â¹Ô»þ¤Ë°Ê²¼¤Î¤è¤¦¤Ë¥¨¥é¡¼¤¬½Ð¤¿¾ì¹ç¡§
-
-@example
-ld.so.1: ./my: fatal: libmysqlclient.so.#: open failed: No such file or directory
-@end example
-
-¤³¤ì¤Ï°Ê²¼¤Î¤É¤ì¤«¤Ç²óÈò¤Ç¤­¤Þ¤¹¡§
-
-@table @bullet
-@item
-°Ê²¼¤Î¥Õ¥é¥°¤Ç¥¯¥é¥¤¥¢¥ó¥È¤ò¥ê¥ó¥¯¤·¤Þ¤¹(@code{-Lpath} ¤ÎÂå¤ï¤ê¤Ë):
-@code{-Wl,r/full-path-to-libmysqlclient.so}
-@item
-@code{libmysqclient.so} ¤ò @file{/usr/lib} ¤Ë¥³¥Ô¡¼¤·¤Þ¤¹
-@item
-@tindex LD_RUN_PATH environment variable
-@tindex Environment variable, LD_RUN_PATH
-@code{LD_RUN_PATH} ´Ä¶­ÊÑ¿ô¤ò @file{libmysqlclient.so} ¤¬Â¸ºß¤¹¤ë¤È¤³¤í¤Ë
-¥»¥Ã¥È¤·¤¿¸å¡¢¥¯¥é¥¤¥¢¥ó¥È¤ò¼Â¹Ô¤·¤Þ¤¹¡£
-@end table
-
-@code{--with-libwrap} configure ¥ª¥×¥·¥ç¥ó»ÈÍÑ»þ¡¢@code{libwrap.a} ¤¬É¬
-ÍפȤ¹¤ë¥é¥¤¥Ö¥é¥ê¤â´Þ¤á¤ëɬÍפ¬¤¢¤ê¤Þ¤¹:
-
-@example
---with-libwrap="/opt/NUtcpwrapper-7.6/lib/libwrap.a -lnsl -lsocket
-@end example
-
-configure ¤ä @strong{MySQL} ¤¬ @code{-lz} ¤Î¥ê¥ó¥¯¤ò»î¤ß¡¢¤¢¤Ê¤¿¤¬¤½¤ì¤ò
-¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤¤¤Ê¤¤¤È¤¤¤¦ÌäÂ꤬¤¢¤ë¾ì¹ç¤Ï¡¢£²¤Ä¤ÎÁªÂò»è¤¬¤¢¤ê¤Þ¤¹:
-
-@itemize @bullet
-@item
-°µ½ÌÄÌ¿®¥×¥í¥È¥³¥ë¤ò»ÈÍѤǤ­¤ë¤è¤¦¤Ë¤·¤¿¤¤¾ì¹ç¡¢ftp.gnu.org ¤«¤é zlib ¤ò
-Æþ¼ê¤·¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-@item
-@code{--with-named-z-libs=no} ¤ò¤Ä¤±¤Æ configure ¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£
-@end itemize
-
-@node Solaris 2.7, Solaris x86, Solaris, Source install system issues
-@subsection Solaris 2.7 notes
-
-Ä̾Solaris 2.6 ¤Î¥Ð¥¤¥Ê¥ê¤Ï Solaris 2.7 ¤Ç»ÈÍѤǤ­¤Þ¤¹¡£
-¤Û¤È¤ó¤É¤Î Solaris 2.6 ¤ÎÌäÂê¤â Solaris 2.7 ¤ËŬÍѤǤ­¤Þ¤¹¡£
-
-Solaris 2.7 ¤Ï¡¢¥¤¥ó¥¯¥ë¡¼¥É¥Õ¥¡¥¤¥ë¤Ë¤¤¤¯¤Ä¤«¥Ð¥°¤¬¤¢¤ê¤Þ¤¹¡£
-@code{gcc} ¤Ç°Ê²¼¤Î¤è¤¦¤Ê¥¨¥é¡¼¤¬½Ð¤¿¾ì¹ç¡§
-
-@example
-/usr/include/widec.h:42: warning: `getwc' redefined
-/usr/include/wchar.h:326: warning: this is the location of the previous
-definition
-@end example
-
-°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ²óÈò¤·¤Þ¤¹¡§
-
-@code{/usr/include/widec.h} ¤ò @code{.../lib/gcc-lib/os/gcc-version/include} ¤Ë¥³¥Ô¡¼
-41 ¹ÔÌܤòÊѹ¹:
-
-@example
-Êѹ¹Á°¡§
-
-#if !defined(lint) && !defined(__lint)
-
-Êѹ¹¸å¡§
-
-#if !defined(lint) && !defined(__lint) && !defined(getwc)
-@end example
-
-Âå¤ï¤ê¤Ë¡¢@file{/usr/include/widec.h} ¤òľÀÜÊѹ¹¤·¤Æ¤â¤«¤Þ¤¤¤Þ¤»¤ó¡£
-¤É¤Á¤é¤ÎÊýË¡¤Ë¤·¤Æ¤â¡¢¥Õ¥¡¥¤¥ë¤ò½¤Àµ¸å¤Ï¡¢@file{config.cache} ¤ò
-¾Ã¤·¤Æ @code{configure} ¤òºÆ¼Â¹Ô¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡ª
-
-@code{make} ¼Â¹Ô»þ¤Ë°Ê²¼¤Î¤è¤¦¤Ê¥¨¥é¡¼¤Ë¤Ê¤Ã¤¿¾ì¹ç¡¢@code{configure} ¤¬
- @file{curses.h} ¥Õ¥¡¥¤¥ë¤ò¸¡½Ð¤Ç¤­¤Æ¤¤¤Þ¤»¤ó (¤³¤ì¤Ï @code{/usr/include/widec.h} ¤Î
-¥¨¥é¡¼¤Î¤¿¤á¤Ë¤ª¤­¤Þ¤¹):
-
-@example
-In file included from mysql.cc:50:
-/usr/include/term.h:1060: syntax error before `,'
-/usr/include/term.h:1081: syntax error before `;'
-@end example
-
-¤³¤ì¤ò²ò·è¤¹¤ë¤Ë¤Ï¡¢°Ê²¼¤Î¤¦¤Á°ì¤Ä¤ò¹Ô¤¤¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-Á°½Ò¤·¤¿¤È¤ª¤ê¡¢@file{/usr/include/widec.h} ¤ò½¤Àµ¤·¡¢configure ¤òºÆ¼Â¹Ô¤·¤Þ¤¹¡£
-@item
-@code{#define HAVE_TERM} ¹Ô¤ò @file{config.h} ¥Õ¥¡¥¤¥ë¤«¤é¾Ã¤·¡¢
-@code{make} ¤òºÆ¼Â¹Ô¤·¤Þ¤¹¡£
-@item
-@code{CFLAGS=-DHAVE_CURSES CXXFLAGS=-DHAVE_CURSES ./configure} ¤È¥³¥ó¥Õ¥£¥®¥ã¡¼¤·¤Þ¤¹¡£
-@end itemize
-
-@node Solaris x86, SunOS, Solaris 2.7, Source install system issues
-@subsection Solarix x86 notes
-
-@code{gcc} ¤« @code{egcs} ¤ò Solaris x86 ¤Ç»ÈÍѤ·¤¿¾ì¹ç¡¢load »þ¤Ë¥³¥¢¥À¥ó¥×¤¹¤ë¾ì¹ç¡¢
-°Ê²¼¤Î¤è¤¦¤Ë @code{configure} ¤·¤Þ¤¹:
-
-@example
-shell> CC=gcc CFLAGS="-O6 -fomit-frame-pointer" \
- CXX=gcc \
- CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" \
- ./configure --prefix=/usr/local/mysql
-@end example
-
-¤³¤ì¤Ï @code{libstdc++} ¥é¥¤¥Ö¥é¥ê¡¼¤È C++ ¤ÎÌäÂê¤ò²óÈò¤·¤Þ¤¹¡£
-
-¤â¤·¤³¤ì¤¬³ºÅö¤·¤Ê¤¤¾ì¹ç¡¢¥Ç¥Ð¥Ã¥°¥â¡¼¥É¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¤Æ
-¥Ç¥Ð¥Ã¥°¤Î¥È¥ì¡¼¥¹¥Õ¥¡¥¤¥ë¤ò½ñ¤­½Ð¤¹¤è¤¦¤Ë¤·¤Æµ¯Æ°¤¹¤ë¤«¡¢
-@code{gdb} ¤ò»ÈÍѤ·¤Æµ¯Æ°¤·¤Æ¤¯¤À¤µ¤¤¡£
-@xref{Debugging server}.
-
-@node SunOS, Linux, Solaris x86, Source install system issues
-@subsection SunOS 4 notes
-
-SunOS 4 ¤Ç¤Ï MIT-pthreads ¤¬É¬ÍפǤ¹¡£
-¤³¤Î¤¿¤á¤Ë¡¢ GNU @code{make} ¤¬ @strong{MySQL} ¤Î¥³¥ó¥Ñ¥¤¥ë¤ËɬÍפˤʤê¤Þ¤¹¡£
-
-¤¤¤¯¤Ä¤«¤Î SunOS 4 ¤Ç¤Ï dynamic libraries ¤È @code{libtool} ¤ËÌäÂ꤬¤¢¤ê¤Þ¤¹¡£
-¤³¤ì¤òÈò¤±¤ë¤¿¤á¤Ë¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ @code{configure} ¤·¤Þ¤¹¡§
-
-@example
-shell> ./configure --disable-shared --with-mysqld-ldflags=-all-static
-@end example
-
-@code{readline} ¤Î¥³¥ó¥Ñ¥¤¥ë»þ¡¢Æó½ÅÄêµÁ¤Î¥ï¡¼¥Ë¥ó¥°¤¬½Ð¤Þ¤¹¤¬¡¢
-¤³¤ì¤Ï̵»ë¤·¤Æ¹½¤¤¤Þ¤»¤ó¡£
-
-@code{mysqld} ¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë»þ¡¢
-¤¤¤¯¤Ä¤« @code{implicit declaration of function} ¥ï¡¼¥Ë¥ó¥°¤¬¤Ç¤Þ¤¹¤¬¡¢
-̵»ë¤·¤Æ¹½¤¤¤Þ¤»¤ó¡£
-
-@node Linux, Alpha-DEC-Unix, SunOS, Source install system issues
-@subsection Linux notes (all Linux versions)
-
-Linux ¤Ç¤Ï @strong{MySQL} ¤Ï LinuxThreads ¤ò»ÈÍѤ·¤Þ¤¹¡£
-¤â¤· @code{glibc2} ¤ò»ý¤¿¤Ê¤¤¸Å¤¤ Linux ¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢
-@strong{MySQL} ¤Î¥³¥ó¥Ñ¥¤¥ë¤ÎÁ°¤Ë¡¢
-LinuxThreads ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-@uref{http://www.mysql.com/Downloads/Linux}
-
-Ãí°Õ: 2.1.1 ¤È¤½¤ì°ÊÁ°¤Î @code{glibc} ¥Ð¡¼¥¸¥ç¥ó¤Ï
-@code{pthread_mutex_timedwait} ÁàºîÃæ¤ËÃ×̿Ū¤Ê¥Ð¥°¤¬¤¢¤ê¤Þ¤¹¡£¤³¤ì¤Ï
-@code{INSERT DELAYED} ¤ò¹Ô¤Ê¤¦»þ¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£@code{INSERT DELAYED} ¤ò
-»ÈÍѤ¹¤ë¾ì¹ç¡¢¼¡¤Î¥Ñ¥Ã¥Á¤ò glibc ¥é¥¤¥Ö¥é¥ê¤ËÄɲÃ@strong{¤·¤Ê¤±¤ì¤Ð¤Ê¤ê
-¤Þ¤»¤ó}:
-@uref{http://www.mysql.com/Downloads/Patches/glibc-pthread_cond_timedwait.patch}¡£
-@strong{MySQL} 3.23.7 ¤È @strong{MySQL} 3.22.32 ¤Ï¤³¤Î¥Ð¥°¤Î°ì»þŪ¤Ê²óÈò
-¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£
-
-1000°Ê¾å¤ÎƱ»þÀܳ¤ò»ÈÍѤ¹¤ëͽÄê¤Ç¤¢¤ì¤Ð¡¢LinuxThreads ¤Ë¤¤¤¯¤Ä¤«¤ÎÊѹ¹
-¤ò¤·¤Æ¡¢ºÆ¥³¥ó¥Ñ¥¤¥ë¤·¡¢MySQL ¤ò¿·¤·¤¤ libthread.a ¤ò»ÈÍѤ¹¤ë¤è¤¦¤ËºÆ¥ê
-¥ó¥¯¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£sysdeps/unix/sysv/linux/bits/local_lim.h Æâ¤Î
-PTHREAD_THREADS_MAX ¤ò 4096 ¤ËÁý²Ã¤·¡¢internals.h Ãæ¤Î STACK_SIZE ¤ò
-256 KB ¤Ë¸º¾¯¤µ¤»¤Æ¤¯¤À¤µ¤¤¡£Ãí°Õ: STACK_SIZE ¤¬¥Ç¥Õ¥©¥ë¥È¤Î 2MB ¤Ç¤¢¤ë
-¾ì¹ç¡¢MySQL ¤Ï 1000 ÄøÅÙ¤ÎÀܳ¤Ç°ÂÄê¤Ç¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£
-
-glibc 2.1.3-65 ¤«¤½¤ì°Ê¹ß¤Î¾ì¹ç¡¢STACK_SIZE ¤òÁý¤ä¤¹É¬ÍפϤ¢¤ê¤Þ¤»¤ó;
-@code{mysqld} ¤Î @code{thread_stack} ÃͤòÂå¤ï¤ê¤ËÊѹ¹¤Ç¤­¤Þ¤¹¡£
-
-If you use a lot of concurrent connections, you may suffer from a 2.2
-kernel "feature" that penalizes a process for forking or cloning a child
-in an attempt to prevent a fork bomb attack. This will cause MySQL not
-to scale well as you increase the number of concurrent clients. On
-single CPU systems, we have seen this manifested in a very slow thread
-creation - which means it may take a long time to connect to MySQL ( as
-long as 1 minute), and it may take just as long to shut it down. On
-multiple CPU systems, we have observed a gradual drop in query speed as
-the number of clients increases. In the process of trying to find a
-solution, we have received a kernel patch from one of our users, who
-claimed it made a lot of difference for his site. We have done some
-limited testing in which the patch greatly improved the scalabitility of
-MySQL. The patch is available
-@uref{http://www.mysql.com/Downloads/Patches/linux-fork.patch,here} - be
-warned, though, that we assume no reponsibility for any damage that this
-patch could do - use at your own risk. We have also been told by the
-Linux kernel developers that this problem is fixed in 2.4, although we
-have not yet done any testing.
-
-¤â¤· @code{mysqld} ¤¬Æ°¤«¤Ê¤«¤Ã¤¿¤ê¡¢ @code{mysql_install_db} ¤¬Æ°¤«¤Ê¤¤¾ì¹ç¡¢
-°Ê²¼¤òÆɤߤ¹¤¹¤á¤Æ¤¯¤À¤µ¤¤¡ª
-LinuxThreads ¤« @code{libc}/@code{glibc} ¥é¥¤¥Ö¥é¥ê¡¼¤ËÌäÂê¤Î¤¢¤ë Linux ¥·¥¹¥Æ¥à¤À¤±¤Ëµ¯¤³¤ê¤Þ¤¹¡£
-¤·¤«¤· @strong{MySQL} ¤òÆ°¤«¤»¤ë¤¿¤á¤Ë´Êñ¤ÊÊýË¡¤¬Â¿¤¯¤¢¤ê¤Þ¤¹¡£
-°ìÈÖ´Êñ¤ÊÊýË¡¤Ï¡¢¥Ð¥¤¥Ê¥ê¤Ë¤Ê¤Ã¤¿ @strong{MySQL} (not the RPM) ¤ò»ÈÍѤ¹¤ë¤³¤È¤Ç¤¹¡¨
-¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Î¥Ð¥¤¥Ê¥ê¤Ï¡¢¤¢¤Ê¤¿¼«¿È¤¬¥³¥ó¥Ñ¥¤¥ë¤·¤¿¤â¤Î¤è¤ê 10% ¤Û¤É®¤¤¤Ç¤·¤ç¤¦¡ª
-@xref{Compile and link options}.
-
-°ì¤ÄÃΤé¤ì¤Æ¤¤¤ëÌäÂê¤È¤·¤Æ¡¢¥Ð¥¤¥Ê¥êÇÛÉÛ¤ò @code{libc5} ¤Î¸Å¤¤ Linux ¥·¥¹¥Æ¥à
-(RedHat 4.x , Slackware 3.6°Ê²¼, Debian 1.3 bo °Ê²¼¤Ê¤É)
-¤Ç»ÈÍѤ¹¤ë¤È¡¢¥Û¥¹¥È̾²ò·è¤ÎÃ×̿Ū¤Ê¥¨¥é¡¼¤¬½Ð¤Þ¤¹
-@xref{Binary notes-Linux}.
-
-@code{myisamchk} ¤Ï @code{libc.so.5.3.12} ¤Ç»ÈÍѤ¹¤ë¤È¥Ï¥ó¥°¤ê¤Þ¤¹.
-ºÇ¿·¤Î @code{libc} ¤Ë¥¢¥Ã¥×¥°¥ì¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-LinuxThreads ¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢ºÇÄ㣳¤Ä¤Î¥×¥í¥»¥¹¤¬Áö¤ê¤Þ¤¹¡£
-¤³¤ì¤é¤Ï¼Â¥¹¥ì¥Ã¥É¤Ç¡¢°ì¤Ä¤Ï LinuxThreads ¥Þ¥Í¡¼¥¸¥ã¡¼¤Î¤¿¤á¤Ë¡¢
-°ì¤Ä¤ÏÀܳ¤Î¥Ï¥ó¥É¥ë¤Ë¡¢¤â¤¦¤Ò¤È¤Ä¤Ï¥¢¥é¡¼¥à¤È¥·¥°¥Ê¥ë¤Î¥Ï¥ó¥É¥ë¤Ç¤¹¡£
-
-Ãí°Õ: linux ¥«¡¼¥Í¥ë¤È linuxthread ¥é¥¤¥Ö¥é¥ê¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï 1024 ¥¹¥ì¥Ã
-¥É¤À¤±»ý¤Ä¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤ì¤Ï¥Ñ¥Ã¥Á¤òŬÍѤ·¤Æ¤¤¤Ê¤¤¥·¥¹¥Æ¥à¾å¤Ç¤Ï
-MySQL ¤Ø¤ÎÀܳ¤ÏºÇÂç 1021 ¤À¤±¤Ç¤¢¤ë¤È¤¤¤¦¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£¥Ú¡¼¥¸
-@uref{http://www.volano.com/linuxnotes.html} ¤Ï¤³¤ÎÀ©¸Â¤ò¤É¤Î¤è¤¦¤Ë²óÈò
-¤¹¤ë¤«¤Î¾ðÊ󤬴ޤޤì¤Æ¤¤¤Þ¤¹¡£
-
-¤â¤· @code{mysqld} ¥Ç¡¼¥â¥ó¥×¥í¥»¥¹¤¬ @code{ps} ¤Ê¤É¤Ç¤ß¤ë¤È»à¤ó¤Ç¤¤¤ë¤è¤¦¤Ç¤¢¤ì¤Ð,
-Ä̾盧¤ì¤Ï @strong{MySQL} ¥Ð¥°¤«¡¢²õ¤ì¤¿¥Æ¡¼¥Ö¥ë¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£
-@xref{Crashing}.
-
-LinuxThreads ¤ò»ÈÍѤ·¤Æ¤¤¤Æ @code{mysqladmin shutdown} ¤¬Æ°¤«¤Ê¤¤¾ì¹ç¡¢
-LinuxThreads 0.7.1 °Ê¾å¤Ë¥¢¥Ã¥×¥°¥ì¡¼¥É¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-RedHat ¤ò»ÈÍѤ·¤Æ¤¤¤Æ, °Ê²¼¤Î¤è¤¦¤Ê¥¨¥é¡¼¤¬½Ð¤¿¾ì¹ç¡§
-
-@example
-/usr/bin/perl is needed...
-/usr/sh is needed...
-/usr/sh is needed...
-@end example
-
-¤³¤Î¾ì¹ç¡¢ @code{rpm} ¤Î¥Ð¡¼¥¸¥ç¥ó¤ò
- @file{rpm-2.4.11-1.i386.rpm} ¤È @file{rpm-devel-2.4.11-1.i386.rpm} (°Ê¾å)
- ¤Ë¤·¤Ê¤¯¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£
-
-RedHat 4.2 ¤Ï°Ê²¼¤«¤é¥¢¥Ã¥×¥°¥ì¡¼¥É¤¬Æþ¼ê¤Ç¤­¤Þ¤¹¡£
-@uref{ftp://ftp.redhat.com/updates/4.2/i386}.
-¤¢¤ë¤¤¤Ï¾¤Î¾ì¹ç¤Ï
-@uref{http://www.sunsite.unc.edu/pub/Linux/distributions/redhat/code/rpm/}
-
-¤â¤· @strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¤ò¼Â¹Ô¤·¤Æ°Ê²¼¤Î¥¨¥é¡¼¤Ë¤Ê¤Ã¤¿¾ì¹ç¡§
-
-@example
-ld.so.1: ./my: fatal: libmysqlclient.so.4: open failed: No such file or directory
-@end example
-
-°Ê²¼¤ÎÊýË¡¤Ç²ò·è¤Ç¤­¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-¥¯¥é¥¤¥¢¥ó¥È¤ò°Ê²¼¤Î¥Õ¥é¥°¤Ç(@code{-Lpath}¤Î¤«¤ï¤ê¤Ë)¥ê¥ó¥¯¤·¤Þ¤¹¡§
-@code{-Wl,r/path-libmysqlclient.so}
-@item
-@code{libmysqclient.so} ¤ò @file{/usr/lib} ¤Ë¥³¥Ô¡¼¤·¤Þ¤¹
-@item
-@tindex LD_RUN_PATH environment variable
-@tindex Environment variable, LD_RUN_PATH
-@code{LD_RUN_PATH} ´Ä¶­ÊÑ¿ô¤ò @file{libmysqlclient.so} ¤¬Â¸ºß¤¹¤ë¾ì½ê¤ËÀßÄꤷ¤Þ¤¹¡£
-(¥¯¥é¥¤¥¢¥ó¥È¤ò¼Â¹Ô¤¹¤ëÁ°¤ËÀßÄꤷ¤Þ¤¹)
-@end itemize
-
-ÉÙ»ÎÄÌ¥³¥ó¥Ñ¥¤¥é @code{(fcc / FCC)} ¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢@strong{MySQL}
-¤Î¥³¥ó¥Ñ¥¤¥ë¤Ë¤¤¤¯¤Ä¤«¤ÎÌäÂ꤬¤¢¤ê¤Þ¤¹¡£Linux ¥Ø¥Ã¥À¥Õ¥¡¥¤¥ë¤Ï¤È¤Æ¤â
-@code{gcc} »Ø¸þ¤Ç¤¢¤ë¤¿¤á¤Ç¤¹¡£
-
-¼¡¤Î @code{configure} ¹Ô¤Ï @code{fcc/FCC} ¤ÇÆ°ºî¤·¤Þ¤¹:
-
-@example
-CC=fcc CFLAGS="-O -K fast -K lib -K omitfp -Kpreex -D_GNU_SOURCE -DCONST=const -DNO_STRTOLL_PROTO" CXX=FCC CXXFLAGS="-O -K fast -K lib -K omitfp -K preex --no_exceptions --no_rtti -D_GNU_SOURCE -DCONST=const -Dalloca=__builtin_alloca -DNO_STRTOLL_PROTO '-D_EXTERN_INLINE=static __inline'" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static --disable-shared --with-low-memory
-@end example
-
-@menu
-* Linux-x86:: Linux-x86 notes
-* Linux-RedHat50:: RedHat 5.0 notes
-* Linux-RedHat51:: RedHat 5.1 notes
-* Linux-SPARC:: Linux-Sparc notes
-* Linux-Alpha:: Linux-Alpha notes
-* MKLinux:: MkLinux notes
-* Qube2:: Qube2 Linux notes
-@end menu
-
-@node Linux-x86, Linux-RedHat50, Linux, Linux
-@subsubsection Linux-x86 notes
-
-@strong{MySQL} ¤Ï @code{libc} 5.4.12 °Ê¾å¤¬É¬ÍפǤ¹¡£@code{libc} 5.4.46 ¤ÇÆ°ºî¤·¤Þ¤¹¡£
-@code{glibc} 2.0.6 °Ê¾å¤Ç¤âÆ°ºî¤·¤Þ¤¹¡£
-@code{glibc} ¤Î RPM ¤Ë¤Ï¤¤¤¯¤Ä¤«ÌäÂ꤬¤¢¤ê¡¢¥¢¥Ã¥×¥Ç¡¼¥È¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£
-@code{glibc} 2.0.7-19 ¤È 2.0.7-29 RPM ¤ÇÆ°ºî¤·¤Þ¤¹¡£
-
-¸Å¤¤ Linux ÇÛÉÛʪ¤Ç¤Ï¡¢@code{configure} »þ¤Ë°Ê²¼¤Î¤è¤¦¤Ê¥¨¥é¡¼¤¬½Ð¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡§
-
-@example
-Syntax error in sched.h. Change _P to __P in the /usr/include/sched.h file.
-See the Installation chapter in the Reference Manual.
-@end example
-
-¤³¤ì¤Ï @code{_P} ¥Þ¥¯¥í¤¬°ì¤Ä¤Î¥¢¥ó¥À¡¼¥¹¥³¥¢¤·¤«¤â¤Æ¤Ê¤¤¤¿¤á¤Ç¡¢
-¤³¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Î¤è¤¦¤ËÂн褷¤Æ¤¯¤À¤µ¤¤¡£
-
-°Ê²¼¤Î¤è¤¦¤Ê¥ï¡¼¥Ë¥ó¥°¤Ï̵»ë¤·¤Æ¹½¤¤¤Þ¤»¤ó¡§
-
-@example
-mysqld.cc -o objs-thread/mysqld.o
-mysqld.cc: In function `void init_signals()':
-mysqld.cc:315: warning: assignment of negative value `-1' to `long unsigned int'
-mysqld.cc: In function `void * signal_hand(void *)':
-mysqld.cc:346: warning: assignment of negative value `-1' to `long unsigned int'
-@end example
-
-Debian GNU/Linux ¤Ç¤Ï¡¢@strong{MySQL} ¤ò¥Þ¥·¥ó¤Îµ¯Æ°»þ¤ËΩ¤Á¤¢¤²¤ë¤¿¤á¤Ë¤Ï¡¢
-°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-
-@example
-shell> cp support-files/mysql.server /etc/init.d/mysql.server
-shell> /usr/sbin/update-rc.d mysql.server defaults 99
-@end example
-
-@code{mysql.server} ¥¹¥¯¥ê¥×¥È¤Ï @strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿Àè¤Î
- @file{share/mysql} directory ¤Ë¤¢¤ê¤Þ¤¹¡£
-¤¢¤ë¤¤¤Ï¡¢ @strong{MySQL} ¤Î¥½¡¼¥¹¤ÎÃæ¤Î @file{support-files} ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ê¤Þ¤¹¡£
-
-
-@code{mysqld} ¤¬¤Ä¤Í¤Ë¥¹¥¿¡¼¥È»þ¤Ë¥³¥¢¤ò¤Ï¤¯¾ì¹ç¡¢
-¸Å¤¤ @file{/lib/libc.a} ¤ò»ÈÍѤ·¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-@file{sql/mysqld} ¤ò¾Ãµî¤·¤Æ¡¢¿·¤·¤¯ @code{make install} ¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
-¤³¤ì¤Ï¤¤¤¯¤Ä¤«¤Î Slackware ¤ÇÊó¹ð¤µ¤ì¤¿¸½¾Ý¤Ç¤¹¡£
-RedHat 5.0 ¤Ï @code{glibc} ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤Ã¤ÆÌäÂ꤬ȯÀ¸¤·¤Þ¤¹¡£
-@xref{Linux-RedHat50}.
-
-¤â¤· @code{mysqld} ¤ò¥ê¥ó¥¯¤¹¤ë¾ì¹ç¤Ë°Ê²¼¤Î¤è¤¦¤Ê¥¨¥é¡¼¤¬½Ð¤¿¾ì¹ç¡¢
- @file{libg++.a} ¤¬Àµ¤·¤¯¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡§
-
-@example
-/usr/lib/libc.a(putc.o): In function `_IO_putc':
-putc.o(.text+0x0): multiple definition of `_IO_putc'
-@end example
-
-@file{libg++.a} ¤Î»ÈÍѤòÈò¤±¤ë¤Ë¤Ï¡¢ @code{configure} ¤ò°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-
-@example
-shell> CXX=gcc ./configure
-@end example
-
-@node Linux-RedHat50, Linux-RedHat51, Linux-x86, Linux
-@subsubsection RedHat 5.0 notes
-
-¤â¤· RedHat ¤Ç @strong{MySQL} ¤ËÌäÂ꤬¤¢¤ë¾ì¹ç¡¢¤Þ¤º @code{glibc} ¤Î¥Ð¡¼¥¸¥ç¥ó¤ò¿·¤·¤¤¤â¤Î¤Ë¤¢¤²¤Æ¤¯¤À¤µ¤¤¡ª
-
-RedHat ¤Î¥ª¥Õ¥£¥·¥ã¥ë¥Ñ¥Ã¥Á(including @code{glibc-2.0.7-19} and @code{glibc-devel-2.0.7-19})
-¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤¤¤ë¤Ê¤é¡¢ @strong{MySQL} ¤ÏÌäÂê¤Ê¤¯Æ°¤¯¤Ï¤º¤Ç¤¹¡ª
-
-@code{glibc} 2.0.5 ¤Ë¤Ï @code{pthread_key_create} ÊÑ¿ô¤ò²òÊü¤¹¤ëÉôʬ¤Ë¥Ð¥°¤¬¤¢¤ê¡¢
-¥¢¥Ã¥×¥Ç¡¼¥È¤¬É¬ÍפǤ¹¡£@code{glibc} 2.0.5 ¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢
-¥¹¥¿¥Æ¥£¥Ã¥¯¥ê¥ó¥¯¤µ¤ì¤ÆºîÀ®¤µ¤ì¤¿ @strong{MySQL} ¥Ð¥¤¥Ê¥êÇÛÉÛʪ¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£
-¥½¡¼¥¹¤«¤é¥³¥ó¥Ñ¥¤¥ë¤·¤¿¤¤¾ì¹ç¡¢ @uref{http://www.mysql.com/Downloads/Linux} ¤Ë¤¢¤ë
-LinuxThreads ¤Î½¤ÀµÈǤò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤«¡¢
-¤¢¤ë¤¤¤Ï @code{glibc} ¤ò¥Ð¡¼¥¸¥ç¥ó¥¢¥Ã¥×¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-
-¤â¤· @code{glibc} or LinuxThreads ¤Î¥Ð¡¼¥¸¥ç¥ó¤¬ÌäÂê¤Î¤¢¤ë¤â¤Î¤À¤È¡¢
- @code{mysqld} ¤Ï¥³¥Í¥¯¥·¥ç¥ó¤ÎÅ٤˥¯¥é¥Ã¥·¥å¤·¤Þ¤¹¡£
-Î㤨¤Ð¡¢@code{mysqladmin version} ¤Ï @code{mysqld} ¤ò´°Á´¤Ë¥¯¥é¥Ã¥·¥å¤·¤Þ¤¹¡ª
-
-¤Þ¤¿¡¢ÌäÂê¤Î¤¢¤ë¥é¥¤¥Ö¥é¥ê¡¼¤ò»ÈÍѤ·¤Æ¤¤¤ë¤È¡¢ @code{mysqld} ¤Ïµ¯Æ°»þ¤Ë¥¯¥é¥Ã¥·¥å¤·¤Þ¤¹¡£
-¤¤¤¯¤Ä¤«¤Î Linux systems ¤Ç¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ configure ¤Ç¤³¤ì¤òÈò¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡§
-
-@example
-shell> ./configure --with-mysqld-ldflags=-all-static
-@end example
-
-RedHat 5.0 ¤Ç¤Ï¡¢@code{glibc} 2.0.7-19 RPM ¤ò´Êñ¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤­¤Þ¤¹¤Î¤Ç¡¢
-¥¤¥ó¥¹¥È¡¼¥ë¸å¡¢@code{--with-mysqld-ldflags=-all-static} ¤Ê¤·¤Ç @code{configure} ¤Ç¤­¤Þ¤¹¡£
-
-@code{glibc} 2.0.7 ¤Î¥½¡¼¥¹¤ËÂФ¹¤ë¥Ñ¥Ã¥Á¤Ï
-@example
-@uref{http://www.mysql.com/Download/Linux/glibc-2.0.7-total-patch.tar.gz}
-@end example
- ¤Ë¤¢¤ê¤Þ¤¹¡£
-¤³¤Î¥Ñ¥Ã¥Á¤Ï @strong{MySQL} ¤¬¥Æ¥¹¥È¤µ¤ì¤¿¥Ñ¥Ã¥Á¤Ç¡¢´Êñ¤ËŬÍѤǤ­¤Þ¤¹¡£
-
-¤â¤· @strong{MySQL} ¹½ÃÛ»þ¤Ë¥¯¥é¥Ã¥·¥å¤¹¤ë¾ì¹ç¡¢¿·¤·¤¤ @strong{MySQL} ¤Î
-¥Ð¥¤¥Ê¥ê¤ò¥À¥¦¥ó¥í¡¼¥É¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£¤³¤ì¤Ï¥¹¥¿¥Æ¥£¥Ã¥¯¥ê¥ó¥¯¤ÇºîÀ®¤µ¤ì¤Æ¤ª¤ê¡¢
-¥é¥¤¥Ö¥é¥ê¡¼¤Î¾×ÆͤòÈò¤±¤ë¤³¤È¤¬¤Ç¤­¡¢Á´¤Æ¤Î Linux ¤ÇÆ°¤¯¤Ï¤º¤Ç¤¹¡ª
-
-@strong{MySQL} ¤Ï¥Ç¥Ð¥Ã¥°¤Î¤¿¤á¥È¥ì¡¼¥¹¥Õ¥¡¥¤¥ë¤Ë¾ðÊó¤ò½ñ¤­½Ð¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¤³¤ì¤ÏÌäÂê¤ò²ò·è¤¹¤ë¤¿¤á¤Ë¥Ò¥ó¥È¤Ë¤Ê¤ë¾ðÊó¤ò¿¤¯½ÐÎϤ·¤Þ¤¹¡£
-@xref{Debugging server}.
-
-@node Linux-RedHat51, Linux-SPARC, Linux-RedHat50, Linux
-@subsubsection RedHat 5.1 notes
-
-RedHat 5.1 ¤Î @code{glibc} (@code{glibc} 2.0.7-13) ¤Ï¥á¥â¥ê¡¼¥ê¡¼¥¯¤·¤Þ¤¹¡£
-@code{glibc} ¤ò 2.0.7-19 ¤Ë¥¢¥Ã¥×¥°¥ì¡¼¥É¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-¤¢¤ë¤¤¤Ï¡¢¥Ð¥¤¥Ê¥êÇÛÉۤΠ@code{mysqld} ¤ò»ÈÍѤ¹¤ë¤«¤Ç¤¹¡£
-¤â¤·¤³¤ì¤ò¹Ô¤ï¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¥á¥â¥ê¡¼´ØÏ¢¤ÎÌäÂ꤬ȯÀ¸¤·¤Þ¤¹(out of memory, etc.,etc.)¡£
-¿¤¯¤Î¾ì¹ç°Ê²¼¤Î¤è¤¦¤Ë¡§
-
-@example
-Can't create a new thread (errno 11). If you are not out of available
-memory, you can consult the manual for any possible OS dependent bug
-@end example
-
-@code{glibc} 2.0.7-19 ¤Ë¥¢¥Ã¥×¥°¥ì¡¼¥É¸å¤Ï¡¢@strong{MySQL} ¤ò
-¥À¥¤¥Ê¥ß¥Ã¥¯¥ê¥ó¥¯»ØÄê(¥Ç¥Õ¥©¥ë¥È)¤Ç configure ¤Ç¤­¤Þ¤¹¡£
-¤¬¡¢@code{glibc} 2.0.7-19 ¤ò¥½¡¼¥¹¤«¤é¥¤¥ó¥¹¥È¡¼¥ë¤·¤Ê¤¤¸Â¤ê¡¢
-@code{--with-mysqld-ldflags=-all-static} ¥ª¥×¥·¥ç¥ó¤Ï @code{configure} ¤Ç@strong{»ÈÍѤǤ­¤Þ¤»¤ó}¡ª
-
-@code{glibc} ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï @code{rpm -q glibc} ¤Ç³Îǧ¤Ç¤­¤Þ¤¹¡£
-
-@node Linux-SPARC, Linux-Alpha, Linux-RedHat51, Linux
-@subsubsection Linux-SPARC notes
-
-¤¤¤¯¤Ä¤«¤ÎËä¤á¹þ¤ß´Ø¿ô, @code{readdir_r()} ¤¬²õ¤ì¤Þ¤¹¡£
-¤³¤Î¸²¤ì¤È¤·¤Æ¡¢@code{SHOW DATABASES} ¤¬¾ï¤Ë¶õ¤òÊÖ¤·¤Þ¤¹¡£
-¤³¤ì¤Ï configure ¸å¡¢¥³¥ó¥Ñ¥¤¥ë¤¹¤ëÁ°¤Ë¡¢
-@file{config.h} ¤«¤é @code{HAVE_READDIR_R} ¤ò¼è¤ê½ü¤¯¤³¤È¤Ç²ò·è¤·¤Þ¤¹¡£
-
-¤½¤Î¾¤¤¤¯¤Ä¤«¤ÎÌäÂê¤Ï¡¢¤¢¤Ê¤¿¤Î Linux ¤Ë¥Ñ¥Ã¥Á¤òÅö¤Æ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-¥Ñ¥Ã¥Á¤Ï @uref{http://www.mysql.com/patches/Linux-sparc-2.0.30.diff} ¤Ë¤¢¤ê¤Þ¤¹¡£
-¤³¤Î¥Ñ¥Ã¥Á¤Ï¡¢@code{vger.rutgers.edu} ¤Ë¤¢¤ë @file{sparclinux-2.0.30.tar.gz} ÍѤǤ¹¡£
-(¤³¤ì¤ÏÀµ¼°¤Î 2.0.30 ¤È¤Ï°ã¤¤¤Þ¤¹¡£¥Ñ¥Ã¥Á¤òÀµ¼°2.0.30¤ËÅö¤Æ¤Ê¤¤¤è¤¦¤Ë)
-¤½¤·¤Æ LinuxThreads 0.6 ¤«¤½¤ì°Ê¾å¤Ë¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-
-¤³¤ì¤Ï @email{jacques@@solucorp.qc.ca} ¤«¤é´ó¤»¤é¤ì¤Þ¤·¤¿¡£
-
-@node Linux-Alpha, MKLinux, Linux-SPARC, Linux
-@subsubsection Linux-Alpha notes
-
-@strong{MySQL} 3.23.12 ¤¬¡¢Linux-Alpha ¾å¤ÇºÇ½é¤Ë¥Æ¥¹¥È¤µ¤ì¤¿¥Ð¡¼¥¸¥ç¥ó¤Ç¤¹¡£
-¤â¤· @strong{MySQL} ¤ò Linux-Alpha ¾å¤Ç»ÈÍѤ·¤¿¤¤¤È¹Í¤¨¤¿¤Ê¤é¡¢
-¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤è¤ê¿·¤·¤¤¤â¤Î¤ò»ÈÍѤ·¤Þ¤¹¡£
-
-Linux-Alpha ¤Ç¤Î°ìÈÖÂ礭¤ÊÌäÂê¤Ï¡¢¤³¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Î @code{glibc} ¤Ë
-¤Þ¤À¤¤¤¯¤Ä¤«ÌäÂ꤬¤¢¤ë¤³¤È¤Ç¤¹¡£ ºÇ¿·¤Î @code{glibc} ¤òÆÀ¤ë¤³¤È¤«¤é
-¤Ï¤¸¤á¤Æ¤¯¤À¤µ¤¤¡£
-
-We have tested @strong{MySQL} on Alpha with our benchmarks + test suite and
-it appears to work nicely. The main thing we haven't yet had time to test
-is how things works with many concurrent users.
-
-When we compiled @strong{MySQL} we where using SuSE 6.3, kernel 2.2.13-SMP,
-egcs 1.1.2 and libc-2.1.2-28.
-
-We used the following configure line:
-
-@example
-CFLAGS="-O6 -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --disable-shared
-@end example
-
-If you have access to Compaq's C compiler, the following configure line
-will give you about 9 % more performance:
-@example
-CC=ccc CFLAGS="-fast -O3 -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti -mcpu=ev6 -Wa,-mev6" CXXLDFLAGS='/usr/lib/compaq/libots-2.2.7/libots.so /usr/lib/compaq/cpml-5.0.0/libcpml_ev6.a' ./configure --prefix=/usr/local/mysql --disable-shared
-@end example
-
-Note that the last example assumes your are using an Alpha EV6 processor.
-
-Some known problems when running @strong{MySQL} on Linux-Alpha:
-
-@itemize @bullet
-@item
-If you create many files ( > 10000) in one directory (as done by the
-@code{test-create} in the @strong{MySQL} benchmarks, mysqld may report
-the error @code{Can't create/write to file '...' (Errcode: 12)}. This
-is probably a bug in the Linux-Alpha kernel.
-@item
-Debugging threaded applications like @strong{MySQL} will not work with
-@code{gdb 4.18}. You should download and use gdb 5.0 instead!
-@item
-If you try linking mysqld staticly, the resulting image will core dump
-at start. In other words, @strong{DON'T} use
-@code{--with-mysqld-ldflags=-all-static}
-@end itemize
-
-We don't yet know if the following old information is still relevant, so we
-leave this here until we have had time to test Linux-Alpha properly.
-
-¤â¤·¥·¥°¥Ê¥ë¤ÇÌäÂ꤬¤¢¤ë¾ì¹ç (@strong{MySQL} dies unexpectedly
-under high load)¡¢¤³¤ì¤Ï OS ¤È¥¹¥ì¥Ã¥É¤Î¥Ð¥°¤Ç¤·¤ç¤¦¡£
-¤³¤Î¾ì¹ç¡¢@strong{MySQL} ¤ò¥·¥°¥Ê¥ë¤ò»ÈÍѤ·¤Ê¤¤¤è¤¦¤Ë¡¢configure »þ¤Ë»ØÄê¤Ç¤­¤Þ¤¹¡§
-
-@example
-shell> CFLAGS=-DDONT_USE_THR_ALARM \
- CXXFLAGS=-DDONT_USE_THR_ALARM \
- ./configure ...
-@end example
-
-¤³¤ì¤Ï @strong{MySQL} ¤Î¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤Ë±Æ¶Á¤·¤Þ¤»¤ó¤¬¡¢
-@code{mysqladmin kill} or @code{mysqladmin shutdown} ¤ò»ÈÍѤ·¤Æ¡¢
-Àܳ¤¬ ``sleeping'' ¤Ë¤Ê¤Ã¤Æ¤¤¤ë¥¯¥é¥¤¥¢¥ó¥È¤ò kill ¤Ç¤­¤Þ¤»¤ó¡£
-¼¡¤Î¥³¥Þ¥ó¥É¤òȯ¹Ô¤·¤¿¤È¤­¡¢¤½¤Î¥¯¥é¥¤¥¢¥ó¥È¤Ï»à¤Ë¤Þ¤¹¡£
-
-
-@node MKLinux, Qube2, Linux-Alpha, Linux
-@subsubsection MkLinux notes
-
-@strong{MySQL} ¤ÏºÇ¿·¤Î @code{glibc} ¤ò»ÈÍѤ·¤¿ MkLinux ¤ÇÆ°ºî¤·¤Þ¤¹¡£
-(@code{glibc} 2.0.7 ¤Ç¥Æ¥¹¥È¤·¤Þ¤·¤¿).
-
-@node Qube2, , MKLinux, Linux
-@subsubsection Qube2 Linux notes
-
-Qube2 (Linux Mips) ¾å¤Ç @strong{MySQL} ¤òÆ°ºî¤µ¤»¤ë¤Ë¤Ï¡¢
-ºÇ¿·¤Î @code{glibc} ¥é¥¤¥Ö¥é¥ê¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó(@code{glibc-2.0.7-29C2} ¤ÏÆ°ºî¤¹¤ë¤³¤È¤¬Ê¬¤«¤Ã¤Æ¤¤¤Þ¤¹)¡£ ¤½¤·¤Æ¡¢ @code{egcs} C++ compiler (@code{egcs-1.0.2-9}, @code{gcc 2.95.2} °Ê¾å) ¤ò»ÈÍѤ·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-
-
-@node Alpha-DEC-Unix, Alpha-DEC-OSF1, Linux, Source install system issues
-@subsection Alpha-DEC-Unix notes
-
-When compiling threaded programs under Digital UNIX, the documentation
-recommends the @code{-pthread} option for @code{cc} and @code{cxx} and the
-libraries @code{-lmach -lexc} (in addition to @code{-lpthread}).
-You should run @code{configure} something like this:
-
-@example
-shell> CC="cc -pthread" CXX="cxx -pthread -O" \
- ./configure --with-named-thread-libs="-lpthread -lmach -lexc -lc"
-@end example
-
-When compiling @code{mysqld}, you may see a couple of warnings like this:
-
-@example
-mysqld.cc: In function void handle_connections()':
-mysqld.cc:626: passing long unsigned int *' as argument 3 of
-accept(int,sockadddr *, int *)'
-@end example
-
-You can safely ignore these warnings. They occur because @code{configure}
-can't detect warnings, only errors.
-
-If you start the server directly from the command line, you may have problems
-with it dying when you log out. (When you log out, your outstanding processes
-receive a @code{SIGHUP} signal.) If so, try starting the server like this:
-
-@example
-shell> nohup mysqld [options] &
-@end example
-
-@code{nohup} causes the command following it to ignore any @code{SIGHUP}
-signal sent from the terminal. Alternatively, start the server by running
-@code{safe_mysqld}, which invokes @code{mysqld} using @code{nohup} for you.
-
-@node Alpha-DEC-OSF1, SGI-Irix, Alpha-DEC-Unix, Source install system issues
-@subsection Alpha-DEC-OSF1 notes
-
-If you have problems compiling and have DEC @code{CC} and @code{gcc}
-installed, try running @code{configure} like this:
-
-@example
-shell> CC=cc CFLAGS=-O CXX=gcc CXXFLAGS=-O3 \
- ./configure --prefix=/usr/local/mysql
-@end example
-
-If you get problems with the @file{c_asm.h} file, you can create and use
-a 'dummy' @file{c_asm.h} file with:
-
-@example
-shell> touch include/c_asm.h
-shell> CC=gcc CFLAGS=-I./include \
- CXX=gcc CXXFLAGS=-O3 \
- ./configure --prefix=/usr/local/mysql
-@end example
-
-On OSF1 V4.0D and compiler "DEC C V5.6-071 on Digital UNIX V4.0 (Rev. 878)"
-the compiler had some strange behavior (undefined @code{asm} symbols).
-@code{/bin/ld} also appears to be broken (problems with @code{_exit
-undefined} errors occuring while linking @code{mysqld}). On this system, we
-have managed to compile @strong{MySQL} with the following @code{configure}
-line, after replacing @code{/bin/ld} with the version from OSF 4.0C:
-
-@example
-shell> CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql
-@end example
-
-With the Digital compiler "C++ V6.1-029", the following should work:
-
-@example
-CC=cc -pthread
-CFLAGS=-O4 -ansi_alias -ansi_args -fast -inline speed -speculate all -arch host
-CXX=cxx -pthread
-CXXFLAGS=-O4 -ansi_alias -ansi_args -fast -inline speed -speculate all -arch host
-export CC CFLAGS CXX CXXFLAGS
-./configure --prefix=/usr/mysql/mysql --with-low-memory --enable-large-files --with-mysqld-ldflags=-all-static --disable-shared --with-named-thread-libs="-lmach -lexc -lc"
-@end example
-
-In some versions of OSF1, the @code{alloca()} function is broken. Fix
-this by removing the line in @file{config.h} that defines @code{'HAVE_ALLOCA'}.
-
-The @code{alloca()} function also may have an incorrect prototype in
-@code{/usr/include/alloca.h}. This warning resulting from this can be ignored.
-
-@code{configure} will use the following thread libraries automatically:
-@code{--with-named-thread-libs="-lpthread -lmach -lexc -lc"}.
-
-When using @code{gcc}, you can also try running @code{configure} like this:
-
-@example
-shell> CFLAGS=-D_PTHREAD_USE_D4 CXX=gcc CXXFLAGS=-O3 ./configure ....
-@end example
-
-If you have problems with signals (@strong{MySQL} dies unexpectedly
-under high load) you may have found an OS bug with threads and
-signals. In this case you can tell @strong{MySQL} not to use signals by
-configuring with:
-
-@example
-shell> CFLAGS=-DDONT_USE_THR_ALARM \
- CXXFLAGS=-DDONT_USE_THR_ALARM \
- ./configure ...
-@end example
-
-This doesn't affect the performance of @strong{MySQL}, but has the side
-effect that you can't kill clients that are ``sleeping'' on a connection with
-@code{mysqladmin kill} or @code{mysqladmin shutdown}. Instead, the client
-will die when it issues its next command.
-
-With @code{gcc} 2.95.2, you will probably run into the following compile error:
-
-@example
-sql_acl.cc:1456: Internal compiler error in `scan_region', at except.c:2566
-Please submit a full bug report.
-@end example
-
-To fix this you should change to the @code{sql} directory and do a 'cut
-and paste' of the last @code{gcc} line, but change @code{-O3} to @code{-O0} (or
-@code{-O0} immediately after @code{gcc} if you don't have any @code{-O}
-option on your compile line. After this is done you can just change back to
-the top level directly and run @code{make} again.
-
-@node SGI-Irix, FreeBSD, Alpha-DEC-OSF1, Source install system issues
-@subsection SGI-IRIX notes
-
-If you are using Irix 6.5.3 or newer @code{mysqld} will only be able to
-create threads if you run it as a user with @code{CAP_SCHED_MGT}
-privileges (like @code{root}) or give the @code{mysqld} server this privilege
-with the following shell command:
-
-@example
-shell> chcap "CAP_SCHED_MGT+epi" /opt/mysql/libexec/mysqld
-@end example
-
-You may have to undefine some things in @file{config.h} after running
-@code{configure} and before compiling.
-
-In some Irix implementations, the @code{alloca()} function is broken. If the
-@code{mysqld} server dies on some @code{SELECT} statements, remove the lines
-from @file{config.h} that define @code{HAVE_ALLOC} and @code{HAVE_ALLOCA_H}.
-If @code{mysqladmin create} doesn't work, remove the line from
-@file{config.h} that defines @code{HAVE_READDIR_R}. You may have to remove
-the @code{HAVE_TERM_H} line as well.
-
-SGI recommends that you install all of the patches on this page as a set:
-http://support.sgi.com/surfzone/patches/patchset/6.2_indigo.rps.html
-
-At the very minimum, you should install the latest kernel rollup, the
-latest @code{rld} rollup, and the latest @code{libc} rollup.
-
-You definately need all the POSIX patches on this page, for pthreads support:
-
-http://support.sgi.com/surfzone/patches/patchset/6.2_posix.rps.html
-
-If you get the something like the following error when compiling
-@file{mysql.cc}:
-
-@example
-"/usr/include/curses.h", line 82: error(1084): invalid combination of type
-@end example
-
-Then type the following in the top-level directory of your @strong{MySQL}
-source tree:
-
-@example
-shell> extra/replace bool curses_bool < /usr/include/curses.h > include/curses.h
-shell> make
-@end example
-
-There have also been reports of scheduling problems. If only one thread is
-running, things go slow. Avoid this by starting another client. This may lead
-to a 2-to-10-fold increase in execution speed thereafter for the other
-thread. This is a poorly-understood problem with Irix threads; you may have
-to improvise to find solutions until this can be fixed.
-
-If you are compiling with @code{gcc}, you can use the following
-@code{configure} command:
-
-@example
-shell> CC=gcc CXX=gcc CXXFLAGS=-O3 \
- ./configure --prefix=/usr/local/mysql --with-thread-safe-client --with-named-thread-libs=-lpthread
-@end example
-
-@node FreeBSD, NetBSD, SGI-Irix, Source install system issues
-@subsection FreeBSD notes
-
-FreeBSD 3.x is recommended for running @strong{MySQL} since it the thread package
-is much more integrated.
-
-ºÇ¤â´Êñ¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ëÊýË¡¤Ï¡¢@uref{http://www.freebsd.org} ¤Î
-mysql-server ¤È mysql-client ¤Î ports ¤òÍøÍѤ¹¤ë¤³¤È¤Ç¤¹¡£
-@uref{http://www.freebsd.org}
-
-¤³¤ì¤Ï°Ê²¼¤Î¤è¤¦¤ÊÍøÅÀ¤ò¤â¤¿¤é¤·¤Þ¤¹¡§
-@itemize @bullet
-@item
-¥ª¥×¥Æ¥£¥Þ¥¤¥º¤µ¤ì¤¿ @strong{MySQL} ¤¬Æ°¤¯
-@item
-¼«Æ° configuration ¤È build
-@item
-¥¹¥¿¡¼¥È¥¢¥Ã¥×ÍѤΥ¹¥¯¥ê¥×¥È¤¬ /usr/local/etc/rc.d ¤Ë¥¤¥ó¥¹¥È¡¼¥ë
-@item
-Ability to see which files that are installed with pkg_info -L. And to
-remove them all with pkg_delete if you no longer want @strong{MySQL} on that
-machine.
-@end itemize
-
-FreeBSD 2.x ¾å¤Ç¤Ï MIT-pthreads ¤ò¡¢¤½¤·¤Æ versions 3 °Ê¾å¤Ç¤Ï¡¢
-¥Í¥¤¥Æ¥£¥Ö¤Î¥¹¥ì¥Ã¥É¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
-ºÇ¶á¤Î¤¤¤¯¤Ä¤«¤Î 2.2.x ¤Ç¤Ï¥Í¥¤¥Æ¥£¥Ö¤Î¥¹¥ì¥Ã¥É ¤ÇÆ°ºî¤¬²Äǽ¤Ç¤¹¤¬¡¢
-mysqld ¤ò Íî¤È¤¹¤È¤­¤ËÌäÂ꤬µ¯¤³¤ê¤Þ¤¹¡£
-
-̾Á°²ò·è¤ÎÀßÄê¤ò³Î¼Â¤Ë¤·¤Æ¤ª¤¤¤Æ¤¯¤À¤µ¤¤¡£ ¤Ç¤Ê¤¤¤È¡¢mysqld ¤ËÀܳ¤¹¤ëºÝ¡¢
-̾Á°²ò·è¤Ë¤È¤Æ¤â»þ´Ö¤¬¤«¤«¤ê¡¢Àܳ¤Ë¼ºÇÔ¤¹¤ë¤Ç¤·¤ç¤¦¡£
-
-³Î¼Â¤Ë @file{/etc/hosts} ¥Õ¥¡¥¤¥ë¤Ë @code{localhost} ¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ë
-¤·¤Æ¤¯¤À¤µ¤¤¡£ (¤Ç¤Ê¤¤¤È¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤ÇÌäÂ꤬½Ð¤Þ¤¹)¡£
- @file{/etc/hosts} ¥Õ¥¡¥¤¥ë¤Ï¡¢°Ê²¼¤Î¹Ô¤«¤é»Ï¤Þ¤ë¤Ù¤­¤Ç¤¹¡§
-
-@example
-127.0.0.1 localhost localhost.your.domain
-@end example
-
-¤â¤· @code{configure} ¤¬ MIT-pthread ¤ò»ÈÍѤ¹¤ë¤Èʬ¤«¤Ã¤¿¾ì¹ç¡¢
-MIT-pthreads notes ¤òÆɤà¤Ù¤­¤Ç¤¹¡£ @xref{MIT-pthreads}.
-
-If you get an error from @code{make install} that it can't find
-@file{/usr/include/pthreads}, @code{configure} didn't detect that you need
-MIT-pthreads. This is fixed by executing these commands:
-
-@example
-shell> rm config.cache
-shell> ./configure --with-mit-threads
-@end example
-
-FreeBSD ¤Î @code{make} ¤Î¿¶¤ëÉñ¤¤¤Ï GNU ¤Î @code{make} ¤È¾¯¤·°ã¤¤¤Þ¤¹¡£
-¤â¤· @code{make} ¤Ë¤«¤«¤ï¤ëÌäÂ꤬½Ð¤¿¤Ê¤é¡¢ GNU @code{make} ¤ò
-¥¤¥ó¥¹¥È¡¼¥ë¤¹¤Ù¤­¤Ç¤¹¡£
-
-FreeBSD ¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥¡¥¤¥ë¥Ï¥ó¥É¥ë¤Î¾å¸ÂÃͤ¬¤È¤Æ¤â¾¯¤Ê¤¤
-ÃͤǤ¢¤ë¤³¤È¤âÃΤé¤ì¤Æ¤¤¤Þ¤¹¡£@xref{Not enough file handles}.
-safe_mysqld Ãæ¤Î ulimit -n ¤Î¥³¥á¥ó¥È¤ò³°¤¹¤«¡¢/etc/login.conf ¥Õ¥¡¥¤¥ë¤Ç
-mysqld ¥æ¡¼¥¶¡¼¤ÎÀ©¸ÂÃͤòÁý²Ã¤µ¤»¤Þ¤¹¡£
-(/etc/login.conf ¤ÎÊѹ¹¤ÎºÝ¤Ï cap_mkdb /etc/login.conf ¤ÇºÆ¹½ÃÛ¤¬É¬ÍפǤ¹)¡£
-¤â¤·¥Ç¥Õ¥©¥ë¥È¤ò»ÈÍѤ·¤¿¤¯¤Ê¤±¤ì¤Ð¡¢¤³¤Î¥æ¡¼¥¶¡¼¤Ë password ¥Õ¥¡¥¤¥ëÃæ¤Ç
-ŬÀÚ¤Ê Class ¤òÍ¿¤¨¤ë¤³¤È¤Ç¤â¡¢Êѹ¹²Äǽ¤Ë¤Ê¤ê¤Þ¤¹¡£(use: chpass mysqld-user-name)
-
-¤â¤· @strong{MySQL} ¤¬¸½ºß»þ¤ÇÌäÂ꤬¤¢¤ë¤Ê¤é¡¢
- @code{TZ} ´Ä¶­ÊÑ¿ô¤òÀßÄꤷ¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£ @xref{Environment variables}.
-
-
-°ÂÁ´¤Ç°ÂÄꤷ¤¿¥·¥¹¥Æ¥à¤òÆþ¤ì¤ë¤Ê¤é¡¢ @code{-STABLE} ¤Î¥«¡¼¥Í¥ë¤À¤±¤ò
-»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
-
-
-@node NetBSD, OpenBSD, FreeBSD, Source install system issues
-@subsection NetBSD notes
-
-To compile on NetBSD you need GNU @code{make}. Otherwise the compile will crash
-when @code{make} tries to run @code{lint} on C++ files.
-
-@node OpenBSD, BSDI, NetBSD, Source install system issues
-@subsection OpenBSD 2.5 notes
-
-On OpenBSD 2.5, you can compile @strong{MySQL} with native threads with the
-following options:
-
-@example
-CFLAGS=-pthread CXXFLAGS=-pthread ./configure --with-mit-threads=no
-@end example
-
-@node BSDI, SCO, OpenBSD, Source install system issues
-@subsection BSD/OS notes
-
-@menu
-* BSDI2:: BSD/OS 2.x notes
-* BSDI3:: BSD/OS 3.x notes
-* BSDI4:: BSD/OS 4.x notes
-@end menu
-
-@node BSDI2, BSDI3, BSDI, BSDI
-@subsubsection BSD/OS 2.x notes
-
-If you get the following error when compiling @strong{MySQL}, your
-@code{ulimit} value for virtual memory is too low:
-
-@example
-item_func.h: In method `Item_func_ge::Item_func_ge(const Item_func_ge &)':
-item_func.h:28: virtual memory exhausted
-make[2]: *** [item_func.o] Error 1
-@end example
-
-Try using @code{ulimit -v 80000} and run @code{make} again. If this
-doesn't work and you are using @code{bash}, try switching to @code{csh}
-or @code{sh}; some BSDI users have reported problems with @code{bash}
-and @code{ulimit}.
-
-If you are using @code{gcc}, you may also use have to use the
-@code{--with-low-memory} flag for @code{configure} to be able to compile
-@file{sql_yacc.cc}.
-
-¤â¤· @strong{MySQL} ¤¬¸½ºß»þ¤ÇÌäÂ꤬¤¢¤ë¤Ê¤é¡¢
- @code{TZ} ´Ä¶­ÊÑ¿ô¤òÀßÄꤷ¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£ @xref{Environment variables}.
-
-@node BSDI3, BSDI4, BSDI2, BSDI
-@subsubsection BSD/OS 3.x notes
-
-Upgrade to BSD/OS 3.1. If that is not possible, install BSDIpatch M300-038.
-
-Use the following command when configuring @strong{MySQL}:
-
-@example
-shell> env CXX=shlicc++ CC=shlicc2 \
- ./configure \
- --prefix=/usr/local/mysql \
- --localstatedir=/var/mysql \
- --without-perl \
- --with-unix-socket-path=/var/mysql/mysql.sock
-@end example
-
-The following is also known to work:
-
-@example
-shell> env CC=gcc CXX=gcc CXXFLAGS=-O3 \
- ./configure \
- --prefix=/usr/local/mysql \
- --with-unix-socket-path=/var/mysql/mysql.sock
-@end example
-
-You can change the directory locations if you wish, or just use the
-defaults by not specifying any locations.
-
-If you have problems with performance under heavy load, try using the
-@code{--skip-thread-priority} option to @code{safe_mysqld}! This will run
-all threads with the same priority; on BSDI 3.1, this gives better
-performance (at least until BSDI fixes their thread scheduler).
-
-If you get the error @code{virtual memory exhausted} while compiling,
-you should try using @code{ulimit -v 80000} and run @code{make} again.
-If this doesn't work and you are using @code{bash}, try switching to
-@code{csh} or @code{sh}; some BSDI users have reported problems with
-@code{bash} and @code{ulimit}.
-
-@node BSDI4, , BSDI3, BSDI
-@subsubsection BSD/OS 4.x notes
-
-BSDI 4.x has some thread related bugs. If you want to use @strong{MySQL}
-on this, you should install all thread related patches. At least
-M400-023 should be installed.
-
-On some BSDI 4.x systems, you may get problems with shared libraries. The
-symptom is that you can't execute any client programs, like for example
-@code{mysqladmin}. In this case you need to reconfigure not to use
-shared libraries with the @code{--disable-shared} option to configure.
-
-@node SCO, SCO Unixware, BSDI, Source install system issues
-@subsection SCO notes
-
-The current port is tested only on a ``sco3.2v5.0.4'' and
-``sco3.2v5.0.5'' system. There has also been a lot of progress on a
-port to ``sco 3.2v4.2''.
-
-For the moment the recommended compiler on OpenServer is gcc 2.95.2. With this
-you should be able to compile @code{MySQL} with just:
-
-@example
-CC=gcc CXX=gcc ./configure ... (options)
-@end example
-
-@enumerate
-@item
-For OpenServer 5.0.X you need to use GDS in Skunkware 95 (95q4c). This
-is necessary because GNU @code{gcc} 2.7.2 in Skunkware 97 does not have
-GNU @code{as}. You can also use @code{egcs} 1.1.2 or newer
-@uref{http://www.egcs.com/}. If you are using @code{egcs} 1.1.2 you have
-to execute the following command:
-
-@example
-shell> cp -p /usr/include/pthread/stdtypes.h /usr/local/lib/gcc-lib/i386-pc-sco3.2v5.0.5/egcs-2.91.66/include/pthread/
-@end example
-@item
-You need the port of GCC 2.5.? for this product and the Development
-system. They are required on this version of SCO UNIX. You cannot
-just use the GCC Dev system.
-@item
-You should get the FSU Pthreads package and install it first. This can be
-found at
-@uref{http://www.cs.wustl.edu/~schmidt/ACE_wrappers/FSU-threads.tar.gz}.
-You can also get a precompiled package from
-@uref{ftp://www.mysql.com/pub/mysql/Downloads/SCO/FSU-threads-3.5c.tar.gz}.
-@item
-FSU Pthreads can be compiled with SCO UNIX 4.2 with tcpip. Or
-OpenServer 3.0 or Open Desktop 3.0 (OS 3.0 ODT 3.0), with the SCO
-Development System installed using a good port of GCC 2.5.X ODT or OS
-3.0 you will need a good port of GCC 2.5.? There are a lot of problems
-without a good port. The port for this product requires the SCO UNIX
-Development system. Without it, you are missing the libraries and the
-linker that is needed.
-@item
-To build FSU Pthreads on your system, do the following:
-@enumerate
-@item
-Run @code{./configure} in the @file{threads/src} directory and select
-the SCO OpenServer option. This command copies @file{Makefile.SCO5} to
-@file{Makefile}.
-@item
-Run @code{make}.
-@item
-To install in the default @file{/usr/include} directory, login as root,
-then @code{cd} to the @file{thread/src} directory, and run @code{make
-install}.
-@end enumerate
-@item
-Remember to use GNU @code{make} when making @strong{MySQL}.
-@item
-On OSR 5.0.5, you should use the following configure line:
-@example
-shell> CC="gcc -DSCO" CXX="gcc -DSCO" ./configure
-@end example
-The @code{-DSCO} is needed to help configure detect some thread
-functions properly. If you forget @code{-DSCO}, you will get the following
-error message while compiling:
-@example
-my_pthread.c: In function `my_pthread_mutex_init':
-my_pthread.c:374: `pthread_mutexattr_default' undeclared (first use this function)
-@end example
-@item
-If you don't start @code{safe_mysqld} as root, you probably will get only the
-default 110 open files per process. @code{mysqld} will write a note about this
-in the log file.
-@item
-With SCO 3.2V5.0.5, you should use FSU Pthreads version 3.5c or newer.
-The following @code{configure} command should work:
-@example
-shell> CC="gcc -belf" ./configure --prefix=/usr/local/mysql --disable-shared
-@end example
-@item
-With SCO 3.2V4.2, you should use FSU Pthreads version 3.5c or newer.
-The following @code{configure} command should work:
-@example
-shell> CFLAGS="-D_XOPEN_XPG4" CXX=gcc CXXFLAGS="-D_XOPEN_XPG4" \
- ./configure \
- --with-debug --prefix=/usr/local/mysql \
- --with-named-thread-libs="-lgthreads -lsocket -lgen -lgthreads" \
- --with-named-curses-libs="-lcurses"
-@end example
-You may get some problems with some include files. In this case, you can
-find new SCO-specific include files at
-@uref{ftp://www.mysql.com/pub/mysql/Downloads/SCO/SCO-3.2v4.2-includes.tar.gz}.
-You should unpack this file in the @file{include}
-directory of your @strong{MySQL} source tree.
-@end enumerate
-
-SCO development notes:
-
-@itemize @bullet
-@item
-@strong{MySQL} should automatically detect FSU Pthreads and link @code{mysqld}
-with @code{-lgthreads -lsocket -lgthreads}.
-@item
-The SCO development libraries are reentrant in FSU Pthreads. SCO claims
-that its libraries' functions are reentrant, so they must be reentrant with
-FSU Pthreads. FSU Pthreads on OpenServer tries to use the SCO scheme to
-make reentrant library.
-@item
-FSU Pthreads (at least the version at @code{www.mysql.com}) comes linked with
-GNU @code{malloc}. If you encounter problems with memory usage, make sure that
-@file{gmalloc.o}
-is included in @file{libgthreads.a} and @file{libgthreads.so}.
-@item
-In FSU Pthreads, the following system calls are pthreads-aware: @code{read()},
-@code{write()}, @code{getmsg()}, @code{connect()}, @code{accept()},
-@code{select()} and @code{wait()}.
-@end itemize
-
-If you want to install DBI on SCO, you have to edit the @file{Makefiles} in
-DBI-xxx and each subdirectory:
-
-@example
-OLD: NEW:
-CC = cc CC = gcc -belf
-CCCDLFLAGS = -KPIC -W1,-Bexport CCCDLFLAGS = -fpic
-CCDLFLAGS = -wl,-Bexport CCDLFLAGS =
-
-LD = ld LD = gcc -belf -G -fpic
-LDDLFLAGS = -G -L/usr/local/lib LDDLFLAGS = -L/usr/local/lib
-LDFLAGS = -belf -L/usr/local/lib LDFLAGS = -L/usr/local/lib
-
-LD = ld LD = gcc -belf -G -fpic
-OPTIMISE = -Od OPTIMISE = -O1
-
-OLD:
-CCCFLAGS = -belf -dy -w0 -U M_XENIX -DPERL_SCO5 -I/usr/local/include
-
-NEW:
-CCFLAGS = -U M_XENIX -DPERL_SCO5 -I/usr/local/include
-@end example
-
-This is because the Perl dynaloader will not load the @code{DBI} modules
-if they were compiled with @code{icc} or @code{cc}.
-
-Perl works best when compiled with @code{cc}.
-
-@node SCO Unixware, IBM-AIX, SCO, Source install system issues
-@subsection SCO Unixware 7.0 notes
-
-You must use a version of @strong{MySQL} at least as recent as 3.22.13, because
-that version fixes some portability problems under Unixware.
-
-We have been able to compile @strong{MySQL} with the following @code{configure}
-command on UnixWare 7.0.1:
-
-@example
-shell> CC=cc CXX=CC ./configure --prefix=/usr/local/mysql
-@end example
-
-If you want to use @code{gcc}, you must use @code{gcc} 2.95.2 or newer.
-
-@node IBM-AIX, HP-UX 10.20, SCO Unixware, Source install system issues
-@subsection IBM-AIX notes
-
-Automatic detection of @code{xlC} is missing from Autoconf, so a
-@code{configure} command something like this is needed when using the IBM
-compiler:
-
-@example
-shell> CC="xlc_r -ma -O3 -qstrict -DHAVE_INT_8_16_32" \
- CXX="xlC_r -ma -O3 -qstrict -DHAVE_INT_8_16_32" \
- ./configure
-@end example
-
-If you change the @code{-O3} to @code{-O2} in the above configure line,
-you must also remove the @code{-qstrict} option (this is a limitation in
-the IBM C compiler).
-
-If you are using @code{gcc} or @code{egcs} to compile @strong{MySQL}, you
-@strong{MUST} use the @code{-fno-exceptions} flag, as the exception
-handling in @code{gcc}/@code{egcs} is not thread-safe! (This is tested with
-@code{egcs} 1.1.) We recommend the following @code{configure} line with
-@code{egcs} and @code{gcc} on AIX:
-
-@example
-shell> CXX=gcc \
- CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti" \
- ./configure --prefix=/home/monty --with-debug --with-low-memory
-@end example
-
-If you have problems with signals (@strong{MySQL} dies unexpectedly
-under high load) you may have found an OS bug with threads and
-signals. In this case you can tell @strong{MySQL} not to use signals by
-configuring with:
-
-@example
-shell> CFLAGS=-DDONT_USE_THR_ALARM CXX=gcc \
- CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti -DDONT_USE_THR_ALARM" \
- ./configure --prefix=/home/monty --with-debug --with-low-memory
-@end example
-
-This doesn't affect the performance of @strong{MySQL}, but has the side
-effect that you can't kill clients that are ``sleeping'' on a connection with
-@code{mysqladmin kill} or @code{mysqladmin shutdown}. Instead, the client
-will die when it issues its next command.
-
-On some versions of AIX, linking with @code{libbind.a} makes @code{getservbyname} core
-dump. This is an AIX bug and should be reported to IBM.
-
-
-@node HP-UX 10.20, HP-UX 11.x, IBM-AIX, Source install system issues
-@subsection HP-UX 10.20 notes
-
-There are a couple of ``small'' problems when compiling @strong{MySQL} on
-HP-UX. We recommend that you use @code{gcc} instead of the HP-UX native
-compiler, because @code{gcc} produces better code!
-
-We recommend one to use gcc 2.95 on HP-UX. Don't use high optimization
-flags (like -O6) as this may not be safe on HP-UX.
-
-Note that MIT-pthreads can't be compiled with the HP-UX compiler,
-because it can't compile @code{.S} (assembler) files.
-
-The following configure line should work:
-
-@example
-CFLAGS="-DHPUX -I/opt/dce/include" CXXFLAGS="-DHPUX -I/opt/dce/include -felide-constructors -fno-exceptions -fno-rtti" CXX=gcc ./configure --with-pthread --with-named-thread-libs='-ldce' --prefix=/usr/local/mysql --disable-shared
-@end example
-
-If you are compiling @code{gcc} 2.95 yourself, you should NOT link it with
-the DCE libraries (@code{libdce.a} or @code{libcma.a}) if you want to compile
-@strong{MySQL} with MIT-pthreads. If you mix the DCE and MIT-pthreads
-packages you will get a @code{mysqld} to which you cannot connect. Remove
-the DCE libraries while you compile @code{gcc} 2.95!
-
-@node HP-UX 11.x, MaxOSX, HP-UX 10.20, Source install system issues
-@subsection HP-UX 11.x notes
-
-For HPUX 11.x we recommend @strong{MySQL} 3.23.15 or later.
-
-If you are using @code{gcc} 2.95.1 on a unpatched HPUX 11.x system you will
-get the error:
-
-@example
-In file included from /usr/include/unistd.h:11,
- from ../include/global.h:125,
- from mysql_priv.h:15,
- from item.cc:19:
-/usr/include/sys/unistd.h:184: declaration of C function `int pthread_atfork(void (*)(...), void (*)
-(...), void (*)(...))' conflicts with
-/usr/include/sys/pthread.h:440: previous declaration `int pthread_atfork(void (*)(), void (*)(), void (*)())' here
-In file included from item.h:306,
- from mysql_priv.h:158,
- from item.cc:19:
-@end example
-
-The problem is that HP-UX doesn't define @code{pthreads_atfork()} consistently.
-It has conflicting prototypes in
-@file{/usr/include/sys/unistd.h}:184 and
-@file{/usr/include/sys/pthread.h}:440 (I post the details below).
-
-One solution is to copy @file{/usr/include/sys/unistd.h} into
-@file{mysql/include} and edit @file{unistd.h} and change it to match
-the definition in @file{pthread.h}. Here's the diff:
-
-@example
-183,184c183,184
-< extern int pthread_atfork(void (*prepare)(), void (*parent)(),
-< void (*child)());
----
-> extern int pthread_atfork(void (*prepare)(void), void (*parent)(void),
-> void (*child)(void));
-@end example
-
-After this, the following configure line should work:
-
-@example
-CFLAGS="-fomit-frame-pointer -O6 -fpic" CXX=gcc CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti -O6" ./configure --prefix=/usr/local/mysql --disable-shared
-@end example
-
-Here is some information that a HPUX 11.x user sent us about compile
-@strong{MySQL} with HPUX:x compiler
-
-@itemize @bullet
-@item
-@example
- Environment:
- proper compilers.
- setenv CC cc
- setenv CXX aCC
- flags
- setenv CFLAGS -D_REENTRANT
- setenv CXXFLAGS -D_REENTRANT
- setenv CPPFLAGS -D_REENTRANT
- % aCC -V
- aCC: HP ANSI C++ B3910B X.03.14.06
- % cc -V /tmp/empty.c
- cpp.ansi: HP92453-01 A.11.02.00 HP C Preprocessor (ANSI)
- ccom: HP92453-01 A.11.01.00 HP C Compiler
- cc: "/tmp/empty.c", line 1: warning 501: Empty source file.
-@end example
-@item
-@example
- configuration:
- ./configure --with-pthread \
- --prefix=/source-control/mysql \
- --with-named-thread-libs=-lpthread \
- --with-low-memory
-@end example
-@item
- added '#define _CTYPE_INCLUDED' to include/m_ctype.h. This
- symbol is the one defined in HP's /usr/include/ctype.h:
-
-@example
- /* Don't include std ctype.h when this is included */
- #define _CTYPE_H
- #define __CTYPE_INCLUDED
- #define _CTYPE_INCLUDED
- #define _CTYPE_USING /* Don't put names in global namespace. */
-@end example
-@item
-I had to use the compile-time flag @code{-D_REENTRANT} to get the
-compiler to recognize the prototype for
-@code{localtime_r}. Alternatively I could have supplied the prototype
-for @code{localtime_r}. But I wanted to catch other bugs without needing
-to run into them. I wasn't sure where I needed it so I added it to all
-flags.
-@item
-The optimization flags used by @strong{MySQL} (-O3) are not recognized
-by HP's compilers. I did not change the flags.
-@end itemize
-
-@node MaxOSX, , HP-UX 11.x, Source install system issues
-@subsection MacOS X notes
-
-You can get @strong{MySQL} to work on MacOS X by following the links to
-the MacOS X ports. @xref{Useful Links}.
-
-@strong{MySQL} 3.23.7 should include all patches necessary to configure
-it on MacOSX. You must however first install the pthread package from
-@uref{http://www.prnet.de/RegEx/mysql.html,MySql for MacOSX Server}
-before configuring MySQL.
-
-You might want to also add aliases to your shell's resource file to
-access @code{mysql} and @code{mysqladmin} from the command line.
-
-@example
-alias mysql '/usr/local/mysql/bin/mysql'
-alias mysqladmin '/usr/local/mysql/libexec/mysqladmin'
-@end example
-
-@node Win32, OS/2, Source install system issues, Installing
-@section Win32 notes
-
-¤³¤ÎÀá¤Ç¤Ï Win32 ¾å¤Ç¤Î @strong{MySQL} ¤Î»ÈÍѤȥ¤¥ó¥¹¥È¡¼¥ë¤Ë¤Ä¤¤¤Æ½Ò¤Ù¤Þ¤¹¡£
-¤³¤ì¤Ï @strong{MySQL} Win32 ÇÛÉÛʪ¤Î @file{README} ¥Õ¥¡¥¤¥ë¤Ë¤â½Ò¤Ù¤é¤ì¤Æ¤¤¤Þ¤¹¡£
-
-@menu
-* Win32 installation:: Installing @strong{MySQL} on Win32
-* Win95 start:: Starting @strong{MySQL} on Win95 / Win98
-* NT start:: Starting @strong{MySQL} on NT
-* Win32 running:: Running @strong{MySQL} on Win32
-* Win32 and SSH:: Connecting to a remote @strong{MySQL} from Win32 with SSH
-* Win32 symbolic links:: Splitting data across different disks under Win32
-* Win32 vs. Unix:: @strong{MySQL}-Win32 compared to Unix @strong{MySQL}
-@end menu
-
-@node Win32 installation, Win95 start, Win32, Win32
-@subsection Win32 ¤Ø¤Î @strong{MySQL} ¤Î¥¤¥ó¥¹¥È¡¼¥ë
-
-¤â¤·Àµ¼°ÈÇ @strong{MySQL} ¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¤Ê¤é¡¢ºÇ½é¤Ë°Ê²¼¤«¤é
-¥·¥§¥¢¥¦¥¨¥¢¥Ð¡¼¥¸¥ç¥ó¤ò¥À¥¦¥ó¥í¡¼¥É¤¹¤Ù¤­¤Ç¤¹¡§
-
-@uref{http://www.mysql.com/mysql_w32.htmy,@strong{MySQL} 3.22.x}
-
-ÆüËܸìÈǤÎɾ²ÁÈÇ¡¢¤ª¤è¤ÓÀµ¼°ÈÇ(3.22)¤Î¼èÆÀ¤Ï°Ê²¼¤Ë¤Ê¤ê¤Þ¤¹¡§
-@uref{http://www.softagency.co.jp/, @strong{MySQL} ÆüËܸìÈÇ}
-
-¤â¤·Â¾¤Î¥×¥í¥°¥é¥à¤«¤é @strong{MySQL} ¤ËÀܳ¤·¤è¤¦¤È¹Í¤¨¤Æ¤¤¤ë¤Ê¤é¡¢
-¿ʬ @strong{MyODBC} ¥É¥é¥¤¥Ð¡¼¤âɬÍפǤ·¤ç¤¦¡£ ¤³¤ì¤Ï
-@uref{http://www.mysql.com/ownload_myodbc.html,@strong{MySQL} download page}.
-¤Ë¤¢¤ê¤Þ¤¹¡£
-
-ÆüËܸìÈǤΠ@strong{MyODBC} ¥É¥é¥¤¥Ð¡¼ ¤Ï¡§
-@uref{http://www.softagency.co.jp/,@strong{MyODBC} ÆüËܸìÈÇ}
-
-¤½¤ì¤¾¤ì¤ÎÇÛÉÛʪ¤Î¥¤¥ó¥¹¥È¡¼¥ë¤ò¤¹¤ë¤Ë¤Ï¡¢¥À¥¦¥ó¥í¡¼¥É¤·¤¿Êª¤ò
-¤É¤³¤« ¤«¤é¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ç unzip ¤·¡¢@code{Setup.exe} ¥×¥í¥°¥é¥à¤ò
-¼Â¹Ô¤·¤Þ¤¹¡£
-
-ɸ½à¤Ç¤Ï¡¢@strong{MySQL}-Win32 ¤Ï @file{C:\mysql} ¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤ë¤è¤¦¤Ë
-¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ ¤â¤·°ã¤¦¾ì½ê¤Ë @strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¤¤¤Ê¤é¡¢
-°ìÅÙ @file{C:\mysql} ¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¸å¤Ë¡¢¤½¤Î¥Õ¥©¥ë¥À¤ò°ÜÆ°¤·¤Þ¤¹¡£
- @strong{MySQL} ¤ò @file{C:\mysql} ¤«¤é°ÜÆ°¤·¤¿¤Ê¤é¤Ð¡¢
- @code{mysqld} ¤ËÂФ·¤Æ¡¢°ÜÆ°Àè¤òɬ¤º¶µ¤¨¤Í¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-¤â¤· @strong{MySQL} ¤ò @file{D:\programs\mysql} ¤Ë°ÜÆ°¤·¤¿¤Ê¤é,
-@code{mysqld} ¤ò°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æµ¯Æ°¤·¤Þ¤¹¡§
-@code{D:\programs\mysql\bin\mysqld --basedir D:\programs\mysql}
-¤Ê¤ª¡¢ @code{C:\mysql\bin\mysqld --help} ¤È¤¹¤ë¤È¡¢Á´¤Æ¤Î¥ª¥×¥·¥ç¥ó¤¬É½¼¨¤µ¤ì¤Þ¤¹¡ª
-
-Àµ¼°ÈǤΠ@strong{MySQL} ¤Ç¤Ï¡¢@file{C:\my.cnf} ¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¡¢
-¤½¤³¤Ë @strong{MySQL} ¥µ¡¼¥Ð¡¼¤Î¥ª¥×¥·¥ç¥ó¤òµ­½Ò¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£
-@file{\mysql\my-xxxxx.cnf} ¤ò @file{C:\my.cnf} ¤Ë¥³¥Ô¡¼¤·¡¢
-¤´¼«Ê¬¤Î´Ä¶­¤Ë¹ç¤ï¤»¤ÆÊÔ½¸¤·¤Æ»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
-Á´¤Æ¤Î¥Ñ¥¹¤Ë¤Ï @code{\} ¤Ç¤Ï¤Ê¤¯¤Æ @code{/} ¤ò»ÈÍѤ·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-¤â¤· @code{\} ¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ë¤Ï¡¢¤³¤ì¤ò£²Çܤ·¤Þ¤¹¡£ @strong{MySQL} ¤Ç¤Ï
- @code{\} ¤Ï¥¨¥¹¥±¡¼¥×ʸ»ú¤À¤«¤é¤Ç¤¹¡£
-@xref{Option files}.
-
-
-@node Win95 start, NT start, Win32 installation, Win32
-@subsection Win95 / Win98 ¾å¤Ç¤Î @strong{MySQL} µ¯Æ°
-
-@strong{MySQL} ¤Ï TCP/IP ¤ò¥¯¥é¥¤¥¢¥ó¥È¤«¤é¥µ¡¼¥Ð¡¼¤Ø¤ÎÀܳ¤Ë»ÈÍѤ·¤Þ¤¹¡£
-¡Ê¤³¤ì¤Ï¡¢¤¢¤Ê¤¿¤Î¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Î¤¤¤«¤Ê¤ë¥Þ¥·¥ó¤«¤é¤â @strong{MySQL} ¥µ¡¼¥Ð¡¼¤Ë
-Àܳ¤Ç¤­¤ë¤Ç¤·¤ç¤¦¡Ë¡£ ¤³¤Î¤¿¤á¡¢@strong{MySQL} ¤òµ¯Æ°¤¹¤ëÁ°¤Ë¡¢
-¤¢¤Ê¤¿¤Ï TCP/IP ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-¤³¤ì¤Ï Windows CD-ROM ¤Ë¤¢¤ê¤Þ¤¹¡£
-
-¤â¤·¸Å¤¤ Win95 (for example OSR2) ¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Ê¤é¡¢
-¤³¤ì¤Ï¸Å¤¤ Winsock ¥Ñ¥Ã¥±¡¼¥¸¤ò»ÈÍѤ·¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡ª
-@strong{MySQL} ¤Ï Winsock 2 ¤òÍ׵ᤷ¤Þ¤¹¡ª ºÇ¿·¤Î Winsock ¤Ï
-@uref{http://www.microsoft.com,Microsoft} ¤Ë¤¢¤ê¤Þ¤¹¡£
- Win98 ¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¿·¤·¤¤ Winsock 2 ¥é¥¤¥Ö¥é¥ê¤Ç¤¹¤Î¤Ç¡¢
-¤³¤ì¤Ï Win98 ¤Ë¤ÏÅö¤Æ¤Ï¤Þ¤ê¤Þ¤»¤ó¡£
-
-2¤Ä¤Î°ã¤¦ @strong{MySQL} ¥µ¡¼¥Ð¡¼¤¬¤¢¤ê¤Þ¤¹¡§
-
-@multitable @columnfractions .15 .85
-@item @code{mysqld} @tab ¥Õ¥ë¥Ç¥Ð¥Ã¥°¤òÍ­¸ú¤Ë¤·¤Æ¡¢¼«Æ° memory allocation ¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤è¤¦¤Ë¥³¥ó¥Ñ¥¤¥ë
-@item @code{mysqld-opt} @tab Pentium ¥×¥í¥»¥Ã¥µ¡¼ÍѤ˺ÇŬ²½¤·¤¿Êª
-@end multitable
-
-ξÊý¤È¤â Intel ¥×¥í¥»¥Ã¥µ¡¼ >= i386 ¤ÇÆ°ºî¤·¤Þ¤¹¡£
-
-@code{mysqld} ¥µ¡¼¥Ð¡¼¤òµ¯Æ°¤¹¤ë¤Ë¤Ï, MS-DOS ¤«¤é°Ê²¼¤Î¤è¤¦¤Ë¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡§
-
-@example
-C:\mysql\bin\mysqld
-@end example
-
-¤³¤ì¤Ï @code{mysqld} ¤ò¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤ÇÆ°¤«¤·¤Þ¤¹¡£
-
-@strong{MySQL} ¥µ¡¼¥Ð¡¼¤Î kill ¤Ë¤Ï¡§
-
-@example
-C:\mysql\bin\mysqladmin -u root shutdown
-@end example
-
-Note that Win95/Win98 don't support creation of named pipes. On
-Win95/Win98, you can only use named pipes to connect to a remote
-@strong{MySQL} running on an NT server.
-
-If @code{mysqld} doesn't start please check whether or not the
-@file{\mysql\mysql.err} file contains any reason for this. You can also
-try to start it with @code{mysqld --standalone}; In this case you may
-get some useful information on the screen that may help solve this.
-
-The last option is to start @code{mysqld} with @code{--debug}. In this
-case @code{mysqld} will write a log file in @file{\mysqld.trace}
-that should contain the reason why @code{mysqld} doesn't start. If you
-make a bug report about this, please only send the lines where something
-seams to go wrong to the mailing list!
-
-@node NT start, Win32 running, Win95 start, Win32
-@subsection NT ¾å¤Ç¤Î @strong{MySQL} µ¯Æ°
-
-The Win95/Win98 section also applies to @strong{MySQL} on NT, with the
-following differences:
-
-TCP/IP ¤Ç @strong{MySQL} ¤òÆ°¤«¤¹¤Ë¤Ï¡¢service pack 3(°Ê¾å) ¤¬É¬¿Ü¤Ç¤¹¡ª
-
-NT ¤Ç¤Ï, ¥µ¡¼¥Ð¡¼¤Î̾Á°¤Ï @code{mysqld-nt} ¤Ç¤¹. Ä̾°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ
- NT ¤Î¥µ¡¼¥Ó¥¹¤È¤·¤Æ @strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡§
-
-@example
-C:\mysql\bin\mysqld-nt --install
-@end example
-
-(@code{mysqld} ¤ä @code{mysqld-opt} ¤ò NT ¾å¤ÇÆ°ºî¤µ¤»¤ë¤³¤È¤â½ÐÍè¤Þ¤¹¡£
-¤·¤«¤·¤³¤ì¤é¤Ï¡¢¥µ¡¼¥Ó¥¹¤È¤·¤Æ¥¹¥¿¡¼¥È¤µ¤»¤ë¤³¤È¤¬½ÐÍ褺¡¢¤Þ¤¿¡¢
-named pipes ¤Î»ÈÍѤâ½ÐÍè¤Þ¤»¤ó¡£)
-
-@strong{MySQL} ¥µ¡¼¥Ó¥¹¤Îµ¯Æ°¤ÈÄä»ß¤Ï¡§
-
-@example
-NET START mysql
-NET STOP mysql
-@end example
-
-¤³¤Î¾ì¹ç¡¢@code{mysqld} ¤Ë¡¢¤¤¤«¤Ê¤ë¥ª¥×¥·¥ç¥ó¤â»ÈÍѤǤ­¤Ê¤¤¤³¤È¤ËÃí°Õ¡ª
-
-¤â¤· @code{mysqld-nt} ¤ò¥ª¥×¥·¥ç¥ó̵¤·¤Çµ¯Æ°¤¹¤ëɬÍפ¬¤¢¤ë¤Ê¤é¤Ð¡¢
- @code{mysqld-nt} ¤ò¥¹¥¿¥ó¥É¥¢¥í¡¼¥ó¤Î¥×¥í¥°¥é¥à¤È¤·¤Æ NT ¾å¤ÇÁö¤é¤»¤ë¤³¤È¤â
-½ÐÍè¤Þ¤¹¡ª ¤â¤· @code{mysqld-nt} ¤ò¥ª¥×¥·¥ç¥ó̵¤·¤Ç NT ¾å¤Çµ¯Æ°¤¹¤ë¤È¡¢
- @code{mysqld-nt} ¤Ï¼«Ê¬¼«¿È¤ò¥µ¡¼¥Ó¥¹¤È¤·¤ÆΩ¤Á¾å¤²¤è¤¦¤È¤·¤Þ¤¹¡£
-¥Ç¥Õ¥©¥ë¥È¤Î¥µ¡¼¥Ó¥¹¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ·¤Æ¡£
- ¤â¤·´û¤Ë @code{mysqld-nt} ¤ò»ß¤á¤Æ¤¤¤¿¤Ê¤é¡¢ @code{NET START mysql} ¤Ç
-µ¯Æ°¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-
-¥µ¡¼¥Ó¥¹¤Ï @code{MySql} ¤È¤¤¤¦Ì¾Á°¤ÇÅÐÏ¿¤µ¤ì¤Þ¤¹¡£ °ìÅÙ¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¤é¡¢
-¤³¤ì¤Ï Services Control Manager (SCM) Utility (¥³¥ó¥È¥í¡¼¥ë¥Ñ¥Í¥ë¤Ë¤¢¤ë)
-¤ò»ÈÍѤ¹¤ë¤«¡¢@code{NET START MySQL} ¥³¥Þ¥ó¥É¤ò»ÈÍѤ¹¤ë¤«¤·¤Æ¡¢
-µ¯Æ°¤µ¤ì¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-¤â¤·¡¢¥ª¥×¥·¥ç¥ó¤¬¤Ê¤Ë¤â»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤Ê¤é¡¢@code{MySQL} ¥µ¡¼¥Ó¥¹³«»ÏÁ°¤Ë¡¢
-SCM Utility ¤Î "Startup parameters" ¤Ëµ­½Ò¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-°ìÅÙÁö¤ì¤Ð¡¢ @code{mysqld-nt} ¤Ï @code{mysqladmin} ¤ä SCM utility ¡¢
-@code{NET STOP MySQL} ¥³¥Þ¥ó¥É¤ÇÄä»ß¤Ç¤­¤Þ¤¹¡£
-¤â¤· SCM ¤ò»ÈÍѤ·¤Æ @code{mysqld-nt} Ää»ß¤¹¤ë¤Ê¤é¡¢
- @code{mysqld shutdown normally} ¤Ë¤Ä¤¤¤Æ¤ÎÊѤʥá¥Ã¥»¡¼¥¸¤¬¤Ç¤Þ¤¹¡£
-When run as a service, @code{mysqld-nt} has no access to a console and so no
-messages can be seen.
-
-NT ¤Ç¤Ï°Ê²¼¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤¬½Ð¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡§
-
-@multitable @columnfractions .3 .7
-@item Permission Denied @tab Means that it cannot find @code{mysqld-nt.exe}
-@item Cannot Register @tab Means that the path is incorrect
-@end multitable
-
-¤â¤· @code{mysqld-nt} ¤ò¥µ¡¼¥Ó¥¹¤È¤·¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¾ì¹ç¤Ë
-ÌäÂ꤬ȯÀ¸¤·¤¿¾ì¹ç¡¢¥Õ¥ë¥Ñ¥¹¤Ç¼Â¹Ô¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡§
-
-@example
-C:\mysql\bin\mysqld-nt --install
-@end example
-
-¤â¤·¤³¤ì¤ÇÆ°ºî¤·¤Ê¤¤¤è¤¦¤Ê¤é¡¢¥ì¥¸¥¹¥È¥êÆâ¤Î¥Ñ¥¹¤ò½¤Àµ¤¹¤ì¤Ð @code{mysqld-nt} ¤ò
-µ¯Æ°¤Ç¤­¤ë¤Ç¤·¤ç¤¦¡£
-
-¥µ¡¼¥Ó¥¹¤È¤·¤Æ @code{mysqld-nt} ¤òµ¯Æ°¤·¤¿¤¯¤Ê¤¤¤Ê¤é°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-
-@example
-C:\mysql\bin\mysqld-nt --standalone
-@end example
-
-or
-
-@example
-C:\mysql\bin\mysqld --standalone --debug
-@end example
-
-ºÇ¿·¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢¥Ç¥Ð¥Ã¥°¤Î¥È¥ì¡¼¥¹¤ò @file{C:\mysqld.trace} ¤Ë½Ð¤·¤Þ¤¹¡£
-
-@node Win32 running, Win32 and SSH, NT start, Win32
-@subsection Win32 ¾å¤Ç @strong{MySQL} ¤ò¼Â¹Ô
-
-@strong{MySQL}¤ÏÁ´¤Æ¤Î Win32 ¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¾å¤Ç TCP/IP ¤ò¥µ¥Ý¡¼¥È¤·¡¢
-NT ¾å¤Ç named pipe ¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£
-¥Ç¥Õ¥©¥ë¥È¤Ï¡¢NT ¾å¤Ç¥í¡¼¥«¥ë¤ËÀܳ¤¹¤ë¤È¤­¤Ë¥Í¡¼¥à¥É¡¦¥Ñ¥¤¥×¤¬»ÈÍѤµ¤ì¡¢
-¤½¤Î¤Û¤«¤ÎÁ´¤Æ¤Î¾ì¹ç¤Ç TCP/IP ¤¬»ÈÍѤµ¤ì¤Þ¤¹¡£
- ¥Û¥¹¥È̾¤Ï¤É¤Î¥×¥í¥È¥³¥ë¤ò»ÈÍѤ¹¤ë¤«¤ò·è¤á¤Þ¤¹¡§
-
-@multitable @columnfractions .3 .7
-@strong{Host name} @tab @strong{protocol}
-@item NULL (none) @tab NT ¤Ç¤ÏºÇ½é¤Ë¥Í¡¼¥à¥É¡¦¥Ñ¥¤¥×¤ò»î¤ß¡¢Æ°¤«¤Ê¤±¤ì¤Ð TCP/IP ¤ò»ÈÍѤ·¤Þ¤¹¡£ Win95/Win98 ¤Ç¤Ï TCP/IP ¤ò»ÈÍѤ·¤Þ¤¹¡£
-@item . @tab ¥Í¡¼¥à¥É¡¦¥Ñ¥¤¥×
-@item localhost @tab TCP/IP to current host
-@item hostname @tab TCP/IP
-@end multitable
-
-@strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¤Ë named pipes ¤ò¶¯À©Åª¤Ë»ÈÍѤµ¤»¤ë¤Ë¤Ï¡¢
-@code{--pipe} ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£ ¤½¤·¤Æ¡¢@code{--socket} ¥ª¥×¥·¥ç¥ó¤Ç
-¥Ñ¥¤¥×¤Î̾Á°¤ò»ØÄꤷ¤Þ¤¹¡£
-
-@strong{MySQL} ¤¬Æ°¤¤¤Æ¤¤¤ë¤«¤É¤¦¤«¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ³Îǧ¤Ç¤­¤Þ¤¹¡§
-
-@example
-C:\mysql\bin\mysqlshow
-C:\mysql\bin\mysqlshow -u root mysql
-C:\mysql\bin\mysqladmin version status proc
-C:\mysql\bin\mysql test
-@end example
-
-¤â¤· Win95/Win98 ¾å¤Ç @code{mysqld} ¤Ø¤ÎÀܳ¤¬ÃÙ¤¤¤è¤¦¤Ê¤é¡¢DNS ¤ÎÌäÂ꤫¤â¤·¤ì¤Þ¤»¤ó¡£
-¤³¤Î¾ì¹ç¡¢ @code{mysqld} ¤ò @code{--skip-name-resolve} ¥ª¥×¥·¥ç¥ó¤Ç
-µ¯Æ°¤·¡¢@strong{MySQL} µö²Ä¥Æ¡¼¥Ö¥ë¤Ë¤Ï¡¢@code{localhost} ¤È IP ¥¢¥É¥ì¥¹¤À¤±
-»ÈÍѤ·¤Þ¤¹¡£
-NT¾å¤ÇÁö¤ë @code{mysqld-nt} @strong{MySQL} ¥µ¡¼¥Ð¡¼¤ËÂФ·¤Æ¤ÎÀܳ»þ¤Ë
- DNS ¤òÈò¤±¤ë¤¿¤á¤Ë¡¢ @code{--pipe} °ú¿ô¤ò»ØÄꤷ¤Æ¥Í¡¼¥à¥É¡¦¥Ñ¥¤¥×¤ò
-»ÈÍѤǤ­¤Þ¤¹¡£ ¤³¤ì¤Ï¤Û¤È¤ó¤É¤Î @strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¤ÇÆ°¤­¤Þ¤¹¡£
-
-2¤Ä¤Î @strong{MySQL} ¥³¥Þ¥ó¥É¥é¥¤¥ó¥Ä¡¼¥ë¤¬¤¢¤ê¤Þ¤¹¡§
-@multitable @columnfractions .15 .85
-@item @code{mysql} @tab Compiled on native Win32, which offers very limited text
-editing capabilities.
-@item @code{mysqlc} @tab Compiled with the Cygnus GNU compiler and libraries, which offers @code{readline} editing.
-@end multitable
-
-¤â¤· @code{mysqlc.exe} ¤ò»ÈÍѤ·¤¿¤¤¤Ê¤é,
-@file{C:\mysql\lib\cygwinb19.dll} ¤ò @file{\windows\system} (¤«¡¢»÷¤¿¥Ñ¥¹)
-¤Ë¥³¥Ô¡¼¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-
-Win32 ¤Î @strong{MySQL} ¤Î½é´ü¤Î¸¢¸Â¤Ï¡¢¥í¡¼¥«¥ë¤ÎÁ´¤Æ¤Î¥æ¡¼¥¶¡¼¤Ë
-ÂФ·¤Æ¡¢Á´¤Æ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÇÁ´¤Æ¤Î¸¢¸Â¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Þ¤¹¡£
-@strong{MySQL} ¤ò°ÂÁ´¤Ë¤¹¤ë¤¿¤á¤Ë¡¢Á´¤Æ¤Î¥æ¡¼¥¶¡¼¤Ë¥Ñ¥¹¥ï¡¼¥É¤ò
-ÀßÄꤹ¤Ù¤­¤Ç¤¹¡£¤Þ¤¿¡¢@code{mysql.user} ¥Æ¡¼¥Ö¥ë¤«¤é
-@code{Host='localhost'} ¤Ç @code{User=''} ¤È¤Ê¤Ã¤Æ¤¤¤ë¥ì¥³¡¼¥É¤ò
-ºï½ü¤¹¤Ù¤­¤Ç¤¹¡£
-
-@code{root} ¥æ¡¼¥¶¡¼¤Ë¤â¥Ñ¥¹¥ï¡¼¥É¤òÀßÄꤹ¤Ù¤­¤Ç¤¹¡§
-(The following example starts by removing the anonymous user, that allows
-anyone to access the 'test' database)
-
-@example
-C:\mysql\bin\mysql mysql
-mysql> DELETE FROM user WHERE Host='localhost' AND User='';
-mysql> QUIT
-C:\mysql\bin\mysqladmin reload
-C:\mysql\bin\mysqladmin -u root password your_password
-@end example
-
-¥Ñ¥¹¥ï¡¼¥É¤òÀßÄꤷ¤¿¸å¡¢¤â¤· @code{mysqld} ¥µ¡¼¥Ð¡¼¤òÄä»ß¤µ¤»¤ë¤Ê¤é¡¢
-°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-
-@example
-mysqladmin --user=root --password=your_password shutdown
-@end example
-
-If you are using the old shareware version of @strong{MySQL} 3.21 under
-Windows, the above command will fail with an error: @code{parse error
-near 'SET OPTION password'}. This is because the old shareware version,
-which is based on @strong{MySQL} 3.21, doesn't have the @code{SET PASSWORD}
-command. The fix is in this case is to upgrade to the 3.22 shareware
-version.
-
-With the newer @strong{MySQL} versions you can easily add new users
-and change privileges with @code{GRANT} and @code{REVOKE} commands.
-@xref{GRANT}.
-
-
-@node Win32 and SSH, Win32 symbolic links, Win32 running, Win32
-@subsection SSH ¤òÍøÍѤ·¤Æ¥ê¥â¡¼¥È¤Î @strong{MySQL} ¤Ë Win32 ¤«¤éÀܳ
-
-SSH ¤òÍøÍѤ·¤Æ¡¢Win32 ¤«¤é¡¢¤É¤¦¤ä¤Ã¤Æ¥ê¥â¡¼¥È¤Î MySQL ¤ËÀܳ¤¹¤ë¤«¤ÎÀâÌÀ¤Ç¤¹¡£
-(by David Carlson).
-
-@itemize @bullet
-@item
-¤¢¤Ê¤¿¤Î windows ¥Þ¥·¥ó¤Ë SSH ¥¯¥é¥¤¥¢¥ó¥È¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹ - »ä¤Ï¥Õ¥ê¡¼ÈǤÎ
-SSH ¥¯¥é¥¤¥¢¥ó¥È¤ò»ÈÍѤ·¤Þ¤·¤¿¡£ @uref{http://www.doc.ic.ac.uk/~ci2/ssh/}.
-¾¤ÎÍ­±×¤Ê¾ðÊó¤Ï¡§
-@uref{http://www.npaci.edu/Security/npaci_security_software.html} and
-@uref{http://www.npaci.edu/Security/samples/ssh32_windows/index.html}.
-@item
-SSH ¤òµ¯Æ°¡£ Host Name ¤ò ¤¢¤Ê¤¿¤Î MySQL ¥µ¡¼¥Ð¡¼¤Î̾Á°¤« IP ¥¢¥É¥ì¥¹¤Ë¥»¥Ã¥È¤·¤Þ¤¹¡£
-userid ¤ò¡¢¤¢¤Ê¤¿¤Î¥µ¡¼¥Ð¡¼¤Ø¤Î¥í¥°¥¤¥ó̾¤Ë¥»¥Ã¥È¤·¤Þ¤¹¡£
-@item
-"local forwards" ¤ò¥¯¥ê¥Ã¥¯¡£ @code{local port: 3306},
-@code{host: localhost}, @code{remote port: 3306} ¤Ë¤½¤ì¤¾¤ì¥»¥Ã¥È¡£
-@item
-Á´¤ÆÊݸ(Save)¡£ Êݸ¤·¤Æ¤â¼¡²ó¤ä¤êľ¤·¤¬¤Ç¤­¤Þ¤¹¡£
-@item
-SSH ¤Ç¤¢¤Ê¤¿¤Î¥µ¡¼¥Ð¡¼¤Ë¥í¥°¥¤¥ó¡£
-@item
-¤Ê¤Ë¤« ODBC ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó(Î㤨¤Ð Access) ¤òµ¯Æ°¡£
-@item
-ODBC ¥É¥é¥¤¥Ð¡¼¤òÍøÍѤ·¤Æ MySQL ¤Ø¤Î¿·¤·¤¤¥Õ¥¡¥¤¥ë¤È¥ê¥ó¥¯¤òºîÀ®¡£
-¤³¤ì¤ÏÄ̾ï¤Î»þ¤ÈºîÀ®ÊýË¡¤ÏÊѤï¤ê¤Ê¤¤¤Ç¤¹¤¬¡¢¥µ¡¼¥Ð¡¼¤¬ "localhost" ¤Ç
-¤¢¤ë¤³¤È¤¬°ã¤¤¤Þ¤¹
-@end itemize
-
-That's it. It works very well with a direct Internet connection. I'm
-having problems with SSH conflicting with my Win95 network and Wingate -
-but that'll be the topic of a posting on another software company's
-usegroup!
-
-@findex Symbolic links
-@findex Using multiple disks to start data
-@node Win32 symbolic links, Win32 vs. Unix, Win32 and SSH, Win32
-@subsection Splitting data across different disks under Win32
-
-On windows @strong{MySQL} 3.23.16 and above is compiled with the
-@code{-DUSE_SYMDIR} option. This allows you to put a database on
-different disk by adding a symbolic link to it (in a similar manner that
-symbolic links works on Unix).
-
-On windows you make a symbolic link to a database by creating a file
-that contains the path to the destination directory and saving this in
-the @code{mysql_data} directory under the filename @code{database.sym}.
-Note that the symbolic link will only be used if the directory
-@code{mysql_data_dir\database} doesn't exist.
-
-For example if you want to have database @code{foo} on @file{D:\data\foo} you
-should create the file @file{C:\mysql\data\foo.sym} that should contains the
-text @code{D:\data\foo}. After this, all tables created in the database
-@code{foo} will be created in @file{D:\data\foo}.
-
-@node Win32 vs. Unix, , Win32 symbolic links, Win32
-@subsection @strong{MySQL}-Win32 compared to Unix @strong{MySQL}
-
-@strong{MySQL}-Win32 ¥Ð¡¼¥¸¥ç¥ó¤Ï¸½ºß¤½¤ì¼«ÂΤȤƤâ°ÂÄꤷ¤¿(stable¤Ê)¾õÂ֤Ƕ¡µë¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-MySQL-win32 ¥Ð¡¼¥¸¥ç¥ó¤Ï ¤¹¤Ù¤Æ¤Îµ¡Ç½¤¬UNIX¥Ð¡¼¥¸¥ç¥ó¤ÎMySQL¤ÈÂбþ¤·¤Æ¤¤¤Þ¤¹¡£
-¤¿¤À¤·¡¢²¼µ­¤Î¤è¤¦¤ÊÎã³°¤¬¤¢¤ê¤Þ¤¹¡£
-
-@table @strong
-@item Win95 ¤È¥¹¥ì¥Ã¥É
-Win95¤Ï¡¢³Æ¡¹¤Î¥¹¥ì¥Ã¥É¤ÎºîÀ®¤Î¤¿¤á¤Ë¥á¥¤¥ó¥á¥â¥ê¤Î¤ª¤è¤½200¥Ð¥¤¥È¤ò¥á¥â¥ê¥ê¡¼¥¯
-¤·¤Þ¤¹¡£¤³¤ì¤Î¤¿¤á¤Ë¡¢¤â¤·¤¢¤Ê¤¿¤¬Â¿¤¯¤ÎÀܳ¤ò¤¹¤ì¤Ð¡¢@strong{MySQL} ¤Î³Æ¡¹¤ÎÀܳ¤¬¿·¤·¤¤
-¥¹¥ì¥Ã¥É¤òºîÀ®¤¹¤ë¤Î¤Ç¡¢¤¢¤Ê¤¿¤ÏWin95¤Ç¤ÏĹ»þ´Ö¡¢@code{mysqld} ¤ò¼Â¹Ô¤µ¤»¤ë¤Ù¤­¤Ç¤Ï¤¢¤ê
-¤Þ¤»¤ó¡ª
-WinNT and Win98 don't suffer from this bug.
-
-@item Concurrent reads
-@strong{MySQL} depends on the @code{pread()} and @code{pwrite()} calls to be
-able to mix @code{INSERT} and @code{SELECT}. As windows doesn't support these
-calls, @strong{MySQL} can't currently handle concurrent reads on windows.
-We plan to fix this by adding an extra mutex to each open file and simulate
-@code{pread()}/@code{pwrite()}.
-
-@item ¥Ö¥í¥Ã¥¯Æɤ߹þ¤ß
-@strong{MySQL} ¤Ï¤½¤ì¤¾¤ì¤ÎÀܳ¤Î¤¿¤á¤Ë¥Ö¥í¥Ã¥¯Æɤ߹þ¤ß¤ò»È¤¤¤Þ¤¹¡£
-¤³¤ì¤Ï°Ê²¼¤Î»öÊÁ¤ò°ÕÌ£¤·¤Æ¤¤¤Þ¤¹¡§
-@itemize @bullet
-
-@item
-Àܳ¤Ï¡¢@strong{MySQL} ¤ÎUnix¥Ð¡¼¥¸¥ç¥ó¤Çµ¯¤³¤ë¤è¤¦¤Ë¡¢8»þ´Ö¤Î¸å¤Ë¼«Æ°Åª¤ËÀܳ¤¬ÃÇ
-¤ÁÀÚ¤é¤ì¤ë¤ï¤±¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó
-
-@item
-¤â¤·Àܳ¤¬¡Ö¥Ï¥ó¥°¤¹¤ì¤Ð¡×¡¢@strong{MySQL}¤ò½ªÎ»¤·¤Ê¤¤¤Ç¤½¤ì¤òÃæÃǤ¹¤ë¤³¤È¤Ï¡¢ÉÔ²Äǽ¤Ç¤¹¡£
-
-@item
-@code{mysqladmin kill} ¤Ï¡¢¥¹¥ê¡¼¥×¤·¤Æ¤¤¤ëÀܳ¾å¤Ç¤ÏƯ¤«¤Ê¤¤¤Ï¤º¤Ç¤¹¡£
-
-@item
-¥¹¥ê¡¼¥×¤·¤Æ¤¤¤ëÀܳ¤¬¤¢¤ë¤«¤®¤ê¡¢@code{mysqladmin shutdown} ¤Ï¡¢ÃæÀ䤹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£
-@end itemize
-
-»ä¤¿¤Á¤Ï¡¢¶á¤¤¾­Íè¤Ë¤³¤ì¤ò½¤Àµ¤¹¤ë¤³¤È¤ò·×²è¤·¤Æ¤¤¤Þ¤¹¡£
-
-@item UDF ´Ø¿ô
-º¹¤·Åö¤ê¡¢@strong{MySQL}-Win32 ¤Ï¥æ¡¼¥¶¤ÎÄêµÁ¤Ç¤­¤ë´Ø¿ô¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤»¤ó¡£
-
-@item @code{DROP DATABASE}
-Ê£¿ô¤Î¥¹¥ì¥Ã¥É¤Ç»È¤ï¤ì¤Æ¤¤¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÏDROP¤ò¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£
-
-@item ¥¿¥¹¥¯¥Þ¥Í¡¼¥¸¥ã¡¼¤«¤é¤Î @strong{MySQL} ¤Î½ªÎ»
-Windows95¤Ç¤Ï¡ÖWindows¤Î½ªÎ»¡×¤ä¥¿¥¹¥¯¥Þ¥Í¡¼¥¸¥ã¤«¤é @strong{MySQL} ¤ò½ªÎ»¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£
-@code{mysqladmin shutdown} ¤Ç½ªÎ»¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-
-@item Âçʸ»ú¾®Ê¸»ú¤ò¶èÊ̤·¤Ê¤¤Ì¾Á°
-Win32¤Ç¤Ï¥Õ¥¡¥¤¥ë¥Í¡¼¥à¤ÏÂçʸ»ú¾®Ê¸»ú¤¬¶èÊ̤µ¤ì¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢Win32ÍѤΠ@strong{MySQL} ¤Ç
-¤Ï¥Æ¡¼¥Ö¥ë̾¤ÏÂçʸ»ú¾®Ê¸»ú¤¬¶èÊ̤µ¤ì¤Þ¤¹¡£Í£°ì¤ÎÀ©¸Â¤Ï¡¢Ì¾Á°¤¬½êÄê¤Î¥¹¥Æ¡¼¥È¥á¥ó
-¥È¤Î»ê¤ë½ê¤ÎƱ¤¸¥±¡¼¥¹¤ÇÍ¿¤¨¤é¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤½¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Èɽ¤Ç¤¹¡£
-²¼¤Î¤è¤¦¤Ê¥¯¥¨¥ê¡¼¤ÏƯ¤­¤Þ¤»¤ó¡£¤½¤ì¤¬É½¤Î @code{MY_TABLE}, @code{my_table} ξÊý¤ò»²¾È¤¹¤ë¤«¤é¤Ç
-¤¹¡£
-
-@example
-SELECT * FROM my_table WHERE MY_TABLE.col=1;
-@end example
-
-@item The @samp{\} (¥Ç¥£¥ì¥¯¥È¥ê̾)
-Win95¤Î¥Ñ¥¹Ì¾¥³¥ó¥Ý¡¼¥Í¥ó¥È¤Ï¡¢ @samp{\} ¤Ë¤è¤Ã¤ÆÎ¥¤µ¤ì¤Þ¤¹¤¬¡¢¤½¤Îʸ»ú¤ÏƱ¤¸¤¯ @strong{MySQL} ¤Î¥¨
-¥¹¥±¡¼¥×ʸ»ú¤Ç¤â¤¢¤ê¤Þ¤¹¡£¤â¤·¤¢¤Ê¤¿¤Ï @code{LOAD DATA INFILE} ¤Þ¤¿¤Ï @code{SELECT ... INTO OUTFILE} ¤ò»È¤Ã¤Æ¡¢UNIX¤Ç¤Î¥Õ¥¡¥¤¥ë¥Í¡¼¥à¤Ç @samp{/} ¤ò½ñ¤¯¤è¤¦¤Ë¤·¤¿¤¤¤Ê¤é¡¢¤½¤ÎÂå¤ï¤ê¤Ë
-¡Ö\\¡×¤È @samp{\} ¤ò¥À¥Ö¥ë¤Ç»È¤ï¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-
-@example
-LOAD DATA INFILE "C:\\tmp\\skr.txt" INTO TABLE skr;
-SELECT * FROM skr INTO OUTFILE 'C:/tmp/skr.txt';
-@end example
-
-@item @code{Can't open named pipe} ¥¨¥é¡¼
-¤â¤·¤¢¤Ê¤¿¤¬ºÇ¿·¤Î mysql-clients ¤ò»ý¤ÄNT¤Î¾å¤Ç @strong{MySQL}-Win32 ¤Î¥·¥§¥¢¥¦¥§¥¢¥Ð¡¼¥¸¥ç¥ó
-¤ò»È¤¨¤Ð¡¢¤¢¤Ê¤¿¤Ï¡¢¼¡¤Î¥¨¥é¡¼¤òÆÀ¤ë¤³¤È¤Ë¤Ê¤ë¤Ï¤º¤Ç¤¹:
-
-@example
-error 2017: can't open named pipe to host: . pipe...
-@end example
-
-@tindex .my.cnf file
-¤³¤ì¤Ï¡¢ @strong{MySQL} ¤Î¥ê¥ê¡¼¥¹¥Ð¡¼¥¸¥ç¥ó¤¬¥Ç¥Õ¥©¥ë¥È¤ÇNT¤Î¾å¤Ë¥Í¡¼¥à¥É¥Ñ¥¤¥×¤ò»È¤Ã¤Æ¤¤
-¤ë¤¿¤á¤Ëµ¯¤³¤Ã¤Æ¤¤¤Þ¤¹¡£
-¤¢¤Ê¤¿¤Ï¿·¤·¤¤ @strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¤Ë¤Þ¤¿¤Ï @file{C:\my.cnf} ¥Õ¥¡¥¤¥ë¤òºî¤ë¤µ¤¤(¤³¤Î¥Õ¥¡¥¤
-¥ë¤Ï°Ê²¼¤Î¾ðÊó¤ò´Þ¤ß¤Þ¤¹)¤Ë @code{--host=localhost} ¥ª¥×¥·¥ç¥ó¤ò»È¤¦¤³¤È¤Ë¤è¤Ã¤Æ¤³¤Î¥¨
-¥é¡¼¤òÈò¤±¤é¤ì¤Þ¤¹¡£
-
-@example
-[client]
-host = localhost
-@end example
-
-@item @code{Access denied for user} error
-¤â¤·¤¢¤Ê¤¿¤¬Æ±¤¸¥Þ¥·¥ó¾å¤Î @strong{MySQL} ¥µ¡¼¥Ð¡¼¤Ë¥¢¥¯¥»¥¹¤·¤¿»þ
-@code{Access denied for user: 'some-user@@unknown' to database 'mysql'}
- ¥¨¥é¡¼¤òÆÀ¤ë¤Ê¤é¡¢¤³¤ì¤Ï¤¢¤Ê¤¿¤Î @strong{MySQL} ¤¬¤¢¤Ê¤¿
-¤Î¥Þ¥·¥ó¤Î¥Û¥¹¥È̾¤òÀµ¤·¤¯²ò·è¤Ç¤­¤Æ¤Ê¤¤¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£
-
-¤³¤ì¤ò½¤Àµ¤¹¤ë¤Ë¤Ï¤¢¤Ê
-¤¿¤Ï¥Õ¥¡¥¤¥ë @file{\windows\hosts} ¤òºî¤ê¡¢°Ê²¼¤Î¾ðÊó¤ò½ñ¤¯¤³¤È¤Ë¤è¤Ã¤Æ¤¹¤Ù¤­¤Ç¤¹¡£
-(Ãí:Windows95,98¤Ë¤Ï\Windows¥Õ¥©¥ë¥À¾å¤Ë¥µ¥ó¥×¥ë¤È¤·¤Æ¡Ölmhosts.sam¡×¥Õ¥¡¥¤¥ë¤¬
-´û¤Ë¤¢¤ë¤Ï¤º¤Ç¤¹)
-
-@example
-127.0.0.1 localhost
-@end example
-@end table
-
-¤³¤³¤Ë¤ÏWin32¥ê¥ê¡¼¥¹¤ò½õ¤±¤Æ¤¯¤ì¤ë狼¤Î¤¿¤á¤Ë¤¤¤¯¤Ä¤«¥ª¡¼¥×¥ó¤Ë¤Ê¤Ã¤Æ¤¤¤ëÌäÂê
-¤¬¤¢¤ê¤Þ¤¹:
-
-@itemize @bullet
-@item
-Make a single user @code{MYSQL.DLL} server. This should include everything in
-a standard @strong{MySQL} server, except thread creation. This will make
-@strong{MySQL} much easier to use in applications that don't need a true
-client/server and don't need to access the server from other hosts.
-
-@item
-Add some nice ``start'' and ``shutdown'' icons to the @strong{MySQL} installation.
-@file{MySQL.DLL}.
-
-@item
-Create a tool to manage registry entries for the @strong{MySQL} startup
-options. The registry entry reading is already coded into @code{mysqld.cc},
-but it should be recoded to be more ``parameter'' oriented.
-The tool should also be able to update the @file{\my.cnf} file if the user
-would prefer to use this instead of the registry.
-
-@item
-NT¾å¤Ç @code{mysqld} ¤ò¥µ¡¼¥Ó¥¹¤È¤·¤Æ @code{--install} ¥Õ¥é¥°¤ÇÅÐÏ¿¤¹¤ë¤È¤­¡¢¤â¤·¤¢¤Ê¤¿¤¬¥³¥Þ¥ó¥É¥é
-¥¤¥ó¤Î¾å¤Ç¥Ç¥Õ¥©¥ë¥È¤Î¥ª¥×¥·¥ç¥ó¤òƱ¤¸¤¯²Ã¤¨¤ë¤³¤È¤¬¤Ç¤­¤ì¤Ð¡¢¤½¤ì¤Ï¡¢Îɤ¤¤À¤í
-¤¦¡£¤³¤ÎÌäÂê¤Ïº¹¤·Åö¤¿¤Ã¤Æ¡¢ @file{C:\my.cnf} ¥Õ¥¡¥¤¥ë¤òÂå¤ï¤ê¤Ë¤¹¤ë¤³¤È¤ÇÂåÍѤ·¤Æ¤¤¤Þ
-¤¹¡£
-
-@item
-¤¢¤Ê¤¿¤¬¥é¥Ã¥×¥È¥Ã¥×¤ÎÁö¤ëWin95¤òÃæÃǤ¹¤ë¤È¡¢¥é¥Ã¥×¥È¥Ã¥×¤Î¥ì¥¸¥å¡¼¥à¤µ¤ì¤ë»þ¡¢
- @code{mysqld} ¥Ç¡¼¥â¥ó¤Ï¿·¤·¤¤Àܳ¤ò¼õ¤±Æþ¤ì¤Þ¤»¤ó¡£»ä¤¿¤Á¤Ï¡¢¤³¤ì¤¬Win95¡¢TCP/IP¡¢¤Þ¤¿
-¤Ï¡¢ @strong{MySQL} ¤¬»ý¤ÄÌäÂê¤Ç¤¢¤ë¤«¤É¤¦¤«¤ï¤«¤ê¤Þ¤»¤ó¡£
-
-@item
-¤Þ¤¿¡¢¥¿¥¹¥¯¥Þ¥Í¡¼¥¸¥ã¤«¤é @code{mysqld} ¤ò½ªÎ»¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ì¤Ð¤Û¤ó¤È¤¦¤Ë¿ÆÀڤǤ·¤ç¤¦¡£
-º£¤Î¤È¤³¤í¡¢¤¢¤Ê¤¿¤Ï @code{mysqladmin shutdown} ¤ò»È¤ï¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-
-@item
-@code{mysql} ¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¥Ä¡¼¥ë¤È¤·¤Æ @code{readline} ¤òWin32¤Ë°Ü¿¢¤·¤Þ¤»¤ó¤«¡©
-
-@item
-ɸ½à¤Î @strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È(@code{mysql}¡¢@code{mysqlshow}¡¢@code{mysqladmin}¡¢¤ª¤è¤Ó¡¢@code{mysqldump})¤ÎGUI
-¥Ð¡¼¥¸¥ç¥ó¤¬¤¢¤ì¤Ð¤¤¤¤¤Ç¤·¤ç¤¦¤Í¤§¡£
-
-@item
-¤â¤· @file{net.c} ¤Î¥½¥±¥Ã¥È¤Ø¡ÖÆɤ߹þ¤ß¡×¤È¡Ö½ñ¤­¹þ¤ß¡×¤¬interruptible¤Ê¤é¤Ð¡¢¤½¤ì¤Ï¤¤
-¤¤¤Î¤Ç¤¹¤¬¡£¤³¤ì¤¬¤Ç¤­¤ì¤ÐWin32¾å¤Ç @code{mysqladmin kill} ¤ò»ÈÍѤ·¤Æ³«¤«¤ì¤¿¥¹¥ì¥Ã¥É¤ò½ª
-λ¤Ç¤­¤ë¤Î¤Ç¤¹¤¬¡£
-
-@item
-@strong{MySQL}-Win32/@strong{MyODBC} ¤Ë¤Ä¤¤¤Æ½ñ¤«¤ì¤¿Windows¥×¥í¥°¥é¥ß¥ó¥°¤Î¥É¥­¥å¥á¥ó¥È¡Ä¤½¤ì¤é¤¬
-Æ°¤¤¤Æ¤¤¤ë¤³¤È¤ò³ÎǧºÑ¤ß¤Ç¤¢¤ë¤³¤È¡£
-
-@item
-@code{mysqld} ¤Ï¥Ç¥Õ¥©¥ë¥È¥í¥±¡¼¥ë¤Ç¤Ï¤Ê¤¯¡¢¾ï¤Ë¡ÖC¡×¥í¥±¡¼¥ë¤Çµ¯Æ°¤·¤Þ¤¹¡£»ä¤¿¤Á¤Ï¡¢
-¥½¡¼¥È½ç½ø¤Î¤¿¤á¤Ë¡¢ @code{mysqld} ¤Ë¡¢¸½ºß¤Î¥í¥±¡¼¥ë¤ò»È¤ï¤»¤¿¤¤¡£
-
-@item
-MysqlManager¤Ë¤â¤Ã¤È¿¤¯¤Î¥ª¥×¥·¥ç¥ó¤ò¡£
-
-@item
-¥¯¥é¥¤¥¢¥ó¥È¤È¥µ¡¼¥Ð¡¼¤Î¥³¥ß¥å¥Ë¥±¡¼¥·¥ç¥ó¥×¥í¥È¥³¥ë¤ÎÊѹ¹¡Äsockets¤ÈTCP/IP¤ÎÂå
-¤ï¤ê¤ËWindowsÆâÉô¤Î¥³¥ß¥å¥Ë¥±¡¼¥·¥ç¥ó¤ò»È¤¦
-
-@item
-UDF ´Ø¿ô¤Î @code{.DLL} ¤Ç¤Î¼ÂÁõ
-
-@item
-Add macros to use the faster thread-safe increment/decrement methods
-provided by Win32.
-
-@end itemize
-
-¾¤Îwin32¤Ë¸ÂÄꤵ¤ì¤¿¾É¾õ¤Ï @strong{MySQL}-Win32 ¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤ËƱº­¤µ¤ì¤Æ¤¤¤ë
- @file{README} ¥Õ¥¡¥¤¥ë¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-
-
-@node OS/2, TcX binaries, Win32, Installing
-@section OS/2 notes
-
-@strong{MySQL} uses quite a few open files. Because of this, you
-should add something like the following to your @file{CONFIG.SYS} file:
-
-@example
-SET EMXOPT=-c -n -h1024
-@end example
-
-If you don't do this, you will probably run into the following error:
-
-@example
-File 'xxxx' not found (Errcode: 24)
-@end example
-
-When using @strong{MySQL} with OS/2 Warp 3, FixPack 29 or above is
-required. With OS/2 Warp 4, FixPack 4 or above is required. This is a
-requirement of the Pthreads library. @strong{MySQL} must be installed
-in a partition that supports long file names such as HPFS, FAT32, etc.
-
-The @file{INSTALL.CMD} script must be run from OS/2's own @file{CMD.EXE}
-and may not work with replacement shells such as @file{4OS2.EXE}.
-
-The @file{scripts/mysql-install-db} script has been renamed: it is now called
-@file{install.cmd} and is a REXX script which will set up the default
-@strong{MySQL} security settings and create the WorkPlace Shell icons
-for @strong{MySQL}.
-
-Dynamic module support is compiled in but not fully tested. Dynamic
-modules should be compiled using the Pthreads runtime library.
-
-@example
-gcc -Zdll -Zmt -Zcrtdll=pthrdrtl -I../include -I../regex -I.. \
- -o example udf_example.cc -L../lib -lmysqlclient udf_example.def
-mv example.dll example.udf
-@end example
-
-@strong{Note:} Due to limitations in OS/2, UDF module name stems must not
-exceed 8 characters. Modules are stored in the @file{/mysql2/udf}
-directory; the @code{safe-mysqld.cmd} script will put this directory in
-the @code{BEGINLIBPATH} environment variable. When using UDF modules,
-specified extensions are ignored --- it is assumed to be @file{.udf}.
-For example, in Unix, the shared module might be named @file{example.so}
-and you would load a function from it like this:
-
-@example
-CREATE FUNCTION metaphon RETURNS STRING SONAME "example.so";
-@end example
-
-Is OS/2, the module would be named @file{example.udf}, but you would not
-specify the module extension:
-
-@example
-CREATE FUNCTION metaphon RETURNS STRING SONAME "example";
-@end example
-
-
-@node TcX binaries, Post-installation, OS/2, Installing
-@section TcX binaries
-
-¥µ¡¼¥Ó¥¹¤È¤·¤Æ¡¢TcX ¤Ï @strong{MySQL} ¤Î¥Ð¥¤¥Ê¥êÇÛÉÛ¤òÄ󶡤·¤Æ¤¤¤Þ¤¹¡£
-¤³¤ì¤é¤Î¥³¥ó¥Ñ¥¤¥ë¤Ï TcX ÆâÉô¤Ç¤ª¤³¤Ê¤Ã¤¿¤ê¡¢²æ¡¹¤Ë¥Þ¥·¥ó¤Î
-¥¢¥¯¥»¥¹¤òÄ󶡤·¤Æ¤â¤é¤Ã¤Æ¤¤¤ë¸ÜµÒ¤Î¥Þ¥·¥ó¾å¤Ç¹Ô¤Ã¤Æ¤¤¤Þ¤¹¡£
-
-¤³¤ì¤é¤ÎÇÛÉÛʪ¤Ï @code{scripts/make_binary_distribution} ¤ÇºîÀ®¤µ¤ì¡¢
-°Ê²¼¤Î¥³¥ó¥Ñ¥¤¥ë¥ª¥×¥·¥ç¥ó¤ÇÄ´À°¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-
-@table @asis
-@item SunOS 4.1.4 2 sun4c with @code{gcc} 2.7.2.1
-@code{CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --disable-shared}
-
-@item SunOS 5.5.1 sun4u with @code{egcs} 1.0.3a
-@code{CC=gcc CFLAGS="-O6 -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-low-memory}
-
-@item SunOS 5.6 sun4u with @code{egcs} 2.90.27
-@code{CC=gcc CFLAGS="-O6 -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-low-memory}
-
-@item SunOS 5.6 i86pc with @code{gcc} 2.8.1
-@code{CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-low-memory}
-
-@item Linux 2.0.33 i386 with @code{pgcc} 2.90.29 (@code{egcs} 1.0.3a)
-@code{CFLAGS="-O6 -mpentium -mstack-align-double -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -mpentium -mstack-align-double -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static}
-
-@item SCO 3.2v5.0.4 i386 with @code{gcc} 2.7-95q4
-@code{CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql}
-
-@item AIX 2 4 with @code{gcc} 2.7.2.2
-@code{CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql}
-
-@item OSF1 V4.0 564 alpha with @code{gcc} 2.8.1
-@code{CC=gcc CFLAGS=-O CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-low-memory}
-
-@item Irix 6.3 IP32 with @code{gcc} 2.8.0
-@code{CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql}
-
-@item BSDI BSD/OS 3.1 i386 with @code{gcc} 2.7.2.1
-@code{CC=gcc CXX=gcc CXXFLAGS=-O ./configure --prefix=/usr/local/mysql}
-
-@item BSDI BSD/OS 2.1 i386 with @code{gcc} 2.7.2
-@code{CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql}
-@end table
-
-¾å¤Ç¼¨¤·¤¿¥ª¥×¥·¥ç¥ó°Ê³°¤ÇºÇŬ²½¤ò»Ü¤·¤¿Êý¤Ï¤À¤ì¤Ç¤â¡¢³«È¯¼Ô¸þ¤±¤Î
-¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤Ë¥Ý¥¹¥È¤Ç¤­¤Þ¤¹¡£
-@email{developer@@lists.mysql.com}.
-
-RPM ÇÛÉÛ¤Ç¤Ï @strong{MySQL} 3.22 ¤ò user-contributed ¤È¤·¤Æ¤¤¤Þ¤¹¡£
-3.22 ¤ò¤Ï¤¸¤á¡¢¤¤¤¯¤Ä¤«¤Î RPM ¥Ñ¥Ã¥±¡¼¥¸¤Ï TcX À½¤Ç¤¹¡£
-
-
-@node Post-installation, Upgrade, TcX binaries, Installing
-@section ¥¤¥ó¥¹¥È¡¼¥ë¸å¤ÎÀßÄê¤È¥Æ¥¹¥È
-
-@menu
-* mysql_install_db:: Problems running @code{mysql_install_db}
-* Starting server:: Problems starting the @strong{MySQL} server
-* Automatic start:: Starting and stopping @strong{MySQL} automatically
-* Option files:: Option files
-@end menu
-
-½é¤á¤Æ @strong{MySQL}¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¤é(¥Ð¥¤¥Ê¥ê¤«¤é¤Ç¤â¥½¡¼¥¹¤«¤é¤Ç¤â¤Ç¤¹¤¬)¡¢
-¥µ¡¼¥Ð¡¼¤òÆ°ºî¤µ¤»¤ë¤¿¤á¤Ë¡¢µö²Ä¥Æ¡¼¥Ö¥ë¤ò½é´ü²½¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-¤Þ¤¿¥Þ¥·¥ó¤Îµ¯Æ°»þ¡¢Ää»ß»þ¤Ë¡¢¥µ¡¼¥Ð¡¼¤ò¼«Æ°¤Ç³«»Ï¡¢Ää»ß¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
-
-Ä̾µö²Ä¥Æ¡¼¥Ö¥ë¤Î¥¤¥ó¥¹¥È¡¼¥ë¤È¥µ¡¼¥Ð¡¼¤Î³«»Ï¤Ï¡¢
-¥½¡¼¥¹¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ê¤é°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-
-@example
-shell> ./scripts/mysql_install_db
-shell> cd mysql_installation_directory
-shell> ./bin/safe_mysqld &
-@end example
-
-¥Ð¥¤¥Ê¥ê¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Ç¤Ï¼¡¤ò¹Ô¤Ê¤¤¤Þ¤¹:
-
-@example
-shell> cd mysql_installation_directory
-shell> ./bin/mysql_install_db
-shell> ./bin/safe_mysqld &
-@end example
-
-¥Æ¥¹¥È¤Ï¡¢@strong{MySQL} ¤Î¥È¥Ã¥×¥Ç¥£¥ì¥¯¥È¥ê¡¼¤«¤é´Êñ¤Ë¼Â¹Ô¤Ç¤­¤Þ¤¹¡£
-¥Ð¥¤¥Ê¥êÇÛÉÛ¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢¤³¤ì(¥È¥Ã¥×¥Ç¥£¥ì¥¯¥È¥ê)¤Ï
-¥¤¥ó¥¹¥È¡¼¥ëÀè¤Î¥Ç¥£¥ì¥¯¥È¥ê¡¼¤Ë¤Ê¤ë¤Ç¤·¤ç¤¦(@file{/usr/local/mysql})¡£
-¥½¡¼¥¹ÇÛÉۤξì¹ç¡¢¤³¤ì¤Ï @strong{MySQL} ¤Î¥½¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¹¡£
-
-¥³¥Þ¥ó¥É¤ÏËÜÀá¤È¤¤¤«¤Ë³¤¯Àá¤ÇÀâÌÀ¤·¤Þ¤¹¤¬¡¢@code{BINDIR} ¤Ï
-@code{mysqladmin} ¤ä @code{safe_mysqld} ¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤ò¼¨¤·¤Þ¤¹¡£
-¥Ð¥¤¥Ê¥êÇÛÉÛ¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢@code{BINDIR} ¤Ï¥Ð¥¤¥Ê¥êÇÛÉۤΠ@file{bin} ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ê¤ê¤Þ¤¹¡£
-¥½¡¼¥¹¤«¤é¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¾ì¹ç¡¢@code{BINDIR} ¤Ï¡¢@code{configure} ¤ÇÆÃÊÌ»ØÄꤷ¤Ê¤¤¸Â¤ê¡¢
-@file{/usr/local/bin} ¤Ç¤¹¡£
-@code{EXECDIR} ¤Ï @code{mysqld} ¥µ¡¼¥Ð¡¼¤Î¥¤¥ó¥¹¥È¡¼¥ëÀè¤Ç¤¹¡£
-¥Ð¥¤¥Ê¥êÇÛÉÛ¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢¤³¤ì¤Ï @code{BINDIR} ¥Ç¥£¥ì¥¯¥È¥ê¤ÈƱ°ì¤Ë¤Ê¤ê¤Þ¤¹¡£
-¥½¡¼¥¹¤«¤é¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¾ì¹ç¡¢@file{/usr/local/libexec} ¤Ç¤¹¡£
-
-¥Æ¥¹¥È¤Ë¤Ä¤¤¤Æ°Ê²¼¤Ë¾ÜºÙ¤ËÀâÌÀ¤·¤Þ¤¹:
-
-@enumerate
-@item
-ɬÍפʤé¤Ð¡¢@code{mysqld} ¥µ¡¼¥Ð¡¼¤òµ¯Æ°¤· @strong{MySQL} ¤Îµö²Ä¥Æ¡¼¥Ö¥ë¤ò½é´ü²½¤·¤Þ¤¹¡£
-(µö²Ä¥Æ¡¼¥Ö¥ë¤Ï¥æ¡¼¥¶¡¼¤¬¤É¤Î¤è¤¦¤Ê¸¢¸Â¤ò¤â¤Ã¤Æ¥µ¡¼¥Ð¡¼¤ËÀܳ¤òµö¤¹¤«¤ò·èÄꤹ¤ë¤â¤Î¤Ç¤¹¡£)
-¤³¤ì¤ÏÄ̾@code{mysql_install_db} ¥¹¥¯¥ê¥×¥È¤Ç½é´ü²½¤µ¤ì¤Þ¤¹¡£
-
-@example
-shell> scripts/mysql_install_db
-@end example
-
-Ä̾@code{mysql_install_db} ¤Î¼Â¹Ô¤Ï½é¤á¤Æ @strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë
-¤·¤¿¤¢¤È°ìÅÙ¤À¤±É¬ÍפǤ¹¡£ ¤¹¤Ç¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤ò
-¥¢¥Ã¥×¥°¥ì¡¼¥É¤¹¤ëºÝ¤Ë¤Ï¤³¤Î¼ê½ç¤ÏÈô¤Ð¤»¤Þ¤¹¡£
-¡Ê¤·¤«¤·¡¢@code{mysql_install_db} ¤Ï¼Â¤Ë°ÂÁ´¤Ç¡¢¤¹¤Ç¤Ë¥Æ¡¼¥Ö¥ë¤¬
-¸ºß¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¤¤¤«¤Ê¤ë¥Æ¡¼¥Ö¥ë¤â¹¹¿·¤·¤Þ¤»¤ó¡£¤·¤¿¤¬¤Ã¤Æ¡¢
-¼Â¹Ô¤¹¤Ù¤­¤«¤É¤¦¤«¤ï¤«¤é¤Ê¤¤¾ì¹ç¤Ï¡¢@code{mysql_install_db} ¤ò¾ï¤Ë
-Áö¤é¤»¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡Ë
-
-@code{mysql_install_db} ¤Ï 6¸Ä¤Î¥Æ¡¼¥Ö¥ë¤òºî¤ê¤Þ¤¹ (@code{user}, @code{db},
-@code{host}, @code{tables_priv}, @code{columns_priv} and @code{func})
-@code{mysql} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¡£ ½é´ü¤Î¸¢¸Â¾õÂ֤ˤĤ¤¤Æ¤ÎÀâÌÀ¤Ï
-@ref{Default privileges}. ¤³¤ì¤é¤Î¸¢¸Â¤Ï @strong{MySQL} @code{root} ¥æ¡¼¥¶¡¼¤Ë
-¤Ê¤ó¤Ç¤â¤Ç¤­¤ë¤è¤¦¤Ëµö²Ä¤·¡¢¤½¤·¤Æ¡¢¤À¤ì¤â¤¬
-@code{'test'} ¤È¤¤¤¦Ì¾Á°¤« @code{'test_'} ¤Ç¤Ï¤¸¤Þ¤ë̾Á°¤ò¤â¤Ä
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤òºîÀ®¡¢»ÈÍѤǤ­¤ë¤è¤¦¤Ëµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-
-¤â¤·µö²Ä¥Æ¡¼¥Ö¥ë¤òÀßÄꤷ¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¥µ¡¼¥Ð¡¼¤òµ¯Æ°»þ¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬½Ð¤Þ¤¹¡§
-
-@tindex host.frm, problems finding
-@example
-mysqld: Can't find file: 'host.frm'
-@end example
-
-¥Ð¥¤¥Ê¥êÇÛÉۤΠ@strong{MySQL} ¤Ç¤Ï¡¢¤â¤· @strong{MySQL} ¤ò
- @code{./bin/safe_mysqld} ¤ò¼Â¹Ô¤·¤Ê¤¤¤Çµ¯Æ°¤·¤¿¾ì¹ç¤Ë¡¢¤³¤Î¥¨¥é¡¼¤¬¤ª¤­¤Þ¤¹¡£!
-
-@code{root} ¤Ç @code{mysql_install_db} ¤ò¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ë¤È¤¢¤Ê¤¿¤Ï»×¤¦¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-¤·¤«¤·¡¢ @strong{MySQL} ¤Ï @code{root} °Ê³°¤Î¥æ¡¼¥¶¡¼¤Çµ¯Æ°¤Ç¤­¤Þ¤¹¡£
-¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤¬¥µ¡¼¥Ð¡¼¤òµ¯Æ°¤·¤¿¥æ¡¼¥¶¤ËÂФ·¤ÆÆɤ߽ñ¤­¤¬µö²Ä¤µ¤ì¤Æ¤¤¤ì¤ÐÎɤ¤¤Î¤Ç¤¹¡£
-@strong{MySQL} ¤ò°ìÈ̥桼¥¶¡¼¤ÇÁö¤é¤»¤ëÊýË¡¤Ï @ref{Changing MySQL user, , Changing
-@strong{MySQL} user}.
-
-¤â¤· @code{mysql_install_db} ¤ÇÌäÂ꤬½Ð¤¿¤é¡¢
-@ref{mysql_install_db, , @code{mysql_install_db}}. ¤ò»²¾È¤Î¤³¤È¡£
-
-@code{mysql_install_db} ¥¹¥¯¥ê¥×¥È¤òÁö¤é¤»¤ë¤Ë¤Ï¤¤¤¯¤Ä¤«ÁªÂò¤¬¤¢¤ê¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-@code{mysql_install_db} ¤òÁö¤é¤»¤ëÁ°¤ËÊÔ½¸¤·¤Æ¡¢µö²Ä¤Î½é´ü¾õÂÖ¤òÊѹ¹¤·¤Æ¤â¤¤¤¤¤Ç¤·¤ç¤¦¡£
-¤³¤ì¤Ï¿¤¯¤Î¥Þ¥·¥ó¤ËƱ¤¸¸¢¸ÂÀßÄê¤ò¤·¤Æ @strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ëºÝ¤Ë
-ÌòΩ¤Á¤Þ¤¹¡£ ¤³¤Î¾ì¹ç¡¢¤¤¤¯¤Ä¤«¤Î @code{INSERT} ¹½Ê¸¤ò @code{mysql.user} ¤È
-@code{mysql.db} ¥Æ¡¼¥Ö¥ë¤Ë¤¿¤¤¤·¤ÆÄɲ乤ë¤è¤¦¤Ë¤¹¤ë¤À¤±¤Ç¤¹¤ß¤Þ¤¹!
-
-@item
-¤â¤·¥¤¥ó¥¹¥È¡¼¥ë¸å¤Ëµö²Ä¤òÊѹ¹¤·¤¿¤¤¾ì¹ç¡¢ @code{mysql -u root mysql} ¤Ç @strong{MySQL} @code{root} ¥æ¡¼¥¶¡¼¤ÇÀܳ¤·¤ÆľÀܵö²Ä¥Æ¡¼¥Ö¥ë¤òÊѹ¹¤¹¤ë SQL ʸ¤ò¼Â¹Ô¤·¤Þ¤¹¡£
-
-@item
-¤¹¤Ç¤Ëµö²Ä¥Æ¡¼¥Ö¥ë¤¬ºîÀ®¤µ¤ì¤¿¾õÂ֤ǡ¢´°Á´¤Ëµö²Ä¥Æ¡¼¥Ö¥ë¤òºîÀ®¤·Ä¾¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¤³¤ì¤Ï¤¹¤Ç¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥Æ¡¼¥Ö¥ë¤¬¤¢¤ë¾ì¹ç¤ä¡¢@code{mysql_install_db} ¤òÊÔ½¸¤·¤¿¸å¤Ë¤½¤¦»×¤¦¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-@end itemize
-
-¤³¤ì¤é¤ÎÁªÂò¤Ë¤Ä¤¤¤Æ¤Ï @ref{Default privileges} ¤«¤é¤µ¤é¤Ë¾ðÊó¤¬ÆÀ¤é¤ì¤Þ¤¹¡£
-
-@item
-@strong{MySQL} ¥µ¡¼¥Ð¡¼¤ò°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æµ¯Æ°¤·¤Þ¤¹¡§
-@example
-shell> cd mysql_installation_directory
-shell> bin/safe_mysqld &
-@end example
-¥µ¡¼¥Ð¤Îµ¯Æ°¤ËÌäÂ꤬¤¢¤ì¤Ð¡¢@ref{Starting server} ¤ò¸«¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-@code{mysqladmin} ¤Ç¥µ¡¼¥Ð¡¼¤¬Áö¤Ã¤Æ¤¤¤ë¤«³Îǧ¤·¤Þ¤¹¡£
-¥µ¡¼¥Ð¡¼¤¬Î©¤Á¾å¤¬¤êÀܳ¤ò¼õ¤±ÉÕ¤±¤ë¤«³Îǧ¤¹¤ë´Êñ¤ÊÊýË¡¤ò°Ê²¼¤Ë¼¨¤·¤Þ¤¹¡§
-
-@example
-shell> BINDIR/mysqladmin version
-shell> BINDIR/mysqladmin variables
-@end example
-
-Î㤨¤Ð¡¢@code{mysqladmin version} ¤Î½ÐÎϤϤ¢¤Ê¤¿¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤È
- @strong{MySQL} ¤Î¥Ð¡¼¥¸¥ç¥ó¤ò½ÐÎϤ·¤Þ¤¹¡£
-½ÐÎϤϰʲ¼¤ÎÍͤˤǤޤ¹¡§
-
-@example
-shell> BINDIR/mysqladmin version
-mysqladmin Ver 6.3 Distrib 3.22.9-beta, for pc-linux-gnu on i686
-TCX Datakonsult AB, by Monty
-
-Server version 3.22.9-beta
-Protocol version 10
-Connection Localhost via UNIX socket
-TCP port 3306
-UNIX socket /tmp/mysql.sock
-Uptime: 16 sec
-
-Running threads: 1 Questions: 20 Reloads: 2 Open tables: 3
-@end example
-
-@code{BINDIR/mysqladmin} ¤Î»ÈÍÑÊýË¡¤Ï¡¢@code{--help} ¥ª¥×¥·¥ç¥ó¤Çµ¯Æ°¤¹¤ë¤³¤È¤Ë¤è¤êÆÀ¤é¤ì¤Þ¤¹¡£
-
-@item
-¥µ¡¼¥Ð¡¼¤ò¥·¥ã¥Ã¥È¥À¥¦¥ó¤¹¤ë¤Ë¤Ï¡§
-
-@example
-shell> BINDIR/mysqladmin -u root shutdown
-@end example
-
-@item
-¥µ¡¼¥Ð¡¼¤ò¥ê¥¹¥¿¡¼¥È¤¹¤ë¤Ë¤Ï¡¢@code{safe_mysqld} ¤« @code{mysqld} ¤òľÀܼ¹Ԥ·¤Þ¤¹¡£
-Î㤨¤Ð¡§
-
-@example
-shell> BINDIR/safe_mysqld --log &
-@end example
-
-@code{safe_mysqld} ¤¬¼ºÇÔ¤¹¤ë¤Ê¤é¡¢ @strong{MySQL} ¤Î¥¤¥ó¥¹¥È¡¼¥ë¥Ç¥£¥ì¥¯¥È¥ê¡¼¤«¤é¼Â¹Ô¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
-¤â¤·¤½¤ì¤Ç¤âµ¯Æ°¤·¤Ê¤¤¤Ê¤é¡¢@ref{Starting server} ¤ò»²¾È¤Î¤³¤È¡£
-
-@item
-¤¤¤¯¤Ä¤«¤Î´Êñ¤Ê¥Æ¥¹¥È¤Ç¥µ¡¼¥Ð¡¼¤¬Æ°¤¤¤Æ¤¤¤ë¤«³Îǧ¤Ç¤­¤Þ¤¹¡£
-°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡§
-
-@example
-shell> BINDIR/mysqlshow
-+-----------+
-| Databases |
-+-----------+
-| mysql |
-+-----------+
-
-shell> BINDIR/mysqlshow mysql
-Database: mysql
-+--------------+
-| Tables |
-+--------------+
-| columns_priv |
-| db |
-| func |
-| host |
-| tables_priv |
-| user |
-+--------------+
-
-shell> BINDIR/mysql -e "select host,db,user from db" mysql
-+------+--------+------+
-| host | db | user |
-+------+--------+------+
-| % | test | |
-| % | test_% | |
-+------+--------+------+
-@end example
-
-¾¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç @strong{MySQL} ¤Î¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤òÈæ³Ó¤¹¤ë¤¿¤á¤Ë
- @file{sql-bench} ¤Ë¥Ù¥ó¥Á¥Þ¡¼¥¯¤¬¤¢¤ê¤Þ¤¹¡£
-@file{sql-bench/Results} ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤Ï¡¢Â¾¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ä¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç
-¥Ù¥ó¥Á¤ò¼Â¹Ô¤·¤¿·ë²Ì¤¬¤¢¤ê¤Þ¤¹¡£
-Á´¤Æ¤Î¥Æ¥¹¥È¤ò¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-
-@example
-shell> cd sql-bench
-shell> run-all-tests
-@end example
-
-RPM ¥Ð¥¤¥Ê¥êÇÛÉÛ¤Ë¤Ï @file{sql-bench} ¥Ç¥£¥ì¥¯¥È¥ê¤¬¤¢¤ê¤Þ¤»¤ó¡£
-(RPM ¤Î¥½¡¼¥¹ÇÛÉۤˤϴޤޤì¤Þ¤¹)
-¤³¤Î¾ì¹ç¡¢¥Ù¥ó¥Á¥Þ¡¼¥¯¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-@strong{MySQL} 3.22 ¤Î¥Ð¥¤¥Ê¥êÇÛÉÛ¤«¤é¡¢
-@file{mysql-bench-VERSION-i386.rpm} ¤È¤¤¤¦Ì¾Á°¤Ç RPM ¥Ñ¥Ã¥±¡¼¥¸¤òºî¤Ã¤Æ¤ª¤ê¡¢
-¤³¤ì¤Ë¤Ï¥Ù¥ó¥Á¥Þ¡¼¥¯¤Î¥Ç¡¼¥¿¤È¥³¡¼¥É¤¬´Þ¤Þ¤ì¤Þ¤¹¡£
-
-@file{tests} ¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Ç¥Æ¥¹¥È¤¹¤ë¤³¤È¤â²Äǽ¤Ç¤¹¡£
-Î㤨¤Ð¡¢@file{auto_increment.tst} ¤Î¼Â¹Ô¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-
-@example
-shell> BINDIR/mysql -vvf test < ./tests/auto_increment.tst
-@end example
-
-¤³¤ì¤Î·ë²Ì¤Ï @file{./tests/auto_increment.res} ¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤µ¤ì¤Þ¤¹¡£
-@end enumerate
-
-
-@node mysql_install_db, Starting server, Post-installation, Post-installation
-@subsection @code{mysql_install_db} ¼Â¹Ô»þ¤ÎÌäÂê
-
-¤³¤ÎÀá¤Ç¤Ï @code{mysql_install_db} ¤ò¼Â¹Ô¤·¤¿ºÝ¤Ë¤Ç¤¯¤ï¤¹¤«¤â¤·¤ì¤Ê¤¤ÌäÂê¤Ë¤Ä¤¤¤Æ½Ò¤Ù¤Þ¤¹¡§
-
-@table @strong
-@item @code{mysql_install_db} doesn't install the privilege tables
-
-¤³¤ì¤Ï @code{mysql_install_db} ¤¬¸¢¸Â¥Æ¡¼¥Ö¥ë¤ò¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤­¤Ê¤«¤Ã¤¿»ö¤Î¥á¥Ã¥»¡¼¥¸¤Ç¤¹¤¬¡¢
-³¤¤¤Æ°Ê²¼¤Î¤è¤¦¤Ë¥á¥Ã¥»¡¼¥¸¤¬½Ð¤¿¾ì¹ç¡§
-
-@example
-starting mysqld daemon with databases from XXXXXX
-mysql daemon ended
-@end example
-
-¤³¤Î¾ì¹ç¡¢Ãí°Õ¿¼¤¯ log ¥Õ¥¡¥¤¥ë¤òÄ´¤Ù¤Æ¤¯¤À¤µ¤¤¡ª
-¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Ë½Ð¤Æ¤¤¤ë @file{XXXXXX} ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥í¥°¥Õ¥¡¥¤¥ë¤¬¤¢¤ê¡¢
-¤³¤ì¤Ë @code{mysqld} ¤¬¤Ê¤¼¥¹¥¿¡¼¥È¤·¤Ê¤«¤Ã¤¿¤«µ­¤µ¤ì¤Æ¤¤¤ë¤Ï¤º¤Ç¤¹¡£
-¤â¤·²¿¤¬µ¯¤³¤Ã¤¿¤«¤ï¤«¤é¤Ê¤¤¾ì¹ç¡¢¤³¤Î¥í¥°¥Õ¥¡¥¤¥ë¤ò´Þ¤ó¤Ç @code{mysqlbug} ¤ò»ÈÍѤ·¤Æ
-¥Ð¥°¥ì¥Ý¡¼¥È¤òÅê¹Æ¤·¤Æ¤¯¤À¤µ¤¤¡ª
-@xref{Bug reports}.
-
-@item There is already a @code{mysqld} daemon running
-
-¤³¤Î¾ì¹ç¡¢ @code{mysql_install_db} ¤ò¼Â¹Ô¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£
-@code{mysql_install_db} ¤ò¼Â¹Ô¤¹¤ë¤Î¤Ï @strong{MySQL} ¤ò½é¤á¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¸å¡¢
-¤¿¤Ã¤¿°ì²ó¤À¤±¤Ç¤¹¡£
-
-@item Installing a second @code{mysqld} daemon doesn't work when one daemon is running
-
-¤³¤ì¤Ï¤¹¤Ç¤Ë @strong{MySQL} ¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤ª¤ê¡¢
-¤·¤«¤·¿·¤·¤¤¥¤¥ó¥¹¥È¡¼¥ë¤ò°ã¤¦¤È¤³¤í¤Ë¹Ô¤ª¤¦¤È¤·¤¿¾ì¹ç¤ËȯÀ¸¤·¤Þ¤¹¡£
-(Î㤨¤Ð¡¢°ìÅÙ¤ËÆó¤Ä¤Î¥¤¥ó¥¹¥È¡¼¥ë¤ò¼Â¹Ô¤·¤¿¾ì¹ç¤Ê¤É)
-°ìÈ̤ˤ³¤ÎÌäÂê¤ÏÆó¤ÄÌܤΥµ¡¼¥Ð¡¼¤òÆ°¤¤¤Æ¤¤¤ë¥µ¡¼¥Ð¡¼¤ÈƱ¤¸¥Ý¡¼¥È¡¢¥½¥±¥Ã¥È¤ò»ÈÍѤ·¤Æµ¯Æ°¤·¤è¤¦¤È¤·¤¿¾ì¹ç¤ËȯÀ¸¤·¤Þ¤¹¡£
-¤³¤Î¾ì¹ç¡¢@code{Can't start server: Bind on TCP/IP port: Address already in use} ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤«
-@code{Can't start server : Bind on unix socket...} ¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤¬½Ð¤Þ¤¹¡£
-¿·¤·¤¤¥µ¡¼¥Ð¡¼¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ°ã¤¦¥Ý¡¼¥È¡¢¥½¥±¥Ã¥È¤Çµ¯Æ°¤Ç¤­¤Þ¤¹¡§
-
-@tindex MYSQL_UNIX_PORT environment variable
-@tindex MYSQL_TCP_PORT environment variable
-@tindex Environment variable, MYSQL_UNIX_PORT
-@tindex Environment variable, MYSQL_TCP_PORT
-@example
-shell> MYSQL_UNIX_PORT=/tmp/mysqld-new.sock
-shell> MYSQL_TCP_PORT=3307
-shell> export MYSQL_UNIX_PORT MYSQL_TCP_PORT
-shell> scripts/mysql_install_db
-shell> bin/safe_mysqld &
-@end example
-
-The environment variables ÉÕÏ¿¤Ï @code{mysqld} ¤Ë±Æ¶Á¤¹¤ë¾¤Î´Ä¶­ÊÑ¿ô¤Î
-°ìÍ÷¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£@xref{Environment variables}¡£
-
-¤³¤Î¸å¡¢Æó¤Ä¤Î¥Ç¡¼¥â¥ó¤ò°ã¤¦¥Ý¡¼¥È¡¢¥½¥±¥Ã¥È¤Ç¼Â¹Ô¤¹¤ë¤è¤¦¤Ë¡¢µ¯Æ°¥¹¥¯¥ê¥×¥È¤òÊѹ¹¤·¤Þ¤¹¡£
-Î㤨¤Ð¡¢@code{safe_mysqld} ¤òÆó¤Ä½ñ¤­¤Þ¤¹¤¬¡¢@code{--socket}, @code{--port} ¤È @code{--basedir}
- ¥ª¥×¥·¥ç¥ó¤ò¤½¤ì¤¾¤ì¤Î @code{safe_mysqld} ¤Ë»ØÄꤷ¤Þ¤¹¡£
-
-@item @file{/tmp} ¤Ë½ñ¤­¹þ¤ßµö²Ä¤ò¤¢¤Ê¤¿¤¬»ý¤Ã¤Æ¤¤¤Ê¤¤¤Ê¤é
-
-¤â¤·¥½¥±¥Ã¥È¥Õ¥¡¥¤¥ë¤òɸ½à¤Î¾ì½ê(@file{/tmp})¤ËºîÀ®¤¹¤ë¤¿¤á¤Î½ñ¤­¹þ¤ßµö²Ä¤¬¤Ê¤¤¤Ê¤é¡¢
-¤¢¤ë¤¤¤Ï¡¢°ì»þ¥Õ¥¡¥¤¥ë¤ò @file{/tmp} ¤ËºîÀ®¤Ç¤­¤Ê¤¤¤Ê¤é¡¢
-@code{mysql_install_db} ¤Î¼Â¹Ô»þ¡¢¤¢¤ë¤¤¤Ï @code{mysqld} ¤Îµ¯Æ°¡¿»ÈÍÑ»þ¤Ë
-¥¨¥é¡¼¤È¤Ê¤ë¤Ç¤·¤ç¤¦¡£
-
-°ã¤¦¥Ç¥£¥ì¥¯¥È¥ê¡¼¤Ë¥½¥±¥Ã¥È¥Õ¥¡¥¤¥ë¤ä°ì»þ¥Õ¥¡¥¤¥ë¤ò»ØÄꤹ¤ë¤Ë¤Ï¡§
-
-@tindex TMPDIR environment variable
-@tindex MYSQL_UNIX_PORT environment variable
-@tindex Environment variable, TMPDIR
-@tindex Environment variable, MYSQL_UNIX_PORT
-@example
-shell> TMPDIR=/some_tmp_dir/
-shell> MYSQL_UNIX_PORT=/some_tmp_dir/mysqld.sock
-shell> export TMPDIR MYSQL_UNIX_PORT
-@end example
-
-@file{some_tmp_dir} ¤Ï½ñ¤­¹þ¤ß¤¬²Äǽ¤Ê¥Ç¥£¥ì¥¯¥È¥ê¡¼¤ò»ØÄꤷ¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-@xref{Environment variables}.
-
-¤³¤Î¸å¡¢@code{mysql_install_db} ¤òÁö¤é¤»¡¢¥µ¡¼¥Ð¡¼¤òµ¯Æ°¤¹¤ë»ö¤¬¤Ç¤­¤Þ¤¹¡§
-
-@example
-shell> scripts/mysql_install_db
-shell> BINDIR/safe_mysqld &
-@end example
-
-@item @code{mysqld} crashes at once
-
-¤â¤· RedHat 5.0 ¾å¤Ç 2.0.7-5 ¤è¤ê¸Å¤¤ @code{glibc} ¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢
-Á´¤Æ¤Î @code{glibc} ¥Ñ¥Ã¥Á¤òÅö¤Æ¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡ª
-¤³¤ì¤Ë´Ø¤·¤Æ¤Ï @strong{MySQL} ¥á¡¼¥ë¤Î¥¢¡¼¥«¥¤¥Ö¤Ë¾ðÊó¤¬Â¿¤¯¤¢¤ê¤Þ¤¹¡£
-¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤Î¥¢¡¼¥«¥¤¥Ö¤Î¥ê¥ó¥¯¤Ï
-@uref{http://www.mysql.com/doc.html, @strong{MySQL} documentation page}.
-see @ref{Linux}.
-
-@code{mysqld} ¤ò @code{--skip-grant-tables} »ØÄê¤Çµ¯Æ°¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
-¤½¤·¤Æ°Ê²¼¤Î¤è¤¦¤Ë @code{mysql} ¤ò»ÈÍѤ·¤Æ¼«Ê¬¼«¿È¤Î¼ê¤Ë¤è¤êµö²Ä¤ò²Ã¤¨¤Þ¤¹¡§
-
-@example
-shell> BINDIR/safe_mysqld --skip-grant-tables &
-shell> BINDIR/mysql -u root mysql
-@end example
-
-@code{mysql} ¤«¤é¼êÆ°¤Ç @code{mysql_install_db} ¤Ë½ñ¤«¤ì¤Æ¤¤¤ë SQL ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Þ¤¹¡£
-µö²Ä¥Æ¡¼¥Ö¥ë¤ò¥µ¡¼¥Ð¡¼¤ËÆɤ߹þ¤Þ¤¹¤¿¤á¤Ë¤Ï¡¢
- @code{mysqladmin flush-privileges} ¤« @code{mysqladmin reload} ¤ò¼Â¹Ô¤·¤Þ¤¹¡£
-@end table
-
-
-@node Starting server, Automatic start, mysql_install_db, Post-installation
-@subsection @strong{MySQL} ¥µ¡¼¥Ð¡¼µ¯Æ°»þ¤ÎÌäÂê
-
-Ä̾ï @code{mysqld} ¥µ¡¼¥Ð¡¼¤Îµ¯Æ°¤Ï¡¢°Ê²¼¤Î»°¤Ä¤ÎÊýË¡¤Î¤¦¤Á°ì¤Ä¤Ç¹Ô¤¤¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-@code{mysql.server} ¤Ë¤è¤ëµ¯Æ°¡£¤³¤Î¥¹¥¯¥ê¥×¥È¤Ï¥·¥¹¥Æ¥à¤Îµ¯Æ°»þ¡¢Ää»ß»þ¤Ë»È¤ï¤ì¤Þ¤¹¡£
-¾ÜºÙ¤Ï @ref{Automatic start}
-@item
-@code{safe_mysqld} ¤Ë¤è¤ëµ¯Æ°¡£¤³¤ì¤Ï @code{mysqld} ¤Ø¤ÎŬÀڤʥª¥×¥·¥ç¥ó¤ò·èÄꤷ¡¢
-¤½¤ì¤é¤Î¥ª¥×¥·¥ç¥ó¤Ç¥µ¡¼¥Ð¡¼¤Îµ¯Æ°¤ò»î¤ß¤Þ¤¹¡£
-@item
-NT ¾å¤Ç¤Ï @code{mysqld} ¤ò¼¡¤Î¤è¤¦¤Ë¥µ¡¼¥Ó¥¹¤È¤·¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤¹¤Ù¤­¤Ç¤¹:
-@example
-bin\mysqld-nt --install # Install MySQL as a service
-@end example
-
-¤¹¤ë¤È¡¢¼¡¤Î¤è¤¦¤Ë @code{mysqld} ¤òµ¯Æ°/Ää»ß¤Ç¤­¤Þ¤¹:
-@example
-NET START mysql
-NET STOP mysql
-@end example
-
-Ãí°Õ: ¤³¤Î¾ì¹ç mysqld ¤ËÂФ·¤Æ¾¤Î¥ª¥×¥·¥ç¥ó¤Ï»ÈÍѤǤ­¤Þ¤»¤ó¡ª
-
-¼¡¤Î¤è¤¦¤Ë¤·¤Æ¥µ¡¼¥Ó¥¹¤òºï½ü¤Ç¤­¤Þ¤¹:
-@example
-bin\mysqld-nt --remove # remove MySQL as a service
-@end example
-@item
-@code{mysqld} ¤òľÀܵ¯Æ°¡£
-@end itemize
-
-¤É¤ÎÊýË¡¤Ç¥µ¡¼¥Ð¡¼¤òµ¯Æ°¤·¤Æ¤â¡¢¤â¤·µ¯Æ°¤Ë¼ºÇÔ¤¹¤ì¤Ð¡¢¥í¥°¥Õ¥¡¥¤¥ë¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£
-¤Ê¤¼¼ºÇÔ¤·¤¿¤«µ­Ï¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¥í¥°¥Õ¥¡¥¤¥ë¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ê¤Þ¤¹¡£
-(¥Ð¥¤¥Ê¥êÇÛÉۤξì¹ç @file{/usr/local/mysql/data} ¡¢¥½¡¼¥¹ÇÛÉۤξì¹ç @file{/usr/local/var}¡¢
- Windows ¤Ç¤Ï @file{\mysql\mysql.err} )
-¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤Ë @file{host_name.err} ¤È @file{host_name.log} ¤È¤¤¤¦
-¥Õ¥¡¥¤¥ë (@code{host_name} ¤Ï¤¢¤Ê¤¿¤Î¥µ¡¼¥Ð¡¼Ì¾) ¤òõ¤·¤Æ¤¯¤À¤µ¤¤¡£
-°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ¤½¤Î¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Î¿ô¹Ô¤ò³Îǧ¤·¤Þ¤¹¡§
-
-@example
-shell> tail host_name.err
-shell> tail host_name.log
-@end example
-
-@code{mysqld} ¥Ç¡¼¥â¥ó¤Îµ¯Æ°»þ¤Ë¡¢¥Ç¡¼¥â¥ó¤Ï¥Ç¡¼¥¿¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥Ç¥£¥ì¥¯¥È¥ê¤òÊѤ¨¤Þ¤¹¡£
-¥í¥°¥Õ¥¡¥¤¥ë¤È pid (process ID) ¥Õ¥¡¥¤¥ë¤¬¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë½ñ¤±¤ë»ö¡¢
-¤½¤·¤Æ¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë»ö¤ò¡¢¥Ç¡¼¥â¥ó¤ÏÍ׵ᤷ¤Þ¤¹¡£
-
-¥Ç¡¼¥¿¥Ç¥£¥ì¥¯¥È¥ê¤Î¾ì½ê¤ÏÇÛÉÛʪ¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë»ØÄꤵ¤ì¤Æ¤¤¤Þ¤¹¡£
-@code{mysqld} ¤¬¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à¾å¤Ë¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤ò¸«¤Ä¤±¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡¢
-¥µ¡¼¥Ð¡¼¤ÏÆ°¤­¤Þ¤»¤ó¡£
- @code{mysqld} ¤ò @code{--help} ¥ª¥×¥·¥ç¥ó¤Çµ¯Æ°¤¹¤ì¤Ð @code{mysqld} ¤Î
-¥Ç¥Õ¥©¥ë¥È¤Î¥Ñ¥¹¤òÃΤ뤳¤È¤¬¤Ç¤­¤Þ¤¹¤Î¤Ç¡¢
-¥µ¡¼¥Ð¡¼¤¬µ¯Æ°¤·¤Ê¤¤Íýͳ¤¬°ã¤¦¥Ñ¥¹¤ò»ÈÍѤ·¤Æ¤¤¤ë¤¿¤á¤Ëµ¯¤³¤Ã¤Æ¤¤¤ë¤«¤É¤¦¤«¤¬¤ï¤«¤ê¤Þ¤¹¡£
-¥Ñ¥¹¤¬°ã¤¦¾ì¹ç¡¢@code{mysqld} ¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¤Î°ú¿ô¤ËÀµ¤·¤¤¥Ñ¥¹¤ò»ØÄꤷ¤Æ¡¢¥Ç¥Õ¥©¥ë¥ÈÃͤò
-¾å½ñ¤­¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£(¤³¤ì¤é¥ª¥×¥·¥ç¥ó¤Ï @code{safe_mysqld} ¤Ë¤âƱÍͤ˻ÈÍѤǤ­¤Þ¤¹)
-
-Ä̾@strong{MySQL} ¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤À¤±¤ò
- @code{mysqld} ¤Ë¶µ¤¨¤ì¤Ð¤¤¤¤¤Ï¤º¤Ç¤¹¡£
-¤³¤ì¤Ï @code{--basedir} ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£
- @code{--help} ¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ¹¤ì¤Ð¥Ñ¥¹¤ÎÊѹ¹¤¬³Îǧ¤Ç¤­¤Þ¤¹¡£
-(@code{--help} ¤Ï@emph{ɬ¤º} ºÇ¸å¤Ë»ØÄê¤Î¤³¤È)
-¡¡Î㤨¤Ð¡§
-
-@example
-shell> EXECDIR/mysqld --basedir=/usr/local --help
-@end example
-
-¥Ñ¥¹¤ÎÀßÄ꤬»×¤¤Ä̤ê¤Ë¸À¤Ã¤¿¤³¤È¤ò³Îǧ¤·¤¿¤é¡¢ @code{--help} ¥ª¥×¥·¥ç¥ó¤ò³°¤·¤Æ¥µ¡¼¥Ð¡¼¤òµ¯Æ°¤·¤Þ¤¹¡£
-
-°Ê²¼¤Î¥¨¥é¡¼¤Î¾ì¹ç¡¢Â¾¤Î¥×¥í¥°¥é¥à¡Ê¤«Â¾¤Î @code{mysqld} ¥µ¡¼¥Ð¡¼¡Ë¤¬
-@code{mysqld} ¤¬»ÈÍѤ·¤è¤¦¤È¤·¤Æ¤¤¤ë TCP/IP ¥½¥±¥Ã¥È¤ò»È¤Ã¤Æ¤¤¤Þ¤¹¡§
-
-@example
-Can't start server: Bind on TCP/IP port: Address already in use
- or
-Can't start server : Bind on unix socket...
-@end example
-
-¾¤Î @code{mysqld} ¥µ¡¼¥Ð¡¼¤¬Áö¤Ã¤Æ¤¤¤Ê¤¤¤«¤ò @code{ps} ¤Ç³Îǧ¤·¤Þ¤¹¡£
-¤â¤·Â¾¤Î¥µ¡¼¥Ð¡¼¤¬µ¯Æ°¤·¤Æ¤¤¤Ê¤¤¤Ê¤é¡¢ @code{telnet your-host-name tcp-ip-port-number}
-¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¡¢²¿²ó¤« @code{RETURN} ¥­¡¼¤ò¤¿¤¿¤¤¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
-¤â¤·¡¢ @code{telnet: Unable to connect to remote host: Connection refused} ¤Î¤è¤¦¤Ê
-¥¨¥é¡¼¤¬½Ð¤¿¾ì¹ç¡¢¤Ê¤Ë¤«¤¬ @code{mysqld} ¤¬»ÈÍѤ·¤è¤¦¤È¤·¤Æ¤¤¤ë¥Ý¡¼¥È¤ò´û¤Ë»È¤Ã¤Æ¤¤¤Þ¤¹¡£
-@xref{mysql_install_db, , @code{mysql_install_db}}, and @ref{Multiple
-servers}.
-
-@code{safe_mysqld} ¥¹¥¯¥ê¥×¥È¤Ï¡¢¥½¡¼¥¹ÇÛÉÛ¤«¤é¤Ç¤â¥Ð¥¤¥Ê¥êÇÛÉۤΠ@strong{MySQL} ¤«¤é¤Ç¤â¡¢
-¤¿¤È¤¨°ã¤¦¾ì½ê¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤Æ¤â¡¢¥µ¡¼¥Ð¡¼¤òµ¯Æ°¤Ç¤­¤ë¤è¤¦¤Ëºî¤é¤ì¤Æ¤¤¤Þ¤¹¡£
- @code{safe_mysqld} ¤Ï°Ê²¼¤Î¤É¤ì¤«°ì¤Ä¤¬¿¿¤Ç¤¢¤ë¤³¤È¤ò´üÂÔ¤·¤Þ¤¹¡§
-
-@itemize @bullet
-@item
- @code{safe_mysqld} ¤¬µ¯Æ°¤µ¤ì¤¿¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤Ë¡¢
-¥µ¡¼¥Ð¡¼¤È¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬¤¢¤ë¾ì¹ç¡£
- @code{safe_mysqld} ¤Ï @file{./bin}, @file{./data} ¥Ç¥£¥ì¥¯¥È¥ê(¥Ð¥¤¥Ê¥êÇÛÉÛʪ¤Î¾ì¹ç)¡¢
-¤¢¤ë¤¤¤Ï @file{./libexec}, @file{./var} ¥Ç¥£¥ì¥¯¥È¥ê(¥½¡¼¥¹ÇÛÉÛʪ¤Î¾ì¹ç)¤òõ¤·¤Þ¤¹¡£
-¤¢¤Ê¤¿¤¬ @strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê(Î㤨¤Ð @file{/usr/local/mysql} ¥Ç¥£¥ì¥¯¥È¥ê)
-¤«¤é @code{safe_mysqld} ¤ò¼Â¹Ô¤·¤¿¾ì¹ç¡¢¤³¤Î¾ò·ï¤ËŬ¹ç¤·¤Þ¤¹¡£
-
-@item
-¥µ¡¼¥Ð¡¼¤È¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ÁêÂХѥ¹°Ê²¼¤Ë¤Ê¤¤¾ì¹ç¡¢@code{safe_mysqld} ¤ÏÀäÂХѥ¹¤Ç¤½¤ì¤é¤òõ¤·¤Þ¤¹¡£
-ŵ·¿Åª¤Ê¥Ç¥£¥ì¥¯¥È¥ê¤Ï @file{/usr/local/libexec} ¤È @file{/usr/local/var} ¤Ç¤¹¡£
-¼ÂºÝ¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ï @code{safe_mysqld} ¤¬¤¢¤ëÇÛÉÛʪ¤¬ºîÀ®¤µ¤ì¤ë¤È¤­¤Ë·è¤á¤é¤ì¤Þ¤¹¡£
-¤³¤ì¤é¤Ï @strong{MySQL} ¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿É¸½à¤Î¥Ñ¥¹¤ËÀµ¤·¤¯ÇÛÃÖ¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-@end itemize
-
-@code{safe_mysqld} ¤Ï¥µ¡¼¥Ð¡¼¤È¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¼«Ê¬¤¬µ¯Æ°¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¤ÎÁêÂХѥ¹¤Çõ¤·¤Þ¤¹¡£
-¤è¤Ã¤Æ¡¢ @code{safe_mysqld} ¤ò @strong{MySQL} ¤Î¥¤¥ó¥¹¥È¡¼¥ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤éµ¯Æ°¤¹¤ë¸Â¤ê¤Ï¡¢
- @strong{MySQL} ¥Ð¥¤¥Ê¥êÇÛÉÛʪ¤ò¼«Ê¬¤Î¹¥¤­¤Ê¤È¤³¤í¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤­¤Þ¤¹¡£
-¤½¤Î¾ì¹ç¤Îµ¯Æ°¤Ï¡§
-
-@example
-shell> cd mysql_installation_directory
-shell> bin/safe_mysqld &
-@end example
-
-¤â¤· @code{safe_mysqld} ¤¬ @strong{MySQL} ¥¤¥ó¥¹¥È¡¼¥ë¥Ç¥£¥ì¥¯¥È¥ê¤«¤éµ¯Æ°¤·¤Æ¤â¼ºÇÔ¤¹¤ë¤Ê¤é¡¢
-@code{safe_mysqld} ¤ò¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥àÍÑ¤Ë @code{mysqld} ¤Î¥Ñ¥¹¤ä¥Ñ¥¹Ì¾¤Î¥ª¥×¥·¥ç¥ó¤ò
-½ñ¤­´¹¤¨¤Æ¤â¤«¤Þ¤¤¤Þ¤»¤ó¡£
-¤³¤Î¾ì¹ç¡¢ @strong{MySQL} ¤ò¥¢¥Ã¥×¥°¥ì¡¼¥É¤·¤¿¾ì¹ç¡¢¤¢¤Ê¤¿¤¬Êѹ¹¤·¤¿
- @code{safe_mysqld} ¤Ï¾å½ñ¤­¤µ¤ì¤ë¤Î¤Ç¡¢Êѹ¹¤·¤¿¤â¤Î¤Ï¥¤¥ó¥¹¥È¡¼¥ëÁ°¤Ë¥³¥Ô¡¼¤·¤Æ¤ª¤­¡¢
-ºÆ¤ÓÌᤵ¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-
-¤â¤· @code{mysqld} ¤¬¤¹¤Ç¤ËÁö¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢°Ê²¼¤Î¥³¥Þ¥ó¥É¤Ë¤Æ¥Ñ¥¹¤ÎÀßÄê¤òÃΤ뤳¤È¤¬¤Ç¤­¤Þ¤¹¡§
-
-@example
-shell> mysqladmin variables
-
-or
-
-shell> mysqladmin -h 'your-host-name' variables
-@end example
-
-¤â¤· @code{safe_mysqld} ¤¬¥µ¡¼¥Ð¡¼¤òµ¯Æ°¤·¤Æ¤âÀܳ¤Ç¤­¤Ê¤¤¤è¤¦¤Ê¤é¡¢
- @file{/etc/hosts} ¥Õ¥¡¥¤¥ë¤Ë°Ê²¼¤Î¤è¤¦¤Êµ­½Ò¤ò»ý¤¿¤»¤Æ¤¯¤À¤µ¤¤¡§
-
-@example
-127.0.0.1 localhost
-@end example
-
-¤³¤ÎÌäÂê¤Ï¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¡¼¤¬¤Ê¤¯¤Æ @strong{MySQL} ¤ò MIT-pthreads ¤ò
-»ÈÍѤ¹¤ë¤è¤¦¤Ë¤·¤Æºî¤Ã¤¿¥·¥¹¥Æ¥à¤Ë¤À¤±µ¯¤³¤ê¤Þ¤¹¡£
-
-Windows ¤Ç¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Æ @code{mysqld} ¤Îµ¯Æ°¤ò»î¤ß¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹:
-
-@example
-C:\mysql\bin\mysqld --standalone --debug
-@end example
-
-¤³¤ì¤Ï¡¢¥Ð¥Ã¥¯¥°¥é¥ó¥É¤ÇÆ°ºî¤»¤º¡¢@file{\mysqld.traec} ¤Ë¥È¥ì¡¼¥¹¤ò½ñ¤­
-½Ð¤·¤Þ¤¹¡£¤³¤ì¤ÏÌäÂê¤Î¸¶°ø¤ò²ò·è¤¹¤ë¼ê½õ¤±¤Ë¤Ê¤ê¤Þ¤¹¡£@xref{Win32}¡£
-
-@node Automatic start, Option files, Starting server, Post-installation
-@subsection @strong{MySQL} ¤Î¼«Æ°µ¯Æ°¤È¼«Æ°Ää»ß
-
-@code{mysql.server} ¥¹¥¯¥ê¥×¥È¤Ï @code{start}, @code{stop} °ú¿ô¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê
-¥µ¡¼¥Ð¡¼¤òµ¯Æ°¡¢Ää»ß¤Ç¤­¤Þ¤¹¡§
-
-@example
-shell> mysql.server start
-shell> mysql.server stop
-@end example
-
-@code{mysql.server} ¤Ï @strong{MySQL} ¥¤¥ó¥¹¥È¡¼¥ë¥Ç¥£¥ì¥¯¥È¥ê¤Î @file{share/mysql} ¥Ç¥£¥ì¥¯¥È¥ê¡¢
-¤Þ¤¿¤Ï @strong{MySQL} ¥½¡¼¥¹¥Ä¥ê¡¼¤Î @file{support-files} ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ê¤Þ¤¹¡£
-
-@code{mysql.server} ¤Ï¥µ¡¼¥Ð¡¼¤òµ¯Æ°»þ¤¹¤ëÁ°¤Ë @strong{MySQL} ¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿
-¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥Ç¥£¥ì¥¯¥È¥ê¤òÊѤ¨¡¢@code{safe_mysqld} ¤òµ¯Æ°¤·¤Þ¤¹¡£
-¤â¤·É¸½à°Ê³°¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤¤¤ë¥Ð¥¤¥Ê¥êÇÛÉÛ¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Ê¤é¡¢
-@code{mysql.server} ¤òÊÔ½¸¤¹¤ëɬÍפ¬¤¢¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-@code{safe_mysqld} ¤òµ¯Æ°¤¹¤ëÁ°¤ËÀµ¤·¤¤¥Ç¥£¥ì¥¯¥È¥ê¤Ë @code{cd} ¤¹¤ë¤è¤¦¤ËÊѹ¹¤·¤Þ¤¹¡£
-@code{safe_mysqld} ¤Ë¾¤Î¥ª¥×¥·¥ç¥ó¤òÍ¿¤¨¤ë¤è¤¦¤Ë @code{mysql.server} ¤òÊѤ¨¤Æ¤â¹½¤¤¤Þ¤»¤ó¡£
-¾¤Î¥æ¡¼¥¶¡¼¤Ç¼Â¹Ô¤·¤¿¤¤¾ì¹ç¡¢@code{mysql_daemon_user=root} ¤òÊѹ¹¤·¤Æ¤â¹½¤¤¤Þ¤»¤ó¡£
-@code{safe_mysqld} ¤Ë¾¤Î¥ª¥×¥·¥ç¥ó¤òÍ¿¤¨¤ë¤¿¤á¤Ë¡¢
-@code{mysql.server} ¤òÊѹ¹¤·¤Æ¤â¹½¤¤¤Þ¤»¤ó¡£
-
-@code{mysql.server stop} ¤Ï¥µ¡¼¥Ð¡¼¤Ë¥·¥°¥Ê¥ë¤òÁ÷¤Ã¤Æ¥µ¡¼¥Ð¡¼¤òÄä»ß¤·¤Þ¤¹¡£
-@code{mysqladmin shutdown} ¤Ç¼êÆ°¤Ç¥µ¡¼¥Ð¡¼¤òÍî¤È¤¹¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
-
-@strong{MySQL} ¤ò»ÈÍѤ·¤Æ¤¤¤ëÀ½ÉʤΤ¿¤á¤Ë¡¢¤³¤ì¤é¥¹¥¿¡¼¥È¡¢¥¹¥È¥Ã¥×¤ò
- @file{/etc/rc*} ¤Ë½ñ¤­¤¿¤¤¤È»×¤ï¤ì¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-¤³¤³¤Ç¤ÎÃí°ÕÅÀ¤Ï¡¢Êѹ¹¤·¤¿ @code{mysql.server} ¤Ï¡¢
- @strong{MySQL} ¤ò¥¢¥Ã¥×¥°¥ì¡¼¥É¤·¤¿¤È¤­¤Ë¾å½ñ¤­¤µ¤ì¤ë¤È¤¤¤¦¤³¤È¤Ç¤¹¡£
-¤è¤Ã¤Æ¡¢Êѹ¹¤·¤¿¤â¤Î¤Ï¥¤¥ó¥¹¥È¡¼¥ëÁ°¤Ë¥³¥Ô¡¼¤ò¼è¤Ã¤Æ¤ª¤¯¤Ù¤­¤Ç¤¹¡£
-
-¤â¤·¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à¤¬ @file{/etc/rc.local} ¤òµ¯Æ°¥¹¥¯¥ê¥×¥È¤È¤·¤Æ»ÈÍѤ·¤Æ¤¤¤ë¤Ê¤é¡¢
-°Ê²¼¤Î¤è¤¦¤Ë¤½¤ÎÃæ¤Ëµ­½Ò¤·¤Þ¤¹¡§
-
-@example
-/bin/sh -c 'cd /usr/local/mysql ; ./bin/safe_mysqld &'
-@end example
-
-¥°¥í¡¼¥Ð¥ëÀßÄê¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë @file{/etc/my.cnf} ¤Ë¡¢ @code{mysql.server} ¤Î
-¥ª¥×¥·¥ç¥ó¤òµ­½Ò¤¹¤ë¤³¤È¤â²Äǽ¤Ç¤¹¡£@file{/etc/my.cnf} ¥Õ¥¡¥¤¥ë¤Ï°Ê²¼¤Î¤è¤¦¤Ê
-µ­½Ò¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡§
-
-@example
-[mysqld]
-datadir=/usr/local/mysql/var
-socket=/tmp/mysqld.sock
-port=3306
-
-[mysql.server]
-user=mysql
-basedir=/usr/local/mysql
-@end example
-
-@code{mysql.server} ¥¹¥¯¥ê¥×¥È¤Ï°Ê²¼¤ÎÊÑ¿ô¤ò»ÈÍѤ·¤Þ¤¹¡§
-@code{user}, @code{datadir}, @code{basedir}, @code{bindir} ¤½¤·¤Æ @code{pid-file}.
-
-@xref{Option files}.
-
-@cindex Default options
-@cindex Option files
-@node Option files, , Automatic start, Post-installation
-@subsection ¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ë ( @code{my.cnf} )
-
-@strong{MySQL} 3.22 ¤Î¥µ¡¼¥Ð¡¼¡¢¥¯¥é¥¤¥¢¥ó¥È¤È¤â¤Ë¡¢¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤«¤é¥Ç¥Õ¥©¥ë¥È¤Îµ¯Æ°¥ª¥×¥·¥ç¥ó¤òÆɤ߹þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-UNIX ¤Ç¤Ï @strong{MySQL} ¤Ï°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤«¤é¥Ç¥Õ¥©¥ë¥È¥ª¥×¥·¥ç¥ó¤òÆɤߤޤ¹¡§
-
-@tindex .my.cnf file
-@multitable @columnfractions .3 .7
-@item @strong{¥Õ¥¡¥¤¥ë̾} @tab @strong{°ÕÌ£}
-@item @code{/etc/my.cnf} @tab Á´ÂΤΥª¥×¥·¥ç¥ó
-@item @code{DATADIR/my.cnf} @tab ¥µ¡¼¥Ð¸ÇÍ­¥ª¥×¥·¥ç¥ó
-@item @code{~/.my.cnf} @tab ¥æ¡¼¥¶¸ÇÍ­¥ª¥×¥·¥ç¥ó
-@end multitable
-
-@code{DATADIR} ¤Ï @strong{MySQL} ¥Ç¡¼¥¿¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤¹ (ÉáÄÌ
-@file{/usr/local/mysql/data} or @file{/usr/local/var}).
-¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ïconfigure»þ¤Ë·èÄꤵ¤ì¤Æ¤ª¤ê¡¢ @code{--datadir} ¤ò @code{mysqld} µ¯Æ°»þ¤Ë»ØÄꤷ¤Æ¤âÊѹ¹¤µ¤ì¤Þ¤»¤ó¡£
-(¥µ¡¼¥Ð¡¼¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó¤Î°ú¿ô¤ò½èÍý¤¹¤ëÁ°¤Ë¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤òõ¤·¤Þ¤¹¡£
-¤è¤Ã¤Æ¡¢@code{--datadir} °ú¿ô¤ò»ØÄꤷ¤Æ¤â¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤òõ¤¹¾ì½ê¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤Ï¤Ê¤ê¤Þ¤»¤ó¡£)
-
-Win32 ¤Ç¤Ï @strong{MySQL} ¤Ï°Ê²¼¤Î¥Õ¥¡¥¤¥ë¤«¤é¥Ç¥Õ¥©¥ë¥È¥ª¥×¥·¥ç¥ó¤òÆɤߤޤ¹¡§
-
-@multitable @columnfractions .3 .7
-@item @strong{¥Õ¥¡¥¤¥ë̾} @tab @strong{°ÕÌ£}
-@item @code{windows-system-directory\my.ini}
-@item @code{C:\my.cnf} @tab Á´ÂΤΥª¥×¥·¥ç¥ó
-@item @code{C:\mysql\data\my.cnf} @tab ¥µ¡¼¥Ð¸ÇÍ­¥ª¥×¥·¥ç¥ó
-@end multitable
-
-Ãí°Õ: Win32 ¤Ç¤Ï @code{\} ¤ÎÂå¤ï¤ê¤Ë @code{/} ¤ÇÁ´¤Æ¤Î¥Ñ¥¹¤òµ­½Ò¤¹¤Ù¤­¤Ç
-¤¹¡£@code{\} ¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢@code{\} ¤Ï @strong{MySQL} ¤Î¥¨¥¹¥±¡¼¥×ʸ»ú
-¤Ê¤Î¤Ç¡¢¤³¤ì¤òÆó½Å¤Ëµ­½Ò¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-@cindex Environment variables
-@strong{MySQL} ¤Ï¾åµ­¤Îɽ¤Ë¤«¤«¤ì¤Æ¤¤¤ë½ç¤Ë¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤òÆɤߤޤ¹¡£
-¤â¤·Ê£¿ô¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤¬¤¢¤Ã¤¿¾ì¹ç¡¢¸å¤«¤éÆɤޤ줿ÀßÄ꤬ͭ¸ú¤Ë¤Ê¤ê¤Þ¤¹¡£
-Á´¤Æ¤Î¥ª¥×¥·¥ç¥ó¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó¤Î°ú¿ô¤Ë¾å½ñ¤­¤µ¤ì¤Þ¤¹¡£
-¤¤¤¯¤Ä¤«¤Î¥ª¥×¥·¥ç¥ó¤Ï´Ä¶­ÊÑ¿ô¤ËÄêµÁ¤Ç¤­¤Þ¤¹¡£
-¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤È¥³¥Þ¥ó¥É¥é¥¤¥ó¤Î°ú¿ô¤Ï´Ä¶­ÊÑ¿ô¤ò¾å½ñ¤­¤·¤Þ¤¹¡£
-
-°Ê²¼¤Î¥×¥í¥°¥é¥à¤Ï¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡§@code{mysql},
-@code{mysqladmin}, @code{mysqld}, @code{mysqldump}, @code{mysqlimport},
-@code{myisamchk} and @code{myisampack}.
-
-¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢¥×¥í¥°¥é¥à¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¥³¥Þ¥ó¥É¥é¥¤¥ó¤Î long ¥ª¥×¥·¥ç¥ó(Î㤨¤Ð¡¢@code{-u} ¤Ç¤Ï¤Ê¤¯¤Æ @code{--user} ¤ÎÊý)¤ò½ñ¤¯¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¥×¥í¥°¥é¥à¤ò @code{--help} ¤Çµ¯Æ°¤¹¤ì¤Ð¡¢ÀßÄê²Äǽ¤ÊÊÑ¿ô̾¤¬ÆÀ¤é¤ì¤Þ¤¹¡£
-
-¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤Î½ñ¼°¤Ï°Ê²¼¤Ç¤¹¡§
-
-@table @code
-@item #comment
-¥³¥á¥ó¥È¤Ï @samp{#} ¤« @samp{;} ʸ»ú¤Ç»Ï¤á¤Þ¤¹¡£¶õ¤Î¹Ô¤Ï̵»ë¤·¤Þ¤¹¡£
-
-@item [group]
-¥°¥ë¡¼¥×Àë¸À¡£
-@code{group} ¤Ï¥ª¥×¥·¥ç¥ó¤òÄêµÁ¤¹¤ë¥×¥í¥°¥é¥à¤«¥°¥ë¡¼¥×¤Î̾Á°¤Ç¤¹¡£
-¤³¤ÎÀë¸À¤Î¸å¡¢@code{¥ª¥×¥·¥ç¥ó} ¤« @code{set-variable} ¹Ô¤Ç¡¢¤³¤Î¥°¥ë¡¼¥×¤Ë¥ª¥×¥·¥ç¥ó¤òÍ¿¤¨¤Þ¤¹¡£
-¤³¤Î¥»¥¯¥·¥ç¥ó¤ÎÈϰϤϡ¢Â¾¤Î¥°¥ë¡¼¥×Àë¸À¤Î¹Ô¤¬Íè¤ë¤«¡¢¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤ËÍè¤ë¤Þ¤Ç¤Ç¤¹¡£
-
-@item option
-¤³¤ì¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó¤Î @code{--option} ¤ÈÅù²Á¤Ç¤¹¡£
-
-@item option=value
-¤³¤ì¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó¤Î @code{--option=value} ¤ÈÅù²Á¤Ç¤¹¡£
-
-@item set-variable = variable=value
-¤³¤ì¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó¤Î @code{--set-variable variable=value} ¤ÈÅù²Á¤Ç¤¹¡£
-¤³¤ì¤Ï @code{mysqld} ÊÑ¿ô¤Ç»ÈÍѤµ¤ì¤ë·Á¼°¤Ç¤¹¡£
-@end table
-
-@code{client} ¥°¥ë¡¼¥×¤Ï¡¢Á´¤Æ¤Î @strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È(@code{mysqld}¤Ï½ü)¤ËÂФ·¤Æ¥ª¥×¥·¥ç¥ó¤òÄêµÁ¤·¤Þ¤¹¡£
-¤³¤ì¤Ï¥µ¡¼¥Ð¡¼¤ËÀܳ¤¹¤ëºÝ¤Ë»ÈÍѤ¹¤ë¥Ñ¥¹¥ï¡¼¥É¤ò»ØÄê¤Ç¤­¤ë¥°¥ë¡¼¥×¤Ç¤¹¡£
-(¤³¤Î¾ì¹ç¡¢¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤Ï¼«Ê¬¤À¤±¤¬Æɤ߽ñ¤­¤Ç¤­¤ë¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤)
-
-¥ª¥×¥·¥ç¥ó¤äÃͤÎÁ±¸å¤Ë¤¢¤ëÁ´¤Æ¤Î¥Ö¥é¥ó¥¯Ê¸»ú¤Ï¼«Æ°¤Ç¼è¤ê½ü¤«¤ì¤Þ¤¹¡£
-ÃͤȤ·¤Æ¡¢@samp{\b},@samp{\t}, @samp{\n}, @samp{\r}, @samp{\\} and @samp{\s}
- ¤Î¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤¬»ÈÍѤǤ­¤Þ¤¹¡£
-(@samp{\s} == blank).
-
-¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ëÎ㡧
-
-@example
-[client]
-port=3306
-socket=/tmp/mysql.sock
-
-[mysqld]
-port=3306
-socket=/tmp/mysql.sock
-set-variable = key_buffer_size=16M
-set-variable = max_allowed_packet=1M
-
-[mysqldump]
-quick
-@end example
-
-¥æ¡¼¥¶¡¼¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ëÎ㡧
-
-@example
-[client]
-# The following password will be sent to all standard MySQL clients
-password=my_password
-
-[mysql]
-no-auto-rehash
-@end example
-
-@tindex .my.cnf file
-¤â¤·¥½¡¼¥¹ÇÛÉÛ¤ò»ý¤Ã¤Æ¤¤¤ë¤Ê¤é¡¢ @file{my-xxxx.cnf} ¤È¤¤¤¦Ì¾Á°¤Î¥µ¥ó¥×¥ë¥Õ¥¡¥¤¥ë¤ò @file{support-files} ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¸«¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¤â¤·¥Ð¥¤¥Ê¥êÇÛÉÛ¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Ê¤é¡¢ @file{DIR/share/mysql} ¥Ç¥£¥ì¥¯¥È¥ê¤òõ¤·¤Æ¤¯¤À¤µ¤¤
-(¤³¤³¤Ç @code{DIR} ¤Ï @strong{MySQL} ¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ñ¥¹Ì¾¤Ç¡¢ÉáÄÌ¤Ï @file{/usr/local/mysql})¡£
-¤³¤Î @file{my-xxxx.cnf} ¥Õ¥¡¥¤¥ë¤ò¼«Ê¬¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë @file{.my.cnf} ¤È¤¤¤¦Ì¾Á°¤Ç¥³¥Ô¡¼¤·¤Æ»ÈÍѤǤ­¤Þ¤¹¡£
-
-@strong{MySQL} ¥×¥í¥°¥é¥à¤Ë¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤òÆɤޤ»¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤Ë¤Ï¡¢
-¥³¥Þ¥ó¥É¥é¥¤¥ó¤Î°ìÈֺǽé¤Ë @code{--no-defaults} ¤ò½ñ¤­¤Þ¤¹¡£
-¤³¤ì¤Ï¥ª¥×¥·¥ç¥ó¤ÎºÇ½é¤Ç¤Ê¤¤¤ÈÍ­¸ú¤Ë¤Ê¤ê¤Þ¤»¤ó¡ª
-¤É¤Î¥ª¥×¥·¥ç¥ó¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤«³Î¤«¤á¤ë¤Ë¤Ï¡¢@code{--print-defaults} ¤òºÇ½é¤Î¥ª¥×¥·¥ç¥ó¤Ë»ØÄꤷ¤Þ¤¹¡£
-
-ÆÃÄê¤Î¥³¥ó¥Õ¥£¥°¥Õ¥¡¥¤¥ë¤ò¶¯À©Åª¤Ë»ÈÍѤ·¤¿¤¤¾ì¹ç¡¢¥ª¥×¥·¥ç¥ó
-@code{--defaults-file=¥Ç¥Õ¥©¥ë¥È¥Õ¥¡¥¤¥ë¤Î¥Õ¥ë¥Ñ¥¹} ¤ò»ÈÍѤǤ­¤Þ¤¹¡£¤³¤ì
-¤ò¹Ô¤Ê¤¦¾ì¹ç¡¢»ØÄꤷ¤¿¥Õ¥¡¥¤¥ë¤À¤±¤¬Æɤޤì¤Þ¤¹¡£
-
-³«È¯¼Ô¸þ¤±¾ðÊ󡧡¡¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤ÎÁàºî¤ÏÁ´¤Æ¤Î¥ª¥×¥·¥ç¥ó¤ò¥³¥Þ¥ó¥É¥é¥¤¥ó¤Î°ú¿ô¤è¤êÀè¤Ë½èÍý¤¹¤ë¤è¤¦¤Ë´Êñ¤ËËä¤á¹þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£
-¤³¤ì¤Ï¥ª¥×¥·¥ç¥ó¤òºÇ¸å¤Ë½èÍý¤¹¤ë¥×¥í¥°¥é¥à¤òÊ£¿ôΩ¤Á¤¢¤²¤ë¾ì¹ç¤ËÅÔ¹ç¤è¤¯Æ°¤­¤Þ¤¹¡£
-¤â¤·¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤àµ¡Ç½¤Î¤Ê¤¤¸Å¤¤¥×¥í¥°¥é¥à¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Ê¤é¡¢
-¤¿¤Ã¤¿Æó¹Ô¤À¤±Ãí°Õ¤·¤Æ½ñ¤±¤Ð¤¤¤¤¤À¤±¤Ç¤¹¡£
-¤³¤ÎÆ°ºî¤Ë¤Ä¤¤¤Æ¤Ï @strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤Î¥³¡¼¥É¤ò»²¹Í¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-
-@node Upgrade, , Post-installation, Installing
-@section @strong{MySQL} ¤Î¥¢¥Ã¥×¥°¥ì¡¼¥É/¥À¥¦¥ó¥°¥ì¡¼¥É»þ¤ËÆÃÊ̤˹Ԥʤ¦¤³¤È¤¬²¿¤«¤¢¤ë¤«¡©
-
-@strong{MySQL} ·Á¼°¤È¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤Ï¡¢@strong{MySQL} ¤¬Æ±¤¸¥Ù¡¼¥¹¥Ð¡¼¥¸¥ç
-¥ó¤Ç¤¢¤ë¸Â¤ê¡¢Æ±¤¸¥¢¡¼¥­¥Æ¥¯¥Á¥ã¾å¤Î°Û¤Ê¤ë¥Ð¡¼¥¸¥ç¥ó´Ö¤Ç¤¤¤Ä¤Ç¤â°ÜÆ°¤Ç¤­
-¤Þ¤¹¡£¸½ºß¤Î¥Ù¡¼¥¹¥Ð¡¼¥¸¥ç¥ó¤Ï 3 ¤Ç¤¹¡£@strong{MySQL} ¤Î¼Â¹Ô»þ¤Ë
-ʸ»ú¥»¥Ã¥È¤¬Êѹ¹¤µ¤ì¤¿¾ì¹ç(¤³¤ì¤Ï¥½¡¼¥È½ç¤âÊѹ¹¤·¤Þ¤¹)¡¢Á´¤Æ¤Î¥Æ¡¼¥Ö¥ë
-¤Ë @code{myisamchk -r -q} ¤ò¹Ô¤Ê¤¦É¬Íפ¬¤¢¤ê¤Þ¤¹¡£¤½¤¦¤·¤Ê¤±¤ì¤Ð¡¢¥¤¥ó¥Ç¥Ã
-¥¯¥¹¤¬Àµ¤·¤¤½ç¤Ë¤Ê¤ê¤Þ¤»¤ó¡£
-
-¤â¤·¤¢¤Ê¤¿¤¬¿À·Ð¼Á¤À¤Ã¤¿¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤ò¶²¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¤¤¤Ä¤Ç¤â¤¢¤Ê
-¤¿¤Î¸Å¤¤ @code{mysqld} ¤ò @code{mysqld}-'old-version-number' ¤Î¤è¤¦¤Ê²¿
-¤«¤Ë¥ê¥Í¡¼¥à¤Ç¤­¤Þ¤¹¡£¤â¤·¿·¤·¤¤ @code{mysqld} ¤¬Í½´ü¤»¤Ì²¿¤«¤ò¹Ô¤Ã¤¿¾ì
-¹ç¡¢Ã±½ã¤Ë¤½¤ì¤ò¥·¥ã¥Ã¥È¥À¥¦¥ó¤·¡¢¸Å¤¤ @code{mysqld} ¤òºÆµ¯Æ°¤¹¤ë¤³¤È¤¬
-¤Ç¤­¤Þ¤¹¡ª
-
-¥¢¥Ã¥×¥°¥ì¡¼¥É»þ¤Ë¤Ï¡¢¤â¤Á¤í¤ó¡¢¸Å¤¤¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¥Ð¥Ã¥¯¥¢¥Ã¥×¤â¤·¤Æ¤ª¤¯
-¤Ù¤­¤Ç¤¹¡£»þ¡¹¤Ï¾¯¤·¿À·Ð¼Á¤Ë¤Ê¤ë¤Î¤ÏÎɤ¤¤³¤È¤Ç¤¹¡ª
-
-¥¢¥Ã¥×¥°¥ì¡¼¥É¸å¡¢ºÆ¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤Ç¡¢
-@code{Commands out sync} ¤äͽ´ü¤»¤Ì¥³¥¢¥À¥ó¥×¤Î¤è¤¦¤ÊÌäÂ꤬µ¯¤­¤ë¾ì¹ç¡¢
-¤ª¤½¤é¤¯¡¢¥×¥í¥°¥é¥à¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë¸Å¤¤¥Ø¥Ã¥À¤ä¥é¥¤¥Ö¥é¥ê¥Õ¥¡¥¤¥ë¤ò»ÈÍÑ
-¤·¤¿¤Î¤Ç¤·¤ç¤¦¡£¤³¤Î¾ì¹ç¡¢@file{mysql.h} ¥Õ¥¡¥¤¥ë¤È @file{libmysql.a} ¥é
-¥¤¥Ö¥é¥ê¤¬¡¢¿·¤·¤¤ @strong{MySQL} ÇÛÉÛ¤«¤é¤Î¤â¤Î¤Ç¤¢¤ë¤«¤É¤¦¤«¤ò³Î¤«¤á¤ë
-¤¿¤á¤Ë¡¢ÆüÉÕ¤ò¥Á¥§¥Ã¥¯¤¹¤Ù¤­¤Ç¤¹¡£¤â¤·°ã¤Ã¤Æ¤¤¤ì¤Ð¡¢¥×¥í¥°¥é¥à¤òºÆ¥³¥ó¥Ñ
-¥¤¥ë¤·¤Æ¤¯¤À¤µ¤¤¡ª
-
-¤â¤·¿·¤·¤¤ @code{mysqld} ¥µ¡¼¥Ð¡¼¤¬µ¯Æ°¤Ç¤­¤Ê¤¤¤È¤«¡¢¥Ñ¥¹¥ï¡¼¥É̵¤·¤Ç
-Àܳ¤Ç¤­¤Ê¤¤¤È¤«¡¢¤¤¤¯¤Ä¤«¤ÎÌäÂ꤬ȯÀ¸¤·¤¿¾ì¹ç¡¢°ÊÁ°¤Î¥¤¥ó¥¹¥È¡¼¥ë¤Ç¤Ç¤­¤¿
-¸Å¤¤ @file{my.cnf} ¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¤«¤É¤¦¤«¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡ª
-@code{program-name --print-defaults} ¤Ç³Îǧ¤Ç¤­¤Þ¤¹. ¤â¤·¤³¤Î½ÐÎϤ¬
-¥×¥í¥°¥é¥à¤Î̾¾Î°Ê³°¤Îʪ¤òÊÖ¤·¤¿¾ì¹ç¡¢Í­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë @code{my.cnf} ¥Õ¥¡¥¤¥ë¤¬
-¤¢¤ê¤Þ¤¹¡ª
-
-¿·¤·¤¤¥ê¥ê¡¼¥¹¤Î @strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¾ì¹ç¤Ë¾ï¤Ë
- @code{Msql-Mysql-modules} ¤òºÆ¹½ÃÛ¡¢ºÆ¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤³¤È¤Ï
-¤¤¤¤¹Í¤¨¤Ç¤¹¡£¤¹¤Ù¤Æ¤Î @code{DBI} ¥¹¥¯¥ê¥×¥È¤¬ @strong{MySQL} ¤Î
-¥¢¥Ã¥×¥°¥ì¡¼¥É¸å¤Ë¥³¥¢¥À¥ó¥×¤¹¤ëÃû¸õ¤Ëµ¤¤Å¤¤¤¿¾ì¹ç¤Ï¡¢ÆäË
-¤½¤¦¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@menu
-* Upgrading-from-3.22:: 3.22 ¤«¤é 3.23 ¥Ð¡¼¥¸¥ç¥ó¤Ø¤Î¥¢¥Ã¥×¥°¥ì¡¼¥É
-* Upgrading-from-3.21:: 3.21 ¤«¤é 3.22 ¥Ð¡¼¥¸¥ç¥ó¤Ø¤Î¥¢¥Ã¥×¥°¥ì¡¼¥É
-* Upgrading-from-3.20:: 3.20 ¤«¤é 3.21 ¥Ð¡¼¥¸¥ç¥ó¤Ø¤Î¥¢¥Ã¥×¥°¥ì¡¼¥É
-* Upgrading-to-arch:: ¾¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ø¤Î¥¢¥Ã¥×¥°¥ì¡¼¥É
-@end menu
-
-@cindex Compatibility, between MySQL versions
-@node Upgrading-from-3.22, Upgrading-from-3.21, Upgrade, Upgrade
-@subsection 3.22 ¤«¤é 3.23 ¥Ð¡¼¥¸¥ç¥ó¤Ø¤Î¥¢¥Ã¥×¥°¥ì¡¼¥É
-
-@strong{MySQL} 3.23 ¤Ï¿·¤·¤¤ @code{MyISAM} ·¿¤Î¥Æ¡¼¥Ö¥ë¤È¡¢¸Å¤¤ @code{ISAM} ·¿¤Î
-¥Æ¡¼¥Ö¥ë¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£
-3.23 ¤ò»ÈÍѤ¹¤ëºÝ¡¢¸Å¤¤¥Æ¡¼¥Ö¥ë(ISAM) ¤òÊÑ´¹¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£
-¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¿·¤·¤¯ºî¤é¤ì¤ë¥Æ¡¼¥Ö¥ë¤¬ @code{MyISAM} ·¿¤Ë¤Ê¤ê¤Þ¤¹¡£
-(¤³¤ì¤Ï @code{mysqld} ¤ò @code{--default-table-type=isam} ¥ª¥×¥·¥ç¥ó¤Ç
-µ¯Æ°¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢Êѹ¹¤Ç¤­¤Þ¤¹)¡£
- @code{ISAM} ¥Æ¡¼¥Ö¥ë¤ò @code{MyISAM} ¤ËÊѹ¹¤¹¤ë¤Ë¤Ï¡¢
- @code{ALTER TABLE} ¤ò»ÈÍѤ¹¤ë¤«¡¢@code{mysql_convert_table_format}
-perl ¥¹¥¯¥ê¥×¥È¤ò»ÈÍѤ·¤Þ¤¹¡£
-
-3.22 ¤È 3.21 ¤Î¥¯¥é¥¤¥¢¥ó¥È¤ÏÌäÂê¤Ê¤¯ 3.23 ¥µ¡¼¥Ð¡¼¤ÇÆ°ºî¤·¤Þ¤¹¡£
-
-°Ê²¼¤Ë¡¢3.23 ¤Ë¥¢¥Ã¥×¥°¥ì¡¼¥É¤¹¤ë¤È¤­¤Ë¡¢ÃíÌܤ¹¤ëɬÍפ¬¤¢¤ë¤â¤Î¤òÎóµó¤·¤Þ¤¹¡§
-
-@itemize @bullet
-@item @code{IF} ¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÌá¤êÃÍ·¿¤Ï¸½ºßξÊý¤Î°ú¿ô¤Ë°Í¸¤·¤Þ¤¹¡£ºÇ½é¤Î°ú¿ô¤À¤±¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-@item @code{AUTO_INCREMENT} Éé¿ô¤Ç¤ÏƯ¤­¤Þ¤»¤ó¡£
-@item @code{INNER} ¤È @code{DELAYED} ¤Ï¡¢Í½Ìó¸ì¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
-@item @code{FLOAT(X)} ¤ÏËÜÅö¤ÎÉâÆ°¾®¿ôÅÀ·¿¤Ë¤Ê¤ê¤Þ¤·¤¿¡£·å¿ô¸ÇÄê¤ÎÃͤǤϤ¢¤ê¤Þ¤»¤ó¡£
-@item @code{DECIMAL(length,dec)} Àë¸À»þ¡¢length °ú¿ô¤Ï¤â¤Ï¤äÉä¹æ¤ä¾®¿ôÅÀ¤Î¾ì½ê¤ò´Þ¤ß¤Þ¤»¤ó¡£
-@item @code{TIME} ʸ»úÎó¤Ï°Ê²¼¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¤¤¤º¤ì¤«¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡§
-@code{[[[DAYS] [H]H:]MM:]SS[.fraction]} ¤«
-@code{[[[[[H]H]H]H]MM]SS[.fraction]}
-@item @code{LIKE} ¤Ï¡¢Æ±°ìʸ»ú¤ÎÈæ³Ó @code{'='} ¥ë¡¼¥ë¤ò»ÈÍѤ·¤Æ¡¢
-Èæ³Ó¤ò¹Ô¤¦¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
-¤â¤·¸Å¤¤Èæ³ÓÊýË¡¤Ë¤¹¤ë¤Ê¤é¤Ð¡¢ @strong{MySQL} ¤ò @code{CXXFLAGS=-DLIKE_CMP_TOUPPER}
- ¥Õ¥é¥°¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¤Þ¤¹¡£
-@item @code{REGEXP} ¤Ï¡¢Ä̾ï¤Îʸ»úÎó(Èó binary) ¤Ç¤Ï¡¢¥±¡¼¥¹Èó°Í¸¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
-@item @code{MyISAM} ¥Æ¡¼¥Ö¥ë(@code{.MYI}) ¤Î¸¡ºº¡¦½¤Éü¤Ë¤Ï¡¢@code{CHECK TABLE}
-¤ò»ÈÍѤ¹¤ë¤«¡¢@code{myisamchk} ¤ò»ÈÍѤ·¤Þ¤¹¡£
-@code{isamchk} ¤Ï ISAM(@code{.ISM}) ¥Æ¡¼¥Ö¥ëÍѤ˻ÈÍѤ·¤Þ¤¹¡£.
-@item ¤â¤·¡¢3.22 ¤È 3.23 ¤Î´Ö¤Ç¸ß´¹À­¤ò»ý¤¿¤»¤Æ @code{mysqldump} ¤ò¹Ô¤¤¤¿¤¤¤Ê¤é¤Ð¡¢
- @code{--opt} ¤ä @code{--full} ¥ª¥×¥·¥ç¥ó¤ò @code{mysqldump} ¤Ë»ØÄꤷ¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£
-@item Á´¤Æ¤Î @code{DATE_FORMAT()} ¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£
-³Æ¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»ú¤ÎÁ°¤Ë¤Ï @samp{%} ʸ»ú¤¬É¬Íפˤʤê¤Þ¤·¤¿¡£
-(@strong{MySQL} 3.22 ¥Ð¡¼¥¸¥ç¥ó°Ê¹ß¤Ç¤Ï¤³¤Îʸˡ¤¬µö¤µ¤ì¤Þ¤¹¡£)
-@item
-@code{mysql_fetch_fields_direct} ¤¬´Ø¿ô¤Ë¤Ê¤ê (º£¤Þ¤Ç¤Ï¥Þ¥¯¥í¤À¤Ã¤¿¤Î¤¬)¡¢
-@code{MYSQL_FIELD} ·¿¤Ç¤Ï¤Ê¤¯ @code{MYSQL_FIELD} ¥Ý¥¤¥ó¥¿¡¼·¿¤òÊÖ¤·¤Þ¤¹¡£
-@item
-@code{mysql_num_fields()} ¤Ï¡¢ @code{MYSQL*} object ¤ò¤â¤Ï¤ä»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£
-(¤³¤ì¤Ïº£¡¢ @code{MYSQL_RES*} ¤ò°ú¿ô¤Ë¼è¤ë´Ø¿ô¤Ë¤Ê¤ê¤Þ¤·¤¿)¡£
-Âå¤ï¤ê¤Ë¡¢ @code{mysql_field_count()} ¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£
-@item
-@code{MySQL} 3.22 ¤Ç¤Ï, @code{SELECT DISTINCT ...} ¤Î½ÐÎϤÏ
-¤Û¤È¤ó¤É¤¤¤Ä¤â¥½¡¼¥È¤µ¤ì¤Þ¤·¤¿¡£ 3.23 ¤Ç¤Ï, ¥½¡¼¥È¤ò¹Ô¤Ã¤¿·ë²Ì¤òÆÀ¤ë¤Ë¤Ï
-@code{GROUP BY} ¤« @code{ORDER BY} ¤ò»ÈÍѤ·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-@item
-¤â¤·¡¢°ìÃפ¹¤ë¥ì¥³¡¼¥É¤¬Ìµ¤«¤Ã¤¿¾ì¹ç¡¢@code{SUM()} ¤Ï 0 ¤ÎÂå¤ï¤ê¤Ë @code{NULL} ¤òÊÖ¤¹¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
-¤³¤ì¤Ï ANSI SQL ½àµò¤Ç¤¹¡£
-@item
-¿·¤·¤¤Í½Ìó¸ì: @code{CASE, THEN, WHEN, ELSE and END}
-@item @code{NULL} ÃͤǤΠ@code{AND} ¤ä @code{OR} ¤Ï¸½ºß 0 ¤Ç¤Ï¤Ê¤¯
-@code{NULL} ¤òÊÖ¤·¤Þ¤¹¡£
-This mostly affects queries that uses @code{NOT}
-on an @code{AND/OR} expression as @code{NOT NULL} = @code{NULL}.
-@end itemize
-
-@cindex Compatibility, between MySQL versions
-@node Upgrading-from-3.21, Upgrading-from-3.20, Upgrading-from-3.22, Upgrade
-@subsection 3.21 ¤«¤é 3.22 ¥Ð¡¼¥¸¥ç¥ó¤Ø¤Î¥¢¥Ã¥×¥°¥ì¡¼¥É
-
-3.21 ¤È 3.22 ¤Î´Ö¤Ë¤Ï¸ß´¹À­¤Ë±Æ¶Á¤¹¤ëÊѹ¹¤Ï¤¢¤ê¤Þ¤»¤ó¡£@code{DATE} ·¿¤ò
-ȼ¤Ã¤ÆÀ¸À®¤µ¤ì¤¿¿·¤·¤¤¥Æ¡¼¥Ö¥ë¤Ï¡¢ÆüÉդγÊǼ¤Ë¿·¤·¤¤ÊýË¡¤ò»ÈÍѤ¹¤ë¤³¤È¤À
-¤±¤¬ pitfall ¤Ç¤¹¡£¤³¤ì¤é¤Î¿·¤·¤¤¥Õ¥£¡¼¥ë¥É¤Ë¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Î
-@code{mysqld} ¤«¤é¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£
-
-@code{MySQL 3.22} ¥¤¥ó¥¹¥È¡¼¥ë¸å¡¢¿·¤·¤¤¥µ¡¼¥Ð¤ò³«»Ï¤·¤Æ¡¢
-@code{mysql_fix_privilege_tables} ¥¹¥¯¥ê¥×¥È¤ò¼Â¹Ô¤¹¤Ù¤­¤Ç¤¹¡£¤³¤ì¤Ï
-@code{GRANT} ¥³¥Þ¥ó¥É¤ò»ÈÍѤ¹¤ë¤¿¤á¤ËɬÍפʸ¢¸Â¤òÄɲä·¤Þ¤¹¡£¤³¤ì¤ò˺¤ì
-¤ë¤È¡¢@code{ALTER TABLE} ¤ä @code{CREATE/DROP INDEX} ¤ò»ÈÍѤ·¤è¤¦¤È¤·¤¿
-»þ¤Ë @code{Access denied} ¤Ë¤Ê¤ê¤Þ¤¹¡£@strong{MySQL} root ¥æ¡¼¥¶¤¬¥Ñ¥¹¥ï¡¼
-¥É¤òÍ׵᤹¤ë¾ì¹ç¡¢@code{mysql_fix_privilege_tables} ¤Ø¤Î°ú¿ô¤È¤·¤Æ¤½¤ì¤ò
-Í¿¤¨¤Æ¤¯¤À¤µ¤¤¡£
-
-C API ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ @code{mysql_real_connect()} ¤ÏÊѹ¹¤µ¤ì¤Þ¤·¤¿¡£¤³¤Î
-´Ø¿ô¤ò¸Æ¤Ó½Ð¤¹¸Å¤¤¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¿·¤·¤¤
-@code{db} °ú¿ô¤Ë @code{0} ¤òÃÖ¤¯(¤Þ¤¿¤Ï¤è¤ê®¤¤Àܳ¤Î¤¿¤á¤Ë @code{db} Í×
-ÁǤòÁ÷¤ë¤è¤¦¤Ë¥¯¥é¥¤¥¢¥ó¥È¤ò¥³¡¼¥Ç¥£¥ó¥°¤·¤Ê¤ª¤¹)ɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-@code{mysql_real_connect()} ¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë
-@code{mysql_init()} ¤ò¸Æ¤Ð¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡ª
-¤³¤ÎÊѹ¹¤Ï¡¢@code{MYSQL} ¤Î¹½Â¤ÂΤ˥ª¥×¥·¥ç¥ó¤òÊݸ¤¹¤ë¤¿¤á¤Î
-¿·¤·¤¤ @code{mysql_options()} ´Ø¿ô¤òÍ­¸ú¤Ë¤·¤Þ¤¹¡£
-
-@code{mysqld} ÊÑ¿ô @code{key_buffer} ¤Ï @code{key_buffer_size} ¤Ë̾Á°¤¬
-ÊѤï¤ê¤Þ¤·¤¿¡£¤·¤«¤·¡¢¤Þ¤ÀÁ°¤Î̾Á°¤â¥¹¥¿¡¼¤È¥¢¥Ã¥×¥Õ¥¡¥¤¥ëÃæ¤Ç»ÈÍѤǤ­¤Þ
-¤¹¡£
-
-
-@node Upgrading-from-3.20, Upgrading-to-arch, Upgrading-from-3.21, Upgrade
-@subsection 3.20 ¤«¤é 3.21 ¥Ð¡¼¥¸¥ç¥ó¤Ø¤Î¥¢¥Ã¥×¥°¥ì¡¼¥É
-
-´û¤Ë 3.20.28 ¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤¬²ÔƯ¤·¤Æ¤¤¤Æ¡¢3.21.x ¤ËÊѹ¹¤·¤¿¤¤¾ì¹ç¤Ï¡¢
-¼¡¤ò¹Ô¤Ê¤¦É¬Íפ¬¤¢¤ê¤Þ¤¹:
-
-@code{safe_mysqld --old-protocol} ¤Ç @code{mysqld} 3.21 ¥µ¡¼¥Ð¤òµ¯Æ°¤¹¤ì
-¤Ð¡¢3.20 ÇÛÉÛ¤«¤é¤Î¥¯¥é¥¤¥¢¥ó¥È¤Ç¤½¤ì¤ò»ÈÍѤǤ­¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢¿·¤·¤¤¥¯
-¥é¥¤¥¢¥ó¥È´Ø¿ô @code{mysql_errno()} ¤Ï¥µ¡¼¥Ð¤Î¥¨¥é¡¼¤Ï²¿¤âÊÖ¤µ¤º¡¢
-@code{CR_UNKNOWN_ERROR} ¤À¤±¤òÊÖ¤·¤Þ¤¹ (¤¿¤À¤·¥¯¥é¥¤¥¢¥ó¥È¤Î¥¨¥é¡¼¤Ë¤Ä¤¤
-¤Æ¤ÏƯ¤­¤Þ¤¹)¡£¤½¤·¤Æ ¥µ¡¼¥Ð¤Ï¸Å¤¤ password() ¥Á¥§¥Ã¥¯¤ò¿·¤·¤¤¤â¤Î¤ÎÂå¤ï
-¤ê¤Ë»ÈÍѤ·¤Þ¤¹¡£
-
-@code{mysqld} ¤Ë @code{--old-protocol} ¥ª¥×¥·¥ç¥ó¤ò@emph{»È¤ï¤Ê¤¤}¾ì¹ç¡¢
-¼¡¤ÎÊѹ¹¤ò¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹:
-
-@itemize @bullet
-@item
-Á´¤Æ¤Î¥¯¥é¥¤¥¢¥ó¥È¥³¡¼¥É¤ÏºÆ¥³¥ó¥Ñ¥¤¥ë¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ODBC ¤ò»ÈÍѤ·
-¤Æ¤¤¤ë¾ì¹ç¤Ï¿·¤·¤¤ @strong{MyODBC} 2.x ¥É¥é¥¤¥Ð¤òÆþ¼ê¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-@item
-@code{mysql.user} ¥Æ¡¼¥Ö¥ëÆâ¤Î @code{password} ¥Õ¥£¡¼¥ë¥É¤ò
-@code{CHAR(16)} ¤ËÊÑ´¹¤¹¤ë¤¿¤á¤Ë¡¢¥¹¥¯¥ê¥×¥È
-@code{scripts/add_long_password} ¤ò¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-@item
-Á´¤Æ¤Î¥Ñ¥¹¥ï¡¼¥É¤Ï @code{mysql.user} ¥Æ¡¼¥Ö¥ëÆâ¤ËºÆÇÛÃÖ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ
-¤¹(31¥Ó¥Ã¥È¥Ñ¥¹¥ï¡¼¥É¤ÎÂå¤ï¤ê¤Ë¡¢62¥Ó¥Ã¥È¤òÆÀ¤ë¤¿¤á¤Ë)¡£
-@item
-¥Æ¡¼¥Ö¥ë·Á¼°¤ÏÊѹ¹¤µ¤ì¤Æ¤¤¤Ê¤¤¤Î¤Ç¡¢¤É¤Î¥Æ¡¼¥Ö¥ë¤âÊÑ´¹¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»
-¤ó¡£
-@end itemize
-
-@strong{MySQL} 3.20.28 ¤È¤½¤ì°Ê¹ß¤Ï¡¢¥¯¥é¥¤¥¢¥ó¥È¤Ë±Æ¶Á¤òµÚ¤Ü¤µ¤º¤Ë¡¢¿·
-¤·¤¤ @code{user} ¥Æ¡¼¥Ö¥ë·Á¼°¤ò½èÍý¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£3.20.28 ¤è¤êÁ°¤Î
-@strong{MySQL} ¥Ð¡¼¥¸¥ç¥ó¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢@code{user} ¥Æ¡¼¥Ö¥ë¤òÊÑ´¹
-¤¹¤ë¤È¡¢¥Ñ¥¹¥ï¡¼¥É¤Ï¤½¤Î¾å¤Ç¤Ï¤â¤¦Æ¯¤­¤Þ¤»¤ó¡£°ÂÁ´¤Î¤¿¤á¡¢ºÇ½é¤Ë¾¯¤Ê¤¯¤È
-¤â 3.20.28 ¤Ë¥¢¥Ã¥×¥°¥ì¡¼¥É¤·¡¢¤½¤ì¤«¤é 3.21.x ¤Ë¥¢¥Ã¥×¥°¥ì¡¼¥É¤¹¤Ù¤­¤Ç
-¤¹¡£
-
-@cindex Protocol mismatch
-¿·¤·¤¤¥¯¥é¥¤¥¢¥ó¥È¥³¡¼¥É¤Ï 3.20.x @code{mysqld} ¥µ¡¼¥Ð¤ÇÆ°ºî¤¹¤ë¤Î¤Ç¡¢¤â
-¤· 3.21.x ¤ÇÌäÂ꤬¤¢¤Ã¤¿¾ì¹ç¤Ï¡¢¥¯¥é¥¤¥¢¥ó¥È¤ò¤â¤¦°ìÅٺƥ³¥ó¥Ñ¥¤¥ë¤¹¤ëɬ
-ÍפϤʤ¯¡¢¸Å¤¤ 3.20.x ¥µ¡¼¥Ð¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@code{mysqld} ¤Ë @code{--old-protocol} ¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ·¤Ê¤¤¾ì¹ç¡¢¸Å¤¤
-¥¯¥é¥¤¥¢¥ó¥È¤Ï¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òȯ¤·¤Þ¤¹:
-
-@example
-ERROR: Protocol mismatch. Server Version = 10 Client Version = 9
-@end example
-
-¿·¤·¤¤ Perl ¥¤¥ó¥¿¥Õ¥§¡¼¥¹ @code{DBI}/@code{DBD} ¤Ï¸Å¤¤ @code{mysqlperl}
-¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤â¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£@code{mysqlperl} ¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ë¹Ô¤¦É¬
-ÍפΤ¢¤ëÊѹ¹¤Ï¡¢@code{connect()} ´Ø¿ô¤Î°ú¿ô¤ÎÊѹ¹¤À¤±¤Ç¤¹¡£¿·¤·¤¤°ú¿ô¤Ï:
-@code{host}, @code{database}, @code{user}, @code{password} (@code{user}
-¤È @code{password} °ú¿ô¤Î½çÈÖ¤¬Êѹ¹¤µ¤ì¤Þ¤·¤¿)¡£
-@xref{Perl DBI Class, , Perl @code{DBI} Class}.
-
-¼¡¤ÎÊѹ¹¤Ï¸Å¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Î¥¯¥¨¥ê¤Ë±Æ¶Á¤·¤Þ¤¹:
-
-@itemize @bullet
-@item
-@code{HAVING} ¤Ï¸½ºß @code{ORDER BY} Àá¤è¤êÁ°¤Ë¤Ê¤±¤ì¤Ð¤¤¤±¤Þ¤»¤ó¡£
-@item
-@code{LOCATE()} ¤Ø¤Î¥Ñ¥é¥á¡¼¥¿¤Ï¸ò´¹¤µ¤ì¤Þ¤·¤¿¡£
-@item
-¿·¤·¤¤Í½Ìó¸ì¤¬¤¤¤¯¤Ä¤«¤¢¤ê¤Þ¤¹¡£ºÇ¤âÃí°Õ¤¹¤Ù¤­¤Ï @code{DATE},
-@code{TIME} ¤½¤·¤Æ @code{TIMESTAMP} ¤Ç¤¹¡£
-@end itemize
-
-@node Upgrading-to-arch, , Upgrading-from-3.20, Upgrade
-@subsection ¾¤Î¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Ø¤Î¥¢¥Ã¥×¥°¥ì¡¼¥É
-
-¤â¤·¡¢@strong{MySQL} 3.23 ¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Ê¤é¤Ð¡¢
-°ã¤¦¥¢¡¼¥­¥Æ¥¯¥Á¥ã¤Î¥Þ¥·¥ó¤Ë¡¢@code{.frm}, @code{.MYI},@code{.MYD} ¥Õ¥¡¥¤¥ë¤ò
-¥³¥Ô¡¼¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
-¤¿¤À¤·¡¢Î¾¼Ô´Ö¤Ç¡¢Æ±¤¸ÉâÆ°¾®¿ôÅÀ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¾ì¹ç¤Ë¸Â¤ê¤Þ¤¹¡£
-(@strong{MySQL} takes care of any byte swapping issues).
-
-¸½ºß @strong{MySQL} ¥Ç¡¼¥¿¤È¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë (@code{ISAM} @file{*.ISD} ¤È
-@file{*.ISM} ¥Õ¥¡¥¤¥ë) ¤Ï¥¢¡¼¥­¥Æ¥¯¥Á¥ã°Í¸¤Ç¡¢¤¤¤¯¤Ä¤«¤Î¥±¡¼¥¹¤Ç¤Ï OS
-°Í¸¤Ç¤¹¡£¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò¡¢¸½ºß¤Î¥Þ¥·¥ó¤È¤Ï°Û¤Ê¤ë¥¢¡¼¥­¥Æ¥¯¥Á¥ã/OS ¤ò
-»ý¤Ä¾¤Î¥Þ¥·¥ó¤Ë°Ü¤·¤¿¤¤¾ì¹ç¤Ï¡¢Ã±½ã¤Ë¥Õ¥¡¥¤¥ë¤ò¾¤Î¥Þ¥·¥ó¤Ë¥³¥Ô¡¼¤¹¤ë¤³
-¤È¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò°Ü¹Ô¤·¤è¤¦¤È¤¹¤Ù¤­¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£@code{mysqldump} ¤ò
-»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£
-
-¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï @code{mysqldump} ¤Ï¡¢´°Á´¤Ê SQL ¥¹¥Æ¡¼¥È¥á¥ó¥È¥Õ¥¡¥¤¥ë¤ò
-À¸À®¤·¤Þ¤¹¡£¤½¤ì¤«¤é¤½¤Î¥Õ¥¡¥¤¥ë¤ò¾¤Î¥Þ¥·¥ó¤ØžÁ÷¤·¡¢@code{mysql} ¥¯¥é
-¥¤¥¢¥ó¥È¤Ø¤ÎÆþÎϤȤ·¤ÆÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-Í­¸ú¤Ê¥ª¥×¥·¥ç¥ó¤¬²¿¤«¤ò¸«¤ë¤¿¤á¤Ë¤Ï¡¢@code{mysqldump --help} ¤ò»î¤·¤Æ¤¯
-¤À¤µ¤¤¡£¥Ç¡¼¥¿¤ò @strong{MySQL} ¤Î¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Ë°Ü¤¹¾ì¹ç¡¢Â®¤¯¥³
-¥ó¥Ñ¥¯¥È¤Ê¥À¥ó¥×¤òÆÀ¤ë¤¿¤á¤Ë¡¢¤è¤ê¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Ç @code{mysqldump --opt}
-¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£
-
-£²¤Ä¤Î¥Þ¥·¥ó´Ö¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò°ÜÆ°¤¹¤ëºÇ¤â´Êñ¤Ê (¤·¤«¤·ºÇ¤â®¤¯¤Ï¤Ê¤¤)
-ÊýË¡¤Ï¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ÃÖ¤«¤ì¤Æ¤¤¤ë¥Þ¥·¥ó¾å¤Ç¼¡¤Î¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ç
-¤¹:
-
-@example
-shell> mysqladmin -h 'other hostname' create db_name
-shell> mysqldump --opt db_name \
- | mysql -h 'other hostname' db_name
-@end example
-
-ÃÙ¤¤¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Ç¥ê¥â¡¼¥È¥Þ¥·¥ó¤«¤é¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¥³¥Ô¡¼¤·¤¿¤¤¾ì¹ç¤Ï¡¢
-¼¡¤ò»ÈÍѤǤ­¤Þ¤¹:
-
-@example
-shell> mysqladmin create db_name
-shell> mysqldump -h 'other hostname' --opt --compress db_name \
- | mysql db_name
-@end example
-
-¥Õ¥¡¥¤¥ëÆâ¤Î·ë²Ì¤ò³ÊǼ¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹ (¤³¤ÎÎã¤Ç¤Ï°µ½Ì¤µ¤ì¤Æ¤¤¤Þ¤¹):
-
-@example
-shell> mysqldump --quick db_name | gzip > db_name.contents.gz
-@end example
-
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÃæ¿È¤ò´Þ¤ó¤Ç¤¤¤ë¥Õ¥¡¥¤¥ë¤ò¡¢ÌÜŪ¤Î¥Þ¥·¥ó¤ËžÁ÷¤·¤Æ¡¢¼¡¤Î¥³
-¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤:
-
-@example
-shell> mysqladmin create db_name
-shell> gunzip < db_name.contents.gz | mysql db_name
-@end example
-
-@cindex @code{mysqldump}
-@cindex @code{mysqlimport}
-¥Ç¡¼¥¿¥Ù¡¼¥¹Å¾Á÷¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤Ë¡¢@code{mysqldump} ¤È @code{mysqlimport}
-¤â»ÈÍѤǤ­¤Þ¤¹¡£Â礭¤Ê¥Æ¡¼¥Ö¥ë¤Ç¤Ï¡¢¤³¤ì¤Ïñ½ã¤Ê @code{mysqldump} ¤Î»ÈÍÑ
-¤è¤ê¤â¤È¤Æ¤â®¤¤¤Ç¤¹¡£¼¡¤Ë¼¨¤¹¥³¥Þ¥ó¥É¤Ç¤Ï¡¢@code{DUMPDIR} ¤Ï
-@code{mysqldump} ¤«¤é¤Î½ÐÎϤò³ÊǼ¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Î´°Á´¤Ê
-¥Ñ¥¹Ì¾¤òɽ¤ï¤·¤Æ¤¤¤Þ¤¹¡£
-
-¤Þ¤º¡¢½ÐÎÏ¥Õ¥¡¥¤¥ë¤Î¤¿¤á¤Î¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤·¤Æ¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¥À¥ó¥×¤·
-¤Þ¤¹:
-
-@example
-shell> mkdir DUMPDIR
-shell> mysqldump --tab=DUMPDIR db_name
-@end example
-
-¤½¤ì¤«¤é¡¢@code{DUMPDIR} ¥Ç¥£¥ì¥¯¥È¥êÆâ¤Î¥Õ¥¡¥¤¥ë¤òÌÜŪ¤Î¥Þ¥·¥ó¾å¤ÎÂбþ
-¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ËžÁ÷¤·¡¢@strong{MySQL} ¤Ë¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹:
-
-@example
-shell> mysqladmin create db_name # create database
-shell> cat DUMPDIR/*.sql | mysql db_name # create tables in database
-shell> mysqlimport db_name DUMPDIR/*.txt # load data into tables
-@end example
-
-@code{mysql} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥³¥Ô¡¼¤â˺¤ì¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£¤½¤ì¤Ï¾µÇ§¥Æ¡¼¥Ö
-¥ë (@code{user}, @code{db}, @code{host}) ¤¬³ÊǼ¤µ¤ì¤ë¤¿¤á¤Ç¤¹¡£
-@code{mysql} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¤½¤Î¾ì½ê¤ËÃÖ¤¯¤Þ¤Ç¡¢¿·¤·¤¤¥Þ¥·¥ó¾å¤Ç¤Ï
-@strong{MySQL} @code{root} ¥æ¡¼¥¶¤È¤·¤Æ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-¿·¤·¤¤¥Þ¥·¥ó¾å¤Ø @code{mysql} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤òƳÆþ¤·¤¿¸å¡¢¥µ¡¼¥Ð¤¬¾µÇ§¥Æ¡¼
-¥Ö¥ë¾ðÊó¤òºÆ¥í¡¼¥É¤¹¤ë¤¿¤á¤Ë¡¢@code{mysqladmin flush-privileges} ¤ò¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@cindex Compatibility, with ANSI SQL
-@node Compatibility, Privilege system, Installing, Top
-@chapter @strong{MySQL} ¤Ï¤É¤Î¤è¤¦¤Ëɸ½à¸ß´¹¤«¡©
-
-@menu
-* Extensions to ANSI:: @strong{MySQL} ¤Î ANSI SQL92 ¤ËÂФ¹¤ë³ÈÄ¥
-* Ansi mode:: Runnning @strong{MySQL} in ANSI mode
-* Differences from ANSI:: @strong{MySQL} differences compared to ANSI SQL92
-* Missing functions:: @strong{MySQL} ¤Ë̵¤¤µ¡Ç½
-* Standards:: @strong{MySQL} ¤¬½àµò¤¹¤ëɸ½à
-* Commit-rollback:: @code{COMMIT}/@code{ROLLBACK} ¤Ê¤·¤Ç¤¦¤Þ¤¯¤ä¤ëÊýË¡
-@end menu
-
-
-@node Extensions to ANSI, Ansi mode, Compatibility, Compatibility
-@section @strong{MySQL} ¤Î ANSI SQL92 ¤ËÂФ¹¤ë³ÈÄ¥
-
-@strong{MySQL} ¤Ï¡¢Â¾¤Î SQL ¥Ç¡¼¥¿¥Ù¡¼¥¹Æâ¤Ë¸«¤é¤ì¤Ê¤¤¤Ç¤¢¤í¤¦¡¢¤¤¤¯¤Ä¤«
-¤Î³ÈÄ¥¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£¤¢¤Ê¤¿¤¬¤½¤ì¤é¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢¥³¡¼¥É¤Ï¾¤Î SQL ¥µ¡¼
-¥Ð¤Ë°Ü¹Ô¤Ç¤­¤Ê¤¯¤Ê¤ë¤Î¤ÇÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£¤¤¤¯¤Ä¤«¤Î¥±¡¼¥¹¤Ç¤Ï¡¢·Á¼°
-@code{/*! ... */} ¤Î¥³¥á¥ó¥È¤ò»ÈÍѤ¹¤ë¤³¤È¤Ç¡¢@strong{MySQL} ³ÈÄ¥¤ò´Þ¤à
-°Ü¹Ô²Äǽ¥³¡¼¥É¤ò½ñ¤¯¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢@strong{MySQL} ¤Ï¥³¥á¥ó¥È
-Æâ¤Î¥³¡¼¥É¤ò¼Â¹Ô¤·¤Þ¤¹¤¬¡¢¤Û¤«¤ÎSQL¥µ¡¼¥Ð¡¼¤Ï¤³¤ì¤ò̵»ë¤·¤Þ¤¹¡£Î㤨¤Ð:
-
-@example
-SELECT /*! STRAIGHT_JOIN */ col_name FROM table1,table2 WHERE ...
-@end example
-
-@code{'!'} ¤Î¸å¤í¤Ë¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òÄɲ乤ë¤È¡¢Ê¸Ë¡¤Ï @strong{MySQL} ¥Ð¡¼
-¥¸¥ç¥ó¤¬»ÈÍѤµ¤ì¤ë¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤ÈÅù¤·¤¤¤«Â礭¤¤¾ì¹ç¤Ë¤Î¤ß¼Â¹Ô¤µ¤ì¤Þ¤¹:
-
-@example
-CREATE /*!32302 TEMPORARY */ TABLE (a int);
-@end example
-
-¾åµ­¤Ï 3.23.02 ¤«¤½¤ì°Ê¾å¤Î¾ì¹ç¤È¤¤¤¦°ÕÌ£¤Ç¡¢¤½¤Î¤È¤­ @strong{MySQL} ¤Ï
-@code{TEMPORARY} ¥­¡¼¥ï¡¼¥É¤ò»ÈÍѤ·¤Þ¤¹¡£
-
-@strong{MySQL} ³ÈÄ¥¤ò°Ê²¼¤Ë¼¨¤·¤Þ¤¹:
-
-@itemize @bullet
-@item
-¥Õ¥£¡¼¥ë¥É·¿ @code{MEDIUMINT}, @code{SET}, @code{ENUM} ¤½¤·¤ÆÍÍ¡¹¤Ê
-@code{BLOB} ¤È @code{TEXT} ·¿¡£
-
-@item
-¥Õ¥£¡¼¥ë¥É°À­ @code{AUTO_INCREMENT}, @code{BINARY}, @code{NULL}, @code{UNSIGNED} ¤½¤·¤Æ
-@code{ZEROFILL}¡£
-
-@item
-Á´¤Æ¤Îʸ»úÎóÈæ³Ó¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥±¡¼¥¹Èó°Í¸¤Ç¡¢¸½ºß¤Îʸ»ú¥»¥Ã¥È(¥Ç¥Õ¥©
-¥ë¥È¤Ç¤Ï ISO-8859-1 Latin1)¤Ë½¾¤Ã¤¿¥½¡¼¥È½ç¤Ç¤¹¡£¤³¤ì¤ò¹¥¤Þ¤Ê¤¤¾ì¹ç¤Ï¡¢
-@code{BINARY} °À­¤Ç¤¢¤Ê¤¿¤Î¥Õ¥£¡¼¥ë¥É¤òÀë¸À¤¹¤Ù¤­¤Ç¤¹¡£¤³¤ì¤Ï¡¢@strong{MySQL}
-¥µ¡¼¥Ð¥Û¥¹¥È¤Î¾å¤Ç»ÈÍѤµ¤ì¤ë ASCII ½ç¤Ë½¾¤Ã¤ÆÈæ³Ó¤¬¼Â¹Ô¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤ê
-¤Þ¤¹¡£
-
-@item
-@strong{MySQL} ¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò@strong{MySQL} ¥Ç¡¼¥¿¥Ç¥£¥ì¥¯¥È¥ê
-°Ê²¼¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¡¢
-¥Æ¡¼¥Ö¥ë¤ò¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤Î¥Õ¥¡¥¤¥ë̾¤Ë
-¥Þ¥Ã¥×¤·¤Þ¤¹¡£¤³¤ì¤Ï£²¤Ä¤Î´Ø·¸¤ò»ý¤Á¤Þ¤¹:
-
-@itemize @minus
-@item
-@cindex Database names, case sensitivity
-@cindex Table names, case sensitivity
-@cindex Case sensitivity, of database names
-@cindex Case sensitivity, of table names
-¥±¡¼¥¹°Í¸¤Î¥Õ¥¡¥¤¥ë̾¤ò»ý¤Ä OS (UNIX¤Î¤è¤¦¤Ê)¾å¤Î @strong{MySQL} ¤Ç¤Ï¡¢
-¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¤È¥Æ¡¼¥Ö¥ë̾¤Ï¥±¡¼¥¹°Í¸¤Ç¤¹¡£
-¥Æ¡¼¥Ö¥ë̾¤Îµ­²±¤ËÌäÂ꤬¤¢¤ë¾ì¹ç¡¢¾ï¤Ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¥Æ¡¼¥Ö¥ë¤ò
-¾®Ê¸»ú¤ÇÀ¸À®¤¹¤ë¤È¤¤¤¦¶ñ¹ç¤Ë¡¢°ì´Ó¤·¤ÆƱ¤¸¤è¤¦¤Ë̿̾¤¹¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
-
-@item
-¥Æ¡¼¥Ö¥ë¤Î¥Ð¥Ã¥¯¥¢¥Ã¥×, ¥ê¥Í¡¼¥à, °ÜÆ°, ºï½ü, ¥³¥Ô¡¼¤Ëɸ½à¥·¥¹¥Æ¥à¥³¥Þ¥ó
-¥É¤ò»ÈÍѤǤ­¤Þ¤¹¡£Î㤨¤Ð¡¢¥Æ¡¼¥Ö¥ë¤ò¥ê¥Í¡¼¥à¤¹¤ë¤Ë¤Ï¡¢¥Æ¡¼¥Ö¥ë¤ËÂбþ¤¹¤ë
-@file{.MYD}, @file{.MYI}, @file{.frm} ¥Õ¥¡¥¤¥ë¤ò¥ê¥Í¡¼¥à¤·¤Æ¤¯¤À¤µ¤¤¡£
-@end itemize
-
-@item
-SQL ʸ¤Ç¤Ï¡¢ @code{db_name.tbl_name} ¹½Ê¸¤ò»ÈÍѤ·¤Æ°ã¤¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Æ¡¼¥Ö¥ë¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤¹¡£
-¤¤¤¯¤Ä¤«¤ÎSQL¥µ¡¼¥Ð¡¼¤ÏƱÍͤε¡Ç½¤òÄ󶡤·¤Þ¤¹¤¬¡¢¤³¤ì¤ò @code{User space} ¤Ç¥³¡¼¥ë¤·¤Þ¤¹¡£
-@strong{MySQL} ¤Ï°Ê²¼¤Î¤è¤¦¤Ê¥Æ¡¼¥Ö¥ë¥¹¥Ú¡¼¥¹¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤»¤ó:
-@code{create table ralph.my_table...IN my_tablespace}.
-
-@item
-¿ôÃÍ¥Õ¥£¡¼¥ë¥É¾å¤Ç¤Î @code{LIKE} ¤¬µö¤µ¤ì¤Þ¤¹¡£
-
-@item
-@code{SELECT} ¥¹¥Æ¡¼¥È¥á¥ó¥ÈÆâ¤Î @code{INTO OUTFILE} ¤È
-@code{STRAIGHT_JOIN} ¤Î»ÈÍÑ¡£@xref{SELECT, , @code{SELECT}}.
-
-@item
-¤É¤Î¤è¤¦¤Ë¥Æ¡¼¥Ö¥ë¤¬·ë¹ç¤µ¤ì¤ë¤«¤Î¾ÜºÙ¤òÆÀ¤ë¤¿¤á¤Î @code{EXPLAIN SELECT}¡£
-
-@item
-¥¤¥ó¥Ç¥Ã¥¯¥¹Ì¾¡¢¥Õ¥£¡¼¥ë¥É¤Î°ìÉô¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¡¢¤½¤·¤Æ @code{CREATE TABLE} ¥¹
-¥Æ¡¼¥È¥á¥ó¥ÈÆâ¤Î @code{INDEX} ¤Þ¤¿¤Ï @code{KEY} ¤Î»ÈÍÑ¡£
-@xref{CREATE TABLE, , @code{CREATE TABLE}}.
-
-@item
-@code{CREATE TABLE} ¤Ç¤Î @code{TEMPORARY} ¤« @code{IF NOT EXISTS} ¤Î»ÈÍÑ¡£
-
-@item
-'list' Í×ÁǤ¬°ì¤Ä°Ê¾å¤Î @code{COUNT(DISTINCT list)} ¤Î»ÈÍÑ¡£
-
-@item
-@code{ALTER TABLE} ¥¹¥Æ¡¼¥È¥á¥ó¥ÈÆâ¤Î @code{CHANGE col_name}, @code{DROP col_name},
-@code{DROP INDEX} ¤Î»ÈÍÑ¡£
-@xref{ALTER TABLE, ,@code{ALTER TABLE}}.
-
-@item
-@code{ALTER TABLE} ¥¹¥Æ¡¼¥È¥á¥ó¥ÈÆâ¤Î @code{IGNORE} ¤Î»ÈÍÑ¡£
-
-@item
-@code{ALTER TABLE} ¥¹¥Æ¡¼¥È¥á¥ó¥ÈÆâ¤ÎÊ£¿ô¤Î @code{ADD}, @code{ALTER},
-@code{DROP}, @code{CHANGE} Àá¤Î»ÈÍÑ¡£
-
-@item
-¥­¡¼¥ï¡¼¥É @code{IF EXISTS} ÉÕ¤­¤Î @code{DROP TABLE} ¤Î»ÈÍÑ¡£
-
-@item
-Ê£¿ô¤Î¥Æ¡¼¥Ö¥ë¤ò°ì²ó¤Î @code{DROP TABLE} ¤ÇÇË´þ¤Ç¤­¤ë
-
-@item
-@code{DELETE} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Î @code{LIMIT} Àá¡£
-
-@item
-@code{INSERT} ¤È @code{REPLACE} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Î @code{DELAYED} Àá¡£
-
-@item
-@code{INSERT}, @code{REPLACE}, @code{DELETE}, @code{UPDATE} ¥¹¥Æ¡¼¥È¥á¥ó¥È
-¤Î @code{LOW_PRIORITY} Àá¡£
-
-@cindex Oracle compatibility
-@cindex Compatibility, with Oracle
-@item
-@code{LOAD DATA INFILE} ¤Î»ÈÍÑ¡£Â¿¤¯¤Î¾ì¹ç¡¢¤³¤Î¹½Ê¸¤Ï ORACLE ¤Î
-@code{LOAD DATA INFILE} ¤È¸ß´¹¤¬¤¢¤ê¤Þ¤¹¡£@xref{LOAD DATA, , @code{LOAD DATA}}.
-
-@item
-@code{OPTIMIZE TABLE} ¥¹¥Æ¡¼¥È¥á¥ó¥È¡£
-@xref{OPTIMIZE TABLE, , @code{OPTIMIZE TABLE}}.
-
-@item
-@code{SHOW} ¥¹¥Æ¡¼¥È¥á¥ó¥È¡£
-@xref{SHOW, , @code{SHOW}}.
-
-@item
-@samp{'} ¤À¤±¤Ç¤Ê¤¯ @samp{"} ¤Þ¤¿¤Ï @samp{'} ¤Ë¤è¤Ã¤Æʸ»úÎó¤ò³ç¤ë¤³¤È¤¬
-²Äǽ¡£
-
-@item
-¥¨¥¹¥±¡¼¥× @samp{\} ʸ»ú¤Î»ÈÍÑ¡£
-
-@item
-@code{SET OPTION} ¥¹¥Æ¡¼¥È¥á¥ó¥È¡£@xref{SET OPTION, , @code{SET OPTION}}.
-
-@item
-@code{GROUP BY} Éô¤ËÁ´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤ò»ý¤ÄɬÍפϤ¢¤ê¤Þ¤»¤ó¡£
-This gives better performance for some very specific, but quite normal
-queries.
-@xref{Group by functions}.
-
-@item
-°Û¤Ê¤ë SQL ´Ä¶­¤«¤éÍ褿¥æ¡¼¥¶¤ËÂФ·¡¢¤è¤ê´Êñ¤Ë¤¹¤ë¤¿¤á¡¢@strong{MySQL}
-¤Ï¿¤¯¤Î´Ø¿ô¤ËÊÌ̾¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤¹¡£Î㤨¤Ð¡¢Á´¤Æ¤Îʸ»úÎó´Ø¿ô¤Ï ANSI
-SQL ¤È ODBC ¹½Ê¸¤ÎξÊý¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£
-
-@item
-@strong{MySQL} ¤Ï @code{||} ¤È @code{&&} ±é»»»Ò¤ò¡¢C ¥×¥í¥°¥é¥ß¥ó¥°¸À¸ì
-¤Î¤è¤¦¤Ë¡¢ÏÀÍýϤÈÏÀÍýÀѤò°ÕÌ£¤¹¤ë¤ÈÍý²ò¤·¤Þ¤¹¡£@strong{MySQL} ¤Ç¤Ï
-@code{||} ¤È @code{OR}¡¢@code{&&} ¤È @code{AND} ¤ÏƱµÁ¸ì¤Ç¤¹¡£¤³¤ÎÎɤ¤¹½
-ʸ¤Î¤¿¤á¡¢@strong{MySQL} ¤Ï ANSI SQL ¤Îʸ»úÎó·ë¹ç±é»»»Ò @code{||} ¤ò¥µ¥Ý¡¼
-¥È¤·¤Þ¤»¤ó¡£@code{CONCAT()} ¤òÂå¤ï¤ê¤Ë»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£@code{CONCAT()}
-¤ÏǤ°Õ¤Î¿ô¤Î°ú¿ô¤ò»ÈÍѤǤ­¤ë¤Î¤Ç¡¢@code{||} ±é»»»Ò¤Î»ÈÍѤò
-@strong{MySQL} ¤ËÊÑ´¹¤¹¤ë¤Î¤Ï´Êñ¤Ç¤¹¡£
-
-@item
-@code{CREATE DATABASE} ¤Þ¤¿¤Ï @code{DROP DATABASE}.
-@xref{CREATE DATABASE, , @code{CREATE DATABASE}}.
-
-@cindex PostgreSQL compatibility
-@cindex Compatibility, with PostgreSQL
-@item
-@code{MOD()} ¤ÈƱµÁ¤Î @code{%}¡£ @code{N % M} ¤Ï @code{MOD(N,M)} ¤ÈÅù²Á¤Ç¤¹¡£
-@code{%} ¤Ï C ¥×¥í¥°¥é¥Þ¡¼¤È PostgreSQL ¤È¤Î¸ß´¹¤Î¤¿¤á¤Ë¥µ¥Ý¡¼¥È¤µ¤ì¤Þ¤¹¡£
-
-@item
-¥Õ¥£¡¼¥ë¥É¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ç¤Î @code{=}, @code{<>}, @code{<=} ,@code{<},
-@code{>=}, @code{>}, @code{<<}, @code{>>}, @code{<=>},
-@code{AND}, @code{OR}, @code{LIKE}¡£
-Î㤨¤Ð¡§
-
-@example
-mysql> SELECT col1=1 AND col2=2 FROM tbl_name;
-@end example
-
-@item
-@code{LAST_INSERT_ID()} ´Ø¿ô¡£
-@xref{mysql_insert_id, , @code{mysql_insert_id()}}.
-
-@item
-@code{REGEXP} ¤Þ¤¿¤Ï @code{NOT REGEXP}¡£
-
-@item
-1¤Ä¤Þ¤¿¤Ï2°Ê¾å¤Î°ú¿ô¤Ç¤Î @code{CONCAT()} ¤Þ¤¿¤Ï @code{CHAR()}¡£
-@strong{MySQL} ¤Ç¤Ï¡¢¤³¤ì¤é¤Î´Ø¿ô¤ÏǤ°Õ¤Î¿ô¤Î°ú¿ô¤ò¼è¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@item @code{BIT_COUNT()}, @code{CASE}, @code{ELT()},
-@code{FROM_DAYS()}, @code{FORMAT()}, @code{IF()}, @code{PASSWORD()},
-@code{ENCRYPT()}, @code{md5()}, @code{ENCODE()}, @code{DECODE()},
-@code{PERIOD_ADD()}, @code{PERIOD_DIFF()}, @code{TO_DAYS()},
-@code{WEEKDAY()} ´Ø¿ô¡£
-
-@item
-¥µ¥Öʸ»úÎó¤ÎÀ°·Á¤Î¤¿¤á¤Ë @code{TRIM()} ¤ò»ÈÍѤǤ­¤Þ¤¹¡£ANSI SQL ¤Ï°ìʸ»ú
-¤Îºï½ü¤À¤±¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£
-
-@item
-@code{GROUP BY} ´Ø¿ô @code{STD()}, @code{BIT_OR()} ¤½¤·¤Æ @code{BIT_AND()}¡£
-
-@item
-@code{DELETE} + @code{INSERT} ¤ÎÂå¤ï¤ê¤Î @code{REPLACE} ¤Î»ÈÍÑ¡£
-@xref{REPLACE, , @code{REPLACE}}.
-
-@item
-@code{FLUSH flush_option} ¹½Ê¸¡£
-
-@item
-@code{:=} ¤Ç¥¹¥Æ¡¼¥È¥á¥ó¥ÈÆâ¤Ç¤ÎÊÑ¿ô¤ÎÀßÄ꤬²Äǽ:
-@example
-SELECT @@a:=SUM(total),@@b=COUNT(*),@@a/@@b AS avg FROM test_table;
-SELECT @@t1:=(@@t2:=1)+@@t3:=4,@@t1,@@t2,@@t3;
-@end example
-
-@end itemize
-
-@node Ansi mode, Differences from ANSI, Extensions to ANSI, Compatibility
-@section ANSI ¥â¡¼¥É¤Ç¤Î MySQL ¤Î¼Â¹Ô
-
-@code{--ansi} ¥ª¥×¥·¥ç¥ó¤Ä¤­¤Ç mysqld ¤ò³«»Ï¤¹¤ë¤È¡¢¤½¤Î @strong{MySQL} ¤Î
-¿¶Éñ¤¤¤¬ÊѤï¤ê¤Þ¤¹¡£
-
-@itemize @bullet
-@item
-@code{||} ¤Ï @code{OR} ¤Ç¤Ï¤Ê¤¯Ê¸»úÎó·ë¹ç¤Ç¤¹¡£
-@item
-´Ø¿ô̾¤È '(' ¤Î´Ö¤ËǤ°Õ¤Î¿ô¤Î¥¹¥Ú¡¼¥¹¤òÃÖ¤¯¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤ì¤Ï¤¹¤Ù¤Æ¤Î
-´Ø¿ô¤òͽÌó¸ì¤Ë¤·¤Þ¤¹¡£
-@item
-@code{"} ¤Ï(@strong{MySQL} @code{`} °úÍÑʸ»ú¤Ë»÷¤¿)¼±Ê̻ҰúÍÑʸ»ú¤Ë¤Ê¤ê¡¢
-ʸ»úÎó°úÍÑʸ»ú¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-@item
-@code{REAL} ¤Ï @code{DOUBLE} ¤ÎƱµÁ¸ì¤Ç¤Ï¤Ê¤¯ @code{FLOAT} ¤ÎƱµÁ¸ì¤Ë¤Ê¤ê
-¤Þ¤¹¡£
-@end itemize
-
-@node Differences from ANSI, Missing functions, Ansi mode, Compatibility
-@section @strong{MySQL} ¤È ANSI SQL92 ¤È¤Î°ã¤¤
-
-²æ¡¹¤Ï @strong{MySQL} ¤ò ANSI SQL ɸ½à¤È ODBC SQL ɸ½à¤Ë½¾¤¦¤è¤¦¤Ë»î¤ß¤Æ¤¤
-¤Þ¤¹¤¬¡¢¤¤¤¯¤Ä¤«¤Î¥±¡¼¥¹¤Ç @strong{MySQL} ¤Ï²¿¤«°ã¤¤¤¬¤¢¤ê¤Þ¤¹:
-
-@itemize @bullet
-@item
-@code{--} ¤Ï¶õÇò¤¬Â³¤¯¾ì¹ç¤À¤±¥³¥á¥ó¥È¤Ë¤Ê¤ê¤Þ¤¹¡£@xref{Missing comments}¡£
-@item
-@code{VARCHAR} ¥Õ¥£¡¼¥ë¥É¤Ç¤Ï¡¢Ãͤ¬³ÊǼ¤µ¤ì¤ë»þ¤ËËöÈø¤Î¶õÇò¤¬ºï½ü¤µ¤ì¤Þ¤¹¡£
-@xref{Bugs}¡£
-@item
-¤¤¤¯¤Ä¤«¤Î¥±¡¼¥¹¤Ç¡¢@code{CHAR} ¥Õ¥£¡¼¥ë¥É¤ÏÌÛ¤Ã¤Æ @code{VARCHAR} ¥Õ¥£¡¼¥ë
-¥É¤ËÊѹ¹¤µ¤ì¤Þ¤¹¡£@xref{Silent column changes}¡£
-@item
-¥Æ¡¼¥Ö¥ë¤òºï½ü¤¹¤ë»þ¤Ë¡¢¥Æ¡¼¥Ö¥ë¤Ë¤Ä¤¤¤Æ¤Î¸¢¸Â¤Ï¼«Æ°Åª¤Ë¤ÏÇË´þ¤µ¤ì¤Þ¤»¤ó¡£
-¥Æ¡¼¥Ö¥ë¤Ë¤Ä¤¤¤Æ¤Î¸¢¸Â¤òÇË´þ¤¹¤ë¤Ë¤Ï¡¢ÌÀ¼¨Åª¤Ë @code{REVOKE} ¤òȯ¹Ô¤¹¤ëɬ
-Íפ¬¤¢¤ê¤Þ¤¹¡£@xref{GRANT, , @code{GRANT}}.
-@item
-@code{NULL AND FALSE} ¤Ï @code{FALSE} ¤Ç¤Ï¤Ê¤¯ @code{NULL} ¤Èɾ²Á¤µ¤ì¤Þ¤¹¡£
-¤³¤Î¥±¡¼¥¹¤Ç¡¢Â¿¤¯¤Î;·×¤Ê¾ò·ï¤òɾ²Á¤¹¤ëɬÍפ¬¤¢¤ë¤³¤È¤ÏÎɤ¤¤³¤È¤Ç¤Ï¤Ê¤¤¤È¡¢
-²æ¡¹¤Ï¹Í¤¨¤Æ¤¤¤ë¤«¤é¤Ç¤¹¡£
-@end itemize
-
-@node Missing functions, Standards, Differences from ANSI, Compatibility
-@section @strong{MySQL} ¤Ë̵¤¤µ¡Ç½
-
-¼¡¤Îµ¡Ç½¤¬ @strong{MySQL} ¤Î¸½ºß¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤Ï¤¢¤ê¤Þ¤»¤ó¡£¿·¤·¤¤³ÈÄ¥¤Î
-Í¥ÀèÅ٤ˤĤ¤¤Æ¤Ï¡¢¼¡¤ò»²¹Í¤Ë¤·¤Æ¤¯¤À¤µ¤¤
-@uref{http://www.mysql.com/Manual_chapter/manual_Todo.html, the
-@strong{MySQL} TODO list}¡£¤³¤ì¤Ï¤³¤Î¥Þ¥Ë¥å¥¢¥ëÃæ¤Î TODO ¥ê¥¹¥È¤ÎºÇ¿·¥Ð¡¼
-¥¸¥ç¥ó¤Ç¤¹¡£@xref{TODO}¡£
-
-@menu
-* Missing Sub-selects:: Sub-selects
-* Missing SELECT INTO TABLE:: @code{SELECT INTO TABLE}
-* Missing Transactions:: ¥È¥é¥ó¥¶¥¯¥·¥ç¥ó
-* Missing Triggers:: ¥È¥ê¥¬
-* Missing Foreign Keys:: Foreign Keys
-* Missing Views:: ¥Ó¥å¡¼
-* Missing comments:: ¥³¥á¥ó¥È³«»Ï¤È¤·¤Æ¤Î @samp{--}
-@end menu
-
-@node Missing Sub-selects, Missing SELECT INTO TABLE, Missing functions, Missing functions
-@subsection Sub-selects
-
-¼¡¤Ï @strong{MySQL} ¤Ç¤Ï¤Þ¤ÀƯ¤­¤Þ¤»¤ó:
-
-@example
-SELECT * FROM table1 WHERE id NOT IN (SELECT id FROM table2);
-@end example
-
-¤·¤«¤·Â¿¤¯¤Î¾ì¹ç¡¢sub select ¤ò»È¤ï¤Ê¤¤¥¯¥¨¥ê¤Ë½ñ¤­Ä¾¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹:
-
-@example
-SELECT table1.* FROM table1,table2 WHERE table1.id=table2.id;
-SELECT table1.* FROM table1 LEFT JOIN table2 ON table1.id=table2.id where table2.id IS NULL
-@end example
-
-¤µ¤é¤ËÊ£»¨¤Ê¥µ¥Ö¥¯¥¨¥ê¤Ç¤Ï¡¢¥µ¥Ö¥¯¥¨¥ê¤òÊÝ»ý¤¹¤ë¤¿¤á¤Ë°ì»þ¥Æ¡¼¥Ö¥ë¤òºîÀ®¤Ç
-¤­¤Þ¤¹¡£¤·¤«¤·¡¢¤³¤ÎÊýË¡¤Ç¤âÆ°¤«¤Ê¤¤¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£¤³¤Î¥±¡¼¥¹¤Ë¤Ï¡¢
-@code{DELETE} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ç¤â¤Ã¤È¤âÉÑÈˤËÁø¶ø¤·¤Þ¤¹¡£@code{DELETE} ¥¹¥Æ¡¼
-¥È¥á¥ó¥È¤Ç¤Ï¡¢É¸½à SQL ¤Ç¤Ï¡Êsub select ¤ÎÃæ¤ò½ü¤¤¤Æ¡Ëjoin ¤ò¥µ¥Ý¡¼¥È¤·¤Æ
-¤¤¤Þ¤»¤ó¡£¥µ¥Ö¥¯¥¨¥ê¤¬ @strong{MySQL} ¤Ë¥µ¥Ý¡¼¥È¤µ¤ì¤ë¤Þ¤Ç¡¢¤³¤Î¾õ¶·¤Ë¤Ï£²
-¤Ä¤ÎÁªÂò»è¤¬¤¢¤ê¤Þ¤¹¡£
-
-ºÇ½é¤ÎÁªÂò»è¤Ï¡¢¼ê³¤­¥×¥í¥°¥é¥ß¥ó¥°¸À¸ì¡ÊPerl ¤ä PHP ¤Î¤è¤¦¤Ê¡Ë¤ò»ÈÍѤ·¤Æ¡¢
-@code{SELECT} ¥¯¥¨¥ê¤òȯ¹Ô¤·¤Æºï½ü¤µ¤ì¤ë¥ì¥³¡¼¥É¤Î¥×¥é¥¤¥Þ¥ê¥­¡¼¤ò³ÍÆÀ¤·¡¢
-¤½¤ì¤«¤é @code{DELETE} ¥¹¥Æ¡¼¥È¥á¥ó¥È¡Ê@code{DELETE FROM ... WHERE
-... IN (key1, key2, ...)}¡Ë¤ò¹½ÃÛ¤¹¤ë¤¿¤á¤Ë¤½¤ÎÃͤò»ÈÍѤ¹¤ë¤³¤È¤Ç¤¹¡£
-
-ÆóÈÖÌܤÎÁªÂò»è¤Ï¡¢ÂÐÏ÷¿ SQL ¤ò»ÈÍѤ·¡¢@code{DELETE} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Î¥»¥Ã
-¥È¤ò¡Êɸ½à @code{||} ¥ª¥Ú¥ì¡¼¥¿¤ÎÂå¤ï¤ê¤Ë¡Ë@strong{MySQL} ³ÈÄ¥
-@code{CONCAT()} ¤ò»ÈÍѤ·¤Æ¡¢¼«Æ°Åª¤ËÁȤßΩ¤Æ¤ë¤³¤È¤Ç¤¹¡£Î㤨¤Ð:
-
-@example
-SELECT CONCAT('DELETE FROM tab1 WHERE pkid = ', tab1.pkid, ';')
- FROM tab1, tab2
- WHERE tab1.col1 = tab2.col2;
-@end example
-
-¤³¤Î¥¯¥¨¥ê¤ò¥¹¥¯¥ê¥×¥È¥Õ¥¡¥¤¥ëÃæ¤ËÃÖ¤­¡¢ÆþÎϤò @code{mysql} ¥³¥Þ¥ó¥É¥é¥¤¥ó
-¥¤¥ó¥¿¥×¥ê¥¿¤ËÀÚÂؤ¨¡¢¤½¤Î½ÐÎϤòÆóÈÖÌܤΥ¤¥ó¥¿¥×¥ê¥¿¥¤¥ó¥¹¥¿¥ó¥¹¤Ë¥Ñ¥¤¥×¤·
-¤Þ¤¹:
-
-@example
-prompt> mysql --skip-column-names mydb < myscript.sql | mysql mydb
-@end example
-
-@strong{MySQL} ¤Ï @code{INSERT ... SELECT ...} ¤È @code{REPLACE ...
-SELECT ...} ¤À¤±¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£ÆÈΩ¤·¤¿ sub-selects ¤Ï¤ª¤½¤é¤¯ 3.24.0
-¤ÇÍ­¸ú¤Ë¤Ê¤ê¤Þ¤¹¡£¤·¤«¤·º£¤Ï¾¤Îʸ̮Æâ¤Ç´Ø¿ô @code{IN()} ¤ò»ÈÍѤǤ­¤Þ¤¹¡£
-
-@node Missing SELECT INTO TABLE, Missing Transactions, Missing Sub-selects, Missing functions
-@subsection @code{SELECT INTO TABLE}
-
-@strong{MySQL} ¤Ï¤Þ¤À Oracle SQL extension:
-@code{SELECT ... INTO TABLE ...} ¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤»¤ó¡£
-@strong{MySQL} ¤Ï @code{INSERT INTO ... SELECT ...} ¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£
-¤³¤ì¤Ï´ðËÜŪ¤ËƱ¤¸¤³¤È¤Ç¤¹¡£
-
-Âå¤ï¤ê¤Ë¡¢@code{INSERT INTO ... SELECT ...} ¤ä @code{CREATE
-TABLE ... SELECT} ¤¬»ÈÍѤǤ­¤Þ¤¹¡£
-@xref{INSERT, , @code{INSERT}}.
-
-@node Missing Transactions, Missing Triggers, Missing SELECT INTO TABLE, Missing functions
-@subsection ¥È¥é¥ó¥¶¥¯¥·¥ç¥ó
-
-@strong{MySQL} ¤Ï¸½ºß¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤¿¤á¡¢¼¡¤ÎµÄÏÀ¤ÏÈó¥È¥é
-¥ó¥¶¥¯¥·¥ç¥ó°ÂÁ´¥Æ¡¼¥Ö¥ë·¿¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ë¤À¤±Í­¸ú¤Ç¤¹¡£@xref{COMMIT}¡£
-
-``¤Ê¤¼ @strong{MySQL} ¤Ï¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ç¤Ê¤¤¤Î¤«¡©'' ¤È¤«
-``¤Ê¤¼ @strong{MySQL} ¤Ï¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤ò¥µ¥Ý¡¼¥È¤·¤Ê¤¤¤Î¤«¡©''
-¤È¤¤¤Ã¤¿¼ÁÌ䤬¤·¤Ð¤·¤Ð¤Ê¤µ¤ì¤Þ¤¹¡£
-
-@strong{MySQL} ¤Ï¡¢¥Ç¡¼¥¿¤Î¼è¤ê°·¤¤¤ËÂФ·¡¢Â¾¤Î¥Ñ¥é¥À¥¤¥à¡¢
-``¥¢¥È¥ß¥Ã¥¯¡¦¥ª¥Ú¥ì¡¼¥·¥ç¥ó''¤ò¥µ¥Ý¡¼¥È¤¹¤ë»ö¤ò°Õ¿Þ¤·¤Æ·èÄꤷ¤Þ¤·¤¿¡£
-¥¢¥È¥ß¥Ã¥¯¡¦¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤¬Æ±Åù¤«¤¢¤ë¤¤¤Ï¤è¤êÎɤ¤¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤ò
-Ä󶡤¹¤ë¤È¤¤¤¦¤Î¤¬¡¢²æ¡¹¤Î·Ð¸³¡¢¤ª¤è¤Ó¹Í¤¨¤Ç¤¹¡£
-¤½¤ì¤Ç¤â¡¢²æ¡¹¤Ï¥È¥é¥ó¥¶¥¯¥·¥ç¥óŪ¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ñ¥é¥À¥¤¥à¤È¥×¥é¥ó¤òɾ²Á¤·¡¢
-Íý²ò¤·¤Æ¤¤¤Þ¤¹¡£¼¡¤Î¿ô¥ê¥ê¡¼¥¹¤Î¤¦¤Á¤Ë¡¢¥Æ¡¼¥Ö¥ëñ°Ì¤ò´ðËܤˡ¢¥È¥é¥ó¥¶¥¯¥·¥ç
-¥ó°ÂÁ´¥Æ¡¼¥Ö¥ë¤òƳÆþ¤·¤Þ¤¹¡£
-¤½¤Î»þ²æ¡¹¤Ï¡¢¥æ¡¼¥¶¡¼¤¬¡¢
-¥¹¥Ô¡¼¥É½Å»ë¤Ç¥¢¥È¥ß¥Ã¥¯¡¦¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤ò»ÈÍѤ¹¤ë¤Î¤«¡¢¤¢¤ë¤¤¤Ï
-¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤Îµ¡Ç½¤ò»È¤¦¤Î¤«¡¢
-¤ò¡¢ÁªÂò¤Ç¤­¤ë¤è¤¦¤Ë¤·¤è¤¦¤È¹Í¤¨¤Æ¤¤¤Þ¤¹¡£
-
-¸·Ì©¤Ë integrity °Ý»ý¤¹¤ë¤Ë¤Ï @strong{MySQL} ¤Îµ¡Ç½¤ò¤É¤Î¤è¤¦¤Ë»ÈÍѤ¹¤ë¤Î
-¤Ç¤·¤ç¤¦¡© ¤½¤·¤Æ¡¢¥È¥é¥ó¥¶¥¯¥·¥ç¥óŪ¥Ñ¥é¥À¥¤¥à¤Ç¤³¤ì¤é¤Îµ¡Ç½¤ò¤É¤Î¤è¤¦¤Ë
-Èæ³Ó¤¹¤ë¤Î¤Ç¤·¤ç¤¦¡©
-
-ºÇ½é¤Ë¡¢¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤Î¥Ñ¥é¥À¥¤¥à¤Ç¤Ï¡¢
-¤â¤·¡¢¤¢¤Ê¤¿¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬ ´ðËܤȤʤëÉôʬ¤Ç
-``commit'' ¤ÎÂå¤ï¤ê¤Ë ``rollback'' ¤Î¸Æ¤Ó½Ð¤·¤Ë°Í¸¤·¤Æ¤¤¤ë¤Ê¤é¡¢
-¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤Ï¤è¤êÊØÍø¤Ë¤Ê¤ë¤Ç¤·¤ç¤¦¡£
-¤ª¤Þ¤±¤Ë¡¢¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤Ï´°Î»¤Ç¤­¤Ê¤«¤Ã¤¿¹¹¿·¤äÉÔÀ°¹ç¤òµ¯¤³¤·¤¿
-¥Ç¡¼¥¿¤¬¡¢³Î¼Â¤Ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÅÐÏ¿¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¤Ç¤­¤Þ¤¹¡£
-¤½¤Î¥µ¡¼¥Ð¡¼¤Ë¤Ï¡¢¼«Æ°Åª¤Ê rollback ¤ò¤¹¤ëµ¡²ñ¤¬Í¿¤¨¤é¤ì¡¢
-¤¢¤Ê¤¿¤Î¥Ç¡¼¥¿¤Ï¼é¤é¤ì¤ë¤Ç¤·¤ç¤¦¡£
-
-@strong{MySQL} ¤Ï¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢¹¹¿·Á°¤Î´Êñ¤Ê¥Á¥§¥Ã¥¯¤ò´Þ¤Þ¤»¤ë¤³¤È¤¬¤Ç¤­¤¿¤ê¡¢
-¤¢¤ë¤¤¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÌ·½â¤ò¸¡ºº¤·¤Æ¼«Æ°½¤Éü¤ä·Ù¹ð¤Îɽ¼¨¤ò¹Ô¤Ã¤¿¤ê¤¹¤ë
-´Êñ¤Ê¥¹¥¯¥ê¥×¥È¤ò¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ê¡¢
-¥Ý¥Æ¥ó¥·¥ã¥ë¤ò¤¢¤Ê¤¿¤ËÄ󶡤·¤Þ¤¹¡£
-@strong{MySQL} ¥í¥°¤Î»ÈÍѤ䳰Éô¤Ø¤Î¥í¥°¤ÎÄɲäò¹Ô¤Ã¤¿¤ê¤¹¤ë»ö¤Ç¡¢
-Ä̾¥Ç¡¼¥¿¤ËÉÔÀ°¹ç¤Î¤ª¤­¤¿¥Æ¡¼¥Ö¥ë¤ò´°Á´¤Ë½¤Éü¤Ç¤­¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-¤µ¤é¤Ë¡¢``fatal'' transactional updates ¤Ï¥¢¥È¥ß¥Ã¥¯¤Ç½ñ¤­´¹¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¼ÂºÝ¡¢¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤¬²ò·è¤¹¤ëÁ´¤Æ¤Î integrity problems ¤Ï
- @code{LOCK TABLES} ¤ä atomic updates ¤ÇÃÖ¤­´¹¤¨¤ë¤³¤È¤¬½ÐÍè¡¢
-¤µ¤é¤Ë¤³¤ì¤Ï¡¢¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤¢¤ë°ìÈÌŪ¤ÊÌäÂê¤Ç¤¢¤ë¡¢
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¤Î¼«Æ°Åª¤ÊÃæÃǤòÆÀ¤ë¤³¤È̵¤·¤Ë¡¢²Äǽ¤Ê¤Ï¤º¤Ç¤¹¡£
-In fact,we will go so far as to say that all integrity problems
-that transactions solve can be done with @code{LOCK TABLES} or atomic updates,
-ensuring that you never will get an automatic abort from the database,
-which is a common problem with transactional databases.
-
-¤â¤·¥µ¡¼¥Ð¡¼¤¬¥À¥¦¥ó¤¹¤ì¤Ð¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤Ç¤âÁ´¤Æ¤ò¼º¤¦¤³¤È¤òÁ˻ߤǤ­¤Þ¤»¤ó¡£
-¤³¤Î¾ì¹ç¡¢¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤Î¥·¥¹¥Æ¥à¤Ç¤â¥Ç¡¼¥¿¤òÁ´¤Æ¼º¤¦¤Ç¤·¤ç¤¦¡£
-The difference
-between different systems lies in just how small the time-lap is where
-they could lose data. No system is 100% secure, only ``secure
-enough''. Even Oracle, reputed to be the safest of transactional
-databases, is reported to sometimes lose data in such situations.
-
-@strong{MySQL} ¤ò°ÂÁ´¤Ë¤¹¤ë¤Ë¤Ï¡¢¥Ð¥Ã¥¯¥¢¥Ã¥×¤ò¼è¤ë¤³¤È¤È¡¢
-¹¹¿·¥í¥°¤òÍ­¸ú¤Ë¤¹¤ë¤³¤È¤À¤±¤Ç¤¹¡£
-¤³¤ì¤Ç¡¢¤¢¤Ê¤¿¤¬Â¾¤Î¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤ò»ý¤Ä¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ç¹Ô¤Ã¤Æ¤¤¤ë¤è¤¦¤Ê
-¤¤¤«¤Ê¤ë¾ìÌ̤Ǥν¤Éü¤¬²Äǽ¤Ç¤¹¡£
-¤â¤Á¤í¤ó¡¢¥Ð¥Ã¥¯¥¢¥Ã¥×¤ò¤È¤ë¤³¤È¤Ï¡¢¤É¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò»ÈÍѤ·¤Æ¤¤¤ë¤«¤Ë
-´Ø¤ï¤é¤º¡¢¾ï¤ËÎɤ¤¤³¤È¤Ç¤¹¡£
-
-The transactional paradigm has its benefits and its drawbacks. Many
-users and application developers depend on the ease with which they can
-code around problems where an ``abort'' appears or is necessary, and they
-may have to do a little more work with @strong{MySQL} to either think
-differently or write more. If you are new to the atomic operations
-paradigm, or more familiar or more comfortable with transactions, do not
-jump to the conclusion that @strong{MySQL} has not addressed these
-issues. Reliability and integrity are foremost in our minds. Recent
-estimates are that there are more than 1,000,000 mysqld servers
-currently running, many of which are in production environments. We
-hear very, very seldom from our users that they have lost any data, and
-in almost all of those cases user error is involved. This is in our
-opinion the best proof of @strong{MySQL}'s stability and reliability.
-
-Lastly, in situations where integrity is of highest importance,
-@strong{MySQL}'s current features allow for transaction-level or better
-reliability and integrity. If you lock tables with @code{LOCK TABLES}, all
-updates will stall until any integrity checks are made. If you only obtain
-a read lock (as opposed to a write lock), then reads and inserts are
-still allowed to happen. The new inserted records will not be seen by
-any of the clients that have a READ lock until they relaease their read
-locks. With INSERT DELAYED you can queue insert into a local queue,
-until the locks are released, without having to have the client to wait
-for the insert to complete.
-
-``Atomic'', in the sense that we mean it is nothing magical, it only means
-that you can be sure that while each specific update is running no other
-user can interfere with it and that there will never be an automatic
-rollback (which can happen on transaction based systems if you are not
-very careful). @strong{MySQL} also guarantees that there will not be
-any dirty reads.
-
-We have thought quite a bit about integrity and performance and we
-believe that our atomic operations paradigm allows for both high
-reliability and extremely high performance, on the order of three to
-five times the speed of the fastest and most optimally tuned of
-transactional databases. We didn't leave out transactions because they
-are hard to do; The main reason we went with atomic operations as
-opposed to transactions is that by doing this we could apply many speed
-optimizations that would not otherwise have been possible.
-
-Many of our users who have speed foremost in their minds are not at all
-concerned about transactions. For them transactions are not an
-issue. For those of our users who are concerned with or have wondered
-about transactions vis a vis @strong{MySQL}, there is a ``@strong{MySQL}
-way'' as we have outlined above. For those where safety is more important
-than speed, we recommend them to use the @code{BDB} tables for all their
-critical data. @xref{BDB}.
-
-One final note: we are currently working on a safe replication schema
-that we believe to be better than any commercial replication system we
-know of. This system will work most reliably under the atomic
-operations, non-transactional, paradigm. Stay tuned.
-
-@node Missing Triggers, Missing Foreign Keys, Missing Transactions, Missing functions
-@subsection ¥¹¥È¥¢¥É¥×¥í¥·¥¸¥ã¤È¥È¥ê¥¬
-
-¥¹¥È¥¢¥É¥×¥í¥·¥¸¥ã¤Ï¡¢¥µ¡¼¥ÐÆâ¤Ç¥³¥ó¥Ñ¥¤¥ë¤Ç¤­³ÊǼ¤Ç¤­¤ë SQL ¥³¥Þ¥ó¥É¤Î
-¥»¥Ã¥È¤Ç¤¹¡£°ìÅÙ¤³¤ì¤¬¹Ô¤Ê¤ï¤ì¤ë¤È¡¢¥¯¥é¥¤¥¢¥ó¥È¤Ï¥¯¥¨¥êÁ´ÂΤκÆȯ¹Ô¤òÊÝ
-»ý¤¹¤ëɬÍפ¬¤Ê¤¯¡¢¥¹¥È¥¢¥É¥×¥í¥·¥¸¥ã¤ò»²¾È¤Ç¤­¤Þ¤¹¡£¤³¤ì¤Ï¤µ¤é¤Ë¤è¤ê®¤¤Â®ÅÙ¤òÄó
-¶¡¤·¤Þ¤¹¡£¥¯¥¨¥ê¤Ï°ìÅÙ¤À¤±²ò¼á¤µ¤ì¡¢¤è¤ê¾¯¤Ê¤¤¥Ç¡¼¥¿¤¬¥µ¡¼¥Ð¤È¥¯¥é¥¤¥¢¥ó
-¥È´Ö¤ÇÁ÷¿®¤µ¤ì¤ë¤«¤é¤Ç¤¹¡£¥µ¡¼¥ÐÆâ¤Ë´Ø¿ô¥é¥¤¥Ö¥é¥ê¤ò»ý¤Ä¤³¤È¤Ë¤è¤ê³µÇ°¥ì
-¥Ù¥ë¤ò¾å¤²¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
-
-¥È¥ê¥¬¤ÏÆÃÊ̤ʥ¤¥Ù¥ó¥È¤¬È¯À¸¤·¤¿»þ¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¥¹¥È¥¢¥É¥×¥í¥·¥¸¥ã¤Ç¤¹¡£
-Î㤨¤Ð¡¢¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¥Æ¡¼¥Ö¥ë¤«¤é¥ì¥³¡¼¥É¤¬ºï½ü¤µ¤ì¤ëÅ٤˥ȥꥬ¤µ¤ì¡¢
-¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤¬ºï½ü¤µ¤ì¤¿»þ¤Ë¼«Æ°Åª¤ËÂбþ¤¹¤ë¸ÜµÒ¤ò¸ÜµÒ¥Æ¡¼¥Ö¥ë¤«¤éºï
-½ü¤¹¤ë¤È¤¤¤¦¥¹¥È¥¢¥É¥×¥í¥·¥¸¥ã¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-·×²è¤µ¤ì¤Æ¤¤¤ë¸À¸ì¤Î¹¹¿·¤Ï¥¹¥È¥¢¥É¥×¥í¥·¥¸¥ã¤ò½èÍý¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¤¬¡¢
-¥È¥ê¥¬¤Ï½ü¤­¤Þ¤¹¡£¥È¥ê¥¬¤ÏÄ̾ïÁ´¤Æ¤ò¡¢¤½¤ì¤é¤òɬÍפȤ·¤Ê¤¤¥¯¥¨¥ê¤Ç¤µ¤¨¤â
-ÃÙ¤¯¤·¤Þ¤¹¡£
-
-@strong{MySQL} ¤¬¥¹¥È¥¢¥É¥×¥í¥·¥¸¥ã¤òÆÀ¤ë»þ¤òÃΤë¤Ë¤Ï¡¢@ref{TODO} ¤ò»²¾È
-¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@node Missing Foreign Keys, Missing Views, Missing Triggers, Missing functions
-@subsection ³°Éô¥­¡¼
-
-Ãí°Õ: SQL ¤Î³°Éô¥­¡¼¤Ï¥Æ¡¼¥Ö¥ë¤ò·ë¹ç¤¹¤ë¤¿¤á¤Ë¤Ï»ÈÍѤǤ­¤Þ¤»¤ó¤¬¡¢»Ø¼¨¤Î
-´°Á´À­¤Î¸¡ºº¤Î¤¿¤á¤ËÎɤ¯»ÈÍѤµ¤ì¤Þ¤¹¡£@code{SELECT} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤ÇÊ£¿ô
-¥Æ¡¼¥Ö¥ë¤«¤é·ë²Ì¤òÆÀ¤¿¤¤¾ì¹ç¡¢¥Æ¡¼¥Ö¥ë¤Î·ë¹ç¤Ë¤è¤Ã¤Æ¤³¤ì¤ò¹Ô¤Ê¤¤¤Þ¤¹¡ª
-
-@example
-SELECT * from table1,table2 where table1.id = table2.id;
-@end example
-@xref{JOIN, , @code{JOIN}}. @xref{example-Foreign keys}.
-
-@strong{MySQL} Æâ¤Ç¤Î @code{FOREIGN KEY} ¹½Ê¸¤Ï¡¢Â¾¤Î SQL ¥Ù¥ó¥À¤Î
-@code{CREATE TABLE} ¥³¥Þ¥ó¥É¤È¤Î¸ß´¹¤Î¤¿¤á¤À¤±¤Ë¸ºß¤·¤Þ¤¹; ¤³¤ì¤Ï²¿¤â¹Ô
-¤Ê¤¤¤Þ¤»¤ó¡£@code{ON DELETE ...} ¤¬¤Ê¤¤ @code{FOREIGN KEY} ¹½Ê¸¤Ï¡¢ÌÜŪ
-¤ÎºîÀ®¤Î¤¿¤á¤Ë¼ç¤Ë»È¤ï¤ì¤Þ¤¹¡£¤¤¤¯¤Ä¤«¤Î ODBC ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢¼«Æ°Åª
-¤Ë @code{WHERE} Àá¤òÄ󶡤¹¤ë¤¿¤á¤Ë¡¢¤³¤ì¤ò»ÈÍѤ·¤Þ¤¹¤¬¡¢¤·¤«¤·¤³¤ì¤ÏÄ̾ï
-´Êñ¤Ë̵¸ú¤Ë¤Ç¤­¤Þ¤¹¡£@code{FOREIGN KEY} ¤Ï»þ¡¹¶¯À©¥Á¥§¥Ã¥¯¤È¤·¤Æ»ÈÍѤµ
-¤ì¤Þ¤¹¡£¤·¤«¤·¡¢¥Æ¡¼¥Ö¥ë¤ËÀµ¤·¤¤½ç¤Ç¹Ô¤¬ÁÞÆþ¤µ¤ì¤ë¾ì¹ç¡¢¤³¤Î¥Á¥§¥Ã¥¯¤Ï¼Â
-ºÝ¤Ë¤ÏÉÔÍפǤ¹¡£¤¤¤¯¤Ä¤«¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¤½¤ì¤¬Â¸ºß¤¹¤ë¤³¤È¤òÍ׵᤹¤ë
-¤¿¤á @strong{MySQL} ¤Ï¤³¤ì¤é¤ÎÀá¤À¤±¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡Ê¤½¤ì¤¬Æ°ºî¤¹¤ë¤«¤É
-¤¦¤«¤Ë´Ø¤ï¤é¤º¡ª¡Ë¡£
-
-@strong{MySQL} ¤Ç¤Ï¡¢³°Éô¥­¡¼¤ò»ý¤Ä¥Æ¡¼¥Ö¥ë¤«¤é¥ì¥³¡¼¥É¤òºï½ü¤¹¤ë»þ¤ËŬ
-ÀÚ¤Ê @code{DELETE} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ËÄɲ乤뤳¤È¤Ç¡¢
-@code{ON DELETE ...} ¤¬¼ÂÁõ¤µ¤ì¤Æ¤¤¤Ê¤¤¤È¤¤¤¦ÌäÂê¤ò²óÈò¤Ç¤­¤Þ¤¹¡£¼ÂºÝ¤Ë
-¤Ï¡¢¤³¤ì¤Ï®¤¯(¤¤¤¯¤Ä¤«¤Î¾ì¹ç¤Ï¤è¤ê®¤¯)¤½¤·¤Æ³°Éô¥­¡¼¤Î»ÈÍѤè¤ê¤â¤µ¤é¤Ë
-²ÄÈÂÀ­¤¬¤¢¤ê¤Þ¤¹¡£
-
-¶á¤¤¾­Íè¡¢¾¯¤Ê¤¯¤È¤â¾ðÊó¤¬Êݸ¤µ¤ì¡¢¤½¤·¤Æ @code{mysqldump} ¤È ODBC ¤Ë¤è¤Ã
-¤Æ¼è¤ê½Ð¤µ¤ì¤ë¤è¤¦¤Ë¡¢²æ¡¹¤Ï @code{FOREIGN KEY} ¼ÂÁõ¤ò³ÈÄ¥¤·¤Þ¤¹¡£
-
-@menu
-* Broken Foreign KEY:: ³°Éô¥­¡¼¤ò»ÈÍѤ·¤Ê¤¤Íýͳ
-@end menu
-
-@node Broken Foreign KEY, , Missing Foreign Keys, Missing Foreign Keys
-@subsubsection ³°Éô¥­¡¼¤ò»ÈÍѤ·¤Ê¤¤Íýͳ
-
-²æ¡¹¤¬¤É¤³¤«¤é»Ï¤á¤ë¤Î¤«¤ï¤«¤é¤Ê¤¤ @code{FOREIGN KEY} ¤Ë¤Ï¿¤¯¤ÎÌäÂ꤬¤¢
-¤ê¤Þ¤¹:
-
-@itemize @bullet
-@item
-³°Éô¥­¡¼¤Ï¿ÍÀ¸¤ò¤È¤Æ¤âÊ£»¨¤Ë¤·¤Þ¤¹¡£³°Éô¥­¡¼ÄêµÁ¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë³ÊǼ¤·¤Ê
-¤±¤ì¤Ð¤Ê¤é¤º¡¢¤½¤ì¤Î¼ÂÁõ¤Ï°ÜÆ°¡¢¥³¥Ô¡¼¡¢ºï½ü¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ¹¤ë¤È¤¤
-¤¦ ``Îɤ¤¥¢¥×¥í¡¼¥Á'' Á´¤Æ¤òÇË´þ¤¹¤ë¤«¤é¤Ç¤¹¡£
-
-@item
-@code{INSERT} ¤È @code{UPDATE} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ø¤Î®Å٤αƶÁ¤Ï¤â¤Î¤¹¤´¤¯¡¢
-¤½¤·¤Æ¤³¤Î¾ì¹ç¡¢¤Û¤È¤ó¤ÉÁ´¤Æ¤Î @code{FOREIGN KEY} ¥Á¥§¥Ã¥¯¤ÏÌò¤ËΩ¤Á¤Þ¤»
-¤ó¡£Ä̾ï¤Ï¡¢Àµ¤·¤¤¥Æ¡¼¥Ö¥ë¤ËÀµ¤·¤¤½ç¤Ç¥ì¥³¡¼¥É¤òÁÞÆþ¤¹¤ë¤¿¤á¤Ç¤¹¡£
-
-@item
-°ì¤Ä¤Î¥Æ¡¼¥Ö¥ë¤Î¹¹¿·»þ¤Ë¤â¤Ã¤È¿¤¯¤Î¥Æ¡¼¥Ö¥ë¾å¤Ç¥í¥Ã¥¯¤òÊÝ»ý¤¹¤ëɬÍפ⤢
-¤ê¤Þ¤¹¡£ÉûºîÍѤ¬¥Ç¡¼¥¿¥Ù¡¼¥¹Á´ÂΤòÄ̤·¤ÆȯÀ¸¤¹¤ë¤«¤é¤Ç¤¹¡£¤Þ¤º°ì¤Ä¤Î¥Æ¡¼
-¥Ö¥ë¤«¤é¥ì¥³¡¼¥É¤òºï½ü¤·¤Æ¡¢¤½¤ì¤«¤é¾¤Î¥Æ¡¼¥Ö¥ë¤«¤é¤½¤ì¤é¤òºï½ü¤¹¤ë¤Û¤¦
-¤¬¤È¤Æ¤â®¤¤¤Ç¤¹¡£
-
-@item
-¥Æ¡¼¥Ö¥ë¤«¤é´°Á´¤Êºï½ü¤ò¹Ô¤Ê¤Ã¤Æ¤«¤éÁ´¤Æ¤Î¥ì¥³¡¼¥É¤ò¡Ê¿·¤·¤¤¥½¡¼¥¹¤ä¥Ð¥Ã
-¥¯¥¢¥Ã¥×¤«¤é¡Ë¥ê¥¹¥È¥¢¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢¥Æ¡¼¥Ö¥ë¤òÉü¸µ¤¹¤ë¤³¤È¤Ï¤â¤¦¤Ç¤­
-¤Þ¤»¤ó¡£
-
-@item
-³°Éô¥­¡¼¤ò»ý¤Ä¾ì¹ç¡¢¥Æ¡¼¥Ö¥ë¤Î¥À¥ó¥×¤È¥ê¥¹¥È¥¢¤ÏÆÃÄê¤Î½ç¤Ë¹Ô¤Ê¤ï¤Ê¤¤¤È¤Ç
-¤­¤Þ¤»¤ó¡£
-
-@item
-°ì²ó¤Î create ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ç³Æ¥Æ¡¼¥Ö¥ë¤òºÆÀ¸À®¤¹¤ë¤³¤È¤ò¥Æ¡¼¥Ö¥ë¤Ë¤Ç¤­
-¤Ê¤¯¤¹¤ë¤è¤¦¤Ê ``µö¤µ¤ì¤¿'' ½ä²óÄêµÁ¤ò¹Ô¤Ê¤¦¤³¤È¤Ï¤È¤Æ¤â´Êñ¤Ç¤¹¡£¤½¤ÎÄê
-µÁ¤¬Æ°ºî¤·¤Æ»ÈÍѤǤ­¤¿¤È¤·¤Æ¤â¤Ç¤¹¡£
-@end itemize
-
-³°Éô¥­¡¼¤ÎÎɤ¤Ì̤ϡ¢ODBC ¤È¾¤Î¤¤¤¯¤Ä¤«¤Î¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤Ë¡¢¤É¤Î
-¤è¤¦¤Ë¥Æ¡¼¥Ö¥ë¤¬Àܳ¤µ¤ì¤ë¤«¤ò¸«¤ëµ¡Ç½¤òÍ¿¤¨¡¢¤³¤ì¤ò»ÈÍѤ·¤ÆÀܳ¿Þ¤ò¼¨¤·¡¢
-À¸À®¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¼ê½õ¤±¤ò¤¹¤ë¤³¤È¤À¤±¤Ç¤¹¡£
-
-@strong{MySQL} ¤Ï´Ö¤â¤Ê¤¯¡¢¥¯¥é¥¤¥¢¥ó¥È¤¬¤É¤Î¤è¤¦¤Ë¥ª¥ê¥¸¥Ê¥ëÀܳ¤¬ºîÀ®
-¤µ¤ì¤¿¤«¤òÌ䤤¹ç¤ï¤»¡¢²óÅú¤ò¼õ¤±¤é¤ì¤ë¤è¤¦¤Ë @code{FOREIGN KEY} ÄêµÁ¤ò³Ê
-Ǽ¤·¤Þ¤¹¡£¸½ºß¤Î @file{.frm} ¥Õ¥¡¥¤¥ë·Á¼°¤Ë¤Ï¤½¤ì¤òÃÖ¤¯¾ì½ê¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-
-@node Missing Views, Missing comments, Missing Foreign Keys, Missing functions
-@subsection ¥Ó¥å¡¼
-
-@strong{MySQL} ¤Ï¥Ó¥å¡¼¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤»¤ó¡£¤·¤«¤·¤³¤ì¤Ï TODO ¤Ë¤¢¤ê¤Þ¤¹¡£
-
-@node Missing comments, , Missing Views, Missing functions
-@subsection ¥³¥á¥ó¥È³«»Ï¤È¤·¤Æ¤Î @samp{--}
-
-¾¤Î¤¤¤¯¤Ä¤«¤Î SQL ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ï¡¢@samp{--} ¤ò¥³¥á¥ó¥È¤Î³«»Ï¤Î¤¿¤á¤Ë»È
-ÍѤ·¤Þ¤¹¡£@strong{MySQL} ¤Ï @samp{#} ¤ò¥³¥á¥ó¥È³«»Ïʸ»ú¤È¤·¤Þ¤¹¡£
-@code{mysql} ¥³¥Þ¥ó¥É¥é¥¤¥ó¥Ä¡¼¥ë¤¬ @samp{--} ¤Ç»Ï¤Þ¤ëÁ´¤Æ¤Î¹Ô¤òºï½ü¤·¤¿
-¤È¤·¤Æ¤â¤Ç¤¹¡£@strong{MySQL} ¤Ç¤Ï C ¥³¥á¥ó¥È¥¹¥¿¥¤¥ë @code{/* ¤³¤ì¤Ï¥³¥á
-¥ó¥È */} ¤â»ÈÍѤǤ­¤Þ¤¹¡£@xref{Comments}¡£
-
-@strong{MySQL} 3.23.3 °Ê¾å¤Ï @samp{--} ¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤»¤ó; ¤³¤ÎÂಽ¤·¤¿¥³¥á¥ó¥È¥¹¥¿
-¥¤¥ë¤Ï¡¢¼¡¤Î¥³¡¼¥É¤Î¤è¤¦¤Ë @code{!payment!} ¤Î payment ¤ÎÃͤò¼«Æ°Åª¤ËÁÞ
-Æþ¤¹¤ë¤è¤¦¤Ê²¿¤«¤ò»ÈÍѤ·¤Æ¼«Æ°Åª¤ËÀ¸À®¤µ¤ì¤ë SQL ¥¯¥¨¥ê¤Ç¿¤¯¤ÎÌäÂê¤ò°ú
-¤­µ¯¤³¤¹¤¿¤á¤Ç¤¹:
-
-@example
-UPDATE tbl_name SET credit=credit-!payment!
-@end example
-
-@code{payment} ¤ÎÃͤ¬Éé¤Î¾ì¹ç¤Ë²¿¤¬µ¯¤­¤ë¤È»×¤¤¤Þ¤¹¤«¡©
-
-@code{1--1} ¤ÏÀµ¤·¤¤ SQL ¤Ê¤Î¤Ç¡¢²æ¡¹¤Ï @samp{--} ¤ò¥³¥á¥ó¥È³«»Ï¤È¸«¤Ê¤¹
-¤³¤È¤Ï¤Ò¤É¤¤¤³¤È¤À¤È»×¤¤¤Þ¤¹¡£
-
-¤·¤«¤· @strong{MySQL} 3.23 ¤Ç¤Ï¼¡¤ò»ÈÍѤǤ­¤Þ¤¹: @code{1-- ¤³¤ì¤Ï¥³¥á¥ó¥È}
-
-°Ê¹ß¤ÎÀâÌÀ¤Ç¤Ï¡¢3.23 ¤è¤ê¤âÁ°¤Î @strong{MySQL} ¥Ð¡¼¥¸¥ç¥ó¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¾ì
-¹ç¤À¤±¤¬ÂоݤǤ¹:
-
-¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Î SQL ¥×¥í¥°¥é¥à¤¬ @samp{--} ¥³¥á¥ó¥È¤ò´Þ¤ó¤Ç¤¤¤ë¾ì¹ç¡¢
-¼¡¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¹:
-
-@example
-shell> replace " --" " #" < text-file-with-funny-comments.sql \
- | mysql database
-@end example
-
-Ä̾ï¤Î¼¡¤ÎÂå¤ï¤ê¤Ë:
-
-@example
-shell> mysql database < text-file-with-funny-comments.sql
-@end example
-
-¼¡¤ÎÊýË¡¤Ç¤â¡¢¥³¥Þ¥ó¥É¥Õ¥¡¥¤¥ëÃæ¤Î @samp{--} ¥³¥á¥ó¥È¤ò @samp{#} ¥³¥á¥ó
-¥È¤ËÊѹ¹¤Ç¤­¤Þ¤¹:
-
-@example
-shell> replace " --" " #" -- text-file-with-funny-comments.sql
-@end example
-
-¤½¤ì¤é¤Ï¼¡¤Î¥³¥Þ¥ó¥É¤ÇÌᤷ¤Æ¤¯¤À¤µ¤¤:
-
-@example
-shell> replace " #" " --" -- text-file-with-funny-comments.sql
-@end example
-
-@node Standards, Commit-rollback, Missing functions, Compatibility
-@section @strong{MySQL} ¤¬½àµò¤·¤Æ¤¤¤ëɸ½à
-
-Entry level SQL92. ODBC level 0-2.
-
-@node Commit-rollback, , Standards, Compatibility
-@section @code{COMMIT}/@code{ROLLBACK} ¤Ê¤·¤Ç¤¦¤Þ¤¯¤ä¤ëÊýË¡
-
-The following mostly apply only for @code{ISAM}, @code{MyISAM} and
-@code{HEAP} tables; If you only use transaction safe tables (@code{BDB}
-tables) in an a update you can do @code{COMMIT} and @code{ROLLBACK} also
-with @code{MySQL}. @xref{COMMIT}.
-
-The problem with handling @code{COMMIT}-@code{ROLLBACK} efficiently with
-the above table types would require a completely different table layout
-than @strong{MySQL} uses today.
-¤³¤Î·¿¤Î¥Æ¡¼¥Ö¥ë¤Ï¡¢¼«Æ°Åª¤Ë¥Æ¡¼¥Ö¥ë¤ò¥¯¥ê¡¼¥ó¥¢¥Ã¥×¤¹¤ë³ÈÄ¥¥¹¥ì¥Ã¥É¤âɬÍ×
-¤È¤·¡¢¥Ç¥£¥¹¥¯»ÈÍÑÎ̤Ϥµ¤é¤ËÂ礭¤¯¤Ê¤ê¤Þ¤¹¡£ ¤³¤ì¤Ï @strong{MySQL} ¤ò¸½ºß
-¤è¤ê¤â 2¡Á4 ÇÜÃÙ¤¯¤·¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
-
-º£¡¢²æ¡¹¤Ï SQL ¥µ¡¼¥Ð¸À¸ì(¥¹¥È¥¢¥É¥×¥í¥·¥¸¥ã¤Î¤è¤¦¤Ê¤â¤Î)¤Î¼ÂÁõ¤Ë¤µ¤é¤Ë
-»¿À®¤Ç¤¹¡£¤³¤ì¤Ç¡¢ËÜÅö¤Ë @code{COMMIT}-@code{ROLLBACK} ¤òɬÍפȤ¹¤ë¤Î¤Ï
-¤á¤Ã¤¿¤Ë¤¢¤ê¤Þ¤»¤ó¡£¤³¤ì¤Ï¤µ¤é¤ËÎɤ¤À­Ç½¤âÍ¿¤¨¤ë¤Ç¤·¤ç¤¦¡£
-
-¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤òɬÍפȤ¹¤ë¥ë¡¼¥×¤Ï¡¢Ä̾ï¤Ï @code{LOCK TABLES} ¤Î½õ¤±¤Ç
-¥³¡¼¥É²½¤Ç¤­¡¢¤½¤·¤Æ fly ¾å¤Ç¥ì¥³¡¼¥É¤Î¹¹¿·»þ¤Ë¤Ï¥«¡¼¥½¥ë¤ÏɬÍפȤ·¤Þ¤»
-¤ó¡£
-
-²æ¡¹ TcX ¤ÇËÜÅö¤ËɬÍפȤ·¤Æ¤¤¤ë¤Î¤Ï¡¢100% ɸ½à¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ç¤Ï¤Ê¤¯¤Æ¡¢
-ËÜÅö¤Ë®¤¤¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ç¤¹¡£Â®ÅÙÄã²¼¤Ê¤·¤Ç¤½¤ì¤é¤Îµ¡Ç½¤ò¼ÂÁõ¤¹¤ëÊýË¡¤ò¸«¤Ä¤±¤¿
-¤È¤­¤Ë¤Ï¡¢²æ¡¹¤Ï¤½¤ì¤ò¹Ô¤Ê¤¦¤Ç¤·¤ç¤¦¡£¤·¤Ð¤é¤¯¤Ï¹Ô¤Ê¤¦¤Ù¤­¤µ¤é¤Ë½ÅÍפʤ³
-¤È¤¬Â¿¤¯¤¢¤ê¤Þ¤¹¡£º£¤Î²æ¡¹¤ÎÍ¥ÀèÅ٤ˤĤ¤¤Æ¤Ï TODO ¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£
-¹â¥ì¥Ù¥ë¤Î¥µ¥Ý¡¼¥È¤ò»ý¤Ä¸ÜµÒ¤Ï¤³¤ì¤òÊѤ¨¤ë¤³¤È¤¬¤Ç¤­¡¢ºÆ¤ÓÍ¥Àè½ç°Ì¤Å¤±¤¬
-¹Ô¤Ê¤ï¤ì¤Þ¤¹¡£
-
-¸½ºß¤ÎÌäÂê¤Ï¼ÂºÝ¤Ë¤Ï @code{ROLLBACK} ¤Ç¤¹¡£@code{ROLLBACK} ¤Ê¤·¤Ç¤â
-@code{LOCK TABLES} ¤Ç @code{COMMIT} ¥¢¥¯¥·¥ç¥ó¤Î¤¤¤¯¤Ä¤«¤Î¼ïÎà¤ò¹Ô¤Ê¤¦¤³
-¤È¤¬¤Ç¤­¤Þ¤¹¡£@code{ROLLBACK} ¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¹¹¿·¤µ¤ì¤ëÁ´¤Æ¤Î¸Å
-¤¤¥ì¥³¡¼¥É¤ò³ÊǼ¤·¡¢@code{ROLLBACK} ¤¬È¯¹Ô¤µ¤ì¤¿¾ì¹ç¤Ë³«»Ï°ÌÃÖ¤ËÁ´¤Æ¤òÌá
-¤¹¤è¤¦¤Ë¡¢@strong{MySQL} ¤òÊѹ¹¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£Ã±½ã¤Ê¾ì¹ç¤Ë¤Ï¡¢¤³
-¤ì¤ò¹Ô¤Ê¤¦¤Ë¤ÏÆñ¤·¤¯¤¢¤ê¤Þ¤»¤ó(¸½ºß¤Î @code{isamlog} ¤ò¤³¤ÎÌÜŪ¤Ë»ÈÍѤ·
-¤Þ¤¹)¡£¤·¤«¤·¡¢@code{ALTER/DROP/CREATE TABLE} ¤Ç¤Î @code{ROLLBACK} ¤Î¼Â
-Áõ¤ò¹Ô¤¦¤³¤È¤Ï¤È¤Æ¤âº¤Æñ¤Ç¤¹¡£
-
-@code{ROLLBACK} ¤Î»ÈÍѤβóÈò¤Î¤¿¤á¤Ë¡¢¼¡¤ÎÊýË¡¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹:
-
-@enumerate
-@item
-@code{LOCK TABLES ...} ¤ò¥¢¥¯¥»¥¹¤·¤¿¤¤¥Æ¡¼¥Ö¥ë¤ÎÁ´¤Æ¤ò¥í¥Ã¥¯¤¹¤ë¤¿¤á¤Ë
-»ÈÍѤ·¤Þ¤¹
-@item
-¾ò·ï¤Î¥Æ¥¹¥È¡£
-@item
-Á´¤Æ OK ¤Ê¤é¹¹¿·¡£
-@item
-@code{UNLOCK TABLES} ¤ò¥í¥Ã¥¯¤Î²ò½ü¤Ë»ÈÍѤ·¤Þ¤¹
-@end enumerate
-
-¤³¤ì¤ÏÉáÄÌ¤Ï @code{ROLLBACK} ²Äǽ¤Ê¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤Î»ÈÍѤè¤ê¤â®¤¤¤Ç¤¹
-¤¬¡¢¾ï¤Ë¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£¤³¤Î²ò¤¬½èÍý¤Ç¤­¤Ê¤¤¾õ¶·¤Ï¡¢¹¹¿·Ãæ¤Ë狼¤¬¥¹¥ì¥Ã
-¥É¤ò kill ¤¹¤ë»þ¤À¤±¤Ç¤¹¡£¤³¤Î¾ì¹ç¡¢Á´¤Æ¤Î¥í¥Ã¥¯¤Ï¥ê¥ê¡¼¥¹¤µ¤ì¤Þ¤¹¤¬¡¢¤¤
-¤¯¤Ä¤«¤Î¹¹¿·¤Ï¼Â¹Ô¤µ¤ì¤Þ¤»¤ó¡£
-
-1²ó¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥óÃæ¤Ç¥ì¥³¡¼¥É¤ò¹¹¿·¤¹¤ë´Ø¿ô¤â»ÈÍѤǤ­¤Þ¤¹¡£¼¡¤Î¥Æ¥¯¥Ë¥Ã¥¯
-¤Ë¤è¤Ã¤Æ¤È¤Æ¤â¸úΨŪ¤Ê¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@itemize @bullet
-@item
-¥Õ¥£¡¼¥ë¥É¤ò¸½ºß¤ÎÃͤÈÈæ³Ó¤·¤ÆÊѹ¹¤¹¤ë
-
-@item
-¼ÂºÝ¤ËÊѹ¹¤µ¤ì¤¿¥Õ¥£¡¼¥ë¥É¤À¤±¤ò¹¹¿·¤¹¤ë
-@end itemize
-
-Î㤨¤Ð¡¢¤¤¤¯¤Ä¤«¤Î¸ÜµÒ¾ðÊó¤Ç¹¹¿·¤ò¹Ô¤Ê¤Ã¤Æ¤¤¤ë»þ¡¢²æ¡¹¤ÏÊѹ¹¤µ¤ì¤¿¸ÜµÒ¥Ç¡¼
-¥¿¤À¤±¤ò¹¹¿·¤·¡¢Êѹ¹¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ç¡¼¥¿¤Ï¥Æ¥¹¥È¤»¤º¡¢Êѹ¹¤µ¤ì¤¿¥Ç¡¼¥¿¤Ë°Í
-¸¤·¤ÆÊѹ¹¤µ¤ì¤¿¥Ç¡¼¥¿¤¬¥ª¥ê¥¸¥Ê¥ë¤Î¹Ô¤ÈÈæ³Ó¤µ¤ì¤Þ¤¹¡£Êѹ¹¤Î¥Æ¥¹¥È¤Ï
-@code{UPDATE} ¥¹¥Æ¡¼¥È¥á¥ó¥ÈÆâ¤Î @code{WHERE} Àá¤Ç¹Ô¤ï¤ì¤Þ¤¹¡£¥ì¥³¡¼¥É¤¬
-¹¹¿·¤µ¤ì¤Ê¤«¤Ã¤¿»þ¤Ï¡¢²æ¡¹¤Ï¥¯¥é¥¤¥¢¥ó¥È¤Ë¥á¥Ã¥»¡¼¥¸: "Some of the data
-you have changed has been changed by another user" ¤òÍ¿¤¨¡¢¤½¤·¤Æ¤½¤ì¤«
-¤é¸Å¤¤¹Ô¤È¿·¤·¤¤¹Ô¤ò¥¦¥£¥ó¥É¥¦Æâ¤Çɽ¼¨¤·¤Þ¤¹¡£¥æ¡¼¥¶¤Ï¸ÜµÒ¥ì¥³¡¼¥É¤Î¤É¤Á
-¤é¤Î¥Ð¡¼¥¸¥ç¥ó¤ò»ÈÍѤ¹¤Ù¤­¤«¤ò·èÄê¤Ç¤­¤Þ¤¹¡£
-
-¤³¤ì¤Ï ``column locking'' ¤Ë»÷¤¿¤â¤Î¤ò²æ¡¹¤ËÍ¿¤¨¤Þ¤¹¤¬¡¢¼ÂºÝ¤Ë¤Ï½½Ê¬¤Ç¤¹¡£
-¤Ê¤¼¤Ê¤é¡¢²æ¡¹¤Ï¤½¤ì¤é¤Î¸½ºß¤ÎÃͤ˴ØÏ¢¤·¤¿Ãͤò»ý¤Ä¥Õ¥£¡¼¥ë¥É¤À¤±¤ò¹¹¿·¤¹¤ë¤«¤é
-¤Ç¤¹¡£¤³¤ì¤Ï¡¢Åµ·¿Åª¤Ê @code{UPDATE} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤¬¼¡¤Î¤è¤¦¤Ë¸«¤¨¤ë¤È
-¤¤¤¦¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹:
-
-@example
-UPDATE tablename SET pay_back=pay_back+'relative change';
-
-UPDATE customer
- SET
- customer_date='current_date',
- address='new address',
- phone='new phone',
- money_he_owes_us=money_he_owes_us+'new_money'
- WHERE
- customer_id=id AND address='old address' AND phone='old phone';
-@end example
-
-¸«¤Æ¤ÎÄ̤ꡢ¾¤Î¥¯¥é¥¤¥¢¥ó¥È¤¬ @code{pay_back} ¤Þ¤¿¤Ï
-@code{money_he_owes_us} ¥Õ¥£¡¼¥ë¥É¤ÎÃͤòÊѹ¹¤·¤¿¤È¤·¤Æ¤â¡¢¤³¤ì¤Ï¤È¤Æ¤â¸úΨŪ¤Ç
-Ư¤­¤Þ¤¹¡£
-
-@findex mysql_insert_id()
-@findex LAST_INSERT_ID()
-¿¤¯¤Î¾ì¹ç¡¢¥æ¡¼¥¶¤Ï @code{ROLLBACK} ¤½¤·¤Æ/¤Þ¤¿¤Ï @code{LOCK TABLES} ¤¬
-¤¤¤¯¤Ä¤«¤Î¥Æ¡¼¥Ö¥ë¤Ç¥æ¥Ë¡¼¥¯¤Ê¼±Ê̻Ҥò´ÉÍý¤¹¤ë¤³¤È¤ò˾¤ß¤Þ¤¹¡£¤³¤ì¤Ï¡¢
-@code{AUTO_INCREMENT} ¥Õ¥£¡¼¥ë¥É¤È SQL @code{LAST_INSERT_ID()} ´Ø¿ô¤ä C API ´Ø
-¿ô @code{mysql_insert_id} ¤Î»ÈÍѤˤè¤Ã¤Æ¡¢¤µ¤é¤Ë¸úΨŪ¤Ë½èÍý¤Ç¤­¤Þ¤¹¡£
-@xref{mysql_insert_id, , @code{mysql_insert_id()}}.
-
-@cindex row-level locking
-TcX ¤Ç¤Ï¡¢²æ¡¹¤Ï¤¤¤Ä¤Ç¤â¤½¤ì¤ò²óÈò¤·¤Æ¥³¡¼¥É²Äǽ¤Ê¤Î¤Ç¡¢²æ¡¹¤Ï¹Ô¥ì¥Ù¥ë¥í¥Ã
-¥¯¤òɬÍפȤ·¤Æ¤¤¤Þ¤»¤ó¡£ËÜÅö¤Ë¹Ô¥í¥Ã¥¯¤òɬÍפȤ¹¤ë¥±¡¼¥¹¤â¤¢¤ê¤Þ¤¹¤¬¡¢¤·
-¤«¤·¤³¤ì¤ÏÈó¾ï¤Ë¤Þ¤ì¤Ç¤¹¡£¹Ô¥ì¥Ù¥ë¥í¥Ã¥¯¤ò˾¤à¤Î¤Ê¤é¡¢¥Æ¡¼¥Ö¥ëÆâ¤Ç¥Õ¥é¥°
-¹àÌܤò»ÈÍѤ·¤Æ¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Æ¹Ô¤Ê¤¨¤Þ¤¹:
-
-@example
-UPDATE tbl_name SET row_flag=1 WHERE id=ID;
-@end example
-
-¹Ô¤¬¸«¤Ä¤«¤ê¡¢¥ª¥ê¥¸¥Ê¥ë¹ÔÆâ¤Ç @code{row_flag} ¤¬´û¤Ë 1 ¤Ç¤Ê¤¤¾ì¹ç¡¢
-@strong{MySQL} ¤Ï±Æ¶Á¤µ¤ì¤¿¹Ô¿ô¤È¤·¤Æ 1 ¤òÊÖ¤·¤Þ¤¹¡£
-
-@strong{MySQL} ¤¬¾å½Ò¤Î¥¯¥¨¥ê¤ò¼¡¤ËÊѹ¹¤·¤¿¤È¹Í¤¨¤ë¤³¤È¤¬²Äǽ¤Ç¤¹:
-
-@example
-UPDATE tbl_name SET row_flag=1 WHERE id=ID and row_flag <> 1;
-@end example
-
-@node Privilege system, Reference, Compatibility, Top
-@chapter @strong{MySQL} ¤Î¥æ¡¼¥¶¡¼¸¢¸Â¤Ï¤É¤Î¤è¤¦¤ËÆ°¤¯¤«¡©
-
-@strong{MySQL} ¤ÏÀè¿ÊŪ¤ÊÈóɸ½à¤Î¥»¥­¥å¥ê¥Æ¥£/Æø¢¥·¥¹¥Æ¥à¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£
-ËܾϤǤϤɤΤ褦¤Ë¤½¤ì¤¬Æ°¤¯¤«¤ò½Ò¤Ù¤Þ¤¹¡£
-
-@menu
-* General security:: General security
-* Security:: @strong{MySQL} ¤ò¥¯¥é¥Ã¥«¡¼¤ËÂФ·¤Æ°ÂÁ´¤Ë¤¹¤ëÊýË¡
-* What Privileges:: Æø¢¥·¥¹¥Æ¥à¤Î¹Ô¤¦¤³¤È
-* User names:: @strong{MySQL} user names and passwords
-* Connecting:: @strong{MySQL} ¥µ¡¼¥Ð¡¼¤ËÀܳ
-* Password security:: Keeping your password secure
-* Privileges provided:: @strong{MySQL} ¤¬Ä󶡤¹¤ë¸¢¸Â
-* Privileges:: Æø¢¥·¥¹¥Æ¥à¤Ï¤É¤Î¤è¤¦¤ËÆ°¤¯¤«¡©
-* Connection access:: Access control, stage 1: Àܳ¤Î¾µÇ§
-* Request access:: Access control, stage 2: Í×µá¤Î¾µÇ§
-* Privilege changes:: When privilege changes take effect
-* Default privileges:: @strong{MySQL} ¸¢¸Âµö²Ä¤Î½é´üÀßÄê
-* Adding users:: ¿·¤·¤¤¥æ¡¼¥¶¸¢¸Â¤ò @strong{MySQL} ¤ØÄɲÃ
-* Passwords:: ¥Ñ¥¹¥ï¡¼¥É¤ÎÀßÄêË¡
-* Access denied:: ²¿¸Î @code{Access denied} ¥¨¥é¡¼¤Ë¤Ê¤ë¤Î¤«
-@end menu
-
-@node General security, Security, Privilege system, Privilege system
-@section ¥»¥­¥å¥ê¥Æ¥£³µÍ×
-
-¤è¤¯¤¢¤ë¥»¥­¥å¥ê¥Æ¥£¤Î´Ö°ã¤¤¤òÈò¤±¤ë¤¿¤á¤Ë¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤ËÀܳ¤µ¤ì¤¿¥³¥ó
-¥Ô¥å¡¼¥¿¾å¤Ç @strong{MySQL} ¤ò»ÈÍѤ¹¤ëï¤â¤¬¡¢¤³¤Î¥»¥¯¥·¥ç¥ó¤òÆɤà¤Ù¤­¤Ç¤¹¡£
-
-``¥»¥­¥å¥ê¥Æ¥£'' ¤ÎµÄÏÀ¤Ç¤Ï¡¢¤¹¤Ù¤Æ¤Î³ºÅö¤¹¤ë¥¢¥¿¥Ã¥¯¥¿¥¤¥×
-(eavesdropping, altering, playback, Denial of Service)¤ËÂФ·¤Æ¡¢¤¹¤Ù¤Æ¤Î¥µ¡¼
-¥Ð¥Û¥¹¥È(ñ¤Ê¤ë @strong{MySQL} ¥µ¡¼¥Ð¤Ç¤Ï¤Ê¤¯)¤Î´°Á´¤ÊÊݸî¤ÎɬÍפò¶¯Ä´¤·¤Þ
-¤¹¡£We do not cover all aspects of availability and fault tolerance
-here.
-
-@strong{MySQL} ¤Ï¡¢¥æ¡¼¥¶¤¬¼Â¹Ô¤·¤è¤¦¤È¤¹¤ë¤¹¤Ù¤Æ¤ÎÀܳ¡¢¥¯¥¨¥ê¡¢¤½¤Î¾¤Î
-¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤ËÂФ·¤Æ¡¢¥¢¥¯¥»¥¹À©¸æ¥ê¥¹¥È(ACLs: Access Control Lists)¥»¥­¥å
-¥ê¥Æ¥£¤ò»ÈÍѤ·¤Þ¤¹¡£@strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¤È¥µ¡¼¥Ð¤Î´Ö¤Ç SSL °Å¹æ²½ÀÜ
-³¤Î¥µ¥Ý¡¼¥È¤â¤¤¤¯¤Ä¤«¤¢¤ê¤Þ¤¹¡£¤³¤³¤ÇµÄÏÀ¤µ¤ì¤ë¥³¥ó¥»¥×¥È¤Î¿¤¯¤Ï¡¢
-@strong{MySQL} ¤ËÆÃÍ­¤Î¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó; Ʊ¤¸°ìÈÌŪ¤Ê¥¢¥¤¥Ç¥¢¤Ï¤Û¤È¤ó¤É
-¤¹¤Ù¤Æ¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ËŬÍѤ·¤Þ¤¹¡£
-
-@strong{MySQL} ¼Â¹Ô»þ¡¢²Äǽ¤Ê¸Â¤ê¤¤¤Ä¤Ç¤â¤³¤ì¤é¤Î¥¬¥¤¥É¥é¥¤¥ó¤Ë½¾¤Ã¤Æ¤¯¤À
-¤µ¤¤:
-
-@itemize @bullet
-@item
-@strong{MySQL} ACL ¥·¥¹¥Æ¥à¤ÎÍý²ò¤ËÅؤá¤ë¤Ù¤­¤Ç¤¹¡£
-@code{GRANT} ¤È @code{REVOKE} ¥³¥Þ¥ó¥É¤Ï @strong{MySQL} ¤Ø¤Î¥¢¥¯¥»¥¹¤òÀ©¸Â¤¹¤ë¤¿¤á¤Îʪ¤Ç¤¹¡£
-ɬÍװʾå¤Î¸¢¸Â¤òï¤Ë¤âÍ¿¤¨¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£
-Á´¤Æ¤Î¥Û¥¹¥È¤ËÂФ·¤Æ¡¢²¿¤«½ÐÍè¤ë¤è¤¦¤Êµö²Ä¤òÍ¿¤¨¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£
-
-Checklist:
-@itemize @bullet
-@item
-@code{mysql -u root} ¤ò¹Ô¤Ã¤Æ¤ß¤Þ¤¹¡£
-
-¥Ñ¥¹¥ï¡¼¥É¤ò¿Ò¤Í¤é¤ì¤ë¤³¤È̵¤·¤Ë¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¤Ç¤­¤ë¾ì¹ç¡¢ÌäÂ꤬¤¢¤ê¤Þ¤¹¡£
-¤É¤Î¥æ¡¼¥¶¤Ç¤â(root ¤Ç¤Ê¤¯¤Æ¤â)¡¢@strong{MySQL} ¥µ¡¼¥Ð¤Ë´°Á´¤Ê¸¢¸Â¤ÇÀܳ¤Ç
-¤­¤Þ¤¹¡ª @code{root} ¥Ñ¥¹¥ï¡¼¥É¤ÎÀßÄê¤Ë¤Ä¤¤¤Æ¤Î¹àÌܤËÆÃÊ̤ÊÃí°Õ¤òʧ¤Ã¤Æ
-@strong{MySQL} ¥¤¥ó¥¹¥È¡¼¥ëÀâÌÀ¤ò¸«Ä¾¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-@code{SHOW GRANTS} ¤ò»ÈÍѤ·¡¢¤À¤ì¤¬¤Ê¤ó¤Î¥¢¥¯¥»¥¹¤ò»ý¤Ä¤«¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£
-ɬÍפʤ¤¸¢¸Â¤ò¡¢@code{REVOKE} ¥³¥Þ¥ó¥É¤ò»ÈÍѤ·¤Æºï½ü¤·¤Æ¤¯¤À¤µ¤¤¡£
-@end itemize
-
-@item
-¤¤¤«¤Ê¤ëʿʸ¥Ñ¥¹¥ï¡¼¥É¤â¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÊݸ¤·¤Ê¤¤¤è¤¦¤Ë¤·¤Þ¤¹¡£
-¤¢¤Ê¤¿¤Î¥³¥ó¥Ô¥å¡¼¥¿¤¬ÂŶ¨¤µ¤ì¤ë»þ¡¢¿·Æþ¼Ô¤Ï¥Ñ¥¹¥ï¡¼¥É¤Î´°Á´¤Ê¥ê¥¹¥È¤òÆÀ¤Æ¡¢
-¤½¤ì¤é¤ò»ÈÍѤǤ­¤Þ¤¹¡£Âå¤ï¤ê¤Ë @code{MD5()} ¤ä¾¤Î one-way hashing ´Ø¿ô¤ò
-»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
-@item
-¼­½ñ¤Ë¤Î¤Ã¤Æ¤¤¤ëñ¸ì¤ò¥Ñ¥¹¥ï¡¼¥É¤Ë»ÈÍѤ·¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£ ¤½¤ì¤é¤òÇˤë
-¥×¥í¥°¥é¥à¤¬¤¢¤ë¤Î¤Ç¤¹¡£ ``xfish98'' ¤Î¤è¤¦¤Ê¥Ñ¥¹¥ï¡¼¥É¤Ï°­¤¤Îã¤Ç¤¹¡£
-¤³¤ì¤è¤ê¤Ï ``duag98'' ¤ÎÊý¤¬¤è¤¤¤Ç¤·¤ç¤¦¡£ ¤³¤ì¤Ï "fish" ¤òÂǤĺݤˡ¢
-¥­¡¼¤ò°ì¤Ä¤º¤Ä¤º¤é¤·¤¿¤â¤Î¤Ç¤¹¡£ ¾¤ÎÊýË¡¤È¤·¤Æ¤Ï¡¢ "Mhall" ¡¢¤³¤ì¤Ï
-"Mary had a little lamb" ¤È¤¤¤¦Ê¸¤ÎƬʸ»ú¤òÍåÎó¤·¤¿¤â¤Î¤Ç¤¹¡£
-¤³¤ì¤òÃΤäƤ¤¤ëʪ¤Ë¤ÏÂǤÁ¤ä¤¹¤¤¥Ñ¥¹¥ï¡¼¥É¤Ç¤¹¤¬¡¢ÃΤé¤Ê¤¤¼Ô¤Ë¤È¤Ã¤Æ¤Ï¡¢
-Îà¿ä¤¹¤ë¤³¤È¤¬Æñ¤·¤¤¥Ñ¥¹¥ï¡¼¥É¤Ç¤¹¡£
-@item
-¥Õ¥¡¥¤¥¢¡¼¥¦¥©¡¼¥ë¤òƳÆþ¤·¤Þ¤¹¡£This protects from at least 50% of all types of
- exploits in any software.
-@strong{MySQL} ¤ò¥Õ¥¡¥¤¥¢¡¼¥¦¥©¡¼¥ë¤Ç¼é¤é¤ì¤¿Êý¤ËÃÖ¤¯¤«¡¢
-DMZ (´Ë¾×ÃÏÂÓ, ÈóÉðÁõÃÏÂÓ) ¤ËÃÖ¤­¤Þ¤¹¡£
-
-Checklist:
-@itemize @bullet
-@item
-¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤«¤é @code{nmap} ¤Î¤è¤¦¤Ê¥Ä¡¼¥ë¤ò»ÈÍѤ·¤Æ¡¢
-¤¢¤Ê¤¿¤Î¥Þ¥·¥ó¤Î¥Ý¡¼¥È¤ò¥¹¥­¥ã¥ó¤·¤Æ¤ß¤Þ¤¹¡£
-@strong{MySQL} ¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç 3306 ÈÖ¤ò»ÈÍѤ·¤Æ¤¤¤Þ¤¹¡£
-¤³¤Î¥Ý¡¼¥È¤Ë¤Ï¡¢¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¹¡£
-
-@strong{MySQL} ¥Ý¡¼¥È¤¬¥ª¡¼¥×¥ó¤·¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¾¤Î´Êñ¤ÊÊý
-Ë¡¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¥ê¥â¡¼¥È¥Þ¥·¥ó¤«¤é @code{telnet server_host 3306} ¤ò¼Â¹Ô¤¹
-¤ë¤³¤È¤Ç¤¹¡£¤³¤³¤Ç @code{server_host} ¤Ï¤¢¤Ê¤¿¤Î @strong{MySQL} ¥µ¡¼¥Ð¤Î¥Û
-¥¹¥È̾¤Ç¤¹¡£Àܳ¤·¡¢¤¤¤¯¤Ä¤«¤Î¥´¥ßʸ»ú¤¬ÆÀ¤é¤ì¤¿¾ì¹ç¡¢¥Ý¡¼¥È¤Ï¥ª¡¼¥×¥ó¤·¤Æ
-¤¤¤Þ¤¹¡£¤½¤ì¤ò¥ª¡¼¥×¥ó¤·¤Æ¤ª¤¯ÀµÅö¤ÊÍýͳ¤¬ËÜÅö¤Ë¤Ê¤¤¸Â¤ê¡¢¥Õ¥¡¥¤¥¢¡¼¥¦¥©¡¼
-¥ë¤ä¥ë¡¼¥¿¤Ç¥¯¥í¡¼¥º¤¹¤Ù¤­¤Ç¤¹¡£@code{telnet} ¤¬¥Ï¥ó¥°¤¹¤ë¾ì¹ç¡¢¤¹¤Ù¤Æ
-OK ¤Ç¤¹¡£¥Ý¡¼¥È¤Ï¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-@end itemize
-
-@item
-¥æ¡¼¥¶¡¼¤«¤éÆþÎϤµ¤ì¤¿¥Ç¡¼¥¿¤Ï¿®Íꤷ¤Ê¤¤¤Ç²¼¤µ¤¤¡£
-¥æ¡¼¥¶¡¼¤Ï¡¢Web¤Î¥Õ¥©¡¼¥à¡¢URL¡¢¤¢¤ë¤¤¤Ï¤¢¤Ê¤¿¤Î¥«¥¹¥¿¥à¥×¥í¥°¥é¥à¤«¤é
-ÆÃÄê¤Îʸ»ú¤òÆþ¤ì¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£ ¤â¤·¥æ¡¼¥¶¡¼¤¬¥Õ¥©¡¼¥à¤Ë
-@code{; DROP ALL DATABASES ;} ¤Î¤è¤¦¤Êʸ»ú¤òÆþÎϤ·¤Æ¤â¡¢
-¤¢¤Ê¤¿¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï°ÂÁ´¤Ç¤¹¤«¡©
-¤³¤ì¤Ï¶Ëü¤ÊÎã¤Ç¤¹¤¬¡¢¤½¤ì¤é¤ËÂФ·¤Æ½àÈ÷¤·¤Ê¤¤¾ì¹ç¡¢»÷¤¿¤è¤¦¤Ê¥Æ¥¯¥Ë¥Ã¥¯¤ò
-»ÈÍѤ¹¤ë¥Ï¥Ã¥«¡¼¤Î·ë²Ì¤È¤·¤Æ¡¢Â礭¤Ê¥»¥­¥å¥ê¥Æ¥£¥ê¡¼¥¯¤È¥Ç¡¼¥¿ÁÓ¼º¤¬È¯À¸¤·
-ÆÀ¤Þ¤¹¡£
-
-¿ôÃͥǡ¼¥¿¤Î¥Á¥§¥Ã¥¯¤â˺¤ì¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£¤è¤¯¤¢¤ë´Ö°ã¤¤¤Ïʸ»úÎó¤·¤«Êݸ
-¤Ê¤¤¤³¤È¤Ç¤¹¡£»þ¡¹¡¢¿Í¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬Êݸ¤ì¤ëɬÍפΤʤ¤¸ø¤ËÍ­¸ú¤Ê¥Ç¡¼¥¿
-¤À¤±¤ò´Þ¤ó¤Ç¤¤¤ë¤«¤É¤¦¤«¤ò¹Í¤¨¤Þ¤¹¡£¤³¤ì¤Ï´Ö°ã¤¤¤Ç¤¹¡£¾¯¤Ê¤¯¤È¤â¡¢
-Denial-of-Service ¥¿¥¤¥×¤Î¥¢¥¿¥Ã¥¯¤Ï¤½¤Î¤è¤¦¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ç¤â¼Â¹Ô¤µ¤ì¤Þ¤¹¡£
-¤³¤Î¥¿¥¤¥×¤Î¥¢¥¿¥Ã¥¯¤«¤éÊݸ¤ë¤â¤Ã¤È¤â´Êñ¤ÊÊýË¡¤Ï¡¢¿ôÃÍÄê¿ô¤Î²ó¤ê¤Ë¥¢¥Ý
-¥¹¥È¥í¥Õ¥£¤ò»ÈÍѤ¹¤ë¤³¤È¤Ç¤¹: @code{SELECT * FROM table WHERE ID=234} ¤ÎÂå
-¤ï¤ê¤Ë @code{SELECT * FROM table WHERE ID='234'}¡£@strong{MySQL} ¤Ï¼«Æ°Åª
-¤Ë¤³¤Îʸ»úÎó¤ò¿ôÃͤËÊÑ´¹¤·¡¢¤½¤³¤«¤é¤¹¤Ù¤Æ¤ÎÈó¿ôÃÍ¥·¥ó¥Ü¥ë¤ò¼è¤ê½ü¤­¤Þ¤¹¡£
-
-¥Á¥§¥Ã¥¯¥ê¥¹¥È:
-@itemize @bullet
-@item
-¤¹¤Ù¤Æ¤Î WWW ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó:
-@itemize @bullet
-@item
-¤¢¤Ê¤¿¤Î WWW ¤ÎÁ´¤Æ¤Î¥Õ¥©¡¼¥à¤Ë¡¢@samp{'} ¤È @samp{"} ¤òÆþÎϤ¹¤ë¤³¤È¤ò»î¤ß¤Æ¤¯¤À¤µ¤¤¡£
-¤â¤·¤Ê¤ó¤é¤«¤Î @strong{MySQL} ¥¨¥é¡¼¤¬¤Ç¤¿¤é¡¢¤¢¤Ê¤¿¤Î¥µ¥¤¥È¤òÄä»ß¤·¤¿¤Û¤¦¤¬
-¤è¤¤¤Ç¤·¤ç¤¦¡£
-@item
-¤¢¤Ê¤¿¤Î URL ¤Ë @code{%22} (@samp{"}), @code{%23} (@samp{#}) , @code{%27} (@samp{'}) ¤ò¤Ä¤±¤Æ¤ß¤Æ¡¢Æ°ÅªURL¤ò
-¤¤¤í¤¤¤íÊѹ¹¤·¤Æ»î¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
-@item
-ưŪ URL ¤Î¥Ç¡¼¥¿¥¿¥¤¥×¤ò¿ôÃͤ«¤é¾å½Ò¤ÎÎã¤Îʸ»ú¤ò´Þ¤àʸ»úÎó¤Ë½¤Àµ¤·¤Æ¤ß¤Æ
-¤¯¤À¤µ¤¤¡£¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¤³¤ì¤È»÷¤¿¤è¤¦¤Ê¥¢¥¿¥Ã¥¯¤ËÂФ·¤Æ°ÂÁ´¤Ç¤¢¤ë¤Ù¤­
-¤Ç¤¹¡£
-@item
-¿ôÃÍ¥Õ¥£¡¼¥ë¥É¤ËÂФ·¤Æ¡¢Ê¸»ú¡¢¥¹¥Ú¡¼¥¹¡¢Æüìʸ»ú¤ÎÆþÎϤò»î¤ß¤Æ¤¯¤À¤µ¤¤¡£
-¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ï¡¢¤½¤ì¤é¤ò @strong{MySQL} ¤ËÁ÷¤ëÁ°¤Ë¼è¤ê½ü¤¯¤«¡¢
-¤¢¤ë¤¤¤Ï¥¨¥é¡¼¤ò½Ð¤¹¤Ù¤­¤Ç¤¹¡£ ¸¡ºº¤·¤Ê¤¤Ãͤò @strong{MySQL} ¤ËÁ÷¤ë¤³¤È¤Ï´í¸±¤Ç¤¹¡£
-@item
-@strong{MySQL} ¤Ë¥Ç¡¼¥¿¤òÁ÷¤ëÁ°¤Ë¡¢¤½¤Î¥µ¥¤¥º¤ò¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£
-@item
-¤¢¤Ê¤¿¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¡¢´ÉÍýÌÜŪ¤Ç¤¢¤Ê¤¿¤¬»ÈÍѤ¹¤ë¤Î¤È°Û¤Ê¤ë¥æ¡¼¥¶Ì¾¤ò
-»ÈÍѤ·¤Æ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÀܳ¤¹¤ë¤³¤È¤ò¹Íθ¤·¤Æ¤¯¤À¤µ¤¤¡£É¬Íװʾå¤Î¥¢¥¯¥»¥¹¸¢
-¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ËÍ¿¤¨¤Ê¤¤¤Ç²¼¤µ¤¤¡£
-@end itemize
-@item
-PHP ¥æ¡¼¥¶:
-@itemize @bullet
-@item
-@code{addslashes()} ´Ø¿ô¤òÄ´¤Ù¤Þ¤¹¡£
-@end itemize
-@item
-@strong{MySQL} C API ¥æ¡¼¥¶:
-@itemize @bullet
-@item
-@code{mysql_escape()} API ¥³¡¼¥ë¤¬¤¢¤ë¤«Ä´¤Ù¤Þ¤¹.
-@end itemize
-@item
-@strong{MySQL}++ ¥æ¡¼¥¶:
-@itemize @bullet
-@item
-Check out the @code{escape} and @code{quote} modifiers for query streams.
-@end itemize
-@item
-Perl DBI ¥æ¡¼¥¶:
-@itemize @bullet
-@item
-Check out the @code{escape} and @code{quote} modifiers (?) for query streams.
-@item
-Check out the @code{quote()} method.
-@end itemize
-@end itemize
-
-@item
-À¸¤Î¥Ç¡¼¥¿(°Å¹æ²½¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ç¡¼¥¿)¤ò¥¤¥ó¥¿¡¼¥Í¥Ã¥È±Û¤·¤ËÁ÷¤Ã¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£
-This data is accessible to
-everyone who have interest to trap this information and reuse it
-somewhere. ¤â¤·Á÷¤ëɬÍפ¬¤¢¤ë¤Ê¤é¡¢SSL ¤Î¤è¤¦¤Ê°Å¹æ²½¤µ¤ì¤¿ÄÌ¿®¤ò
-»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£
-@strong{MySQL} supports internal SSL connections beginning from
-version 3.23.9.
-SSH port-forwarding can be used to create an encrypted (and compressed)
-tunnel for the communication.
-@item
-"tcpdump", "strings" ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤ò»È¤¦¤³¤È¤ò³Ø¤ó¤Ç²¼¤µ¤¤.
-°Ê²¼¤Î¥³¥Þ¥ó¥É¤Ç¡¢¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢°Å¹æ²½¤µ¤ì¤Æ¤¤¤Ê¤¤
-@strong{MySQL} ¤Î¥Ç¡¼¥¿¤¬¸«¤¨¤ë¤Ç¤·¤ç¤¦¡§
-@example
-shell> tcpdump -l -i eth0 -w - src or dst port 3306 | strings
-@end example
-(¤³¤ÎÎã¤Ï Linux ¤Î¤â¤Î¤Ç¤¹¡£Â¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¾¯¤·°ã¤¦¤Ç¤·¤ç¤¦).
- Warning: If you do not see data this doesn't actually
-always mean that it is encrypted. If you need high security you should
-consult with security expert.
-@end itemize
-
-
-@node Security, What Privileges, General security, Privilege system
-@section @strong{MySQL} ¤ò¥¯¥é¥Ã¥«¡¼¤ËÂФ·¤Æ°ÂÁ´¤Ë¤¹¤ëÊýË¡
-
-@strong{MySQL} ¥µ¡¼¥Ð¡¼¤ËÀܳ¤¹¤ë¤È¤­¤Ï¡¢¥Ñ¥¹¥ï¡¼¥É¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£
-¥Ñ¥¹¥ï¡¼¥É¤Ï¥³¥Í¥¯¥·¥ç¥ó´Ö¤Ç¡¢¤Ù¤¿¥Æ¥­¥¹¥È¤Ç¤Ïή¤ì¤Þ¤»¤ó¡£
-
-¤½¤Î¾¤ÎÁ´¤Æ¤Î¾ðÊó¤Ï¥Æ¥­¥¹¥È¤ÇžÁ÷¤µ¤ì¡¢
-¤³¤ì¤ÏÀܳ¤òÇÁ¤¯¤³¤È¤¬½ÐÍè¤ë¿Í¤ËÆɤޤì¤Þ¤¹¡£
-¤â¤·¤³¤ì¤ò¿´ÇÛ¤¹¤ë¤Ê¤é¡¢°µ½Ì¥×¥í¥È¥³¥ë(@strong{MySQL} 3.22 °Ê¾å)¤ò
-»ÈÍѤ¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£¤è¤ê°ÂÁ´¤Ë¤·¤¿¤¤¾ì¹ç¡¢
-@code{ssh} (@uref{http://www.cs.hut.fi/ssh}) ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤¹¤Ù¤­¤Ç¤¹¡£
-¤³¤ì¤ò»ÈÍѤ¹¤ì¤Ð¡¢@strong{MySQL} ¥µ¡¼¥Ð¡¼¤È @strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È
-´Ö¤Î TCP/IP ¥³¥Í¥¯¥·¥ç¥ó¤ÏÁ´¤Æ°Å¹æ²½¤µ¤ì¤Þ¤¹¡£
-
-@strong{MySQL} ¥·¥¹¥Æ¥à¤ò°ÂÁ´¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¼¡¤Î¤³¤È¤ò¹Í¤¨¤ë¤Ù¤­¤Ç¤¹:
-
-@itemize @bullet
-@item
-Á´¤Æ¤Î @strong{MySQL} ¥æ¡¼¥¶¤Ë¥Ñ¥¹¥ï¡¼¥É¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£
-@code{other_user} ¤Ë¥Ñ¥¹¥ï¡¼¥É¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢
-ï¤Ç¤â @code{mysql -u other_user db_name} ¤È¤·¤Æ´Êñ¤Ë¾¤Î¿Í¤È¤·¤Æ¥í¥°¥¤¥ó¤Ç¤­
-¤ë¤³¤È¤ò³Ð¤¨¤Æ¤¯¤À¤µ¤¤¡£¤³¤ì¤ÏÁ´¤Æ¤Î¥¯¥é¥¤¥¢¥ó¥È¡¿¥µ¡¼¥Ð¥¢¥×¥ê¥±¡¼¥·¥ç¥ó
-¤Ç°ìÈÌŪ¤Ê¿¶¤ëÉñ¤¤¤Ç¤¹¡£Á´¤Æ¤Î¥æ¡¼¥¶¤Î¥Ñ¥¹¥ï¡¼¥É¤Ï¡¢
-@code{mysql_install_db} ¥¹¥¯¥ê¥×¥È¤ò¼Â¹ÔÁ°¤ËÊÔ½¸¤¹¤ë¤³¤È¤Ç¡¢¤Þ¤¿¤Ï
-@strong{MySQL} @code{root} ¥æ¡¼¥¶¤À¤±¤Ï¼¡¤Î¤è¤¦¤Ë¤·¤ÆÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@example
-shell> mysql -u root mysql
-mysql> UPDATE user SET Password=PASSWORD('new_password')
- WHERE user='root';
-@end example
-
-@item
-@strong{MySQL} ¥Ç¡¼¥â¥ó¤ò Unix ¤Î @code{root} ¥æ¡¼¥¶¡¼¤Ç¼Â¹Ô¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£
-It is very dangerous as any user with @code{FILE} privileges will be able to
-create files
-as @code{root} (e.g. @code{~root/.bashrc}). To prevent this
-@code{mysqld} will refuse to run as @code{root} unless it is specified
-directly via @code{--user=root} option.
-
-@code{mysqld} ¤ÏǤ°Õ¤Î¥æ¡¼¥¶¤Ç¼Â¹Ô¤Ç¤­¤Þ¤¹¡£
-¤è¤ê°ÂÁ´¤Ë¤¹¤ë¤¿¤á¡¢¿·¤·¤¯ Unix ¥æ¡¼¥¶ @code{mysql} ¤òÄɲ乤뤳¤È¤â¤Ç¤­¤Þ¤¹¡£
-@code{mysqld} ¤ò ¾¤Î Unix ¥æ¡¼¥¶¡¼¤Çµ¯Æ°¤·¤¿¤È¤·¤Æ¤â¡¢
-@strong{MySQL} ¤Î @code{user} ¥Æ¡¼¥Ö¥ë¤Î @code{root} ¥æ¡¼¥¶¡¼¤Î̾Á°¤òÊѹ¹¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£
-¤Ê¤¼¤Ê¤é¡¢ @strong{MySQL} ¥æ¡¼¥¶¡¼¤Î̾Á°¤Ï Unix ¤Î¥æ¡¼¥¶¡¼Ì¾¤È¤Ï¤Ê¤ó¤Î´Ø·¸¤â¤Ê¤¤¤«¤é¤Ç¤¹¡£
-root ¥æ¡¼¥¶Ì¾¤òÊѹ¹¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£
-@code{mysqld} ¤ò¾¤Î Unix ¥æ¡¼¥¶¤Çµ¯Æ°¤¹¤ë¤¿¤á¤Ë¡¢@code{mysql.server} ÊÔ½¸¤·¤Æ¤â¤è¤¤¤Ç¤·¤ç¤¦¡£
-Ä̾¤³¤ì¤Ï @code{su} ¥³¥Þ¥ó¥É¤Ç¹Ô¤ï¤ì¤Þ¤¹¡£
-¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï ¢ª @ref{Changing MySQL user, , Changing @strong{MySQL} user}.
-
-@item
-@code{mysql.server} ¥¹¥¯¥ê¥×¥ÈÆâ¤Ë Unix @code{root} ¥æ¡¼¥¶¡¼¤Î¤¿¤á¤Ë¥Ñ¥¹¥ï¡¼¥É¤ò
-½ñ¤¤¤¿¾ì¹ç¡¢¤³¤Î¥¹¥¯¥ê¥×¥È¤Ï @code{root} ¤À¤±¤¬Æɤá¤ë¤è¤¦¤Ë¤·¤Ê¤¯¤Æ¤Ï
-¤Ê¤ê¤Þ¤»¤ó¡£
-
-@item
-¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤Ï @code{mysqld} ¤ò¼Â¹Ô¤·¤Æ¤¤¤ë Unix ¥æ¡¼¥¶¤À¤±¤¬
-Æɤ߹þ¤ß¡¿½ñ¤­¹þ¤ß²Äǽ¤Ê¤³¤È¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-On Unix platforms, do not run @code{mysqld} as root unless you really
-need to. Consider creating a user named @code{mysql} for that purpose.
-
-@item
-@strong{process} ¸¢¸Â¤òÁ´¤Æ¤Î¥æ¡¼¥¶¤ËÍ¿¤¨¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£¤³¤Îµö²Ä¤¬¤¢¤ë¿Í¤Ïï¤Ç¤â
-@code{mysqladmin processlist} ¥³¥Þ¥ó¥É¤Ç¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë¥¯¥¨¥ê¡¼¤ÎÃæ¿È¤ò¸«¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¤â¤·Ã¯¤«¤¬¡¢@code{UPDATE user SET password=PASSWORD('not_secure')} ¥¯¥¨¥ê¡¼¤ò
-¼Â¹Ô¤·¤Æ¤¤¤¿¤È¤·¤Æ¡¢¤½¤ì¤¬¸«¤¨¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
-
-@code{mysqld} ¤Ï @strong{process} ¸¢¸Â¤ò»ý¤Ä¥æ¡¼¥¶¤ËÂФ¹¤ëÆÃÊ̤ÊÀܳ¤ò¥ê¥¶¡¼¥Ö¤·¤Þ¤¹¡£
-¤½¤Î¤¿¤á¡¢¤¿¤È¤¨Á´¤Æ¤ÎÄ̾ïÀܳ¤¬»È¤ï¤ì¤¿¤È¤·¤Æ¤â¡¢@strong{MySQL} @code{root} ¥æ¡¼¥¶¤À¤±¤Ï¡¢
-¥í¥°¥¤¥ó¤Ç¤­¡¢¤¤¤í¤¤¤í¥Á¥§¥Ã¥¯¤Ç¤­¤Þ¤¹¡£
-
-@item
-@strong{file} ¤òÁ´¤Æ¤Î¥æ¡¼¥¶¤ËÍ¿¤¨¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£¥æ¡¼¥¶¤¬¤³¤Î¸¢¸Â¤ò»ý¤Ä¾ì
-¹ç¡¢@code{mysqld} ¥Ç¡¼¥â¥ó¤ò¼Â¹Ô¤·¤Æ¤¤¤ë Unix ¥æ¡¼¥¶¡¼¤Î¸¢¸Â¤Ç
-¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥àÆâ¤Î¤É¤³¤Ë¤Ç¤â¥Õ¥¡¥¤¥ë¤ò½ñ¤­¹þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤¹¡ª
-¤³¤ì¤ò¾¯¤·°ÂÁ´¤Ë¤¹¤ë¤¿¤á¤Ë¡¢@code{SELECT ... INTO OUTFILE} ¤ÇºîÀ®¤µ¤ì¤ëÁ´¤Æ¤Î¥Õ¥¡¥¤¥ë¤Ï
-Á´°÷¤ËÆɤ߹þ¤ß²Äǽ¤ÇÀ¸À®¤µ¤ì¡¢´û¸¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¾å½ñ¤­¤Ç¤­¤Þ¤»¤ó¡£
-
-@tindex /etc/passwd
-@strong{file} ¸¢¸Â¤Ï¥µ¡¼¥Ð¡¼¤òÁö¤é¤»¤Æ¤¤¤ë UNIX ¥æ¡¼¥¶¡¼¤¬¥¢¥¯¥»¥¹¤Ç¤­¤ë
-Á´¤Æ¤Î¥Õ¥¡¥¤¥ë¤òÆɤि¤á¤Ë»ÈÍѤµ¤ì¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-Î㤨¤Ð¡¢ @file{/etc/passwd} ¤ò¥Æ¡¼¥Ö¥ë¤Ë¼è¤ê¹þ¤à¤¿¤á¤Ë @code{LOAD DATA} ¤¬
-»ÈÍѤµ¤ì¤ë¤È¡¢ @code{SELECT} ¤Ç¤½¤ÎÆâÍƤ¬Æɤá¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-@item
-¤¢¤Ê¤¿¤Î DNS ¤ò¿®ÍѤ·¤Ê¤¤¾ì¹ç¡¢¸¢¸Â¥Æ¡¼¥Ö¥ëÆâ¤Ë¤Ï¥Û¥¹¥È̾¤ÎÂå¤ï¤ê¤Ë IP
-¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£@code{mysqld} ¤Ø¤Î @code{--secure} ¥ª¥×¥·¥ç¥ó¤Ï¸¶Íý¾å¤Ï¥Û¥¹¥È̾¤ò°Â
-Á´¤Ë¤·¤Þ¤¹¡£¤É¤ó¤Ê¾ì¹ç¤Ç¤â¡¢¥ï¥¤¥ë¥É¥«¡¼¥É¤ò´Þ¤ó¤À¥Û¥¹¥È̾¤ò¡¢µö²Ä¥Æ¡¼¥Ö¥ë¤ËÅÐÏ¿¤¹¤ë
-»ö¤ÏËÜÅö¤ËÃí°Õ¿¼¤¯¤¹¤Ù¤­¤Ç¤¹¡ª
-
-@end itemize
-
-@code{mysqld} ¤Ø¤Î¼¡¤Î¥ª¥×¥·¥ç¥ó¤Ï¥»¥­¥å¥ê¥Æ¥£¤Ë±Æ¶Á¤·¤Þ¤¹:
-
-@table @code
-@item --secure
-@code{gethostbyname()} ¤«¤éÊÖ¤µ¤ì¤ë ip ¤¬¥ª¥ê¥¸¥Ê¥ë¤Î¥Û¥¹¥È̾¤ËÌ᤻¤ë¤«¤É
-¤¦¤«¤ò¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£¤³¤ì¤Ï¡¢³°¤Î狼¤¬Â¾¤Î¥Û¥¹¥È¤ò¿¿»÷¤Æ¥¢¥¯¥»¥¹¤òÆÀ¤ë
-¤³¤È¤òÆñ¤·¤¯¤·¤Þ¤¹¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤¤¯¤Ä¤«¤ÎÀµ¤·¤¤¥Û¥¹¥È̾¥Á¥§¥Ã¥¯¤âÄÉ
-²Ã¤·¤Þ¤¹¡£¤³¤ì¤Ï¡¢»þ¤Ë¥Á¥§¥Ã¥¯¤ËŤ¤»þ´Ö¤¬¤«¤«¤ë¤¿¤á¡¢@strong{MySQL} 3.21
-¤Ç¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥ª¥Õ¤Ë¤µ¤ì¤Æ¤¤¤Þ¤¹¡£@strong{MySQL} 3.22 ¤Ç¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï
-¥Ç¥Õ¥©¥ë¥È¤ÇÍ­¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¢¥Û¥¹¥È̾¤ò¥­¥ã¥Ã¥·¥å¤¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
-
-@item --skip-grant-tables
-Æø¢¥·¥¹¥Æ¥à¤òÁ´¤¯»ÈÍѤ·¤Þ¤»¤ó¡£¤³¤ì¤ÏÁ´°÷¤ËÁ´¤Æ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î
-@emph{´°Á´¤Ê¥¢¥¯¥»¥¹} ¤òÍ¿¤¨¤Þ¤¹¡ª
-(@code{mysqladmin flush-privileges} ¤« @code{mysqladmin reload} ¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ç¡¢
-µ¯Æ°¤·¤Æ¤¤¤ë¥µ¡¼¥Ð¡¼¤ÏÆø¢¥·¥¹¥Æ¥à¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£)
-
-@item --skip-name-resolve
-¥Û¥¹¥È̾¤ò²òÀϤ·¤Þ¤»¤ó¡£¸¢¸Â¥Æ¡¼¥Ö¥ëÃæ¤ÎÁ´¤Æ¤Î @code{Host}¥Õ¥£¡¼¥ë¥É¤Ï IP ¥¢¥É¥ì¥¹¤«
-@code{localhost} ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-
-@item --skip-networking
-¥Í¥Ã¥È¥ï¡¼¥¯ (TCP/IP) ·Ðͳ¤ÎÀܳ¤òµö²Ä¤·¤Þ¤»¤ó¡£@code{mysqld} ¤Ø¤ÎÁ´¤Æ¤ÎÀܳ¤Ï¡¢
-Unix ¥½¥±¥Ã¥È¤Ç¹Ô¤ï¤ì¤Þ¤¹¡£MIT-pthreads ¤Ï Unix ¥½¥±¥Ã¥È¤ò¥µ¥Ý¡¼¥È¤·¤Ê¤¤
-¤¿¤á¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï MIT-pthreads ¤ò»ÈÍѤ¹¤ë¥·¥¹¥Æ¥à¾å¤Ç¤Ï¡¢¤¦¤Þ¤¯Æ°¤­¤Þ¤»¤ó¡£
-@end table
-
-
-@node What Privileges, User names, Security, Privilege system
-@section Æø¢¥·¥¹¥Æ¥à¤Î¹Ô¤¦¤³¤È
-
-@strong{MySQL} Æø¢¥·¥¹¥Æ¥à¤Î´ðËܵ¡Ç½¤Ï¡¢Í¿¤¨¤é¤ì¤¿¥Û¥¹¥È¤«¤éÀܳ¤¹¤ë
-¥æ¡¼¥¶¤òǧ¾Ú¤¹¤ë¤³¤È¡¢¤½¤·¤Æ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ¹¤ë
- @strong{select}, @strong{insert}, @strong{update}, @strong{delete} Åù¤Î¸¢¸Â¤òÍ¿¤¨¤ë¤³¤È¤Ç¤¹¡£
-
-³ÈÄ¥µ¡Ç½¤Ïƿ̾¥æ¡¼¥¶¤ò¤â¤ÄǽÎϤò´Þ¤ß¡¢@code{LOAD DATA INFILE} ¤Î¤è¤¦¤Ê
-@strong{MySQL} ¸ÇÍ­¤Îµ¡Ç½¤ò»ÈÍѤ¹¤ëµö²Ä¤òÍ¿¤¨¤Þ¤¹¡£
-
-
-@node User names, Connecting, What Privileges, Privilege system
-@section @strong{MySQL} ¥æ¡¼¥¶Ì¾¤È¥Ñ¥¹¥ï¡¼¥É
-
-@strong{MySQL} ¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ë¥æ¡¼¥¶¡¼Ì¾¤È¥Ñ¥¹¥ï¡¼¥É¤Î»ÈÍѤΤµ¤ìÊý¤È¡¢
-UNIX, Windows ¤Ç»ÈÍѤµ¤ì¤ëÊýË¡¤È¤Ï¡¢¤¤¤¯¤Ä¤«°Û¤Ê¤ëÅÀ¤¬¤¢¤ê¤Þ¤¹¡£
-
-@itemize @bullet
-@item
-@strong{MySQL} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥¢¥¯¥»¥¹Ç§¾Ú¤Ë»ÈÍѤ¹¤ë¥æ¡¼¥¶¡¼Ì¾¤Ï¡¢
-UNIX ¤Î¥í¥°¥¤¥ó¥æ¡¼¥¶¤äWindows¤Î¥æ¡¼¥¶¡¼Ì¾¤Ç¹Ô¤¦¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó(°ìÃפ·¤Æ¤¤¤Þ¤»¤ó)¡£
-ÍøÊØÀ­¤ò¤Ï¤«¤ë¤¿¤á¡¢Â¿¤¯¤Î @strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¤Ï¸½ºß¤Î¥í¥°¥¤¥ó¤·¤Æ¤¤¤ë¥æ¡¼¥¶Ì¾¤ò
-@strong{MySQL}¤Î¥æ¡¼¥¶¡¼Ì¾¤È¤·¤Æ¥í¥°¥¤¥ó¤ò»î¤ß¤Þ¤¹¡£
-¤·¤«¤·¤³¤ì¤Ï @code{-u} ¤« @code{--user} ¥¹¥¤¥Ã¥Á¤ÇÊѹ¹¤Ç¤­¤Þ¤¹¡£
-¤³¤ì¤Ï¡¢Á´¤Æ¤Î¥æ¡¼¥¶¤ËÂФ·¥Ñ¥¹¥ï¡¼¥É¤òÀßÄꤷ¤Æ¤ª¤«¤Ê¤¤¤È¡¢
-Á´¤¯¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò°ÂÁ´¤Ë¤Ç¤­¤Ê¤¤¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£
-¤â¤·¥Ñ¥¹¥ï¡¼¥É¤òÁ´¥æ¡¼¥¶¡¼¤ËÀßÄꤷ¤Æ¤ª¤«¤Ê¤¤¤È¡¢¤½¤Î¥æ¡¼¥¶¡¼Ì¾¤Çǧ¾Ú¤Ê¤·¤Ë¥µ¡¼¥Ð¡¼¤ËÀܳ¤Ç¤­¤Þ¤¹¡£
-
-@item
-@strong{MySQL} ¤Î¥æ¡¼¥¶¡¼Ì¾¤Ï 16ʸ»ú¤Þ¤Ç(±Ñ¿ôȾ³Ñ)»ÈÍѤǤ­¤Þ¤¹¡£
-UNIX¤Ï¤À¤¤¤¿¤¤8ʸ»ú¤Ç¤¹¤¬¡£(8ʸ»ú¤ò¤³¤¨¤ë¥·¥¹¥Æ¥à¤â¤¢¤ë)
-
-@item
-@strong{MySQL} ¥æ¡¼¥¶¡¼¤Î¥Ñ¥¹¥ï¡¼¥É¤Ï¡¢Unix ¤Î¥Ñ¥¹¥ï¡¼¥É¤È°ã¤¤¤Þ¤¹¡£
-¤è¤Ã¤Æ¡¢¤½¤ì¤é¤Î¥Þ¥·¥ó¾å¤Ç Unix ¤Î¥í¥°¥¤¥ó¥Ñ¥¹¥ï¡¼¥É¤È
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Ñ¥¹¥ï¡¼¥É¤ÏƱ¤¸¤Ë¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£
-
-@item
-@strong{MySQL} ¤Ï Unix ¤Î¥í¥°¥¤¥ó¥Ñ¥¹¥ï¡¼¥É¤È¤ÏÁ´¤¯°ã¤¦¡¢
-Æȼ«¤Î°Å¹æ²½¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤À¤±¤ò»ÈÍѤ·¤Þ¤¹¡£
-@code{PASSWORD()} ¤È @code{ENCRYPT()} ´Ø¿ô¤ÎÀâÌÀ¤ò»²¾È ¢ª @ref{Miscellaneous
-functions}.
-@end itemize
-
-@node Connecting, Password security, User names, Privilege system
-@section @strong{MySQL} ¥µ¡¼¥Ð¡¼¤ËÀܳ
-
-@strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤Ï¡¢¶¦Ä̤ηè¤Þ¤Ã¤¿°ú¿ô¤ò»ý¤Á¤Þ¤¹¡§
-Àܳ¤·¤¿¤¤¥Û¥¹¥È̾¡¢Àܳ¥æ¡¼¥¶¡¼Ì¾¡¢¤½¤·¤Æ¥Ñ¥¹¥ï¡¼¥É¤Ç¤¹¡£
-Î㤨¤Ð¡¢@code{mysql} ¥³¥Þ¥ó¥É¤Ï°Ê²¼¤Î¤è¤¦¤Ê°ú¿ô¤ò»ý¤Á¤Þ¤¹
-(¥ª¥×¥·¥ç¥ó¤Î°ú¿ô¤Ï @samp{[} ¤È @samp{]} ¤Ç°Ï¤Þ¤ì¤Æ¤¤¤ëÉôʬ¤Ç¤¹)
-
-@example
-shell> mysql [-h host_name] [-u user_name] [-pyour_pass]
-@end example
-
-@code{-h}, @code{-u}, @code{-p} ¥ª¥×¥·¥ç¥ó¤Ï°Ê²¼¤ÈÅù²Á¤Ç¤¹¡£
-@code{--host=host_name}, @code{--user=user_name}, @code{--password=your_pass}
-@code{-p} ¤È¥Ñ¥¹¥ï¡¼¥É¤Î´Ö¤Ë¤Ï¥¹¥Ú¡¼¥¹¤¬¤Ê¤¤¤³¤È¤ËÃí°Õ
-
-@strong{Ãí°Õ:} ¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë¥Ñ¥¹¥ï¡¼¥É¤òÍ¿¤¨¤ë¤Î¤Ï°ÂÁ´¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡ª
-¥·¥¹¥Æ¥à¤ËÆþ¤Ã¤Æ¤¤¤ëÇ¡²¿¤Ê¤ë¥æ¡¼¥¶¡¼¤â @code{ps auxww} ¤Î¤è¤¦¤Ê¥³¥Þ¥ó¥É¤ò
-»ÈÍѤ¹¤ë»ö¤Ç¥Ñ¥¹¥ï¡¼¥É¤ò¸«ÉÕ¤±¤ë»ö¤¬¤Ç¤­¤Þ¤¹
-@xref{Option files}.
-
-@code{mysql} ¥³¥Þ¥ó¥É¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë°ú¿ô¤¬¤Ê¤±¤ì¤ÐÀܳ¤Ë¥Ç¥Õ¥©¥ë¥ÈÃͤòÍѤ¤¤Þ¤¹¡£
-
-@itemize @bullet
-@item
-¥Ç¥Õ¥©¥ë¥È¤Î¥Û¥¹¥È̾¤Ï @code{localhost}, ¥æ¡¼¥¶¡¼Ì¾¤Ï Unix ¤Î¥í¥°¥¤¥ó̾¤Ç¤¹¡£
-
-@item
-(@code{-p} ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¥Ñ¥¹¥ï¡¼¥É¤ÏÍ¿¤¨¤é¤ì¤Þ¤»¤ó)
-@end itemize
-
-Unix ¤Î¥í¥°¥¤¥ó¥æ¡¼¥¶¡¼¤¬ @code{joe} ¤Î¾ì¹ç¡¢°Ê²¼¤Î¥³¥Þ¥ó¥É¤ÏÅù²Á¤Ç¤¹¡§
-
-@example
-shell> mysql -h localhost -u joe
-shell> mysql -h localhost
-shell> mysql -u joe
-shell> mysql
-@end example
-
-¾¤Î @strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¤âƱ¤¸¤è¤¦¤ËÆ°ºî¤·¤Þ¤¹¡£
-
-Unix ¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤¢¤ëÃͤò¥Ç¥Õ¥©¥ë¥ÈÃͤˤ·¤ÆÀܳ¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¤½¤¦¤¹¤ë¤³¤È¤Ë¤½¤ê¡¢Ëè²óËè²ó¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë°ú¿ô¤òÍ¿¤¨¤Ê¤¯¤Æ¤¹¤à¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-@tindex .my.cnf file
-¼«Ê¬¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ë @file{.my.cnf} ¤òºî¤ê¡¢¤½¤Î¥Õ¥¡¥¤¥ë¤ÎÃæ¤Î
-@code{[client]} ¥»¥¯¥·¥ç¥ó¤ËÀܳÍѤΥѥé¥á¥¿¡¼¤òµ­½Ò¤Ç¤­¤Þ¤¹¡£
-¤½¤Îµ­½Ò¤Ï°Ê²¼¤Î¤è¤¦¤Ç¤¹¡§
-
-@example
-[client]
-host=host_name
-user=user_name
-password=your_pass
-@end example
-
-@xref{Option files}.
-
-@item
-@tindex MYSQL_HOST environment variable
-@tindex Environment variable, MYSQL_HOST
-@tindex MYSQL_PWD environment variable
-@tindex Environment variable, MYSQL_PWD
-@tindex USER environment variable
-@tindex Environment variable, USER
-Àܳ¤Î¥Ñ¥é¥á¥¿¡¼¤Ë´Ä¶­ÊÑ¿ô¤ò»ÈÍѤ¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
-¥Û¥¹¥È̾¤Ï @code{MYSQL_HOST} ´Ä¶­ÊÑ¿ô¤ò»ÈÍѤ·¤Þ¤¹¡£
-@strong{MySQL} ¤Î¥æ¡¼¥¶¡¼Ì¾¤Ï @code{USER} (¤³¤ì¤Ï Windows ¤Î¤ß) ¤ËÀßÄꤵ¤ì¤¿Ãͤò»ÈÍѤ·¤Þ¤¹¡£
-¥Ñ¥¹¥ï¡¼¥É¤Ï @code{MYSQL_PWD} ´Ä¶­ÊÑ¿ô¤ò¸«¤Þ¤¹¤¬¡¢¤³¤ì¤Ï´í¸±¤Ç¤¹¡£(¼¡¤ÎÀỲ¾È)
-@xref{Environment variables}.
-@end itemize
-
-
-@node Password security, Privileges provided, Connecting, Privilege system
-@subsection ¥Ñ¥¹¥ï¡¼¥É¤ò°ÂÁ´¤Ë¤¹¤ë
-
-¼«Ê¬¤Î¥Ñ¥¹¥ï¡¼¥É¤ò¾¿Í¤Ë¤µ¤é¤±½Ð¤¹¤Î¤Ï´«¤á¤é¤ì¤ë¤³¤È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-¤½¤ì¤¾¤ì¤ÎÊýË¡¤Ë±÷¤±¤ë´í¸±Å٤˱þ¤¸¡¢°Ê²¼¤Ë¼¨¤¹ÊýË¡¤Ç¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤Ë
-¤¢¤Ê¤¿¤Î¥Ñ¥¹¥ï¡¼¥É¤ò¤¢¤¿¤¨¤ÆÁö¤é¤»¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-@code{-pyour_pass} ¤« @code{--password=your_pass} ¥ª¥×¥·¥ç¥ó¤ò¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç»ÈÍѤ·¤Þ¤¹¡£
-¤³¤ì¤ÏÊØÍø¤Ç¤¹¤¬°ÂÁ´¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£¤¢¤Ê¤¿¤Î¥Ñ¥¹¥ï¡¼¥É¤Ï (@code{ps} ¥³¥Þ¥ó¥É¤Î¤è¤¦¤Ê)
-¥·¥¹¥Æ¥à¤Î¾õÂÖ¤ò¸«¤ë¥³¥Þ¥ó¥É¤Ë¤Æ¸«¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-(@strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¤Ï½é´ü²½²áÄø¤Ë¤ª¤¤¤Æ¥³¥Þ¥ó¥É¥é¥¤¥ó¤Î°ú¿ô¤ò¥¼¥í¤Ç¾å½ñ¤­¤·¤Æ
-¸«¤»¤Ê¤¤¤è¤¦¤Ë¤·¤Æ¤¤¤ë¤Î¤Ç¤¹¤¬¡¢½Ö´Ö¤Ç¤¹¤¬Ãͤ¬¸«¤¨¤Æ¤·¤Þ¤¦¤Î¤Ç¤¹)
-
-@item
-@code{-p} ¤¢¤ë¤¤¤Ï @code{--password} ¥ª¥×¥·¥ç¥ó¤ò @code{your_pass} ¤òÍ¿¤¨¤Ê¤¤¤Ç»ÈÍѤ·¤Þ¤¹¡£
-¤³¤Î¾ì¹ç¡¢¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤Ï¥¿¡¼¥ß¥Ê¥ë¤òÄ̤¸¤Æ¥Ñ¥¹¥ï¡¼¥É¤ÎÆþÎϤòÂ¥¤·¤Æ¤­¤Þ¤¹:
-
-@example
-shell> mysql -u user_name -p
-Enter password: ********
-@end example
-
-¥¯¥é¥¤¥¢¥ó¥È¤Ï¤¢¤Ê¤¿¤ÎÆþÎϤ·¤¿¥Ñ¥¹¥ï¡¼¥É¤ò @samp{*} ʸ»ú¤ÇüËö¤ËÊÖ¤·¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢
-²èÌ̤ò¤Î¤¾¤­¹þ¤Þ¤ì¤¿¤È¤·¤Æ¤â¥Ñ¥¹¥ï¡¼¥É¤Ï¤ï¤«¤ê¤Þ¤»¤ó¡£
-
-¤³¤ì¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë¥Ñ¥¹¥ï¡¼¥É¤ò»ØÄꤹ¤ë¤è¤ê°ÂÁ´¤Ç¤¹¡£Â¾¤Î¥æ¡¼¥¶¡¼¤Ë¤Ï¸«¤¨¤Þ¤»¤ó¤«¤é¡£
-¤·¤«¤·¤³¤Î¥Ñ¥¹¥ï¡¼¥É¤òËè²óÆþ¤ì¤ëÊýË¡¤ÏÂÐÏü°¤Î¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¾ì¹ç¤À¤±¤Ë»ÈÍѤǤ­¤ë¼ê¤Ç¤¹¡£
-¤â¤·ÈóÂÐÏü°¤Î¥¹¥¯¥ê¥×¥È¤«¤é¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤òµ¯Æ°¤·¤¿¤¤¾ì¹ç¡¢
-¥Ñ¥¹¥ï¡¼¥É¤òüËö¤«¤éÆþ¤ì¤ëµ¡²ñ¤¬¤¢¤ê¤Þ¤»¤ó¡£
-On some systems, you may even find that the first line of your
-script is read and interpreted (incorrectly) as your password!
-
-@item
-@tindex .my.cnf file
-ÀßÄê¥Õ¥¡¥¤¥ë¤Ë¥Ñ¥¹¥ï¡¼¥É¤ò½ñ¤¤¤Æ¤ª¤¯¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
-Î㤨¤Ð¡¢¼«Ê¬¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¡¼¤Ë¤¢¤ë @file{.my.cnf} ¥Õ¥¡¥¤¥ë¤Î @code{[client]}
-¥»¥¯¥·¥ç¥ó¤Ë¡¢°Ê²¼¤Î¤è¤¦¤Ê·Á¤Ç½ñ¤­¤Þ¤¹¡§
-
-@example
-[client]
-password=your_pass
-@end example
-
-¤â¤· @file{.my.cnf} ¥Õ¥¡¥¤¥ë¤Ë¥Ñ¥¹¥ï¡¼¥É¤ò½ñ¤¤¤Æ¤¤¤ë¤Ê¤é¡¢¥Õ¥¡¥¤¥ë¤Ï¥°¥ë¡¼¥×¤ä
-¤½¤Î¾¤Î¥æ¡¼¥¶¡¼¤¬Æɤ߽ñ¤­¤Ç¤­¤Ê¤¤¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¹¡£¥Õ¥¡¥¤¥ë¤Î¥â¡¼¥É¤Ï @code{400}
-¤« @code{600} ¤Ë¤·¤Þ¤¹¡£
-
-@xref{Option files}.
-@item
-@code{MYSQL_PWD} ´Ä¶­ÊÑ¿ô¤Ë¥Ñ¥¹¥ï¡¼¥É¤òÀßÄꤹ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£¤·¤«¤·¤³¤ÎÊýË¡¤Ï
-¤­¤ï¤á¤Æ´í¸±¤Ç¤¢¤ë¤Î¤Ç¡¢»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-@code{ps} ¤Î¤¢¤ë¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢¼Â¹ÔÃæ¤Î¥×¥í¥»¥¹¤Î´Ä¶­ÊÑ¿ô¤òɽ¼¨¤¹¤ë¥ª¥×¥·¥ç¥ó¤¬¤¢¤ê¤Þ¤¹¡¨
-¤â¤· @code{MYSQL_PWD} ´Ä¶­ÊÑ¿ô¤Ë¥Ñ¥¹¥ï¡¼¥É¤òÀßÄꤷ¤Æ¤¤¤ë¤ÈÁ´¤Æ¤Ù¤¿¤Ç¸«¤ì¤Þ¤¹¡£
-¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤Î @code{ps} ¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¥·¥¹¥Æ¥à¤À¤È¤·¤Æ¤â¡¢¥×¥í¥»¥¹¤Î´Ä¶­ÊÑ¿ô¤òÄ´¤Ù¤ë
-ÊýË¡¤¬¤Ê¤¤¤È¤Ï¤¤¤¨¤Ê¤¤¤Î¤Ç¡¢¤³¤ÎÊýË¡¤Ï¤¢¤Þ¤ê¤¤¤¤ÊýË¡¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-@xref{Environment variables}.
-@end itemize
-
-¤Þ¤È¤á¤ë¤È¡¢¤è¤ê°ÂÁ´¤ÊÊýË¡¤Ï¡¢
-¥Ñ¥¹¥ï¡¼¥É¥×¥í¥ó¥×¥È¤òÊÖ¤¹¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤ò¼Â¹Ô¤¹¤ë¤«¡¢
-ŬÀڤʥѡ¼¥ß¥Ã¥·¥ç¥ó¤ò¤«¤±¤¿ @file{.my.cnf} ¥Õ¥¡¥¤¥ë¤Ë¥Ñ¥¹¥ï¡¼¥É¤ò½ñ¤¯¤«
-¤Ç¤¹¡£
-
-
-@node Privileges provided, Privileges, Password security, Privilege system
-@section @strong{MySQL} ¤¬Ä󶡤¹¤ë¸¢¸Â
-
-¸¢¸Â¤ÎÀßÄê¤Ï @code{mysql} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î @code{user}, @code{db}, @code{host},
- @code{tables_priv}, @code{columns_priv} ¤Ç¹Ô¤¤¤Þ¤¹¡£
-(@code{mysql} ¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î̾Á°¤Ç¤¹)
-@strong{MySQL} ¥µ¡¼¥Ð¡¼¤Ï¡¢¥µ¡¼¥Ð¡¼¤Îµ¯Æ°»þ¤«
- @ref{Privilege changes} ¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤ëÊýË¡¤Ë¤è¤ê¡¢
-¤³¤ì¤é¤Î¥Æ¡¼¥Ö¥ë¤«¤é¸¢¸Â¤ÎÀßÄê¤òÆɤ߹þ¤ß¤Þ¤¹¡£
-
-@strong{MySQL} ¤¬Ä󶡤¹¤ë¸¢¸Â¤Î̾¾Î¤Ï,
-Ëܥޥ˥奢¥ë¤Ç¤Ï°Ê²¼¤Îɽ¤Î̾¾Î¤òÍѤ¤¤Þ¤¹¡£
-¤³¤Îɽ¤Î¹àÌÜ̾¤¬¤½¤ì¤¾¤ì¤Îµö²Ä¤µ¤ì¤ë¸¢¸Â¤È¤½¤ÎÀâÌÀ¤ËÂбþ¤·¤Æ¤¤¤Þ¤¹¡§
-
-@multitable @columnfractions .15 .25 .6
-@item @strong{Privilege} @tab @strong{Column} @tab @strong{Context}
-@item @strong{select} @tab @code{Select_priv} @tab tables
-@item @strong{insert} @tab @code{Insert_priv} @tab tables
-@item @strong{update} @tab @code{Update_priv} @tab tables
-@item @strong{delete} @tab @code{Delete_priv} @tab tables
-@item @strong{index} @tab @code{Index_priv} @tab tables
-@item @strong{alter} @tab @code{Alter_priv} @tab tables
-@item @strong{create} @tab @code{Create_priv} @tab databases, tables or indexes
-@item @strong{drop} @tab @code{Drop_priv} @tab databases or tables
-@item @strong{grant} @tab @code{Grant_priv} @tab databases or tables
-@item @strong{references} @tab @code{References_priv} @tab databases or tables
-@item @strong{reload} @tab @code{Reload_priv} @tab server administration
-@item @strong{shutdown} @tab @code{Shutdown_priv} @tab server administration
-@item @strong{process} @tab @code{Process_priv} @tab server administration
-@item @strong{file} @tab @code{File_priv} @tab file access on server
-@end multitable
-
-@strong{select}, @strong{insert}, @strong{update}, @strong{delete} ¤Î¸¢¸Â¤Ï¡¢
-¸ºß¤·¤Æ¤¤¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æµö²Ä¤µ¤ì¤Þ¤¹¡£
-
-¤â¤·¥Æ¡¼¥Ö¥ë¤«¤é¹Ô¤ò¼è¤ê½Ð¤¹¤À¤±¤Ê¤é¡¢@code{SELECT} ¹½Ê¸¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤Ë¤Ï
- @strong{select} ¸¢¸Â¤À¤±¤¢¤ì¤Ð¤«¤Þ¤¤¤Þ¤»¤ó¡£
-¤À¤±¤Ç¤Ê¤¯¡¢¥µ¡¼¥Ð¡¼¤Î¤É¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¥¢¥¯¥»¥¹¤òµö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ç¤â¡¢
-¤¢¤ë¼ï¤Î @code{SELECT} ¤Ï¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-Î㤨¤Ð¡¢´Êñ¤Ê·×»»¤ò @code{mysql} ¥¯¥é¥¤¥¢¥ó¥È¤Ç¹Ô¤¦¾ì¹ç¤Ç¤¹¡§
-
-@example
-mysql> SELECT 1+1;
-mysql> SELECT PI()*2;
-@end example
-
-@strong{index} ¸¢¸Â¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎºîÀ®¤ÈÇË´þ(ºï½ü)¤òµö²Ä¤·¤Þ¤¹¡£
-
-@strong{alter} ¸¢¸Â¤Ï @code{ALTER TABLE} ¤Î¼Â¹Ô¤òµö²Ä¤·¤Þ¤¹¡£
-
-@strong{create} ¤È @strong{drop} ¸¢¸Â¤Ï¡¢¿·¤·¤¤¥Ç¡¼¥¿¥Ù¡¼¥¹¤ä¥Æ¡¼¥Ö¥ë¤ÎºîÀ®¡¢
-¤¢¤ë¤¤¤Ï´û¤Ë¸ºß¤¹¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¡¢¥Æ¡¼¥Ö¥ë¤ÎÇË´þ(ºï½ü)¤òµö²Ä¤·¤Þ¤¹¡£
-
-Ãí°Õ¡§ @code{mysql} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¥æ¡¼¥¶¡¼¤Ë @strong{drop} ¸¢¸Â¤òÍ¿¤¨¤ë¤È¡¢
-¤½¤Î¥æ¡¼¥¶¡¼¤Ï @strong{MySQL} ¤Î¥¢¥¯¥»¥¹¸¢¸Â¤¬³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÇË´þ¤Ç¤­¤Þ¤¹¡ª
-
-@strong{grant} ¸¢¸Â¤Ï¡¢¤¢¤Ê¤¿¤¬Â¾¤Î¥æ¡¼¥¶¡¼¤ËÂФ·¤Æ¼«Ê¬¤Î¸¢¸Â¤ò»ý¤¿¤»¤ë»ö¤òµö²Ä¤·¤Þ¤¹¡£
-
- @strong{file} ¤Î¸¢¸Â¤òÍ¿¤¨¤ë¤È¡¢@code{LOAD DATA INFILE} ¤È @code{SELECT ... INTO OUTFILE} ¹½Ê¸¤ò»ÈÍѤ·¤Æ¡¢¥µ¡¼¥Ð¡¼¤Î¥Õ¥¡¥¤¥ë¤òÆɤ߽ñ¤­¤¹¤ë»ö¤¬¤Ç¤­¤Þ¤¹¡£
- @strong{MySQL} ¥µ¡¼¥Ð¡¼¤¬¤¬Æɤ߽ñ¤­¤Ç¤­¤ë¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ¡¢¤³¤Î¸¢¸Â¤¬Í¿¤¨¤é¤ì¤¿¥æ¡¼¥¶¡¼¤Ï¥Õ¥¡¥¤¥ë¤òÆɤ߽ñ¤­¤Ç¤­¤Þ¤¹¡£
-
-»Ä¤ê¤Î¸¢¸Â¤Ï¥¢¥É¥ß¥óÁàºî¤Ë´Ø¤¹¤ëµö²Ä¤Ç¡¢@code{mysqladmin} ¥³¥Þ¥ó¥É¤ò»ÈÍѤ·¤Æ¼Â¹Ô¤·¤Þ¤¹¡£
-¼¡¤Îɽ¤Ë @code{mysqladmin} ¥³¥Þ¥ó¥É¤Î¤É¤ì¤¬¡¢¤É¤Î¸¢¸Â¤ËÂбþ¤·¤Æ¤¤¤ë¤«¤ò¼¨¤·¤Þ¤¹¡§
-
-@multitable @columnfractions .15 .85
-@item @strong{Privilege} @tab @strong{Commands permitted to privilege holders}
-@item @strong{reload} @tab @code{reload}, @code{refresh},
-@code{flush-privileges},
-@code{flush-hosts}, @code{flush-logs}, @code{flush-tables}
-@item @strong{shutdown} @tab @code{shutdown}
-@item @strong{process} @tab @code{processlist}, @code{kill}
-@end multitable
-
-@code{reload} ¥³¥Þ¥ó¥É¤Ï¥µ¡¼¥Ð¡¼¤Ë¸¢¸Â¤ÎÀßÄê¤òºÆÆɹþ¤µ¤»¤ë¤è¤¦¤ËÅÁ¤¨¤Þ¤¹¡£
-@code{refresh} ¥³¥Þ¥ó¥É¤ÏÁ´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤ò¥Õ¥é¥Ã¥·¥å¤·¡¢¥í¥°¥Õ¥¡¥¤¥ë¤ò³«¤­Ä¾¤·¤Þ¤¹¡£
-@code{flush-privileges} ¤Ï @code{reload} ¤ÈƱµÁ¤Ç¤¹¡£
-¤½¤Î¾¤Î @code{flush-*} ¥³¥Þ¥ó¥É¤Ï @code{refresh} ¤ÎÆ°ºî¤È¤è¤¯»÷¤Æ¤¤¤Þ¤¹¤¬¡¢
-ŬÍÑÈϰϤò¹Ê¤Ã¤Æ¤ª¤ê¡¢¤Á¤ç¤Ã¤È¤·¤¿¾ì¹ç¤ËÍ­¸ú¤Ç¤¹¡£
-Î㤨¤Ð¡¢¥í¥°¥Õ¥¡¥¤¥ë¤À¤±¤ò¥Õ¥é¥Ã¥·¥å¤·¤¿¤¤¾ì¹ç¡¢
-@code{refresh} ¤ò¹Ô¤¦¤è¤ê¤â @code{flush-logs} ¤¬¤¤¤¤¤Ç¤¹¡£
-
-@code{shutdown} ¥³¥Þ¥ó¥É¤Ï¡¢¥µ¡¼¥Ð¡¼¤ò¥·¥ã¥Ã¥È¥À¥¦¥ó¤·¤Þ¤¹¡£
-
-@code{processlist} ¥³¥Þ¥ó¥É¤Ï¥µ¡¼¥Ð¡¼¤¬¼Â¹Ô¤·¤Æ¤¤¤ë¥¹¥ì¥Ã¥É¤Î¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£
- @code{kill} ¥³¥Þ¥ó¥É¤Ï¥µ¡¼¥Ð¡¼¤Î¥¹¥ì¥Ã¥É¤òkill¤·¤Þ¤¹¡£
-¼«Ê¬¤Î¥¹¥ì¥Ã¥É¤Ï¾ï¤Ëɽ¼¨¡¢kill¤Ç¤­¤Þ¤¹¤¬¡¢Â¾¿Í¤Î¥¹¥ì¥Ã¥É¤ò¤½¤¦¤¹¤ë¤Ë¤Ï @strong{process} ¸¢¸Â¤¬É¬ÍפǤ¹¡£
-
-¤¢¤ë¸¢¸Â¤òÍߤ·¤¬¤ë¥æ¡¼¥¶¡¼¤À¤±¤Ë¤½¤Î¸¢¸Â¤òµö²Ä¤¹¤ë¤Î¤Ï¤è¤¤¹Í¤¨¤Ç¤¹¤¬¡¢
-¸¢¸Â¤òÍ¿¤¨¤ë¤È¤­¤Ë¤Ï¡¢ÆÃÄê¤Î»ö¹à¤ò½ÏÃΤ·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡§
-
-@itemize @bullet
-@item
-@strong{grant} ¸¢¸Â¤òµö²Ä¤µ¤ì¤¿¥æ¡¼¥¶¡¼¤Ï¡¢Â¾¤Î¥æ¡¼¥¶¡¼¤Î¸¢¸Â¤òÊѤ¨¤ë»ö¤¬¤Ç¤­¤Þ¤¹¡£
-Æó¿Í¤Î¥æ¡¼¥¶¡¼´Ö¤Ç°ã¤Ã¤Æ¤¤¤ë¸¢¸Â¤È @code{grant} ¸¢¸Â¤òÆþ¤ì´¹¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@item
-@strong{alter} ¸¢¸Â¤Ï¡¢¥Æ¡¼¥Ö¥ë̾¤ÎÊѹ¹¤ò¹Ô¤¦¤³¤È¤Ë¤è¤êÆø¢¥·¥¹¥Æ¥à¤òÇˤ뤿¤á¤Ë
-»ÈÍѤµ¤ì¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-
-@item
-@strong{file} ¸¢¸Â¤Ï¡¢¥µ¡¼¥Ð¡¼¾å¤Ë¤¢¤ëÁ´¤Æ¤ÎÆɤ߹þ¤ß²Äǽ¤Ê¥Õ¥¡¥¤¥ë¤ò
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¼è¤ê¹þ¤à¤³¤È¤¬¤Ç¤­¡¢¤³¤ì¤Ï @code{SELECT} ʸ¤Ç¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤¹¡£
-This includes the contents of all databases
-hosted by the server!
-
-@item
-@strong{shutdown} ¸¢¸Â¤Ï¡¢Â¾¤Î¥æ¡¼¥¶¡¼¤ËÂФ¹¤ë¥µ¡¼¥Ó¥¹¤ò¡¢¥µ¡¼¥Ð¡¼¤ò
-Ää»ß¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢µñÈݤ¹¤ë¤è¤¦¤Ë¤Ç¤­¤Þ¤¹¡£
-
-@item
-@strong{process} ¸¢¸Â¤Ï¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë¥¯¥¨¥ê¡¼¤ò¥×¥ì¡¼¥ó¥Æ¥­¥¹¥È¤Ç¸«¤ë¤³¤È¤Ë»È¤¨¤Þ¤¹¡£
-¥Ñ¥¹¥ï¡¼¥É¤ÎÀßÄê¡¢Êѹ¹¤Î¥¯¥¨¥ê¡¼¤â´Þ¤ß¤Þ¤¹¡£
-
-@item
- @code{mysql} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ·¤Æ¤Î¸¢¸Â¤Ï¡¢¥Ñ¥¹¥ï¡¼¥É¤ÎÊѹ¹¤È¾¤Î¸¢¸Â¤ÎÀßÄê¤òÊѹ¹¤¬¤Ç¤­¤Þ¤¹¡£
-¥Ñ¥¹¥ï¡¼¥É¤Ï°Å¹æ²½¤µ¤ì¤ÆÅÐÏ¿¤µ¤ì¤Æ¤ª¤ê¡¢°­°Õ¤Î¤¢¤ë¥æ¡¼¥¶¡¼¤Ç¤â
-ñ½ã¤ËÆɤळ¤È¤Ï¤Ç¤­¤Þ¤»¤ó¤¬¡¢¤³¤Î¸¢¸Â¤òµö²Ä¤µ¤ì¤¿¤½¤Î¥æ¡¼¥¶¡¼¤Ï¡¢
-¥Ñ¥¹¥ï¡¼¥É¤ò°ã¤¦¤â¤Î¤ËÊѤ¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@end itemize
-
-°Ê²¼¤Ï @strong{MySQL} ¤ÎÆø¢¥·¥¹¥Æ¥à¤Ç¹Ô¤¦¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡§
-
-@itemize @bullet
-@item
-¥¢¥¯¥»¥¹¤òµñÈݤ¹¤ë¥æ¡¼¥¶¡¼¤òÆÃÄꤷ¤ÆÀßÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£
-´°Á´¤Ë°ìÃפ·¤¿¥æ¡¼¥¶¡¼¤«¤é¤ÎÀܳ¤òµñÈݤǤ­¤Þ¤»¤ó¡£
-
-@item
-¥Ç¡¼¥¿¥Ù¡¼¥¹Æâ¤Î¥Æ¡¼¥Ö¥ë¤ÎºîÀ®¡¢ÇË´þ¤Î¸¢¸Â¤ò»ý¤Ä¤¬¡¢
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤½¤Î¤â¤Î¤òºîÀ®¡¢ÇË´þ¤Ç¤­¤ë¡¢¤½¤Î¤è¤¦¤Ê¥æ¡¼¥¶¡¼¤òÀßÄê¤Ç¤­¤Þ¤»¤ó¡£
-@end itemize
-
-
-@node Privileges, Connection access, Privileges provided, Privilege system
-@section Æø¢¥·¥¹¥Æ¥à¤Ï¤É¤Î¤è¤¦¤ËÆ°¤¯¤«¡©
-
-@strong{MySQL} ¤ÎÆø¢¥·¥¹¥Æ¥à¤Ï¡¢Á´¤Æ¤Î¥æ¡¼¥¶¡¼¤¬Í¿¤¨¤é¤ì¤¿µö²Ä¤ÎÈÏ°ÏÆâ¤ÇÆ°¤¯»ö¤òÊݾڤ·¤Þ¤¹¡£
-@strong{MySQL} ¥µ¡¼¥Ð¡¼¤ËÀܳ¤¹¤ë¤È¤­¡¢Ëܿͤοȸµ¤Ï¡¢@strong{Àܳ¸µ¤Î¥Û¥¹¥È} ¤È
- @strong{Àܳ¤Ë»ÈÍѤ¹¤ë¥æ¡¼¥¶¡¼Ì¾} ¤Ë¤è¤Ã¤Æ³Îǧ¤µ¤ì¤Þ¤¹¡£
-¤³¤Î¥·¥¹¥Æ¥à¤Ï¡¢¤¢¤Ê¤¿¤Î¿È¸µ¤È@strong{¤¢¤Ê¤¿¤¬Í׵᤹¤ë¤³¤È¤¬²¿¤«} ¤Ë¤è¤Ã¤Æ¡¢¸¢¸Â¤òÍ¿¤¨¤Þ¤¹¡£
-
-@strong{MySQL} ¤Ï¤¢¤Ê¤¿¤Î¥Û¥¹¥È̾¤È¥æ¡¼¥¶¡¼Ì¾¤ÎξÊý¤ò¤¢¤ï¤»¤Æ¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£
-¤³¤ì¤Ï¥¤¥ó¥¿¡¼¥Í¥Ã¥È¾å¤ËƱ¤¸Ì¾Á°¤Î¥æ¡¼¥¶¡¼¤¬¤É¤³¤«¤Ë¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¤È¤¤¤¦¤³¤È¤«¤é¤½¤¦¤·¤Æ¤¤¤Þ¤¹¡£
-Î㤨¤Ð¡¢@code{whitehouse.gov} ¤«¤éÀܳ¤·¤Æ¤­¤¿ @code{bill} ¤È¡¢
- @code{microsoft.com} ¤«¤éÀܳ¤·¤Æ¤­¤¿ @code{bill} ¤ÏƱ°ì¿Íʪ¤Ç¤¢¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£
-@strong{MySQL} ¤Ï¤³¤Î°ã¤¦¥Û¥¹¥È¤«¤éÀܳ¤·¤Æ¤­¤¿Æ±Ì¾¤Î¥æ¡¼¥¶¡¼¤ò°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ°·¤¤¤Þ¤¹¡§
- @code{whitehouse.gov} ¤«¤éÀܳ¤·¤¿ @code{bill} ¤Ë¤¢¤ëµö²Ä¤ò¤¢¤¿¤¨¡¢
-¤½¤ì¤È¤Ï°ã¤¦µö²Ä¤ò @code{microsoft.com} ¤«¤éÀܳ¤·¤Æ¤­¤¿ @code{bill} ¤ËÍ¿¤¨¤Þ¤¹¡£
-
-@strong{MySQL} ¤Î¥¢¥¯¥»¥¹¥³¥ó¥È¥í¡¼¥ë¤Ï°Ê²¼¤ÎÆó¤Ä¤«¤é¤Ê¤ê¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-Stage 1: ¥µ¡¼¥Ð¡¼¤ÏÀܳµö²Ä¤¬¤¢¤ë¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£
-
-@item
-Stage 2: Àܳµö²Ä¸å¡¢¥µ¡¼¥Ð¡¼¤Ï¤½¤ì¤¾¤ì¤Î¥ê¥¯¥¨¥¹¥È¤ò¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£
-¤¢¤Ê¤¿¤¬Í׵ᤷ¤Æ¤­¤¿»öÊÁ¤ò¡¢¤¢¤Ê¤¿¤¬¼Â¹Ô¤Ç¤­¤ë¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£
-Î㤨¤Ð¡¢¤¢¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Æ¡¼¥Ö¥ë¤Î¹Ô¤Î¼è¤ê½Ð¤·¤ä¥Æ¡¼¥Ö¥ë¤ÎÇË´þ¤ò¤¢¤Ê¤¿¤¬Ì¿Îᤷ¤¿¾ì¹ç¡¢
-¥µ¡¼¥Ð¡¼¤Ï¡¢¤¢¤Ê¤¿¤Ë¤½¤Î¥Æ¡¼¥Ö¥ë¤ËÂФ¹¤ë @strong{select} µö²Ä¤¬¤¢¤ë¤Î¤«¡¢
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ·¤Æ @strong{drop} ¤¹¤ëµö²Ä¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤ë¤Î¤«¡¢¤ò³Îǧ¤·¤Þ¤¹¡£
-@end itemize
-
-¥µ¡¼¥Ð¡¼¤Ï @code{mysql} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î @code{user}, @code{db}, @code{host} £³¤Ä¤Î¥Æ¡¼¥Ö¥ë¤«¤é¡¢
-¤³¤Î£²¤Ä¤Î¥¢¥¯¥»¥¹À©¸Â¤ò·èÄꤷ¤Þ¤¹¡£
-¤³¤Î¥Æ¡¼¥Ö¥ë¤Î¥Õ¥£¡¼¥ë¥É¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡§
-
-@multitable @columnfractions .2 .25 .25 .25
-@item @strong{Table name} @tab @code{user} @tab @code{db} @tab @code{host}
-
-@item @strong{Scope fields} @tab @code{Host} @tab @code{Host} @tab @code{Host}
-@item @tab @code{User} @tab @code{Db} @tab @code{Db}
-@item @tab @code{Password} @tab @code{User} @tab
-
-@item @strong{Privilege fields} @tab @code{Select_priv} @tab @code{Select_priv} @tab @code{Select_priv}
-@item @tab @code{Insert_priv} @tab @code{Insert_priv} @tab @code{Insert_priv}
-@item @tab @code{Update_priv} @tab @code{Update_priv} @tab @code{Update_priv}
-@item @tab @code{Delete_priv} @tab @code{Delete_priv} @tab @code{Delete_priv}
-@item @tab @code{Index_priv} @tab @code{Index_priv} @tab @code{Index_priv}
-@item @tab @code{Alter_priv} @tab @code{Alter_priv} @tab @code{Alter_priv}
-@item @tab @code{Create_priv} @tab @code{Create_priv} @tab @code{Create_priv}
-@item @tab @code{Drop_priv} @tab @code{Drop_priv} @tab @code{Drop_priv}
-@item @tab @code{Grant_priv} @tab @code{Grant_priv} @tab @code{Grant_priv}
-@item @tab @code{References_priv} @tab @tab
-@item @tab @code{Reload_priv} @tab @tab
-@item @tab @code{Shutdown_priv} @tab @tab
-@item @tab @code{Process_priv} @tab @tab
-@item @tab @code{File_priv} @tab @tab
-@end multitable
-
-¡¡¥¢¥¯¥»¥¹¥³¥ó¥È¥í¡¼¥ë¤ÎÂè2Ãʳ¬(Í׵᾵ǧ)¤Î¤¿¤á¤Ë¡¢¥µ¡¼¥Ð¡¼¤Ï¤³¤ì¤é 3 ¤Ä¤Î
-¥Æ¡¼¥Ö¥ë¤Ë¤è¤Ã¤Æ·è¤á¤é¤ì¤¿µö²Ä¤ò´ðËܤȤ·¤Þ¤¹¤¬¡¢¤â¤·¥Æ¡¼¥Ö¥ë¤ËÂФ¹¤ëÍ×µá¤Ç
-¤¢¤ë¤Ê¤é¤Ð¡¢@code{tables_priv} ¤È @code{columns_priv} ¥Æ¡¼¥Ö¥ë¤ò
-¤µ¤é¤ËÄ´¤Ù¤Þ¤¹¡£¤³¤ì¤é¤Î¥Æ¡¼¥Ö¥ë¤Î¥Õ¥£¡¼¥ë¥É¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡§
-
-@multitable @columnfractions .2 .25 .25
-@item @strong{Table name} @tab @code{tables_priv} @tab @code{columns_priv}
-
-@item @strong{Scope fields} @tab @code{Host} @tab @code{Host}
-@item @tab @code{Db} @tab @code{Db}
-@item @tab @code{User} @tab @code{User}
-@item @tab @code{Table_name} @tab @code{Table_name}
-@item @tab @tab @code{Column_name}
-
-@item @strong{Privilege fields} @tab @code{Table_priv} @tab @code{Type}
-@item @tab @code{Column_priv} @tab
-
-@item @strong{Other fields} @tab @code{Timestamp} @tab @code{Timestamp}
-@item @tab @code{Grantor} @tab
-@end multitable
-
-¡¡¥Æ¡¼¥Ö¥ë¤Î³Æ¥Õ¥£¡¼¥ë¥É¤òʬÎह¤ë¤È¡¢£²¼ïÎà¤Ë¤ï¤«¤ì¤Þ¤¹¡§
-ŬÍÑÈϰϤò»ØÄꤹ¤ë¥Õ¥£¡¼¥ë¥É(°Ê²¼¡¡¥¹¥³¡¼¥×¥Õ¥£¡¼¥ë¥É)¤Èµö²Ä¤òÄêµÁ¤¹¤ë¥Õ¥£¡¼¥ë¥É(°Ê²¼¡¡¸¢¸Â¥Õ¥£¡¼¥ë¥É)¤Ç¤¹¡£
-
-¡¡¥¹¥³¡¼¥×¥Õ¥£¡¼¥ë¥É¤Ï¡¢¸¢¸Â¥Æ¡¼¥Ö¥ë¤ÎÅÐÏ¿¤´¤È¤Ë¡¢¤½¤ÎŬÍÑÈϰϤò·è¤á¤Þ¤¹¡£
-Î㤨¤Ð¡¢ @code{user} ¥Æ¡¼¥Ö¥ë¤Î @code{Host} ¤È @code{User} ¤Ë
- @code{'thomas.loc.gov'} ¤È @code{'bob'} ¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢
-¥µ¡¼¥Ð¡¼¤Ø¤ÎÀܳ¤Ï ¥Û¥¹¥È @code{thomas.loc.gov} ¤«¤éÍ褿 @code{'bob'} ¤Ëµö²Ä¤µ¤ì¤Þ¤¹¡£
-ƱÍͤˡ¢@code{db} ¥Æ¡¼¥Ö¥ë¤Î @code{Host}, @code{User}, @code{Db} ¤Ë
- @code{'thomas.loc.gov'}, @code{'bob'}, @code{'reports'} ¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë¤È¡¢
-¥Û¥¹¥È @code{thomas.loc.gov} ¤«¤éÍ褿 @code{bob} ¤ËÂФ· @code{reports} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤¬µö¤µ¤ì¤Þ¤¹¡£
-@code{tables_priv} ¤È @code{columns_priv} ¥Æ¡¼¥Ö¥ë¤Ï¡¢
-¥Æ¡¼¥Ö¥ë¤«¡¢¥Æ¡¼¥Ö¥ë¤È¥Õ¥£¡¼¥ë¥É¤òÂФˤ·¤¿¥¹¥³¡¼¥×¥Õ¥£¡¼¥ë¥É¤ò´Þ¤ß¤Þ¤¹¡£
-
-@cindex Case sensitivity, in access checking
-¡¡¥¢¥¯¥»¥¹¤Î¥Á¥§¥Ã¥¯¤Ï¡¢@code{Host} ¤ÎÃͤϥ±¡¼¥¹Èó°Í¸¤ÇÈæ³Ó¤µ¤ì¤Þ¤¹¡£
-@code{User}, @code{Password}, @code{Db}, @code{Table_name} ¤ÎÃͤϥ±¡¼¥¹°Í¸¤ÇÈæ³Ó¤µ¤ì¤Þ¤¹¡£
-@code{Column_name} ¤ÎÃÍ¤Ï @strong{MySQL} 3.22.12 °Ê¾å¤Ç¤Ï¥±¡¼¥¹Èó°Í¸¤ÇÈæ³Ó¤µ¤ì¤Þ¤¹¡£
-(3.22.11 ¤Þ¤Ç¤Ï ¥±¡¼¥¹°Í¸¤Ç¤¹)
-
-¸¢¸Â¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥Æ¡¼¥Ö¥ë¤ËÅÐÏ¿¤µ¤ì¤ë¤³¤È¤Ë¤è¤êÍ­¸ú¤Ë¤Ê¤Ã¤¿µö²Ä¤ò¤·¤á¤·¡¢
-¤³¤ì¤Ï¤É¤ÎÁàºî¤¬¼Â¹Ô¤Ç¤­¤ë¤«¤ò¼¨¤·¤Þ¤¹¡£
-¥µ¡¼¥Ð¡¼¤Ïµö²Ä¥Æ¡¼¥Ö¥ë¤Î¾ðÊó¤ò¥æ¡¼¥¶¡¼¤Î¸¢¸Â¤òÆÀ¤ë¤¿¤á¤Ë¤Þ¤È¤á¤Þ¤¹¡£
-¤³¤Î¥æ¡¼¥¶¡¼¤Î¸¢¸Âµö²Ä¤ò³ä¤ê½Ð¤¹ÊýË¡¤Ï @ref{Request access} ¤Ë½Ò¤Ù¤Æ¤ª¤­¤Þ¤¹¡£
-
-¥¹¥³¡¼¥×¥Õ¥£¡¼¥ë¥É¤Ïʸ»ú¤ÇÄêµÁ¤µ¤ì¡¢¥Ç¥Õ¥©¥ë¥ÈÃͤ϶õʸ»ú¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡§
-
-@multitable @columnfractions .15 .15 .7
-@item @strong{Field name} @tab @strong{Type}
-@item @code{Host} @tab @code{CHAR(60)}
-@item @code{User} @tab @code{CHAR(16)}
-@item @code{Password} @tab @code{CHAR(16)}
-@item @code{Db} @tab @code{CHAR(64)} @tab (@code{CHAR(60)} for the
-@code{tables_priv} and @code{columns_priv} tables)
-@item @code{Table_name} @tab @code{CHAR(60)}
-@item @code{Column_name} @tab @code{CHAR(60)}
-@end multitable
-
-@code{user}, @code{db}, @code{host} ¥Æ¡¼¥Ö¥ë¤Ç¤Ï¡¢
-Á´¤Æ¤Î¸¢¸Â¥Õ¥£¡¼¥ë¥É¤Ï @code{ENUM('N','Y')} ¤ÇÄêµÁ¤µ¤ì¤Þ¤¹¡£
-¤³¤ÎÃÍ¤Ï @code{'N'} ¤« @code{'Y'} ¤Î¤É¤Á¤é¤«¤Ç¡¢¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï @code{'N'} ¤Ç¤¹¡£
-
-@code{tables_priv} ¤È @code{columns_priv} ¥Æ¡¼¥Ö¥ë¤Ç¤Ï¡¢
-¸¢¸Â¥Õ¥£¡¼¥ë¥É¤Ï @code{SET} ¥Õ¥£¡¼¥ë¥É¤È¤·¤ÆÄêµÁ¤µ¤ì¤Þ¤¹¡§
-
-@multitable @columnfractions .2 .2 .6
-@item @strong{Table name} @tab @strong{Field name} @tab @strong{Possible set elements}
-@item @code{tables_priv} @tab @code{Table_priv} @tab @code{'Select', 'Insert',
-'Update', 'Delete', 'Create', 'Drop', 'Grant', 'References', 'Index', 'Alter'}
-@item @code{tables_priv} @tab @code{Column_priv} @tab @code{'Select', 'Insert',
-'Update', 'References'}
-@item @code{columns_priv} @tab @code{column_priv} @tab @code{'Select', 'Insert',
-'Update', 'References'}
-@end multitable
-
-¥µ¡¼¥Ð¡¼¤Ï°Ê²¼¤Î¤è¤¦¤Ëµö²Ä¥Æ¡¼¥Ö¥ë¤ò»ÈÍѤ·¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-@code{user} ¥Æ¡¼¥Ö¥ë¤Î¥¹¥³¡¼¥×¥Õ¥£¡¼¥ë¥É¤Ï¡¢ÀܳÍ×µá¤ò¼õ¤±Æþ¤ì¤ë¤«µñÈݤ¹¤ë¤«¤ò·èÄꤷ¤Þ¤¹¡£
-For allowed connections, any privileges granted in
-the @code{user} table indicate the user's global (superuser) privileges.
-These privileges apply to @strong{all} databases on the server.
-(ÌõÃí¡§
-Î㤨¤Ð¡¢@code{user} ¥Æ¡¼¥Ö¥ë ¤Î¸¢¸Â¤ò @code{'Y'} ¤Ë¤·¤¿¾ì¹ç¡¢
-¤É¤ó¤Ê¤Ë @code{Db} ¤ä @code{Host} ¤Ç @code{'N'} ¤Ë¤·¤¿¤È¤·¤Æ¤â @code{'Y'} ¤Î¤Þ¤Þ¤Ç¤¢¤ë¡£
-¤è¤¦¤Ï @code{user} ¥Æ¡¼¥Ö¥ë¤Î¸¢¸Âµö²Ä @code{'Y'} ¤¬Á´¤Æ¤ËÈ¿±Ç¤µ¤ì¤Æ¤·¤Þ¤¦¤È¤¤¤¦»ö¡£
-@code{user} ¥Æ¡¼¥Ö¥ë¤Ë¤ÏºÇÄã¸Â¤Îµö²Ä¤òÍ¿¤¨¤ë¤è¤¦¤Ë¤·¡¢
-@code{Db} ¤ä @code{Host} ¤´¤È¤Ë¡¢¤½¤ì¤¾¤ì¤Î¸¢¸Âµö²Ä¤òÄêµÁ¤¹¤ëÊý¤¬ÌµÆñ¡£
-)
-
-@item
-@code{db} ¤È @code{host} ¥Æ¡¼¥Ö¥ë¤Ï°ì½ï¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡§
-
-@itemize @minus
-@item
-@code{db} ¥Æ¡¼¥Ö¥ë¤Î¥¹¥³¡¼¥×¥Õ¥£¡¼¥ë¥É¤Ï¤É¤Î¥Û¥¹¥È¤«¤é¤É¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥¢¥¯¥»¥¹¤Ç¤­¤ë¤«¤ò·èÄꤷ¤Þ¤¹¡£
-¸¢¸Â¥Õ¥£¡¼¥ë¥É¤Ï¡¢¤É¤¦¤¤¤Ã¤¿Áàºî¤¬¤Ç¤­¤ë¤«ÄêµÁ¤·¤Þ¤¹¡£
-
-@item
-@code{host} ¥Æ¡¼¥Ö¥ë¤Ï¡¢@code{db} ¥Æ¡¼¥Ö¥ë¤ÎÅÐÏ¿¤Ë¤Ë¥Û¥¹¥È¤òÍ¿¤¨¤¿¾ì¹ç¤Ë¡¢
-@code{db} ¥Æ¡¼¥Ö¥ë¤Î³ÈÄ¥¤È¤·¤Æ»ÈÍѤµ¤ì¤Þ¤¹¡£
-Î㤨¤Ð¡¢¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Î¸ÂÄꤷ¤¿¥Þ¥·¥ó¤«¤é¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò»ÈÍѤ·¤¿¤¤¾ì¹ç¡¢
-@code{db} ¥Æ¡¼¥Ö¥ë¤Î @code{Host} ¤ÎÃͤ϶õ¤Ë¤·¤Æ¤ª¤­¤Þ¤¹¡£
-¤½¤·¤Æ @code{host} ¥Æ¡¼¥Ö¥ë¤Ë¤½¤ì¤¾¤ì¤Î¥Û¥¹¥È¤Ë¤Ä¤¤¤Æ¤ÎÅÐÏ¿¤ò¹Ô¤¤¤Þ¤¹¡£
-¤³¤Îµ¡¹½¤Ï¡¢ @ref{Request access} ¤Ç¾ÜºÙ¤Ë½Ò¤Ù¤é¤ì¤Æ¤¤¤Þ¤¹¡£
-@end itemize
-
-@item
-@code{tables_priv} ¤È @code{columns_priv} ¥Æ¡¼¥Ö¥ë¤Ï @code{db} ¥Æ¡¼¥Ö¥ë¤Ë»÷¤Æ¤¤¤Þ¤¹¤¬¡¢
-¤½¤ì¤é¤Ï¤è¤êºÙ¤«¤¯ÄêµÁ¤Ç¤­¤Þ¤¹¡¨
-¥Ç¡¼¥¿¥Ù¡¼¥¹¥ì¥Ù¥ë¤Ç¤Ï¤Ê¤¯¡¢¥Æ¡¼¥Ö¥ë¤È¥Õ¥£¡¼¥ë¥É¤Î¥ì¥Ù¥ë¤ÇÍ¿¤¨¤Þ¤¹¡£
-@end itemize
-
-´ÉÍý¼Ô¸¢¸Â (@strong{reload}, @strong{shutdown},¤Ê¤É) ¤Ï @code{user} ¥Æ¡¼¥Ö¥ë¤Ë¤À¤±ÄêµÁ¤¹¤ë¤è¤¦¤Ë¡£
-¤³¤ì¤Ï¡¢´ÉÍý¼ÔÁàºî¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ç¤Ï¤Ê¤¯¥µ¡¼¥Ð¡¼¤Ø¤ÎÁàºî¤Ç¤¢¤ê¡¢
-¾¤Îµö²Ä¥Æ¡¼¥Ö¥ë¤Ë¤¢¤ëɬÍפ¬¤Ê¤¤¤«¤é¤Ç¤¹¡£
-¤Þ¤¿¤³¤¦¤·¤Æ¤ª¤¯¤È¡¢´ÉÍý¼ÔÁàºî¤Îµö²Ä¤Ï¡¢@code{user} ¥Æ¡¼¥Ö¥ë¤ÎÄêµÁ¤À¤±¤ò
-¸«¤ì¤Ð¤ï¤«¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-@strong{file} Áàºî¤Î¸¢¸Â¤Ï @code{user} ¥Æ¡¼¥Ö¥ë¤Ë¤À¤±ÄêµÁ¤¹¤ë¤è¤¦¤Ë¡£
-¤³¤ì¤Ï´ÉÍý¼ÔÁàºî¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬¡¢¥¢¥¯¥»¥¹¤·¤Æ¤¤¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤«¤«¤ï¤é¤º¡¢
-¥µ¡¼¥Ð¡¼Æâ¤Î¥Õ¥¡¥¤¥ë¤òÆɤ߽ñ¤­¤Ç¤­¤ë¤Î¤Ç¤¹¡£
-
-@code{mysqld} ¥µ¡¼¥Ð¡¼¤Ïµ¯Æ°»þ¤Ë¤³¤ì¤é¤Î¥Æ¡¼¥Ö¥ë¤òÆɤ߹þ¤ß¤Þ¤¹¡£
-µö²Ä¥Æ¡¼¥Ö¥ë¤ÎÊѹ¹¤òÈ¿±Ç¤µ¤»¤ëÊýË¡¤Ï¤³¤Á¤é¤ò»²¾È¤Î¤³¤È ¢ª @ref{Privilege changes}
-
-¤³¤ì¤é¤Î¥Æ¡¼¥Ö¥ë¤ÎÅÐÏ¿¤òÊѹ¹¤·¤¿¾ì¹ç¡¢»×¤Ã¤¿¤È¤ª¤ê¤Î¸¢¸Â¾õÂ֤ˤʤäƤ¤¤ë»ö¤ò³Îǧ¤¹¤ë¤³¤È¤Ï¤¤¤¤¤³¤È¤Ç¤¹¡£
-ÌäÂê¤Î²ò·è¤Ë¤Ï, @ref{Access denied}. ¥»¥­¥å¥ê¥Æ¥£¤Ë´Ø¤¹¤ë¥¢¥É¥Ð¥¤¥¹¤Ï
-@ref{Security}.
-
-ÊØÍø¤Ê¥Ä¡¼¥ë¤È¤·¤Æ @code{mysqlaccess} ¥¹¥¯¥ê¥×¥È( Yves Carlier ºî)¤¬ @strong{MySQL} ¤ÎÇÛÉۤ˴ޤޤì¤Æ¤¤¤Þ¤¹¡£
-@code{mysqlaccess} ¤ò @code{--help} ¥ª¥×¥·¥ç¥ó¤Çµ¯Æ°¤¹¤ë¤È¥Ø¥ë¥×¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£
-@code{mysqlaccess} ¤Ï @code{user},@code{db} and @code{host} ¥Æ¡¼¥Ö¥ë¤À¤±¤·¤«
-¸¡ºº¤·¤Þ¤»¤ó¡£¥Æ¡¼¥Ö¥ë¥ì¥Ù¥ë¤Î¸¢¸Â¡¢¥Õ¥£¡¼¥ë¥É¥ì¥Ù¥ë¤Î¸¢¸Â¤ÏÄ´¤Ù¤Þ¤»¤ó¡£
-
-
-@node Connection access, Request access, Privileges, Privilege system
-@section Access control, stage 1: Àܳ¤Î¾µÇ§
-
-@strong{MySQL} ¥µ¡¼¥Ð¡¼¤ËÀܳ¤¹¤ë¤È¡¢¤¢¤Ê¤¿¤¬¥Ñ¥¹¥ï¡¼¥Éǧ¾Ú¤·¤ÆÀܳ¤·¤Æ¤¤¤è¤¦¤¬¤¤¤Þ¤¤¤¬¡¢
-¥µ¡¼¥Ð¡¼¤Ï¤¢¤Ê¤¿¤Î¿È¸µ¤Ë¤è¤êÀܳ¤Îµö²ÄµñÈݤò¹Ô¤¤¤Þ¤¹¡£
-¤â¤·¿È¸µ¤¬°ìÃפ·¤Ê¤¤¾ì¹çÀܳ¤òµñÈݤ·¡¢Àܳµö²Ä¤·¤¿¾ì¹ç¡¢¥µ¡¼¥Ð¡¼¤Ï stage 2 ¤Ø¤È¿Ê¤ß¡¢Í×µá¤òÂÔ¤Á¤Þ¤¹¡£
-
-¿È¸µ¤ÏÆó¤Ä¤Î¤â¤Î¤Ë´ð¤Å¤¤¤Æ³Îǧ¤µ¤ì¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-¤¢¤Ê¤¿¤¬Àܳ¤·¤è¤¦¤È¤·¤Æ¤¤¤ë¥Û¥¹¥È
-
-@item
-¤¢¤Ê¤¿¤Î @strong{MySQL} ¥æ¡¼¥¶¡¼Ì¾
-@end itemize
-
-¿È¸µ¤Î³Îǧ¤Ï @code{user} ¥Æ¡¼¥Ö¥ë¤Î¥¹¥³¡¼¥×¥Õ¥£¡¼¥ë¥É(@code{Host}, @code{User}, @code{Password}) ¤ò»ÈÍѤ·¤Æ¹Ô¤¤¤Þ¤¹¡£
-¥µ¡¼¥Ð¡¼¤Ï @code{user} ¥Æ¡¼¥Ö¥ë¤ÎÅÐÏ¿¤Ë°ìÃפ·¤Æ¤¤¤ë¥Û¥¹¥È̾¤È¥æ¡¼¥¶¡¼Ì¾¤Ë¸Â¤êÀܳ¤òµö²Ä¤·¡¢¤½¤Î¸å¡¢¥Ñ¥¹¥ï¡¼¥É¤òÍ׵ᤷ¤Þ¤¹¡£
-
-@code{user} ¥Æ¡¼¥Ö¥ë¤Î¥¹¥³¡¼¥×¥Õ¥£¡¼¥ë¥É¤ÎÅÐÏ¿¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-@code{Host} ¤ÎÃͤϥۥ¹¥È̾¤« IP ¥¢¥É¥ì¥¹¤« @code{'localhost'}(¥í¡¼¥«¥ë¥Û¥¹¥È) ¤Ç¤¹¡£
-
-@item
-@cindex Wildcards, in @code{mysql.user} table
-@code{Host} ¤Ë¤Ï¥ï¥¤¥ë¥É¥«¡¼¥Éʸ»ú @samp{%} ¤È @samp{_} ¤ò»ÈÍѤǤ­¤Þ¤¹¡£
-
-@item
-@code{Host} ¤Ë @code{'%'} ¤òÀßÄꤹ¤ë¤È¡¢Á´¤Æ¤Î¥Û¥¹¥È¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
-@code{Host} ¤ò¶õ¤Ë¤¹¤ë¤È¡¢@code{'%'} ¤ÈƱ¤¸¤Ë¤Ê¤ê¤Þ¤¹¡£
-¤³¤ì¤é¤ÎÃͤϡ¢@emph{¤É¤ó¤Ê¥Û¥¹¥È¤â¥µ¡¼¥Ð¡¼¤ËÀܳ¤Ç¤­¤ë}¤È¤¤¤¦¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡ª
-
-@cindex Netmask notation, in @code{mysql.user} table
-@item
-As of MySQL 3.23, for @code{Host} values specified as IP numbers, you
-can specify a netmask indicating how many address bits to use for the
-network number. For example:
-
-@example
-GRANT ALL PRIVILEGES on db.* to david@'192.58.197.0/255.255.255.0';
-@end example
-
-This will allow everyone to connect from an IP where the following is true:
-
-@example
-user_ip & netmask = host_ip.
-@end example
-
-In the above example all IP:s in the interval 192.58.197.0 -
-192.58.197.255 can connect to the @strong{MySQL} server.
-
-@item
-@cindex Anonymous user
-¥ï¥¤¥ë¥É¥«¡¼¥Éʸ»ú¤Ï @code{User} ¥Õ¥£¡¼¥ë¥É¤Ë¤ÏÀßÄê¤Ç¤­¤Þ¤»¤ó¤¬¡¢
-@code{User} ¥Õ¥£¡¼¥ë¥É¤ò¥Ö¥é¥ó¥¯(¶õ)¤Ë¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤¹¡£¥Ö¥é¥ó¥¯¤ÏÁ´¤Æ¤Î̾Á°¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
-¤³¤ì¤Ï¥æ¡¼¥¶¡¼Ì¾¤¬¤Ê¤¤¾õÂÖ¤ÇÀܳ¤·¤Æ¤­¤¿¤â¤Î¤ËŬÍѤµ¤ì¡¢
-¥¯¥é¥¤¥¢¥ó¥È¤¬¥æ¡¼¥¶¡¼Ì¾¤òÌÀµ­¤·¤Ê¤¤¸Â¤ê¡¢Æ¿Ì¾¥æ¡¼¥¶¡¼(̾Á°¤¬¥Ö¥é¥ó¥¯)¤È¤·¤Æ°·¤ï¤ì¤Þ¤¹¡£
-Á´¤Æ¤Î¥¢¥¯¥»¥¹¤Î¥Á¥§¥Ã¥¯¤Ë¥Ö¥é¥ó¥¯¤Î¥æ¡¼¥¶¡¼Ì¾¤¬»ÈÍѤµ¤ì¤ë»ö¤ò°ÕÌ£¤·¤Þ¤¹¡£(that is, during stage 2)
-
-@item
-@code{Password} ¥Õ¥£¡¼¥ë¥É¤Ï¶õ¤Ë¤Ç¤­¤Þ¤¹¡£¤½¤Î¾ì¹ç¡¢¥Ñ¥¹¥ï¡¼¥É¤Ê¤·¤ÆÀܳ¤Ç¤­¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
-@end itemize
-
-@findex PASSWORD()
-Èó¥Ö¥é¥ó¥¯¤Î @code{Password} Ãͤϥѥ¹¥ï¡¼¥É¤ò°Å¹æ²½¤·¤¿¤â¤Î¤Ç¤¹¡£
-@strong{MySQL} ¤Ï¤À¤ì¤â¤¬¸«¤ì¤ë¤è¤¦¤Ë¥Ñ¥¹¥ï¡¼¥É¤òʿʸ¤Ç¤ÏÊݸ¤·¤Þ¤»¤ó¡£
-Àܳ¤ò»î¤ß¤è¤¦¤È¤·¤Æ¤¤¤ë¥æ¡¼¥¶¡¼¤Î¥Ñ¥¹¥ï¡¼¥É¤â¡¢(@code{PASSWORD()} ´Ø¿ô¤Ç)
-°Å¹æ²½¤µ¤ì¡¢@code{user} ¥Æ¡¼¥Ö¥ë¤ËÊݸ¤µ¤ì¤Æ¤¤¤ë°Å¹æ²½¥Ñ¥¹¥ï¡¼¥É¤È
-Èæ³Ó¤·¤Þ¤¹¡£¤â¤·°ìÃפ·¤¿¤Ê¤é¡¢¥Ñ¥¹¥ï¡¼¥É¤ÏÀµ¤·¤¤¤È¤¤¤¦¤³¤È¤Ç¤¹¡£
-
-°Ê²¼¤Îɽ¤Ï¡¢ÀܳÍ×µá¤ËÂФ·¤ÆÍ¿¤¨¤ë¡¢
-@code{user} ¥Æ¡¼¥Ö¥ë¤Î @code{Host} ¤È @code{User} ¤ÎÀßÄêÎã¤Ç¤¹¡§
-
-@multitable @columnfractions .25 .15 .60
-@item @code{Host} @strong{value} @tab @code{User} @strong{value} @tab @strong{Connections matched by entry}
-@item @code{'thomas.loc.gov'} @tab @code{'fred'} @tab @code{fred}, @code{thomas.loc.gov} ¤«¤éÀܳ
-@item @code{'thomas.loc.gov'} @tab @code{''} @tab @code{thomas.loc.gov} ¤«¤éÀܳ¤·¤Æ¤¯¤ëÁ´¤Æ¤Î¥æ¡¼¥¶¡¼
-@item @code{'%'} @tab @code{'fred'} @tab @code{fred}, Á´¤Æ¤Î¥Û¥¹¥È¤«¤éÀܳ
-@item @code{'%'} @tab @code{''} @tab Á´¤Æ¤Î¥Û¥¹¥È¤«¤éÀܳ¤·¤Æ¤¯¤ëÁ´¥æ¡¼¥¶¡¼
-@item @code{'%.loc.gov'} @tab @code{'fred'} @tab @code{fred}, @code{loc.gov} ¥É¥á¥¤¥óÆâ¤ÎÁ´¤Æ¤Î¥Û¥¹¥È¤«¤é¤ÎÀܳ
-@item @code{'x.y.%'} @tab @code{'fred'} @tab @code{fred}, @code{x.y.net}, @code{x.y.com},@code{x.y.edu}, ¤Ê¤É¤«¤é¤ÎÀܳ. (¤¢¤Þ¤êÍ­¸ú¤Ê»È¤¤Êý¤Ç¤Ï¤Ê¤¤¤Ç¤¹)
-@item @code{'144.155.166.177'} @tab @code{'fred'} @tab @code{fred}, IP address ¤¬ @code{144.155.166.177} ¤Î¥Û¥¹¥È¤«¤é¤ÎÀܳ
-@item @code{'144.155.166.%'} @tab @code{'fred'} @tab @code{fred}, @code{144.155.166} class C subnet Æâ¤ÎÁ´¤Æ¤Î¥Û¥¹¥È¤«¤é¤ÎÀܳ
-@item @code{'144.155.166.0/24'} @tab @code{'fred'} @tab Same as previous example
-@end multitable
-
-@code{Host} ¤Ë IP ¤Î¥ï¥¤¥ë¥É¥«¡¼¥É(Î㤨¤Ð @code{'144.155.166.%'} ¤Ï
-¥µ¥Ö¥Í¥Ã¥È¤ÎÁ´¤Æ¤Î¥Û¥¹¥È¤Ë¥Þ¥Ã¥Á) ¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¤¬¡¢¤³¤Î¾ì¹ç¡¢ @code{144.155.166.somewhere.com} ¤È¤¤¤¦¥Û¥¹¥È̾¤Ç
-¤À¤ì¤«¤¬Àܳ¤·¤è¤¦¤È¤·¤Æ¤¯¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-¤³¤Î¤è¤¦¤Ê¹¶·â¤ËÂФ·¡¢@strong{MySQL} ¤Ï¿ô»ú¤ä¥É¥Ã¥È¤Ç»Ï¤Þ¤ë¥Û¥¹¥È̾¤òµñÈݤ·¤Æ¤¤¤Þ¤¹¡£
-¤â¤· @code{1.2.foo.com} ¤Î¤è¤¦¤Ê̾Á°¤Î¥Û¥¹¥È¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢
-µö²Ä¥Æ¡¼¥Ö¥ë¤Î @code{Host} ¤Ë¤ÏÀäÂФ˥ޥåÁ¤·¤Þ¤»¤ó¡£
-IP¥¢¥É¥ì¥¹¤Î¤ß¡¢IP ¤Î¥ï¥¤¥ë¥É¥«¡¼¥É¤Ë¥Þ¥Ã¥Á¤¹¤ë»ö¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-¥µ¡¼¥Ð¡¼¤ËÍè¤ëÀܳ¤Ï¡¢@code{user} ¥Æ¡¼¥Ö¥ëÆâ¤ÎÅÐÏ¿¤Ë£±¤Ä°Ê¾å
-¥Þ¥Ã¥Á¤¹¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-Î㤨¤Ð, @code{thomas.loc.gov} ¤Î @code{fred} ¤«¤é¤ÎÀܳ¤Ï¡¢¾å¤Ë¼¨¤µ¤ì¤¿
-ÅÐÏ¿¤Î¤¦¤Á¤Î¤¤¤¯¤Ä¤«¤Ë¥Þ¥Ã¥Á¤¹¤ë¤Ç¤·¤ç¤¦¡£
-¥µ¡¼¥Ð¡¼¤Ï¡¢Ê£¿ô¤ÎÅÐÏ¿¤Ë¥Þ¥Ã¥Á¤·¤¿¾ì¹ç¡¢¤É¤Î¤è¤¦¤Ë¤·¤Æ¤½¤ÎÃ椫¤é
-»ÈÍѤ¹¤ëÅÐÏ¿¤òÁª¤Ö¤Î¤Ç¤·¤ç¤¦¡©
-¥µ¡¼¥Ð¡¼¤Ïµ¯Æ°¸å¤Ë @code{user} ¥Æ¡¼¥Ö¥ë¤ò¥½¡¼¥È¤·¡¢Ê¤Ӵ¹¤¨¤é¤ì¤¿½ç¤Ë
-ÅÐÏ¿¤ò¸¡º÷¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢¤³¤ÎÌäÂê¤ò²ò·è¤·¤Þ¤¹¡£
-ºÇ½é¤Ë¥Þ¥Ã¥Á¤·¤¿ÅÐÏ¿¤¬»ÈÍѤµ¤ì¤Þ¤¹¡£
-
-@code{user} ¥Æ¡¼¥Ö¥ë¤¬°Ê²¼¤Î¤è¤¦¤Ë¥½¡¼¥È¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¡§
-
-@example
-+-----------+----------+-
-| Host | User | ...
-+-----------+----------+-
-| % | root | ...
-| % | jeffrey | ...
-| localhost | root | ...
-| localhost | | ...
-+-----------+----------+-
-@end example
-
-¥µ¡¼¥Ð¡¼¤¬¤³¤Î¥Æ¡¼¥Ö¥ë¤òÆɤà¤È¡¢@code{Host} ¤ËÃͤ¬ºÇ¤â³Î¼Â¤ËÆÃÄê¤Ç¤­¤ë¥Û¥¹¥È¤ò»ØÄꤷ¤Æ¤¤¤ë¥¨¥ó¥È¥ê¤ò¡¢ºÇ½é¤Ë»²¾È¤·¤Þ¤¹¡£
-(@code{Host} ¹à¤Î @code{'%'} ¤Ï ``¤¹¤Ù¤Æ¤Î¥Û¥¹¥È'' ¤ò°ÕÌ£¤·¡¢¥Û¥¹¥È̾¤ò¤Ï¤Ã¤­¤ê¤ÈÆÃÄꤷ¤Æ¤¤¤ë¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó)
-
-@code{Host} ¤ÎÃͤ¬Æ±¤¸¥¨¥ó¥È¥ê¤¬¤¢¤Ã¤¿¾ì¹ç¡¢¤â¤Ã¤È¤âÌÀ³Î¤Ë @code{User} ¤ÎÃͤ¬¥æ¡¼¥¶¡¼¤ò»ØÄꤷ¤Æ¤¤¤ë¥¨¥ó¥È¥ê¤òºÇ½é¤Ë»²¾È¤·¤Þ¤¹¡£(@code{User} ¤ÎÃͤ¬¶õ¤Î¾ì¹ç¡¢``¤À¤ì¤Ç¤â'' ¤ò°ÕÌ£¤·¤Þ¤¹)
-¤³¤Î·ë²Ì¡¢@code{user} ¥Æ¡¼¥Ö¥ë¤Ï°Ê²¼¤Î¤è¤¦¤Ë¥½¡¼¥È¤µ¤ì¤Þ¤¹¡§
-
-@example
-+-----------+----------+-
-| Host | User | ...
-+-----------+----------+-
-| localhost | root | ...
-| localhost | | ...
-| % | jeffrey | ...
-| % | root | ...
-+-----------+----------+-
-@end example
-
-@cindex Grant tables, sorting
-@cindex Sorting, grant tables
-@cindex @code{user} table, sorting
-Àܳ¤¬»î¤ß¤é¤ì¤¿¾ì¹ç¡¢¥µ¡¼¥Ð¡¼¤ÏʤӴ¹¤¨¤é¤ì¤¿ÅÐÏ¿¤òõ¤·¡¢ºÇ½é¤Ë¸«¤Ä¤±¤¿¤â¤Î¤ò
-»ÈÍѤ·¤Þ¤¹¡£
-@code{'localhost'} ¤Î @code{jeffrey} ¤«¤é¤ÎÀܳ¤Ï¡¢¤Þ¤ººÇ½é¤Ë @code{Host} ¤Ë @code{localhost} ¤òÀßÄꤷ¤Æ¤¤¤ë¥¨¥ó¥È¥ê¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
-¥æ¡¼¥¶¡¼Ì¾¤¬¶õ¤Î¥¨¥ó¥È¥ê¤Ï¡¢¥Û¥¹¥È̾¤È¥æ¡¼¥¶¡¼Ì¾¤ÎξÊý¤ò»ØÄꤷ¤¿Àܳ¤Ë¤â¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
-( @code{'%'/'jeffrey'} ¥¨¥ó¥È¥ê¤â¥Þ¥Ã¥Á¤·¤Þ¤¹¡£¤¬¡¢¤³¤ì¤ÏºÇ½é¤Ë¤Ï¥Þ¥Ã¥Á¤·¤Þ¤»¤ó¡£)
-
-¤â¤¦°ìÎã¡£@code{user} ¤¬°Ê²¼¤ÎÀßÄê¤È²¾Äꤷ¤Þ¤¹¡§
-
-@example
-+----------------+----------+-
-| Host | User | ...
-+----------------+----------+-
-| % | jeffrey | ...
-| thomas.loc.gov | | ...
-+----------------+----------+-
-@end example
-
-¤³¤ì¤Ï¼¡¤Î¤è¤¦¤Ë¥½¡¼¥È¤µ¤ì¤Þ¤¹¡§
-
-@example
-+----------------+----------+-
-| Host | User | ...
-+----------------+----------+-
-| thomas.loc.gov | | ...
-| % | jeffrey | ...
-+----------------+----------+-
-@end example
-
-@code{thomas.loc.gov} ¤Î @code{jeffrey} ¤«¤é¤ÎÀܳ¤Ï¡¢ºÇ½é¤Î¥¨¥ó¥È¥ê¤Ë¥Þ¥Ã¥Á¤·¡¢
-@code{whitehouse.gov} ¤Î @code{jeffrey} ¤«¤é¤ÎÀܳ¤Ï¡¢Æó¤ÄÌܤΥ¨¥ó¥È¥ê¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
-
-ºÇ½é¤Ë¥µ¡¼¥Ð¤¬,Àܳ¤Î¤¿¤á¤Î¥Þ¥Ã¥Á¤ò¸«¤Ä¤±¤ë¤Î¤ò»î¤ß¤ë¤È¤­,¶¦Ä̤θí²ò¤ÏÍ¿¤¨¤é¤ì¤¿
-¥æ¡¼¥¶Ì¾¤ËÌÀ¤é¤«¤Ë¤½¤Î¥æ¡¼¥¶¤ò̿̾¤¹¤ë¤¹¤Ù¤Æ¤Î¥¨¥ó¥È¥ê¤¬»ÈÍѤµ¤ì¤ë¤È»×¤¦¤³¤È¤Ç¤¹.
-¤³¤ì¤Ïñ¤ËËÜÅö¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó. jeffrey¤Ë¤è¤ëthomas.loc.gov¤«¤é¤ÎÀܳ¤¬ºÇ½é¤Ë
-¥¨¥ó¥È¥ê¤Ë¤è¤Ã¤Æ¥æ¡¼¥¶Ê¬ÌîÃͤȤ·¤Æ¡Æjeffrey'¤ò´Þ¤Þ¤Ê¤¤¤¤¤º¤ì¤Î¥¨¥ó¥È¥ê¤Ë¤è¤Ã¤Æ¤ë¹ç¤ï
-¤»¤é¤ì¤ë¾ì¹ç,Á°¤ÎÎã¤Ï¤³¤ì¤ò¥æ¡¼¥¶Ì¾¤Ê¤·¤ÇÎ㼨¤·¤Þ¤¹!
-
-¤è¤¯¤¢¤ë¹Í¤¨°ã¤¤¤Ï¡¢¥æ¡¼¥¶¡¼Ì¾¤òÍ¿¤¨¤¿¾ì¹ç¡¢
-¥µ¡¼¥Ð¡¼¤¬Àܳ¤Ë¥Þ¥Ã¥Á¤¹¤ë¤â¤Î¤òõ¤¹ºÝ¤Ë¡¢
-¤½¤Î¥æ¡¼¥¶¡¼¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥ë¡¼¥ë¤¬¡¢
-ºÇ½é¤Ë»ÈÍѤµ¤ì¤ë¤À¤í¤¦¤È¹Í¤¨¤ë¤³¤È¤Ç¤¹¡£¤³¤ì¤ÏÀµ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡£
-Á°¤ÎÎã¤Ç¤³¤ì¤ò¼¨¤·¤Þ¤·¤¿¤¬¡¢@code{thomas.loc.gov} ¤Î @code{jeffrey} ¤«¤é¤ÎÀܳ¤¬
-ºÇ½é¤Ë¥Þ¥Ã¥Á¤¹¤ë¤Î¤Ï¡¢ @code{User} ¥Õ¥£¡¼¥ë¥É¤ÎÃͤ¬ @code{'jeffrey'} ¤Ë
-¤Ê¤Ã¤Æ¤¤¤ë¥¨¥ó¥È¥ê¤Ç¤Ï¤Ê¤¯¡¢¥æ¡¼¥¶¡¼Ì¾¤Ê¤·(¡á¤À¤ì¤Ç¤â) ¤Î¥¨¥ó¥È¥ê¤ÎÊý¤¬
-Àè¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡ª
-
-¤â¤·¥µ¡¼¥Ð¡¼¤Ø¤ÎÀܳ¤¬¤¦¤Þ¤¯¹Ô¤«¤Ê¤¤¾ì¹ç¡¢ @code{user} ¥Æ¡¼¥Ö¥ë¤òɽ¼¨¤·¡¢
-¥Þ¥Ë¥å¥¢¥ë¤Ç¥½¡¼¥È¤·¤Æ¤ß¤Æ¡¢¤É¤Î¥¨¥ó¥È¥ê¤ËºÇ½é¤Ë¥Þ¥Ã¥Á¤¹¤ë¤«Ãµ¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-
-@node Request access, Privilege changes, Connection access, Privilege system
-@section Access control, stage 2: Í×µá¤Î¾µÇ§
-
-°ìÅÙÀܳ¤«³ÎΩ¤µ¤ì¤ë¤È¡¢¥µ¡¼¥Ð¡¼¤Ï¥¹¥Æ¡¼¥¸£²¤Ë°Ü¤ê¤Þ¤¹¡£
-¤³¤Î¥¹¥Æ¡¼¥¸¤Ç¤Ï¡¢¥µ¡¼¥Ð¡¼¤Ï¤³¤ÎÀܳ¤«¤éÍè¤ë¤½¤ì¤¾¤ì¤ÎÍ׵᤬µö²Ä¤µ¤ì¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£
-¥Á¥§¥Ã¥¯¤Ï¼Â¹Ô¤·¤è¤¦¤È¤·¤Æ¤¤¤ëÁàºî¤Î¥¿¥¤¥×¤Ë¤è¤ê¹Ô¤¤¤Þ¤¹¡£
-¤½¤ÎÁàºî¤¬µö²Ä¥Æ¡¼¥Ö¥ë¤Î¤É¤Î¸¢¸Â¥Õ¥£¡¼¥ë¥É¤ËÅö¤Æ¤Ï¤Þ¤ë¤«¤ò¸«¤Þ¤¹¡£
-¤³¤ì¤é¸¢¸Â¤Ï @code{user}, @code{db},@code{host}, @code{tables_priv} ¤« @code{columns_priv} ¥Æ¡¼¥Ö¥ë¤è¤êƳ½Ð¤µ¤ì¤Þ¤¹¡£
-µö²Ä¥Æ¡¼¥Ö¥ë¤Ï @code{GRANT} ¥³¥Þ¥ó¥É¤ÇÁàºî¤·¤Þ¤¹¡£
-@xref{GRANT, , @code{GRANT}}.
-(You may find it helpful to refer to the table shown earlier that lists
-the fields present in each of the grant tables; see @ref{Privileges}.)
-
-@code{user} ¥Æ¡¼¥Ö¥ë¤ÏÁ´¤Æ¤ËÂФ·¤Æ´ðËܤȤʤ븢¸Â¤ò¥æ¡¼¥¶¡¼¤Ë³ä¤êÅö¤Æ¤Þ¤¹¡£
-¤¿¤È¤¨¥«¥ì¥ó¥È¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬µö²Ä¤òÍ¿¤¨¤Æ¤¤¤Ê¤¯¤Æ¤â¡¢@code{user} ¥Æ¡¼¥Ö¥ë¤ÎÀßÄ꤬ͭ¸ú¤Ë¤Ê¤ê¤Þ¤¹¡£
-Î㤨¤Ð¡¢@code{user} ¥Æ¡¼¥Ö¥ë¤Ç @strong{delete} ¤òµö²Ä¤·¤¿¾ì¹ç¡¢
-¥µ¡¼¥Ð¡¼¤Ë¤¢¤ë¤É¤ó¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¹Ô¤âºï½ü¤Ç¤­¤ë¤Î¤Ç¤¹¡ª
-¤¤¤¦¤Ê¤é¤Ð¡¢@code{user} ¥Æ¡¼¥Ö¥ë¤Î¸¢¸Â¤Ï¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤Î¸¢¸Â¤È¸À¤Ã¤Æ¤â¤¤¤¤¤Ç¤·¤ç¤¦¡£
-¤³¤Î¸¢¸Â¤Ï¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼(¥µ¡¼¥Ð¡¼¤ä¥Ç¡¼¥¿¡¼¥Ù¡¼¥¹´ÉÍý¼Ô)¤Î¤ß¤ËÍ¿¤¨¤Æ¤ª¤¯»ö¤¬¸­ÌÀ¤Ç¤¹¡£
-¾¤Î¥æ¡¼¥¶¡¼¤Ï¡¢@code{user} ¥Æ¡¼¥Ö¥ë¤Î¸¢¸Â¤ÎÀßÄê¤ò @code{'N'} ¤Î¤Þ¤Þ¤Ë¤·¤Æ¤ª¤¯¤Ù¤­¤Ç¤¹¤·¡¢
-¤Þ¤¿¡¢@code{db} ¥Æ¡¼¥Ö¥ë¤È @code{host} ¥Æ¡¼¥Ö¥ë¤òÍøÍѤ·¤Æ¡¢
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò»ØÄꤷ¤¿¾å¤Ç¥æ¡¼¥¶¡¼¤Ë¸¢¸Â¤òµö²Ä¤¹¤Ù¤­¤Ç¤¹¡£
-
-@cindex Anonymous user
-@cindex Wildcards, in @code{mysql.db} table
-@cindex Wildcards, in @code{mysql.host} table
-@code{db} ¥Æ¡¼¥Ö¥ë¤È @code{host} ¥Æ¡¼¥Ö¥ë¤ÏÆÃÄê¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ¹¤ë¸¢¸Âµö²Ä¤ò¹Ô¤¤¤Þ¤¹¡£
-Values in the scope fields may be specified as follows:
-
-@itemize @bullet
-@item
-¥ï¥¤¥ë¥É¥«¡¼¥Éʸ»ú @samp{%} ¤È @samp{_} ¤Ï @code{Db} ¥Æ¡¼¥Ö¥ë¤È @code{Host} ¥Õ¥£¡¼¥ë¥É¤À¤±¤Ë»ÈÍѤǤ­¤Þ¤¹¡£
-
-@item
-@code{'%'} @code{Host} ÃÍ¤Ï ``¤¢¤é¤æ¤ë¥Û¥¹¥È'' ¤ò°ÕÌ£¤·¤Þ¤¹¡£
-@code{db} ¥Æ¡¼¥Ö¥ë¤Î @code{Host} ¤Ë¶õ¤òÀßÄꤹ¤ë¤È¡¢``¤µ¤é¤Ë @code{host} ¥Æ¡¼¥Ö¥ë¤Ëµö²Ä¾ðÊó¤òõ¤·¤Ë¤¤¤¯''
-¤È¤Ê¤ê¤Þ¤¹¡£
-
-@item
-@code{'%'} ¤« ¶õÃͤò @code{Host} ¥Æ¡¼¥Ö¥ë¤ËÀßÄꤹ¤ë¤È¡¢¤½¤ì¤Ï ``¤¢¤é¤æ¤ë¥Û¥¹¥È'' ¤È¤Ê¤ê¤Þ¤¹¡£
-
-@item
-@code{'%'} ¤« ¶õÃͤò @code{host} ¥Æ¡¼¥Ö¥ë¤Î @code{Db} ¥Õ¥£¡¼¥ë¥É¤ËÀßÄꤹ¤ë¤È¡¢
-¤½¤ì¤Ï ``¤¢¤é¤æ¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹'' ¤È¤Ê¤ê¤Þ¤¹¡£
-
-@item
-@code{User} ¤ò¶õÃͤˤ¹¤ë¤È¡¢Æ¿Ì¾¥æ¡¼¥¶¡¼¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
-@end itemize
-
-@cindex Grant tables, sorting
-@cindex Sorting, grant tables
-@cindex @code{db} table, sorting
-@cindex @code{host} table, sorting
-¥µ¡¼¥Ð¡¼µ¯Æ°»þ¤Ë¡¢@code{db} ¥Æ¡¼¥Ö¥ë¤È @code{host} ¥Æ¡¼¥Ö¥ë¤Ï¥µ¡¼¥Ð¡¼¤ËÆɤ߹þ¤Þ¤ì¤Þ¤¹¡£
-(@code{user} ¥Æ¡¼¥Ö¥ë¤â¤³¤Î»þ¤ËƱ»þ¤ËÆɤޤì¤Þ¤¹)
-@code{db} ¥Æ¡¼¥Ö¥ë¤Ï @code{Host}, @code{Db}, @code{User} ¤Î¥Õ¥£¡¼¥ë¥É¤Ç¥½¡¼¥È¤µ¤ì¡¢
-@code{host} ¥Æ¡¼¥Ö¥ë¤Ï @code{Host}, @code{Db} ¥Õ¥£¡¼¥ë¥É¤Ç¥½¡¼¥È¤µ¤ì¤Þ¤¹¡£
-@code{user} ¥Æ¡¼¥Ö¥ë¤Ï¡¢°ìÈÖÆÃÄê¤Ç¤­¤ë¥¨¥ó¥È¥ê¤òºÇ½é¤Ë¡¢°ìÈÖÆÃÄê¤Ç¤­¤Ê¤¤¤â¤Î¤òºÇ¸å¤Ë¥½¡¼¥È¤·¤Þ¤¹¡£
-¥µ¡¼¥Ð¡¼¤Ï¥½¡¼¥È¤µ¤ì¤¿¤â¤Î¤ÎÃ椫¤é¡¢ºÇ½é¤Ë¥Þ¥Ã¥Á¤·¤¿¤â¤Î¤ò»ÈÍѤ·¤Þ¤¹¡£
-
-@cindex Wildcards, in mysql.tables_priv table
-@cindex Wildcards, in mysql.columns_priv table
-@code{tables_priv} ¤È @code{columns_priv} ¥Æ¡¼¥Ö¥ë¤Ï¡¢
-ÆÃÄê¤Î¥Æ¡¼¥Ö¥ë¤È¥Õ¥£¡¼¥ë¥É¤ËÂФ¹¤ë¸¢¸Â¤òµö²Ä¤·¤Þ¤¹¡£
-¥¹¥³¡¼¥×¥Õ¥£¡¼¥ë¥É¤ÎÃͤϡ¢¤¤¤«¤Ë¤½¤Ã¤Æµ­½Ò¤µ¤ì¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-¥ï¥¤¥ë¥É¥«¡¼¥Éʸ»ú @samp{%} ¤È @samp{_} ¤Ï¤É¤Á¤é¤«¤Î¥Æ¡¼¥Ö¥ë¤Î
-@code{Host} ¥Õ¥£¡¼¥ë¥É¤Ë»ÈÍѤǤ­¤Þ¤¹¡£
-
-@item
-¤É¤Á¤é¤«¤Î¥Æ¡¼¥Ö¥ë¤Î @code{Host} Ãͤò @code{'%'} ¤«¥Ö¥é¥ó¥¯¤Ë¤¹¤ë¤È¡¢
-``any host.'' ¤ò°ÕÌ£¤·¤Þ¤¹¡£
-
-@item
-@code{Db}, @code{Table_name}, @code{Column_name} ¥Õ¥£¡¼¥ë¥É¤Ï¤É¤Î¥Æ¡¼¥Ö¥ë¤Ë¤â
-¥ï¥¤¥ë¥É¥«¡¼¥É¤ä¥Ö¥é¥ó¥¯¤Ï»ÈÍѤǤ­¤Þ¤»¤ó¡£
-@end itemize
-
-@code{tables_priv} ¤È @code{columns_priv} ¥Æ¡¼¥Ö¥ë¤Ï
-@code{Host}, @code{Db}, @code{User} ¥Õ¥£¡¼¥ë¥É¤ÇʤӴ¹¤¨¤é¤ì¤Þ¤¹¡£
-¤³¤ì¤Ï @code{db} ¥Æ¡¼¥Ö¥ë¤Î¥½¡¼¥È¤Ë»÷¤Æ¤¤¤Þ¤¹¤¬¡¢ @code{Host} ¥Õ¥£¡¼¥ë¥É¤À¤±¤¬
-¥ï¥¤¥ë¥É¥«¡¼¥É¤ò´Þ¤à¤Î¤Ç¡¢¥½¡¼¥È¤Ï¤è¤êñ½ã¤Ê¤â¤Î¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-¤³¤ÎÍ×µá¤Î¾µÇ§¤Ï¼¡¤Î¤è¤¦¤Ë¤·¤Æ¹Ô¤¤¤Þ¤¹¡£
-¤â¤·¥¢¥¯¥»¥¹¾µÇ§¤ò·èÄꤹ¤ëÉôʬ¤Î¥½¡¼¥¹¥³¡¼¥É¤òÍý²ò¤Ç¤­¤ë¤Ê¤é¡¢
-¤Á¤ç¤Ã¤ÈÊѤï¤Ã¤¿¥¢¥ë¥´¥ê¥º¥à¤Ç¾µÇ§¤Î·èÄê¤ò¹Ô¤Ã¤Æ¤¤¤ë»ö¤Ëµ¤¤Å¤¯¤Ç¤·¤ç¤¦¡£
-
-´ÉÍý¼Ô¤ÎÍ×µá(@strong{shutdown}, @strong{reload}, etc.)¤Ë¤Ä¤¤¤Æ¤Ï¡¢¥µ¡¼¥Ð¡¼¤Ï
- @code{user} ¥Æ¡¼¥Ö¥ë¤À¤±¤ò»²¾È¤·¤Þ¤¹¡£(@code{user} ¥Æ¡¼¥Ö¥ë¤À¤±¤¬´ÉÍý¼Ô¸¢¸Â¤Î¥Õ¥£¡¼¥ë¥É¤ò»ý¤Ä)¡£
-¥¨¥ó¥È¥ê¤Ëµö²ÄÅÐÏ¿¤µ¤ì¤Æ¤¤¤ëÁàºî¤Ï¼õ¤±Æþ¤ì¤é¤ì¡¢¤½¤ì°Ê³°¤ÏµñÈݤµ¤ì¤Þ¤¹¡£
-Î㤨¤Ð¡¢@code{mysqladmin shutdown} ¤ò¼Â¹Ô¤·¤è¤¦¤È¤·¤Æ¤â¡¢@code{user} ¥Æ¡¼¥Ö¥ë¤Î @strong{shutdown} ¸¢¸Â¤¬µö¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¼Â¹Ô¤Ç¤­¤Þ¤»¤ó¡£¤³¤Î»þ¡¢@code{db} ¤È @code{host} ¥Æ¡¼¥Ö¥ë¤Ï¥Á¥§¥Ã¥¯¤µ¤ì¤Þ¤»¤ó¡£(¤³¤ì¤é¤Î¥Æ¡¼¥Ö¥ë¤Ë¤Ï @code{Shutdown_priv} ¥Õ¥£¡¼¥ë¥É¤¬Ìµ¤¤¤«¤é¤Ç¤¹)
-
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÍ×µá (@strong{insert}, @strong{update}, etc.) ¤Ë¤ª¤¤¤Æ¡¢¥µ¡¼¥Ð¡¼¤Ï¤Þ¤ººÇ½é¤Ë¡¢¥æ¡¼¥¶¡¼¤Î¥°¥í¡¼¥Ð¥ë¤Ê¸¢¸Â(¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼)¤ò @code{user} ¤ÎÃ椫¤éõ¤·¤À¤·¤Þ¤¹¡£
-¤â¤·µö²Ä¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤ì¤Ð¡¢¥¢¥¯¥»¥¹¤ÏÀ®¸ù¤·¤Þ¤¹¡£
-
-@code{user} ¥Æ¡¼¥Ö¥ë¤Î¥°¥í¡¼¥Ð¥ë¤Ê¸¢¸Â¤ÎÀßÄ꤬ÉÔ½½Ê¬¤Ç¤¢¤ë¤Ê¤é¡¢¥µ¡¼¥Ð¡¼¤Ï¥æ¡¼¥¶¡¼¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ¹¤ë¸¢¸Â¤ò @code{db} ¥Æ¡¼¥Ö¥ë¤È @code{host} ¥Æ¡¼¥Ö¥ë¤«¤é·èÄꤷ¤Þ¤¹¡§
-
-@enumerate
-@item
-¥µ¡¼¥Ð¡¼¤Ï @code{db} ¥Æ¡¼¥Ö¥ë¤Î @code{Host},@code{Db},@code{User}¥Õ¥£¡¼¥ë¥É¤ò»²¾È¤·¤Þ¤¹¡£
-@code{Host} ¤È @code{User} ¥Õ¥£¡¼¥ë¥É¤Ï¥æ¡¼¥¶¡¼¤ÎÀܳ»þ¤Î¥Û¥¹¥È̾¤È @strong{MySQL} ¥æ¡¼¥¶¡¼Ì¾¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
-@code{Db} ¥Õ¥£¡¼¥ë¥É¤Ï¥æ¡¼¥¶¡¼¤¬¥¢¥¯¥»¥¹¤·¤¿¤¤¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
-@code{Host} ¤È @code{User} ¤Ë¥Þ¥Ã¥Á¤¹¤ë¤â¤Î¤¬Ìµ¤«¤Ã¤¿¾ì¹ç¡¢¥¢¥¯¥»¥¹¤ÏµñÈݤµ¤ì¤Þ¤¹¡£
-
-@item
-@code{db} ¥Æ¡¼¥Ö¥ëÆâ¤Î @code{Host} ¥Õ¥£¡¼¥ë¥É¤¬¶õ¤Ç¤Ê¤¤¥¨¥ó¥È¥ê¤Ë¥Þ¥Ã¥Á¤·¤¿¾ì¹ç¡¢
-¥æ¡¼¥¶¡¼¤Î»ØÄꤵ¤ì¤Æ¤¤¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ¹¤ë¸¢¸Â¤¬ÄêµÁ¤µ¤ì¤Þ¤¹¡£
-
-@item
-@code{Host} ¥Õ¥£¡¼¥ë¥É¤¬¶õÃͤΠ@code{db} ¥Æ¡¼¥Ö¥ë¤Î¥¨¥ó¥È¥ê¤Ë¥Þ¥Ã¥Á¤·¤¿¾ì¹ç¡¢
-¤É¤Î¥Û¥¹¥È¤¬¤½¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¥¢¥¯¥»¥¹¤Ç¤­¤ë¤«¤ò @code{host} ¥Æ¡¼¥Ö¥ë¤«¤éõ¤·½Ð¤·¤Þ¤¹¡£
-¤³¤Î¾ì¹ç¡¢@code{host} ¥Æ¡¼¥Ö¥ë ¤Î @code{Host}, @code{Db} ¥Õ¥£¡¼¥ë¥É¤È¥Þ¥Ã¥Á¤¹¤ë¤â¤Î¤òõ¤·½Ð¤·¤Þ¤¹¡£
-@code{host} ¥Æ¡¼¥Ö¥ë¤Ë¥¨¥ó¥È¥ê¤¬¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¥¢¥¯¥»¥¹¤ÏµñÈݤµ¤ì¤Þ¤¹¡£
-¤â¤·¥Þ¥Ã¥Á¤¹¤ë¤È¡¢¥æ¡¼¥¶¡¼¤ÎÆÃÄê¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ¹¤ë¸¢¸Â¤Ï¡¢
-@code{host} ¥Æ¡¼¥Ö¥ë¤È @code{db} ¥Æ¡¼¥Ö¥ëξÊý¤Ë¤Þ¤¿¤¬¤Ã¤¿¸¢¸Â¤«¤é³ä¤ê½Ð¤µ¤ì¤Þ¤¹¡£
-¤¤¤¦¤Ê¤é¤ÐξÊý¤È¤â @code{'Y'} ¤Ç¤¢¤ë¸¢¸Â¡£
-(¤³¤ÎÊýË¡¤ò»ÈÍѤ¹¤ë¤È¡¢¤Þ¤º @code{db} ¥Æ¡¼¥Ö¥ë¤Î¥¨¥ó¥È¥ê¤ËÂç¤Þ¤«¤Ê¸¢¸Â¤òÀßÄꤷ¤Æ¤ª¤­¡¢
-¤½¤ì¤«¤é @code{host} ¥Æ¡¼¥Ö¥ë¤Î¥¨¥ó¥È¥ê¤ò»ÈÍѤ·¤Æ¡¢¥Û¥¹¥È¾ðÊó¤â¤È¤Ë¸¢¸Â¤ò¸ÂÄꤷ¤Æ¤¤¤¯¤È¤¤¤¦»ö¤¬¤Ç¤­¤Þ¤¹)
-@end enumerate
-
-ÆÃÄê¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ¹¤ë¸¢¸Â¤¬ @code{db} ¥Æ¡¼¥Ö¥ë¤È @code{host} ¥Æ¡¼¥Ö¥ë¤Î¥¨¥ó¥È¥ê¤«¤é·èÄꤵ¤ì¤¿¸å¡¢
-¥µ¡¼¥Ð¡¼¤Ï¤½¤Î³ä¤ê½Ð¤µ¤ì¤¿¸¢¸Â¤ËÂФ·¡¢@code{user} ¥Æ¡¼¥Ö¥ë¤ÆÀßÄꤵ¤ì¤Æ¤¤¤ë¸¢¸Â¤ò²Ã¤¨¤Þ¤¹¡£
-¤³¤Î·ë²Ì¤«¤éÆÀ¤é¤ì¤¿¸¢¸Â¤Ë¥Þ¥Ã¥Á¤·¤¿Í×µá¤Ï¼õ¤±Æþ¤ì¤é¤ì¤Þ¤¹¡£
-¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢¥µ¡¼¥Ð¡¼¤Ï¥æ¡¼¥¶¡¼¤Î¥Æ¡¼¥Ö¥ë¡¢¥Õ¥£¡¼¥ë¥É¤ËÂФ¹¤ëµö²Ä¤ò¡¢
- @code{tables_priv} ¤È @code{columns_priv} Æâ¤Ëõ¤·¤Þ¤¹¡£
-¥¢¥¯¥»¥¹¤Ï¤³¤Î·ë²Ì¤Ë¤è¤ê¡¢µö²Ä¡¢µñÈݤµ¤ì¤Þ¤¹¡£
-
-Àè¤Î¥æ¡¼¥¶¡¼¤Î¸¢¸Â¤¬·×»»¤µ¤ì¤ëÊýË¡¤Îµ­½Ò¤Ï¡¢boolean ɽµ­¤Ç¼¨¤¹¤Ê¤é¤Ð¡¢
-°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ë¤Ç¤·¤ç¤¦¡§
-
-@example
-global privileges
-OR (database privileges AND host privileges)
-OR table privileges
-OR column privileges
-@end example
-
-¤³¤ì¤Ï¾¯¤·Ê¬¤«¤ê¤Ë¤¯¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¡£¤â¤·¥°¥í¡¼¥Ð¥ë¤Î @code{user} ¥¨¥ó¥È¥ê
-¸¢¸Âµö²Ä¤¬¡¢¥ê¥¯¥¨¥¹¥È¤µ¤ì¤¿¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ë¤ÏÉÔ½½Ê¬¤À¤ÈºÇ½é¤Ëʬ¤«¤Ã¤¿ºÝ¡¢
-¥µ¡¼¥Ð¡¼¤¬¤³¤ì¤é¤Î¸¢¸Â¤ò database-, table-, column-¸ÇÍ­¤Î¸¢¸Â¤Î
-¸å¤Ë¡¢¤Ê¤¼¡¢Äɲ䷤Ƥ·¤Þ¤¦¤Î¤«¡£
- ¤½¤ÎÍýͳ¤Ï¡¢¥ê¥¯¥¨¥¹¥È¤¬1¸Ä°Ê¾å¤Î¸¢¸Â¤òÍ׵᤹¤ë¤À¤í¤¦¤È¤¤¤¦¤³¤È¤Ç¤¹¡£
-Î㤨¤Ð¡¢¤â¤·¤¢¤Ê¤¿¤¬ @code{INSERT ... SELECT} ¹½Ê¸¤ò¼Â¹Ô¤¹¤ë¤Ê¤é¡¢
-¤¢¤Ê¤¿¤Ë¤Ï @strong{insert} ¤È @strong{select} µö²Ä¤¬É¬ÍפǤ¹¡£
-¤¢¤Ê¤¿¤Î¸¢¸Â¤¬¡¢ @code{user} ¥Æ¡¼¥Ö¥ë¥¨¥ó¥È¥ê¤Ç°ì¤Ä¤Î¸¢¸Â¤¬µö²Ä¤µ¤ì¡¢
- @code{db} ¥Æ¡¼¥Ö¥ë¤Ç¡¢¤½¤Î¤Û¤«¤Î¸¢¸Â¤¬µö²Ä¤µ¤ì¤Æ¤¤¤¿¤È¤·¤Þ¤¹¡£
-¤³¤Î¾ì¹ç¡¢¤¢¤Ê¤¿¤Ï¡¢¤½¤Î¥ê¥¯¥¨¥¹¥È¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤Ë¡¢É¬Íפʸ¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£
-¤·¤«¤·¡¢¥µ¡¼¥Ð¡¼¤Ï¤É¤Á¤é¤Î¥Æ¡¼¥Ö¥ë¡¢¤½¤ìñÂΤ«¤é¤Ç¤Ï¡¢¸¢¸Â¤òÆÀ¤ë¤³¤È¤¬½ÐÍè¤Þ¤»¤ó¡£
-¸¢¸Â¤Ï¡¢Î¾Êý¤Î¥¨¥ó¥È¥ê¡¼¤ò¹ç¤ï¤»¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¤Î¤Ç¤¹¡£
-
-@code{host} ¥Æ¡¼¥Ö¥ë¤Ï ``°ÂÁ´¤Ê'' ¥Û¥¹¥È¤Î¥ê¥¹¥È¤ò°Ý»ý¤¹¤ë¤¿¤á¤Ë»ÈÍѤǤ­¤Þ¤¹¡£
-TcX ¤Ç¤Ï¡¢@code{host} ¥Æ¡¼¥Ö¥ë¤Ë¤Ï¥í¡¼¥«¥ë¥Í¥Ã¥È¾å¤ÎÁ´¤Æ¤Î¥Û¥¹¥È¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-¤³¤ì¤é¤Î¥Û¥¹¥È¤ÏÁ´¤Æ¤Î¸¢¸Â¤¬µö²Ä¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-
-µÕ¤Ë @code{host} table ¤Ç°ÂÁ´@emph{¤Ç¤Ï¤Ê¤¤}¥Û¥¹¥È¤ò»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
- @code{public.your.domain} ¤È¤¤¤¦¥Þ¥·¥ó¤¬°ÂÁ´¤Ç¤Ï¤Ê¤¤¡¢¸ø³«¤µ¤ì¤Æ¤¤¤ë¾ì½ê¤Ë¤¢¤ë¤È¤·¤Þ¤¹¡£
-¤½¤Î¾ì¹ç°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ¡¢¤½¤Î¸ø³«¥Þ¥·¥ó°Ê³°¤Î¥Í¥Ã¥È¥ï¡¼¥¯¾å¤Î¥Û¥¹¥È¤ËÂФ·¤Æ¡¢¥¢¥¯¥»¥¹¤òµö²Ä¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡§
-
-@example
-+--------------------+----+-
-| Host | Db | ...
-+--------------------+----+-
-| public.your.domain | % | ... (all privileges set to 'N')
-| %.your.domain | % | ... (all privileges set to 'Y')
-+--------------------+----+-
-@end example
-
-¸¢¸Â¤Î¥Æ¡¼¥Ö¥ëÀßÄê¤Ï¡¢¤¢¤Ê¤¿¤Î»×¤¤Ä̤ê¤Ëµö²Ä¤¬ÆÀ¤é¤ì¤ë¤Î¤«¡¢¾ï¤Ë(@code{mysqlaccess}Åù¤ò»ÈÍѤ·¤Æ)¥Á¥§¥Ã¥¯¤¹¤Ù¤­¤Ç¤¹¡£
-
-
-@node Privilege changes, Default privileges, Request access, Privilege system
-@section ¤¤¤Ä¸¢¸Â¤ÎÊѹ¹¤¬È¿±Ç¤µ¤ì¤ë¤«
-
-@code{mysqld} ¤Îµ¯Æ°»þ¡¢Á´¤Æ¤Îµö²Ä¥Æ¡¼¥Ö¥ë¤Ï¥á¥â¥ê¡¼¤ËÆɤ߹þ¤Þ¤ì¡¢
-¤³¤Î»þÅÀ¤ÇÍ­¸ú¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-@code{GRANT}, @code{REVOKE}, @code{SET PASSWORD} ¤ò»ÈÍѤ·¤Æµö²Ä¥Æ¡¼¥Ö¥ë¤ò
-Êѹ¹¤·¤¿¾ì¹ç¡¢Ä¾¤Ë¥µ¡¼¥Ð¤ËÄÌÃΤµ¤ì¤Þ¤¹¡£
-
-¤â¤·¼êÆ°¤Çµö²Ä¥Æ¡¼¥Ö¥ë¤òÊѹ¹¤·¤¿¾ì¹ç(@code{INSERT}, @code{UPDATE} ¤Ê¤É¤Ç)¡¢
-@code{FLUSH PRIVILEGES} ¹½Ê¸¤« @code{mysqladmin flush-privileges} ¥³¥Þ¥ó¥É
-¤« @code{mysqladmin reload} ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ¡¢
-¥µ¡¼¥Ð¡¼¤Ëµö²Ä¥Æ¡¼¥Ö¥ë¤ÎÆɤ߹þ¤ß¤ò»Ø¼¨¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-¤½¤¦¤·¤Ê¤±¤ì¤Ð¡¢¥µ¡¼¥Ð¡¼¤òºÆµ¯Æ°¤µ¤»¤ë¤Þ¤Ç¡¢Êѹ¹¤Ï@emph{È¿±Ç¤µ¤ì¤Þ¤»¤ó}¡£
-If you change the grant tables manually
-but forget to reload the privileges, you will be wondering why your changes
-don't seem to make any difference!
-
-¥µ¡¼¥Ð¡¼¤¬µö²Ä¥Æ¡¼¥Ö¥ë¤ÎÊѹ¹¤òÄÌÃΤ·¤¿¾ì¹ç¡¢´û¤ËÀܳ¤·¤Æ¤¤¤ë
-¥¯¥é¥¤¥¢¥ó¥È¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ê±Æ¶Á¤ò¼õ¤±¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-¥Æ¡¼¥Ö¥ë¤È¥Õ¥£¡¼¥ë¥É¤Îµö²Ä¤ÎÊѹ¹¤Ï¡¢¼¡¤Î¥¯¥é¥¤¥¢¥ó¥È¤ÎÍ׵ᤫ¤éÈ¿±Ç¤µ¤ì¤Þ¤¹¡£
-
-@item
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ¹¤ëµö²Ä¤ÎÊѹ¹¤Ï¼¡¤Î @code{USE db_name} ¥³¥Þ¥ó¥É°Ê¹ß¤«¤é
-Í­¸ú¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-@end itemize
-
-¥°¥í¡¼¥Ð¥ë¸¢¸Â¤È¥Ñ¥¹¥ï¡¼¥É¤ÎÊѹ¹¤Ï¡¢¼¡¤Î¥¯¥é¥¤¥¢¥ó¥È¤ÎÀܳ»þ¤«¤éÈ¿±Ç¤µ¤ì¤Þ¤¹¡£
-
-
-@node Default privileges, Adding users, Privilege changes, Privilege system
-@section @strong{MySQL} ¸¢¸Âµö²Ä¤Î½é´üÀßÄê
-
-@strong{MySQL} ¥¤¥ó¥¹¥È¡¼¥ë¸å¡¢@code{scripts/mysql_install_db} ¤ò¼Â¹Ô¤·¤Æ¸¢¸Â¤Î¥¢¥¯¥»¥¹µö²Ä¤ò½é´ü²½¤·¤Þ¤¹¡£
-@xref{Quick install}.
-@code{mysql_install_db} ¥¹¥¯¥ê¥×¥È¤Ï @code{mysqld} ¥µ¡¼¥Ð¡¼¤òµ¯Æ°¤·¡¢
-°Ê²¼¤Î¤è¤¦¤Ë¸¢¸Â¤ò½é´ü²½¤·¤Æ¥Æ¡¼¥Ö¥ë¤ËÅÐÏ¿¤·¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-@strong{MySQL} @code{root} ¥æ¡¼¥¶¡¼¤Ï¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤È¤·¤ÆÅÐÏ¿¤µ¤ì¡¢
-Á´¤Æ¤ÎÁàºî¤¬¤Ç¤­¤Þ¤¹¡£
-localhost¤«¤é¤·¤«Àܳ¤Ç¤­¤Þ¤»¤ó¡£
-
-@strong{Ãí°Õ:}
-@code{root} ¤Î¥Ñ¥¹¥ï¡¼¥É¤Î½é´üÃͤ϶õ¤Ç¤¹¡£
-Á´¤Æ¤Î¿Í¤¬ @emph{¥Ñ¥¹¥ï¡¼¥É¤Ê¤·¤Ç} @code{root} ¤Ë¤Ê¤ì¡¢Á´¤Æ¤Î¸¢¸Âµö²Ä¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@item
-@cindex Anonymous user
-@code{'test'} ¤¢¤ë¤¤¤Ï @code{'test_'} ¤Ç̾Á°¤¬¤Ï¤¸¤Þ¤Ã¤Æ¤¤¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ·¤Æ¡¢
-ƿ̾¥æ¡¼¥¶¡¼¤Ç¤â¤Ê¤ó¤Ç¤â¤Ç¤­¤ë¤è¤¦¤Ëµö²Ä¤¬Í¿¤¨¤é¤ì¤Þ¤¹¡£
-¤³¤ì¤Ï ¥í¡¼¥«¥ë¥Û¥¹¥È¤«¤é¤ÎÁ´¤Æ¤Î¥æ¡¼¥¶¡¼¤Ï ¥Ñ¥¹¥ï¡¼¥É̵¤·¤ÇÀܳ¤¬¤Ç¤­¡¢
-ƿ̾¥æ¡¼¥¶¡¼¤È¤·¤Æ°·¤ï¤ì¤ë¤È¤¤¤¦¤³¤È¤Ç¤¹¡£
-
-@item
-¤½¤Î¾¤ÎÍ×µá¤ÏµñÈݤµ¤ì¤Þ¤¹¡£Î㤨¤Ð¡¢°ìÈ̥桼¥¶¡¼¤Ï @code{mysqladmin shutdown} ¤ä @code{mysqladmin processlist} ¤ò¼Â¹Ô¤Ç¤­¤Þ¤»¤ó¡£
-@end itemize
-
-@strong{Ãí°Õ:} ¥Ç¥Õ¥©¥ë¥È¤Î¸¢¸Â¤Ï Win32 ¤Ç¤Ï°ã¤¤¤Þ¤¹¡£
-@xref{Win32 running}.
-
-½é´ü¥¤¥ó¥¹¥È¡¼¥ë¤Î¾õÂ֤ǤϤ«¤Ê¤ê¥¢¥¯¥»¥¹¤¬²òÊü¤µ¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢
-¥¤¥ó¥¹¥È¡¼¥ë¸åºÇ½é¤Ë¤¹¤ë¤³¤È¤Ï¡¢@strong{MySQL} @code{root} ¥æ¡¼¥¶¡¼¤Ë¥Ñ¥¹¥ï¡¼¥É¤òÀßÄꤹ¤ë¤³¤È¤Ç¤¹¡£
-°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹(¥Ñ¥¹¥ï¡¼¥É¤Ï @code{PASSWORD()} ´Ø¿ô¤ò»ÈÍѤ¹¤ë¤³¤È¤ò¤ªËº¤ì¤Ê¤¯)¡§
-
-@example
-shell> mysql -u root mysql
-mysql> UPDATE user SET Password=PASSWORD('new_password')
- WHERE user='root';
-mysql> FLUSH PRIVILEGES;
-@end example
-
-@strong{MySQL} 3.22 °Ê¾å¤Ç¤Ï¡¢@code{SET PASSWORD} ¹½Ê¸¤â»ÈÍѤǤ­¤Þ¤¹:
-
-@example
-shell> mysql -u root mysql
-mysql> SET PASSWORD FOR root=PASSWORD('new_password');
-@end example
-
-password ¤ò¥»¥Ã¥È¤¹¤ë¾¤ÎÊýË¡¤È¤·¤Æ¡¢@code{mysqladmin} ¥³¥Þ¥ó¥É¤â»ÈÍѤǤ­¤Þ¤¹¡§
-
-@example
-shell> mysqladmin -u root password new_password
-@end example
-
-¤â¤·ºÇ½é¤ÎÊýË¡¤Ç @code{user} ¥Æ¡¼¥Ö¥ë¤Î¥Ñ¥¹¥ï¡¼¥É¤òľÀܹ¹¿·¤·¤¿¤Ê¤é¡¢
-¥µ¡¼¥Ð¡¼¤Ëµö²Ä¥Æ¡¼¥Ö¥ë¤ÎºÆÆɤ߹þ¤ß¤ò¹Ô¤ï¤»¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó(@code{FLUSH PRIVILEGES} ¤ò»ÈÍѤ·¤Æ)¡£
-
-°ìÅÙ @code{root} ¤Î¥Ñ¥¹¥ï¡¼¥É¤òÀßÄꤷ¤¿¤Ê¤é¡¢@code{root} ¤Ç¥µ¡¼¥Ð¡¼¤ËÀܳ¤¹¤ë¾ì¹ç¤Ï
-¾ï¤Ë¥Ñ¥¹¥ï¡¼¥É¤òÍ¿¤¨¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-
-ÄɲÃÀßÄê¤ä¥Æ¥¹¥È¤ò¤·¤Æ¤¤¤ë¤¿¤á¥Ñ¥¹¥ï¡¼¥É¤òÆþ¤ì¤¿¤¯¤Ê¤¤¾ì¹ç¡¢
-@code{root} ¥Ñ¥¹¥ï¡¼¥É¤ò¥Ö¥é¥ó¥¯¤Î¤Þ¤Þ¤Ë¤·¤Æ¤ª¤³¤¦¤È¹Í¤¨¤ë¤«¤âÃΤì¤Þ¤»¤ó¤¬¡¢
-¼Â²ÔƯ¤µ¤»¤ëÁ°¤Ë¤Ïɬ¤ºÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£
-
-¤É¤Î¤è¤¦¤Ë¥Ç¥Õ¥©¥ë¥È¤Î¸¢¸Â¤òÀßÄꤷ¤Æ¤¤¤ë¤«¡¢@code{scripts/mysql_install_db} ¸«¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
-¤³¤ì¤Ï¾¤Î¥æ¡¼¥¶¡¼¤òÀßÄꤹ¤ë¤È¤­¤Ë»È¤¨¤ë¤Ç¤·¤ç¤¦¡£
-
-¤â¤·¸¢¸Â¤Î½é´ü¾õÂÖ¤ò°ã¤¦¤â¤Î¤Ë¤·¤Æ½é´ü²½¤·¤¿¤¤¤Ê¤é¡¢
-@code{mysql_install_db} ¤ò¼Â¹Ô¤¹¤ëÁ°¤ËÊÔ½¸¤·¤Æ¤â¤è¤¤¤Ç¤·¤ç¤¦¡£
-
-¤â¤·¥Æ¡¼¥Ö¥ë¤ò´°Á´¤Ëºî¤êľ¤·¤¿¤¤¤Ê¤é¡¢@code{mysql} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¸ºß¤¹¤ë
-Á´¤Æ¤Î @file{*.frm}, @file{*.MYI}, @file{*.MYD} ¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Þ¤¹¡£
-(¤³¤Î¥Ç¥£¥ì¥¯¥È¥ê¡¼¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¡¼¤Î²¼¤Ë @code{mysql} ¤È¤¤¤¦Ì¾Á°¤Ç¸ºß¤·¤Þ¤¹¡£
-@code{mysqld --help} ¤È¤¹¤ì¤Ð¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Ç¥£¥ì¥¯¥È¥ê¡¼¤¬É½¼¨¤µ¤ì¤Þ¤¹¡£)
-¤½¤·¤Æ¹¥¤ß¤Îµö²Ä¾õÂÖ¤Ë @code{mysql_install_db} ¤òÊÔ½¸¤·¤Æ¤«¤é¼Â¹Ô¤·¤Þ¤¹¡£
-
-@strong{Ãí°Õ:} @strong{MySQL} 3.22.10 °ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï,
-@file{*.frm} ¥Õ¥¡¥¤¥ë¤ò¾Ã¤·¤Æ¤Ï¤¤¤±¤Þ¤»¤ó. ¤â¤·¤¦¤Ã¤«¤ê¾Ã¤·¤Æ¤·¤Þ¤Ã¤¿¾ì¹ç¡¢
-@code{mysql_install_db} ¤ò¼Â¹Ô¤¹¤ëÁ°¤Ë¡¢ @strong{MySQL} ÇÛÉÛ¤«¤é¥³¥Ô¡¼¤·¤Ê¤ª¤µ
-¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-
-
-@node Adding users, Passwords, Default privileges, Privilege system
-@section ¿·¤·¤¤¥æ¡¼¥¶¸¢¸Â¤ò @strong{MySQL} ¤ØÄɲÃ
-
-¥æ¡¼¥¶¡¼¤Ï£²¤Ä¤Î°ã¤Ã¤¿ÊýË¡¤ÇÄɲäǤ­¤Þ¤¹¡§
-@code{GRANT} ¹½Ê¸¤ò»ÈÍѤ·¤Æ¹Ô¤¦ÊýË¡¤È¡¢
-@strong{MySQL} ¤Îµö²Ä¥Æ¡¼¥Ö¥ë¤òľÀÜÁàºî¤¹¤ëÊýË¡¤È¤Ç¤¹¡£
-@code{GRANT} ¹½Ê¸¤Î»ÈÍѤò¤ª´«¤á¤·¤Þ¤¹¡£
-
-°Ê²¼¤ÎÎã¤Ç¤Ï¡¢¤¤¤«¤Ë¤·¤Æ @code{mysql} ¥¯¥é¥¤¥¢¥ó¥È¤ò»ÈÍѤ·¤Æ¿·µ¬¤Ë¥æ¡¼¥¶¡¼¤òÅÐÏ¿¤¹¤ë¤«¤ò¼¨¤·¤Þ¤¹¡£
-°Ê²¼¤ÎÎã¤Ç¤Ï¡¢¸¢¸Â¤ÏÁ°Àá¤Ç½Ò¤Ù¤¿¥Ç¥Õ¥©¥ë¥ÈÃͤˤʤäƤ¤¤ë¤È¤·¤Þ¤¹¡£
-¤è¤Ã¤ÆÊѹ¹¤ò¹Ô¤¦¤¿¤á¤Ë¤Ï¡¢¤¢¤Ê¤¿¤Ï @code{mysqld} ¤¬Áö¤Ã¤Æ¤¤¤ë¥Þ¥·¥ó¾å¤Ë¥í¥°¥¤¥ó¤·¤Æ¤¤¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¤·¡¢
-¤«¤Ä¡¢@strong{MySQL} @code{root} ¥æ¡¼¥¶¡¼¤ÇÀܳ¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-¤µ¤é¤Ë @strong{MySQL} @code{root} ¥æ¡¼¥¶¡¼¤Ë¤Ï
- @code{mysql} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ·¤Æ @strong{insert} ¸¢¸Â¤ò»ý¤Á¡¢
-@strong{reload} ¤Î¥¢¥É¥ß¥Ë¥¹¥È¥ì¡¼¥¿¡¼¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-¤â¤· @code{root} ¥æ¡¼¥¶¡¼¤Î¥Ñ¥¹¥ï¡¼¥É¤òÊѤ¨¤Æ¤¤¤¿¤Ê¤é¤Ð¡¢
- @code{mysql} ¥³¥Þ¥ó¥É¤Ë¥Ñ¥¹¥ï¡¼¥É»ØÄê¤òÍ¿¤¨¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-
-@example
-shell> mysql --user=root mysql
-mysql> GRANT ALL PRIVILEGES ON *.* TO monty@@localhost
- IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
-mysql> GRANT ALL PRIVILEGES ON *.* TO monty@@"%"
- IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
-mysql> GRANT RELOAD,PROCESS ON *.* TO admin@@localhost;
-mysql> GRANT USAGE ON *.* TO dummy@@localhost;
-@end example
-
-¤³¤ì¤é @code{GRANT} ¹½Ê¸¤Ç¤Ï3¤Ä¤Î¿·¤·¤¤¥æ¡¼¥¶¤òºî¤ê¤Þ¤¹:
-
-@table @code
-@item monty
-¤É¤³¤«¤é¤Ç¤â¥µ¡¼¥Ð¡¼¤ËÀܳ¤Ç¤­¤ë´°Á´¤Ê¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡£
-¤·¤«¤·¡¢@strong{MySQL} ¤ò»ÈÍѤ¹¤ë»þ¤Ë¤Ï¥Ñ¥¹¥ï¡¼¥É @code{'some_pass'} ¤ò
-»ÈÍѤ¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-@code{monty@@localhost} ¤È @code{monty@@"%"} ¤ÎξÊý¤Ë @code{GRANT} ¹½Ê¸¤ò
-ȯ¹Ô¤·¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤»ö¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-¤â¤· @code{localhost} ¤«¤é¤Îµö²Ä¤ò¤·¤¿ÅÐÏ¿¤¬¤Ê¤¤¤È¡¢@code{localhost} ¤«¤éÀܳ¤·¤¿»þ¡¢
-@code{mysql_install_db} ¤¬¼«Æ°¤ÇºîÀ®¤·¤¿ @code{localhost} ¤Ø¤Îƿ̾¥æ¡¼¥¶¡¼¤¬Í¥À褵¤ì¤Þ¤¹¡£
-¤Ê¤¼¤Ê¤é¡¢ @code{Host} ¥Õ¥£¡¼¥ë¥É¤ÎÃͤ¬(¥Ö¥é¥ó¥¯¤ä¥ï¡¼¥ë¥É¥«¡¼¥É°Ê³°¤Ë)ÌÀµ­¤µ¤ì¤Æ¤ª¤ê¡¢
-µö²ÄÅÐÏ¿¤¬ MySQL ÆâÉô¤Ç¥½¡¼¥È¤µ¤ì¤ë»þ¤Ë½çÈÖ¤¬¾å¤Ë¥½¡¼¥È¤µ¤ì¤ë¤«¤é¤Ç¤¹¡£
-
-@item admin
-@code{localhost} ¤«¤é¥Ñ¥¹¥ï¡¼¥É¤Ê¤·¤ÇÀܳ¤Ç¤­¤Þ¤¹¤¬¡¢@code{reload}, @code{process} ¤Î»ÈÍѤÀ¤±¤¬µö¤µ¤ì¤Þ¤¹¡£
-¤³¤ì¤Ï¡¢@code{mysqladmin reload}, @code{mysqladmin refresh}, @code{mysqladmin flush-*} ¤½¤·¤Æ
- @code{mysqladmin processlist} ¥³¥Þ¥ó¥É¤Î¼Â¹Ô¤¬¤³¤Î¥æ¡¼¥¶¡¼¤Ëµö²Ä¤µ¤ì¤Þ¤¹¡£
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£
-¤·¤«¤·¤³¤ì¤Ï¸å¤Ç¥Æ¡¼¥Ö¥ë @code{GRANT} ¹½Ê¸¤òȯ¹Ô¤¹¤ì¤Ð¡¢
-¸Ä¡¹¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¸¢¸Â¤¬ÀßÄê¤Ç¤­¤Þ¤¹¡£
-
-@item dummy
-¥Ñ¥¹¥ï¡¼¥É¤Ê¤·¤Ç localhost ¤«¤é¤Î¤ß¡¢Àܳ¤Ç¤­¤ë¥æ¡¼¥¶¡¼¡£
-¥°¥í¡¼¥Ð¥ë¤Ê¸¢¸Â¤ÏÁ´¤Æ @code{'N'} ¤ËÀßÄꤵ¤ì¤Þ¤¹¡£
-@code{USAGE} ¸¢¸Â¤Ï¸¢¸Â̵¤·¥æ¡¼¥¶¡¼¤ÎÀßÄê¤òµö²Ä¤¹¤ë»ö¤Ë¤Ê¤ê¤Þ¤¹¡£
-¤³¤ì¤Ï¡¢ÆÃÄê¥Ç¡¼¥¿¡¼¥Ù¡¼¥¹¤ËÂФ·¤Æ¤Îµö²Ä¤ò¸å¤«¤éÍ¿¤¨¤ë»ö¤òÁÛÄꤷ¤Æ¤¤¤Þ¤¹¡£
-@end table
-
-Ʊ¤¸¥¢¥¯¥»¥¹µö²Ä¤ò @code{INSERT} ¹½Ê¸¤ò»ÈÍѤ·¤ÆľÀÜÀßÄê¤Ç¤­¤Þ¤¹¡£
-¥µ¡¼¥Ð¡¼¤Ëµö²Ä¥Æ¡¼¥Ö¥ë¤ÎºÆÆɤ߹þ¤ß¤ò»Ø¼¨¤·¤Þ¤¹¡§
-
-@example
-shell> mysql --user=root mysql
-mysql> INSERT INTO user VALUES('localhost','monty',PASSWORD('some_pass'),
- 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y')
-mysql> INSERT INTO user VALUES('%','monty',PASSWORD('some_pass'),
- 'Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y')
-mysql> INSERT INTO user SET Host='localhost',User='admin',
- Reload_priv='Y', Process_priv='Y';
-mysql> INSERT INTO user (Host,User,Password)
- VALUES('localhost','dummy','');
-mysql> FLUSH PRIVILEGES;
-@end example
-
-@strong{MySQL} ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë¤è¤ê¡¢¾å¤Î @code{'Y'} ¤Î¿ô¤¬°ã¤¦»ö¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-(3.22.11 °ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¹àÌÜ¿ô¤¬¾¯¤Ê¤¯¤Ê¤ê¤Þ¤¹).
-@code{admin} ¥æ¡¼¥¶¡¼¤òÅÐÏ¿¤Ç»ÈÍѤ·¤Æ¤¤¤ë @code{INSERT} ¤Î³ÈÄ¥¤Ï 3.22.11 °Ê¾å¤Ç²Äǽ¤Ç¤¹¡£
-
-¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤òÄêµÁ¤¹¤ë¤¿¤á¤Ë¤Ï¡¢@code{user} ¥Æ¡¼¥Ö¥ë¤Îµö²Ä¥Õ¥£¡¼¥ë¥É¤ò
-@code{'Y'} ¤Ë¤¹¤ë¤À¤±¤Ç¤«¤Þ¤¤¤Þ¤»¤ó¡£
-@code{db} ¤ä @code{host} ¥Æ¡¼¥Ö¥ë¤ËÅÐÏ¿¤ÏɬÍ×̵¤¤¤Î¤Ç¤¹¡£
-
-@code{user} ¥Æ¡¼¥Ö¥ë¤Îµö²Ä¥Õ¥£¡¼¥ë¥É¤ÏºÇ¸å¤Î @code{INSERT} ʸ¤Ç(@code{dummy} ¥æ¡¼¥¶¡¼¤Î¤¿¤á¤Ë)
-¤ÏÀßÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó¡£¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Ï¥Ç¥Õ¥©¥ë¥ÈÃͤΠ@code{'N'} ¤Ë¤Ê¤ê¤Þ¤¹¡£
-¤³¤ì¤Ï @code{GRANT USAGE} ¤¬¹Ô¤¦¤Î¤ÈƱ¤¸¤â¤Î¤Ç¤¹¡£
-
-°Ê²¼¤Ï¡¢@code{localhost}, @code{server.domain}, @code{whitehouse.gov} ¤«¤éÀܳ¤¬²Äǽ¤Ê
- @code{custom} ¥æ¡¼¥¶¡¼¤ÎÄɲÃÎã¤Ç¤¹¡£
- @code{custom} ¥æ¡¼¥¶¡¼¤Ï @code{bankaccount} ¥Ç¡¼¥¿¡¼¥Ù¡¼¥¹¤Ë¤Ï @code{localhost} ¤«¤é¤ÎÀܳ¤Î¤ß¤òµö²Ä¤µ¤ì¡¢
-@code{expenses} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤Ï @code{whitehouse.gov} ¤«¤é¤Î¤ßÀܳ¤¬µö²Ä¤µ¤ì¡¢
-@code{customer} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤ÏÁ´¤Æ¤Î¥Û¥¹¥È¤«¤éÀܳ¤Ç¤­¤Þ¤¹¡£
-@code{custom} ¥æ¡¼¥¶¡¼¤Ï¡¢ @code{stupid} ¤È¤¤¤¦¥Ñ¥¹¥ï¡¼¥É¤òÁ´¤Æ¤Î¥Û¥¹¥È¤Ç»ÈÍѤ·¤¿¤¤¤È¤·¤Þ¤¹¡£
-
-¤³¤Î¥æ¡¼¥¶¡¼¤Îµö²Ä¤ò @code{GRANT} ¹½Ê¸¤ÇÄêµÁ¤¹¤ë¤Ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-
-@example
-shell> mysql --user=root mysql
-mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
- ON bankaccount.*
- TO custom@@localhost
- IDENTIFIED BY 'stupid';
-mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
- ON expenses.*
- TO custom@@whitehouse.gov
- IDENTIFIED BY 'stupid';
-mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP
- ON customer.*
- TO custom@@'%'
- IDENTIFIED BY 'stupid';
-@end example
-
-µö²Ä¥Æ¡¼¥Ö¥ë¤òľÀÜÊѹ¹¤·¤Æ¤³¤Î¥æ¡¼¥¶¡¼¤Î¸¢¸Â¤òÀßÄꤹ¤ë¤Ë¤Ï¤¤¤«¤Î¤è¤¦¤Ë¤·¤Þ¤¹
-(@code{FLUSH PRIVILEGES} ¤òºÇ¸å¤Ë¼Â¹Ô¤·¤Æ¤¤¤ë»ö¤ËÃí°Õ)¡§
-
-@example
-shell> mysql --user=root mysql
-mysql> INSERT INTO user (Host,User,Password)
- VALUES('localhost','custom',PASSWORD('stupid'));
-mysql> INSERT INTO user (Host,User,Password)
- VALUES('server.domain','custom',PASSWORD('stupid'));
-mysql> INSERT INTO user (Host,User,Password)
- VALUES('whitehouse.gov','custom',PASSWORD('stupid'));
-mysql> INSERT INTO db
- (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,
- Create_priv,Drop_priv)
- VALUES
- ('localhost','bankaccount','custom','Y','Y','Y','Y','Y','Y');
-mysql> INSERT INTO db
- (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,
- Create_priv,Drop_priv)
- VALUES
- ('whitehouse.gov','expenses','custom','Y','Y','Y','Y','Y','Y');
-mysql> INSERT INTO db
- (Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,
- Create_priv,Drop_priv)
- VALUES('%','customer','custom','Y','Y','Y','Y','Y','Y');
-mysql> FLUSH PRIVILEGES;
-@end example
-
-ºÇ½é¤Î£³¤Ä¤Î @code{INSERT} ʸ¤Ï¡¢ @code{custom} ¥æ¡¼¥¶¡¼¤¬¤½¤ì¤¾¤ì¤Î¥Û¥¹¥È¤«¤é
-¥Ñ¥¹¥ï¡¼¥É¤Ä¤­¤ÇÀܳ¤Ç¤­¤ë¤è¤¦¤Ë @code{user} ¥Æ¡¼¥Ö¥ë¤ËÄɲ䷤Ƥ¤¤Þ¤¹¡£
-¤·¤«¤·¤³¤³¤Ç¤Ï¸¢¸Â¤Ï£±¤Ä¤âÍ¿¤¨¤é¤ì¤Æ¤¤¤Þ¤»¤ó(¸¢¸Â¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï @code{'N'} ¤Ç¤¹)¡£
-¼¡¤Î»°¤Ä¤Î @code{INSERT} ʸ¤Ï¡¢@code{bankaccount}, @code{expenses}, @code{customer}
- ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ¹¤ë³ºÅö¥Û¥¹¥È¤«¤é¤Î¥¢¥¯¥»¥¹µö²Ä¤ò @code{custom} ¥æ¡¼¥¶¡¼¤ËÍ¿¤¨¤ë¤è¤¦¤Ë¡¢
-@code{db} ¥Æ¡¼¥Ö¥ë¤ËÄɲ䷤Ƥ¤¤Þ¤¹¡£
-µö²Ä¥Æ¡¼¥Ö¥ë¤¬Ä¾ÀÜÊѹ¹¤µ¤ì¤¿¾ì¹ç¡¢¤³¤ì¤é¤ò¥µ¡¼¥Ð¡¼¤ËÈ¿±Ç¤µ¤»¤ë¤¿¤á¤Ë¡¢µö²Ä¥Æ¡¼¥Ö¥ë¤Î
-ºÆÆɤ߹þ¤ß¤ò(@code{FLUSH PRIVILEGES}¤Ç) ¥µ¡¼¥Ð¡¼¤Ë¤Ä¤²¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-
-¤â¤·¡¢¤¢¤ë¥É¥á¥¤¥ó¤ÎÁ´¤Æ¤Î¥Þ¥·¥ó¤ËÀܳ¤òµö²Ä¤·¤¿¤¤¾ì¹ç¡¢
-°Ê²¼¤Î¤è¤¦¤Ë @code{GRANT} ¹½Ê¸¤òȯ¹Ô¤·¤Þ¤¹¡§
-
-@example
-mysql> GRANT ...
- ON *.*
- TO myusername@@"%.mydomainname.com"
- IDENTIFIED BY 'mypassword';
-@end example
-
-µö²Ä¥Æ¡¼¥Ö¥ë¤òľÀÜÊѹ¹¤¹¤ë¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-
-@example
-mysql> INSERT INTO user VALUES ('%.mydomainname.com', 'myusername',
- PASSWORD('mypassword'),...);
-mysql> FLUSH PRIVILEGES;
-@end example
-¤â¤Á¤í¤ó¡¢@code{xmysqladmin}, @code{mysql_webadmin}, ¤½¤·¤Æ @code{xmysql} ¤ò»È¤Ã¤Æ
-¤â¡¢¸¢¸Â¥Æ¡¼¥Ö¥ë¤Ø¤ÎÃͤÎÁÞÆþ/Êѹ¹/¹¹¿·¤¬¤Ç¤­¤Þ¤¹¡£¤³¤ì¤é¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ï
-@uref{http://www.mysql.com/Contrib/,Contrib directory of the @strong{MySQL}
-Website}.
-¤Ë¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-
-@node Passwords, Access denied, Adding users, Privilege system
-@section ¥Ñ¥¹¥ï¡¼¥É¤ÎÀßÄêË¡
-@cindex Passwords, setting
-@findex PASSWORD()
-
-Á°Àá¤ÎÎã¤Ç½Ò¤Ù¤¿¡¢¤È¤Æ¤â½ÅÍפʴðËܸ¶Â§¡§
-
-@code{INSERT} ¤« @code{UPDATE} ¤Ç¶õ¤Ç¤Ï¤Ê¤¤¥Ñ¥¹¥ï¡¼¥É¤òÀßÄꤹ¤ë¾ì¹ç¡¢
-°Å¹æ²½¤¹¤ë¤¿¤á¤Ë @code{PASSWORD()} ´Ø¿ô¤ò»ÈÍѤ·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-¤³¤ì¤Ï @code{user} ¥Æ¡¼¥Ö¥ë¤Ï¥×¥ì¡¼¥ó¥Æ¥­¥¹¥È¤Ç¤Ê¤¯¡¢°Å¹æ²½¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤Ç¤¢¤ë¤³¤È¤òÍ׵ᤷ¤Æ¤¤¤ë¤«¤é¤Ç¤¹¡£
-¤³¤Î¸¶Â§¤ò˺¤ì¤Æ¤·¤Þ¤Ã¤¿¾ì¹ç¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ¥Ñ¥¹¥ï¡¼¥É¤ò¥»¥Ã¥È¤·¤Æ¤·¤Þ¤¦¤«¤â¤·¤ì¤Þ¤»¤ó¡§
-
-@example
-shell> mysql -u root mysql
-mysql> INSERT INTO user (Host,User,Password)
- VALUES('%','jeffrey','biscuit');
-mysql> FLUSH PRIVILEGES;
-@end example
-
-¤³¤ì¤Ï @code{user} ¥Æ¡¼¥Ö¥ë¤Ë¥×¥ì¡¼¥ó¥Æ¥­¥¹¥È¤Î @code{'biscuit'} ¤ò¥Ñ¥¹¥ï¡¼¥É¤È¤·¤ÆÅÐÏ¿¤·¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
-@code{jeffrey} ¥æ¡¼¥¶¡¼¤Ç¤³¤Î¥Ñ¥¹¥ï¡¼¥É¤ò»ÈÍѤ·¤Æ¥µ¡¼¥Ð¡¼¤ËÀܳ¤·¤è¤¦¤È¤¹¤ë¤È¡¢
- @code{mysql} ¥¯¥é¥¤¥¢¥ó¥È¤Ï°Å¹æ²½¤·¤¿¥Ñ¥¹¥ï¡¼¥É¤ò¥µ¡¼¥Ð¡¼¤ËÁ÷¤ê¤Þ¤¹¡£
-¥µ¡¼¥Ð¡¼¤Ï°Å¹æ²½¤µ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É(@code{'biscuit'} ¤Ç¤Ï@emph{¤¢¤ê¤Þ¤»¤ó}) ¤È
- @code{user} ¥Æ¡¼¥Ö¥ë¤ËÅÐÏ¿¤µ¤ì¤¿ÃÍ(@code{'biscuit'}) ¤òÈæ³Ó¤·¤Þ¤¹¡£
-¤½¤Î·ë²Ì¡¢Èæ³Ó¤Ï¼ºÇÔ¤·¡¢¥µ¡¼¥Ð¡¼¤ÏÀܳ¤òµñÈݤ·¤Þ¤¹¡§
-
-@example
-shell> mysql -u jeffrey -pbiscuit test
-Access denied
-@end example
-
- @code{user} ¥Æ¡¼¥Ö¥ë¤ËÅÐÏ¿¤µ¤ì¤ë¥Ñ¥¹¥ï¡¼¥É¤Ï°Å¹æ²½¤µ¤ì¤¿¤â¤Î¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-@code{INSERT} ¹½Ê¸¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ»ÈÍѤ·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡§
-
-@example
-mysql> INSERT INTO user (Host,User,Password)
- VALUES('%','jeffrey',PASSWORD('biscuit'));
-@end example
-
-@code{SET PASSWORD} ¹½Ê¸¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡§
-
-@example
-mysql> SET PASSWORD FOR jeffrey@@"%" = PASSWORD('biscuit');
-@end example
-
-¤â¤· @code{GRANT ... IDENTIFIED BY} ¹½Ê¸¤ä @code{mysqladmin password} ¥³¥Þ¥ó¥É
-¤Ç¥Ñ¥¹¥ï¡¼¥É¤òÀßÄꤷ¤¿¾ì¹ç¡¢@code{PASSWORD()} ´Ø¿ô¤ÏɬÍפ¢¤ê¤Þ¤»¤ó¡£
-ξÊý¤È¤â¡¢¥Ñ¥¹¥ï¡¼¥É¤ò°Å¹æ²½¤·¤Æ¤¯¤ì¤Þ¤¹¤Î¤Ç¡¢
-°Ê²¼¤Î¤è¤¦¤Ë@code{'biscuit'}¤ÈÍ¿¤¨¤Þ¤¹¡§
-
-@example
-mysql> GRANT USAGE ON *.* TO jeffrey@@"%" IDENTIFIED BY 'biscuit';
-
-shell> mysqladmin -u jeffrey password biscuit
-@end example
-
-@strong{Ãí°Õ}¡§ @code{PASSWORD()} ¤¬¥Ñ¥¹¥ï¡¼¥É¤ò°Å¹æ²½¤¹¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-¤³¤Î°Å¹æ²½¤Ï UNIX ¤Î¥Ñ¥¹¥ï¡¼¥É¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë°Å¹æ²½¤È°ã¤¦¤³¤È¤Ë¤âα°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-UNIX ¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤Ëµ­Ï¿¤µ¤ì¤Æ¤¤¤ë°Å¹æ¤È @code{PASSWORD()} ¤¬°Å¹æ²½¤·¤¿Êª¤¬Æ±¤¸¤Ç¤â¡¢
-Ʊ¤¸¥Ñ¥¹¥ï¡¼¥É¤Ç¤¢¤ë¤È¤Ï»×¤ï¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£
-@xref{User names}.
-
-@node Access denied, , Passwords, Privilege system
-@section ²¿¸Î @code{Access denied} ¥¨¥é¡¼¤Ë¤Ê¤ë¤Î¤«
-
-¤â¤·¡¢@strong{MySQL} ¥µ¡¼¥Ð¡¼¤ËÀܳ¤·¤è¤¦¤È¤·¤Æ @code{Access denied} ¥¨¥é¡¼¤Ë
-Áø¶ø¤·¤Æ¤·¤Þ¤Ã¤¿¤é¡¢°Ê²¼¤Ëµ­¤¹¤³¤È¤¬ÌäÂê¤Î²ò·è¤Î¤¿¤á¤Î»Øɸ¤È¤Ê¤ë¤Ç¤·¤ç¤¦:
-
-@itemize @bullet
-@item
-@strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¸å¤Ë¡¢¥¹¥¯¥ê¥×¥È @code{mysql_install_db} ¤ò¼Â¹Ô¤·¤Æ
-µö²Ä¥Æ¡¼¥Ö¥ë¤ò½é´ü²½¤·¤Þ¤·¤¿¤«¡©
-¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£@xref{Default privileges}
-¸¢¸Âµö²Ä¤Î¥Æ¡¼¥Ö¥ë¤¬½é´ü²½¤µ¤ì¤Æ¤¤¤ë¤«¤ò»î¤¹¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-
-@example
-shell> mysql -u root test
-@end example
-
-¤³¤ì¤ÏÉáÄ̤ϥ¨¥é¡¼¤Ê¤·¤ÇÀܳ¤Ç¤­¤Þ¤¹¡£
-@strong{MySQL} ¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥êÆâ¤Ë @file{user.MYD} ¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¤«¤É¤¦¤«¤Ç¤â¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£
-(ÉáÄÌ¤Ï @file{PATH/var/mysql/user.MYD} ¤Ç¤¹¡£¤³¤³¤Ç @code{PATH} ¤Ï @strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¥Ç¥£¥ì¥¯¥È¥ê¡¼¥Ñ¥¹¤ò¼¨¤·¤Þ¤¹¡£)
-
-@item
-½é¤á¤Æ¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¸å¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ¥µ¡¼¥Ð¡¼¤ËÀܳ¤·¤Æ¥æ¡¼¥¶¡¼¤È¥¢¥¯¥»¥¹¸¢¤òÀßÄꤷ¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡§
-
-@example
-shell> mysql -u root mysql
-@end example
-
-½é´ü¾õÂ֤Ǥϡ¢@strong{MySQL} ¤Ë @code{root} ¥æ¡¼¥¶¡¼¤ò¥Ñ¥¹¥ï¡¼¥É¤Ê¤·¤ÇÅÐÏ¿¤·¤Æ¤¤¤ë¤Î¤Ç¡¢
-ÌäÂê¤Ê¤¯Àܳ¤Ç¤­¤ë¤Ï¤º¤Ç¤¹¡£
-¤·¤«¤·¤³¤ì¤Ï¥»¥­¥å¥ê¥Æ¥£¾å´í¸±¤Ê¾õÂ֤ʤΤǡ¢
-¾¤Î @strong{MySQL} ¥æ¡¼¥¶¡¼¤òÅÐÏ¿¤·¤Æ¤¤¤ë»þ¤Ë¡¢
-@code{root} ¤Î¥Ñ¥¹¥ï¡¼¥É¤òÀßÄꤷ¤Æ¤ª¤¤¤Æ¤¯¤À¤µ¤¤¡£
-
-¤â¤· @code{root} ¤ÇÀܳ¤·¤è¤¦¤È¤·¤Æ°Ê²¼¤Î¥¨¥é¡¼¤¬½Ð¤¿¾ì¹ç¡§
-
-@example
-Access denied for user: '@@unknown' to database mysql
-@end example
-
-¤³¤ì¤Ï @code{user} ¥Æ¡¼¥Ö¥ë¤Ë¡¢ @code{User} ¥Õ¥£¡¼¥ë¥É = @code{root} ¤«¤Ä
-@code{mysqld} ¤¬¥ê¥¾¥ë¥Ö¤Ç¤­¤Ê¤«¤Ã¤¿¥Û¥¹¥È̾¤Ç¡¢¥¯¥é¥¤¥¢¥ó¥È¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¤é¤Ç¤¹¡£
-¤³¤Î¾ì¹ç¡¢ @file{/etc/hosts} ¥Õ¥¡¥¤¥ë¤¢¤ë¤¤¤Ï @file{\windows\hosts} ¥Õ¥¡¥¤¥ë¤òÊÔ½¸¤·¤Æ
-¥Û¥¹¥È̾¤òÄɲä·¡¢@code{--skip-grant-tables} ¥ª¥×¥·¥ç¥ó¤Ç¥µ¡¼¥Ð¡¼¤ò¥ê¥¹¥¿¡¼¥È¤·¤Þ¤¹¡£
-
-@cindex @code{mysql_fix_privilege_tables}
-¤â¤· 3.22.11 ¤è¤êÁ°¤Î @strong{MySQL} ¤«¤é 3.22.11 °Ê¾å¤Ë¥Ð¡¼¥¸¥ç¥ó¥¢¥Ã¥×¤·¤¿¤Ê¤é¡¢
-@code{mysql_fix_privilege_tables} ¥¹¥¯¥ê¥×¥È¤ò¼Â¹Ô¤·¤Þ¤·¤¿¤«¡©
-¼Â¹Ô¤·¤Æ¤¤¤Ê¤¤¤Ê¤é¡¢¤³¤Î¥¨¥é¡¼¤Ë¤Ê¤ê¤Þ¤¹¡£
-µö²Ä¥Æ¡¼¥Ö¥ë¤Î¹½Â¤¤¬ @strong{MySQL} 3.22.11 ¤«¤éÊѹ¹¤µ¤ì¡¢
-@code{GRANT} ¹½Ê¸¤¬µ¡Ç½¤·¤Æ¤¤¤Þ¤¹¡£
-
-@item
-¤â¤·µö²Ä¥Æ¡¼¥Ö¥ë¤òľÀÜÊѤ¨¤Æ(@code{INSERT} ¤« @code{UPDATE} ¹½Ê¸¤Ç)¡¢
-Êѹ¹¤¬Ìµ»ë¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ê¤é¤Ð¡¢¥µ¡¼¥Ð¡¼¤Ë¥Æ¡¼¥Ö¥ë¤òºÆÆɤ߹þ¤ß¤µ¤»¤ë¤¿¤á¤Ë¡¢
-@code{FLUSH PRIVILEGES} ¹½Ê¸¤« @code{mysqladmin flush-privileges} ¥³¥Þ¥ó¥É¤ò
-¼Â¹Ô¤¹¤ë»ö¤ò»×¤¤½Ð¤·¤Æ¤¯¤À¤µ¤¤¡£
-¤³¤ì¤ò¼Â¹Ô¤·¤Ê¤«¤Ã¤¿¾ì¹ç¡¢Êѹ¹¤Ï¼¡¤Î¥µ¡¼¥Ð¡¼¤Î¥ê¥¹¥¿¡¼¥È¤Þ¤ÇÈ¿±Ç¤µ¤ì¤Þ¤»¤ó¡£
-@code{root} ¥æ¡¼¥¶¡¼¤Î¥Ñ¥¹¥ï¡¼¥É¤òÀßÄꤷ¤¿¤¢¤È¤Ç¤â¡¢
-¸¢¸Â¾ðÊó¤òºÆÆɤ߹þ¤ß¤¹¤ë¤Þ¤Ç¤Ï¿·¤·¤¤¥Ñ¥¹¥ï¡¼¥É¤ÏÉÔÍפǤ¹¡£
-¤Ê¤¼¤Ê¤é¡¢¥µ¡¼¥Ð¡¼¤Ï¿·¤·¤¤¥Ñ¥¹¥ï¡¼¥É¤ò¤Þ¤ÀÃΤé¤Ê¤¤¤«¤é¤Ç¤¹¡ª
-
-@code{mysqladmin reload} ¤ò¹Ô¤Ã¤Æ¤â¡¢¸¢¸Â¤¬Í­¸ú¤Ê¤Î¤Ï¡¢
-¤³¤Î¥³¥Þ¥ó¥Éȯ¹Ô¸å¤Ë¿·¤·¤¯Àܳ¤·¤¿¥¯¥é¥¤¥¢¥ó¥È¤ËÂФ·¤Æ¤À¤±¤Ç¤¹¡£
-(¿¤¯¤Î¸¢¸Â¾ðÊ󤬥µ¡¼¥Ð¡¼¤Ë¥­¥ã¥Ã¥·¥å¤µ¤ì¤Æ¤¤¤ë¤¿¤á¤Ç¤¹)
-
-@item
-¤â¤·¤¢¤Ê¤¿¤Î¸¢¸Â¤¬¥»¥Ã¥·¥ç¥ó¤ÎÅÓÃæ¤ÇÊѹ¹¤µ¤ì¤¿¤è¤¦¤Ë»×¤Ã¤¿¤Ê¤é¡¢¤½¤ì¤Ï
-¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼¤¬¸¢¸Â¤òÊѤ¨¤¿¤Î¤«¤âÃΤì¤Þ¤»¤ó¡£µö²Ä¥Æ¡¼¥Ö¥ë¤ÎºÆÆɤ߹þ¤ß¤Ï
-¿·¤·¤¤¥¯¥é¥¤¥¢¥ó¥È¤ÎÀܳ¤«¤éÈ¿±Ç¤µ¤ì¤Þ¤¹¤¬¡¢¤¹¤Ç¤ËÀܳ¤·¤Æ¤¤¤ë¾ì¹ç¤Ç¤â
-@ref{Privilege changes}. ¤Ë¼¨¤¹¾ò·ï²¼¤Ç¤Ï±Æ¶Á¤ò¼õ¤±¤Þ¤¹¡£
-
-@item
-¥Æ¥¹¥È¤Î¤¿¤á¤Ë¤Ï¡¢@code{mysqld} ¥Ç¡¼¥â¥ó¤ò @code{--skip-grant-tables} ¥ª¥×¥·¥ç
-¥ó¤Ç³«»Ï¤¹¤Ù¤­¤Ç¤¹¡£¤½¤¦¤¹¤ì¤Ð @strong{MySQL} ¾µÇ§¥Æ¡¼¥Ö¥ë¤òÊѹ¹¤Ç¤­¡¢¥¹¥¯¥ê¥×
-¥È @code{mysqlaccess} ¤ò¡¢¤¢¤Ê¤¿¤Î¾µÇ§¤¬Æ¯¤¯¤«¤É¤¦¤«¤Î¥Á¥§¥Ã¥¯¤Î¤¿¤á¤Ë»È
-ÍѤǤ­¤Þ¤¹¡£
-@code{mysqladmin flush-privileges} ¤Ï @code{mysqld} ¥Ç¡¼¥â¥ó¤Ë¿·¤·¤¤¾µÇ§¥Æ¡¼¥Ö¥ë¤Î
-»ÈÍѤò³«»Ï¤¹¤ë¤è¤¦¤ËÃΤ餻¤Þ¤¹¡£¤³¤ì¤Ï @code{--skip-grant-tables} ¥ª¥×¥·¥ç¥ó¤ò¾å½ñ¤­¤·¤Þ¤¹¡£
-¥æ¡¼¥¶¡¼¤Îµö²Ä¥Æ¡¼¥Ö¥ë¤òÆɤ߹þ¤Þ¤»¤ë¤Î¤Ë¡¢¥µ¡¼¥Ð¡¼¤òÍ¤ÆΩ¤Á¾å¤²Ä¾¤¹É¬ÍפϤ¢¤ê¤Þ¤»¤ó¡£
-
-@item
-Perl, PHP, Python ¤Þ¤¿¤Ï ODBC ¤Ç¥¢¥¯¥»¥¹¤ÎÌäÂ꤬¤¢¤Ã¤¿¾ì¹ç¤â¡¢¾ï¤Ë
-@code{mysql -u user_name db_name} ¤Þ¤¿¤Ï @code{mysql -u user_name -pyour_pass db_name} ¤Ç¡¢
-¸¢¸Â¤ÎÌäÂê¤ò¥Æ¥¹¥È¤·¤Æ¤¯¤À¤µ¤¤¡£(@code{-p} ¤È password ¤Î´Ö¤Ë¤Ï¶õ
-Çò¤¬¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£@code{--password=your_password} ¹½Ê¸¤Ç¤â
-¥Ñ¥¹¥ï¡¼¥É¤òÍ¿¤¨¤é¤ì¤Þ¤¹)
-@code{mysql} ¥¯¥é¥¤¥¢¥ó¥È¤ÇÀܳ¤Ç¤­¤ë¤Ê¤é¡¢¥¢¥¯¥»¥¹¤Î¸¢¸Â¤ÎÀßÄê¤ÎÌäÂê¤Ç¤Ï¤Ê¤¯¡¢
-¥×¥í¥°¥é¥à¤ÎÌäÂê¤Ç¤¹¡£
-
-@item
-¤â¤·¤¢¤Ê¤¿¤Î¥Ñ¥¹¥ï¡¼¥É¤¬Æ¯¤«¤Ê¤¤¤Î¤Ç¤¢¤ì¤Ð¡¢
-@code{INSERT}, @code{UPDATE}, @code{SET PASSWORD} ¹½Ê¸¤Ç¥Ñ¥¹¥ï¡¼¥É¤òÀßÄꤹ¤ë¤È¤­
- @code{PASSWORD()} ´Ø¿ô¤ò»ÈÍѤ·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤ò»×¤¤½Ð¤·¤Æ¤¯¤À¤µ¤¤¡£
-¤·¤«¤· @code{PASSWORD()} ´Ø¿ô¤Ï¡¢@code{GRANT ... INDENTIFIED BY} ¹½Ê¸¤ä
-@code{mysqladmin password} ¥³¥Þ¥ó¥É¤Ç¤ÏÉÔÍפǤ¹¡£
-@xref{Passwords}.
-
-@item
-@code{localhost} ¤Ï¥í¡¼¥«¥ë¤Î¥Û¥¹¥È̾¤Ç¤¹¡£
-¤â¤·¥¯¥é¥¤¥¢¥ó¥È¤¬¥Û¥¹¥È¤ò»ØÄꤻ¤º¤ËÀܳ¤·¤Æ¤­¤¿¾ì¹ç¡¢@code{localhost} ¤¬¥Ç¥Õ¥©¥ë¥È¤Ç»ÈÍѤµ¤ì¤Þ¤¹¡£
-¤·¤«¤·¡¢ MIT-pthreads ¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢@code{localhost} ¤Ø¤ÎÀܳ¤Ï¼ºÇÔ¤·¤Þ¤¹¡£
-(@code{localhost} ¤Ø¤ÎÀܳ¤Ï¡¢Unix¥½¥±¥Ã¥È¤ò»ÈÍѤ·¤Þ¤¹¤¬¡¢ MIT-pthreads ¤¬ ¥½¥±¥Ã¥ÈÀܳ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¤¿¤á¤Ç¤¹¡£)
-¤³¤ÎÌäÂ꤬µ¯¤­¤ë¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥µ¡¼¥Ð¡¼Ì¾¤ò»ØÄꤹ¤ë¤¿¤á¤Ë @code{--host} ¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£
-¤³¤ì¤Ï TCP/IP Àܳ¤ò»ÈÍѤ·¤Æ @code{mysqld} ¥µ¡¼¥Ð¡¼¤ËÀܳ¤·¤Þ¤¹¡£
-¤³¤Î¾ì¹ç¡¢@code{user} ¥Æ¡¼¥Ö¥ë¤Ë¡¢¥µ¡¼¥Ð¡¼¤Î¼Â¥Û¥¹¥È̾¤òÅÐÏ¿¤·¤Æ¤ª¤«¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-(¤³¤ì¤Ï¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤ò¥µ¡¼¥Ð¡¼¤ÈƱ¤¸¥Û¥¹¥È¾å¤ÇÆ°¤«¤·¤Æ¤¤¤ë¾ì¹ç¿¿¤È¤Ê¤ê¤Þ¤¹)
-
-@item
-@code{mysql -u user_name db_name} ¤ò»ÈÍѤ·¤Æ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÀܳ¤·¤Æ¤¤¤ë¤È¤­¤Ë
- @code{Access denied} ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¡¢@code{user} ¥Æ¡¼¥Ö¥ë¤ÎÀßÄê°ã¤¤¤¬¹Í¤¨¤é¤ì¤Þ¤¹¡£
-@code{mysql -u root mysql} ¤ò¼Â¹Ô¤·¡¢°Ê²¼¤Î SQL ʸ¤ò»î¤·¤Æ¤¯¤À¤µ¤¤¡§
-
-@example
-mysql> SELECT * FROM user;
-@end example
-
-@code{Host} ¤È @code{User} ¤Ë¤¢¤Ê¤¿¤Î¥³¥ó¥Ô¥å¡¼¥¿Ì¾¤È @strong{MySQL} ¥æ¡¼¥¶¡¼Ì¾¤Ë¥Þ¥Ã¥Á¤¹¤ëÅÐÏ¿¤¬¤Ê¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-
-@item
-@code{Access denied} ¥¨¥é¡¼¤Ï¡¢¤É¤Î¥æ¡¼¥¶¡¼¤ÇÀܳ¤·¤Æ¤­¤¿¤«¡¢¤É¤Î¥Û¥¹¥È¤«¤éÀܳ¤·¤è¤¦¤È¤·¤Æ¤¤¤ë¤«¡¢¥Ñ¥¹¥ï¡¼¥É¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Î¤«¤ò¥á¥Ã¥»¡¼¥¸¤Ë½ÐÎϤ·¤Þ¤¹¡£
-Ä̾¥¨¥é¡¼¤Ë¤Ê¤Ã¤Æ¤¤¤ë¥Û¥¹¥È̾¤È¥æ¡¼¥¶¡¼Ì¾¤¬¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤¬ @code{user} ¥Æ¡¼¥Ö¥ë¤Ë°ì¤Ä¤Ï¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-
-@item
-¾¤Î¥Û¥¹¥È¤«¤é @strong{MySQL} ¥µ¡¼¥Ð¡¼¤ËÀܳ¤ò»î¤ß¤¿»þ¤Ë°Ê²¼¤Î¥¨¥é¡¼¤¬½Ð¤¿¾ì¹ç¡¢
-@code{user} ¥Æ¡¼¥Ö¥ë¤Ë¤¢¤Ê¤¿¤¬¥¢¥¯¥»¥¹¤·¤Æ¤¤¤ë¥Û¥¹¥È¤Ë¥Þ¥Ã¥Á¤¹¤ë¹Ô¤¬¤¢¤ê¤Þ¤»¤ó¡§
-
-@example
-Host ... is not allowed to connect to this MySQL server
-@end example
-
-@code{mysql} ¥³¥Þ¥ó¥É¤ò¥µ¡¼¥Ð¡¼¤Î¥Û¥¹¥È¾å¤Ç»ÈÍѤ·¤Æ¡¢
-@code{user}, @code{db}, @code{host} ¥Æ¡¼¥Ö¥ë¤Ë¡¢Àܳ¤·¤è¤¦¤È¤·¤Æ¤¤¤ë ¥æ¡¼¥¶¡¼Ì¾¡¿¥Û¥¹¥È̾ ¤ò
-²Ã¤¨¤ì¤Ð²ò·è¤Ç¤­¤ë¤Ç¤·¤ç¤¦¡£
-¤â¤·¥µ¡¼¥Ð¡¼¤¬ @strong{MySQL} 3.22 ¤Ç¤Ï¤Ê¤¯¡¢Àܳ¤·¤è¤¦¤È¤·¤Æ¤¤¤ë¥Û¥¹¥È¤Î IP ¤â¥Û¥¹¥È̾¤â¤ï¤«¤é¤Ê¤¤¾ì¹ç¡¢
-@code{user} ¥Æ¡¼¥Ö¥ë¤Î @code{Host} ¥Õ¥£¡¼¥ë¥É¤Ë @code{'%'} ¤òÀßÄꤷ¡¢
-@code{mysqld} ¤ò @code{--log} ¥ª¥×¥·¥ç¥ó¤ÇºÆµ¯Æ°¤·¤Æ¤¯¤À¤µ¤¤¡£
-¤½¤·¤Æ¥¯¥é¥¤¥¢¥ó¥È¥Û¥¹¥È¤«¤éÀܳ¤¹¤ì¤Ð¡¢@strong{MySQL} ¤Î¥í¥°¥Õ¥¡¥¤¥ë¤Ë
-¤½¤Î¥Û¥¹¥È¤Î¾ðÊ󤬵­Ï¿¤µ¤ì¤Æ¤¤¤ë¤Ï¤º¤Ç¤¹¡£
-¤½¤ì¤¬¤ï¤«¤ì¤Ð¡¢Àè¤ËÀßÄꤷ¤¿ @code{user} ¥Æ¡¼¥Ö¥ë¤Î @code{Host} ¥Õ¥£¡¼¥ë¥É¤Î @code{'%'} ¤ò
-¥í¥°¤Ëµ­Ï¿¤µ¤ì¤¿¥Û¥¹¥È̾¤ËÃÖ¤­´¹¤¨¤Þ¤¹¡£(¤·¤«¤·¤³¤ì¤Ï¥·¥¹¥Æ¥à¤ò´í¸±¤Ë¤µ¤é¤·¤Þ¤¹)
-
-@item
-@code{mysql -u root test} ¤ÏÆ°¤¤¤¿¤â¤Î¤Î @code{mysql -h your_hostname -u root test} ¤¬
- @code{Access denied} ¤òÊÖ¤·¤¿¾ì¹ç¡¢
-@code{user} ¥Æ¡¼¥Ö¥ë¤ËÀµ¤·¤¤¥Û¥¹¥È̾¤¬»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤¤È»×¤ï¤ì¤Þ¤¹¡£
-@code{user} ¥Æ¡¼¥Ö¥ë¤Î @code{Host} ¥Õ¥£¡¼¥ë¥É¤Ë¥Û¥¹¥È̾¤ò³ÎÄê¤Ç¤­¤ë·Á¤Ç»ØÄꤷ¤Æ¤¤¤Ê¤¤¤«¡¢
-»ÈÍѤ·¤Æ¤¤¤ë¥·¥¹¥Æ¥à¤Î¥ê¥¾¥ë¥Ö¤¬ FQDN (or vice-versa) ¤òÊÖ¤·¤Æ¤¤¤ë¤«¤À¤È»×¤ï¤ì¤Þ¤¹¡£
-Î㤨¤Ð¡¢@code{user} ¥Æ¡¼¥Ö¥ë¤Ë @code{'tcx'} ¥Û¥¹¥È¤ÎÄêµÁ¤¬¤¢¤Ã¤¿¤È¤·¤Æ¡¢
-DNS ¤¬ @strong{MySQL} ¤Ë @code{'tcx.subnet.se'} ¤ò¥Û¥¹¥È̾¤È¤·¤ÆÊÖ¤·¤¿¾ì¹ç¡¢
-¤³¤ì¤ÏÆ°¤­¤Þ¤»¤ó¡£
-@code{user} ¥Æ¡¼¥Ö¥ë¤Î @code{Host} ¥Õ¥£¡¼¥ë¥É¤ÎÃͤˡ¢¤¢¤Ê¤¿¤Î¥Û¥¹¥È¤Î IP ÈÖ¹æ¤ò²Ã¤¨¤Æ¤¯¤À¤µ¤¤¡£
-(@code{user} ¥Æ¡¼¥Ö¥ë¤Î @code{Host} ¤ÎÃͤ˥磻¥ë¥É¥«¡¼¥É¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£@code{'tcx.%'} ¤Î¤è¤¦¤Ë¡£
-¤·¤«¤·¥Û¥¹¥È̾¤ÎÃͤò @samp{%} ʸ»ú¤Ç½ª¤ï¤é¤»¤ëÀßÄê¤Ï¡¢@emph{°ÂÁ´¤Ç¤Ï¤Ê¤¯}¡¢@emph{¿ä¾©¤µ¤ì¤Þ¤»¤ó})
-
-@item
-¤â¤· @code{mysql -u user_name test} ¤¬Æ°ºî¤· @code{mysql -u user_name other_db_name} ¤¬
-Æ°ºî¤·¤Ê¤¤¾ì¹ç¤Ï¡¢@code{db} ¥Æ¡¼¥Ö¥ë¤Ë @code{other_db_name} ¤Î¥¨¥ó¥È¥ê¤¬
-ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£
-
-@item
-@code{mysql -u user_name db_name} ¤Ï¥¶¡¼¥Ð¡¼¾å¤Ç¤ÏÆ°ºî¤¹¤ë¤¬¡¢
-@code{mysql -u host_name -u user_name db_name} ¤¬¥¯¥é¥¤¥¢¥ó¥È¥Û¥¹¥È¾å¤ÇÆ°ºî¤·¤Ê¤¤¾ì¹ç¡¢
-@code{user} ¥Æ¡¼¥Ö¥ë¤« @code{db} ¥Æ¡¼¥Ö¥ë¤Ë¥¯¥é¥¤¥¢¥ó¥È¥Û¥¹¥È¤Î̾Á°¤¬ÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£
-
-@item
-@code{Access denied} ¤Î¸¶°ø¤¬¤â¤·¾åµ­¤ËÅö¤Æ¤Ï¤Þ¤é¤Ê¤¤¾ì¹ç¤Ï¡¢
-@code{user} ¥Æ¡¼¥Ö¥ë¤«¤é @code{Host} ¤Ë¥ï¥¤¥ë¥É¥«¡¼¥É¤ò»ÈÍѤ·¤Æ¤¤¤ë¥¨¥ó¥È¥ê¤òÁ´¤Æ¾Ãµî¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£(@samp{%} ¤ä @samp{_} ¤ò´Þ¤àÃͤǤ¹)
-¤è¤¯¤¢¤ë´Ö°ã¤¤¤Ï¡¢@code{localhost} ¤ËÂФ·¤Æ @code{localhost} ¤ÈƱ¤¸¥Þ¥·¥ó¾å¤«¤é
-¤ÎÀܳ¤òµö²Ä¤¹¤ë¤È¹Í¤¨¤Æ
-@code{Host}=@code{'%'} ¤È @code{User}=@code{'some user'} ¤òÅÐÏ¿¤¹¤ë¤³¤È¤Ç¤¹¡£
-¤³¤ì¤ÏÆ°¤­¤Þ¤»¤ó¡£¤Ê¤¼¤Ê¤é¡¢¥Ç¥Õ¥©¥ë¥È¤Î¸¢¸Â¤Ë
-@code{Host}=@code{'localhost'} ¤È @code{User}=@code{''} ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤«¤é¤Ç¤¹¡£
-@code{Host} ¤ÎÃͤ¬ @code{'localhost'} ¤Î¾ì¹ç¡¢¤³¤ì¤Ï @code{'%'} ¤è¤ê¤â
-¶ñÂÎŪ¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢@code{localhost} ¤«¤é¤ÎÀܳ¤Ë¤Ï¤³¤Á¤é¤ÎÊý¤¬
-»ÈÍѤµ¤ì¤ë¤Î¤Ç¤¹¡ª Àµ¤·¤¤»ØÄê¤Î»ÅÊý¤Ï¡¢ÆóÈÖÌܤÎÅÐÏ¿¤È¤·¤Æ
-@code{Host}=@code{'localhost'} ¤È @code{User}=@code{'some_user'} ¤òÄɲ乤뤫¡¢
-¤¢¤ë¤¤¤Ï¡¢@code{Host}=@code{'localhost'} ¤È @code{User}=@code{''} ¤òºï½ü¤¹¤ë¤³¤È¤Ç¤¹¡£
-
-@item
-¤â¤·°Ê²¼¤Î¥¨¥é¡¼¤¬½Ð¤¿¾ì¹ç
-@code{db} ¤« @code{host} ¥Æ¡¼¥Ö¥ë¤ËÌäÂ꤬¤¢¤ë¤Î¤«¤â¤·¤ì¤Þ¤»¤ó¡£¡§
-
-@example
-Access to database denied
-@end example
-
-¤â¤· @code{db} ¥Æ¡¼¥Ö¥ë¤Ë @code{Host} ¥Õ¥£¡¼¥ë¥É¤¬¶õ¤ÎÅÐÏ¿¤¬¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢
-@code{host} ¥Æ¡¼¥Ö¥ëÃæ¤Ë¡¢@code{db} ¥Æ¡¼¥Ö¥ë¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤ë
-¥Û¥¹¥È¤òÌÀµ­¤·¤¿Êª¤¬°ì¤Ä°Ê¾å¤¢¤ë¤«¤É¤¦¤«¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-¤â¤· @code{SELECT ... INTO OUTFILE} ¤ä @code{LOAD DATA INFILE} SQL ʸ¤ò
-»ÈÍѤ·¤Æ¤¤¤ë»þ¤Ë¤³¤Î¥¨¥é¡¼¤¬½Ð¤ë¾ì¹ç¡¢
-@code{user} ¥Æ¡¼¥Ö¥ë¤Î¤¢¤Ê¤¿¤ÎÅÐÏ¿¤Ë @strong{file} ¸¢¸Â¤¬
-µö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¤È»×¤ï¤ì¤Þ¤¹¡£
-
-@item
-@cindex Configuration files
-@cindex Environment variables
-@tindex .my.cnf file
-¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤ÏÀܳ¤ËºÝ¤·¤Æ¡¢
-ÀßÄê¥Õ¥¡¥¤¥ë¤ÇÀßÄꤵ¤ì¤¿Ãͤ«´Ä¶­ÊÑ¿ô¤ÎÃͤò»ÈÍѤ¹¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-¤â¤·¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤¬¸í¤Ã¤¿ÃͤòÀܳ¤Ë»ÈÍѤ·¤Æ¤¤¤ë¤è¤¦¤Ê¤é¡¢
-´Ä¶­ÊÑ¿ô¤È¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë @file{.my.cnf} ¥Õ¥¡¥¤¥ë¤ò³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£
-¤â¤Á¤í¤ó¥·¥¹¥Æ¥à¥ï¥¤¥É¤Î @strong{MySQL} ÀßÄê¥Õ¥¡¥¤¥ë¤â¡¢¥Ñ¥é¥á¥¿¡¼¤¬µ­½Ò¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢
-¥Á¥§¥Ã¥¯¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£@xref{Option files}.
-¤â¤·¥¯¥é¥¤¥¢¥ó¥È¤ò¥ª¥×¥·¥ç¥ó¤Ê¤·¤Çµ¯Æ°¤·¤Æ¤¤¤Æ @code{Access denied} ¤¬¤Ç¤ë¤Ê¤é¡¢
-¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤Ë¸Å¤¤¥Ñ¥¹¥ï¡¼¥É¤¬½ñ¤«¤ì¤Æ¤¤¤ë¤«³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£
-@xref{Option files}.
-
-@item
-¤â¤·Á´¤Æ¼ºÇÔ¤¹¤ë¤Ê¤é¡¢@code{mysqld} ¥Ç¡¼¥â¥ó¤ò¥Ç¥Ð¥Ã¥°¥ª¥×¥·¥ç¥ó¤Çµ¯Æ°¤·¤Æ¤¯¤À¤µ¤¤¡£
-Î㤨¤Ð¡¢@code{--debug=d,general,query}¡£¤³¤ì¤Ï¥³¥Í¥¯¥·¥ç¥ó¤Ë»î¤ß¤¿¥Û¥¹¥È¤ä¥æ¡¼¥¶¡¼¤Î¾ðÊó¡¢
-¤Þ¤¿¼Â¹Ô¤·¤¿¥³¥Þ¥ó¥É¤òɽ¼¨¤·¤Þ¤¹¡£ @xref{Debugging server}.
-
-@item
-¤â¤· @strong{MySQL} ¤Î¸¢¸Âµö²Ä¤Ë¤Ä¤¤¤Æ¤½¤Î¾¤ÎÌäÂ꤬µ¯¤³¤ê¡¢
-¥á¡¼¥ê¥ó¥°¡¦¥ê¥¹¥È¤ËÌäÂê¤ò¥Ý¥¹¥È¤·¤Ê¤¯¤Æ¤Ï¤¤¤±¤Ê¤¤¤È´¶¤¸¤ì¤Ð¡¢
-¤¤¤Ä¤â @strong{MySQL} µö²Ä¥Æ¡¼¥Ö¥ë¤Î¥À¥ó¥×¤òÄ󶡤·¤Æ²¼¤µ¤¤¡£
-@code{mysqldump mysql} ¥³¥Þ¥ó¥É¤Ç¥À¥ó¥×¤Ç¤­¤Þ¤¹¡£
-¤¤¤Ä¤â¤Î¤è¤¦¤Ë¡¢ @code{mysqlbug} ¥¹¥¯¥ê¥×¥È¤Ç¥Ý¥¹¥È¤·¤Æ¤¯¤À¤µ¤¤¡£@xref{Bug reports}.
-¤È¤­¤Ë¤Ï¤Ï¡¢ @code{mysqldump} ¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤Ë¡¢
-@code{mysqld} ¤ò @code{--skip-grant-tables} ¥ª¥×¥·¥ç¥ó¤Ç¼Â¹Ô¤·¤Ê¤¤¤È
-¤¤¤±¤Ê¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-@end itemize
-
-
-@node Reference, Table types, Privilege system, Top
-@chapter @strong{MySQL} ¸À¸ì¥ê¥Õ¥¡¥ì¥ó¥¹
-
-@menu
-* Literals:: ¥ê¥Æ¥é¥ë:ʸ»úÎó¤È¿ôÃͤò¤É¤Î¤è¤¦¤Ë½ñ¤¯¤«¡©
-* Variables:: ¥æ¡¼¥¶ÊÑ¿ô
-* Column types:: ¥Õ¥£¡¼¥ë¥É·¿
-* Functions:: ´Ø¿ô
-* CREATE DATABASE:: @code{CREATE DATABASE} ¹½Ê¸
-* DROP DATABASE:: @code{DROP DATABASE} ¹½Ê¸
-* CREATE TABLE:: @code{CREATE TABLE} ¹½Ê¸
-* ALTER TABLE:: @code{ALTER TABLE} ¹½Ê¸
-* DROP TABLE:: @code{DROP TABLE} ¹½Ê¸
-* OPTIMIZE TABLE:: @code{OPTIMIZE TABLE} ¹½Ê¸
-* CHECK TABLE:: @code{CHECK TABLE} syntax
-* REPAIR TABLE:: @code{REPAIR TABLE} syntax
-* DELETE:: @code{DELETE} ¹½Ê¸
-* SELECT:: @code{SELECT} ¹½Ê¸
-* JOIN:: @code{JOIN} ¹½Ê¸
-* INSERT:: @code{INSERT} ¹½Ê¸
-* REPLACE:: @code{REPLACE} ¹½Ê¸
-* LOAD DATA:: @code{LOAD DATA INFILE} ¹½Ê¸
-* UPDATE:: @code{UPDATE} ¹½Ê¸
-* USE:: @code{USE} ¹½Ê¸
-* FLUSH:: @code{Flush} ¹½Ê¸ (¥­¥ã¥Ã¥·¥å¤Î¥¯¥ê¥¢)
-* KILL:: @code{KILL} ¹½Ê¸
-* SHOW:: @code{SHOW} ¹½Ê¸ (¥Æ¡¼¥Ö¥ë¤ä¥Õ¥£¡¼¥ë¥É¤Ê¤É¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÆÀ¤ë)
-* EXPLAIN:: @code{EXPLAIN} ¹½Ê¸ (@code{SELECT}¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÆÀ¤ë )
-* DESCRIBE:: @code{DESCRIBE} ¹½Ê¸ (¥Õ¥£¡¼¥ë¥É̾¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÆÀ¤ë)
-* COMMIT::
-* LOCK TABLES:: @code{LOCK TABLES/UNLOCK TABLES} ¹½Ê¸
-* SET OPTION:: @code{SET OPTION} ¹½Ê¸
-* GRANT:: @code{GRANT} ¤È @code{REVOKE} ¹½Ê¸
-* CREATE INDEX:: @code{CREATE INDEX} ¹½Ê¸
-* DROP INDEX:: @code{DROP INDEX} ¹½Ê¸
-* Comments:: Comment ¹½Ê¸
-* CREATE FUNCTION:: @code{CREATE FUNCTION} ¹½Ê¸
-* Reserved words:: Is @strong{MySQL} picky about reserved words?
-@end menu
-
-
-@cindex Strings
-@cindex Strings, escaping characters
-@node Literals, Variables, Reference, Reference
-@section ¥ê¥Æ¥é¥ë:ʸ»úÎó¤È¿ôÃͤò¤É¤Î¤è¤¦¤Ë½ñ¤¯¤«¡©
-
-@menu
-* String syntax:: Strings
-* Number syntax:: Numbers
-* Hexadecimal values::
-* NULL values:: @code{NULL} values
-* Legal names:: Database, table, index, column and alias names
-@end menu
-
-@node String syntax, Number syntax, Literals, Literals
-@subsection ʸ»úÎó
-
-ʸ»úÎó¤Ïʸ»ú¤ÎʤӤǤ¹¡£°úÍÑÉä(@samp{'})¤Þ¤¿¤ÏÆó½Å°úÍÑÉä(@samp{"})¤Ç³ç¤é
-¤ì¤Þ¤¹(¸å¼Ô¤Ï ANSI ¥â¡¼¥É¤Ç¼Â¹Ô¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Î¤ß)¡£ Î㡧
-
-@example
-'a string'
-"another string"
-@end example
-
-ʸ»úÎóÃæ¤Ç¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¥·¡¼¥±¥ó¥¹¤ÏÆÃÊ̤ʰÕÌ£¤ò»ý¤Á¤Þ¤¹¡£¤³¤ì¤é¤Î¥·¡¼¥±
-¥ó¥¹¤Î¤½¤ì¤¾¤ì¤Ï@emph{¥¨¥¹¥±¡¼¥×ʸ»ú}¤È¤·¤ÆÃΤé¤ì¤ë¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å
-(@samp{\})¤Ç»Ï¤Þ¤ê¤Þ¤¹¡£@strong{MySQL} ¤Ï¼¡¤Î¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤òǧ¼±
-¤·¤Þ¤¹¡£
-
-@c these aren't really functions, but that's probably the most reasonable index
-@table @code
-@findex \0 (ASCII 0)
-@findex NUL
-@item \0
-ASCII 0 (@code{NUL}) ʸ»ú¡£
-
-@findex \n (newline)
-@findex newline (\n)
-@item \n
-²þ¹Ôʸ»ú¡£
-
-@findex \t (tab)
-@findex tab (\t)
-@item \t
-¥¿¥Öʸ»ú¡£
-
-@findex \r (carriage return)
-@findex return (\r)
-@findex carriage return (\r)
-@item \r
-¥ê¥¿¡¼¥óʸ»ú¡£
-
-@findex \b (backspace)
-@findex backspace (\b)
-@item \b
-¥Ð¥Ã¥¯¥¹¥Ú¡¼¥¹Ê¸»ú¡£
-
-@findex \' (single quote)
-@findex single quote (\')
-@item \'
-°úÍÑÉä(@samp{'})¡£
-
-@findex \" (double quote)
-@findex double quote (\")
-@item \"
-Æó½Å°úÍÑÉä(@samp{"})¡£
-
-@findex \\ (escape)
-@findex escape (\\)
-@item \\
-¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å(@samp{\})ʸ»ú¡£
-
-@findex % (wildcard character)
-@findex Wildcard character (%)
-@item \%
-@samp{%} ʸ»ú¡£¤³¤ì¤Ï @samp{%} ¤¬¥ï¥¤¥ë¥É¥«¡¼¥Éʸ»ú¤È¤·¤Æ²ò¼á¤µ¤ì¤ëʸ̮
-¤Ç¡¢@samp{%} ¤½¤Î¤â¤Î¤ò¸¡º÷¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£
-@xref{String comparison functions}.
-
-@findex _ (wildcard character)
-@findex Wildcard character (_)
-@item \_
-@code{_} ʸ»ú¡£¤³¤ì¤Ï @samp{_} ¤¬¥ï¥¤¥ë¥É¥«¡¼¥Éʸ»ú¤È¤·¤Æ²ò¼á¤µ¤ì¤ëʸ̮
-¤Ç¡¢@code{_} ¤½¤Î¤â¤Î¤ò¸¡º÷¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£
-@xref{String comparison functions}.
-@end table
-
-¤¤¤¯¤Ä¤«¤Îʸ»úÎóʸ̮¤Ç @samp{\%} ¤Þ¤¿¤Ï @samp{\_} ¤ò»ÈÍѤ¹¤ë¤È¡¢¤³¤ì¤é¤Ïʸ
-»úÎó @samp{%} ¤È @samp{_} ¤Ç¤Ï¤Ê¤¯¡¢@samp{\%} ¤È @samp{\_} ¤òÊÖ¤·¤Þ¤¹¡£
-
-@noindent
-ʸ»úÎóÃæ¤Ë°úÍÑÉä¤ò´Þ¤á¤ëÊýË¡¤Ï¤¤¤¯¤Ä¤«¤¢¤ê¤Þ¤¹:
-
-@itemize @bullet
-@item
-@samp{'} ¤Ç³ç¤é¤ì¤ëʸ»úÎóÃæ¤Î @samp{'} ¤Ï @samp{''} ¤È¤·¤Æ½ñ¤¯¤³¤È¤¬¤Ç¤­
-¤Þ¤¹¡£
-
-@item
-@samp{"} ¤Ç³ç¤é¤ì¤ëʸ»úÎóÃæ¤Î @samp{"} ¤Ï @samp{""} ¤È¤·¤Æ½ñ¤¯¤³¤È¤¬¤Ç¤­
-¤Þ¤¹¡£
-
-@item
-°úÍÑÉä¤ÎÁ°¤Ë¥¨¥¹¥±¡¼¥×ʸ»ú (@samp{\}) ¤òÃÖ¤¯¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@item
-@samp{"} ¤Ç³ç¤é¤ì¤¿Ê¸»úÎóÃæ¤Î @samp{'} ¤ÏÆÃÊÌ°·¤¤¤ÎɬÍפϤʤ¯¡¢Æó½Å¤Ë¤·
-¤¿¤ê¡¢¥¨¥¹¥±¡¼¥×¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£Æ±¤¸¤è¤¦¤Ë¡¢@samp{'} ¤Ç³ç¤é¤ì¤¿Ê¸
-»úÎóÃæ¤Î @samp{"} ¤ÏÆÃÊÌ°·¤¤¤ÎɬÍפϤ¢¤ê¤Þ¤»¤ó¡£
-@end itemize
-
-¼¡¤Î @code{SELECT} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ï¡¢¥¯¥©¡¼¥È¤È¥¨¥¹¥±¡¼¥×¤¬¤É¤Î¤è¤¦¤ËƯ
-¤¯¤«¤ò¼¨¤·¤Þ¤¹:
-
-@example
-mysql> SELECT 'hello', '"hello"', '""hello""', 'hel''lo', '\'hello';
-+-------+---------+-----------+--------+--------+
-| hello | "hello" | ""hello"" | hel'lo | 'hello |
-+-------+---------+-----------+--------+--------+
-
-mysql> SELECT "hello", "'hello'", "''hello''", "hel""lo", "\"hello";
-+-------+---------+-----------+--------+--------+
-| hello | 'hello' | ''hello'' | hel"lo | "hello |
-+-------+---------+-----------+--------+--------+
-
-mysql> SELECT "This\nIs\nFour\nlines";
-+--------------------+
-| This
-Is
-Four
-lines |
-+--------------------+
-@end example
-
-@cindex Quoting binary data
-
-¥Ð¥¤¥Ê¥ê¥Ç¡¼¥¿¤ò @code{BLOB} ¥Õ¥£¡¼¥ë¥É¤ËÁÞÆþ¤·¤¿¤¤¾ì¹ç¡¢¼¡¤Îʸ»ú¤ò¥¨¥¹¥±¡¼¥×
-¥·¡¼¥±¥ó¥¹¤Çɽ¤¹É¬Íפ¬¤¢¤ê¤Þ¤¹:
-@table @code
-@item NUL
-ASCII 0¡£@samp{\0} (¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤È ASCII @samp{0} ʸ»ú) ¤ËÃÖ¤­´¹¤¨¤ë
-¤Ù¤­¤Ç¤¹¡£
-@item \
-ASCII 92, ¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¡£@samp{\\} ¤Èɽµ­¤·¤Æ¤¯¤À¤µ¤¤¡£
-@item '
-ASCII 39, °úÍÑÉä¡£@samp{\'} ¤Èɽµ­¤·¤Æ¤¯¤À¤µ¤¤¡£
-@item "
-ASCII 34, Æó½Å°úÍÑÉä¡£@samp{\"} ¤Èɽµ­¤·¤Æ¤¯¤À¤µ¤¤¡£
-@end table
-
-@cindex Quoting
-@cindex @code{BLOB}, inserting binary data
-@findex mysql_escape_string()
-@findex DBI->quote
-C ¥³¡¼¥É¤ò½ñ¤¯¾ì¹ç¡¢@code{INSERT} Àá¤Çʸ»ú¤ò¥¨¥¹¥±¡¼¥×¤¹¤ë¤¿¤á¤Ë¡¢C API
-´Ø¿ô @code{mysql_escape_string()} ¤ò»ÈÍѤǤ­¤Þ¤¹¡£@xref{C API function
-overview}. Perl ¤Ç¤Ï¡¢@code{DBI} ¥Ñ¥Ã¥±¡¼¥¸¤Î @code{quote} ¥á¥½¥Ã¥É¤ò»È
-ÍѤ·¤Æ¡¢Æüìʸ»ú¤òŬÅö¤Ê¥¨¥¹¥±¡¼¥×¥·¡¼¥±¥ó¥¹¤ËÊÑ´¹¤Ç¤­¤Þ¤¹¡£@xref{Perl
-DBI Class, , Perl @code{DBI} Class}.
-
-¾åµ­¤ÎÆüìʸ»ú¤Î¤É¤ì¤«¤ò´Þ¤à²ÄǽÀ­¤Î¤¢¤ëÁ´¤Æ¤Îʸ»úÎó¤Ë¤Ä¤¤¤Æ¡¢¥¨¥¹¥±¡¼¥×
-´Ø¿ô¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡ª
-
-@node Number syntax, Hexadecimal values, String syntax, Literals
-@subsection ¿ôÃÍ
-
-À°¿ô¤Ï¿ô»ú¤ÎʤӤÇɽ¸½¤µ¤ì¤Þ¤¹¡£
-ÉâÆ°¾®¿ôÅÀ¤Ï @samp{.} ¤Ç¾®¿ô¤òʬ³ä¤·¤Þ¤¹¡£
-¤É¤Á¤é¤Î·¿¤âÉé¿ô¤òɽ¤¹¤¿¤á¤Ë @samp{-} ¤òÁ°¤Ë¤Ä¤±¤Þ¤¹¡£
-
-ÀµÅö¤Ê¿ôÃͤÎÎã:
-
-@example
-1221
-0
--32
-@end example
-
-Í­¸ú¤ÊÉâÆ°¾®¿ôÅÀ¤ÎÎ㡧
-
-@example
-294.42
--32032.6809e+10
-148.00
-@end example
-
-À°¿ô¤¬ÉâÆ°¾®¿ôÅÀ¤Îʸ̮¤Ç»ÈÍѤµ¤ì¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡¨ ¤³¤Î¾ì¹ç¡¢ÉâÆ°¾®¿ôÅÀ¤Ë
-ÊÑ´¹¤µ¤ì¤Þ¤¹¡£
-
-@tindex Hexadecimal values
-@node Hexadecimal values, NULL values, Number syntax, Literals
-@subsection 16¿ÊË¡¤ÎÃÍ
-
-@strong{MySQL} ¤Ï16¿ÊË¡¤ÎÃͤò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£
-¿ôÃͤÎʸ̮¤Ç¤Ï¡¢¤³¤ì¤é¤ÏÀ°¿ô(64¥Ó¥Ã¥ÈÀºÅÙ)¤Î¤è¤¦¤Ë¿¶¤ëÉñ¤¤¤Þ¤¹¡£
-ʸ»úÎó¤Îʸ̮¤Ç¤Ï¡¢hex¤Î·å¤Î¤½¤ì¤¾¤ì¤Î¥Ú¥¢¤¬Ê¸»ú¤ËÊÑ´¹¤µ¤ì¤¿
-¥Ð¥¤¥Ê¥ê¡¼Ê¸»ú¤Î¤è¤¦¤Ë¿¶¤ëÉñ¤¤¤Þ¤¹¡£
-
-@example
-mysql> SELECT 0xa+0
- -> 10
-mysql> select 0x5061756c;
- -> Paul
-@end example
-
-16¿Ê¿ôɽµ­¤Ï¡¢ODBC ¤Ë¤ª¤¤¤Æ BLOB ¤ÎÃͤòÍ¿¤¨¤ë¤¿¤á¤Ë¤·¤Ð¤·¤Ð»ÈÍѤµ¤ì¤Þ¤¹¡£
-
-@tindex NULL value
-@node NULL values, Legal names, Hexadecimal values, Literals
-@subsection @code{NULL} ÃÍ
-
-@code{NULL} ¤Ï ``no data'' ¤ò°ÕÌ£¤·¡¢¿ôÃÍ·¿¤Î @code{0} ¤äʸ»úÎ󷿤ζõʸ
-»úÎó¤È¤Ï°Û¤Ê¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-@xref{Problems with NULL, , Problems with @code{NULL}}.
-
-¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤ä½ñ¤­½Ð¤·»þ¤Ë¡¢@code{NULL} ¤Ï @code{\N} ¤Ç
-ɽ¸½¤µ¤ì¤Þ¤¹¡£ (@code{LOAD DATA INFILE}, @code{SELECT ... INTO OUTFILE}).
-@xref{LOAD DATA, , @code{LOAD DATA}}.
-@node Legal names, , NULL values, Literals
-@subsection ¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¡¢¥Æ¡¼¥Ö¥ë̾¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹Ì¾¡¢¥Õ¥£¡¼¥ë¥É̾¡¢¥¨¥¤¥ê¥¢¥¹Ì¾
-
-@menu
-* Name case sensitivity:: Case sensitivity in names
-@end menu
-
-¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¡¢¥Æ¡¼¥Ö¥ë̾¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹Ì¾¡¢¥Õ¥£¡¼¥ë¥É̾¡¢¥¨¥¤¥ê¥¢¥¹Ì¾¤Ï
-@strong{MySQL} ¤Ç¤ÏÁ´¤ÆƱ¤¸µ¬Â§¤Ë´ð¤Å¤­¤Þ¤¹:
-
-@tindex Quoting of identifiers
-@tindex `
-@tindex "
-Ãí°Õ: µ¬Â§¤Ï @strong{MySQL} 3.23.6 ¤ÇÊѹ¹¤µ¤ì¤Þ¤·¤¿¡£¤½¤ì¤Ï¼±ÊÌ»Ò(¥Ç¡¼¥¿¥Ù¡¼
-¥¹Ì¾¡¢¥Æ¡¼¥Ö¥ë̾¡¢¥Õ¥£¡¼¥ë¥É̾)¤Î @code{`} ¤Ç¤Î¥¯¥©¡¼¥È¤òƳÆþ¤·¤¿»þ¤Ç¤¹
-(ANSI ¥â¡¼¥É¤Ç¼Â¹Ô¤¹¤ë¾ì¹ç¤Ï¡¢@code{"} ¤â¼±Ê̻Ҥò¥¯¥©¡¼¥È¤¹¤ë¤¿¤á¤ËƯ¤­¤Þ
-¤¹)¡£
-
-@multitable @columnfractions .15 .7 .78
-@item @strong{¼±ÊÌ»Ò} @tab @strong{ºÇÂçĹ} @tab @strong{µö¤µ¤ì¤ëʸ»ú}
-@item ¥Ç¡¼¥¿¥Ù¡¼¥¹ @tab 64 @tab ¥Ç¥£¥ì¥¯¥È¥ê̾¤È¤·¤Æµö¤µ¤ì¤ë¤¹¤Ù¤Æ¤Îʸ»ú¡£@code{/} ¤ò½ü¤¯¡£
-@item ¥Æ¡¼¥Ö¥ë @tab 64 @tab ¥Õ¥¡¥¤¥ë̾¤È¤·¤Æµö¤µ¤ì¤ë¤¹¤Ù¤Æ¤Îʸ»ú¡£@code{/} ¤È @code{.} ¤ò½ü¤¯¡£
-@item ¥Õ¥£¡¼¥ë¥É @tab 64 @tab ¤¹¤Ù¤Æ¤Îʸ»ú
-@item ¥¨¥¤¥ê¥¢¥¹ @tab 255 @tab ¤¹¤Ù¤Æ¤Îʸ»ú
-@end multitable
-
-Ãí°Õ: ¾åµ­¤Ë²Ã¤¨¡¢¼±ÊÌ»ÒÆâ¤Ë¤Ï ASCII(0) ¤È ASCII(255) ¤ò»ý¤Æ¤Þ¤»¤ó¡£
-
-Ãí°Õ: ¼±Ê̻Ҥ¬À©¸Â¤µ¤ì¤¿Ã±¸ì¤Ç¤¢¤Ã¤¿¤êÆüìʸ»ú¤ò´Þ¤à¾ì¹ç¤Ï¡¢¤½¤ì¤ò»ÈÍѤ¹¤ë
-»þ¤Ë¤Ï¾ï¤Ë @code{`} ¤Ç¥¯¥©¡¼¥È¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹:
-
-@example
-SELECT * from `select` where `select`.id > 100;
-@end example
-
-@strong{MySQL} ¤ÎÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢Ì¾Á°¤Îµ¬Â§¤Ï¼¡¤Ë½¾¤¤¤Þ¤¹:
-
-@itemize @bullet
-@item
-̾Á°¤Ï¡¢¸½ºß¤Îʸ»ú¥»¥Ã¥È¤Î¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤È¿ô»úʸ»ú¤«¤éÀ®¤ê¡¢@samp{_} ¤È
-@samp{$} ¤â´Þ¤ß¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥Èʸ»ú¥»¥Ã¥È¤Ï ISO-8859-1 Latin1 ¤Ç¤¹¤¬¡¢
-¤³¤ì¤Ï @code{mysqld} ¤Ë @code{--default-character-set} ¥ª¥×¥·¥ç¥ó¤ò
-Í¿¤¨¤ë¤³¤È¤ÇÊѹ¹¤Ç¤­¤Þ¤¹. (3.23.14 °Ê¾å¤Î¾ì¹ç¤Î¤ß¡£
-¤½¤ì°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï @strong{MySQL} ºÆ¥³¥ó¥Ñ¥¤¥ë¤¬É¬Í×)
-@xref{Character sets}.
-
-@item
-̾Á°¤Ï¡¢Ì¾Á°¤È¤·¤ÆÀµ¤·¤¤Ç¤°Õ¤Îʸ»ú¤Ç»Ï¤á¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£Æäˡ¢Ì¾Á°¤Ï¿ô
-»ú¤Ç»Ï¤á¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹(¤³¤ì¤Ï¾¤Î¿¤¯¤Î¥·¥¹¥Æ¥à¤È°Û¤Ê¤ê¤Þ¤¹¡ª)¡£¤·¤«¤·¡¢
-¿ô»ú@emph{¤À¤±}¤Î̾Á°¤Ë¤¹¤ë»ö¤Ï¤Ç¤­¤Þ¤»¤ó¡£
-
-@item
-̾Á°¤ÎÃæ¤Ë @samp{.} ʸ»ú¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£¥Õ¥£¡¼¥ë¥É¤ò»²¾È¤Ç¤­¤ë¤è¤¦
-¤Ë·Á¼°¤ò³ÈÄ¥¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¤¿¤á¤Ç¤¹(¸å½Ò)¡£
-@end itemize
-
-@code{1e} ¤Î¤è¤¦¤Ê̾Á°¤Ï»ÈÍѤ·¤Ê¤¤¤³¤È¤ò´«¤á¤Þ¤¹¡£@code{1e+1} ¤Î¤è¤¦¤Ê¼°¤¬
-¤¢¤¤¤Þ¤¤¤À¤«¤é¤Ç¤¹¡£¤³¤ì¤Ï¡¢¼° @code{1e + 1} ¤È¤·¤Æ¡¢¤Þ¤¿¤Ï¿ôÃÍ
-@code{1e+1} ¤È¤·¤Æ²ò¼á¤µ¤ì¤Þ¤¹¡£
-
-@strong{MySQL} ¤Ç¤Ï¼¡¤Î·Á¼°¤Î¤¤¤º¤ì¤«¤ò»ÈÍѤ·¤Æ¥Õ¥£¡¼¥ë¥É¤ò»²¾È¤Ç¤­¤Þ¤¹:
-
-@multitable @columnfractions .35 .65
-@item @strong{¥Õ¥£¡¼¥ë¥É¤Î»²¾ÈÊýË¡} @tab @strong{°ÕÌ£}
-@item @code{col_name} @tab ¥¯¥¨¥êÃæ¤Ç»ÈÍѤµ¤ì¤ë¥Æ¡¼¥Ö¥ëÆâ¤Ë¸ºß¤·¤Æ¤¤¤ë @code{col_name} ¤È¤¤¤¦Ì¾Á°¤Î¥Õ¥£¡¼¥ë¥É
-@item @code{tbl_name.col_name} @tab ¸½ºß¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Æ¡¼¥Ö¥ë @code{tbl_name} Æâ¤Î¥Õ¥£¡¼¥ë¥É @code{col_name}
-@item @code{db_name.tbl_name.col_name} @tab ¥Ç¡¼¥¿¥Ù¡¼¥¹ @code{db_name}
-¤Î¥Æ¡¼¥Ö¥ë @code{tbl_name} Æâ¤Î¥Õ¥£¡¼¥ë¥É @code{col_name}¡£¤³¤Î·Á¼°¤Ï 3.22 °Ê¹ß
-¤ÇÍ­¸ú¤Ç¤¹¡£
-@item
-@code{`column_name`} @tab ¥­¡¼¥ï¡¼¥É¤Ç¤¢¤Ã¤¿¤êÆüìʸ»ú¤ò´Þ¤à¥Õ¥£¡¼¥ë¥É¡£
-@end multitable
-
-»²¾È¤¬Û£Ëæ¤Ç¤Ê¤¤¤Ê¤é¤Ð¡¢¥¹¥Æ¡¼¥È¥á¥ó¥ÈÃæ¤Î¥Õ¥£¡¼¥ë¥É»²¾È¤ÎÁ°¤Ë @code{tbl_name}
-¤Þ¤¿¤Ï @code{db_name.tbl_name} ¤òµ­½Ò¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£Î㤨¤Ð¡¢¥Æ¡¼
-¥Ö¥ë @code{t1} ¤È @code{t2} ¤¬¤½¤ì¤¾¤ì¥Õ¥£¡¼¥ë¥É @code{c} ¤ò´Þ¤ß¡¢@code{t1} ¤È
-@code{t2} ¤ÎξÊý¤ò»ÈÍѤ¹¤ë @code{SELECT} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ç @code{c} ¤ò¼è
-¤ê½Ð¤¹¤È¤·¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢@code{c} ¤Ï¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ç»ÈÍѤµ¤ì¤ë¥Æ¡¼¥Ö¥ë
-´Ö¤ÇÍ£°ì¤Ç¤Ê¤¤¤Î¤ÇÛ£Ëæ¤Ç¤¹¡£¤½¤Î¤¿¤á¡¢@code{t1.c} ¤Þ¤¿¤Ï @code{t2.c} ¤È
-µ­½Ò¤¹¤ë¤³¤è¤Ë¤è¤ê¤É¤Á¤é¤Î¥Æ¡¼¥Ö¥ë¤ò°ÕÌ£¤¹¤ë¤«¤ò¼¨¤¹É¬Íפ¬¤¢¤ê¤Þ¤¹¡£Æ±ÍÍ
-¤Ë¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹ @code{db1} ¤Î¥Æ¡¼¥Ö¥ë @code{t} ¤È¥Ç¡¼¥¿¥Ù¡¼¥¹
-@code{db2} ¤Î¥Æ¡¼¥Ö¥ë @code{t} ¤«¤é¼è¤ê½Ð¤¹¾ì¹ç¡¢¤³¤ì¤é¤Î¥Æ¡¼¥Ö¥ëÃæ¤Î¹à
-Ìܤϡ¢@code{db1.t.col_name} ¤È @code{db2.t.col_name} ¤È¤·¤Æ»²¾È¤¹¤ëɬÍ×
-¤¬¤¢¤ê¤Þ¤¹¡£
-
-@cindex ODBC compatibility
-@cindex Compatibility, with ODBC
-¹½Ê¸ @code{.tbl_name} ¤Ï¸½ºß¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹Æâ¤Î¥Æ¡¼¥Ö¥ë @code{tbl_name}
-¤ò°ÕÌ£¤·¤Þ¤¹¡£¤³¤Î¹½Ê¸¤Ï¤¤¤¯¤Ä¤«¤Î ODBC ¤¬ @samp{.} ʸ»ú¤ò¥Æ¡¼¥Ö¥ë̾¤ÎÁ°
-¤ËÃÖ¤¯¤¿¤á¤Ëµö¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-
-@node Name case sensitivity, , Legal names, Legal names
-@subsubsection ̾Á°¤Î¥±¡¼¥¹°Í¸À­
-@cindex Database names, case sensitivity
-@cindex Table names, case sensitivity
-@cindex Column names, case sensitivity
-@cindex Alias names, case sensitivity
-@cindex Case sensitivity, of database names
-@cindex Case sensitivity, of table names
-@cindex Case sensitivity, of column names
-@cindex Case sensitivity, of alias names
-
-@strong{MySQL} ¤Ç¤Ï¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¥Æ¡¼¥Ö¥ë¤Ï¡¢¥Ç¥£¥ì¥¯¥È¥ê¤È
-¤½¤Î¥Ç¥£¥ì¥¯¥È¥êÃæ¤Î¥Õ¥¡¥¤¥ë¤ËÂбþ¤·¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢²¼¤ÇÆ°ºî¤¹¤ë¥ª¥Ú¥ì¡¼
-¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Î¥±¡¼¥¹°Í¸À­¤Ï¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¥Æ¡¼¥Ö¥ë̾¤Î¥±¡¼¥¹°Í¸À­¤ò·èÄꤷ¤Þ¤¹¡£
-¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¤È¥Æ¡¼¥Ö¥ë̾¤Ï Unix ¤Ç¤Ï¥±¡¼¥¹°Í¸¤Ç¡¢Win32 ¤Ç¤Ï¥±¡¼¥¹Èó°Í
-¸¤Ç¤¹¡£
-
-@strong{Ãí°Õ:} Win32 ¤Ç¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¤È¥Õ¥¡¥¤¥ë̾¤Ï¥±¡¼¥¹Èó°Í¸¤Ç¤¹¤¬¡¢
-Ʊ¤¸¥¯¥¨¥êÆâ¤Ç¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤ä¥Æ¡¼¥Ö¥ë¤ò°Û¤Ê¤ë¥±¡¼¥¹¤ò»ÈÍѤ·¤Æ»²¾È¤¹¤Ù¤­
-¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-°Ê²¼¤Î¥¯¥¨¥ê¤ÏÆ°¤­¤Þ¤»¤ó¡£¤Ê¤¼¤Ê¤é @code{my_table} ¤È @code{MY_TABLE} ¤ÎξÊý¤ò
-»²¾È¤·¤Æ¤¤¤ë¤«¤é¤Ç¤¹¡§
-
-@example
-mysql> SELECT * FROM my_table WHERE MY_TABLE.col=1;
-@end example
-
-¥Õ¥£¡¼¥ë¥É̾¤ÏÁ´¤Æ¤Î¾ì¹ç¤Ç¥±¡¼¥¹Èó°Í¸¤Ç¤¹¡£
-
-¥Æ¡¼¥Ö¥ë¤ÎÊÌ̾¤Ï¥±¡¼¥¹°Í¸¤Ç¤¹¡£
-°Ê²¼¤Î¥¯¥¨¥ê¤ÏÆ°¤­¤Þ¤»¤ó¡£¤Ê¤¼¤Ê¤é @code{a} ¤È @code{A} ¤Î¥¨¥¤¥ê¥¢¥¹¤òξÊý
-»²¾È¤·¤Æ¤¤¤ë¤«¤é¤Ç¤¹¡§
-
-@example
-mysql> SELECT col_name FROM tbl_name AS a
- WHERE a.col_name = 1 OR A.col_name = 2;
-@end example
-
-¥Õ¥£¡¼¥ë¥É¤Î¥¨¥¤¥ê¥¢¥¹Ì¾¤Ï¥±¡¼¥¹Èó°Í¸¤Ç¤¹¡£
-
-
-@node Variables, Column types, Literals, Reference
-@section ¥æ¡¼¥¶¡¼ÊÑ¿ô
-
-@strong{MySQL} ¤Ï¡¢@code{@@variablename} ¹½Ê¸¤Ç¥¹¥ì¥Ã¥É¸ÇÍ­¤ÎÊÑ¿ô¤ò¥µ¥Ý¡¼
-¥È¤·¤Þ¤¹¡£ÊÑ¿ô̾¤Ï¸½ºß¤Îʸ»ú¥»¥Ã¥È¤Î¥¢¥ë¥Õ¥¡¥Ù¥Ã¥È¤È¿ô»ú¡¢¤½¤ì¤Ë
-@samp{_}¡¢@samp{$}¡¢@samp{.} ʸ»ú¤«¤é¤Ê¤ê¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥Èʸ»ú¥»¥Ã¥È¤Ï
-ISO-8859-1 Latin1 ¤Ç¤¹¡£
-¤³¤ì¤Ï @code{mysqld} ¤Ë @code{--default-character-set} ¥ª¥×¥·¥ç¥ó¤ò
-Í¿¤¨¤ë¤³¤È¤ÇÊѹ¹¤Ç¤­¤Þ¤¹. (3.23.14 °Ê¾å¤Î¾ì¹ç¤Î¤ß¡£
-¤½¤ì°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï @strong{MySQL} ºÆ¥³¥ó¥Ñ¥¤¥ë¤¬É¬Í×)
-@xref{Character sets}¡£
-
-ÊÑ¿ô¤Ï½é´ü²½¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï @code{NULL} ¤Ç¤¢¤ê¡¢À°¿ô
-ÃÍ¡¢¼Â¿ôÃÍ¡¢Ê¸»úÎóÃͤò³ÊǼ¤Ç¤­¤Þ¤¹¡£¤¹¤Ù¤Æ¤Î¥¹¥ì¥Ã¥ÉÊÑ¿ô¤Ï¡¢¥¹¥ì¥Ã¥É¤¬½ªÎ»
-¤¹¤ë¤È¼«Æ°Åª¤Ë²òÊü¤µ¤ì¤Þ¤¹¡£
-
-@code{SET} ¹½Ê¸¤ÇÊÑ¿ô¤òÀßÄê¤Ç¤­¤Þ¤¹:
-
-@example
-SET @@variable= @{ integer expression | real expression | string expression @}
-[,@@variable= ...].
-@end example
-
-@code{@@variable:=expr} ¹½Ê¸¤Ç¡¢¼°Ãæ¤ÇÊÑ¿ô¤òÀßÄꤹ¤ë¤³¤È¤â²Äǽ¤Ç¤¹:
-
-@example
-select @@t1:=(@@t2:=1)+@@t3:=4,@@t1,@@t2,@@t3;
-+----------------------+------+------+------+
-| @@t1:=(@@t2:=1)+@@t3:=4 | @@t1 | @@t2 | @@t3 |
-+----------------------+------+------+------+
-| 5 | 5 | 1 | 4 |
-+----------------------+------+------+------+
-@end example
-
-(²æ¡¹¤Ï @code{:=} ¹½Ê¸¤ò»ÈÍѤ¹¤ëɬÍפ¬¤¢¤ê¤Þ¤·¤¿¡£@code{=} ¤ÏÈæ³Ó¤Î¤¿¤á¤Ë
-ͽÌ󤵤ì¤Æ¤¤¤¿¤«¤é¤Ç¤¹¡£)
-
-¥æ¡¼¥¶¡¼ÊÑ¿ô¤Ï¼°¤¬µö¤µ¤ì¤ë¾ì½ê¤Ç»ÈÍѤǤ­¤Þ¤¹¡£Ãí°Õ: ¤³¤ì¤Ï¸½ºß¡¢
-@code{SELECT} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Î @code{LIMIT} Àá¡¢@code{LOAD DATA} ¥¹¥Æ¡¼¥È
-¥á¥ó¥È¤Î @code{IGNORE number LINES} Àá¤Î¤è¤¦¤Ë¡¢¿ôÃͤ¬ÌÀ¼¨Åª¤ËÍ׵ᤵ¤ì¤ëʸ
-Ì®¤Ç¤Î»ÈÍѤò´Þ¤ß¤Þ¤»¤ó¡£
-
-@strong{Ãí°Õ:} @code{SELECT} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ç¤Ï¡¢¤½¤ì¤¾¤ì¤Î¼°¤Ï¥¯¥é¥¤¥¢¥ó
-¥È¤ËÁ÷¤é¤ì¤¿»þ¤Ë¤À¤±É¾²Á¤µ¤ì¤Þ¤¹¡£¤³¤ì¤Ï¡¢@code{SELECT} Éô¤ÇÀßÄꤵ¤ì¤¿ÊÑ¿ô
-¤òɬÍפȤ¹¤ë¼°¤ò»²¾È¤¹¤ë @code{HAVING}, @code{GROUP BY}, @code{ORDER BY}
-À᤬¤Ç¤­¤Ê¤¤¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£Î㤨¤Ð¡¢¼¡¤Î¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ï´üÂÔÄ̤ê¤Ë¤ÏÆ°ºî
-¤·¤Þ¤»¤ó:
-
-@example
-SELECT (@@aa:=id) AS a, (@@aa+3) AS b FROM table_name HAVING b=5;
-@end example
-
-¤³¤ÎÍýͳ¤Ï¡¢@code{@@aa} ¤¬¸½ºß¤Î¥ì¥³¡¼¥É¤ÎÃͤǤϤʤ¯¡¢Á°¤Ë¼õ¤±¼è¤Ã¤¿¥ì¥³¡¼
-¥É¤Î @code{id} ¤ÎÃͤˤʤ뤫¤é¤Ç¤¹¡£
-
-@node Column types, Functions, Variables, Reference
-@section ¥Õ¥£¡¼¥ë¥É·¿
-
-@strong{MySQL}¤Ï¿¤¯¤Î¥Õ¥£¡¼¥ë¥É·¿¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤ª¤ê¡¢¤½¤ì¤é¤Ï£³¤Ä¤Î¥«¥Æ¥´¥ê¤Ë¥°¥ë¡¼¥×²½¤µ¤ì¤Þ¤¹: ¿ôÃÍ·¿¡¢ÆüÉÕµÚ¤Ó»þ´Ö·¿¡¢¤½¤·¤Æʸ»úÎó(ʸ»ú)·¿¡£
-¤³¤Î¾Ï¤Ç¤Ï¤Þ¤º¡¢ÍøÍѤǤ­¤ë·¿¤Î³µÍפ«¤é»Ï¤Þ¤ê¡¢¤½¤ì¤«¤é³Æ¥«¥Æ¥´¥ê¤Î³Æ¥Õ¥£¡¼¥ë¥É·¿¤Î½êÍ×µ­²±ÍÆÎ̤ÎÍ×Ìó¤È¡¢·¿¤Î°À­¤Ë¤Ä¤¤¤Æ¤Î¤è¤ê¾ÜºÙ¤Ê¾ðÊó¤òÄ󶡤·¤Þ¤¹¡£
-³µÍפϰտÞŪ¤Ë´Ê·é¤Ë¤Þ¤È¤á¤Æ¤¤¤Þ¤¹¡£ÃͤȤ·¤Æ»ØÄê¤Ç¤­¤ë½ñ¼°¤Î¤è¤¦¤Ê¥Õ¥£¡¼¥ë¥É·¿¸ÇÍ­¤ÎÉղþðÊó¤Ï¡¢¾ÜºÙ¤ÎÀâÌÀÉô¤Ë¤ÆÄ´¤Ù¤Æ²¼¤µ¤¤¡£
-
-@strong{MySQL}¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤ë¥Õ¥£¡¼¥ë¥É·¿¤Ï°Ê²¼¤Ë¼¨¤¹Ä̤ê¤Ç¤¹¡£¸å¤Ë³¤¯Ê¸»ú¤Î°ÕÌ£¤ÏÀâÌÀ¤Î¤¿¤á¤Ë»È¤ï¤ì¤Þ¤¹:
-
-@table @code
-@item M
-ºÇÂçɽ¼¨¥µ¥¤¥º¤ò°ÕÌ£¤·¤Þ¤¹¡£ºÇÂç¤Îɽ¼¨·å¿ô¤Ï 255.
-
-@item D
-ÉâÆ°¾®¿ôÅÀ¿ô·¿¤ËŬÍѤµ¤ì¡¢¾®¿ôÅÀ°Ê²¼¤Î·å¿ô¤òɽ¤·¤Þ¤¹¡£
-ºÇÂç¤ÎÃÍ¤Ï 30 ¤Ç¤¹¤¬¡¢¤³¤ì¤Ï @code{M}-2 ¤è¤êÂ礭¤¯¤Ê¤Ã¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£
-@end table
-
-Ã楫¥Ã¥³(@samp{[}µÚ¤Ó@samp{]})¤Ï·¿ÄêµÁ¤Î°ìÉô¤Ç¤¢¤ê¡¢¤½¤ì¤¬¥ª¥×¥·¥ç¥ó¤Ç¤¢¤ë¤³¤È¤òɽ¤·¤Þ¤¹¡£
-
-@tindex Types
-
-@c The @w{-number} stuff keeps a linebreak from occurring between
-@c the - and number.
-
-¤â¤·¤¢¤ë¥Õ¥£¡¼¥ë¥É¤Ë @code{ZEROFILL} ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢
- @strong{MySQL} ¤Ï¼«Æ°¤Ç @code{UNSIGNED} °À­¤ò¤½¤Î¥Õ¥£¡¼¥ë¥É¤Ë
-Äɲä·¤Þ¤¹¡£
-
-@table @code
-@tindex TINYINT
-@item TINYINT[(M)] [UNSIGNED] [ZEROFILL]
-
-¤È¤Æ¤â¾®¤µ¤¤À°¿ô¡£Éä¹æ¤Ä¤­¤ÎÈÏ°Ï¤Ï @code{-128}¡Á@code{127}¡£Éä¹æ¤Ê¤·¤ÎÈÏ°Ï¤Ï @code{0}¡Á@code{255}¡£
-
-@tindex SMALLINT
-@item SMALLINT[(M)] [UNSIGNED] [ZEROFILL]
-
-¾®¤µ¤¤À°¿ô¡£Éä¹æ¤Ä¤­¤ÎÈÏ°Ï¤Ï @code{-32768}¡Á@code{32767}¡£Éä¹æ¤Ê¤·¤ÎÈÏ°Ï¤Ï @code{0}¡Á@code{65535}¡£
-
-@tindex MEDIUMINT
-@item MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL]
-
-Ãæ´Ö¤ÎÀ°¿ô¡£Éä¹æ¤¢¤ê¤ÎÈÏ°Ï¤Ï @code{-8388608}¡Á@code{8388607}¡£Éä¹æ¤Ê¤·¤ÎÈÏ°Ï¤Ï @code{0}¡Á@code{16777215}
-
-@tindex INT
-@item INT[(M)] [UNSIGNED] [ZEROFILL]
-
-Ä̾ï¤ÎÀ°¿ô¡£Éä¹æ¤¢¤ê¤ÎÈÏ°Ï¤Ï @code{-2147483648}¡Á@code{2147483647}¡£Éä¹æ¤Ê¤·¤ÎÈÏ°Ï¤Ï @code{0}¡Á@code{4294967295}
-
-@tindex INTEGER
-@item INTEGER[(M)] [UNSIGNED] [ZEROFILL]
-
-¤³¤ì¤Ï¡¢@code{INT}¤ÎƱµÁ¸ì¤Ç¤¹¡£
-
-@tindex BIGINT
-@item BIGINT[(M)] [UNSIGNED] [ZEROFILL]
-
-Â礭¤¤À°¿ô¡£Éä¹æ¤¢¤ê¤ÎÈÏ°Ï¤Ï @code{-9223372036854775808}¡Á@code{9223372036854775807}¡£
-Éä¹æ¤Ê¤·¤ÎÈÏ°Ï¤Ï @code{0}¡Á@code{18446744073709551615}¡£
-Á´¤Æ¤Î±é»»¤ÏÉä¹çÉÕ¤­ @code{BIGINT} ¤Þ¤¿¤Ï @code{DOUBLE} ¤Ç¹Ô¤ï¤ì¤ë¤¿¤á¡¢
-Éä¹ç̵¤·¤Î @code{9223372036854775807} (63 bits) ¤è¤ê¤âÂ礭¤ÊÀ°¿ô¤ò
-¥Ó¥Ã¥È´Ø¿ô°Ê³°¤Ç»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡ª
-@code{-}¡¢@code{+}µÚ¤Ó@code{*}¤Ï¡¢Î¾Êý¤Î°ú¿ô¤¬@code{INTEGER}Ãͤλþ¡¢@code{BIGINT}±é»»¤ò»È¤¦¤³¤È¤ËÃí°Õ¤·¤Æ²¼¤µ¤¤¡ª¤³¤ì¤Ï¡¢£²¤Ä¤ÎÂ礭¤ÊÀ°¿ô¤Î¤«¤±»»¤ò¹Ô¤Ê¤¦(Ëô¤ÏÀ°¿ô¤òÊÖ¤¹´Ø¿ô¤Î·ë²Ì¤¬Â礭¤ÊÀ°¿ô¤Ç¤¢¤ë)»þ¡¢·ë²Ì¤¬@code{9223372036854775807}¤è¤ê¤âÂ礭¤¤¾ì¹ç¤Ëͽ´ü¤·¤Ê¤¤·ë²Ì¤ò¼õ¤±¼è¤ë¤³¤È¤¬¤¢¤ë¤È¤¤¤¦¤³¤È¤ò°ÕÌ£¤·¤Æ¤¤¤Þ¤¹¡£
-
-@tindex FLOAT(precision)
-@item FLOAT(precision) [ZEROFILL]
-
-ÉâÆ°¾®¿ôÅÀ¿ô¡£Éä¹æ¤Ê¤·¤Ë¤Ï¤Ç¤­¤Þ¤»¤ó¡£Ã±ÀºÅÙÉâÆ°¾®¿ôÅÀ¿ô¤Ç¤Ï
-@code{precision} ¤¬ @code{<=24} ¤Ç¡¢ÇÜÀºÅÙÉâÆ°¾®¿ôÅÀ¿ô¤Ç¤Ï 25¡Á53 ¤Î´Ö¤Ç¤¹¡£
-¤³¤ì¤é¤Î·¿¤Ï¼¡¤Ç½Ò¤Ù¤ë@code{FLOAT}¤ä@code{DOUBLE}·¿¤Ë»÷¤Æ¤¤¤Þ¤¹¡£
-@code{FLOAT(X)}¤Ï¡¢@code{FLOAT}µÚ¤Ó@code{DOUBLE}·¿¤Ë°ìÃפ¹¤ëƱ¤¸ÈϰϤò»ý¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¢
-ɽ¼¨¥µ¥¤¥º¤ä¾®¿ôÅÀ°Ê²¼·å¿ô¤¬ÄêµÁ¤µ¤ì¤Þ¤»¤ó¡£
-
-@strong{MySQL} 3.23 ¤Ç¤Ï¡¢¤³¤ì¤ÏÀµ¤·¤¤ÉâÆ°¾®¿ôÅÀ¤Ç¤¹¡£Á°¤Î
-@strong{MySQL} ¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï, @code{FLOAT(precision)} ¤Ï¾ï¤Ë¾®¿ôÉô¤Ï2·å¤Ç
-¤·¤¿¡£
-
-@cindex ODBC compatibility
-@cindex Compatibility, with ODBC
-¤³¤Î¹½Ê¸¤Ï ODBC ¸ß´¹¤Ç¤¹¡£
-
-@tindex FLOAT
-@tindex FLOAT(M,D)
-@item FLOAT[(M,D)] [ZEROFILL]
-
-¾®¤µ¤¤ÉâÆ°¾®¿ôÅÀ¿ô¡£Éä¹æ¤Ê¤·¤Ë¤Ï¤Ç¤­¤Þ¤»¤ó¡£
-ÈÏ°Ï¤Ï @code{@w{-3.402823466E+38}}¡Á@code{@w{-1.175494351E-38}}¡¢ @code{0}¡¢
-@code{@w{1.175494351E-38}}¡Á@code{3.402823466E+38}¤Ç¤¹¡£
-M ¤Ïɽ¼¨Éý¤Ç D ¤Ï¾®¿ôÉô·å¿ô¤Ç¤¹¡£°ú¿ô¤¬Ìµ¤¤¤«°ú¿ô¤¬24°Ê²¼¤Î @code{FLOAT}
-¤ÏñÀºÅÙÉâÆ°¾®¿ôÅÀ¿ô¤ò°ÕÌ£¤·¤Þ¤¹¡£
-
-@tindex DOUBLE
-@tindex FLOAT(precision)
-@item DOUBLE[(M,D)] [ZEROFILL]
-
-Ä̾ï¤ÎÉâÆ°¾®¿ôÅÀ¿ô¡£Éä¹æ¤Ê¤·¤Ë¤Ï¤Ç¤­¤Þ¤»¤ó¡£
-ÈÏ°Ï¤Ï @code{@w{-1.7976931348623157E+308}}¡Á@code{@w{-2.2250738585072014E-308}}¡¢ @code{0}¡¢@code{2.2250738585072014E-308}¡Á@code{1.7976931348623157E+308}¤Ç¤¹¡£
-M ¤Ïɽ¼¨Éý¤Ç D ¤Ï¾®¿ôÉô·å¿ô¤Ç¤¹¡£°ú¿ô¤¬Ìµ¤¤¤« @code{DOUBLE} ¤«¡¢25 <= X
-<= 53 ¤Ç¤¢¤ë @code{FLOAT(X)} ¤ÏÇÜÀºÅÙÉâÆ°¾®¿ôÅÀ¿ô¤ò°ÕÌ£¤·¤Þ¤¹¡£
-
-@tindex DOUBLE PRECISION
-@tindex REAL
-@item DOUBLE PRECISION[(M,D)] [ZEROFILL]
-@itemx REAL[(M,D)] [ZEROFILL]
-
-¤³¤ì¤é¤Ï@code{DOUBLE}¤ÎƱµÁ¸ì¤Ç¤¹¡£
-
-@tindex DECIMAL
-@item DECIMAL[(M[,D])] [ZEROFILL]
-
-¥Ñ¥Ã¥¯Ìµ¤·ÉâÆ°¾®¿ôÅÀ¿ô¡£Éä¹æ¤Ê¤·¤Ë¤Ï¤Ç¤­¤Þ¤»¤ó¡£@code{CHAR}¥Õ¥£¡¼¥ë¥É¤Î¤è¤¦¤Ë¿¶Éñ¤¤¤Þ¤¹¡£`¥Ñ¥Ã¥¯Ìµ¤·'¤Ï¡¢¿ôÃͤ¬Ê¸»úÎó¤È¤·¤Æ³ÊǼ¤µ¤ì¤ë¤³¤È¤ò°ÕÌ£¤·¡¢¿ôÃͤΤ½¤ì¤¾¤ì¤Î·å¡¢¾®¿ôÅÀ¡¢µÚ¤ÓÉé¿ô¤Ç¤Î@samp{-}Éä¹æ¤Ë£±Ê¸»ú»ÈÍѤ·¤Þ¤¹¡£
-@code{D}¤¬0¤Î»þ¡¢ÃͤϾ®¿ôÅÀ¤ä¾®¿ôÉô¤ò»ý¤Á¤Þ¤»¤ó¡£@code{DECIMAL}ÃͤκÇÂçÈϰϤÏ@code{DOUBLE}¤ÈƱ¤¸¤Ç¤¹¤¬¡¢¼ÂºÝ¤ÎÈϰϤÏ@code{DECIMAL}¥Õ¥£¡¼¥ë¥É¤ËÍ¿¤¨¤é¤ì¤¿@code{M}µÚ¤Ó@code{D}¤ÎÁªÂò¤Ë¶¯À©¤µ¤ì¤Þ¤¹¡£
-
-@code{D} ¤ò¾Êά¤·¤¿¾ì¹ç¤Ï 0 ¤ËÀßÄꤵ¤ì¤¤¤Þ¤¹¡£@code{M} ¤ò¾Êά¤·¤¿¾ì¹ç¤Ï
-10 ¤ËÀßÄꤵ¤ì¤Þ¤¹¡£
-
-@strong{MySQL} 3.22 ¤Ç¤Ï¡¢ @code{M} °ú¿ô¤ÏÉä¹æ¤ä¾®¿ôÅÀ¤ò´Þ¤ß¤Þ¤¹¡£
-
-@tindex NUMERIC
-@item NUMERIC(M,D) [ZEROFILL]
-
-@code{DECIMAL}¤ÈƱ¤¸¡£
-
-@tindex DATE
-@item DATE
-
-ÆüÉÕ¡£¥µ¥Ý¡¼¥È¤µ¤ì¤ëÈϰϤÏ@code{'1000-01-01'}¤«¤é@code{'9999-12-31'}¤Þ¤Ç¡£
-@strong{MySQL}¤Ï@code{'YYYY-MM-DD'}¤Î½ñ¼°¤Ç@code{DATE}Ãͤòɽ¼¨¤·¤Þ¤¹¤¬¡¢@code{DATE}¥Õ¥£¡¼¥ë¥É¤Ø¤ÎÃͤγäÅö¤Æ¤Ï¡¢Ê¸»úÎó¤â¤·¤¯¤Ï¿ôÃͤΤ¤¤º¤ì¤«¤Î»ÈÍѤ¬µö¤µ¤ì¤Þ¤¹¡£
-
-@tindex DATETIME
-@item DATETIME
-
-ÆüÉդȻþ¹ï¤ÎÁȤ߹ç¤ï¤»¡£¥µ¥Ý¡¼¥È¤µ¤ì¤ëÈϰϤÏ@code{'1000-01-01 00:00:00'}¡Á@code{'9999-12-31 23:59:59'}¤Ç¤¹¡£@strong{MySQL}¤Ï@code{DATETIME}Ãͤò@code{'YYYY-MM-DD HH:MM:SS'}¤È¤¤¤¦½ñ¼°¤Çɽ¼¨¤·¤Þ¤¹¤¬¡¢@code{DATETIME}¥Õ¥£¡¼¥ë¥É¤Ø¤ÎÃͤγäÅö¤Æ¤Ï¡¢Ê¸»úÎó¤â¤·¤¯¤Ï¿ôÃͤΤ¤¤º¤ì¤«¤Î»ÈÍѤ¬µö¤µ¤ì¤Þ¤¹¡£
-
-@tindex TIMESTAMP
-@item TIMESTAMP[(M)]
-
-¥¿¥¤¥à¥¹¥¿¥ó¥×¡£ÈϰϤÏ@code{'1970-01-01 00:00:00'}¡Á@code{2106}ǯËö¤Þ¤Ç¤Ç¤¹¡£@strong{MySQL}¤Ï@code{TIMESTAMP}Ãͤò@code{YYYYMMDDHHMMSS}¡¢@code{YYMMDDHHMMSS}¡¢@code{YYYYMMDD}Ëô¤Ï@code{YYMMDD}¤È¤¤¤¦½ñ¼°¤Çɽ¼¨¤·¡¢¤½¤ì¤Ï@code{M}¤Ë@code{14}(¤â¤·¤¯¤Ï¸í¤Ã¤Æ¤½¤ì°Ê¾å¤ÎÃͤò»ØÄꤷ¤¿»þ)¡¢@code{12}¡¢@code{8}Ëô¤Ï@code{6}¤Î¤¤¤º¤ì¤¬»ØÄꤵ¤ì¤¿¤«¤Ë°Í¸¤·¤Þ¤¹¡£¤·¤«¤·¤Ê¤¬¤é@code{TIMESTAMP}¥Õ¥£¡¼¥ë¥É¤Ø¤ÎÃͤγäÅö¤Æ¤Ï¡¢Ê¸»úÎó¤â¤·¤¯¤Ï¿ôÃͤΤ¤¤º¤ì¤«¤Î»ÈÍѤ¬µö¤µ¤ì¤Þ¤¹¡£
-@code{TIMESTAMP}¥Õ¥£¡¼¥ë¥É¤Ï¡¢ºÇ¸å¤ËÁàºî¤µ¤ì¤¿»þ¹ï¤ò¼«Æ°Åª¤ËÀßÄꤹ¤ë¤Î¤Ç¡¢@code{INSERT}¤ä@code{UPDATE}Áàºî¤Î»þ¹ï¤òµ­Ï¿¤¹¤ë¤Î¤ËÌòΩ¤Á¤Þ¤¹¡£
-@code{NULL}ÃͤòÍ¿¤¨¤ë¤³¤È¤Ë¤è¤Ã¤Æ¤â¡¢¸½ºß»þ¹ï¤òÀßÄê¤Ç¤­¤Þ¤¹¡£
-@xref{Date and time types}¡£
-
-@tindex TIME
-@item TIME
-
-»þ´Ö¡£ÈϰϤÏ@code{'-838:59:59'}¡Á@code{'838:59:59'}¤Ç¤¹¡£
-@strong{MySQL}¤Ï@code{TIME}Ãͤò@code{'HH:MM:SS'}¤È¤¤¤¦½ñ¼°¤Çɽ¼¨¤·¤Þ¤¹¤¬¡¢@code{TIME}¥Õ¥£¡¼¥ë¥É¤Ø¤ÎÃͤγäÅö¤Æ¤Ï¡¢Ê¸»úÎó¤â¤·¤¯¤Ï¿ôÃͤΤ¤¤º¤ì¤«¤Î»ÈÍѤ¬µö¤µ¤ì¤Þ¤¹¡£
-
-@tindex YEAR
-@item YEAR[(2|4)]
-
-ǯ¡£2·å¤Þ¤¿¤Ï4·å·Á¼°(¥Ç¥Õ¥©¥ë¥È¤Ï4·å)¡£µö¤µ¤ì¤ëÃͤϡ¢4·å·Á¼°¤Ç¤Ï
-@code{1901}¡Á@code{2155}, @code{0000} ¤Ç¡¢2·å·Á¼°(70¡Á69)¤Ç¤Ï 1970¡Á2069
-¤Ç¤¹¡£@strong{MySQL} ¤Ï @code{YEAR} Ãͤò @code{YYYY} ·Á¼°¤Çɽ¼¨¤·¤Þ¤¹¤¬¡¢
-@code{YEAR} ¥Õ¥£¡¼¥ë¥É¤Ø¤ÎÃͤγä¤êÅö¤Æ¤Ïʸ»úÎó¤È¿ô»ú¤Î¤É¤Á¤é¤Ç¤â»ÈÍѤǤ­¤Þ
-¤¹¡£(@code{YEAR} ¤Ï @strong{MySQL} 3.22 ¤Ç¤Î¿·¤·¤¤·¿¤Ç¤¹¡£)
-
-@tindex NATIONAL CHAR
-@tindex NCHAR
-@tindex CHAR
-@tindex CHARACTER
-@item [NATIONAL] CHAR(M) [BINARY]
-
-¸ÇÄêĹʸ»úÎó¤Ç¡¢³ÊǼ»þ¤Ë¤Ïɬ¤º»ØÄꤵ¤ì¤¿Ä¹¤µ¤Þ¤Ç±¦Â¦¤Ë¶õÇò¤òËä¤á¤Þ¤¹¡£
-@code{M}¤ÎÈÏ°Ï¤Ï 1 ¤«¤é 255 ʸ»ú¤Ç¤¹¡£¸å³¤Î¶õÇò¤ÏÃͤμè¤ê½Ð¤·»þ¤Ëºï½ü¤µ¤ì
-¤Þ¤¹¡£@code{BINARY} ¥­¡¼¥ï¡¼¥É¤¬Í¿¤¨¤é¤ì¤Ê¤¤¾ì¹ç¡¢@code{CHAR} ÃͤΥ½¡¼¥È¤È
-Èæ³Ó¤Ï¡¢¥Ç¥Õ¥©¥ë¥Èʸ»ú¥»¥Ã¥È¤Ë½¾¤Ã¤Æ¥±¡¼¥¹Èó°Í¸¤ÎÊýË¡¤Ç¹Ô¤Ê¤ï¤ì¤Þ¤¹¡£
-
-@code{NATIONAL CHAR} (û¤¤·Á¼°¤Ï @code{NCHAR}) ¤Ï¡¢ANSI SQL ¤Ç¡¢CHAR ¥Õ¥£¡¼
-¥ë¥É¤¬¥Ç¥Õ¥©¥ë¥Èʸ»ú¥»¥Ã¥È¤ò»ÈÍѤ¹¤ë¤³¤È¤òÄêµÁ¤¹¤ëÊýË¡¤Ç¤¹¡£¤³¤ì¤Ï
-@code{MySQL} ¤Ç¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤¹¡£
-
-@code{CHAR} ¤Ï @code{CHARACTER} ¤Îάµ­¤Ç¤¹¡£
-
-@strong{MySQL} ¤Ï @code{CHAR(0)} ·¿¤Î¥Õ¥£¡¼¥ë¥É¤ÎÀ¸À®¤òµö¤·¤Þ¤¹¡£¤³¤ì¤Ï¼ç
-¤Ë¡¢¼ÂºÝ¤Ë¤Ï¤â¤¦Ãͤ¬»È¤ï¤ì¤Æ¤¤¤Ê¤¤¥Õ¥£¡¼¥ë¥É¤¬Â¸ºß¤¹¤ë¤³¤È¤Ë°Í¸¤·¤Æ¤¤¤ë¤è
-¤¦¤Ê¤¤¤¯¤Ä¤«¤Î¸Å¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ËÂбþ¤¹¤ëɬÍפ¬¤¢¤ë»þ¤ËÊØÍø¤Ç¤¹¡££²¤Ä¤Î
-ÃͤÀ¤±¤ò¼è¤ë¤³¤È¤¬¤Ç¤­¤ë¥Õ¥£¡¼¥ë¥É¤òɬÍפȤ¹¤ë»þ¤Ë¤â¤È¤Æ¤âÎɤ¤¤³¤È¤Ç¤¹:
-@code{NOT NULL} ¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤Ê¤¤ @code{CHAR(0)} ¤Ï1¥Ó¥Ã¥È¤À¤±¤òÀêÍ­
-¤·¡¢£²¤Ä¤ÎÃͤÀ¤±¤ò¼è¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹: @code{NULL} ¤Þ¤¿¤Ï @code{""}¡£
-
-@tindex CHARACTER VARYING
-@tindex CHAR VARYING
-@tindex VARCHAR
-@item [NATIONAL] VARCHAR(M) [BINARY]
-
-²ÄÊÑĹʸ»úÎó¡£ Ãí°Õ:
-¸å³¤Î¶õÇò¤Ï³ÊǼ»þ¤Ëºï½ü¤µ¤ì¤Þ¤¹(¤³¤ì¤Ï ANSI SQL »ÅÍͤȰۤʤê¤Þ¤¹)¡£
-@code{M}¤ÎÈÏ°Ï¤Ï 1 ¤«¤é 255 ʸ»ú¤Ç¤¹¡£
-@code{BINARY} ¥­¡¼¥ï¡¼¥É¤¬Í¿¤¨¤é¤ì¤Ê¤¤¾ì¹ç¡¢¥½¡¼¥È¤ÈÈæ³Ó¤Ï¥±¡¼¥¹¤Ë°Í¸¤·¤Þ¤»¤ó¡£
-@xref{Silent column changes}.
-
-@code{VARCHAR} ¤Ï @code{CHARACTER VARYING} ¤Îάµ­¤Ç¤¹¡£
-
-@tindex TINYBLOB
-@tindex TINYTEXT
-@item TINYBLOB
-@itemx TINYTEXT
-
-ºÇÂçĹ 255 (2^8 - 1) ʸ»ú¤Î @code{TEXT}/@code{BLOB}¡£@xref{Silent column changes}.
-
-@tindex BLOB
-@tindex TEXT
-@item BLOB
-@itemx TEXT
-
-ºÇÂçĹ 65535 (2^16 - 1) ʸ»ú¤Î @code{TEXT}/@code{BLOB}¡£@xref{Silent column changes}.
-
-@tindex MEDIUMBLOB
-@tindex MEDIUMTEXT
-@item MEDIUMBLOB
-@itemx MEDIUMTEXT
-
-ºÇÂçĹ 16777215 (2^24 - 1) ʸ»ú¤Î @code{TEXT}/@code{BLOB}¡£@xref{Silent column changes}.
-
-@tindex LONGBLOB
-@tindex LONGTEXT
-@item LONGBLOB
-@itemx LONGTEXT
-
-ºÇÂçĹ 4294967295 (2^32 - 1) ʸ»ú¤Î @code{TEXT}/@code{BLOB}¡£@xref{Silent column changes}.
-
-@tindex ENUM
-@item ENUM('value1','value2',...)
-
-Îóµó¡£
-ÂоݤȤʤëʸ»úÎó¤Ï¡¢Ãͤò°ì¤Ä¤À¤±»ý¤Á¡¢Ãͥꥹ¥È@code{'value1', 'value2',...}(Ëô¤Ï@code{NULL})¤«¤éÁª¤Ð¤ì¤Þ¤¹¡£@code{ENUM}¤ÏºÇÂç65535¸Ä¤Î¸ÇÍ­Ãͤò»ý¤Ä¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@tindex SET
-@item SET('value1','value2',...)
-
-ÁÈ¡£
-ÂоݤȤʤëʸ»úÎó¤Ï0°Ê¾å¤ÎÃͤò»ý¤Á¡¢¤½¤ì¤¾¤ìÃͥꥹ¥È@code{'value1', 'value2',...}¤«¤éÁª¤Ð¤ì¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-@code{SET}¤Ï¡¢ºÇÂç 64¸Ä¤ÎÍ×ÁǤò»ý¤Ä¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@end table
-
-@menu
-* Storage requirements:: Column type storage requirements
-* Numeric types:: Numeric types
-* Date and time types:: Date and time types
-* String types:: String types
-* Casts:: Cast operators
-* Choosing types:: Choosing the right type for a column
-* Indexes:: Column indexes
-* Multiple-column indexes:: Multiple-column indexes
-* Other-vendor column types:: Using column types from other database engines
-@end menu
-
-@cindex Storage requirements
-@node Storage requirements, Numeric types, Column types, Column types
-@subsection ¥Õ¥£¡¼¥ë¥É¥¿¥¤¥×¤Î½êÍ×ÍÆÎÌ
-
-@strong{MySQL}¤¬¥µ¥Ý¡¼¥È¤¹¤ë³Æ¥Õ¥£¡¼¥ë¥É¥¿¥¤¥×Ëè¤Î½êÍ×ÍÆÎ̤ò¡¢¥«¥Æ¥´¥êÊ̤˰ʲ¼¤Ëµ­½Ò¤·¤Þ¤¹¡£
-
-@subheading ¿ôÃÍ¥¿¥¤¥×
-
-@multitable @columnfractions .35 .65
-@item @strong{¥Õ¥£¡¼¥ë¥É¥¿¥¤¥×} @tab @strong{½êÍ×ÍÆÎÌ}
-@item @code{TINYINT} @tab 1 byte
-@item @code{SMALLINT} @tab 2 bytes
-@item @code{MEDIUMINT} @tab 3 bytes
-@item @code{INT} @tab 4 bytes
-@item @code{INTEGER} @tab 4 bytes
-@item @code{BIGINT} @tab 8 bytes
-@item @code{FLOAT(X)} @tab X <= 24 ¤Î¾ì¹ç 4¡¢25 <= X <= 53 ¤Î¾ì¹ç 8
-@item @code{FLOAT} @tab 4 bytes
-@item @code{DOUBLE} @tab 8 bytes
-@item @code{DOUBLE PRECISION} @tab 8 bytes
-@item @code{REAL} @tab 8 bytes
-@item @code{DECIMAL(M,D)} @tab @code{M} bytes (@code{M < D} ¤Î¾ì¹ç @code{D}+2)
-@item @code{NUMERIC(M,D)} @tab @code{M} bytes (@code{M < D} ¤Î¾ì¹ç @code{D}+2)
-@end multitable
-
-@subheading ÆüÉդȻþ´Ö¥¿¥¤¥×
-
-@multitable @columnfractions .35 .65
-@item @strong{¥Õ¥£¡¼¥ë¥É¥¿¥¤¥×} @tab @strong{½êÍ×ÍÆÎÌ}
-@item @code{DATE} @tab 3 bytes
-@item @code{DATETIME} @tab 8 bytes
-@item @code{TIMESTAMP} @tab 4 bytes
-@item @code{TIME} @tab 3 bytes
-@item @code{YEAR} @tab 1 byte
-@end multitable
-
-@subheading ʸ»úÎ󥿥¤¥×
-
-@multitable @columnfractions .35 .65
-@item @strong{¥Õ¥£¡¼¥ë¥É¥¿¥¤¥×} @tab @strong{½êÍ×ÍÆÎÌ}
-@item @code{CHAR(M)} @tab @code{M} bytes, @code{1 <= M <= 255}
-@item @code{VARCHAR(M)} @tab @code{L}+1 bytes, where @code{L <= M} and
-@code{1 <= M <= 255}
-@item @code{TINYBLOB}, @code{TINYTEXT} @tab @code{L}+1 bytes,
-where @code{L} < 2^8
-@item @code{BLOB}, @code{TEXT} @tab @code{L}+2 bytes,
-where @code{L} < 2^16
-@item @code{MEDIUMBLOB}, @code{MEDIUMTEXT} @tab @code{L}+3 bytes,
-where @code{L} < 2^24
-@item @code{LONGBLOB}, @code{LONGTEXT} @tab @code{L}+4 bytes,
-where @code{L} < 2^32
-@item @code{ENUM('value1','value2',...)} @tab 1 or 2 bytes, ÎóµóÃͤοô¤Ë°Í¸ (ºÇÂçÃÍ¤Ï 65535 )
-@item @code{SET('value1','value2',...)} @tab 1, 2, 3, 4 or 8 bytes, Í×ÁǤοô¤Ë°Í¸ (ºÇÂçÍ×ÁÇ 64 )
-@end multitable
-
-@code{VARCHAR}¡¢@code{BLOB}¡¢µÚ¤Ó@code{TEXT}·¿¤Ï²ÄÊÑĹ·¿¤Ç¤¢¤ê¡¢½êÍ×ÍÆÎ̤ϡ¢¥Õ¥£¡¼¥ë¥É¤Î¤È¤êÆÀ¤ëºÇÂ祵¥¤¥º¤È¤¤¤¦¤è¤ê¤Ï¤à¤·¤í¥Õ¥£¡¼¥ë¥ÉÃͤμºݤÎŤµ¤Ë°Í¸¤·¤Þ¤¹(Á°¤Îɽ¤Ç@code{L}¤Èɽ¤·¤Þ¤·¤¿)¡£
-Î㤨¤Ð¡¢@code{VARCHAR(10)}¥Õ¥£¡¼¥ë¥É¤Ï¡¢ºÇÂç10ʸ»úʬ¤ÎŤµ¤Îʸ»úÎó¤òÊÝ»ý¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£¼ÂºÝ¤Î½êÍ×ÍÆÎ̤ϡ¢Ê¸»úÎó¤ÎŤµ(@code{L})¤È¡¢¤½¤ÎŤµ¤òµ­Ï¿¤¹¤ë¤¿¤á¤Î£±¥Ð¥¤¥È¤ò²Ã¤¨¤Þ¤¹¡£Ê¸»úÎó@code{'abcd'}¤Ë¤ª¤¤¤Æ¤Ï¡¢@code{L}¤Ï£´¤Ç¡¢½êÍ×ÍÆÎ̤ϣµ¥Ð¥¤¥È¤Ç¤¹¡£
-
-@code{BLOB}¤È@code{TEXT}·¿¤Ï¡¢¥Õ¥£¡¼¥ë¥ÉÃͤÎŤµ¤òµ­Ï¿¤¹¤ë¤Î¤Ë¡¢£±¡¢£²¡¢£³¡¢Ëô¤Ï£´¥Ð¥¤¥ÈɬÍפȤ·¡¢·¿¤Î¤È¤êÆÀ¤ëºÇÂç¤ÎŤµ¤Ë°Í¸¤·¤Þ¤¹¡£
-
-¥Æ¡¼¥Ö¥ë¤¬²ÄÊÑĹ¥Õ¥£¡¼¥ë¥É·¿¤ò´Þ¤à¾ì¹ç¡¢¤½¤Î¥ì¥³¡¼¥É¥Õ¥©¡¼¥Þ¥Ã¥È¤â¤Þ¤¿²ÄÊÑĹ¤È¤Ê¤ë¤Ç¤·¤ç¤¦¡£
-¥Æ¡¼¥Ö¥ë¤¬ºîÀ®¤µ¤ì¤¿»þ¡¢@strong{MySQL}¤Ï³Î¤«¤Ê¾ò·ï¤Î²¼¡¢¥Õ¥£¡¼¥ë¥É¤ò²ÄÊÑĹ¥¿¥¤¥×¤«¤é¸ÇÄêĹ¥¿¥¤¥×¤ØÊѹ¹¤·¡¢ÉûºîÍѤòµ¯¤³¤¹¤³¤È¤ËÃí°Õ¤·¤Æ²¼¤µ¤¤¡£
-
-@code{ENUM}¥ª¥Ö¥¸¥§¥¯¥È¤Î¥µ¥¤¥º¤Ï¡¢°Û¤Ê¤ëÎóµóÃͤοô¤Ë¤è¤Ã¤Æ·è¤á¤é¤ì¤Þ¤¹¡£
-Îóµó¤¹¤ë¿ô¤¬255°ÊÆâ¤Ç¤Ï¡¢£±¥Ð¥¤¥È¤¬»ÈÍѤµ¤ì¤Þ¤¹¡£
-Îóµó¤¹¤ë¿ô¤¬65535°ÊÆâ¤Ç¤Ï¡¢£²¥Ð¥¤¥È¤¬»ÈÍѤµ¤ì¤Þ¤¹¡£
-
-@code{SET}¥ª¥Ö¥¸¥§¥¯¥È¤Î¥µ¥¤¥º¤Ï¡¢°Û¤Ê¤ëÍ×ÁǤοô¤Ë¤è¤Ã¤Æ·è¤á¤é¤ì¤Þ¤¹¡£
-ÁȤΥµ¥¤¥º¤ò@code{N}¤È¤¹¤ë¤È¡¢¥ª¥Ö¥¸¥§¥¯¥È¤Ï@code{(N+7)/8}¥Ð¥¤¥È¤òÀêÍ­¤·¡¢£±¡¢£²¡¢£³¡¢£´Ëô¤Ï£¸¥Ð¥¤¥È¤ËÀھ夲¤é¤ì¤Þ¤¹¡£
-£±¤Ä¤Î@code{SET}¤Ï¡¢ºÇÂ磶£´Í×ÁǤò»ý¤Ä¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@node Numeric types, Date and time types, Storage requirements, Column types
-@subsection ¿ôÃÍ·¿
-
-@strong{MySQL} ¤Ï ANSI/ISO SQL92 ¿ôÃÍ·¿¤ò¤¹¤Ù¤Æ¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£¤³¤ì¤é¤Î·¿
-¤ÏÀµ³Î¤Ê¿ôÃͥǡ¼¥¿·¿(@code{NUMERIC}, @code{DECIMAL}, @code{INTEGER},
-@code{SMALLINT})¡¢¶á»÷¿ôÃÍ·¿(@code{FLOAT}, @code{REAL}, @code{DOUBLE
-PRECISION})¤ò´Þ¤ß¤Þ¤¹¡£¥­¡¼¥ï¡¼¥É @code{INT} ¤Ï @code{INTEGER} ¤ÎƱµÁ¸ì¤Ç¡¢
-@code{DEC}¤Ï @code{DECIMAL} ¤ÎƱµÁ¸ì¤Ç¤¹¡£
-
-@strong{MySQL} ¤Ç¤Ï @code{NUMERIC} ¤È @code{DECIMAL} ·¿¤Ï¡¢SQL92 ɸ½à¤Çµö
-¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤ËƱ¤¸·¿¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¤³¤ì¤é¤ÏÀµ³Î¤ÊÀºÅÙ¤ò°Ý»ý¤¹¤ë
-¤³¤È¤¬½ÅÍפÊÃÍ(Î㤨¤Ð¶âÁ¬¥Ç¡¼¥¿)¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£¤³¤ì¤é¤Î·¿¤Î°ì¤Ä¤Î¥Õ¥£¡¼¥ë
-¥É¤òÀë¸À¤¹¤ë»þ¡¢ÀºÅÙ¤ÈÂ礭¤µ¤¬»ØÄê¤Ç¤­¤Þ¤¹(Ä̾ï¤Ï¤½¤¦¤·¤Þ¤¹); Î㤨¤Ð:
-
-@example
- salary DECIMAL(9,2)
-@end example
-
-¤³¤ÎÎã¤Ç¤Ï¡¢@code{9} (@code{precisoin}) ¤ÏÃͤò³ÊǼ¤¹¤ë½ÅÍפʿôÃͤηå¿ô¤òɽ
-¤·¤Þ¤¹¡£¤½¤·¤Æ @code{2} (@code{scale}) ¤Ï¾®¿ôÅÀ¤Ë³¤¤¤Æ³ÊǼ¤µ¤ì¤ë·å¿ô¤òɽ
-¤·¤Þ¤¹¡£½¾¤Ã¤Æ¡¢¤³¤Î¾ì¹ç @code{salary} ¥Õ¥£¡¼¥ë¥É¤Ë³ÊǼ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ëÃÍ
-¤ÎÈϰϤϡ¢@code{-9999999.99} ¤«¤é @code{9999999.99} ¤Ç¤¹¡£ANSI/ISO SQL92
-¤Ç¤Ï¡¢¹½Ê¸ @code{DECIMAL(p)} ¤Ï @code{DECIMAL(p,0)} ¤ÈÅù¤·¤¤¤Ç¤¹¡£Æ±Íͤˡ¢
-¹½Ê¸ @code{DECIMAL} ¤Ï @code{DECIMAL(p,0)} ¤ÈÅù¤·¤¤¤Ç¤¹¡£¤³¤³¤Ç @code{p}
-¤ÎÃͤηèÄê¤Ï¼ÂÁõ¤Ëµö¤µ¤ì¤Æ¤Þ¤¹¡£@code{DECIMAL}/@code{NUMERIC} ¥Ç¡¼¥¿·¿¤Î¤³
-¤ì¤é¤Î°Û¤Ê¤ë·Á¼°¤Ï¡¢@strong{MySQL} ¤Ï¸½ºß¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤»¤ó¡£¤³¤Î·¿¤Î¼ç
-¤ÊÍø±×¤ÏÀºÅÙ¤ÈÂ礭¤µ¤ÎξÊý¤òÌÀ¼¨Åª¤ËÀ©¸æ¤¹¤ëµ¡Ç½¤«¤é°ú¤­½Ð¤µ¤ì¤ë¤Î¤Ç¡¢¤³¤ì
-¤ÏÄ̾¹ï¤ÊÌäÂê¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-
-@code{DECIMAL} ¤È @code{NUMERIC} Ãͤϡ¢Ãͤξ®¿ô¤ÎÀºÅÙ¤ò°Ý»ý¤¹¤ë¤¿¤á¡¢¥Ð¥¤
-¥Ê¥êÉâÆ°¾®¿ôÅÀ¿ô¤È¤·¤Æ¤Ç¤Ï¤Ê¤¯¡¢Ê¸»úÎó¤È¤·¤Æ³ÊǼ¤µ¤ì¤Þ¤¹¡£1ʸ»ú¤ÏÃͤΤ½¤ì
-¤¾¤ì¤Î·å(@code{scale} > 0 ¤Î¾ì¹ç)¤È @samp{-} µ­¹æ(Éé¿ô¤Î¾ì¹ç)¤Ë»ÈÍѤµ¤ì¤Þ
-¤¹¡£@code{scale} ¤¬ 0 ¤Î¾ì¹ç¡¢@code{DECIMAL} ¤È @code{NUMERIC} ÃͤϾ®¿ôÅÀ
-¤È¾®¿ôÉô¤ò´Þ¤ß¤Þ¤»¤ó¡£
-
-@code{DECIMAL} ¤È @code{NUMERIC} ÃͤκÇÂçÈÏ°Ï¤Ï @code{DOUBLE} ¤ÈƱ¤¸¤Ç¤¹¡£
-¤·¤«¤· @code{DECIMAL} ¤ä @code{NUMERIC} ¥Õ¥£¡¼¥ë¥É¤ËÍ¿¤¨¤é¤ì¤ë¼ÂºÝ¤ÎÈϰϤÏ
-¥Õ¥£¡¼¥ë¥É¤ËÍ¿¤¨¤é¤ì¤¿ @code{precision} ¤È @code{scale} ¤Ë¤è¤Ã¤Æ¶¯À©¤µ¤ì¤Þ
-¤¹¡£¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë¡¢»ØÄꤵ¤ì¤¿ @code{scale} ¤Çµö¤µ¤ì¤ë¤è¤ê¤â¿¤¤·å¤Î¾®¿ô
-Éô¤ò»ý¤Ä¿ôÃͤ¬³ä¤êÅö¤Æ¤é¤ì¤¿¾ì¹ç¡¢ÃͤϤ½¤Î @code{scale} ¤Ë´Ý¤á¤é¤ì¤Þ¤¹¡£
-@code{DECIMAL} ¤ä @code{NUMERIC} ¥Õ¥£¡¼¥ë¥É¤Ë¡¢»ØÄꤵ¤ì¤¿(¤Þ¤¿¤Ï¥Ç¥Õ¥©¥ë¥È
-¤Î) @code{precision} ¤È @code{scale} ¤Ç¼¨¤µ¤ì¤¿ÈϰϤòĶ¤¨¤¿Â礭¤µ¤ÎÃͤò³ä
-¤êÅö¤Æ¤¿»þ¡¢@strong{MySQL} ¤Ï¤½¤ÎÈϰϤÎÂбþ¤¹¤ëºÇÂçÃͤòɽ¤¹Ãͤò³ÊǼ¤·¤Þ¤¹¡£
-
-ANSI/ISO SQL92 ɸ½à¤ËÂФ¹¤ë³ÈÄ¥¤È¤·¤Æ¡¢¾å¤Îɽ¤Ë¥ê¥¹¥È¤·¤¿¤è¤¦¤Ë¡¢
-@strong{MySQL} ¤ÏÀ°¿ô·¿ @code{TINYINT}, @code{MEDIUMINT}, @code{BIGINT} ¤â
-¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£@strong{MySQL} ¤Ë¤è¤Ã¤Æ¥µ¥Ý¡¼¥È¤µ¤ì¤ë¾¤Î³ÈÄ¥¤È¤·¤Æ¡¢¥ª¥×
-¥·¥ç¥ó¤Ç¡¢·¿¤Î´ðËÜ¥­¡¼¥ï¡¼¥É¤Ë³¤±¤Æ³ç¸ÌÆâ¤Ë»ØÄꤹ¤ëÀ°¿ôÃͤÎɽ¼¨Éý(Î㤨¤Ð
-@code{INT(4)})¤¬¤¢¤ê¤Þ¤¹¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤ÎÉý»ØÄê¤Ï¡¢¥Õ¥£¡¼¥ë¥É¤Ë»ØÄꤵ¤ì¤¿
-Éý¤è¤ê¤â¾¯¤Ê¤¤Éý¤ÎÃͤÎɽ¼¨¤Îº¸Â¦¤òËä¤á¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£¤·¤«¤·¥Õ¥£¡¼¥ë
-¥É¤Ë³ÊǼ¤¹¤ë¤³¤È¤¬¤Ç¤­¤ëÃͤÎÈϰϤ䡢¥Õ¥£¡¼¥ë¥É¤Ë»ØÄꤵ¤ì¤¿Éý¤òĶ¤¨¤ëÉý¤ÎÃÍ
-¤Ë¤Ä¤¤¤Æɽ¼¨¤µ¤ì¤ë·å¿ô¤ÏÀ©Ì󤵤ì¤Þ¤»¤ó¡£¥ª¥×¥·¥ç¥ó¤Î³Èĥ°À­
-@code{ZEROFILL} ¤ò»ØÄꤷ¤Æ»ÈÍѤµ¤ì¤¿¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥È¤ÎËä¤á¤é¤ì¤ë¶õÇò¤Ï 0
-¤ÇÃÖ¤­´¹¤¨¤é¤ì¤Þ¤¹¡£Î㤨¤Ð¡¢@code{INT(5) ZEROFILL} ¤È¤·¤ÆÀë¸À¤µ¤ì¤¿¥Õ¥£¡¼
-¥ë¥É¤Ç¤Ï¡¢ÃÍ @code{4} ¤Ï @code{0004} ¤È¤·¤Æ¼è¤ê½Ð¤µ¤ì¤Þ¤¹¡£Ãí°Õ: À°¿ô¥Õ¥£¡¼
-¥ë¥ÉÆâ¤Ëɽ¼¨Éý¤è¤ê¤âÂ礭¤¤Ãͤò³ÊǼ¤¹¤ë¾ì¹ç¡¢@strong{MySQL} ¤¬Ê£»¨¤Ê join
-¤Î¤¿¤á¤Ë°ì»þ¥Æ¡¼¥Ö¥ë¤òÀ¸À®¤¹¤ë»þ¤Ë¡¢ÌäÂê¤òÂ賤¹¤ë¤Ç¤·¤ç¤¦¡£¤³¤Î¾ì¹ç
-@strong{MySQL} ¤Ï¥Ç¡¼¥¿¤¬¥ª¥ê¥¸¥Ê¥ë¤Î¥Õ¥£¡¼¥ë¥ÉÉý¤Ë¹ç¤Ã¤Æ¤¤¤ë¤³¤È¤ò¿®ÍѤ¹
-¤ë¤¿¤á¤Ç¤¹¡£
-
-¤¹¤Ù¤Æ¤ÎÀ°¿ô·¿¤Ï¥ª¥×¥·¥ç¥ó¤Î(Èóɸ½à)°À­ @code{UNSIGNED} ¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­
-¤Þ¤¹¡£Éä¹ç̵¤·¤ÎÃͤϥե£¡¼¥ë¥ÉÆâ¤ËÀµ¤Î¿ô¤À¤±¤òµö²Ä¤·¤¿¤¯¤Æ¡¢¥Õ¥£¡¼¥ë¥É¤ËÂÐ
-¤·¤Æ¾¯¤·Â礭¤¤¿ôÃͤÎÈϰϤ¬É¬Íפʻþ¤Ë»ÈÍѤǤ­¤Þ¤¹¡£
-
-@code{FLOAT} ·¿¤Ï¶á»÷¿ô¥Ç¡¼¥¿·¿¤òɽ¤¹¤¿¤á¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£ANSI/ISO SQL92 ɸ
-½à¤Ï¡¢@code{FLOAT} ¥­¡¼¥ï¡¼¥É¤Ë³¤¯³ç¸ÌÃæ¤Ë¥ª¥×¥·¥ç¥ó¤ÎÀºÅÙ(»Ø¿ô¤ÎÈϰϤǤÏ
-¤Ê¤¤)¤Î»ØÄê¤òµö¤·¤Æ¤¤¤Þ¤¹¡£@strong{MySQL} ¼ÂÁõ¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤ÎÀºÅÙ»ØÄê¤â
-¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤¹¡£¥­¡¼¥ï¡¼¥É @code{FLOAT} ¤¬ÀºÅ٤λØÄê̵¤·¤Ç¥Õ¥£¡¼¥ë¥É·¿
-¤È¤·¤Æ»ÈÍѤµ¤ì¤¿»þ¤Ï¡¢@strong{MySQL} ¤ÏÃͤò³ÊǼ¤¹¤ë¤¿¤á¤Ë4¥Ð¥¤¥È¤ò»ÈÍѤ·¤Þ
-¤¹¡£@code{FLOAT} ¥­¡¼¥ï¡¼¥É¤Ë³¤¯³ç¸ÌÃæ¤Ë2¤Ä¤Î¿ôÃͤòÍ¿¤¨¤ë¹½Ê¸¤â¥µ¥Ý¡¼¥È¤µ
-¤ì¤Þ¤¹¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç¤Î¡¢ºÇ½é¤Î¿ôÃͤÏÃͤËɬÍפÊÍÆÎ̤ò¥Ð¥¤¥È¤Çɽ¤·¤Þ¤¹¡£
-2ÈÖÌܤοôÃͤϡ¢³ÊǼ¡¢É½¼¨¤µ¤ì¤ë¾®¿ôÉô¤Î·å¿ô¤ò»ØÄꤷ¤Þ¤¹(@code{DECIMAL} ¤È
-@code{NUMERIC} ¤ÈƱÍÍ)¡£@strong{MySQL} ¤¬¥Õ¥£¡¼¥ë¥É¤Ë»ØÄꤵ¤ì¤¿¤è¤ê¤âÂ礭
-¤¤¾®¿ôÉô¤Î·å¿ô¤ò»ý¤Ä¿ôÃͤò¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë³ÊǼ¤¹¤ë»þ¡¢ÃͤγÊǼ»þ¤Ë;·×¤Ê·å
-¤ò¼è¤ê½ü¤¯¤è¤¦¤ËÃͤ¬´Ý¤á¤é¤ì¤Þ¤¹¡£
-
-@code{REAL} ¤È @code{DOUBLE PRECISION} ·¿¤ÏÀºÅÙ»ØÄê¤òµö¤·¤Þ¤»¤ó¡£
-ANSI/ISO SQL92 ɸ½à¤ËÂФ¹¤ë³ÈÄ¥¤È¤·¤Æ¡¢@strong{MySQL} ¤Ï @code{DOUBLE} ¤ò
-@code{DOUBLE PRECISION} ·¿¤ÎƱµÁ¸ì¤È¤·¤Æǧ¼±¤·¤Þ¤¹¡£@code{REAL} ¤ÎÀºÅÙ¤Ï
-@code{DOUBLE PRECISION} ¤Î»ØÄê¤è¤ê¤â¾®¤µ¤¤¤³¤È¤òÍ׵᤹¤ëɸ½à¤È°Û¤Ê¤ê¡¢
-@strong{MySQL} ¤Ï¤É¤Á¤é¤â8¥Ð¥¤¥È¤ÎÇÜÀºÅÙ¾®¿ôÅÀ¤ÎÃͤȤ·¤Æ¼ÂÁõ¤·¤Æ¤¤¤Þ¤¹
-("ANSI ¥â¡¼¥É"¤Ç¼Â¹Ô¤·¤Æ¤¤¤Ê¤¤¾ì¹ç)¡£°Ü¿¢À­¤òºÇÂç¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¶á»÷¿ôÃÍ
-¥Ç¡¼¥¿ÃͤγÊǼ¤òÍ׵᤹¤ë¥³¡¼¥É¤Ï¡¢ÀºÅ٤侮¿ôÉô·å¿ô¤Î»ØÄê̵¤·¤Î
-@code{FLOAT} ¤« @code{DOUBLE PRECISION} ¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£
-
-¥Õ¥£¡¼¥ë¥É¤Î·¿¤ÎÃͤεöÍÆÈϰϤòĶ¤¨¤¿¿ôÃͤòÂåÆþ¤·¤è¤¦¤È¤¹¤ë¤È¡¢@strong{MySQL} ¤Ï
-¤½¤ÎÃͤòµöÍÆÈϰϤ¤¤Ã¤Ñ¤¤¤ËÀÚ¤êµÍ¤á¡¢¤½¤Î·ë²Ì¤òÂå¤ï¤ê¤ËÂåÆþ¤·¤Þ¤¹¡£
-
-Î㤨¤Ð¡¢ @code{INT} ¥Õ¥£¡¼¥ë¥É¤ÎÈÏ°Ï¤Ï @code{-2147483648} ¤«¤é @code{2147483647} ¤Ç¤¹¡£
-¤â¤· @code{-9999999999} ¤ò @code{INT} ¥Õ¥£¡¼¥ë¥É¤ËÁÞÆþ¤·¤è¤¦¤È¤¹¤ë¤È¡¢ÃͤÏÈϰϤκÇÄãÃͤË
-½¤Àµ¤µ¤ì¡¢ @code{-2147483648} ¤¬Âå¤ï¤ê¤ËÂåÆþ¤µ¤ì¤Þ¤¹¡£Æ±Íͤˡ¢@code{9999999999} ¤Î¾ì¹ç¡¢
- @code{2147483647} ¤¬Âå¤ï¤ê¤ËÂåÆþ¤µ¤ì¤Þ¤¹¡£
-
-¤½¤·¤Æ¡¢@code{INT} ¥Õ¥£¡¼¥ë¥É¤¬Éä¹æ̵¤·¤Î¾ì¹ç¡¢¥Õ¥£¡¼¥ë¥É¤ÎÈϰϤÎÂ礭¤µ¤Ï
-Ʊ¤¸¤Ç¤¹¤¬¡¢¸Â³¦ÃÍ¤Ï @code{0} ¤È@code{4294967296} ¤Ë¤Ê¤ê¤Þ¤¹¡£
-¤â¤· @code{-9999999999} ¤È @code{9999999999} ¤òÂåÆþ¤·¤è¤¦¤È¤¹¤ë¤È¡¢
-ÃÍ¤Ï @code{0} ¤È @code{4294967296} ¤È¤·¤ÆÂåÆþ¤µ¤ì¤Þ¤¹¡£
-
-@code{ALTER TABLE}, @code{LOAD DATA INFILE}, @code{UPDATE} ¤Þ¤¿¤Ï
- multi-row @code{INSERT} »þ¡¢¤³¤ì¤é¤ÎÊÑ´¹¤Ï `·Ù¹ð' ¤È¤·¤ÆÆÀ¤é¤ì¤Þ¤¹¡£
-
-
-@cindex Types, Date and Time
-@cindex Date and Time types
-@node Date and time types, String types, Numeric types, Column types
-@subsection ÆüÉդȻþ´Ö¤Î·¿
-
-@menu
-* Y2K issues:: Y2K issues and date types
-* DATETIME:: The @code{DATETIME}, @code{DATE} and @code{TIMESTAMP} types
-* TIME:: The @code{TIME} type
-* YEAR:: The @code{YEAR} type
-@end menu
-
-ÆüÉդȻþ´Ö¤Î·¿¤Ï @code{DATETIME}, @code{DATE}, @code{TIMESTAMP},
-@code{TIME}, @code{YEAR} ¤Ç¤¹. ¤³¤ì¤é¤Ï¤½¤ì¤¾¤ìÃͤËŬÀµ¤ÊÈϰϤ¬¤¢¤ê¡¢
-``zero'' ¤Ï¤¢¤Ê¤¿¤¬´Ö°ã¤Ã¤¿Ãͤò»ØÄꤷ¤¿¾ì¹ç¤ËÍѤ¤¤é¤ì¤Þ¤¹¡£Ãí°Õ: @strong{MySQL} ¤Ï
-³Î¼Â¤Ë '¸·Ì©¤Ç¤Ê¤¤' Àµ¤·¤¤ÆüÉÕ¤ÎÃÍ¡¢Î㤨¤Ð @code{1999-11-31} ¤ò³ÊǼ¤¹¤ë¤³
-¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤ÎÍýͳ¤Ï¡¢ÆüÉÕ¤ò¥Á¥§¥Ã¥¯¤¹¤ë½èÍý¤ÎÀÕǤ¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë
-¤¢¤ê¡¢SQL ¥µ¡¼¥Ð¤Ë¤Ï¤Ê¤¤¤È¹Í¤¨¤Æ¤¤¤ë¤«¤é¤Ç¤¹¡£ÆüÉÕ¤ò'®¤¯'¥Á¥§¥Ã¥¯¤¹¤ë¤¿¤á
-¤Ë¡¢@strong{MySQL} ¤Ï·î¤¬ 0¡Á12 ¤ÎÈϰϤǤ¢¤ë¤«¤ÈÆü¤¬ 0¡Á31 ¤ÎÈϰϤǤ¢¤ë¤«
-¤À¤±¤ò¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£¾å½Ò¤ÎÈϰϤϡ¢@strong{MySQL} ¤¬ @code{DATE} ¤Þ¤¿¤Ï
-@code{DATETIME} ¥Õ¥£¡¼¥ë¥É¤Ë¡¢Æü¤Þ¤¿¤Ï·îÆü¤¬ 0 ¤Ç¤¢¤ëÆüÉÕ¤ò³ÊǼ¤Ç¤­¤ë¤¿¤á
-¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¤³¤ì¤Ï¡¢Àµ³Î¤ÊÆüÉÕ¤òÃΤé¤Ê¤¤ÃÂÀ¸Æü¤òÅÐÏ¿¤¹¤ëɬÍפ¬¤¢¤ë
-¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ËÈó¾ï¤ËÍ­ÍѤǤ¹¡£¤³¤Î¾ì¹ç¡¢@code{1999-00-00} ¤ä
-@code{1999-01-00} ¤Î¤è¤¦¤ÊÆüÉÕ¤òñ½ã¤ËÅÐÏ¿¤Ç¤­¤Þ¤¹(¤â¤Á¤í¤ó¡¢¤³¤Î¤è¤¦¤ÊÆü
-ÉÕ¤ò @code{DATE_SUB()} ¤ä @code{DATE_ADD} ¤Î¤è¤¦¤Ê´Ø¿ô¤Ç»ÈÍѤ·¤Æ¡¢Àµ¤·¤¤ÃÍ
-¤¬Ê֤뤳¤È¤Ï´üÂԤǤ­¤Þ¤»¤ó)¡£
-
-¤³¤ì¤Ï¡¢ÆüÉդȻþ´Ö·¿¤Çºî¶È¤¹¤ë¾ì¹ç¤Ë¡¢°ìÈÌŪ¤Ë¹Íθ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤Ç¤¹:
-
-@itemize @bullet
-@item
-@strong{MySQL}¤Ï¡¢É¸½à·Á¼°¤ÇÍ¿¤¨¤é¤ì¤¿ÆüÉÕ¤ä»þ´Ö¤«¤éÃͤòÃê½Ð¤·¤Þ¤¹¤¬¡¢Í¿¤¨¤é¤ì¤¿Â¿ÍͤʷÁ¼°¤ÎÃÍ(Î㤨¤Ð¡¢»ØÄꤵ¤ì¤¿ÃͤòÆüÉÕ¤ä»þ´Ö·¿¤Ë³ä¤êÅö¤Æ¤¿¤ê¡¢Èæ³Ó¤·¤¿¤ê)¤ò²ò¼á¤·¤è¤¦¤È»î¤ß¤Þ¤¹¡£
-¤½¤ì¤Ç¤â¡¢¼¡Àá¤Ç½Ò¤Ù¤ë·Á¼°¤À¤±¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Þ¤¹¡£
-¤½¤ì¤Ï¡¢ÀµÅö¤ÊÃͤ¬Í¿¤¨¤é¤ì¤ë¤³¤È¤ò´üÂÔ¤·¡¢Â¾¤Î·Á¼°¤ÎÃͤò»ÈÍѤµ¤ì¤ë¤è¤¦¤Ê»öÂÖ¤¬µ¯¤³¤ë¤È¡¢¤É¤Î¤è¤¦¤Ê·ë²Ì¤È¤Ê¤ë¤«Í½ÁۤǤ­¤Þ¤»¤ó¡£
-
-@item
-@strong{MySQL} ¤Ï¤¤¤¯¤Ä¤«¤Î·Á¼°¤ËÃͤòÊѤ¨¤Æ¤¯¤ì¤Þ¤¹¤¬¡¢
-¾ï¤Ëǯ¤ÎÉôʬ¤ÈÆü¤Ë¤Á¤ÎÉôʬ¤Ïº¸¤«¤éÍ¿¤¨¤é¤ì¤Æ¤¤¤ë¤È´üÂÔ¤·¤Æ¤¤¤Þ¤¹¡£
-ÆüÉÕ¤Ï Ç¯-·î-Æü ¤Î½ç(Î㤨¤Ð¡¢@code{'98-09-04'})¤Ç¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-·î-Æü-ǯ ¤ä Æü-·î-ǯ ¤ÎÍͤʤɤ³¤Ç¤â»È¤ï¤ì¤Æ¤¤¤ë¤è¤¦¤Ê·Á¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-(Î㤨¤Ð¡¢@code{'09-04-98'}¤ä@code{'04-09-98'}).
-
-@item
-@strong{MySQL} ¤Ï¡¢¤â¤·¿ôÃͤÎʸ̮¤ÇÆüÉդȻþ´Ö¤Î·¿¤¬»ÈÍѤµ¤ì¤ë¤È¡¢
-¼«Æ°Åª¤ËÆüÉդȻþ´Ö¤ò¿ôÃͤËľ¤·¤Þ¤¹¡£µÕ¤â¹Ô¤¤¤Þ¤¹¡£
-
-@item
-@strong{MySQL} ¤¬Èϰϳ°¤Î¸í¤Ã¤¿ÃͤòÆüÉդȻþ´Ö·¿¤È¤·¤Æ¼õ¤±¼è¤Ã¤¿¾ì¹ç
-(¤³¤Î¥»¥¯¥·¥ç¥ó¤ÎºÇ½é¤ò¤ß¤Æ¤¯¤À¤µ¤¤)¡¢¤½¤ÎÃÍ¤Ï ``¥¼¥í'' ¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£
-(Îã³°¤Ï¡¢Èϰϳ°¤Î@code{TIME}Ãͤ¬Å¬ÀÚ¤Ê@code{TIME}¤ÎÈϰϤ賦ÃͤËÀÚ¤êµÍ¤á¤é¤ì¤ë¤³¤È¤Ç¤¹¡£)
-°Ê²¼¤Ë¡¢¤½¤ì¤¾¤ì¤Î·¿¤Î `¥¼¥í' ¤Î·Á¼°¤ò¼¨¤·¤Þ¤¹¡§
-
-@multitable @columnfractions .3 .7
-@item @strong{¥Õ¥£¡¼¥ë¥É¥¿¥¤¥×} @tab @strong{`¥¼¥í'ÃÍ}
-@item @code{DATETIME} @tab @code{'0000-00-00 00:00:00'}
-@item @code{DATE} @tab @code{'0000-00-00'}
-@item @code{TIMESTAMP} @tab @code{00000000000000} (length depends on display size)
-@item @code{TIME} @tab @code{'00:00:00'}
-@item @code{YEAR} @tab @code{0000}
-@end multitable
-
-@item
-`¥¼¥í'ÃͤÏÆÃÊ̤Ǥ¹¤¬¡¢É½¤Ë¼¨¤µ¤ì¤¿ÃͤòÌÀ¼¨Åª¤Ë»ÈÍѤ·¤Æ¡¢³ÊǼ¤·¤¿¤ê»²¾È¤·¤¿¤ê¤Ç¤­¤Þ¤¹¡£
-¤³¤ÎÃͤϡ¢ @code{'0'} Ëô¤Ï @code{0} ¤ò»ÈÍѤ¹¤ë¤³¤È¤Ë¤è¤ê¡¢¤è¤ê´Ê·é¤Ë½ñ¤¯¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
-
-@item
-@strong{MyODBC} Æâ¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë `¥¼¥í' ¤ÎÆüÉդȻþ´Ö¤Ï¡¢
-@strong{MyODBC} 2.50.12 °Ê¾å¤Ç¤Ï¼«Æ°Åª¤Ë @code{NULL} ¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£
-¤³¤ì¤Ï ODBC ¤¬¤³¤ì¤é¤ÎÃͤò°·¤¨¤Ê¤¤¤«¤é¤Ç¤¹¡£
-@end itemize
-
-@cindex Year 2000 issues
-@node Y2K issues, DATETIME, Date and time types, Date and time types
-@subsubsection À¾Îñ£²£°£°£°Ç¯ÌäÂê¤È¥Ç¡¼¥¿·¿
-
-@strong{MySQL} ¼«ÂΤÏ2000ǯÌäÂê¤ËÂФ·¤Æ°ÂÁ´¤Ç¤¹(@pxref{Year 2000 compliance})¤¬¡¢
- @strong{MySQL} ¤ËÄ󼨤µ¤ì¤ëÆþÎÏÃͤ˴ؤ·¤Æ¤Ï¤½¤¦¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£2·å¤Î
-ǯ¤ÎÆþÎϤϲ¿À¤µª¤Ê¤Î¤«¤ï¤«¤é¤Ê¤¤¤Î¤ÇÁ´¤ÆÛ£Ëæ¤Ç¤¹¡£¤³¤Î¤è¤¦¤ÊÃÍ¤Ï @strong{MySQL}
-¤¬ÆâÉô¤Çǯ¤Ë4·å¤ò»È¤Ã¤Æ¤¤¤ë¤³¤È¤«¤é4·å¤Î·Á¼°¤ËÊÑ´¹¤µ¤ì¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
-
- @strong{MySQL} ¤ÏÛ£Ëæ¤ÊÆüÉÕ¤ò @code{DATETIME}, @code{DATE}, @code{TIMESTAMP}
-¤ª¤è¤Ó @code{YEAR} ·¿¤Ë´Ø¤·¤Æ¡¢°Ê²¼¤Î
-¥ë¡¼¥ë¤Ë½¾¤Ã¤Æ²ò¼á¤·¤Þ¤¹¡£
-
-@itemize @bullet
-@item
-@code{00-69} ¤ÎÈϰϤÎǯ¤Ï @code{2000-2069} ¤ËÊÑ´¹¡£
-
-@item
-@code{70-99} ¤ÎÈϰϤÎǯ¤Ï @code{1970-1999} ¤ËÊÑ´¹¡£
-@end itemize
-
-¤³¤ì¤é¤Î¥ë¡¼¥ë¤Ï¥Ç¡¼¥¿¤¬²¿¤ò°ÕÌ£¤·¤Æ¤¤¤ë¤«¤ËÂФ·¤ÆÂÅÅö¤Ê¿äÄê¤òÍ¿¤¨¤ë¤Ë
-²á¤®¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£¤³¤Î @strong{MySQL} ȯ¸«Åª¼êË¡¤¬Àµ¤·¤¤ÃͤòÀ¸À®¤·
-¤Ê¤¤¾ì¹ç¤ÏÛ£Ëæ¤Ç¤Ê¤¤4·å¤Îǯ¤ò´Þ¤àÆþÎϤòÍ¿¤¨¤ë¤Ù¤­¤Ç¤¹¡£
-
-@code{ORDER BY} ¤Ï2·å¤Î @code{YEAR/DATE/DATETIME} ·¿¤òÀµ¤·¤¯¥½¡¼¥È¤µ¤ì¤Þ¤¹¡£
-
-Ãí°Õ: @code{MIN()} ¤È @code{MAX()} ¤Î¤è¤¦¤Ê¤¤¤¯¤Ä¤«¤Î´Ø¿ô¤Ï @code{TIMESTAMP/DATE} ¤ò¿ôÃÍ
-¤ËÊÑ´¹¤·¤Þ¤¹¡£¤³¤ì¤Ïǯ¤¬2·å¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤Ï¤³¤ì¤é¤Î´Ø¿ô¤ÇÀµ¤·¤¯Æ°ºî¤·¤Ê
-¤¤¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£¤³¤Î¾ì¹ç¤Î½¤Éü¤Ï¡¢@code{TIMESTAMP/DATE} ¤ò4·å¤Îǯ¤Î·Á
-¼°¤ËÊÑ´¹¤¹¤ë¤«¡¢@code{MIN(DATE_ADD(timestamp,INTERVAL 0 DAYS))} ¤Î¤è¤¦¤Ê²¿
-¤«¤ò»ÈÍѤ¹¤ë¤³¤È¤Ç¤¹¡£
-
-@tindex DATETIME
-@tindex DATE
-@tindex TIMESTAMP
-@node DATETIME, TIME, Y2K issues, Date and time types
-@subsubsection @code{DATETIME}, @code{DATE}, @code{TIMESTAMP} ·¿
-
-@code{DATETIME}, @code{DATE}, @code{TIMESTAMP}·¿¤Ï¤ª¸ß¤¤¤Ë´ØÏ¢¤·¤Æ¤¤¤Þ¤¹¡£¤³¤Î¥»¥¯¥·¥ç¥ó¤Ç
-¤Ï¤½¤ì¤é¤ÎÆÃħ¤È¡¢¤½¤ì¤¾¤ì¤¬¤É¤¦Æ±¤¸¤Ç¤É¤¦°ã¤¦¤«¤ò¼¨¤·¤Þ¤¹¡£
-
-@code{DATETIME} ·¿¤ÏÆüÉդȻþ¹ï¤Î¾ðÊó¤ò´Þ¤àÃͤ¬É¬Íפʾì¹ç¤Ë»È¤¤¤Þ¤¹¡£@strong{MySQL} ¤Ï
- @code{DATETIME} Ãͤò @code{'YYYY-MM-DD HH:MM:SS'} ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¼è¤ê½Ð¤·¡¢É½¼¨¤·¤Þ¤¹¡£
-¥µ¥Ý¡¼¥È¤µ¤ì¤ëÈÏ°Ï¤Ï @code{'1000-01-01 00:00:00'} ¤«¤é @code{'9999-12-31 23:59:59'} ¤Ç¤¹¡£
-(¡Ö¥µ¥Ý¡¼¥È¤µ¤ì¤ë¡×¤È¤Ï¤µ¤é¤Ë²áµî¤ÎÃͤǤâÆ°¤¯¤«¤âÃΤì¤Þ¤»¤ó¤¬Êݾڤθ¤ê¤Ç¤Ï¤Ê¤¤¤È¤¤¤¦°ÕÌ£¤Ç¤¹)
-
-@code{DATE} ·¿¤Ï»þ¹ï¤ÎÉôʬ¤Ê¤·¤ÇÆüÉÕ¤ÎÃͤΤߤ¬É¬Íפʾì¹ç¤Ë»È¤¤¤Þ¤¹¡£@strong{MySQL} ¤Ï
- @code{DATE} Ãͤò@code{'YYYY-MM-DD'} ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¼è¤ê½Ð¤·¡¢É½¼¨¤·¤Þ¤¹¡£¥µ¥Ý¡¼¥È¤µ¤ì
-¤ëÈÏ°Ï¤Ï @code{'1000-01-01'} ¤«¤é @code{'9999-12-31'} ¤Ç¤¹¡£
-
-@code{TIMESTAMP} ¥¿¥¤¥×¤Ï @code{INSERT} ¤ä @code{UPDATE} Áàºî¤Ë¼«Æ°Åª¤Ë
-¸½ºß¤ÎÆüÉդȻþ¹ï¤ò¥Þ¡¼¥¯¤¹¤ë¾ì¹ç¤ËÄ󶡤µ¤ì¤ë·¿¤Ç¤¹¡£
-¤â¤·Ê£¿ô¤Î @code{TIMESTAMP} ¥Õ¥£¡¼¥ë¥É¤¬¤¢¤ë¾ì¹ç¤Ë¤ÏºÇ½é
-¤Î°ì¤Ä¤À¤±¤¬¼«Æ°Åª¤Ë¹¹¿·¤µ¤ì¤Þ¤¹¡£
-
-ºÇ½é¤Î @code{TIMESTAMP} ¥Õ¥£¡¼¥ë¥É¤Î¼«Æ°¹¹¿·¤Ï°Ê²¼¤Î¤¤¤º¤ì¤«¤Î¾ò·ï¤Çµ¯¤³¤ê¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-¤½¤Î¥Õ¥£¡¼¥ë¥É¤¬ÌÀ¼¨Åª¤Ë @code{INSERT} ¤Þ¤¿¤Ï @code{LOAD DATA INFILE} ʸ¤Ç»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤È¤­¡£
-@item
-¤½¤Î¥Õ¥£¡¼¥ë¥É¤¬ÌÀ¼¨Åª¤Ë @code{UPDATE} ʸ¤Ç»ØÄꤵ¤ì¤º¡¢¤«¤Ä¡¢Â¾¤Î¥Õ¥£¡¼¥ë¥É¤ÎÃͤ¬ÊѤï¤Ã¤¿¾ì¹ç¡£
-(¤â¤È¤â¤È¥Õ¥£¡¼¥ë¥É¤ËÆþ¤Ã¤Æ¤¤¤¿ÃͤÈƱ¤¸Ãͤ˹¹¿·¤·¤è¤¦¤È¤¹¤ë @code{UPDATE} ʸ¤Ï @code{TIMESTAMP}
-¥Õ¥£¡¼¥ë¥É¤ò¹¹¿·¤·¤Ê¤¤¤³¤È¤ËÃí°Õ¡£¤Ê¤¼¤Ê¤é¤¢¤ë¥Õ¥£¡¼¥ë¥É¤ò¸½ºß¤ÈƱ¤¸ÃͤËÊѤ¨¤è¤¦¤È¤·¤Æ¤â
-@strong{MySQL} ¤Ï¸úΨ¤Î¤¿¤á¤Ë¤½¤ì¤ò̵»ë¤¹¤ë¤«¤é¤Ç¤¹¡£)
-@item
-ÌÀ¼¨Åª¤Ë @code{TIMESTAMP} ¥Õ¥£¡¼¥ë¥É¤ò @code{NULL} ¤Ë¤·¤¿¾ì¹ç¡£
-@end itemize
-
-ºÇ½é°Ê³°¤Î @code{TIMESTAMP} ¥Õ¥£¡¼¥ë¥É¤â¸½ºß¤ÎÆüÉդȻþ¹ï¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤½¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤ò
-@code{NULL} ¤Þ¤¿¤Ï @code{NOW()} ¤Ë¤¹¤ë¤³¤È¤Ç¤¹¡£
-
-¤É¤Î @code{TIMESTAMP} ¥Õ¥£¡¼¥ë¥É¤âÌÀ¼¨Åª¤Ë˾¤àÃͤò¥»¥Ã¥È¤¹¤ë¤³¤È¤Ç¸½ºß¤ÎÆü»þ¤Ç¤Ê¤¤ÃͤË
-¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤½¤ì¤ÏºÇ½é¤Î @code{TIMESTAMP} ¥Õ¥£¡¼¥ë¥É¤Ë¤Ä¤¤¤Æ¤âƱ¤¸¤Ç¤¹¡£¤³¤ÎÆÃ
-À­¤ÏÎ㤨¤Ð @code{TIMESTAMP} ¥Õ¥£¡¼¥ë¥É¤ò¤¢¤ë¥ì¥³¡¼¥É¤¬À¸À®¤µ¤ì¤¿¤È¤­¤ÎÆü»þ¤Ë¤·¡¢¤½¤Î¸å¤½¤Î¹Ô
-¤¬¹¹¿·¤µ¤ì¤Æ¤âÊѲ½¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¤¤¤È¤¤¤¦¤è¤¦¤Ê¤È¤­¤Ë»È¤¨¤Þ¤¹¡£
-
-@itemize @bullet
-@item
-@strong{MySQL} ¤Ë¥ì¥³¡¼¥É¤¬À¸À®¤µ¤ì¤¿¤È¤­¤Ë¤½¤Î¥Õ¥£¡¼¥ë¥É¤ò¥»¥Ã¥È¤µ¤»¤ë¡£¤³¤ì¤Ç¸½ºßÆü»þ¤Ë½é
-´ü²½¤µ¤ì¤ë¡£
-
-@item
-°Ê¹ß¤Î¾¤Î¥Õ¥£¡¼¥ë¥É¤ËÂФ¹¤ë¹¹¿·»þ¤Ë @code{TIMESTAMP} ¥Õ¥£¡¼¥ë¥É¤ò¤½¤ì¼«ÂΤ¬º£»ý¤Ã¤Æ¤¤¤ëÃͤË
-ÌÀ¼¨Åª¤Ë¹¹¿·¤¹¤ë¡£
-@end itemize
-
-°ìÊý¡¢¤³¤Î¼êË¡¤Ï @code{DATATIME} ¥Õ¥£¡¼¥ë¥É¤ò¹ÔÀ¸À®»þ¤Ë @code{NOW()} ¤Ç½é´ü²½¤·¡¢°Ê¹ß¤Î¹¹¿·»þ¤Ë
-¤½¤ì¤ò¤Û¤¦¤Ã¤Æ¤ª¤¯¤Î¤ÈƱ¤¸¤è¤¦¤Ë´Êñ¤Ç¤¢¤ë¤È¤ï¤«¤ë¤Ç¤·¤ç¤¦¡£
-
-@code{TIMESTAMP} ¤ÎÃÍ¤Ï @code{1970} ǯ¤ÎºÇ½é¤«¤é @code{2037} ǯ¤Î¤É¤³¤«¤Î»þÅÀ¤Þ¤Ç¤ÎÈϰϤÇÍ­¸ú¤Ç¡¢
-1Éäλþ´Öʬ²òǽ¤ò»ý¤Á¤Þ¤¹¡£ÃͤϿôÃͤȤ·¤Æɽ¼¨¤µ¤ì¤Þ¤¹¡£
-
-@strong{MySQL} ¤¬ @code{TIMESTAMP} Ãͤò¼è¤ê½Ð¤·¤¿¤êɽ¼¨¤¹¤ë¤Î¤Ë»È¤¦¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï°Ê²¼¤Îɽ
-¤Ë¼¨¤¹¤è¤¦¤Ë¤½¤Îɽ¼¨¥µ¥¤¥º¤Ë°Í¸¤·¤Þ¤¹¡£¡ÖÌÜ°ìÇÕ¤Î¡× @code{TIMESTAMP} ¥Õ¥©¡¼¥Þ¥Ã
-¥È¤Ï14·å¤Ç¤¹¤¬¡¢ @code{TIMESTAMP} ¥Õ¥£¡¼¥ë¥É¤Ï¤è¤êû¤¤É½¼¨¥µ¥¤¥º¤ÇÀ¸À®¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡§
-
-@multitable @columnfractions .3 .7
-@item @strong{¥Õ¥£¡¼¥ë¥É·¿} @tab @strong{ɽ¼¨¥Õ¥©¡¼¥Þ¥Ã¥È}
-@item @code{TIMESTAMP(14)} @tab @code{YYYYMMDDHHMMSS}
-@item @code{TIMESTAMP(12)} @tab @code{YYMMDDHHMMSS}
-@item @code{TIMESTAMP(10)} @tab @code{YYMMDDHHMM}
-@item @code{TIMESTAMP(8)} @tab @code{YYYYMMDD}
-@item @code{TIMESTAMP(6)} @tab @code{YYMMDD}
-@item @code{TIMESTAMP(4)} @tab @code{YYMM}
-@item @code{TIMESTAMP(2)} @tab @code{YY}
-@end multitable
-
-Á´¤Æ¤Î @code{TIMESTAMP} ¥Õ¥£¡¼¥ë¥É¤Ïɽ¼¨¥µ¥¤¥º¤Ë´Ø·¸¤Ê¤¯Æ±¤¸³ÊǼ¥µ¥¤¥º¤ò»ý¤Á¤Þ¤¹¡£¤â¤Ã
-¤È¤â°ìÈÌŪ¤Êɽ¼¨¥µ¥¤¥º¤Ï 6 , 8 , 12 ¤ª¤è¤Ó 14 ¤Ç¤¹¡£É½¼¨¥µ¥¤¥º¤Ï¥Æ¡¼¥Ö¥ëÀ¸À®»þ
-¤ËǤ°Õ¤ÎÃͤ˻ØÄê¤Ç¤­¤Þ¤¹¤¬¡¢ 0 ¤ª¤è¤Ó 14 °Ê¾å¤ÎÃͤ϶¯À©Åª¤Ë 14 ¤Ë¤Ê¤ê¤Þ¤¹¡£1
-¤«¤é 13 ¤Þ¤Ç¤Î´ñ¿ô¤Î¥µ¥¤¥º¤Ï¶¯À©Åª¤Ë°ì¤ÄÂ礭¤¤¶ö¿ô¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-@code{DATETIME}, @code{DATE}, @code{TIMESTAMP} Ãͤϰʲ¼¤Î¶¦ÄÌ¥Õ¥©¡¼¥Þ¥Ã¥È¥»¥Ã¥È¤Î¤¤¤º¤ì¤«¤ò
-»È¤Ã¤Æ»ØÄê¤Ç¤­¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-ʸ»úÎó¤Ç @code{'YYYY-MM-DD HH:MM:SS'} ¤« @code{'YY-MM-DD HH:MM:SS'} ¤Î·Á¼°¡£
-"½ÀÆð¤Ê"½ñ¤­Êý¤òµö¤·¤Æ¤¤¤Þ¤¹ -- ÆüÉÕ¤ä»þ¹ï¤Î¶èÀÚ¤êʸ»ú¤È¤·¤Æ¡¢¤¤¤«¤Ê¤ë¶çÆɵ­¹æ
-¤â»ÈÍѤǤ­¤Þ¤¹¡£Î㤨¤Ð¡¢@code{'98-12-31 11:30:45'}, @code{'98.12.31 11+30+45'},
-@code{'98/12/31 11*30*45'}, @code{'98@@12@@31 11^30^45'} ¤ÏÅù²Á¤Ç¤¹¡£
-
-@item
-ʸ»úÎó¤Ç @code{'YYYY-MM-DD'} ¤« @code{'YY-MM-DD'} ¤Î·Á¼°¡£
-¤³¤ì¤â"½ÀÆð¤Ê"½ñ¤­Êý¤¬¤Ç¤­¤Þ¤¹¡£
-Î㤨¤Ð, @code{'98-12-31'},@code{'98.12.31'}, @code{'98/12/31'}, @code{'98@@12@@31'} ¤Ï
-Åù²Á¤Ç¤¹¡£
-
-@item
-ʸ»úÎó @code{'YYYYMMDDHHMMSS'} ¤Þ¤¿¤Ï @code{'YYMMDDHHMMSS'} ¥Õ¥©¡¼¥Þ¥Ã¥È¡£
-¡Ö´Ë¤ä¤«¤Ê¡×ʸˡ¤¬Ç§¤á¤é¤ì¤Æ¤¤¤Æ¡¢¶çÆɵ­¹æ¤ÏÆüÉÕ¡¢»þ¹ïÉôʬ¤Î¶èÀÚ¤ê
-¤È¤·¤Æ»È¤¨¤Þ¤¹¡£Î㤨¤Ð @code{'98-12-31 11:30:45'}, @code{'98.12.31 11+30+45'},
- @code{'98/12/31 11*:30*:45'}, @code{'98@@12@@31 11^30^45'} ¤ÏÁ´¤ÆÅù²Á¤Ç¤¹¡£
-
-@item
-ʸ»úÎó @code{'YYYY-MM-DD'} ¤Þ¤¿¤Ï @code{'YY-MM-DD'} ¥Õ¥©¡¼¥Þ¥Ã¥È¡£¤³¤ì¤â¡Ö´Ë¤ä¤«¤Ê¡×ʸˡ
-¤¬Ç§¤á¤é¤ì¤Æ¤¤¤Þ¤¹¡£Î㤨¤Ð @code{'98-12-31'}, @code{'98.12.31'}, @code{'98/12/31'}, @code{'98@@12@@31'}
-¤ÏÁ´¤ÆÅù²Á¤Ç¤¹¡£
-
-@item
-¶èÀÚ¤êʸ»ú¤Ê¤·¤Îʸ»úÎó @code{'YYYYMMDDHHMMSS'} ¤Þ¤¿¤Ï @code{'YYMMDDHHMMSS'} ¥Õ¥©¡¼¥Þ¥Ã
-¥È¤ÇÆü»þ¤È¤·¤Æ°ÕÌ£¤Î¤¢¤ë¤â¤Î¡£Î㤨¤Ð @code{'19970523091528'} ¤ª¤è¤Ó @code{'970523091528'}
-¤Ï @code{'1997-05-23 09:15:28'} ¤È²ò¼á¤µ¤ì¤Þ¤¹¡£¤·¤«¤· @code{'971122129015'} ¤Ï̵¸ú¤Ç
-(»þ¤Èʬ¤ÎÉôʬ¤¬¤ª¤«¤·¤¤)¡¢ @code{'0000-00-00 00:00:00'} ¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-@item
-¶èÀÚ¤êʸ»ú¤Ê¤·¤Îʸ»úÎó @code{'YYYYMMDD'} ¤Þ¤¿¤Ï @code{'YYMMDD'} ¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¡¢ÆüÉÕ¤È
-¤·¤Æ°ÕÌ£¤Î¤¢¤ë¤â¤Î¡£Î㤨¤Ð @code{'19970523'} ¤ª¤è¤Ó @code{'970523'} ¤Ï @code{'1997-05-23'} ¤È²ò¼á
-¤µ¤ì¤Þ¤¹¡£¤·¤«¤· @code{'971332'} ¤Ï̵¸ú¤Ç(·î¤ÈÆü¤ÎÉôʬ¤¬¤ª¤«¤·¤¤)¡¢ @code{'0000-00-00'}
-¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-@item
- @code{YYYYMMDDHHMMSS} ¤Þ¤¿¤Ï @code{YYMMDDHHMMSS} ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¿ôÃͤǡ¢Æü»þ¤È¤·¤Æ°Õ
-Ì£¤Î¤¢¤ë¤â¤Î¡£Î㤨¤Ð @code{19830905132800} ¤ª¤è¤Ó @code{830905132800} ¤Ï
- @code{'1983-09-05 13:28:00'} ¤È²ò¼á¤µ¤ì¤Þ¤¹¡£
-
-@item
- @code{YYYYMMDD} ¤Þ¤¿¤Ï @code{YYMDD} ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¿ôÃͤÇÆüÉդȤ·¤Æ°ÕÌ£¤Î¤¢¤ë¤â¤Î¡£
-Î㤨¤Ð @code{19830905} ¤ª¤è¤Ó @code{830905} ¤Ï @code{'1983-09-05'} ¤È¤·¤Æ²ò¼á¤µ¤ì¤Þ¤¹¡£
-
-@item
- @code{NOW()} ¤ä @code{CURRENT_DATE} ¤Î¤è¤¦¤Ë
- @code{DATETIME} , @code{DATE} , @code{TIMESTAMP} ¤Î¥³¥ó¥Æ¥­¥¹¥È¤Ç
-¥¢¥¯¥»¥¹²Äǽ¤ÊÃͤòÊÖ¤¹´Ø¿ô¤Î·ë²Ì¡£
-@end itemize
-
-̵¸ú¤Ê @code{DATETIME} , @code{DATE} , @code{TIMESTAMP} ¤ÎÃͤÏŬÀڤʡ֥¼¥í¡×ÃͤËÊÑ´¹¤µ¤ì¤Þ¤¹(
- @code{'0000-00-00 00:00:00'} , @code{'0000-00-00'} ¤Þ¤¿¤Ï @code{00000000000000} )¡£
-
-Æü»þ¤ÎÉôʬ¤Ë¶èÀÚ¤ê¤ò»ý¤Äʸ»úÎó¤Ç»ØÄꤵ¤ì¤ëÃͤǡ¢·î¡¢Æü¤ÎÃͤ¬10̤Ëþ¤Î¾ì
-¹ç¤Ï2·å¤Ç»ØÄꤷ¤Ê¤¯¤Æ¤â¤«¤Þ¤¤¤Þ¤»¤ó¡£ @code{'1979-6-9'} ¤Ï @code{'1979-06-09'} ¤ÈÅù²Á¤Ç
-¤¹¡£Æ±Íͤ˻þ¹ï¤ÎÉôʬ¤Ë¶èÀÚ¤ê¤ò»ý¤Äʸ»úÎó¤Ç»ØÄꤵ¤ì¤ëÃͤǡ¢»þ¡¢Ê¬¡¢Éä¬
- @code{10} ̤Ëþ¤Î¾ì¹ç¤Ï2·å¤Ç»ØÄꤷ¤Ê¤¯¤Æ¤â¤«¤Þ¤¤¤Þ¤»¤ó¡£ @code{'1979-10-30 1:2:3'} ¤Ï
- @code{'1979-10-30 01:02:03'} ¤ÈÅù²Á¤Ç¤¹¡£
-
-¿ôÃͤǤ·¤Æ¤¤¤µ¤ì¤ëÃÍ¤Ï 6, 8, 12 ¤Þ¤¿¤Ï 14 ·å¤Ç¤¢¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤â¤·¤½¤Î¿ô
-Ãͤ¬ 8 ¤Þ¤¿¤Ï 14 ·å¤ÎŤµ¤Î»þ¤Ï¤½¤ì¤¾¤ì @code{YYYYMMDD} ¤ª¤è¤Ó @code{YYYYMMDDHHMMSS} ¥Õ¥©¡¼
-¥Þ¥Ã¥È¤Ç¡¢ºÇ½é¤Î 4 ·å¤Çǯ¤¬Í¿¤¨¤é¤ì¤ë¤â¤Î¤È²¾Äꤵ¤ì¤Þ¤¹¡£¤â¤·¤½¤Î¿ôÃͤ¬ 6
-¤Þ¤¿¤Ï12·å¤ÎŤµ¤Î»þ¤Ï @code{YYMMDD} ¤ª¤è¤Ó @code{YYMMDDHHMMSS} ¥Õ¥©¡¼¥Þ¥Ã¥È¤ÇºÇ½é¤Î2·å¤Ç
-ǯ¤¬Í¿¤¨¤é¤ì¤ë¤â¤Î¤È²¾Äꤵ¤ì¤Þ¤¹¡£¤³¤ì¤é°Ê³°¤ÎŤµ¤Î¿ôÃͤϤ¢¤È¤Ë @code{0} ¤¬ÄɲÃ
-¤µ¤ì¤Æ¤³¤ì¤é¤Î¤¦¤Á¤Î¤â¤Ã¤È¤â¶á¤¤Ä¹¤µ¤Î¤â¤Î¤È²ò¼á¤µ¤ì¤Þ¤¹¡£
-
-¶èÀÚ¤ê¤Ê¤·¤Îʸ»úÎó¤ÇÍ¿¤¨¤é¤ì¤ëÃͤϤ½¤ì¼«¿È¤ÎŤµ¤ò»È¤Ã¤Æ²ò¼á¤µ¤ì¤Þ¤¹¡£
-¤â¤·Ê¸»úÎó¤¬8¤Þ¤¿¤Ï14ʸ»ú¤Ê¤é¤Ðǯ¤ÏºÇ½é¤Î4ʸ»ú¤ÇÍ¿¤¨¤é¤ì¤ë¤È²¾Äꤵ¤ì¤Þ
-¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤ÐºÇ½é¤Î2ʸ»ú¤ÇÍ¿¤¨¤é¤ì¤ë¤È²¾Äꤵ¤ì¤Þ¤¹¡£Ê¸»úÎó¤Ïº¸¤«
-¤é±¦¤Ëǯ¡¢·î¡¢Æü¡¢»þ¡¢Ê¬¡¢ÉäÈʸ»úÎóÃæ¤Ëɽ¸½¤µ¤ì¤Æ¤¤¤ëʬ¤À¤±½ç¤Ë²ò¼á¤µ
-¤ì¤Þ¤¹¡£¤Ä¤Þ¤ê6ʸ»ú°Ê²¼¤Îʸ»úÎó¤Ï»È¤Ã¤Æ¤Ï¤¤¤±¤Ê¤¤¤È¤¤¤¦¤³¤È¤Ç¤¹¡£Î㤨
-¤Ð1999ǯ3·î¤ò»ØÄꤹ¤ë¤Ä¤â¤ê¤Ç @code{'9903'} ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢ @strong{MySQL} ¤Ï¡Ö¥¼¥í¡×ÆüÉÕ
-¤ò¥Æ¡¼¥Ö¥ë¤ËÁÞÆþ¤·¤Þ¤¹¡£¤³¤ì¤Ïǯ¤È·î¤ÎÉôʬ¤Ï @code{99} ¤È @code{03} ¤Ç¤¹¤¬Æü¤ÎÉôʬ¤¬·ç¤±
-¤Æ¤¤¤ë(¥¼¥í)¤¿¤á¤ËÃͤ¬Í­¸ú¤ÊÆüÉդǤʤ¤¤¿¤á¤Ëµ¯¤³¤ê¤Þ¤¹¡£
-
-@code{TIMESTAMP} ¥Õ¥£¡¼¥ë¥É¤ÏÍ­¸ú¤ÊÃͤò¡¢É½¼¨¥µ¥¤¥º¤Ë´Ø·¸¤Ê¤¯»ØÄꤵ¤ì¤¿ÃͤòºÇ¹âÀºÅÙ¤Î
-»þ´Öʬ²òǽ¤Ç³ÊǼ¤·¤Þ¤¹¡£¤³¤Î¤³¤È¤Ï¤¤¤¯¤Ä¤«¤Î°ÕÌ£¹ç¤¤¤ò»ý¤Á¤Þ¤¹¡£
-
-ǯ¤ÎÃͤ¬Æó·å¤Ç»ØÄꤵ¤ì¤¿¾ì¹ç¡¢À¤µª¤ÎÉôʬ¤¬¤Ê¤¤¤Î¤ÇÛ£Ëæ¤ÊÃͤȤʤê¤Þ¤¹¡£
-@strong{MySQL} ¤ÏÆó·å¤Îǯ¤ÎÃͤò°Ê²¼¤Ë¼¨¤¹µ¬Â§¤Ë¤½¤Ã¤ÆÊÑ´¹¤·¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-Îó¤Î·¿¤¬TIMESTAMP(4)¤Ç¤¢¤Ã¤Æ¤âTIMESTAMP(2)¤Ç¤¢¤Ã¤Æ¤â¾ï¤Ëǯ·îÆü¤ò»ØÄê
-¤¹¤ë¤³¤È¡£¤½¤¦¤Ç¤Ê¤±¤ì¤ÐÃͤÏ̵¸ú¤Ç0¤¬³ÊǼ¤µ¤ì¤Þ¤¹¡£
-
-@item
-¤â¤·Ã»¤¤·Á¼°¤Î @code{TIMESTAMP} ¤ò @code{ALTER TABLE} ¤ò»È¤Ã¤Æ³ÈÄ¥¤·¤è¤¦¤È¤·¤¿¾ì¹ç¡¢³È
-Ä¥Á°¤Ë¤Ï¡Ö±£¤ì¤Æ¤¤¤¿¡×¾ðÊ󤬸½¤ì¤Þ¤¹¡£
-
-@item
-ƱÍÍ¤Ë @code{TIMESTAMP} ¥Õ¥£¡¼¥ë¥É¤ò½Ì¤á¤¿¾ì¹ç¤â¡¢Ãͤ¬É½¼¨¤µ¤ì¤¿»þ¤Ë¤è¤ê¾¯¤Ê¤¤¾ðÊó¤·
-¤«¸½¤ì¤Ê¤¤¤È¤¤¤¦ÅÀ¤ò½ü¤¤¤Æ¡¢¾ðÊó¤Ï¼º¤ï¤ì¤Þ¤»¤ó¡£
-
-@item
- @code{TIMESTAMP} ÃͤϺǹâÀºÅ٤λþ´Öʬ²òǽ¤Ç³ÊǼ¤µ¤ì¤Þ¤¹¤¬¡¢ÆâÉôŪ¤Ë³ÊǼ¤µ¤ì
-¤¿ÃͤòľÀÜÁàºî¤Ç¤­¤ë´Ø¿ô¤Ï @code{UNIX_TIMESTAMP()} ¤Î¤ß¤Ç¤¹¡£Â¾¤Î´Ø¿ô¤Ï¥Õ¥©¡¼¥Þ¥Ã
-¥È¤µ¤ì¤Æ¼è¤ê½Ð¤µ¤ì¤¿ÃͤˤĤ¤¤ÆÁàºî¤·¤Þ¤¹¡£¤Ä¤Þ¤ê¡¢ @code{HOUR()} ¤ä @code{SECOND()} ¤Ê¤É
-¤Î´Ø¿ô¤Ï @code{TIMESTAMP} ÃͤÎÂбþ¤¹¤ëÉôʬ¤¬¥Õ¥©¡¼¥Þ¥Ã¥È¤µ¤ì¤¿ÃͤǴޤޤì¤Ê¤¤¤È
-»È¤¦¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£Î㤨¤Ð @code{TIMESTAMP} Îó¤Î @code{HH} ¤ÎÉôʬ¤Ïɽ¼¨¥µ¥¤¥º¤¬¾¯¤Ê¤¯
-¤È¤â10°Ê¾å¤Ê¤¤¤Èɽ¼¨¤µ¤ì¤Ê¤¤¤Î¤Ç¡¢¤½¤ì¤è¤êû¤¤ @code{TIMESTAMP} ÃÍ¤Ë @code{HOUR()} ¤ÎÁà
-ºî¤ò¹Ô¤Ã¤Æ¤â̵°ÕÌ£¤ÊÃͤ·¤«ÆÀ¤é¤ì¤Þ¤»¤ó¡£
-@end itemize
-
-¤¢¤ëÆüÉÕ·¿¤ò¾¤ÎÆüÉÕ·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ë³ÈÄ¥¤·¤Æ»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¤·¤«¤·¤½¤ì¤ÏÃͤÎÊѲ½¤ä¾ðÊó¤Î·çÍî¤òµ¯¤³¤¹²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£
-
-@itemize @bullet
-@item
-@code{DATE} ¤ÎÃͤò @code{DATETIME} ¤« @code{TIMESTAMP} ¤Îʪ¤ËÍ¿¤¨¤¿¾ì¹ç¡¢
-»þ¹ï¤ÎÉôʬ¤Ï @code{'00:00:00'} ¤Ë¤Ê¤ê¤Þ¤¹¡£¤³¤ì¤Ï @code{DATE} Ãͤ¬
-»þ¹ï¤Î¾ðÊó¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¤«¤é¤Ç¤¹¡£
-
-@item
-@code{DATETIME} ¤« @code{TIMESTAMP} ¤ÎÃͤò @code{DATE} ¤Îʪ¤ËÍ¿¤¨¤¿¾ì¹ç¡¢
-»þ¹ï¤ÎÉôʬ¤Ïºï¤é¤ì¤Þ¤¹¡£¤³¤ì¤Ï @code{DATE} Ãͤ¬
-»þ¹ï¤Î¾ðÊó¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¤«¤é¤Ç¤¹¡£
-
-@item
- @code{DATETIME}, @code{DATE}, @code{TIMESTAMP} ÃͤÏƱ¤¸¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¥»¥Ã¥È¤ò»È¤Ã¤Æɽ¸½¤Ç
-¤­¤Þ¤¹¤¬¡¢¤É¤Î·¿¤âƱ¤¸ÃͤÎÈϰϤò»ý¤Ã¤Æ¤¤¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¤³¤È¤ò³Ð¤¨¤Æ¤ª¤¤
-¤Æ¤¯¤À¤µ¤¤¡£Î㤨¤Ð @code{TIMESTAMP} ÃÍ¤Ï @code{1970} ǯ¤è¤êÁ°¤ä @code{2037} ǯ¤è¤ê¸å¤ÎÃͤˤϤǤ­
-¤Þ¤»¤ó¡£¤Ä¤Þ¤ê @code{'1968-01-01'} ¤È¤¤¤¦ÃÍ¤Ï @code{DATETIME} ¤ä @code{DATE} ¤ÎÃͤȤ·¤Æ¤ÏÍ­¸ú¤Ç¤¹
-¤¬ @code{TIMESTAMP} ¤ÎÃͤȤ·¤Æ¤Ï̵¸ú¤Ç¡¢¤½¤Î¤è¤¦¤Ê¥ª¥Ö¥¸¥§¥¯¥È¤ò»ØÄꤷ¤¿¾ì¹ç¤Ï
- @code{0} ¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£
-@end itemize
-
-ÆüÉÕ¤ÎÃͤò»ØÄꤹ¤ë¤È¤­¤ÎÍî¤È¤··ê¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤:
-
-@itemize @bullet
-@item
-ʸ»úÎó¤È¤·¤Æ»ØÄꤵ¤ì¤ëÃͤνÀÆð¤Ê¥Õ¥©¡¼¥Þ¥Ã¥È¤ËñÙ¤µ¤ì¤Ê¤¤¤è¤¦¡£Î㤨
-¤Ð @code{'10:11:12'} ¤Ï @samp{':'} ¤ò¶èÀÚ¤êʸ»ú¤È¤¹¤ë»þ¹ï¤Î¤è¤¦¤Ë¸«¤¨¤Þ¤¹¤¬¡¢ÆüÉդΥ³¥ó
-¥Æ¥­¥¹¥È¤Ç»È¤ï¤ì¤ë¤È¤³¤ì¤Ï @code{'2010-11-12'} ¤È²ò¼á¤µ¤ì¤Þ¤¹¡£@code{'10:45:15'} ¤Ï @code{'45'}
-¤¬Í­¸ú¤Ê·î¤Ç¤Ï¤Ê¤¤¤Î¤Ç @code{'0000-00-00'} ¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£
-
-@item
-2·å¤Çɽ¤µ¤ì¤ëǯ¤ÏÀ¤µª¤ÎÉôʬ¤¬ÉÔÌÀ¤Ê¤Î¤ÇÛ£Ëæ¤Ç¤¹¡£ @strong{MySQL} ¤Ï°Ê²¼¤Î¥ë¡¼¥ë
-¤Ç2·å¤Îǯ¤ò²ò¼á¤·¤Þ¤¹¡£
-
-@itemize @minus
-@item
-@code{00-69} ¤ÎÈϰϤˤ¢¤ëǯ¤ÎÃÍ¤Ï @code{2000-2069} ǯ¤È¤¹¤ë¡£
-
-@item
-@code{70-99} ¤ÎÈϰϤˤ¢¤ëǯ¤ÎÃÍ¤Ï @code{1970-1999} ǯ¤È¤¹¤ë¡£
-@end itemize
-@end itemize
-
-@tindex TIME
-@node TIME, YEAR, DATETIME, Date and time types
-@subsubsection @code{TIME} ·¿
-
-@strong{MySQL} ¤Ï @code{TIME} ¤ÎÃͤò @code{'HH:MM:SS'}
- (»þ¤ÎÉôʬ¤¬Â礭¤¤¾ì¹ç¤Ï @code{'HHH:MM:SS'})
-¤È¤¤¤¦¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç°·¤¤¡¢¤Þ¤¿É½¼¨¤·¤Þ¤¹¡£
-(»þ¤ÎÉôʬ¤¬Â礭¤¤¾ì¹ç¤Ï @code{'HHH:MM:SS'})¡£
-@code{TIME} ÃͤÎÈÏ°Ï¤Ï @code{'-838:59:59'} ¤«¤é @code{'838:59:59'} ¤ÎÈϰϤǤ¹¡£
-»þ¤ÎÉôʬ¤¬¤³¤ó¤Ê¤ËÂ礭¤¤¤Î¤Ï¡¢@code{TIME} ·¿¤Ï°ìÆü¤¹¤Ê¤ï¤Á24»þ´Ö°ÊÆâ
-¤Î»þ¹ï¤òɽ¸½¤¹¤ë¤Î¤ËÍѤ¤¤é¤ì¤ë¤À¤±¤Ç¤Ï¤Ê¤¯·Ð²á»þ´Ö¤äÆó¤Ä¤Î»ö¾Ý¤Î´Ö³Ö
-(¤É¤Á¤é¤â£²£´»þ´Ö¤ò±Û¤¨¤¿¤ê¡¢Éé¤Î¿ô¤Ë¤Ê¤ë¾ì¹ç¤â¤¢¤ê¤Þ¤¹)¤òɽ¸½¤¹¤ë¤³¤È
-¤â¤¢¤ë¤«¤é¤Ç¤¹¡£
-
-@code{TIME} ÃͤÏÍÍ¡¹¤Ê¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç»ØÄê²Äǽ¤Ç¤¹¡§
-
-@itemize @bullet
-@item
-ʸ»úÎó¤Ç @code{'D HH:MM:SS.fraction'} ¤È¤¤¤¦¥Õ¥©¡¼¥Þ¥Ã¥È¡£
-(@strong{MySQL}¤Ï¤Þ¤À¤³¤Î fraction ¤ò time ¥Õ¥£¡¼¥ë¥É¤ËÊݸ¤Ç¤­¤Þ¤»¤ó)¡£
-°Ê²¼¤Î ``½ÀÆð¤Ê'' ʸˡ¤¬»ÈÍѤǤ­¤Þ¤¹¡§
-
-@code{HH:MM:SS.fraction}, @code{HH:MM:SS}, @code{HH:MM}, @code{D HH:MM:SS},
-@code{D HH:MM}, @code{D HH} or @code{SS}. Here @code{D} is days between 0-33.
-
-@item
-ʸ»úÎó¤Ç @code{'HHMMSS'} ¤È¤¤¤¦¤è¤¦¤Ë¶èÀÚ¤ê¤Î¤Ê¤¤¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç»þ¹ï¤È¤·¤ÆÍ­¸ú
-¤Ê¤â¤Î¡£Î㤨¤Ð @code{'101112'} ¤Ï @code{'10:11:12'} ¤È²ò¼á¤µ¤ì¤Þ¤¹¤¬ @code{'109712'} ¤Ï̵¸ú¤Ç(ʬ
-¤ÎÉôʬ¤¬Ìµ°ÕÌ£) @code{'00:00:00'} ¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-@item
-¿ôÃÍ¤Ç @code{HHMMSS} ¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç»þ¹ï¤È¤·¤ÆÍ­¸ú¤Ê¤â¤Î¡£
-Î㤨¤Ð @code{101112} ¤Ï @code{'10:11:12'} ¤È²ò¼á¤µ¤ì¤Þ¤¹¡£
-¼¡¤ÎÊ̤ηÁ¼°¤â²ò¼á¤Ç¤­¤Þ¤¹: @code{SS}, @code{MMSS},@code{HHMMSS},
-@code{HHMMSS.fraction}¡£Ãí°Õ: @strong{MySQL} ¤Ï¤Þ¤À fraction Éô¤òÊݸ¤Ç¤­
-¤Þ¤»¤ó¡£
-
-@item
-Î㤨¤Ð @code{CURRENT_TIME} ¤Î¤è¤¦¤Ë @code{TIME} ¤Î¥³¥ó¥Æ¥­¥¹¥È¤Ç¼õ¤±ÉÕ¤±¤é¤ì¤ëÃͤòÊÖ¤¹
-´Ø¿ô¤Î·ë²Ì¡£
-@end itemize
-
-ʸ»úÎó¤Ç»þ¹ï¤Î³ÆÉô¤Î¶èÀÚ¤ê¤ò´Þ¤à @code{TIME} ¤ÎÃͤˤĤ¤¤Æ¤Ï¡¢»þ¡¢Ê¬¡¢Éä¬ @code{10} °Ê²¼
-¤Î¾ì¹ç¡¢£²·å¤Î¿ô»ú¤ò»ØÄꤹ¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£@code{'8:3:2'} ¤Ï @code{'08:03:02'} ¤ÈƱ
-¤¸¤Ç¤¹¡£
-
-¡Öû¤¤¡× @code{TIME} Ãͤò @code{TIME} ¥Õ¥£¡¼¥ë¥É¤È¤·¤Æ»ØÄꤹ¤ë¾ì¹ç¤ÏÍ×Ãí°Õ¤Ç¤¹¡£
-@strong{MySQL} ¤Ï¤½¤ÎÃͤò¤â¤Ã¤È¤â±¦Ã¼¤Î·å¤ÏÉäòɽ¤¹¤È²¾Äꤷ¤Æ²ò¼á¤·¤Þ¤¹
-(@strong{MySQL} ¤Ï @code{TIME} ¤ÎÃͤò°ìÆü¤Î
-¤¦¤Á¤Î»þ¹ï¤È¤·¤Æ¤è¤ê·Ð²á»þ´Ö¤È¤·¤Æ²ò¼á¤·¤Þ¤¹)¡£Î㤨¤Ð @code{'11:12'},@code{'1112'},
- @code{1112} ¤¬ @code{'00:11:12'} (11»þ12ʬ)¤òɽ¤·¤Æ¤¤¤ë¤Ä¤â¤ê¤Ç¤¤¤Æ¤â¡¢
-@strong{MySQL} ¤Ï¤³¤ì¤é¤ò @code{'00:00:12'} (11ʬ12ÉÃ)¤È¤·¤Æ²ò¼á¤·¤Þ¤¹¡£
-ƱÍÍ¤Ë @code{'12'} ¤ª¤è¤Ó @code{12} ¤Ï @code{'00:00:12'} ¤È²ò¼á¤·¤Þ¤¹¡£
-
-@code{TIME} ¤ÎÈϰϳ°¤Ë¤¢¤ëÃͤÇÃͰʳ°¤ÏÀµ¤·¤¤¤â¤Î¤ÏÈϰϤÎü¤ÎÃͤÎŬÅö¤ÊÊý¤Ë¥¯¥ê¥Ã
-¥×¤µ¤ì¤Þ¤¹¡£Î㤨¤Ð @code{'-850:00:00'} ¤ª¤è¤Ó @code{'850:00:00'} ¤Ï
-¤½¤ì¤¾¤ì @code{'-838:59:59'} ¤ª¤è¤Ó @code{'838:59:59'} ¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-̵¸ú¤Ê @code{TIME} ÃÍ¤Ï @code{'00:00:00'} ¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£
-¤³¤³¤Ç @code{'00:00:00'} ¼«ÂΤÏÍ­¸ú¤Ê @code{TIME} ÃͤʤΤǡ¢
-¥Æ¡¼¥Ö¥ëÆâ¤ËÊݸ¤µ¤ì¤¿'00:00:00'¤È¤¤¤¦Ãͤ«¤é¤½¤ì¤¬¤â¤È¤â
-¤È @code{'00:00:00'} ¤È»ØÄꤵ¤ì¤¿ÃͤʤΤ«Ìµ¸ú¤Ê¤¿¤á¤ËÊÑ´¹¤µ¤ì¤¿·ë²Ì¤Ê¤Î¤«¤ò¶è
-Ê̤¹¤ëÊýË¡¤Ï¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-
-@tindex YEAR
-@node YEAR, , TIME, Date and time types
-@subsubsection @code{YEAR} ·¿
-
-@code{YEAR} ·¿¤Ïǯ¤òɽ¸½¤¹¤ë¤Î¤Ë»È¤ï¤ì¤ë1¥Ð¥¤¥È¤ÎÃͤǤ¹¡£
-
-@strong{MySQL} ¤Ï @code{YEAR} ¤ÎÃͤò @code{YYYY} ¤È¤¤¤¦¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç°·¤¤¡¢
-¤Þ¤¿É½¼¨¤·¤Þ¤¹¡£ÈÏ°Ï¤Ï @code{1901} ¤«¤é @code{2155} ¤Ç¤¹¡£
-
-@code{YEAR} ·¿¤ÏÍÍ¡¹¤Ê¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç»ØÄê²Äǽ¤Ç¤¹¡§
-
-@itemize @bullet
-@item
-@code{'1901'} ¤«¤é @code{'2155'} ¤ÎÈϰϤˤ¢¤ë4·å¤Îʸ»úÎó
-
-@item
-@code{1901} ¤«¤é @code{2155} ¤ÎÈϰϤˤ¢¤ë4·å¤Î¿ôÃÍ¡£
-
-@item
-@code{'00'} ¤«¤é @code{'99'} ¤ÎÈϰϤˤ¢¤ë2·å¤Îʸ»úÎó¡£
-@code{'00'} ¤«¤é @code{'69'} ¤Þ¤Ç¤ª¤è¤Ó @code{'70'} ¤«¤é
-@code{'99'} ¤Þ¤Ç¤ÎÈϰϤϤ½¤ì¤¾¤ì @code{2000} ¤«¤é @code{2069} ¤Þ¤Ç
-¤ª¤è¤Ó @code{1970} ¤«¤é @code{1999} ¤Þ¤Ç¤ÎÈϰϤÎ
-YEAR·¿¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£
-
-@item
-@code{1} ¤«¤é @code{99} ¤ÎÈϰϤˤ¢¤ë2·å¤Î¿ôÃÍ¡£@code{1} ¤«¤é @code{69} ¤Þ¤Ç
-¤ª¤è¤Ó @code{70} ¤«¤é @code{99} ¤Þ¤Ç¤ÎÈϰϤÏ
-¤½¤ì¤¾¤ì @code{2001} ¤«¤é @code{2069} ¤Þ¤Ç¤ª¤è¤Ó @code{1970} ¤«¤é @code{1999} ¤Þ¤Ç
-¤ÎÈϰϤΠ@code{YEAR} ·¿¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£
-2·å¤Î¿ôÃͤξì¹ç¤Ï2·å¤Îʸ»úÎó¤Î¾ì¹ç¤È¼ã´³°Û¤Ê¤Ã¤Æ¤¤¤ëÅÀ¤ËÃí°Õ¤·¤Æ
-¤¯¤À¤µ¤¤¡£¤Ê¤¼¤Ê¤é0¤ò¿ôÃͤȤ·¤Æ»ØÄꤷ¡¢¤½¤ì¤ò2000ǯ¤È¤·¤Æ²ò¼á¤µ¤»¤ë¤³
-¤È¤¬¤Ç¤­¤Ê¤¤¤«¤é¤Ç¤¹¡£¤½¤Î¾ì¹ç¤Ïʸ»úÎó¤Ç @code{'0'} ¤Þ¤¿¤Ï @code{'00'} ¤ò@emph{»ØÄꤷ¤Ê¤±¤ì¤Ð
-¤Ê¤ê¤Þ¤»¤ó}¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¿ôÃÍ0¤Ï̵¸ú¤ÊYEARÃͤò¼¨¤¹ @code{0000} ¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£
-
-@item
-Î㤨¤Ð @code{NOW()} ¤Î¤è¤¦¤Ë @code{YEAR} ¥³¥ó¥Æ¥­¥¹¥È¤Ç¼õ¤±Æþ¤ì¤é¤ì¤ëÃͤòÊÖ¤¹´Ø¿ô¤Î·ë
-²Ì¡£
-@end itemize
-
-̵¸ú¤Ê @code{YEAR} ÃÍ¤Ï @code{0000} ¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£
-
-
-@node String types, Choosing types, Date and time types, Column types
-@subsection ʸ»úÎó·¿
-
-ʸ»úÎó·¿¤Ï @code{CHAR}, @code{VARCHAR}, @code{BLOB}, @code{TEXT},
-@code{ENUM} ¤ª¤è¤Ó @code{SET} ¤Ç¤¹¡£
-
-@tindex CHAR
-@tindex VARCHAR
-@menu
-* CHAR:: The @code{CHAR} and @code{VARCHAR} types
-* BLOB:: The @code{BLOB} and @code{TEXT} types
-* ENUM:: The @code{ENUM} type
-* SET:: The @code{SET} type
-@end menu
-
-@node CHAR, BLOB, String types, String types
-@subsubsection @code{CHAR} ·¿¤È @code{VARCHAR} ·¿
-
-@code{CHAR} ·¿¤È @code{VARCHAR} ·¿¤Ï¤è¤¯»÷¤Æ¤¤¤Þ¤¹¤¬³ÊǼ¡¢¼è¤ê½Ð¤·¤Î¼ê½ç¤Ë°ã¤¤¤¬¤¢¤ê¤Þ¤¹¡£
-
-@code{CHAR} ¥Õ¥£¡¼¥ë¥É¤ÎŤµ¤Ï¥Æ¡¼¥Ö¥ë¤òÀ¸À®¤¹¤ë¤È¤­¤ËÀë¸À¤·¤¿Ä¹¤µ¤Ë¸ÇÄꤵ¤ì¤Þ¤¹¡£Ä¹¤µ
-¤Ï 1 ¤«¤é 255 ¤Þ¤Ç¤ÎÃͤò¼è¤ê¤Þ¤¹¡£@code{CHAR} ¤¬³ÊǼ¤µ¤ì¤ë¤È¤­¤Ë¤Ï»ØÄꤵ¤ì¤¿Ä¹¤µ¤Ë
-¤Ê¤ë¤è¤¦¤Ë±¦Â¦¤Ë¶õÇò¤¬µÍ¤á¤é¤ì¤Þ¤¹¡£@code{CHAR} ¤ÎÃͤ¬¼è¤ê½Ð¤µ¤ì¤¿¾ì¹ç¤Ë¤Ï±¦Â¦
-(¸å³)¤Î¶õÇò¤Ï¼è¤ê½ü¤«¤ì¤Þ¤¹¡£
-
-@code{VARCHAR} ¥Õ¥£¡¼¥ë¥É¤ÎÃͤϲÄÊÑĹʸ»úÎó¤Ç¤¹¡£
-@code{VARCHAR} ¥Õ¥£¡¼¥ë¥É¤Ï @code{CHAR} ¥Õ¥£¡¼¥ë¥É
-¤ÈƱ¤¸¤¯ 1 ¤«¤é 255 ¤Þ¤Ç¤ÎŤµ¤ËÀë¸À¤Ç¤­¤Þ¤¹¡£
-(@strong{MySQL} 3.23 ¤Ç¤Ï, @code{CHAR} ¤ÎŤµ¤Ï 0 ¤«¤é 255 ¤Þ¤Çµö¤µ¤ì¤Æ¤¤¤Þ¤¹.)
-¤·¤«¤· @code{CHAR} ·¿¤È°Û¤Ê¤ê @code{VARCHAR} ·¿¤ÎÃͤÏɬÍפÊʸ»ú¿ô¤Îʬ¤Ë
-Ťµ¤òµ­Ï¿¤¹¤ë1 ¥Ð¥¤¥È¤ò­¤·¤¿Îΰè¤Ë³ÊǼ¤µ¤ì¤Þ¤¹¡£ÃͤˤϷå¹ç¤ï¤»¤Î¤¿¤á¤Î¶õÇò¤Ï¤Ä¤±¤é¤ì
-¤Þ¤»¤ó¡£¸å³¤Î¶õÇò¤ÏÃͤγÊǼ»þ¤Ë¼è¤ê½ü¤«¤ì¤Þ¤¹¡£(¤³¤Î¶õÇò¤Î½üµî¤Ï ANSI
-SQL»ÅÍͤȤϰã¤Ã¤Æ¤¤¤Þ¤¹¡£)
-
-¤â¤· @code{CHAR} ¤Þ¤¿¤Ï @code{VARCHAR} ¥Õ¥£¡¼¥ë¥É¤Ë¡¢¥Õ¥£¡¼¥ë¥É¤ÎºÇÂçŤò
-±Û¤¨¤ëŤµ¤ÎÃͤòÍ¿¤¨¤¿¾ì¹ç¤Ï¡¢Å¬¹ç¤¹¤ë¤è¤¦¤ËÀÚ¤êµÍ¤á¤é¤ì¤Þ¤¹¡£
-
-°Ê²¼¤Îɽ¤Ï¤³¤ì¤é¤ÎÆó¤Ä¤Î¥Õ¥£¡¼¥ë¥É·¿¤Î°ã¤¤¤ò¡¢@code{CHAR(4)} ¤ª¤è¤Ó @code{VARCHAR(4)} ¤ËÍÍ¡¹
-¤Êʸ»úÎóÃͤò³ÊǼ¤·¤¿·ë²Ì¤ò¼¨¤¹¤³¤È¤Çɽ¤·¤Æ¤¤¤Þ¤¹¡£
-
-@c Need to use @(space) to make sure second column values retain spacing
-@c in output for table below.
-
-@multitable @columnfractions .2 .15 .2 .2 .25
-@item @strong{ÃÍ} @tab @code{CHAR(4)} @tab @strong{ɬÍפʳÊǼ°è} @tab @code{VARCHAR(4)} @tab @strong{ɬÍפʳÊǼ°è}
-@item @code{''} @tab @code{'@ @ @ @ '} @tab 4 ¥Ð¥¤¥È @tab @code{''} @tab 1 ¥Ð¥¤¥È
-@item @code{'ab'} @tab @code{'ab@ @ '} @tab 4 ¥Ð¥¤¥È @tab @code{'ab'} @tab 3 ¥Ð¥¤¥È
-@item @code{'abcd'} @tab @code{'abcd'} @tab 4 ¥Ð¥¤¥È @tab @code{'abcd'} @tab 5 ¥Ð¥¤¥È
-@item @code{'abcdefgh'} @tab @code{'abcd'} @tab 4 ¥Ð¥¤¥È @tab @code{'abcd'} @tab 5 ¥Ð¥¤¥È
-@end multitable
-
-@code{CHAR(4)} ¥Õ¥£¡¼¥ë¥É¤Î¸å³¤Î¶õÇò¤Ï¼è¤ê½Ð¤·»þ¤Ë¤È¤ê¤Î¤¾¤«¤ì¤ë¤Î¤Ç¡¢CHAR(4)¤ª¤è¤Ó
-@code{VARCHAR(4)} ¤«¤é¼è¤ê½Ð¤µ¤ì¤ëÃͤϤɤξì¹ç¤Ç¤âƱ¤¸¤Ç¤¹¡£
-
-@code{CHAR} ¤ª¤è¤Ó @code{VARCHAR} ¥Õ¥£¡¼¥ë¥É¤ÎÃͤϥơ¼¥Ö¥ë¤ÎÀ¸À®»þ¤Ë @code{BINARY} °À­¤¬
-¤Ä¤±¤é¤ì¤Ê¤¤¸Â¤ê¡¢Âçʸ»ú¤È¾®Ê¸»ú¤ò¶èÊ̤·¤Ê¤¤¤Ç¥½¡¼¥È¡¦Èæ³Ó¤µ¤ì¤Þ¤¹¡£@code{BINARY} °À­¤Ï¤½¤Î
-Îó¤ÎÃͤ¬Âçʸ»ú¡¢¾®Ê¸»ú¤ò¶èÊ̤·¤Æ¡¢MySQL¥µ¡¼¥Ð¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¥Þ¥·¥ó¤Î
-ASCII½ç¤Ë¥½¡¼¥È¡¦Èæ³Ó¤µ¤ì¤ë¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£
-
-@code{BINARY} °À­¤Ï¡Ö¸ÇÄêŪ¡×¤Ç¤¹¡£¤Ä¤Þ¤ê¡¢¤â¤· @code{BINARY} ¤Ç¤¢¤ë¤È»ØÄꤵ¤ì¤¿
-¥Õ¥£¡¼¥ë¥É¤¬¼°¤ÎÃæ¤Ë¤¢¤ë¤È¼°Á´ÂΤ¬ @code{BINARY} ¤ÎÃͤȤ·¤ÆÈæ³Ó¤µ¤ì¤ë¤Î¤Ç¤¹¡£
-
-@strong{MySQL} ¤Ï¥Æ¡¼¥Ö¥ëÀ¸À®»þ¤Ë²¿¤âÃǤ餺¤Ë@code{CHAR} ¤Þ¤¿¤Ï @code{VARCHAR} ·¿¤Î
-¥Õ¥£¡¼¥ë¥É¤òÊѹ¹¤¹¤ë»ö¤¬¤¢¤ê¤Þ¤¹¡£
-@xref{Silent column changes}.
-
-@tindex BLOB
-@tindex TEXT
-@node BLOB, ENUM, CHAR, String types
-@subsubsection @code{BLOB} ¤È @code{TEXT} ·¿
-
-@code{BLOB} ¤ÏÂ礭¤Ê¥Ð¥¤¥Ê¥ê·¿¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ç¡¢²ÄÊÑĹ¤Î¥Ç¡¼¥¿¤òÊÝ»ý¤Ç¤­¤Þ¤¹¡£
-4 ¤Ä¤Î @code{BLOB} ·¿¡¢¤¹¤Ê¤ï¤Á @code{TINYBLOB}, @code{BLOB},
-@code{MEDIUMBLOB} ¤È @code{LONGBLOB} ¤ÏÊÝ»ý¤Ç¤­¤ë¥Ç¡¼¥¿¤ÎºÇÂ獬°ã¤¦¤À¤±¤Ç¤¹¡£
-@xref{Storage requirements}.
-
-4 ¤Ä¤Î @code{TEXT} ·¿¡¢¤¹¤Ê¤ï¤Á @code{TINYTEXT}, @code{TEXT}, @code{MEDIUMTEXT}
-¤È @code{LONGTEXT} ¤Ï 4 ¤Ä¤Î @code{BLOB} ·¿¤ËÂбþ¤·¡¢Æ±¤¸ºÇÂçŤÈ
-³ÊǼ¾ò·ï¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£ @code{TEXT} ¤È @code{BLOB} ¤Î°ã¤¤¤Ï¡¢
-@code{TEXT} ¤Ï¥±¡¼¥¹¤Ë°Í¸¤·¤Ê¤¤¤Ç¥½¡¼¥È¤ÈÈæ³Ó¤µ¤ì¡¢
-@code{BLOB} ¤Ï¥±¡¼¥¹¤Ë°Í¸¤·¤Æ(ʸ»ú¥³¡¼¥É¤Ç)Èæ³Ó¤µ¤ì¤ë¤³¤È¤À¤±¤Ç¤¹¡£
-¤¤¤¦¤Ê¤é¤Ð¡¢@code{TEXT} ¤Ï¡¢¥±¡¼¥¹¤Ë°Í¸¤·¤Ê¤¤ @code{BLOB} ¤Ç¤¹¡£
-
-¤â¤· @code{BLOB} ¤ä @code{TEXT} ¥Õ¥£¡¼¥ë¥É¤Ë¤½¤ì¤é¤ÎºÇÂçĹ°Ê¾å¤ÎÃͤ¬Í¿¤¨¤é¤ì¤¿¾ì¹ç¡¢
-¤½¤ÎÃͤϤ­¤Ã¤Á¤ê¼ý¤Þ¤ë¤è¤¦¤ËÀÚ¤êÍî¤È¤µ¤ì¤Þ¤¹¡£
-
-¤Û¤È¤ó¤É¤ÎÅÀ¤Ç¡¢@code{TEXT} ¥Õ¥£¡¼¥ë¥É¤ò @code{VARCHAR} ¤ÎÂ礭¤¤Êª¤È¸«¤Ê¤¹¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
-ƱÍͤˡ¢@code{BLOB} ¥Õ¥£¡¼¥ë¥É¤Ï @code{VARCHAR BINARY} ¥Õ¥£¡¼¥ë¥É¤ÎÂ礭¤¯¤Ê¤Ã¤¿Êª¤Ç¤¹¡£
-°ã¤¤¤Ï¡¢
-
-@itemize @bullet
-@item
-@strong{MySQL} 3.23.2 °Ê¾å¤Ç¤Ï¡¢@code{BLOB} ¤È @code{TEXT} ¹à¤Ë
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ä¤³¤È¤¬½ÐÍè¤Þ¤¹¡£¤½¤ì°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò¤â¤Ä¤³¤È¤¬½ÐÍè¤Þ¤»¤ó¡£
-
-@item
-@code{VARCHAR} ¥Õ¥£¡¼¥ë¥É¤Ç¹Ô¤Ã¤Æ¤¤¤ë¤è¤¦¤Ë¤Ï¡¢@code{BLOB} ¤È @code{TEXT} ¥Õ¥£¡¼¥ë¥É¤Î
-Ãͤθå¤í¤Ë¤Ä¤¤¤Æ¤¤¤ëϢ³¤·¤¿¶õÇòʸ»ú¤ÏÀÚ¤êÍî¤È¤µ¤ì¤Þ¤»¤ó¡£
-
-@item
-@cindex Default values, @code{BLOB} and @code{TEXT} columns
-@cindex @code{BLOB} columns, default values
-@cindex @code{TEXT} columns, default values
-@code{BLOB} ¤È @code{TEXT} ¹à¤Ï @code{DEFAULT} Ãͤò»ý¤Ä¤³¤È¤¬½ÐÍè¤Þ¤»¤ó¡£
-@end itemize
-
-@code{MyODBC} ¤Ï @code{BLOB} ¤ò @code{LONGVARBINARY} ¤È¤·¤Æ¡¢
-@code{TEXT} ¤ò @code{LONGVARCHAR} ¤È¤·¤ÆÄêµÁ¤·¤Þ¤¹¡£
-
-@code{BLOB} ¤È @code{TEXT} ¥Õ¥£¡¼¥ë¥É¤Ï¶Ëü¤ËŤ¤¤Î¤Ç¡¢¤½¤ì¤é¤ò»ÈÍѤ¹¤ëºÝ¤Ë¤Ï¡¢
-¤¤¤¯¤Ä¤«¤Îº¤¤Ã¤¿»ö¤Ë¤Ç¤¯¤ï¤¹¤«¤â¤·¤ì¤Þ¤»¤ó¡§
-
-@itemize @bullet
-@item
-¤â¤· @code{GROUP BY} ¤« @code{ORDER BY} ¤ò @code{BLOB} ¥Õ¥£¡¼¥ë¥É¤ä @code{TEXT} ¥Õ¥£¡¼¥ë¥É
-¤Ç»ÈÍѤ·¤¿¤¤¤Ê¤é¡¢¥Õ¥£¡¼¥ë¥É¤ÎÃͤò¸ÇÄêŤΤâ¤Î¤ËÊÑ´¹¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-ɸ½àŪ¤ÊÊýË¡¤Ï¡¢ @code{SUBSTRING} ´Ø¿ô¤ò»ÈÍѤ¹¤ë¤³¤È¤Ç¤¹¡£
-¤¿¤È¤¨¤Ð¡§
-
-@example
-mysql> select comment from tbl_name,substring(comment,20) as substr
- ORDER BY substr;
-@end example
-
-¤â¤·¤³¤ì¤ò¤·¤Ê¤¤¾ì¹ç¡¢¥Õ¥£¡¼¥ë¥É¤ÎºÇ½é¤Î @code{max_sort_length} ¥Ð¥¤¥È¤¬
-¥½¡¼¥È»þ¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£ @code{max_sort_length} ¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¤Ï 1024;
-¤³¤ÎÃÍ¤Ï @code{mysqld} ¥µ¡¼¥Ð¡¼µ¯Æ°»þ¤Ë @code{-O} ¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ¹¤ë¤³¤È¤Ç
-Êѹ¹¤Ç¤­¤Þ¤¹¡£
-¥Õ¥£¡¼¥ë¥É¤Î°ÌÃÖ¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤Ã¤Æ¤«¡¢¥¨¥¤¥ê¥¢¥¹¤ò»ÈÍѤ¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢
- @code{BLOB} ¤ä @code{TEXT} ¤ÎÃÍ¤Ç group ²½¤Ç¤­¤Þ¤¹¡£
-
-@example
-mysql> select id,substring(blob_col,1,100) from tbl_name
- GROUP BY 2;
-mysql> select id,substring(blob_col,1,100) as b from tbl_name
- GROUP BY b;
-@end example
-
-@item
-@code{BLOB} ¤Þ¤¿¤Ï @code{TEXT} ¥ª¥Ö¥¸¥§¥¯¥È¤ÎºÇÂçĹ¤Ï¤½¤Î·¿¤Ë¤è¤ê·èÄꤵ¤ì¤Þ¤¹¤¬¡¢
-¤¢¤Ê¤¿¤¬¥¯¥é¥¤¥¢¥ó¥È¤È¥µ¡¼¥Ð¤Î´Ö¤Ç¼ÂºÝ¤ËÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë¤ÏºÇÂçĹ¤Ï¡¢
-ÍøÍѲÄǽ¤Ê¥á¥â¥êÎ̤ȥ³¥ß¥å¥Ë¥±¡¼¥·¥ç¥ó¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤Ë¤è¤Ã¤Æ·èÄꤵ¤ì¤Þ¤¹¡£
-¥á¥Ã¥»¡¼¥¸¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤òÊѤ¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¤¬¡¢¤½¤Î¾ì¹ç¡¢¥µ¡¼¥Ð¡¼¤È¥¯¥é¥¤¥¢¥ó¥È¡¢
-ξÊý¶¦¤ËÊѹ¹¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£@xref{Server parameters}.
-@end itemize
-
-¤½¤ì¤¾¤ì¤Î @code{BLOB}, @code{TEXT} ¥Õ¥£¡¼¥ë¥É¤Ï¡¢°ì°Õ¤Î¥¢¥í¥±¡¼¥È¤µ¤ì¤¿¥ª¥Ö¥¸¥§¥¯¥È¤Ë¤è¤Ã¤Æ¡¢
-ÆâÉô¤Ç¤Ïɽ¤µ¤ì¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤.¡£
-¤³¤ì¤Ï¥Æ¡¼¥Ö¥ë¤¬³«¤«¤ì¤ë¤È¤­¤Ë°ìÅÙ¤À¤±¥¢¥í¥±¡¼¥È¤µ¤ì¤ë¾¤Î¥Õ¥£¡¼¥ë¥É¤È¤ÏÂоÈŪ¤Ç¤¹¡£
-
-@tindex ENUM
-@node ENUM, SET, BLOB, String types
-@subsubsection @code{ENUM} ·¿
-
-@code{ENUM} ¤Ï¥¹¥È¥ê¥ó¥°¥ª¥Ö¥¸¥§¥¯¥È¤Ç¡¢
-¤½¤ÎÃͤϡ¢Ä̾¥Æ¡¼¥Ö¥ëºîÀ®»þ¤Î¥Õ¥£¡¼¥ë¥ÉÄêµÁ¤ÇÎóµó¤µ¤ì¤¿ÃͤÎÃ椫¤éÁª¤Ð¤ì¤Þ¤¹¡£
-
-ÃͤϤ¢¤ë¾õ¶·²¼¤Ç¤Ï ¶õʸ»ú (@code{""}) ¤« @code{NULL} ¤ò¼è¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-¤â¤· @code{ENUM} ¤Ë̵¸ú¤ÊÃÍ (Îóµó¤µ¤ì¤Æ¤¤¤ëÃͤÎÃæ¤Ë´Þ¤Þ¤ì¤Ê¤¤Ê¸»ú) ¤ò
-ÂåÆþ¤·¤¿¾ì¹ç¡¢ ¤½¤Î¥¨¥é¡¼¤Ë¤Ê¤ëʸ»ú¤ÎÂå¤ï¤ê¤Ë¶õʸ»ú¤¬ÁÞÆþ¤µ¤ì¤Þ¤¹¡£
-
-@item
-¤â¤· @code{ENUM} ¤¬ @code{NULL} ¤ÈÄêµÁ¤µ¤ì¤¿¾ì¹ç, @code{NULL} ¤Ï¤½¤Î¥Õ¥£¡¼¥ë¥É¤Ç
-µö²Ä¤µ¤ì¤ëÃͤȤʤꡢ¥Ç¥Õ¥©¥ë¥ÈÃͤ¬ @code{NULL} ¤Ë¤Ê¤ê¤Þ¤¹¡£
- ¤â¤· @code{ENUM} ¤¬ @code{NOT NULL} ¤ÈÄêµÁ¤µ¤ì¤¿¤Ê¤é¤Ð¡¢ ¥Ç¥Õ¥©¥ë¥ÈÃͤϡ¢
-Îóµó¥ê¥¹¥È¤ÎºÇ½é¤ÎÃͤˤʤê¤Þ¤¹¡£
-@end itemize
-
-Îóµó¤µ¤ì¤¿¤½¤ì¤¾¤ì¤ÎÃͤϥ¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Á¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-Îóµó¥ê¥¹¥È¤ÎÍ×ÁÇ¤Ï 1 ¤«¤éÉÕÈÖ¤µ¤ì¤Þ¤¹¡£
-
-@item
-¶õʸ»ú¥¨¥é¡¼¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹ÃÍ¤Ï 0 ¡£
- ¤³¤ì¤ÏÉÔÀµ¤Ê @code{ENUM} Ãͤ¬Í¿¤¨¤é¤ì¤Æ¤¤¤ë¥ì¥³¡¼¥É¤ò¸«¤Ä¤±¤ë¤¿¤á¤Ë
-°Ê²¼¤Î¤è¤¦¤Ê @code{SELECT} ¹½Ê¸¤¬»ÈÍѤǤ­¤ë¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡§
-
-@example
-mysql> SELECT * FROM tbl_name WHERE enum_col=0;
-@end example
-
-@item
-@code{NULL} ¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹ÃÍ¤Ï @code{NULL}.
-@end itemize
-
-¤¿¤È¤¨¤Ð¡¢¥Õ¥£¡¼¥ë¥É¤¬ @code{ENUM("one", "two", "three")} ¤ÈÄêµÁ¤µ¤ì¤¿¤Ê¤é¡¢
-°Ê²¼¤Ë¼¨¤¹Ãͤò¤È¤ê¤Þ¤¹¡£ ¤½¤ì¤¾¤ì¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹Ãͤ⼨¤·¤Þ¤¹¡£
-
-@multitable @columnfractions .2 .8
-@item @strong{ÃÍ} @tab @strong{¥¤¥ó¥Ç¥Ã¥¯¥¹}
-@item @code{NULL} @tab @code{NULL}
-@item @code{""} @tab 0
-@item @code{"one"} @tab 1
-@item @code{"two"} @tab 2
-@item @code{"three"} @tab 3
-@end multitable
-
-Îóµó¤ÏºÇÂç 65535 ¸Ä¤ÎÍ×ÁǤޤDzÄǽ¤Ç¤¹¡£
-
-@code{ENUM} ¥Õ¥£¡¼¥ë¥É¤ËÃͤòÍ¿¤¨¤ë¾ì¹ç¤ÏÂçʸ»ú¾®Ê¸»ú¤Ï̵´Ø·¸¤Ç¤¹¡£
-¤·¤«¤·¡¢¸å¤Ç¥Õ¥£¡¼¥ë¥É¤«¤é¸¡º÷¤µ¤ì¤ëÃͤϡ¢Âçʸ»ú¾®Ê¸»ú¤ò¤â¤Á¤Þ¤¹¡£
-¤³¤ì¤Ï¥Æ¡¼¥Ö¥ëºîÀ®»þ¤ËÍ¿¤¨¤é¤ì¤¿¥ê¥¹¥È¤ÎÃͤǤ¹¡£
-
-¤â¤· @code{ENUM} ¤ò¿ôÃͤÎʸ̮¤Ç¸¡º÷¤·¤¿¾ì¹ç¡¢¤½¤Î¥á¥ó¥Ð¡¼¤òÁ°¤«¤é¿ô¤¨¤¿
-»þ¤Î½çÈÖ¤¬¿ôÃͤÇÊ֤äƤ­¤Þ¤¹¡£
-¤â¤· @code{ENUM} ¤Ë¿ôÃͤòÂåÆþ¤·¤è¤¦¤È¤·¤¿¾ì¹ç¡¢¤½¤Î¿ôÃͤΰÌÃ֤ˤ¢¤ë
-¥á¥ó¥Ð¡¼¤¬ÂåÆþ¤µ¤ì¤Þ¤¹¡£
-(¤·¤«¤·¡¢¤³¤ì¤Ï @code{LOAD DATA} ¤Ç¤ÏƯ¤­¤Þ¤»¤ó¡£¤³¤ì¤Ï¤¹¤Ù¤Æ¤ÎÆþÎϤòʸ»ú
-Îó¤È¤·¤Æ°·¤¤¤Þ¤¹¡£)
-
-@code{ENUM} ÃͤÏÎóµó¥á¥ó¥Ð¤¬¥Õ¥£¡¼¥ë¥É»ØÄê¤Ë¥ê¥¹¥È¤µ¤ì¤¿½ç¤Ë½¾¤Ã¤Æ¥½¡¼¥È¤µ
-¤ì¤Þ¤¹¡£
-(¤Ä¤Þ¤ê¡¢@code{ENUM} Ãͤϥ¤¥ó¥Ç¥Ã¥¯¥¹Ãͤ˽¾¤Ã¤Æ¥½¡¼¥È¤µ¤ì¤Þ¤¹¡£)
-Î㤨¤Ð¡¢@code{ENUM("a", "b")} ¤Ê¤é¤Ð @code{"a"} ¤¬ @code{"b"} ¤ÎÁ°¤Ë¥½¡¼¥È¤µ¤ì¡¢
-@code{ENUM("b", "a")} ¤Ê¤é¤Ð @code{"b"} ¤¬ @code{"a"} ¤ÎÁ°¤Ë¥½¡¼¥È¤µ¤ì¤Þ¤¹¡£
-¶õʸ»úÎó¤Ï¶õ¤Ç¤Ï¤Ê¤¤Ê¸»ú¤ÎÁ°¤Ë¥½¡¼¥È¤µ¤ì¡¢
-@code{NULL} ¤Ï¾¤ÎÎóµó¤ÎÁ°¤ËʤӤޤ¹¡£
-
-@code{ENUM} ¥Õ¥£¡¼¥ë¥É¤Ç»ØÄê²Äǽ¤ÊÃͤΥꥹ¥È¤òÁ´¤Æ¼è¤ê¤¿¤¤¤Ê¤é¤Ð¡¢
-¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-@code{SHOW COLUMNS FROM table_name LIKE enum_column_name}
-¤½¤·¤ÆÆóÈÖÌܤΥե£¡¼¥ë¥É¤Î @code{ENUM} ÄêµÁ¤òʬÀϤ·¤Þ¤¹¡£
-
-@tindex SET
-@node SET, , ENUM, String types
-@subsubsection @code{SET} ·¿
-
-@code{SET} ¤Ïʸ»ú·¿¥ª¥Ö¥¸¥§¥¯¥È¤Ç¥¼¥í¤«¤½¤ì°Ê¾å¤òÃÍ»ý¤Á¤Þ¤¹¡£
-¥Æ¡¼¥Ö¥ëºîÀ®»þ¤Ë¤Ï¡¢¤½¤ì¤¾¤ì¤ÎÃͤϥꥹ¥È¤«¤éÁª¤Ð¤ì¤ë¤Ù¤­¤Ç¤¹¡£
-@code{SET} ·¿¤Î¥Õ¥£¡¼¥ë¥É¤ÎÃͤϡ¢¥³¥ó¥Þ(@samp{,})
-¶èÀÚ¤ê¤Çʤ٤é¤ì¤¿Ê£¿ô¤Î¥á¥ó¥Ð¡¼¤Ç¹½À®¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-¤³¤ì¤Ï¡¢ @code{SET} ¥á¥ó¥Ð¡¼¤ÎÃÍÃæ¤Ë¥³¥ó¥Þ¤ò´Þ¤à¤³¤È¤¬½ÐÍè¤Ê¤¤¡¢
-¤È¤¤¤¦¤³¤È¤Ç¤¹¡£
-
-Î㤨¤Ð¡¢
-@code{SET("one", "two") NOT NULL} ¤È»ØÄꤵ¤ì¤¿¥Õ¥£¡¼¥ë¥É¤Ï°Ê²¼¤ÎÃͤò¤È¤ê¤Þ¤¹¡§
-
-@example
-""
-"one"
-"two"
-"one,two"
-@end example
-
-@code{SET} ¤ÏºÇÂç 64 ¸Ä¤Î°Û¤Ê¤Ã¤¿¥á¥ó¥Ð¡¼¤¬¤â¤Æ¤Þ¤¹¡£
-
-@strong{MySQL} ¤Ï @code{SET} ¤ÎÃͤò¿ôÃͤȤ·¤ÆÂåÆþ¤·¤Þ¤¹¡£ÂåÆþ¤µ¤ì¤¿
-ÃͤκDz¼°Ì¤Î¥Ó¥Ã¥È¤¬ºÇ½é¤Î¥á¥ó¥Ð¡¼¤ËÂбþ¤·¤Þ¤¹¡£¤â¤· @code{SET} Ãͤò
-¿ôÃͤÎʸ̮¤Ç¸¡º÷¤·¤¿¾ì¹ç¡¢¸¡º÷¤µ¤ì¤ëÃͤϥե£¡¼¥ë¥É¤ÎÃͤËÂбþ¤·¤Þ¤¹¡£
-¤â¤·¥á¥ó¥Ð¡¼¤¬ @code{SET} ¥Õ¥£¡¼¥ë¥É¤ËÂåÆþ¤µ¤ì¤¿¾ì¹ç¡¢
-Æó¿Ê¿ô¤Çɽ¤µ¤ì¤ë¿ôÃͤ¬¡¢¥á¥ó¥Ð¡¼¤Î¿ôÃͤȤ·¤Æ·èÄꤵ¤ì¤Þ¤¹¡£
-@code{SET("a","b","c","d")} ¤È¥Õ¥£¡¼¥ë¥É¤¬ÄêµÁ¤µ¤ì¤¿¤È¤·¤Þ¤¹¡£
-¥á¥ó¥Ð¡¼¤Ï°Ê²¼¤Î£²¿Ê¿ô¤ÎÃͤò»ý¤Á¤Þ¤¹¡§
-
-@multitable @columnfractions .2 .2 .6
-@item @code{SET} @strong{member} @tab @strong{10¿Ê¿ô} @tab @strong{£²¿Ê¿ôÃÍ}
-@item @code{a} @tab @code{1} @tab @code{0001}
-@item @code{b} @tab @code{2} @tab @code{0010}
-@item @code{c} @tab @code{4} @tab @code{0100}
-@item @code{d} @tab @code{8} @tab @code{1000}
-@end multitable
-
-¤â¤·¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ë @code{9} ¤òÍ¿¤¨¤¿¾ì¹ç¡¢¤³¤ì¤Ï£²¿Ê¿ô¤Ç @code{1001} ¤Ç¤¹¤«¤é¡¢
-1 ÈÖÌÜ¤È 4 ÈÖÌܤΠ@code{SET} ¥á¥ó¥Ð¡¼¤Ç¤¢¤ë @code{"a"} ¤È @code{"d"} ¤¬
-ÁªÂò¤µ¤ì¡¢·ë²Ì¡¢ @code{"a,d"} ¤È¤Ê¤ê¤Þ¤¹¡£
-
-1¤Ä°Ê¾å¤Î @code{SET} Í×ÁǤò´Þ¤àÃͤˤª¤¤¤Æ¤Ï,¤¢¤Ê¤¿¤¬ÃͤòÁÞÆþ¤¹¤ë¤È¤­,Í×ÁǤ¬¤É¤ó¤Ê
-½ç½ø¤Çµ­ºÜ¤µ¤ì¤Æ¤¤¤ë¤Î¤«¤Ï½ÅÍפǤϤ¢¤ê¤Þ¤»¤ó. ¤Þ¤¿,²¿²óÍ×ÁǤ¬Í¿¤¨¤é¤ì¤¿¤Î¤«¤Ï
-½ÅÍפǤϤ¢¤ê¤Þ¤»¤ó. ¸å¤ÇÃͤ¬¸¡º÷¤µ¤ì¤ë¤È¤­, ÃͤÎÃæ¤Î¤½¤ì¤¾¤ì¤ÎÍ×ÁǤÏ
-¤¿¤À°ì²ó¤À¤±É½¤ì¤Þ¤¹¡£¤½¤Î¤È¤­¡¢¥Æ¡¼¥Ö¥ëºîÀ®»þ¤ËÍ¿¤¨¤é¤ì¤¿½ç¤ËÍ×ÁǤÏʤӤޤ¹¡£
-Î㤨¤Ð¡¢¥Õ¥£¡¼¥ë¥É¤¬ @code{SET("a","b","c","d")} ¤ÈÀßÄꤵ¤ì¤Æ¤¤¤¿¤Ê¤é¡¢
-@code{"a,d"}, @code{"d,a"}, @code{"d,a,a,d,d"} ¤Ï¸¡º÷¤µ¤ì¤ë¤È @code{"a,d"} ¤È
-¤Ê¤ê¤Þ¤¹¡£
-
-@code{SET} ÃͤϿôÃͤȤ·¤ÆÂåÆþ¤µ¤ì¤Þ¤¹¡£
-@code{NULL} ÃͤÏÈó @code{NULL} @code{SET} ÃͤÎÁ°¤Ë¥½¡¼¥È¤µ¤ì¤Þ¤¹¡£
-
-Ä̾@code{LIKE} ¤« @code{FIND_IN_SET()} ¤ò»ÈÍѤ·¤Æ @code{SET} ¥Õ¥£¡¼¥ë¥É
-¤Î @code{SELECT} ¤ò¹Ô¤¤¤Þ¤¹¡§
-
-@example
-mysql> SELECT * FROM tbl_name WHERE set_col LIKE '%value%';
-mysql> SELECT * FROM tbl_name WHERE FIND_IN_SET('value',set_col)>0;
-@end example
-
-¤·¤«¤·¡¢°Ê²¼¤âÆ°ºî¤·¤Þ¤¹¡§
-
-@example
-mysql> SELECT * FROM tbl_name WHERE set_col = 'val1,val2';
-mysql> SELECT * FROM tbl_name WHERE set_col & 1;
-@end example
-
-ºÇ½é¤Îʸ¤Ï´°Á´°ìÃפ¹¤ë¤â¤Î¤òõ¤·¤Þ¤¹¡£
-Æó¤ÄÌܤÏÂè°ìÈÖÌܤΥá¥ó¥Ð¡¼¤ò´Þ¤àÃͤòõ¤·¤Þ¤¹¡£
-
-¤â¤· @code{SET} ¥Õ¥£¡¼¥ë¥É¤ÇÀßÄê²Äǽ¤Ê¤¹¤Ù¤Æ¤Î¥á¥ó¥Ð¡¼¤òÃΤꤿ¤¤¾ì¹ç¡§
- @code{SHOW COLUMNS FROM table_name LIKE set_column_name} ¤È¤·¡¢
-£²ÈÖÌܤˤ¢¤é¤ï¤µ¤ì¤ë @code{SET} ÄêµÁ¤òʬÀϤ·¤Þ¤¹¡£
-
-@cindex Types, choosing
-@cindex Choosing types
-@node Choosing types, Indexes, String types, Column types
-@subsection Àµ¤·¤¤¥Õ¥£¡¼¥ë¥É·¿¤ÎÁªÂò
-
-¤â¤Ã¤È¤â¸úΨ¤è¤¯³ÊǼ¤¹¤ë¤Ë¤Ï¡¢Á´¤Æ¤Ë¤ª¤¤¤Æ°ìÈÖÀµ³Î¤Ê·¿¤ò»ÈÍѤ¹¤ë¤³¤È¤Ç¤¹¡£
-Î㤨¤Ð¡¢@code{1}-@code{99999} ¤ÎÀ°¿ô
-¤Ë¤Ï¡¢@code{MEDIUMINT UNSIGNED} ¤¬ºÇÎɤη¿¤Ç¤¹¡£
-
-Îɤ¯¤¢¤ëÌäÂê¤Ï¡¢²ßʾ¤ÎÃͤÎÀµ³Î¤Êɽ¸½¤Ç¤¹¡£@strong{MySQL} ¤Ç¤Ï
-@code{DECIMAL} ·¿¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£¤³¤ì¤Ïʸ»úÎó¤È¤·¤Æ³ÊǼ¤·¡¢Àµ³Î¤µ¤Î¥í
-¥¹¤ÏȯÀ¸¤·¤Þ¤»¤ó¡£Àµ³Î¤µ¤¬½ÅÍפǤʤ¤¾ì¹ç¤Ï @code{DOUBLE} ·¿¤Ç¤â½½Ê¬Îɤ¤
-¤Ç¤¹¡£
-
-¹âÀºÅ٤Τ¿¤á¡¢¾ï¤Ë @code{BITINT} ¤Ë³ÊǼ¤µ¤ì¤ë¸ÇÄê¾®¿ôÅÀ·¿¤ËÊÑ´¹¤Ç¤­¤Þ¤¹¡£
-¤³¤ì¤Ï¡¢Á´¤Æ¤Î·×»»¤òÀ°¿ô¤Ç¹Ô¤Ê¤¦¤è¤¦¤Ë¤·¡¢·ë²Ì¤À¤±¤òÉâÆ°¾®¿ôÅÀ¤ËÊÑ´¹¤·¤Æ
-Ìᤷ¤Þ¤¹¡£
-
-@cindex Indexes
-@cindex Keys
-@node Indexes, Multiple-column indexes, Choosing types, Column types
-@subsection ¥Õ¥£¡¼¥ë¥É¥¤¥ó¥Ç¥Ã¥¯¥¹
-
-@strong{MySQL} ¤ÎÁ´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-ŬÀڤʥե£¡¼¥ë¥É¤Ç¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î»ÈÍѤϡ¢@code{SELECT} ¤Î
-À­Ç½¤ò¸þ¾å¤¹¤ëºÇÎɤÎÊýË¡¤Ç¤¹¡£
-
-°ì¤Ä¤Î¥Æ¡¼¥Ö¥ë¤Ë¤ÏºÇÂç16¸Ä¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬µö¤µ¤ì¤Þ¤¹¡£
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎºÇÂçŤÏ256¥Ð¥¤¥È¤Ç¡¢
-¤³¤ì¤Ï @strong{MySQL} ¥³¥ó¥Ñ¥¤¥ë»þ¤ËÊѹ¹¤Ç¤­¤Þ¤¹¡£
-
-@code{CHAR} ¤È @code{VARCHAR} ¥Õ¥£¡¼¥ë¥É¤Ë¤ÏÀÜƬÉô¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¥Õ¥£¡¼¥ë¥ÉÁ´ÂΤò¥¤¥ó¥Ç¥Ã¥¯¥¹²½¤¹¤ë¤è¤ê¡¢
-¤³¤ì¤Ï¤Ï¤ë¤«¤ËÁ᤯¡¢¾¯¤Ê¤¤¥Ç¥£¥¹¥¯ÍÆÎ̤ǤǤ­¤Þ¤¹¡£
-
-@code{CREATE TABLE} ¹½Ê¸¤Ç¥Õ¥£¡¼¥ë¥É¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤òºî¤ë¤Ë¤Ï¡¢
-°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-
-@example
-KEY index_name (col_name(length))
-@end example
-
-°Ê²¼¤ÎÎã¤Ï @code{name} ¥Õ¥£¡¼¥ë¥É¤ÎºÇ½é¤Î10ʸ»ú¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÁϤê½Ð¤·¤Þ¤¹:
-
-@example
-mysql> CREATE TABLE test (
- name CHAR(200) NOT NULL,
- KEY index_name (name(10)));
-@end example
-
- @code{BLOB} ¤È @code{TEXT} ¥Õ¥£¡¼¥ë¥É¤Ç¤Ï¡¢¤½¤Î¥Õ¥£¡¼¥ë¥É¤ÎƬ¤ÎÉôʬ¤Ë
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÄ¥¤é¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£ ¥Õ¥£¡¼¥ë¥É¤ÎÁ´ÂΤ˥¤¥ó¥Ç¥Ã¥¯¥¹¤ÏÄ¥¤ì¤Þ¤»¤ó¡£
-
-
-@node Multiple-column indexes, Other-vendor column types, Indexes, Column types
-@subsection Ê£¿ô¥Õ¥£¡¼¥ë¥É¥¤¥ó¥Ç¥Ã¥¯¥¹
-
-@strong{MySQL} ¤Ï°Û¤Ê¤ë¥Õ¥£¡¼¥ë¥É¤Î¥»¥Ã¥È¤Ë°ì¤Ä¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÏºÇÂç15¸Ä¤Î¥³¥é¥à¤Þ¤Çµö¤µ¤ì¤Þ¤¹¡£
-(@code{CHAR} ¤È @code{VARCHAR} ¥Õ¥£¡¼¥ë¥É¤ÎÀÜƬÉô¤ò¥¤¥ó¥Ç¥Ã¥¯¥¹¤È¤·¤Æ»ÈÍѤǤ­¤Þ¤¹)
-
-Ê£¿ô¥Õ¥£¡¼¥ë¥É¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï¡¢
-¥½¡¼¥È¤µ¤ì¤¿ÇÛÎó(¥¤¥ó¥Ç¥Ã¥¯¥¹²½¤µ¤ì¤¿¥Õ¥£¡¼¥ë¥É¤ÎÃͤ¬·ë¹ç¤µ¤ì¤Æ¤¤¤ëÇÛÎó)
-¡¡¤ò°·¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-¥¤¥ó¥Ç¥Ã¥¯¥¹²½¤µ¤ì¤¿¥³¥é¥à¤ËÂФ·¤Æ¡¢´ûÃΤÎÃͤò @code{WHERE} Àá¤Ç»ØÄꤷ¤¿»þ¡¢
-¤¿¤È¤¨Â¾¤Î¥Õ¥£¡¼¥ë¥É¤ÎÃͤò»ØÄꤷ¤Ê¤¯¤È¤â¡¢
-@strong{MySQL} ¤ÏÊ£¿ô¥Õ¥£¡¼¥ë¥É¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ·¤Þ¤¹¡£
-
-°Ê²¼¤Î¥Æ¡¼¥Ö¥ë¤¬¤¢¤ë¤È²¾Äꤷ¤Æ¤¯¤À¤µ¤¤¡§
-
-@example
-mysql> CREATE TABLE test (
- id INT NOT NULL,
- last_name CHAR(30) NOT NULL,
- first_name CHAR(30) NOT NULL,
- PRIMARY KEY (id),
- INDEX name (last_name,first_name));
-@end example
-
-@code{name} ¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï¡¢@code{last_name} ¤È @code{first_name} ¤Ë¤Þ¤¿¤¬¤ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ç¤¹¡£
-¤³¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï¡¢@code{last_name} ¤ËÂФ¹¤ë¥¯¥¨¥ê¤ä¡¢
-@code{name} ¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï°Ê²¼¤Î¥¯¥¨¥ê¤Ç»È¤ï¤ì¤Þ¤¹¡§
-
-@example
-mysql> SELECT * FROM test WHERE last_name="Widenius";
-
-mysql> SELECT * FROM test WHERE last_name="Widenius"
- AND first_name="Michael";
-
-mysql> SELECT * FROM test WHERE last_name="Widenius"
- AND (first_name="Michael" OR first_name="Monty");
-
-mysql> SELECT * FROM test WHERE last_name="Widenius"
- AND first_name >="M" AND first_name < "N";
-@end example
-
-¤·¤«¤· @code{name} ¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï°Ê²¼¤Î¥¯¥¨¥ê¤Ç¤Ï»ÈÍѤµ¤ì¤Þ¤»¤ó:
-
-@example
-mysql> SELECT * FROM test WHERE first_name="Michael";
-
-mysql> SELECT * FROM test WHERE last_name="Widenius"
-¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡OR first_name="Michael";
-@end example
-
-@strong{MySQL} ¤¬¥¯¥¨¥ê¤ÎÀ­Ç½¤ò¾å¤²¤ë¤¿¤á¤Ë¤É¤¦¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ·¤Æ¤¤¤ë¤«¡¢
-¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï¤³¤Á¤é¡§ @ref{MySQL indexes, , @strong{MySQL} indexes}.
-
-
-@cindex Type portability
-@node Other-vendor column types, , Multiple-column indexes, Column types
-@subsection ¾¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥¨¥ó¥¸¥ó¤Î¥Õ¥£¡¼¥ë¥É·¿¤Î»ÈÍÑ
-
-¤Û¤«¤Î¥Ù¥ó¥À¡¼¤«¤éSQL¤ò´Êñ¤Ë½ñ¤±¤ì¤ë¤è¤¦¤Ë¡¢ @strong{MySQL} ¤Ï°Ê²¼¤Îɽ¤Ë
-¤·¤á¤¹¥Õ¥£¡¼¥ë¥É·¿¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£¤³¤ì¤é¤Ï¡¢¥Æ¡¼¥Ö¥ë¤ÎÄêµÁ¤ò¡¢
-¾¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥¨¥ó¥¸¥ó¤«¤é @strong{MySQL} ¤Ë´Êñ¤Ë°Ü¹Ô¤µ¤»¤Æ¤¯¤ì¤Þ¤¹¡§
-
-@multitable @columnfractions .4 .6
-@item @strong{Other vendor type} @tab @strong{MySQL type}
-@item @code{BINARY(NUM)} @tab @code{CHAR(NUM) BINARY}
-@item @code{CHAR VARYING(NUM)} @tab @code{VARCHAR(NUM)}
-@item @code{FLOAT4} @tab @code{FLOAT}
-@item @code{FLOAT8} @tab @code{DOUBLE}
-@item @code{INT1} @tab @code{TINYINT}
-@item @code{INT2} @tab @code{SMALLINT}
-@item @code{INT3} @tab @code{MEDIUMINT}
-@item @code{INT4} @tab @code{INT}
-@item @code{INT8} @tab @code{BIGINT}
-@item @code{LONG VARBINARY} @tab @code{MEDIUMBLOB}
-@item @code{LONG VARCHAR} @tab @code{MEDIUMTEXT}
-@item @code{MIDDLEINT} @tab @code{MEDIUMINT}
-@item @code{VARBINARY(NUM)} @tab @code{VARCHAR(NUM) BINARY}
-@end multitable
-
-¤â¤·Â¾¤Î¥Ù¥ó¥À¡¼¤Î·¿¤ò»ÈÍѤ·¤Æ¥Æ¡¼¥Ö¥ë¤òºî¤í¤¦¤È¤¹¤ë¤È¡¢
-¥Æ¡¼¥Ö¥ëºîÀ®»þ¤Î¥Õ¥£¡¼¥ë¥É¤Î·¿¤Î¥Þ¥Ã¥Ô¥ó¥°¤¬È¯À¸¤·¡¢
-@code{DESCRIBE tbl_name} ¹½Ê¸¤òȯ¹Ô¤·¤Þ¤¹¡£
-¤½¤·¤Æ @strong{MySQL} ¤Ï¡¢»ÈÍѤµ¤ì¤¿·¿¤ÈÅù²Á¤Ê @strong{MySQL} ¤Î·¿¤òÍѤ¤¤Æ
-¥Æ¡¼¥Ö¥ë¤ò¹½À®¤·¤¿¤³¤È¤ò¹ð¤²¤Þ¤¹¡£
-
-@cindex Functions for @code{SELECT} and @code{WHERE} clauses
-@node Functions, CREATE DATABASE, Column types, Reference
-@section @code{SELECT} ¤È @code{WHERE} Àá¤Ç»ÈÍѤ¹¤ë´Ø¿ô
-
-SQL ¥¹¥Æ¡¼¥È¥á¥ó¥ÈÃæ¤Î @code{select_expression} ¤Þ¤¿¤Ï
-@code{where_definition} ¤Ï¸å½Ò¤Î´Ø¿ô¤ò»ÈÍѤ·¤¿Ç¤°Õ¤Î¼°¤«¤é¤Ê¤ê¤Þ¤¹¡£
-
-±é»»¤È´Ø¿ô¤ò¼°¤ÎÃæ¤Ç¸Æ¤Ö»þ¡¢Ëܥɥ­¥å¥á¥ó¥È¤Ë¼¨¤·¤Æ¤¤¤ë¤â¤Î°Ê³°¤Î¡¢
-@code{NULL} ¤ò´Þ¤à¼°¤Ï¾ï¤Ë @code{NULL} ÃͤòÀ¸À®¤·¤Þ¤¹
-
-@strong{Ãí°Õ:} ´Ø¿ô̾¤È¤½¤ì¤Ë³¤¯¸ì¶ç¤Î´Ö¤Ë¤Ï¡¢¶õÇò¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-¤³¤ì¤Ï´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤È¡¢´Ø¿ô¤ÈƱ̾¤Î¥Æ¡¼¥Ö¥ë(¤«¥Õ¥£¡¼¥ë¥É)¤Î»²¾È¤ò¡¢
- @strong{MySQL} ¥Ñ¡¼¥µ¤¬¶èÊ̤¹¤ë¤Î¤ò½õ¤±¤Þ¤¹¡£
-
-@need 2000
-¼¡¤ÎÎã¤Ç¤Ï¡¢@code{mysql} ¥×¥í¥°¥é¥à¤Î½ÐÎϤÏû¤¯¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£¤Ä¤Þ¤ê:
-
-@example
-mysql> select MOD(29,9);
-1 rows in set (0.00 sec)
-
-+-----------+
-| mod(29,9) |
-+-----------+
-| 2 |
-+-----------+
-@end example
-
-¤³¤ì¤Ï¼¡¤ËÊÑ´¹¤µ¤ì¤Æ¤¤¤Þ¤¹:
-
-@example
-mysql> select MOD(29,9);
- -> 2
-@end example
-
-@menu
-* Grouping functions:: Grouping functions
-* Arithmetic functions:: Normal arithmetic operations
-* Bit functions:: Bit functions
-* Logical functions:: Logical operations
-* Comparison functions:: Comparison operators
-* String comparison functions:: String comparison functions
-* Control flow functions:: Control flow functions
-* Casts:: Cast operators
-* Mathematical functions:: Mathematical functions
-* String functions:: String functions
-* Date and time functions:: Date and time functions
-* Miscellaneous functions:: Miscellaneous functions
-* Group by functions:: Functions for @code{GROUP BY} clause
-@end menu
-
-@node Grouping functions, Arithmetic functions, Functions, Functions
-@subsection ¥°¥ë¡¼¥×²½´Ø¿ô
-@cindex Grouping of expressions
-@table @code
-
-@findex () (parentheses)
-@findex parentheses ( and )
-@item ( ... )
-´Ý¤«¤Ã¤³¡£ ¼°¤Îɾ²Á¤ÎÍ¥ÀèÅÙ¤ò¶¯À©¤¹¤ë¤¿¤á¤Ë»ÈÍѤ·¤Þ¤¹¡£
-@example
-mysql> select 1+2*3;
- -> 7
-mysql> select (1+2)*3;
- -> 9
-@end example
-@end table
-
-@node Arithmetic functions, Bit functions, Grouping functions, Functions
-@subsection Ä̾ï¤Î»»½Ñ±é»»
-
-ÉáÄ̤λ»½Ñ±é»»¤¬Í­¸ú¤Ç¤¹¡£
-@code{-}, @code{+}, @code{*} ¤Ï¡¢Æó¤Ä¤Î°ú¿ô¤¬Àµ¿ô¤Ê¤é¤Ð
- @code{BIGINT} (64bitÀºÅÙ) ¤Ç·×»»¤µ¤ì¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡ª
-
-@cindex Arithmetic expressions
-@table @code
-@findex + (addition)
-@findex addition (+)
-@item +
-­¤·»»
-@example
-mysql> select 3+5;
- -> 8
-@end example
-
-@findex - (subtraction)
-@findex subtraction (-)
-@item -
-°ú¤­»»
-@example
-mysql> select 3-5;
- -> -2
-@end example
-
-@findex * (multiplication)
-@findex multiplication (*)
-@item *
-³Ý¤±»»
-@example
-mysql> select 3*5;
- -> 15
-mysql> select 18014398509481984*18014398509481984.0;
- -> 324518553658426726783156020576256.0
-mysql> select 18014398509481984*18014398509481984;
- -> 0
-@end example
-
-ºÇ¸å¤Î¼°¤Î·ë²Ì¤ÏÉÔÅö¤Ç¤¹¡£¤Ê¤¼¤Ê¤é·ë²Ì¤Ï 64 ¥Ó¥Ã¥È¤òĶ¤¨¤¿À°¿ô¤À¤«¤é¤Ç¤¹¡£
-
-@findex / (division)
-@findex division (/)
-@item /
-³ä¤ê»»¡£
-@example
-mysql> select 3/5;
- -> 0.60
-@end example
-
-0 ¤Ç³ä¤Ã¤¿¾ì¹ç¡¢@code{NULL} ¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-@example
-mysql> select 102/(1-1);
- -> NULL
-@end example
-
-±é»»·ë²Ì¤¬À°¿ô¤Ë¤Ê¤ë¾ì¹ç¤Ë¤À¤±¡¢ @code{BIGINT} ¤òÍѤ¤¤Æ³ä¤ê»»¤Ï·×»»¤µ¤ì¤Þ¤¹¡£
-@end table
-
-@findex Arithmetic functions
-@findex Bit functions
-@findex Functions, arithmetic
-@findex Functions, bit
-@node Bit functions, Logical functions, Arithmetic functions, Functions
-@subsection ¥Ó¥Ã¥È´Ø¿ô
-
-¤³¤ì¤é¤ÏºÇÂç 64 ¥Ó¥Ã¥È¤ÎÈϰϤò»ý¤Á¤Þ¤¹¡£@strong{MySQL} ¤Ï @code{BIGINT} (64-bit) ±é»»¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ç¤¹¡£
-
-@table @code
-@findex | (bitwise OR)
-@findex OR, bitwise
-@item |
-¥Ó¥Ã¥È±é»» OR
-@example
-mysql> select 29 | 15;
- -> 31
-@end example
-
-@findex & (bitwise AND)
-@findex AND, bitwise
-@item &
-¥Ó¥Ã¥È±é»» AND
-@example
-mysql> select 29 & 15;
- -> 13
-@end example
-
-@findex << (left shift)
-@item <<
-º¸¤Ë longlong (@code{BIGINT}) number ʬ¡¢¥Ó¥Ã¥È¤ò¥·¥Õ¥È¤·¤Þ¤¹
-@example
-mysql> select 1 << 2
- -> 4
-@end example
-
-@findex >> (right shift)
-@item >>
-±¦¤Ë longlong (@code{BIGINT}) number ʬ¡¢¥Ó¥Ã¥È¤ò¥·¥Õ¥È¤·¤Þ¤¹
-@example
-mysql> select 4 >> 2
- -> 1
-@end example
-
-@findex ~
-@item ~
-Invert all bits.
-@example
-mysql> select 5 & ~1
- -> 4
-@end example
-
-@findex BIT_COUNT()
-@item BIT_COUNT(N)
-°ú¿ô @code{N} ¤¬¤¤¤¯¤Ä¥Ó¥Ã¥È¤ò»ý¤Ã¤Æ¤¤¤ë¤«(£²¿Ê¿ôɽµ­¤·¤¿¤È¤­¤Î£±¤Î¿ô)
-@example
-mysql> select BIT_COUNT(29);
- -> 4
-@end example
-@end table
-
-@findex Logical functions
-@node Logical functions, Comparison functions, Bit functions, Functions
-@subsection ÏÀÍý±é»»
-
-Á´¤Æ¤ÎÏÀÍý´Ø¿ô¤Ï @code{1} (TRUE) or @code{0} (FALSE) ¤òÊÖ¤·¤Þ¤¹¡£
-
-@table @code
-@findex NOT, logical
-@findex ! (logical NOT)
-@item NOT
-@itemx !
-ÏÀÍýÈÝÄê¡£°ú¿ô¤¬ @code{0} ¤Ê¤é @code{1} ¤òÊÖ¤·¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @code{0} ¤òÊÖ¤·¤Þ¤¹¡£
-Îã³°: @code{NOT NULL} ¤Ï @code{NULL} ¤òÊÖ¤·¤Þ¤¹.
-@example
-mysql> select NOT 1;
- -> 0
-mysql> select NOT NULL;
- -> NULL
-mysql> select ! (1+1);
- -> 0
-mysql> select ! 1+1;
- -> 1
-@end example
-ºÇ¸å¤ÎÎã¤Ï @code{1} ¤òÊÖ¤·¤Þ¤¹¡£¤Ê¤¼¤Ê¤é¡¢¼°¤Îɾ²Á¤¬
- @code{(!1)+1} ¤ÈƱ¤¸¤À¤«¤é¤Ç¤¹¡£
-
-@findex OR, logical
-@findex || (logical OR)
-@item OR
-@itemx ||
-ÏÀÍýÏ¡£°ú¿ô¤Î¤É¤ì¤«¤¬ @code{0} ¤Þ¤¿¤Ï @code{NULL} ¤Ç¤Ê¤±¤ì¤Ð @code{1} ¤òÊÖ¤·¤Þ¤¹¡£
-@example
-mysql> select 1 || 0;
- -> 1
-mysql> select 0 || 0;
- -> 0
-mysql> select 1 || NULL;
- -> 1
-
-@end example
-
-@findex AND, logical
-@findex && (logical AND)
-@item AND
-@itemx &&
-ÏÀÍýÀÑ¡£Á´¤Æ¤Î°ú¿ô¤¬ @code{0} ¤Þ¤¿¤Ï @code{NULL} ¤Ç¤Ê¤±¤ì¤Ð @code{1} ¤òÊÖ¤·¤Þ¤¹¡£
-@example
-mysql> select 1 && NULL;
- -> 0
-mysql> select 1 && 0;
- -> 0
-@end example
-@end table
-
-@cindex Casts
-@cindex Type conversions
-@findex Comparison operators
-@node Comparison functions, String comparison functions, Logical functions, Functions
-@subsection Èæ³Ó±é»»»Ò
-
-@code{1} (TRUE), @code{0} (FALSE) ¤Þ¤¿¤Ï @code{NULL} ¤òÊÖ¤·¤Þ¤¹¡£
-¤³¤ì¤é¤Î´Ø¿ô¤Ï¿ôÃͤÈʸ»úÎó¤ÎξÊý¤ÇƯ¤­¤Þ¤¹¡£
-ɬÍפʤé¤Ð¡¢Ê¸»ú¤Ï¼«Æ°Åª¤Ë¿ô»ú¤ËÊÑ´¹¤µ¤ì¡¢¿ô»ú¤Ïʸ»ú¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£
-(Perl¤¬¤ª¤³¤Ê¤Ã¤Æ¤¤¤ë¤ß¤¿¤¤¤Ë)
-
-@strong{MySQL} ¤Ï°Ê²¼¤Îµ¬Â§¤ÇÈæ³Ó¤ò¹Ô¤¤¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-¤É¤Á¤é¤«¤Þ¤¿¤ÏξÊý¤Î°ú¿ô¤¬ @code{NULL} ¤Î¾ì¹ç¤Ï¡¢Èæ³Ó·ë²Ì¤Ï @code{NULL}
-¤Ç¤¹¡£@code{<=>} ±é»»»Ò¤ò½ü¤­¤Þ¤¹¡£
-
-@item
-Èæ³ÓÁàºî¤ÎξÊý¤Î°ú¿ô¤¬Ê¸»úÎó¤Î¾ì¹ç¡¢Ê¸»úÎó¤È¤·¤ÆÈæ³Ó¤µ¤ì¤Þ¤¹¡£
-
-@item
-ξÊý¤Î°ú¿ô¤¬À°¿ô¤Î¾ì¹ç¡¢À°¿ô¤È¤·¤ÆÈæ³Ó¤µ¤ì¤Þ¤¹¡£
-
-@item
-16¿Ê¿ô¤ÎÃͤϡ¢¤â¤·¿ôÃͤÈÈæ³Ó¤µ¤ì¤Ê¤¤¤Î¤Ç¤¢¤ì¤Ð¡¢Ê¸»úÎó¤È¤·¤Æ°·¤ï¤ì¤Þ¤¹¡£
-
-@item
-@cindex ODBC compatibility
-@cindex Compatibility, with ODBC
-°ú¿ô¤Î°ìÊý¤¬ @code{TIMESTAMP} ¤Þ¤¿¤Ï @code{DATETIME} ¥Õ¥£¡¼¥ë¥É¤Ç¡¢Â¾¤Î°ú¿ô¤¬
-Äê¿ô¤Î¾ì¹ç¤Ï¡¢Äê¿ô¤ÏÈæ³ÓÁ°¤Ë timestamp ¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£¤³¤ì¤Ï¤è¤ê ODBC
-¥Õ¥ì¥ó¥É¥ê¤Ë¤¹¤ë¤¿¤á¤Ç¤¹¡£
-
-@item
-¾¤Î¾ì¹ç¤ÏÁ´¤ÆÉâÆ°¾®¿ôÅÀ(real)¤È¤·¤ÆÈæ³Ó¤µ¤ì¤Þ¤¹¡£
-@end itemize
-
-ʸ»úÎó¤ÎÈæ³Ó¤Ï¡¢¥±¡¼¥¹¤Ë°Í¸¤»¤º¡¢É¸½à¤Î¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È¤Ë½¾¤Ã¤Æ
-¹Ô¤ï¤ì¤Þ¤¹¡£(ISO-8859-1 Latin1 ¤¬¥Ç¥Õ¥©¥ë¥È¤Ç¤¹¡£¤³¤ì¤Ï English ¤Ç¤¹)
-
-°Ê²¼¤Ï¡¢Èæ³Ó¤Î¤¿¤á¤Ëʸ»ú¤¬¿ôÃͤØÊÑ´¹¤µ¤ì¤Æ¤¤¤ëÎã¤Ç¤¹¡§
-
-@example
-mysql> SELECT 1 > '6x';
- -> 0
-mysql> SELECT 7 > '6x';
- -> 1
-mysql> SELECT 0 > 'x6';
- -> 0
-mysql> SELECT 0 = 'x6';
- -> 1
-@end example
-
-@table @code
-@findex = (equal)
-@findex equal (=)
-@item =
-Åù¤·¤¤
-@example
-mysql> select 1 = 0;
- -> 0
-mysql> select '0' = 0;
- -> 1
-mysql> select '0.0' = 0;
- -> 1
-mysql> select '0.01' = 0;
- -> 0
-mysql> select '.01' = 0.01;
- -> 1
-@end example
-
-@findex <> (not equal)
-@findex not equal (<>)
-@findex != (not equal)
-@findex not equal (!=)
-@item <>
-@itemx !=
-Åù¤·¤¯¤Ê¤¤
-@example
-mysql> select '.01' <> '0.01';
- -> 1
-mysql> select .01 <> '0.01';
- -> 0
-mysql> select 'zapp' <> 'zappp';
- -> 1
-@end example
-
-@findex <= (less than or equal)
-@findex less than or equal (<=)
-@item <=
-¤è¤ê¾®¤µ¤¤¤«Åù¤·¤¤
-@example
-mysql> select 0.1 <= 2;
- -> 1
-@end example
-
-@findex < (less than)
-@findex less than (<)
-@item <
-¤è¤ê¾®¤µ¤¤
-@example
-mysql> select 2 <= 2;
- -> 1
-@end example
-
-@findex >= (greater than or equal)
-@findex greater than or equal (>=)
-@item >=
-¤è¤êÂ礭¤¤¤«Åù¤·¤¤
-@example
-mysql> select 2 >= 2;
- -> 1
-@end example
-
-@findex > (greater than)
-@findex greater than (>)
-@item >
-¤è¤êÂ礭¤¤
-@example
-mysql> select 2 > 2;
- -> 0
-@end example
-
-@findex <=> (Equal to)
-@item <=>
-Åù¤·¤¤(NULL °ÂÁ´)
-@example
-mysql> select 1 <=> 1, NULL <=> NULL, 1 <=> NULL;
- -> 1 1 0
-@end example
-
-@findex IS NULL
-@findex IS NOT NULL
-@item IS NULL
-@itemx IS NOT NULL
-Ãͤ¬ @code{NULL} ¤È¤Ç¤¢¤ë¤«¤É¤¦¤«¤Î¥Æ¥¹¥È
-@example
-mysql> select 1 IS NULL, 0 IS NULL, NULL IS NULL:
- -> 0 0 1
-mysql> select 1 IS NOT NULL, 0 IS NOT NULL, NULL IS NOT NULL;
- -> 1 1 0
-@end example
-
-@findex BETWEEN ... AND
-@item expr BETWEEN min AND max
-¤â¤· @code{expr} ¤¬ @code{min} °Ê¾å¡¢ @code{max} °Ê²¼¤Ê¤é @code{1}¤òÊÖ¤·¤Þ¤¹¡£
-¤½¤¦¤Ç¤Ê¤¤¤Ê¤é @code{0} ¤òÊÖ¤·¤Þ¤¹¡£
-¤³¤ì¤Ï Á´¤Æ¤Î°ú¿ô¤¬Æ±¤¸·¿¤Ê¤é¤Ð¡¢@code{(min <= expr AND expr <= max)} ¤ÈƱ¤¸¤Ç¤¹¡£
- ºÇ½é¤Î°ú¿ô (@code{expr}) ¤Ï¤¤¤«¤Î¤è¤¦¤ËÈæ³ÓÊýË¡¤ò·èÄꤷ¤Þ¤¹¡£
-
-@itemize @bullet
-@item
-¤â¤· @code{exor} ¤¬ @code{TIMESTAMP}, @code{DATE}, @code{DATETIME} ¥Õ¥£¡¼
-¥ë¥É¤Ê¤é¡¢ºÇ¾®¤ÈºÇÂç¤Ï¤½¤ì¤é¤¬Äê¿ô¤Î¾ì¹ç¤ÈƱ¤¸¥Õ¥©¡¼¥Þ¥Ã¥È¤Ë¤Ê¤ê¤Þ¤¹¡£
-@item
-¤â¤· @code{expr} ¤¬Ê¸»ú¼°¤Ê¤é¡¢¥±¡¼¥¹Èó°Í¸¤ÇÈæ³Ó¤¬¹Ô¤ï¤ì¤Þ¤¹¡£
-@item
-¤â¤· @code{expr} ¤¬¥Ð¥¤¥Ê¥êʸ»ú¤Ê¤é¡¢¥±¡¼¥¹°Í¸¤ÇÈæ³Ó¤¬¹Ô¤ï¤ì¤Þ¤¹¡£
-@item
-¤â¤· @code{expr} ¤¬À°¿ô¤Ê¤é¡¢À°¿ô¤ÇÈæ³Ó¤¬¹Ô¤ï¤ì¤Þ¤¹¡£
-@item
-¤½¤Î¾¤ÏÉâÆ°¾®¿ôÅÀ(¼Â¿ô)¤ÇÈæ³Ó¤µ¤ì¤Þ¤¹¡£
-@end itemize
-
-@example
-mysql> select 1 BETWEEN 2 AND 3;
- -> 0
-mysql> select 'b' BETWEEN 'a' AND 'c';
- -> 1
-mysql> select 2 BETWEEN 2 AND '3';
- -> 1
-mysql> select 2 BETWEEN 2 AND 'x-3';
- -> 0
-@end example
-
-@findex IN
-@item expr IN (value,...)
-¤â¤· @code{expr} ¤¬ @code{IN} ¥ê¥¹¥È¤Ë¤¢¤ëÃͤΤɤ줫¤Ê¤é¤Ð¡¢@code{1} ¤òÊÖ¤·¤Þ¤¹¡£
-¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @code{0} ¤òÊÖ¤·¤Þ¤¹¡£
-¤â¤·Á´¤Æ¤ÎÃͤ¬Äê¿ô¤Ê¤é¡¢¤¹¤Ù¤Æ¤ÎÃͤ¬ @code{expr} ¤Î·¿¤Ë½¾¤Ã¤Æɾ²Á¤µ¤ì¡¢
-¥½¡¼¥È¤µ¤ì¤Þ¤¹¡£¤³¤Î¸¡º÷¤Ë¤Ï¥Ð¥¤¥Ê¥ê¥µ¡¼¥Á¤¬»ÈÍѤµ¤ì¤Þ¤¹¡£
-¤³¤ì¤Ï @code{IN} ¥ê¥¹¥È¤ËÄê¿ô¤òÍ¿¤¨¤¿¾ì¹ç¡¢@code{IN} ¤¬Â®¤¯¤Ê¤ë¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£
-¤â¤· @code{expr} ¤¬¥±¡¼¥¹°Í¸¤Îʸ»ú¼°¤Ê¤é¡¢¥±¡¼¥¹°Í¸¤Î¤ä¤êÊý¤ÇÈæ³Ó¤µ¤ì¤Þ¤¹¡£
-@example
-mysql> select 2 IN (0,3,5,'wefwf');
- -> 0
-mysql> select 'wefwf' IN (0,3,5,'wefwf');
- -> 1
-@end example
-
-@findex NOT IN
-@item expr NOT IN (value,...)
-@code{NOT (expr IN (value,...))} ¤ÈƱ¤¸¡£
-
-@findex ISNULL()
-@item ISNULL(expr)
-@code{expr} ¤¬ @code{NULL} ¤Ê¤é @code{1} ¤ò¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @code{0} ¤òÊÖ¤·¤Þ¤¹¡£
-@example
-mysql> select ISNULL(1+1);
- -> 0
-mysql> select ISNULL(1/0);
- -> 1
-@end example
-
-@code{NULL} ¤ÎÃͤò @code{=} ¤ò»ÈÍѤ·¤ÆÈæ³Ó¤·¤¿¾ì¹ç¤Ï¾ï¤Ëµ¶(false) ¤È¤Ê¤ë¤³¤È¤Ë
-Ãí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡ª
-
-@findex COALESCE()
-@item COALESCE(list)
-list Ãæ¤Î¡¢ºÇ½é¤Ë¸½¤ì¤¿ Èó-@code{NULL} Í×ÁǤòÊÖ¤·¤Þ¤¹¡£
-
-@example
-mysql> select COALESCE(NULL,1);
- -> 1
-mysql> select COALESCE(NULL,NULL,NULL);
- -> NULL
-@end example
-
-@findex INTERVAL()
-@item INTERVAL(N,N1,N2,N3,...)
-¤â¤· @code{N} < @code{N1} ¤Ê¤é @code{0} ¤òÊÖ¤·¤Þ¤¹¡£
-¤â¤· @code{N} < @code{N2} ¤Ê¤é @code{1} ¤òÊÖ¤·¤Þ¤¹¡£
-Á´¤Æ¤Î°ú¿ô¤ÏÀ°¿ô¤È¤·¤Æ°·¤ï¤ì¤Þ¤¹¡£
-¤³¤ì¤Ï @code{N1} < @code{N2} < @code{N3} < @code{...} < @code{Nn}¤òÀµ¤·¤¯Æ°ºî¤µ¤»¤ë¤¿¤á¤Ë
-ɬÍפʤ³¤È¤Ç¤¹¡£¤³¤ì¤Ï¥Ð¥¤¥Ê¥ê¸¡º÷¤¬»ÈÍѤµ¤ì¤Þ¤¹(®¤¤¤Ç¤¹)
-
-@example
-mysql> select INTERVAL(23, 1, 15, 17, 30, 44, 200);
- -> 3
-mysql> select INTERVAL(10, 1, 10, 100, 1000);
- -> 2
-mysql> select INTERVAL(22, 23, 30, 44, 200);
- -> 0
-@end example
-@end table
-
-@findex String comparison functions
-@findex Functions, string comparison
-@node String comparison functions, Casts, Comparison functions, Functions
-@subsection ʸ»úÎóÈæ³Ó´Ø¿ô
-
-@cindex Case sensitivity, in string comparisons
-@cindex String comparisons, case sensitivity
-Ä̾Èæ³Ó¤µ¤ì¤ëɽ¸½¤¬¥±¡¼¥¹°Í¸¤Ç¤Ê¤¤¾ì¹ç¡¢Èæ³Ó¤Ï¥±¡¼¥¹Èó°Í¸¤Ç¹Ô¤ï¤ì¤Þ¤¹¡£
-
-@table @code
-@findex LIKE
-@item expr LIKE pat [ESCAPE 'escape-char']
-SQL ¤Î´Êñ¤ÊÀµµ¬É½¸½Èæ³Ó¤Ç¤¹¡£@code{1} (TRUE) ¤Þ¤¿¤Ï @code{0} (FALSE) ¤òÊÖ¤·¤Þ¤¹¡£
-@code{LIKE} ¤Ë¤Ï2¤Ä¤Î¥ï¥¤¥ë¥É¥«¡¼¥É¤¬¤¢¤ê¤Þ¤¹:
-
-@multitable @columnfractions .1 .9
-@item @code{%} @tab Ǥ°Õ¤Î¿ô¤Îʸ»ú(0ʸ»ú¤â´Þ¤à)¤ËŬ¹ç¤·¤Þ¤¹¡£
-@item @code{_} @tab ¸·Ì©¤Ë1¤Ä¤Îʸ»ú¤ËŬ¹ç¤·¤Þ¤¹¡£
-@end multitable
-
-@example
-mysql> select 'David!' LIKE 'David_';
- -> 1
-mysql> select 'David!' LIKE '%D%v%';
- -> 1
-@end example
-
-¥ï¥¤¥ë¥É¥«¡¼¥Éʸ»ú¤Î¥Æ¥¹¥È¤ò¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¥¨¥¹¥±¡¼¥×ʸ»ú¤è¤êÀè¹Ô¤·¤Æ¤ª¤³¤Ê¤Ã¤Æ
-¤¯¤À¤µ¤¤¡£
-@code{ESCAPE} ¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¤Ï¡¢Ê¸»ú @code{'\'} ¤¬»È¤ï¤ì¤Þ¤¹:
-
-@multitable @columnfractions .1 .9
-@item @code{\%} @tab 1¤Ä¤Î @code{%} ¤ËŬ¹ç¤·¤Þ¤¹¡£
-@item @code{\_} @tab 1¤Ä¤Î @code{_} ¤ËŬ¹ç¤·¤Þ¤¹¡£
-@end multitable
-
-@example
-mysql> select 'David!' LIKE 'David\_';
- -> 0
-mysql> select 'David_' LIKE 'David\_';
- -> 1
-@end example
-
-°ã¤¦¥¨¥¹¥±¡¼¥×ʸ»ú¤ò»ØÄꤹ¤ë¤Ë¤Ï¡¢ @code{ESCAPE} Àá¤ò»ÈÍѤ·¤Þ¤¹:
-
-@example
-mysql> select 'David_' LIKE 'David|_' ESCAPE '|';
- -> 1
-@end example
-
-@code{LIKE} ¤Ï¿ôÃÍɽ¸½¤Ç¤âµö¤µ¤ì¤Þ¤¹¡ª
-(¤³¤ì¤Ï @strong{MySQL} ¤Î¡¢ANSI SQL @code{LIKE} ¤ËÂФ¹¤ë³ÈÄ¥¤Ç¤¹)
-
-Ãí°Õ¡§ @strong{MySQL} ¤Ïʸ»úÎóÃæ¤Ë C ¤Î¥¨¥¹¥±¡¼¥×ʸ»ú¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Î¤Ç(e.g.,
-@samp{\n}), @code{LIKE} ¤Î»ØÄêʸ»úÎó¤È¤·¤Æ»ÈÍѤ¹¤ë¤Ë¤Ï @samp{\} ¤ò
-ÆóÇܤ·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£ Î㤨¤Ð¡¢ @samp{\n} ¤òõ¤¹¤Ë¤Ï¡¢@samp{\\n} ¤È
-µ­½Ò¤·¤Þ¤¹¡£ @samp{\} ¤òõ¤¹¤Ë¤Ï¡¢ @samp{\\\\} (¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤Ï¡¢
-°ì¤Ä¤Ï¥Ñ¡¼¥µ¡¼¤Ë¼è¤ê½ü¤«¤ì¡¢¥Ñ¥¿¡¼¥ó¥Þ¥Ã¥Á¤¬¹Ô¤ï¤ì¤ëºÝ¤Ë¤â¤¦¤Ò¤È¤Ä
-¼è¤ê½ü¤«¤ì¡¢°ìÃפòõ¤¹¤¿¤á¤Ë»Ä¤Ã¤¿°ì¤Ä¤Î¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤¬»ÈÍѤµ¤ì¤Þ¤¹)
-
-@findex NOT LIKE
-@item expr NOT LIKE pat [ESCAPE 'escape-char']
-@code{NOT (expr LIKE pat [ESCAPE 'escape-char'])} ¤ÈƱ¤¸
-
-@example
-mysql> select 10 LIKE '1%';
- -> 1
-@end example
-
-@cindex mSQL compatibility
-@cindex Compatibility, with mSQL
-@findex REGEXP
-@findex RLIKE
-@item expr REGEXP pat
-@itemx expr RLIKE pat
-¥Ñ¥¿¡¼¥ó @code{pat} ¤ËÂФ·¡¢Ê¸»ú¼° @code{expr} ¤Î¥Ñ¥¿¡¼¥ó¥Þ¥Ã¥Á¤ò¹Ô¤¤¤Þ¤¹¡£
-¥Ñ¥¿¡¼¥ó @code{pat} ¤ÏÀµµ¬É½¸½¤Î³ÈÄ¥¤¬»ÈÍѤǤ­¤Þ¤¹¡£@xref{Regexp}.
-¤â¤· @code{expr} ¤¬ @code{pat} ¤Ë¥Þ¥Ã¥Á¤¹¤ë¤Ê¤é @code{1} ¤òÊÖ¤·¡¢
-¤Ç¤Ê¤±¤ì¤Ð @code{0} ¤òÊÖ¤·¤Þ¤¹¡£
-@code{RLIKE} ¤Ï @code{REGEXP} ¤ÈƱµÁ¤Ç¡¢@code{mSQL} ¸ß´¹¤òÄ󶡤·¤Þ¤¹¡£
-Ãí°Õ: @strong{MySQL} ¤Ï C ¥¨¥¹¥±¡¼¥×¹½Ê¸¤òʸ»úÃæ¤Ë»ÈÍѤ·¤Æ¤ª¤ê(@code{\n})¡¢
- @code{REGEXP} Ãæ¤Ç»ÈÍѤµ¤ì¤ë @code{'\'} ʸ»ú¤Ï¤¹¤Ù¤Æ¡¢Æó½Å¤Ë½ñ¤«¤Ê¤±¤ì¤Ð
-¤Ê¤ê¤Þ¤»¤ó¡£
-@code{MySQL} 3.23.4 @code{REGEXP} ¤Ï¡¢ÉáÄ̤Îʸ»ú (not binary) ¤Ï¥±¡¼¥¹Èó°Í¸¤Ç¤¹¡£
-
-@example
-mysql> select 'Monty!' REGEXP 'm%y%%';
- -> 0
-mysql> select 'Monty!' REGEXP '.*';
- -> 1
-mysql> select 'new*\n*line' REGEXP 'new\\*.\\*line';
- -> 1
-mysql> select "a" REGEXP "A", "a" REGEXP BINARY "A";
- -> 1 0
-@end example
-
-@item
-@code{REGEXP} and @code{RLIKE} ¤Ï¡¢Ê¸»ú¤Î·¿¤ò·èÄꤹ¤ë¾ì¹ç¡¢
-¥«¥ì¥ó¥È¤Î¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È¤ò»ÈÍѤ·¤Þ¤¹¡£
-(ISO-8859-1 Latin1 ¤¬¥Ç¥Õ¥©¥ë¥È)
-
-@findex NOT REGEXP
-@item expr NOT REGEXP pat
-@itemx expr NOT RLIKE pat
-@code{NOT (expr REGEXP pat)} ¤ÈƱ¤¸.
-
-@findex STRCMP()
-@item STRCMP(expr1,expr2)
-ʸ»úÎó¤¬Æ±¤¸¤Ê¤é @code{0} ¤òÊÖ¤·¤Þ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢ºÇ½é¤Î°ú¿ô¤¬¥½¡¼¥È½ç¤Ç¾®
-¤µ¤±¤ì¤Ð @code{-1} ¤òÊÖ¤·¤Þ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @code{1} ¤òÊÖ¤·¤Þ¤¹¡£
-
-@example
-mysql> select STRCMP('text', 'text2');
- -> -1
-mysql> select STRCMP('text2', 'text');
- -> 1
-mysql> select STRCMP('text', 'text');
- -> 0
-@end example
-@end table
-
-@findex Casts
-@node Casts, Control flow functions, String comparison functions, Functions
-@subsection Cast operators
-
-@table @code
-@findex BINARY
-@item @code{BINARY}
-@code{BINARY} ±é»»»Ò¤Ï¡¢¤³¤ì°Ê¹ß¤Ë³¤¯Ê¸»ú¤ò¥Ð¥¤¥Ê¥ê¤Ë¥­¥ã¥¹¥È¤·¤Þ¤¹¡£
-¤³¤ì¤Ï¤¿¤È¤¨¥Õ¥£¡¼¥ë¥É¤¬ @code{BINARY} ¤ä @code{BLOB} ÄêµÁ¤Ç¤Ê¤¯¤Æ¤â¡¢
-¥±¡¼¥¹°Í¸¤Ç¥Õ¥£¡¼¥ë¥É¤òÈæ³Ó¤¹¤ë¤³¤È¤¬½ÐÍè¤ë´Êñ¤ÊÊýË¡¤Ç¤¹¡£
-@example
-mysql> select "a" = "A";
- -> 1
-mysql> select BINARY "a" = "A";
- -> 0
-@end example
-
-@code{BINARY} ¤Ï @strong{MySQL} 3.23.0 ¤ÇÅо줷¤Þ¤·¤¿¡£
-@end table
-
-@findex Control flow functions
-@findex Functions, control flow
-@node Control flow functions, Mathematical functions, Casts, Functions
-@subsection ¥Õ¥í¡¼À©¸æ´Ø¿ô
-
-@table @code
-@findex IFNULL()
-@item IFNULL(expr1,expr2)
-@code{expr1} ¤¬ @code{NULL} ¤Ç¤Ê¤¤¾ì¹ç¤Ï @code{expr1} ¤ò¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð
-@code{expr2} ¤òÊÖ¤·¤Þ¤¹¡£
-@code{IFNULL()} ¤Ï¤É¤Îʸ̮¤Ç»ÈÍѤµ¤ì¤¿¤«¤Ë¤è¤ê¿ôÃͤ«Ê¸»ú¤òÊÖ¤·¤Þ¤¹¡£
-@example
-mysql> select IFNULL(1,0);
- -> 1
-mysql> select IFNULL(0,10);
- -> 0
-mysql> select IFNULL(1/0,10);
- -> 10
-mysql> select IFNULL(1/0,'yes');
- -> 'yes'
-@end example
-
-@findex NULLIF()
-@item NULLIF(expr1,expr2)
-@code{expr1 = expr2} ¤¬¿¿¤Ê¤é¡¢@code{expr1} ¤òÊÖ¤·¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð
-@code{NULL} ¤òÊÖ¤·¤Þ¤¹¡£
-@example
-mysql> select NULLIF(1,1);
- -> 1
-mysql> select NULLIF(1,2);
- -> NULL
-@end example
-
-Ãí°Õ: °ú¿ô¤¬Åù¤·¤¤¾ì¹ç¡¢@code{expr1} ¤Ï @strong{MySQL} ¤Ç¤Ï2²óɾ²Á¤µ¤ì¤Þ¤¹¡£
-
-@findex IF()
-@item IF(expr1,expr2,expr3)
-@code{expr1} ¤¬¿¿ (@code{expr1 <> 0} and @code{expr1 <> NULL}) ¤Î¾ì¹ç
- @code{expr2} ¤òÊÖ¤·¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @code{expr3} ¤òÊÖ¤·¤Þ¤¹¡£
-@code{IF()} ¤Ï¤É¤Îʸ̮¤Ç»ÈÍѤµ¤ì¤¿¤«¤Ë¤è¤ê¿ôÃͤ«Ê¸»ú¤òÊÖ¤·¤Þ¤¹¡£
-
-@example
-mysql> select IF(1>2,2,3);
- -> 3
-mysql> select IF(1<2,'yes','no');
- -> 'yes'
-mysql> select IF(strcmp('test','test1'),'no','yes');
- -> 'no'
-@end example
-
-@code{expr1} ¤Ï @code{INTEGER} ¤È¤·¤Æɾ²Á¤µ¤ì¤Þ¤¹¡£¤³¤ì¤ÏÉâÆ°¾®¿ôÅÀ¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢
-Èæ³Ó±é»»¤â»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ë¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£
-
-@example
-mysql> select IF(0.1,1,0);
- -> 0
-mysql> select IF(0.1<>0,1,0);
- -> 1
-@end example
-
-¾å¤ÎºÇ½é¤ÎÎã¤Ç¤Ï¡¢ @code{IF(0.1)} ¤Ï @code{0} ¤òÊÖ¤·¤Þ¤¹¡£¤Ê¤¼¤Ê¤é @code{0.1} ¤Ï
-À°¿ôÃͤȤ·¤ÆÊÑ´¹¤µ¤ì @code{IF(0)} ¤Ë¤Ê¤ê¡¢¤½¤ì¤ò¤â¤È¤Ë¤·¤¿¥Æ¥¹¥È·ë²Ì¤¬
-Ê֤뤫¤é¤Ç¤¹¡£ ¤³¤ì¤Ï¤¢¤Ê¤¿¤Î´üÂԤ˟¤ï¤Ê¤¤¤«¤â¤·¤ì¤Þ¤»¤ó¡£
- ÆóÈÖÌܤξì¹ç¡¢ Èæ³Ó¤Ï¡¢¸µ¤ÎÉâÆ°¾®¿ôÅÀÃͤ¬Èó¥¼¥í¤«¤É¤¦¤«¥Æ¥¹¥È¤·¤Þ¤¹¡£
-Èæ³Ó·ë²Ì¤ÏÀ°¿ô¤È¤·¤Æ»ÈÍѤµ¤ì¤Þ¤¹¡£
-
-@code{IF()} ¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÌá¤êÃÍ·¿(°ì»þ¥Æ¡¼¥Ö¥ë¤Ë³ÊǼ¤µ¤ì¤ë»þ¤ËÌäÂê¤È¤Ê¤ê
-¤Þ¤¹)¤Ï @strong{MySQL} 3.23 ¤Ç¤Ï¼¡¤Î¤è¤¦¤Ë·×»»¤µ¤ì¤Þ¤¹:
-
-@multitable @columnfractions .7 .3
-@item expr2 ¤Þ¤¿¤Ï expr3 ¤¬Ê¸»úÎó¤òÊÖ¤¹ @tab ʸ»úÎó
-@item expr2 ¤Þ¤¿¤Ï expr3 ¤¬ÉâÆ°¾®¿ôÅÀÃͤòÊÖ¤¹ @tab ÉâÆ°¾®¿ôÅÀ
-@item expr2 ¤Þ¤¿¤Ï expr3 ¤¬À°¿ô¤òÊÖ¤¹ @tab À°¿ô
-@end multitable
-
-@findex CASE
-@item CASE value WHEN [compare-value] THEN result [WHEN [compare-value] THEN result ...] [ELSE result] END
-@item CASE WHEN [condition] THEN result [WHEN [condition] THEN result ...] [ELSE result] END
-
-ºÇ½é¤Î¼°¤Ï @code{value=compare-value} ¤Ê¤é¤Ð @code{result} ¤òÊÖ¤·¤Þ¤¹¡£
-Æó¤ÄÌܤμ°¤Ç¤Ï¡¢ºÇ½é¤Î¾ò·ï[condition] ¤¬¿¿¤Ê¤é¤Ð¡¢ @code{result} ¤òÊÖ¤·¤Þ¤¹¡£
-¤â¤·¥Þ¥Ã¥Á¤¹¤ë result ¤ÎÃͤ¬¤Ê¤±¤ì¤Ð¡¢ @code{ELSE} °Ê²¼¤Î result ¤¬ÊÖ¤ê¤Þ¤¹¡£
-¤â¤· @code{ELSE} Éôʬ¤¬¤Ê¤±¤ì¤Ð¡¢ @code{NULL} ¤¬ÊÖ¤ê¤Þ¤¹¡£
-
-@example
-mysql> SELECT CASE 1 WHEN 1 THEN "one" WHEN 2 THEN "two" ELSE "more" END;
- -> "one"
-mysql> SELECT CASE WHEN 1>0 THEN "true" ELSE "false" END;
- -> "true"
-mysql> SELECT CASE BINARY "B" when "a" then 1 when "b" then 2 END;
- -> NULL
-@end example
-@end table
-
-@findex Mathematical functions
-@findex Functions, mathematical
-@node Mathematical functions, String functions, Control flow functions, Functions
-@subsection ¿ô³Ø´Ø¿ô
-¤¹¤Ù¤Æ¤Î¿ô³Ø´Ø¿ô¤Ï¥¨¥é¡¼¤Î¾ì¹ç @code{NULL} ¤òÊÖ¤·¤Þ¤¹¡£
-
-@table @code
-@findex - (unary minus)
-@findex minus, unary (-)
-@findex unary minus (-)
-@item -
-Éä¹æ¡£°ú¿ô¤ÎÉä¹æ¤òÊѹ¹¤·¤Þ¤¹¡£
-@example
-mysql> select - 2;
- -> -2
-@end example
-
-¤³¤Î¥ª¥Ú¥ì¡¼¥¿¡¼¤¬ @code{BIGINT} ¤È¤È¤â¤Ë»ÈÍѤµ¤ì¤¿¾ì¹ç¡¢
-ÊÖ¤êÃÍ¤Ï @code{BIGINT} ¤Ç¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤! ¤³¤ì¤Ï @code{-2^63} ¤ÎÃͤò
-»ý¤Ä¤«¤â¤·¤ì¤Ê¤¤À°¿ô¤ò¡¢ @code{-} ¤Ç»ÈÍѤ·¤Æ¤Ï¤Ê¤é¤Ê¤¤¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡ª
-
-@findex ABS()
-@item ABS(X)
-Returns the absolute value of @code{X}.
-@example
-mysql> select ABS(2);
- -> 2
-mysql> select ABS(-32);
- -> 32
-@end example
-
-¤³¤Î´Ø¿ô¤Ï @code{BIGINT} ÃͤȤȤâ¤Ë»ÈÍѤµ¤ì¤ë¤È°ÂÁ´¤Ç¤¹¡£
-
-@findex SIGN()
-@item SIGN(X)
-@code{X} ¤¬Éé¿ô¡¢¥¼¥í¡¢À°¿ô¤Ë¤è¤Ã¤Æ¡¢ @code{-1}, @code{0} or @code{1} ¤ò
-ÊÖ¤·¤Þ¤¹¡£
-@example
-mysql> select SIGN(-32);
- -> -1
-mysql> select SIGN(0);
- -> 0
-mysql> select SIGN(234);
- -> 1
-@end example
-
-@findex MOD()
-@findex % (modulo)
-@findex modulo (%)
-@item MOD(N,M)
-@itemx %
-¾ê; ( C ¤Î @code{%} ±é»»»Ò¤Î¤è¤¦¤Ê ).
-@code{N} ¤ò @code{M} ¤Ç³ä¤Ã¤¿¤È¤­¤Î;¤ê¤¬ÊÖ¤ê¤Þ¤¹¡£
-@example
-mysql> select MOD(234, 10);
- -> 4
-mysql> select 253 % 7;
- -> 1
-mysql> select MOD(29,9);
- -> 2
-@end example
-
-¤³¤Î´Ø¿ô¤Ï @code{BIGINT} ÃͤǤâ°ÂÁ´¤Ë»ÈÍѤǤ­¤Þ¤¹¡£
-
-@findex FLOOR()
-@item FLOOR(X)
-@code{X} ¤è¤êÂ礭¤¯¤Ê¤é¤Ê¤¤À°¿ô¤Î¤¦¤Á¡¢ºÇÂç¤ÎÀ°¿ôÃͤòÊÖ¤·¤Þ¤¹.
-@example
-mysql> select FLOOR(1.23);
- -> 1
-mysql> select FLOOR(-1.23);
- -> -2
-@end example
-
-ÊÖ¤êÃÍ¤Ï @code{BIGINT} ¤ËÊÑ´¹¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ËÃí°Õ!
-
-@findex CEILING()
-@item CEILING(X)
-@code{X} ¤è¤ê¾®¤µ¤¯¤Ê¤é¤Ê¤¤À°¿ô¤Î¤¦¤Á¡¢ºÇ¾®¤ÎÀ°¿ôÃͤòÊÖ¤·¤Þ¤¹.
-@example
-mysql> select CEILING(1.23);
- -> 2
-mysql> select CEILING(-1.23);
- -> -1
-@end example
-
-ÊÖ¤êÃÍ¤Ï @code{BIGINT} ¤ËÊÑ´¹¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ËÃí°Õ!
-
-@findex ROUND()
-@item ROUND(X)
-@code{X} ¤òÀ°¿ô¤Ë´Ý¤á¤¿ÃÍ(»Í¼Î¸ÞÆþ)¤òÊÖ¤·¤Þ¤¹¡£
-@example
-mysql> select ROUND(-1.23);
- -> -1
-mysql> select ROUND(-1.58);
- -> -2
-mysql> select ROUND(1.58);
- -> 2
-@end example
-
-ÊÖ¤êÃÍ¤Ï @code{BIGINT} ¤ËÊÑ´¹¤µ¤ì¤Æ¤¤¤ë¤³¤È¤ËÃí°Õ!
-
-@findex ROUND()
-@item ROUND(X,D)
-@code{X} ¤ò @code{D} ¤Ç»ØÄꤷ¤¿¾¯¿ô·å¤Ë´Ý¤á¤¿ÃÍ(»Í¼Î¸ÞÆþ)¤òÊÖ¤·¤Þ¤¹¡£
-¤â¤· @code{D} ¤¬ @code{0} ¤Ê¤é, ·ë²Ì¤Ï¾®¿ôÅÀ̵¤·¤Ë¤Ê¤ë¤«
-¾¯¿ôÉôʬ¤Ë¤Ê¤ë¤Ç¤·¤ç¤¦¡£
-@example
-mysql> select ROUND(1.298, 0);
- -> 1
-@end example
-
-@findex EXP()
-@item EXP(X)
-»Ø¿ô´Ø¿ô : @code{e} (¼«Á³Âпô¤ÎÄì) ¤Î @code{X} ¾è¡£
-@example
-mysql> select EXP(2);
- -> 7.389056
-mysql> select EXP(-2);
- -> 0.135335
-@end example
-@findex LOG()
-@item LOG(X)
-¼«Á³Âпô @code{X}
-@example
-mysql> select LOG(2);
- -> 0.693147
-mysql> select LOG(-2);
- -> NULL
-@end example
-If you want the log of a number @code{X} to some arbitary base @code{B}, use
-the formula @code{LOG(X)/LOG(B)}.
-
-@findex LOG10()
-@item LOG10(X)
-¾ïÍÑÂпô(10¤òÄì¤È¤·¤¿Âпô) @code{X}
-@example
-mysql> select LOG10(2);
- -> 0.301030
-mysql> select LOG10(100);
- -> 2.000000
-mysql> select LOG10(-100);
- -> NULL
-@end example
-
-@findex POW()
-@findex POWER()
-@item POW(X,Y)
-@itemx POWER(X,Y)
-@code{X} ¤Î @code{Y} ¾è¡£
-@example
-mysql> select POW(2,2);
- -> 4.000000
-mysql> select POW(2,-2);
- -> 0.250000
-@end example
-
-@findex SQRT()
-@item SQRT(X)
-@code{X} ¤ÎÈóÉé¤ÎÊ¿Êýº¬¤òÊÖ¤·¤Þ¤¹¡£
-@example
-mysql> select SQRT(4);
- -> 2.000000
-mysql> select SQRT(20);
- -> 4.472136
-@end example
-
-@findex PI()
-@item PI()
-¦Ð
-@example
-mysql> select PI();
- -> 3.141593
-@end example
-
-@findex COS()
-@item COS(X)
-¥³¥µ¥¤¥ó @code{X}¡£@code{X} ¤Ï¥é¥¸¥¢¥ó¡£
-@example
-mysql> select COS(PI());
- -> -1.000000
-@end example
-
-@findex SIN()
-@item SIN(X)
-¥µ¥¤¥ó @code{X}¡£@code{X} ¤Ï¥é¥¸¥¢¥ó¡£
-@example
-mysql> select SIN(PI());
- -> 0.000000
-@end example
-
-@findex TAN()
-@item TAN(X)
-¥¿¥ó¥¸¥§¥ó¥È @code{X}¡£@code{X} ¤Ï¥é¥¸¥¢¥ó¡£
-@example
-mysql> select TAN(PI()+1);
- -> 1.557408
-@end example
-
-@findex ACOS()
-@item ACOS(X)
-@code{X} ¤Î¥¢¡¼¥¯¥³¥µ¥¤¥ó¤òÊÖ¤·¤Þ¤¹¡£¤³¤ì¤Ï¥³¥µ¥¤¥ó¤¬ @code{X} ¤Ç¤¢¤ëÃͤÇ
-¤¹¡£@code{X} ¤¬ @code{-1} ¤«¤é @code{1} ¤ÎÈϰϤˤʤ¤¾ì¹ç¤Ï @code{NULL} ¤ò
-ÊÖ¤·¤Þ¤¹¡£
-@example
-mysql> select ACOS(1);
- -> 0.000000
-mysql> select ACOS(1.0001);
- -> NULL
-mysql> select ACOS(0);
- -> 1.570796
-@end example
-
-@findex ASIN()
-@item ASIN(X)
-@code{X} ¤Î¥¢¡¼¥¯¥µ¥¤¥ó¤òÊÖ¤·¤Þ¤¹¡£¤³¤ì¤Ï¥µ¥¤¥ó¤¬ @code{X} ¤Ç¤¢¤ëÃͤǤ¹¡£
-@code{X} ¤¬ @code{-1} ¤«¤é @code{1} ¤ÎÈϰϤˤʤ¤¾ì¹ç¤Ï @code{NULL} ¤òÊÖ¤·
-¤Þ¤¹¡£
-@example
-mysql> select ASIN(0.2);
- -> 0.201358
-mysql> select ASIN('foo');
- -> 0.000000
-@end example
-
-@findex ATAN()
-@item ATAN(X)
-@code{X} ¤Î¥¢¡¼¥¯¥¿¥ó¥¸¥§¥ó¥È¤òÊÖ¤·¤Þ¤¹¡£¤³¤ì¤Ï¥¿¥ó¥¸¥§¥ó¥È¤¬ @code{X} ¤Ç
-¤¢¤ëÃͤǤ¹¡£
-@example
-mysql> select ATAN(2);
- -> 1.107149
-mysql> select ATAN(-2);
- -> -1.107149
-@end example
-
-@findex ATAN2()
-@item ATAN2(X,Y)
-£²¤Ä¤ÎÊÑ¿ô @code{X} ¤È @code{Y} ¤Î¥¢¡¼¥¯¥¿¥ó¥¸¥§¥ó¥È¤òÊÖ¤·¤Þ¤¹¡£Î¾Êý¤Î°ú¿ô
-¤ÎÉä¹æ¤¬·ë²Ì¤Î¾Ý¸Â¤ò·èÄꤹ¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¤³¤È¤ò½ü¤¤¤Æ¡¢@code{Y / X} ¤Î
-¥¢¡¼¥¯¥¿¥ó¥¸¥§¥ó¥È¤Î·×»»¤ÈƱÍͤǤ¹¡£
-@example
-mysql> select ATAN(-2,2);
- -> -0.785398
-mysql> select ATAN(PI(),0);
- -> 1.570796
-@end example
-
-@findex COT()
-@item COT(X)
-@code{X} ¤Î¥³¥¿¥ó¥¸¥§¥ó¥È¤òÊÖ¤·¤Þ¤¹¡£
-@example
-mysql> select COT(12);
- -> -1.57267341
-mysql> select COT(0);
- -> NULL
-@end example
-
-@findex RAND()
-@item RAND()
-@itemx RAND(N)
-@code{0} ¤«¤é @code{1.0} ´Ö¤Î¥é¥ó¥À¥à¤ÊÉâÆ°¾®¿ôÅÀ¿ôÃͤòÊÖ¤·¤Þ¤¹¡£
-¤â¤· @code{N} ¤ËÀ°¿ô¤òÍ¿¤¨¤¿¾ì¹ç¡¢¥·¡¼¥É¤È¤·¤Æ¤³¤ÎÃͤ¬»ÈÍѤµ¤ì¤Þ¤¹¡£
-@example
-mysql> select RAND();
- -> 0.5925
-mysql> select RAND(20);
- -> 0.1811
-mysql> select RAND(20);
- -> 0.1811
-mysql> select RAND();
- -> 0.2079
-mysql> select RAND();
- -> 0.7888
-@end example
-@code{RAND()} Ãͤò»ý¤Ä¥Õ¥£¡¼¥ë¥É¤Ï @code{ORDER BY} Àá¤Ç»ÈÍѤǤ­¤Þ¤»¤ó¡£
-@code{ORDER BY} ¤Ï¥Õ¥£¡¼¥ë¥É¤òÊ£¿ô²óɾ²Á¤¹¤ë¤¿¤á¤Ç¤¹¡£
-
-¤·¤«¤· @strong{MySQL} 3.23 ¤Ç¤Ï, ¼¡¤¬²Äǽ¤Ç¤¹:
-@code{SELECT * FROM table_name ORDER BY RAND()}
-
-¤³¤ì¤Ï @code{SELECT * FROM table1,table2 WHERE a=b AND c<d ORDER BY
-RAND() LIMIT 1000} ¤Î¥»¥Ã¥È¤«¤é¥é¥ó¥À¥à¤Ê¥µ¥ó¥×¥ë¤òÆÀ¤ë¤Î¤ËÊØÍø¤Ç¤¹¡£
-
-Ãí°Õ: @code{WHERE} Àá¤Î @code{RAND()} ¤Ï @code{WHERE} ¤¬¼Â¹Ô¤¹¤ëÅ٤˺Æɾ²Á
-¤µ¤ì¤Þ¤¹¡£
-
-@findex LEAST()
-@item LEAST(X,Y,...)
-Æó¤Ä°Ê¾å¤Î°ú¿ô¤ò¼è¤ê¡¢°ú¿ôÃæ¡¢ºÇ¾®¤ÎÃͤòÊÖ¤·¤Þ¤¹¡£
-°ú¿ô¤Ï°Ê²¼¤Îµ¬Â§¤Ë½¾¤Ã¤ÆÈæ³Ó¤µ¤ì¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-Ãͤ¬ @code{INTEGER} ¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Ê¤é¡¢¤¢¤ë¤¤¤Ï¡¢Á´¤Æ¤Î°ú¿ô¤¬
-À°¿ôÃͤʤé¤Ð¡¢À°¿ô¤È¤·¤ÆÈæ³Ó¤·¤Þ¤¹¡£
-
-@item
-Ãͤ¬ @code{REAL} ¤È¤·¤Æ»ÈÍѤµ¤ì¤Æ¤¤¤ë¤«¡¢Á´¤Æ¤Î°ú¿ô¤¬¼Â¿ô¤Ê¤é¤Ð¡¢
-¼Â¿ô¤È¤·¤ÆÈæ³Ó¤·¤Þ¤¹¡£
-
-@item
-¤¤¤«¤Ê¤ë°ú¿ô¤â¥±¡¼¥¹°Í¸¤Îʸ»ú¤Ê¤é¤Ð¡¢°ú¿ô¤Ï¥±¡¼¥¹°Í¸ʸ»ú¤È¤·¤ÆÈæ³Ó¤µ¤ì¤Þ¤¹¡£
-
-@item
-¤½¤Î¤Û¤«¤Î¾ì¹ç¡¢°ú¿ô¤Ï¥±¡¼¥¹Èó°Í¸ʸ»ú¤È¤·¤ÆÈæ³Ó¤µ¤ì¤Þ¤¹¡£
-@end itemize
-
-@example
-mysql> select LEAST(2,0);
- -> 0
-mysql> select LEAST(34.0,3.0,5.0,767.0);
- -> 3.0
-mysql> select LEAST("B","A","C");
- -> "A"
-@end example
-3.22.5 °ÊÁ°¤Î @strong{MySQL} ¤Ç¤Ï¡¢@code{MIN()} ¤ò @code{LEAST} ¤ÎÂå¤ï¤ê¤Ë»ÈÍѤǤ­¤Þ¤¹¡£
-
-@findex GREATEST()
-@item GREATEST(X,Y,...)
-Æó¤Ä°Ê¾å¤Î°ú¿ô¤ò¼è¤ê¡¢°ú¿ôÃæ¡¢ºÇÂç¤ÎÃͤòÊÖ¤·¤Þ¤¹¡£
-°ú¿ô¤Ï @code{LEAST} ¤Î»þ¤ÈƱ¤¸¤è¤¦¤ËÈæ³Ó¤µ¤ì¤Þ¤¹¡£
-
-@example
-mysql> select GREATEST(2,0);
- -> 2
-mysql> select GREATEST(34.0,3.0,5.0,767.0);
- -> 767.0
-mysql> select GREATEST("B","A","C");
- -> "C"
-@end example
-
-3.22.5 °ÊÁ°¤Î @strong{MySQL} ¤Ç¤Ï¡¢@code{MAX()} ¤ò @code{GREATEST} ¤ÎÂå¤ï¤ê¤Ë»ÈÍѤǤ­¤Þ¤¹¡£
-
-@findex DEGREES()
-@item DEGREES(X)
-°ú¿ô @code{X} ¤ò¥é¥¸¥¢¥ó¤«¤éÅÙ¤ËÊÑ´¹¤·¤ÆÊÖ¤·¤Þ¤¹¡£
-@example
-mysql> select DEGREES(PI());
- -> 180.000000
-@end example
-
-@findex RADIANS()
-@item RADIANS(X)
-°ú¿ô @code{X} ¤òÅÙ¤«¤é¥é¥¸¥¢¥ó¤ËÊÑ´¹¤·¤ÆÊÖ¤·¤Þ¤¹¡£
-@example
-mysql> select RADIANS(90);
- -> 1.570796
-@end example
-
-@findex TRUNCATE()
-@item TRUNCATE(X,D)
-¾¯¿ôÅÀ°Ê²¼ @code{D} ·å¤Ç @code{X} ¤òÀÚ¤ê¼Î¤Æ¤¿ÃͤòÊÖ¤·¤Þ¤¹¡£
-@code{D} ¤¬ @code{0} ¤Î¾ì¹ç¡¢·ë²Ì¤Ï¾®¿ôÉô¤äÈù¾®Éô¤ò»ý¤Á¤Þ¤»¤ó¡£
-@example
-mysql> select TRUNCATE(1.223,1);
- -> 1.2
-mysql> select TRUNCATE(1.999,1);
- -> 1.9
-mysql> select TRUNCATE(1.999,0);
- -> 1
-@end example
-@end table
-
-@findex String functions
-@findex Functions, string
-@node String functions, Date and time functions, Mathematical functions, Functions
-@subsection ʸ»úÎó´Ø¿ô
-
-¥µ¡¼¥Ð¡¼Â¦¤Î¥Ñ¥é¥á¥¿¡¼ @code{max_allowed_packet} ¤è¤ê¤â·ë²Ì¤ÎŤµ¤¬Â礭¤¤¾ì¹ç¡¢
-ʸ»úÎó´Ø¿ô¤Ï @code{NULL} ¤òÊÖ¤·¤Þ¤¹¡£ @xref{Server parameters}.
-
-ʸ»ú¤Î°ÌÃÖ¤ò°·¤¦´Ø¿ô¤Ë¤ª¤¤¤Æ¤Ï¡¢°ìÈֺǽé¤Î°ÌÃ֤Ͽô»ú¤Î 1 ¤Ç¤¹¡£
-
-@table @code
-@findex ASCII()
-@item ASCII(str)
-@code{str} ¤Îº¸Ã¼¤Îʸ»ú¤Î ASCII ¥³¡¼¥ÉÃͤòÊÖ¤·¤Þ¤¹¡£
-@code{str} ¤¬¶õʸ»ú¤Î¾ì¹ç¤Ï @code{0} ¤òÊÖ¤·¤Þ¤¹¡£
-@code{str} ¤¬ @code{NULL} ¤Î¾ì¹ç¤Ï @code{NULL} ¤òÊÖ¤·¤Þ¤¹¡£
-
-@example
-mysql> select ASCII('2');
- -> 50
-mysql> select ASCII(2);
- -> 50
-mysql> select ASCII('dx');
- -> 100
-@end example
-
-See also the @code{ORD()} function.
-
-@findex ORD()
-@item ORD(str)
-ʸ»úÎó str ¤Îº¸Ã¼¤Îʸ»ú¤¬¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Î¾ì¹ç¡¢Ê¸»ú¤ÎASCII ¥³¡¼¥ÉÃͤò¼¡
-¤Î·Á¼°¤ÇÊÖ¤¹¤³¤È¤Ë¤è¤ê¡¢¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Î¥³¡¼¥É¤òÊÖ¤·¤Þ¤¹:
-@code{((first byte ASCII code)*256+(second byte ASCII code))[*256+third byte ASCII code...]}.
-º¸Ã¼¤Îʸ»ú¤¬¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢@code{ASCII()} ´Ø¿ô¤ÈƱ¤¸ÃͤòÊÖ
-¤·¤Þ¤¹¡£
-
-@example
-mysql> select ORD('2');
- -> 50
-@end example
-
-@findex CONV()
-@item CONV(N,from_base, to_base)
-¿ô»ú¤ò¡¢¿Ê¿ô¤Î°ã¤¦¿ô»ú¤ËÊÑ´¹¤·¤Þ¤¹¡£
-¿ô @code{N} ¤ò @code{from_base} ¿Ê¿ô¤«¤é @code{to_base} ¿Ê¿ô¤Ë
-ÊÑ´¹¤·¤¿¾ì¹ç¤Î¡¢Ê¸»úɽ¸½¤òÊÖ¤·¤Þ¤¹¡£
-¤â¤·°ú¿ô¤¬ @code{NULL} ¤Ê¤é @code{NULL} ¤òÊÖ¤·¤Þ¤¹¡£
-°ú¿ô @code{N} ¤ÏÀ°¿ô¤È¤·¤Æ²ò¼á¤µ¤ì¤Þ¤¹¤¬¡¢À°¿ô¤«Ê¸»úÎó¤Ç»ØÄꤷ¤Þ¤¹¡£
-ºÇ¾®¤Î¿Ê¿ô¤Ï @code{2} ¤Ç¡¢ºÇÂç¤Ï @code{36} ¤Ç¤¹¡£
-@code{to_base} ¤¬Éé¿ô¤Ê¤é¡¢@code{N} ¤ÏÉä¹æÉÕ¤­¤Î¿ô¤Ë¤Ê¤ê¤Þ¤¹¡£
-@code{CONV} ¤Ï 64-bit ÀºÅÙ¤ÇÆ°ºî¤·¤Þ¤¹¡£
-
-@example
-mysql> select CONV("a",16,2);
- -> '1010'
-mysql> select CONV("6E",18,8);
- -> '172'
-mysql> select CONV(-17,10,-18);
- -> '-H'
-mysql> select CONV(10+"10"+'10'+0xa,10,10);
- -> '40'
-@end example
-
-@findex BIN()
-@item BIN(N)
-@code{N} ¤òÆó¿Ê¿ô¤Ë¤·¤¿ÃͤòÊÖ¤·¤Þ¤¹¡£@code{N} ¤Ï longlong ¿ôÃͤǤ¹¡£
-¤³¤ì¤Ï @code{CONV(N,10,2)} ¤ÈƱ¤¸¤Ç¤¹¡£
-@code{N} ¤¬ @code{NULL} ¤Ê¤é @code{NULL} ¤òÊÖ¤·¤Þ¤¹.
-
-@example
-mysql> select BIN(12);
- -> '1100'
-@end example
-
-@findex OCT()
-@item OCT(N)
-@code{N} ¤Î8¿Ê¿ôÃͤòɽ¤¹Ê¸»úÎó¤òÊÖ¤·¤Þ¤¹¡£@code{N} ¤Ï longlong ¿ôÃͤǤ¹¡£
-¤³¤ì¤Ï @code{CONV(N,10,8)} ¤ÈƱ¤¸¤Ç¤¹¡£@code{N} ¤¬ @code{NULL} ¤Î¾ì¹ç¤Ï
-@code{NULL} ¤òÊÖ¤·¤Þ¤¹¡£
-
-@example
-mysql> select OCT(12);
- -> '14'
-@end example
-
-@findex HEX()
-@item HEX(N)
-@code{N} ¤Î16¿Ê¿ôÃͤòɽ¤¹Ê¸»úÎó¤òÊÖ¤·¤Þ¤¹¡£@code{N} ¤Ï
-longlong(@code{BIGINT}) ¿ôÃͤǤ¹¡£¤³¤ì¤Ï @code{CONV(N,10,16)} ¤ÈƱ¤¸¤Ç¤¹¡£
-@code{N} ¤¬ @code{NULL} ¤Î¾ì¹ç¤Ï @code{NULL} ¤òÊÖ¤·¤Þ¤¹¡£
-
-@example
-mysql> select HEX(255);
- -> 'FF'
-@end example
-
-@findex CHAR()
-@item CHAR(N,...)
-°ú¿ô¤Î ASCII ¥³¡¼¥ÉÃͤˤè¤Ã¤ÆÍ¿¤¨¤é¤ì¤¿Ê¸»ú¤«¤é¤Ê¤ëʸ»úÎó¤òÊÖ¤·¤Þ¤¹¡£
-@code{NULL} ¤ÏÈô¤Ð¤µ¤ì¤Þ¤¹¡£
-
-@example
-mysql> select CHAR(77,121,83,81,'76');
- -> 'MySQL'
-mysql> select CHAR(77,77.3,'77.3');
- -> 'MMM'
-@end example
-
-@findex CONCAT()
-@item CONCAT(str1,str2,...)
-°ú¿ô¤ò·ë¹ç¤·¤¿·ë²Ì¤òÊÖ¤·¤Þ¤¹¡£°ú¿ô¤¬ @code{NULL} ¤Ê¤é @code{NULL} ¤òÊÖ¤·¤Þ¤¹.
-2¸Ä°Ê¾å¤Î°ú¿ô¤òɬÍפȤ·¤Þ¤¹¡£
-¿ôÃͤΰú¿ô¤ÏÅù²Á¤Îʸ»úÎó·Á¼°¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£
-@example
-mysql> select CONCAT('My', 'S', 'QL');
- -> 'MySQL'
-mysql> select CONCAT('My', NULL, 'QL');
- -> NULL
-mysql> select CONCAT(14.3);
- -> '14.3'
-@end example
-
-@findex CONCAT_WS()
-@item CONCAT_WS(separator, str1, str2,...)
-
-@code{CONCAT_WS()} ¤Ï¶èÀÚ¤êʸ»ú¤Ä¤­ CONCAT (CONCAT With Separator) ¤ò°ÕÌ£
-¤·¡¢@code{CONCAT()} ¤ÎÆüì¤Ê·Á¼°¤Ç¤¹¡£ºÇ½é¤Î°ú¿ô¤Ï¡¢»Ä¤ê¤Î°ú¿ô¤Î¶èÀÚ¤êʸ»ú
-¤Ç¤¹¡£¶èÀÚ¤êʸ»ú¤Ï»Ä¤ê¤Î°ú¿ô¤ÈƱ¤¸¤è¤¦¤Êʸ»úÎó¤Ç¤¹¡£¶èÀÚ¤êʸ»ú¤¬
-@code{NULL} ¤Î¾ì¹ç¡¢·ë²Ì¤Ï @code{NULL} ¤Ë¤Ê¤ê¤Þ¤¹¡£´Ø¿ô¤Ï¶èÀÚ¤êʸ»ú¤è¤ê¸å
-¤Î @code{NULL} ¤È¶õʸ»úÎó¤òÈô¤Ð¤·¤Þ¤¹¡£¶èÀÚ¤êʸ»ú¤Ï·ë¹ç¤µ¤ì¤ëʸ»úÎó¤Î´Ö¤Ë
-Äɲ䵤ì¤Þ¤¹¡£
-@example
-mysql> select CONCAT_WS(",","First name","Second name","Last Name");
- -> 'First name,Second name,Last Name'
-mysql> select CONCAT_WS(",","First name",NULL,"Last Name");
- -> 'First name,Last Name'
-@end example
-
-@findex LENGTH()
-@findex OCTET_LENGTH()
-@findex CHAR_LENGTH()
-@findex CHARACTER_LENGTH()
-@item LENGTH(str)
-@itemx OCTET_LENGTH(str)
-@itemx CHAR_LENGTH(str)
-@itemx CHARACTER_LENGTH(str)
-ʸ»úÎó @code{str} ¤ÎŤµ¡£
-@example
-mysql> select LENGTH('text');
- -> 4
-mysql> select OCTET_LENGTH('text');
- -> 4
-@end example
-
-Ãí°Õ: @code{CHAR_LENGTH()} ¤Ë¤Ä¤¤¤Æ¤Ï¡¢¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Ï°ìÅÙ¤À¤±¤·¤«¥«¥¦
-¥ó¥È¤µ¤ì¤Þ¤»¤ó¡£
-
-@findex LOCATE()
-@findex POSITION()
-@item LOCATE(substr,str)
-@itemx POSITION(substr IN str)
-@code{str} Æâ¤Ë¤¢¤ë @code{substr} ʸ»úÎó¤Î°ÌÃÖ¤òÊÖ¤·¤Þ¤¹¡£ºÇ½é¤Î°ÌÃÖ¤Ï 1 ¤Ç¤¹¡£
-@code{str} Æâ¤Ë @code{substr} ¤¬¤Ê¤¤»þ¤Ï @code{0} ¤òÊÖ¤·¤Þ¤¹¡£
-@example
-mysql> select LOCATE('bar', 'foobarbar');
- -> 4
-mysql> select LOCATE('xbar', 'foobar');
- -> 0
-@end example
-
-¤³¤Î´Ø¿ô¤Ï¥Þ¥ë¥Á¥Ð¥¤¥È¤Ç¤â°ÂÁ´¤Ç¤¹¡£
-
-@findex LOCATE()
-@item LOCATE(substr,str,pos)
-ʸ»úÎó @code{str} Ãæ¤ËºÇ½é¤Ë¸²¤ì¤¿ @code{substr} ʸ»ú¤Î°ÌÃÖ¤òÊÖ¤·¤Þ¤¹¡£
-@code{pos} ¤Ï¸¡º÷¤ò³«»Ï¤¹¤ë°ÌÃ֤Ǥ¹¡£
-@code{str} ¤Ë @code{substr} ¤¬¤Ê¤±¤ì¤Ð @code{0} ¤òÊÖ¤·¤Þ¤¹¡£
-@example
-mysql> select LOCATE('bar', 'foobarbar',5);
- -> 7
-@end example
-
-¤³¤Î´Ø¿ô¤Ï¥Þ¥ë¥Á¥Ð¥¤¥È¤Ç¤â°ÂÁ´¤Ç¤¹¡£
-
-@findex INSTR()
-@item INSTR(str,substr)
-ʸ»úÎó @code{str} Æâ¤ÎºÇ½é¤Îʸ»úÎó @code{substr} ¤Î°ÌÃÖ¤òÊÖ¤·¤Þ¤¹¡£
-¤³¤ì¤Ï°ú¿ô¤¬Æþ¤ìÂؤï¤Ã¤Æ¤¤¤ë¤³¤È¤ò¤Î¤¾¤¤¤Æ¡¢
-2¤Ä¤Î°ú¿ô¤òÍ¿¤¨¤¿ @code{LOCATE} ¤ÈƱ¤¸¤Ç¤¹¡£
-
-@example
-mysql> select INSTR('foobarbar', 'bar');
- -> 4
-mysql> select INSTR('xbar', 'foobar');
- -> 0
-@end example
-
-¤³¤Î´Ø¿ô¤Ï¥Þ¥ë¥Á¥Ð¥¤¥È¤Ç¤â°ÂÁ´¤Ç¤¹¡£
-
-@findex LPAD()
-@item LPAD(str,len,padstr)
-@code{str} ¤ÎŤµ¤¬ @code{len} ¤Ë¤Ê¤ë¤Þ¤Çʸ»úÎó @code{str} ¤Î»Ï¤á¤Ë @code{padstr} ¤òËä¤á¤Þ¤¹¡£
-@example
-mysql> select LPAD('hi',4,'??');
- -> '??hi'
-@end example
-
-@findex RPAD()
-@item RPAD(str,len,padstr)
-@code{str} ¤ÎŤµ¤¬ @code{len} ¤Ë¤Ê¤ë¤Þ¤Çʸ»úÎó @code{str} ¤Î½ª¤ï¤ê¤Ë @code{padstr} ¤òËä¤á¤Þ¤¹¡£
-@example
-mysql> select RPAD('hi',5,'?');
- -> 'hi???'
-@end example
-
-@findex LEFT()
-@item LEFT(str,len)
-ʸ»úÎó @code{str} ¤ÎºÇ½é¤«¤é @code{len} ¸Ä¤Îʸ»ú¤òÆÀ¤Þ¤¹¡£
-
-@example
-mysql> select LEFT('foobarbar', 5);
- -> 'fooba'
-@end example
-
-¤³¤Î´Ø¿ô¤Ï¥Þ¥ë¥Á¥Ð¥¤¥È¤Ç¤â°ÂÁ´¤Ç¤¹¡£
-
-@findex RIGHT()
-@item RIGHT(str,len)
-ʸ»úÎó @code{str} ¤ÎºÇ¸å¤«¤é @code{len} ¸Ä¤Îʸ»ú¤òÆÀ¤Þ¤¹¡£
-
-@example
-mysql> select RIGHT('foobarbar', 4);
- -> 'rbar'
-@end example
-
-¤³¤Î´Ø¿ô¤Ï¥Þ¥ë¥Á¥Ð¥¤¥È¤Ç¤â°ÂÁ´¤Ç¤¹¡£
-
-@findex SUBSTRING()
-@findex MID()
-@item SUBSTRING(str,pos,len)
-@itemx SUBSTRING(str FROM pos FOR len)
-@itemx MID(str,pos,len)
-@code{str} ¤Î @code{pos} °ÌÃÖ¤«¤é @code{len} ʸ»ú¿ôʬ¤Îʸ»úÎó¤òÊÖ¤·¤Þ¤¹¡£
-@code{FROM} ¤Î°ã¤¤¤Ï ANSI SQL 92 ¹½Ê¸¤Ç¤¹¡£
-
-@example
-mysql> select SUBSTRING('Quadratically',5,6);
- -> 'ratica'
-@end example
-
-¤³¤Î´Ø¿ô¤Ï¥Þ¥ë¥Á¥Ð¥¤¥È¤Ç¤â°ÂÁ´¤Ç¤¹¡£
-
-@findex SUBSTRING()
-@item SUBSTRING(str,pos)
-@item SUBSTRING(str FROM pos)
-ʸ»úÎó @code{str} ¤Î °ÌÃÖ @code{pos} °Ê¹ß¤Îʸ»ú¤òÊÖ¤·¤Þ¤¹¡£
-
-@example
-mysql> select SUBSTRING('Quadratically',5);
- -> 'ratically'
-mysql> select SUBSTRING('foobarbar' FROM 4);
- -> 'rbar'
-@end example
-
-¤³¤Î´Ø¿ô¤Ï¥Þ¥ë¥Á¥Ð¥¤¥È¤Ç¤â°ÂÁ´¤Ç¤¹¡£
-
-@findex SUBSTRING_INDEX()
-@item SUBSTRING_INDEX(str,delim,count)
-@code{str} ¤«¤é¡¢¶èÀÚ¤êʸ»ú @code{delim} ¤¬ @code{count} ¸Ä¸½¤ì¤¿°ÌÃÖ¤«¤éÁ°¤Î
-ʸ»úÎó¤òÊÖ¤·¤Þ¤¹¡£@code{count} ¤¬Àµ¤Î¾ì¹ç¤Ïʸ»úÎó¤Ïº¸¤«¤é¸¡º÷¤µ¤ì¡¢
-@code{count} ¤¬Éé¤Î¾ì¹ç¤Ïʸ»úÎó¤Ï±¦¤«¤é¸¡º÷¤µ¤ì¤Þ¤¹¡£
-
-@example
-mysql> select SUBSTRING_INDEX('www.mysql.com', '.', 2);
- -> 'www.mysql'
-mysql> select SUBSTRING_INDEX('www.mysql.com', '.', -2);
- -> 'mysql.com'
-@end example
-
-¤³¤Î´Ø¿ô¤Ï¥Þ¥ë¥Á¥Ð¥¤¥È¤Ç¤â°ÂÁ´¤Ç¤¹¡£
-
-@findex LTRIM()
-@item LTRIM(str)
-ʸ»úÎó @code{str} ¤ÎºÇ½é¤«¤é¶õÇòʸ»ú¤òºï½ü¤·¤Þ¤¹¡£
-@example
-mysql> select LTRIM(' barbar');
- -> 'barbar'
-@end example
-
-@findex RTRIM()
-@item RTRIM(str)
-ʸ»úÎó @code{str} ¤ÎºÇ¸å¤«¤é¶õÇòʸ»ú¤òºï½ü¤·¤Þ¤¹¡£
-@example
-mysql> select RTRIM('barbar ');
- -> 'barbar'
-@end example
-
-@findex TRIM()
-@item TRIM([[BOTH | LEADING | TRAILING] [remstr] FROM] str)
-Á´¤Æ¤Î @code{remstr} ¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤Þ¤¿¤Ï¥µ¥Õ¥£¥Ã¥¯¥¹¤ò @code{str} ¤«¤éºï½ü¤·¤¿
-ʸ»úÎó¤òÊÖ¤·¤Þ¤¹¡£@code{BOTH}, @code{LEADING} ¤½¤·¤Æ @code{TRAILING} ¤¬
-»ÈÍѤµ¤ì¤Ê¤¤¾ì¹ç¡¢@code{BOTH} ¤¬Å¬ÍѤµ¤ì¤Þ¤¹¡£@code{remstr} ¤¬Í¿¤¨¤é¤ì¤Ê¤¤¤È¡¢
-¶õÇò¤¬ºï½ü¤µ¤ì¤Þ¤¹¡£
-@example
-mysql> select TRIM(' bar ');
- -> 'bar'
-mysql> select TRIM(LEADING 'x' FROM 'xxxbarxxx');
- -> 'barxxx'
-mysql> select TRIM(BOTH 'x' FROM 'xxxbarxxx');
- -> 'bar'
-mysql> select TRIM(TRAILING 'xyz' FROM 'barxxyz');
- -> 'barx'
-@end example
-
-¤³¤Î´Ø¿ô¤Ï¥Þ¥ë¥Á¥Ð¥¤¥È¤Ç¤â°ÂÁ´¤Ç¤¹¡£
-
-@findex SOUNDEX()
-@item SOUNDEX(str)
-@code{str} ¤«¤é¤Î soundex ʸ»úÎó¤òÊÖ¤·¤Þ¤¹¡£È¯²»¤¬``ÂçÂÎƱ¤¸''£²¤Ä¤Îʸ»úÎó
-¤ÏƱ¤¸ soundex ʸ»úÎó¤ò»ý¤Á¤Þ¤¹¡£``ɸ½à¤Î'' soundex ʸ»úÎó¤Ï4ʸ»úŤǤ¹¤¬¡¢
-@code{SOUNDEX()} ´Ø¿ô¤ÏǤ°Õ¤ÎŤµ¤Îʸ»úÎó¤òÊÖ¤·¤Þ¤¹¡£@code{SUBSTRING()} ¤ò
-·ë²Ì¤Ë»ÈÍѤ·¤Æ¡¢``ɸ½à¤Î'' soundex ʸ»úÎó¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£Í¿¤¨¤é¤ì¤¿
-ʸ»úÎóÃæ¤ÎÈó¥¢¥ë¥Õ¥¡¥Ù¥Ã¥Èʸ»ú¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£A-Z ¤ÎȾ°Ê³°¤Î¤¹¤Ù¤Æ¤Î¹ñºÝŪ
-¤Ê¥¢¥ë¥Õ¥¡¥Ù¥Ã¥Èʸ»ú¤ÏÊì²»¤È¤ß¤Ê¤µ¤ì¤Þ¤¹¡£
-
-@example
-mysql> select SOUNDEX('Hello');
- -> 'H400'
-mysql> select SOUNDEX('Quadratically');
- -> 'Q36324'
-@end example
-
-@findex SPACE()
-@item SPACE(N)
-@code{N} ¸Ä¤Î¶õÇòʸ»ú¤òÊÖ¤·¤Þ¤¹¡£
-@example
-mysql> select SPACE(6);
- -> ' '
-@end example
-
-@findex REPLACE()
-@item REPLACE(str,from_str,to_str)
-ʸ»úÎó @code{str} Æâ¤ÎÁ´¤Æ¤Îʸ»úÎó @code{from_str} ¤ò @code{to_str} ¤Ë
-ÃÖ¤­´¹¤¨¤Þ¤¹¡£
-
-@example
-mysql> select REPLACE('www.mysql.com', 'w', 'Ww');
- -> 'WwWwWw.mysql.com'
-@end example
-
-¤³¤Î´Ø¿ô¤Ï¥Þ¥ë¥Á¥Ð¥¤¥È¤Ç¤â°ÂÁ´¤Ç¤¹¡£
-
-@findex REPEAT()
-@item REPEAT(str,count)
-@code{str} ¤ò @code{count} ²ó·«¤êÊÖ¤·¤Þ¤¹¡£@code{count <= 0} ¤Î¾ì¹ç¤Ï
-¶õ¤Îʸ»úÎó¤òÊÖ¤·¤Þ¤¹¡£@code{str} ¤Þ¤¿¤Ï @code{count} ¤¬ @code{NULL}
-¤Þ¤¿¤Ï¡¢@code{LENGTH(str)*count > max_allowed_packet} ¤Î¾ì¹ç¤Ï
-@code{NULL} ¤òÊÖ¤·¤Þ¤¹¡£
-
-@example
-mysql> select REPEAT('MySQL', 3);
- -> 'MySQLMySQLMySQL'
-@end example
-
-@findex REVERSE()
-@item REVERSE(str)
-ʸ»úÎó @code{str} ¤òȿž¤·¤Þ¤¹¡£
-@example
-mysql> select REVERSE('abc');
- -> 'cba'
-@end example
-
-¤³¤Î´Ø¿ô¤Ï¥Þ¥ë¥Á¥Ð¥¤¥È¤Ç¤â°ÂÁ´¤Ç¤¹¡£
-
-@findex INSERT()
-@item INSERT(str,pos,len,newstr)
-@code{str} Ãæ¤Î @code{pos} °ÌÃÖ¤«¤é @code{len} ŤÎʸ»úÎó¤ò
-@code{newstr} ¤ÇÃÖ¤­´¹¤¨¤Þ¤¹¡£@code{str} Æâ¤ÎºÇ½é¤Î°ÌÃÖ¤Ï1¤Ç¤¹¡£
-
-@example
-mysql> select INSERT('Quadratic', 3, 4, 'What');
- -> 'QuWhattic'
-@end example
-
-¤³¤Î´Ø¿ô¤Ï¥Þ¥ë¥Á¥Ð¥¤¥È¤Ç¤â°ÂÁ´¤Ç¤¹¡£
-
-@findex ELT()
-@item ELT(N,str1,str2,str3...)
-@code{N} = @code{1} ¤Ê¤é @code{str1} ¤ò¡¢@code{N} = @code{2} ¤Ê¤é @code{str2} ¤òÊÖ¤·¤Þ¤¹¡£
-@code{N} ¤¬ @code{1} ¤è¤ê¾®¤µ¤¤¾ì¹ç¡¢¤Þ¤¿¤Ï°ú¿ô¤Î¿ô¤è¤êÂ礭¤¤¾ì¹ç¤Ï @code{NULL}
-¤¬ÊÖ¤µ¤ì¤Þ¤¹¡£
-@code{ELT()} ¤Ï @code{FIELD()} ¤ÎµÕ¤Ç¤¹¡£
-
-@example
-mysql> select ELT(1, 'ej', 'Heja', 'hej', 'foo');
- -> 'ej'
-mysql> select ELT(4, 'ej', 'Heja', 'hej', 'foo');
- -> 'foo'
-@end example
-
-@findex FIELD()
-@item FIELD(str,str1,str2,str3,...)
-@code{str1}, @code{str2}, @code{str3}, @code{...} ¥ê¥¹¥ÈÆâ¤Î @code{str} ¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò
-ÊÖ¤·¤Þ¤¹¡£@code{str} ¤¬¸«¤Ä¤«¤é¤Ê¤±¤ì¤Ð @code{0} ¤òÊÖ¤·¤Þ¤¹¡£
-@code{FIELD()} ¤Ï @code{ELT()} ¤ÎµÕ¤Ç¤¹¡£
-
-@example
-mysql> select FIELD('ej', 'Hej', 'ej', 'Heja', 'hej', 'foo');
- -> 2
-mysql> select FIELD('fo', 'Hej', 'ej', 'Heja', 'hej', 'foo');
- -> 0
-@end example
-
-@findex FIND_IN_SET()
-@item FIND_IN_SET(str,strlist)
-@code{str} ¤¬ @code{strlist} Ãæ¤Ë¤¢¤ì¤Ð¡¢ÃÍ @code{1} ¤«¤é @code{N} ¤òÊÖ¤·¤Þ¤¹¡£
-@code{strlist} ¤Ï¡¢¤½¤ì¤¾¤ì¤Î°Û¤Ê¤ëÃͤ¬ ',' ¤Çʬ³ä¤µ¤ì¤¿Ê¸»úÎó¤Ç¤¹¡£ºÇ½é¤Î
-°ú¿ô¤¬Äê¿ôʸ»úÎó¤Ç£²ÈÖÌܤ¬ @code{SET} ·¿¤Î¥Õ¥£¡¼¥ë¥É¤Î¾ì¹ç@code{FIND_IN_SET} ¤Ï
-¥Ó¥Ã¥È±é»»¤ò»ÈÍѤ·¤ÆºÇŬ²½¤µ¤ì¤Þ¤¹¡ª
-@code{strlist} ¤¬¶õʸ»ú¤Ê¤é @code{0} ¤òÊÖ¤·¤Þ¤¹¡£
-¤É¤Á¤é¤«¤Î°ú¿ô¤¬ @code{NULL} ¤Ê¤é @code{NULL} ¤òÊÖ¤·¤Þ¤¹.
-¤³¤Î´Ø¿ô¤ÏºÇ½é¤Î°ú¿ô¤¬ ',' ¤ò´Þ¤ó¤À¾ì¹ç¡¢¤¦¤Þ¤¯Æ°¤«¤Ê¤¤¤Ç¤·¤ç¤¦¡£
-
-@example
-mysql> SELECT FIND_IN_SET('b','a,b,c,d');
- -> 2
-@end example
-
-@findex MAKE_SET()
-@item MAKE_SET(bits,str1,str2,...)
-@code{bits} ¤Ë»ØÄꤵ¤ì¤¿¥Ó¥Ã¥È¤ËÂбþ¤¹¤ëʸ»úÎó¤Î¥»¥Ã¥È¤òÊÖ¤·¤Þ¤¹¡£
-(ʸ»úÎó¤¬Ê£¿ô¤Î¾ì¹ç¡¢ @samp{,} ¤Ç¶èÀÚ¤é¤ì¤Þ¤¹)
-@code{str1} ¤¬ ¥Ó¥Ã¥È 0 ¤ËÂбþ¤·¡¢@code{str2} ¤¬ ¥Ó¥Ã¥È 1 ¤ËÂбþ¤·¡¢
-@code{str3} ¤¬ ¥Ó¥Ã¥È 2 ¤ËÂбþ¤·... ¤È¤Ê¤ê¤Þ¤¹¡£
-@code{str1}, @code{str2}, @code{...} Ãæ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë @code{NULL} ʸ»ú¤Ï
-·ë²Ì¤Ë¤ÏÄɲ䵤ì¤Þ¤»¤ó¡£
-
-@example
-mysql> SELECT MAKE_SET(1,'a','b','c');
- -> 'a'
-mysql> SELECT MAKE_SET(1 | 4,'hello','nice','world');
- -> 'hello,world'
-mysql> SELECT MAKE_SET(0,'a','b','c');
- -> ''
-@end example
-
-@findex EXPORT_SET()
-@item EXPORT_SET(bits,on,off,[separator,[number_of_bits]])
-'bits' ¤ËÍ¿¤¨¤é¤ì¤¿¿ôÃͤËÂФ·¡¢
-Á´¤Æ¤Î¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¥Ó¥Ã¥È¤ò 'on' ¤Ç»ØÄꤵ¤ì¤¿Ê¸»ú¤Çɽ¤·¡¢
-¥ê¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¥Ó¥Ã¥È¤ò 'off' ¤Ç»ØÄꤵ¤ì¤¿Ê¸»ú¤Çɽ¤·¤¿Ê¸»úÎó¤òÊÖ¤·¤Þ¤¹¡£
-¤½¤ì¤¾¤ì¤Îʸ»ú¤Ï 'separator' (¥Ç¥Õ¥©¥ë¥È',') ¤Ç¼¨¤µ¤ì¤¿Ê¸»ú¤Ç¶èÀÚ¤é¤ì¡¢
-'number_of_bits' (default 64) ¤ËÍ¿¤¨¤é¤ì¤¿·å¿ô¤À¤±¤Î¥Ó¥Ã¥È¤òɽ¼¨¤·¤Þ¤¹¡£
-
-@example
-mysql> SELECT EXPORT_SET(5,'Y','N',',',4);
- -> Y,N,Y,N
-@end example
-
-@findex LCASE()
-@findex LOWER()
-@item LCASE(str)
-@itemx LOWER(str)
-@code{str} ¤ò¸½ºß¤Î¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È¥Þ¥Ã¥Ô¥ó¥°
- (¥Ç¥Õ¥©¥ë¥È ISO-8859-1 Latin1) ¤Ë¤·¤¿¤¬¤Ã¤Æ¾®Ê¸»ú¤ËÊÑ´¹¤·¤Þ¤¹¡£
-
-¤³¤Î´Ø¿ô¤Ï¥Þ¥ë¥Á¥Ð¥¤¥È¤Ç¤â°ÂÁ´¤Ç¤¹¡£
-
-@example
-mysql> select LCASE('QUADRATICALLY');
- -> 'quadratically'
-@end example
-
-@findex UCASE()
-@findex UPPER()
-@item UCASE(str)
-@itemx UPPER(str)
-@code{str} ¤ò¸½ºß¤Î¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È¥Þ¥Ã¥Ô¥ó¥°
- (¥Ç¥Õ¥©¥ë¥È ISO-8859-1 Latin1) ¤Ë¤·¤¿¤¬¤Ã¤ÆÂçʸ»ú¤ËÊÑ´¹¤·¤Þ¤¹¡£
-
-@example
-mysql> select UCASE('Hej');
- -> 'HEJ'
-@end example
-
-¤³¤Î´Ø¿ô¤Ï¥Þ¥ë¥Á¥Ð¥¤¥È¤Ç¤â°ÂÁ´¤Ç¤¹¡£
-
-@findex FILE
-@item LOAD_FILE(file_name)
-¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤ß¡¢¥Õ¥¡¥¤¥ë¤ÎÃæ¿È¤òʸ»ú¤È¤·¤ÆÊÖ¤·¤Þ¤¹¡£ ¥Õ¥¡¥¤¥ë¤Ï
-¥µ¡¼¥Ð¡¼¾å¤Ë¤Ê¤¯¤Æ¤Ï¤Ê¤é¤º¡¢¥Õ¥¡¥¤¥ë¤ò¥Õ¥ë¥Ñ¥¹¤Ç»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-¤½¤·¤Æ¡¢ @strong{file} ¸¢¸Â¤¬¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ ¥Õ¥¡¥¤¥ë¤ÏÁ´°÷¤Ë
-Æɤ߹þ¤ß²Äǽ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤º¡¢¤½¤·¤Æ¡¢ @code{max_allowed_packet} ¤è¤ê
-¾®¤µ¤¤¥µ¥¤¥º¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-
-¤³¤Î¤¦¤Á¤É¤ì¤«¤ÎÍýͳ¤Ç¡¢¤â¤·¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Ê¤¤¤«Æɤ߹þ¤á¤Ê¤¤¾ì¹ç¡¢
-¤³¤Î´Ø¿ô¤Ï @code{NULL} ¤òÊÖ¤·¤Þ¤¹¡£
-
-@example
-mysql> UPDATE table_name
- SET blob_column=LOAD_FILE("/tmp/picture")
- WHERE id=1;
-@end example
-@end table
-
-@strong{MySQL} ¤ÏɬÍפȤ¢¤é¤Ð¿ôÃͤòʸ»úÎó¤ËÊÑ´¹¤·¤Þ¤¹¡£
-µÕ¤âƱÍͤ˹Ԥ¤¤Þ¤¹¡§
-
-@example
-mysql> SELECT 1+"1";
- -> 2
-mysql> SELECT concat(2,' test');
- -> '2 test'
-@end example
-
-ÌÀ¼¨Åª¤Ë¿ôÃͤòʸ»úÎó¤ËÊÑ´¹¤·¤¿¤±¤ì¤Ð¡¢@code{CONCAT()} ¤Ë°ú¿ô¤È¤·¤ÆÅϤ·¤Æ²¼
-¤µ¤¤¡£
-
-ʸ»úÎó´Ø¿ô¤Ï°ú¿ô¤È¤·¤Æ¥Ð¥¤¥Ê¥êʸ»úÎó¤¬Í¿¤¨¤é¤ì¤ë¤È¡¢·ë²Ì¤Îʸ»úÎó¤â¥Ð¥¤¥Ê¥ê
-ʸ»úÎó¤Ë¤Ê¤ê¤Þ¤¹¡£Ê¸»úÎó¤ËÊÑ´¹¤µ¤ì¤¿¿ôÃͤϥХ¤¥Ê¥êʸ»úÎó¤È¤ß¤Ê¤µ¤ì¤Þ¤¹¡£¤³
-¤ì¤ÏÈæ³Ó¤Ë¤À¤±±Æ¶Á¤·¤Þ¤¹¡£
-
-@findex Date and time functions
-@findex Functions, date and time
-@node Date and time functions, Miscellaneous functions, String functions, Functions
-@subsection ÆüÉդȻþ¹ï´Ø¿ô
-
-¤½¤ì¤¾¤ì¤Î·¿¤¬¤â¤ÄÃͤÎÈϰϤÈÆü¤È»þ´Ö¤ÎÃͤ¬µ­½Ò¤µ¤ì¤ëÍ­¸ú¤Ê·Á¼°¤Ë¤Ä¤¤¤Æ¤Ï
- @ref{Date and time types}.
-
-ÆüÉÕ´Ø¿ô¤ò»ÈÍѤ¹¤ëÎã:
-@code{date_col} ¤¬ºÇ¿·¤Î30Æü¤Ç¤¢¤ëÁ´¤Æ¤Î¥ì¥³¡¼¥É¤òÁªÂò¤·¤Þ¤¹:
-
-@example
-mysql> SELECT something FROM table
- WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) <= 30;
-@end example
-
-@table @code
-@findex DAYOFWEEK()
-@item DAYOFWEEK(date)
-@code{date} ¤ÎÍËÆü¤òÆÀ¤Þ¤¹ (@code{1} = ÆüÍËÆü, @code{2} = ·îÍËÆü, ... @code{7} = ÅÚÍËÆü)
-¤³¤ì¤Ï ODBC ɸ½à¤Ë½¾¤¤¤Þ¤¹¡£
-@example
-mysql> select DAYOFWEEK('1998-02-03');
- -> 3
-@end example
-
-@findex WEEKDAY()
-@item WEEKDAY(date)
-@code{date} ¤ÎÍËÆü¤òÆÀ¤Þ¤¹ (@code{0} = ÆüÍËÆü, @code{1} = ·îÍËÆü, ... @code{6} = ÅÚÍËÆü)
-@example
-mysql> select WEEKDAY('1997-10-04 22:23:00');
- -> 5
-mysql> select WEEKDAY('1997-11-05');
- -> 2
-@end example
-
-@findex DAYOFMONTH()
-@item DAYOFMONTH(date)
-·î¤ÎÆü¤òÊÖ¤·¤Þ¤¹ (@code{1} - @code{31})
-@example
-mysql> select DAYOFMONTH('1998-02-03');
- -> 3
-@end example
-
-@findex DAYOFYEAR()
-@item DAYOFYEAR(date)
-ǯ¤ÎÆü¤òÊÖ¤·¤Þ¤¹ (@code{1}-@code{366})
-@example
-mysql> select DAYOFYEAR('1998-02-03');
- -> 34
-@end example
-
-@findex MONTH()
-@item MONTH(date)
-·î¤òÊÖ¤·¤Þ¤¹ (@code{1} - @code{12})
-@example
-mysql> select MONTH('1998-02-03');
- -> 2
-@end example
-
-@findex DAYNAME()
-@item DAYNAME(date)
-ÍËÆü¤Î̾Á°¤òÊÖ¤·¤Þ¤¹¡£
-@example
-mysql> select DAYNAME("1998-02-05");
- -> 'Thursday'
-@end example
-
-@findex MONTHNAME()
-@item MONTHNAME(date)
-·î¤Î̾Á°¤òÊÖ¤·¤Þ¤¹¡£
-@example
-mysql> select MONTHNAME("1998-02-05");
- -> 'February'
-@end example
-
-@findex QUARTER()
-@item QUARTER(date)
-@code{date} ¤Ë¤Ä¤¤¤Æ¤Îǯ¤Î»ÍȾ´ü¤òÊÖ¤·¤Þ¤¹¡£ÈÏ°Ï¤Ï @code{1} ¤«¤é
-@code{4} ¤Ç¤¹¡£
-@example
-mysql> select QUARTER('98-04-01');
- -> 2
-@end example
-
-@findex WEEK()
-@item WEEK(date)
-@itemx WEEK(date,first)
-°ú¿ô¤¬°ì¤Ä¤Î¾ì¹ç¡¢@code{date} ¤Ë¤Ä¤¤¤Æ¤Î½µ¤òÊÖ¤·¤Þ¤¹¡£ÈÏ°Ï¤Ï @code{0} ¤«¤é
-@code{53} (¤½¤¦¡¢53½µ¤ÎºÇ½é¤È¤¤¤¦¤Î¤â¤¢¤ê¤¨¤Þ¤¹)¤Ç¡¢ÆüÍËÆü¤¬½µ¤Î
-ºÇ½é¤ÎÆü¤Ç¤¹¡£°ú¿ô¤¬Æó¤Ä¤Î·Á¼°¤Î @code{WEEK()} ¤Ï¡¢½µ¤Î³«»Ï¤òÆüÍËÆü¤«·îÍË
-Æü¤«»ØÄê¤Ç¤­¤Þ¤¹¡£Âè2°ú¿ô¤¬ @code{0} ¤Î¾ì¹ç¡¢½µ¤Î³«»Ï¤ÏÆüÍËÆü¤Ç¤¹¡£Âè2°ú¿ô
-¤¬ @code{1} ¤Î¾ì¹ç¡¢½µ¤Î³«»Ï¤Ï·îÍËÆü¤Ç¤¹¡£
-@example
-mysql> select WEEK('1998-02-20');
- -> 7
-mysql> select WEEK('1998-02-20',0);
- -> 7
-mysql> select WEEK('1998-02-20',1);
- -> 8
-mysql> select WEEK('1998-12-31',1);
- -> 53
-@end example
-
-@findex YEAR()
-@item YEAR(date)
-ǯ¤òÊÖ¤·¤Þ¤¹ (@code{1000} - @code{9999}).
-@example
-mysql> select YEAR('98-02-03');
- -> 1998
-@end example
-@item YEARWEEK(date)
-@itemx YEARWEEK(date,first)
-¥Ç¡¼¥¿¤Îǯ¤È½µ¤òÊÖ¤·¤Þ¤¹¡£Âè2°ú¿ô¤Ï @code{WEEK()} ¤ÎÂè2°ú¿ô¤È¤Þ¤Ã¤¿¤¯Æ±¤¸
-¤è¤¦¤ËƯ¤­¤Þ¤¹¡£Ãí°Õ: ǯ¤ÎºÇ½é¤ÈºÇ¸å¤Î½µ¤Ç¤Ï¡¢Ç¯¤¬ date °ú¿ôÆâ¤Îǯ¤È¤Ï°Û¤Ê
-¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡ª
-@example
-
-mysql> select YEARWEEK('1987-01-01');
- -> 198653
-@end example
-
-@findex HOUR()
-@item HOUR(time)
-»þ¤òÊÖ¤·¤Þ¤¹ (@code{0} - @code{23})
-@example
-mysql> select HOUR('10:05:03');
- -> 10
-@end example
-
-@findex MINUTE()
-@item MINUTE(time)
-ʬ¤òÊÖ¤·¤Þ¤¹ (@code{0}-@code{59})
-@example
-mysql> select MINUTE('98-02-03 10:05:03');
- -> 5
-@end example
-
-@findex SECOND()
-@item SECOND(time)
-ÉäòÊÖ¤·¤Þ¤¹ (@code{0} to @code{59})
-@example
-mysql> select SECOND('10:05:03');
- -> 3
-@end example
-
-@findex PERIOD_ADD()
-@item PERIOD_ADD(P,N)
-@code{N} ·î¤ò´ü´Ö @code{P} (·¿ @code{YYMM} ¤Þ¤¿¤Ï @code{YYYYMM}) ¤ËÄɲÃ
-¤·¤Þ¤¹¡£@code{YYYYMM} ¤òÊÖ¤·¤Þ¤¹¡£
-
-Ãí°Õ: ´ü´Ö°ú¿ô @code{P} ¤ÏÆüÉÕÃͤǤÏ@emph{¤¢¤ê¤Þ¤»¤ó}¡£
-
-@example
-mysql> select PERIOD_ADD(9801,2);
- -> 199803
-@end example
-
-@findex PERIOD_DIFF()
-@item PERIOD_DIFF(P1,P2)
-´ü´Ö @code{P1} ¤È @code{P2} ¤Îº¹¤Î·î¤òÊÖ¤·¤Þ¤¹¡£@code{P1} ¤È @code{P2} ¤Ï·Á
-¼° @code{YYMM} ¤Þ¤¿¤Ï @code{YYYYMM} ¤Ç¤¹¡£
-
-Ãí°Õ: ´ü´Ö°ú¿ô @code{P1} ¤È @code{P2} ¤ÏÆüÉÕÃͤǤÏ@emph{¤¢¤ê¤Þ¤»¤ó}¡£
-
-@example
-mysql> select PERIOD_DIFF(9802,199703);
- -> 11
-@end example
-
-@findex DATE_ADD()
-@findex DATE_SUB()
-@findex ADDDATE()
-@findex SUBDATE()
-@findex EXTRACT(type FROM date)
-@item DATE_ADD(date,INTERVAL expr type)
-@itemx DATE_SUB(date,INTERVAL expr type)
-@itemx ADDDATE(date,INTERVAL expr type)
-@itemx SUBDATE(date,INTERVAL expr type)
-
-¤³¤ì¤é´Ø¿ô¤ÏÆüÉդα黻¤Ë»ÈÍѤ·¤Þ¤¹¡£ ¤³¤ì¤é¤Ï @strong{MySQL} 3.22 ¤Î
-¿·¤·¤¤µ¡Ç½¤Ç¤¹¡£ @code{ADDDATE()} ¤È @code{SUBDATE()} ¤Ï
-@code{DATE_ADD()} , @code{DATE_SUB()} ¤ÈƱµÁ¤Ç¤¹¡£
-
-@strong{MySQL} 3.23 ¤Ç¤Ï, @code{+} ¤È @code{-} ¤ò
-@code{DATE_ADD()} , @code{DATE_SUB()} ¤ÎÂå¤ï¤ê¤Ë»ÈÍѤǤ­¤Þ¤¹. (See example)
-
-@code{date} ¤Ë¤Ï¡¢@code{DATETIME} ¤« @code{DATE} ·¿¤ÎÃͤò»ØÄꤷ¤Þ¤¹¡£
-¤³¤ÎÃͤ«¤é±é»»¤¬³«»Ï¤µ¤ì¤Þ¤¹¡£
-@code{expr} ¤Ë¤Ï¡¢date ¤«¤éÁý¸º¤µ¤»¤ëÃͤò»ØÄꤷ¤Þ¤¹¡£
-@code{expr} ¤¬ @samp{-} ¤«¤é»Ï¤Þ¤Ã¤Æ¤¤¤ì¤Ð¡¢Éé¿ô¤ò¼¨¤·¤Þ¤¹¡£
-@code{type} ¤Ï¤É¤ì¤°¤é¤¤¤Î´ü´Ö¤«¤ò¼¨¤¹¥­¡¼¥ï¡¼¥É¤Ç¤¹¡£
-
-@code{EXTRACT(type FROM date)} ´Ø¿ô¤Ï¡¢date ¤«¤é 'type' ¤ÎÉôʬ¤òÊÖ¤·¤Þ¤¹¡£
-
-°Ê²¼¤Îɽ¤Ë¡¢@code{type} ¤È @code{expr} ¤Î´ØÏ¢¤ò¼¨¤·¤Þ¤¹¡§
-
-@multitable @columnfractions .18 .3 .42
-@item @code{type} @strong{ÃÍ} @tab @strong{°ÕÌ£} @tab @code{expr} @strong{¤Î¥Õ¥©¡¼¥Þ¥Ã¥È}
-@item @code{SECOND} @tab ÉÃ @tab @code{SECONDS}
-@item @code{MINUTE} @tab ʬ @tab @code{MINUTES}
-@item @code{HOUR} @tab »þ´Ö @tab @code{HOURS}
-@item @code{DAY} @tab Æü @tab @code{DAYS}
-@item @code{MONTH} @tab ·î @tab @code{MONTHS}
-@item @code{YEAR} @tab ǯ @tab @code{YEARS}
-@item @code{MINUTE_SECOND} @tab ʬ¤ÈÉà @tab @code{"MINUTES:SECONDS"}
-@item @code{HOUR_MINUTE} @tab »þ´Ö¤Èʬ @tab @code{"HOURS:MINUTES"}
-@item @code{DAY_HOUR} @tab Æü ¤È»þ´Ö @tab @code{"DAYS HOURS"}
-@item @code{YEAR_MONTH} @tab ǯ ¤È·î @tab @code{"YEARS-MONTHS"}
-@item @code{HOUR_SECOND} @tab »þ´Ö¤Èʬ @tab @code{"HOURS:MINUTES:SECONDS"}
-@item @code{DAY_MINUTE} @tab Æü¡¢»þ¡¢Ê¬ @tab @code{"DAYS HOURS:MINUTES"}
-@item @code{DAY_SECOND} @tab Æü¡¢»þ¡¢Ê¬¡¢Éà @tab @code{"DAYS HOURS:MINUTES:SECONDS"}
-@end multitable
-
-@strong{MySQL} ¤Ï¡¢ @code{expr} ¥Õ¥©¡¼¥Þ¥Ã¥ÈÆâ¤Î¤¤¤«¤Ê¤ë¶çÆÉÅÀ¶èÀÚ¤ê¤ò¤âµö¤·¤Þ¤¹¡£
-¾å¤ÎɽÃæ¤Î¶èÀÚ¤êʸ»ú¤ÏÄó°Æ¤¹¤ë¶èÀÚ¤êʸ»ú¤Ç¤¹¡£ ¤â¤· @code{date} °ú¿ô¤¬
- @code{DATE} Ãͤǡ¢@code{YEAR}, @code{MONTH}, @code{DAY} ¤ÎÉôʬ¤Î¤ß¤ò´Þ¤à
-·×»»¤ò¤¹¤ë¤Ê¤é¡¢·ë²Ì¤Ï @code{DATE} Ãͤ¬ÊÖ¤ê¤Þ¤¹¡£ ¤½¤ì°Ê³°¤Ê¤é @code{DATETIME} Ãͤ¬
-ÊÖ¤ê¤Þ¤¹¡£
-
-@example
-mysql> SELECT "1997-12-31 23:59:59" + INTERVAL 1 SECOND;
- -> 1998-01-01 00:00:00
-mysql> SELECT INTERVAL 1 DAY + "1997-12-31";
- -> 1998-01-01
-mysql> SELECT "1998-01-01" - INTERVAL 1 SECOND;
- -> 1997-12-31 23:59:59
-mysql> SELECT DATE_ADD("1997-12-31 23:59:59",
- INTERVAL 1 SECOND);
- -> 1998-01-01 00:00:00
-mysql> SELECT DATE_ADD("1997-12-31 23:59:59",
- INTERVAL 1 DAY);
- -> 1998-01-01 23:59:59
-mysql> SELECT DATE_ADD("1997-12-31 23:59:59",
- INTERVAL "1:1" MINUTE_SECOND);
- -> 1998-01-01 00:01:00
-mysql> SELECT DATE_SUB("1998-01-01 00:00:00",
- INTERVAL "1 1:1:1" DAY_SECOND);
- -> 1997-12-30 22:58:59
-mysql> SELECT DATE_ADD("1998-01-01 00:00:00",
- INTERVAL "-1 10" DAY_HOUR);
- -> 1997-12-30 14:00:00
-mysql> SELECT DATE_SUB("1998-01-02", INTERVAL 31 DAY);
- -> 1997-12-02
-mysql> SELECT EXTRACT(YEAR FROM "1999-07-02");
- -> 1999
-mysql> SELECT EXTRACT(YEAR_MONTH FROM "1999-07-02 01:02:03");
- -> 199907
-mysql> SELECT EXTRACT(DAY_MINUTE FROM "1999-07-02 01:02:03");
- -> 20102
-@end example
-
-¤â¤·¤¢¤Ê¤¿¤Î»ØÄꤹ¤ë interval Ãͤ¬Ã»¤¹¤®¤ë¤Ê¤é( @code{type} ¥­¡¼¥ï¡¼¥É¤«¤é
-Îà¿ä¤µ¤ì¤ëÃͤò´Þ¤ó¤Ç¤¤¤Ê¤¤¾ì¹ç)¡¢ @strong{MySQL} ¤Ï interval ÃͤΰìÈÖ
-º¸¤ÎÉôʬ¤ò»ØÄꤷ˺¤ì¤¿¤â¤Î¤À¤È²¾Äꤷ¤Þ¤¹¡£
-Î㤨¤Ð¡¢¤â¤· @code{type} ¤ò @code{DAY_SECOND} ¤Ë»ØÄꤷ¤¿¾ì¹ç¡¢
- @code{expr} ¤ÎÃÍ¤Ï Æü¡¢»þ¡¢Ê¬¡¢Éà ¤«¤é¤Ê¤ëʪ¤È´üÂÔ¤µ¤ì¤Þ¤¹¡£
-¤³¤³¤Ç¤¢¤Ê¤¿¤¬ @code{"1:10"} ¤Î¤è¤¦¤ÊÃͤò»ØÄꤷ¤Æ¤¤¤¿¤Ê¤é¡¢
- @strong{MySQL} ¤Ï¡¢Æü¡¢»þ ¤ÎÉôʬ¤¬Ëº¤ìµî¤é¤ì¤Æ¡¢Ê¬¡¢Éà ¤¬Í¿¤¨¤é¤ì¤¿¤È
-¿äÄꤷ¤Þ¤¹¡£
-¤Ä¤Þ¤ê¡¢ @code{"1:10" DAY_SECOND} ¤Ï @code{"1:10" MINUTE_SECOND} ¤Ç
-¤¢¤ë¤ÈÍý²ò¤µ¤ì¤ë¤Î¤Ç¤¹¡£
-¤³¤ì¤Ï¡¢@strong{MySQL} ¤¬ @code{TIME} Ãͤò»þ¹ï¤Ç¤Ï¤Ê¤¯·Ð²á»þ´Ö¤Îɽ¸½¤È²ò¼á
-¤¹¤ëÊýË¡¤ËÎà»÷¤·¤Æ¤¤¤Þ¤¹¡£
-
-¤â¤·¡¢ÉÔÀµ¤ÊÃͤ¬»ÈÍѤµ¤ì¤¿¤Ê¤é¡¢·ë²Ì¤Ï @code{NULL} ¤Ç¤¹.
-¤â¤· @code{MONTH} ¤ä @code{YEAR_MONTH} ¤ä @code{YEAR} ¤ò­¤·»»¤·¤Æ¡¢
-·ë²Ì¤È¤Ê¤ëÆüÉÕ¤¬¿·¤·¤¤·î¤ÎºÇÂçÆü¤è¤ê¤âÂ礭¤¤Æü¤Ë¤Ê¤ë¤è¤¦¤Ê¤é¡¢
-¤½¤ÎÆü¤Ï¡¢¿·¤·¤¤·î¤ÎºÇÂçÆü¤Ë½¤Àµ¤µ¤ì¤Þ¤¹¡£
-
-@example
-mysql> select DATE_ADD('1998-01-30',Interval 1 month);
- -> 1998-02-28
-@end example
-
-Îã¤Î¤è¤¦¤Ë¡¢@code{INTERVAL} ¤È @code{type} ¥­¡¼¥ï¡¼¥É¤Ï
-¥±¡¼¥¹°Í¸¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-
-@findex TO_DAYS()
-@item TO_DAYS(date)
-ÆüÉÕ @code{date} ¤òÍ¿¤¨¤ë¤È¡¢0ǯ¤«¤é¤ÎÆü¿ô¤òÊÖ¤·¤Þ¤¹¡£
-
-@example
-mysql> select TO_DAYS(950501);
- -> 728779
-mysql> select TO_DAYS('1997-10-07');
- -> 729669
-@end example
-
-@code{TO_DAYS()} ¤Ï¥°¥ì¥´¥ê¥ªÎò¤Î³«»Ï(1582)¤è¤êÁ°¤ÎÃͤǤλÈÍѤò°Õ¿Þ¤µ¤ì¤Æ
-¤¤¤Þ¤»¤ó¡£Îò¤¬Êѹ¹¤µ¤ì¤¿»þ¤Ë¼º¤ï¤ì¤¿Æü¤ò¹Íθ¤ËÆþ¤ì¤Æ¤Ê¤¤¤«¤é¤Ç¤¹¡£
-
-@findex FROM_DAYS()
-@item FROM_DAYS(N)
-Given a daynumber @code{N}, returns a @code{DATE} value.
-
-@example
-mysql> select FROM_DAYS(729669);
- -> '1997-10-07'
-@end example
-
-@code{FROM_DAYS()} ¤Ï¥°¥ì¥´¥ê¥ªÎò¤Î³«»Ï(1582)¤è¤êÁ°¤ÎÃͤǤλÈÍѤò°Õ¿Þ¤µ¤ì
-¤Æ¤¤¤Þ¤»¤ó¡£Îò¤¬Êѹ¹¤µ¤ì¤¿»þ¤Ë¼º¤ï¤ì¤¿Æü¤ò¹Íθ¤ËÆþ¤ì¤Æ¤Ê¤¤¤«¤é¤Ç¤¹¡£
-
-@findex DATE_FORMAT()
-@item DATE_FORMAT(date,format)
-@code{date} Ãͤò @code{format} ʸ»úÎó¤Ë½¾¤Ã¤ÆÀ°·Á¤·¤Þ¤¹¡£¼¡¤Î»ØÄ꤬
-@code{format} ʸ»úÎó¤Ç»ÈÍѤǤ­¤Þ¤¹:
-@multitable @columnfractions .1 .9
-@item @code{%M} @tab ·î̾ (@code{January}..@code{December})
-@item @code{%W} @tab ÍËÆü (@code{Sunday}..@code{Saturday})
-@item @code{%D} @tab ±Ñ¸ì¥µ¥Õ¥£¥Ã¥¯¥¹ÉÕ¤­·î¤ÎÆü (@code{1st}, @code{2nd}, @code{3rd}, etc.)
-@item @code{%Y} @tab 4·å¤Îǯ
-@item @code{%y} @tab 2·å¤Îǯ
-@item @code{%X} @tab ½µ¤Îǯ¡£½µ¤ÎºÇ½é¤ÎÆü¤ÏÆüÍËÆü¡£4·å¤Î¿ôÃÍ¡£'%V' ¤È¶¦¤Ë»ÈÍѤµ¤ì¤Þ¤¹
-@item @code{%x} @tab ½µ¤Îǯ¡£½µ¤ÎºÇ½é¤ÎÆü¤Ï·îÍËÆü¡£4·å¤Î¿ôÃÍ¡£'%v' ¤È¶¦¤Ë»ÈÍѤµ¤ì¤Þ¤¹
-@item @code{%a} @tab ¾Êά¤µ¤ì¤¿ÍËÆü̾ (@code{Sun}..@code{Sat})
-@item @code{%d} @tab ·î¤ÎÆü, ¿ôÃÍ (@code{00}..@code{31})
-@item @code{%e} @tab ·î¤ÎÆü, ¿ôÃÍ (@code{0}..@code{31})
-@item @code{%m} @tab ·î, ¿ôÃÍ (@code{01}..@code{12})
-@item @code{%c} @tab ·î, ¿ôÃÍ (@code{1}..@code{12})
-@item @code{%b} @tab ¾Êά¤µ¤ì¤¿·î̾ (@code{Jan}..@code{Dec})
-@item @code{%j} @tab ǯ¤ÎÆü (@code{001}..@code{366})
-@item @code{%H} @tab »þ (@code{00}..@code{23})
-@item @code{%k} @tab »þ (@code{0}..@code{23})
-@item @code{%h} @tab »þ (@code{01}..@code{12})
-@item @code{%I} @tab »þ (@code{01}..@code{12})
-@item @code{%l} @tab »þ (@code{1}..@code{12})
-@item @code{%i} @tab ʬ, ¿ôÃÍ (@code{00}..@code{59})
-@item @code{%r} @tab »þ¹ï, 12»þ´Ö (@code{hh:mm:ss [AP]M})
-@item @code{%T} @tab »þ¹ï, 24»þ´Ö (@code{hh:mm:ss})
-@item @code{%S} @tab ÉÃ (@code{00}..@code{59})
-@item @code{%s} @tab ÉÃ (@code{00}..@code{59})
-@item @code{%p} @tab @code{AM} or @code{PM}
-@item @code{%w} @tab ½µ¤ÎÆü (@code{0}=Sunday..@code{6}=Saturday)
-@item @code{%U} @tab ½µ (@code{0}..@code{53}), ½µ¤Î¤Ï¤¸¤Þ¤ê¤ò ÆüÍˤȤ·¤¿¾ì¹ç
-@item @code{%u} @tab ½µ (@code{0}..@code{53}), ½µ¤Î¤Ï¤¸¤Þ¤ê¤ò ·îÍˤȤ·¤¿¾ì¹ç
-@item @code{%V} @tab ½µ (@code{1}..@code{53}), ½µ¤Î¤Ï¤¸¤Þ¤ê¤ÏÆüÍËÆü¡£'%X' ¤È¶¦¤Ë»ÈÍѤµ¤ì¤Þ¤¹
-@item @code{%v} @tab ½µ (@code{1}..@code{53}), ½µ¤Î¤Ï¤¸¤Þ¤ê¤Ï·îÍËÆü¡£'%x' ¤È¶¦¤Ë»ÈÍѤµ¤ì¤Þ¤¹
-@item @code{%%} @tab ¥ê¥Æ¥é¥ë @samp{%}¡£
-@end multitable
-
-¾¤ÎÁ´¤Æ¤Îʸ»ú¤Ï²ò¼á¤µ¤ì¤º¤Ë·ë²Ì¤Ë¥³¥Ô¡¼¤µ¤ì¤Þ¤¹¡£
-
-@example
-mysql> select DATE_FORMAT('1997-10-04 22:23:00', '%W %M %Y');
- -> 'Saturday October 1997'
-mysql> select DATE_FORMAT('1997-10-04 22:23:00', '%H:%i:%s');
- -> '22:23:00'
-mysql> select DATE_FORMAT('1997-10-04 22:23:00',
- '%D %y %a %d %m %b %j');
- -> '4th 97 Sat 04 10 Oct 277'
-mysql> select DATE_FORMAT('1997-10-04 22:23:00',
- '%H %k %I %r %T %S %w');
- -> '22 22 10 10:23:00 PM 22:23:00 00 6'
-mysql> select DATE_FORMAT('1999-01-01', '%X %V');
- -> '1998 52'
-@end example
-
-@strong{MySQL} 3.23 ¤Ç¤Ï¡¢ @code{%} ʸ»ú¤Ï¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»ú¤ÎÁ°¤Ëɬ¤ºÉ¬ÍפȤµ¤ì¤Þ¤¹¡£
-¤½¤ì¤è¤êÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢ @code{%} ʸ»ú¤Ï¥ª¥×¥·¥ç¥ó¤Ç¤·¤¿¡£
-
-@findex TIME_FORMAT()
-@item TIME_FORMAT(time,format)
-¤³¤ì¤Ï¾åµ­¤Î @code{DATE_FORMAT()} ¤Î¤è¤¦¤Ë»ÈÍѤµ¤ì¤Þ¤¹¤¬¡¢
-@code{format} ¥ª¥×¥·¥ç¥ó¤Ç¤Ï¡¢»þ,ʬ,ÉäÀ¤±¤òÁàºî¤Ç¤­¤Þ¤¹¡£
-¾¤Î¥ª¥×¥·¥ç¥ó¤Ï @code{NULL} or @code{0} ¤òÍ¿¤¨¤Þ¤¹¡£
-
-@findex CURDATE()
-@findex CURRENT_DATE
-@item CURDATE()
-@itemx CURRENT_DATE
-º£Æü¤ÎÆüÉÕ¤òÊÖ¤·¤Þ¤¹¡£ÆüÉդηÁ¼°¤Ï¡¢@code{CURDATE()} ¤¬¿ôÃͤޤ¿¤Ïʸ»úÎó¤Î¤É¤Á
-¤é¤Îʸ̮¤Ç»ÈÍѤµ¤ì¤¿¤«¤Ë°Í¸¤·¤Æ @code{YYYYMMDD} ¤Þ¤¿¤Ï @code{'YYYY-MM-DD'} ¤ÇÊÖ¤µ¤ì¤Þ¤¹¡£
-
-@example
-mysql> select CURDATE();
- -> '1997-12-15'
-mysql> select CURDATE() + 0;
- -> 19971215
-@end example
-
-@findex CURTIME()
-@findex CURRENT_TIME
-@item CURTIME()
-@itemx CURRENT_TIME
-¸½ºß¤Î»þ¹ï¤ò @code{HHMMSS} ¤Þ¤¿¤Ï @code{'HH:MM:SS'} ¤Î·Á¼°¤ÇÊÖ¤·¤Þ¤¹¡£¤³
-¤ì¤Ï @code{CURTIME()} ¤¬¿ôÃͤޤ¿¤Ïʸ»úÎó¤Î¤É¤Á¤é¤Îʸ̮¤Ç»ÈÍѤµ¤ì¤¿¤«¤Ë°Í
-¸¤·¤Þ¤¹¡£
-
-@example
-mysql> select CURTIME();
- -> '23:50:26'
-mysql> select CURTIME() + 0;
- -> 235026
-@end example
-
-@findex NOW()
-@findex SYSDATE()
-@findex CURRENT_TIMESTAMP
-@item NOW()
-@itemx SYSDATE()
-@itemx CURRENT_TIMESTAMP
-¸½ºß¤Î»þ¹ï¤òÊÖ¤·¤Þ¤¹¡£¿ôÃͤޤ¿¤Ïʸ»úÎó¤Î¤É¤Á¤é¤Îʸ̮¤Ç»ÈÍѤµ¤ì¤¿¤«¤Ë°Í¸¤·¤Æ
- @code{YYYYMMDDHHMMSS} ¤Þ¤¿¤Ï @code{'YYYY-MM-DD HH:MM:SS'} ·Á¼°¤ÇÊÖ¤µ¤ì¤Þ¤¹¡£
-
-@example
-mysql> select NOW();
- -> '1997-12-15 23:50:26'
-mysql> select NOW() + 0;
- -> 19971215235026
-@end example
-
-@findex UNIX_TIMESTAMP()
-@item UNIX_TIMESTAMP()
-@itemx UNIX_TIMESTAMP(date)
-°ú¿ô¤Ê¤·¤Ç¸Æ¤Ó½Ð¤µ¤ì¤¿¾ì¹ç¤Ï¡¢UNIX timestamp (GMT @code{'1970-01-01 00:00:00'} ¤«
-¤é¤ÎÉÿô) ¤Ç¤¹¡£Ä̾ï¤Ï¡¢@code{TIMESTAMP} ¥Õ¥£¡¼¥ë¥É¤ò°ú¿ô¤È¤·¤Æ¸Æ¤Ó½Ð¤·¡¢¥Õ¥£¡¼¥ë¥É¤Î
-ÃͤòÉÿô¤ÇÊÖ¤·¤Þ¤¹¡£@code{date} ¤Ï¥í¡¼¥«¥ë»þ¹ï¤Ç¤Î @code{DATE} ʸ»úÎó¡¢@code{DATETIME}
-ʸ»úÎ󡢤ޤ¿¤Ï @code{YYMMDD} ¤Þ¤¿¤Ï @code{YYYYMMDD} ·Á¼°¤Î¿ôÃͤǤ¹¡£
-
-@example
-mysql> select UNIX_TIMESTAMP();
- -> 882226357
-mysql> select UNIX_TIMESTAMP('1997-10-04 22:23:00');
- -> 875996580
-@end example
-
-@code{UNIX_TIMESTAMP} ¤¬ @code{TIMESTAMP} ¥Õ¥£¡¼¥ë¥É¤Ë»ÈÍѤµ¤ì¤¿¾ì¹ç¡¢
-¤³¤Î´Ø¿ô¤Ï¡¢°ÅÌۤΠ``ʸ»ú¤«¤é UNIX ¥¿¥¤¥à¥¹¥¿¥ó¥×'' ÊÑ´¹¤ò¤¹¤ë¤³¤È¤Ê¤¯¡¢
-ÃͤòÆÀ¤Þ¤¹¡£
-
-@findex FROM_UNIXTIME()
-@item FROM_UNIXTIME(Unix_timestamp)
-ʸ̮(¿ôÃÍ/ʸ»úÎó)¤Ë°Í¸¤·¤Æ¡¢@code{'YYYY-MM-DD HH:MM:SS'} ¤Þ¤¿¤Ï
-@code{YYYYMMDDHHMMSS} ·Á¼°¤Î timestamp ʸ»úÎó¤òÊÖ¤·¤Þ¤¹¡£
-
-@example
-mysql> select FROM_UNIXTIME(875996580);
- -> '1997-10-04 22:23:00'
-mysql> select FROM_UNIXTIME(875996580) + 0;
- -> 19971004222300
-@end example
-
-@findex FROM_UNIXTIME()
-@item FROM_UNIXTIME(unix_timestamp,format)
-@code{format} ¤Ë½¾¤Ã¤ÆÀ°·Á¤µ¤ì¤¿ Unix timestamp ʸ»úÎó¤òÊÖ¤·¤Þ¤¹¡£
-@code{format} ¤Ï @code{DATE_FORMAT()} ´Ø¿ô¤Î¥¨¥ó¥È¥ê¤Ë°ìÍ÷¤µ¤ì¤¿¤Î¤ÈƱ¤¸»Ø
-Äê»Ò¤ò´Þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@example
-mysql> select FROM_UNIXTIME(UNIX_TIMESTAMP(),
- '%Y %D %M %h:%i:%s %x');
- -> '1997 23rd December 03:43:30 x'
-@end example
-
-@findex SEC_TO_TIME()
-@item SEC_TO_TIME(seconds)
-@code{seconds} °ú¿ô¤ò»þʬÉäËÊÑ´¹¤·¤ÆÊÖ¤·¤Þ¤¹¡£´Ø¿ô¤¬Ê¸»úÎóʸ̮¤Þ¤¿¤Ï¿ôÃÍ
-ʸ̮¤Î¤É¤Á¤é¤Ç»ÈÍѤµ¤ì¤¿¤«¤Ë°Í¸¤·¤Æ¡¢@code{'HH:MM:SS'} ¤Þ¤¿¤Ï
-@code{HHMMSS} ·Á¼°¤ÇÃͤòÊÖ¤·¤Þ¤¹¡£
-
-@example
-mysql> select SEC_TO_TIME(2378);
- -> '00:39:38'
-mysql> select SEC_TO_TIME(2378) + 0;
- -> 3938
-@end example
-
-@findex TIME_TO_SEC()
-@item TIME_TO_SEC(time)
-@code{time} ¤òÉäËÊÑ´¹¤·¤Þ¤¹¡£
-
-@example
-mysql> select TIME_TO_SEC('22:23:00');
- -> 80580
-mysql> select TIME_TO_SEC('00:39:38');
- -> 2378
-@end example
-@end table
-
-@findex Miscellaneous functions
-@findex Functions, miscellaneous
-@node Miscellaneous functions, Group by functions, Date and time functions, Functions
-@subsection ¤½¤Î¾¤Î´Ø¿ô
-
-@table @code
-@findex DATABASE()
-@item DATABASE()
-¸½ºß¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¤òÊÖ¤·¤Þ¤¹¡£
-@example
-mysql> select DATABASE();
- -> 'test'
-@end example
-
-¤â¤·¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤Ê¤¤¤Ê¤é¡¢@code{DATABASE()} ¤Ï¶õʸ»ú¤òÊÖ¤·¤Þ¤¹¡£
-
-@findex USER()
-@findex SYSTEM_USER()
-@findex SESSION_USER()
-@item USER()
-@itemx SYSTEM_USER()
-@itemx SESSION_USER()
-¸½ºß¤Î @strong{MySQL} ¥æ¡¼¥¶Ì¾¤òÊÖ¤·¤Þ¤¹¡£
-@example
-mysql> select USER();
- -> 'davida@@localhost'
-@end example
-
-@strong{MySQL} 3.22.11 °Ê¹ß¤Ç¤Ï¡¢¤³¤Î´Ø¿ô¤Ï¥æ¡¼¥¶¡¼Ì¾¤È¥¯¥é¥¤¥¢¥ó¥È¤Î¥Û¥¹¥È̾¤ò´Þ¤ß¤Þ¤¹¡£
-¥æ¡¼¥¶¡¼Ì¾¤ÎÉôʬ¤À¤±¼è¤ê½Ð¤¹¤Ë¤Ï¼¡¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡£
-¡Ê¤³¤ì¤Ï¥Û¥¹¥È̾¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¯¤È¤âÆ°¤¯¤Ç¤·¤ç¤¦¡Ë¡§
-
-@example
-ysql> select substring_index(USER(),"@@",1);
- -> 'davida'
-@end example
-
-@findex PASSWORD()
-@item PASSWORD(str)
-¥×¥ì¡¼¥ó¥Æ¥­¥¹¥È¤Î¥Ñ¥¹¥ï¡¼¥É @code{str} ¤«¤é¥Ñ¥¹¥ï¡¼¥Éʸ»úÎó¤ò·×»»¤·¤Þ¤¹¡£
-¤³¤ì¤Ï @code{user} µö²Ä¥Æ¡¼¥Ö¥ë¤Î @code{Password} ¥Õ¥£¡¼¥ë¥É¤Ë¡¢
-°Å¹æ²½¤µ¤ì¤¿ @strong{MySQL} ¥Ñ¥¹¥ï¡¼¥É¤òÊݸ¤¹¤ëºÝ¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£
-
-@example
-mysql> select PASSWORD('badpwd');
- -> '7f84554057dd964b'
-@end example
-
-@cindex Password encryption, reversibility of
-@code{PASSWORD()} °Å¹æ¤ÏÉԲĵդǤ¹¡£
-
-@code{PASSWORD()} ¤Ï UNIX ¤Î¥Ñ¥¹¥ï¡¼¥É¤¬°Å¹æ²½¤¹¤ë¤Î¤ÈƱ¤¸ÊýË¡¤Ç
-°Å¹æ²½¤ò¹Ô¤¦¤ï¤±¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-UNIX ¤Î¥Ñ¥¹¥ï¡¼¥É¤È @strong{MySQL} ¤Î¥Ñ¥¹¥ï¡¼¥É¤¬Æ±¤¸¤È»×¤Ã¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£
-UNIX ¤Î¥Ñ¥¹¥ï¡¼¥É¥Õ¥¡¥¤¥ë¤ËÊݸ¤µ¤ì¤ëÃͤ¬ @code{PASSWORD()} ¤¬ÊÖ¤¹¤È
-¹Í¤¨¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£
-@code{ENCRYPT()} »²¾È¡£
-
-@findex ENCRYPT()
-@item ENCRYPT(str[,salt])
-UNIX ¤Î @code{crypt()} ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ç @code{str} ¤ò°Å¹æ²½¤·¤Þ¤¹¡£
-@code{salt} ¤Ï2ʸ»ú¤Îʸ»úÎó¤Ç¤¹¡£
-(@strong{MySQL} 3.22.16 ¤Ç, @code{salt} ¤Ï2ʸ»ú°Ê¾åµö¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£)
-
-@example
-mysql> select ENCRYPT("hello");
- -> 'VxuFAJXVARROc'
-@end example
-
-¥·¥¹¥Æ¥à¤Ç @code{crypt()} ¤¬ÍøÍѤǤ­¤Ê¤¤¾ì¹ç¤Ï @code{ENCRYPT()} ¤Ï¾ï¤Ë
-@code{NULL} ¤òÊÖ¤·¤Þ¤¹¡£
-
-¾¯¤Ê¤¯¤È¤â¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢
-@code{ENCRYPT()} ¤Ï @code{str} ʸ»úÃæ¤ÎºÇ½é¤Î 8 ʸ»ú°Ê³°¤ÏÁ´¤Æ̵»ë¤·¤Þ¤¹¡£
-¤³¤ì¤Ï @code{crypt()} ¥·¥¹¥Æ¥à¥³¡¼¥ë¤Î¿¶¤ëÉñ¤¤¤Ë¤è¤Ã¤Æ·èÄê¤Å¤±¤é¤ì¤Þ¤¹¡£
-
-@findex ENCODE()
-@item ENCODE(str,pass_str)
-¥Ñ¥¹¥ï¡¼¥É¤È¤·¤Æ @code{pass_str} ¤òÍѤ¤¤Æ @code{str} ¤ò°Å¹æ²½¤·¤Þ¤¹¡£·ë²Ì
-¤òÉü¹æ²½¤¹¤ë¤Ë¤Ï¡¢@code{DECODE()}¤ò»ÈÍѤ·¤Þ¤¹¡£
-
-·ë²Ì¤Ï¥Ð¥¤¥Ê¥êʸ»úÎó¤Ç¤¹¡£¥Õ¥£¡¼¥ë¥É¤Ë¤½¤ì¤òÊݸ¤·¤¿¤¤¾ì¹ç¤Ï @code{BLOB}
-¥Õ¥£¡¼¥ë¥É·¿¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
-
-@findex DECODE()
-@item DECODE(crypt_str,pass_str)
-°Å¹æ²½¤µ¤ì¤¿Ê¸»úÎó @code{crypt_str} ¤ò¥Ñ¥¹¥ï¡¼¥É¤È¤·¤Æ @code{pass_str} ¤ò
-ÍѤ¤¤ÆÉü¹æ²½¤·¤Þ¤¹¡£@code{crypt_str} ¤Ï @code{ENCODE()} ¤«¤éÊÖ¤µ¤ì¤¿Ê¸»úÎó
-¤Ç¤¢¤ë¤Ù¤­¤Ç¤¹¡£
-
-@findex MD5()
-@item MD5(string)
-ʸ»úÎó¤ò MD5 ¥Á¥§¥Ã¥¯¥µ¥à¤·¤¿·ë²Ì¤òÊÖ¤·¤Þ¤¹¡£ ÃÍ¤Ï 32 ·å¤Î 16¿Êɽ¼¨¤Ç¤¹¡£
-Î㤨¤Ð¥Ï¥Ã¥·¥å¥­¡¼¤È¤·¤Æ»ÈÍѤǤ­¤ë¤è¤¦¤Ë¡£
-
-@example
-mysql> select MD5("testing")
- -> 'ae2b1fca515949e5d54fb22b8ed95575'
-@end example
-
-¤³¤ì¤Ï "RSA Data Security, Inc. MD5 Message-Digest Algorithm".
-
-@findex LAST_INSERT_ID([expr])
-@item LAST_INSERT_ID([expr])
-ºÇ¸å¤Ë @code{AUTO_INCREMENT} ¥Õ¥£¡¼¥ë¥É¤ËÁÞÆþ¤µ¤ì¤Æ¼«Æ°Åª¤ËÀ¸À®¤µ¤ì¤¿ÃͤòÊÖ¤·¤Þ¤¹¡£
-@xref{mysql_insert_id, , @code{mysql_insert_id()}}.
-
-@example
-mysql> select LAST_INSERT_ID();
- -> 195
-@end example
-
-ºÇ¸å¤ÎºîÀ®¤µ¤ì¤¿ ID ¤Ï¤½¤ì¤¾¤ì¤Î¥³¥Í¥¯¥·¥ç¥óËè¤Ë¥µ¡¼¥Ð¡¼¤Ë°Ý»ý¤µ¤ì¤Þ¤¹¡£
-¤³¤ì¤Ï¾¤Î¥¯¥é¥¤¥¢¥ó¥È¤«¤é¤ÏÊѹ¹¤Ç¤­¤Ê¤¤¤Ç¤·¤ç¤¦¡£
-¤â¤·Â¾¤ÎÈó¥Þ¥¸¥Ã¥¯Ãͤò¤â¤Ä @code{AUTO_INCREMENT} ¥Õ¥£¡¼¥ë¥É
-¡ÊÃͤ¬ @code{NULL} ¤Ç¤â @code{0} ¤Ç¤â¤Ê¤¤¤È¤¤¤¦¤³¤È¡Ë
-¤ò¹¹¿·¤·¤Æ¤â¡¢¤³¤ì¤Ï Êѹ¹¤µ¤ì¤Þ¤»¤ó¡£
-
-@cindex Sequence emulation
-¤â¤· @code{UPDATE} ÀáÆâ¤Î @code{LAST_INSERT_ID()} ¤Î°ú¿ô¤Ë @code{expr} ¤ò»ØÄꤹ¤ë¤È¡¢
-°ú¿ô¤ÎÃÍ¤Ï @code{LAST_INSERT_ID()} ¤ÎÃͤȤ·¤ÆÊÖ¤ê¤Þ¤¹¡£
-¤³¤ì¤Ï ¥·¡¼¥±¥ó¥¹ÈÖ¹æ¤Î¥·¥ß¥å¥ì¡¼¥·¥ç¥ó¤Ë»ÈÍѤǤ­¤Þ¤¹¡§
-
-ºÇ½é¤Ë¥Æ¡¼¥Ö¥ë¤òºîÀ®¡§
-
-@example
-mysql> create table sequence (id int not null);
-mysql> insert into sequence values (0);
-@end example
-
-¤½¤·¤Æ°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ¥·¡¼¥±¥ó¥¹ÈÖ¹æ¤òÀ¸À®¡§
-
-@example
-mysql> UPDATE sequence SET id=last_insert_id(id+1);
-@end example
-
-@code{LAST_INSERT_ID()} ¤Î¸Æ¤Ó½Ð¤·Ìµ¤·¤Ç¥·¡¼¥±¥ó¥¹ÈÖ¹æ¤òÀ¸À®¤¹¤ë¤³¤È¤¬²Äǽ
-¤Ç¤¹¤¬¡¢¤³¤ÎÊýË¡¤Ç¤³¤Î´Ø¿ô¤ò»ÈÍѤ¹¤ë¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ï¡¢ID Ãͤ¬ºÇ¸å¤Ë¼«Æ°Åª
-¤ËÀ¸À®¤µ¤ì¤¿ÃͤȤ·¤Æ¥µ¡¼¥Ð¤Ë´ÉÍý¤µ¤ì¤Þ¤¹¡£@strong{MySQL} Æâ¤ÎÄ̾ï¤ÎǤ°Õ¤Î
-@code{AUTO_INCREMENT} ÃͤòÆɤ߹þ¤ó¤Ç¿·¤·¤¤ ID ¤ò¼è¤ê½Ð¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£Îã
-¤¨¤Ð¡¢@code{LAST_INSERT_ID()} (°ú¿ô̵¤·) ¤Ï¿·¤·¤¤ ID ¤òÊÖ¤·¤Þ¤¹¡£C API ´Ø
-¿ô @code{mysql_insert_id()} ¤â¤³¤ÎÃͤòÆÀ¤ë¤¿¤á¤Ë»ÈÍѤǤ­¤Þ¤¹¡£
-
-@findex FORMAT()
-@item FORMAT(X,D)
-@code{'#,###,###.##'} ¤Î¤è¤¦¤Ê·Á¼°(¾®¿ôÉô @code{X} ·å)¤Ç¿ôÃÍ @code{D} ¤òÀ°·Á
-¤·¤Þ¤¹¡£ ¤â¤· @code{D} ¤¬ @code{0} ¤Ê¤é, ·ë²Ì¤Ë¤Ï¤¤¤«¤Ê¤ë
-¾®¿ôÅÀ¤â¾®¿ôÉô¤â´Þ¤Þ¤ì¤Þ¤»¤ó¡£
-
-@example
-mysql> select FORMAT(12332.123456, 4);
- -> '12,332.1235'
-mysql> select FORMAT(12332.1,4);
- -> '12,332.1000'
-mysql> select FORMAT(12332.2,0);
- -> '12,332'
-@end example
-
-@findex VERSION()
-@item VERSION()
-@strong{MySQL} ¥µ¡¼¥Ð¤Î¥Ð¡¼¥¸¥ç¥ó¤òÊÖ¤·¤Þ¤¹¡£
-@example
-mysql> select VERSION();
- -> '3.23.13-log'
-@end example
-
-Ãí°Õ: ¥Ð¡¼¥¸¥ç¥ó¤¬ @code{-log} ¤Ç½ª¤ï¤ë¾ì¹ç¤Ï¥í¥®¥ó¥°¤¬Í­¸ú¤Ç¤¢¤ë¤³¤È¤ò°Õ
-Ì£¤·¤Þ¤¹¡£
-
-@findex CONNECTION_ID()
-@item CONNECTION_ID()
-Àܳ¤ÎÀܳ ID (@code{thread_id}) ¤òÊÖ¤·¤Þ¤¹¡£¤¹¤Ù¤Æ¤ÎÀܳ¤ÏÀܳ¼«¿È¤Î°ì°Õ
-¤Ê ID ¤ò»ý¤Á¤Þ¤¹¡£
-@example
-mysql> select CONNECTION_ID();
- -> 1
-@end example
-
-
-@findex GET_LOCK()
-@item GET_LOCK(str,timeout)
-@code{timeout} ÉäΥ¿¥¤¥à¥¢¥¦¥È¤Ç¡¢@code{str} ¤È̾ÉÕ¤±¤é¤ì¤¿¥í¥Ã¥¯¤Î³ÍÆÀ¤ò»î¤ß
-¤Þ¤¹¡£¥í¥Ã¥¯¤ò³ÍÆÀ¤·¤¿¾ì¹ç¤Ï @code{1}, ¥¿¥¤¥à¥¢¥¦¥È¤Î¾ì¹ç¤Ï @code{0}, ¥¨¥é¡¼¤Î¾ì¹ç(¥á
-¥â¥êÉÔ­¤ä¥¹¥ì¥Ã¥É¤¬ @code{mysqladmin kill} ¤Ç»¦¤µ¤ì¤¿¾ì¹ç¤Ê¤É)¤Ï @code{NULL}
-¤¬ÊÖ¤ê¤Þ¤¹¡£@code{RELEASE_LOCK} ¤Î¼Â¹Ô¡¢¿·¤·¤¤ @code{GET_LOCK} ¤Î¼Â¹Ô¡¢
-¥¹¥ì¥Ã¥É¤Î½ªÎ»¤Î¾ì¹ç¤Ë¡¢¥í¥Ã¥¯¤Ï²òÊü¤µ¤ì¤Þ¤¹¡£¤³¤Î´Ø¿ô¤Ï¥¢¥×¥ê¥±¡¼¥·¥ç¥ó
-¥í¥Ã¥¯¤ä¥ì¥³¡¼¥É¥í¥Ã¥¯¤Î¥·¥ß¥å¥ì¡¼¥È¤Î¤¿¤á¤Ë»ÈÍѤǤ­¤Þ¤¹¡£
-¤³¤ì¤Ï¡¢Æ±¤¸Ì¾Á°¤Î¥í¥Ã¥¯¤ò¹Ô¤ª¤¦¤È¤¹¤ë¾¤Î¥¯¥é¥¤¥¢¥ó¥È¤«¤é¤Î¥ê¥¯¥¨¥¹¥È¤ò
-¥Ö¥í¥Ã¥¯¤·¤Þ¤¹¡¨ Í¿¤¨¤é¤ì¤¿Ì¾Á°¤Î¥í¥Ã¥¯¤Ë±þ¤¸¤Æ¤¤¤ë¥¯¥é¥¤¥¢¥ó¥È¤Ï¡¢
-¶¨Ä´¤·¤Æ¥í¥Ã¥­¥ó¥°¤ò¹Ô¤¦¤¿¤á¤Ë¡¢¤½¤Îʸ»úÎó¤ò»ÈÍѤǤ­¤Þ¤¹¡£
-
-@example
-mysql> select GET_LOCK("lock1",10);
- -> 1
-mysql> select GET_LOCK("lock2",10);
- -> 1
-mysql> select RELEASE_LOCK("lock2");
- -> 1
-mysql> select RELEASE_LOCK("lock1");
- -> NULL
-@end example
-
-£²¤ÄÌܤΠ@code{RELEASE_LOCK()} ¤Ï @code{NULL} ¤òÊÖ¤·¤Þ¤¹¡£
-¤Ê¤¼¤Ê¤é¡¢ @code{"lock1"} ¤Ï¡¢£²¤ÄÌܤΠ@code{GET_LOCK()} ¤Î¸Æ¤Ó½Ð¤·»þÅÀ¤Ç¡¢
-¼«Æ°Åª¤Ë²òÊü¤µ¤ì¤ë¤«¤é¤Ç¤¹¡£
-
-@findex RELEASE_LOCK()
-@item RELEASE_LOCK(str)
-@code{GET_LOCK} ¤Ç³ÍÆÀ¤·¤¿¥í¥Ã¥¯ @code{str} ¤ò²òÊü¤·¤Þ¤¹¡£¥í¥Ã¥¯¤¬²ò
-Êü¤µ¤ì¤¿¾ì¹ç¤Ï @code{1}, ¤³¤Î¥¹¥ì¥Ã¥É¤Ë¤è¤Ã¤Æ¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï @code{0}
-(¤³¤Î¾ì¹ç¡¢¥í¥Ã¥¯¤Ï²òÊü¤µ¤ì¤Þ¤»¤ó),
-@code{str}¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ï @code{NULL} ¤¬ÊÖ¤ê¤Þ¤¹¡£
-¤â¤·¡¢ @code{GET_LOCK()} ¤ò¥³¡¼¥ë¤·¤ÆÆÀ¤é¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡¢
-¤¢¤ë¤¤¤Ï¡¢´û¤Ë²òÊü¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥í¥Ã¥¯¤Ï¸ºß¤·¤Ê¤¤¤Ç¤·¤ç¤¦¡£
-
-@findex BENCHMARK()
-@item BENCHMARK(count,expr)
-@code{BENCHMARK()} ´Ø¿ô¤Ï @code{expr} ¤ÇÍ¿¤¨¤é¤ì¤¿Ê¸¤ò @code{count} ²ó
-·«¤êÊÖ¤·¼Â¹Ô¤·¤Þ¤¹¡£ ¤³¤ì¤Ï @strong{MySQL} ¤Î¤½¤Îʸ¤Î½èÍý¤¬¤É¤ì¤°¤é¤¤
-®¤¤¤Î¤«ÃΤë¤Î¤Ë»ÈÍѤµ¤ì¤ë¤Ç¤·¤ç¤¦¡£ ·ë²Ì¤Ï¾ï¤Ë @code{0} ¤Ç¤¹¡£
-ÁÛÄꤷ¤Æ¤¤¤ë»ÈÍѤϡ¢ @code{mysql} ¥¯¥é¥¤¥¢¥ó¥È¤Ç¤¹¡£
-¤¢¤ë¥¯¥¨¥ê¤Î¼Â¹Ô»þ´Ö¤òÃΤ뤿¤á¤Î»ÈÍѤǤ¹¡£
-
-@example
-mysql> select BENCHMARK(1000000,encode("hello","goodbye"));
-+----------------------------------------------+
-| BENCHMARK(1000000,encode("hello","goodbye")) |
-+----------------------------------------------+
-| 0 |
-+----------------------------------------------+
-1 row in set (4.74 sec)
-@end example
-
-Êó¹ð¤µ¤ì¤¿»þ´Ö¤Ï¡¢¥¯¥é¥¤¥¢¥ó¥È¤Ç¤Î·Ð²á»þ´Ö¤Ç¤¹¡£ ¥µ¡¼¥Ð¡¼Â¦¤Î CPU »þ´Ö¤Ç¤Ï
-¤¢¤ê¤Þ¤»¤ó¡£@code{BENCHMARK()} ¤ò²¿²ó¤«¼Â¹Ô¤·¤Æ¡¢¥µ¡¼¥Ð¥Þ¥·¥ó¤ÎÉé²Ù¤Î½Å¤µ
-¤ò¹Íθ¤·¤Æ·ë²Ì¤ò²ò¼á¤¹¤ë¤³¤È¤ò´«¤á¤Þ¤¹¡£
-
-@findex INET_NTOA()
-@item INET_NTOA(expr)
-¿ôÃÍɽ¸½¤ËÂФ¹¤ë¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹(4 ¤Þ¤¿¤Ï 8 ¥Ð¥¤¥È) ¤òÊÖ¤·¤Þ¤¹¡£
-
-@example
-mysql> select INET_NTOA(3520061480);
- -> "209.207.224.40"
-@end example
-
-@findex INET_ATON()
-@item INET_NTOA(expr)
-¥Í¥Ã¥È¥ï¡¼¥¯¥¢¥É¥ì¥¹¤ËÂФ¹¤ë¿ôÃͤòɽ¤¹À°¿ô¤òÊÖ¤·¤Þ¤¹¡£¥¢¥É¥ì¥¹¤Ï 4 ¤Þ¤¿¤Ï
-8 ¥Ð¥¤¥È¥¢¥É¥ì¥¹¤Ç¤¹¡£
-
-@example
-mysql> select INET_ATON("209.207.224.40");
- -> 3520061480
-@end example
-@end table
-
-@findex GROUP BY functions
-@findex Functions, GROUP BY
-@node Group by functions, , Miscellaneous functions, Functions
-@subsection @code{GROUP BY} Àá¤Î´Ø¿ô
-
-@code{GROUP BY} Àá¤Ê¤·¤Ç ¥°¥ë¡¼¥×´Ø¿ô¤ò»ÈÍѤ¹¤ë¤Ê¤é¡¢
-¤³¤ì¤ÏÁ´¤Æ¤Î¥ì¥³¡¼¥É¤ò¥°¥ë¡¼¥×²½¤¹¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-@table @code
-@findex COUNT()
-@item COUNT(expr)
-@code{SELECT} ʸ¤Ë¤è¤Ã¤ÆÆÀ¤é¤ì¤ë¥ì¥³¡¼¥É Ãæ¡¢Ãͤ¬ Èó@code{NULL} ¤Ç
-¤¢¤ë¥ì¥³¡¼¥É¤Î¿ô¤òÊÖ¤·¤Þ¤¹¡£
-
-@example
-mysql> select student.student_name,COUNT(*)
- from student,course
- where student.student_id=course.student_id
- GROUP BY student_name;
-
-@end example
-
-¸¡º÷¤µ¤ì¤¿¥ì¥³¡¼¥É¤Î¿ô¤¬¡¢¥ì¥³¡¼¥ÉÃæ¤Ë @code{NULL} Ãͤò´Þ¤à¤«¤É¤¦¤«¤Ç¡¢
-@code{COUNT(*)} ¤ÇÊÖ¤ëÃͤϤϤ¤¤¯¤Ö¤ó°Û¤Ê¤ê¤Þ¤¹¡£
-
-¤â¤· @code{SELECT} ¤¬°ì¤Ä¤Î¥Æ¡¼¥Ö¥ë¤«¤é¸¡º÷¤·¡¢¤«¤Ä¡¢
-¾¤Î¥Õ¥£¡¼¥ë¥É¤¬¸¡º÷¤µ¤ì¤ë¤³¤È¤â¤Ê¤¯¡¢¤«¤Ä
-@code{WHERE} À᤬̵¤¤¤Ê¤é¤Ð¡¢
-@code{COUNT(*)} ¤Ï®¤¯Åú¤¨¤ë¤¿¤á¤ËºÇŬ²½¤µ¤ì¤Þ¤¹¡£
-Î㤨¤Ð¡§
-
-@example
-mysql> select COUNT(*) from student;
-@end example
-
-@findex COUNT(DISTINCT)
-@findex DISTINCT
-@item COUNT(DISTINCT expr,[expr...])
-°Û¤Ê¤ëÃͤοô¤Î¥«¥¦¥ó¥È¤òÊÖ¤·¤Þ¤¹¡£
-
-@example
-mysql> select COUNT(DISTINCT results) from student;
-@end example
-
-@strong{MySQL} ¤Ç¤Ï¡¢¼°¤Î¥ê¥¹¥È¤òÍ¿¤¨¤ë¤³¤È¤Ç¡¢Ê̸Ĥμ°¤ÎÁȹ礻¤Î¿ô¤òÆÀ¤ë
-¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ANSI SQL ¤Ç¤Ï¡¢¤¹¤Ù¤Æ¤Î¼°¤ò @code{CODE(DISTINCT ..)} Æâ¤Ç
-·ë¹ç¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-@findex AVG()
-@item AVG(expr)
-@code{expr}¤ÎÊ¿¶ÑÃÍ¡£
-
-@example
-mysql> select student_name, AVG(test_score)
- from student
- GROUP BY student_name;
-@end example
-
-@findex MIN()
-@findex MAX()
-@item MIN(expr)
-@itemx MAX(expr)
-@code{expr}.¤ÎºÇ¾®/ºÇÂçÃÍ¡£
-@code{min()} ¤È @code{max()} ¤¬Ê¸»úÎó°ú¿ô¤ò¼è¤ë¤È¡¢ºÇ¾®/ºÇÂç¤Îʸ»úÎóÃͤòÊÖ¤·¤Þ¤¹¡£
-
-@example
-mysql> select student_name, MIN(test_score), MAX(test_score)
- from student
- GROUP BY student_name;
-@end example
-
-@findex SUM()
-@item SUM(expr)
-@code{expr}¤Î¹ç·×.
-Ãí°Õ: ·ë²Ì¥»¥Ã¥È¤¬²¿¤â¥ì¥³¡¼¥É¤òÊÖ¤µ¤Ê¤¤¾ì¹ç¤Ï¡¢¤³¤ì¤Ï NULL ¤òÊÖ¤·¤Þ¤¹¡ª
-
-@findex STD()
-@findex STDDEV()
-@cindex Oracle compatibility
-@cindex Compatibility, with Oracle
-@item STD(expr)
-@itemx STDDEV(expr)
-@code{expt} ¤Îɸ½àͶƳ(standard derivative)¡£¤³¤ì¤Ï @code{ANSI SQL} ¤ËÂФ¹¤ë³ÈÄ¥¤Ç¤¹¡£
-¤³¤Î´Ø¿ô¤Î @code{STDDEV()} ·Á¼°¤Ï¡¢Oracle ¸ß´¹¤Î¤¿¤á¤ËÄ󶡤µ¤ì¤Þ¤·¤¿¡£
-
-@findex BIT_OR()
-@item BIT_OR(expr)
-@code{expr} Æâ¤ÎÁ´¤Æ¤Î¥Ó¥Ã¥È¤ÎÏÀÍý @code{OR}¡£64 ¥Ó¥Ã¥È(@code{BIGINT})¤ÎÀº
-Å٤Ƿ׻»¤µ¤ì¤Þ¤¹¡£
-
-@findex BIT_AND()
-@item BIT_AND(expr)
-@code{expr} Æâ¤ÎÁ´¤Æ¤Î¥Ó¥Ã¥È¤ÎÏÀÍý @code{AND}¡£64 ¥Ó¥Ã¥È(@code{BIGINT})¤Î
-ÀºÅ٤Ƿ׻»¤µ¤ì¤Þ¤¹¡£
-@end table
-
-@strong{MySQL} ¤Ï @code{GROUP BY} ¤ò³ÈÄ¥¤·¤Æ¤¤¤Þ¤¹¡£@code{SELECT} ɽ¸½Æâ¤Ç
-@code{GROUP BY} Éô¤Ë¸½¤ì¤Ê¤¤¥Õ¥£¡¼¥ë¥É¤Þ¤¿¤Ï·×»»¤ò»ÈÍѤǤ­¤Þ¤¹¡£¤³¤ì¤Ï @emph{¤³¤Î¥°¥ë¡¼
-¥×¤Î¤¿¤á¤ÎÁ´¤Æ¤Î²Äǽ¤ÊÃÍ} ¤òɽ¤·¤Æ¤¤¤Þ¤¹¡£¤³¤Î»ÈÍѤˤè¤ê¡¢É¬Íפʤ¤¥Õ¥£¡¼¥ë¥É¤Ç
-¤Î¥½¡¼¥È¤È¥°¥ë¡¼¥×¤¬Èò¤±¤é¤ì¤ë¤Î¤Ç¡¢¹â¤¤À­Ç½¤¬ÆÀ¤é¤ì¤Þ¤¹¡£Î㤨¤Ð¡¢¼¡¤Î¥¯
-¥¨¥ê¤Ç¤Ï @code{customer.name} ¤Ç¥°¥ë¡¼¥×¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó:
-
-@example
-mysql> select order.custid,customer.name,max(payments)
- from order,customer
- where order.custid = customer.custid
- GROUP BY order.custid;
-@end example
-
-ANSI SQL ¤Ç¤Ï¡¢@code{GROUP BY} Àá¤Ë @code{customer.name} ¤òÄɲ乤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-@strong{MySQL} ¤Ç¤Ï¡¢ANSI ¥â¡¼¥É¤Ç¼Â¹Ô¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢name ¤Ï¾éŤǤ¹¡£
-
-@code{GROUP BY} Éô¤«¤é¾Êά¤·¤¿¥Õ¥£¡¼¥ë¥É¤¬¥°¥ë¡¼¥×Æâ¤Ç°ì°Õ¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢¤³
-¤Îµ¡Ç½¤ò»ÈÍѤ·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡ª
-
-¤¤¤¯¤Ä¤«¤Î¥±¡¼¥¹¤Ç¤Ï¡¢¤½¤ì¤¬°ì°Õ¤Ç¤Ê¤¤¾ì¹ç¤Ç¤â¡¢@code{MIN()} ¤È
-@code{MAX()} ¤òÆÃÄê¤Î¥Õ¥£¡¼¥ë¥ÉÃͤò³ÍÆÀ¤¹¤ë¤¿¤á¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¼¡¤Ï¡¢@code{sort} ¥Õ¥£¡¼¥ë¥ÉÆâ¤ÎºÇ¾®¤ÎÃͤò´Þ¤à¥ì¥³¡¼¥É¤«¤é¤Î
-@code{column} ¤ÎÃͤòÍ¿¤¨¤Þ¤¹:
-
-@example
-substr(MIN(concat(sort,space(6-length(sort)),column),7,length(column)))
-@end example
-
-@cindex @code{ORDER BY}, aliases in
-@cindex Aliases, in @code{ORDER BY} clauses
-@cindex @code{GROUP BY}, aliases in
-@cindex Aliases, in @code{GROUP BY} clauses
-@cindex Expressions, aliases for
-@cindex Aliases, for expressions
-Ãí°Õ: @strong{MySQL} 3.22 (¤Þ¤¿¤Ï¤½¤ì°ÊÁ°) ¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢¤Þ¤¿¤Ï
-ANSI SQL ¤Ë½¾¤ª¤¦¤È¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢@code{GROUP BY} ¤ä @code{ORDER BY} Àá¤Ç
-¼°¤ò»ÈÍѤǤ­¤Þ¤»¤ó¡£¼°¤ÎÊÌ̾¤ò»ÈÍѤ¹¤ë¤³¤È¤Ç¤³¤ÎÀ©¸Â¤ò²óÈò¤Ç¤­¤Þ¤¹:
-
-@example
-mysql> SELECT id,FLOOR(value/100) AS val FROM tbl_name
- GROUP BY id,val ORDER BY val;
-@end example
-
-@code{MySQL} 3.23 ¤Ç¤Ï¼¡¤ò¹Ô¤Ê¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹:
-
-@example
-mysql> SELECT id,FLOOR(value/100) FROM tbl_name ORDER BY RAND();
-@end example
-
-@findex CREATE DATABASE
-@node CREATE DATABASE, DROP DATABASE, Functions, Reference
-@section @code{CREATE DATABASE}¹½Ê¸
-
-@example
-CREATE DATABASE [IF NOT EXISTS] db_name
-@end example
-
-@code{CREATE DATABASE} ¤ÏÍ¿¤¨¤é¤ì¤¿Ì¾Á°¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤òºî¤ê¤Þ¤¹¡£¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î̾Á°¤È¤·¤Æµö¤µ¤ì¤ë̿̾µ¬Â§¤Ï¡¢@ref{Legal names}¤Ë°Í¤ê¤Þ¤¹¡£
-¤â¤·¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬¤¹¤Ç¤Ë¸ºß¤·¤Æ¤¤¤ë¤Ë¤â¤«¤«¤ï¤é¤º @code{IF NOT EXISTS} ¤ò
-»ØÄꤷ¤Æ¤¤¤Ê¤«¤Ã¤¿¤é¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤¹¡£
-
-@strong{MySQL}¤Ë¤ª¤±¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ï¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹Æâ¤Î¥Æ¡¼¥Ö¥ë¤ËÁêÅö¤¹¤ë¥Õ¥¡¥¤¥ë¤ò´Þ¤à¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Þ¤¹¡£½é´üºîÀ®¸å¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹Æâ¤Ë¥Æ¡¼¥Ö¥ë¤Ï¸ºß¤»¤º¡¢@code{CREATE DATABASE}¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ï¡¢@strong{MySQL}¥Ç¡¼¥¿¥Ç¥£¥ì¥¯¥È¥ê²¼¤Ë¥Ç¥£¥ì¥¯¥È¥ê¤òºîÀ®¤¹¤ë¤À¤±¤Ç¤¹¡£
-
-@cindex @code{mysqladmin}
-@code{mysqladmin}¤Ç¤â¥Ç¡¼¥¿¥Ù¡¼¥¹¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@xref{Programs}.
-
-@findex DROP DATABASE
-@node DROP DATABASE, CREATE TABLE, CREATE DATABASE, Reference
-@section @code{DROP DATABASE}¹½Ê¸
-
-@example
-DROP DATABASE [IF EXISTS] db_name
-@end example
-
-@code{DROP DATABASE}¤Ï¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹Æâ¤ÎÁ´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤È¶¦¤Ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÇË´þ¤·¤Þ¤¹¡£@strong{¤³¤Î¥³¥Þ¥ó¥É¤Î»ÈÍѤˤÏËüÁ´¤ÎÃí°Õ¤òʧ¤Ã¤Æ²¼¤µ¤¤¡ª}
-
-@code{DROP DATABASE}¤Ï¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤«¤éºï½ü¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Î¿ô¤òÊÖ¤·¤Þ¤¹¡£¤½¤ì¤¾¤ì¤Î¥Æ¡¼¥Ö¥ë¤Ï@file{.MYD}¥Õ¥¡¥¤¥ë¡¿@file{.MYI}¥Õ¥¡¥¤¥ë¡¿@file{.frm}¥Õ¥¡¥¤¥ë¤ËÁêÅö¤¹¤ë¤³¤È¤«¤é¡¢Ä̾盧¤ÎÃͤϥơ¼¥Ö¥ë¤Î£³Çܤοô¤È¤Ê¤ê¤Þ¤¹¡£
-
-@strong{MySQL} 3.22°Ê¹ß¤Ç¤Ï¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬Â¸ºß¤·¤Ê¤¤¤³¤È¤Ëµ¯°ø¤¹¤ë¥¨¥é¡¼¤òËɤ°¤¿¤á¤Ë¡¢¥­¡¼¥ï¡¼¥É @code{IF EXISTS} ¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@cindex @code{mysqladmin}
-@code{mysqladmin}¤Ç¤â¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÇË´þ¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@xref{Programs}.
-
-@findex CREATE TABLE
-@node CREATE TABLE, ALTER TABLE, DROP DATABASE, Reference
-@section @code{CREATE TABLE}¹½Ê¸
-
-@menu
-* Silent column changes:: Silent column changes
-@end menu
-
-@example
-CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name [(create_definition,...)]
-[table_options] [select_statement]
-
-create_definition:
- col_name type [NOT NULL | NULL] [DEFAULT default_value] [AUTO_INCREMENT]
- [PRIMARY KEY] [reference_definition]
- or PRIMARY KEY (index_col_name,...)
- or KEY [index_name] (index_col_name,...)
- or INDEX [index_name] (index_col_name,...)
- or UNIQUE [INDEX] [index_name] (index_col_name,...)
- or [CONSTRAINT symbol] FOREIGN KEY index_name (index_col_name,...)
- [reference_definition]
- or CHECK (expr)
-
-type:
- TINYINT[(length)] [UNSIGNED] [ZEROFILL]
- or SMALLINT[(length)] [UNSIGNED] [ZEROFILL]
- or MEDIUMINT[(length)] [UNSIGNED] [ZEROFILL]
- or INT[(length)] [UNSIGNED] [ZEROFILL]
- or INTEGER[(length)] [UNSIGNED] [ZEROFILL]
- or BIGINT[(length)] [UNSIGNED] [ZEROFILL]
- or REAL[(length,decimals)] [UNSIGNED] [ZEROFILL]
- or DOUBLE[(length,decimals)] [UNSIGNED] [ZEROFILL]
- or FLOAT[(length,decimals)] [UNSIGNED] [ZEROFILL]
- or DECIMAL(length,decimals) [UNSIGNED] [ZEROFILL]
- or NUMERIC(length,decimals) [UNSIGNED] [ZEROFILL]
- or CHAR(length) [BINARY]
- or VARCHAR(length) [BINARY]
- or DATE
- or TIME
- or TIMESTAMP
- or DATETIME
- or TINYBLOB
- or BLOB
- or MEDIUMBLOB
- or LONGBLOB
- or TINYTEXT
- or TEXT
- or MEDIUMTEXT
- or LONGTEXT
- or ENUM(value1,value2,value3,...)
- or SET(value1,value2,value3,...)
-
-index_col_name:
- col_name [(length)]
-
-reference_definition:
- REFERENCES tbl_name [(index_col_name,...)]
- [MATCH FULL | MATCH PARTIAL]
- [ON DELETE reference_option]
- [ON UPDATE reference_option]
-
-reference_option:
- RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT
-
-table_options:
- TYPE = @{ISAM | MYISAM | HEAP@}
-or AUTO_INCREMENT = #
-or AVG_ROW_LENGTH = #
-or CHECKSUM = @{0 | 1@}
-or COMMENT = "string"
-or MAX_ROWS = #
-or MIN_ROWS = #
-or PACK_KEYS = @{0 | 1@}
-or PASSWORD = "string"
-or DELAY_KEY_WRITE = @{0 | 1@}
-or ROW_FORMAT= @{ default | dynamic | static | compressed @}
-or RAID_TYPE= @{1 | STRIPED | RAID0 @} RAID_CHUNKS=# RAID_CHUNKSIZE=#;
-
-select_statement:
- [IGNORE | REPLACE] SELECT ... (Some legal select statement)
-@end example
-
-
-@code{CREATE TABLE}¤Ï¥«¥ì¥ó¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¡¢Í¿¤¨¤é¤ì¤¿Ì¾Á°¤Î¥Æ¡¼¥Ö¥ë¤ò
-ºîÀ®¤·¤Þ¤¹¡£¥Æ¡¼¥Ö¥ë¤Î̾Á°¤È¤·¤Æµö¤µ¤ì¤ë̿̾µ¬Â§¤Ï¡¢@xref{Legal names}¤Ë
-°Í¤ê¤Þ¤¹¡£
-¥«¥ì¥ó¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬Ìµ¤¤¾ì¹ç¤ä¡¢¥Æ¡¼¥Ö¥ë¤¬´û¤Ë¸ºß¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¥¨¥é¡¼¤¬
-ȯÀ¸¤·¤Þ¤¹¡£
-
-@strong{MySQL} 3.22 °Ê¹ß¤Ç¤Ï¥Æ¡¼¥Ö¥ë̾¤Ï @code{db_name.tbl_name} ¤È¤¤¤¦·Á¤ÇÍ¿¤¨¤ë»ö¤â¤Ç¤­¤Þ¤¹¡£
-¤³¤ì¤Ï¥«¥ì¥ó¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬¤¢¤ë¤«¤É¤¦¤«¤Ë¤Ë´Ø·¸¤Ê¤¯Æ°ºî¤·¤Þ¤¹¡£
-
-@strong{MySQL} 3.23 ¤Ç¤Ï¡¢¥Æ¡¼¥Ö¥ëºîÀ®»þ¤Ë @code{TEMPORARY} ¥­¡¼¥ï¡¼¥É¤ò»ÈÍѤ¹¤ë¤³¤È¤¬
-¤Ç¤­¤Þ¤¹¡£ °ì»þ¥Æ¡¼¥Ö¥ë¤Ï¡¢¤â¤·¡¢¥³¥Í¥¯¥·¥ç¥ó¤¬Íî¤Á¤¿¾ì¹ç¡¢¼«Æ°¤Ç¾Ãµî¤µ¤ì¤Þ¤¹¡£
-°ì»þ¥Æ¡¼¥Ö¥ë¤Î̾Á°¤Ï¤½¤ì¤¾¤ì¤ÎÀܳ¤´¤È¤Ç¤¹¡£
-¤³¤ì¤Ï¡¢Æó¤Ä¤Î°ã¤¦Àܳ¤Ç¡¢Æ±¤¸Ì¾Á°¤Î°ì»þ¥Æ¡¼¥Ö¥ë¤ò
-¾×Æͤ¹¤ë¤³¤È¤Ê¤¯¡¢»ÈÍѤǤ­¤ë¤È¤¤¤¦»ö¤Ç¤¹¡£
-¤µ¤é¤Ë¤Ï¡¢´û¤Ë¸ºß¤¹¤ë¥Æ¡¼¥Ö¥ë¤ÈƱ̾¤Ç¤¢¤Ã¤Æ¤â¡¢°ì»þ¥Æ¡¼¥Ö¥ë¤Ï»ÈÍѤǤ­¤Þ¤¹¡£
-(°ì»þ¥Æ¡¼¥Ö¥ë¤¬ºï½ü¤µ¤ì¤ë¤Þ¤Ç¡¢¼Âºß¤¹¤ë¥Æ¡¼¥Ö¥ë¤Ï±£¤µ¤ì¤Þ¤¹)
-
-@strong{MySQL} 3.23 °Ê¹ß¤Ç¤Ï¡¢ @code{IF NOT EXISTS} ¥­¡¼¥ï¡¼¥É¤ò»ÈÍѤǤ­¤Þ¤¹¡£
-¤³¤ì¤Ï¡¢¤â¤·¥Æ¡¼¥Ö¥ë¤¬´û¤Ë¸ºß¤·¤Æ¤¤¤¿¾ì¹ç¡¢¥¨¥é¡¼¤òȯÀ¸¤µ¤»¤Þ¤»¤ó¡£
-¥Æ¡¼¥Ö¥ë¤Î¹½Â¤¤¬°ì°Õ¤«¤É¤¦¤«¤Þ¤Ç¤Ï¸¡ºº¤·¤Ê¤¤¤³¤È¤ËÃí°Õ¡£
-
-¤½¤ì¤¾¤ì¤Î¥Æ¡¼¥Ö¥ë¤Ï¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤ª¤±¤ë°Ê²¼¤ÎÊ£¿ô¤Î
-¥Õ¥¡¥¤¥ë¤Çɽ¤µ¤ì¤Þ¤¹¡£¤³¤ì¤Ï MyISAM ·¿ ¤Î¥Æ¡¼¥Ö¥ë¾ì¹ç¡§
-
-@multitable @columnfractions .2 .8
-@item @strong{¥Õ¥¡¥¤¥ë} @tab @strong{ÌÜŪ}
-@item @code{tbl_name.frm} @tab ¥Æ¡¼¥Ö¥ëÄêµÁ(½ñ¼°)¥Õ¥¡¥¤¥ë
-@item @code{tbl_name.MYD} @tab ¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë
-@item @code{tbl_name.MYI} @tab ¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë
-@end multitable
-
-¥Õ¥£¡¼¥ë¥É¤ËÂФ¹¤ë¼ï¡¹¤Î·¿Â°À­¤Î¾ÜºÙ¤Ï¡¢@ref{Column types}¤ò»²¾È¤Î¤³¤È¡£
-
-@itemize @bullet
-@item
- @code{NULL}¤â@code{NOT NULL}¤â»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¥Õ¥£¡¼¥ë¥É¤Ï@code{NULL}¤¬»ØÄꤵ¤ì¤¿¤â¤Î¤È¤·¤Æ°·¤ï¤ì¤Þ¤¹¡£
-
-@item
- À°¿ô·¿¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤ÏÉղðÀ­@code{AUTO_INCREMENT}¤â»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£@code{AUTO_INCREMENT}¤Î¥Õ¥£¡¼¥ë¥É¤ËÃÍ@code{NULL}Ëô¤Ï@code{0}¤òÁÞÆþ¤·¤¿¾ì¹ç¡¢¥Õ¥£¡¼¥ë¥É¤Ë¤Ï@code{value+1}¤ÎÃͤ¬¥»¥Ã¥È¤µ¤ì¤Þ¤¹¡£@code{value}¤Ï¡¢¤½¤Î¥Æ¡¼¥Ö¥ëÆâ¤ÎÅö³º¥Õ¥£¡¼¥ë¥É¤Ë¤ª¤±¤ë¸½ºß¤ÎºÇÂçÃͤǤ¹¡£
-@code{AUTO_INCREMENT} ¤Ï @code{1} ¤«¤é¤Ï¤¸¤Þ¤ê¤Þ¤¹.
-@xref{mysql_insert_id, , @code{mysql_insert_id()}}.
-
- ºï½ü¤·¤¿¥ì¥³¡¼¥É¤¬¡¢@code{AUTO_INCREMENT}¥Õ¥£¡¼¥ë¥É¤ÎºÇÂçÃͤò´Þ¤ó¤Ç¤¤¤¿¾ì¹ç¡¢¤½¤ÎÃͤϼ¡¤ËºÆÍøÍѤµ¤ì¤Þ¤¹(¤¿¤À¤·¡¢¤³¤ì¤Ï ISAM ¥Æ¡¼¥Ö¥ë¤Î¾ì¹ç¤Ç¡¢MyISAM ¥Æ¡¼¥Ö¥ë¤Ç¤Ïµ¯¤³¤ê¤Þ¤»¤ó)¡£
-¤Þ¤¿¡¢¥Æ¡¼¥Ö¥ëÆâ¤ÎÁ´¤Æ¤Î¥ì¥³¡¼¥É¤ò @code{DELETE FROM TABLE} (@code{WHERE}Àá̵¤·¤Ç) ¤ò
-»ÈÍѤ·¤Æºï½ü¤·¤¿¾ì¹ç¤Ï¡¢»Ï¤á¤«¤éºÎÈÖ¤·Ä¾¤·¤Þ¤¹¡£
-
-@strong{Ãí°Õ:} 1¤Ä¤Î¥Æ¡¼¥Ö¥ë¤Ë¤Ï1¤Ä¤·¤«@code{AUTO_INCREMENT}¥Õ¥£¡¼¥ë¥É¤ò»ØÄê¤Ç¤­¤Þ¤»¤ó¡£¤Þ¤¿¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-@strong{MySQL} 3.23 ¤Ï auto_increment ¥Õ¥£¡¼¥ë¥É¤¬Àµ¤Î¿ô¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë
-¤À¤±¡¢Àµ¤·¤¯Æ°ºî¤·¤Þ¤¹¡£Éé¤Î¿ô¤ÎÁÞÆþ¤Ï¤È¤Æ¤âÂ礭¤ÊÀµ¤Î¿ô¤ÎÁÞÆþ¤È¤ß¤Ê¤µ¤ì¤Þ
-¤¹¡£¤³¤ì¤Ï¡¢¿ôÃͤ¬Àµ¤«¤éÉé¤Ø¤Î 'wrap' over ¤¹¤ë»þ¤ÎÀºÅÙ¤ÎÌäÂê¤ò²óÈò¤¹¤ë¤¿
-¤á¤È¡¢¥¢¥¯¥·¥Ç¥ó¥ÈŪ¤Ë 0 ¤ò´Þ¤à auto_increment ¥Õ¥£¡¼¥ë¥É¤òÆÀ¤ë¤³¤È¤¬¤Ê¤¤
-¤³¤È¤ò³Î¼Â¤Ë¤¹¤ë¤¿¤á¤Ë¡¢¹Ô¤Ê¤ï¤ì¤Þ¤¹¡£
-
-@cindex ODBC compatibility
-@cindex Compatibility, with ODBC
-@strong{MySQL} ¤ò¤¤¤¯¤Ä¤«¤Î ODBC ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤È¸ß´¹¤Ë¤¹¤ë¤¿¤á¤Ë¡¢¼¡¤Î
-¥¯¥¨¥ê¤ÇºÇ¸å¤ËÁÞÆþ¤µ¤ì¤¿¥ì¥³¡¼¥É¤ò¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹:
-
-@example
-SELECT * FROM tbl_name WHERE auto_col IS NULL
-@end example
-
-@item
-@code{TIMESTAMP}¥Õ¥£¡¼¥ë¥É¤Ë¤ª¤±¤ë@code{NULL}Ãͤϡ¢Â¾¤Î¥Õ¥£¡¼¥ë¥É°À­¤È°ã¤Ã¤¿°·¤ï¤ìÊý¤ò¤·¤Þ¤¹¡£Äê¿ô@code{NULL}¤ò@code{TIMESTAMP}¥Õ¥£¡¼¥ë¥É¤Ë³ÊǼ¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£@code{NULL}ÃͤλØÄê¤Ï¸½ºß»þ¹ï¤ò¥»¥Ã¥È¤¹¤ë¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£@code{TIMESTAMP}¥Õ¥£¡¼¥ë¥É¤¬¤³¤Î¤è¤¦¤Ë¿¶Éñ¤¦¤Î¤Ç¡¢Ä̾ï¤Ï@code{NULL}°À­¤ä@code{NOT NULL}°À­¤ÏŬÍѤǤ­¤Þ¤»¤ó¡£¤½¤ì¤é¤ò»ØÄꤷ¤Æ¤â̵»ë¤µ¤ì¤Þ¤¹¡£
-
- °ìÊý¡¢@strong{MySQL}¥¯¥é¥¤¥¢¥ó¥È¤«¤é¤Ï¡¢¤è¤ê°Â°×¤Ë@code{TIMESTAMP}¥Õ¥£¡¼¥ë¥É¤òÍøÍѤǤ­¡¢¥µ¡¼¥Ð¤â@code{TIMESTAMP}¥Õ¥£¡¼¥ë¥É¤Ø¤Î@code{NULL}¤ÎŬÍѤòÊó¹ð¤·¤Þ¤¹¤¬¡¢@code{TIMESTAMP}¥Õ¥£¡¼¥ë¥É¤Ï¼ÂºÝ¤Ë¤Ï@code{NULL}ÃͤòÊݸ¤¹¤ë¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¡£@code{DESCRIBE tbl_name}¤ò»ÈÍѤ·¤Æ¡¢¥Æ¡¼¥Ö¥ëÄêµÁʸ¤ò¼èÆÀ¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢¤³¤Î¸½¾Ý¤ò³Îǧ¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
- @code{TIMESTAMP}¥Õ¥£¡¼¥ë¥É¤Ë@code{0}¤ò»ØÄꤹ¤ë¤³¤È¤Ï¡¢@code{NULL}¤ò»ØÄꤹ¤ë¤³¤È¤ÈÅù¤·¤¯¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£¤Ê¤¼¤Ê¤é¡¢@code{0}¤Ï@code{TIMESTAMP}¤ÎÃͤȤ·¤ÆÉÔÀµ¤Ç¤¢¤ë¤«¤é¤Ç¤¹¡£
-
-@item
-¥Õ¥£¡¼¥ë¥É¤ËÂФ·¤Æ @code{DEFAULT} Ãͤ¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¤Ï @strong{MySQL} ¤¬
-¼«Æ°Åª¤Ë¤½¤ì¤ò³ä¤êÅö¤Æ¤Þ¤¹¡£
-
-¥Õ¥£¡¼¥ë¥É¤¬ @code{NULL} ¤òÃͤȤ·¤Æ¼è¤êÆÀ¤ë¾ì¹ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥ÈÃͤÏ
-@code{NULL} ¤Ç¤¹¡£
-
-¥Õ¥£¡¼¥ë¥É¤¬ @code{NOT NULL} ¤È¤·¤ÆÀë¸À¤µ¤ì¤¿¾ì¹ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥ÈÃͤϥե£¡¼
-¥ë¥É·¿¤Ë°Í¸¤·¤Þ¤¹:
-
-@itemize @minus
-@item
-@code{AUTO_INCREMENT} ÄêµÁ¤µ¤ì¤¿°Ê³°¤Î¿ôÃÍ·¿¤Î¥Õ¥£¡¼¥ë¥É¤ËÂФ·¤Æ¤Ï¡¢
-½é´üÃͤÏ@code{0}¤È¤Ê¤ê¤Þ¤¹¡£
-@code{AUTO_INCREMENT}¥Õ¥£¡¼¥ë¥É¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥ÈÃͤϼ¡¤Î¥·¡¼¥±¥ó¥¹ÈÖ¹æ¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-@item
-@code{TIMESTAMP} ·¿°Ê³°¤ÎÆüÉÕ·¿¤È»þ¹ï·¿¤Î¥Õ¥£¡¼¥ë¥É¤ËÂФ·¤Æ¤Ï¡¢
-½é´üÃͤϤ½¤Î·¿¤Ë¤ª¤¤¤ÆŬÀÚ¤Ê``¥¼¥í''ÃͤȤʤê¤Þ¤¹¡£
-Îã³°: ¥Õ¥£¡¼¥ë¥É¤¬¤½¤Î¥Æ¡¼¥Ö¥ëÆâ¤ÇºÇ½é¤Î@code{TIMESTAMP}¥Õ¥£¡¼¥ë¥É¤Ç¤¢¤ë¾ì¹ç¡¢½é´üÃͤϸ½ºß»þ¹ï¤Ë¤Ê¤ê¤Þ¤¹¡£
-@xref{Date and time types}.
-
-@item
-@code{ENUM} °Ê³°¤Îʸ»úÎ󷿤Υե£¡¼¥ë¥É¤ËÂФ·¤Æ¤Ï¡¢½é´üÃͤ϶õʸ»úÎó¤È¤Ê¤ê¤Þ¤¹¡£
-@code{ENUM} ¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥ÈÃͤϺǽé¤ÎÎóµóÃͤǤ¹¡£
-@end itemize
-
-@item
-@code{KEY}¤Ï¡¢@code{INDEX}¤ÎƱµÁ¸ì¤Ç¤¹¡£
-
-@item
-@strong{MySQL}¤Ç¤Ï¡¢@code{UNIQUE}¥­¡¼¤Ï¸ÇÍ­Ãͤ·¤«»ý¤Ä¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£´û¤Ë¸ºß¤¹¤ë¥ì¥³¡¼¥É¤È¥­¡¼¤ÎÃͤ¬½ÅÊ£¤¹¤ë¥ì¥³¡¼¥É¤òÁÞÆþ¤·¤è¤¦¤È¤·¤¿¾ì¹ç¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤Þ¤¹¡£
-
-@item
-@code{PRIMARY KEY} ¤Ï¥æ¥Ë¡¼¥¯ @code{KEY} ¤Ç¡¢¤¹¤Ù¤Æ¤Î¥­¡¼¥Õ¥£¡¼¥ë¥É¤Ï
-@code{NOT NULL} ¤È¤·¤ÆÄêµÁ¤µ¤ì¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤È¤¤¤¦ÆÃÊ̤ÊÀ©¸Â¤òȼ¤¤¤Þ¤¹¡£
-@strong{MySQL} ¤Ç¤Ï¥­¡¼¤Ï @code{PRIMARY} ¤È̾ÉÕ¤±¤é¤ì¤Þ¤¹¡£¥Æ¡¼¥Ö¥ë¤Ï
-@code{PRIMARY KEY} ¤ò°ì¤Ä¤À¤±»ý¤Ä¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£@code{PRIMARY KEY} ¤ò»ý¤¿
-¤Ê¤¤¾ì¹ç¤Ë¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬¥Æ¡¼¥Ö¥ëÆâ¤Î @code{PRIMARY KEY} ¤ò¿Ò¤Í¤ë¤È¡¢
-@strong{MySQL} ¤Ï @code{PRIMARY KEY} ¤È¤·¤Æ¡¢@code{NULL} ¥Õ¥£¡¼¥ë¥É¤ò»ý¤¿
-¤Ê¤¤ºÇ½é¤Î @code{UNIQUE} ¥­¡¼¤òÊÖ¤·¤Þ¤¹¡£
-
-@item
-@code{PRIMARY KEY}¤ÏÊ£¿ô¥Õ¥£¡¼¥ë¥É¥¤¥ó¥Ç¥Ã¥¯¥¹¤È¤Ç¤­¤Þ¤¹¡£¤·¤«¤·¤Ê¤¬¤é¡¢1¤Ä¤Î¥Õ¥£¡¼¥ë¥ÉÄêµÁÆâ¤Ç¤Ï@code{PRIMARY KEY}°À­¤òÍѤ¤¤ÆÊ£¹ç¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÄêµÁ¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¤Î¤Ç¡¢¥Õ¥£¡¼¥ë¥ÉÄêµÁÆâ¤Ë¤ª¤±¤ë»ØÄê¤Ï¡¢¥×¥é¥¤¥Þ¥ê¡¦¥­¡¼¤¬Ã±ÆÈ¥Õ¥£¡¼¥ë¥É¤Î¾ì¹ç¤Î¤ß¤È¤·¤Æ²¼¤µ¤¤¡£Ê£¹ç¥Õ¥£¡¼¥ë¥É¤Î¾ì¹ç¤Ï¡¢@code{PRIMARY KEY(index_col_name,...)}ʸ¤ò»ÈÍѤ·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-
-@item
-@code{PRIMARY} ¤ä @code{UNIQUE} ¥­¡¼¤¬£±¤Ä¤Î¥Õ¥£¡¼¥ë¥É¤À¤±¤«¤é¤Ê¤ê¡¢¤½¤Î·¿¤¬À°¿ô¤Î
-¾ì¹ç¡¢¤½¤ì¤ò @code{_rowid} ¤È¤·¤Æ¤â»²¾È¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹(3.23.11 ¤Ç¤Î¿·µ¡
-ǽ)¡£
-
-@item
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ë̾Á°¤ò³ä¤êÅö¤Æ¤Ê¤¤¾ì¹ç¡¢°ì°Õ¤Ê̾Á°¤òÉÕ¤±¤ë¤¿¤á¤Ë¡¢@code{index_col_name}Æâ¤ÎºÇ½é¤Î¥Õ¥£¡¼¥ë¥É̾¤Ë(@code{_2}, @code{_3}, ...)¤Î¤è¤¦¤Ê¥µ¥Õ¥£¥Ã¥¯¥¹¤òÉղä·¤¿¤â¤Î¤¬³ä¤êÅö¤Æ¤é¤ì¤Þ¤¹¡£¥Æ¡¼¥Ö¥ë¤¬»ÈÍѤ·¤Æ¤¤¤ë¥¤¥ó¥Ç¥Ã¥¯¥¹Ì¾¤Ï¡¢@code{SHOW INDEX FROM tbl_name}¤Ë¤è¤ê³Îǧ¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@xref{SHOW, , @code{SHOW}}.
-
-@item
-@cindex @code{NULL} values, and indexes
-@cindex Indexes, and @code{NULL} values
-@code{MyISAM} ¥Æ¡¼¥Ö¥ë¤Î¤ß¤¬¡¢@code{NULL} Ãͤò¤â¤Ä¥Õ¥£¡¼¥ë¥É¤ËÂФ·¤Æ
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ä¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
-¤½¤Î¾¤Î¥Æ¡¼¥Ö¥ë·¿¤Î¾ì¹ç¡¢¥Õ¥£¡¼¥ë¥É¤ò @code{NOT NULL} ¤ÇÄêµÁ¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-
-@item
-@code{col_name(length)}ʸ¤ò¶¦¤Ë»ØÄꤹ¤ë¤³¤È¤Ç¡¢@code{CHAR}¥Õ¥£¡¼¥ë¥ÉËô¤Ï@code{VARCHAR}¥Õ¥£¡¼¥ë¥É¤Î°ìÉôʬ¤À¤±¤ò¥¤¥ó¥Ç¥Ã¥¯¥¹¤È¤·¤ÆÄêµÁ¤Ç¤­¤Þ¤¹¡£¤³¤ì¤Ë¤è¤ê¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¤òŬÅ٤˾®¤µ¤¯¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@xref{Indexes}.
-
-@item
-@cindex @code{BLOB} columns, indexing
-@cindex Indexes, and @code{BLOB} columns
-@cindex @code{TEXT} columns, indexing
-@cindex Indexes, and @code{TEXT} columns
-@code{MyISAM} ¥Æ¡¼¥Ö¥ë·¿¤Î¤ß¤¬¡¢ @code{BLOB} ¤È @code{TEXT} ¥Õ¥£¡¼¥ë¥É¾å¤Ë
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ä¤³¤È¤¬½ÐÍè¤Þ¤¹¡£ @code{BLOB} ¤È @code{TEXT} ¥Õ¥£¡¼¥ë¥É¤Ë
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÄ¥¤ë¾ì¹ç¡¢¾ï¤Ë¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎŤµ¤ò»ØÄꤷ¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡§
-@example
-CREATE TABLE test (blob_col BLOB, index(blob_col(10)));
-@end example
-
-@item
-@code{TEXT}¥Õ¥£¡¼¥ë¥É¤ä@code{BLOB}¥Õ¥£¡¼¥ë¥É¤Ç @code{ORDER BY} ¤ä @code{GROUP BY} ¤ò
-»ÈÍѤ¹¤ë¤È¡¢ºÇ½é¤Î@code{max_sort_length}¥Ð¥¤¥È¤À¤±¤¬»ÈÍѤµ¤ì¤Þ¤¹¡£
-@xref{BLOB, , @code{BLOB}}.
-
-@item
-@code{FOREIGN KEY}¡¢@code{CHECK}µÚ¤Ó@code{REFERENCES}Àá¤Ï¼ÂºÝ¤Ë¤Ï²¿¤â¹Ô¤¤¤Þ¤»¤ó¡£¤³¤ì¤é¤Î¹½Ê¸¤Ï¡¢¸ß´¹À­¤Î¤¿¤á¤À¤±¤ËÍÑ°Õ¤µ¤ì¤Æ¤ª¤ê¡¢Â¾¤ÎSQL¥µ¡¼¥Ð¤«¤é¤Î¥³¡¼¥É¤Î°Ü¿¢¤òÍưפˤ·¤¿¤ê¡¢»²¾È¾ðÊó¤È¶¦¤Ë¥Æ¡¼¥Ö¥ë¤òºîÀ®¤¹¤ë¤è¤¦¤Ê¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤òÆ°ºî¤µ¤»¤ë¤³¤È¤òÌÜŪ¤È¤·¤Æ¤¤¤Þ¤¹¡£
-@xref{Missing functions}.
-
-@item
-Á´¤Æ¤Î@code{NULL}¥Õ¥£¡¼¥ë¥É¤Ï¡¢1¥Ó¥Ã¥È;·×¤Ë¾ÃÈñ¤·¡¢Ä¾¶á¤Î¥Ð¥¤¥È¤Ë´Ý¤á¤é¤ì¤Þ¤¹¡£
-
-@item
-¥ì¥³¡¼¥É¤ÎºÇÂçĹ¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æµá¤á¤é¤ì¤Þ¤¹:
-
-@example
-¥ì¥³¡¼¥É¤ÎŤµ = 1
- + (¥Õ¥£¡¼¥ë¥É¤ÎŤµ¤Î¹ç·×)
- + (NULL¥Õ¥£¡¼¥ë¥É¤Î¿ô + 7)/8
- + (²ÄÊÑĹ¥Õ¥£¡¼¥ë¥É¤Î¿ô)
-@end example
-
-@item @code{table_options} ¤È @code{SELECT} ¥ª¥×¥·¥ç¥ó¤Ï¡¢
-@strong{MySQL} 3.23 °Ê¾å¤Ç¤Î¤ß¼ÂÁõ¤µ¤ì¤Þ¤¹¡£
-
-¥Æ¡¼¥Ö¥ë·¿¤Ï¡§
-
-@multitable @columnfractions .20 .80
-@item ISAM @tab ¥ª¥ê¥¸¥Ê¥ë¤Î¥Æ¡¼¥Ö¥ë @xref{ISAM}.
-@item MyISAM @tab ¿·¤·¤¤¡¢¥Ð¥¤¥Ê¥ê¸ß´¹¤Î¥Æ¡¼¥Ö¥ë @xref{MyISAM}.
-@item HEAP @tab ¤³¤Î¥Æ¡¼¥Ö¥ë¤Î¥Ç¡¼¥¿¤Ï¡¢¥á¥â¥ê¡¼Æâ¤Ë¤Î¤ßÃߤ¨¤é¤ì¤ë @xref{HEAP}.
-@item BDB ¤Þ¤¿¤Ï Berkeley_db @tab ¥È¥é¥ó¥¶¥¯¥·¥ç¥ó°ÂÁ´¤Ê¥Æ¡¼¥Ö¥ë @xref{BDB}.
-@end multitable
-@xref{Table types}.
-
-¤½¤Î¾¤Î¥Æ¡¼¥Ö¥ë¥ª¥×¥·¥ç¥ó¤ò»È¤Ã¤Æ¡¢¥Æ¡¼¥Ö¥ë¤Î¿¶¤ëÉñ¤¤¤òºÇŬ²½¤·¤Þ¤¹¡£
-¤¿¤¤¤Æ¤¤¤Î¾ì¹ç¤Ï¡¢¥ª¥×¥·¥ç¥ó¤òÌÀ¼¨¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤»¤ó¡£
-ÌÀ¼¨Åª¤Ë»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¥ª¥×¥·¥ç¥ó¤Ï¤¹¤Ù¤Æ¤Î¥Æ¡¼¥Ö¥ë·¿¤ËºîÍѤ·¤Þ¤¹¡£
-
-@multitable @columnfractions .20 .80
-@item @code{AUTO_INCREMENT} @tab ¤¢¤Ê¤¿¤¬¤³¤Î¥Æ¡¼¥Ö¥ë¤Ë¥»¥Ã¥È¤·¤¿¤¤¡¢¼¡¤Î auto_increment ÃÍ
-@item @code{AVG_ROW_LENGTH} @tab ¥Æ¡¼¥Ö¥ë¤Ë´Þ¤Þ¤ì¤ë¥ì¥³¡¼¥É¤ÎŤµ¤Î¤ª¤ª¤è¤½¤ÎÊ¿¶ÑÃÍ¡£ ²ÄÊÑĹ¤Î¥ì¥³¡¼¥É¤ò»ý¤Ä¾ì¹ç¤Ë¤Î¤ß¡¢¤³¤ì¤ò¥»¥Ã¥È¤·¤Þ¤¹¡£
-@item @code{CHECKSUM} @tab @strong{MySQL} ¤ËÁ´¤Æ¤Î¥ì¥³¡¼¥É¤ò¥Á¥§¥Ã¥¯¤µ¤»¤¿¤¤¾ì¹ç¡¢¤³¤ì¤ò 1 ¤Ë¥»¥Ã¥È¤·¤Þ¤¹¡£ (¤³¤ì¤Ï¹¹¿·¤òÃÙ¤¯¤µ¤»¤Þ¤¹¤¬¡¢ÉÔÀ°¹ç¤ÎÀ¸¤¸¤¿¥Æ¡¼¥Ö¥ë¤ò¸«¤Ä¤±½Ð¤·¤ä¤¹¤¯¤Ê¤ê¤Þ¤¹) (MyISAM)
-@item @code{COMMENT} @tab ¥Æ¡¼¥Ö¥ë¤Î¡¢60ʸ»ú¥³¥á¥ó¥È
-@item @code{MAX_ROWS} @tab ¤¢¤Ê¤¿¤¬¥Æ¡¼¥Ö¥ë¤ËÊݸ¤·¤¿¤¤¤È¹Í¤¨¤Æ¤¤¤ëºÇÂç¥ì¥³¡¼¥É¿ô¡£
-@item @code{MIN_ROWS} @tab ¤¢¤Ê¤¿¤¬¥Æ¡¼¥Ö¥ë¤ËÊݸ¤·¤¿¤¤¤È¹Í¤¨¤Æ¤¤¤ëºÇÄã¥ì¥³¡¼¥É¿ô
-@item @code{PACK_KEYS} @tab ¤è¤ê¾®¤µ¤¤¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ë¤·¤¿¤¤¤Ê¤é¡¢¤³¤ì¤ò 1 ¤Ë¤·¤Þ¤¹¡£ ¤³¤ì¤Ï¹¹¿·¤òÃÙ¤¯¤·¤Þ¤¹¤¬¡¢Æɤ߽Ф·¤Ï®¤¯¤Ê¤ê¤Þ¤¹ (MyISAM, ISAM).
-@item @code{PASSWORD} @tab @code{.frm} ¥Õ¥¡¥¤¥ë¤ò¥Ñ¥¹¥ï¡¼¥ÉÉÕ¤­¤Ç°Å¹æ²½¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢É¸½à¤Î @strong{MySQL} ¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¤Ê¤Ë¤â¹Ô¤¤¤Þ¤»¤ó¡£
-@item @code{DELAY_KEY_WRITE} @tab ¥Æ¡¼¥Ö¥ë¤¬¥¯¥í¡¼¥º¤µ¤ì¤ë¤Þ¤Ç¥­¡¼¥Æ¡¼¥Ö¥ë¤Î¹¹¿·¤òÁ÷¤é¤»¤¿¤¤¾ì¹ç¡¢1¤ËÀßÄꤷ¤Þ¤¹(MyISAM)¡£
-@item @code{ROW_FORMAT} @tab ¥ì¥³¡¼¥É¤¬¤É¤Î¤è¤¦¤Ë³ÊǼ¤µ¤ì¤ë¤«¤òÄêµÁ¤·¤Þ¤¹(¾­Íè¤Î¤¿¤á)¡£
-@end multitable
-
-@code{MyISAM} ¥Æ¡¼¥Ö¥ë¤ò»ÈÍѤ¹¤ë¤Ê¤é¤Ð¡¢@strong{MySQL} ¤Ï
-@code{max_rows * avg_row_length} ¤ÎÃͤò¡¢¥Æ¡¼¥Ö¥ë¤¬¤É¤Î¤¯¤é¤¤Â礭¤¯¤Ê¤ë¤«
-¤Î¿äÄê¤Ë»ÈÍѤ·¤Þ¤¹¡£
-¤â¤·¡¢¾åµ­¤Î¥ª¥×¥·¥ç¥ó¤ò¤Ê¤Ë¤â»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¥Æ¡¼¥Ö¥ë¤ÎºÇÂ祵¥¤¥º¤Ï
-4G ¤Ë¤Ê¤ê¤Þ¤¹¡£(¤«¡¢¤¢¤Ê¤¿¤Î OS ¤¬ 2G ¤·¤«¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤±¤ì¤Ð 2G ¤Þ¤Ç)
-
-@code{PACK_KEYS} ¤ò»ÈÍѤ·¤Ê¤¤¾ì¹ç¡¢¥Ç¥Õ¥©¥ë¥È¤Ïʸ»úÎó¤À¤±¤ò¥Ñ¥Ã¥¯¤·¡¢¿ôÃÍ
-¤Ï¥Ñ¥Ã¥¯¤·¤Þ¤»¤ó¡£@code{PACK_KEYS=1} ¤ò»ÈÍѤ¹¤ë¤È¤µ¤é¤Ë¿ôÃͤâ¥Ñ¥Ã¥¯¤µ¤ì¤Þ
-¤¹¡£
-
-¥Ð¥¤¥Ê¥ê¿ôÃÍ¥­¡¼¤ò¥Ñ¥Ã¥¯¤¹¤ë»þ¡¢@strong{MySQL} ¤Ï¥×¥ì¥Õ¥£¥Ã¥¯¥¹°µ½Ì¤ò»ÈÍÑ
-¤·¤Þ¤¹¡£¤³¤ì¤Ï¡¢Æ±¤¸¿ôÃͤò¿¤¯»ý¤Ä¾ì¹ç¤Ë¤À¤±¤³¤ÎÂ礭¤Ê²¸·Ã¤òÆÀ¤ë¤È¤¤¤¦¤³¤È
-¤ò°ÕÌ£¤·¤Þ¤¹¡£¥×¥ì¥Õ¥£¥Ã¥¯¥¹°µ½Ì¤Ï¡¢Á°¤Î¥­¡¼¤Î²¿¥Ð¥¤¥È¤¬¼¡¤Î¥­¡¼¤ÈƱ¤¸¤Ç¤¢
-¤ë¤«¤ò¼¨¤¹¤¿¤á¤Î;·×¤Ê1¥Ð¥¤¥È¤¬¤¹¤Ù¤Æ¤Î¥­¡¼¤ËɬÍפȤʤ뤳¤È¤ò°ÕÌ£¤·¤Þ¤¹(Ãí
-°Õ: ¥ì¥³¡¼¥É¤Ø¤Î¥Ý¥¤¥ó¥¿¤Ï¡¢°µ½Ì¤Î¸þ¾å¤Î¤¿¤á high-byte-first-order ¤Ç¥­¡¼
-¤Îľ¸å¤Ë³ÊǼ¤µ¤ì¤Þ¤¹)¡£¤³¤ì¤Ï¡¢2¤Ä¤Î¥ì¥³¡¼¥É¤¬Æ±¤¸¥­¡¼Â¿¤¯»ý¤Ä¾ì¹ç¡¢¸å¤Î¤¹
-¤Ù¤Æ¤Î'Ʊ¤¸'¥­¡¼¤ÏÄ̾ï2¥Ð¥¤¥È(¥ì¥³¡¼¥É¤Ø¤Î¥Ý¥¤¥ó¥¿¤ò´Þ¤à)¤À¤±¤òɬÍפȤ¹¤ë
-¤È¤¤¤¦¤³¤È¤Ç¤¹¡£¤³¤ì¤ò¡¢Ä̾ï¤Î¥±¡¼¥¹¤ÈÈæ³Ó¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£Ä̾ï¤Î¥±¡¼¥¹¤Ï¡¢
-¸å¤Î¥­¡¼¤Ï'¥­¡¼¤Î³ÊǼ¥µ¥¤¥º' + ¥Ý¥¤¥ó¥¿¥µ¥¤¥º(Ä̾ï4)¤òɬÍפȤ·¤Þ¤¹¡£°ìÊý¡¢
-¤¹¤Ù¤Æ¤Î¥­¡¼¤¬Á´¤¯°Û¤Ê¤Ã¤Æ¤¤¤ë¤È¡¢¥­¡¼¤¬ @code{NULL} Ãͤò»ý¤Ä¤³¤È¤¬¤Ç¤­¤ë
-¥­¡¼¤Ç¤Ï¤Ê¤¤¾ì¹ç¤Ç¤Ï¡¢¥­¡¼Ëè¤Ë1¥Ð¥¤¥È¤ò¾ÃÈñ¤·¤Þ¤¹(¤³¤Î¾ì¹ç¡¢¥Ñ¥Ã¥¯¤µ¤ì¤¿¥­¡¼
-¤ÎŤµ¤Ï¡¢¥­¡¼¤¬ @code{NULL} ¤Î»þ¤Ë¥Þ¡¼¥¯¤Î¤¿¤á¤Ë»ÈÍѤµ¤ì¤ë¤Î¤ÈƱ¤¸¥Ð¥¤¥È
-¿ô¤Ç³ÊǼ¤µ¤ì¤Þ¤¹)¡£
-
-@item
-¤â¤· @code{CREATE STATEMENT} ¤Î¸å¤Ë @code{SELECT} ¤ò»ØÄꤹ¤ë¤Ê¤é¤Ð¡¢
-@strong{MySQL} ¤Ï¡¢@code{SELECT} ¤ÇÊ֤äƤ¯¤ëÁ´¤Æ¤Î¹àÌܤò¼ý¤á¤ë¤¿¤á¤Ë¡¢
-¿·¤·¤¤¥Õ¥£¡¼¥ë¥É¤òºîÀ®¤·¤Þ¤¹¡£
-Î㤨¤Ð¡§
-
-@example
-mysql> CREATE TABLE test (a int not null auto_increment,
- primary key (a), key(b))
- TYPE=HEAP SELECT b,c from test2;
-@end example
-
-¤³¤ì¤Ï 3¤Ä¤Î¥Õ¥£¡¼¥ë¥É¤ò @code{HEAP} ¥Æ¡¼¥Ö¥ë¤ËºîÀ®¤·¤Þ¤¹¡£
-¤â¤·¥Ç¡¼¥¿¤ò¥Æ¡¼¥Ö¥ë¤Ë¥³¥Ô¡¼¤·¤Æ¤¤¤ëºÇÃæ¤Ë¥¨¥é¡¼¤¬µ¯¤­¤¿¤Ê¤é¡¢
-¤³¤Î¥Æ¡¼¥Ö¥ë¤Ï¼«Æ°Åª¤Ë¾Ãµî¤µ¤ì¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-@code{RAID_TYPE} ¥ª¥×¥·¥ç¥ó¤Ï¡¢Â絬ÌÏ¥Õ¥¡¥¤¥ë¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤ OS ¾å¤Î
-2G/4G¤ÎÀ©¸Â¤òÇˤë¼ê½õ¤±¤ò¤·¤Þ¤¹¡£¤Þ¤¿¡¢@code{RAID} ¥Ç¥£¥ì¥¯¥È¥ê¤òÊ̤ÎʪÍý
-¥Ç¥£¥¹¥¯¤ËÃÖ¤¯¤³¤È¤Ë¤è¤ê¡¢IO ¥Ü¥È¥ë¥Í¥Ã¥¯¤«¤é¤µ¤é¤Ë®ÅÙ¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ
-¤¹¡£@code{RAID_TYPE} ¤Ï¡¢@strong{MySQL} ¤ò @code{--with-raid} ¤Ç¥³¥ó¥Õ¥£¥°
-¤¹¤ì¤Ð¡¢¤É¤ó¤Ê OS ¾å¤Ç¤âƯ¤­¤Þ¤¹¡£¸½ºß¡¢@code{RAID_TYPE} ¤Ï
-@code{STRIPED} ¤À¤±¤¬µö¤µ¤ì¤Æ¤¤¤Þ¤¹(@code{1} ¤È @code{RAID0} ¤Ï¤³¤ì¤ÎÊÌ̾
-¤Ç¤¹)¡£
-
-@code{RAID_TYPE=STRIPED} ¤ò @code{MyISAM} ¥Æ¡¼¥Ö¥ë¤Ë»ØÄꤹ¤ë¤È¡¢
-@code{MyISAM} ¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥êÃæ¤Ë 00, 01, 02 ¤È¤¤¤¦Ì¾Á°¤Î
-@code{RAID_CHUNKS} ¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤òÀ¸À®¤·¤Þ¤¹¡£¤³¤ì¤é¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Î¤½
-¤ì¤¾¤ì¤Ë¡¢@code{MyISAM} ¤Ï @code{table_name.MYD} ¤òÀ¸À®¤·¤Þ¤¹¡£¥Ç¡¼¥¿¥Õ¥¡
-¥¤¥ë¤Ë¥Ç¡¼¥¿¤¬½ñ¤­¹þ¤Þ¤ì¤ë»þ¡¢@code{RAID} ¥Ï¥ó¥É¥é¤ÏºÇ½é¤Î
-@code{RAID_CHUNKSIZE} *1024 ¥Ð¥¤¥È¤òºÇ½é¤Î¥Õ¥¡¥¤¥ë¤Ë¡¢¼¡¤Î
-@code{RAID_CHUNKSIZE} *1024 ¥Ð¥¤¥È¤ò¼¡¤Î¥Õ¥¡¥¤¥ë¤Ë¥Þ¥Ã¥×¤·¤Þ¤¹¡£
-@end itemize
-
-
-@node Silent column changes, , CREATE TABLE, CREATE TABLE
-@subsection °ÅÌۤΥե£¡¼¥ë¥ÉÄêµÁÊѹ¹
-
-¤¤¤¯¤Ä¤«¤Î¥±¡¼¥¹¤Ë¤ª¤¤¤Æ@strong{MySQL}¤Ï¡¢@code{CREATE TABLE}¥¹¥Æ¡¼¥È¥á¥ó¥È¤ÇÍ¿¤¨¤é¤ì¤¿¥Õ¥£¡¼¥ë¥ÉÄêµÁ¤ò°ÅÌÛ¤ÎÆâ¤ËÊѹ¹¤·¤Þ¤¹
-(¤³¤ì¤Ï @code{ALTER TABLE} ¤Çµ¯¤­¤ë¤«¤â¤·¤ì¤Þ¤»¤ó)
-
-@itemize @bullet
-@item
-¥Õ¥£¡¼¥ë¥ÉŤ¬4̤Ëþ¤Î@code{VARCHAR}¥Õ¥£¡¼¥ë¥É¤Ï@code{CHAR}¤ËÊѹ¹¤µ¤ì¤Þ¤¹¡£
-
-@item
-¥Æ¡¼¥Ö¥ëÆâ¤Ë¤¤¤¯¤Ä¤«¤Î²ÄÊÑĹ¥Õ¥£¡¼¥ë¥É¤¬¤¢¤ë¾ì¹ç¡¢·ë²ÌŪ¤Ë¥ì¥³¡¼¥ÉÁ´ÂΤ¬²ÄÊÑĹ¤È¤Ê¤ê¤Þ¤¹¡£
-¤½¤Î·ë²Ì¡¢¥Æ¡¼¥Ö¥ë¤¬¤¤¤¯¤Ä¤«¤Î²ÄÊÑĹ¥Õ¥£¡¼¥ë¥É(@code{VARCHAR}¡¢@code{TEXT}µÚ¤Ó@code{BLOB})
-¤ò»ý¤Ä¤Ê¤é¤Ð¡¢3ʸ»ú¤è¤êÂ礭¤¤¥Õ¥£¡¼¥ë¥ÉŤÎÁ´¤Æ¤Î@code{CHAR}¥Õ¥£¡¼¥ë¥É¤Ï¡¢
-@code{VARCHAR}¥Õ¥£¡¼¥ë¥É¤ËÊѹ¹¤µ¤ì¤Þ¤¹¡£
-¤³¤Î¤³¤È¤Ï¡¢¥Õ¥£¡¼¥ë¥É¤Î»ÈÍÑÊýË¡¤Ë¤Ï±Æ¶Á¤·¤Þ¤»¤ó¡£
-@strong{MySQL}¤Ç¤Ï¡¢@code{VARCHAR}¤Ïʸ»úÎó¤ò³ÊǼ¤¹¤ë¤¿¤á¤Î1¤Ä¤Î¼êÃʤ˲᤮¤Þ¤»¤ó¡£
-@strong{MySQL}¤Ï¡¢¥¹¥Ú¡¼¥¹Ëä¤á¤Î¥³¥ó¥Ð¡¼¥¸¥ç¥ó¤ò¹Ô¤¤¤Þ¤¹¤·¡¢¥Æ¡¼¥Ö¥ëÁàºî¤â¤è¤ê®¤¯¹Ô¤¤¤Þ¤¹¡£
-@xref{Table types}.
-
-@item
-@code{TIMESTAMP}¥Õ¥£¡¼¥ë¥É¤Îɽ¼¨¥µ¥¤¥º¤Ï¡¢2¡Á14¤ÎÈϰϤζö¿ô¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£É½¼¨¥µ¥¤¥º¤ò0¤ä14¤è¤êÂ礭¤¯»ØÄꤷ¤¿¾ì¹ç¡¢¥µ¥¤¥º¤Ï14¤Ë¶¯À©¤µ¤ì¤Þ¤¹¡£1¤«¤é13¤ÎÈϰϤδñ¿ô¤Î¾ì¹ç¡¢Â礭¤¤Êý¤Î¶ö¿ôÃͤ˶¯À©¤µ¤ì¤Þ¤¹¡£
-
-@item
-@code{TIMESTAMP} ¥Õ¥£¡¼¥ë¥É¤Ë¤Ï @code{NULL} ¤òÂåÆþ¤Ç¤­¤Þ¤»¤ó¡¨ @code{NULL} ¤Ï
-¸½ºß¤ÎÆü»þ¤ò¥»¥Ã¥È¤·¤Þ¤¹¡£
-@code{NULL} and @code{NOT NULL} °À­¤ÏÄ̾ï¤ÎÊýË¡¤Ç¤ÏŬÍѤµ¤ì¤º¡¢¤½¤ì¤é¤ò
-Í¿¤¨¤¿¾ì¹ç¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£
-@code{DESCRIBE tbl_name} ¤Ï¾ï¤Ë @code{TIMESTAMP} ¥Õ¥£¡¼¥ë¥É¤Ë @code{NULL} Ãͤ¬³ä¤êÅö¤Æ
-¤é¤ì¤¿»ö¤ò¹ð¤²¤Þ¤¹¡£
-
-@item
-@strong{MySQL} ¤Ï¾¤Î SQL ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î»ÈÍѤ·¤Æ¤¤¤ë·¿¤ò @strong{MySQL} ·¿¤Ë
-¥Þ¥Ã¥×¤·¤Þ¤¹¡£ @xref{Other-vendor column types}.
-@end itemize
-
-¤â¤· @strong{MySQL} ¤¬¥Õ¥£¡¼¥ë¥É¤Î·¿¤ò¤¢¤Ê¤¿¤¬»ØÄꤷ¤¿¤â¤Î¤È°ã¤¦¤â¤Î¤Ë¤·¤¿¤«¤É¤¦¤«¤ò
-ÃΤꤿ¤¤¾ì¹ç¡¢¥Æ¡¼¥Ö¥ë¤ÎºîÀ®¡¢alter ¸å¤Ë¡¢ @code{DESCRIBE tbl_name} ¹½Ê¸
-¤òȯ¹Ô¤·¤Þ¤¹¡£
-
-@cindex @code{myisampack}
-@code{myisampack}¤ò»ÈÍѤ·¤Æ¥Æ¡¼¥Ö¥ë¤ò°µ½Ì¤·¤¿¾ì¹ç¡¢Ê̤Υե£¡¼¥ë¥ÉÄêµÁÊѹ¹¤¬¤¢¤ëÄøÅÙµ¯¤³¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£
-@xref{Compressed format}.
-
-@findex ALTER TABLE
-@node ALTER TABLE, DROP TABLE, CREATE TABLE, Reference
-@section @code{ALTER TABLE}¹½Ê¸
-
-@example
-ALTER [IGNORE] TABLE tbl_name alter_spec [, alter_spec ...]
-
-alter_specification:
- ADD [COLUMN] create_definition [FIRST | AFTER column_name ]
- or ADD [COLUMN] (create_definition, create_definition,...)
- or ADD INDEX [index_name] (index_col_name,...)
- or ADD PRIMARY KEY (index_col_name,...)
- or ADD UNIQUE [index_name] (index_col_name,...)
- or ALTER [COLUMN] col_name @{SET DEFAULT literal | DROP DEFAULT@}
- or CHANGE [COLUMN] old_col_name create_definition
- or MODIFY [COLUMN] create_definition
- or DROP [COLUMN] col_name
- or DROP PRIMARY KEY
- or DROP INDEX index_name
- or RENAME [AS] new_tbl_name
- or table_options
-@end example
-
-@code{ALTER TABLE}¤Ï¡¢´û¸¤Î¥Æ¡¼¥Ö¥ë¤Î¹½Â¤Êѹ¹¤ò²Äǽ¤Ë¤·¤Þ¤¹¡£
-Î㤨¤Ð¡¢¥Õ¥£¡¼¥ë¥É¤ÎÄɲääºï½ü¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎºîÀ®¤äÇË´þ¡¢´û¸¤Î¥Õ¥£¡¼¥ë¥É°À­¤ÎÊѹ¹¡¢µÚ¤Ó¥Õ¥£¡¼¥ë¥É¤ä¥Æ¡¼¥Ö¥ë¤½¤Î¤â¤Î¤Î̾Á°¤ÎÊѹ¹¤Ç¤¹¡£
-¤Þ¤¿¡¢¥Æ¡¼¥Ö¥ë¤Î¥³¥á¥ó¥È¤ä¥Æ¡¼¥Ö¥ë¤Î·¿¼°¤òÊѹ¹¤¹¤ë¤³¤È¤â²Äǽ¤Ç¤¹¡£
-@xref{CREATE TABLE, , @code{CREATE TABLE}}.
-
-¤â¤· @code{ALTER TABLE} ¤Ç¥Õ¥£¡¼¥ë¥ÉÄêµÁ¤òÊѤ¨¤Æ¤â @code{DESCRIBE tbl_name} ¤¬
-¥Õ¥£¡¼¥ë¥É¤òÊѹ¹¤·¤Æ¤¤¤Ê¤¤¤È¼¨¤¹¤Ê¤é¡¢¤³¤ì¤Ï @strong{MySQL} ¤¬
- @ref{Silent column changes}. ¤Ë½Ò¤Ù¤Æ¤¤¤ëÍýͳ¤Î°ì¤Ä¤ÇÊѹ¹¤·¤Æ¤¤¤Ê¤¤²ÄǽÀ­¤¬
-¤¢¤ê¤Þ¤¹¡£ Î㤨¤Ð¡¢ @code{VARCHAR} ¥Õ¥£¡¼¥ë¥É¤ò @code{CHAR} ¤Ë¤·¤è¤¦¤È¤¹¤ë¤È,
-@strong{MySQL} ¤Ï¤½¤Î¥Æ¡¼¥Ö¥ë¤Ë¾¤Î²ÄÊÑĹ¤Î¥Õ¥£¡¼¥ë¥É¤¬¤¢¤ë¤«¤®¤ê¡¢
-@code{VARCHAR} ¤Î¤Þ¤Þ¤Ë¤·¤è¤¦¤È¤·¤Þ¤¹¡£
-
-@code{ALTER TABLE}¤Ï¥ª¥ê¥¸¥Ê¥ë¤Î¥Æ¡¼¥Ö¥ë¤Î°ì»þŪ¤Ê¥³¥Ô¡¼¤òºîÀ®¤¹¤ë¤³¤È¤Ë¤è¤êÆ°ºî¤·¤Þ¤¹¡£
-¥³¥Ô¡¼¤Ø¤ÎÊѹ¹ºî¶È¤¬´°Î»¤¹¤ë¤È¡¢¥ª¥ê¥¸¥Ê¥ë¤Î¥Æ¡¼¥Ö¥ë¤Ïºï½ü¤µ¤ì¿·¤·¤¯ºî¤é¤ì¤¿Êý¤Î̾Á°¤¬Êѹ¹¤µ¤ì¤Þ¤¹¡£¤³¤ì¤ÏÁ´¤Æ¤ÎÊѹ¹¤¬¼«Æ°Åª¤Ë¿·¤·¤¤¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ¼Â»Ü¤µ¤ì¤ë¤³¤È¤Ë¤è¤ê¡¢¸í¤Ã¤¿Êѹ¹Ìµ¤·¤Ë´°Î»¤·¤Þ¤¹¡£@code{ALTER TABLE}¤¬¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë´Ö¡¢¥ª¥ê¥¸¥Ê¥ë¤Î¥Æ¡¼¥Ö¥ë¤Ï¾¤Î¥¯¥é¥¤¥¢¥ó¥È¤«¤éÆɤߤÀ¤·¤¬²Äǽ¤Ç¤¹¡£¤³¤Î¥Æ¡¼¥Ö¥ë¤Ø¤Î¹¹¿·¤ä½ñ¤­¹þ¤ß¤Ï¡¢¿·¤·¤¤¥Æ¡¼¥Ö¥ë¤¬½àÈ÷´°Î»¤È¤Ê¤ë¤Þ¤ÇÃ٤餵¤ì¤Þ¤¹¡£
-
-@itemize @bullet
-@item
-@code{ALTER TABLE}¤ò»È¤¦¤Ë¤Ï¡¢¤½¤Î¥Æ¡¼¥Ö¥ë¤Ë@strong{select}¡¢@strong{insert}¡¢
-@strong{delete}¡¢@strong{update}¡¢@strong{create}¡¢¤½¤ì¤«¤é@strong{drop}
-¸¢¸Â¤¬É¬ÍפǤ¹¡£
-
-@item
-@code{IGNORE}¤ÏANSI SQL92¤ËÂФ¹¤ë@strong{MySQL}¤Î³ÈÄ¥¤Ç¤¹¡£
-¤³¤ì¤Ï¡¢¿·¤·¤¤¥Æ¡¼¥Ö¥ë¤Î¥æ¥Ë¡¼¥¯¥­¡¼¤Ç½ÅÊ£¤¬¤¢¤Ã¤¿¾ì¹ç¤ÎÆ°ºî¤òÀ©¸æ¤·¤Þ¤¹¡£
-@code{IGNORE}¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¢¥³¥Ô¡¼¤Ï°Û¾ï½ªÎ»¤·¡¢¥í¡¼¥ë¥Ð¥Ã¥¯¤µ¤ì¤Þ¤¹¡£
-@code{IGNORE}¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¡¢¥æ¥Ë¡¼¥¯¥­¡¼¤Î½ÅÊ£¤¬¤¢¤Ã¤¿¥ì¥³¡¼¥É¤ËÂФ·¡¢ºÇ½é¤Î¥ì¥³¡¼¥É¤À¤±¤ò»ÈÍѤ·¡¢Â¾¤Ïºï½ü¤µ¤ì¤Þ¤¹¡£
-
-@item
-1¤Ä¤Î@code{ALTER TABLE}¥¹¥Æ¡¼¥È¥á¥ó¥È¤ÎÃæ¤Ç¡¢@code{ADD}¡¢@code{ALTER}¡¢
-@code{DROP}¡¢¤½¤ì¤«¤é@code{CHANGE}Àá¤ÎÊ£¹çŪ¤Êȯ¹Ô¤¬²Äǽ¤Ç¤¹¡£
-¤³¤ì¤Ï¡¢@code{ALTER TABLE}¥¹¥Æ¡¼¥È¥á¥ó¥ÈËè¤Ë1¤Ä¤À¤±¤·¤«¤³¤ì¤é¤ÎÀá¤ò
-µö¤µ¤Ê¤¤ANSI SQL92¤ËÂФ¹¤ë@strong{MySQL}¤Î³ÈÄ¥¤Ç¤¹¡£
-
-@item
-@code{CHANGE col_name}¡¢@code{DROP col_name}µÚ¤Ó@code{DROP
-INDEX}¤ÏANSI SQL92¤ËÂФ¹¤ë@strong{MySQL}¤Î³ÈÄ¥¤Ç¤¹¡£
-
-@item
-@code{MODIFY} ¤Ï @code{Oracle} ¤Î @code{ALTER TABLE} ³ÈÄ¥¤Ç¤¹¡£
-
-@item
-¥ª¥×¥·¥ç¥ó¸ì@code{COLUMN}¤Ï¼Ø­¤Ç¤¢¤ê¡¢µ­½Ò¤ò¾Ê¤¯¤³¤È¤¬²Äǽ¤Ç¤¹¡£
-
-@item
-¾¤Î¥ª¥×¥·¥ç¥ó̵¤·¤Ç@code{ALTER TABLE tbl_name RENAME AS new_name}¤ò»ÈÍѤ¹¤ë¤È¡¢
-@strong{MySQL}¤Ï@code{tbl_name}¤Ë°ìÃפ¹¤ë¥Æ¡¼¥Ö¥ë¤Î̾Á°¤òñ½ã¤ËÊѹ¹¤·¤Þ¤¹¡£
-¥Æ¥ó¥Ý¥é¥ê¥Æ¡¼¥Ö¥ë¤ÎºîÀ®¤ÏɬÍפȤ·¤Þ¤»¤ó¡£
-
-@item
-@code{create_definition}¤Ï¡¢@code{CREATE TABLE}¤Ë¤ª¤±¤ë@code{ADD}¤ä@code{CHANGE}¤ÈƱ¤¸¹½Ê¸¤ò»ÈÍѤ·¤Þ¤¹¡£
-@xref{CREATE TABLE, , @code{CREATE TABLE}}.
-
-@item
-@code{CHANGE old_col_name create_definition}Àá¤ò»ÈÍѤ¹¤ë¤³¤È¤Ë¤è¤ê¥Õ¥£¡¼¥ë¥É¤Î̾Á°¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¤³¤Î¤è¤¦¤Ê¤³¤È¤ò¹Ô¤¦¤¿¤á¤Ë¤Ï¡¢¥Õ¥£¡¼¥ë¥É¤Îµì̾¾Î¤È¿·Ì¾¾Î¡¢¤½¤ì¤«¤é¤½¤Î¥Õ¥£¡¼¥ë¥É¤Î¸½ºß¤Î·¿¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£Î㤨¤Ð¡¢¤¢¤ë@code{INTEGER}¥Õ¥£¡¼¥ë¥É¤ò@code{a}¤«¤é@code{b}¤ËÊѹ¹¤¹¤ë¾ì¹ç¡¢°Ê²¼¤Î¤è¤¦¤Ë¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹:
-
-@example
-mysql> ALTER TABLE t1 CHANGE a b INTEGER;
-@end example
-
-¤â¤·¥Õ¥£¡¼¥ë¥É¤Î̾Á°¤òÊѤ¨¤ë¤³¤È¤Ê¤¯¡¢·¿¤À¤±¤òÊѹ¹¤·¤¿¤¤¾ì¹ç¤Ç¤¢¤Ã¤Æ¤â¡¢
-¤³¤Î @code{CHANGE} ¹½Ê¸¤Ï¡¢¤¿¤È¤¨Æ±¤¸Ì¾Á°¤Ç¤¢¤Ã¤Æ¤â¡¢
-£²¤Ä¤Î̾Á°¤ò»ØÄꤹ¤ë¤è¤¦Í׵ᤷ¤Þ¤¹¡£
-Îã:
-
-@example
-mysql> ALTER TABLE t1 CHANGE b b BIGINT NOT NULL;
-@end example
-
-¤·¤«¤· @strong{MySQL} 3.22.16a ¤«¤é¤Ï, @code{MODIFY} ¤ò»ÈÍѤ·¤Æ¡¢
-̾¾ÎÊѹ¹¤ò¤¹¤ë¤³¤È¤Ê¤¯¥Õ¥£¡¼¥ë¥É¤Î·¿¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@example
-mysql> ALTER TABLE t1 MODIFY b BIGINT NOT NULL;
-@end example
-
-@item
-@code{CHANGE} ¤ä @code{MODIFY} ¤ò»ÈÍѤ·¤Æ¡¢¥Õ¥£¡¼¥ë¥É¤Î°ìÉô¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹
-¤¬Â¸ºß¤¹¤ë¤è¤¦¤Ê¥Õ¥£¡¼¥ë¥É¤òû¤¯¤·¤è¤¦¤È¤·¤Æ¤â(Î㤨¤Ð @code{VARCHAR} ¥Õ¥£¡¼
-¥ë¥É¤ÎºÇ½é¤Î10ʸ»ú¾å¤Ë¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬¤¢¤ë¾ì¹ç)¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¤µ¤ì¤¿Ê¸»ú¿ô
-¤è¤ê¤â¥Õ¥£¡¼¥ë¥É¤òû¤¯¤¹¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£
-
-@item
-@code{CHANGE} ¤ä @code{MODIFY} ¤òÍѤ¤¤Æ¥Õ¥£¡¼¥ë¥É¤Î·¿¤òÊѹ¹¤¹¤ë¾ì¹ç¡¢
-@strong{MySQL}¤Ï²Äǽ¤Ê¸Â¤ê¿·¤·¤¤·¿¤Ë¥Ç¡¼¥¿¤ò¥³¥ó¥Ð¡¼¥È¤·¤è¤¦¤È»î¤ß¤Þ¤¹¡£
-
-@item
-@strong{MySQL} 3.22°Ê¹ß¤Ç¤Ï¡¢@code{FIRST}Ëô¤Ï@code{ADD ... AFTER col_name}¤ò»ÈÍѤ·¤Æ¡¢¥Æ¡¼¥Ö¥ë¤Î¥ì¥³¡¼¥ÉÆâ¤Î»ØÄꤷ¤¿°ÌÃ֤ˡ¢¥Õ¥£¡¼¥ë¥É¤òÄɲ乤뤳¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢¥Õ¥£¡¼¥ë¥É¤Ï(¤½¤Î¥ì¥³¡¼¥É¤Î)ºÇ¸å¤ËÄɲ䵤ì¤Þ¤¹¡£
-
-@item
-@code{ALTER COLUMN}¤Ï¡¢¥Õ¥£¡¼¥ë¥É¤Î¿·¤¿¤Ê½é´üÃͤò»ØÄꤷ¤¿¤ê¡¢¥Õ¥£¡¼¥ë¥É¤Î¸Å¤¤½é´üÃͤòºï½ü¤·¤¿¤ê¤·¤Þ¤¹¡£
-¸Å¤¤½é´üÃͤ¬ºï½ü¤µ¤ì¡¢¥Õ¥£¡¼¥ë¥É¤¬@code{NULL}¤òµö¤¹¾ì¹ç¡¢¿·¤¿¤Ê½é´üÃͤÏ@code{NULL}¤È¤Ê¤ê¤Þ¤¹¡£
-@code{NULL}¤¬µö¤µ¤ì¤Ê¤¤¾ì¹ç¡¢@strong{MySQL}¤Ï¤¢¤ë½é´üÃͤò³ä¤êÅö¤Æ¤Þ¤¹¡£
-³ä¤êÅö¤Æ¤ë½é´üÃͤϡ¢
-@ref{CREATE TABLE, , @code{CREATE TABLE}}. ¤ÇÀâÌÀ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-
-@item
-@code{DROP INDEX}¤Ï¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¤òºï½ü¤·¤Þ¤¹¡£¤³¤ì¤ÏANSI SQL92¤ËÂФ¹¤ë@strong{MySQL}¤Î³ÈÄ¥¤Ç¤¹¡£
-
-@item
-¥Õ¥£¡¼¥ë¥É¤¬¥Æ¡¼¥Ö¥ë¤«¤éºï½ü¤µ¤ì¤ë¤È¡¢¤½¤Î¥Õ¥£¡¼¥ë¥É¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤«¤é¤â¤½¤Î¥Õ¥£¡¼¥ë¥É¤¬ºï½ü¤µ¤ì¤Þ¤¹¡£
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò¹½À®¤¹¤ëÁ´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤¬ºï½ü¤µ¤ì¤ë¤È¡¢¤½¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤âºï½ü¤µ¤ì¤Þ¤¹¡£
-
-@item
-@code{DROP PRIMARY KEY}¤Ï¡¢¥×¥é¥¤¥Þ¥ê¡¦¥¤¥ó¥Ç¥Ã¥¯¥¹¤òºï½ü¤·¤Þ¤¹¡£¤â¤·¥×¥é¥¤¥Þ¥ê¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬Â¸ºß¤·¤Ê¤±¤ì¤Ð¡¢¤½¤Î¥Æ¡¼¥Ö¥ë¤ÎºÇ½é¤Î@code{UNIQUE}¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬ºï½ü¤µ¤ì¤Þ¤¹¡£
-(@strong{MySQL}¤Ï¡¢ÌÀ¼¨Åª¤Ë@code{PRIMARY KEY}¤¬»ØÄꤵ¤ì¤Ê¤±¤ì¤ÐºÇ½é¤Î@code{UNIQUE}¥­¡¼¤ò@code{PRIMARY KEY}¤È¤·¤Æ°·¤¤¤Þ¤¹¡£)
-
-@item
-@findex mysql_info()
-C API´Ø¿ô@code{mysql_info()}¤Ë¤è¤ê¡¢¤É¤ì¤À¤±¤Î¥ì¥³¡¼¥É¤¬¥³¥Ô¡¼¤µ¤ì¤¿¤«¡¢(@code{IGNORE}¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë»þ¤Ï)¤É¤ì¤À¤±¤Î¥ì¥³¡¼¥É¤¬¥æ¥Ë¡¼¥¯¥­¡¼¤Î½ÅÊ£¤Ë¤è¤êºï½ü¤µ¤ì¤¿¤«¤òÄ´¤Ù¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@item
-@cindex Foreign keys
-@cindex References
-@code{FOREIGN KEY}¡¢@code{CHECK}µÚ¤Ó@code{REFERENCES}Àá¤Ï¡¢¼ÂºÝ¤Ë¤Ï
-²¿¤â¤·¤Þ¤»¤ó¡£¤³¤ì¤é¤Î¹½Ê¸¤Ï¡¢¸ß´¹À­¤Î¤¿¤á¤À¤±¤ËÍÑ°Õ¤µ¤ì¤Æ¤ª¤ê¡¢
-¾¤ÎSQL¥µ¡¼¥Ð¤«¤é¤Î¥³¡¼¥É¤Î°Ü¿¢¤òÍưפˤ·¤¿¤ê¡¢
-»²¾È¾ðÊó¤È¶¦¤Ë¥Æ¡¼¥Ö¥ë¤òºîÀ®¤¹¤ë¤è¤¦¤Ê¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤òÆ°ºî
-¤µ¤»¤ë¤³¤È¤òÌÜŪ¤È¤·¤Æ¤¤¤Þ¤¹¡£
-@xref{Missing functions}.
-@end itemize
-
-°Ê²¼¤Ï¡¢@code{ALTER TABLE}¤Î»ÈÍÑÎã¤òɽ¤¹Îã¤Ç¤¹¡£
-¼¡¤Ë¼¨¤¹¤è¤¦¤ËºîÀ®¤µ¤ì¤¿¥Æ¡¼¥Ö¥ë@code{t1}¤«¤é»Ï¤á¤Þ¤¹:
-
-@example
-mysql> CREATE TABLE t1 (a INTEGER,b CHAR(10));
-@end example
-
-¥Æ¡¼¥Ö¥ë@code{t1}¤Î̾Á°¤ò@code{t2}¤ËÊѹ¹¤¹¤ë¤Ë¤Ï:
-
-@example
-mysql> ALTER TABLE t1 RENAME t2;
-@end example
-
-¥Õ¥£¡¼¥ë¥É @code{a}¤ò @code{INTEGER} ¤«¤é @code{TINYINT NOT NULL} ¤Ë
-(̾Á°¤ÏƱ¤¸¤Þ¤Þ¤Ç)Êѹ¹¤·¡¢
-@code{b} ¤ò @code{CHAR(10)} ¤«¤é @code{CHAR(20)} ¤ËÊѹ¹¤·¤Ä¤Ä¡¢
-̾Á°¤ò @code{b} ¤«¤é @code{c}¤ËÊѹ¹¤¹¤ë¤Ë¤Ï:
-
-@example
-mysql> ALTER TABLE t2 MODIFY a TINYINT NOT NULL, CHANGE b c CHAR(20);
-@end example
-
-@code{TIMESTAMP}¤òÄɲä·¡¢Ì¾Á°¤ò@code{d}¤È¤¹¤ë¤Ë¤Ï:
-
-@example
-mysql> ALTER TABLE t2 ADD d TIMESTAMP;
-@end example
-
-¥Õ¥£¡¼¥ë¥É@code{d}¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÄɲä·¡¢¥Õ¥£¡¼¥ë¥É@code{a}¤ò¥×¥é¥¤¥Þ¥ê¡¦¥­¡¼¤È¤¹¤ë¤Ë¤Ï:
-
-@example
-mysql> ALTER TABLE t2 ADD INDEX (d), ADD PRIMARY KEY (a);
-@end example
-
-¥Õ¥£¡¼¥ë¥É@code{c}¤òºï½ü¤¹¤ë¤Ë¤Ï:
-
-@example
-mysql> ALTER TABLE t2 DROP COLUMN c;
-@end example
-
-@code{c} ¤È¤¤¤¦Ì¾Á°¤Î @code{NULL} ¤òµö²Ä¤·¤Ê¤¤ @code{AUTO_INCREMENT} À°¿ô
-¥Õ¥£¡¼¥ë¥É¤òÄɲä·¡¢ºîÀ®¤¹¤ë¤Ë¤Ï:
-
-@example
-mysql> ALTER TABLE t2 ADD c INT UNSIGNED NOT NULL AUTO_INCREMENT,
- ADD INDEX (c);
-@end example
-
-¤³¤³¤Ç²æ¡¹¤¬ @code{c} ¤ò¥¤¥ó¥Ç¥Ã¥¯¥¹»ØÄꤷ¤¿¤Î¤Ï¡¢ @code{AUTO_INCREMENT} ¥Õ¥£¡¼¥ë¥É¤Ï
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ç¤¢¤ë¤Ù¤­¤À¤«¤é¤Ç¡¢ @code{c} ¤ò @code{NOT NULL} »ØÄꤷ¤Æ¤¤¤ë¤Î¤Ï
-¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥£¡¼¥ë¥É¤Ï @code{NULL} ¤Ë¤Ç¤­¤Ê¤¤¤«¤é¤Ç¤¹¡£
-
-@code{AUTO_INCREMENT} ¥Õ¥£¡¼¥ë¥É¤òÄɲä·¤¿¾ì¹ç¡¢¥Õ¥£¡¼¥ë¥É¤ÎÃͤÏ
-¼«Æ°Åª¤Ë¥·¡¼¥±¥ó¥¹ÈÖ¹æ¤ÇËä¤á¤é¤ì¤Þ¤¹¡£
-
-See also @xref{ALTER TABLE problems, , @code{ALTER TABLE} problems}.
-
-
-@findex DROP TABLE
-@node DROP TABLE, OPTIMIZE TABLE, ALTER TABLE, Reference
-@section @code{DROP TABLE}¹½Ê¸
-
-@example
-DROP TABLE [IF EXISTS] tbl_name [, tbl_name,...]
-@end example
-
-@code{DROP TABLE}¤Ï¡¢1¤ÄËô¤Ï1¤Ä°Ê¾å¤Î¥Æ¡¼¥Ö¥ë¤òÇË´þ¤·¤Þ¤¹¡£¥Æ¡¼¥Ö¥ë¤ÎÁ´¤Æ¤Î¥Ç¡¼¥¿¤È¥Æ¡¼¥Ö¥ëÄêµÁ¤Ï@emph{ÇË´þ}¤µ¤ì¤Þ¤¹¤Î¤Ç¡¢¤³¤Î¥³¥Þ¥ó¥É¤Î»ÈÍѤϿµ½Å¤Ë¹Ô¤Ã¤Æ¤¯¤À¤µ¤¤¡ª
-
-@strong{MySQL} 3.22°Ê¹ß¤Ç¤Ï¡¢¥Æ¡¼¥Ö¥ë¤¬Â¸ºß¤·¤Ê¤¤¤³¤È¤Ëµ¯°ø¤¹¤ë¥¨¥é¡¼¤òËɤ°¤¿¤á¤Ë¡¢¥­¡¼¥ï¡¼¥É @code{IF EXISTS} ¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-
-@findex OPTIMIZE TABLE
-@node OPTIMIZE TABLE, CHECK TABLE, DROP TABLE, Reference
-@section @code{OPTIMIZE TABLE}¹½Ê¸
-
-@example
-OPTIMIZE TABLE tbl_name
-@end example
-
-@code{OPTIMIZE TABLE}¤Ï¡¢¥Æ¡¼¥Ö¥ë¤ÎÂçÉôʬ¤òºï½ü¤·¤¿¤ê¡¢²ÄÊÑĹ¤È¤Ê¤Ã¤Æ¤¤¤ë¥Æ¡¼¥Ö¥ë(@code{VARCHAR}¡¢@code{BLOB}¤â¤·¤¯¤Ï@code{TEXT}¥Õ¥£¡¼¥ë¥É¤ò»ý¤Ä¥Æ¡¼¥Ö¥ë)¤Ë¿¤¯¤ÎÊѹ¹¤ò²Ã¤¨¤¿¾ì¹ç¤Ë»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£
-ºï½ü¤µ¤ì¤¿¥ì¥³¡¼¥É¤Ï¥ê¥ó¥¯¥ê¥¹¥È¤Ç°Ý»ý¤µ¤ì¡¢¼¡¤Î@code{INSERT}Áàºî¤Ï¡¢¸Å¤¤¥ì¥³¡¼¥É°ÌÃÖ¤òºÆÍøÍѤ·¤Þ¤¹¡£
-̤»ÈÍÑÎΰè¤òºÆÀ¸¤¹¤ë¤¿¤á¤Ë@code{OPTIMIZE TABLE}¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@code{OPTIMIZE TABLE}¤Ï¡¢¥ª¥ê¥¸¥Ê¥ë¤Î¥Æ¡¼¥Ö¥ë¤Î°ì»þŪ¤Ê¥³¥Ô¡¼¤òºîÀ®¤¹¤ë¤³¤È¤Ë¤è¤êÆ°ºî¤·¤Þ¤¹¡£
-¸Å¤¤¥Æ¡¼¥Ö¥ë¤Ï¿·¤·¤¤¥Æ¡¼¥Ö¥ë¤Ë(̤»ÈÍѥ쥳¡¼¥É¤ò½ü¤¤¤Æ)¥³¥Ô¡¼¤µ¤ì¡¢
-¸µ¤Î¥Æ¡¼¥Ö¥ë¤¬ºï½ü¤µ¤ì¤Æ¤«¤é¿·¤·¤¤¥Æ¡¼¥Ö¥ë¤Î̾Á°¤¬Êѹ¹¤µ¤ì¤Þ¤¹¡£
-@code{OPTIMIZE TABLE}¤¬¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë´Ö¡¢¥ª¥ê¥¸¥Ê¥ë¤Î¥Æ¡¼¥Ö¥ë¤Ï¾¤Î¥¯¥é¥¤¥¢¥ó¥È¤«¤éÆɤߤÀ¤·¤¬²Äǽ¤Ç¤¹¡£
-¤³¤Î¥Æ¡¼¥Ö¥ë¤Ø¤Î¹¹¿·¤ä½ñ¤­¹þ¤ß¤Ï¡¢¿·¤·¤¤¥Æ¡¼¥Ö¥ë¤¬½àÈ÷´°Î»¤È¤Ê¤ë¤Þ¤ÇÃ٤餵¤ì¤Þ¤¹¡£
-¤³¤ì¤ÏÁ´¤Æ¤ÎÊѹ¹¤¬¼«Æ°Åª¤Ë¿·¤·¤¤¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ¼Â»Ü¤µ¤ì¤ë¤³¤È¤Ë¤è¤ê¡¢¸í¤Ã¤¿Êѹ¹Ìµ¤·¤Ë´°Î»¤·¤Þ¤¹¡£
-
-
-@findex CHECK TABLE
-@node CHECK TABLE, REPAIR TABLE, OPTIMIZE TABLE, Reference
-@section @code{CHECK TABLE} ¹½Ê¸
-
-@example
-CHECK TABLE tbl_name[,tbl_name...] [TYPE = QUICK]
-@end example
-
-¥Æ¡¼¥Ö¥ë¤Î¥¨¥é¡¼¤ò¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£¤³¤Î¥³¥Þ¥ó¥É¤Ï¼¡¤Î¥Õ¥£¡¼¥ë¥É¤ò»ý¤Ä¥Æ¡¼¥Ö
-¥ë¤òÊÖ¤·¤Þ¤¹:
-
-@multitable @columnfractions .35 .65
-@item Table @tab ¥Æ¡¼¥Ö¥ë̾
-@item Op @tab ¾ï¤Ë 'check'
-@item Msg_type @tab @code{status}, @code{error}, @code{info}, @code{warning} ¤Î°ì¤Ä¡£
-@item Msg_text @tab ¥á¥Ã¥»¡¼¥¸¡£
-@end multitable
-
-Ãí°Õ: ¥Á¥§¥Ã¥¯¤µ¤ì¤¿³Æ¥Æ¡¼¥Ö¥ë¤ËÂФ¹¤ë¾ðÊó¤Î¿¤¯¤Î¥ì¥³¡¼¥É¤¬ÆÀ¤é¤ì¤Þ¤¹¡£ºÇ
-¸å¤Î£±¥ì¥³¡¼¥É¤Ï @code{Msg_type status} ¤Ë¤Ê¤ê¡¢Ä̾ï¤Ï @code{OK} ¤Ç¤¢¤ë¤Ù
-¤­¤Ç¤¹¡£@code{OK} ¤¬ÆÀ¤é¤ì¤Ê¤¤¾ì¹ç¤Ï¡¢¥Æ¡¼¥Ö¥ë¤Î½¤Éü¤òÄ̾ïÄ̤ê¼Â¹Ô¤¹¤Ù¤­¤Ç
-¤¹¡£@xref{Table maintenance}¡£
-
-@code{TYPE=QUICK} ¤¬Í¿¤¨¤é¤ì¤¿¾ì¹ç¤Ï¡¢@strong{MySQL} ¤Ï¸ÇÄêĹ¥ì¥³¡¼¥É¥Æ¡¼
-¥Ö¥ë¤Î¥ì¥³¡¼¥É¤òÁöºº¤·¤Þ¤»¤ó¡£
-
-@code{CHECK TABLE} ¤Ï @code{MyISAM} ¥Æ¡¼¥Ö¥ë¤À¤±¤ÇÆ°ºî¤·¡¢¥Æ¡¼¥Ö¥ë¤ËÂФ¹¤ë
-@code{myisamchk -m table_name} ¤Î¼Â¹Ô¤ÈƱ¤¸¤³¤È¤Ç¤¹¡£
-
-@findex REPAIR TABLE
-@node REPAIR TABLE, DELETE, CHECK TABLE, Reference
-@section @code{REPAIR TABLE} ¹½Ê¸
-
-@example
-REPAIR TABLE tbl_name[,tbl_name...] [TYPE = QUICK]
-@end example
-
-@code{REPAIR TABLE} ¤Ï @code{MyISAM} ¥Æ¡¼¥Ö¥ë¤À¤±¤ÇÆ°ºî¤·¤Þ¤¹¡£¥Æ¡¼¥Ö¥ë¤Ë
-@code{myisamchk -r table_name} ¤ò¼Â¹Ô¤¹¤ë¤³¤È¤ÈƱ¤¸¤Ç¤¹¡£
-
-²õ¤ì¤¿¥Æ¡¼¥Ö¥ë¤ò½¤Éü¤·¤Þ¤¹¡£¥³¥Þ¥ó¥É¤Ï¼¡¤Î¥Õ¥£¡¼¥ë¥É¤ò´Þ¤à¥Æ¡¼¥Ö¥ë¤òÊÖ¤·¤Þ
-¤¹:
-
-@multitable @columnfractions .35 .65
-@item Table @tab ¥Æ¡¼¥Ö¥ë̾
-@item Op @tab ¾ï¤Ë 'repair'
-@item Msg_type @tab @code{status}, @code{error}, @code{info}, @code{warning} ¤Î¤É¤ì¤«
-@item Msg_text @tab ¥á¥Ã¥»¡¼¥¸
-@end multitable
-
-Ãí°Õ: ½¤Éü¤µ¤ì¤¿³Æ¥Æ¡¼¥Ö¥ë¤Î¾ðÊó¤Î¿¤¯¤Î¥ì¥³¡¼¥É¤òÆÀ¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£ºÇ¸å
-¤Î£±¥ì¥³¡¼¥É¤Ï @code{Msg_type status} ¤Ë¤Ê¤ê¡¢Ä̾ï¤Ï @code{OK} ¤Ç¤¢¤ë¤Ù¤­
-¤Ç¤¹¡£@code{OK} ¤¬ÆÀ¤é¤ì¤Ê¤±¤ì¤Ð¡¢@code{myisamchk -o} ¤Ç¥Æ¡¼¥Ö¥ë¤Î½¤Éü¤ò»î
-¤ß¤ë¤Ù¤­¤Ç¤¹¡£@code{REPAIR TABLE} ¤Ï¤Þ¤À @code{myisamchk} ¤Î¤¹¤Ù¤Æ¤Î¥ª¥×¥·¥ç
-¥ó¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¤¿¤á¤Ç¤¹¡£¶á¤¤¾­Íè¡¢²æ¡¹¤Ï¤³¤ì¤ò¤è¤ê½ÀÆð¤Ë¤¹¤ëͽÄê¤Ç¤¹¡£
-
-If @code{TYPE=QUICK} is given then @strong{MySQL} will try to do a
-@code{REPAIR} of only the index tree.
-
-@findex DELETE
-@node DELETE, SELECT, REPAIR TABLE, Reference
-@section @code{DELETE}¹½Ê¸
-
-@example
-DELETE [LOW_PRIORITY] FROM tbl_name
- [WHERE where_definition] [LIMIT rows]
-@end example
-
-@code{DELETE}¤Ï¡¢@code{tbl_name}¤è¤ê¡¢@code{where_definition}¤Ë¤ÆÍ¿¤¨¤é¤ì¤¿¾ò·ï¤òËþ¤¿¤¹¥ì¥³¡¼¥É¤òºï½ü¤·¡¢ºï½ü¤µ¤ì¤¿¥ì¥³¡¼¥É¿ô¤òÊÖ¤·¤Þ¤¹¡£
-
-@code{WHERE}Àá¤ò»ØÄꤹ¤ë¤³¤È¤Ê¤·¤Ë@code{DELETE}¤òȯ¹Ô¤·¤¿¾ì¹ç¡¢Á´¤Æ¤Î¥ì¥³¡¼¥É¤¬ºï½ü¤µ¤ì¤Þ¤¹¡£
-@strong{MySQL}¤Ï¡¢¤³¤ì¤ò¶õ¥Æ¡¼¥Ö¥ë¤òºÆºîÀ®¤¹¤ë¤³¤È¤Ç¼Â¸½¤·¤Æ¤ª¤ê¡¢¤³¤ì¤Ï¡¢Á´¤Æ¤Î¥ì¥³¡¼¥É¤ò¼ÂºÝ¤Ëºï½ü¤¹¤ë¤è¤ê¤â¤«¤Ê¤êÁ᤯ưºî¤·¤Þ¤¹¡£
-¤³¤Î¾ì¹ç@code{DELETE}¤Ï¡¢±Æ¶Á¤Î¤¢¤Ã¤¿¥ì¥³¡¼¥É¿ô¤È¤·¤Æ0¤òÊÖ¤·¤Þ¤¹¡£
-(ºÆºîÀ®¤Ï¡¢¸µ¤Î¥Ç¡¼¥¿¤¬³ÊǼ¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë¤³¤È¤Ê¤¯¼Â»Ü¤µ¤ì¤Þ¤¹¤«¤é¡¢@strong{MySQL}¤Ï¼ÂºÝ¤Ëºï½ü¤µ¤ì¤¿¥ì¥³¡¼¥É¿ô¤òÊÖ¤¹¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£
-¤¿¤È¤¨¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤ä¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¤¬Í𤵤줿¤È¤·¤Æ¤â¡¢¥Æ¡¼¥Ö¥ëÄêµÁ¥Õ¥¡¥¤¥ë@file{tbl_name.frm}¤¬Í­¸ú¤Ç¤¢¤ë¸Â¤ê¡¢¤³¤Î¤è¤¦¤ÊÊýË¡¤Ç¥Æ¡¼¥Ö¥ë¤ÎºÆºîÀ®¤¬²Äǽ¤È¤Ê¤ê¤Þ¤¹¡£)
-
-¤â¤·Á´¤Æ¤Î¥ì¥³¡¼¥É¤òºï½ü¤·¤Æ¤¤¤ë»þ¤Ë¡¢¤¤¤¯¤Ä¤Î¥ì¥³¡¼¥É¤¬¾Ã¤µ¤ì¡¢¤¤¤¯¤Ä¤Î¥ì¥³¡¼¥É¤¬
-¥¹¥Ô¡¼¥É¤òµ¾À·¤Ë¤·¤Æ¤¤¤ë¤Î¤«¡¢ËÜÅö¤ËÃΤꤿ¤¤¤Ê¤é¤Ð¡¢
-@code{DELETE} ¹½Ê¸¤ò°Ê²¼¤Î¤è¤¦¤Ë»ÈÍѤ·¤Þ¤¹¡§
-
-@example
-mysql> DELETE FROM tbl_name WHERE 1>0;
-@end example
-
-¤³¤ì¤Ï @code{DELETE FROM tbl_name} ¤ò @code{WHERE} Àá¤Ê¤·¤Ç¹Ô¤¦¤è¤ê¤â¡¢
-¤È¤Æ¤âÃÙ¤¤¤Ç¤¹¡£¤Ê¤¼¤Ê¤é°ìÅ٤Ǿ佤¦¤È¤¹¤ë¤«¤é¤Ç¤¹¡£
-
-¥­¡¼¥ï¡¼¥É@code{LOW_PRIORITY}¤ò»ØÄꤷ¤¿¾ì¹ç¡¢¤½¤Î¥Æ¡¼¥Ö¥ë¤òÆɤó¤Ç¤¤¤ë¥¯¥é¥¤¥¢¥ó¥È¤¬¤¤¤Ê¤¯¤Ê¤ë¤Þ¤Ç@code{DELETE}¤Î¼Â¹Ô¤ÏÃ٤餻¤é¤ì¤Þ¤¹¡£
-
-ºï½ü¤µ¤ì¤¿¥ì¥³¡¼¥É¤Ï¥ê¥ó¥¯¥ê¥¹¥È¤Ç°Ý»ý¤µ¤ì¡¢¼¡¤Î@code{INSERT}Áàºî¤Ï¡¢¸Å¤¤¥ì¥³¡¼¥É°ÌÃÖ¤òºÆÍøÍѤ·¤Þ¤¹¡£
-¥Õ¥¡¥¤¥ë¤ò¤è¤ê¾®¤µ¤¯¤·¤¿¤¤¾ì¹ç¤Ï¡¢@code{OPTIMIZE TABLE}¥¹¥Æ¡¼¥È¥á¥ó¥È¤«¥Æ¡¼¥Ö¥ë¤ÎºÆÊÔÀ®¤Î¤¿¤á¤Ë@code{myisamchk}¥æ¥Æ¥£¥ê¥Æ¥£¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
-@code{OPTIMIZE TABLE}¤ÎÊý¤¬´Êñ¤Ç¤¹¤¬¡¢@code{myisamchk}¤ÎÊý¤¬Á᤯ưºî¤·¤Þ¤¹¡£
-@xref{OPTIMIZE TABLE, , @code{OPTIMIZE TABLE}}, ¤È
-@ref{Optimization}.
-
-@strong{MySQL}-Æò½ @code{DELETE} ¤Î @code{LIMIT rows} ¥ª¥×¥·¥ç¥ó¤Ï
-¥µ¡¼¥Ð¡¼¤Ë¾Ã¤¹ºÇÂç¤Î¥ì¥³¡¼¥É¿ô¤ò¤Ä¤²¤Þ¤¹¡£¤³¤ì¤Ï @code{DELETE} ¥³¥Þ¥ó¥É¤¬
-¤¢¤Þ¤ê¤Ë¿¤¯¤Î»þ´Ö¤ò¼è¤é¤Ê¤¤¤¿¤á¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£
-@code{LIMIT} Ãͤè¤ê¤â affected row ¤Î¿ô¤¬¾¯¤Ê¤¯¤Ê¤ë¤Þ¤Ç¡¢
-ñ½ã¤Ë @code{DELETE} ¥³¥Þ¥ó¥É¤ò·«¤êÊÖ¤¹¤À¤±¤Ç¤¹¡£
-
-@findex SELECT
-@node SELECT, JOIN, DELETE, Reference
-@section @code{SELECT}¹½Ê¸
-
-@example
-SELECT [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]
- [HIGH_PRIORITY]
- [DISTINCT | DISTINCTROW | ALL]
- select_expression,...
- [INTO @{OUTFILE | DUMPFILE@} 'file_name' export_options]
- [FROM table_references
- [WHERE where_definition]
- [GROUP BY @{unsigned_integer | col_name | formula@}]
- [HAVING where_definition]
- [ORDER BY @{unsigned_integer | col_name | formula@} [ASC | DESC] ,...]
- [LIMIT [offset,] rows]
- [PROCEDURE procedure_name] ]
-@end example
-
-@code{SELECT}¤ÏÄ̾1¤Ä¤Þ¤¿¤Ï1¤Ä°Ê¾å¤Î¥Æ¡¼¥Ö¥ë¤«¤é¥ì¥³¡¼¥É¤ò¸¡º÷¤·¤ÆÃê½Ð¤¹¤ë¤Î¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£
-@code{select_expression} ¤Ï¼è¤ê½Ð¤·¤¿¤¤¥Õ¥£¡¼¥ë¥É¤ò¼¨¤·¤Þ¤¹¡£
-@code{SELECT}¤Ï¤Þ¤¿¡¢¥Æ¡¼¥Ö¥ë¤Î»²¾È¤Ê¤·¤Ë·×»»¤Ë¤è¤Ã¤Æµá¤á¤é¤ì¤¿¥ì¥³¡¼¥É¤ò¼è¤ê½Ð¤¹¤¿¤á¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£Îã:
-
-@example
-mysql> SELECT 1 + 1;
- -> 2
-@end example
-
-Á´¤Æ¤Î¥­¡¼¥ï¡¼¥É¤Î»ÈÍѤϡ¢¾åµ­¤Ë¼¨¤¹¤è¤¦¤Ê½ç½ø¤ÇÀµ³Î¤ËÍ¿¤¨¤é¤ì¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£Î㤨¤Ð¡¢@code{HAVING}Àá¤Ïɬ¤º@code{GROUP BY}Àá¤Î¸å¡¢@code{ORDER BY}Àá¤ÎÁ°¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-
-@itemize @bullet
-
-@item
-@cindex Aliases, on expressions
-@cindex Expression aliases
-@code{SELECT}¤Îɽ¸½¤Ç¤Ï¡¢@code{AS}¤Ë¤è¤ëÊÌ̾¤Î»ØÄ꤬²Äǽ¤Ç¤¹¡£ÊÌ̾¤Ï¡¢¥Õ¥£¡¼¥ë¥É̾¤Îɽ¸½¤È¤·¤Æ»È¤ï¤ì¡¢@code{ORDER BY}µÚ¤Ó@code{HAVING}Àá¤È¤È¤â¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-Îã:
-
-@example
-mysql> select concat(last_name,', ',first_name) AS full_name
- from mytable ORDER BY full_name;
-@end example
-
-@item
-@code{FROM table_references}Àá¤Ï¡¢(Î㤨¤Ð¡¢ÁªÂò¤¹¤ë¥ì¥³¡¼¥É¤Ë¤è¤ê¡¢1¤ÄËô¤Ï¤½¤ì°Ê¾å¤Î)·ë¹ç¤¹¤ë¥Æ¡¼¥Ö¥ë¤Î¥ê¥¹¥È¤ò¼¨¤·¤Þ¤¹¡£
-¤³¤Î¥ê¥¹¥È¤Ï¤Þ¤¿¡¢@code{LEFT OUTER JOIN}»²¾È¤ò´Þ¤à¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£
-@xref{JOIN, , @code{JOIN}}.
-
-@item
-@code{col_name}¡¢@code{tbl_name.col_name}¡¢@code{db_name.tbl_name.col_name}¤Î¤è¤¦¤Ë¤·¤Æ¥Õ¥£¡¼¥ë¥É¤òɽ¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@code{SELECT}¥¹¥Æ¡¼¥È¥á¥ó¥ÈÆâ¤Ç¤ÎÎó¤Î»²¾È¤¬Û£Ëæ¤Ç¤Ê¤±¤ì¤Ð¡¢@code{tbl_name}¤ä@code{db_name.tbl_name}¤Î¤è¤¦¤Ê¥×¥ê¥Õ¥£¥Ã¥¯¥¹¤ò¾ÜºÙ¤Ëµ­½Ò¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£
-¤è¤êÌÀ¼¨Åª¤Ê¥Õ¥£¡¼¥ë¥É¤Î»ØÄê·Á¼°¤ò¤òɬÍפȤ¹¤ëÛ£Ëæ¤Ê»²¾È¤ÎÎã¤Ï¡¢@ref{Legal names}¤ò»²¾È¤Î¤³¤È¡£
-
-@item
-@cindex Aliases, for tables
-@cindex Table aliases
-¥Æ¡¼¥Ö¥ë»²¾È¤Ï¡¢@code{tbl_name AS alias_name}Ëô¤Ï@code{tbl_name alias_name}¤ò»È¤Ã¤ÆÊÌ̾¤ò»ÈÍѤ¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£
-
-@example
-mysql> select t1.name, t2.salary from employee AS t1, info AS t2
- where t1.name = t2.name;
-mysql> select t1.name, t2.salary from employee t1, info t2
- where t1.name = t2.name;
-@end example
-
-@item
-@code{LIKE}¤Îɽ¸½¤Ë¤ª¤¤¤Æ¡¢¥ï¥¤¥ë¥É¥«¡¼¥É¡¦¥­¥ã¥é¥¯¥¿¤Ç¤¢¤ë@samp{%}¤ä@samp{_}
-¤Ï¡¢¤³¤ì¤é¤ÎÄ̾ï¤Î¥ï¥¤¥ë¥É¥«¡¼¥É¤È¤·¤Æ¤Î°ÕÌ£¤òÍÞÀ©¤¹¤ë¤¿¤á¤Ë@samp{\}¤Î¸å¤ËÃÖ¤«¤ì¤ë¤³¤È¤Ë¤è¤ê¡¢Äê¿ô@samp{%}¤ä@samp{_}¤Î¸¡º÷¤Ë»È¤ï¤ì¤Þ¤¹¡£
-
-@item
-½ÐÎÏÍѤËÁªÂò¤µ¤ì¤¿¥Õ¥£¡¼¥ë¥É¤Ï¡¢@code{ORDER BY}Àá¤ä@code{GROUP BY}Àá¤Ë¤ª¤¤¤Æ¡¢¥Õ¥£¡¼¥ë¥É̾¡¢¥Õ¥£¡¼¥ë¥É¤Î¥¨¥¤¥ê¥¢¥¹Ì¾¡¢Ëô¤Ï¥Õ¥£¡¼¥ë¥ÉÈÖ¹æ¤Ë¤Æ»Ø¤·¼¨¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¥Õ¥£¡¼¥ë¥ÉÈÖ¹æ¤Ï1¤«¤é»Ï¤Þ¤ê¤Þ¤¹¡£
-
-@example
-mysql> select college, region, seed from tournament
- ORDER BY region, seed;
-mysql> select college, region AS r, seed AS s from tournament
- ORDER BY r, s;
-mysql> select college, region, seed from tournament
- ORDER BY 2, 3;
-@end example
-
-µÕ½ç¤Çʤ٤¿¤¤¾ì¹ç¤Ë¤Ï¡¢ @code{ORDER BY} Àá¤ÎÃæ¤Ç¡¢¤¢¤Ê¤¿¤¬Ê¤٤¿¤¤¤È»×¤Ã¤Æ¤¤¤ë
-¥Õ¥£¡¼¥ë¥É¤Î̾Á°¤Î¸å¤í¤Ë¡¢ @code{DESC} (descending) ¥­¡¼¥ï¡¼¥É¤ò
-Äɲä·¤Þ¤¹¡£
-¥Ç¥Õ¥©¥ë¥È¤Ï¾º½ç¤Ç¤¹¡¨ ¤³¤ì¤Ï @code{ASC} ¥­¡¼¥ï¡¼¥É¤ò»ØÄꤷ¤¿¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-@item
-@code{HAVING}Àá¤Ï¡¢@code{select_expression}¤Ë¤ª¤¤¤Æ¤É¤Î¥Õ¥£¡¼¥ë¥É¤Î̾Á°¤ä¥¨¥¤¥ê¥¢¥¹Ì¾¤Ç¤â»Ø¤·¼¨¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¤³¤ì¤ÏºÇ¸å¤ËŬÍѤµ¤ì¡¢¥¯¥é¥¤¥¢¥ó¥È¤Ë¥¢¥¤¥Æ¥à¤¬Á÷¤é¤ì¤ëľÁ°¤Ë¼Â¹Ô¤µ¤ì¤ë¤Î¤Ç¡¢ºÇŬ²½¤µ¤ì¤Þ¤»¤ó¡£
-@code{WHERE}Àá¤Ç½ñ¤¯¤Ù¤­¤â¤Î¤Ë@code{HAVING}¤òÍѤ¤¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£
-Î㤨¤Ð¡¢¼¡¤Î¤è¤¦¤Ë½ñ¤¤¤Æ¤Ï¤¤¤±¤Þ¤»¤ó:
-
-@example
-mysql> select col_name from tbl_name HAVING col_name > 0;
-@end example
-
-¤½¤ÎÂå¤ï¤ê¤Ë¡¢¼¡¤Î¤è¤¦¤Ë½ñ¤¤¤Æ¤¯¤À¤µ¤¤:
-
-@example
-mysql> select col_name from tbl_name WHERE col_name > 0;
-@end example
-
-@strong{MySQL} 3.22.5°Ê¹ß¤Ç¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¥¯¥¨¥ê¤òµ­½Ò¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹:
-
-@example
-mysql> select user,max(salary) from users
- group by user HAVING max(salary)>10;
-@end example
-
-@strong{MySQL}¤Î¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢¤³¤ÎÂå¤ï¤ê¤Ë¼¡¤Î¤è¤¦¤Ëµ­½Ò¤Ç¤­¤Þ¤¹:
-
-@example
-mysql> select user,max(salary) AS sum from users
- group by user HAVING sum>10;
-@end example
-
-@item
-@code{SQL_SMALL_RESULT}, @code{SQL_BIG_RESULT}, @code{SQL_BUFFER_RESULT},
-@code{STRAIGHT_JOIN}, @code{HIGH_PRIORITY} ¤Ï ANSI SQL92 ¤ËÂФ¹¤ë @strong{MySQL} ³ÈÄ¥¤Ç¤¹¡£
-
-@item
-@code{HIGH_PRIORITY} ¤Ï¡¢¥Æ¡¼¥Ö¥ë¤Î¹¹¿·¤è¤ê¤â @code{SELECT} ¤òÍ¥À褵¤»¤Þ¤¹¡£
-¤³¤ì¤Ï°ìÅ٤Ǵ°Î»¤¹¤ë¡¢¤È¤Æ¤â®¤¤¥¯¥¨¥ê¤Ë¤Î¤ßŬÍѤ¹¤Ù¤­¤Ç¤¹¡£
-¤â¤·¥ê¡¼¥É¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¥Æ¡¼¥Ö¥ë¤¬¤¢¤Ã¤¿¤È¤·¡¢
-¤¿¤È¤¨ update ʸ¤¬¤³¤Î¥Æ¡¼¥Ö¥ë¤Î²ò½ü¤òÂԤäƤ¤¤¿¤È¤·¤Æ¤â¡¢
-@code{SELECT HIGH_PRIORITY} ¥¯¥¨¥ê¤Ï¼Â¹Ô¤µ¤ì¤Þ¤¹¡£
-
-@item
-@code{SQL_BIG_RESULT} ¤Ï @code{GROUP BY} ¤ä @code{DISTINCT} ¤È¶¦¤Ë»ÈÍѤ¹¤ë
-»ö¤¬¤Ç¤­¡¢·ë²Ì¥»¥Ã¥È¤¬Â¿¤¯¤Î¥ì¥³¡¼¥É¤ò»ý¤Ä¤³¤È¤ò¥ª¥×¥Æ¥£¥Þ¥¤¥¶¤ËÃΤ餻¤Þ¤¹¡£
-¤³¤Î¾ì¹ç¡¢É¬Íפʤé @strong{MySQL} ¤Ï¥Ç¥£¥¹¥¯¥Ù¡¼¥¹¤Î°ì»þ¥Æ¡¼¥Ö¥ë¤òľÀÜ»ÈÍÑ
-¤·¤Þ¤¹¡£@code{MySQL} ¤Ï¤³¤Î¾ì¹ç¡¢@code{GROUP BY} Í×ÁǾå¤Î¥­¡¼¤Ç°ì»þ¥Æ¡¼¥Ö
-¥ë¤ò¹Ô¤Ê¤¦Âå¤ï¤ê¤Ë¥½¡¼¥È¤ò¹Ô¤Ê¤¦¤³¤È¤òÁªÂò¤·¤Þ¤¹¡£
-
-@item
-@code{SQL_SMALL_RESULT} (@strong{MySQL} ¸ÇÍ­¤Î¥ª¥×¥·¥ç¥ó) ¤Ï @code{GROUP BY}
-¤« @code{DISTINCT} ¤È¶¦¤Ë»ÈÍѤ¹¤ë»ö¤¬¤Ç¤­¡¢
-·ë²Ì¥»¥Ã¥È¤¬¾®¤µ¤¯¤Ê¤ë¤³¤È¤ò¥ª¥×¥Æ¥£¥Þ¥¤¥¶¤ËÃΤ餻¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢
-@strong{MySQL} ¤Ï¥½¡¼¥È¤¹¤ëÂå¤ï¤ê¤Ë¡¢Â®¤¤°ì»þ¥Æ¡¼¥Ö¥ë¤ò·ë²Ì¤ÎÊݸ¤Î¤¿
-¤á¤Ë»ÈÍѤ·¤Þ¤¹¡£ @strong{MySQL} 3.23 ¤Ç¤Ï¡¢¤³¤ì¤ÏÄ̾ïɬÍפǤϤ¢¤ê¤Þ¤»¤ó¡£
-
-@item
-@code{STRAIGHT_JOIN}¤Ï¡¢@code{FROM}Àá¤Ë¤Æµ­½Ò¤µ¤ì¤¿¥Æ¡¼¥Ö¥ë¤Î½ç½ø¤Ë½¾¤Ã¤Æ·ë¹ç¤¹¤ë¤è¤¦¡¢¥ª¥×¥Æ¥£¥Þ¥¤¥¶¤Ë¶¯À©¤·¤Þ¤¹¡£¥ª¥×¥Æ¥£¥Þ¥¤¥¶¤¬¡¢¥Æ¡¼¥Ö¥ë¤òºÇŬ¤Ê½ç½ø¤Ç·ë¹ç¤·¤Ê¤¤¾ì¹ç¤Ë¡¢¥¯¥¨¥ê¤Î¥¹¥Ô¡¼¥É¥¢¥Ã¥×¤Î¤¿¤á¤Ë¤³¤ì¤ò»ÈÍѤ¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£
-@xref{EXPLAIN, , @code{EXPLAIN}}.
-
-@item
-@code{LIMIT} Àá¤Ï¡¢ @code{SELECT} ¹½Ê¸¤ÇÊÖ¤µ¤ì¤ë¥ì¥³¡¼¥É¿ô¤ò»ØÄꤹ¤ë¤Î¤Ë
-»ÈÍѤµ¤ì¤Þ¤¹¡£ @code{LIMIT} ¤Ï°ì¤Ä¤«Æó¤Ä¤Î¿ô»ú¤Î°ú¿ô¤ò¼è¤ê¤Þ¤¹¡£
-
-°ú¿ô¤¬2¤ÄÍ¿¤¨¤é¤ì¤¿¤Ê¤é¤Ð¡¢ºÇ½é¤Î°ú¿ô¤ÏºÇ½é¤Î¥ì¥³¡¼¥É¤«¤é¤Î¥ª¥Õ¥»¥Ã¥È¤ò¼¨¤·¡¢2¤Ä¤á¤Î°ú¿ô¤ÏÊÖ¤¹¥ì¥³¡¼¥É¤ÎºÇÂç¿ô¤ò¼¨¤·¤Þ¤¹¡£
-½é¤á¤Î¥ì¥³¡¼¥É¤Î¥ª¥Õ¥»¥Ã¥È¤Ï0¤Ç¤¹(1¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó)¡£
-
-@example
-mysql> select * from table LIMIT 5,10; # 6¡Á15¹ÔÌܤòÊÖ¤¹
-@end example
-
-¤â¤·°ú¿ô¤¬°ì¤Ä¤Ê¤é¡¢ÊÖ¤¹¤Ù¤­¥ì¥³¡¼¥É¤ÎºÇÂç¹Ô¿ô¤ò»ØÄꤷ¤¿¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-@example
-mysql> select * from table LIMIT 5; # ºÇ½é¤Î5¹Ô¤ò¼è¤ê½Ð¤¹
-@end example
-
-¤¤¤¤¤«¤¨¤ì¤Ð¡¢@code{LIMIT n} ¤Ï @code{LIMIT 0,n} ¤ÈƱ¤¸¤Ç¤¹¡£
-
-@item
-@tindex /etc/passwd
-@code{SELECT}¤Î½ñ¼°¡¢@code{SELECT ... INTO OUTFILE 'file_name'}¤Ï¡¢ÁªÂò¤µ¤ì¤¿¥ì¥³¡¼¥É¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤ß¤Þ¤¹¡£
-¥Õ¥¡¥¤¥ë¤Ï¥µ¡¼¥Ðµ¡¤ËºîÀ®¤µ¤ì¡¢´û¤Ë¸ºß¤¹¤ë¥Õ¥¡¥¤¥ë¤Ç¤¢¤Ã¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó(@file{/etc/passwd}¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¤ÎÇ˲õ¤òËɻߤ·¤Þ¤¹)¡£
-@code{SELECT ... INTO OUTFILE}¤Ï¡¢@code{LOAD DATA INFILE}¤ÎµÕ¤Ç¤¹¡£@code{export_options}¤Î¹½Ê¸¤Ï¡¢@code{LOAD DATA INFILE}¥¹¥Æ¡¼¥È¥á¥ó¥È¤Î°ìÉô¤Ç»È¤ï¤ì¤ë@code{FIELDS}Àá¤ä@code{LINES}Àá¤ÈƱ¤¸¤è¤¦¤Ê¹½À®¤Ç¤¹¡£
-@xref{LOAD DATA, , @code{LOAD DATA}}.
-
-@code{INTO OUTFILE}¤ò»È¤¦¤È¤­¡¢¥¨¥¹¥±¡¼¥×¡¦¥­¥ã¥é¥¯¥¿¡¢@code{ASCII 0} (nul)¡¢¤½¤·¤ÆÁ´¤Æ¤Î¥¿¡¼¥ß¥Í¡¼¥¿¡¦¥­¥ã¥é¥¯¥¿¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¥¨¥¹¥±¡¼¥×¤µ¤ì¤ë¤³¤È¤Ëµ¤¤ò¤Ä¤±¤Æ¤¯¤À¤µ¤¤¡£
-@xref{LOAD DATA, , @code{LOAD DATA}}.
-
-·ë²Ì¤È¤·¤Æ¼è¤ê½Ð¤µ¤ì¤ë¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Ç¤Ï¡¢
-°Ê²¼¤Ë¼¨¤¹Ê¸»ú¤¬ @code{ESCAPED BY} »ØÄê¤Îʸ»ú¤Ë¤è¤Ã¤Æ¥¨¥¹¥±¡¼¥×¤µ¤ì¤Þ¤¹¡§
-
-@itemize @bullet
-@item @code{ESCAPED BY} ʸ»ú¼«¿È
-@item @code{FIELDS TERMINATED BY} ¤ÎºÇ½é¤Îʸ»ú
-@item @code{LINES TERMINATED BY} ¤ÎºÇ½é¤Îʸ»ú
-@end itemize
-
-¤µ¤é¤Ë¡¢ @code{ASCII 0} ¤Ï¡¢@code{ESCAPED BY} 0 (@code{ASCII 48}) ¤Ë¥³¥ó¥Ð¡¼¥È¤µ¤ì¤Þ¤¹¡£
-
-¤¤¤«¤Ê¤ë @code{FIELDS TERMINATED BY}, @code{ESCAPED BY}, @code{LINES TERMINATED BY}
-»ØÄꤵ¤ì¤Æ¤¤¤ëʸ»ú¤â¡¢¥¨¥¹¥±¡¼¥×¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤Íýͳ¤Ï¡¢
-¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤òÆɤßÊÖ¤»¤ì¤ë¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ê¤Î¤Ç¤¹¡£
-@code{ASCII 0} ¤Ï¤¤¤¯¤Ä¤«¤Î¥Ú¡¼¥¸¥ã¡¼¤Ç¤â¸«¤ì¤ë¤è¤¦¤Ë¤¹¤ë¤¿¤á¤Ë
-¥¨¥¹¥±¡¼¥×¤µ¤ì¤ë¤Î¤Ç¤¹¡£
-
-·ë²Ì¤Î¥Õ¥¡¥¤¥ë¤Ï SQL ¤Îʸ¤ò´Þ¤ó¤Ç¤¤¤Ê¤¤¤Î¤Ç¡¢²¿¤â¥¨¥¹¥±¡¼¥×¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£
-@end itemize
-
-@findex DUMPFILE
-@code{INTO OUTFILE} ¤ÎÂå¤ï¤ê¤Ë @code{INTO DUMPFILE} ¤ò»ÈÍѤ¹¤ë¤È¡¢
-@strong{MySQL} ¤Ï¥Õ¥¡¥¤¥ë¤Ë£±¥ì¥³¡¼¥É¤À¤±¤ò½ñ¤­¤Þ¤¹¡£¥Õ¥£¡¼¥ë¥É¤ä¹Ô¤Î½ªÃ¼
-¤È¤¹¤Ù¤Æ¤Î¥¨¥¹¥±¡¼¥×¤ò´Þ¤ß¤Þ¤»¤ó¡£¤³¤ì¤Ï¥Õ¥¡¥¤¥ëÆâ¤Ë BLOB ¤ò³ÊǼ¤·¤¿¤¤¾ì¹ç
-¤ËÊØÍø¤Ç¤¹¡£
-
-@findex JOIN
-@findex INNER JOIN
-@findex CROSS JOIN
-@findex LEFT JOIN
-@findex LEFT OUTER JOIN
-@findex NATURAL LEFT JOIN
-@findex NATURAL LEFT OUTER JOIN
-@findex STRAIGHT_JOIN
-@node JOIN, INSERT, SELECT, Reference
-@section @code{JOIN} ¹½Ê¸
-
-@strong{MySQL}¤Ï¡¢°Ê²¼¤Ë¼¨¤¹@code{SELECT}¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ë¤ª¤±¤ë@code{JOIN}¹½Ê¸¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹:
-
-@example
-table_reference, table_reference
-table_reference [CROSS] JOIN table_reference
-table_reference INNER JOIN table_reference join_condition
-table_reference STRAIGHT_JOIN table_reference
-table_reference LEFT [OUTER] JOIN table_reference join_condition
-table_reference LEFT [OUTER] JOIN table_reference
-table_reference NATURAL [LEFT [OUTER]] JOIN table_reference
-@{ oj table_reference LEFT OUTER JOIN table_reference ON conditional_expr @}
-@end example
-
-Where @code{table_reference} is defined as
-@example
-table_name [[AS] alias] [USE INDEX (key_list)] [IGNORE INDEX (key_list)]
-@end example
-
-and @code{join_condition} is defined as
-
-@example
-ON conditional_expr |
-USING (column_list)
-@end example
-
-Note that in version before 3.23.16 the @code{INNER JOIN} didn't take
-a join condition!
-
-@cindex ODBC compatibility
-@cindex Compatibility, with ODBC
-¾å¤Ë¼¨¤¹ºÇ¸å¤Î@code{LEFT OUTER JOIN}¹½Ê¸¤Ï¡¢ODBC¤È¤Î¸ß´¹À­¤Î¤¿¤á¤À¤±¤Ë¸ºß¤·¤Þ¤¹¡£
-
-@itemize @bullet
-@item
-table reference¤Ï¡¢@code{tbl_name AS alias_name}¤ä@code{tblname alias_name}¤Ë¤è¤ëÊÌ̾¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@example
-mysql> select t1.name, t2.salary from employee AS t1, info AS t2
- where t1.name = t2.name;
-@end example
-
-@item
-@code{INNER JOIN}¤È@code{,} (¥³¥ó¥Þ)¤Ï¡¢Æ±µÁ¸ì¤Ç¤¹¡£¤É¤Á¤é¤â»ÈÍѤµ¤ì¤ë¥Æ¡¼¥Ö¥ë´Ö¤ÎľÀѤò¤È¤ê¤Þ¤¹¡£Ä̾ï¤Ï@code{WHERE}¾ò·ï¤Ë¤Æ¡¢¥Æ¡¼¥Ö¥ë¤¬¤É¤Î¤è¤¦¤Ë¥ê¥ó¥¯¤µ¤ì¤ë¤Ù¤­¤«¤òÄêµÁ¤·¤Þ¤¹¡£
-
-@item
-@code{ON}¾ò·ïÀá¤Ï¡¢@code{WHERE}Àá¤Ç»ÈÍѤµ¤ì¤ë¤è¤¦¤Ê¾ò·ïʸ¤Î½ñ¼°¤Ç¤¹¡£
-
-@item
-¤â¤·¡¢@code{LEFT JOIN} ¤Î @code{ON} ¤ä @code{USING} ¤Ë¤ª¤¤¤Æ
-±¦Â¦¤Î¥Æ¡¼¥Ö¥ë¤Ë¥Þ¥Ã¥Á¤¹¤ë¥ì¥³¡¼¥É¤¬Ìµ¤«¤Ã¤¿¾ì¹ç¡¢
-Á´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤¬@code{NULL}¤Ç¤¢¤ë1¤Ä¤Î¥ì¥³¡¼¥É¤¬¡¢±¦Â¦¤Î¥Æ¡¼¥Ö¥ë¤È¤·¤Æ»ÈÍѤµ¤ì¤Þ¤¹¡£
-¤³¤Î»ö¼Â¤Ï¡¢¤¢¤ë¥Æ¡¼¥Ö¥ë¤Ë¤Ä¤¤¤Æ¡¢Â¾¤Î¥Æ¡¼¥Ö¥ë¤ËÂбþ¤¹¤ë¥ì¥³¡¼¥É¤¬Â¸ºß¤·¤Ê¤¤¥ì¥³¡¼¥É¤òõ¤¹¤È¤¤¤¦¤³¤È¤ËÍøÍѤǤ­¤Þ¤¹:
-
-@example
-mysql> select table1.* from table1
- LEFT JOIN table2 ON table1.id=table2.id
- where table2.id is NULL;
-@end example
-
-¤³¤ÎÎã¤Ï¡¢@code{table1}¤ÎÆâ¡¢@code{id}¤ÎÃͤ¬@code{table2}¤Ë¸ºß¤·¤Ê¤¤Á´¤Æ¤Î¥ì¥³¡¼¥É¤ò¸¡º÷¤·¤Þ¤¹¡£(¨¤Á¡¢@code{table2}Æâ¤Î¥ì¥³¡¼¥É¤È°ìÃפ·¤Ê¤¤@code{table1}¤ÎÁ´¤Æ¤Î¥ì¥³¡¼¥É¡£)
-¤â¤Á¤í¤ó¡¢¤³¤Î¾ì¹ç¤Î@code{table2.id}¤Ï¡¢@code{NOT NULL}¤ÈÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤È²¾Äꤷ¤Þ¤¹¡£
-
-@item
-@code{USING} @code{(column_list)}Àá¤Î¥Õ¥£¡¼¥ë¥É̾¥ê¥¹¥È¤Ï¡¢Î¾Êý¤Î¥Æ¡¼¥Ö¥ë¤Ë¸ºß¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£@code{USING}À᤬¼¡¤Î¤è¤¦¤Ë:
-
-@example
-A LEFT JOIN B USING (C1,C2,C3,...)
-@end example
-
-ÄêµÁ¤µ¤ì¤ë¤³¤È¤Ï¡¢@code{ON}¼°¤¬¤³¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤ë¤Î¤ÈƱµÁ¤Ç¤¹:
-
-@example
-A.C1=B.C1 AND A.C2=B.C2 AND A.C3=B.C3,...
-@end example
-
-@item
-Ʊ¤¸¥Õ¥£¡¼¥ë¥É̾¤ò»ý¤Ä2¤Ä¤Î¥Æ¡¼¥Ö¥ë¤Î @code{NATURAL [LEFT] JOIN} ¤Ï¡¢
-@code{USING} Àá¤òȼ¤Ã¤¿ @code{INNER JOIN} ¤ä @code{LEFT JOIN} ¤È
-Ʊ¤¸¤È¤·¤ÆÄêµÁ¤µ¤ì¤Þ¤¹¡£
-
-@item
-@code{STRAIGHT_JOIN}¤Ï¡¢±¦Â¦¤Î¥Æ¡¼¥Ö¥ë¤ÎÁ°¤Ë¡¢¾ï¤Ëº¸Â¦¤Î¥Æ¡¼¥Ö¥ë¤òÆɤळ¤È¤ò½ü¤±¤Ð¡¢@code{JOIN}¤ÈÁ´¤¯Æ±¤¸¤³¤È¤Ç¤¹¡£¤³¤ì¤Ï¡¢·ë¹ç¥ª¥×¥Æ¥£¥Þ¥¤¥¶¤¬¡¢ÉÔÅö¤Ê½ç½ø¤Ç¥Æ¡¼¥Ö¥ë¤ò½ÐÎϤ¹¤ë¤è¤¦¤Ê¤Þ¤ì¤Ê»öÂ֤˻ÈÍѤǤ­¤Þ¤¹¡£
-
-@item
-@strong{MySQL} 3.23.12 ¤«¤é¡¢¥Æ¡¼¥Ö¥ë¤«¤é¾ðÊó¤ò¼è¤ê½Ð¤¹»þ¤Ë¡¢
-@strong{MySQL} ¤¬¤É¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ¹¤Ù¤­¤«¤È¤¤¤¦¥Ò¥ó¥È¤òÍ¿¤¨¤ë¤³¤È¤¬
-¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£¤³¤ì¤Ï¡¢@strong{MySQL} ¤¬´Ö°ã¤Ã¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»È
-ÍѤ·¤Æ¤¤¤ë¤³¤È¤ò @code{EXPLAIN} ¤¬¼¨¤¹¾ì¹ç¤ËÍ­ÍѤǤ¹¡£@code{USE INDEX
-(key_list)} ¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢¥Æ¡¼¥Ö¥ë¤«¤é¥ì¥³¡¼¥É¤ò¸«¤Ä¤±¤ë¤¿¤á¤Ë¡¢
-»ØÄꤵ¤ì¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î°ì¤Ä¤À¤±¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë @strong{MySQL} ¤ËÅÁ¤¨¤ë¤³
-¤È¤¬¤Ç¤­¤Þ¤¹¡£Ê̤ι½Ê¸ @code{IGNORE INDEX (key_list)} ¤Ï¡¢@strong{MySQL}
-¤ËÆÃÄê¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ·¤Ê¤¤¤è¤¦¤ËÅÁ¤¨¤ë¤¿¤á¤Ë»ÈÍѤǤ­¤Þ¤¹¡£
-@end itemize
-
-Îã:
-
-@example
-mysql> select * from table1,table2 where table1.id=table2.id;
-mysql> select * from table1 LEFT JOIN table2 ON table1.id=table2.id;
-mysql> select * from table1 LEFT JOIN table2 USING (id);
-mysql> select * from table1 LEFT JOIN table2 ON table1.id=table2.id
- LEFT JOIN table3 ON table2.id=table3.id;
-mysql> select * from table1 USE INDEX (key1,key2) WHERE key1=1 and key2=2 AND
- key3=3;
-mysql> select * from table1 IGNORE INDEX (key3) WHERE key1=1 and key2=2 AND
- key3=3;
-@end example
-
-@xref{LEFT JOIN optimization, , @code{LEFT JOIN} optimization}.
-
-@findex INSERT
-@node INSERT, REPLACE, JOIN, Reference
-@section @code{INSERT}¹½Ê¸
-
-@example
- INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
- [INTO] tbl_name [(col_name,...)]
- VALUES (expression,...),(...),...
-or INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
- [INTO] tbl_name [(col_name,...)]
- SELECT ...
-or INSERT [LOW_PRIORITY | DELAYED] [IGNORE]
- [INTO] tbl_name
- SET col_name=expression, col_name=expression, ...
-@end example
-
-@code{INSERT}¤Ï¡¢´û¸¤Î¥Æ¡¼¥Ö¥ë¤Ë¿·¤·¤¤¥ì¥³¡¼¥É¤òÁÞÆþ¤·¤Þ¤¹¡£
-@code{INSERT ... VALUES}½ñ¼°¤Ï¡¢ÃͤÎÌÀ¼¨»ØÄê¤ò´ðËܤȤ·¤Æ¥ì¥³¡¼¥É¤òÁÞÆþ¤·¤Þ¤¹¡£
-@code{INSERT ... SELECT}½ñ¼°¤Ï¡¢Â¾¤Îɽ(Ê£¿ô²Ä)¤«¤éÃê½Ð¤·¤¿¥ì¥³¡¼¥É¤òÁÞÆþ¤·¤Þ¤¹¡£
-Ê£¿ô¤ÎÃͥꥹ¥È¤òÍѤ¤¤ë@code{INSERT ... VALUES}½ñ¼°¤Ï¡¢@strong{MySQL} 3.22.5°Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-@code{col_name=expression}¹½Ê¸¤Ï¡¢@strong{MySQL} 3.22.10°Ê¹ß¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-
-@code{tbl_name}¤Ï¡¢¥ì¥³¡¼¥É¤òÁÞÆþ¤¹¤ë¥Æ¡¼¥Ö¥ë¤Ç¤¹¡£¥Õ¥£¡¼¥ë¥É̾¥ê¥¹¥È¤Ï¡¢¸å³¤ÎÃÍÄêµÁ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Î¥Õ¥£¡¼¥ë¥É¤ò»Ø¤·¼¨¤·¤Þ¤¹¡£
-
-@itemize @bullet
-@item
-¤â¤·¤¤¤«¤Ê¤ë¥Õ¥£¡¼¥ë¥É¤â @code{INSERT ... VALUES} ¤ä @code{INSERT ... SELECT} ¤Ê¤É¤Ç
-ÌÀ¼¨¤·¤Ê¤±¤ì¤Ð¡¢Á´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤ÎÃͤ¬ @code{VALUES()} ¤ÎÃæ¤ËÍ¿¤¨¤é¤ì¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-¥Æ¡¼¥Ö¥ëÆâ¤Î¥Õ¥£¡¼¥ë¥É½ç¤¬ÉÔÌÀ¤Ê¾ì¹ç¡¢¤³¤ì¤òÄ´¤Ù¤ë¤¿¤á¤Ë@code{DESCRIBE tbl_name}¤ò»ÈÍѤ·¤Æ²¼¤µ¤¤¡£
-
-@item
-¥Æ¡¼¥Ö¥ëÆâ¤Î°ìÉô¤Î¥Õ¥£¡¼¥ë¥É¤·¤«»ØÄꤷ¤Ê¤¤¾ì¹ç¡¢»ØÄꤵ¤ì¤Ê¤«¤Ã¤¿¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¡¢¤½¤ì¤¾¤ì¤Î½é´üÃͤ¬»ØÄꤵ¤ì¤Þ¤¹¡£½é´üÃͤγäÅö¤Æ¤Ï¡¢@ref{CREATE TABLE, , @code{CREATE TABLE}}. ¤Ç½Ò¤Ù¤é¤ì¤Æ¤¤¤Þ¤¹¡£
-
-@item
-@code{NULL}¤ò@code{TIMESTAMP}¥Õ¥£¡¼¥ë¥É¤ËÁÞÆþ¤·¤¿¾ì¹ç¡¢¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¸½ºß»þ¹ï¤¬¥»¥Ã¥È¤µ¤ì¤Þ¤¹¡£Â¾¤ÎÃͤòÁÞÆþ¤·¤¿¾ì¹ç¡¢»ØÄꤵ¤ì¤¿Ãͤ¬Ã±½ã¤Ë¥»¥Ã¥È¤µ¤ì¤Þ¤¹¡£
-
-@item
-@code{expression}¤Ï¡¢Ãͥꥹ¥ÈÆâ¤ÇÀèƬ¤Ë¶á¤¤Êý¤Î¥Õ¥£¡¼¥ë¥É¤ò»²¾È¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-Î㤨¤Ð¡¢¼¡¤Î¤è¤¦¤Ëµ­½Ò¤Ç¤­¤Þ¤¹:
-
-@example
-mysql> INSERT INTO tbl_name (col1,col2) VALUES(15,col1*2);
-@end example
-
-¤·¤«¤·¡¢¼¡¤Î¤è¤¦¤Ë¤Ïµ­½Ò¤Ç¤­¤Þ¤»¤ó:
-
-@example
-mysql> INSERT INTO tbl_name (col1,col2) VALUES(col2*2,15);
-@end example
-
-@item
-¥­¡¼¥ï¡¼¥É@code{LOW_PRIORITY}¤ò»ØÄꤷ¤¿¾ì¹ç¡¢@code{INSERT}¤Î¼Â¹Ô¤Ï¤½¤Î¥Æ¡¼
-¥Ö¥ë¤«¤éÃͤòÆɤ߹þ¤à¥¯¥é¥¤¥¢¥ó¥È¤¬¤¤¤Ê¤¯¤Ê¤ë¤Þ¤ÇÃ٤餵¤ì¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢¥¯
-¥é¥¤¥¢¥ó¥È¤Ï insert ʸ¤¬´°Î»¤¹¤ë¤Þ¤ÇÂÔ¤¿¤µ¤ì¤Þ¤¹¡£¥Æ¡¼¥Ö¥ë¤¬ÉÑÈˤ˻ÈÍѤµ¤ì
-¤ë¾ì¹ç¡¢Ä¹¤¤»þ´Ö¤«¤«¤ê¤Þ¤¹¡£¤³¤ì¤Ï¥¯¥é¥¤¥¢¥ó¥È¤ò°ìÅ٤˷ѳ¤µ¤»¤ë
-@code{INSERT DELAYED} ¤ÈÂоÎŪ¤Ç¤¹¡£
-
-@item
-¤â¤· @code{IGNORE} ¥­¡¼¥ï¡¼¥É¤ò @code{INSERT} ¤Ë ÃͤȤȤâ¤Ë Í¿¤¨¤ë¤Ê¤é¡¢
-¥Æ¡¼¥Ö¥ëÆâ¤Î @code{PRIMARY} ¤ä @code{UNIQUE} ¥­¡¼¤Ë¤¹¤Ç¤Ë¸ºß¤¹¤ë½ÅÊ£¤·¤¿
-¤â¤Î¤Ï̵»ë¤µ¤ì¡¢ÁÞÆþ¤µ¤ì¤Þ¤»¤ó¡£
-¿½Å¹Ô¤ÎÃͤò´Þ¤à¥ì¥³¡¼¥É¤Î @code{INSERT} ¤Ë¥­¡¼¥ï¡¼¥É @code{IGNORE} ¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¡¢
-¥Æ¡¼¥Ö¥ë¤Î @code{PRIMARY} ¥­¡¼¤ä @code{UNIQUE} ¥­¡¼¤Ë½ÅÊ£¤¬µ¯¤³¤ëºÝ¤Ë¡¢
-ÁÞÆþ½èÍý¤¬°Û¾ï½ªÎ»¤·¤Þ¤¹¡£
-@code{IGNORE} ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢½ÅÊ£¤¹¤ë¥­¡¼Ãͤò»ý¤Ä¥ì¥³¡¼¥É¤ÏÁÞÆþ¤µ¤ì¤Þ¤»¤ó¡£
-C API ´Ø¿ô @code{mysql_info()} ¤Ë¤è¤ê¡¢¥Æ¡¼¥Ö¥ë¤Ë¤¤¤¯¤Ä¤Î¥ì¥³¡¼¥É¤¬ÁÞÆþ¤µ¤ì¤¿¤«
-¥Á¥§¥Ã¥¯¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@item
-@strong{MySQL}¤¬¡¢@code{DONT_USE_DEFAULT_FIELDS}¥ª¥×¥·¥ç¥ó¤Ë¤è¤êÀ©¸Â¤µ¤ì¤Æ¤¤¤¿¾ì¹ç¡¢@code{NULL}Ãͤòµö¤µ¤Ê¤¤Á´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤ËÌÀ¼¨Åª¤ËÃͤò¤·¤Ê¤¤¤È@code{INSERT}¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ï¡¢¥¨¥é¡¼¤òÀ¸À®¤·¤Þ¤¹¡£
-@xref{configure options, , @code{configure} options}.
-
-@item
-°Ê²¼¤Î¾ò·ï¤Ï¡¢@code{INSERT INTO ... SELECT}¥¹¥Æ¡¼¥È¥á¥ó¥È¤Î¤¿¤á¤ËÍÑ°Õ¤µ¤ì¤Æ¤¤¤Þ¤¹:
-
-@itemize @minus
-@item
-¥¯¥¨¥ê¡¼¤Ï¡¢@code{ORDER BY}Àá¤ò´Þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£
-
-@item
-@code{INSERT}¥¹¥Æ¡¼¥È¥á¥ó¥È¤Î¥¿¡¼¥²¥Ã¥È¤È¤Ê¤ë¥Æ¡¼¥Ö¥ë¤Ï¡¢¥¯¥¨¥ê¡¼Æâ@code{SELECT}Éô¤Î@code{FROM}Àá¤Ë»ØÄê¤Ç¤­¤Þ¤»¤ó¡£¤Ê¤¼¤Ê¤é¡¢ÁÞÆþÀè¤Î¥Æ¡¼¥Ö¥ë¤«¤é¤Î@code{SELECT}¤ÏANSI SQL¤Ç¶Ø¤¸¤é¤ì¤Æ¤¤¤ë¤«¤é¤Ç¤¹¡£(ÌäÂê¤Ï¡¢@code{SELECT}¤¬¼Â¹ÔÃæ¤ËÁÞÆþ¤·¤¿¥ì¥³¡¼¥É¤òÃê½Ð¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¢¤ë¤³¤È¤Ç¤¹¡£ÉûÌ䤤¹ç¤ï¤»Àá¤ò»ÈÍѤ¹¤ë¤È¤­¤Ë¡¢¤³¤Î¤è¤¦¤Ê¾õ¶·¤Çº®Í𤷤䤹¤¯¤Ê¤ê¤Þ¤¹¡ª)
-
-@item
-@code{AUTO_INCREMENT}¥Õ¥£¡¼¥ë¥É¤Ï¡¢Ä̾ïÄ̤êÆ°ºî¤·¤Þ¤¹¡£
-@end itemize
-@end itemize
-
-@findex mysql_info()
-¿½Å¤ÎÃͥꥹ¥È¤ò»ý¤Ä @code{INSERT ... SELECT ...} Ëô¤Ï @code{INSERT ... VALUES()} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢¥¯¥¨¥ê¡¼¤Ë´Ø¤¹¤ë¾ðÊó¤òÆÀ¤ë¤¿¤á¤Ë C API´Ø¿ô @code{mysql_info()} ¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¤½¤Î¾ðÊó¤Î½ñ¼°¤Ï°Ê²¼¤Ë¼¨¤¹Ê¸»úÎó¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹:
-
-@example
-Records: 100 Duplicates: 0 Warnings: 0
-@end example
-
-@code{Duplicates}¤Ï¡¢´û¤Ë¸ºß¤¹¤ë¥æ¥Ë¡¼¥¯¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎÃͤȽÅÊ£¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢ÁÞÆþ¤Ç¤­¤Ê¤«¤Ã¤¿¥ì¥³¡¼¥É¿ô¤òɽ¤·¤Þ¤¹¡£
-@code{Warnings}¤Ï¡¢ÁÞÆþ¤µ¤ì¤¿¥Õ¥£¡¼¥ë¥É¤¬²¿¤é¤«¤Îµ¿¤ï¤·¤¤ÃͤǤ¢¤Ã¤¿¤È¤¤¤¦¿ô¤òɽ¤·¤Þ¤¹¡£·Ù¹ð¤Ï¡¢¼¡¤Î¤è¤¦¤Ê¾ò·ï¤Î²¼¤ÇȯÀ¸¤·¤Þ¤¹:
-
-@itemize @bullet
-@item
-@code{NOT NULL}ÄêµÁ¤µ¤ì¤¿¥Õ¥£¡¼¥ë¥É¤Ø¤Î@code{NULL}¤ÎÁÞÆþ¡£¥Õ¥£¡¼¥ë¥É¤Ë¤Ï½é´üÃͤ¬ÀßÄꤵ¤ì¤Þ¤¹¡£
-
-@item
-¿ôÃÍ¥Õ¥£¡¼¥ë¥É¤ÎÈϰϤòĶ¤¨¤ëÃͤΥ»¥Ã¥È¡£ÃͤÏÈÏ°ÏÆâ¤Î¸Â³¦ÃͤËÊäÀµ¤µ¤ì¤Þ¤¹¡£
-
-@item
-¿ôÃÍ¥Õ¥£¡¼¥ë¥É¤Ø¤Î @code{`10.34 a'} ¤Î¤è¤¦¤ÊÃͤΥ»¥Ã¥È¡£°ú¤­¤º¤Ã¤Æ¤¤¤ë¥´¥ß¤Ï¼è¤ê½ü¤«¤ì¡¢»Ä¤ê¤Î¿ôÃÍÉôʬ¤¬ÁÞÆþ¤µ¤ì¤Þ¤¹¡£Ãͤ¬¿ôÃͤȤ·¤ÆȽÃǤǤ­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢¥Õ¥£¡¼¥ë¥É¤Ë¤Ï @code{0} ¤¬¥»¥Ã¥È¤µ¤ì¤Þ¤¹¡£
-
-@item
-@code{CHAR}¡¢@code{VARCHAR}¡¢@code{VARCHAR}¡¢@code{TEXT}Ëô¤Ï@code{BLOB}¥Õ¥£¡¼¥ë¥É¤Ø¤ÎºÇÂçŤòĶ¤¨¤ëʸ»úÎó¤ÎÁÞÆþ¡£Ãͤϥե£¡¼¥ë¥É¤ÎºÇÂçŤËÀÚ¤ê¼Î¤Æ¤é¤ì¤Þ¤¹¡£
-
-@item
-ÆüÉÕËô¤Ï»þ¹ï¥Õ¥£¡¼¥ë¥É¤Ø¤Î¥Õ¥£¡¼¥ë¥É°À­¤ËÈ¿¤·¤¿ÁÞÆþ¡£¤½¤Î°À­¤ËŬ¤·¤¿``¥¼¥í''Ãͤ¬¥»¥Ã¥È¤µ¤ì¤Þ¤¹¡£
-@end itemize
-
-@findex INSERT DELAYED
-@findex DELAYED
-
-@code{INSERT} ¹½Ê¸¤Î @code{DELAYED} ¥ª¥×¥·¥ç¥ó¤Ï @strong{MySQL} Æȼ«¤Î
-¥ª¥×¥·¥ç¥ó¤Ç¡¢¤³¤ì¤Ï @code{INSERT} ¤¬´°Á´¤Ë½ªÎ»¤¹¤ë¤³¤È¤òÂԤƤʤ¤
-¥¯¥é¥¤¥¢¥ó¥È¤ò»ý¤Ä¾ì¹ç¤Ë¡¢¤È¤Æ¤âÌòΩ¤Á¤Þ¤¹¡£
-¤³¤ì¤Ï¡¢¥í¥®¥ó¥°¤Î¤¿¤á¤Ë @strong{MySQL} ¤ò»ÈÍѤ¹¤ë»þ¤Î°ìÈÌŪ¤ÊÌäÂê¤Ç¡¢´°Î»
-¤ËŤ¤»þ´Ö¤¬¤«¤«¤ë @code{SELECT} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤âÄê´üŪ¤Ë¼Â¹Ô¤Ç¤­¤Þ¤¹¡£
-@code{DELAYED} ¤Ï @strong{MySQL} 3.22.15 ¤ÇƳÆþ¤µ¤ì¤Þ¤·¤¿¡£ ¤³¤ì¤Ï
- ANSI SQL92 ¤ËÂФ¹¤ë @strong{MySQL} ³ÈÄ¥¤Ç¤¹¡£
-
-@code{INSERT DELAYED} ¤ò»ÈÍѤ¹¤ë»þ¡¢¥¯¥é¥¤¥¢¥ó¥È¤Ï°ìÅÙ ok ¤È¤Ê¤ê¡¢¥Æ¡¼¥Ö¥ë
-¤¬Â¾¤Î¥¹¥ì¥Ã¥É¤Ç»ÈÍÑÃæ¤Ç¤Ê¤¤»þ¤Ë¥ì¥³¡¼¥É¤¬ÁÞÆþ¤µ¤ì¤Þ¤¹¡£
-
-@code{INSERT DELAYED} ¤ò»ÈÍѤ·¤ÆÆÀ¤é¤ì¤ë¤Û¤«¤ÎÍø±×¤Ï¡¢
-¿¤¯¤Î¥¯¥é¥¤¥¢¥ó¥È¤«¤é¤Î insert ¤¬Æ±»þ¤Ë«¤Í¤é¤ì¡¢°ì¤Ä¤Î¥Ö¥í¥Ã¥¯¤Ç
-½ñ¤«¤ì¤ë¤³¤È¤Ç¤¹¡£ ¤³¤ì¤Ï¿¤¯¤ÎÊÌ¡¹¤Î insert ¤ò¼Â¹Ô¤¹¤ë¤è¤ê
-¤È¤Æ¤â®¤¯¤Ê¤ê¤Þ¤¹¡£
-
-¸½ºß¡¢¥­¥å¡¼¥¤¥ó¥°¤µ¤ì¤¿¥ì¥³¡¼¥É¤Ï¡¢¤½¤ì¤é¤¬¥Æ¡¼¥Ö¥ë¤ËÂåÆþ¤µ¤ì¤ë¤Þ¤Ç
-¥á¥â¥ê¡¼¤ËÊÝ»ý¤µ¤ì¤Æ¤¤¤ë¤À¤±¤Ç¤¹¡£ ¤³¤ì¤Ï¡¢¤â¤· @code{mysqld} ¤ò
-¶¯°ú¤ÊÊýË¡ (@code{kill -9}) ¤Ç¥­¥ë¤·¤¿¤ê¡¢ @code{mysqld} ¤¬Í½´ü¤»¤º
-»à¤ó¤À¾ì¹ç¡¢¥­¥å¡¼¥¤¥ó¥°¤µ¤ì¤Æ¤¤¤ë¥ì¥³¡¼¥É¤Ï¥Ç¥£¥¹¥¯¤Ë½ñ¤«¤ì¤º¼º¤ï¤ì¤Þ¤¹¡ª
-
-@code{DELAYED} ¥ª¥×¥·¥ç¥ó¤ò @code{INSERT} ¤ä @code{REPLACE} ¤Ç»ÈÍѤ¹¤ë¾ì¹ç¡¢
-°Ê²¼¤Î¤³¤È¤¬¤ª¤­¤Þ¤¹¡£
-¤³¤³¤Ç ``¥¹¥ì¥Ã¥É'' ¤È¤Ï @code{INSERT DELAYED} ¥³¥Þ¥ó¥É¤ò¼õ¤±¤¿¥¹¥ì¥Ã¥É¤ò¤µ¤·¡¢
-``¥Ï¥ó¥É¥é¡¼'' ¤È¤ÏÆÃÄê¤Î¥Æ¡¼¥Ö¥ë¤Î¤¿¤á¤ÎÁ´¤Æ¤Î
-@code{INSERT DELAYED} ¹½Ê¸¤òÁàºî¤¹¤ë¥¹¥ì¥Ã¥É¤ò»Ø¤·¤Þ¤¹¡£
-
-@itemize @bullet
-@item
-¥¹¥ì¥Ã¥É¤¬¤¢¤ë¥Æ¡¼¥Ö¥ë¤ËÂФ· @code{DELAYED} ¹½Ê¸¤ò¼Â¹Ô¤¹¤ë¤È¤­¡¢
-¤½¤Î¥Æ¡¼¥Ö¥ë¤ËÂФ¹¤ëÁ´¤Æ¤Î @code{DELAYED} ¹½Ê¸
-¤ò½èÍý¤¹¤ë¤¿¤á¤Ë¥Ï¥ó¥É¥é¡¼¥¹¥ì¥Ã¥É¤¬ºîÀ®¤µ¤ì¤Þ¤¹¡£
-¤â¤·¤½¤Î¤è¤¦¤Ê¥Ï¥ó¥É¥é¡¼¤¬Â¸ºß¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¤Ï¡£
-
-@item
-¤½¤Î¥¹¥ì¥Ã¥É¤Ï¡¢¤½¤Î¥Ï¥ó¥É¥é¡¼¤¬ @code{DELAYED} ¥í¥Ã¥¯¤ò´û¤Ë»ý¤Ã¤Æ¤¤¤ë¤«
-¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡¨ ¤â¤·»ý¤Ã¤Æ¤¤¤Ê¤¤¤Ê¤é¡¢¤½¤¦¤¹¤ë¤è¤¦¤Ë
-¥Ï¥ó¥É¥é¡¼¤Ë¹ð¤²¤Þ¤¹¡£
-¤¿¤È¤¨Â¾¤Î¥¹¥ì¥Ã¥É¤¬ @code{READ} ¤« @code{WRITE} ¥í¥Ã¥¯¤ò¤½¤Î¥Æ¡¼¥Ö¥ë¤Ë
-»ý¤Ã¤Æ¤¤¤¿¤È¤·¤Æ¤â¡¢ @code{DELAYED} ¥í¥Ã¥¯¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¤·¤«¤·¡¢¤½¤Î¥Ï¥ó¥É¥é¡¼¤ÏÁ´¤Æ¤Î @code{ALTER TABLE} ¥í¥Ã¥¯¤«
- @code{FLUSH TABLES} ¤òÂÔ¤Á¤Þ¤¹¡£ ¤½¤Î¥Æ¡¼¥Ö¥ë¹½Â¤¤¬ºÇ¿·¤Ç¤¢¤ë¤Î¤ò
-³Î¼Â¤Ë¤¹¤ë¤¿¤á¤Ë¡£
-
-@item
-¥¹¥ì¥Ã¥É¤Ï @code{INSERT} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤ò¼Â¹Ô¤·¤Þ¤¹¤¬¡¢¥ì¥³¡¼¥É¤ò¥Æ¡¼¥Ö¥ë
-¤Ë½ñ¤¯Âå¤ï¤ê¤Ë¡¢¥Ï¥ó¥É¥é¥¹¥ì¥Ã¥É¤Ë¤è¤Ã¤Æ´ÉÍý¤µ¤ì¤ë¥­¥å¡¼¤ËºÇ¸å¤Î¥ì¥³¡¼¥É¤Î
-¥³¥Ô¡¼¤òÃÖ¤­¤Þ¤¹¡£Ê¸Ë¡¥¨¥é¡¼¤Ï¥¹¥ì¥Ã¥É¤Ë¤è¤Ã¤ÆÄÌÃΤµ¤ì¡¢¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°
-¥é¥à¤ËÊó¹ð¤µ¤ì¤Þ¤¹¡£
-
-@item
-¥¯¥é¥¤¥¢¥ó¥È¤Ï·ë²Ì¹Ô¤Î½ÅÊ£¿ô¤ä @code{AUTO_INCREMENT} ¤ÎÃͤò
-Êó¹ð¤Ç¤­¤Þ¤»¤ó¡¨ ¤½¤ì¤Ï¥µ¡¼¥Ð¡¼¤«¤éÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£ ¤Ê¤¼¤Ê¤é¡¢
- @code{INSERT} ¤Ï¥¤¥ó¥µ¡¼¥È¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤¬´°Á´¤Ë½ªÎ»¤¹¤ëÁ°¤Ë
-Ê֤뤫¤é¤Ç¤¹¡£ ¤â¤· C API ¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Ê¤é¡¢ @code{mysql_info()} ´Ø¿ô¤Ï
-ƱÍͤÎÍýͳ¤Ë¤è¤ê¤Ê¤Ë¤âÊÖ¤·¤Þ¤»¤ó¡£
-
-@item
-¹¹¿·¥í¥°¤Ï¡¢¥ì¥³¡¼¥É¤¬¤½¤Î¥Æ¡¼¥Ö¥ë¤Ë insert ¤µ¤ì¤¿¤È¤­¡¢¤½¤Î¥Ï¥ó¥É¥é¡¼¥¹¥ì¥Ã¥É
-¤Ë¤è¤Ã¤Æ¹¹¿·¤µ¤ì¤Þ¤¹¡£ Ê£¿ô¥ì¥³¡¼¥É¤ÎÁÞÆþ¤Î¾ì¹ç¡¢ ¹¹¿·¥í¥°¤ÏºÇ½é¤Î¹Ô¤¬
-ÁÞÆþ¤µ¤ì¤¿¤È¤­¤Ë¹¹¿·¤µ¤ì¤Þ¤¹¡£
-
-@item
-¤½¤ì¤¾¤ì¤Î @code{delayed_insert_limit} ¥ì¥³¡¼¥É¤¬½ñ¤«¤ì¤¿¸å¡¢¤½¤Î¥Ï¥ó¥É¥é¡¼¤Ï
-¤¤¤«¤Ê¤ë @code{SELECT} ʸ¤â¤Þ¤À±ä´ü¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¤ò³Îǧ¤·¤Þ¤¹¡£
-¤â¤·¤½¤¦¤Ê¤é¡¢Â³¤±¤ëÁ°¤Ë¤³¤ì¤é¤ËÂФ·¤Æ¼Â¹Ô¤ò²Äǽ¤Ë¤·¤Þ¤¹¡£
-
-@item
-¥Ï¥ó¥É¥é¡¼¤Î¥­¥å¡¼Æâ¤Ë¥ì¥³¡¼¥É¤¬¤Ê¤¯¤Ê¤Ã¤¿¤È¤­¡¢¥Æ¡¼¥Ö¥ë¤Ï¥¢¥ó¥í¥Ã¥¯¤µ¤ì¤Þ¤¹¡£
-¤â¤·¿·¤·¤¤ @code{INSERT DELAYED} ¥³¥Þ¥ó¥É¤¬ @code{delayed_insert_timeout} ÉðÊÆâ¤Ë
-¼õ¤±ÉÕ¤±¤é¤ì¤Ê¤±¤ì¤Ð¡¢¥Ï¥ó¥É¥é¡¼¤Ï½ªÎ»¤·¤Þ¤¹¡£
-
-@item
-¤â¤·¡¢ÆÃÄê¤Î¥Ï¥ó¥É¥é¡¼¤Î¥­¥å¡¼Æâ¤Ë @code{delayed_queue_size} °Ê¾å¤Î¥ì¥³¡¼¥É¤¬
-´û¤Ë±ä´ü¤µ¤ì¤Æ¤¤¤ë¤Ê¤é¤Ð¡¢¤½¤Î¥¹¥ì¥Ã¥É¤Ï¡¢¥­¥å¡¼¤Ë;͵¤¬¤¢¤ë´ÖÂÔ¤Á¤Þ¤¹¡£
-¤³¤ì¤Ï @code{mysqld} ¥µ¡¼¥Ð¡¼¤¬ delayed ¤µ¤ì¤¿¥­¥å¡¼¤ËÁ´¤Æ¤Î
-¥á¥â¥ê¡¼¤ò³Î¼Â¤Ë»ÈÍѤ·¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤Î¤ËÌòΩ¤Á¤Þ¤¹¡£
-
-@item
-¤½¤Î¥Ï¥ó¥É¥é¡¼¥¹¥ì¥Ã¥É¤Ï @strong{MySQL} ¥×¥í¥»¥¹¥ê¥¹¥È¤Î @code{Command} ¹à
-Æâ¤Ë¡¢ @code{delayed_insert} ¤È¶¦¤Ëɽ¼¨¤µ¤ì¤Þ¤¹¡£
-¤³¤ì¤Ï @code{FLUSH TABLES} ¥³¥Þ¥ó¥É¤« @code{KILL thread_id} ¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ç¡¢
-kill ¤Ç¤­¤ë¤Ç¤·¤ç¤¦¡£
-¤·¤«¤·¡¢¤³¤ì¤é¤Ï¡¢½ªÎ»¤¹¤ëÁ°¤Ë¡¢¥­¥å¡¼Æâ¤ÎÁ´¤Æ¤Î¥ì¥³¡¼¥É¤ò¥Æ¡¼¥Ö¥ë¤Ë
-Êݸ¤·¤è¤¦¤È¤·¤Þ¤¹¡£
-¤³¤Î´Ö¡¢¤³¤Î¥¹¥ì¥Ã¥É¤Ï¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤«¤éÍ褿¤¤¤«¤Ê¤ë
-¿·¤·¤¤ @code{INSERT} ¥³¥Þ¥ó¥É¤â¼õ¤±ÉÕ¤±¤Þ¤»¤ó¡£
-¤â¤·¡¢¤³¤Î¸å¤Ë @code{INSERT DELAYED} ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤Ê¤é¡¢
-¿·¤·¤¤¥Ï¥ó¥É¥é¡¼¥¹¥ì¥Ã¥É¤¬ºîÀ®¤µ¤ì¤Þ¤¹¡£
-
-@item
-¾åµ­¤Î¤³¤È¤Ï¡¢¤â¤· @code{INSERT DELAYED} ¥³¥Þ¥ó¥É¤¬´û¤ËÁö¤Ã¤Æ¤¤¤ë¤Ê¤é¡¢
- @code{INSERT DELAYED} ¥³¥Þ¥ó¥É¤Ï¡¢ÉáÄ̤Π@code{INSERT} ¥³¥Þ¥ó¥É¤è¤ê¤â¹â¤¤
-Í¥ÀèÅÙ¤ò»ý¤Ä¤È¤¤¤¦¤³¤È¤Ç¤¹¡ª
-¾¤Î update ¥³¥Þ¥ó¥É¤Ï @code{INSERT DELAY} ¥­¥å¡¼¤¬¶õ¤Ë¤Ê¤ë¤Þ¤Ç¡¢
-¤¢¤ë¤¤¤Ï狼¤¬ @code{KILL thread_id} ¤ä @code{FLUSH TABLES} ¤ò¼Â¹Ô¤·¤Æ
-¥Ï¥ó¥É¥é¡¼¤ò¥­¥ë¤¹¤ë¤Þ¤Ç¡¢
-ÂÔ¤¿¤µ¤ì¤Þ¤¹¡£
-
-@item
-°Ê²¼¤Î¥¹¥Æ¡¼¥¿¥¹ÊÑ¿ô¤Ï @code{INSERT DELAYED} ¥³¥Þ¥ó¥É¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤ò
-Í¿¤¨¤Þ¤¹¡§
-
-@multitable @columnfractions .35 .65
-@item @code{Delayed_insert_threads} @tab ¥Ï¥ó¥É¥é¡¼¥¹¥ì¥Ã¥É¤Î¿ô
-@item @code{Delayed_writes} @tab @code{INSERT DELAYED} ¤Ç½ñ¤«¤ì¤ë¥ì¥³¡¼¥É¿ô
-@item @code{Not_flushed_delayed_rows} @tab ½ñ¤­¹þ¤ß¤òÂԤĥ쥳¡¼¥É¿ô
-@end multitable
-
-¤³¤ì¤é¤ÎÊÑ¿ô¤Ï @code{SHOW STATUS} ¹½Ê¸¤òȯ¹Ô¤·¤¿¤ê
- @code{mysqladmin extended-status} ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ç¸«¤ì¤Þ¤¹.
-@end itemize
-
-Ãí°Õ: @code{INSERT DELAYED} ¤Ï¡¢¥Æ¡¼¥Ö¥ë¤¬»ÈÍÑÃæ¤Ç¤Ê¤¤¾ì¹ç¡¢Ä̾ï¤Î
-INSERT ¤è¤ê¤âÃÙ¤¯¤Ê¤ê¤Þ¤¹¡£@code{INSERT DELAYED} ¤ò»ÈÍѤ¹¤ë³Æ¥Æ¡¼¥Ö¥ë¤Ë¤Ä
-¤¤¤ÆÊ̤Υ¹¥ì¥Ã¥É¤òÁàºî¤¹¤ë¥µ¡¼¥Ð¤Î¡¢ÄɲäΥª¡¼¥Ð¡¼¥Ø¥Ã¥É¤â¤¢¤ê¤Þ¤¹¡£¤³¤ì¤Ï¡¢
-³Î¼Â¤Ë¤½¤ì¤òɬÍפȤ¹¤ë»þ¤Ë¤À¤± @code{INSERT DELAYED} ¤ò»ÈÍѤ¹¤Ù¤­¤³¤È¤ò°Õ
-Ì£¤·¤Þ¤¹¡ª
-
-@findex REPLACE
-@node REPLACE, LOAD DATA, INSERT, Reference
-@section @code{REPLACE}¹½Ê¸
-
-@example
- REPLACE [LOW_PRIORITY | DELAYED]
- [INTO] tbl_name [(col_name,...)]
- VALUES (expression,...)
-or REPLACE [LOW_PRIORITY | DELAYED]
- [INTO] tbl_name [(col_name,...)]
- SELECT ...
-or REPLACE [LOW_PRIORITY | DELAYED]
- [INTO] tbl_name
- SET col_name=expression, col_name=expression,...
-@end example
-
-@code{REPLACE}¤Ï¡¢¥Æ¡¼¥Ö¥ëÃæ¤Î¸Å¤¤¥ì¥³¡¼¥É¤¬¥æ¥Ë¡¼¥¯¥¤¥ó¥Ç¥Ã¥¯¥¹¾å¤Î
-¿·¤·¤¤¥ì¥³¡¼¥É¤ÈƱ¤¸Ãͤò»ý¤Ä¾ì¹ç¤Ë¡¢¿·¤·¤¤¥ì¥³¡¼¥É¤òÁÞÆþ¤¹¤ëÁ°¤Ë¡¢
-¸Å¤¤¥ì¥³¡¼¥É¤òºï½ü¤¹¤ë¤È¤¤¤¦¤³¤È¤ò½ü¤±¤Ð¡¢@code{INSERT}¤ÈÁ´¤¯Æ±¤¸¤è¤¦¤Ë
-Æ°ºî¤·¤Þ¤¹¡£
-@xref{INSERT, , @code{INSERT}}.
-
-@findex LOAD DATA INFILE
-@node LOAD DATA, UPDATE, REPLACE, Reference
-@section @code{LOAD DATA INFILE}¹½Ê¸
-
-@example
-LOAD DATA [LOW_PRIORITY] [LOCAL] INFILE 'file_name.txt' [REPLACE | IGNORE]
- INTO TABLE tbl_name
- [FIELDS
- [TERMINATED BY '\t']
- [OPTIONALLY] ENCLOSED BY '']
- [ESCAPED BY '\\' ]]
- [LINES TERMINATED BY '\n']
- [IGNORE number LINES]
- [(col_name,...)]
-@end example
-
-@code{LOAD DATA INFILE}¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ï¡¢¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤«¤é¥Æ¡¼¥Ö¥ë¤Ø¤È¡¢
-¥ì¥³¡¼¥É¤ò¹â®¤ËÆɤ߹þ¤ß¤Þ¤¹¡£ @code{LOCAL} ¥­¡¼¥ï¡¼¥É¤¬»ØÄꤵ¤ì¤ì¤Ð¡¢¥Õ¥¡¥¤¥ë¤Ï
-¥¯¥é¥¤¥¢¥ó¥È¡¦¥Û¥¹¥È¤«¤éÆɤ߹þ¤Þ¤ì¤Þ¤¹¡£
-@code{LOCAL}¤¬»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¡¢¥Õ¥¡¥¤¥ë¤Ï¥µ¡¼¥Ð¤Ë°ÌÃÖ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹
-(@code{LOCAL}¤Ï¡¢@strong{MySQL} 3.22.6°Ê¹ß¤ÇÍøÍѤǤ­¤Þ¤¹)¡£
-
-¥»¥­¥å¥ê¥Æ¥£¾å¤ÎÍýͳ¤«¤é¡¢¥µ¡¼¥Ð¤«¤é¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤òÆɤ߽Ф¹»þ¤Ï¡¢
-¥Õ¥¡¥¤¥ë¤¬¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤Ë¸ºß¤¹¤ë¤«¡¢
-Á´¤Æ¤ËÆɤ߹þ¤ß¸¢¸Â¤¬¤¢¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-¤Þ¤¿¡¢¥µ¡¼¥Ð¥Õ¥¡¥¤¥ë¤Ç @code{LOAD DATA INFILE} ¤ò»ÈÍѤ¹¤ë¤Ë¤Ï¡¢
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î @strong{file} ¸¢¸Â¤â»ý¤¿¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-@xref{Privileges provided}.
-
-¤â¤· @code{LOW_PRIORITY} ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢@code{LOAD DATA} ¹½Ê¸¤Ï
-¤½¤Î¥Æ¡¼¥Ö¥ë¤«¤é¾¤Î¥¯¥é¥¤¥¢¥ó¥È¤¬Æɤ߹þ¤ß¤ò¹Ô¤Ã¤Æ¤¤¤ë´Ö¡¢
-Ã٤餵¤ì¤Þ¤¹¡£
-
-@code{LOCAL} »ÈÍѤò¤¹¤ë¤È¡¢¥¯¥é¥¤¥¢¥ó¥È¡¦¥Û¥¹¥È¤«¤é¥µ¡¼¥Ð¡¦¥Û¥¹¥È¤Ø
-¥Õ¥¡¥¤¥ë¤ÎÆâÍƤ¬Å¾Á÷¤µ¤ì¤ëʬ¡¢Â¿¾¯ÃÙ¤¯¤Ê¤ë¤Ç¤·¤ç¤¦¡£
-¤¤¤¦¤Ê¤é¤Ð¡¢¥í¡¼¥«¥ë¤Î¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤à¤Î¤Ë¡¢
-@strong{file} ¸¢¸Â¤ÏɬÍפʤ¤¤È¤¤¤¦¤³¤È¤Ç¤¹¡£
-
-@cindex @code{mysqlimport}
-@code{mysqlimport}¥æ¥Æ¥£¥ê¥Æ¥£¤Ï¡¢¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£; ¤³¤ì¤Ï¡¢¥µ¡¼¥Ð¤Ë@code{LOAD DATA INFILE}¥³¥Þ¥ó¥É¤òÁ÷¿®¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ½èÍý¤ò¼Â¸½¤·¤Æ¤¤¤Þ¤¹¡£
-@code{--local}¥ª¥×¥·¥ç¥ó¤Ï¡¢@code{mysqlimport}¤Ë¡¢¥¯¥é¥¤¥¢¥ó¥È¡¦¥Û¥¹¥È¤«¤é¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤Þ¤»¤Þ¤¹¡£
-¥¯¥é¥¤¥¢¥ó¥È¤È¥µ¡¼¥Ð¤¬°µ½Ì¥×¥í¥È¥³¥ë¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ì¤Ð¡¢Ä㮤ʥͥåȥ¥¯¤Ç¤è¤êÎɤ¤¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤òÆÀ¤ë¤¿¤á¤Ë¡¢@code{--compress}¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-¥µ¡¼¥Ð¡¦¥Û¥¹¥È¤Ë¥Õ¥¡¥¤¥ë¤òÃÖ¤¯¾ì¹ç¡¢¥µ¡¼¥Ð¤Ï¡¢°Ê²¼¤Î¥ë¡¼¥ë¤ò»ÈÍѤ·¤Þ¤¹:
-
-@itemize @bullet
-@item
-´°Á´¤Ê¥Ñ¥¹¤Ç¥Õ¥¡¥¤¥ë̾¤¬Í¿¤¨¤é¤ì¤¿¾ì¹ç¡¢¥µ¡¼¥Ð¤Ï¥Ñ¥¹Ì¾¤ò¤½¤Î¤Þ¤Þ»ÈÍѤ·¤Þ¤¹¡£
-
-@item
-£±¤ÄËô¤ÏÊ£¿ô¤Î¹½À®Í×ÁǤ«¤éÀ®¤ëÁêÂХѥ¹¤È¶¦¤Ë¥Õ¥¡¥¤¥ë̾¤¬Í¿¤¨¤é¤ì¤¿¾ì¹ç¡¢¥µ¡¼¥Ð¤Ï¡¢¥µ¡¼¥Ð¤Î¥Ç¡¼¥¿¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤«¤é¥Õ¥¡¥¤¥ë¤òõ¤·¤Þ¤¹¡£
-
-@item
-¥Õ¥¡¥¤¥ë̾¤À¤±¤¬Ã±¤ËÍ¿¤¨¤é¤ì¤¿¾ì¹ç¡¢¥µ¡¼¥Ð¤Ï¡¢
-¥«¥ì¥ó¥È¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤òõ¤·¤Þ¤¹¡£
-@end itemize
-
-¤³¤ì¤é¤Î¥ë¡¼¥ë¤Ï¡¢¥Õ¥¡¥¤¥ë¤¬ @file{myfile.txt} ¤Î¤è¤¦¤ËÍ¿¤¨¤é¤ì¤ì¤Ð
-¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¥Õ¥¡¥¤¥ë¤¬Æɤ߽Фµ¤ì¡¢
-@file{./myfile.txt} ¤Î¤è¤¦¤ËÍ¿¤¨¤é¤ì¤ì¤Ð¡¢¸½ºßÁªÂò¤·¤Æ¤¤¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Ç¡¼¥¿¥Ç¥£¥ì¥¯¥È¥ê¤«¤é
-¥Õ¥¡¥¤¥ë¤¬Æɤ߽Фµ¤ì¤ë¤È¤¤¤¦°ÕÌ£¤Ç¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤Æ²¼¤µ¤¤¡£
-
-Î㤨¤Ð¡¢°Ê²¼¤Î @code{LOAD DATA} ʸ¤Ï¡¢@file{data.txt} ¥Õ¥¡¥¤¥ë¤ò
-@code{db1} ¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤«¤éÆɤߤޤ¹¡£ ¤Ê¤¼¤Ê¤é¡¢@code{db1} ¤Ï
-¸½ºßÁªÂò¤µ¤ì¤Æ¤¤¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤À¤«¤é¤Ç¤¹¡£ ¤¿¤È¤¨¡¢@code{db2} ¥Ç¡¼¥¿¥Ù¡¼¥¹
-¤Î¥Æ¡¼¥Ö¥ë¤Ë¡¢¥Õ¥¡¥¤¥ë¤«¤éÆɤ߹þ¤ó¤À¥Ç¡¼¥¿¤òÁÞÆþ¤¹¤ë¤È¤·¤Æ¤â¡£¡§
-
-°Ê²¼¤Ë¼¨¤¹¤è¤¦¤Ê¹½Ê¸¤Ç¤Ï¡¢¥Õ¥¡¥¤¥ë¤Ï @code{db1} ¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê
-¤«¤éÆɤޤì¤Þ¤¹¡£@code{db2} ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó:
-
-@example
-mysql> USE db1;
-mysql> LOAD DATA INFILE "data.txt" INTO TABLE db2.my_table;
-@end example
-
-@code{REPLACE} ¤È @code{IGNORE} ¥­¡¼¥ï¡¼¥É¤Ï¡¢¤¹¤Ç¤Ë¸ºß¤¹¤ë¥æ¥Ë¡¼¥¯¥­¡¼¤Ë
-½ÅÊ£¤·¤Æ¤¤¤ë¥ì¥³¡¼¥É¤ÎÆþÎϤËÂФ¹¤ëÀ©¸æ¤Ç¤¹¡£
-@code{REPLACE} »ØÄê¤Î¾ì¹ç¡¢Æ±¤¸¥æ¥Ë¡¼¥¯¥­¡¼¤ò»ý¤Ä´û¸¤Î¥ì¥³¡¼¥É¤Ï¿·¤·¤¤¥ì¥³¡¼¥É¤Ç
-ÃÖ¤­´¹¤¨¤é¤ì¤Þ¤¹¡£
-@code{IGNORE} »ØÄê¤Î¾ì¹ç¡¢´û¸¤Î¥ì¥³¡¼¥É¤Î¥æ¥Ë¡¼¥¯¥­¡¼¤È½ÅÊ£¤¹¤ë¥­¡¼¤ò¤â¤Ä¿·¤·¤¤¥ì¥³¡¼¥É¤Ï
-Èô¤Ð¤µ¤ì¤Þ¤¹¡£ ¤â¤·¡¢¤É¤Á¤é¤â»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢½ÅÊ£¤·¤¿¥­¡¼¤¬¸«¤Ä¤«¤Ã¤¿¾ì¹ç
-¥¨¥é¡¼¤¬È¯À¸¤·¡¢¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£
-
-@code{LOCAL} ¥­¡¼¥ï¡¼¥É¤ò»ÈÍѤ·¤Æ¥Ç¡¼¥¿¤ò¥í¡¼¥«¥ë¤«¤é¥í¡¼¥É¤¹¤ë¾ì¹ç¡¢
-¥µ¡¼¥Ð¡¼¤ÏÁàºî¤ÎÅÓÃæ¤ÇžÁ÷¤ò¤È¤á¤ëÊýË¡¤òÃΤê¤Þ¤»¤ó¡£
-¤½¤ì¤Ç¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤È¤·¤Æ¤Ï @code{IGNORE} ¤¬»ØÄꤵ¤ì¤¿¤Î¤È
-Ʊ¤¸¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-@code{LOAD DATA INFILE}¤Ï¡¢@code{SELECT ... INTO OUTFILE}¤ÎµÕ¤Ç¤¹¡£
-@xref{SELECT, , @code{SELECT}}.
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¥Õ¥¡¥¤¥ë¤Ø¥Ç¡¼¥¿¤ò½ñ¤­¹þ¤à¤Ë¤Ï¡¢@code{SELECT ... INTO OUTFILE}¤ò»ÈÍѤ·¤Þ¤¹¡£
-¥Õ¥¡¥¤¥ë¤«¤é¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÆɤßÌ᤹¤Ë¤Ï¡¢@code{LOAD DATA INFILE}¤ò»ÈÍѤ·¤Þ¤¹¡£
-@code{FIELDS}¤È@code{LINES}Àá¤Î¹½Ê¸¤ÏξÊý¤Î¥³¥Þ¥ó¥É¤È¤âƱ¤¸¤Ç¤¹¡£
-¤É¤Á¤é¤ÎÀá¤â¥ª¥×¥·¥ç¥ó¤Ç¤¹¤¬¡¢Î¾Êý¤ò»ØÄꤹ¤ë¾ì¹ç¤Ï¡¢@code{FIELDS}¤Ï¡¢@code{LINES}¤è¤êÀè¤Ë»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-
-@code{FIELDS}Àá¤ò»ØÄꤷ¤¿¾ì¹ç¡¢¤½¤ÎÃÊÍî(@code{TERMINATED BY}¡¢@code{[OPTIONALLY] ENCLOSED BY}µÚ¤Ó@code{ESCAPED BY})¤Ï¡¢¾¯¤Ê¤¯¤È¤â£±¤Ä¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤ò½ü¤¤¤Æ¡¢¤½¤ì¤é¤â¤Þ¤¿¥ª¥×¥·¥ç¥ó¤È¤Ê¤ê¤Þ¤¹¡£
-
-@code{FIELDS}Àá¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢½é´üÃͤϰʲ¼¤Î¤è¤¦¤Ëµ­½Ò¤·¤¿¤Î¤ÈÅù²Á¤È¤Ê¤ê¤Þ¤¹:
-
-@example
-FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\'
-@end example
-
-@code{LINES}Àá¤ò»ØÄꤷ¤Ê¤«¤Ã¤¿¾ì¹ç¡¢½é´üÃͤϰʲ¼¤Î¤è¤¦¤Ëµ­½Ò¤·¤¿¤Î¤ÈÅù²Á¤È¤Ê¤ê¤Þ¤¹:
-
-@example
-LINES TERMINATED BY '\n'
-@end example
-
-¸À¤¤´¹¤¨¤ë¤È¡¢@code{LOAD DATA INFILE} ¤Î½é´üÃͤϡ¢½ÐÎϤؽñ¤­¹þ¤àºÝ¤Ë°Ê²¼¤Î¤è¤¦¤Ë¿¶Éñ¤¤¤Þ¤¹:
-
-@itemize @bullet
-@item
-²þ¹Ô¤ò¥ì¥³¡¼¥É¤Î¶­³¦¤È¤ß¤Ê¤¹
-
-@item
-¥¿¥Öʸ»ú¤Ë¤è¤Ã¤Æ¥Õ¥£¡¼¥ë¥É¤ò¶èÀÚ¤ë
-
-@item
-¥¯¥©¡¼¥Èʸ»ú¤Ç¥Õ¥£¡¼¥ë¥É¤ò°Ï¤ó¤Ç¤¤¤Ê¤¤¤â¤Î¤È¤¹¤ë
-
-@item
-¥¿¥Öʸ»ú¤ä²þ¹Ôʸ»úµÚ¤Ó@samp{\}¤ÎÁ°¤Ë@samp{\}¤¬¤¢¤ë¤³¤È¤Ë¤è¤ê¡¢¤½¤ì¤é¤ò¥Õ¥£¡¼¥ë¥ÉÃͤΰìÉô¤Î¥ê¥Æ¥é¥ëʸ»ú¤Ç¤¢¤ë¤È¤·¤Æ½èÍý¤¹¤ë¡£
-@end itemize
-
-µÕ¤Ë¡¢@code{LOAD DATA INFILE}¤Î½é´üÃͤϡ¢ÆþÎϤòÆɤ߹þ¤àºÝ¤Ë°Ê²¼¤Î¤è¤¦¤Ë¿¶Éñ¤¤¤Þ¤¹:
-
-@itemize @bullet
-@item
-¥Õ¥£¡¼¥ë¥É´Ö¤Ë¥¿¥Öʸ»ú¤ò½ñ¤¯
-
-@item
-¤¤¤º¤ì¤Î¥¯¥©¡¼¥Èʸ»ú¤Ç¤â¥Õ¥£¡¼¥ë¥É¤ò°Ï¤Þ¤Ê¤¤
-
-@item
-@samp{\}¤Î»ÈÍѤˤè¤ê¡¢¥Õ¥£¡¼¥ë¥ÉÃͤÎÃæ¤Ç»ÈÍѤ¹¤ë¥¿¥Öʸ»ú¤ä²þ¹Ôʸ»ú¡¢@samp{\}¤ò¥¨¥¹¥±¡¼¥×¤¹¤ë
-
-@item
-¥ì¥³¡¼¥É¤Î½ª¤ê¤Ë²þ¹Ôʸ»ú¤ò½ñ¤¯
-@end itemize
-
- @code{FIELDS ESCAPED BY '\\'}¤È½ñ¤¤¤¿¾ì¹ç¡¢Ã±°ì¤Î¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤È¤·¤ÆÆɤ߽Фµ¤ì¤ëÃͤȤ¹¤ë¤¿¤á¤Ë¡¢£²¤Ä¤Î¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ²¼¤µ¤¤¡£
-
-@code{IGNORE number LINES} ¥ª¥×¥·¥ç¥ó¤Ï¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤Ë¤¢¤ë¥ì¥³¡¼¥É¤ò̵»ë¤¹¤ë¤Î¤Ë
-»ÈÍѤµ¤ì¤Þ¤¹¡§
-
-@example
-mysql> LOAD DATA INFILE "/tmp/file_name" into table test IGNORE 1 LINES;
-@end example
-
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¥Õ¥¡¥¤¥ë¤Ø¥Ç¡¼¥¿¤ò½ñ¤­¡¢¤½¤ì¤«¤é¸å¤Ç¤½¤Î¥Õ¥¡¥¤¥ë¤«¤é¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¥Ç¡¼¥¿¤òÆɤßÌ᤹¤¿¤á¤Ë¡¢@code{SELECT ... INTO OUTFILE}¤ÈÂФË@code{LOAD DATA INFILE}¤ò»È¤¦¾ì¹ç¡¢ÁÐÊý¤Î¥Õ¥£¡¼¥ë¥É¤È¥ì¥³¡¼¥É¤Î¼è°·¤¤¤Ë´Ø¤¹¤ë¥ª¥×¥·¥ç¥ó¤Ï¡¢°ìÃפ·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£¤µ¤â¤Ê¤±¤ì¤Ð¡¢@code{LOAD DATA INFILE}¤ÏŬÀڤ˥ե¡¥¤¥ë¤ò½èÍý¤·¤Ê¤¤¤Ç¤·¤ç¤¦¡£
- ¥Õ¥£¡¼¥ë¥É¤ò¥³¥ó¥Þ¤Ç¶èÀڤäƥե¡¥¤¥ë¤Ø½ñ¤­½Ð¤¹¤¿¤á¤Ë¡¢@code{SELECT ... INTO OUTFILE}¤ò»ÈÍѤ¹¤ë¤È¤¹¤ì¤Ð:
-
-@example
-mysql> SELECT * FROM table1 INTO OUTFILE 'data.txt'
- FIELDS TERMINATED BY ','
- FROM ...
-@end example
-
-¥³¥ó¥Þ¶èÀÚ¤ê¥Õ¥¡¥¤¥ë¤«¤éÆɤßÌ᤹¤¿¤á¡¢Àµ¤·¤¤¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ï¤³¤¦¤Ê¤ë¤Ç¤·¤ç¤¦:
-
-@example
-mysql> LOAD DATA INFILE 'data.txt' INTO TABLE table2
- FIELDS TERMINATED BY ',';
-@end example
-
-¤½¤ÎÂå¤ï¤ê¤È¤·¤Æ¼¡¤Ë¼¨¤¹¤è¤¦¤Ê¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ç¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤â¤¦¤È¤·¤Æ¤â¡¢Àµ¤·¤¯Æ°ºî¤·¤Ê¤¤¤Ç¤·¤ç¤¦¡£¤Ê¤¼¤Ê¤é¡¢¤³¤ì¤Ï¡¢@code{LOAD DATA INFILE}¤ËÂФ·¤Æ¥Õ¥£¡¼¥ë¥É¤Î´Ö¤Ë¥¿¥Ö¤òõ¤¹¤è¤¦»Ø¼¨¤¹¤ë¤«¤é¤Ç¤¹:
-
-@example
-mysql> LOAD DATA INFILE 'data.txt' INTO TABLE table2
- FIELDS TERMINATED BY '\t';
-@end example
-
-¤ª¤½¤é¤¯¡¢¤½¤ì¤¾¤ì¤ÎÆþÎϹԤÏñ°ì¤Î¥Õ¥£¡¼¥ë¥É¤È¤·¤Æ½èÍý¤µ¤ì¤ë¤Ç¤·¤ç¤¦¡£
-
-@code{LOAD DATA INFILE}¤Ï³°Éô¥½¡¼¥¹¤«¤é¤â¥Õ¥¡¥¤¥ë¤òÆɤ߽Ф¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-Î㤨¤Ð¡¢dBASE¥Õ¥©¡¼¥Þ¥Ã¥È¤Î¥Õ¥¡¥¤¥ë¤Ï¡¢¥Õ¥£¡¼¥ë¥É¤ò¥³¥ó¥Þ¤Ç¶èÀÚ¤é¤ì¡¢¥À¥Ö¥ë¥¯¥©¡¼¥Æ¡¼¥·¥ç¥ó¤Ç°Ï¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£
-¥ì¥³¡¼¥É¤¬²þ¹Ôʸ»ú¤Ç¶èÀÚ¤é¤ì¤Æ¤¤¤ë¤È¤·¤¿¤é¡¢¼¡¤Ë¼¨¤¹¥Õ¥£¡¼¥ë¥ÉµÚ¤Ó¥ì¥³¡¼¥É¤Î¼è°·¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤¿¥³¥Þ¥ó¥É¤¬¡¢¤³¤Î¤è¤¦¤Ê¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤à¤Î¤Ë»ÈÍѤǤ­¤Þ¤¹¡£
-
-@example
-mysql> LOAD DATA INFILE 'data.txt' INTO TABLE tbl_name
- FIELDS TERMINATED BY ',' ENCLOSED BY '"'
- LINES TERMINATED BY '\n';
-@end example
-
-¤¤¤¯¤Ä¤«¤Î¥Õ¥£¡¼¥ë¥ÉµÚ¤Ó¥ì¥³¡¼¥É¤Î¼è°·¥ª¥×¥·¥ç¥ó¤Ë¡¢¶õʸ»úÎó(@code{''})¤ò»ØÄꤹ¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£¶õ¤Ç¤Ê¤¤¤Ê¤é¡¢@code{FIELDS [OPTIONALLY] ENCLOSED BY}¤È@code{FIELDS ESCAPED BY}¤ÎÃͤÏñ°ì¤Îʸ»ú¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£@code{FIELDS TERMINATED BY}¤È@code{LINES TERMINATED BY}¤Ï£²¤Ä°Ê¾å¤Îʸ»ú¤È¤Ê¤ë¤Ç¤·¤ç¤¦¡£Î㤨¤Ð¡¢¥ê¥¿¡¼¥óʸ»ú¤È²þ¹Ôʸ»ú¤Î¥Ú¥¢¤Ç¶èÀÚ¤é¤ì¤¿¥ì¥³¡¼¥É¤ò½ñ¤­¹þ¤ó¤À¤ê¡¢¤³¤Î¤è¤¦¤Ê¥ì¥³¡¼¥É¤ò´Þ¤ó¤À¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤ó¤À¤ê¤¹¤ë¤Ë¤Ï¡¢@code{LINES TERMINATED BY '\r\n'}Àá¤ò»ØÄꤷ¤Þ¤¹¡£
-
-@code{FIELDS [OPTIONALLY] ENCLOSED BY}¤Ï¡¢¥Õ¥£¡¼¥ë¥É¤Î°úÍÑÉä¤òÀ©¸æ¤·¤Þ¤¹¡£½ÐÎϤκÝ(@code{SELECT ... INTO OUTFILE})¡¢@code{OPTIONALLY}¸ì¤ò¾Ê¤¤¤¿¤Ê¤é¡¢Á´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤Ï@code{ENCLOSED BY}ʸ»ú¤Ç°Ï¤Þ¤ì¤Þ¤¹¡£¤³¤Î¤è¤¦¤Ê½ÐÎÏ(¥Õ¥£¡¼¥ë¥É¶èÀÚ¤ê¤Ë¥³¥ó¥Þ¤ò»ÈÍÑ)¤ÎÎã¤ò¼¡¤Ë¼¨¤·¤Þ¤¹:
-
-@example
-"1","a string","100.20"
-"2","a string containing a , comma","102.20"
-"3","a string containing a \" quote","102.20"
-"4","a string containing a \", quote and comma","102.20"
-@end example
-
-@code{OPTIONALLY}¤ò»ØÄꤹ¤ì¤Ð¡¢@code{ENCLOSED BY}ʸ»ú¤Ï¡¢ @code{CHAR}¥Õ¥£¡¼¥ë¥É¤È@code{VARCHAR}¥Õ¥£¡¼¥ë¥É¤Î¤ß°Ï¤à¤Î¤Ë»ÈÍѤµ¤ì¤Þ¤¹:
-
-@example
-1,"a string",100.20
-2,"a string containing a , comma",102.20
-3,"a string containing a \" quote",102.20
-4,"a string containing a \", quote and comma",102.20
-@end example
-
-¥Õ¥£¡¼¥ë¥ÉÃͤÎÃæ¤Ë¤ª¤±¤ë@code{ENCLOSED BY}ʸ»ú¤Î½Ð¸½¤Ï¡¢@code{ESCAPED BY}ʸ»ú¤ò¤½¤ÎÁ°¤ËÃÖ¤¯¤³¤È¤Ë¤è¤ê¥¨¥¹¥±¡¼¥×¤µ¤ì¤ë¤³¤È¤ËÃí°Õ¤·¤Æ²¼¤µ¤¤¡£@code{ESCAPED BY}Ãͤ˶õ¤ò»ØÄꤹ¤ë¤È¡¢@code{LOAD DATA INFILE}¤Ë¤è¤êÀµ¤·¤¯Æɤ߹þ¤á¤Ê¤¤½ÐÎϤòÀ¸À®¤¹¤ë¤Ç¤·¤ç¤¦¡£Î㤨¤Ð¡¢¤³¤Î¤è¤¦¤Ë¥¨¥¹¥±¡¼¥×ʸ»ú¤ò¶õ¤Ë¤·¤¿¾ì¹ç¡¢°Ê²¼¤Ë¼¨¤¹¤è¤¦¤Ê½ÐÎϤȤʤê¤Þ¤¹¡££´¹ÔÌܤΣ²¤ÄÌܤΥե£¡¼¥ë¥É¤Ë¡¢(¸í¤Ã¤Æ)¥Õ¥£¡¼¥ë¥É¤ò¶èÀڤ뤫¤Î¤è¤¦¤Ê¥¯¥©¡¼¥È¤Ë³¤¯¥³¥ó¥Þ¤ò´Þ¤ó¤Ç¤¤¤ë¤³¤È¤ËÃí»ë¤·¤Æ²¼¤µ¤¤:
-
-@example
-1,"a string",100.20
-2,"a string containing a , comma",102.20
-3,"a string containing a " quote",102.20
-4,"a string containing a ", quote and comma",102.20
-@end example
-
-ÆþÎϤˤª¤¤¤Æ¡¢@code{ENCLOSED BY}ʸ»ú¤¬»ØÄꤵ¤ì¤Æ¤ª¤ê¡¢¤½¤ì¤¬¥Õ¥£¡¼¥ë¥ÉÃͤÎξü¤Ë¸½¤ì¤¿¾ì¹ç¡¢¤½¤Îʸ»ú¤Ï¼è¤êµî¤é¤ì¤Þ¤¹¡£(¤³¤ì¤Ï¡¢@code{OPTIONALLY}¤¬»ØÄꤵ¤ì¤¿¤«¤É¤¦¤«¤Ë¹´¤é¤º¡¢Åö¤Æ¤Ï¤Þ¤ê¤Þ¤¹;@code{OPTIONALLY}¤ÏÆþÎϲòÀϤˤϸú²Ì¤¬¤¢¤ê¤Þ¤»¤ó¡£)
- @code{ESCAPED BY}ʸ»ú¤òÁ°ÃÖ¤­¤µ¤ì¤¿@code{ENCLOSED BY}ʸ»ú¤Î½Ð¸½¤Ï¡¢¸½ºß¤Î¥Õ¥£¡¼¥ë¥ÉÃͤΰìÉô¤È¤·¤Æ½èÍý¤µ¤ì¤Þ¤¹¡£¶ñÂÎŪ¤Ë¤Ï¡¢¤¢¤ë¥Õ¥£¡¼¥ë¥É¤¬¤½¤ì¼«¿È¡¢¤¿@code{ENCLOSED BY}ʸ»ú¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢¥Õ¥£¡¼¥ë¥É¤é¤ÎÆâÉô¤ÇȯÀ¸¤¹¤ë£²½Å¤Î@code{ENCLOSED BY}ʸ»ú¤Ï¡¢Ã±°ì¤Î@code{ENCLOSED BY}ʸ»ú¤È¤·¤Æ½èÍý¤µ¤ì¤Þ¤¹¡£
- Î㤨¤Ð¡¢@code{ENCLOSED BY '"'}¤¬»ØÄꤵ¤ì¤ë¤È¡¢°úÍÑÉä¤Ï°Ê²¼¤Î¤è¤¦¤ËÁàºî¤µ¤ì¤Þ¤¹:
-
-@example
-"The ""BIG"" boss" -> The "BIG" boss
-The "BIG" boss -> The "BIG" boss
-The ""BIG"" boss -> The ""BIG"" boss
-@end example
-
-@code{FIELDS ESCAPED BY}¤Ï¡¢Æüìʸ»ú¤ò¤É¤Î¤è¤¦¤Ë½ñ¤­¹þ¤ó¤À¤êÆɤ߹þ¤ó¤À¤ê¤¹¤ë¤«¤òÀ©¸æ¤·¤Þ¤¹¡£
- @code{FIELDS ESCAPED BY}ʸ»ú¤¬¶õ¤Ç¤Ê¤¤¾ì¹ç¡¢½ÐÎϤˤª¤¤¤Æ¼¡¤Î¤è¤¦¤Êʸ»ú(ʸ»úÎó)¤Î¥×¥ê¥Õ¥£¥Ã¥¯¥¹¤Ë»ÈÍѤµ¤ì¤Þ¤¹:
-@itemize @bullet
-@item
-@code{FIELDS ESCAPED BY}ʸ»ú
-@item
-@code{FIELDS [OPTIONALLY] ENCLOSED BY}ʸ»ú
-@item
-@code{FIELDS TERMINATED BY}ÃͤÈ@code{LINES TERMINATED BY}Ãͤκǽé¤Îʸ»ú
-@item
-ASCII 0 (¥¨¥¹¥±¡¼¥×ʸ»ú¤Î¸å¤Ë³¤¤¤Æ¼ÂºÝ¤Ë½ñ¤«¤ì¤ëʸ»ú¤ÏASCII @code{'0'}¤Ç¡¢'¥¼¥íÃÍ'¥Ð¥¤¥È¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó)
-@end itemize
-
-@code{FIELDS ESCAPED BY}ʸ»ú¤¬¶õ¤Ç¤¢¤ì¤Ð¡¢¤É¤Îʸ»ú¤â¥¨¥¹¥±¡¼¥×¤µ¤ì¤Þ¤»¤ó¡£
-Æäˡ¢¥Õ¥£¡¼¥ë¥ÉÃͤ¬¾å¤Ë¼¨¤·¤¿Ê¸»ú¤ò´Þ¤ó¤Ç¤¤¤ë¤Ê¤é¤Ð¡¢¥¨¥¹¥±¡¼¥×ʸ»ú¤Ë¶õ¤ò»ØÄꤹ¤ë¤Î¤Ï¤¢¤Þ¤êÎɤ¤¹Í¤¨¤È¤Ï¸À¤¨¤Ê¤¤¤Ç¤·¤ç¤¦¡£
-
-ÆþÎϤˤª¤¤¤Æ¡¢@code{FIELDS ESCAPED BY}ʸ»ú¤¬¶õ¤Ç¤Ê¤¤¾ì¹ç¡¢¤³¤Îʸ»ú¤Î½Ð¸½¤Ï¼è¤êµî¤é¤ì¡¢¸å³¤Îʸ»ú¤Ï¥Õ¥£¡¼¥ë¥ÉÃͤΰìÉô¤È¤·¤Æ¤½¤Î¤Þ¤Þ¼õ¤±¼è¤é¤ì¤Þ¤¹¡£
-Îã³°¤Ï¡¢¥¨¥¹¥±¡¼¥×¤µ¤ì¤¿@samp{0}¤ä@samp{N}¤Ç¤¹(Î㤨¤Ð¡¢¥¨¥¹¥±¡¼¥×ʸ»ú¤¬@samp{\}¤Ç¤¢¤ë»þ¤Î@code{\0}¤ä@code{\N})¡£
- ¤³¤ì¤é¤Î¥·¡¼¥±¥ó¥¹¤Ï¡¢ASCII 0('¥¼¥íÃÍ'¥Ð¥¤¥È) ¡¢@code{NULL}¤È¤·¤Æ½èÍý¤µ¤ì¤Þ¤¹¡£@code{NULL}Áàºî¤Îµ¬Â§¤Ï²¼¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£
-
-@samp{\}-escape syntax¤Ë´Ø¤¹¤ë¤³¤ì°Ê³°¤Î¾ðÊó¤Ï¡¢@ref{Literals}»²¾È¡£
-
-¥Õ¥£¡¼¥ë¥É¤È¥ì¥³¡¼¥ÉÁàºî¥ª¥×¥·¥ç¥ó¤¬³Î¼Â¤ËÁê¸ßºîÍѤ¹¤ë»öÎã:
-
-@itemize @bullet
-@item
-@code{LINES TERMINATED BY}¤¬¶õʸ»úÎó¤Ç@code{FIELDS TERMINATED BY}¤¬¶õ¤Ç¤Ê¤¤¾ì¹ç¡¢³Æ¥ì¥³¡¼¥É¤â¤Þ¤¿@code{FIELDS TERMINATED BY}¤Ç½ª¤é¤»¤é¤ì¤Þ¤¹¡£
-
-@item
-@code{FIELDS TERMINATED BY}¤È@code{FIELDS ENCLOSED BY}Ãͤ¬Î¾Êý¤È¤â¶õ(@code{''})¤Î»þ¡¢(¶èÀÚ¤é¤ì¤Ê¤¤)¸ÇÄêĹ¹Ô¥Õ¥©¡¼¥Þ¥Ã¥È¤¬»ÈÍѤµ¤ì¤Þ¤¹¡£
-¸ÇÄêĹ¹Ô¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤Ï¡¢¥Õ¥£¡¼¥ë¥É´Ö¤Ë¶èÀÚ¤êʸ»úÎ󤬻ÈÍѤµ¤ì¤Þ¤»¤ó¡£
-¤½¤ÎÂå¤ï¤ê¡¢¥Õ¥£¡¼¥ë¥ÉÃͤϡ¢¥Õ¥£¡¼¥ë¥É¤Î``ɽ¼¨''Éý¤ò»È¤Ã¤Æ½ñ¤­¹þ¤Þ¤ì¤¿¤ê¡¢Æɤ߹þ¤Þ¤ì¤Þ¤¹¡£
-Î㤨¤Ð¡¢¤¢¤ë¥Õ¥£¡¼¥ë¥É¤¬@code{INT(7)}¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¥Õ¥£¡¼¥ë¥É¤ÎÃͤÏ7ʸ»ú¤Î·å¤ò»È¤Ã¤Æ½ñ¤­¹þ¤Þ¤ì¤Þ¤¹¡£
-ÆþÎϤˤª¤¤¤Æ¥Õ¥£¡¼¥ë¥É¤Ï¡¢£·Ê¸»ú¤ÎÆɤ߹þ¤ß¤Ë¤è¤êÆÀ¤é¤ì¤Þ¤¹¡£
-¸ÇÄêĹ¹Ô¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¤Þ¤¿¡¢@code{NULL}ÃͤÎÁàºî¤Ë¹¥¤ó¤ÇÍѤ¤¤é¤ì¤Þ¤¹;²¼¤ò»²¾È¤Î¤³¤È¡£
-Ãí°Õ: ¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¥»¥Ã¥È¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¤Ï¸ÇÄêĹ¥Õ¥©¡¼¥Þ¥Ã¥È¤ÏƯ¤­¤Þ
-¤»¤ó¡£
-@end itemize
-
-@code{FIELDS}¤È@code{LINES}¥ª¥×¥·¥ç¥ó¤Ë¤è¤ë@code{NULL}ÃͤοÍͤʼ谷¤¤:
-
-@itemize @bullet
-@item
-@code{FIELDS}¤È@code{LINES}¤Î½é´üÃͤΤ¿¤á¤Ë¡¢½ÐÎÏ»þ¤Ë@code{NULL}¤Ï@code{\N}¤È¤·¤Æ½ñ¤­¹þ¤Þ¤ì¡¢ÆþÎÏ»þ¤Ë@code{\N}¤Ï@code{NULL}¤È¤·¤ÆÆɤ߹þ¤Þ¤ì¤Þ¤¹(ÅöÁ³¤Î¤³¤È¤Ê¤¬¤é¡¢@code{ESCAPED BY}ʸ»ú¤Ï@samp{\}¤È¤·¤Þ¤¹)¡£
-
-@item
-@code{FIELDS ENCLOSED BY}¤¬¶õ¤Ç̵¤¤»þ¡¢Äê¿ô@code{NULL}¤Î¥Õ¥£¡¼¥ë¥ÉÃͤÏ@code{NULL}ÃͤȤ·¤ÆÆɤ߹þ¤Þ¤ì¤Þ¤¹(¤³¤ì¤Ï¡¢Ê¸»úÎó@code{'NULL'}¤È¤·¤ÆÆɤ߹þ¤Þ¤ì¤ë@code{FIELDS ENCLOSED BY}ʸ»úÎó¤Ç°Ï¤Þ¤ì¤¿@code{NULL}¤È¤Ï°Û¤Ê¤ê¤Þ¤¹)¡£
-
-@item
-@code{FIELDS ESCAPED BY}¤¬¶õ¤Î»þ¡¢@code{NULL}¤Ï@code{NULL}¤È¤·¤Æ½ñ¤­¹þ¤Þ¤ì¤Þ¤¹¡£
-
-@item
-¸ÇÄêĹ¹Ô¥Õ¥©¡¼¥Þ¥Ã¥È(@code{FIELDS TERMINATED BY}¤È@code{FIELDS ENCLOSED BY}¤¬¤¤¤º¤ì¤â¶õ¤Î¾ì¹ç¤Ëµ¯¤³¤ê¤Þ¤¹)¤Ë¤ª¤¤¤Æ¡¢@code{NULL}¤Ï¡¢¶õÇòʸ»úÎó¤È¤·¤Æ½ñ¤­¹þ¤Þ¤ì¤Þ¤¹¡£
-¤³¤ì¤Ï¡¢¥Õ¥¡¥¤¥ëÆâ¤Ç¤Ï¡¢@code{NULL}ÃͤȶõÇòÃͤθ«Ê¬¤±¤¬¤Ä¤«¤Ê¤¤¤È¤¤¤¦¤³¤È¤ò¼¨¤·¤Æ¤¤¤ë¤³¤È¤ËÃí°Õ¤·¤Æ²¼¤µ¤¤¡£¥Õ¥¡¥¤¥ë¤«¤é¥Ç¡¼¥¿¤òÆɤßÌ᤹»þ¤Ëξ¼Ô¤ò¶èÊ̤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¾ì¹ç¡¢¸ÇÄêĹ¹Ô¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-@end itemize
-
-¥­¡¼¥ï¡¼¥É@code{REPLACE}¤È@code{IGNORE}¤Ï¡¢¥æ¥Ë¡¼¥¯¡¦¥­¡¼Ãͤ¬½ÅÊ£¤¹¤ë¥ì¥³¡¼¥É¤¬Â¸ºß¤¹¤ëÆþÎϥ쥳¡¼¥É¤Î¼è°·¤¤¤òÀ©¸æ¤·¤Þ¤¹¡£
-@code{REPLACE}¤ò»ØÄꤷ¤¿¾ì¹ç¡¢Æ±¤¸¥æ¥Ë¡¼¥¯¡¦¥­¡¼Ãͤò»ý¤Ä¿·¤·¤¤¥ì¥³¡¼¥É¤Ï¡¢´û¤Ë¸ºß¤¹¤ëƱ¤¸¥æ¥Ë¡¼¥¯¡¦¥­¡¼¤Ç¤¢¤ë¥ì¥³¡¼¥É¤òÃÖ¤­´¹¤¨¤Þ¤¹¡£
-@code{IGNORE}¤ò»ØÄꤷ¤¿¾ì¹ç¡¢´û¤Ë¸ºß¤¹¤ë¥ì¥³¡¼¥É¤Î¥æ¥Ë¡¼¥¯¡¦¥­¡¼ÃͤȽÅÊ£¤¹¤ëÆþÎϥ쥳¡¼¥É¤Ï¡¢¥¹¥­¥Ã¥×¤µ¤ì¤Þ¤¹¡£
-¤¤¤º¤ì¤Î¥ª¥×¥·¥ç¥ó¤â»ØÄꤷ¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢½ÅÊ£¥­¡¼¤¬È¯¸«¤µ¤ì¤¿»þÅÀ¤Ç¥¨¥é¡¼¤¬È¯À¸¤·¡¢¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Î»Ä¤ê¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£
-
-@code{LOAD DATA INFILE}¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤Ê¤¤¥±¡¼¥¹:
-@itemize @bullet
-
-@item
-¸ÇÄêĹ¹Ô(@code{FIELDS TERMINATED BY}¤È@code{FIELDS ENCLOSED BY}¤ÎξÊý¤¬¶õ)¤È@code{BLOB}¥Õ¥£¡¼¥ë¥É¡£
-@item
-¤¢¤ë¥»¥Ñ¥ì¡¼¥¿¤ò¾¤ÈƱ¤¸¤«¤â¤·¤¯¤Ï¾¤Î¥×¥ê¥Õ¥£¥Ã¥¯¥¹¤È¤·¤¿¾ì¹ç¡¢@code{LOAD DATA INFILE}¤Ï¡¢Àµ¤·¤¤ÆþÎϽèÍý¤¬¤Ç¤­¤Ê¤¤¤Ç¤·¤ç¤¦¡£
-Î㤨¤Ð¡¢°Ê²¼¤Î@code{FIELDS}Àá¤ÏÌäÂê¤Î¸¶°ø¤È¤Ê¤ê¤Þ¤¹:
-
-@example
-FIELDS TERMINATED BY '"' ENCLOSED BY '"'
-@end example
-
-@item
-@code{FIELDS ESCAPED BY}¤¬¶õ¤Ç¡¢¥Õ¥£¡¼¥ë¥ÉÃͤˡ¢@code{FIELDS ENCLOSED BY}Ãͤä@code{LINES TERMINATED BY}Ãͤθå¤Ë@code{FIELDS TERMINATED BY}Ãͤ¬¤¯¤ë¤è¤¦¤Ê¤â¤Î¤ò´Þ¤à¾ì¹ç¡¢¥Õ¥£¡¼¥ë¥É¤ä¹Ô¤ÎÆɤ߹þ¤ß¤¬Áá¤á¤ËÂǤÁÀÚ¤é¤ì¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
-¤³¤ì¤Ï¡¢@code{LOAD DATA INFILE}¤¬¡¢¥Õ¥£¡¼¥ë¥É¤ä¥ì¥³¡¼¥É¤Î½ªÎ»°ÌÃÖ¤òÀµ¤·¤¯·è¤á¤é¤ì¤Ê¤¤¤³¤È¤Ë¤è¤êȯÀ¸¤·¤Þ¤¹¡£
-@end itemize
-
-¼¡¤ÎÎã¤Ï¡¢@code{persondata}¥Æ¡¼¥Ö¥ë¤ÎÁ´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤òÆɤ߹þ¤ß¤Þ¤¹:
-
-@example
-mysql> LOAD DATA INFILE 'persondata.txt' INTO TABLE persondata;
-@end example
-
-¥Õ¥£¡¼¥ë¥É¥ê¥¹¥È¤¬»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó¤«¤é¡¢@code{LOAD DATA INFILE}¤Ï¡¢ÆþÎϥ쥳¡¼¥É¤¬¥Æ¡¼¥Ö¥ë¤Î¤½¤ì¤¾¤ì¤Î¥Õ¥£¡¼¥ë¥É¤ò´Þ¤à¤â¤Î¤ÈÁÛÄꤷ¤Þ¤¹¡£
-@code{FIELDS}¤È@code{LINES}¤Î½é´üÃͤ¬»ÈÍѤµ¤ì¤Þ¤¹¡£
-
-¥Æ¡¼¥Ö¥ë¤Î°ìÉô¤Î¥Õ¥£¡¼¥ë¥É¤Î¤ßÆɤ߹þ¤ß¤¿¤¤¾ì¹ç¡¢¥Õ¥£¡¼¥ë¥É¥ê¥¹¥È¤ò»ØÄꤷ¤Þ¤¹:
-
-@example
-mysql> LOAD DATA INFILE 'persondata.txt'
- INTO TABLE persondata (col1,col2,...);
-@end example
-
-¥Æ¡¼¥Ö¥ëÆâ¤Î¥Õ¥£¡¼¥ë¥É½ç¤ÈÆþÎÏ¥Õ¥¡¥¤¥ë¤Î¥Õ¥£¡¼¥ë¥É½ç¤¬°Û¤Ê¤ë¾ì¹ç¤Ë¤â¡¢@strong{MySQL}¤Ë¥Æ¡¼¥Ö¥ë¤Î¥Õ¥£¡¼¥ë¥É¤ÈÆþÎÏ¥Õ¥£¡¼¥ë¥É¤ÎÂбþ¤ò¶µ¤¨¤ë¤¿¤á¤Ë¡¢¥Õ¥£¡¼¥ë¥É¥ê¥¹¥È¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-
-ÆþÎϥ쥳¡¼¥É¤Î¥Õ¥£¡¼¥ë¥É¿ô¤ÎÊý¤¬¾¯¤Ê¤¤¾ì¹ç¡¢ÆþÎÏ¥Õ¥£¡¼¥ë¥ÉÃͤ¬Í¿¤¨¤é¤ì¤Ê¤¤¥Õ¥£¡¼¥ë¥É¤Ï¡¢½é´üÃͤ¬ÀßÄꤵ¤ì¤Þ¤¹¡£
-½é´üÃͤγäÅö¤Æ¤Ë¤Ä¤¤¤Æ¤Ï¡¢@ref{CREATE TABLE, , @code{CREATE TABLE}}.
-¤Ç½Ò¤Ù¤é¤ì¤Æ¤¤¤Þ¤¹¡£
-
-¶õ¤Î¥Õ¥£¡¼¥ë¥ÉÃͤÏÊÑ´¹¤µ¤ì¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-ʸ»ú·¿¤Î¾ì¹ç¡¢ ¥Õ¥£¡¼¥ë¥É¤ÎÃͤ϶õʸ»ú¤Ë¥»¥Ã¥È¤µ¤ì¤Þ¤¹¡£
-
-@item
-¿ôÃÍ·¿¤Î¾ì¹ç¡¢¥Õ¥£¡¼¥ë¥É¤ÎÃÍ¤Ï @code{0} ¤Ë¥»¥Ã¥È¤µ¤ì¤Þ¤¹¡£
-
-@item
-ÆüÉդȻþ¹ï¤Î·¿¤Î¾ì¹ç¡¢ ¥Õ¥£¡¼¥ë¥É¤ÎÃÍ¤Ï ``zero'' ¤Î°ÕÌ£¤¹¤ëÃͤ¬¥»¥Ã¥È¤µ¤ì¤Þ¤¹¡£
-@xref{Date and time types}.
-@end itemize
-
-@code{TIMESTAMP} ¥Õ¥£¡¼¥ë¥É¤Ï¡¢¥Õ¥£¡¼¥ë¥ÉÃÍ¤Ë @code{NULL} Ãͤ¬»ØÄꤵ¤ì¤Æ¤¤¤¿¾ì¹ç¤â¤·¤¯¤Ï¡¢
-¥Õ¥£¡¼¥ë¥É¥ê¥¹¥È¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë»þ¤Ë @code{TIMESTAMP} ¥Õ¥£¡¼¥ë¥É¤¬¤½¤Î¥ê¥¹¥È¤«¤é½ü³°¤µ¤ì¤Æ¤¤¤¿¾ì¹ç
-(ºÇ½é¤Î@code{TIMESTAMP}¥Õ¥£¡¼¥ë¥É¤Î¤ß)¡¢¸½ºß»þ¹ï¤¬ÀßÄꤵ¤ì¤ë¤À¤±¤Ç¤¹¡£
-
-ÆþÎϥ쥳¡¼¥É¤Î¥Õ¥£¡¼¥ë¥É¿ô¤ÎÊý¤¬Â¿¤¤¾ì¹ç¡¢Í¾Ê¬¤Ê¥Õ¥£¡¼¥ë¥É¤Ï̵»ë¤µ¤ì¡¢·Ù¹ð¤Î¿ô¤¬Áý¤ä¤µ¤ì¤Þ¤¹¡£
-
-@code{LOAD DATA INFILE}¤ÏÁ´¤Æ¤ÎÆþÎϤòʸ»úÎó¤Èʸ»úÎó¤È¤ß¤Ê¤¹¤³¤È¤«¤é¡¢@code{INSERT}¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ç¤Ç¤­¤ë¤è¤¦¤Ê@code{ENUM}¥Õ¥£¡¼¥ë¥É¤ä@code{SET}¥Õ¥£¡¼¥ë¥É¤Ø¤Î¿ôÃͤλØÄê¤Ï¤Ç¤­¤Þ¤»¤ó¡£Á´¤Æ¤Î@code{ENUM}µÚ¤Ó@code{SET}ÃͤÏʸ»úÎó¤È¤·¤ÆÍ¿¤¨¤é¤ì¤Ê¤±¤ì¤Ð¤¤¤±¤Þ¤»¤ó¡ª
-
-@findex mysql_info()
-@code{LOAD DATA INFILE}¥¯¥¨¥ê¤Î½ªÎ»»þ¡¢¥¯¥¨¥ê¤Î¾ðÊó¤òÆÀ¤ë¤¿¤á¤ËC API´Ø¿ô@code{mysql_info()}¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¾ðÊó¤Î½ñ¼°¤Ï°Ê²¼¤Ë¼¨¤¹¤è¤¦¤Ê¤â¤Î¤Ç¤¹:
-
-@example
-Records: 1 Deleted: 0 Skipped: 0 Warnings: 0
-@end example
-
-@code{LOAD DATA INFILE} ¤¬¡¢ÆþÎϥ쥳¡¼¥É¤Î¥Õ¥£¡¼¥ë¥É¿ô¤Î²áÉÔ­¤¬¤¢¤Ã¤¿»þ¤Ë¤â
-·Ù¹ð¤ò°ú¤­µ¯¤³¤¹»ö¤ò½ü¤±¤Ð¡¢@code{INSERT} ¥¹¥Æ¡¼¥È¥á¥ó¥È
-(@xref{INSERT, , @code{INSERT}}. ) ¤Ë¤è¤êÃͤ¬ÁÞÆþ¤µ¤ì¤ë»þ¤Ë
-·Ù¹ð¤¬È¯À¸¤¹¤ë¤Î¤ÈƱ¤¸¾õ¶·²¼¤Ç¡¢·Ù¹ð¤¬È¯À¸¤·¤Þ¤¹¡£
-·Ù¹ð¤Ï¤É¤³¤Ë¤âÊݸ¤µ¤ì¤Þ¤»¤ó¡¨ ·Ù¹ð¤Î¿ô¤ÏÁ´¤Æ¤¦¤Þ¤¯¤¤¤Ã¤¿¾ì¹ç¤Ë¤À¤±
-»ÈÍѤǤ­¤Þ¤¹¡£ ¤â¤··Ù¹ð¤òÃΤꤿ¤¤¡¢¤½¤Î·Ù¹ð¤ÎÍýͳ¤òÃΤꤿ¤¤¤Î¤Ê¤é¡¢
-°ì¤ÄÊýË¡¤¬¤¢¤ê¤Þ¤¹¡£ @code{SELECT ... INTO OUTFILE} ¤ò»ÈÍѤ·¤Æ
-¾¤Î¥Õ¥¡¥¤¥ë¤ËÍî¤È¤·¡¢¥ª¥ê¥¸¥Ê¥ë¤Î¥Õ¥¡¥¤¥ë¤ÈÈæ¤Ù¤Þ¤¹¡£
-
-@code{INSERT}¤ÈÈæ³Ó¤·¤¿@code{LOAD DATA INFILE}¤Î¸úΨ¤ä@code{LOAD DATA INFILE}¤Î¹â®²½¤Ë¤Ä¤¤¤Æ¤Î¤è¤ê¾Ü¤·¤¤¾ðÊó¤Ï¡¢@xref{Insert speed}¤ò»²¾È¤Î¤³¤È¡£
-
-@findex UPDATE
-@node UPDATE, USE, LOAD DATA, Reference
-@section @code{UPDATE} ¹½Ê¸
-
-@example
-UPDATE [LOW_PRIORITY] [IGNORE] tbl_name SET col_name1=expr1,col_name2=expr2,...
- [WHERE where_definition] [LIMIT #]
-@end example
-
-@code{UPDATE} ¤Ï¥Æ¡¼¥Ö¥ë¤Ë¸ºß¤¹¤ë¥ì¥³¡¼¥É¤Î¥Õ¥£¡¼¥ë¥É¤ò¡¢¿·¤·¤¤Ãͤ˹¹¿·¤·¤Þ¤¹¡£
-@code{SET} Àá¤Ï¤É¤Î¥Õ¥£¡¼¥ë¥É¤ò¤É¤¦¤¤¤Ã¤¿Ãͤˤ¹¤Ù¤­¤«¤ò¼¨¤·¤Þ¤¹¡£
-@code{WHERE} À᤬Ϳ¤¨¤é¤ì¤¿¾ì¹ç¡¢¹¹¿·¤¹¤Ù¤­¥ì¥³¡¼¥É¤òÆÃÄꤹ¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
-¤½¤ì°Ê³°¤Ï¡¢Á´¤Æ¤Î¥ì¥³¡¼¥É¤ò¹¹¿·¤·¤Þ¤¹¡£
-
-@code{LOW_PRIORITY} ¥­¡¼¥ï¡¼¥É¤ò»ØÄꤷ¤¿¾ì¹ç¡¢@code{UPDATE} ¤Î¼Â¹Ô¤Ï¡¢
-¥Æ¡¼¥Ö¥ë¤òÆɤó¤Ç¤¤¤ë¥¯¥é¥¤¥¢¥ó¥È¤¬¤Ê¤¯¤Ê¤ë¤Þ¤Ç¡¢Ã٤餵¤ì¤Þ¤¹¡£
-
-@code{IGNORE} ¥­¡¼¥ï¡¼¥É¤ò»ØÄꤷ¤¿¾ì¹ç¤Ï¡¢update ʸ¤Ï¡¢
-update Ãæ¤ËÆó½Å¥­¡¼¤Î¥¨¥é¡¼¤òÆÀ¤¿¤È¤·¤Æ¤â¡¢°Û¾ï½ªÎ»¤·¤Þ¤»¤ó¡£
-Rows that would cause conflicts will not be updated.
-
-ɽµ­Ãæ¤Î @code{tbl_name} ¤«¤é¤Î¥Õ¥£¡¼¥ë¥É¤ò¥¢¥¯¥»¥¹¤¹¤ë¤È¡¢@code{UPDATE}
-¤Ï¸½ºß¤Î¥Õ¥£¡¼¥ë¥ÉÃͤò»ÈÍѤ·¤Þ¤¹¡£Î㤨¤Ð¡¢¼¡¤Î¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ï
-@code{age} ¥Õ¥£¡¼¥ë¥É¤Ë¤½¤Î¸½ºßÃͤè¤ê£±Â礭¤¤ÃͤòÀßÄꤷ¤Þ¤¹:
-
-@example
-mysql> UPDATE persondata SET age=age+1;
-@end example
-
-@code{UPDATE} ¤Ïº¸¤«¤é±¦¤Ëɾ²Á¤µ¤ì¤Þ¤¹¡£Î㤨¤Ð¡¢°Ê²¼¤Îʸ¤Ï @code{age} ¥Õ¥£¡¼¥ë¥É¤ò
-2Çܤˤ·¡¢¤½¤Î¤¢¤È1Áý¤ä¤·¤Þ¤¹¡§
-
-@example
-mysql> UPDATE persondata SET age=age*2, age=age+1;
-@end example
-
-¤â¤·¥Õ¥£¡¼¥ë¥É¤Ë¸½ºß¤â¤Ã¤Æ¤¤¤ëÃͤò»ØÄꤷ¤¿¾ì¹ç¡¢@strong{MySQL} ¤Ï¤½¤ì¤òÄÌÃΤ·¡¢
-ÃͤϹ¹¿·¤·¤Þ¤»¤ó¡£
-
-@findex mysql_info()
-@code{UPDATE} ¤ÏÊѹ¹¤µ¤ì¤¿¥ì¥³¡¼¥É¿ô¤òÊÖ¤·¤Þ¤¹¡£
-@strong{MySQL} 3.22 °Ê¾å¤Ç¤Ï¡¢C API ´Ø¿ô @code{mysql_info()} ¤¬
-¥Þ¥Ã¥Á¤·¹¹¿·¤µ¤ì¤¿¥ì¥³¡¼¥É¿ô¤òÊÖ¤·¤Þ¤¹¡£¤Þ¤¿ @code{UPDATE} Ãæ¤Ëµ¯¤­¤¿
-¥ï¡¼¥Ë¥ó¥°¤Î¿ô¤âÊÖ¤·¤Þ¤¹¡£
-
-@strong{MySQL} 3.23 ¤Ç¤Ï¡¢ @code{LIMIT #} ¤Ç»ØÄꤷ¤¿¿ô¤À¤±¥ì¥³¡¼¥É¤òÊѹ¹
-¤Ç¤­¤Þ¤¹¡£
-
-@findex USE
-@node USE, FLUSH, UPDATE, Reference
-@section @code{USE} ¹½Ê¸
-
-@example
-USE db_name
-@end example
-
-@code{USE db_name} ¹½Ê¸¤Ï¡¢ @strong{MySQL} ¤Ë @code{db_name} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò
-¤³¤Î¸å¤Î¥¯¥¨¥ê¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤¹¤ë¤è¤¦¤Ë»Ø¼¨¤·¤Þ¤¹¡£
-»ØÄꤵ¤ì¤¿¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ï¡¢¥»¥Ã¥·¥ç¥ó¤ÎºÇ¸å¤Þ¤Ç¡¢¤¢¤ë¤¤¤Ï¡¢Â¾¤Î @code{USE} ¹½Ê¸
-¤¬È¯¹Ô¤µ¤ì¤ë¤Þ¤Ç»Ä¤ê¤Þ¤¹¡§
-
-@example
-mysql> USE db1;
-mysql> SELECT count(*) FROM mytable; # selects from db1.mytable
-mysql> USE db2;
-mysql> SELECT count(*) FROM mytable; # selects from db2.mytable
-@end example
-
-@code{USE} ¹½Ê¸¤ÇÆÃÄê¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¥«¥ì¥ó¥È¤Ë¤·¤Æ¤â¡¢
-¾¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Æ¡¼¥Ö¥ë¤«¤é¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤ò˸¤²¤Þ¤»¤ó¡£
-°Ê²¼¤Ï @code{db1} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î @code{author} ¥Æ¡¼¥Ö¥ë¤È¡¢
- @code{db2} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î @code{editor} ¥Æ¡¼¥Ö¥ë¤Ë¥¢¥¯¥»¥¹¤¹¤ëÎã¤Ç¤¹¡§
-
-@example
-mysql> USE db1;
-mysql> SELECT author_name,editor_name FROM author,db2.editor
- WHERE author.editor_id = db2.editor.editor_id;
-@end example
-
-@cindex Sybase compatibility
-@cindex Compatibility, with Sybase
-@code{USE} ¹½Ê¸¤Ï Sybase ¤Î¸ß´¹¤Î¤¿¤á¤ËÄ󶡤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-
-@cindex @code{mysqladmin}
-@findex FLUSH
-@node FLUSH, KILL, USE, Reference
-@section @code{FLUSH} ¹½Ê¸ (¥­¥ã¥Ã¥·¥å¤Î¥¯¥ê¥¢)
-
-@example
-FLUSH flush_option [,flush_option]
-@end example
-
-@code{FLUSH} ¥³¥Þ¥ó¥É¤Ç @strong{MySQL} ¤¬»ÈÍѤ·¤Æ¤¤¤ëÆâÉô¥­¥ã¥Ã¥·¥å¤Î
-¤¤¤¯¤Ä¤«¤ò¤­¤ì¤¤¤Ë¾Ã¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@code{FLUSH} ¤ò¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢ @strong{reload} ¸¢¸Â¤¬¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-
-@code{flush_option} ¤Ë¤Ï°Ê²¼¤ÎÆâ°ì¤Ä¤¬»ØÄê¤Ç¤­¤Þ¤¹¡§
-
-@multitable @columnfractions .15 .85
-@item @code{HOSTS} @tab ¥Û¥¹¥È¥­¥ã¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤ò¶õ¤Ë¤·¤Þ¤¹¡£¤¢¤Ê¤¿¤Î¥Û¥¹¥È¤Î
-IP ¥¢¥É¥ì¥¹¤òÊѤ¨¤¿¤ê¡¢@code{Host ... is blocked} ¤È¤¤¤¦¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤¬
-½Ð¤ë¾ì¹ç¤Ï¥Û¥¹¥È¥Æ¡¼¥Ö¥ë¥­¥ã¥Ã¥·¥å¤ò°ìÅÙ¶õ¤Ë¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-¡Ê»ØÄꤷ¤¿¥Û¥¹¥È¤ËÂФ·¤Æ @code{max_connect_errors} °Ê¾å¤ÎÀܳ¥¨¥é¡¼¤¬½Ð¤ë¾ì¹ç¡¢
-@strong{MySQL} ¤Ï²¿¤«µ¯¤­¤¿¤È
-¿äÄꤷ¡¢¤½¤Î¥Û¥¹¥È¤«¤é¤Î¤¤¤«¤Ê¤ëÀܳÍ×µá¤âµñÈݤ·¤Þ¤¹¡£¥Û¥¹¥È¥Æ¡¼¥Ö¥ë¥­¥ã¥Ã¥·¥å¤Î¾Ãµî¤Ï¡¢
-ºÆ¤ÓÀܳ¤òµö¤¹¤è¤¦¤Ë¤·¤Þ¤¹¡£@xref{Blocked host}.¡Ë
-@code{mysqld} ¤ò
-@code{-O max_connection_errors=999999999} ³«»Ï¤·¡¢¤³¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò
-²óÈò¤Ç¤­¤Þ¤¹
-
-@item @code{LOGS} @tab ɸ½à¤Î¥í¥°¥Õ¥¡¥¤¥ë¤È¹¹¿·¥í¥°¥Õ¥¡¥¤¥ë¤ò
-°ìÅÙÊĤ¸¤ÆºÆ¤Ó³«¤­¤Þ¤¹¡£
-¤â¤·¹¹¿·¥í¥°¥Õ¥¡¥¤¥ë¤ò³ÈÄ¥»Ò̵¤·¤Ç»ØÄꤷ¤Æ¤¤¤ë¾ì¹ç¡¢¿·¤·¤¤¹¹¿·¥í¥°¥Õ¥¡¥¤¥ë¤Î
-³ÈÄ¥»Ò¤ÎÈÖ¹æ¤Ï¡¢°ì¤ÄÁ°¤Î¥Õ¥¡¥¤¥ë¤è¤ê 1 Áý¤ä¤·¤¿¿ô¤Ë¤Ê¤ê¤Þ¤¹¡£
-¥Õ¥¡¥¤¥ë̾¤Ë³ÈÄ¥¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢@strong{MySQL} ¤Ï¹¹¿·¥í¥°¥Õ¥¡¥¤¥ë¤òÊĤ¸¤Æ³«¤­¤Þ¤¹¡£
-@xref{Update log}.
-
-@item @code{PRIVILEGES} @tab @code{mysql} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Îµö²Ä¥Æ¡¼¥Ö¥ë¤«¤é¡¢
-¸¢¸Â¾ðÊó¤òºÆÆɹþ¤·¤Þ¤¹¡£
-
-@item @code{TABLES} @tab Á´¤Æ¤Î³«¤¤¤Æ¤¤¤ë¥Æ¡¼¥Ö¥ë¤òÊĤ¸¤Þ¤¹¡£
-
-@item @code{TABLES WITH READ LOCK} @tab Closes all open tables and locks all tables for read until one executes @code{UNLOCK TABLES}.
-
-@item @code{STATUS} @tab ¤Û¤È¤ó¤É¤Î¥¹¥Æ¡¼¥¿¥¹ÊÑ¿ô¤ò 0 ¤Ë¤·¤Þ¤¹¡£
-@end multitable
-
-¾å¤Ë¼¨¤·¤¿¥³¥Þ¥ó¥É¤Ï¡¢@code{mysqladmin} ¤ò»ÈÍѤ·¤Æ¤â¼Â¹Ô¤Ç¤­¤Þ¤¹¡£
-@code{mysqladmin} ¤Î°ú¿ô¤Ï¤½¤ì¤¾¤ì¡¢
-@code{flush-hosts}, @code{flush-logs}, @code{reload}, @code{flush-tables} ¤È
-¤Ê¤ê¤Þ¤¹¡£
-
-@code{FLUSH} ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢@strong{reload} ¸¢¸Â¤¬¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-
-@cindex @code{mysqladmin}
-@findex KILL
-@node KILL, SHOW, FLUSH, Reference
-@section @code{KILL} ¹½Ê¸
-
-@example
-KILL thread_id
-@end example
-
-@code{thread_id} ¤Ë¤Ï¡¢@code{mysqld} ¤ËÀܳ¤·¤ÆÁö¤Ã¤Æ¤¤¤ë¥¹¥ì¥Ã¥É¤Î ID ¤ò
-¶õÇò¤Ç¶èÀڤäƻØÄꤷ¤Þ¤¹¡£
-@code{SHOW PROCESSLIST} ¥³¥Þ¥ó¥É¤ÇÁö¤Ã¤Æ¤¤¤ë¥¹¥ì¥Ã¥É¤òÃΤ뤳¤È¤¬¤Ç¤­¡¢
- @code{KILL thread_id} ¥³¥Þ¥ó¥É¤Ç¥¹¥ì¥Ã¥É¤ò KILL ¤Ç¤­¤Þ¤¹¡£
-
-¤â¤· @strong{process} ¸¢¸Â¤¬¤¢¤ë¤Ê¤é¡¢Á´¤Æ¤Î¥¹¥ì¥Ã¥É¤ò³Îǧ¤·¡¢KILL ½ÐÍè¤Þ¤¹¡£
-¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢¼«Ê¬¤Î¥¹¥ì¥Ã¥É¤À¤±¤ò¡¢
-³Îǧ¤·¡¢KILL ¤¹¤ë»ö¤¬¤Ç¤­¤Þ¤¹¡£
-
-@code{mysqladmin processlist} ¤È @code{mysqladmin kill} ¤ò¥¹¥ì¥Ã¥É¤Î
-¸¡ºº¤È KILL ¤Ë»ÈÍѤǤ­¤Þ¤¹¡£
-
-@findex SHOW DATABASES
-@findex SHOW TABLES
-@findex SHOW COLUMNS
-@findex SHOW FIELDS
-@findex SHOW INDEX
-@findex SHOW KEYS
-@findex SHOW STATUS
-@findex SHOW VARIABLES
-@findex SHOW PROCESSLIST
-@findex SHOW TABLE STATUS
-@findex SHOW GRANTS
-@node SHOW, EXPLAIN, KILL, Reference
-@section @code{SHOW} ¹½Ê¸ (¥Æ¡¼¥Ö¥ë¤ä¥Õ¥£¡¼¥ë¥É¤Ê¤É¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÆÀ¤ë)
-
-@example
- SHOW DATABASES [LIKE wild]
-or SHOW TABLES [FROM db_name] [LIKE wild]
-or SHOW COLUMNS FROM tbl_name [FROM db_name] [LIKE wild]
-or SHOW INDEX FROM tbl_name [FROM db_name]
-or SHOW STATUS [LIKE wild]
-or SHOW VARIABLES [LIKE wild]
-or SHOW [FULL] PROCESSLIST
-or SHOW TABLE STATUS [FROM db_name] [LIKE wild]
-or SHOW GRANTS FOR user
-@end example
-
-@code{SHOW} ¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¡¢¥Æ¡¼¥Ö¥ë¡¢¥Õ¥£¡¼¥ë¥É¡¢¥µ¡¼¥Ð¡¼¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÍ¿¤¨¤Þ¤¹¡£
-@code{LIKE wild} ¤¬»ÈÍѤµ¤ì¤¿¾ì¹ç¡¢@code{wild} ʸ»úÎó¤ÏÄ̾ï¤Î SQL ¥ï¥¤¥ë¥É¥«¡¼¥É
- (@samp{%} ¤È @samp{_}) ¤Ç¤¹¡£
-
-@code{tbl_name FROM db_name} ¤ÎÂå¤ï¤ê¤Ë¡¢@code{db_name.tbl_name} ¤¬»ÈÍѤǤ­¤Þ¤¹¡£
-¤³¤ì¤éÆó¤Ä¤ÏƱ¤¸¤Ç¤¹¡§
-
-@example
-mysql> SHOW INDEX FROM mytable FROM mydb;
-mysql> SHOW INDEX FROM mydb.mytable;
-@end example
-
-@code{SHOW DATABASES} ¤Ï @strong{MySQL} ¥µ¡¼¥Ð¡¼¾å¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¼¨¤·¤Þ¤¹¡£
-@code{mysqlshow} ¥³¥Þ¥ó¥É¤Ç¤âƱ¤¸¾ðÊó¤¬ÆÀ¤é¤ì¤Þ¤¹¡£
-
-@code{SHOW TABLES} ¤Ï»ØÄꤵ¤ì¤¿¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Æ¡¼¥Ö¥ë¤ò°ìÍ÷ɽ¼¨¤·¤Þ¤¹¡£
-@code{mysqlshow db_name} ¥³¥Þ¥ó¥É¤Ç¤âƱ¤¸¾ðÊó¤¬ÆÀ¤é¤ì¤Þ¤¹¡£
-
-@strong{NOTE}: ¤â¤·¥æ¡¼¥¶¡¼¤Ë¥Æ¡¼¥Ö¥ë¤ËÂФ¹¤ë¸¢¸Â¤¬Ìµ¤¤¾ì¹ç¡¢
-¥Æ¡¼¥Ö¥ë¤Ï @code{SHOW TABLES} ¤ä @code{mysqlshow db_name} ¤ÎÍ×µá¤Ç
-ɽ¼¨¤µ¤ì¤Þ¤»¤ó¡£
-
-@code{SHOW COLUMNS} ¤ÏÍ¿¤¨¤é¤ì¤¿¥Æ¡¼¥Ö¥ë¤Î¥Õ¥£¡¼¥ë¥É¤òɽ¼¨¤·¤Þ¤¹¡£
-¤â¤·¤½¤Î¥Õ¥£¡¼¥ë¥É¤Î·¿¤¬¡¢¤¢¤Ê¤¿¤¬ @code{CREATE TABLE} ¹½Ê¸¼Â¹Ô»þ¤ËÍ¿¤¨¤¿¤â¤Î¤È
-°ã¤¦¾ì¹ç¤Ï¡¢ @strong{MySQL} ¤Ï¡¢¥Õ¥£¡¼¥ë¥É¤Î·¿¤ò¤È¤­¤ª¤êÊѹ¹¤¹¤ë¤³¤È¤¬
-¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-@xref{Silent column changes}.
-
-@code{DESCRIBE} ʸ¤Ï @code{SHOW COLUMNS} ¤È»÷¤¿¤è¤¦¤Ê¾ðÊó¤òÄ󶡤·¤Þ¤¹¡£
-@xref{DESCRIBE, , @code{DESCRIBE}}.
-
-@code{SHOW TABLE STATUS} (¥Ð¡¼¥¸¥ç¥ó 3.23 ¤Î¿·µ¡Ç½) ¤Ï @code{SHOW STATUS}
-¤Î¤è¤¦¤Ç¤¹¤¬¡¢¤½¤ì¤¾¤ì¤Î¥Æ¡¼¥Ö¥ë¤Ë¤Ä¤¤¤Æ¤è¤ê¿¤¯¤Î¾ðÊó¤òÄ󶡤·¤Þ¤¹¡£
-@code{mysqlshow --status db_name} ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ¤âƱ¤¸¤â¤Î¤¬ÆÀ¤é¤ì¤Þ¤¹¡£
-°Ê²¼¤Î¹àÌܤ¬Ê֤äƤ­¤Þ¤¹¡§
-
-@multitable @columnfractions .30 .70
-@item @strong{¹àÌÜ} @tab @strong{°ÕÌ£}
-@item @code{Name} @tab ¥Æ¡¼¥Ö¥ë̾
-@item @code{Type} @tab ¥Æ¡¼¥Ö¥ë¤Î¼ïÎà (BDB, ISAM, MyISAM or HEAP)
-@item @code{Row_format} @tab ¥ì¥³¡¼¥É¤ÎÊݸ·Á¼° (Fixed, Dynamic, or Compressed)
-@item @code{Rows} @tab ¥ì¥³¡¼¥É¿ô
-@item @code{Avg_row_length} @tab ¥ì¥³¡¼¥É¤ÎÊ¿¶ÑĹ
-@item @code{Data_length} @tab ¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤ÎÂ礭¤µ
-@item @code{Max_data_length} @tab ¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤ÎºÇÂçÃÍ
-@item @code{Index_length} @tab ¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¤ÎÂ礭¤µ
-@item @code{Data_free} @tab ³ä¤êÅö¤Æ¤é¤ì¤¿¤¬»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤¥Ð¥¤¥È¿ô
-@item @code{Auto_increment} @tab ¼¡¤Î autoincrement ÃÍ
-@item @code{Create_time} @tab ¥Æ¡¼¥Ö¥ëºîÀ®»þ¹ï
-@item @code{Update_time} @tab °ìÈֺǸå¤Ë¹¹¿·¤µ¤ì¤¿»þ¹ï
-@item @code{Check_time} @tab °ìÈֺǸå¤Ë¥Á¥§¥Ã¥¯¤µ¤ì¤¿»þ¹ï
-@item @code{Create_options} @tab @code{CREATE TABLE} ¤Ç»ÈÍѤµ¤ì¤¿³ÈÄ¥¥ª¥×¥·¥ç¥ó
-@item @code{Comment} @tab ¥Æ¡¼¥Ö¥ëºîÀ®»þ¤Ë¤Ä¤±¤é¤ì¤¿¥³¥á¥ó¥È (¤¢¤ë¤¤¤Ï¡¢¤Ê¤¼¤³¤Î¥Æ¡¼¥Ö¥ë¤Ë@strong{MySQL} ¤¬¥¢¥¯¥»¥¹¤Ç¤­¤Ê¤¤¤«¤Î¤¤¤¯¤Ä¤«¤Î¾ðÊó).
-@end multitable
-
-@code{SHOW FIELDS} ¤Ï @code{SHOW COLUMNS} ¤ÎÊÌ̾¤È¤·¤Æ»ÈÍѤµ¤ì¡¢
-@code{SHOW KEYS} ¤Ï @code{SHOW INDEX} ¤ÎÊÌ̾¤È¤·¤Æ»ÈÍѤµ¤ì¤Þ¤¹¡£
-¥Æ¡¼¥Ö¥ë¤Î¥Õ¥£¡¼¥ë¥É¤ä¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï @code{mysqlshow db_name tbl_name}
-¤« @code{mysqlshow -k db_name tbl_name} ¤Ç¤â¸«¤ì¤Þ¤¹¡£
-
-@code{SHOW INDEX} ¤Ï ODBC ¤Ç¤¤¤¦ @code{SQLStatistics}
-¤Ë¶á¤¤·Á¼°¤Ç¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£
-°Ê²¼¤Î¹àÌܤ¬ÊÖ¤ê¤Þ¤¹¡§
-
-@multitable @columnfractions .35 .65
-@item @strong{¹àÌÜ} @tab @strong{°ÕÌ£}
-@item @code{Table} @tab ¥Æ¡¼¥Ö¥ë̾
-@item @code{Non_unique} @tab ¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬½ÅÊ£¤ò´Þ¤Þ¤Ê¤¤¤Ê¤é 0
-@item @code{Key_name} @tab ¥¤¥ó¥Ç¥Ã¥¯¥¹Ì¾
-@item @code{Seq_in_index} @tab ¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î¹àÌÜÈֹ档1 ¤«¤é»Ï¤Þ¤ê¤Þ¤¹¡£
-@item @code{Column_name} @tab ¥Õ¥£¡¼¥ë¥É̾¡£
-@item @code{Collation} @tab ¤¤¤«¤Ë¤³¤Î¥Õ¥£¡¼¥ë¥É¤¬¥¤¥ó¥Ç¥Ã¥¯¥¹Ãæ¤Ç¥½¡¼¥È¤µ¤ì¤ë¤«. @strong{MySQL} ¤Ç¤Ï, ¤³¤ì¤Ï @code{A} (Ascending) ¤« @code{NULL} (Not sorted) ¤Ë¤Ê¤ê¤Þ¤¹¡£
-@item @code{Cardinality} @tab ¥¤¥ó¥Ç¥Ã¥¯¥¹Ãæ¤Î¥æ¥Ë¡¼¥¯¤ÊÃͤοô¡£ ¤³¤ì¤Ï @code{isamchk -a} ¤Î¼Â¹Ô¤Ç¹¹¿·¤µ¤ì¤Þ¤¹¡£
-@item @code{Sub_part} @tab ¤â¤·¤³¤Î¥Õ¥£¡¼¥ë¥É¤¬¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ë°ìÉôʬ¤À¤±»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢¤½¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ë»ÈÍѤ·¤Æ¤¤¤ë¥­¥ã¥é¥¯¥¿¡¼¿ô¤ò¤·¤á¤¹¡£ ¤â¤·¥­¡¼Á´ÂΤ¬¥¤¥ó¥Ç¥Ã¥¯¥¹¤µ¤ì¤Æ¤¤¤ë¤Ê¤é @code{NULL} ¡£
-@end multitable
-
-
-@cindex @code{mysqladmin}
-@code{SHOW STATUS} ¤Ï @code{mysqladmin extended-status} ¤ÈƱÍͤˡ¢¥µ¡¼¥Ð¤«¤é¤Î¥¹¥Æ¡¼
-¥¿¥¹¾ðÊó¤òÍ¿¤¨¤Þ¤¹¡£½ÐÎϤϼ¡¤È¤Ï°Û¤Ê¤ë¤«¤â¤·¤ì¤Þ¤»¤ó:
-
-@example
-+--------------------------+--------+
-| Variable_name | Value |
-+--------------------------+--------+
-| Aborted_clients | 0 |
-| Aborted_connects | 0 |
-| Connections | 17 |
-| Created_tmp_tables | 0 |
-| Delayed_insert_threads | 0 |
-| Delayed_writes | 0 |
-| Delayed_errors | 0 |
-| Flush_commands | 2 |
-| Handler_delete | 2 |
-| Handler_read_first | 0 |
-| Handler_read_key | 1 |
-| Handler_read_next | 0 |
-| Handler_read_rnd | 35 |
-| Handler_update | 0 |
-| Handler_write | 2 |
-| Key_blocks_used | 0 |
-| Key_read_requests | 0 |
-| Key_reads | 0 |
-| Key_write_requests | 0 |
-| Key_writes | 0 |
-| Max_used_connections | 1 |
-| Not_flushed_key_blocks | 0 |
-| Not_flushed_delayed_rows | 0 |
-| Open_tables | 1 |
-| Open_files | 2 |
-| Open_streams | 0 |
-| Opened_tables | 11 |
-| Questions | 14 |
-| Slow_launch_threads | 0 |
-| Slow_queries | 0 |
-| Threads_connected | 1 |
-| Threads_running | 1 |
-| Uptime | 149111 |
-+--------------------------+--------+
-@end example
-
-¾å¤Ë¼¨¤·¤¿¥¹¥Æ¡¼¥¿¥¹ÊÑ¿ô¤Ï°Ê²¼¤Ë¼¨¤¹¤Î°ÕÌ£¤ò»ý¤Á¤Þ¤¹¡§
-
-@multitable @columnfractions .35 .65
-@item @code{Aborted_clients} @tab ¥¯¥é¥¤¥¢¥ó¥È¤¬Àܳ¤òÊĤ¸¤ëÁ°¤Ë»à¤ó¤Ç¤·¤Þ¤Ã¤¿¤¿¤á¤ËÃæÃǤµ¤ì¤¿¥³¥Í¥¯¥·¥ç¥ó¿ô¡£
-@item @code{Aborted_connects} @tab @strong{MySQL} ¥µ¡¼¥Ð¡¼¤ËÀܳ¤ò»î¤ß¤Æ¼ºÇÔ¤·¤¿¿ô
-@item @code{Bytes_received} @tab ¥¯¥é¥¤¥¢¥ó¥È¤«¤é¼õ¿®¤·¤¿¥Ð¥¤¥È¿ô
-@item @code{Bytes_sent} @tab ¥¯¥é¥¤¥¢¥ó¥È¤ËÁ÷¿®¤·¤¿¥Ð¥¤¥È¿ô
-@item @code{Connections} @tab @strong{MySQL} ¥µ¡¼¥Ð¡¼¤ËÀܳ¤ò»î¤ß¤¿¿ô
-@item @code{Created_tmp_tables} @tab ¥¹¥Æ¡¼¥È¥á¥ó¥È¼Â¹ÔÃæ¤Ë°ÅÌۤΤ¦¤Á¤ËºîÀ®¤µ¤ì¤¿°ì»þ¥Æ¡¼¥Ö¥ë¤Î¿ô
-@item @code{Delayed_insert_threads} @tab »ÈÍÑÃæ¤Î delayed insert ¥Ï¥ó¥É¥é¡¼¥¹¥ì¥Ã¥É¤Î¿ô
-@item @code{Delayed_writes} @tab @code{INSERT DELAYED} ¤Ç½ñ¤«¤ì¤¿¥ì¥³¡¼¥É¿ô
-@item @code{Delayed_errors} @tab @code{INSERT DELAYED} ¤Ç½ñ¤«¤ì¤¿¥ì¥³¡¼¥É¤Ç¤Ê¤ó¤é¤«¤Î¥¨¥é¡¼¤Î¤¢¤Ã¤¿¥ì¥³¡¼¥É¿ô (¤¿¤Ö¤ó @code{duplicate key}).
-@item @code{Flush_commands} @tab @code{FLUSH} ¥³¥Þ¥ó¥É¤Î¼Â¹Ô²ó¿ô
-@item @code{Handler_delete} @tab ¥Æ¡¼¥Ö¥ë¤«¤é¥ì¥³¡¼¥É¤òºï½ü¤¹¤ë¤¿¤á¤Î¥ê¥¯¥¨¥¹¥È¿ô
-@item @code{Handler_read_first} @tab ¥Æ¡¼¥Ö¥ëÃæ¤ÎºÇ½é¤Î¥ì¥³¡¼¥É¤òÆɤि¤á¤Î¥ê¥¯¥¨¥¹¥È¿ô¡£
-@item @code{Handler_read_key} @tab ¥­¡¼¤Ë´ð¤Å¤¤¤Æ¥ì¥³¡¼¥É¤òÆɤि¤á¤Î¥ê¥¯¥¨¥¹¥È¿ô¡£
-@item @code{Handler_read_next} @tab ¥­¡¼½ç¤Ç¼¡¤Î¥ì¥³¡¼¥É¤òÆɤि¤á¤Î¥ê¥¯¥¨¥¹¥È¿ô¡£
-@item @code{Handler_read_rnd} @tab ¸ÇÄê°ÌÃ֤˴ð¤Å¤¤¤Æ¥ì¥³¡¼¥É¤òÆɤि¤á¤Î¥ê¥¯¥¨¥¹¥È¿ô¡£
-@item @code{Handler_read_rnd_next} @tab ¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤Î¼¡¤Î¥ì¥³¡¼¥É¤òÆɤàÍ×µá¤Î¿ô¡£
-¿¤¯¤Î¥Æ¡¼¥Ö¥ë¥¹¥­¥ã¥ó¤ò¹Ô¤Ê¤¦¾ì¹ç¡¢¤³¤ì¤Ï¹â¤¯¤Ê¤ê¤Þ¤¹ - Ä̾¤³¤ì¤Ï¥Æ¡¼
-¥Ö¥ë¤¬Àµ¤·¤¯¥¤¥ó¥Ç¥Ã¥¯¥¹¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢Â¸ºß¤¹¤ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÍ­Íø¤Ë»È¤¦¤è
-¤¦¤Ë¥¯¥¨¥ê¤¬½ñ¤«¤ì¤Æ¤¤¤Ê¤¤¤³¤È¤ò¼¨º¶¤·¤Þ¤¹¡£
-@item @code{Handler_update} @tab ¥Æ¡¼¥Ö¥ë¤Î¥ì¥³¡¼¥É¤ò¹¹¿·¤¹¤ë¤¿¤á¤ÎÍ×µá¿ô
-@item @code{Handler_write} @tab ¥Æ¡¼¥Ö¥ë¤Ë¥ì¥³¡¼¥É¤òÁÞÆþ¤¹¤ë¤¿¤á¤Î¥ê¥¯¥¨¥¹¥È¿ô
-@item @code{Key_blocks_used} @tab ¥­¡¼¥­¥ã¥Ã¥·¥åÃæ¤Ç»ÈÍѤµ¤ì¤¿¥Ö¥í¥Ã¥¯¿ô
-@item @code{Key_read_requests} @tab ¥­¥ã¥Ã¥·¥å¤«¤é¥­¡¼¥Ö¥í¥Ã¥¯¤òÆɤ߹þ¤ó¤À¥ê¥¯¥¨¥¹¥È¿ô
-@item @code{Key_reads} @tab Disk ¤«¤éʪÍýŪ¤Ë¥­¡¼¥Ö¥í¥Ã¥¯¤òÆɤó¤À²ó¿ô
-@item @code{Key_write_requests} @tab ¥­¥ã¥Ã¥·¥å¤Ë¥­¡¼¥Ö¥í¥Ã¥¯¤ò½ñ¤­¹þ¤ó¤À¥ê¥¯¥¨¥¹¥È¿ô
-@item @code{Key_writes} @tab Disk¤ËʪÍýŪ¤Ë¥­¡¼¥Ö¥í¥Ã¥¯¤ò½ñ¤­¹þ¤ó¤À²ó¿ô
-@item @code{Max_used_connections} @tab ºÇÂçƱ»þÀܳ¿ô
-@item @code{Not_flushed_key_blocks} @tab ¥­¡¼¥­¥ã¥Ã¥·¥åÃæ¤Ë¤¢¤ë¥­¡¼¥Ö¥í¥Ã¥¯¤Ç¡¢Êѹ¹¤µ¤ì¤¿¤â¤Î¤Î¤¤¤Þ¤ÀDisk¤Ë½ñ¤­½Ð¤µ¤ì¤Æ¤¤¤Ê¤¤¥­¡¼¥Ö¥í¥Ã¥¯¿ô
-@item @code{Not_flushed_delayed_rows} @tab @code{INSERT DELAY} ¥¯¥¨¥ê¤Ç½ñ¤­½Ð¤·¤òÂԤäƤ¤¤ë¥ì¥³¡¼¥É¿ô
-@item @code{Open_tables} @tab ¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Æ¡¼¥Ö¥ë¿ô
-@item @code{Open_files} @tab ¥ª¡¼¥×¥ó¤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¿ô
-@item @code{Open_streams} @tab ³«¤¤¤Æ¤¤¤ë¥¹¥È¥ê¡¼¥à¿ô (¼ç¤Ë¥í¥°¤Ë»ÈÍѤµ¤ì¤ë)
-@item @code{Opened_tables} @tab ¥ª¡¼¥×¥ó¤µ¤ì¤¿¥Æ¡¼¥Ö¥ë¿ô
-@item @code{Questions} @tab ¥µ¡¼¥Ð¡¼¤ËÁ÷¤é¤ì¤¿¥¯¥¨¥ê¤Î¿ô
-@item @code{Slow_launch_threads} @tab Àܳ¤Ë @code{slow_launch_time} °Ê¾å¤òÍפ·¤¿¥¹¥ì¥Ã¥É¿ô
-@item @code{Slow_queries} @tab @code{long_query_time} °Ê¾å¤Ë»þ´Ö¤Î¤«¤«¤Ã¤¿¥¯¥¨¥ê¤Î¿ô
-@item @code{Threads_cached} @tab ¥¹¥ì¥Ã¥É¥­¥ã¥Ã¥·¥åÆâ¤Î¥¹¥ì¥Ã¥É¿ô
-@item @code{Threads_connected} @tab ¸½ºß³«¤¤¤Æ¤¤¤ëÀܳ¿ô
-@item @code{Threads_running} @tab ¥¹¥ê¡¼¥×¤·¤Æ¤¤¤Ê¤¤¥¹¥ì¥Ã¥É¤Î¿ô
-@item @code{Uptime} @tab ¥µ¡¼¥Ð¡¼¤¬Áö¤Ã¤Æ¤¤¤ëÉÿô
-@end multitable
-
-¾å¤Ë¤Ä¤¤¤Æ¤Î¤¤¤¯¤Ä¤«¥³¥á¥ó¥È¡§
-
-@itemize @bullet
-@item
-¤â¤· @code{Opened_tables} ¤¬Â礭¤±¤ì¤Ð¡¢ @code{table_cache} ÊÑ¿ô¤¬¾®¤µ¤¹¤®¤ë
-¤Î¤Ç¤·¤ç¤¦¡£
-@item
-¤â¤· @code{key_reads} ¤¬Â礭¤±¤ì¤Ð¡¢ @code{key_cache} ¤¬¾¯¤Ê¤¹¤®¤ë¤Ç¤·¤ç¤¦¡£
-¥­¥ã¥Ã¥·¥å¥Ò¥Ã¥È¥ì¡¼¥È¤Ï
-@code{key_reads}/@code{key_read_requests} ¤Ç·×»»¤Ç¤­¤Þ¤¹¡£
-@item
-¤â¤· @code{Handler_read_rnd} ¤¬Â礭¤±¤ì¤Ð¡¢
-@strong{MySQL} ¤Ë¥Æ¡¼¥Ö¥ë¤ò¥¹¥­¥ã¥ó¤µ¤»¤ë¤è¤¦¤Ê¿¤¯¤Î¥¯¥¨¥ê
-¤ä¡¢ ¥­¡¼¤ò»ÈÍѤ·¤Ê¤¤ JOIN ¤¬¤â¤Æ¤Þ¤¹¡£
-@end itemize
-
-@code{SHOW VARIABLES} ¤Ï @strong{MySQL} ¥·¥¹¥Æ¥àÊÑ¿ô¤Î¤¤¤¯¤Ä¤«¤ÎÃͤò¼¨¤·¤Þ¤¹¡£
-@code{mysqlshow variables} ¥³¥Þ¥ó¥É¤Ç¤âƱ¤¸¾ðÊó¤¬ÆÀ¤é¤ì¤Þ¤¹¡£
-¤â¤·É¸½àÃͤ¬Å¬¤µ¤Ê¤¤¤Ê¤é¡¢¤Û¤È¤ó¤É¤ÎÊÑ¿ô¤ò @code{mysqld} µ¯Æ°»þ¤Ë
-¥³¥Þ¥ó¥É¥é¥¤¥ó¤Î¥ª¥×¥·¥ç¥ó¤È¤·¤ÆÍ¿¤¨¤ë¤³¤È¤Ë¤è¤ê¡¢Êѹ¹¤Ç¤­¤Þ¤¹¡£
-½ÐÎϤϰʲ¼¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¤¬¡¢¥Õ¥©¡¼¥Þ¥Ã¥È¤ä¿ô¤Ï¤¤¤¯¤Ö¤ó°ã¤¦¤Ç¤·¤ç¤¦¡§
-
-@example
-+------------------------+--------------------------+
-| Variable_name | Value |
-+------------------------+--------------------------+
-| back_log | 5 |
-| connect_timeout | 5 |
-| basedir | /my/monty/ |
-| datadir | /my/monty/data/ |
-| delayed_insert_limit | 100 |
-| delayed_insert_timeout | 300 |
-| delayed_queue_size | 1000 |
-| join_buffer_size | 131072 |
-| flush_time | 0 |
-| interactive_timeout | 28800 |
-| key_buffer_size | 1048540 |
-| language | /my/monty/share/english/ |
-| log | OFF |
-| log_update | OFF |
-| long_query_time | 10 |
-| low_priority_updates | OFF |
-| max_allowed_packet | 1048576 |
-| max_connections | 100 |
-| max_connect_errors | 10 |
-| max_heap_table_size | 16777216 |
-| max_delayed_threads | 20 |
-| max_join_size | 4294967295 |
-| max_sort_length | 1024 |
-| max_tmp_tables | 32 |
-| net_buffer_length | 16384 |
-| port | 3306 |
-| protocol-version | 10 |
-| record_buffer | 131072 |
-| skip_locking | ON |
-| slow_launch_time | 2 |
-| socket | /tmp/mysql.sock |
-| sort_buffer | 2097116 |
-| table_cache | 64 |
-| thread_stack | 131072 |
-| tmp_table_size | 1048576 |
-| tmpdir | /machine/tmp/ |
-| version | 3.23.0-alpha-debug |
-| wait_timeout | 28800 |
-+------------------------+--------------------------+
-@end example
-
-@xref{Server parameters, ,Server parameters}.
-
-@findex Threads
-@findex PROCESSLIST
-@code{SHOW PROCESSLIST} ¤Ï¤É¤Î¥¹¥ì¥Ã¥É¤¬Áö¤Ã¤Æ¤¤¤ë¤«¤òɽ¼¨¤·¤Þ¤¹¡£
-@code{mysqlshow processlist} ¥³¥Þ¥ó¥É¤Ç¤âƱ¤¸¾ðÊó¤¬ÆÀ¤é¤ì¤Þ¤¹¡£
-¤â¤· @strong{process} ¸¢¸Â¤¬¤¢¤ë¤Ê¤é¡¢Á´¤Æ¤Î¥¹¥ì¥Ã¥É¤¬¤ß¤ì¤Þ¤¹¡£
-¤·¤«¤·¸¢¸Â¤¬¤Ê¤¤¤Ê¤é¡¢¼«Ê¬¤Î¥¹¥ì¥Ã¥É¤·¤«¸«¤ì¤Þ¤»¤ó¡£
-@xref{KILL, , @code{KILL}}.
-@code{FULL} ¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ·¤Ê¤¤¾ì¹ç¡¢³Æ¥¯¥¨¥ê¤ÎºÇ½é¤Î100ʸ»ú¤À¤±¤¬É½¼¨
-¤µ¤ì¤Þ¤¹¡£
-
-@code{SHOW GRANTS FOR user} ¤Ï¥æ¡¼¥¶¤Îµö²Ä¤òÊ£À½¤¹¤ë¤¿¤á¤Ëȯ¹Ô¤¹¤ëɬÍפ¬¤¢
-¤ë grant ¥³¥Þ¥ó¥É¤ò¥ê¥¹¥È¤·¤Þ¤¹¡£
-
-@example
-mysql> SHOW GRANTS FOR root@@localhost;
-+---------------------------------------------------------------------+
-| Grants for root@@localhost |
-+---------------------------------------------------------------------+
-| GRANT ALL PRIVILEGES ON *.* TO 'root'@@'localhost' WITH GRANT OPTION |
-+---------------------------------------------------------------------+
-@end example
-
-@findex EXPLAIN
-@findex SELECT, optimizing
-@node EXPLAIN, DESCRIBE, SHOW, Reference
-@section @code{EXPLAIN} ¹½Ê¸ (@code{SELECT}¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÆÀ¤ë)
-
-@example
- EXPLAIN tbl_name
-or EXPLAIN SELECT select_options
-@end example
-
-@code{EXPLAIN tbl_name} ¤Ï¡¢ @code{DESCRIBE tbl_name} ¤ä
-@code{SHOW COLUMNS FROM tbl_name} ¤ÈƱµÁ¤Ç¤¹¡£
-
-¤â¤· @code{EXPLAIN} ¤ò¤È¤â¤Ê¤Ã¤Æ @code{SELECT} ¹½Ê¸¤ò¼Â¹Ô¤·¤¿¾ì¹ç¡¢
-@strong{MySQL} ¤Ï¤³¤Î @code{SELECT} ¤¬¤¤¤«¤ËÆ°ºî¤¹¤ë¤«¤òÀâÌÀ¤·¡¢
-¤¤¤«¤Ë¥Æ¡¼¥Ö¥ë¤¬·ë¹ç¤µ¤ì¤ë¤«¤Î¾ðÊó¤òÍ¿¤¨¤Þ¤¹¡£
-
-@code{EXPLAIN} ¤Î¾ðÊó¤ò¸µ¤Ë¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ·¤¿Â®¤¤ @code{SELECT} ¤ò
-ÆÀ¤ë¤¿¤á¤Ë¥Æ¡¼¥Ö¥ë¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò²Ã¤¨¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¤È¤¤¤¦»ö¤¬¤ï¤«¤ê¤Þ¤¹¡£
-¥Æ¡¼¥Ö¥ë·ë¹ç¤ÎºÇŬ²½¤â¥ª¥×¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¸«¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@code{SELECT} ¹½Ê¸¤Ç¤Î·ë¹ç¤ò¶¯À©Åª¤ËºÇŬ²½¤¹¤ë¤Ë¤Ï @code{STRAIGHT_JOIN} Àá¤ò²Ã¤¨¤Þ¤¹¡£
-
-ñ½ã¤Ç¤Ï¤Ê¤¤ join ¤Î¤¿¤á¤Ë¡¢@code{EXPLAIN} ¤Ï @code{SELECT} ʸ¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë
-¤½¤ì¤¾¤ì¤Î¥Æ¡¼¥Ö¥ë¤Î¾ðÊó¤òÊÖ¤·¤Þ¤¹¡£
-¥Æ¡¼¥Ö¥ë¤ÏÆɤޤì¤ë½ç¤Ëɽ¼¨¤µ¤ì¤Þ¤¹¡£@strong{MySQL} ¤Ï one-sweep multi-join method
-¤òÍѤ¤¤¿Á´¤Æ¤Î join ¤ò²ò·è¤·¤Þ¤¹¡£¤³¤ì¤Ï @strong{MySQL} ¤ÏºÇ½é¤Î¥Æ¡¼¥Ö¥ë¤«¤é
-°ì¥ì¥³¡¼¥ÉÆɤ߹þ¤ß¡¢Æó¤ÄÌܤΥơ¼¥Ö¥ë¤«¤é¥Þ¥Ã¥Á¤·¤¿¥ì¥³¡¼¥É¤òõ¤·¡¢¤½¤·¤Æ»°ÈÖÌܤòõ¤¹¤È¤¤¤¦¤³¤È¤Ç¤¹¡£
-Á´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤¬½èÍý¤µ¤ì¤ë»þ¡¢ÁªÂò¤µ¤ì¤¿¥Õ¥£¡¼¥ë¥É¤ò½ÐÎϤ·¡¢¥Æ¡¼¥Ö¥ë¤Î°ìÍ÷¤Ï
-¤è¤ê¥Þ¥Ã¥Á¤¹¤ë¥ì¥³¡¼¥É¤ò¤â¤Ä¥Æ¡¼¥Ö¥ë¤ò¸«¤Ä¤±¤ë¤Þ¤Ç back-track ¤µ¤ì¤Þ¤¹¡£
-¼¡¤Î¥ì¥³¡¼¥É¤Ï¤³¤Î¥Æ¡¼¥Ö¥ë¤«¤éÆɤޤ졢¼¡¤Î¥Æ¡¼¥Ö¥ë¤«¤é½èÍý¤ò³¤±¤Þ¤¹¡£
-
-@code{EXPLAIN} ¤Î½ÐÎϤϰʲ¼¤Î¥Õ¥£¡¼¥ë¥É¤ò´Þ¤ß¤Þ¤¹¡§
-
-@table @code
-@item table
-½ÐÎϥ쥳¡¼¥É¤¬»²¾È¤µ¤ì¤ë¥Æ¡¼¥Ö¥ë
-
-@item type
-¡¡join ¥¿¥¤¥×. ÍÍ¡¹¤Ê¥¿¥¤¥×¤ÎÀâÌÀ¤Ï¸å½Ò¤·¤Þ¤¹
-
-@item possible_keys
-@code{possible_keys} ¹àÌܤϡ¢@strong{MySQL} ¤¬¥Æ¡¼¥Ö¥ë¤«¤é¥ì¥³¡¼¥É¤ò¸«¤Ä¤±¤ë¤¿¤á¤Ë
-¤É¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ¹¤ë»ö¤¬¤Ç¤­¤¿¤«¤ò¼¨¤·¤Þ¤¹¡£
-Ãí°Õ: ¤³¤Î¥Õ¥£¡¼¥ë¥É¤Ï¥Æ¡¼¥Ö¥ë¤Î½ç¤Ë¤Þ¤Ã¤¿¤¯°Í¸¤·¤Þ¤»¤ó¡£¤³¤ì¤Ï¡¢
-possible_keys Æâ¤Î¤¤¤¯¤Ä¤«¤Î¥­¡¼¤Ï¡¢À¸À®¤µ¤ì¤¿¥Æ¡¼¥Ö¥ë½ç¤Ç¤Î¼Â¹Ô¤Ë»ÈÍѤǤ­
-¤Ê¤¤¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£
-
-¤³¤Î¹àÌܤ¬¶õ¤Ê¤é¡¢´ØÏ¢¤·¤¿
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï̵¤¤¤È¤¤¤¦¤³¤È¤Ç¤¹¡£¤³¤Î¾ì¹ç¡¢¤¢¤Ê¤¿¤Ï @code{WHERE} Àá¤ò
-Ä´¤Ù¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢¥¯¥¨¥ê¤ÎÀ­Ç½¤ò¸þ¾å¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-¤â¤·¤½¤ì¤¬¥¤¥ó¥Ç¥Ã¥¯¥¹¤ËŬ¹ç¤·¤¿¥Õ¥£¡¼¥ë¥É¤ò»²¾È¤·¤Æ¤¤¤ë¤Ê¤é¤Ð¡£
-²¾¤Ë¤½¤¦¤À¤È¤¹¤ë¤È¡¢Å¬Àڤʥ¤¥ó¥Ç¥Ã¥¯¥¹¤òºîÀ®¤·¡¢ @code{EXPLAIN} ¤Ç¥¯¥¨¥ê¤ò
-¤â¤¦°ìÅÙ¥Á¥§¥Ã¥¯¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
-
-¥Æ¡¼¥Ö¥ë¤¬¤É¤ó¤Ê¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ã¤Æ¤¤¤ë¤«¤ß¤ë¤Ë¤Ï¡¢@code{SHOW INDEX FROM tbl_name} ¤È¤·¤Þ¤¹¡£
-
-@item key¡¡¡¡¡¡
-@code{key} ¹àÌܤϡ¢ @strong{MySQL} ¤¬»ÈÍѤ¹¤ë¤È¼ÂºÝ¤Ë·è¤á¤¿¥­¡¼¤ò¼¨¤·¤Þ¤¹¡£
-¤É¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤âÁª¤Ð¤ì¤Ê¤«¤Ã¤¿¤Ê¤é¤Ð¡¢¥­¡¼¤Ï @code{NULL} ¤Ç¤¹¡£
-@strong{MySQL} ¤¬´Ö°ã¤Ã¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÁªÂò¤¹¤ë¾ì¹ç¡¢¤¿¤¤¤Æ¤¤¤Ï
-@strong{MySQL} ¤Ë¾¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë¶¯À©¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@code{myisamchk --analyze} ¤Î»ÈÍÑ¡¢@xref{myisamchk syntax}¡¢¤Þ¤¿¤Ï
-@code{USE INDEX/IGNORE INDEX} ¤Î»ÈÍѤˤè¤Ã¤Æ¡£@xref{JOIN}¡£
-
-@item key_len
-@code{key_len} ¹àÌܤϡ¢@strong{MySQL} ¤¬»ÈÍѤ¹¤ë¤È·è¤á¤¿¥­¡¼¤ÎŤµ¤ò¼¨¤·¤Þ¤¹¡£
-¤â¤· @code{key} ¤¬ @code{NULL} ¤Ê¤é¡¢Ä¹¤µ¤Ï @code{NULL} ¤Ç¤¹¡£
-Ãí°Õ: ¤³¤ì¤Ï@strong{MySQL} ¤¬¥Þ¥ë¥Á¥Ñ¡¼¥È¥­¡¼¤Î¤¤¤¯¤Ä¤Î¥Ñ¡¼¥È¤ò¼ÂºÝ¤Ë»ÈÍÑ
-¤¹¤ë¤«¤ò¼¨¤·¤Þ¤¹¡£
-
-@item ref¡¡¡¡¡¡
-@code{ref} ¹àÌܤϡ¢¥Æ¡¼¥Ö¥ë¤«¤é¥ì¥³¡¼¥É¤ò select ¤¹¤ë¤¿¤á¤Ë¡¢¤É¤Î¥Õ¥£¡¼¥ë¥É¤äÄê¿ô¤¬
- @code{key} ¤È¶¦¤Ë»ÈÍѤµ¤ì¤¿¤«¤ò¼¨¤·¤Þ¤¹¡£
-
-@item rows¡¡¡¡¡¡
-@code{rows} ¥Õ¥£¡¼¥ë¥É¤Ï¡¢@strong{MySQL} ¤¬¥¯¥¨¥ê¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤Ë¸¡ºº¤¹¤ë
-ɬÍפ¬¤¢¤ë¤È¹Í¤¨¤Æ¤¤¤ë¥ì¥³¡¼¥É¤Î¿ô¤ò¼¨¤·¤Þ¤¹¡£
-
-@item Extra¡¡
-This column contains additional information of how @strong{MySQL} will
-resolve the query. Here follows an explanation of the different text
-strings that can be found in this column:
-
-@table @code
-@item Not exists
-@strong{MySQL} was able to do a @code{LEFT JOIN} optimisation on the
-query and will not examine more rows in this table for a row combination
-after it founds one rows that matches the @code{LEFT JOIN} criteria.
-@item @code{range checked for each record (index map: #)}
-@strong{MySQL} didn't find a real good index to use. It will instead for
-each row combination in the preceding tables do a check which index to
-use (if any) use this index to retrieve the rows from the table. This
-isn't very fast but is of course faster than having to do a join without
-an index.
-@item Using filesort
-@strong{MySQL} will need to do an extra pass to find out how to retrieve
-the rows in sorted order. The sort is done by going through all rows
-according to the @code{join type} and storing the sort key + pointer to
-the row for all rows that match the @code{WHERE}. Then the keys are
-sorted. Finally the rows are retrieved in sorted order.
-@item Using index
-The column information is retrieved from the table using only
-information in the index tree without having to do an additional seek to
-read the actually row. This can be done when all the used columns for
-the table are part of the same index.
-@item Using temporary
-To be able to resolve the query @strong{MySQL} will need to create a
-temporary table to hold the result. This typically happens if you do an
-@code{ORDER BY} on a different column set than you did an @code{GROUP
-BY} on.
-@item where used
-A @code{WHERE} clause will be used to restrict which rows will be
-matched against the next table or sent to the client. If you don't have
-this information and the the table is of type @code{ALL} or @code{index}
-you may have something wrong in your query (if you don't intend to
-fetch/examine all rows from the table).
-@end table
-
-If you want to get your queries as fast as possible, you should look out for
-@code{Using filesort} and @code{Using temporary}.
-@end table
-
-join type ¤Ï°Ê²¼¤Î¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡£Îɤ¤Êª¤«¤é½ç¤Ë½ñ¤¤¤Æ¤¤¤Þ¤¹¡§
-
-@cindex System table
-@cindex Table, system
-@table @code
-@item system
-¥Æ¡¼¥Ö¥ë¤¬°ì¥ì¥³¡¼¥É¤À¤±»ý¤Ã¤Æ¤¤¤ë (= system table). ¤³¤ì¤Ï @code{const} join type
-¤ÎÆÃÊ̤ʾì¹ç¤Ç¤¹¡£
-
-@cindex Constant table
-@cindex Table, constant
-@item const
-¥Æ¡¼¥Ö¥ë¤Ï¡¢ºÇ¤â¥Þ¥Ã¥Á¤¹¤ë¥ì¥³¡¼¥É¤ò£±¤Ä¤â¤Ã¤Æ¤ª¤ê¡¢¤³¤ì¤Ï¥¯¥¨¥ê¤Î
-ºÇ½é¤ËÆɤޤì¤Þ¤¹¡£
-1 ¤Ä¤Î¥ì¥³¡¼¥É¤Ç¤¢¤ë¤¿¤á¡¢¤³¤Î¥ì¥³¡¼¥ÉÃæ¤Î¥Õ¥£¡¼¥ë¥É¤ÎÃͤÏ
-¥ª¥×¥Æ¥£¥Þ¥¤¥¶¡¼¤Ë¤è¤Ã¤Æ¾ï¿ô¤È¤·¤Æ¤ß¤Ê¤µ¤ì¤Þ¤¹¡£
-1²ó¤À¤±Æɤޤì¤ë¤Î¤Ç¡¢@code{const} ¥Æ¡¼¥Ö¥ë¤Ï¤È¤Æ¤â®¤¤¤Ç¤¹!
-
-@item eq_ref
-Á°¤Î¥Æ¡¼¥Ö¥ë¤Î¤½¤ì¤¾¤ì¤Î¥ì¥³¡¼¥É¤È·ë¹ç¤¹¤ëºÝ¡¢¤³¤Î¥Æ¡¼¥Ö¥ë¤«¤é1¥ì¥³¡¼¥ÉÆɤޤì¤Þ¤¹¡£
-¤³¤ì¤Ï join ¤Ç¤Ï @code{const} ¤è¤ê¤âÎɤ¤·Á¤Ç¤¹¡£
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎÁ´¤Æ¤Î¥Ñ¡¼¥È¤¬ join ¤Ç»ÈÍѤµ¤ì¡¢¤«¤Ä¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬
-@code{UNIQUE} ¤« @code{PRIMARY KEY} ¤Ç¤¢¤ë¤È¤­¤Ë¡¢¤³¤ì¤Ï»ÈÍѤµ¤ì¤Þ¤¹¡£
-
-@item ref¡¡¡¡¡¡
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎÃͤ˹ç¤Ã¤¿¤¹¤Ù¤Æ¤Î¥ì¥³¡¼¥É¤Ï¡¢Á°¤Î¥Æ¡¼¥Ö¥ë¤«¤é¥ì¥³¡¼¥É¤È·ë¹ç¤¹¤ë¤¿¤á¤Ë¡¢
-¤³¤Î¥Æ¡¼¥Ö¥ë¤«¤éÆɤޤì¤ë¤Ç¤·¤ç¤¦¡£
-¤â¤·¤½¤Î join ¤¬¥­¡¼¤Î°ìÈÖº¸¤ÎÀÜƬÉôʬ¤À¤±¤ò»ÈÍѤ¹¤ë¤Ê¤é¤Ð¡¢
-¤¢¤ë¤¤¤Ï¡¢
-¤â¤·¤½¤Î¥­¡¼¤¬ @code{UNIQUE} ¤ä @code{PRIMARY KEY} ¤Ç¤Ê¤±¤ì¤Ð
-(¸À¤¤´¹¤¨¤ë¤Ê¤é¡¢¤â¤· join ¤¬¥­¡¼¤ÎÃͤò¸µ¤Ë°ì¤Ä¤À¤±¤Î¡¢¥ì¥³¡¼¥É¤òÁªÂò¤Ç¤­¤Ê¤±¤ì¤Ð)¡¢
-@code{ref} ¤Ï»ÈÍѤµ¤ì¤Þ¤¹¡£
-¤â¤·¤½¤Î¥­¡¼¤¬¤¤¤¯¤Ä¤«¤Î¥Þ¥Ã¥Á¤¹¤ë¥ì¥³¡¼¥É¤Ë»ÈÍѤµ¤ì¤ë¤À¤±¤Ê¤é¡¢
-join ¤ÏÎɤ¤·Á¤Ç¤¹¡£
-
-@item range
-¼¨¤µ¤ì¤¿ÈÏ°ÏÆâ¤Ë¤¢¤ë¥ì¥³¡¼¥É¤Î¤ß¤¬¸¡º÷¤µ¤ì¤Þ¤¹¡£
-@code{ref} ¹àÌܤϤɤΥ¤¥ó¥Ç¥Ã¥¯¥¹¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ë¤«¼¨¤·¤Þ¤¹¡£
-
-@item index
-@code{ALL} ¤ÈƱ¤¸¤Ç¤¹¤¬¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¥Ä¥ê¡¼¤¬Áöºº¤µ¤ì¤ë¾ì¹ç¤Î¤ß¤ò½ü¤­¤Þ¤¹¡£
-¤³¤ì¤Ï¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¤Ï¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤è¤ê¤â¾®¤µ¤¤¤¿¤á¡¢Ä̾ï @code{ALL} ¤è¤ê®¤¤¤Ç¤¹¡£
-
-@item ALL
-Á°¤Î¥Æ¡¼¥Ö¥ë¤Î¥ì¥³¡¼¥É¤È¤Î¤½¤ì¤¾¤ì¤Î·ë¹ç¤Ë¤ª¤¤¤Æ¡¢Á´¥Æ¡¼¥Ö¥ë¤¬Áöºº¤µ¤ì¤Þ¤¹¡£
-¤â¤·¤½¤Î¥Æ¡¼¥Ö¥ë¤¬ºÇ½é¤Î¥Æ¡¼¥Ö¥ë¤Ç @code{const} ¾õÂ֤ǤϤʤ¤¤Ê¤é¡¢Ä̾ï
-¤³¤ì¤ÏÎɤ¯¤¢¤ê¤Þ¤»¤ó¡£Â¾¤Î¾õÂ֤ǤÏ@strong{¤È¤Æ¤â}°­¤¯¤Ê¤ê¤Þ¤¹¡£
-¤³¤ì¤ÏÉáÄÌ¡¢¥ì¥³¡¼¥É¤¬¤¬¤è¤êÁᤤ¥Æ¡¼¥Ö¥ë¤«¤é¤«¤éÄê¿ôÃͤ˴ð¤Å¤¤¤Æ¸¡º÷¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¡¢
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÄɲ乤뤳¤È¤Ë¤è¤ê @code{ALL} ¤òÈò¤±¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£
-@end table
-
-@code{EXPLAIN} ½ÐÎϤΠ@code{rows} ¥Õ¥£¡¼¥ë¥ÉÆâ¤Î¤¹¤Ù¤Æ¤ÎÃͤòÁý¤ä¤¹¤³¤È¤Ë¤è
-¤ê¡¢join ¤¬¤É¤Î¤è¤¦¤ËÎɤ¯¤Ê¤ë¤«¤ÎÎɤ¤É½¼¨¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤ì¤Ï¡¢
-@strong{MySQL} ¤¬¥¯¥¨¥ê¼Â¹Ô¤Î¸¡ºº¤ò¤¹¤ëɬÍפ¬¤¢¤ë¥ì¥³¡¼¥É¤Î¤ª¤ª¤è¤½¤Î¿ô¤ò
-ÃΤ餻¤Þ¤¹¡£¤³¤Î¿ô¤Ï @code{max_join_size} ÊÑ¿ô¤Ç¤Î¥¯¥¨¥ê¤òÀ©¸Â¤¹¤ë»þ¤Ë¤â»È
-ÍѤ·¤Þ¤¹¡£
-@xref{Server parameters}.
-
-°Ê²¼¤ÎÎã¤Ï¡¢@code{EXPLAIN} ¤¬Ä󶡤¹¤ë¾ðÊó¤ò¸µ¤Ë¡¢¤¤¤«¤Ë @code{JOIN} ¤¬ºÇŬ²½
-¤Ç¤­¤ë¤«¤ÎÎã¤Ç¤¹¡£
-
-°Ê²¼¤Î¤è¤¦¤Ê @code{EXPLAIN} ¤Ç¸¡ºº¤¹¤ë @code{SELECT} ¹½Ê¸¤¬¤¢¤ë¤È¤·¤Þ¤¹¡§
-
-@example
-EXPLAIN SELECT tt.TicketNumber, tt.TimeIn,
- tt.ProjectReference, tt.EstimatedShipDate,
- tt.ActualShipDate, tt.ClientID,
- tt.ServiceCodes, tt.RepetitiveID,
- tt.CurrentProcess, tt.CurrentDPPerson,
- tt.RecordVolume, tt.DPPrinted, et.COUNTRY,
- et_1.COUNTRY, do.CUSTNAME
- FROM tt, et, et AS et_1, do
- WHERE tt.SubmitTime IS NULL
- AND tt.ActualPC = et.EMPLOYID
- AND tt.AssignedPC = et_1.EMPLOYID
- AND tt.ClientID = do.CUSTNMBR;
-@end example
-
-¤³¤ÎÎã¤Ç¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë²¾Äꤷ¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-¥Õ¥£¡¼¥ë¥É¤Ï°Ê²¼¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤¹¡§
-
-@multitable @columnfractions .1 .2 .7
-@item @strong{Table} @tab @strong{Column} @tab @strong{Column type}
-@item @code{tt} @tab @code{ActualPC} @tab @code{CHAR(10)}
-@item @code{tt} @tab @code{AssignedPC} @tab @code{CHAR(10)}
-@item @code{tt} @tab @code{ClientID} @tab @code{CHAR(10)}
-@item @code{et} @tab @code{EMPLOYID} @tab @code{CHAR(15)}
-@item @code{do} @tab @code{CUSTNMBR} @tab @code{CHAR(15)}
-@end multitable
-
-@item
-¥Æ¡¼¥Ö¥ë¤Ï°Ê²¼¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Á¤Þ¤¹¡§
-
-@multitable @columnfractions .1 .9
-@item @strong{Table} @tab @strong{Index}
-@item @code{tt} @tab @code{ActualPC}
-@item @code{tt} @tab @code{AssignedPC}
-@item @code{tt} @tab @code{ClientID}
-@item @code{et} @tab @code{EMPLOYID} (primary key)
-@item @code{do} @tab @code{CUSTNMBR} (primary key)
-@end multitable
-
-@item
-@code{tt.ActualPC} ¤ÎÃͤϡ¢¤¤¤Á¤è¤¦¤ËʬÉÛ¤·¤Æ(ÇÛÃÖ¤µ¤ì¤Æ)¤¤¤Þ¤»¤ó¡£
-@end itemize
-
-ºÇ½é¡¢¤¤¤«¤Ê¤ëºÇŬ²½¤â¹Ô¤ï¤ì¤Æ¤¤¤Ê¤¤¾õÂ֤Ǥϡ¢@code{EXPLAIN} ¹½Ê¸¤Ï
-°Ê²¼¤Î¾ðÊó¤òÄ󼨤·¤Þ¤¹¡§
-
-@example
-table type possible_keys key key_len ref rows Extra
-et ALL PRIMARY NULL NULL NULL 74
-do ALL PRIMARY NULL NULL NULL 2135
-et_1 ALL PRIMARY NULL NULL NULL 74
-tt ALL AssignedPC,ClientID,ActualPC NULL NULL NULL 3872
- range checked for each record (key map: 35)
-@end example
-
-¤½¤ì¤¾¤ì¤Î¥Æ¡¼¥Ö¥ë¤Ç¡¢@code{type} ¤¬ @code{ALL} ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
-¤³¤ì¤Ï @strong{MySQL} ¤¬Á´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤òÁ´·ë¹ç¤¹¤ë¤³¤È¤ò¼¨¤·¤Þ¤¹¡ª
-¤½¤ì¤¾¤ì¤Î¥Æ¡¼¥Ö¥ëÆâ¤Î¹Ô¿ôʬ¤«¤éºî¤Ã¤¿Êª¤¬Ä´¤Ù¤é¤ì¤ë¤Î¤Ç¡¢¤È¤Æ¤âŤ¤»þ´Ö¤¬¤«¤«¤ê¤Þ¤¹¡ª
-¤³¤Î¾ì¹ç¡¢@code{74 * 2135 * 74 * 3872 = 45,268,558,720} ¹ÔÄ´¤Ù¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
-¥Æ¡¼¥Ö¥ë¤¬ÈîÂç²½¤·¤¿¤È¤­¤Ë¤«¤«¤ë»þ´Ö¤ò¹Í¤¨¤Æ¤¯¤À¤µ¤¤....
-
-°ì¤ÄÌäÂ꤬¤¢¤ê¤Þ¤¹¡£(¤Þ¤À) @strong{MySQL} ¤¬¥Õ¥£¡¼¥ë¥É¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò¸ú²ÌŪ¤Ë
-»ÈÍѤǤ­¤Æ¤¤¤Þ¤»¤ó¡£
-¤³¤ÎÎã¤Î¾ì¹ç¤Ç¤Ï¡¢@code{VARCHAR} ¤È @code{CHAR} ¤Ï¡¢¤½¤ì¤é¤¬Æ±¤¸Ä¹¤µ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢
-ÊѤï¤ê¤¬¤¢¤ê¤Þ¤»¤ó¡£
-@code{tt.ActualPC} ¤Ï @code{CHAR(10)} ¤ÈÄêµÁ¤µ¤ì¤Æ¤ª¤ê¡¢
-@code{et.EMPLOYID} ¤Ï @code{CHAR(15)} ¤Ç¤¹¡£¤³¤ì¤é¤ÎŤµ¤Ï°ã¤¤¤Þ¤¹¡£
-
-¤³¤ÎÉÔÄà¤ê¹ç¤¤¤ò½¤Àµ¤¹¤ë¤Ë¤¢¤¿¤ê¡¢@code{ALTER TABLE} ¤ò»È¤Ã¤Æ
-@code{ActualPC} ¤ÎŤµ¤ò 10 ʸ»ú¤«¤é 15 ʸ»ú¤Ë¤·¤Þ¤¹¡§
-
-@example
-mysql> ALTER TABLE tt MODIFY ActualPC VARCHAR(15);
-@end example
-
-¤³¤ì¤Ç @code{tt.ActualPC} and @code{et.EMPLOYID} ¤ÏξÊý¤È¤â @code{VARCHAR(15)} ¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
- @code{EXPLAIN} ¹½Ê¸¤ò¼Â¹Ô¤·Ä¾¤¹¤È¡¢°Ê²¼¤òÄ󼨤·¤Þ¤¹¡§
-
-@example
-table type possible_keys key key_len ref rows Extra
-tt ALL AssignedPC,ClientID,ActualPC NULL NULL NULL 3872 where used
-do ALL PRIMARY NULL NULL NULL 2135
- range checked for each record (key map: 1)
-et_1 ALL PRIMARY NULL NULL NULL 74
- range checked for each record (key map: 1)
-et eq_ref PRIMARY PRIMARY 15 tt.ActualPC 1
-@end example
-
-¤Þ¤À´°Á´¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬¡¢¤è¤ê¤è¤¯¤Ê¤Ã¤Æ¤¤¤Þ¤¹(@code{rows} ÃͤÎ
-À¸À®ÎÌ¤Ï 74 ¤è¤ê¾®¤µ¤¯¤Ê¤ê¤Þ¤¹)¡£¤³¤Î¾ì¹ç¡¢¼Â¹Ô¤Ï¿ôÉäǤ·¤ç¤¦¡£
-
-@code{tt.AssignedPC = et_1.EMPLOYID} ¤È @code{tt.ClientID =
-do.CUSTNMBR} ¤ÎÈæ³Ó¤Ë¤ª¤¤¤Æ¡¢¥Õ¥£¡¼¥ë¥É¤ÎŤµ¤Î°ã¤¤¤òÇÓ½ü¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹:
-
-@example
-mysql> ALTER TABLE tt MODIFY AssignedPC VARCHAR(15),
- MODIFY ClientID VARCHAR(15);
-@end example
-
-¤³¤ì¤Ç @code{EXPLAIN} ¤Ï°Ê²¼¤ò½ÐÎϤ·¤Þ¤¹¡§
-
-@example
-table type possible_keys key key_len ref rows Extra
-et ALL PRIMARY NULL NULL NULL 74
-tt ref AssignedPC,ClientID,ActualPC ActualPC 15 et.EMPLOYID 52 where used
-et_1 eq_ref PRIMARY PRIMARY 15 tt.AssignedPC 1
-do eq_ref PRIMARY PRIMARY 15 tt.ClientID 1
-@end example
-
-¤³¤ì¤Ï ``¤Û¤È¤ó¤É'' ºÇÎɤ˶ᤤ¤Ç¤¹¡£
-
-»Ä¤ëÌäÂê¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢@strong{MySQL} ¤Ï @code{tt.ActualPC} ¥Õ¥£¡¼¥ë¥ÉÆâ¤ÎÃͤ¬
-¤Þ¤ó¤Ù¤ó¤Ê¤¯Ê¬ÉÛ¤·¤Æ¤¤¤ë¤ÈÁÛÄꤷ¤Æ¤ª¤ê¡¢¤³¤Î @code{tt} ¥Æ¡¼¥Ö¥ë¤Î¾ì¹ç¤Ë¤ÏŬ¹ç¤·¤Þ¤»¤ó¡£
-¹¬±¿¤Ë¤â¡¢¤³¤ì¤ò @strong{MySQL} ¤Ë¶µ¤¨¤ë¤Î¤Ï¤È¤Æ¤â´Êñ¤Ç¤¹¡§
-
-@example
-shell> myisamchk --analyze PATH_TO_MYSQL_DATABASE/tt
-shell> mysqladmin refresh
-@end example
-
-¤³¤ì¤Ç join ¤Ï ``´°àú'' ¤Ç¤¹¡£
-@code{EXPLAIN} ¤Ï°Ê²¼¤Î·ë²Ì¤ò¼¨¤·¤Þ¤¹¡§
-
-@example
-table type possible_keys key key_len ref rows Extra
-tt ALL AssignedPC,ClientID,ActualPC NULL NULL NULL 3872 where used
-et eq_ref PRIMARY PRIMARY 15 tt.ActualPC 1
-et_1 eq_ref PRIMARY PRIMARY 15 tt.AssignedPC 1
-do eq_ref PRIMARY PRIMARY 15 tt.ClientID 1
-@end example
-
- @code{EXPLAIN} ¤Î½ÐÎÏÃæ¤Î @code{rows} ¹àÌܤϡ¢ @strong{MySQL} JOIN ¥ª¥×¥Æ¥£¥Þ¥¤¥¶¡¼
-¤Ë¤è¤ë¡¢``¿ä¬'' ¤Ç¤¹¡¨
-¥¯¥¨¥ê¤ÎºÇŬ²½¤Î¤¿¤á¤Ë¡¢¤³¤Î¿ôÃͤ¬¼ÂºÝ¤Ë¶á¤¤¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤¹¤Ù¤­¤Ç¤¹¡£
-¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢@code{SELECT} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ç @code{STRAIGHT_JOIN} ¤ò»ÈÍÑ
-¤·¡¢@code{FROM} Àá¤Ë°Û¤Ê¤ë½ç¤Ç¥Æ¡¼¥Ö¥ë¤òʤ٤뤳¤È¤Ç¡¢Îɤ¤¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤ò
-ÆÀ¤é¤ì¤Þ¤¹¡£
-
-@findex DESC
-@findex DESCRIBE
-@node DESCRIBE, COMMIT, EXPLAIN, Reference
-@section @code{DESCRIBE} ¹½Ê¸ (¥Õ¥£¡¼¥ë¥É¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÆÀ¤ë)
-
-@example
-@{DESCRIBE | DESC@} tbl_name @{col_name | wild@}
-@end example
-
-@code{DESCRIBE} ¤Ï¥Õ¥£¡¼¥ë¥É¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÍ¿¤¨¤Þ¤¹¡£
-@code{col_name} ¤Ï¥Õ¥£¡¼¥ë¥É¤Ï¥Õ¥£¡¼¥ë¥É̾¤Þ¤¿¤Ïʸ»úÎó¤Ç¤¹¡£
-ʸ»úÎó¤Ï SQL @samp{%},@samp{_} ¥ï¥¤¥ë¥É¥«¡¼¥É¤ò´Þ¤á¤Þ¤¹¡£
-
-¤â¤·¥Õ¥£¡¼¥ë¥É¤Î·¿¤¬¤¢¤Ê¤¿¤¬ @code{CREATE TABLE} ʸ¤ÇÍ¿¤¨¤¿Êª¤È°ã¤Ã¤Æ¤¤¤ë¤Ê¤é¡¢
-¤³¤ì¤Ï @strong{MySQL} ¤¬¥Õ¥£¡¼¥ë¥É¤Î·¿¤òÊѹ¹¤·¤Æ¤¤¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-@xref{Silent column changes}.
-
-@cindex Oracle compatibility
-@cindex Compatibility, with Oracle
-¤³¤Î¥³¥Þ¥ó¥É¤Ï Oracle ¤Î¸ß´¹¤Î¤¿¤á¤Ë¤¢¤ê¤Þ¤¹¡£
-
-@code{SHOW} ¹½Ê¸¤Ï»÷¤¿¤è¤¦¤Ê¾ðÊó¤òÄ󶡤·¤Þ¤¹¡£
-@xref{SHOW, , @code{SHOW}}.
-
-@findex BEGIN
-@findex COMMIT
-@findex ROLLBACK
-@node COMMIT, LOCK TABLES, DESCRIBE, Reference
-@section @code{BEGIN/COMMIT/ROLLBACK} ¹½Ê¸
-
-¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï @strong{MySQL} ¤Ï @code{autocommit} ¥â¡¼¥É¤ÇÆ°ºî¤·¤Þ¤¹¡£¤³
-¤ì¤Ï¡¢¹¹¿·¤ò¼Â¹Ô¤¹¤ë¤È¤¹¤°¤Ë @strong{MySQL} ¤¬¹¹¿·¤ò¥Ç¥£¥¹¥¯¤Ë³ÊǼ¤¹¤ë¤³¤È
-¤ò°ÕÌ£¤·¤Þ¤¹¡£
-
-¤â¤· @code{BDB} ·¿¤Î¥Æ¡¼¥Ö¥ë¤ò»ÈÍѤ¹¤ë¤Ê¤é, °Ê²¼¤Î¥³¥Þ¥ó¥É¤Ç @strong{MySQL} ¤ò
-@code{autocommit} ¥â¡¼¥É¤Ç¤Ï¤Ê¤¤¾õÂ֤ˤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡§
-
-@example
-SET AUTOCOMMIT=0
-@end example
-
-¤³¤Î¸å¡¢¥Ç¥£¥¹¥¯¤ËÊѹ¹¤ò³ÊǼ¤¹¤ë¤¿¤á¤Ë¤Ï @code{COMMIT} ¤ò»ÈÍѤ·¡¢¤Þ¤¿¡¢ÊÑ
-¹¹¤ò̵»ë¤¹¤ë¤¿¤á¤Ë¤Ï @code{ROLLBACK} ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-If you want to switch from @code{AUTOCOMMIT} mode for one serie of
-statements, you can use the @code{BEGIN} statement.
-
-@example
-BEGIN;
-SELECT @@A:=SUM(salary) FROM table1 WHERE type=1;
-UPDATE table2 SET summmary=@@A WHERE type=1;
-COMMIT;
-@end example
-
-Ãí°Õ: ¥È¥é¥ó¥¶¥¯¥·¥ç¥ó°ÂÁ´¥Æ¡¼¥Ö¥ë¤ò»ÈÍѤ·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢@code{autocommit}
-¥â¡¼¥É¤Î¥¹¥Æ¡¼¥¿¥¹¤Ë¤Ï°Í¸¤»¤º¤Ë¡¢Êѹ¹¤Ï¤¹¤°¤Ë³ÊǼ¤µ¤ì¤Þ¤¹¡£@xref{Table
-types}.
-
-@findex LOCK TABLES
-@findex UNLOCK TABLES
-@node LOCK TABLES, SET OPTION, COMMIT, Reference
-@section @code{LOCK TABLES/UNLOCK TABLES} ¹½Ê¸
-
-@example
-LOCK TABLES tbl_name [AS alias] @{READ | [READ LOCAL] | [LOW_PRIORITY] WRITE@}
- [, tbl_name @{READ | [LOW_PRIORITY] WRITE@} ...]
-...
-UNLOCK TABLES
-@end example
-
-@code{LOCK TABLES} ¤Ï¥«¥ì¥ó¥È¤Î¥¹¥ì¥Ã¥É¤Î¤¿¤á¤Ë¥Æ¡¼¥Ö¥ë¤ò¥í¥Ã¥¯¤·¤Þ¤¹¡£
-@code{UNLOCK TABLES} ¤Ï¤³¤Î¥¹¥ì¥Ã¥É¤ÎÁ´¤Æ¤Î¥í¥Ã¥¯¤ò²ò½ü¤·¤Þ¤¹¡£
-¥«¥ì¥ó¥È¥¹¥ì¥Ã¥É¤Ë¤è¤Ã¤Æ¥í¥Ã¥¯¤µ¤ì¤¿Á´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤Ï¡¢
-¥¹¥ì¥Ã¥É¤¬Â¾¤Î @code{LOCK TABLES} ¤òȯ¹Ô¤·¤¿¾ì¹ç¤ä¥µ¡¼¥Ð¡¼¤¬Àܳ¤òÊĤ¸¤¿¾ì¹ç¡¢
-¼«Æ°¤Ç²ò½ü¤µ¤ì¤Þ¤¹¡£
-
-¥¹¥ì¥Ã¥É¤¬¥Æ¡¼¥Ö¥ë¤Ë @code{READ} ¥í¥Ã¥¯¤ò»ý¤Ä¾ì¹ç¡¢¤½¤Î¥¹¥ì¥Ã¥É(¤È¾¤ÎÁ´¤Æ¤Î¥¹¥ì¥Ã¥É)¤Ï
-¥Æ¡¼¥Ö¥ë¤«¤é¤ÎÆɤ߹þ¤ß¤À¤±¤¬¤Ç¤­¤Þ¤¹¡£¥¹¥ì¥Ã¥É¤¬¥Æ¡¼¥Ö¥ë¤Ë @code{WRITE} ¥í¥Ã¥¯¤ò»ý¤Ä¾ì¹ç¡¢
-¤³¤Î¥¹¥ì¥Ã¥É¤À¤±¤¬¥Æ¡¼¥Ö¥ë¤Î @code{READ} ¤È @code{WRITE} ¤¬¤Ç¤­¤Þ¤¹¡£
-¾¤Î¥¹¥ì¥Ã¥É¤Ï¥Ö¥í¥Ã¥¯¤µ¤ì¤Þ¤¹¡£
-
-@code{READ LOCAL} ¤È @code{READ} ¤Î°ã¤¤¤Ï¡¢@code{READ LOCAL} ¤Ï¡¢¥í¥Ã¥¯¤¬
-ÊÝ»ý¤µ¤ì¤Æ¤¤¤ë´Ö¤Ë¥³¥ó¥Õ¥ê¥¯¥È¤·¤Ê¤¤ @code{INSERT} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤ò¼Â¹Ô¤Ç
-¤­¤ë¤³¤È¤Ç¤¹¡£¤¿¤À¤·¡¢¤³¤ì¤Ï¥í¥Ã¥¯¤òÊÝ»ý¤·¤Æ¤¤¤ë´Ö¤Ë @strong{MySQL} ¤Î³°¤Ç
-¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥¡¥¤¥ë¤òÁàºî¤·¤è¤¦¤È¤¹¤ë¾ì¹ç¤Ï»ÈÍѤǤ­¤Þ¤»¤ó¡£
-
-¤½¤ì¤¾¤ì¤Î¥¹¥ì¥Ã¥É¤Ï¤½¤ì¤é¤¬Á´¤Æ¤Î¥í¥Ã¥¯¤òÆÀ¤ë¤Þ¤ÇÂÔ¤Á¤Þ¤¹(¥¿¥¤¥à¥¢¥¦¥È̵¤·)¡£
-
-@code{WRITE} ¥í¥Ã¥¯¤ÏÉáÄÌ¡¢¤Ç¤­¤ë¸Â¤ê¹¹¿·¤ò¹Ô¤ï¤»¤ë¤¿¤á¡¢
- @code{READ} ¥í¥Ã¥¯¤è¤ê¤âÍ¥Àè½ç°Ì¤¬¹â¤¯¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
-¤³¤ì¤Ï¤¢¤ë¥¹¥ì¥Ã¥É¤¬ @code{READ} ¥í¥Ã¥¯¤ò¤«¤±¡¢¤½¤ì°Ê³°¤Î¥¹¥ì¥Ã¥É¤¬ @code{WRITE} ¤ò
-Í׵ᤷ¤¿¾ì¹ç¡¢ @code{READ} ¤Ï¡¢@code{WRITE} ¥¹¥ì¥Ã¥É¤¬¥í¥Ã¥¯¤ò¤·¡¢¤½¤ì¤ò²ò½ü¤¹¤ë¤Þ¤Ç
-ÂԤĤȤ¤¤¦¤³¤È¤Ç¤¹¡£
-@code{LOW_PRIORITY WRITE} ¤ò»ÈÍѤ¹¤ì¤Ð¡¢
-@code{WRITE} ¥í¥Ã¥¯¤òÂԤäƤ¤¤ë¥¹¥ì¥Ã¥É¤Ë @code{READ} ¥í¥Ã¥¯¤òÆÀ¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@code{LOW_PRIORITY WRITE} ¤Ï @code{READ} ¥í¥Ã¥¯¤ò¤·¤Æ¤¤¤ë¥¹¥ì¥Ã¥É¤¬°ì¤Ä¤â¤Ê¤¤¤È
-¤ï¤«¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£
-
-@code{LOCK TABLES} ¤ò»ÈÍѤ¹¤ë¤È¤­¡¢»ÈÍѤ·¤è¤¦¤È¤¹¤ëÁ´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤ò¥í¥Ã
-¥¯¤¹¤Ù¤­¤Ç¤¹¡ª
-¤½¤·¤Æ¥¯¥¨¥ê¤Ç»ÈÍѤ·¤è¤¦¤È¤·¤Æ¤¤¤ë¤Î¤ÈƱ¤¸¥¨¥¤¥ê¥¢¥¹¤ò»È¤ï¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡ª
-¤â¤·¥¯¥¨¥ê¤ÇÊÂÎó¤ËÊ£¿ô²ó¥Æ¡¼¥Ö¥ë¤ò»ÈÍѤ¹¤ë¤Ê¤é(alias ¤ò¤È¤â¤Ê¤Ã¤Æ)¡¢
-¤½¤ì¤¾¤ì¤Î alias ¤ò¥í¥Ã¥¯¤¹¤Ù¤­¤Ç¤¹¡ª
-¤³¤Î¥Ý¥ê¥·¡¼¤Ï¥Æ¡¼¥Ö¥ë¥í¥Ã¥¯¤ò¥Ç¥Ã¥É¥í¥Ã¥¯¥Õ¥ê¡¼¤Ë¤¹¤ë¤³¤È¤ò³Î¤«¤Ë¤·¤Þ¤¹¡£
-
-@code{INSERT DELAYED} ¤Ç»ÈÍѤ·¤Æ¤¤¤ë¤¤¤«¤Ê¤ë¥Æ¡¼¥Ö¥ë¤â¡¢¥í¥Ã¥¯¤¹¤Ù¤­¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-¤³¤Î¾ì¹ç @code{INSERT} ¤ÏÊ̤Υ¹¥ì¥Ã¥É¤Ç¹Ô¤Ê¤ï¤ì¤ë¤«¤é¤Ç¤¹¡£
-
-Ä̾Á´¤Æ¤Îñ°ì¤Î @code{UPDATE} ¹½Ê¸¤Ë¤ª¤¤¤Æ¤Ï¡¢¥Æ¡¼¥Ö¥ë¤ò¥í¥Ã¥¯¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡¨
-¥¹¥ì¥Ã¥É¤Ï¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤¬¸½ºß¼Â¹Ô¤·¤Æ¤¤¤ë SQL ʸ¤Ë´³¾Ä¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£
-¤³¤ì¤é¤Ï¥Æ¡¼¥Ö¥ë¤ò¥í¥Ã¥¯¤·¤¿Êý¤¬¤è¤¤¡¢¤Þ¤ì¤Ê¾ì¹ç¤Ç¤¹¡§
-
-@itemize @bullet
-@item
-¥Æ¡¼¥Ö¥ë¤ò¤Þ¤È¤á¤Æ¿¤¯¤ÎÁàºî¤ò¼Â¹Ô¤·¤è¤¦¤È¤¹¤ë¾ì¹ç¡¢»ÈÍѤ·¤è¤¦¤È¤·¤Æ¤¤¤ë¥Æ¡¼
-¥Ö¥ë¤ò¥í¥Ã¥¯¤¹¤ë¤È¤È¤Æ¤â®¤¯¤Ê¤ê¤Þ¤¹¡£¤â¤Á¤í¤ó¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤Ï @code{READ} ¥í¥Ã
-¥¯¤µ¤ì¤¿¥Æ¡¼¥Ö¥ë¤Î¹¹¿·¤Ï¤Ç¤­¤Þ¤»¤ó¤·¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤Ï @code{WRITE} ¥í¥Ã¥¯¤µ¤ì¤¿
-¥Æ¡¼¥Ö¥ë¤òÆɤळ¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£
-@item
-@code{MySQL} ¤Ï¥È¥é¥ó¥¶¥¯¥·¥ç¥ó´Ä¶­¤ò¥µ¥Ý¡¼¥È¤·¤Ê¤¤¤¿¤á¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤¬
-@code{SELECT},@code{UPDATE}¤Î´Ö¤ËÍè¤Ê¤¤¤³¤È¤òÊݾڤ·¤¿¤¤¾ì¹ç¤Ï¡¢
-@code{LOCK TABLES} ¤ò»ÈÍѤ¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-¼¡¤ÎÎã¤Ï°ÂÁ´¤Î¤¿¤á¤Ë¤Ï @code{LOCK TABLES} ¤òɬÍפȤ·¤Þ¤¹¡§
-
-@example
-mysql> LOCK TABLES trans READ, customer WRITE;
-mysql> select sum(value) from trans where customer_id= some_id;
-mysql> update customer set total_value=sum_from_previous_statement
- where customer_id=some_id;
-mysql> UNLOCK TABLES;
-@end example
-
- @code{LOCK TABLES} ¤ò»ÈÍѤ·¤Ê¤¤¾ì¹ç¡¢@code{SELECT} ¤Î¼Â¹Ô¤È @code{UPDATE} ¤Î
-¼Â¹Ô¤ò¹Ô¤¦´Ö¤Ë¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤¬¿·¤·¤¤ @code{trans} ¹Ô¤òÁÞÆþ¤¹¤ë·ä¤¬¤Ç¤­¤Þ¤¹¡£
-@end itemize
-
-Áý²Ã¹¹¿· (@code{UPDATE customer SET value=value+new_value}) ¤Þ¤¿¤Ï
-@code{LAST_INSERT_ID()} ´Ø¿ô¤Î»ÈÍѤˤè¤ê¡¢Â¿¤¯¤Î¾ì¹ç @code{LOCK TABLES} ¤ò²óÈò
-¤Ç¤­¤Þ¤¹¡£
-
-¤¤¤¯¤Ä¤«¤Î¾ì¹ç¡¢¥æ¡¼¥¶¥ì¥Ù¥ë¥í¥Ã¥¯: @code{GET_LOCK()} ¤È @code{RELEASE_LOCK()} ¤Î»ÈÍÑ
-¤Ë¤è¤Ã¤Æ¤â²ò·è¤Ç¤­¤Þ¤¹¡£¤³¤ì¤é¤Î¥í¥Ã¥¯¤Ï¥µ¡¼¥ÐÆâ¤Î¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ëÆâ¤ËÊÝ
-»ý¤µ¤ì¡¢¹â®¤Î¤¿¤á @code{pthread_mutex_lock()} ¤Ç¼ÂÁõ¤µ¤ì¤Þ¤·¤¿¡£
-@xref{Miscellaneous functions}.
-
-¥í¥Ã¥¯¥Ý¥ê¥·¡¼¤Î¤µ¤é¤Ê¤ë¾ðÊó¤Ë¤Ä¤¤¤Æ¤Ï @ref{Internal locking} ¤ò¸«¤Æ¤¯¤À¤µ
-¤¤¡£
-
-@findex SET OPTION
-@node SET OPTION, GRANT, LOCK TABLES, Reference
-@section @code{SET OPTION} ¹½Ê¸
-
-@example
-SET [OPTION] SQL_VALUE_OPTION= value, ...
-@end example
-
-@code{SET OPTION} ¤Ï¥µ¡¼¥Ð¤ä¥¯¥é¥¤¥¢¥ó¥È¤ÎÁàºî¤Ë±Æ¶Á¤¹¤ëÍÍ¡¹¤Ê¥ª¥×¥·¥ç¥ó¤òÀßÄꤷ¤Þ¤¹.
-¸½ºß¤Î¥»¥Ã¥·¥ç¥ó¤¬½ª¤ï¤ë¤«,¤Þ¤¿¤Ï¤¢¤Ê¤¿¤¬°Û¤Ê¤Ã¤¿Ãͤ˥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë¤Þ¤Ç,
-ÀßÄꤵ¤ì¤¿¥ª¥×¥·¥ç¥óÃͤϻĤäƤ¤¤Þ¤¹.
-
-@table @code
-@item CHARACTER SET character_set_name | DEFAULT
-¤³¤ì¤Ï»ØÄꤵ¤ì¤¿¥Þ¥Ã¥Ô¥ó¥°¤Ë½¾¤Ã¤Æ¡¢¤¹¤Ù¤Æ¤Îʸ»úÎó¤ò¥¯¥é¥¤¥¢¥ó¥È¤«¤é¥¯¥é¥¤¥¢¥ó¥È¤Ë¥Þ¥Ã¥×¤·¤Þ¤¹.
-¸½ºß¡¢@code{character_set_name} ¤Ë»ØÄê¤Ç¤­¤ë¥ª¥×¥·¥ç¥ó¤Ï @code{cp1251_koi8} ¤À¤±¤Ç¤¹¤¬,
-@strong{MySQL} ¤Î¥½¡¼¥¹Ãæ¤Ë¤¢¤ë @file{sql/convert.cc} ¥Õ¥¡¥¤¥ë¤òÊÔ½¸¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ,
-Íưפ˿·¤·¤¤¥Þ¥Ã¥Ô¥ó¥°¤ò²Ã¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹. ɸ½à¤Î¥Þ¥Ã¥Ô¥ó¥°¤ËÌ᤹¤Ë¤Ï¡¢
-@code{character_set_name} ¤Ë @code{DEFAULT} ¤ò»ØÄꤷ¤Þ¤¹¡£
-
-@code{CHARACTER SET} ¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë¤¿¤á¤Î¹½Ê¸¤Ï¡¢
-¾¤Î¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë¹½Ê¸¤È°Û¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤.
-
-@item PASSWORD = PASSWORD('some password')
-@cindex Passwords, setting
-¸½ºß¤Î¥æ¡¼¥¶¤Î¥Ñ¥¹¥ï¡¼¥É¤òÀßÄꤷ¤Þ¤¹¡£¤¤¤«¤Ê¤ëÈóƿ̾¤Î¥æ¡¼¥¶¤â¡¢
-¼«Ê¬¼«¿È¥Ñ¥¹¥ï¡¼¥É¤òÊѤ¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹!
-
-@item PASSWORD FOR user = PASSWORD('some password')
-@cindex Passwords, setting
-¸½ºß¥í¥°¥¤¥ó¤·¤Æ¤¤¤ë¥Û¥¹¥È¤ÎÆÃÄê¥æ¡¼¥¶¤Î¥Ñ¥¹¥ï¡¼¥É¤òÀßÄꤷ¤Þ¤¹¡£
-@code{mysql} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¥¢¥¯¥»¥¹¤¬¤Ç¤­¤ë¥æ¡¼¥¶¡¼¤À¤±¤¬¼Â¹Ô¤Ç¤­¤Þ¤¹¡£
-¥æ¡¼¥¶¤Ï @code{user@@hostname} ·Á¼°¤ÇÍ¿¤¨¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-¤³¤³¤Ç @code{user} ¤È @code{hostname} ¤Ï¡¢@code{mysql.user} ¥Æ¡¼¥Ö¥ë¤Î
-@code{User}, @code{Host} ¥Õ¥£¡¼¥ë¥É¤ËÅÐÏ¿¤µ¤ì¤Æ¤¤¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-Î㤨¤Ð¡¢@code{User} ¤È @code{Host} ¥Õ¥£¡¼¥ë¥É¤¬ @code{'bob'} ¤È
-@code{'%.loc.gov'} ¤Ê¤é¤Ð¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-
-@example
-mysql> SET PASSWORD FOR bob@@"%.loc.gov" = PASSWORD("newpass");
-
-¤Þ¤¿¤Ï
-
-mysql> UPDATE mysql.user SET password=PASSWORD("newpass") where user="bob' and host="%.loc.gov";
-@end example
-
-@item SQL_AUTO_IS_NULL = 0 | 1
-@code{1} (¥Ç¥Õ¥©¥ë¥È) ¤òÀßÄꤹ¤ë¤È¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Æ¡¢auto_increment ¥ì¥³¡¼
-¥É¤ò»ý¤Ä¥Æ¡¼¥Ö¥ë¤Ç¡¢ºÇ¸å¤ËÁÞÆþ¤µ¤ì¤¿¥ì¥³¡¼¥É¤ò¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹:
-@code{WHERE auto_increment_column IS NULL}¡£¤³¤ì¤Ï¡¢Access ¤Î¤è¤¦¤Ê¤¤¤¯¤Ä
-¤«¤Î ODBC ¥×¥í¥°¥é¥à¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤Þ¤¹¡£
-
-@item SET AUTOCOMMIT= 0 | 1
-@code{1} ¤òÀßÄꤹ¤ë¤È¡¢¥Æ¡¼¥Ö¥ë¤Ø¤Î¤¹¤Ù¤Æ¤ÎÊѹ¹¤Ï¤¹¤°¤Ë¹Ô¤Ê¤ï¤ì¤Þ¤¹¡£
-To start
-an multi command transaction you have to use the @code{BEGIN}
-statement. @xref{COMMIT}.
-@code{0} ¤òÀßÄꤹ¤ë¤È¡¢¤½¤Î¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤òµö²Ä/ÇË´þ¤¹¤ë¤¿¤á¤Ë¡¢
-@code{COMMIT} / @code{ROLLBACK} ¤ò»ÈÍѤ¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£@xref{COMMIT}¡£
-Ãí°Õ: Èó @code{AUTOCOMMIT} ¥â¡¼¥É¤«¤é @code{AUTOCOMMIT} ¥â¡¼¥É¤ËÊѹ¹¤¹¤ë»þ¡¢
-@strong{MySQL} ¤Ï¤¹¤Ù¤Æ¤Î¥ª¡¼¥×¥ó¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤ò¼«Æ°Åª¤Ë
-@code{COMMIT} ¤·¤Þ¤¹¡£
-
-@item SQL_BIG_TABLES = 0 | 1
-@cindex The table is full
-@code{0} ¤Î¾ì¹ç¡¢Á´¤Æ¤Î°ì»þ¥Æ¡¼¥Ö¥ë¤Ï¥á¥â¥ê¡¼¤Ç¤Ï¤Ê¤¯¥Ç¥£¥¹¥¯¤Ë½ñ¤­½Ð¤µ¤ì¤Þ¤¹¡£
-¤³¤ì¤Ï¾¯¤·ÃÙ¤¯¤Ê¤ê¤Þ¤¹¤¬¡¢Â¿¤¯¤Î°ì»þ¥Æ¡¼¥Ö¥ë¤òɬÍפȤ¹¤ëÂ礭¤Ê @code{SELECT} ¤ò
-¼Â¹Ô¤·¤Æ¤â¡¢@code{The table tbl_name is full} ¥¨¥é¡¼¤¬½Ð¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£
-¿·¤·¤¤Àܳ¤Ë¤ª¤±¤ë¤³¤ÎÃͤΥǥե©¥ë¥ÈÃÍ¤Ï @code{1} (¥á¥â¥ê¡¼¤Ë°ì»þ¥Æ¡¼¥Ö¥ë¤òºî¤ë)
-¤Ç¤¹¡£
-
-@item SQL_BIG_SELECTS = 0 | 1
-@code{1} ¤Î¾ì¹ç¡¢¤È¤Æ¤â»þ´Ö¤Î¤«¤«¤ë @code{SELECT} ¤¬¼Â¹Ô¤µ¤ì¤¿¾ì¹ç¡¢
-@strong{MySQL} ¤Ï¤½¤ì¤òÃæ»ß¤·¤Þ¤¹¡£
-¤³¤ì¤Ï¤¢¤Þ¤ê˧¤·¤¯¤Ê¤¤(´Ö°ã¤Ã¤¿) @code{WHERE} ¹½Ê¸¤¬È¯¹Ô¤µ¤ì¤¿¤È¤­¤ËÌòΩ¤Á¤Þ¤¹¡£
-@code{max_join_size} ¹Ô°Ê¾å¤ò¸¡Æ¤¤¹¤ë¤è¤¦¤Ê @code{SELECT} ¤¬
-Â礭¤Ê¥¯¥¨¥ê¤ÈÄêµÁ¤µ¤ì¤Þ¤¹¡£
-¿·¤·¤¤Àܳ¤Ë¤ª¤±¤ë¤³¤ÎÃͤΥǥե©¥ë¥ÈÃÍ¤Ï @code{0} ¤Ç¤¹¡£
-(Á´¤Æ¤Î @code{SELECT} ¹½Ê¸¤òµö¤·¤Þ¤¹)
-
-@item SQL_BUFFER_RESULT = 0 | 1
-@code{SQL_BUFFER_RESULT} ¤Ï°ì»þ¥Õ¥¡¥¤¥ë¤ËÃÖ¤«¤ì¤ë @code{SELECT} ¤«¤é¤Î·ë²Ì
-¤ò¶¯À©Åª¤ËÃÖ¤­¤Þ¤¹¡£¤³¤ì¤Ï @strong{MySQL} ¤¬¥Æ¡¼¥Ö¥ë¥í¥Ã¥¯¤òÁ᤯²òÊü¤¹¤ë¼ê
-½õ¤±¤ò¤·¡¢¥¯¥é¥¤¥¢¥ó¥È¤Ø·ë²Ì¥»¥Ã¥È¤òÁ÷¿®¤¹¤ë¤¿¤á¤ËŤ¤»þ´Ö¤¬³Ý¤«¤ë¾ì¹ç¤ËÌò
-Ω¤Á¤Þ¤¹¡£
-
-@item SQL_LOW_PRIORITY_UPDATES = 0 | 1
-@code{1} ¤Î¾ì¹ç¡¢Á´¤Æ¤Î @code{INSERT}, @code{UPDATE}, @code{DELETE},
- @code{LOCK TABLE WRITE}¹½Ê¸¤Ï¡¢
-ÂоݤȤʤë¥Æ¡¼¥Ö¥ë¤ò½èÍýÃæ¤Î @code{SELECT} ¤ä @code{LOCK TABLE READ}
-¤¬¤Ê¤¯¤Ê¤ë¤Þ¤ÇÂÔ¤Á¤Þ¤¹¡£
-
-@item SQL_MAX_JOIN_SIZE = value | DEFAULT
-¤ª¤½¤é¤¯ @code{value} ¤è¤ê¤â¿¤¤¥ì¥³¡¼¥É¤ÎÁȹ礻¤ò»î¸³¤¹¤ëɬÍפ¬¤¢¤ë¤è¤¦¤Ê
-@code{SELECT} ¤òµö²Ä¤·¤Þ¤»¤ó¡£¤³¤ÎÃͤòÀßÄꤹ¤ë¤³¤È¤Ç¡¢¥­¡¼¤¬»ÈÍѤµ¤ì¤Ê¤¤¤Ç
-¤¢¤í¤¦ @code{SELECT} ¤ÈŤ¤»þ´Ö¤¬³Ý¤«¤ë¤Ç¤¢¤í¤¦ @code{SELECT} ¤òÊ᪤Ǥ­¤Þ
-¤¹¡£¤³¤ì¤ò @code{DEFAULT} °Ê³°¤ÎÃͤËÀßÄꤹ¤ë¤È¡¢@code{SQL_BIG_SELECTS} ¥Õ
-¥é¥°¤ò¥ê¥»¥Ã¥È¤·¤Þ¤¹¡£@code{SQL_BIG_SELECTS} ¥Õ¥é¥°¤òºÆ¤ÓÀßÄꤹ¤ë¤È¡¢
-@code{SQL_MAX_JOIN_SIZE} ÊÑ¿ô¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£@code{-O max_join_size=#} ¤Ç
-@code{mysqld} ¤òµ¯Æ°¤¹¤ë¤³¤È¤Ç¡¢¤³¤ÎÊÑ¿ô¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤòÀßÄê¤Ç¤­¤Þ¤¹¡£
-
-@item SQL_SAFE_MODE = 0 | 1
-@code{1} ¤ËÀßÄꤹ¤ë¤È¡¢@code{WHERE} ÀáÆâ¤Ç¥­¡¼¤ä @code{LIMIT} ¤ò»ÈÍѤ·¤Ê¤¤
-¤Ç @code{UPDATE} ¤Þ¤¿¤Ï @code{DELETE} ¤ò¹Ô¤Ê¤ª¤¦¤È¤·¤¿¾ì¹ç¤Ë
-@strong{MySQL} ¤¬¥¢¥Ü¡¼¥È¤·¤Þ¤¹¡£¤³¤ì¤Ï¡¢¼ê¤Ç SQL ¥³¥Þ¥ó¥É¤òÀ¸À®¤¹¤ë»þ¤Î´Ö
-°ã¤Ã¤¿¹¹¿·¤ÎÊ᪤ò²Äǽ¤Ë¤·¤Þ¤¹¡£
-
-@item SQL_SELECT_LIMIT = value | DEFAULT
-@code{SELECT} ¹½Ê¸¤«¤éÊÖ¤µ¤ì¤ë¥ì¥³¡¼¥É¤ÎºÇÂçÃÍ¡£
-¤â¤· @code{SELECT} ¤Ë @code{LIMIT} Àá¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢@code{LIMIT} ¤Ï
- @code{SQL_SELECT_LIMIT} ¤ÎÃͤè¤êÍ¥À褵¤ì¤Þ¤¹¡£
-¿·¤·¤¤Àܳ¤Ë¤ª¤±¤ë¤³¤ÎÃͤÎɸ½àÃÍ¤Ï ``unlimited''.
-¤â¤·¥ê¥ß¥Ã¥È¤òÊѤ¨¤Æ¤¤¤ë¤Ê¤é¤Ð¡¢@code{SQL_SELECT_LIMIT} ¤Ë
- @code{DEFAULT} ¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤ê¡¢É¸½àÃͤËÌ᤹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@item SQL_LOG_OFF = 0 | 1
-¤³¤ÎÃͤ¬ @code{1} ¤Î¾ì¹ç¡¢¤â¤·¥¯¥é¥¤¥¢¥ó¥È¤¬ @strong{process} ¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤ë¤Ê¤é¤Ð¡¢
-¤³¤Î¥¯¥é¥¤¥¢¥ó¥È¤Î¥í¥°¤¬¹Ô¤ï¤ì¤Þ¤»¤ó¡£
-¤³¤ì¤Ï¹¹¿·¥í¥°¤Ë±Æ¶Á¤·¤Þ¤»¤ó¡ª
-
-@item SQL_LOG_UPDATE = 0 | 1
-@code{0} ¤Î¾ì¹ç¡¢¤â¤·¥¯¥é¥¤¥¢¥ó¥È¤¬ @strong{process} ¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤ë¤Ê¤é¤Ð¡¢
-¤³¤Î¥¯¥é¥¤¥¢¥ó¥È¤Î¹¹¿·¥í¥°¤Îµ­Ï¿¤Ï¹Ô¤ï¤ì¤Þ¤»¤ó¡£
-¤³¤ì¤ÏÄ̾ï¤Î¥í¥°¤Ë¤Ï±Æ¶Á¤·¤Þ¤»¤ó¡ª
-
-@item TIMESTAMP = timestamp_value | DEFAULT
-¥¯¥é¥¤¥¢¥ó¥È¤Ë»þ´Ö¤òÀßÄꤷ¤Þ¤¹¡£
-¤â¤·¥ì¥³¡¼¥É¤Î¥ê¥¹¥È¥¢¤Ë¹¹¿·¥í¥°¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢¥ª¥ê¥¸¥Ê¥ë¤Î¥¿¥¤¥à¥¹¥¿¥ó¥×¤òÆÀ¤ë¤¿¤á¤Ë»ÈÍѤ·¤Þ¤¹¡£
-
-@item LAST_INSERT_ID = #
-@code{LAST_INSERT_ID()} ¤«¤é¤ÎÊÖ¤êÃͤòÀßÄꤷ¤Þ¤¹¡£
-¥Æ¡¼¥Ö¥ë¤ò¹¹¿·¤¹¤ë¥³¥Þ¥ó¥ÉÃæ¤Ë @code{LAST_INSERT_ID()} ¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢
-¤³¤ì¤Ï¹¹¿·¥í¥°¤ËÊݸ¤µ¤ì¤Þ¤¹¡£
-
-@item INSERT_ID = #
- @code{AUTO_INCREMENT} ÃͤòÁÞÆþ¤¹¤ë»þ¡¢
-@code{INSERT} ¥³¥Þ¥ó¥É¤Ë½¾¤Ã¤Æ»ÈÍѤµ¤ì¤ëÃͤò¥»¥Ã¥È¤·¤Þ¤¹¡£
-¤³¤ì¤Ï¹¹¿·¥í¥°¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤Þ¤¹¡£
-
-@end table
-
-@findex GRANT
-@findex REVOKE
-@node GRANT, CREATE INDEX, SET OPTION, Reference
-@section @code{GRANT} ¤È @code{REVOKE} ¹½Ê¸
-
-@example
-GRANT priv_type [(column_list)] [, priv_type [(column_list)] ...]
- ON @{tbl_name | * | *.* | db_name.*@}
- TO user_name [IDENTIFIED BY 'password']
- [, user_name [IDENTIFIED BY 'password'] ...]
- [WITH GRANT OPTION]
-
-REVOKE priv_type [(column_list)] [, priv_type [(column_list)] ...]
- ON @{tbl_name | * | *.* | db_name.*@}
- FROM user_name [, user_name ...]
-@end example
-
-@code{GRANT} ¤Ï @strong{MySQL} 3.22.11 °Ê¾å¤Ç¼ÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤¹; Á°¤Î
-@strong{MySQL} ¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢@code{GRANT} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ï²¿¤â¹Ô¤Ê¤¤¤Þ
-¤»¤ó¡£
-
-@code{GRANT} ¤È @code{REVOKE} ¥³¥Þ¥ó¥É¥»¥Ã¥È¤Î¼ç¤ÊÌÜŪ¤Ï¡¢¥·¥¹¥Æ¥à´ÉÍý¼Ô
-¤¬ @strong{MySQL} ¥æ¡¼¥¶¤Ë¼¡¤Î£´¤Ä¤Î¸¢¸Â¥ì¥Ù¥ë¤Î¸¢Íø¤òÍ¿¤¨¤¿¤ê¼è¤ê¾Ã¤¹¤³
-¤È¤ò¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¤³¤È¤Ç¤¹:
-
-@table @strong
-@item Global ¥ì¥Ù¥ë
-Global ¸¢¸Â¤ÏÍ¿¤¨¤é¤ì¤¿¥µ¡¼¥Ð¾å¤ÎÁ´¤Æ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËŬÍѤ·¤Þ¤¹¡£¤³¤ì¤é¤Î¸¢¸Â¤Ï
-@code{mysql.user} ¥Æ¡¼¥Ö¥ëÆâ¤Ë³ÊǼ¤µ¤ì¤Þ¤¹¡£
-
-@item Database ¥ì¥Ù¥ë
-Database ¸¢¸Â¤ÏÍ¿¤¨¤é¤ì¤¿¥Ç¡¼¥¿¥Ù¡¼¥¹Æâ¤ÎÁ´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤ËŬÍѤ·¤Þ¤¹¡£¤³
-¤ì¤é¤Î¸¢¸Â¤Ï @code{mysql.db} ¥Æ¡¼¥Ö¥ë¤È @code{mysql.host} ¥Æ¡¼¥Ö¥ëÆâ¤Ë³ÊǼ¤µ¤ì¤Þ¤¹¡£
-
-@item Table ¥ì¥Ù¥ë
-Table ¸¢¸Â¤ÏÍ¿¤¨¤é¤ì¤¿¥Æ¡¼¥Ö¥ëÆâ¤ÎÁ´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤ËŬÍѤ·¤Þ¤¹¡£¤³¤ì¤é¤Î¸¢¸Â¤Ï
-@code{mysql.tables_priv} ¥Æ¡¼¥Ö¥ëÆâ¤Ë³ÊǼ¤µ¤ì¤Þ¤¹¡£
-
-@item Column ¥ì¥Ù¥ë
-Column ¸¢¸Â¤ÏÍ¿¤¨¤é¤ì¤¿¥Æ¡¼¥Ö¥ëÆâ¤Î°ì¤Ä¤Î¥Õ¥£¡¼¥ë¥É¤ËŬÍѤ·¤Þ¤¹¡£¤³¤ì¤é¤Î¸¢¸Â¤Ï
-@code{mysql.column_priv} ¥Æ¡¼¥Ö¥ëÆâ¤Ë³ÊǼ¤µ¤ì¤Þ¤¹¡£
-@end table
-
-@code{GRANT} ¤ÎÆ°ºîÎã¤Ï ¢ª @ref{Adding users}.
-
-@code{GRANT} ¤È @code{REVOKE} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ë¤ª¤¤¤Æ @code{priv_type} ¤Ë¤Ï
-°Ê²¼¤¬»ØÄê¤Ç¤­¤Þ¤¹:
-
-@example
-ALL PRIVILEGES FILE RELOAD
-ALTER INDEX SELECT
-CREATE INSERT SHUTDOWN
-DELETE PROCESS UPDATE
-DROP REFERENCES USAGE
-@end example
-
-@code{ALL} ¤Ï @code{ALL PRIVILEGES} ¤ÎƱµÁ¸ì¤Ç¤¹.
-@code{REFERENCES} ¤Ï¤Þ¤À¼Â¹Ô¤µ¤ì¤Þ¤»¤ó¡£
-@code{USAGE} ¤Ï ``no privileges'' ¤ÈƱµÁ¤Ç¤¹.
-¤³¤ì¤Ï¤Ê¤ó¤Î¸¢¸Â¤â»ý¤¿¤Ê¤¤¥æ¡¼¥¶¡¼¤òºî¤ë¾ì¹ç¤Ë»ÈÍѤ·¤Þ¤¹.
-
-¥æ¡¼¥¶¡¼¤«¤é¸¢¸Âµö²Ä¤ò¼è¤ê½ü¤¯¤Ë¤Ï¡¢@code{GRANT OPTION} ¥ª¥×¥·¥ç¥ó¤ÎÃͤË
-@code{priv_type} ¤ò»ØÄꤷ¤Þ¤¹¡§
-
-@example
-REVOKE GRANT OPTION ON ... FROM ...;
-@end example
-
-¥Æ¡¼¥Ö¥ë¤ËÂФ¹¤ëµö²Ä¤Î¤¿¤á¤Ë»ØÄê¤Ç¤­¤ë @code{priv_type} ¤Ï¼¡¤Î¥Õ¥£¡¼¥ë¥É¤À¤±¤Ç¤¹¡§
-@code{SELECT},@code{INSERT}, @code{UPDATE}, @code{DELETE}, @code{CREATE}, @code{DROP},
-@code{GRANT}, @code{INDEX}, @code{ALTER}.
-
-¥Õ¥£¡¼¥ë¥É¤ËÂФ¹¤ëµö²Ä¤Î¤¿¤á¤Ë»ØÄê¤Ç¤­¤ë @code{priv_type} ¤Ï¼¡¤Î¥Õ¥£¡¼¥ë¥É¤À¤±¤Ç¤¹
-(¤³¤ì¤Ï @code{column_list} Àá¤ò»ÈÍѤ¹¤ë¾ì¹ç¤ËŬÍѤµ¤ì¤Þ¤¹)¡§
-@code{SELECT}, @code{INSERT}, @code{UPDATE}.
-
-@code{WITH GRANT OPTION} Àá¤Ï¡¢@code{GRANT} ¹½Ê¸¤ò»ÈÍѤ·¤Æ
-¾¤Î¥æ¡¼¥¶¡¼¤Ë¸¢¸Â¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
-
-@code{ON *.*} ¤ò»ÈÍѤ·¤Æ¥°¥í¡¼¥Ð¥ë¸¢¸Â¤òÀßÄê¤Ç¤­¤Þ¤¹¡£
-@code{ON db_name.*} ¤ò»ÈÍѤ·¤Æ¥Ç¡¼¥¿¥Ù¡¼¥¹¸¢¸Â¤òÀßÄê¤Ç¤­¤Þ¤¹¡£@code{ON *} ¤ò
-»ØÄꤹ¤ë¤È¡¢¸½ºß¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¸¢¸Â¤òÀßÄê¤Ç¤­¤Þ¤¹¡£
-(@strong{·Ù¹ð¡§} ¸½ºß¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò»ý¤¿¤Ê¤¤¾õÂÖ¤Ç @code{ON *} ¤ò»ØÄꤷ¤¿¾ì¹ç¡¢
-global ¸¢¸Â¤Ë±Æ¶Á¤·¤Þ¤¹¡ª)
-
-¥æ¡¼¥¶¤Ø¤Î¸¢Íø¤Î¶¡Í¿¤ò¾¤Î¥Û¥¹¥È¤«¤éŬ±þ¤¹¤ë¤¿¤á¤Ë¡¢@strong{MySQL} ¤Ï
- @code{user_name} ¤ÎÃͤò @code{user@@host} ¤Î·Á¤Ç½ñ¤±¤ë¤è¤¦¤Ë¤·¤Æ¤¤¤Þ¤¹¡£
-Æüìʸ»ú(@samp{%} ¤Î¤è¤¦¤Ê)¤Ç @code{user_name} ¤ÎÃͤò»ØÄꤷ¤¿¤¤¾ì¹ç¡¢
-¥æ¡¼¥¶¤ä¥Û¥¹¥È̾¤ò¥¯¥©¡¼¥È¤Ç¤­¤Þ¤¹;
-(Î㤨¤Ð @code{'test-user'@@'test-hostname'})¡£
-
-¥Û¥¹¥È̾¤Ë¥ï¥¤¥ë¥É¥«¡¼¥É¤ò»ÈÍѤǤ­¤Þ¤¹¡£Î㤨¤Ð¡¢@code{user@@"%.loc.gov"} ¤Ï
-@code{loc.gov} ¥É¥á¥¤¥ó¤ÎÁ´¤Æ¤Î¥Û¥¹¥È¤Î @code{user} ¤òÍ¿¤¨¡¢
-@code{user@@"144.155.166.%"} ¤Ï @code{144.155.166} ¥¯¥é¥¹C¥µ¥Ö¥Í¥Ã¥È¤Î
-¤¢¤é¤æ¤ë¥Û¥¹¥È¤Î @code{user} ¤È¤Ê¤ê¤Þ¤¹¡£
-
-ñ¤Ë @code{user} ¤È½ñ¤¯¤È @code{user@@"%"} ¤ÈƱ¤¸¤Ç¤¹.
-@strong{Ãí°Õ¡§} ¤â¤·Æ¿Ì¾¥æ¡¼¥¶¡¼¤«¤é¤Î @strong{MySQL} ¥µ¡¼¥Ð¡¼¤Ø¤ÎÀܳ¤ò
-µö¤¹¾ì¹ç(¥Ç¥Õ¥©¥ë¥È¤Ç¤¹)¡¢Á´¤Æ¤Î¥í¡¼¥«¥ë¥æ¡¼¥¶¡¼ @code{username@@localhost} ¤ò²Ã¤¨¤ë¤Ù¤­¤Ç¤¹¡£
-¤Ê¤¼¤Ê¤é¡¢Æ¿Ì¾¥æ¡¼¥¶¡¼¤ÏƱ¤¸¥Þ¥·¥ó¤«¤é @strong{MySQL} ¥µ¡¼¥Ð¡¼¤ËÆþ¤í¤¦¤È¤·¤¿¾ì¹ç¤Ë
-»ÈÍѤµ¤ì¤ë¤«¤é¤Ç¤¹¡ª
-ƿ̾¥æ¡¼¥¶¡¼¤Ï @code{mysql.user} ¥æ¡¼¥¶¡¼¥Æ¡¼¥Ö¥ë¤Ë¡¢ @code{User=''} ¤È¤·¤ÆÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-¤³¤ì¤ò³Îǧ¤¹¤ë¤Ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-
-@example
-mysql> SELECT Host,User FROM mysql.user WHERE User='';
-@end example
-
-¤µ¤·¤¢¤¿¤ê, @code{GRANT} ¤Ï¥Û¥¹¥È̾¡¢¥Æ¡¼¥Ö¥ë̾¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¡¢¥Õ¥£¡¼¥ë¥É̾¤Ë
-ºÇÂç60ʸ»ú¤Þ¤Ç»ÈÍѤǤ­¤Þ¤¹¡£¥æ¡¼¥¶¡¼Ì¾¤ÏºÇÂç16ʸ»ú¤Þ¤Ç¤Ç¤¹¡£
-
-¥Æ¡¼¥Ö¥ë/¥Õ¥£¡¼¥ë¥É¤Î¸¢¸Â¤Ï global(¥æ¡¼¥¶¤È¥Ç¡¼¥¿¥Ù¡¼¥¹)¸¢¸Â¤È
-@code{GRANT} ¸¢¸Â¤È @code{OR} ¤µ¤ì¤Þ¤¹¡£Î㤨¤Ð¡¢¥æ¡¼¥¶¤¬
-@code{mysql.user} ¥Æ¡¼¥Ö¥ëÆâ¤Î global @strong{select} ¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢
-¤³¤ì¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤ä¥Æ¡¼¥Ö¥ë/¥Õ¥£¡¼¥ë¥É¥ì¥Ù¥ëÆâ¤Î¥¨¥ó¥È¥ê¤Ç¤ÏµñÈݤǤ­¤Þ¤»¤ó¡£
-
-¥Õ¥£¡¼¥ë¥É¤Î¸¢Íø¤Ï¼¡¤Î¤è¤¦¤Ë·×»»¤Ç¤­¤Þ¤¹:
-@example
-global privileges
-OR (database privileges AND host privileges)
-OR table privileges
-OR column privileges
-@end example
-
-¿¤¯¤Î¾ì¹ç¡¢°Û¤Ê¤ë¸¢¸Â¥ì¥Ù¥ë¤Î°ì¤Ä¤Ç¥æ¡¼¥¶¤Ë¸¢Íø¤òÍ¿¤¨¤ë¤Î¤Ç¡¢¿ÍÀ¸¤ÏÄ̾ï
-¾å½Ò¤Î¤è¤¦¤Ë¤ÏÊ£»¨¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£:)
-¥¢¥¯¥»¥¹À©¸Â¤Î¥Á¥§¥Ã¥¯¤Î¾ÜºÙ¤Ï¢ª@ref{Privilege system}.
-
-¥æ¡¼¥¶¤Ø¤Î¸¢Íø¤Î¶¡Í¿¤ò¾¤Î¥Û¥¹¥È¤«¤éŬ±þ¤¹¤ë¤¿¤á¤Ë¡¢@strong{MySQL} ¤Ï¥æ¡¼
-¥¶Ì¾¤¬·Á¼° @code{user@@host} ¤Ç»ØÄê¤Ç¤­¤ë¤³¤È¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£´Êñ¤Ê·Á
-¼° @code{user} ¤Ï @code{user@@%} ¤ÎƱµÁ¸ì¤Ç¤¹¡£Æüìʸ»ú(@code{.} ¤Î¤è¤¦
-¤Ê)¤Ç¥Û¥¹¥È̾¤ò»ØÄꤷ¤¿¤¤¾ì¹ç¡¢@code{"user"@@"hostname"} ¹½Ê¸¤ò»ÈÍѤǤ­
-¤Þ¤¹¡£
-
-¥æ¡¼¥¶¤È¥Û¥¹¥È̾¤ÎÁȤ¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¡¢¥¨¥ó¥È¥ê¤Ï @code{mysql.user} ¥Æ¡¼
-¥Ö¥ë¤ËÄɲ䵤졢@code{DELETE} ¥³¥Þ¥ó¥É¤Çºï½ü¤µ¤ì¤ë¤Þ¤Ç¤½¤³¤Ë»Ä¤ê¤Þ¤¹¡£
-¤¤¤¦¤Ê¤é¤Ð @code{GRANT} ¤Ï @code{user} ¥Æ¡¼¥Ö¥ë¤ÎÅÐÏ¿¤òºî¤ê¤Þ¤¹¤¬¡¢
- @code{REVOKE} ¤Ï¤½¤ì¤é¤òºï½ü¤Ç¤­¤Þ¤»¤ó;
-¤½¤¦¤¹¤ë¤Ë¤Ï @code{DELETE} ¤ò»ÈÍѤ·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-
-@cindex Passwords, setting
-@strong{MySQL} 3.22.12 °Ê¾å¤Ç¤Ï¡¢
-¿·¤·¤¤¥æ¡¼¥¶¡¼¤¬ºîÀ®¤µ¤ì¤¿¾ì¹ç¡¢¤¢¤ë¤¤¤Ï¡¢¤¢¤Ê¤¿¤¬¥°¥í¡¼¥Ð¥ë¤Ê¸¢¸Â¤òµö²Ä¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢
-¥æ¡¼¥¶¡¼¤Î¥Ñ¥¹¥ï¡¼¥É¤Ï @code{IDENTIFIED BY} Àá¤ò»ÈÍѤ·¤ÆÀßÄê¤Ç¤­¤Þ¤¹¡£
-¤¹¤Ç¤Ë¥æ¡¼¥¶¡¼¤Ë¥Ñ¥¹¥ï¡¼¥É¤¬¤¢¤ë¾ì¹ç¡¢¿·¤·¤¯ÀßÄꤵ¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤ËÃÖ¤­´¹¤¨¤é¤ì¤Þ¤¹¡£
-
-@strong{·Ù¹ð¡§} ¤â¤·¿·¤·¤¤¥æ¡¼¥¶¡¼¤òºî¤Ã¤Æ¤â
-@code{IDENTIFIED BY} Àá¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¡¢ ¤½¤Î¥æ¡¼¥¶¡¼¤Ï¥Î¡¼¥Ñ¥¹¥ï¡¼¥É¤Ç¤¹¡£
-¤³¤ì¤Ï´í¸±¤Ç¤¹¡£
-
-¥Ñ¥¹¥ï¡¼¥É¤Ï @code{SET PASSWORD} ¥³¥Þ¥ó¥É¤Ç¤âÀßÄê¤Ç¤­¤Þ¤¹¡£
-@xref{SET OPTION, , @code{SET OPTION}}.
-
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¸¢¸Â¤ò @code{GRANT} ¤¹¤ë¾ì¹ç¡¢@code{mysql.db} ¥Æ¡¼¥Ö¥ëÆâ¤Î
-¥¨¥ó¥È¥ê¤ÏɬÍפʾì¹ç¤ËÀ¸À®¤µ¤ì¤Þ¤¹¡£Á´¤Æ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¸¢¸Â¤¬
-@code{REVOKE} ¤Çºï½ü¤µ¤ì¤¿»þ¡¢¤³¤Î¥¨¥ó¥È¥ê¤Ïºï½ü¤µ¤ì¤Þ¤¹¡£
-
-¥æ¡¼¥¶¤¬¥Æ¡¼¥Ö¥ë¤Ë²¿¤â¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢¥Æ¡¼¥Ö¥ë¤Î°ìÍ÷Í×µá»þ(Î㤨
-¤Ð¡¢@code{SHOW TABLES} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ç)¤Ë¤Ï¡¢¥Æ¡¼¥Ö¥ë¤Ï¸½¤ì¤Þ¤»¤ó¡£
-
-@code{WITH GRANT OPTION} Àá¤Ï¡¢Â¾¤Î¥æ¡¼¥¶¡¼¤Ë¡¢¼«Ê¬¤¬»ý¤Ã¤Æ¤¤¤ë¸¢¸Â¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@strong{¸¢¸Âµö²Ä}¤ò¾¤ËÍ¿¤¨¤ë¾ì¹ç¤ÏÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-¤¢¤Ê¤¿¤Èµö²Ä¤òÍ¿¤¨¤ë¥æ¡¼¥¶¡¼¤¬°ã¤¦¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢
-Í¿¤¨¤é¤ì¤ë¸¢¸Â¤Îµö²Ä¤Ï¡¢Æó¤Ä¤ò¹ç¤ï¤»¤¿Êª¤Ë¤Ê¤ê¤Þ¤¹¡ª
-
-¼«Ê¬¼«¿È¤¬»ý¤Ã¤Æ¤¤¤Ê¤¤¸¢¸Â¤ò¾¤Î¥æ¡¼¥¶¡¼¤ËÍ¿¤¨¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡¨
-@strong{¸¢¸Âµö²Ä}¤Ï¤¢¤Ê¤¿¤¬½êÍ­¤¹¤ë¸¢¸Â¤Îµö²Ä¤À¤±¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-¤¢¤Ê¤¿¤¬¥æ¡¼¥¶¡¼¤Ë³ÊÊ̤θ¢¸Â¥ì¥Ù¥ë¤òÍ¿¤¨¤¿¾ì¹ç¡¢´û¤Ë¥æ¡¼¥¶¡¼¤¬»ý¤Ã¤Æ¤¤¤ë¤¤¤«¤Ê¤ë¸¢¸Â
-(¤¢¤ë¤¤¤Ï ¾­Íè»ý¤Ä¸¢¸Â) ¤Ï¤½¤Î¥æ¡¼¥¶¡¼¤Ë¤è¤Ã¤Æ¤âµö²Ä¤¬Í¿¤¨¤é¤ì¤Þ¤¹¡£
-¤¢¤Ê¤¿¤¬¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ¹¤ë @strong{insert} µö²Ä¤ò¤¢¤ë¥æ¡¼¥¶¡¼¤ËÍ¿¤¨¤¿¤È²¾Äꤷ¤Þ¤¹¡£
-¤â¤·¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ¹¤ë @strong{select} ¸¢¸Â¤òÍ¿¤¨¤¿¤ê¡¢
-@code{WITH GRANT OPTION} ¤ò¹Ô¤¦¤È¡¢¥æ¡¼¥¶¡¼¤Ï @strong{select} ¸¢¸Â¤À¤±¤Ç¤Ê¤¯
- @strong{insert} ¤âÆÀ¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
-¤â¤· @strong{update} ¸¢¸Â¤ò¥æ¡¼¥¶¡¼¤ËÍ¿¤¨¤ë¤È¡¢¤½¤Î¥æ¡¼¥¶¡¼¤Ï
-@strong{insert}, @strong{select}, @strong{update} ¤¬²Äǽ¤Ç¤¹¡£
-
-@strong{alter} ¸¢¸Â¤ò°ìÈ̥桼¥¶¤ËÍ¿¤¨¤ë¤Ù¤­¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£¤³¤Î¾ì¹ç
-¥æ¡¼¥¶¤Ï¥Æ¡¼¥Ö¥ë¤ò¥ê¥Í¡¼¥à¤Ç¤­¡¢¤³¤ÎÊýË¡¤Ç¸¢¸Â¤ò²ó¤ë¤³¤È¤ò»î¤ß¤ë¤³¤È¤¬¤Ç
-¤­¤Þ¤¹¡ª
-
-Ãí°Õ¡§¤â¤· table/column ¸¢¸Â¤ò°ì¿Í¤Î¥æ¡¼¥¶¡¼¤Ë¤À¤±Í¿¤¨¤¿¾ì¹ç¡¢
- @strong{MySQL} ¤ÏÁ´¤Æ¤Î¥æ¡¼¥¶¡¼¤ËÂФ·¤Æ¥Æ¡¼¥Ö¥ë¤È¥Õ¥£¡¼¥ë¥É¤Î¾µÇ§¸¢¸Â¤ò¸¡Æ¤¤·¤Þ¤¹¡£
-¤³¤ì¤Ï @strong{MySQL} ¤ò¾¯¤·ÃÙ¤¯¤·¤Þ¤¹¡£
-
-@code{mysqld} ³«»Ï»þ¡¢Á´¤Æ¤Î¸¢¸Â¤Ï¥á¥â¥ê¤ËÆɤ߹þ¤Þ¤ì¤Þ¤¹¡£¥Ç¡¼¥¿¥Ù¡¼¥¹¡¢
-¥Æ¡¼¥Ö¥ë¡¢¥Õ¥£¡¼¥ë¥É¸¢¸Â¤Ï°ìÅÙ¸ú²Ì¤òÆÀ¤Þ¤¹¡£¥æ¡¼¥¶¥ì¥Ù¥ë¸¢¸Â¤Ï¥æ¡¼¥¶ºÆÀܳ»þ¤Ë
-¸ú²Ì¤òÆÀ¤Þ¤¹¡£
-¤³¤ì¤é¤Îµö²Ä¥Æ¡¼¥Ö¥ë¤ò @code{GRANT} ¤ä @code{REVOKE} ¤ò»È¤Ã¤ÆÊѹ¹¤·¤Æ¤â
-¥µ¡¼¥Ð¡¼¤Ë¤Ï¤¹¤°¤ËÈ¿±Ç¤µ¤ì¤Þ¤»¤ó¡£
-¤â¤·¤³¤ì¤é¤Îµö²Ä¥Æ¡¼¥Ö¥ë¤ò¼êÆ°¤ÇÊѹ¹¤·¤¿¾ì¹ç(@code{INSERT}, @code{UPDATE}, Åù¤ÇÊѹ¹¤·¤¿¾ì¹ç)¡¢
-@code{FLUSH PRIVILEGES} ¹½Ê¸¤ò¼Â¹Ô¤¹¤ë¤«¡¢@code{mysqladmin flush-privileges} ¤ò¼Â¹Ô¤·¤Æ
-¥µ¡¼¥Ð¡¼¤Ëµö²Ä¥Æ¡¼¥Ö¥ë¤ÎºÆÆɤ߹þ¤ß¤ò¹Ô¤ï¤»¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-@xref{Privilege changes}.
-
-@code{ANSI SQL GRANT} ¤È @strong{MySQL} @code{GRANT} ¤È¤ÎÂ礭¤Ê°ã¤¤¤Ï:
-
-@itemize @bullet
-@item
-ANSI SQL ¤Ï¥°¥í¡¼¥Ð¥ë¤È¥Ç¡¼¥¿¥Ù¡¼¥¹¥ì¥Ù¥ë¾µÇ§¤ò»ý¤¿¤º¡¢ANSI SQL ¤Ï
- @strong{MySQL} ¤¬¥µ¥Ý¡¼¥È¤¹¤ëÁ´¤Æ¤Î¸¢¸Â¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤»¤ó¡£
-@item
-ANSI SQL ¤Ç¥Æ¡¼¥Ö¥ë¤òÇË´þ¤¹¤ë»þ¡¢¤½¤Î¥Æ¡¼¥Ö¥ë¤ÎÁ´¤Æ¤Î¸¢¸Â¤ÏÇË´þ¤µ
-¤ì¤Þ¤¹¡£@code{ANSI SQL} ¤Ç¸¢¸Â¤ò¼è¤ê¾Ã¤¹¾ì¹ç¡¢¤³¤Î¸¢¸Â¤Ë´ð¤Å¤¤¤Æ¾µÇ§¤µ¤ì
-¤¿Á´¤Æ¤Î¸¢¸Â¤â¼è¤ê¾Ã¤µ¤ì¤Þ¤¹¡£@code{MySQL} ¤Ç¤Ï¡¢Á´¤Æ¤Î¸¢¸Â¤ÏÌÀ¼¨Åª¤Ê
-@code{REVOKE} ¥³¥Þ¥ó¥É¤Þ¤¿¤Ï @strong{MySQL} ¸¢¸Â¥Æ¡¼¥Ö¥ë¤ÎÁàºî¤Ë¤è¤Ã¤Æ¤Î
-¤ßÇË´þ¤µ¤ì¤Þ¤¹¡£
-@end itemize
-
-
-@cindex Indexes
-@cindex Indexes, multi-part
-@cindex Multi-part index
-@findex CREATE INDEX
-@node CREATE INDEX, DROP INDEX, GRANT, Reference
-@section @code{CREATE INDEX} ¹½Ê¸
-
-@example
-CREATE [UNIQUE] INDEX index_name ON tbl_name (col_name[(length)],... )
-@end example
-
-@code{CREATE INDEX} ¹½Ê¸¤Ï @strong{MySQL} 3.22 ¤è¤ê°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¤Ê¤Ë¤â¤·¤Þ¤»¤ó¡£
-3.22 °Ê¹ß¤Ç¡¢@code{CREATE INDEX} ¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎºîÀ®¤Î¤¿¤á¤Ë @code{ALTER TABLE}
- ¤ò¸Æ¤Ó¤À¤·¤Æ¤¤¤Þ¤¹¡£
-@xref{ALTER TABLE, , @code{ALTER TABLE}}.
-
-Ä̾¥Æ¡¼¥Ö¥ëÆâ¤ÎÁ´¤Æ¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï @code{CREATE TABLE} ¤Ç
-¥Æ¡¼¥Ö¥ë¤òºî¤ë¤È¤­¤Ë°ìÅ٤˺îÀ®¤µ¤ì¤Þ¤¹¡£
-@xref{CREATE TABLE, , @code{CREATE TABLE}}.
-@code{CREATE INDEX} ¤Ï´û¤Ë¸ºß¤¹¤ë¥Æ¡¼¥Ö¥ë¤ËÂФ·¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÄɲä·¤Þ¤¹¡£
-
-¥Õ¥£¡¼¥ë¥É¤ò @code{(col1,col2,...)} ¤È¤·¤Æ»ØÄꤹ¤ë¤È¡¢Ê£¿ô¥Õ¥£¡¼¥ë¥É¥¤¥ó¥Ç¥Ã¥¯¥¹¤òºîÀ®¤·¤Þ¤¹¡£
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎÃͤϡ¢Í¿¤¨¤é¤ì¤¿¥Õ¥£¡¼¥ë¥É¤ÎÃͤòÏ¢·ë¤·¤Æ¡¢¹½À®¤µ¤ì¤Þ¤¹¡£
-
-@code{CHAR} ¤È @code{VARCHAR} ¥Õ¥£¡¼¥ë¥É¤Ç¤Ï¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï¥Õ¥£¡¼¥ë¥É¤Î°ìÉôʬ¤À¤±¤ò»ÈÍѤ·¤Æ
-ºîÀ®¤µ¤ì¤Þ¤¹¡£¤³¤ì¤Ï @code{col_name(length)} ¹½Ê¸¤ò»ÈÍѤ·¤Þ¤¹¡£
-(@code{BLOB} ¤È @code{TEXT} Àá¤Ç¤Ï length ¤¬É¬ÍפǤ¹)¡£
-ºÇ½é¤Î10ʸ»ú¤ò¥¤¥ó¥Ç¥Ã¥¯¥¹¤È¤·¤Æ»ÈÍѤ¹¤ë¤Ë¤Ï¡¢¤³¤Î¹½Ê¸¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ»ÈÍѤ·¤Þ¤¹(@code{name} ¥Õ¥£¡¼¥ë¥É¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤òºî¤ê¤Þ¤¹)¡§
-
-@example
-mysql> CREATE INDEX part_of_name ON customer (name(10));
-@end example
-
-¥Õ¥£¡¼¥ë¥É¤Î°ìÉôʬ¤À¤±¤ò¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ë»ÈÍѤ¹¤ì¤Ð¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¤ò¤Ï¤ë¤«¤Ë¾®¤µ¤¯¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¤Û¤È¤ó¤É¤Î̾Á°¤¬ºÇ½é¤Î10ʸ»ú¤Ë¤ª¤¤¤ÆÄ̾ï°Û¤Ê¤ë¤Î¤Ç¡¢
-¤³¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï @code{name} ¥Õ¥£¡¼¥ë¥ÉÁ´Éô¤ò»ÈÍѤ·¤ÆÁϤê½Ð¤·¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹¤ËÈæ¤Ù¤Æ
-ÃÙ¤¯¤Ê¤ë¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¡£¤Þ¤¿¡¢Â¿¤¯¤Î¥Ç¥£¥¹¥¯¥¹¥Ú¡¼¥¹¤òÀáÌó¤Ç¤­¡¢
- @code{INSERT} ¤ò®¤¯¤¹¤ë¤Î¤Ç¤¹¡ª
-
-@strong{MySQL} version 3.23.2 °Ê¾å¤Ç @code{MyISAM} ·¿¤Î¥Æ¡¼¥Ö¥ë¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢
-@code{NULL} Ãͤò¤â¤Ä¥Õ¥£¡¼¥ë¥É¤ä¡¢ @code{BLOB}/@code{TEXT} ¥Õ¥£¡¼¥ë¥É¤ËÂФ·¤Æ
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÄ¥¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£
-
-@strong{MySQL} ¤¬¤É¤Î¤è¤¦¤Ë¤·¤Æ¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ¹¤ë¤«¤Ï ¢ª
-¡¡@ref{MySQL indexes, , @strong{MySQL} indexes}.
-
-@findex DROP INDEX
-@node DROP INDEX, Comments, CREATE INDEX, Reference
-@section @code{DROP INDEX} ¹½Ê¸
-
-@example
-DROP INDEX index_name ON tbl_name
-@end example
-
-@code{DROP INDEX} ¤Ï @code{index_name} ¤È¤¤¤¦Ì¾Á°¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò¥Æ¡¼¥Ö¥ë
-@code{tbl_name} ¤«¤éÇË´þ¤·¤Þ¤¹¡£
-@code{DROP INDEX} ¤Ï @strong{MySQL} 3.22 ¤è¤ê°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¤Ê¤Ë¤â¤·¤Þ¤»¤ó¡£
-3.22 °Ê¹ß¤Ç¡¢@code{DROP INDEX} ¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎÇË´þ¤Î¤¿¤á¤Ë
-@code{ALTER TABLE} ¤ò¸Æ¤Ó¤À¤·¤Æ¤¤¤Þ¤¹¡£
-@xref{ALTER TABLE, , @code{ALTER TABLE}}.
-
-@findex Comment syntax
-@node Comments, CREATE FUNCTION, DROP INDEX, Reference
-@section ¥³¥á¥ó¥È ¹½Ê¸
-
-@strong{MySQL} ¤Ï @code{# ¹ÔËö¤Þ¤Ç} , @code{-- ¹ÔËö¤Þ¤Ç} ¤½¤·¤Æ @code{/*
-¹ÔÃæ¤Þ¤¿¤ÏÊ£¿ô¹Ô */} ¥³¥á¥ó¥È½ñ¼°¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹:
-
-@example
-mysql> select 1+1; # ¤³¤Î¥³¥á¥ó¥È¤Ï¹ÔËö¤Þ¤Ç³¤¯
-mysql> select 1+1; -- ¤³¤Î¥³¥á¥ó¥È¤Ï¹ÔËö¤Þ¤Ç³¤¯
-mysql> select 1 /* ¤³¤ì¤Ï¹ÔÃ楳¥á¥ó¥È */ + 1;
-mysql> select 1+
-/*
-¤³¤ì¤Ï
-Ê£¿ô¹Ô¥³¥á¥ó¥È
-*/
-1;
-@end example
-
-@code{--} ¥³¥á¥ó¥È¥¹¥¿¥¤¥ë¤Ï @code{--} ¤Î¸å¤í¤ËºÇÄã°ì¤Ä¤Î¥¹¥Ú¡¼¥¹¤¬
-ɬÍפǤ¢¤ë¤³¤È¤ËÃí°Õ¡ª
-
-¥µ¡¼¥Ð¡¼¤Ï¥³¥á¥ó¥È¹½Ê¸¤òÍý²ò¤·¤Þ¤¹¤¬¡¢ @code{mysql} ¥¯¥é¥¤¥¢¥ó¥È¤¬
- @code{/* ... */} ¥³¥á¥ó¥È¤òʬÀϤ¹¤ë¤Ë¤Ï¤¤¤¯¤Ä¤«À©¸Â¤¬¤¢¤ê¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-¥·¥ó¥°¥ë¥¯¥¦¥©¡¼¥È¤È¥À¥Ö¥ë¥¯¥ª¡¼¥Èʸ»ú¤Ï°úÍÑʸ»úÎó¤Î¥È¡¼¥¯¥ó¤Î³«»Ï¤ò
-¼¨¤·¤Þ¤¹¡£¤¿¤È¤¨¥³¥á¥ó¥È¤ÎÃæ¤Ç¤¢¤Ã¤Æ¤â¡£
-¤â¤·¥³¥á¥ó¥È¤ÎÃæ¤Ç¥¯¥ª¡¼¥È¤¬Æó¤ÄÌܤΥ¯¥ª¡¼¥È¤Ë¥Þ¥Ã¥Á¤·¤Ê¤«¤Ã¤¿¾ì¹ç¡¢
-¥Ñ¡¼¥µ¡¼¤Ï¥³¥á¥ó¥È¤¬½ªÎ»¤·¤Æ¤¤¤Ê¤¤¤Èǧ¼±¤·¤Þ¤¹¡£
-@code{mysql} ¤òÂÐÏå⡼¥É¤Ç¼Â¹Ô¤·¤Æ¤¤¤ë¾ì¹ç¡¢
-¥×¥í¥ó¥×¥È¤¬ @code{mysql>} ¤«¤é @code{'>} ¤« @code{">} ¤ËÊѤï¤ê¤Þ¤¹¡£
-
-@item
-¥»¥ß¥³¥í¥ó¤Ï SQL ¹½Ê¸¤Î½ªÎ»¤ò¼¨¤·¡¢¤³¤ì¤Ë³¤¯Ê¸»ú¤Ï¼¡¤Î¹½Ê¸¤Î³«»Ï¤È
-¤Ê¤ê¤Þ¤¹¡£
-@end itemize
-
-¤³¤ì¤é¤ÎÀ©¸Â¤Ï @code{mysql} ¤òÂÐÏå⡼¥É¤Ç¼Â¹Ô¤·¤Æ¤¤¤ë¾ì¹ç¤È¡¢
-@code{mysql} ¤Ë¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤Þ¤»¤Æ¤¤¤ë¾ì¹ç ( @code{mysql < some-file} ) ¤Î
-ξÊý¤Ç¸½¤ì¤Þ¤¹¡£
-
-@strong{MySQL} ¤Ï ANSI SQL ¥³¥á¥ó¥È¤Î @samp{--} ¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤»¤ó¡£
-@xref{Missing comments}.
-
-
-@findex CREATE FUNCTION
-@findex DROP FUNCTION
-@findex UDF functions
-@findex User-defined functions
-@findex Functions, user-defined
-@node CREATE FUNCTION, Reserved words, Comments, Reference
-@section @code{CREATE FUNCTION/DROP FUNCTION} ¹½Ê¸
-
-@example
-CREATE [AGGREGATE] FUNCTION function_name RETURNS @{STRING|REAL|INTEGER@}
- SONAME shared_library_name
-
-DROP FUNCTION function_name
-@end example
-
-¥æ¡¼¥¶¡¼ÄêµÁ´Ø¿ô (UDF : user-definable functions) ¤Ï
- @strong{MySQL} ¤Ë¿·¤·¤¤´Ø¿ô¤ò»ý¤¿¤»¤ì¤ë³ÈÄ¥ÊýË¡¤Ç¤¹¡£
-¤³¤ì¤Ï @strong{MySQL} ¤Î¥Í¥¤¥Æ¥£¥Ö(Ëä¤á¹þ¤ß)´Ø¿ô
-(@code{ABS()}, @code{CONCAT()} ¤Î¤è¤¦¤Ê)¤ÈƱ¤¸¤è¤¦¤ËÆ°ºî¤·¤Þ¤¹¡£
-
-@code{AGGREGATE} ¤Ï @strong{MySQL} 3.23 ¤Î¿·¤·¤¤¥ª¥×¥·¥ç¥ó¤Ç¤¹¡£
-@code{AGGREGATE} ´Ø¿ô¤Ï¡¢@code{SUM} ¤ä @code{COUNT()} ¤Î¤è¤¦¤Ê¥Í¥¤¥Æ¥£¥Ö¤Ê
-@strong{MySQL} @code{GROUP} ´Ø¿ô¤Î¤è¤¦¤ËÀµ³Î¤ËÆ°ºî¤·¤Þ¤¹¡£
-
-@code{CREATE FUNCTION} ¤Ï¡¢´Ø¿ô̾¡¢·¿¡¢¶¦Í­¥é¥¤¥Ö¥é¥ê̾¤ò¡¢
-@code{mysql.func} ¥·¥¹¥Æ¥à¥Æ¡¼¥Ö¥ë¤Ë¡¢Êݸ¤·¤Þ¤¹¡£
-´Ø¿ô¤ÎºîÀ®¡¢ÇË´þ¤ò¹Ô¤¦¤Ë¤Ï¡¢ @code{mysql} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ·¤Æ¡¢
- @strong{insert} , @code{delete} ¸¢¸Â¤¬¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-
-Á´¤Æ¤Î´Ø¿ô¤Ï¥µ¡¼¥Ð¡¼¤Îµ¯Æ°»þ¤ËÆɤ߹þ¤Þ¤ì¤Þ¤¹¡£
-¤¿¤À¤· @code{--skip-grant-tables} ¥ª¥×¥·¥ç¥ó¤ò @code{mysqld} ¤Ë¤Ä¤±¤Æ¤¤¤Ê¤±¤ì¤Ð¡£
-¤³¤Î¾ì¹ç¡¢UDF ¤Î½é´ü²½¤ÏÈô¤Ð¤µ¤ì¡¢UDF ¤Çºî¤Ã¤¿´Ø¿ô¤Ï»ÈÍѤǤ­¤Þ¤»¤ó¡£
-(´Ø¿ô¤Ï @code{CREATE FUNCTION} ¤Ç¥í¡¼¥É¤µ¤ì¡¢ @code{DROP FUNCTION} ¤Çºï½ü¤µ¤ì¤Þ¤¹)
-
-¥æ¡¼¥¶¡¼ÄêµÁ´Ø¿ô¤Ë´Ø¤¹¤ë¤µ¤é¤Ê¤ë¾ðÊó¤Ï ¢ª @ref{Adding functions}.
-UDF ¥á¥«¥Ë¥º¥à¤ÇÆ°¤«¤¹¤¿¤á¤Ë¤Ï¡¢´Ø¿ô¤Ï C ¤« C++ ¤Ç½ñ¤«¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-¤«¤Ä¡¢¤¢¤Ê¤¿¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤¬¥À¥¤¥Ê¥ß¥Ã¥¯¥í¡¼¥Ç¥£¥ó¥°¤ò
-¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£¤µ¤é¤Ë @code{mysqld} ¤Ï¥¹¥¿¥Æ¥£¥Ã¥¯¤Ç¤Ï¤Ê¤¯
-¥À¥¤¥Ê¥ß¥Ã¥¯¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-
-@cindex Keywords
-@cindex Reserved words
-@cindex Reserved words, exceptions
-@node Reserved words, , CREATE FUNCTION, Reference
-@section Is @strong{MySQL} picky about reserved words?
-
-¶¦Ä̤ÎÌäÂê¤Ï¡¢¥Õ¥£¡¼¥ë¥É¤Î̾Á°¤ò¡¢ @code{TIMESTAMP} ¤È¤« @code{GROUP} ¤È¤«¤Î
- @strong{MySQL} ¤ËËä¤á¹þ¤Þ¤ì¤Æ¤¤¤ë¥Ç¡¼¥¿·¿¤ä´Ø¿ô̾¤ÈƱ̾¤Ë¤·¤Æ¡¢
-¥Æ¡¼¥Ö¥ë¤òºî¤Ã¤¿¾ì¹ç¤Ëµ¯¤³¤ê¤Þ¤¹¡£
-¤³¤Î¤è¤¦¤Ê¤³¤È¤Ï¹Ô¤¨¤Þ¤¹(Î㤨¤Ð @code{ABS} ¤Ï¥Õ¥£¡¼¥ë¥É̾¤Ë¤Ç¤­¤Þ¤¹)¡£
-¤·¤«¤·¡¢´Ø¿ô¤È¤·¤Æ»ÈÍѤ¹¤ë¾ì¹ç¡¢
-¤³¤Î̾Á°¤¬¥Õ¥£¡¼¥ë¥É̾¤È¤·¤Æ»ÈÍѤµ¤ì¤Æ¤¤¤ë¤Ê¤é¡¢
-´Ø¿ô̾¤È @samp{(} ¤Î´Ö¤Î¶õÇò¤Ïµö¤µ¤ì¤Þ¤»¤ó¡£
-
-°Ê²¼¤Î¸ì¤Ï @strong{MySQL} ¤ËͽÌ󤵤ì¤Æ¤¤¤Þ¤¹¡£
-¤³¤ì¤é¤Î¤Û¤È¤ó¤É¤Ï¡¢ ANSI SQL92 ¤Ë¤è¤Ã¤Æ¡¢
-¥Æ¡¼¥Ö¥ë¡¢¥Õ¥£¡¼¥ë¥É̾¤È¤·¤Æ¤Î»ÈÍѤ϶ػߤµ¤ì¤Æ¤¤¤Þ¤¹¡£(Î㤨¤Ð @code{group})¡£
-¤Þ¤¿¤¤¤¯¤Ä¤«¤Î¸ì¤Ï @strong{MySQL} ¤¬É¬ÍפȤ·¡¢ @code{yacc} ¥Ñ¡¼¥µ¡¼¤Ç
-»ÈÍѤ·¤Æ¤¤¤ë¤Î¤ÇͽÌ󤵤ì¤Æ¤¤¤Þ¤¹¡£
-
-@c This is fixed by including the symbols table from lex.h here and then running
-@c fix-mysql-reserved-words in emacs (or let David do it):
-@c (defun fix-mysql-reserved-words ()
-@c (interactive)
-@c (let ((cnt 0))
-@c (insert "\n@item ")
-@c (while (looking-at "[ \t]*{ +\"\\([^\"]+\\)\"[ \t]*,.*\n")
-@c (replace-match "@code{\\1}")
-@c (incf cnt)
-@c (if (> cnt 3)
-@c (progn
-@c (setf cnt 0)
-@c (insert "\n@item "))
-@c (insert " @tab ")))))
-@c But remove the non alphanumeric entries by hand first.
-@c Updated after 3.23.4 990928 by David
-
-@multitable @columnfractions .25 .25 .25 .25
-@item @code{action} @tab @code{add} @tab @code{aggregate} @tab @code{all}
-@item @code{alter} @tab @code{after} @tab @code{and} @tab @code{as}
-@item @code{asc} @tab @code{avg} @tab @code{avg_row_length} @tab @code{auto_increment}
-@item @code{between} @tab @code{bigint} @tab @code{bit} @tab @code{binary}
-@item @code{blob} @tab @code{bool} @tab @code{both} @tab @code{by}
-@item @code{cascade} @tab @code{case} @tab @code{char} @tab @code{character}
-@item @code{change} @tab @code{check} @tab @code{checksum} @tab @code{column}
-@item @code{columns} @tab @code{comment} @tab @code{constraint} @tab @code{create}
-@item @code{cross} @tab @code{current_date} @tab @code{current_time} @tab @code{current_timestamp}
-@item @code{data} @tab @code{database} @tab @code{databases} @tab @code{date}
-@item @code{datetime} @tab @code{day} @tab @code{day_hour} @tab @code{day_minute}
-@item @code{day_second} @tab @code{dayofmonth} @tab @code{dayofweek} @tab @code{dayofyear}
-@item @code{dec} @tab @code{decimal} @tab @code{default} @tab @code{delayed}
-@item @code{delay_key_write} @tab @code{delete} @tab @code{desc} @tab @code{describe}
-@item @code{distinct} @tab @code{distinctrow} @tab @code{double} @tab @code{drop}
-@item @code{end} @tab @code{else} @tab @code{escape} @tab @code{escaped}
-@item @code{enclosed} @tab @code{enum} @tab @code{explain} @tab @code{exists}
-@item @code{fields} @tab @code{file} @tab @code{first} @tab @code{float}
-@item @code{float4} @tab @code{float8} @tab @code{flush} @tab @code{foreign}
-@item @code{from} @tab @code{for} @tab @code{full} @tab @code{function}
-@item @code{global} @tab @code{grant} @tab @code{grants} @tab @code{group}
-@item @code{having} @tab @code{heap} @tab @code{high_priority} @tab @code{hour}
-@item @code{hour_minute} @tab @code{hour_second} @tab @code{hosts} @tab @code{identified}
-@item @code{ignore} @tab @code{in} @tab @code{index} @tab @code{infile}
-@item @code{inner} @tab @code{insert} @tab @code{insert_id} @tab @code{int}
-@item @code{integer} @tab @code{interval} @tab @code{int1} @tab @code{int2}
-@item @code{int3} @tab @code{int4} @tab @code{int8} @tab @code{into}
-@item @code{if} @tab @code{is} @tab @code{isam} @tab @code{join}
-@item @code{key} @tab @code{keys} @tab @code{kill} @tab @code{last_insert_id}
-@item @code{leading} @tab @code{left} @tab @code{length} @tab @code{like}
-@item @code{lines} @tab @code{limit} @tab @code{load} @tab @code{local}
-@item @code{lock} @tab @code{logs} @tab @code{long} @tab @code{longblob}
-@item @code{longtext} @tab @code{low_priority} @tab @code{max} @tab @code{max_rows}
-@item @code{match} @tab @code{mediumblob} @tab @code{mediumtext} @tab @code{mediumint}
-@item @code{middleint} @tab @code{min_rows} @tab @code{minute} @tab @code{minute_second}
-@item @code{modify} @tab @code{month} @tab @code{monthname} @tab @code{myisam}
-@item @code{natural} @tab @code{numeric} @tab @code{no} @tab @code{not}
-@item @code{null} @tab @code{on} @tab @code{optimize} @tab @code{option}
-@item @code{optionally} @tab @code{or} @tab @code{order} @tab @code{outer}
-@item @code{outfile} @tab @code{pack_keys} @tab @code{partial} @tab @code{password}
-@item @code{precision} @tab @code{primary} @tab @code{procedure} @tab @code{process}
-@item @code{processlist} @tab @code{privileges} @tab @code{read} @tab @code{real}
-@item @code{references} @tab @code{reload} @tab @code{regexp} @tab @code{rename}
-@item @code{replace} @tab @code{restrict} @tab @code{returns} @tab @code{revoke}
-@item @code{rlike} @tab @code{row} @tab @code{rows} @tab @code{second}
-@item @code{select} @tab @code{set} @tab @code{show} @tab @code{shutdown}
-@item @code{smallint} @tab @code{soname} @tab @code{sql_big_tables} @tab @code{sql_big_selects}
-@item @code{sql_low_priority_updates} @tab @code{sql_log_off} @tab @code{sql_log_update} @tab @code{sql_select_limit}
-@item @code{sql_small_result} @tab @code{sql_big_result} @tab @code{sql_warnings} @tab @code{straight_join}
-@item @code{starting} @tab @code{status} @tab @code{string} @tab @code{table}
-@item @code{tables} @tab @code{temporary} @tab @code{terminated} @tab @code{text}
-@item @code{then} @tab @code{time} @tab @code{timestamp} @tab @code{tinyblob}
-@item @code{tinytext} @tab @code{tinyint} @tab @code{trailing} @tab @code{to}
-@item @code{type} @tab @code{use} @tab @code{using} @tab @code{unique}
-@item @code{unlock} @tab @code{unsigned} @tab @code{update} @tab @code{usage}
-@item @code{values} @tab @code{varchar} @tab @code{variables} @tab @code{varying}
-@item @code{varbinary} @tab @code{with} @tab @code{write} @tab @code{when}
-@item @code{where} @tab @code{year} @tab @code{year_month} @tab @code{zerofill}
-@end multitable
-
-°Ê²¼¤Ï ANSI SQL ¤Ç¤Ï¥Õ¥£¡¼¥ë¥É¡¢¥Æ¡¼¥Ö¥ë̾¤È¤·¤Æ¤Î»ÈÍѤò¶Ø»ß¤µ¤ì¤Æ¤¤¤Þ¤¹¤¬¡¢
- @strong{MySQL} ¤Ç¤Ïµö²Ä¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-¤³¤ì¤Ï¡¢¤³¤ì¤é¤Î̾Á°¤ÏÀ¨¤¯¼«Á³¤Ê̾Á°¤Ç¡¢Â¿¤¯¤Î¿Í¤¬¤³¤ì¤é¤ò´û¤Ë̾Á°¤È¤·¤Æ
-»ÈÍѤ·¤Æ¤¤¤ë¤«¤é¤Ç¤¹¡£
-
-@itemize @bullet
-@item @code{ACTION}
-@item @code{BIT}
-@item @code{DATE}
-@item @code{ENUM}
-@item @code{NO}
-@item @code{TEXT}
-@item @code{TIME}
-@item @code{TIMESTAMP}
-@end itemize
-
-@cindex Table types, Choosing
-@cindex BDB table type
-@cindex Berkeley_db table type
-@cindex ISAM table type
-@cindex HEAP table type
-@cindex MySQL table types
-@cindex MyISAM table type
-@node Table types, Tutorial, Reference, Top
-@chapter MySQL table types
-
-With MySQL you can currently (version 3.23.6) choose between three basic
-table formats. When you create a new table, you can tell @strong{MySQL}
-which table type it should use for the table. @strong{MySQL} will
-always create a @code{.frm} file to hold the table and column
-definitions. Depending on the table type the index and data will be
-stored in other files.
-
-The default table type in @strong{MySQL} is @code{MyISAM}. If you are
-trying to use a table type that is not incompiled or activated,
-@strong{MySQL} will instead create a table of type @code{MyISAM}.
-
-@code{ALTER TABLE} ʸ¤ò»ÈÍѤ¹¤ì¤Ð¡¢¥Æ¡¼¥Ö¥ë¤ò°ã¤¦·Á¼°¤ËÊѹ¹¤Ç¤­¤Þ¤¹¡£
-@xref{ALTER TABLE, , @code{ALTER TABLE}}.
-
-Note that @strong{MySQL} supports two different kind of
-tables. Transactions safe tables (@code{BDB}) and not transaction safe
-tables (@code{ISAM},@code{MyISAM} and @code{HEAP}.
-
-Advantages of transaction safe tables (TST)
-
-@itemize @bullet
-@item
-Safer; Even if @code{MySQL} crashes or you get hardware problems, you
-can get your data back; Either by automatic recovery or from a backup
-+ the transaction log.
-@item
-You can combine many statements and accept these all in one go with
-the @code{COMMIT} command.
-@item
-You can execute @code{ROLLBACK} to ignore your changes (if you are not
-running in auto commit mode).
-@item
-If an update fails, all your changes will be restored. (With NTST tables all
-changes that has taken place are permanent)
-@end itemize
-
-Advantages of not transaction safe tables (NTST):
-
-@itemize @bullet
-@item
-Much faster as there is no transcation overhead.
-@item
-Will use less disk space as there is no overhead of transactions.
-@item
-Will use less memory to do updates.
-@end itemize
-
-You can combine TST and NTST tables in the same statements to get the best
-of both worlds.
-
-@menu
-* MyISAM:: MyISAM tables
-* ISAM:: ISAM tables
-* HEAP:: HEAP tables
-* BDB::
-@end menu
-
-@node MyISAM, ISAM, Table types, Table types
-@section MyISAM tables
-
-@code{MyISAM} ¤Ï¡¢@strong{MySQL} 3.23 ¤Ç¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥Æ¡¼¥Ö¥ë·Á¼°¤Ç¤¹¡¥
-¤³¤ì¤Ï @code{ISAM} ¥³¡¼¥É¤ò´ð¤Ë¤·¡¢Â¿¤¯¤ÎÊØÍø¤Ê³ÈÄ¥µ¡Ç½¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£
-
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï @code{.MYI} (MYindex) ³ÈÄ¥»Ò¤Î¤Ä¤¯¥Õ¥¡¥¤¥ë¤ËÊݸ¤µ¤ì¡¢
-¥Ç¡¼¥¿¤Ï¡¢ @code{.MYD} (MYData) ³ÈÄ¥»Ò¤Î¤Ä¤¯¥Õ¥¡¥¤¥ë¤ËÊݸ¤µ¤ì¤Þ¤¹¡£
-@code{myisamchk} ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤ò»ÈÍѤ·¤Æ¡¢ @code{MyISAM} ¥Æ¡¼¥Ö¥ë¤Î
-¸¡ºº¡¦½¤Éü¤¬²Äǽ¤Ç¤¹¡£ @xref{Crash recovery}.
-
-The following is new in @code{MyISAM}:
-
-@itemize @bullet
-@item
-¤¢¤ë¥¹¥ì¥Ã¥É¤¬Æɤ߹þ¤ßÃæ¤Î¥Æ¡¼¥Ö¥ë¤ËÂФ·¡¢°ã¤¦¥¹¥ì¥Ã¥É¤¬
-Ʊ¤¸¥Æ¡¼¥Ö¥ë¤Ë¡¢¿·¤·¤¤¹Ô¤ò @code{INSERT} ¤Ç¤­¤Þ¤¹¡£
-ºï½ü¤Ï¤Ê¤·¤Ç
-You can @code{INSERT} new rows in a table without deleted rows,
-while other threads are reading from the table.
-@item
-Âç¥Õ¥¡¥¤¥ë (63 bit) ¤Î¥µ¥Ý¡¼¥È¡£
-¤¿¤À¤·¡¢filesystems/operating systems ¤¬µðÂç¥Õ¥¡¥¤¥ë¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¾ì¹ç¡£
-@item
-Á´¥Ç¡¼¥¿¤Ï¡¢²¼°Ì¥Ð¥¤¥È¤¬Àè¤Ë¤«¤«¤ì¤Þ¤¹¡£ ¤³¤ì¤Ï¡¢¥Ç¡¼¥¿¤ò¡¢¥Þ¥·¥ó¡¦OS
-Èó°Í¸¤Ë¤·¤Þ¤·¤¿¡£
-The only requirement is that the machine uses two's-complement
-signed integers (as every machine for the last 20 years has)
-and IEEE floating point format (also totally dominant among mainstream
-machines). The only area of machines that may not support binary
-compatibility are embedded systems (because they sometimes have peculiar
-processors).
-@item
-Á´¿ôÃÍ¥­¡¼¤Ï¹â°Ì¥Ð¥¤¥È¤¬Àè¤Ë½ñ¤«¤ì¤Þ¤¹¡£ ¤³¤ì¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î°µ½ÌΨ¤ò
-Îɤ¯¤·¤Þ¤¹¡£
-@item
-Internal handling of one @code{AUTO_INCREMENT} column. @code{MyISAM}
-will automatically update this on @code{INSERT/UPDATE}. The
-@code{AUTO_INCREMENT} value can be reset with @code{myisamchk}. This
-will make @code{AUTO_INCREMENT} columns faster (at least 10 %) and old
-numbers will not be reused as with the old ISAM. Note that when a
-@code{AUTO_INCREMENT} is defined on the end of a multi-part-key the old
-behavior is still present.
-@item
-When inserted in sorted order (as when you are using an @code{AUTO_INCREMENT}
-column) the key tree will be split so that the high node only contains one
-key. This will improve the space utilization in the key tree.
-@item
-@code{BLOB} ¤È @code{TEXT} ¥Õ¥£¡¼¥ë¥É¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬Ä¥¤ì¤Þ¤¹
-@item
-@code{NULL} Ãͤò¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎÄ¥¤é¤ì¤¿¥Õ¥£¡¼¥ë¥É¤Ëµö¤·¤Þ¤¹¡¥ This takes 0-1
-bytes/key.
-@item
-¸½ºß¡¢¥­¡¼¤ÎºÇÂçĹ¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç 500 ¤Ç¤¹¡£ In cases of keys longer
-than 250 bytes, a bigger key block size than the default of 1024 bytes
-is used for this key.
-@item
-Maximum number of keys/table enlarged to 32 as default. This can be
-enlarged to 64 without having to recompile @code{myisamchk}.
-@item
-There is a flag in the @code{MyISAM} file that indicates whether or not the
-table was closed correctly. This will soon be used for automatic repair
-in the @strong{MySQL} server.
-@item
-@code{myisamchk} will mark tables as checked if one runs it with
-@code{--update-state}. @code{myisamchk --fast} will only check those
-tables that don't have this mark.
-@item
-@code{myisamchk -a} stores statistics for key parts (and not only for
-whole keys as in @code{ISAM}).
-@item
-Dynamic size rows will now be much less fragmented when mixing deletes
-with updates and inserts. This is done by automatically combining adjacent
-deleted blocks and by extending blocks if the next block is deleted.
-@item
-@code{myisampack} ¤Ï @code{BLOB} ¤È @code{VARCHAR} ¥Õ¥£¡¼¥ë¥É¤ò¥Ñ¥Ã¥¯¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£
-@end itemize
-
-@code{MyISAM} also supports the following things, which @strong{MySQL}
-will be able to use in the near future.
-
-@itemize @bullet
-@item
-Support for a true @code{VARCHAR} type; A @code{VARCHAR} column starts
-with a length stored in 2 bytes.
-@item
-Tables with @code{VARCHAR} may have fixed or dynamic record length.
-@item
-@code{VARCHAR} and @code{CHAR} may be up to 64K.
-All key segments have their own language definition. This will enable
-@strong{MySQL} to have different language definitions per column.
-@item
-A hashed computed index can be used for @code{UNIQUE}; This will allow
-you to have @code{UNIQUE} on any combination of columns in a table. (You
-can't search on a @code{UNIQUE} computed index, however.)
-@end itemize
-
-@menu
-* Key space:: Space needed for keys
-* MyISAM table formats::
-@end menu
-
-@node Key space, MyISAM table formats, MyISAM, MyISAM
-@subsection Space needed for keys
-
-@strong{MySQL} can support different index types, but the normal type is
-ISAM or MyISAM. These use a B-tree index and you can roughly calculate
-the size for the index file as @code{(key_length+4)/0.67}, summed over
-all keys. (This is for the worst case when all keys are inserted in
-sorted order and we don't have any compressed keys.)
-
-String indexes are space compressed. If the first index part is a
-string, it will also be prefix compressed. Space compression makes the
-index file smaller than the above figures if the string column has a lot
-of trailing space or is a @code{VARCHAR} column that is not always used
-to the full length. Prefix compression is used on keys that start
-with a string. Prefix compression helps if there are many strings
-with an identical prefix.
-
-In @code{MyISAM} tables, you can also prefix compress numbers by specifying
-@code{PACK_KEYS=1} when you create the table. This helps when you have
-many integer keys which have an identical prefix when the numbers are stored
-high-byte first.
-
-@node MyISAM table formats, , Key space, MyISAM
-@subsection MyISAM table formats
-
-@strong{MyISAM} supports 3 different table types. 2 of them are chosen
-automatically depending on the type of columns you are using. The third,
-compressed tables, can only be created with the @code{myisampack} tool.
-
-@menu
-* Static format:: Static (Fixed-length) table characteristics
-* Dynamic format:: Dynamic table characteristics
-* Compressed format:: Compressed table characteristics
-@end menu
-
-@node Static format, Dynamic format, MyISAM table formats, MyISAM table formats
-@subsubsection Static (Fixed-length) table characteristics
-
-This is the default format. It's used when the table contains no
-@code{VARCHAR}, @code{BLOB} or @code{TEXT} columns.
-
-¤³¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¢ºÇ¤âñ½ã¡¢¤«¤Ä¡¢°ÂÁ´¤Ê¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤¹¡£
-¤³¤ì¤Ï, Disk ¾å¤Ëºî¤é¤ì¤ë¥Æ¡¼¥Ö¥ë¤ÎÃæ¤Ç¡¢ºÇ¤â®¤¤¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç¤â¤¢¤ê¤Þ¤¹¡£
-¤³¤ì¤Ï¥Ç¥£¥¹¥¯¾å¤Î¥Ç¡¼¥¿¤ò¸«¤Ä¤±¤ä¤¹¤¤¤«¤é¤Ç¤¹¡£
-When looking up something with an index and static
-format it is very simple, just multiply the row number with the row length.
-
-Also when scanning a table it is very easy to read a constant number of
-records with each disk read.
-
-°ÂÁ´¡¢¤È¤¤¤¦¤Î¤Ï¡¢¼¡¤ÎÍͤʤ³¤È¤Ç¤¹¡£
-¤â¤·²¾¤Ë¡¢ÀÅŪ(¸ÇÄêĹ) MyISAM ¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤ßÃæ¤Ë¡¢
-¤¢¤Ê¤¿¤Î¥³¥ó¥Ô¥å¡¼¥¿¤¬¥¯¥é¥Ã¥·¥å¤·¤¿¾ì¹ç¡¢
-@code{myisamchk} ¤Ï¡¢¤½¤ì¤¾¤ì¤Î¥ì¥³¡¼¥É¤Î³«»ÏÅÀ¤È½ªÎ»ÅÀ¤ò°Â°×¤Ë¸«¤Ä¤±¤ë¤³¤È¤¬½Ð
-Íè¤Þ¤¹¡£
-So it can usually reclaim all records except the
-partially written one.
-MySQL ¤Ç¤Ï¡¢¾ï¤Ë¡¢Á´¤Æ¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬ºÆ¹½ÃۤǤ­¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@itemize @bullet
-@item
-Á´¤Æ¤Î @code{CHAR}, @code{NUMERIC}, @code{DECIMAL} ¥Õ¥£¡¼¥ë¥É¤Ï¡¢¤½¤Î¥Õ¥£¡¼¥ë¥É
-Ť˭¤ê¤Ê¤¤Éôʬ¤Ë¤Ï¥¹¥Ú¡¼¥¹¤¬Ëä¤á¤é¤ì¤Þ¤¹¡£
-@item
-¤È¤Æ¤â®¤¤
-@item
-¥­¥ã¥Ã¥·¥å¤·¤ä¤¹¤¤¡£
-@item
-¥¯¥é¥Ã¥·¥å¤Î¸åºÆ¹½ÃÛ¤·¤ä¤¹¤¤¡£¤Ê¤¼¤Ê¤é¥ì¥³¡¼¥É¤¬¸ÇÄꤵ¤ì¤¿°ÌÃ֤˳ä¤êÅö¤Æ¤é¤ì¤Æ¤¤
-¤ë¤«¤é¡£
-@item
-Doesn't have to be reorganized (with @code{myisamchk}) unless a huge number of
-records are deleted and you want to return free disk space to the operating
-system.
-@item
-Ä̾ưŪ¥Æ¡¼¥Ö¥ë¤è¤ê¤â¿¤¯¤Î¥Ç¥£¥¹¥¯ÍÆÎ̤¬É¬Íס£
-@end itemize
-
-@node Dynamic format, Compressed format, Static format, MyISAM table formats
-@subsubsection Dynamic table characteristics
-
-This format is used if the table contains any @code{VARCHAR}, @code{BLOB}
-or @code{TEXT} columns or if the table was created with
-@code{ROW_FORMAT=dynamic}.
-
-¤³¤Î·Á¼°¤Ï¾¯¤·Ê£»¨¤Ç¤¹¡£ ¤Ê¤¼¤Ê¤é¤½¤ì¤¾¤ì¤Î¥ì¥³¡¼¥É¤¬¡¢¥ì¥³¡¼¥É¤¬¤É¤Î¤°¤é¤¤¤Î
-Ťµ¤ò»ý¤Ã¤Æ¤¤¤ë¤«¤òµ­Ï¿¤¹¤ë¥Ø¥Ã¥À¡¼¤ò»ý¤Ã¤Æ¤¤¤ë¤«¤é¤Ç¤¹¡£
-One record can also end up at more than one
-location when it is made longer at an update.
-
-@code{OPTIMIZE table} ¤« @code{myisamchk} ¤ò»ÈÍѤ·¤Æ¡¢¥Æ¡¼¥Ö¥ë¤Î
-¥Õ¥é¥°¥á¥ó¥Æ¡¼¥·¥ç¥ó¤ò½¤Àµ¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£
-If you have static data that you access/change a lot in the same
-table as some @code{VARCHAR} or @code{BLOB} columns, it might be a good
-idea to move the dynamic columns to other tables just to avoid
-fragmentation.
-
-@itemize @bullet
-@item
-Á´¤Æ¤Îʸ»ú¥Õ¥£¡¼¥ë¥É¤¬Æ°Åª¤Ë¤Ê¤ê¤Þ¤¹¡Ê¤¿¤À¤·4byte¤è¤êû¤¤Êª¤Ï½ü¤­¤Þ¤¹¡Ë
-@item
-¤½¤ì¤¾¤ì¤Î¥ì¥³¡¼¥É¤ÎÀèƬ¤Ë¤Ï¡¢¥Õ¥£¡¼¥ë¥É¤Î¾õÂÖ¤òɽ¤¹¥Ó¥Ã¥È¡¦¥Þ¥Ã¥×¤¬¤­¤Þ¤¹¡£
-¤³¤Î¥Ó¥Ã¥È¤Ï¡¢¤É¤Îʸ»ú·¿¥Õ¥£¡¼¥ë¥É¤¬¶õʸ»ú(@code{''})¤Ê¤Î¤«¡¢
-¤É¤Î¿ôÃÍ¥Õ¥£¡¼¥ë¥É¤¬¥¼¥í¤Ê¤Î¤«¤ò¼¨¤·¤Þ¤¹¡£
-(¤³¤ì¤Ï¥Õ¥£¡¼¥ë¥É¤ÎÃͤ¬ @code{NULL} ÃͤȤϰ㤤¤Þ¤¹)¡£
-¤â¤·¡¢Ê¸»ú·¿¥Õ¥£¡¼¥ë¥É¤Îʸ»úÎó¤ÎŤµ(¸å¤Ë³¤¯¶õÇò¤Ï¼è¤ê½ü¤«¤ì¤ë)¤¬ ¥¼¥í ¤Ç
-¤¢¤Ã¤¿¤ê¡¢¤¢¤ë¤¤¤Ï¡¢¿ôÃÍ¥Õ¥£¡¼¥ë¥É¤ÎÃͤ¬ ¥¼¥í ¤Ç¤¢¤Ã¤¿¾ì¹ç¤Ï¡¢
-¤½¤Î¥Õ¥£¡¼¥ë¥É¤Ï¥Ó¥Ã¥È¡¦¥Þ¥Ã¥×¤Ë¥Þ¡¼¥¯¤µ¤ì¡¢Ãͤϥǥ£¥¹¥¯¤Ë¤ÏÊݸ¤µ¤ì¤Þ¤»¤ó¡£
-¶õʸ»ú¤Ç¤Ï¤Ê¤¤¾ì¹ç¤Ï¡¢Ê¸»úÎó¤Î¥Ð¥¤¥È¿ô¤¬¥Ó¥Ã¥È¡¦¥Þ¥Ã¥×¤Ëµ­Ï¿¤µ¤ì¡¢
-ʸ»úÎ󼫿Ȥ¬¥Õ¥£¡¼¥ë¥É¤ËÊݸ¤µ¤ì¤Þ¤¹¡£
-@item
-Ä̾¸ÇÄêĹ¤Î¥Æ¡¼¥Ö¥ë¤è¤ê¤â¾¯¤Ê¤¤¥Ç¥£¥¹¥¯ÍÆÎ̤Ǥ¹¤ß¤Þ¤¹
-@item
-¤½¤ì¤¾¤ì¤Î¥ì¥³¡¼¥É¤Ï¡¢Í׵ᤵ¤ì¤¿¤À¤±¤Î¥¹¥Ú¡¼¥¹¤ò»ÈÍѤ·¤Þ¤¹¡£
-¤â¤·¤¢¤ë¥ì¥³¡¼¥É¤¬Â礭¤¯¤Ê¤ë¤È¡¢Í׵ᤵ¤ì¤¿Ê¬¡¢¤½¤ì¤ò¿¤¯¤ÎÃÇÊÒ¤Ëʬ¤±¤Þ¤¹¡£
-¤³¤Î·ë²Ì¡¢¥ì¥³¡¼¥É¤Î¥Õ¥é¥°¥á¥ó¥Æ¡¼¥·¥ç¥ó¤¬È¯À¸¤·¤Þ¤¹¡£
-@item
-If you update a row with information that extends the row length, the
-row will be fragmented. In this case, you may have to run @code{myisamchk
--r} from time to time to get better performance. Use @code{myisamchk -ei
-tbl_name} for some statistics.
-@item
-Not as easy to reconstruct after a crash, because a record may be fragmented
-into many pieces and a link (fragment) may be missing.
-@item
-´üÂÔ¤µ¤ì¤ë¥ì¥³¡¼¥É¤ÎŤµ¤Ï¡§
-
-@example
-3
-+ (¥Õ¥£¡¼¥ë¥É¿ô + 7) / 8
-+ (char ¥Õ¥£¡¼¥ë¥É¤Î¿ô)
-+ ¿ôÃÍ¥Õ¥£¡¼¥ë¥É¤ò¥Ñ¥Ã¥¯¤·¤¿¥µ¥¤¥º
-+ ʸ»ú¤ÎŤµ
-+ (NULL ¥Õ¥£¡¼¥ë¥É¤Î¿ô + 7) / 8
-@end example
-
-There is a penalty of 6 bytes for each link. A dynamic record is linked
-whenever an update causes an enlargement of the record. Each new link will be
-at least 20 bytes, so the next enlargement will probably go in the same link.
-If not, there will be another link. You may check how many links there are
-with @code{myisamchk -ed}. All links may be removed with @code{myisamchk -r}.
-@end itemize
-
-@node Compressed format, , Dynamic format, MyISAM table formats
-@subsubsection Compressed table characteristics
-
-¤³¤ì¤ÏÆɤ߹þ¤ßÀìÍѤη¿¤Ç¡¢¥ª¥×¥·¥ç¥ó¥Ä¡¼¥ë¤Î @code{myisampack} ¤ÇºîÀ®¤µ¤ì¤Þ¤¹¡£
-(@code{pack_isam} for @code{ISAM} tables).
-
-@code{myisampack} and @code{pack_isam} are available to all customers
-that have bought a @strong{MySQL} license or @code{MySQL} support
-for their internal use.
-
-@itemize @bullet
-@item
-The uncompress code exists in all @strong{MySQL} distributions so that
-even customers who don't have @code{myisampack} can read tables that
-were compressed with @code{myisampack}
-@item
-Compressed tables takes very little disk space. This minimizes disk usage which
-is very nice when using slow disks (like CD-ROMs).
-@item
-Each record is compressed separately (very little access overhead). The
-header for a record is fixed (1-3 bytes) depending on the biggest record in the
-table. Each column is compressed differently. Some of the compression types
-are:
-@itemize @minus
-@item
-There is usually a different Huffman table for each column.
-@item
-Suffix space compression.
-@item
-Prefix space compression.
-@item
-Numbers with value @code{0} are stored using 1 bit.
-@item
-If values in an integer column have a small range, the column is stored using
-the smallest possible type. For example, a @code{BIGINT} column (8 bytes) may
-be stored as a @code{TINYINT} column (1 byte) if all values are in the range
-@code{0} to @code{255}.
-@item
-If a column has only a small set of possible values, the column type is
-converted to @code{ENUM}.
-@item
-A column may use a combination of the above compressions.
-@end itemize
-@item
-Can handle fixed or dynamic length records, but not @code{BLOB} or @code{TEXT}
-columns.
-@item
-Can be uncompressed with @code{myisamchk}.
-@end itemize
-
-@node ISAM, HEAP, MyISAM, Table types
-@section ISAM tables
-
-You can also use the deprecated ISAM table type. This will disappear
-rather soon because @code{MyISAM} is a better implementation of the same
-thing. ISAM uses a @code{B-tree} index. The index is stored in a file
-with the @code{.ISM} extension and the data is stored in file with the
-@code{.ISD} extension. You can check/repair ISAM tables with the
-@code{isamchk} utility. @xref{Crash recovery}.
-
-@code{ISAM} has the following features/properties:
-
-@itemize @bullet
-@item Compressed and fixed length keys
-@item Fixed and dynamic record length
-@item 16 keys with 16 key parts / key
-@item Max key length 256 (default)
-@item Data is stored in machine format; this is fast, but is machine/OS dependent.
-@end itemize
-
-Most of the things for @code{MyISAM} tables are also true for @code{ISAM}
-tables. @xref{MyISAM}. The major differences compared to @code{MyISAM}
-tables are:
-
-@itemize @bullet
-@item ISAM tables are not binary portable across OS/Platforms.
-@item Can't handle tables > 4G.
-@item Only support prefix compression on strings
-@item Smaller key limits.
-@item Dynamic tables gets more fragmented.
-@item Tables are compressed with @code{pack_isam} rather than with @code{myisampack}.
-@end itemize
-
-@node HEAP, BDB, ISAM, Table types
-@section HEAP tables
-
-@code{HEAP} tables use a hashed index and are stored in memory. This
-makes them very fast, but if @strong{MySQL} crashes you will lose all
-data stored in them. @code{HEAP} is very useful as temporary tables!
-
-@strong{MySQL} ÆâÉô HEAP ¥Æ¡¼¥Ö¥ë¤Ï¡¢100% ¥À¥¤¥Ê¥Ã¥ß¥Ã¥¯¡¦¥Ï¥Ã¥·¥ó¥°¤ò
-»ÈÍѤ·¤Æ¤ª¤¤¤Þ¤¹¡Ê¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¥¨¥ê¥¢Ìµ¤·¤Ë¡Ë¡£
-There is no extra space needed for free lists.
-@code{HEAP} tables also don't have problems with delete + inserts, which
-normally is common with hashed tables..
-
-@example
-mysql> CREATE TABLE test TYPE=HEAP SELECT ip,SUM(downloads) as down
- FROM log_table GROUP BY ip;
-mysql> SELECT COUNT(ip),AVG(down) FROM test;
-mysql> DROP TABLE test;
-@end example
-
-Here are some things you should consider when you use @code{HEAP} tables:
-
-@itemize @bullet
-@item
-You should always use specify @code{MAX_ROWS} in the @code{CREATE} statement
-to ensure that you accidently do not use all memory.
-@item
-Indexes will only be used with @code{=} and @code{<=>} (but are VERY fast).
-@item
-@code{HEAP} tables can only use whole keys to search for a row; compare this
-to @code{MyISAM} tables where any prefix of the key can be used to find rows.
-@item
-@code{HEAP} tables use a fixed record length format.
-@item
-@code{HEAP} doesn't support @code{BLOB}/@code{TEXT} columns.
-@item
-@code{HEAP} doesn't support @code{AUTO_INCREMENT} columns.
-@item
-@code{HEAP} doesn't support an index on a @code{NULL} column.
-@item
-You can have non-unique keys in a @code{HEAP} table (this isn't common for
-hashed tables).
-@item
-@code{HEAP} tables are shared between all clients (just like any other
-table).
-@item
-You can't search for the next entry in order (that is to use the index
-to do a @code{ORDER BY}).
-@item
-Data for @code{HEAP} tables are allocated in small blocks. The tables
-are 100% dynamic (on inserting). No overflow areas and no extra key
-space is needed. Deleted rows are put in a linked list and are
-reused when you insert new data into the table.
-@item
-You need enough extra memory for all HEAP tables that you want to use at
-the same time.
-@item
-To free memory, you should execute @code{DELETE FROM heap_table} or
-@code{DROP TABLE heap_table}.
-@item
-@strong{MySQL} cannot find out how approximately many rows there
-are between two values (this is used by the range optimizer to decide which
-index to use). This may affect some queries if you change a @code{MyISAM}
-table to a @code{HEAP} table.
-@item
-To ensure that you accidentally don't do anything stupid, you can't create
-@code{HEAP} tables bigger than @code{max_heap_table_size}.
-@end itemize
-
-Memory needed for one row in a @code{HEAP} table is:
-
-SUM_OVER_ALL_KEYS(max_length_of_key + sizeof(char*)*2) +
-ALIGN(length_of_row+1,sizeof(char*))
-
-@code{sizeof(char*)} is 4 on 32 bit machines and 8 on 64 bit machines.
-
-@node BDB, , HEAP, Table types
-@section BDB or Berkeley_db tables
-
-Berkeley DB (@uref{http://www.sleepycat.com}) has provided @strong{MySQL}
-with a transaction safe table handler. This will survive crashes and
-also provides @code{COMMIT} and @code{ROLLBACK} on transactions. In
-order to build MySQL 3.23.x (BDB support first appeared in 3.23.15) with
-support for @code{BDB} tables, you will need Berkeley DB 3.1.11 or newer
-which can be downloaded from @uref{http://www.mysql.com/download_3.23.html};
-or also from Sleepycat's download page at @uref{http://www.sleepycat.com/download.html}.
-
-Even if Berkeley DB is in itself very tested and reliably, the
-@strong{MySQL} interface is still very alpha, but we are actively
-improving and optimizing it to get it this stable real soon.
-
-If you are running with @code{AUTOCOMMIT=0} then your changes in @code{BDB}
-tables will not be updated until you execute @code{COMMIT}. Instead of commit
-you can execute @code{ROLLBACK} to forget your changes. @xref{COMMIT}.
-
-The following options to @code{mysqld} can be used to change the behavour of
-BDB tables:
-
-@multitable @columnfractions .30 .70
-@item --bdb-home= directory @tab Berkeley home direcory
-item --bdb-lock-detect=# @tab Berkeley lock detect. One of (DEFAULT, OLDEST, RANDOM or YOUNGEST)
-@item --bdb-logdir=directory @tab Berkeley DB log file directory
-@item --bdb-nosync @tab Don't synchronously flush logs
-@item --bdb-recover @tab Start Berkeley DB in recover mode
-@item --bdb-tmpdir=directory @tab Berkeley DB tempfile name
-@item --skip-bdb @tab Don't use berkeley db.
-@end multitable
-
-If you use @code{--skip-bdb}, @strong{MySQL} will not initialize the
-Berkeley DB library and this will save a lot of memory. You can of course
-not use @code{BDB} tables if you are using this option.
-
-Some characteristic of @code{BDB} tables:
-
-@itemize @bullet
-@item
-All @code{BDB} tables must have a primary key.
-@item
-If all columns you access in a @code{BDB} tables is part of the same index or
-part of the the primary key then @strong{MySQL} can execute the query
-without having to access the actual row. In a @code{MyISAM} table the
-above holds only if the columns are part of the same index.
-@item
-@code{LOCK TABLES} works on @code{BDB} tables as with other tables. If
-you don't use @code{LOCK TABLE}, @strong{MYSQL} will issue an internal
-multiple write lock on the table to ensure that the table will be
-properly locked if one another thread issues a table lock.
-@item
-@code{ALTER TABLE} doesn't yet work on @code{BDB} tables.
-@item
-Internal locking in @code{BDB} tables are done on page level.
-@item
-Scanning is slower than with @code{MyISAM} tables as one has data in BDB
-tables is stored in B-trees and not in a separate data file.
-@item
-One must in the application always be prepared to handle the case that
-any change of a @code{BDB} table may make an automatic rollback and any
-read may fail with a deadlock error.
-@item
-Keys are not compressed to previous keys as with ISAM or MyISAM
-tables. In other words, the key information will take a little more
-space in @code{BDB} tables compared to MyISAM tables with don't use
-@code{PACK_KEYS=0}.
-@item
-One must do a @code{FLUSH LOGS} from time to time to sync to get checkpoints
-for the @code{BDB} tables.
-@item
-As transaction logs take more place than ordinary logs it's more important
-to rotate and remove old logs when using @code{BDB} tables than using other table
-types.
-@end itemize
-
-Some things that we have to fix in the near future:
-
-@itemize @bullet
-@item
-Remove the requirement that @code{BDB} tables must have a primary key. This
-will be fixed by having an automatic hidden auto_increment column for
-the tables without a primary key.
-@item
-@code{LOCK TABLES} should work as for other @strong{MySQL} tables.
-@item
-@code{ALTER TABLE} doesn't yet work.
-@item
-@code{SHOW TABLE STATUS} doesn't yet provide that much information for BDB
-tables.
-@end itemize
-
-@node Tutorial, Server, Table types, Top
-@chapter MySQL ¥Á¥å¡¼¥È¥ê¥¢¥ë
-
-@menu
-* Connecting-disconnecting:: Connecting to and disconnecting from the server
-* Entering queries:: Entering queries
-* Examples:: Examples
-* Searching on two keys::
-* Database use:: Creating and using a database
-* Getting information:: Getting information about databases and tables
-* Batch mode:: Using @code{mysql} in batch mode
-* Twin:: Queries from twin project
-@end menu
-
-¤³¤Î¾Ï¤Ç¤Ï¡¢ @code{mysql} ¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤Î»ÈÍѤλÅÊý¤È
-ñ½ã¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎºîÀ®¤È»ÈÍѤλÅÊý¤òÎãÂê¤È¤·¤Æ¤È¤ê¾å¤²¤Þ¤¹¡£
-@code{mysql} (``terminal monitor'' ¤ä ``monitor'' ¤È¤·¤Æ»²¾È¤µ¤ì¤Þ¤¹)¤Ï
-@strong{MySQL} ¥µ¡¼¥Ð¡¼¤ËÀܳ¤Ç¤­¤ëÂÐÏå⡼¥É¤Î¥×¥í¥°¥é¥à¤Ç¡¢
-¥¯¥¨¥ê¤Î¼Â¹Ô¤ä·ë²Ì¤Îɽ¼¨¤¬²Äǽ¤Ç¤¹¡£
-@code{mysql} ¤Ï¥Ð¥Ã¥Á¥â¡¼¥É¤â²Äǽ¤Ç¤¹¡§ ¥¯¥¨¥ê¤ò¤Þ¤º¥Õ¥¡¥¤¥ë¤Ë½ñ¤¤¤Æ¤ª¤­¡¢
-¤½¤·¤Æ¤½¤Î¥Õ¥¡¥¤¥ë¤ò @code{mysql} ¤Ë¼Â¹Ô¤µ¤»¤Þ¤¹¡£
-¤É¤Á¤é¤ÎÊýË¡¤Ç¤â @code{mysql} ¤Ï¤³¤Î¾Ï¤ÎÀâÌÀ¤Ç¥«¥Ð¡¼¤µ¤ì¤Þ¤¹¡£
-
-@code{mysql} ¤ÎÄ󶡤¹¤ë¥ª¥×¥·¥ç¥ó¤ò¸«¤ë¤Ë¤Ï¡¢ @code{--help} ¥ª¥×¥·¥ç¥ó¤ò
-¼Â¹Ô¤·¤Þ¤¹¡§
-
-@example
-shell> mysql --help
-@end example
-
-¤³¤Î¾Ï¤Ç¤Ï @code{mysql} ¤¬´û¤Ë¤¢¤Ê¤¿¤Î¥Þ¥·¥ó¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤È¤·¡¢
-¤Þ¤¿ @strong{MySQL} ¥µ¡¼¥Ð¡¼¤ËÀܳ²Äǽ¤Ç¤¢¤ë¤È¤·¤Þ¤¹¡£ ¤â¤·¤½¤¦¤Ç¤Ê¤¤¤Ê¤é¡¢
-¤¢¤Ê¤¿¤Î @strong{MySQL} ´ÉÍý¼Ô¤ËÏ¢Íí¤ò¼è¤Ã¤Æ¤¯¤À¤µ¤¤¡£
-(¤â¤·@emph{¤¢¤Ê¤¿¼«¿È¤¬}´ÉÍý¼Ô¤Ê¤é¡¢¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Î¾¤Î¥»¥¯¥·¥ç¥ó¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£)
-
-ËܾϤǤϥǡ¼¥¿¥Ù¡¼¥¹ÀßÄê¤ÎÁ´ÂÎ¤Î¥×¥í¥»¥¹¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î»ÈÍѤˤĤ¤¤Æ½Ò¤Ù¤Þ¤¹¡£
-¤â¤·¤¢¤Ê¤¿¤¬´û¤Ë¸ºß¤·¤Æ¤¤¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¥¢¥¯¥»¥¹¤¹¤ë»ö¤À¤±¤Ë¶½Ì£¤¬¤¢¤ë¤Ê¤é¡¢
-¤³¤Î¾Ï¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¡¢¥Æ¡¼¥Ö¥ë¤ÎºîÀ®ÊýË¡¤ÎÀâÌÀ¤òÆɤßÈô¤Ð¤·¤Æ¤â¤«¤Þ¤¤¤Þ¤»¤ó¡£
-
-¤³¤Î¾Ï¤¬ËܼÁŪ¤Ë¤Ï¥Á¥å¡¼¥È¥ê¥¢¥ë¤Ç¤¢¤ë¤Î¤Ç¡¢Â¿¤¯¤Î¾ÜºÙ¤Ï¡¢¤«¤Ê¤é¤º°ã¤¦¾Ï¤Ë¤¢¤ê¤Þ¤¹¡£
-¤³¤³¤Ë½ñ¤«¤ì¤Æ¤¤¤ë»öÊÁ¤Ç¡¢
-¤µ¤é¤Ë¾Ü¤·¤¤¾ðÊó¤Ë¤Ä¤¤¤Æ¤Ï¥Þ¥Ë¥å¥¢¥ë¤ÎŬÀڤʥ»¥¯¥·¥ç¥ó¤òÄ´¤Ù¤Æ²¼¤µ¤¤¡£
-
-
-@node Connecting-disconnecting, Entering queries, Tutorial, Tutorial
-@section ¥µ¡¼¥Ð¡¼¤Ø¤ÎÀܳ¤ÈÀÚÃÇ
-
-¥µ¡¼¥Ð¡¼¤Ë @code{mysql} ¥³¥Þ¥ó¥É¤«¤éÀܳ¤¹¤ë¤¿¤á¤Ë¤Ï¡¢Ä̾
-@strong{MySQL} ¥æ¡¼¥¶Ì¾¡¢¥Ñ¥¹¥ï¡¼¥É¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¤Ç¤·¤ç¤¦¡£
-¤â¤·¤¢¤Ê¤¿¤¬¥í¥°¥¤¥ó¤·¤Æ¤¤¤ë°Ê³°¤Î¥Þ¥·¥ó¤Î¾å¤Ç¥µ¡¼¥Ð¡¼¤¬Áö¤Ã¤Æ¤¤¤ì¤Ð¡¢
-¤¢¤Ê¤¿¤Ï¡¢¥Û¥¹¥È̾¤òÌÀ¼¨¤¹¤ëɬÍפ¬¤¢¤ë¤Ç¤·¤ç¤¦¡£
-¤Þ¤º¤¢¤Ê¤¿¤Î´ÉÍý¼Ô¤ËÌ䤤¹ç¤ï¤»¤Æ¡¢¤¢¤Ê¤¿¤¬»È¤¦¤Ù¤­Àܳ¤Î¤¿¤á¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤ò¸«¤Ä¤±½Ð¤·¤Æ²¼¤µ¤¤¡£
-(¤¹¤Ê¤ï¤Á¡¢¤É¤Î¤è¤¦¤Ê¥Û¥¹¥È¡¢¥æ¡¼¥¶¡¼Ì¾¤È¥Ñ¥¹¥ï¡¼¥É¤ò»È¤¦¤Ù¤­¤Ê¤Î¤«¡£)
-ŬÀڤʥѥé¥á¡¼¥¿¡¼¤òÃΤäƤ¤¤ì¤Ð¡¢¤¢¤Ê¤¿¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤ÆÀܳ¤Ç¤­¤Þ¤¹¡§
-
-@example
-shell> mysql -h host -u user -p
-Enter password: ********
-@end example
-
-@code{********} ¤È¤«¤«¤ì¤Æ¤¤¤ëÉôʬ¤Ë¤Ï¤¢¤Ê¤¿¤Î¥Ñ¥¹¥ï¡¼¥É¤òÆþ¤ì¤Þ¤¹¡¨
-@code{mysql} ¤¬ @code{Enter password:} ¥×¥í¥ó¥×¥È¤ò½Ð¤·¤¿¤È¤­¤Ë¡£
-
-¤­¤Á¤ó¤ÈÆ°¤±¤Ð¡¢¤¤¤¯¤Ä¤«¤Î¾ðÊó¤È @code{mysql>} ¥×¥í¥ó¥×¥È¤¬¸½¤ì¤Þ¤¹¡§
-
-@example
-shell> mysql -h host -u user -p
-Enter password: ********
-Welcome to the MySQL monitor. Commands end with ; or \g.
-Your MySQL connection id is 459 to server version: 3.22.20a-log
-
-Type 'help' for help.
-
-mysql>
-@end example
-
-¤³¤Î¥×¥í¥ó¥×¥È¤Ï @code{mysql} ¤¬¥³¥Þ¥ó¥ÉÆþÎϤòÂԤäƤ¤¤ë¾õÂÖ¤ò¼¨¤·¤Þ¤¹¡£
-
-¤¤¤¯¤Ä¤«¤Î @strong{MySQL} ¥¤¥ó¥¹¥È¥ì¡¼¥·¥ç¥ó¤Ç¤Ï¡¢¥í¡¼¥«¥ë¥Û¥¹¥È¤Ç
-¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë¥µ¡¼¥Ð¡¼¤Ë¡¢¥æ¡¼¥¶¡¼¤Ë``ƿ̾''(̾Á°Ìµ¤·)¤ÎÀܳ¤òµö¤·¤Æ¤¤¤Þ¤¹¡£
-¤â¤·¤¢¤Ê¤¿¤Î¥Þ¥·¥ó¤¬¤³¤Î¾ì¹ç¤ËÅö¤Æ¤Ï¤Þ¤ë¤Ê¤é¡¢@code{mysql} ¤ò¥ª¥×¥·¥ç¥ó̵¤·¤Ç
-µ¯Æ°¤¹¤Ù¤­¤Ç¤¹¡§
-
-@example
-shell> mysql
-@end example
-
-Àܳ¤¬À®¸ù¤·¤¿¸å¡¢ @code{mysql>} ¥×¥í¥ó¥×¥È¤Ç¡¢@code{QUIT} ¤È¥¿¥¤¥×¤¹¤ì¤Ð
-¤¤¤Ä¤Ç¤âÀܳ¤òÀڤ뤳¤È¤¬¤Ç¤­¤Þ¤¹¡§
-
-@example
-mysql> QUIT
-Bye
-@end example
-
-control-D ¤ÇÀÚÃǤ·¤Æ¤â¤«¤Þ¤¤¤Þ¤»¤ó¡£
-
-°Ê²¼¤Î¥»¥¯¥·¥ç¥ó¤Ç¤Î¤Û¤È¤ó¤É¤ÎÎã¤Ç¤Ï¡¢¤¢¤Ê¤¿¤¬¥µ¡¼¥Ð¡¼¤ËÀܳ¤·¤Æ¤¤¤ë¤â¤Î¤È
-¤·¤Æ¤¤¤Þ¤¹¡£¤½¤Î¾ì¹ç¤Ï @code{mysql>} ¥×¥í¥ó¥×¥È¤Ë¤è¤Ã¤Æ¡¢¤½¤ì¤ò¼¨¤·¤Æ¤¤¤Þ¤¹¡£
-
-
-@node Entering queries, Examples, Connecting-disconnecting, Tutorial
-@section ¥¯¥¨¥ê¤ÎÆþÎÏ
-
-Á°¤Î¥»¥¯¥·¥ç¥ó¤Ç½Ò¤Ù¤¿¤è¤¦¤Ë¡¢¤¢¤Ê¤¿¤¬¥µ¡¼¥Ð¡¼¤È¤Ä¤Ê¤¬¤Ã¤Æ¤¤¤ë¤³¤È¤ò³Î¤«¤á¤Æ²¼¤µ¤¤¡£
-¤³¤Î¾õÂ֤ǤϤޤÀ¤É¤ó¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹¤âÁªÂò¤·¤Æ¤¤¤Ê¤¤¾õÂ֤Ǥ¹¡£¤·¤«¤·¤½¤ì¤Ï¤«¤Þ¤¤¤Þ¤»¤ó¡£
-¤³¤³¤Ç¤Ï¡¢¥Æ¡¼¥Ö¥ë¤ÎºîÀ®¤ä¥Ç¡¼¥¿¤ÎÆþÎÏ¡¢¼è¤ê½Ð¤·¤è¤ê¤â¡¢
-¤¤¤«¤Ë¥¯¥¨¥ê¤òȯ¹Ô¤¹¤ë¤«¤Ë½ÅÅÀ¤òÃÖ¤­¤Þ¤¹¡£
-¤³¤Î¥»¥¯¥·¥ç¥ó¤Ç¤Ï¡¢¤¢¤Ê¤¿¼«¿È¤ò @code{mysql} ¤ÎÆ°¤­¤Ë´·¤ì¤µ¤»¤ë¤¿¤á¤Ë¡¢
-¤¢¤Ê¤¿¤¬¤ä¤Ã¤Æ¤ß¤ë¤³¤È¤¬¤Ç¤­¤ë¤Ç¤¢¤í¤¦¡¢¤¤¤¯¤Ä¤«¤Î¥¯¥¨¥ê¤ò»ÈÍѤ·¤Æ¡¢
-¥³¥Þ¥ó¥ÉÆþÎϤδðËÜŪ¤Ê¸¶Â§¤ò½Ò¤Ù¤Þ¤¹¡£
-
-¥µ¡¼¥Ð¡¼¤Î¥Ð¡¼¥¸¥ç¥ó¡¢º£Æü¤ÎÆüÉÕ¤ò¥µ¡¼¥Ð¡¼¤ËÌ䤤¹ç¤ï¤»¤ë¡¢Ã±½ã¤Ê¥³¥Þ¥ó¥É
-¤¬¤³¤³¤Ë¤¢¤ê¤Þ¤¹¡£ °Ê²¼¤Î¤è¤¦¤Ë @code{mysql>} ¥×¥í¥ó¥×¥È¤Î¸å¤ËÆþÎϤ·
- RETURN ¥­¡¼¤ò²¡¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡§
-
-@example
-mysql> SELECT VERSION(), CURRENT_DATE;
-+--------------+--------------+
-| version() | CURRENT_DATE |
-+--------------+--------------+
-| 3.22.20a-log | 1999-03-19 |
-+--------------+--------------+
-1 row in set (0.01 sec)
-mysql>
-@end example
-
-¤³¤Î¥¯¥¨¥ê¤Ï¡¢@code{mysql} ¤Î¤¤¤¯¤Ä¤«¤Î»ö¤òÀâÌÀ¤·¤Æ¤¤¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-Ä̾¥³¥Þ¥ó¥É¤Ï¡¢¥»¥ß¥³¥í¥ó¤Ç½ª¤ï¤ë SQL ¥¹¥Æ¡¼¥È¥á¥ó¥È¤«¤é¡¢¹½À®¤µ¤ì¤Þ¤¹¡£
-(¥»¥ß¥³¥í¥ó¤¬É¬ÍפȤµ¤ì¤Ê¤¤¤¤¤¯¤Ä¤«¤ÎÎã³°¤¬¤¢¤ê¤Þ¤¹¡£
-°ÊÁ°¤Ë½Ò¤Ù¤¿ @code{QUIT} ¤Ï¤½¤Î¤¦¤Á¤Î°ì¤Ä¤Ç¤¹¡£¸å¤Ç¾¤â½Ð¤Æ¤­¤Þ¤¹¡£)
-
-@item
-¥³¥Þ¥ó¥É¤òȯ¹Ô¤¹¤ë¤È¡¢@code{mysql} ¤Ï¤½¤ì¤ò¥µ¡¼¥Ð¡¼¤ËÁ÷¤ê¡¢·ë²Ì¤òɽ¼¨¤·¤Þ¤¹¡£
-¤½¤Î¸å¡¢ @code{mysql>} ¥×¥í¥ó¥×¥È¤ò½Ð¤·¡¢Â¾¤Î¥³¥Þ¥ó¥É¤¬¼õ¤±ÉÕ¤±¤ì¤ë¾õÂ֤Ǥ¢¤ë¤È
-¼¨¤·¤Þ¤¹¡£
-
-@item
-@code{mysql} ¤Ï¥¯¥¨¥ê¤Î·ë²Ì¤òɽ¤Ë¤·¤Æ½Ð¤·¤Þ¤¹¡£ ºÇ½é¤Î¹Ô¤Ï¹àÌܤΥé¥Ù¥ë̾¤Ç¤¹¡£
-¤½¤Î²¼¤Î¹Ô¤Ë¡¢¥¯¥¨¥ê¤Î·ë²Ì¤¬Â³¤­¤Þ¤¹¡£ Ä̾¹àÌܤΥé¥Ù¥ë̾¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Æ¡¼¥Ö¥ë¤«¤é
-¤¢¤Ê¤¿¤¬¼è¤ê½Ð¤·¤¿¥Õ¥£¡¼¥ë¥É̾¤Ë¤Ê¤ê¤Þ¤¹¡£ ¥Æ¡¼¥Ö¥ë¤Î¥Õ¥£¡¼¥ë¥É̾°Ê³°¤Î¼°¤ò
-¤¢¤Ê¤¿¤¬¸¡º÷¤·¤¿¤Î¤Ê¤é(¤Á¤ç¤¦¤ÉÎã¤Î¤è¤¦¤Ë)¡¢@code{mysql} ¤ÏÍ¿¤¨¤é¤ì¤¿¼°¼«¿È¤ò
-¹àÌܤΥé¥Ù¥ë̾¤È¤·¤Æɽ¼¨¤·¤Þ¤¹¡£
-
-@item
-@code{mysql} ¤Ï²¿¥ì¥³¡¼¥É(rows)Ê֤äƤ­¤¿¤«¤ò¼¨¤·¡¢¼Â¹Ô¤Ë¤É¤ì¤¯¤é¤¤¤Î»þ´Ö¤¬
-¤«¤«¤Ã¤¿¤«¤â¼¨¤·¤Þ¤¹¡£ ¤³¤ì¤Ï¤ª¤ª¤¶¤Ã¤Ñ¤Ê¥µ¡¼¥Ð¡¼¤Î¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤ò¼¨¤·¤Þ¤¹¡£
-¤³¤ì¤é¤ÎÃÍ¤Ï wall clock time (CPU ¤ä ¥Þ¥·¥ó¥¿¥¤¥à¤Ç¤Ï¤Ê¤¯) ¤ò»ÈÍѤ·¤Æ¤ª¤ê¡¢¤µ¤é¤Ë¡¢
-¥µ¡¼¥Ð¡¼¤ÎÉé²Ù¡¢¤ª¤è¤Ó¥Í¥Ã¥È¥ï¡¼¥¯ÂÔ¤Á»þ´Ö¤È¤¤¤Ã¤¿Í×°ø¤Ë¤â±Æ¶Á¤µ¤ì¤ë¤Î¤Ç¡¢
-ÉÔÀµ³Î¤Ç¤¹¡£
-(¤³¤Î¾Ï¤Î¾¤ÎÎãÂê¤Ë¤ª¤¤¤Æ¤Ï ``rows in set'' ¤Î¹Ô¤Ï¾Ê¤­¤Þ¤¹¡£)
-@end itemize
-
-¥­¡¼¥ï¡¼¥É¤Ï¡¢¤¤¤«¤Ê¤ëÂçʸ»ú¾®Ê¸»ú¤Ç¤âµ­½Ò¤Ç¤­¤Þ¤¹¡£
-°Ê²¼¤Ë¼¨¤¹¥¯¥¨¥ê¤ÏƱ¤¸¤Ç¤¹¡§
-
-@example
-mysql> SELECT VERSION(), CURRENT_DATE;
-mysql> select version(), current_date;
-mysql> SeLeCt vErSiOn(), current_DATE;
-@end example
-
-°Ê²¼¤Î¥¯¥¨¥ê¤Ï¡¢@code{mysql} ¤ò´Êñ¤Ê·×»»µ¡¤È¤·¤Æ»ÈÍѤ·¤¿Îã¤Ç¤¹¡§
-
-@example
-mysql> SELECT SIN(PI()/4), (4+1)*5;
-+-------------+---------+
-| SIN(PI()/4) | (4+1)*5 |
-+-------------+---------+
-| 0.707107 | 25 |
-+-------------+---------+
-@end example
-
-
-º£¤Þ¤Ç¤Ï¸«¤Æ¤­¤¿¤¿¥³¥Þ¥ó¥É¤Ï¡¢Èæ³ÓŪû¤¤¡¢°ì¹Ô¤Î¤Îʸ¤Ç¤¹¡£
-¤¢¤Ê¤¿¤Ï°ì¹Ô¤ËÊ£¿ô¡¢Ê¸¤ò½ñ¤¯¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
-¤½¤ì¤¾¤ì¤Îʸ¤Î½ª¤ï¤ê¤Ë¤Ï¥»¥ß¥³¥í¥ó¤òÉÕ¤±¤Þ¤¹¡§
-
-@example
-mysql> SELECT VERSION(); SELECT NOW();
-+--------------+
-| version() |
-+--------------+
-| 3.22.20a-log |
-+--------------+
-
-+---------------------+
-| NOW() |
-+---------------------+
-| 1999-03-19 00:15:33 |
-+---------------------+
-@end example
-
-¥³¥Þ¥ó¥É¤Ï°ì¹Ô¤Ë¤«¤¯É¬Íפ⤢¤ê¤Þ¤»¤ó¡£ Ê£¿ô¹Ô¤Ë¤ï¤¿¤ëŤ¤¥³¥Þ¥ó¥É¤Ç¤âÌäÂꤢ¤ê¤Þ¤»¤ó¡£
-@code{mysql} ¤Ï¥»¥ß¥³¥í¥ó¤Ç¡¢°ìʸ¤Î½ª¤ï¤ê¤È¸«¤Ê¤·¤Þ¤¹¡£ ¤½¤Î¹Ô¤ÎºÇ¸å¤òʸ¤ÎºÇ¸å¤È¤Ï
-¸«¤Ê¤·¤Þ¤»¤ó¡£ ¡Ê¤¤¤¦¤Ê¤ì¤Ð¡¢@code{mysql} ¤Ï¼«Í³¤ÊÆþÎϤòµö¤·¡¢¥»¥ß¥³¥í¥ó¤¬¸½¤ì¤ë¤Þ¤Ç¤Ï
-¤½¤ì¤é¤ÎÆþÎϤµ¤ì¤¿¹Ô¤ò¼Â¹Ô¤·¤Þ¤»¤ó¡Ë
-
-Ê£¿ô¹Ô¤Ë¤Þ¤¿¤¬¤Ã¤¿Ê¸¤ÎÎã¤Ç¤¹¡§
-
-@example
-mysql> SELECT
- -> USER()
- -> ,
- -> CURRENT_DATE;
-+--------------------+--------------+
-| USER() | CURRENT_DATE |
-+--------------------+--------------+
-| joesmith@@localhost | 1999-03-18 |
-+--------------------+--------------+
-@end example
-
-¤³¤ÎÎã¤Ç¤Ï¡¢Ê£¿ô¤Ë¤Þ¤¿¤¬¤ë¥¯¥¨¥ê¤Ë¤ª¤¤¤Æ¡¢ºÇ½é¤Î¹Ô¤ÎÆþÎϤΤ¢¤È¡¢
-¤¤¤«¤Ë¥×¥í¥ó¥×¥È¤¬ @code{mysql>} ¤«¤é @code{->} ¤ËÊѤï¤ë¤«¤ò¼¨¤·¤Æ¤¤¤Þ¤¹¡£
-¤³¤ì¤Ï @code{mysql} ¤¬¡¢¤Þ¤Àʸ¤¬½ª¤ï¤Ã¤Æ¤ª¤é¤º¡¢»Ä¤ê¤ÎÉôʬ¤ÎÆþÎϤòÂԤäƤ¤¤ë
-¤³¤È¤ò¼¨¤·¤Þ¤¹¡£ The prompt is your friend, because it provides
-valuable feedback. If you use that feedback, you will always be aware of
-what @code{mysql} is waiting for.
-
-ÆþÎÏÃæ¤Ë¥³¥Þ¥ó¥É¤Î¼Â¹Ô¤ò¼è¤ê¤ä¤á¤è¤¦¤È»×¤Ã¤¿¾ì¹ç¡¢
-@code{\c} ¤Ç¤³¤ì¤ò¥­¥ã¥ó¥»¥ë¤Ç¤­¤Þ¤¹¡§
-
-@example
-mysql> SELECT
- -> USER()
- -> \c
-mysql>
-@end example
-
-Here, too, notice the prompt. It switches back to @code{mysql>} after you
-type @code{\c}, providing feedback to indicate that @code{mysql} is ready
-for a new command.
-
-°Ê²¼¤Îɽ¤Ë¡¢ @code{mysql} ¤Î¥×¥í¥ó¥×¥È¤È¤½¤Î¾õÂÖ¤ÎÀâÌÀ¤ò¼¨¤·¤Þ¤¹¡§
-
-@multitable @columnfractions .10 .9
-@item @strong{¥×¥í¥ó¥×¥È} @tab @strong{°ÕÌ£}
-@item @code{mysql>} @tab ¿·¤·¤¤¥³¥Þ¥ó¥É¤ÎÂÔ¾õÂÖ
-@item @code{@ @ @ @ ->} @tab Ê£¿ô¹Ô¤Ë¤Þ¤¿¤¬¤ë¥³¥Þ¥ó¥É¤Î¡¢¼¡¤Î¹Ô¤ÎÆþÎϤòÂԤäƤ¤¤ë¾õÂÖ¡£
-@item @code{@ @ @ @ '>} @tab ¥·¥ó¥°¥ë¥¯¥ª¡¼¥È (@samp{'}) ¤Ç»Ï¤á¤é¤ì¤¿Ê¸»ú¤Î¡¢¼¡¤Î¹Ô¤ÎÆþÎϤòÂԤäƤ¤¤ë¾õÂÖ¡£
-@item @code{@ @ @ @ ">} @tab ¥À¥Ö¥ë¥¯¥ª¡¼¥È (@samp{"}) ¤Ç»Ï¤á¤é¤ì¤¿Ê¸»ú¤Î¡¢¼¡¤Î¹Ô¤ÎÆþÎϤòÂԤäƤ¤¤ë¾õÂÖ¡£
-@end multitable
-
-¤¢¤Ê¤¿¤¬Ê¸¤ò¥»¥ß¥³¥í¥ó¤Ç½ª¤ï¤é¤¹¤³¤È¤ò˺¤ì¤Æ¼Â¹Ô¤·¤¿¾ì¹ç¤Ë¡¢
-Ê£¿ô¹Ô¤ÎÆþÎÏÂÔ¤Á¤¬µ¯¤³¤ê¤Þ¤¹¡£ ¤³¤Î¾ì¹ç¡¢ @code{mysql} ¤Ï
-¼¡¤ÎÆþÎϤòÂÔ¤Á¤Þ¤¹¡§
-
-@example
-mysql> SELECT USER()
- ->
-@end example
-
-If this happens to you (you think you've entered a statement but the only
-response is a @code{->} prompt), most likely @code{mysql} is waiting for the
-semicolon. If you don't notice what the prompt is telling you, you might sit
-there for a while before realizing what you need to do. Enter a semicolon to
-complete the statement, and @code{mysql} will execute it:
-
-@example
-mysql> SELECT USER()
- -> ;
-+--------------------+
-| USER() |
-+--------------------+
-| joesmith@@localhost |
-+--------------------+
-@end example
-
-The @code{'>} and @code{">} prompts occur during string collection.
-In @strong{MySQL}, you can write strings surrounded by either @samp{'}
-or @samp{"} characters (for example, @code{'hello'} or @code{"goodbye"}),
-and @code{mysql} lets you enter strings that span multiple lines. When you
-see a @code{'>} or @code{">} prompt, it means that you've entered a line
-containing a string that begins with a @samp{'} or @samp{"} quote character,
-but have not yet entered the matching quote that terminates the string.
-That's fine if you really are entering a multiple-line string, but how likely
-is that? Not very. More often, the @code{'>} and @code{">} prompts indicate
-that you've inadvertantly left out a quote character. For example:
-
-@example
-mysql> SELECT * FROM my_table WHERE name = "Smith AND age < 30;
- ">
-@end example
-
-If you enter this @code{SELECT} statement, then hit RETURN and wait for the
-result, nothing will happen. Instead of wondering, ``why does this
-query take so long?,'' notice the clue provided by the @code{">} prompt. It
-tells you that @code{mysql} expects to see the rest of an unterminated
-string. (Do you see the error in the statement? The string @code{"Smith} is
-missing the second quote.)
-
-At this point, what do you do? The simplest thing is to cancel the command.
-However, you cannot just type @code{\c} in this case, because @code{mysql}
-interprets it as part of the string that it is collecting! Instead, enter
-the closing quote character (so @code{mysql} knows you've finished the
-string), then type @code{\c}:
-
-@example
-mysql> SELECT * FROM my_table WHERE name = "Smith AND age < 30;
- "> "\c
-mysql>
-@end example
-
-The prompt changes back to @code{mysql>}, indicating that @code{mysql}
-is ready for a new command.
-
-It's important to know what the @code{'>} and @code{">} prompts signify,
-because if you mistakenly enter an unterminated string, any further lines you
-type will appear to be ignored by @code{mysql} --- including a line
-containing @code{QUIT}! This can be quite confusing, especially if you
-don't know that you need to supply the terminating quote before you can
-cancel the current command.
-
-@node Examples, Searching on two keys, Entering queries, Tutorial
-@section Examples of common queries
-
-Here follows examples of how to solve some common problems with
-@strong{MySQL}.
-
-Some of the examples use the table @code{shop} to hold the price of each
-article (item number) for certain traders (dealers). Supposing that each
-trader has a single fixed price per article, then (@code{item},
-@code{trader}) is a primary key for the records.
-
-You can create the example table as:
-
-@example
-CREATE TABLE shop (
- article INT(4) UNSIGNED ZEROFILL DEFAULT '0000' NOT NULL,
- dealer CHAR(20) DEFAULT '' NOT NULL,
- price DOUBLE(16,2) DEFAULT '0.00' NOT NULL,
- PRIMARY KEY(article, dealer));
-
-INSERT INTO shop VALUES
-(1,'A',3.45),(1,'B',3.99),(2,'A',10.99),(3,'B',1.45),(3,'C',1.69),
-(3,'D',1.25),(4,'D',19.95);
-@end example
-
-Okay, so the example data is:
-
-@example
-SELECT * FROM shop
-
-+---------+--------+-------+
-| article | dealer | price |
-+---------+--------+-------+
-| 0001 | A | 3.45 |
-| 0001 | B | 3.99 |
-| 0002 | A | 10.99 |
-| 0003 | B | 1.45 |
-| 0003 | C | 1.69 |
-| 0003 | D | 1.25 |
-| 0004 | D | 19.95 |
-+---------+--------+-------+
-@end example
-
-@menu
-* example-Maximum-column::
-* example-Maximum-row::
-* example-Maximum-column-group::
-* example-Maximum-column-group-row::
-* example-Foreign keys::
-@end menu
-
-@node example-Maximum-column, example-Maximum-row, Examples, Examples
-@subsection The maximum value for a column
-
-``What's the highest item number?''
-
-@example
-SELECT MAX(article) AS article FROM shop
-
-+---------+
-| article |
-+---------+
-| 4 |
-+---------+
-@end example
-
-@node example-Maximum-row, example-Maximum-column-group, example-Maximum-column, Examples
-@subsection The row holding the maximum of a certain column
-
-``Find number, dealer, and price of the most expensive article.''
-
-In ANSI SQL this is easily done with a sub-query:
-
-@example
-SELECT article, dealer, price
-FROM shop
-WHERE price=(SELECT MAX(price) FROM shop)
-@end example
-
-In @strong{MySQL} (which does not yet have sub-selects), just do it in
-two steps:
-
-@enumerate
-@item
-Get the maximum price value from the table with a @code{SELECT} statement.
-@item
-Using this value compile the actual query:
-@example
-SELECT article, dealer, price
-FROM shop
-WHERE price=19.95
-@end example
-@end enumerate
-
-Another solution is to sort all rows descending by price and only
-get the first row using the @strong{MySQL} specific @code{LIMIT} clause:
-
-@example
-SELECT article, dealer, price
-FROM shop
-ORDER BY price DESC
-LIMIT 1
-@end example
-
-@strong{Note}: If there are several most expensive articles (e.g. each 19.95)
-the @code{LIMIT} solution shows only one of them!
-
-@node example-Maximum-column-group, example-Maximum-column-group-row, example-Maximum-row, Examples
-@subsection Maximum of column: per group: only the values
-
-``What's the highest price per article?''
-
-@example
-SELECT article, MAX(price) AS price
-FROM shop
-GROUP BY article
-
-+---------+-------+
-| article | price |
-+---------+-------+
-| 0001 | 3.99 |
-| 0002 | 10.99 |
-| 0003 | 1.69 |
-| 0004 | 19.95 |
-+---------+-------+
-@end example
-
-@node example-Maximum-column-group-row, example-Foreign keys, example-Maximum-column-group, Examples
-@subsection The rows holding the group-wise maximum of a certain field
-
-``For each article, find the dealer(s) with the most expensive price.''
-
-In ANSI SQL, I'd do it with a sub-query like this:
-
-@example
-SELECT article, dealer, price
-FROM shop s1
-WHERE price=(SELECT MAX(s2.price)
- FROM shop s2
- WHERE s1.article = s2.article)
-@end example
-
-In @strong{MySQL} it's best do it in several steps:
-
-@enumerate
-@item
-Get the list of (article,maxprice). @xref{example-Maximum-column-group-row}.
-@item
-For each article get the corresponding rows which have the stored maximum
-price.
-@end enumerate
-
-This can easily be done with a temporary table:
-
-@example
-CREATE TEMPORARY TABLE tmp (
- article INT(4) UNSIGNED ZEROFILL DEFAULT '0000' NOT NULL,
- price DOUBLE(16,2) DEFAULT '0.00' NOT NULL);
-
-LOCK TABLES article read;
-
-INSERT INTO tmp SELECT article, MAX(price) FROM shop GROUP BY article;
-
-SELECT article, dealer, price FROM shop, tmp
-WHERE shop.article=tmp.article AND shop.price=tmp.price;
-
-UNLOCK TABLES;
-
-DROP TABLE tmp;
-@end example
-
-If you don't use a @code{TEMPORARY} table, you must also lock the 'tmp' table.
-
-`Can it be done with a single query?''
-
-Yes, but only by using a quite inefficient trick that I call the
-``MAX-CONCAT trick'':
-
-@example
-SELECT article,
- SUBSTRING( MAX( CONCAT(LPAD(price,6,'0'),dealer) ), 7) AS dealer,
- 0.00+LEFT( MAX( CONCAT(LPAD(price,6,'0'),dealer) ), 6) AS price
-FROM shop
-GROUP BY article;
-
-+---------+--------+-------+
-| article | dealer | price |
-+---------+--------+-------+
-| 0001 | B | 3.99 |
-| 0002 | A | 10.99 |
-| 0003 | C | 1.69 |
-| 0004 | D | 19.95 |
-+---------+--------+-------+
-@end example
-
-The last example can of course be made a bit more efficient by doing the
-splitting of the concatenated column in the client.
-
-@node example-Foreign keys, , example-Maximum-column-group-row, Examples
-@subsection Using foreign keys
-
-You don't need foreign keys to join 2 tables.
-
-The only thing @strong{MySQL} doesn't do is @code{CHECK} to make sure that
-the keys you use really exist in the table(s) you're referencing and it
-doesn't automatically delete rows from table with a foreign key
-definition. If you use your keys like normal, it'll work just fine!
-
-
-@example
-CREATE TABLE persons (
- id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
- name CHAR(60) NOT NULL,
- PRIMARY KEY (id)
-);
-
-CREATE TABLE shirts (
- id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
- style ENUM('t-shirt', 'polo', 'dress') NOT NULL,
- color ENUM('red', 'blue', 'orange', 'white', 'black') NOT NULL,
- owner SMALLINT UNSIGNED NOT NULL REFERENCES persons,
- PRIMARY KEY (id)
-);
-
-
-INSERT INTO persons VALUES (NULL, 'Antonio Paz');
-
-INSERT INTO shirts VALUES
-(NULL, 'polo', 'blue', LAST_INSERT_ID()),
-(NULL, 'dress', 'white', LAST_INSERT_ID()),
-(NULL, 't-shirt', 'blue', LAST_INSERT_ID());
-
-
-INSERT INTO persons VALUES (NULL, 'Lilliana Angelovska');
-
-INSERT INTO shirts VALUES
-(NULL, 'dress', 'orange', LAST_INSERT_ID()),
-(NULL, 'polo', 'red', LAST_INSERT_ID()),
-(NULL, 'dress', 'blue', LAST_INSERT_ID()),
-(NULL, 't-shirt', 'white', LAST_INSERT_ID());
-
-
-SELECT * FROM persons;
-+----+---------------------+
-| id | name |
-+----+---------------------+
-| 1 | Antonio Paz |
-| 2 | Lilliana Angelovska |
-+----+---------------------+
-
-SELECT * FROM shirts;
-+----+---------+--------+-------+
-| id | style | color | owner |
-+----+---------+--------+-------+
-| 1 | polo | blue | 1 |
-| 2 | dress | white | 1 |
-| 3 | t-shirt | blue | 1 |
-| 4 | dress | orange | 2 |
-| 5 | polo | red | 2 |
-| 6 | dress | blue | 2 |
-| 7 | t-shirt | white | 2 |
-+----+---------+--------+-------+
-
-
-SELECT s.* FROM persons p, shirts s
- WHERE p.name LIKE 'Lilliana%'
- AND s.owner = p.id
- AND s.color <> 'white';
-
-+----+-------+--------+-------+
-| id | style | color | owner |
-+----+-------+--------+-------+
-| 4 | dress | orange | 2 |
-| 5 | polo | red | 2 |
-| 6 | dress | blue | 2 |
-+----+-------+--------+-------+
-@end example
-
-@findex UNION
-@node Searching on two keys, Database use, Examples, Tutorial
-@section Searching on two keys
-
-@strong{MySQL} doesn't yet optimize when you search on two different
-keys combined with @code{OR} (Searching on one key with different @code{OR}
-parts is optimized quite good):
-
-@example
-SELECT field1_index, field2_index FROM test_table WHERE field1_index = '1'
-OR field2_index = '1'
-@end example
-
-The reason is that we haven't yet had time to come up with an efficient
-way to handle this in the general case. (The @code{AND} handling is
-in comparison now completely general and works very well).
-
-For the moment you can solve this very efficently by using a
-@code{TEMPORARY} table; This type of optimization is also very good if
-you are using very complicated queries where the SQL server does the
-optimizations in the wrong order.
-
-@example
-CREATE TEMPORARY TABLE tmp
-SELECT field1_index, field2_index FROM test_table WHERE field1_index = '1';
-INSERT INTO tmp
-SELECT field1_index, field2_index FROM test_table WHERE field2_index = '1';
-SELECT * from tmp;
-DROP TABLE tmp;
-@end example
-
-The above way to solve this query is in effect an @code{UNION} of two queries.
-
-@node Database use, Getting information, Searching on two keys, Tutorial
-@section Creating and using a database
-
-@menu
-* Creating database:: Creating a database
-* Creating tables:: Creating a table
-* Loading tables:: Loading data into a table
-* Retrieving data:: Retrieving information from a table
-* Multiple tables:: Using more than one table
-@end menu
-
-Now that you know how to enter commands, it's time to access a database.
-
-Suppose you have several pets in your home (your ``menagerie'') and you'd
-like to keep track of various types of information about them. You can do so
-by creating tables to hold your data and loading them with the desired
-information. Then you can answer different sorts of questions about your
-animals by retrieving data from the tables. This section shows how to do
-all that:
-
-@itemize @bullet
-@item
-How to create a database
-@item
-How to create a table
-@item
-How to load data into the table
-@item
-How to retrieve data from the table in various ways
-@item
-How to use multiple tables
-@end itemize
-
-The menagerie database will be simple (deliberately), but it is not difficult
-to think of real-world situations in which a similar type of database might
-be used. For example, a database like this could be used by a farmer to keep
-track of livestock, or by a veterinarian to keep track of patient records.
-
-Use the @code{SHOW} statement to find out what databases currently exist
-on the server:
-
-@example
-mysql> SHOW DATABASES;
-+----------+
-| Database |
-+----------+
-| mysql |
-| test |
-| tmp |
-+----------+
-@end example
-
-The list of databases is probably different on your machine, but the
-@code{mysql} and @code{test} databases are likely to be among them. The
-@code{mysql} database is required because it describes user access
-privileges. The @code{test} database is often provided as a workspace for
-users to try things out.
-
-If the @code{test} database exists, try to access it:
-
-@example
-mysql> USE test
-Database changed
-@end example
-
-Note that @code{USE}, like @code{QUIT}, does not require a semicolon. (You
-can terminate such statements with a semicolon if you like; it does no harm.)
-The @code{USE} statement is special in another way, too: it must be given on
-a single line.
-
-You can use the @code{test} database (if you have access to it) for the
-examples that follow, but anything you create in that database can be
-removed by anyone else with access to it. For this reason, you should
-probably ask your @strong{MySQL} administrator for permission to use a
-database of your own. Suppose you want to call yours @code{menagerie}. The
-administrator needs to execute a command like this:
-
-@example
-mysql> GRANT ALL ON menagerie.* TO your_mysql_name;
-@end example
-
-where @code{your_mysql_name} is the @strong{MySQL} user name assigned to
-you.
-
-@node Creating database, Creating tables, Database use, Database use
-@subsection Creating and selecting a database
-
-If the administrator creates your database for you when setting up your
-permissions, you can begin using it. Otherwise, you need to create it
-yourself:
-
-@example
-mysql> CREATE DATABASE menagerie;
-@end example
-
-Under Unix, database names are case sensitive (unlike SQL keywords), so you
-must always refer to your database as @code{menagerie}, not as
-@code{Menagerie}, @code{MENAGERIE} or some other variant. This is also true
-for table names. (Under Windows, this restriction does not apply, although
-you must refer to databases and tables using the same lettercase throughout a
-given query.)
-
-Creating a database does not select it for use, you must do that explicitly.
-To make @code{menagerie} the current database, use this command:
-
-@example
-mysql> USE menagerie
-Database changed
-@end example
-
-Your database needs to be created only once, but you must select it for use
-each time you begin a @code{mysql} session. You can do this by issuing a
-@code{USE} statement as shown above. Alternatively, you can select the
-database on the command line when you invoke @code{mysql}. Just specify its
-name after any connection parameters that you might need to provide. For
-example:
-
-@example
-shell> mysql -h host -u user -p menagerie
-Enter password: ********
-@end example
-
-Note that @code{menagerie} is not your password on the command just shown.
-If you want to supply your password on the command line after the @code{-p}
-option, you must do so with no intervening space (e.g., as
-@code{-pmypassword}, not as @code{-p mypassword}). However, putting your
-password on the command line is not recommended, because doing so exposes it
-to snooping by other users logged in on your machine.
-
-@node Creating tables, Loading tables, Creating database, Database use
-@subsection Creating a table
-
-Creating the database is the easy part, but at this point it's empty, as
-@code{SHOW TABLES} will tell you:
-
-@example
-mysql> SHOW TABLES;
-Empty set (0.00 sec)
-@end example
-
-The harder part is deciding what the structure of your database should be:
-what tables you will need, and what columns will be in each of them.
-
-You'll want a table that contains a record for each of your pets. This can
-be called the @code{pet} table, and it should contain, as a bare minimum,
-each animal's name. Because the name by itself is not very interesting, the
-table should contain other information. For example, if more than one person
-in your family keeps pets, you might want to list each animal's owner. You
-might also want to record some basic descriptive information such as species
-and sex.
-
-How about age? That might be of interest, but it's not a good thing to store
-in a database. Age changes as time passes, which means you'd have to update
-your records often. Instead, it's better to store a fixed value such as
-date of birth. Then, whenever you need age, you can calculate it as the
-difference between the current date and the birth date. @strong{MySQL}
-provides functions for doing date arithmetic, so this is not difficult.
-Storing birth date rather than age has other advantages, too:
-
-@itemize @bullet
-@item
-You can use the database for tasks such as generating reminders for upcoming
-pet birthdays. (If you think this type of query is somewhat silly, note that
-it is the same question you might ask in the context of a business database
-to identify clients to whom you'll soon need to send out birthday greetings,
-for that computer-assisted personal touch.)
-
-@item
-You can calculate age in relation to dates other than the current date. For
-example, if you store death date in the database, you can easily calculate
-how old a pet was when it died.
-@end itemize
-
-You can probably think of other types of information that would be useful in
-the @code{pet} table, but the ones identified so far are sufficient for now:
-name, owner, species, sex, birth and death.
-
-Use a @code{CREATE TABLE} statement to specify the layout of your table:
-
-@example
-mysql> CREATE TABLE pet (name VARCHAR(20), owner VARCHAR(20),
- -> species VARCHAR(20), sex CHAR(1), birth DATE, death DATE);
-@end example
-
-@code{VARCHAR} is a good choice for the @code{name}, @code{owner} and
-@code{species} columns because the column values will vary in length. The
-lengths of those columns need not all be the same, and need not be
-@code{20}. You can pick any length from @code{1} to @code{255}, whatever
-seems most reasonable to you. (If you make a poor choice and it turns
-out later that you need a longer field, @strong{MySQL} provides an
-@code{ALTER TABLE} statement.)
-
-Animal sex can be represented in a variety of ways, for example, @code{"m"}
-and @code{"f"}, or perhaps @code{"male"} and @code{"female"}. It's simplest
-to use the single characters @code{"m"} and @code{"f"}.
-
-The use of the @code{DATE} data type for the @code{birth} and @code{death}
-columns is a fairly obvious choice.
-
-Now that you have created a table, @code{SHOW TABLES} should produce some
-output:
-
-@example
-mysql> SHOW TABLES;
-+---------------------+
-| Tables in menagerie |
-+---------------------+
-| pet |
-+---------------------+
-@end example
-
-To verify that your table was created the way you expected, use
-a @code{DESCRIBE} statement:
-
-@example
-mysql> DESCRIBE pet;
-+---------+-------------+------+-----+---------+-------+
-| Field | Type | Null | Key | Default | Extra |
-+---------+-------------+------+-----+---------+-------+
-| name | varchar(20) | YES | | NULL | |
-| owner | varchar(20) | YES | | NULL | |
-| species | varchar(20) | YES | | NULL | |
-| sex | char(1) | YES | | NULL | |
-| birth | date | YES | | NULL | |
-| death | date | YES | | NULL | |
-+---------+-------------+------+-----+---------+-------+
-@end example
-
-You can use @code{DESCRIBE} any time, for example, if you forget the names of
-the columns in your table or what types they are.
-
-@node Loading tables, Retrieving data, Creating tables, Database use
-@subsection Loading data into a table
-
-After creating your table, you need to populate it. The @code{LOAD DATA} and
-@code{INSERT} statements are useful for this.
-
-Suppose your pet records can be described as shown below.
-(Observe that @strong{MySQL} expects dates in @code{YYYY-MM-DD} format;
-this may be different than what you are used to.)
-
-@multitable @columnfractions .16 .16 .16 .16 .16 .16
-@item @strong{name} @tab @strong{owner} @tab @strong{species} @tab @strong{sex} @tab @strong{birth} @tab @strong{death}
-@item Fluffy @tab Harold @tab cat @tab f @tab 1993-02-04 @tab
-@item Claws @tab Gwen @tab cat @tab m @tab 1994-03-17 @tab
-@item Buffy @tab Harold @tab dog @tab f @tab 1989-05-13 @tab
-@item Fang @tab Benny @tab dog @tab m @tab 1990-08-27 @tab
-@item Bowser @tab Diane @tab dog @tab m @tab 1998-08-31 @tab 1995-07-29
-@item Chirpy @tab Gwen @tab bird @tab f @tab 1998-09-11 @tab
-@item Whistler @tab Gwen @tab bird @tab @tab 1997-12-09 @tab
-@item Slim @tab Benny @tab snake @tab m @tab 1996-04-29 @tab
-@end multitable
-
-Because you are beginning with an empty table, an easy way to populate it is to
-create a text file containing a row for each of your animals, then load the
-contents of the file into the table with a single statement.
-
-You could create a text file @file{pet.txt} containing one record per line,
-with values separated by tabs, and given in the order in which the columns
-were listed in the @code{CREATE TABLE} statement. For missing values (such
-as unknown sexes, or death dates for animals that are still living), you can
-use @code{NULL} values. To represent these in your text file, use
-@code{\N}. For example, the record for Whistler the bird would look like
-this (where the whitespace between values is a single tab character):
-
-@multitable @columnfractions .15 .15 .15 .15 .25 .15
-@item @code{Whistler} @tab @code{Gwen} @tab @code{bird} @tab @code{\N} @tab @code{1997-12-09} @tab @code{\N}
-@end multitable
-
-To load the text file @file{pet.txt} into the @code{pet} table, use this
-command:
-
-@example
-mysql> LOAD DATA LOCAL INFILE "pet.txt" INTO TABLE pet;
-@end example
-
-You can specify the column value separator and end of line marker explicitly
-in the @code{LOAD DATA} statement if you wish, but the defaults are tab and
-linefeed. These are sufficient for the statement to read the file
-@file{pet.txt} properly.
-
-When you want to add new records one at a time, the @code{INSERT} statement
-is useful. In its simplest form, you supply values for each column, in the
-order in which the columns were listed in the @code{CREATE TABLE} statement.
-Suppose Diane gets a new hamster named Puffball. You could add a new record
-using an @code{INSERT} statement like this:
-
-@example
-mysql> INSERT INTO pet
- -> VALUES ('Puffball','Diane','hamster','f','1999-03-30',NULL);
-@end example
-
-Note that string and date values are specified as quoted strings here. Also,
-with @code{INSERT}, you can insert @code{NULL} directly to represent a
-missing value. You do not use @code{\N} like you do with @code{LOAD DATA}.
-
-From this example, you should be able to see that there would be a lot more
-typing involved to load
-your records initially using several @code{INSERT} statements rather
-than a single @code{LOAD DATA} statement.
-
-@node Retrieving data, Multiple tables, Loading tables, Database use
-@subsection Retrieving information from a table
-
-@menu
-* Selecting all:: Selecting all data
-* Selecting rows:: Selecting particular rows
-* Selecting columns:: Selecting particular columns
-* Sorting rows:: Sorting rows
-* Date calculations:: Date calculations
-* Working with NULL:: Working with @code{NULL} values
-* Pattern matching:: Pattern matching
-* Counting rows:: Counting rows
-@end menu
-
-The @code{SELECT} statement is used to pull information from a table.
-The general form of the statement is:
-
-@example
-SELECT what_to_select
-FROM which_table
-WHERE conditions_to_satisfy
-@end example
-
-@code{what_to_select} indicates what you want to see. This can be a list of
-columns, or @code{*} to indicate ``all columns.'' @code{which_table}
-indicates the table from which you want to retrieve data. The @code{WHERE}
-clause is optional. If it's present, @code{conditions_to_satisfy} specifies
-conditions that rows must satisfy to qualify for retrieval.
-
-@node Selecting all, Selecting rows, Retrieving data, Retrieving data
-@subsubsection Selecting all data
-
-The simplest form of @code{SELECT} retrieves everything from a table:
-
-@example
-mysql> SELECT * FROM pet;
-+----------+--------+---------+------+------------+------------+
-| name | owner | species | sex | birth | death |
-+----------+--------+---------+------+------------+------------+
-| Fluffy | Harold | cat | f | 1993-02-04 | NULL |
-| Claws | Gwen | cat | m | 1994-03-17 | NULL |
-| Buffy | Harold | dog | f | 1989-05-13 | NULL |
-| Fang | Benny | dog | m | 1990-08-27 | NULL |
-| Bowser | Diane | dog | m | 1998-08-31 | 1995-07-29 |
-| Chirpy | Gwen | bird | f | 1998-09-11 | NULL |
-| Whistler | Gwen | bird | NULL | 1997-12-09 | NULL |
-| Slim | Benny | snake | m | 1996-04-29 | NULL |
-| Puffball | Diane | hamster | f | 1999-03-30 | NULL |
-+----------+--------+---------+------+------------+------------+
-@end example
-
-This form of @code{SELECT} is useful if you want to review your entire table,
-for instance, after you've just loaded it with your initial dataset. As it
-happens, the output just shown reveals an error in your data file: Bowser
-appears to have been born after he died! Consulting your original pedigree
-papers, you find that the correct birth year is 1989, not 1998.
-
-There are are least a couple of ways to fix this:
-
-@itemize @bullet
-@item
-Edit the file @file{pet.txt} to correct the error, then empty the table
-and reload it using @code{DELETE} and @code{LOAD DATA}:
-
-@example
-mysql> DELETE FROM pet;
-mysql> LOAD DATA LOCAL INFILE "pet.txt" INTO TABLE pet;
-@end example
-
-However, if you do this, you must also re-enter the record for Puffball.
-
-@item
-Fix only the erroneous record with an @code{UPDATE} statement:
-
-@example
-mysql> UPDATE pet SET birth = "1989-08-31" WHERE name = "Bowser";
-@end example
-@end itemize
-
-As shown above, it is easy to retrieve an entire table. But typically you
-don't want to do that, particularly when the table becomes large. Instead,
-you're usually more interested in answering a particular question, in which
-case you specify some constraints on the information you want. Let's look at
-some selection queries in terms of questions about your pets that they
-answer.
-
-@node Selecting rows, Selecting columns, Selecting all, Retrieving data
-@subsubsection Selecting particular rows
-
-You can select only particular rows from your table. For example, if you want
-to verify the change that you made to Bowser's birth date, select Bowser's
-record like this:
-
-@example
-mysql> SELECT * FROM pet WHERE name = "Bowser";
-+--------+-------+---------+------+------------+------------+
-| name | owner | species | sex | birth | death |
-+--------+-------+---------+------+------------+------------+
-| Bowser | Diane | dog | m | 1989-08-31 | 1995-07-29 |
-+--------+-------+---------+------+------------+------------+
-@end example
-
-The output confirms that the year is correctly recorded now as 1989, not 1998.
-
-String comparisons are normally case-insensitive, so you can specify the
-name as @code{"bowser"}, @code{"BOWSER"}, etc. The query result will be
-the same.
-
-You can specify conditions on any column, not just @code{name}. For example,
-if you want to know which animals were born after 1998, test the @code{birth}
-column:
-
-@example
-mysql> SELECT * FROM pet WHERE birth >= "1998-1-1";
-+----------+-------+---------+------+------------+-------+
-| name | owner | species | sex | birth | death |
-+----------+-------+---------+------+------------+-------+
-| Chirpy | Gwen | bird | f | 1998-09-11 | NULL |
-| Puffball | Diane | hamster | f | 1999-03-30 | NULL |
-+----------+-------+---------+------+------------+-------+
-@end example
-
-You can combine conditions, for example, to locate female dogs:
-
-@example
-mysql> SELECT * FROM pet WHERE species = "dog" AND sex = "f";
-+-------+--------+---------+------+------------+-------+
-| name | owner | species | sex | birth | death |
-+-------+--------+---------+------+------------+-------+
-| Buffy | Harold | dog | f | 1989-05-13 | NULL |
-+-------+--------+---------+------+------------+-------+
-@end example
-
-The preceding query uses the @code{AND} logical operator. There is also an
-@code{OR} operator:
-
-@example
-mysql> SELECT * FROM pet WHERE species = "snake" OR species = "bird";
-+----------+-------+---------+------+------------+-------+
-| name | owner | species | sex | birth | death |
-+----------+-------+---------+------+------------+-------+
-| Chirpy | Gwen | bird | f | 1998-09-11 | NULL |
-| Whistler | Gwen | bird | NULL | 1997-12-09 | NULL |
-| Slim | Benny | snake | m | 1996-04-29 | NULL |
-+----------+-------+---------+------+------------+-------+
-@end example
-
-@code{AND} and @code{OR} may be intermixed. If you do that, it's a good idea
-to use parentheses to indicate how conditions should be grouped:
-
-@example
-mysql> SELECT * FROM pet WHERE (species = "cat" AND sex = "m")
- -> OR (species = "dog" AND sex = "f");
-+-------+--------+---------+------+------------+-------+
-| name | owner | species | sex | birth | death |
-+-------+--------+---------+------+------------+-------+
-| Claws | Gwen | cat | m | 1994-03-17 | NULL |
-| Buffy | Harold | dog | f | 1989-05-13 | NULL |
-+-------+--------+---------+------+------------+-------+
-@end example
-
-@node Selecting columns, Sorting rows, Selecting rows, Retrieving data
-@subsubsection Selecting particular columns
-
-
-If you don't want to see entire rows from your table, just name the columns
-in which you're interested, separated by commas. For example, if you want to
-know when your animals were born, select the @code{name} and @code{birth}
-columns:
-
-@example
-mysql> SELECT name, birth FROM pet;
-+----------+------------+
-| name | birth |
-+----------+------------+
-| Fluffy | 1993-02-04 |
-| Claws | 1994-03-17 |
-| Buffy | 1989-05-13 |
-| Fang | 1990-08-27 |
-| Bowser | 1989-08-31 |
-| Chirpy | 1998-09-11 |
-| Whistler | 1997-12-09 |
-| Slim | 1996-04-29 |
-| Puffball | 1999-03-30 |
-+----------+------------+
-@end example
-
-To find out who owns pets, use this query:
-
-@example
-mysql> SELECT owner FROM pet;
-+--------+
-| owner |
-+--------+
-| Harold |
-| Gwen |
-| Harold |
-| Benny |
-| Diane |
-| Gwen |
-| Gwen |
-| Benny |
-| Diane |
-+--------+
-@end example
-
-@findex DISTINCT
-However, notice that the query simply retrieves the @code{owner} field from
-each record, and some of them appear more than once. To minimize the output,
-retrieve each unique output record just once by adding the keyword
-@code{DISTINCT}:
-
-@example
-mysql> SELECT DISTINCT owner FROM pet;
-+--------+
-| owner |
-+--------+
-| Benny |
-| Diane |
-| Gwen |
-| Harold |
-+--------+
-@end example
-
-You can use a @code{WHERE} clause to combine row selection with column
-selection. For example, to get birth dates for dogs and cats only,
-use this query:
-
-@example
-mysql> SELECT name, species, birth FROM pet
- -> WHERE species = "dog" OR species = "cat";
-+--------+---------+------------+
-| name | species | birth |
-+--------+---------+------------+
-| Fluffy | cat | 1993-02-04 |
-| Claws | cat | 1994-03-17 |
-| Buffy | dog | 1989-05-13 |
-| Fang | dog | 1990-08-27 |
-| Bowser | dog | 1989-08-31 |
-+--------+---------+------------+
-@end example
-
-@node Sorting rows, Date calculations, Selecting columns, Retrieving data
-@subsubsection Sorting rows
-
-You may have noticed in the preceding examples that the result rows are
-displayed in no particular order. However, it's often easier to examine
-query output when the rows are sorted in some meaningful way. To sort a
-result, use an @code{ORDER BY} clause.
-
-Here are animal birthdays, sorted by date:
-
-@example
-mysql> SELECT name, birth FROM pet ORDER BY birth;
-+----------+------------+
-| name | birth |
-+----------+------------+
-| Buffy | 1989-05-13 |
-| Bowser | 1989-08-31 |
-| Fang | 1990-08-27 |
-| Fluffy | 1993-02-04 |
-| Claws | 1994-03-17 |
-| Slim | 1996-04-29 |
-| Whistler | 1997-12-09 |
-| Chirpy | 1998-09-11 |
-| Puffball | 1999-03-30 |
-+----------+------------+
-@end example
-
-To sort in reverse order, add the @code{DESC} (descending) keyword to the
-name of the column you are sorting by:
-
-@example
-mysql> SELECT name, birth FROM pet ORDER BY birth DESC;
-+----------+------------+
-| name | birth |
-+----------+------------+
-| Puffball | 1999-03-30 |
-| Chirpy | 1998-09-11 |
-| Whistler | 1997-12-09 |
-| Slim | 1996-04-29 |
-| Claws | 1994-03-17 |
-| Fluffy | 1993-02-04 |
-| Fang | 1990-08-27 |
-| Bowser | 1989-08-31 |
-| Buffy | 1989-05-13 |
-+----------+------------+
-@end example
-
-You can sort on multiple columns. For example, to sort by type of
-animal, then by birth date within animal type with youngest animals first,
-use the following query:
-
-@example
-mysql> SELECT name, species, birth FROM pet ORDER BY species, birth DESC;
-+----------+---------+------------+
-| name | species | birth |
-+----------+---------+------------+
-| Chirpy | bird | 1998-09-11 |
-| Whistler | bird | 1997-12-09 |
-| Claws | cat | 1994-03-17 |
-| Fluffy | cat | 1993-02-04 |
-| Fang | dog | 1990-08-27 |
-| Bowser | dog | 1989-08-31 |
-| Buffy | dog | 1989-05-13 |
-| Puffball | hamster | 1999-03-30 |
-| Slim | snake | 1996-04-29 |
-+----------+---------+------------+
-@end example
-
-Note that the @code{DESC} keyword applies only to the column name immediately
-preceding it (@code{birth}); @code{species} values are still sorted in
-ascending order.
-
-@node Date calculations, Working with NULL, Sorting rows, Retrieving data
-@subsubsection ÆüÉդη׻»
-
-@strong{MySQL} ¤Ï¤¤¤¯¤Ä¤«¤ÎÆüÉդη׻»¤ò¹Ô¤¦´Ø¿ô¤òÄ󶡤·¤Þ¤¹¡£
-Î㤨¤Ð¡¢Ç¯¤Î·×»»¤äÆüÉÕ¤ÎÉôʬ¤ò¼è¤ê½Ð¤·¤¿¤ê¡£
-
-¥Ú¥Ã¥È¤ÎǯÎ𤬲¿ºÍ¤Ê¤Î¤«¤òÃΤ뤿¤á¤Ë¤Ï¡¢¸½ºß¤ÎÆüÉÕ¤ÈÃÂÀ¸Æü¤È¤Îº¹¤ò·×»»
-¤·¤Þ¤¹¡£ ¤³¤Î¤¿¤á¤Ë¤Ï¡¢Æó¤Ä¤ÎÆüÉÕ¤òÆü¿ô¤Ëľ¤·¡¢º¹¤ò¼è¤ê¡¢¤½¤·¤Æ 365
-(ǯ¤ÎÆü¿ô) ¤Ç³ä¤ê¤Þ¤¹¡§
-
-@example
-mysql> SELECT name, (TO_DAYS(NOW())-TO_DAYS(birth))/365 FROM pet;
-+----------+-------------------------------------+
-| name | (TO_DAYS(NOW())-TO_DAYS(birth))/365 |
-+----------+-------------------------------------+
-| Fluffy | 6.15 |
-| Claws | 5.04 |
-| Buffy | 9.88 |
-| Fang | 8.59 |
-| Bowser | 9.58 |
-| Chirpy | 0.55 |
-| Whistler | 1.30 |
-| Slim | 2.92 |
-| Puffball | 0.00 |
-+----------+-------------------------------------+
-@end example
-
-¥¯¥¨¥ê¤ÏÆ°¤­¤Þ¤·¤¿¤¬¡¢²þÎɤ·¤¿¤¤¤¯¤Ä¤«¤Î¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£
-Âè1¤Ë¡¢¤³¤Î·ë²Ì¤Ï¡¢¤â¤·¥ì¥³¡¼¥É¤Ë¤¤¤¯¤Ä¤«¤Î½çÈÖ¤òÍ¿¤¨¤ì¤Ð¡¢´Êñ¤ËʤӴ¹¤¨¤¬
-½ÐÍ褽¤¦¤Ê¤³¤È¡£
-Âè2¤Ë¡¢Ç¯ÎðÍó¤Î¸«½Ð¤·¤Ï¡¢¤³¤Î¤Þ¤Þ¤Ç¤Ï¤Ê¤ó¤Ê¤Î¤«Ê¬¤«¤ê¤Þ¤»¤ó¡£
-
-ºÇ½é¤ÎÌäÂê¤Ï @code{ORDER BY name} Àá¤ò²Ã¤¨¤ë¤³¤È¤Ç name ½ç¤ÇʤӴ¹¤¨¤¬½ÐÍè¤Þ¤¹¡£
-Æó¤ÄÌܤÎÌäÂê¤ËÂФ·¤Æ¤Ï¡¢°ã¤¦¸«½Ð¤·¤ò½ÐÎϤ˸½¤ì¤ë¤è¤¦¤Ë¡¢Íó¤Î¸«½Ð¤·¤ò
-°·¤¤¤Þ¤¹ (¤³¤ì¤ò ¥Õ¥£¡¼¥ë¥É¤Î¥¨¥¤¥ê¥¢¥¹ ¤È¸Æ¤Ó¤Þ¤¹) :
-
-@example
-mysql> SELECT name, (TO_DAYS(NOW())-TO_DAYS(birth))/365 AS age
- -> FROM pet ORDER BY name;
-+----------+------+
-| name | age |
-+----------+------+
-| Bowser | 9.58 |
-| Buffy | 9.88 |
-| Chirpy | 0.55 |
-| Claws | 5.04 |
-| Fang | 8.59 |
-| Fluffy | 6.15 |
-| Puffball | 0.00 |
-| Slim | 2.92 |
-| Whistler | 1.30 |
-+----------+------+
-@end example
-
-@code{name} ¤Ç¤Ï¤Ê¤¯ @code{age} ¤ÇʤӴ¹¤¨¤ë¤Ë¤Ï¡¢ @code{ORDER BY} Àá¤ò
-°Ê²¼¤Î¤è¤¦¤ËÊѤ¨¤Þ¤¹¡§
-
-@example
-mysql> SELECT name, (TO_DAYS(NOW())-TO_DAYS(birth))/365 AS age
- -> FROM pet ORDER BY age;
-+----------+------+
-| name | age |
-+----------+------+
-| Puffball | 0.00 |
-| Chirpy | 0.55 |
-| Whistler | 1.30 |
-| Slim | 2.92 |
-| Claws | 5.04 |
-| Fluffy | 6.15 |
-| Fang | 8.59 |
-| Bowser | 9.58 |
-| Buffy | 9.88 |
-+----------+------+
-@end example
-
-»÷¤¿¥¯¥¨¥ê¤¬¡¢´û¤Ë»à¤ó¤Ç¤·¤Þ¤Ã¤¿Æ°Êª¤Î¡¢»à¤ó¤À»þÅÀ¤ÎǯÎð¤òÄ´¤Ù¤ë¤Î¤Ë¤â
-»ÈÍѤǤ­¤Þ¤¹¡£ ¤É¤Îưʪ¤¬»à¤ó¤Ç¤¤¤ë¤«¤É¤¦¤«¤Ï¡¢@code{death} Ãͤ¬ @code{NULL} ¤«
-¤É¤¦¤«¤ÇȽÃǤ·¤Þ¤¹¡£ ¤³¤ì¤é¤ÎÃͤ¬ Èó@code{NULL} ¤Ê¤é¤Ð¡¢ @code{death} ¤È @code{birth}
-¤Îº¹¤Î·×»»¤ò¹Ô¤¤¤Þ¤¹¡§
-
-@example
-mysql> SELECT name, birth, death, (TO_DAYS(death)-TO_DAYS(birth))/365 AS age
- -> FROM pet WHERE death IS NOT NULL ORDER BY age;
-+--------+------------+------------+------+
-| name | birth | death | age |
-+--------+------------+------------+------+
-| Bowser | 1989-08-31 | 1995-07-29 | 5.91 |
-+--------+------------+------------+------+
-@end example
-
-¤³¤Î¥¯¥¨¥ê¤Ç¤Ï¡¢ @code{death != NULL} ¤Ç¤Ï¤Ê¤¯ @code{death IS NOT NULL} ¤ò
-»ÈÍѤ·¤Þ¤¹¡£ ¤Ê¤¼¤Ê¤é¡¢ @code{NULL} ¤ÏÆÃÊ̤ÊÃͤÀ¤«¤é¤Ç¤¹¡£ ¤³¤ì¤Ï¸å¤Ç²òÀ⤷¤Þ¤¹¡£
-@xref{Working with NULL, , Working with @code{NULL}}.
-
-¤â¤·¤¢¤Ê¤¿¤¬Íâ·îÃÂÀ¸Æü¤Îưʪ¤òÃΤꤿ¤¤¤È¤·¤Þ¤¹¡£ ¤³¤Î¼ï¤Î·×»»¤Ç¤Ï¡¢
-ǯ¤ÈÆü¤¬´Ø·¸¤¢¤ê¤Þ¤»¤ó¡£ @code{birth} ¥Õ¥£¡¼¥ë¥É¤Î·î¤À¤±¤òñ¤Ë
-¼è¤ê½Ð¤·¤¿¤¯¤Ê¤ë¤Ç¤·¤ç¤¦¡£ @strong{MySQL} ¤ÏÆüÉÕ¤ÎÉôʬ¤ò¼è¤ê½Ð¤¹¤¤¤¯¤Ä¤«¤Î´Ø¿ô¤ò
-Ä󶡤·¤Þ¤¹¡£ @code{YEAR()}, @code{MONTH()}, @code{DAYOFMONTH()} ¤Ê¤É¡£
-¤³¤³¤Ç¤Ï @code{MONTH()} ¤¬¤¤¤¤¤Ç¤·¤ç¤¦¡£ ¤³¤ì¤¬¤É¤Î¤è¤¦¤ËÆ°¤¯¤«³Î¤«¤á¤ë¤Ë¤Ï¡¢
-@code{birth} ¤È @code{MONTH(birth)} ¤ÎξÊý¤òɽ¼¨¤µ¤»¤ë¥¯¥¨¥ê¤ò¼Â¹Ô¤·¤Æ¤ß¤Þ¤¹¡§
-
-@example
-mysql> SELECT name, birth, MONTH(birth) FROM pet;
-+----------+------------+--------------+
-| name | birth | MONTH(birth) |
-+----------+------------+--------------+
-| Fluffy | 1993-02-04 | 2 |
-| Claws | 1994-03-17 | 3 |
-| Buffy | 1989-05-13 | 5 |
-| Fang | 1990-08-27 | 8 |
-| Bowser | 1989-08-31 | 8 |
-| Chirpy | 1998-09-11 | 9 |
-| Whistler | 1997-12-09 | 12 |
-| Slim | 1996-04-29 | 4 |
-| Puffball | 1999-03-30 | 3 |
-+----------+------------+--------------+
-@end example
-
-Íè·îÃÂÀ¸Æü¤ò·Þ¤¨¤ëưʪ¤ò¸«¤Ä¤±¤ë¤Î¤Ï´Êñ¤Ç¤¹¡£ ¸½ºß4·î¤À¤È¤·¤Þ¤¹¡£
-¤¹¤ë¤È¡¢5·îÀ¸¤Þ¤ì¤Îưʪ¤òõ¤·¤Þ¤¹¡§
-
-@example
-mysql> SELECT name, birth FROM pet WHERE MONTH(birth) = 5;
-+-------+------------+
-| name | birth |
-+-------+------------+
-| Buffy | 1989-05-13 |
-+-------+------------+
-@end example
-
-¤â¤·¸½ºß¤¬12·î¤Ê¤é¡¢¤Á¤ç¤Ã¤Èº¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£ ·î¤Î¿ô»ú (@code{12}) ¤Ë
-1 ¤ò­¤·¤Æ 13 ·îÀ¸¤Þ¤ì¤Îưʪ¤òõ¤¹¤ï¤±¤Ë¤Ï¤¤¤­¤Þ¤»¤ó¡£ ¤«¤ï¤ê¤Ë1·îÀ¸¤Þ¤ì¤Î
-ưʪ¤òõ¤·¤Þ¤¹¡£
-
-¸½ºß¤¬²¿·î¤Ê¤Î¤«¤òµ¤¤Ë¤¹¤ë¤³¤È¤Ê¤¯¡¢Æ°ºî¤¹¤ë¥¯¥¨¥ê¤ò½ñ¤¯¤³¤È¤¬²Äǽ¤Ç¤¹¡£
-¤³¤ÎÊýË¡¤Ç¤Ï¡¢¤¢¤Ê¤¿¤Ï·î¤Î¿ô»ú¤ò¥¯¥¨¥ê¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤¢¤ê¤Þ¤»¤ó¡£
-@code{DATE_ADD()} ´Ø¿ô¤ÏÍ¿¤¨¤¿ÆüÉÕ¤«¤é¤¢¤ë»þ´Ö¤ò­¤¹¤³¤È¤¬²Äǽ¤Ç¤¹¡£
-¤â¤·¸½»þÅÀ @code{NOW()} ¤ÎÃÍ¤Ë 1¥ö·î ­¤·¡¢ @code{MONTH()} ¤Ç·î¤Î
-Éôʬ¤ò¼è¤ê½Ð¤·¡¢¤½¤Î·ë²Ì¤ò¡¢ÃÂÀ¸·î¤òÄ´¤Ù¤ë¤¿¤á¤Ë»ÈÍѤ·¤Þ¤¹¡§
-
-@example
-mysql> SELECT name, birth FROM pet
- -> WHERE MONTH(birth) = MONTH(DATE_ADD(NOW(), INTERVAL 1 MONTH));
-@end example
-
-Ʊ¤¸¤³¤È¤¬¤Ç¤­¤ëÊ̤ÎÊýË¡¤È¤·¤Æ¡¢¾ê;´Ø¿ô ¤ò»ÈÍѤ·¤¿·ë²Ì¤Ë 1 ¤ò­¤¹ÊýË¡¤¬¤¢¤ê¤Þ¤¹¡£
-(¤â¤·º£·î¤¬12·î¤Ê¤é¡¢¾ê;´Ø¿ô (@code{MOD}) ¤ò»ÈÍѤ·¤¿·ë²Ì¤Ï @code{0} ¤Ë¤Ê¤ê¤Þ¤¹)¡§
-
-@example
-mysql> SELECT name, birth FROM pet
- -> WHERE MONTH(birth) = MOD(MONTH(NOW()), 12) + 1;
-@end example
-
-Note that @code{MONTH} return a number between 1 and 12. And
-@code{MOD(something,12)} returns a number between 0 and 11. So the
-addition has to be after the @code{MOD()} oterwise we would go from
-November (11) to January (1).
-
-@node Working with NULL, Pattern matching, Date calculations, Retrieving data
-@subsubsection @code{NULL} ÃͤﶤëÉñ¤¤
-
-¤¢¤Ê¤¿¤¬¤½¤ì¤Ë´·¤ì¤ë¤Þ¤Ç¤Ï¡¢@code{NULL} Ãͤˤ϶䯤«¤â¤·¤ì¤Þ¤»¤ó¡£
-³µÇ°Åª¤Ë¡¢@code{NULL} ÃÍ¤Ï ``ÃÍ̵¤·'' ¤« ``̤ÃΤÊÃÍ'' ¤ò°ÕÌ£¤·¡¢
-¾¤ÎÃͤè¤ê¤â¤¤¤¯¤Ö¤ó°Û¤Ê¤Ã¤Æ°·¤ï¤ì¤Þ¤¹¡£
-@code{NULL} ¤Îɾ²Á¤ÎºÝ¤Ë¤Ï¡¢¿ôÃͤÎÈæ³Ó±é»»»Ò @code{=}, @code{<}, @code{!=} ¤ò
-»ÈÍѤ¹¤ë¤³¤È¤Ï½ÐÍè¤Þ¤»¤ó¡£ ¤¢¤Ê¤¿¼«¿È¤³¤ì¤ò¥Ç¥â¤¹¤ë¤¿¤á¤Ë¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡§
-
-@example
-mysql> SELECT 1 = NULL, 1 != NULL, 1 < NULL, 1 > NULL;
-+----------+-----------+----------+----------+
-| 1 = NULL | 1 != NULL | 1 < NULL | 1 > NULL |
-+----------+-----------+----------+----------+
-| NULL | NULL | NULL | NULL |
-+----------+-----------+----------+----------+
-@end example
-
-³Î¼Â¤Ë¤³¤ì¤é¤ÎÈæ³Ó¤«¤é¤¤¤«¤Ê¤ë°ÕÌ£¤¬¤¢¤ë·ë²Ì¤â¼õ¤±¼è¤ê¤Þ¤»¤ó¡£
-¤³¤ÎÂå¤ï¤ê¤Ë¡¢ @code{IS NULL} , @code{IS NOT NULL} ±é»»»Ò¤ò»ÈÍѤ·¤Þ¤¹¡§
-
-@example
-mysql> SELECT 1 IS NULL, 1 IS NOT NULL;
-+-----------+---------------+
-| 1 IS NULL | 1 IS NOT NULL |
-+-----------+---------------+
-| 0 | 1 |
-+-----------+---------------+
-@end example
-
-@strong{MySQL} ¤Ç¤Ï, 0 ¤Ï false¡Êµ¶¡Ë ¤Ç¡¢1 ¤¬ true¡Ê¿¿¡Ë¤Ç¤¹¡£
-
-¤³¤Î @code{NULL} ¤ÎÆÃÊ̤ʰ·¤¤¤Ï¤Ê¤¼¤Ê¤Î¤«¡£ Á°¤Î¥»¥¯¥·¥ç¥ó¤ò¸«¤Æ¤¯¤À¤µ¤¤¡£
-¤É¤Îưʪ¤¬¤â¤Ï¤äÀ¸¤­¤Æ¤¤¤Ê¤¤¤³¤È¤ò·èÄê¤Å¤±¤ë¤¿¤á¤Ë¤Ï¡¢
-@code{death != NULL} ¤Ç¤Ï¤Ê¤¯ @code{death IS NOT NULL} ¤Î»ÈÍѤ¬
-ɬÍפȤµ¤ì¤ë¤Î¤Ç¤¹¡£
-
-@node Pattern matching, Counting rows, Working with NULL, Retrieving data
-@subsubsection ¥Ñ¥¿¡¼¥ó¡¦¥Þ¥Ã¥Á
-
-@strong{MySQL} ¤Ïɸ½àSQL¤Î¥Ñ¥¿¡¼¥ó¡¦¥Þ¥Ã¥Á¤òÄ󶡤·¤Þ¤¹¡£
-¤Þ¤¿¡¢³ÈÄ¥¤µ¤ì¤¿Àµµ¬É½¸½¤ò´ð¤Ë¤·¤¿·Á¼°¤Î¥Ñ¥¿¡¼¥ó¡¦¥Þ¥Ã¥Á¡¢
-¤³¤ì¤Ï @code{vi}, @code{grep} and @code{sed} ¤Ê¤É UNIX ¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ë
-»ÈÍѤµ¤ì¤Æ¤¤¤ëʪ¤È»÷¤Æ¤¤¤Þ¤¹¤¬¡¢¤³¤ì¤âÄ󶡤·¤Þ¤¹¡£
-
-SQL ¥Ñ¥¿¡¼¥ó¡¦¥Þ¥Ã¥Á¤Ï¡¢ @samp{_} ¤Ç¤¤¤«¤Ê¤ë£±Ê¸»ú¤È¤â°ìÃפ·¡¢
-@samp{%} ¤Ç¤¢¤é¤æ¤ë0¤³°Ê¾å¤Îʸ»úÎó¤Ë°ìÃפ·¤Þ¤¹¡£
-@strong{MySQL} ¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ç SQL ¥Ñ¥¿¡¼¥ó¤Ï¥±¡¼¥¹Èó°Í¸¤Ç¤¹¡£
-¤¤¤¯¤Ä¤«Îã¤ò°Ê²¼¤Ë¼¨¤·¤Þ¤¹¡£ SQL¥Ñ¥¿¡¼¥ó¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢ @code{=} ¤ä
-@code{!=} ¤ò»ÈÍѤ·¤Ê¤¤¤è¤¦¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£ @code{LIKE} ¤« @code{NOT LIKE}
-¤òÂå¤ï¤ê¤Ë»ÈÍѤ·¤Þ¤¹¡£
-
-@samp{b} ¤«¤é»Ï¤Þ¤ë̾Á°¤ò¸«¤Ä¤±¤ë¤Ë¤Ï:
-
-@example
-mysql> SELECT * FROM pet WHERE name LIKE "b%";
-+--------+--------+---------+------+------------+------------+
-| name | owner | species | sex | birth | death |
-+--------+--------+---------+------+------------+------------+
-| Buffy | Harold | dog | f | 1989-05-13 | NULL |
-| Bowser | Diane | dog | m | 1989-08-31 | 1995-07-29 |
-+--------+--------+---------+------+------------+------------+
-@end example
-
-@samp{fy} ¤Ç½ª¤ï¤ë̾Á°¤ò¸«¤Ä¤±¤ë¤Ë¤Ï:
-
-@example
-mysql> SELECT * FROM pet WHERE name LIKE "%fy";
-+--------+--------+---------+------+------------+-------+
-| name | owner | species | sex | birth | death |
-+--------+--------+---------+------+------------+-------+
-| Fluffy | Harold | cat | f | 1993-02-04 | NULL |
-| Buffy | Harold | dog | f | 1989-05-13 | NULL |
-+--------+--------+---------+------+------------+-------+
-@end example
-
-@samp{w} ¤ò´Þ¤à̾Á°¤ò¸«¤Ä¤±¤ë¤Ë¤Ï:
-
-@example
-mysql> SELECT * FROM pet WHERE name LIKE "%w%";
-+----------+-------+---------+------+------------+------------+
-| name | owner | species | sex | birth | death |
-+----------+-------+---------+------+------------+------------+
-| Claws | Gwen | cat | m | 1994-03-17 | NULL |
-| Bowser | Diane | dog | m | 1989-08-31 | 1995-07-29 |
-| Whistler | Gwen | bird | NULL | 1997-12-09 | NULL |
-+----------+-------+---------+------+------------+------------+
-@end example
-
-5ʸ»ú¤Î̾Á°¤ò¸«¤Ä¤±¤ë¤Ë¤Ï, @samp{_} ¥Ñ¥¿¡¼¥óʸ»ú¤ò»ÈÍѤ·¤Æ¡§
-
-@example
-mysql> SELECT * FROM pet WHERE name LIKE "_____";
-+-------+--------+---------+------+------------+-------+
-| name | owner | species | sex | birth | death |
-+-------+--------+---------+------+------------+-------+
-| Claws | Gwen | cat | m | 1994-03-17 | NULL |
-| Buffy | Harold | dog | f | 1989-05-13 | NULL |
-+-------+--------+---------+------+------------+-------+
-@end example
-
-@strong{MySQL} ¤Ç¤Ï¾¤Î¥Ñ¥¿¡¼¥ó¡¦¥Þ¥Ã¥Á¤Î·Á¤âÄ󶡤µ¤ì¤Þ¤¹¡£Àµµ¬É½¸½¤Î³ÈÄ¥¤ò»ÈÍѤ·¤Æ¡£
-¤³¤ì¤é¤Î¥Ñ¥¿¡¼¥ó¡¦¥Þ¥Ã¥Á¤ò¥Æ¥¹¥È¤¹¤ëºÝ¤Ë¤Ï¡¢@code{REGEXP} ¤È @code{NOT REGEXP}
-±é»»»Ò¡Ê¤¢¤ë¤¤¤Ï@code{RLIKE}, @code{NOT RLIKE} ±é»»»Ò¡£¤³¤ì¤é¤ÏƱµÁ¤Ç¤¹¡Ë
-¤ò»ÈÍѤ·¤Þ¤¹¡£
-
-³ÈÄ¥Àµµ¬É½¸½¤Î¤¤¤¯¤Ä¤«¤ÎÆÃħ¡§
-
-@itemize @bullet
-@item
-@samp{.} ¤Ï¤¤¤«¤Ê¤ë°ìʸ»ú¤È¤â°ìÃפ·¤Þ¤¹¡£
-
-@item
-@samp{[...]} ¤Ï¡¢¤«¤Ã¤³Æâ¤Ë¤¢¤ëʸ»ú¤È°ìÃפ·¤Þ¤¹¡£
-Î㤨¤Ð¡¢@samp{[abc]} ¤Ï @samp{a}, @samp{b} ¤¢¤ë¤¤¤Ï @samp{c} ¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
-ʸ»ú¤òÈÏ°Ï»ØÄꤹ¤ë¾ì¹ç¤Ë¤Ï¥À¥Ã¥·¥å¤ò»ÈÍѤ·¤Þ¤¹¡£ @samp{[a-z]} ¤Ï¤¤¤«¤Ê¤ë
-¾®Ê¸»ú¤Î¥¢¥ë¥Õ¥¡¥Ù¥Ã¥Èʸ»ú¤Ë¤â°ìÃפ·¡¢ @samp{[0-9]} ¤Ï¤¤¤«¤Ê¤ë¿ô»ú¤Ë¤â
-°ìÃפ·¤Þ¤¹¡£
-
-@item
-@samp{*} ¤Ï¡¢Àè¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ëʸ»ú 0 ¸Ä°Ê¾å¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
-Î㤨¤Ð¡¢@samp{x*} ¤Ï ʸ»ú @samp{x} ¤¬¤¤¤¯¤Ä¤âϢ³¤·¤Æ¤¤¤ëʪ¤Ë¥Þ¥Ã¥Á¤·¡¢
-@samp{[0-9]*} ¤Ï¤¤¤«¤Ê¤ë¿ôÃͤȤâ¥Þ¥Ã¥Á¤·¡¢ @samp{.*} ¤Ï¤¢¤é¤æ¤ëʸ»úÎó¤Ë
-°ìÃפ·¤Þ¤¹¡£
-
-@item
-Àµµ¬É½¸½¤Ï¥±¡¼¥¹°Í¸¤Ç¤¹¡£ ¤·¤«¤·Âçʸ»ú¾®Ê¸»ú¤É¤Á¤é¤Ç¤â¥Þ¥Ã¥Á¤µ¤»¤¿¤¤¾ì¹ç¡¢
-ʸ»ú¥¯¥é¥¹¤ò»ÈÍѤǤ­¤Þ¤¹¡£ Î㤨¤Ð¡¢ @samp{[aA]} ¤ÏÂçʸ»ú¾®Ê¸»ú¤Î @samp{a} ¤Ë
-¥Þ¥Ã¥Á¤·¡¢@samp{[a-zA-Z]} ¤ÏÂçʸ»ú¾®Ê¸»ú¤Î¤¤¤«¤Ê¤ë¥¢¥ë¥Õ¥¡¥Ù¥Ã¥Èʸ»ú¤Ë¤â¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
-
-@item
-¥Ñ¥¿¡¼¥ó¤Ï¡¢¥Æ¥¹¥È¤µ¤ì¤¿ÃͤÎÃæ¤Î¤É¤³¤«¤Ë¤¢¤ë¾ì¹ç¡¢¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
-(SQL patterns match only if they match the entire value).
-
-@item
-ÃͤΤϤ¸¤á¡¢¤¢¤ë¤¤¤Ï½ª¤ï¤ê¤Ë°ÌÃÖ¤ò»ØÄꤷ¤Æ¥Þ¥Ã¥Á¤µ¤»¤¿¤¤¾ì¹ç¤Ï¡¢
-¥Ñ¥¿¡¼¥ó¤Î½é¤á¤Ë¥Þ¥Ã¥Á¤µ¤»¤ë¾ì¹ç¤Ï @samp{^} ¤ò»ÈÍѤ·¡¢
-¥Ñ¥¿¡¼¥ó¤Î½ª¤ï¤ê¤Ë¥Þ¥Ã¥Á¤µ¤»¤ë¾ì¹ç¤Ï @samp{$} ¤ò»ÈÍѤ·¤Þ¤¹¡£
-(¤³¤ì¤é¤Ï¥¢¥ó¥«¡¼¤È¸Æ¤Ð¤ì¤Þ¤¹)
-@end itemize
-
-°Ê²¼¤Ï³ÈÄ¥¤µ¤ì¤¿Àµµ¬É½¸½¤¬¤É¤¦Æ°¤¯¤«¤ÎÎã¤Ç¤¹¡£
-¾å¤Ë¼¨¤·¤¿ @code{LIKE} ¤Î¥¯¥¨¥ê¤Ï @code{REGEXP} ¤Ç°Ê²¼¤Î¤è¤¦¤Ë½ñ¤­´¹¤¨¤ì¤Þ¤¹¡§
-
-@samp{b} ¤Ç»Ï¤Þ¤ë̾Á°¤ò¤ß¤Ä¤±¤ë¤Ë¤Ï¡¢@samp{^} ¤Ç̾Á°¤ÎƬ¤Ë¥Þ¥Ã¥Á¤µ¤»¡¢
-¤«¤Ä @samp{[bB]} ¤È¤·¤Æ¡¢Âçʸ»ú¾®Ê¸»ú¤Ë¤â¥Þ¥Ã¥Á¤µ¤»¤Þ¤¹¡§
-
-@example
-mysql> SELECT * FROM pet WHERE name REGEXP "^[bB]";
-+--------+--------+---------+------+------------+------------+
-| name | owner | species | sex | birth | death |
-+--------+--------+---------+------+------------+------------+
-| Buffy | Harold | dog | f | 1989-05-13 | NULL |
-| Bowser | Diane | dog | m | 1989-08-31 | 1995-07-29 |
-+--------+--------+---------+------+------------+------------+
-@end example
-
-@samp{fy} ¤Ç½ª¤ï¤ë̾Á°¤ò¸«¤Ä¤±¤ë¤Ë¤Ï¡¢ @samp{$} ¤ò»ÈÍѤ·¤Æ̾Á°¤Î
-ºÇ¸å¤Ë¥Þ¥Ã¥Á¤µ¤»¤Þ¤¹¡§
-
-@example
-mysql> SELECT * FROM pet WHERE name REGEXP "fy$";
-+--------+--------+---------+------+------------+-------+
-| name | owner | species | sex | birth | death |
-+--------+--------+---------+------+------------+-------+
-| Fluffy | Harold | cat | f | 1993-02-04 | NULL |
-| Buffy | Harold | dog | f | 1989-05-13 | NULL |
-+--------+--------+---------+------+------------+-------+
-@end example
-
-@samp{w} ¤ò´Þ¤à̾Á°¤ò¸«¤Ä¤±¤ë¤Ë¤Ï¡¢@samp{[wW]} ¤ò»ÈÍѤ·¤Æ
-Âçʸ»ú¾®Ê¸»ú¤Ë¥Þ¥Ã¥Á¤µ¤»¤Þ¤¹¡§
-
-@example
-mysql> SELECT * FROM pet WHERE name REGEXP "[wW]";
-+----------+-------+---------+------+------------+------------+
-| name | owner | species | sex | birth | death |
-+----------+-------+---------+------+------------+------------+
-| Claws | Gwen | cat | m | 1994-03-17 | NULL |
-| Bowser | Diane | dog | m | 1989-08-31 | 1995-07-29 |
-| Whistler | Gwen | bird | NULL | 1997-12-09 | NULL |
-+----------+-------+---------+------+------------+------------+
-@end example
-
-Àµµ¬É½¸½¤Ï¤â¤·ÃÍÃæ¤Î¤É¤³¤«¤Ë¤Ç¤â¤¢¤ì¤Ð¥Þ¥Ã¥Á¤¹¤ë¤¿¤á¡¢
-SQL ¥Ñ¥¿¡¼¥ó¤Î¤è¤¦¤Ë¡¢¥Ñ¥¿¡¼¥ó¤ÎÁ°¸å¤Ë¥ï¥¤¥ë¥É¥«¡¼¥É¤ò½ñ¤¯É¬ÍפϤ¢¤ê¤Þ¤»¤ó¡£
-
-5ʸ»ú¤Î̾Á°¤ò¸«¤Ä¤±¤ë¤Ë¤Ï¡¢@samp{^} ¤È @samp{$} ¤ò»ÈÍѤ·¤Æ̾Á°¤Î½é¤á¤È½ª¤ï¤ê¤Ë
-¥Þ¥Ã¥Á¤µ¤»¡¢¤½¤Î´Ö¤Ë @samp{.} ¤ò5¸ÄÆþ¤ì¤Þ¤¹¡§
-
-@example
-mysql> SELECT * FROM pet WHERE name REGEXP "^.....$";
-+-------+--------+---------+------+------------+-------+
-| name | owner | species | sex | birth | death |
-+-------+--------+---------+------+------------+-------+
-| Claws | Gwen | cat | m | 1994-03-17 | NULL |
-| Buffy | Harold | dog | f | 1989-05-13 | NULL |
-+-------+--------+---------+------+------------+-------+
-@end example
-
-Á°¤Î¥¯¥¨¥ê¤Ï @samp{@{n@}} ``@code{n}²ó·«¤êÊÖ¤·'' ¥ª¥Ú¥ì¡¼¥¿¡¼¤Ç
-½ñ´¹¤¨²Äǽ¤Ç¤¹¡£
-
-@example
-mysql> SELECT * FROM pet WHERE name REGEXP "^.@{5@}$";
-+-------+--------+---------+------+------------+-------+
-| name | owner | species | sex | birth | death |
-+-------+--------+---------+------+------------+-------+
-| Claws | Gwen | cat | m | 1994-03-17 | NULL |
-| Buffy | Harold | dog | f | 1989-05-13 | NULL |
-+-------+--------+---------+------+------------+-------+
-@end example
-
-@node Counting rows, , Pattern matching, Retrieving data
-@subsubsection Counting rows
-
-Databases are often used to answer the question, ``How often does a certain
-type of data occur in a table?'' For example, you might want to know how
-many pets you have, or how many pets each owner has, or you might want to
-perform various kinds of censuses on your animals.
-
-Counting the total number of animals you have is the same question as ``How
-many rows are in the @code{pet} table?,'' because there is one record per pet.
-The @code{COUNT()} function counts the number of non-@code{NULL} results, so
-the query to count your animals looks like this:
-
-@example
-mysql> SELECT COUNT(*) FROM pet;
-+----------+
-| COUNT(*) |
-+----------+
-| 9 |
-+----------+
-@end example
-
-Earlier, you retrieved the names of the people who owned pets. You can
-use @code{COUNT()} if you want to find out how many pets each owner has:
-
-@example
-mysql> SELECT owner, COUNT(*) FROM pet GROUP BY owner;
-+--------+----------+
-| owner | COUNT(*) |
-+--------+----------+
-| Benny | 2 |
-| Diane | 2 |
-| Gwen | 3 |
-| Harold | 2 |
-+--------+----------+
-@end example
-
-Note the use of @code{GROUP BY} to group together all records for each
-@code{owner}. Without it, all you get is an error message:
-
-@example
-mysql> SELECT owner, COUNT(owner) FROM pet;
-ERROR 1140 at line 1: Mixing of GROUP columns (MIN(),MAX(),COUNT()...)
-with no GROUP columns is illegal if there is no GROUP BY clause
-@end example
-
-@code{COUNT()} and @code{GROUP BY} are useful for characterizing your
-data in various ways. The following examples show different ways to
-perform animal census operations.
-
-Number of animals per species:
-
-@example
-mysql> SELECT species, COUNT(*) FROM pet GROUP BY species;
-+---------+----------+
-| species | COUNT(*) |
-+---------+----------+
-| bird | 2 |
-| cat | 2 |
-| dog | 3 |
-| hamster | 1 |
-| snake | 1 |
-+---------+----------+
-@end example
-
-Number of animals per sex:
-
-@example
-mysql> SELECT sex, COUNT(*) FROM pet GROUP BY sex;
-+------+----------+
-| sex | COUNT(*) |
-+------+----------+
-| NULL | 1 |
-| f | 4 |
-| m | 4 |
-+------+----------+
-@end example
-
-(In this output, @code{NULL} indicates ``sex unknown.'')
-
-Number of animals per combination of species and sex:
-
-@example
-mysql> SELECT species, sex, COUNT(*) FROM pet GROUP BY species, sex;
-+---------+------+----------+
-| species | sex | COUNT(*) |
-+---------+------+----------+
-| bird | NULL | 1 |
-| bird | f | 1 |
-| cat | f | 1 |
-| cat | m | 1 |
-| dog | f | 1 |
-| dog | m | 2 |
-| hamster | f | 1 |
-| snake | m | 1 |
-+---------+------+----------+
-@end example
-
-You need not retrieve an entire table when you use @code{COUNT()}. For
-example, the previous query, when performed just on dogs and cats, looks like
-this:
-
-@example
-mysql> SELECT species, sex, COUNT(*) FROM pet
- -> WHERE species = "dog" OR species = "cat"
- -> GROUP BY species, sex;
-+---------+------+----------+
-| species | sex | COUNT(*) |
-+---------+------+----------+
-| cat | f | 1 |
-| cat | m | 1 |
-| dog | f | 1 |
-| dog | m | 2 |
-+---------+------+----------+
-@end example
-
-Or, if you wanted the number of animals per sex only for known-sex animals:
-
-@example
-mysql> SELECT species, sex, COUNT(*) FROM pet
- -> WHERE sex IS NOT NULL
- -> GROUP BY species, sex;
-+---------+------+----------+
-| species | sex | COUNT(*) |
-+---------+------+----------+
-| bird | f | 1 |
-| cat | f | 1 |
-| cat | m | 1 |
-| dog | f | 1 |
-| dog | m | 2 |
-| hamster | f | 1 |
-| snake | m | 1 |
-+---------+------+----------+
-@end example
-
-@node Multiple tables, , Retrieving data, Database use
-@subsection Using more than one table
-
-The @code{pet} table keeps track of which pets you have. If you want to
-record other information about them, such as events in their lives like
-visits to the vet or when litters are born, you need another table. What
-should this table look like?
-
-@itemize @bullet
-@item
-It needs to contain the pet name so you know which animal each event pertains
-to.
-
-@item
-It needs a date so you know when the event occurred.
-
-@item
-It needs a field to describe the event.
-
-@item
-If you want to be able to categorize events, it would be useful to have an
-event type field.
-@end itemize
-
-Given these considerations, the @code{CREATE TABLE} statement for the
-@code{event} table might look like this:
-
-@example
-mysql> CREATE TABLE event (name VARCHAR(20), date DATE,
- -> type VARCHAR(15), remark VARCHAR(255));
-@end example
-
-As with the @code{pet} table, it's easiest to load the initial records
-by creating a tab-delimited text file containing the information:
-
-@multitable @columnfractions .15 .15 .15 .55
-@item Fluffy @tab 1995-05-15 @tab litter @tab 4 kittens, 3 female, 1 male
-@item Buffy @tab 1993-06-23 @tab litter @tab 5 puppies, 2 female, 3 male
-@item Buffy @tab 1994-06-19 @tab litter @tab 3 puppies, 3 female
-@item Chirpy @tab 1999-03-21 @tab vet @tab needed beak straightened
-@item Slim @tab 1997-08-03 @tab vet @tab broken rib
-@item Bowser @tab 1991-10-12 @tab kennel
-@item Fang @tab 1991-10-12 @tab kennel
-@item Fang @tab 1998-08-28 @tab birthday @tab Gave him a new chew toy
-@item Claws @tab 1998-03-17 @tab birthday @tab Gave him a new flea collar
-@item Whistler @tab 1998-12-09 @tab birthday @tab First birthday
-@end multitable
-
-Load the records like this:
-
-@example
-mysql> LOAD DATA LOCAL INFILE "event.txt" INTO TABLE event;
-@end example
-
-Based on what you've learned from the queries you've run on the @code{pet}
-table, you should be able to perform retrievals on the records in the
-@code{event} table; the principles are the same. But when is the
-@code{event} table by itself insufficient to answer questions you might ask?
-
-Suppose you want to find out the ages of each pet when they had their
-litters. The @code{event} table indicates when this occurred, but to
-calculate age of the mother, you need her birth date. Because that is
-stored in the @code{pet} table, you need both tables for the query:
-
-@example
-mysql> SELECT pet.name, (TO_DAYS(date) - TO_DAYS(birth))/365 AS age, remark
- -> FROM pet, event
- -> WHERE pet.name = event.name AND type = "litter";
-+--------+------+-----------------------------+
-| name | age | remark |
-+--------+------+-----------------------------+
-| Fluffy | 2.27 | 4 kittens, 3 female, 1 male |
-| Buffy | 4.12 | 5 puppies, 2 female, 3 male |
-| Buffy | 5.10 | 3 puppies, 3 female |
-+--------+------+-----------------------------+
-@end example
-
-There are several things to note about this query:
-
-@itemize @bullet
-@item
-The @code{FROM} clause lists two tables because the query needs to pull
-information from both of them.
-
-@item
-When combining (joining) information from multiple tables, you need to
-specify how records in one table can be matched to records in the other.
-This is easy because they both have a @code{name} column. The query uses
-@code{WHERE} clause to match up records in the two tables based on the
-@code{name} values.
-
-@item
-Because the @code{name} column occurs in both tables, you must be specific
-about which table you mean when referring to the column. This is done
-by prepending the table name to the column name.
-@end itemize
-
-You need not have two different tables to perform a join. Sometimes it is
-useful to join a table to itself, if you want to compare records in a table
-to other records in that same table. For example, to find breeding pairs
-among your pets, you can join the @code{pet} table with itself to pair up
-males and females of like species:
-
-@example
-mysql> SELECT p1.name, p1.sex, p2.name, p2.sex, p1.species
- -> FROM pet AS p1, pet AS p2
- -> WHERE p1.species = p2.species AND p1.sex = "f" AND p2.sex = "m";
-+--------+------+--------+------+---------+
-| name | sex | name | sex | species |
-+--------+------+--------+------+---------+
-| Fluffy | f | Claws | m | cat |
-| Buffy | f | Fang | m | dog |
-| Buffy | f | Bowser | m | dog |
-+--------+------+--------+------+---------+
-@end example
-
-In this query, we specify aliases for the table name in order to be able
-to refer to the columns and keep straight which instance of the table
-each column reference is associated with.
-
-@node Getting information, Batch mode, Database use, Tutorial
-@section ¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¥Æ¡¼¥Ö¥ë¤Î¾ðÊó¤òÆÀ¤ë
-
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤ä¥Æ¡¼¥Ö¥ë¤Î̾Á°¤¬²¿¤Ç¤¢¤Ã¤¿¤«¡¢¤¢¤ë¤¤¤Ï¥Æ¡¼¥Ö¥ë¤Î¹½Â¤¤Ï¤É¤¦¤Ç¤¢¤Ã¤¿¤«¡¢
-(¤Ê¤ó¤È¤¤¤¦¥Õ¥£¡¼¥ë¥É¤¬¤¢¤Ã¤¿¤Î¤«)˺¤ì¤Æ¤·¤Þ¤Ã¤¿¾ì¹ç¡£
-@strong{MySQL} ¤Ç¤Ï¤¤¤¯¤Ä¤«¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¥Æ¡¼¥Ö¥ë¤Î¾ðÊó¤òÄ󶡤¹¤ëʸ¤òÄ̤¸¤Æ
-¤³¤ÎÌäÂê¤ò½èÍý¤·¤Þ¤¹¡£
-
-¤¢¤Ê¤¿¤Ï´û¤Ë @code{SHOW DATABASES} ¤òÃΤäƤ¤¤ë¤Ï¤º¤Ç, ¤³¤ì¤Ï¥µ¡¼¥Ð¡¼¤¬
-´ÉÍý¤¹¤ë¥Ç¡¼¥¿¡¼¥Ù¡¼¥¹¤Î°ìÍ÷¤òɽ¼¨¤·¤Þ¤¹¡£ ¸½ºßÁªÂò¤·¤Æ¤¤¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬
-²¿¤Ç¤¢¤ë¤«¤òÃΤë¤Ë¤Ï¡¢@code{DATABASE()} ´Ø¿ô¤ò»ÈÍѤ·¤Þ¤¹¡§
-
-@example
-mysql> SELECT DATABASE();
-+------------+
-| DATABASE() |
-+------------+
-| menagerie |
-+------------+
-@end example
-
-¤â¤·¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¤Þ¤À²¿¤âÁªÂò¤·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢·ë²Ì¤Ï¥Ö¥é¥ó¥¯¤Ç¤¹¡£
-
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë´Þ¤Þ¤ì¤ë¥Æ¡¼¥Ö¥ë¤ò¸«¤Ä¤±¤ë¤Ë¤Ï(¤¿¤È¤¨¤Ð¡¢¤¢¤Ê¤¿¤¬¥Æ¡¼¥Ö¥ë̾¤ò
-ÃΤé¤Ê¤¤¾ì¹ç)¡¢¤³¤Î¥³¥Þ¥ó¥É¤ò»ÈÍѤ·¤Þ¤¹¡§
-
-@example
-mysql> SHOW TABLES;
-+---------------------+
-| Tables in menagerie |
-+---------------------+
-| event |
-| pet |
-+---------------------+
-@end example
-
-¤â¤·¥Æ¡¼¥Ö¥ë¤Î¹½Â¤¤òÃΤꤿ¤¤¤Ê¤é¡¢@code{DESCRIBE} ¥³¥Þ¥ó¥É¤¬ÊØÍø¤Ç¤¹¡¨
-¤³¤ì¤Ï¥Æ¡¼¥Ö¥ë¤Î¤½¤ì¤¾¤ì¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£
-
-@example
-mysql> DESCRIBE pet;
-+---------+-------------+------+-----+---------+-------+
-| Field | Type | Null | Key | Default | Extra |
-+---------+-------------+------+-----+---------+-------+
-| name | varchar(20) | YES | | NULL | |
-| owner | varchar(20) | YES | | NULL | |
-| species | varchar(20) | YES | | NULL | |
-| sex | char(1) | YES | | NULL | |
-| birth | date | YES | | NULL | |
-| death | date | YES | | NULL | |
-+---------+-------------+------+-----+---------+-------+
-@end example
-
-@code{Field} ¤Ï¥Õ¥£¡¼¥ë¥É̾¤ò¼¨¤·¡¢@code{Type} ¤Ï¥Õ¥£¡¼¥ë¥É¤Î¥Ç¡¼¥¿·¿¡¢
-@code{Null} ¤Ï¤³¤Î¥Õ¥£¡¼¥ë¥É¤¬ @code{Null} Ãͤò´Þ¤à¤«¤ò¼¨¤·¡¢
-@code{Key} ¤Ï¤³¤Î¥Õ¥£¡¼¥ë¥É¤¬¥¤¥ó¥Ç¥Ã¥¯¥¹²½¤µ¤ì¤Æ¤¤¤ë¤«¤ò¼¨¤·¡¢
-@code{Default} ¤Ï¥Õ¥£¡¼¥ë¥É¤Î¥Ç¥Õ¥©¥ë¥È¤ÎÃͤò¼¨¤·¤Þ¤¹¡£
-
-¤â¤·¥Æ¡¼¥Ö¥ë¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ã¤Æ¤¤¤ë¤Ê¤é¡¢
-@code{SHOW INDEX FROM tbl_name} ¤¬¤½¤ì¤é¤Î¾ðÊó¤ò¼¨¤·¤Þ¤¹¡£
-
-@node Batch mode, Twin, Getting information, Tutorial
-@section @code{mysql} ¤Î¥Ð¥Ã¥Á¥â¡¼¥É¤Ç¤Î»ÈÍÑ
-
-Á°¤Î¥»¥¯¥·¥ç¥ó¤Ç¤Ï¡¢@code{mysql} ¤òÂÐÏå⡼¥É¤Ç»ÈÍѤ·¡¢¥¯¥¨¥ê¤ÎÆþÎϤÈ
-·ë²Ì¤òɽ¼¨¤·¤Þ¤·¤¿¡£ @code{mysql} ¤Ï¥Ð¥Ã¥Á¥â¡¼¥É¤Ç¤â¼Â¹Ô²Äǽ¤Ç¤¹¡£
-¤³¤ì¤ò¹Ô¤¦¤Ë¤Ï¡¢¤¢¤Ê¤¿¤¬¼Â¹Ô¤·¤¿¤¤¥³¥Þ¥ó¥É¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤¤¤Æ¤ª¤­¡¢
-¤½¤Î¥Õ¥¡¥¤¥ë¤«¤éÆþÎϤòÆɤ߹þ¤à¤è¤¦¤Ë¤·¤Æ @code{mysql} ¤ò¼Â¹Ô¤·¤Þ¤¹¡§
-
-@example
-shell> mysql < batch-file
-@end example
-
-¤â¤·Àܳ¥Ñ¥é¥á¥¿¡¼¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¾ì¹ç¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ë¤Ç¤·¤ç¤¦¡§
-
-@example
-shell> mysql -h host -u user -p < batch-file
-Enter password: ********
-@end example
-
-¤³¤ÎÊýË¡¤Ç @code{mysql} ¤ò»ÈÍѤ¹¤ë¤È¤­¡¢¤¢¤Ê¤¿¤Ï¥¹¥¯¥ê¥×¥È¥Õ¥¡¥¤¥ë¤ò
-ºîÀ®¤·¡¢¤½¤ì¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ë¤Ê¤ë¤Ç¤·¤ç¤¦¡£
-
-¤Ê¤¼¥¹¥¯¥ê¥×¥È¤ò»ÈÍѤ¹¤ë¤Î¤«¡© ¤½¤ì¤Ë¤Ï°Ê²¼¤ÎÍýͳ¤¬¤¢¤ê¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-¤â¤··«¤êÊÖ¤·¥¯¥¨¥ê¤ò¼Â¹Ô¤¹¤ë¾ì¹ç(ËèÆü¤È¤«Ëè½µ¤È¤«)¡¢¥¹¥¯¥ê¥×¥È¤ò½ñ¤¯¤³¤È¤Ç¡¢
-¤½¤Î¼Â¹Ô¤ÎÅ٤ˤ¢¤Ê¤¿¤¬¥³¥Þ¥ó¥É¤ò¥¿¥¤¥×¤¹¤ë¤³¤È¤ò¾Ê¤¯¤³¤È¤¬²Äǽ¤Ç¤¹¡£
-
-@item
-¤â¤·´û¤Ë¤¢¤ë¥¯¥¨¥ê¤Ë»÷¤¿¿·¤·¤¤¥¯¥¨¥ê¤ò½ñ¤¯¾ì¹ç¡¢¤½¤ì¤é¤ò¥³¥Ô¡¼¤·
-¥¹¥¯¥ê¥×¥È¥Õ¥¡¥¤¥ë¤òÊÔ½¸¤Ç¤­¤Þ¤¹¡£
-
-@item
-¥Ð¥Ã¥Á¥â¡¼¥É¤Ï¥¯¥¨¥ê¤Î³«È¯Ãæ¤äÊ£¿ô¤Ë¤Þ¤¿¤¬¤ë¥³¥Þ¥ó¥É¤Ë¤ÏÌò¤ËΩ¤Á¤Þ¤¹¡£
-¤â¤·¥³¥Þ¥ó¥É¤¬´Ö°ã¤Ã¤Æ¤¤¤¿¤È¤·¤Æ¤âÁ´¤Æ¤òÂǤÁľ¤¹É¬Íפ¬¤¢¤ê¤Þ¤»¤ó¡£
-¥¨¥é¡¼¤ò½¤Àµ¤¹¤ë¤¿¤á¤Ë¥¹¥¯¥ê¥×¥È¤òÊÔ½¸¤·¡¢ºÆ¤Ó @code{mysql} ¤Ë¼Â¹Ô¤µ¤»¤Þ¤¹¡£
-
-@item
-¤â¤·Â¿¤¯¤Î½ÐÎϤò½Ð¤¹¤è¤¦¤Ê¥¯¥¨¥ê¤Î¾ì¹ç¡¢¥Ú¡¼¥¸¥ã¡¼¤ò»ÈÍѤ·¤Æ½ÐÎϤò¸«¤ë¤³¤È¤¬
-½ÐÍè¤Þ¤¹¡£ ½ÐÎϤ¬¥¹¥¯¥í¡¼¥ë¤·¤Æ²èÌ̤«¤é¸«¤¨¤Ê¤¯¤Ê¤ë¤è¤ê¤¤¤¤¤Ç¤·¤ç¤¦¡§
-
-@example
-shell> mysql < batch-file | more
-@end example
-
-@item
-¤¢¤Ê¤¿¤Ï¤è¤ê½èÍý¤ò¹Ô¤¦¤¿¤á¤Ë¡¢·ë²Ì¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤¹¤³¤È¤¬²Äǽ¤Ç¤¹¡§
-
-@example
-shell> mysql < batch-file > mysql.out
-@end example
-
-@item
-¤¢¤Ê¤¿¤Ï¡¢Â¾¿Í¤Ø¤Î¤¢¤Ê¤¿¤Î¥¹¥¯¥ê¥×¥È¤òÇÛÉÛ¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤ì¤Ë¤è¤ê¡¢¤Û¤«¤Î¿Í¤¿¤Á¤â
-¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@item
-¤¤¤¯¤Ä¤«¤Î¾õ¶·¤Ç¤Ï¡¢ÂÐÏå⡼¥É¤Ç¤Ï»ÈÍѤËÂѤ¨¤Þ¤»¤ó¡£ ¤¿¤È¤¨¤Ð¡¢¥¯¥¨¥ê¤ò
- @code{cron} ¥¸¥ç¥Ö¤È¤·¤Æ¼Â¹Ô¤¹¤ë¾ì¹ç¡£ ¤³¤Î¾ì¹ç¡¢¥Ð¥Ã¥Á¥â¡¼¥É¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-
-@item
-üËö¤¬Àµ¤·¤¯°·¤¨¤Ê¤¤Ê¸»ú¤ò @code{mysql} ¥³¥Þ¥ó¥É¤ËÅϤ¹¾ì¹ç¡£
-¤¿¤È¤¨¤Ð¡¢EUC-JP, Shift_JIS ¤Î´Á»úʸ»ú¤Ê¤É¤Ï¡¢Ã¼Ëö¤ä´Ä¶­¤Ë¤è¤Ã¤Æ¤ÏľÀÜÆþÎϤǤ­¤Ê¤¤¾ì¹ç¤â¤¢¤ë¤Ç¤·¤ç¤¦¡£
-@end itemize
-
-@code{mysql} ¤ò¥Ð¥Ã¥Á¥â¡¼¥É¤Ç»ÈÍѤ¹¤ë¤«¡¢ÂÐÏå⡼¥É¤Ç»ÈÍѤ¹¤ë¤«¤Ç¡¢
-¥Ç¥Õ¥©¥ë¥È¤Î½ÐÎÏ·Á¼°¤¬ÊѤï¤ê¤Þ¤¹¡£ Î㤨¤Ð¡¢ @code{SELECT DISTINCT species FROM pet} ¤Î
-½ÐÎϤÏÂÐÏå⡼¥É¤Ç¤Ï¼¡¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡§
-
-@example
-+---------+
-| species |
-+---------+
-| bird |
-| cat |
-| dog |
-| hamster |
-| snake |
-+---------+
-@end example
-
-¤·¤«¤·¡¢¥Ð¥Ã¥Á¥â¡¼¥É¤Ç¤Ï¡§
-
-@example
-species
-bird
-cat
-dog
-hamster
-snake
-@end example
-
-¤â¤·¥Ð¥Ã¥Á¥â¡¼¥É¤Ç¤âÂÐÏå⡼¥É¤Î¤è¤¦¤Ê½ÐÎϤòÆÀ¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢@code{mysql -t} ¤È¤·¤Þ¤¹¡£
-½ÐÎÏÃæ¤Ë¡¢¼Â¹Ô¤·¤¿¥³¥Þ¥ó¥É¤òɽ¼¨¤µ¤»¤ë¤Ê¤é¤Ð¡¢@code{mysql -vvv} ¤È¤·¤Þ¤¹¡£
-
-@node Twin, , Batch mode, Tutorial
-@section Queries from twin project
-
-At Analytikerna and Lentus, we have been doing the systems and field work
-for a big research project. This project is a collaboration between the
-Institute of Environmental Medicine at Karolinska Institutet Stockholm
-and the Section on Clinical Research in Aging and Psychology at the
-University of Southern California.
-
-The project involves a screening part where all twins in Sweden older
-than 65 years are interviewed by telephone. Twins who meet certain
-criteria are passed on to the next stage. In this latter stage, twins who
-want to participate are visited by a doctor/nurse team. Some of the
-examinations include physical and neuropsychological examination,
-laboratory testing, neuroimaging, psychological status assessment, and family
-history collection. In addition, data are collected on medical and
-environmental risk factors.
-
-More information about Twin studies can be found at:
-
-@example
-@url{http://www.imm.ki.se/TWIN/TWINUKW.HTM}
-@end example
-
-The latter part of the project is administered with a web interface
-written using Perl and @strong{MySQL}.
-
-Each night all data from the interviews are moved into a @strong{MySQL}
-database.
-
-@menu
-* Twin pool:: Find all non-distributed twins
-* Twin event:: Show a table on twin pair status
-@end menu
-
-@node Twin pool, Twin event, Twin, Twin
-@subsection Find all non-distributed twins
-
-The following query is used to determine who goes into the second part of the
-project:
-
-@example
-select
- concat(p1.id, p1.tvab) + 0 as tvid,
- concat(p1.christian_name, " ", p1.surname) as Name,
- p1.postal_code as Code,
- p1.city as City,
- pg.abrev as Area,
- if(td.participation = "Aborted", "A", " ") as A,
- p1.dead as dead1,
- l.event as event1,
- td.suspect as tsuspect1,
- id.suspect as isuspect1,
- td.severe as tsevere1,
- id.severe as isevere1,
- p2.dead as dead2,
- l2.event as event2,
- h2.nurse as nurse2,
- h2.doctor as doctor2,
- td2.suspect as tsuspect2,
- id2.suspect as isuspect2,
- td2.severe as tsevere2,
- id2.severe as isevere2,
- l.finish_date
-from
- twin_project as tp
- /* For Twin 1 */
- left join twin_data as td on tp.id = td.id and tp.tvab = td.tvab
- left join informant_data as id on tp.id = id.id and tp.tvab = id.tvab
- left join harmony as h on tp.id = h.id and tp.tvab = h.tvab
- left join lentus as l on tp.id = l.id and tp.tvab = l.tvab
- /* For Twin 2 */
- left join twin_data as td2 on p2.id = td2.id and p2.tvab = td2.tvab
- left join informant_data as id2 on p2.id = id2.id and p2.tvab = id2.tvab
- left join harmony as h2 on p2.id = h2.id and p2.tvab = h2.tvab
- left join lentus as l2 on p2.id = l2.id and p2.tvab = l2.tvab,
- person_data as p1,
- person_data as p2,
- postal_groups as pg
-where
- /* p1 gets main twin and p2 gets his/her twin. */
- /* ptvab is a field inverted from tvab */
- p1.id = tp.id and p1.tvab = tp.tvab and
- p2.id = p1.id and p2.ptvab = p1.tvab and
- /* Just the sceening survey */
- tp.survey_no = 5 and
- /* Skip if partner died before 65 but allow emigration (dead=9) */
- (p2.dead = 0 or p2.dead = 9 or
- (p2.dead = 1 and
- (p2.death_date = 0 or
- (((to_days(p2.death_date) - to_days(p2.birthday)) / 365)
- >= 65))))
- and
- (
- /* Twin is suspect */
- (td.future_contact = 'Yes' and td.suspect = 2) or
- /* Twin is suspect - Informant is Blessed */
- (td.future_contact = 'Yes' and td.suspect = 1 and id.suspect = 1) or
- /* No twin - Informant is Blessed */
- (ISNULL(td.suspect) and id.suspect = 1 and id.future_contact = 'Yes') or
- /* Twin broken off - Informant is Blessed */
- (td.participation = 'Aborted'
- and id.suspect = 1 and id.future_contact = 'Yes') or
- /* Twin broken off - No inform - Have partner */
- (td.participation = 'Aborted' and ISNULL(id.suspect) and p2.dead = 0))
- and
- l.event = 'Finished'
- /* Get at area code */
- and substring(p1.postal_code, 1, 2) = pg.code
- /* Not already distributed */
- and (h.nurse is NULL or h.nurse=00 or h.doctor=00)
- /* Has not refused or been aborted */
- and not (h.status = 'Refused' or h.status = 'Aborted'
- or h.status = 'Died' or h.status = 'Other')
-order by
- tvid;
-@end example
-
-Some explanations:
-@table @asis
-@item @code{concat(p1.id, p1.tvab) + 0 as tvid}
-We want to sort on the concatenated @code{id} and @code{tvab} in
-numerical order. Adding @code{0} to the result causes @strong{MySQL} to treat the
-result as a number.
-@item column @code{id}
-This identifies a pair of twins. It is a key in all tables.
-@item column @code{tvab}
-This identifies a twin in a pair. It has a value of @code{1} or @code{2}.
-@item column @code{ptvab}
-This is an inverse of @code{tvab}. When @code{tvab} is @code{1} this is
-@code{2}, and vice versa. It exists to save typing and to make it easier for
-@strong{MySQL} to optimize the query.
-@end table
-
-This query demonstrates, among other things, how to do lookups on a
-table from the same table with a join (@code{p1} and @code{p2}). In the example, this
-is used to check whether a twin's partner died before the age of 65. If so,
-the row is not returned.
-
-All of the above exist in all tables with twin-related information. We
-have a key on both @code{id,tvab} (all tables) and @code{id,ptvab}
-(@code{person_data}) to make queries faster.
-
-On our production machine (A 200MHz UltraSPARC), this query returns
-about 150-200 rows and takes less than one second.
-
-The current number of records in the tables used above:
-@multitable @columnfractions .3 .5
-@item @strong{Table} @tab @strong{Rows}
-@item @code{person_data} @tab 71074
-@item @code{lentus} @tab 5291
-@item @code{twin_project} @tab 5286
-@item @code{twin_data} @tab 2012
-@item @code{informant_data} @tab 663
-@item @code{harmony} @tab 381
-@item @code{postal_groups} @tab 100
-@end multitable
-
-@node Twin event, , Twin pool, Twin
-@subsection Show a table on twin pair status
-
-Each interview ends with a status code called @code{event}. The query
-shown below is used to display a table over all twin pairs combined by
-event. This indicates in how many pairs both twins are finished, in how many
-pairs one twin is finished and the other refused, and so on.
-
-@example
-select
- t1.event,
- t2.event,
- count(*)
-from
- lentus as t1,
- lentus as t2,
- twin_project as tp
-where
- /* We are looking at one pair at a time */
- t1.id = tp.id
- and t1.tvab=tp.tvab
- and t1.id = t2.id
- /* Just the sceening survey */
- and tp.survey_no = 5
- /* This makes each pair only appear once */
- and t1.tvab='1' and t2.tvab='2'
-group by
- t1.event, t2.event;
-
-@end example
-
-@cindex Server functions
-@node Server, Replication, Tutorial, Top
-@chapter @strong{MySQL} ¥µ¡¼¥Ð¡¼¥Õ¥¡¥ó¥¯¥·¥ç¥ó
-
-@menu
-* Languages:: @strong{MySQL} ¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¸À¸ì¤Ï¡©
-* Table size:: @strong{MySQL} ¤Ï¥Æ¡¼¥Ö¥ë¤ò¤É¤ì¤¯¤é¤¤Â礭¤¯¤Ç¤­¤ë¤«¡©
-@end menu
-
-@cindex Which languages @strong{MySQL} supports
-@cindex Language support
-@node Languages, Table size, Server, Server
-@section @strong{MySQL} ¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¸À¸ì¤Ï¡©
-
-@code{mysqld} ¤Ï¼¡¤Î¸À¸ì¤Ç¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òÄ󶡤Ǥ­¤Þ¤¹: ¥Á¥§¥³¸ì, ¥ª¥é
-¥ó¥À¸ì, ±Ñ¸ì(¥Ç¥Õ¥©¥ë¥È), Estonia, ¥Õ¥é¥ó¥¹¸ì, ¥É¥¤¥Ä¸ì, ¥Î¥ë¥¦¥§¡¼¸ì, ¿·¥Î¥ë¥¦¥§¡¼
-¸ì,¥Ý¡¼¥é¥ó¥É¸ì, ¥Ý¥ë¥È¥¬¥ë¸ì, ¥¹¥Ú¥¤¥ó¸ì¤½¤·¤Æ¥¹¥¦¥§¡¼¥Ç¥ó¸ì¡£
-
-¤¢¤ë¸À¸ì¤Ç @code{mysqld} ¤ò³«»Ï¤¹¤ë¤¿¤á¤Ë¤Ï @code{--language=lang} ¤Þ¤¿
-¤Ï @code{-L lang} ¥¹¥¤¥Ã¥Á¤Î°ì¤Ä¤ò»È¤¤¤Þ¤¹:
-
-@example
-shell> mysqld --language=swedish
-@end example
-
-or:
-
-@example
-shell> mysqld --language=/usr/local/share/swedish
-@end example
-
-¸À¸ì̾¤ÏÁ´¤Æ¾®Ê¸»ú¤Ç¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-¸À¸ì¥Õ¥¡¥¤¥ë¤Ï(¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï)¼¡¤Î¾ì½ê¤Ë¤¢¤ê¤Þ¤¹¡£
-@file{@var{mysql_base_dir}/share/@var{LANGUAGE}/}.
-
-¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¥Õ¥¡¥¤¥ë¤ò¹¹¿·¤·¤¿¤¤¾ì¹ç¤Ï¡¢ @file{errmsg.txt} ¥Õ¥¡¥¤¥ë¤òÊÔ½¸¤·¡¢
- @file{errmsg.sys} ¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë¤¿¤á¤Ë°Ê²¼¤Î¤è¤¦¤Ë¼Â¹Ô¤·¤Þ¤¹:
-
-@example
-shell> comp_err errmsg.txt errmsg.sys
-@end example
-
-¤â¤· @strong{MySQL} ¤ò¿·¤·¤¤¤â¤Î¤Ë¥¢¥Ã¥×¥°¥ì¡¼¥É¤·¤¿¤Ê¤é¡¢°ÊÁ°½¤Àµ¤·¤¿Éôʬ¤ÈƱ¤¸¤È¤³¤í¤Ë¡¢
-¿·¤·¤¤ @file{errmsg.txt} ¥Õ¥¡¥¤¥ë¤Ë½¤Àµ¤ò¤Û¤É¤³¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@menu
-* Character sets:: ¥Ç¡¼¥¿¤È¥½¡¼¥È¤Ë»ÈÍѤµ¤ì¤ë¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È
-* Adding character set:: ¿·¤·¤¤¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È¤ÎÄɲÃ
-* String collating:: String collating support
-* Multi-byte characters:: Multi-byte character support
-@end menu
-
-@node Character sets, Adding character set, Languages, Languages
-@subsection ¥Ç¡¼¥¿¤È¥½¡¼¥È¤Ë»ÈÍѤµ¤ì¤ë¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È
-
-¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢@strong{MySQL} ¤Ï ISO8859-1 (Latin1) ¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È¤ò»ÈÍѤ·
-¤Þ¤¹¡£¤³¤ì¤Ï USA ¤ÈÀ¾¥è¡¼¥í¥Ã¥Ñ¤Ç»ÈÍѤµ¤ì¤ë¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È¤Ç¤¹¡£
-
-¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È¤Ï̾Á°¤È¤·¤Æµö¤µ¤ì¤ëʸ»ú¤È¡¢@code{ORDER BY} ¤È @code{GROUP BY}
-¥³¥Þ¥ó¥É¤Ë¤è¤Ã¤Æ¥½¡¼¥È¤µ¤ì¤ëÊýË¡¤ò·èÄꤷ¤Þ¤¹¡£
-¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È¤Ï¡¢Ì¾Á°¤È¤·¤Æ»ÈÍѤ·¤Æ¤â¤è¤¤Ê¸»ú¤È @code{SELECT} ¹½Ê¸Ãæ¤Î
- @code{ORDER BY} ¤È @code{GROUP BY} ¥³¥Þ¥ó¥É¤òÍѤ¤¤¿¥½¡¼¥ÈÊýË¡¤ò·èÄꤷ¤Þ¤¹¡£
-
-You can change the character set with the
-@code{--default-character-set} option when you start the server.
-The character sets available depend on the @code{--with-charset=charset}
-option to @code{configure}, and the character set configuration files
-listed in @file{SHAREDIR/charsets/Index}.
-@xref{Quick install}.
-
-When a client connects to a @strong{MySQL} server, the server sends the
-default character set in use to the client. The client will switch to
-use this character set for this connection.
-
-One should use @code{mysql_real_escape_string()} when escaping strings
-for a SQL query. @code{mysql_real_escape_string()} is identical to the
-old @code{mysql_escape_string()} function, except that it takes the MYSQL
-connection handle as the first parameter.
-
-If the client is compiled with different paths than where the server is
-installed and the user that configured @strong{MySQL} didn't included all
-character sets in the @strong{MySQL} binary one must specify for
-the client where it can find the additional character sets it will need
-if the server runs with a different character set than the client.
-
-On can specify this by putting in a @strong{MySQL} option file:
-
-@example
-[client]
-default-set-dir=/usr/local/mysql/share/mysql/charsets
-@end example
-
-where the path points to where the dynamic @strong{MySQL} character sets
-are stored.
-
-One can force the client to use specific character set by specifying:
-
-@example
-[client]
-default-character-set=character-set-name
-@end example
-
-but normally this is never needed.
-
-To add another character set to @strong{MySQL}, use the following procedure:
-
-@node Adding character set, String collating, Character sets, Languages
-@subsection ¿·¤·¤¤¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È¤ÎÄɲÃ
-
-@enumerate
-@item
-Decide if the set is simple or complex. If the character set
-does not need to use special string collating routines for
-sorting, and does not need mulit-byte character support, it is
-simple. If it needs either of those features, it is complex.
-
-@item
-If the character set is simple, then create the file
-@file{sql/share/charsets/MYSET.conf}, and add MYSET the
-@file{sql/share/charsets/Index} file. Read the
-@file{sql/share/charsets/README} for more instructions.
-
-@item
-Add the character set name to the @code{CHARSETS_AVAILABLE} and
-@code{COMPILED_CHARSETS} lists in @code{configure.in}.
-
-@item
-Reconfigure, recompile and test.
-
-@item
-If the character set is complex, create the file
-@file{strings/ctype-MYSET.c} ¥Õ¥¡¥¤¥ë¤ò @strong{MySQL} ¤Î¥½¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê°Ê²¼¤ËºîÀ®¤·¤Þ¤¹¡£
-
-@item
-Add MYSET to the end of the @file{sql/share/charsets/Index} file. Take
-note of its position in the file - this is its character set number,
-denoted @code{MYNUMBER} below.
-
-@item
-ɬÍפÊÄêµÁ¤µ¤ì¤ë¤â¤Î¤òÄ´¤Ù¤ë¤¿¤á¤Ë¡¢´û¸¤Î @file{ctype-*.c} ¥Õ¥¡¥¤¥ë¤Î°ì¤Ä¤ò¸«¤Æ¤¯
-¤À¤µ¤¤¡£¤³¤Î¥Õ¥¡¥¤¥ëÃæ¤Ç»ÈÍѤ¹¤ëÇÛÎó¤Î̾Á°¤Ï¡¢
-@code{ctype_MYSET}, @code{to_lower_MYSET} ¤Î¤è¤¦¤Ë¤·¤Ê¤±¤ì¤Ð¤¤¤±¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-Near the top of the file, place a special comment like this:
-
-@example
-/*
- * This comment is parsed by configure to create ctype.c,
- * so don't change it unless you know what you are doing.
- *
- * .configure. number_MYSET=MYNUMBER
- * .configure. strxfrm_multiply_MYSET=N
- * .configure. mbmaxlen_MYSET=N
- */
-@end example
-
-The @code{configure} program uses this comment to include
-the character set into the @strong{MySQL} library automatically.
-
-The strxfrm_multiply and mbmaxlen lines will be explained in
-the following sections. Only include them if you the string
-collating functions or the multi-byte character set functions,
-respectively.
-
-@code{to_lower[]} ¤È @code{to_upper[]} ¤Ï¡¢¤½¤ì¤¾¤ì¤Î¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È¤Ë±÷¤±¤ë
-Âçʸ»ú¡¢¾®Ê¸»ú¤ÎÂбþ¤òÄêµÁ¤·¤¿¡¢Ã±½ã¤ÊÇÛÎó¤Ç¤¹¡£
-Î㤨¤Ð¡§
-
-@example
-to_lower['A'] should contain 'a'
-to_upper['a'] should contain 'A'
-@end example
-
-@code{sort_order[]} ¤Ïʸ»ú¤¬¤É¤Î¤è¤¦¤Ë¥½¡¼¥È¤µ¤ì¤ë¤Ù¤­¤«¤Î¥Þ¥Ã¥×¤Ç¤¹¡£Â¿¤¯¤Î¥»¥Ã
-¥È¤Ç¤Ï¡¢¤³¤ì¤Ï @code{to_upper[]} ¤ÈƱ¤¸¤Ç¤¹ (¥±¡¼¥¹Èó°Í¸¥½¡¼¥È)¡£
-@strong{MySQL} ¤Ï @code{sort_order[character]} ¤ÎÃͤò¸µ¤Ëʸ»ú¤ò¥½¡¼¥È¤·¤Þ¤¹¡£
-For more complicated sorting rules, see
-the discussion of string collating below.
-
-@code{ctype[]} ¤Ï³Æʸ»ú¤òÀâÌÀ¤¹¤ë¥Ó¥Ã¥È¤ÎÇÛÎó¤Ç¡¢1¤«¤¿¤Þ¤ê¤Î¥Ó¥Ã¥ÈÎó¤¬1ʸ»ú¤òÄêµÁ¤·¤Þ¤¹¡£
-( @code{to_lower[]}, @code{to_upper[]},@code{sort_order[]}¤Ï¡¢Ê¸»ú¤ÎÃͤǥ¤¥ó¥Ç¥Ã¥¯¥¹¤µ¤ì¤Þ¤¹¤¬¡¢
-@code{ctype[]}¤Ïʸ»ú¤ÎÃÍ+1 ¤Ç¥¤¥ó¥Ç¥Ã¥¯¥¹¤µ¤ì¤Þ¤¹¡£
-¤³¤ì¤Ï EOF ¤òÁàºî¤¹¤ë¤¿¤á¤Ë¤º¤¤¤Ö¤óÁ°¤«¤é»È¤ï¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢¤³¤ÎÊýË¡¤ò»ÈÍѤ·¤Æ¤¤¤Þ¤¹¡£)
-@file{m_ctype.h} ¤Ë¼¡¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯¤ÎÄêµÁ¤ò¸«¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹:
-
-@example
-#define _U 01 /* Upper case */
-#define _L 02 /* Lower case */
-#define _N 04 /* Numeral (digit) */
-#define _S 010 /* Spacing character */
-#define _P 020 /* Punctuation */
-#define _C 040 /* Control character */
-#define _B 0100 /* Blank */
-#define _X 0200 /* heXadecimal digit */
-@end example
-
-¤½¤ì¤¾¤ì¤Îʸ»ú¤ËÂФ¹¤ë @code{ctype[]} ¤Ï¡¢Ê¸»ú¤ò³ÎÄꤹ¤ë¤¿¤á¤Ë
-¥Ó¥Ã¥ÈÎó¤ÈÁȤˤʤäƤ¤¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-¤¿¤È¤¨¤Ð¡¢@code{'A'} ¤ÏÂçʸ»úÄêµÁ (@code{_U}) ¤È 16¿ÊÄêµÁ (@code{_X}) ξÊý¤È¤â¤Ë
-°¤¹¤ë¤Î¤Ç¡¢@code{ctype['A'+1]} ¤Ï°Ê²¼¤ÎÃͤò´Þ¤Þ¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó:
-@example
-_U + _X = 01 + 0200 = 0201
-@end example
-
-@item
-Add support for the string collating or multi-byte features needed, as
-described in the following sections.
-
-@item
-@code{CHARSETS_AVAILABLE} ¥ê¥¹¥È¤È @code{configure.in} ¤ÎÃæ¤Î @code{COMPILED_CHARSETS} ¥ê¥¹¥È
-¤Ë¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È̾¤òÄɲä·¤Þ¤¹¡£
-
-@item
-configure¤È¥³¥ó¥Ñ¥¤¥ë¤ò¤·¤Ê¤ª¤·¡¢¥Æ¥¹¥È¤·¤Æ¤¯¤À¤µ¤¤¡£
-@end enumerate
-
-@cindex String collating
-@node String collating, Multi-byte characters, Adding character set, Languages
-@subsection String collating support
-
-If the sorting rules for your language are too complex to be handled
-with the simple @code{sort_order[]} table, you need to use the string
-collating functions.
-
-Right now the best documentation on this is the character sets that are
-already implemented. Look at the big5, czech, gbk, sjis and tis160
-character sets for examples.
-
-You must specify the @code{strxfrm_multiply_MYSET=N} value in the
-special comment at the top of the file. @code{N} should be set to
-the maximum ratio the strings may grow during my_strxfrm_MYSET (it
-must be a positive integer).
-
-@cindex Multi-byte characters
-@node Multi-byte characters, , String collating, Languages
-@subsection ¥Þ¥ë¥Á¥Ð¥¤¥Èʸ»ú¤Î¥µ¥Ý¡¼¥È
-
-If your character set includes multi-byte characters, you need to use
-the multi-byte character functions.
-
-Right now the best documentation on this is the character sets that are
-already implemented. Look at the euc_kr, gb2312, gbk, sjis and ujis
-character sets for examples.
-
-You must specify the @code{mbmaxlen_MYSET=N} value in the
-special comment at the top of the file. @code{N} should be set to
-the size in bytes of the largest character in the set.
-
-
-@cindex Table size
-@cindex Size of tables
-@node Table size, , Languages, Server
-@section @strong{MySQL} ¤Ï¥Æ¡¼¥Ö¥ë¤ò¤É¤ì¤¯¤é¤¤Â礭¤¯¤Ç¤­¤ë¤«¡©
-
-@strong{MySQL} 3.22 ¤Î¥Æ¡¼¥Ö¥ë¥µ¥¤¥º¤ÎÀ©¸Â¤Ï 4G ¤Ç¤¹¡£
-@strong{MySQL} 3.23 ¤Î¿·¤·¤¤ @code{MyISAM} ¤Ç¤Ï¡¢ºÇÂç¤Î¥Æ¡¼¥Ö¥ë¥µ¥¤¥º¤Ï 800Ëü¥Æ¥é¥Ð¥¤¥È
-(2 ^ 63 bytes) ¤Ç¤¹.
-
-¤·¤«¤·¡¢¤½¤ì¤È¤ÏÊÌ¤Ë OS ¼«¿È¤Î¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤ÎÀ©¸Â¤¬¤¢¤ê¤Þ¤¹¡£
-Î㤨¤Ð¤¤¤¯¤Ä¤«¤Î OS ¤Ç¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡§
-
-@multitable @columnfractions .6 .4
-@item Linux-Intel @tab 2G (or 4G with reiserfs)
-@item Linux-Alpha @tab 8T (?)
-@item Solaris 2.5.1 @tab 2G (possible 4G with patch)
-@item Solaris 2.6 @tab 4G
-@item Solaris 2.7 Intel @tab 4G
-@item Solaris 2.7 ULTRA-SPARC @tab 8T (?)
-@end multitable
-
-¤³¤ì¤Ï¡¢Ä̾@strong{MySQL} ¤Î¥Æ¡¼¥Ö¥ë¥µ¥¤¥º¤Ï
-¥ª¥Ú¡¼¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤ÆÀ©¸Â¤µ¤ì¤ë¤È¤¤¤¦¤³¤È¤Ç¤¹¡£
-
-By default, @strong{MySQL} tables have a maximum size of about 4G. You can
-check the maximum table size for a table with the @code{SHOW TABLE STATUS}
-command or with the @code{myisamchk -dv table_name}.
-@xref{SHOW}.
-
-If you need bigger tables than 4G (and your operating system supports
-this), you should set the @code{AVG_ROW_LENGTH} and @code{MAX_ROWS}
-parameter when you create your table. @xref{CREATE TABLE}. You can
-also set these later with @code{ALTER TABLE}. @xref{ALTER TABLE}.
-
-If you need to have bigger tables than 2G / 4G
-
-¤â¤·Â礭¤Ê¥Æ¡¼¥Ö¥ë¤ò¥ê¡¼¥É¥ª¥ó¥ê¡¼¤Ç»ÈÍѤ¹¤ë¤Ê¤é¡¢@code{myisampack}¤ò»È¤Ã¤ÆÊ£¿ô¤Î¥Æ¡¼¥Ö¥ë¤ò·ë¹ç¤·¤¿¤¦¤¨¤Ç°µ½Ì¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£@code{myisampack}¤Ï¾¯¤Ê¤¯¤È¤â 50% ¥Æ¡¼¥Ö¥ë¤ò°µ½Ì¤¹¤ë¤³¤È¤¬¤Ç¤­¡¢¤½¤Î·ë²Ì¡¢Â礭¤Ê¥Æ¡¼¥Ö¥ë¤ò»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@xref{myisampack, , @code{myisampack}}.
-
-¾¤ÎÊýË¡¤È¤·¤Æ¡¢"Ʊ¤¸¤è¤¦¤Ê"¥Æ¡¼¥Ö¥ë¤ò°ì¤Ä¤Ë¤Ç¤­¤ë MERGE ¥é¥¤¥Ö¥é¥ê¡¼¤ò´Þ¤àÊýË¡¤¬¤¢¤ê¤Þ¤¹¡£
-("Ʊ¤¸¤è¤¦¤Ê" ¤È¤Ï¡¢Æ±¤¸¹àÌܾðÊó¤ò¤â¤Ã¤ÆÁ´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤¬ºî¤é¤ì¤Æ¤¤¤ë¾õÂÖ¤ò¤µ¤·¤Þ¤¹)
-MERGE ¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¤¿¤á¡¢Æ±¼ï¤Î¥Æ¡¼¥Ö¥ë¤·¤«Áöºº¤Ç¤­¤Þ¤»¤ó¡£
-¤³¤ì¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤Îµ¡Ç½¤ò¶á¤¤¾­ÍèÄɲ乤ëͽÄê¤Ç¤¹¡£
-
-@cindex Replication
-@node Replication, Performance, Server, Top
-@chapter Replication in MySQL
-
-@menu
-* Replication Intro:: Introduction
-* Replication Implementation::
-* Replication HOWTO:: HOWTO
-* Replication Features:: Replication Features. Replication Features. Replication Features. Replication Features. Replication Features. Replication Features. Replication Features. Replication Features
-* Replication Options:: Replication Options in my.cnf
-* Replication SQL:: SQL Commands related to replication
-@end menu
-
-@node Replication Intro, Replication Implementation, Replication, Replication
-@section Introduction
-
-One way replication can be used both to increase robustness and
-speed. For robustness you have two systems and switch to the backup if
-you have problems with the master. The extra speed is achieved by
-sending a part of the non-updating queries to the replica server. Of
-course this only works if non-updating queries dominate, but that is the
-normal case.
-
-Starting in 3.23.15, @strong{MySQL} supports one-way replication
-internally. One server acts as the master, while the other acts as the
-slave. Note that one server could play the roles of master in one pair
-and slave in the other. The master server keeps a binary log of updates
-and an index file to binary logs to keep track of log rotation. The
-slave upon connecting informs the master where it left off sinse the
-last successfully propogated update, catches up on the updates, and then
-blocks and waits for the master to notify it of the new updates.
-
-@node Replication Implementation, Replication HOWTO, Replication Intro, Replication
-@section Replication Implementation Overview
-
-@strong{MySQL} internal replication uses the master-slave approach. One
-server is designated as the master, while the other ( or others) as
-slave(s). The master keeps a binary log of updates. The slave connects
-to the master, catches up on the missed updates, and then starts
-receiving updates immediately as they come to the master. If the
-connection is lost, the slave will reconnect. If the master goes down,
-the slave will keep trying to connect every @code{master-connect-retry}
-seconds until the master comes back up and the connection can be
-established. The slave keeps track of where it left off in the
-replication process, so it can use the info in the case it goes down and
-gets restarted later.
-
-@node Replication HOWTO, Replication Features, Replication Implementation, Replication
-@section HOWTO
-Below is a quick HOWTO on how to set up replication on your current system:
-
-@itemize @bullet
-@item
-Upgrade both slave and master to 3.23.15 or higher.
-@item
-Set up special replication user(s) on the master with the @code{FILE}
-privilege and permission to connect from all the slaves
-@item
-Take a snapshot of all the tables/databases on the master that could
-possibly be involved in the update queries before taking the next step
-@item
-In @code{my.cnf} on the master add @code{log-bin} and restart it. Make
-sure there are no important updates to the master between the time you
-have taken the snapshot and the time master is restarted with
-@code{log-bin} option
-@item
-Load the snapshot of the master to all the slaves
-@item
-Add the following to @code{my.cnf} on the slave(s):
-
-@example
-master-host=<hostname of the master>
-master-user=<replication user name>
-master-password=<replication user password>
-@end example
-
-replacting the values in <> with what is relevant to your system.
-
-@item Restart the slave(s)
-
-@end itemize
-
-After you have done the above, the master and the slave(s) should be in
-sync.
-
-@node Replication Features, Replication Options, Replication HOWTO, Replication
-@section Replication Features
-
-Below is an explanation of what is supported and what is not:
-
-@itemize @bullet
-@item
-Replication will be done correctly with @code{AUTO_INCREMENT},
-@code{LAST_INSERT_ID}, and @code{TIMESTAMP} values
-@item
-@code{LOAD DATA INFILE} will be handled properly as long as the file
-still resides on the master server at the time of update
-propogation. @code{LOAD LOCAL DATA INFILE} will be skipped.
-@item
-Update queries that use user variables are not replication-safe (yet)
-@item
-If the query on the slave gets an error, the slave thread will
-terminate, and a message will appear in @code{.err} file. You should
-then connect to the slave manually, fix the cause of the error
-(eg. non-existent table), and then run @code{SLAVE START} sql command ( available starting in 3.23.16,
-in 3.23.15 you will have to restart the server).
-@item
-If connection to the master is lost, the slave will retry immediately,
-and then in case of failure every @code{master-connect-retry} (default
-60) seconds. Because of this, it is safe to shut down the master, and
-then restart it after a while. The slave will also be able to deal with
-network connectivity outages.
-@item
-Shutting down the slave (cleanly) is also safe, as it keeps track of
-where it left off. Unclean shutdowns might produce problems, especially
-if disk cache was not synced before the system died. Your system fault
-tolerance will be greatly increased if you have a good UPS.
-@item
-If the master is listening on a non-standard port, you will also need to
-specify this with @code{master-port} parameter in @code{my.cnf} .
-@item
-In 3.23.15,all of the tables and databases will be replicated. Starting in 3.23.16, you
-can restrict replication to a set of databases with @code{replicate-do-db} directives in
-@code{my.cnf} or just excluse a set of databases with @code{replicate-ignore-db}.
-@item
-Starting in 3.23.16, @code{SET SQL_LOG_BIN = 0} will turn off replication (binary) logging on the
-master, and @code{SET SQL_LOG_BIN = 1} will turn in back on - you must have the process privilege to do
-this.
-@item The slave thread does not log updates to the binary log of the slave, so it is possible to couple
-two servers in a mutual master-slave relationship. You can actually set up a load balancing scheme and
-do queries safely on either of the servers. Just do not expect to do LOCK TABLES on one server, then
-connect to the other and still have that lock :-) .
-@end itemize
-
-@node Replication Options, Replication SQL, Replication Features, Replication
-@section Replication Options in my.cnf
-
-The table below explains the replications options in @code{my.cnf} . All of the are available
-starting in 3.23.15 unless indicated otherwise.
-
-@multitable @columnfractions .25 .25 .25 .25
-@item @strong{Option} @tab @strong{Description} @tab @strong{Where to set} @tab @strong{Example}
-@item @code{log-bin} @tab Should be set on the master. Tells it to keep a binary update
-log. If a parameter is specified, the log will be written to the specified location. @tab Master @tab
-@code{log-bin}
-@item @code{log-bin-index} @tab Because the user could issue @code{FLUSH LOGS} command, we need to
-know which log is currently active and which ones have been rotated out and it what sequence. This info
-is stored in the binary log index file. The default is `hostname`.index . You can use this option
-if you want to be a rebel. @tab Master @tab @code{log-bin-index=db.index}
-@item @code{master-host} @tab Master hostname or IP address for replication. If not set,
-the slave thread will not be started @tab Slave @tab @code{master-host=db-master.mycompany.com}
-@item @code{master-user} @tab The user the slave thread will authenticate as when connecting to
-the master. The user must have @code{FILE} privilige. If the master user is not set, user @code{test}
- is assumed. @tab Slave @tab @code{master-user=scott}
-@item @code{master-password} @tab The password the slave thread will authenticate with when
-connecting to the master. If not set, empty password is assumed @tab Slave @tab
-@code{master-password=tiger}
-@item @code{master-port} @tab The port the master is listening on. If not set, the compiled setting of
-@code{MYSQL_PORT} is assumed. If you have not tinkered with @code{configure} options, this should be
-3306. @tab Slave @tab @code{master-port=3306}
-@item @code{master-connect-retry} @tab The number of seconds the slave thread will sleep before retrying
-to connect to the master in case the master goes down or the connection is lost.
-Default is 60. @tab Slave @tab @code{master-connect-retry=60}
-@item @code{master-info-file} @tab The location of the file that remembers where we left off on the
- master during the replication process. The default is master.info in the data directory.
-Sasha: The only reason I see for ever changing the default is the desire to
-be rebelious. @tab Slave @tab @code{master-info-file=master.info}
-@item @code{replicate-do-db} @tab Tells the slave thread to restrict replication to the specified database. To sp
-cify more than one database, use the directive multiple times, once for each database.
-Note that this will only work if you do not use cross-database queries such as
-@code{UPDATE some_db.some_table SET foo='bar'} while having selected a different or
-no database. @tab Slave @tab @code{replicate-ignore-db=some_db}
-@item @code{replicate-ignore-db} @tab Tells the slave thread to not replicate to the specified
-database. To specify more than one database to ignore, use the directive multiple times,
-once for each database. You must not use cross database updates for this option. @tab Slave @tab @code{replicate-
-o-db=some_db}
-@item @code{sql-bin-update-same} @tab If set, setting @code{SQL_LOG_BIN} to a value will
-automatically set @code{SQL_LOG_UPDATE} to the same value and vice
-versa. @tab Master @tab @code{sql-bin-update-same}
-
-@item @code{log-slave-updates} @tab Tells the slave to log the updates from the slave thread to the binary log. Off by default. You will need to turn it on if you plan to daisy-chain the slaves @tab Slave @tab @code{log-slave-updates}
-
-@end multitable
-
-@node Replication SQL, , Replication Options, Replication
-@section SQL commands related to replication
-
-Replication can be controlled through the SQL interface. Below is the
-summary of commands:
-
-@multitable @columnfractions .30 .40 .30
-@item @strong{Command} @tab @strong{Description} @tab @strong{Where to run}
-@item @code{SLAVE START} @tab Starts the slave thread. @tab Slave
-@item @code{SLAVE STOP} @tab Stops the slave thread. @tab Slave
-@item @code{SET SQL_LOG_BIN=0} @tab Disables update logging @tab Master
-@item @code{SET SQL_LOG_BIN=1} @tab Re-enable update logging @tab Master
-@end multitable
-
-@cindex Performance
-@cindex Optimization
-@node Performance, MySQL Benchmarks, Replication, Top
-@chapter MySQL ¤ÎºÇÂçÀ­Ç½¤ò¤Ò¤­¤À¤¹¤Ë¤Ï
-
-Optimization is a complicated task because it ultimately requires
-understanding of the whole system. While it may be possible to do some
-local optimizations with small knowledge of your system/application, the
-more optimal you want your system to become the more you will have to
-know about it.
-
-So this chapter will try to explain and give some examples of different
-ways to optimize @strong{MySQL}. But remember that there are always some
-(increasingly harder) ways to make the system even faster left to do.
-
-@menu
-* Optimize Basics:: Optimization overview
-* System:: System/Compile time and startup parameter tuning
-* Data size:: Get your data as small as possible
-* MySQL indexes:: How @strong{MySQL} uses indexes
-* Query Speed:: Speed of queries that access or update data
-* Tips:: Other optimization tips
-* Benchmarks:: Using your own benchmarks
-* Design:: Design choices
-* Design Limitations:: MySQL design limitations/tradeoffs
-* Portability:: Portability
-* Internal use:: What have we used MySQL for?
-@end menu
-
-@node Optimize Basics, System, Performance, Performance
-@section ºÇŬ²½ ³µÍ×
-
-¥·¥¹¥Æ¥à¤ò®¤¯¤¹¤ë¤¿¤á¤ÎºÇ¤â½ÅÍפÊÉôʬ¤Ï¡¢¤â¤Á¤í¤ó´ðÁÃŪ¤ÊÀ߷פǤ¹¡£
-You also need to know what kinds of things your system will be
-doing, and what your bottlenecks are.
-
-¼ç¤Ê¥Ü¥È¥ë¥Í¥Ã¥¯¤Ï¡§
-@itemize @bullet
-@item Disk ¥·¡¼¥¯ ¡§
-°ìÊҤΥǡ¼¥¿¤ò¸«¤Ä¤±¤ë¤¿¤á¤Ë¤Ï¡¢¥Ç¥£¥¹¥¯¤Ë»þ´Ö¤¬¤«¤«¤ê¤Þ¤¹¡£
-1999ǯ¤ÎºÇ¿··¿¤Î¥Ç¥£¥¹¥¯¤Ç¤Ï¡¢¤³¤Î¤¿¤á¤ÎÊ¿¶Ñ»þ´Ö¤Ï¡¢10ms¤è¤ê¤âÄ̾ï¤è¤ê¾®¤µ¤¤¤Ç¤¹¡£
-¤·¤¿¤¬¤Ã¤Æ¡¢²æ¡¹¤Ï¡¢ÍýÏÀ¾å¤Ï 1ÉäÇÌó1000 ¥·¡¼¥¯¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¤³¤Î»þ´Ö¤Ï¡¢°ì¤Ä¤Î¥Æ¡¼¥Ö¥ë¤Ç¤¢¤ë¤Ê¤é¤Ð¡¢¥Ç¡¼¥¿¤ÎÁý²Ã¤È¶¦¤Ë¥Ç¥£¥¹¥¯¥¢¥¯¥»¥¹¤Î»þ´Ö¤¬
-¾¯¤·¤º¤ÄÁý²Ã¤¹¤ë¤³¤È¤Ë¤Ê¤ê¡¢¤È¤Æ¤âºÇŬ²½¤¹¤ë¤Î¤ÏÆñ¤·¤¯¤Ê¤Ã¤Æ¤¤¤­¤Þ¤¹¡£
-¤³¤ì¤òºÇŬ²½¤¹¤ëÊýË¡¤Ï¡¢¥Ç¡¼¥¿¤ò 1¸Ä°Ê¾å¤Î¥Ç¥£¥¹¥¯¤Ëʬ»¶¤¹¤ë»ö¤Ç¤¹¡£
-@item Disk reading/writing
-When the disk is at the correct position we need to read the data. With
-modern disks in 1999 one disk delivers something like 10-20Mb/s. This
-is easier to optimize than seeks because you can read in parallel from
-multiple disks.
-@item CPU cycles ¡§
-¥Ç¡¼¥¿¤ò¥á¥¤¥ó¡¦¥á¥â¥ê¡¼¤ÎÃæ¤ËÆþ¤ì¤¿(¤Þ¤¿¤Ï´û¤Ë¥á¥â¥ê¤Ë¸ºß¤·¤Æ¤¤¤ë)¾ì¹ç¤Ë¡¢
-·ë²Ì¤òÆÀ¤ë¤¿¤á¤Ë¤Ï¡¢¤½¤ì¤ò½èÍý¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-¥á¥â¥ê¡¼ÍÆÎ̤è¤ê¤â¾®¤µ¤Ê¥Æ¡¼¥Ö¥ë¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢¤³¤ì¤Ï¡¢À©¸Â¤ÎÍ×°ø¤È¤Ê¤ê¤Þ¤¹¡£
-¾®¤µ¤¤¥Æ¡¼¥Ö¥ë¤Ç¤Ï¡¢¥¹¥Ô¡¼¥É¤Ï¡¢Ä̾ïÌäÂê¤Ë¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-@item Memory bandwidth ¡§
-CPU ¤¬¥­¥ã¥Ã¥·¥å¤Ë¼ý¤Þ¤é¤Ê¤¤¤è¤¦¤Ê¥Ç¡¼¥¿¤òÍ׵ᤷ¤¿¾ì¹ç¡¢¥á¥¤¥ó¡¦¥á¥â¥ê¡¼
-¤Î¥Ð¥ó¥ÉÉý¤Ï¥Ü¥È¥ë¥Í¥Ã¥¯¤Ë¤Ê¤ê¤Þ¤¹¡£
-¤³¤ì¤Ï¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¤Çʬ¤«¤ê¤Ë¤¯¤¤¥Ü¥È¥ë¥Í¥Ã¥¯¤È¤Ê¤ê¤Þ¤¹¤¬¡¢
-狼¤Ï¤½¤ì¤òÃΤäƤ¤¤ë¤Ù¤­¤Ç¤¹¡£
-@end itemize
-
-@node System, Data size, Optimize Basics, Performance
-@section ¥·¥¹¥Æ¥à¡¢¥³¥ó¥Ñ¥¤¥ë»þ¡¢¥¹¥¿¡¼¥È¥Ñ¥é¥á¥¿¡¼¤Î¥Á¥å¡¼¥Ë¥ó¥°
-
-We start with the system level things since some of these decisions have
-to be made very early. In other cases a fast look at this part may
-suffice because it not that important for the big gains. However, it is always
-nice to have a feeling about how much one could gain by changing things
-at this level.
-
-»È¤¦¤Ù¤­ OS ¤Ï¤È¤Æ¤â½ÅÍפǤ¹¡ª Ê£¿ô¤Î CPU ¤ò»ý¤Ä¥Þ¥·¥ó¤Ç¤Ï¡¢
-Solaris (¤Ê¤¼¤Ê¤é¡¢Solaris ¤Î¥¹¥ì¥Ã¥É¤Ï¤È¤Æ¤âÁÇÀ²¤é¤·¤¯Æ°ºî¤¹¤ë¤«¤é)¡¢
-¤¢¤ë¤¤¤Ï¡¢Linux ( kernel 2.2 ¤ÏÎɤ¤ SMP ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤«¤é) ¤ò
-»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£ 32bit ¥Þ¥·¥ó¤Î Linux ¤Ç¤Ï¡¢2G bytes ¤Î¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤Î
-À©¸Â¤¬¤¢¤ê¤Þ¤¹¡£ ¤³¤ì¤Ï¿·¤·¤¤¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à (XFS) ¤Î¥ê¥ê¡¼¥¹»þ¤Ë
-¤Ê¤¯¤Ê¤Ã¤ÆÍߤ·¤¤¤â¤Î¤Ç¤¹¡£
-
-Because we have not run @strong{MySQL} in production on that many platforms we
-advice you to test your intended platform before choosing it, if possible.
-
-Other tips:
-@itemize @bullet
-@item
-½¼Ê¬ RAM ¤¬¤¢¤ë¤Ê¤é¤Ð¡¢Á´¤Æ¤Î swap ¤ò³°¤·¤Æ¤â¤è¤¤¤Ç¤·¤ç¤¦¡£
-¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤¿¤È¤¨¥á¥â¥ê¡¼¤¬¶õ¤¤¤Æ¤¤¤Æ¤â¡¢
-swap ¤ò»ÈÍѤ¹¤ë¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£
-
-@item
-³°Éô¤Î¥í¥Ã¥¯¤òÈò¤±¤ë¤¿¤á¡¢@code{--skip-locking} @strong{MySQL} ¥ª¥×¥·¥ç¥ó
-¤ò»ÈÍѤ·¤Þ¤¹¡£
-Note that this will not impact @strong{MySQL}'s functionality as
-long as you only run one server.
-@code{myisamchk} ¤ò¼Â¹Ô¤¹¤ëÁ°¤Ë¡¢¥µ¡¼¥Ð¡¼¤ò»ß¤á¤ë¤³¤È¤ò˺¤ì¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£
-On some system
-this switch is mandatory because the external locking does not work in any
-case.
-
-MIT ¥¹¥ì¥Ã¥É¤Ç¥³¥ó¥Ñ¥¤¥ë¤¹¤ë»þ¤Ï @code{--skip-locking} ¤¬¥Ç¥Õ¥©¥ë¥È¤Ç¤¹¡£
-¤³¤ì¤ÏÁ´¤Æ¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç MIT ¥¹¥ì¥Ã¥É¤¬ @code{flock()} ¤ò´°Á´¤Ë¥µ¥Ý¡¼¥È¤·
-¤Æ¤¤¤Ê¤¤¤¿¤á¤Ç¤¹¡£
-
-@code{--skip-locking} ¤¬»ÈÍѤǤ­¤Ê¤¤¤¿¤À°ì¤Ä¤Î¾õÂ֤ϡ¢
-¤â¤·¤¢¤Ê¤¿¤¬Ê£¿ô¤Î @strong{MySQL} @emph{¥µ¡¼¥Ð¡¼} (¥¯¥é¥¤¥¢¥ó¥È¤Ç¤Ï¤Ê¤¤) ¤ò
-Ʊ¤¸¥Ç¡¼¥¿¤ËÂФ·¤ÆÁö¤é¤»¤Æ¤¤¤ë¾ì¹ç¤Ç¤¹¡£
-Or run
-@code{myisamchk} on the table without first flushing and locking the
-@code{mysqld} server tables first.
-
-¤¿¤È¤¨ @code{--skip-locking} ¤ò»ÈÍѤ·¤Æ¤¤¤Æ¤â¡¢
-@code{LOCK TABLES} / @code{UNLOCK TABLES} ¤Î»ÈÍѤϲÄǽ¤Ç¤¹¡£
-@end itemize
-
-@menu
-* Compile and link options:: How compiling and linking affects the speed of MySQL
-* Disk issues:: Disk issues
-* Server parameters:: Tuning server parameters
-* Table cache:: How MySQL opens and closes tables
-* Creating many tables:: Drawbacks of creating large numbers of tables in the same database
-* Open tables:: Why so many open tables?
-* Memory use:: How MySQL uses memory
-* Internal locking:: How MySQL locks tables
-* Table locking:: Table locking issues
-@end menu
-
-@node Compile and link options, Disk issues, System, System
-@subsection MySQL ¤Î®Å٤˱ƶÁ¤¹¤ë¥³¥ó¥Ñ¥¤¥ë¤È¥ê¥ó¥¯ÊýË¡
-
-¼¡¤Î¥Æ¥¹¥È¤Î¿¤¯¤Ï Linux ¾å¤Ç @strong{MySQL} ¥Ù¥ó¥Á¥Þ¡¼¥¯¤Ç¹Ô¤ï¤ì¤Þ¤·¤¿¡£
-¤·¤«¤·¡¢¤³¤ì¤é¤Ï¾¤Î OS ¤Ë¤Ä¤¤¤Æ¤â¤¤¤¯¤Ä¤«¤Î»Øɸ¤òÍ¿¤¨¤Þ¤¹¡£
-
-@code{-static} ¤Ç¤Î¥ê¥ó¥¯»þ¤ËºÇ®¤Î¼Â¹Ô·Á¼°¤òÆÀ¤Þ¤¹¡£
-TCP/IP ¤ÎÂå¤ï¤ê¤Ë Unix ¥½¥±¥Ã¥È¤ò¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î
-Àܳ¤Ë»ÈÍѤ¹¤ë¤³¤È¤â¡¢¤è¤êÎɤ¤À­Ç½¤òÍ¿¤¨¤Þ¤¹¡£
-
-Linux ¤Ç¤Ï¡¢@code{pgcc} ¤È @code{-O6} ¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¤¿»þ¤ËºÇ®¤Î¥³¡¼¥É¤òÆÀ¤é¤ì¤Þ¤¹¡£
-¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç @file{sql_yacc.cc} ¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤È¡¢@code{gcc/pgcc} ¤Ï
-Á´¤Æ¤Î´Ø¿ô¤ò¥¤¥ó¥é¥¤¥ó¤Ë¤¹¤ë¤¿¤á¤Ë¿¤¯¤Î¥á¥â¥ê¤òɬÍפȤ¹¤ë¤Î¤Ç¡¢200M ¤Î¥á¥â¥ê¤¬É¬ÍפǤ¹¡£
-@code{libstdc++} ¥é¥¤¥Ö¥é¥ê¤ÎÁý²Ã¤òÈò¤±¤ë¤¿¤á¤Ë¤Ï¡¢
-@strong{MySQL} ¤Î configure »þ¤Ë @code{CXX=gcc} ¤âÀßÄꤹ¤Ù¤­¤Ç¤¹¡£
-
-¤è¤êÎɤ¤¥³¥ó¥Ñ¥¤¥é¡¼¡¢¤½¤·¤Æ¥³¥ó¥Ñ¥¤¥é¡¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢10-30% ¤Î
-®Å٤θþ¾å¤ò¤â¤¿¤é¤·¤Þ¤¹¡£ ¤³¤ì¤Ï¤¢¤Ê¤¿¼«¿È¤¬ MySQL ¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë
-»þ¤Ë½ÅÍפʤ³¤È¤Ç¤¹¡ª
-
-Intel ¤Ç¤Ï¡¢Î㤨¤Ð pgcc ¤« Cygnus CodeFusion compiler ¤ÇºÇ®¤È¤Ê¤ê¤Þ¤¹¡£
-²æ¡¹¤Ï ¿·¤·¤¤ Fujitsu ¥³¥ó¥Ñ¥¤¥é¡¼¤Ç¤â¥Æ¥¹¥È¤·¤Þ¤·¤¿¤¬¡¢
-@strong{MySQL} ¤òºÇŬ²½¥ª¥×¥·¥ç¥ó¤Ç¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤Ë¤Ï¡¢
-¤Þ¤À´°Á´¤Ê¥Ð¥°¡¦¥Õ¥ê¡¼¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£
-
-Here is a list of some mesurements that we have done:
-@itemize @bullet
-@item
-@code{pgcc} ¤ò»ÈÍѤ·¤Æ @code{-O6} ¤ÇÁ´¤Æ¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤È¡¢
-@code{gcc} 2.95.2 ¤è¤ê¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢
-@code{mysqld} ¥µ¡¼¥Ð¡¼¤Ï 11% ®¤¯¤Ê¤ê¤Þ¤¹¡£
-
-@item
-ưŪ¥ê¥ó¥¯(@code{-static}) ̵¤·)¤Î¾ì¹ç¡¢·ë²Ì¤Ï 13% ÃÙ¤¯¤Ê¤ê¤Þ¤¹¡£
-Note that you still can use a dynamic linked MySQL library. It
-is only the server that is critical for performance.
-
-@item
-(localhost ¤Ø¤ÎÀܳ¤Ë) Unix ¥½¥±¥Ã¥È¤ÎÂå¤ï¤ê¤Ë TCP/IP ¤ò»ÈÍѤ¹¤ë¤È¡¢·ë²Ì¤Ï 7.5% ÃÙ¤¯¤Ê¤ê¤Þ¤¹¡£
-
-@item
-SPARCstation 10 ¤Ç¤Ï¡¢@code{gcc} 2.7.3 ¤Ï Sun Pro C++ 4.2 ¤è¤ê 13% ®¤¯¤Ê¤ê¤Þ¤¹¡£
-
-@item
-¥·¥ó¥°¥ë¥×¥í¥»¥Ã¥µ¤Î Solaris 2.5.1 ¤Ç¤Ï¡¢mit-pthreads ¤Ï Solaris ¥Í¥¤¥Æ¥£¥Ö¥¹¥ì¥Ã¥É¤è¤ê 8-12% ÃÙ¤¯¤Ê¤ê¤Þ¤¹¡£
-With more load/CPUs the difference should
-get bigger.
-@end itemize
-
-TCX ¤Ë¤è¤êÇÛÉÛ¤µ¤ì¤Æ¤¤¤ë @strong{MySQL}-Linux ÇÛÉÛ¤Ï @code{pgcc} ¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Æ
-¤¤¤Þ¤¹¤¬¡¢
-but we had to go back to regular gcc because of a bug in pgcc that would
-generate the code that does not run on AMD. We will continue using gcc until that bug is resolved.
-In the meantime, if you have a non-AMD machine, you can get a faster binary by compiling with pgcc.
-The Linux binary is linked statically.
-
-@node Disk issues, Server parameters, Compile and link options, System
-@subsection Disk ¤ÎÌäÂê
-
-@itemize @bullet
-@item
-Á°¤Ë½Ò¤Ù¤¿¥Ç¥£¥¹¥¯¥·¡¼¥¯¤¬Â礭¤Ê¥Ü¥È¥ë¥Í¥Ã¥¯¤Ç¤¹¡£ ¤³¤ÎÌäÂê¤Ï¡¢¥Ç¡¼¥¿¤¬¸ú²ÌŪ¤Ë
-¥­¥ã¥Ã¥·¥ó¥°¤¬ÉÔ²Äǽ¤Ë¤Ê¤ë¤Û¤É¡¢Â礭¤¯¤Ê¤ê»Ï¤á¤ë¤È¤­¤Ë¡¢¤À¤ó¤À¤óÌÀÇò¤Ë¤Ê¤Ã¤Æ¤­¤Þ¤¹¡£
-For large databases,
-where you access data more or less randomly, you can count on that you
-will need at least one disk seek to read and a couple of disk seeks to
-write things. ¤³¤ÎÌäÂê¤ò¾¯¤Ê¤¯¤¹¤ë¤Ë¤Ï¡¢disk¥·¡¼¥¯»þ´Ö¤Î¾¯¤Ê¤¤¥Ç¥£¥¹¥¯¤ò
-»ÈÍѤ·¤Þ¤¹¡£
-@item
-ÍøÍѤǤ­¤ë¥Ç¥£¥¹¥¯¥¹¥Ô¥ó¥É¥ë¤Î¿ô¤òÁý¤ä¤·¤Þ¤¹(¤½¤ì¤Ë¤è¤Ã¤Æ¥Ç¥£¥¹¥¯¥·¡¼¥¯
-¤Î¥ª¡¼¥Ð¡¼¥Ø¥Ã¥É¤Ï½Ì¾®¤·¤Þ¤¹)¡£
-¤³¤ì¤Ï°ã¤¦¥Ç¥£¥¹¥¯¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ò¤Ï¤Ã¤¿¤ê¡¢¥¹¥È¥é¥¤¥×¤ò¹Ô¤¦¤³¤È¤Ç
-²Äǽ¤Ç¤¹¡£
-@table @strong
-@item symbolic link ¤Î»ÈÍÑ
-¤³¤ì¤ÏÄ̾ï¤Î¥Ç¡¼¥¿¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¡¢°ã¤¦¥Ç¥£¥¹¥¯¤Ø¡¢
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤ä¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤ò¥·¥ó¥Ü¥ê¥Ã¥¯¡¦¥ê¥ó¥¯¤¹¤ë¤³¤È¤Ç¤¹¡£
-¤³¤ì¤Ï ¥·¡¼¥¯ ¤È ¥ê¡¼¥É ¤ò®¤¯¤·¤Þ¤¹¡£ (¤â¤·¤½¤Î¥Ç¥£¥¹¥¯¤¬
-¾¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð). @xref{Symbolic links}.
-@item Striping
-¥¹¥È¥é¥¤¥Ô¥ó¥°¤Ï¡¢Ê£¿ô¤Î¥Ç¥£¥¹¥¯¤ËÂФ·¤Æ¡¢¤Þ¤º¥Ç¡¼¥¿¤ÎºÇ½é¤Î¥Ö¥í¥Ã¥¯¤ò
-1ÈÖÌܤΠdisk ¤Ë½ñ¤­¡¢2ÈÖÌܤΥ֥í¥Ã¥¯¤ò2¤ÄÌܤÎdisk¤Ë½ñ¤­¡¢½ç¼¡ N ÈÖÌÜ
-(N ¤Ï disk ¤Î¿ô) ¤Þ¤Ç½ç¤Ë½ñ¤¤¤Æ¤¤¤­¤Þ¤¹¡£ ¤³¤ì¤Ï¡¢¤â¤·¥Ç¡¼¥¿¤¬¥¹¥È¥é¥¤¥×¤Î
-¥µ¥¤¥º¤è¤ê¤â¾®¤µ¤±¤ì¤Ð¡¢¤è¤ê¤è¤¤¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤òÆÀ¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
-¥¹¥È¥é¥¤¥Ô¥ó¥°¤Ï¡¢OS ¤ä ¥¹¥È¥é¥¤¥×¤Î¥µ¥¤¥º¤Ë¤È¤Æ¤â°Í¸¤·¤Æ¤¤¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-¤½¤Î¤¿¤á¡¢¤¢¤Ê¤¿¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¥Ù¥ó¥Á¥Þ¡¼¥¯¤¬¥¹¥È¥é¥¤¥×¥µ¥¤¥º¤Ë¤è¤Ã¤Æ
-ÊѤï¤ë¤Ç¤·¤ç¤¦¡£ @xref{Benchmarks}.
-
-¥¹¥È¥é¥¤¥Ô¥ó¥°¤Î¥¹¥Ô¡¼¥É¤Î°ã¤¤¤Ï¡¢@strong{¤È¤Æ¤â} ¥Ñ¥é¥á¥¿¡¼¤Ë°Í¸¤·¤Æ¤¤¤Þ¤¹¡£
-Depending on how you set the striping parameters and
-number of disks you may get difference in orders of magnitude. Note that
-you have to choose to optimize for random or sequential access.
-@end table
-@item
-¿®ÍêÀ­¤Î¤¿¤á¡¢¤¢¤Ê¤¿¤Ï RAID 0+1 (striping + mirroring) ¤ò»ÈÍѤ·¤¿¤¤¤È
-»×¤¦¤«¤â¤·¤ì¤Þ¤»¤ó¡£ ¤·¤«¤·¤³¤ì¤Ï N ¸Ä¤Î¥É¥é¥¤¥Ö¤Î¥Ç¡¼¥¿¤ò¼ý¤á¤ë¤Î¤Ë
-2*N ¸Ä¤Î¥É¥é¥¤¥Ö¤¬É¬ÍפȤʤê¤Þ¤¹¡£
-¤³¤ì¤Ï¤â¤·»ñ¶â¤¬¤¢¤ë¤Ê¤é¤Ð°ìÈ֤褤ÊýË¡¤Ç¤·¤ç¤¦¡ª ¤·¤«¤·¡¢Ç½Î¨Åª¤Ë¤½¤ì¤ò
-¼è¤ê°·¤¦¤¿¤á¤Ë¡¢¥Ü¥ê¥å¡¼¥à¡¦¥Þ¥Í¡¼¥¸¥á¥ó¥È¡¦¥½¥Õ¥È¥¦¥§¥¢¤ËÅê»ñ¤¹¤ëɬÍפ¬
-¤¢¤Ã¤Æ¤â¤è¤¤¤Ç¤¹¡£
-@item
-A good option is to have semi-important data (that can be re-generated)
-on RAID 0 disk while store really important data (like host information
-and logs) on a RAID 0+1 or RAID N disks. RAID N can be a problem if you
-have many writes because of the time to update the parity bits.
-@item
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë»ÈÍѤ·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Î mount ¥Ñ¥é¥á¥¿¡¼¤òÊѹ¹¤·¤Æ¤â
-Îɤ¤¤Ç¤·¤ç¤¦¡£ °ì¤Ä¤Î´Êñ¤ÊÊýË¡¤È¤·¤Æ¤Ï¡¢noatime ¥ª¥×¥·¥ç¥ó¤Ç¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò
-¥Þ¥¦¥ó¥È¤·¤Þ¤¹¡£ ¤³¤ì¤Ï inode ¤Ë¤¢¤ëºÇ¸å¤Ë¥¢¥¯¥»¥¹¤·¤¿»þ´Ö¤Î¹¹¿·¤ò
-¥¹¥­¥Ã¥×¤·¤Þ¤¹¡£ ¤³¤ì¤Ç¤¤¤¯¤é¤« ¥Ç¥£¥¹¥¯¥·¡¼¥¯¤òÈò¤±¤ë¤³¤È¤¬¤Ç¤­¤ë¤Ç¤·¤ç¤¦¡£
-@end itemize
-
-@menu
-* Symbolic links:: Using symbolic links for databases and tables
-@end menu
-
-@node Symbolic links, , Disk issues, Disk issues
-@subsubsection ¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¥Æ¡¼¥Ö¥ë¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤ò»ÈÍѤ¹¤ë
-
-¥Æ¡¼¥Ö¥ë¤È¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Õ¥¡¥¤¥ë¤ò MySQL ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¡¼¤«¤é
-°ã¤¦¾ì½ê¤Ë°ÜÆ°¤·¡¢ ¤½¤ì¤ËÂФ·¤Æ¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òÄ¥¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¤³¤ì¤ÏÎ㤨¤Ð¥Ç¥£¥¹¥¯ÍÆÎ̤¬¾¯¤Ê¤¯¤Ê¤Ã¤Æ¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò°ÜÆ°¤·¤¿¤¤¾ì¹ç¤Ë¤½¤¦¤·¤¿¤¯¤Ê¤ë¤Ç¤·¤ç¤¦¡£
-
-@strong{MySQL} ¤¬¡¢¥Æ¡¼¥Ö¥ë¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¢¤ë¤³¤È¤Ëµ¤¤Å¤¤¤¿¾ì¹ç¡¢
-symlink ¤ò²òÀϤ·¡¢Âå¤ï¤ê¤Ë¤½¤Î¼ÂÂΤΥơ¼¥Ö¥ë¤ò»ÈÍѤ·¤Þ¤¹¡£
-¤³¤ì¤Ï @code{realpath()} ¥³¡¼¥ë¤ò¥µ¥Ý¡¼¥È¤¹¤ëÁ´¤Æ¤Î¥·¥¹¥Æ¥à¤ÇƯ¤­¤Þ¤¹¡Ê¾¯
-¤Ê¤¯¤È¤â Linux ¤È Solaris ¤Ï @code{realpath()} ¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡ª¡Ë¡£
-@code{realpath()} ¤ò¥µ¥Ý¡¼ ¥È¤·¤Ê¤¤¥·¥¹¥Æ¥à¾å¤Ç¤Ï¡¢symlink ¤È¥Æ¡¼¥Ö¥ë¤ò
-Ʊ»þ¤Ë»ÈÍѤ¹¤Ù¤­¤Ç¤¢¤ê¤Þ¤»¤ó¡ª ¥Æ¡¼¥Ö¥ë¤Ï¥Æ¡¼¥Ö¥ë¤Î¹¹¿·¸å¤ËÌ·½â¤¹¤ë»ö¤Ë¤Ê¤ë¤Ç¤·¤ç¤¦¡£
-
-@strong{MySQL} ¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹Æ±»Î¤Î¥ê¥ó¥¯¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤»¤ó¡£
-¤¬¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹´Ö¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òºîÀ®¤·¤Ê¤¤¸Â¤ê¡¢¤³¤ì¤ÏÀµ¾ï¤ËƯ¤¯¤Ç¤·¤ç¤¦¡£
-@strong{MySQL} ¥Ç¡¼¥¿¥Ç¥£¥ì¥¯¥È¥ê¤Ë @code{db1} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬¤¢¤ë¤È¤·¤Æ¡¢
-²¾¤Ë @code{db2} ¤ò @code{db1} ¤Î¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ë¤·¤¿¤È¤·¤Þ¤¹:
-
-@example
-shell> cd /path/to/datadir
-shell> ln -s db1 db2
-@end example
-
-¤¹¤ë¤È¡¢@code{db1} Ãæ¤Î @code{tbl_a} ¥Æ¡¼¥Ö¥ë¤Ï @code{db2} ¤Î @code{tbl_a} ¥Æ¡¼¥Ö¥ë¤È¤·¤Æ¸«¤¨¤Þ¤¹¡£
-¤â¤·¤¢¤ë¥¹¥ì¥Ã¥É¤¬ @code{db1.tbl_a} ¤ò¹¹¿·¤·¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤¬ @code{db2.tbl_a} ¤ò
-¹¹¿·¤·¤¿¾ì¹ç¡¢ ÌäÂ꤬ȯÀ¸¤·¤Þ¤¹¡£
-
-¤³¤¦¤¤¤Ã¤¿»ÈÍѤò¤É¤¦¤·¤Æ¤â¤·¤¿¤¤¾ì¹ç¡¢@file{mysys/mf_format.c} ¤ò°Ê²¼¤Î¤è¤¦¤ËÊѹ¹¤·¤Þ¤¹:
-
-@example
-if (!lstat(to,&stat_buff)) /* Check if it's a symbolic link */
- if (S_ISLNK(stat_buff.st_mode) && realpath(to,buff))
-@end example
-
-Change the code to this:
-
-@example
-if (realpath(to,buff))
-@end example
-
-@cindex Startup parameters
-@node Server parameters, Table cache, Disk issues, System
-@subsection ¥µ¡¼¥Ð¡¼¥Ñ¥é¥á¡¼¥¿¡¼¤Î¥Á¥å¡¼¥Ë¥ó¥°
-
-@code{mysqld} ¥µ¡¼¥Ð¡¼¤¬»ÈÍѤ·¤Æ¤¤¤ë¸½ºß¤Î¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤ò¼¡¤ÇÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹:
-
-@example
-shell> mysqld --help
-@end example
-
-¤³¤Î·ë²Ì¡¢Á´¤Æ¤Î @code{mysqld} ¥ª¥×¥·¥ç¥ó¤È¼¡¤Î¤è¤¦¤Ê¥³¥ó¥Õ¥£¥°²ÄǽÊÑ¿ô¤Î¥ê¥¹¥È
-¤òÆÀ¤é¤ì¤Þ¤¹¡£½ÐÎÏ·ë²Ì¤Ë¤Ï¥Ç¥Õ¥©¥ë¥ÈÃͤ¬´Þ¤Þ¤ì¡¢°Ê²¼¤Î¤è¤¦¤Ëɽ¼¨¤µ¤ì¤Þ¤¹:
-
-@example
-Possible variables for option --set-variable (-O) are:
-back_log current value: 5
-connect_timeout current value: 5
-delayed_insert_timeout current value: 300
-delayed_insert_limit current value: 100
-delayed_queue_size current value: 1000
-flush_time current value: 0
-interactive_timeout current value: 28800
-join_buffer_size current value: 131072
-key_buffer_size current value: 1048540
-lower_case_table_names current value: 0
-long_query_time current value: 10
-max_allowed_packet current value: 1048576
-max_connections current value: 100
-max_connect_errors current value: 10
-max_delayed_threads current value: 20
-max_heap_table_size current value: 16777216
-max_join_size current value: 4294967295
-max_sort_length current value: 1024
-max_tmp_tables current value: 32
-max_write_lock_count current value: 4294967295
-net_buffer_length current value: 16384
-query_buffer_size current value: 0
-record_buffer current value: 131072
-sort_buffer current value: 2097116
-table_cache current value: 64
-thread_concurrency current value: 10
-tmp_table_size current value: 1048576
-thread_stack current value: 131072
-wait_timeout current value: 28800
-@end example
-
-¤â¤· @code{mysqld} ¥µ¡¼¥Ð¡¼¤òÁö¤é¤»¤Æ¤¤¤ë¤Ê¤é¡¢°Ê²¼¤Î¥³¥Þ¥ó¥É¤Ç¤âÊÑ¿ô¤ÎÃͤò¸«¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹:
-
-@example
-shell> mysqladmin variables
-@end example
-
-¤³¤ì¤é¤Î¥ª¥×¥·¥ç¥ó¤Ï°Ê²¼¤Î¤è¤¦¤Ë·è¤á¤Æ¤¯¤À¤µ¤¤¡£
-buffer size, buffer length, stack size ¤Ï byte ñ°Ì¤ÇÍ¿¤¨¤Þ¤¹¡£
-¤³¤ì¤é¤ÎÃͤθå¤í¤Ë @samp{K} ¤ä @samp{M} ¤òÄɲ乤ë¤È¡¢¥­¥í¥Ð¥¤¥È¡¢¥á¥¬¥Ð¥¤¥È¤Ë¤Ê¤ê¤Þ¤¹¡£
-Î㤨¤Ð¡¢@code{16M} ¤Ï16¥á¥¬¥Ð¥¤¥È¤ò¼¨¤·¤Þ¤¹¡£Âçʸ»ú¾®Ê¸»ú¤Î¶èÊ̤Ϥʤ¯¡¢
-@code{16M} ¤È @code{16m} ¤ÏƱ¤¸°ÕÌ£¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-²ÔƯÃæ¤Î¥µ¡¼¥Ð¡¼¤ÎÅý·×¾ðÊó¤Ï @code{SHOW STATUS} ¤Ç»²¾È¤Ç¤­¤Þ¤¹. @xref{SHOW}.
-
-@table @code
-@item @code{ansi_mode}.
-¤â¤· @code{mysqld} ¤¬ @code{--ansi} ¥ª¥×¥·¥ç¥ó¤Çµ¯Æ°¤µ¤ì¤Æ¤¤¤ë¤Ê¤é¡¢@code{ON}.
-@xref{Ansi mode}.
-
-@item @code{back_log}
-@strong{MySQL} ¤¬»ý¤Æ¤ë̤²ò·è¤ÎÀܳÍ×µá¤Î¿ô¤Ç¤¹¡£¤³¤ì¤Ï @strong{MySQL}
-¥¹¥ì¥Ã¥É¤¬@strong{¤â¤Î¤¹¤´¤¯}¿¤¯¤ÎÀܳÍ×µá¤ò¤È¤Æ¤âû¤¤»þ´Ö¤ËÆÀ¤¿»þ¤Ë¡¢Æ¯¤­
-¤Þ¤¹¡£Àܳ¤Î¥Á¥§¥Ã¥¯¤È¿·¤·¤¤¥¹¥ì¥Ã¥É¤Î³«»Ï¤Ï¥á¥¤¥ó¥¹¥ì¥Ã¥É¤Ë¤¹¤³¤·»þ´Ö
-(¤·¤«¤·¤Û¤ó¤Î¤ï¤º¤«)¤¬¤«¤«¤ê¤Þ¤¹¡£back_log ¤Ï¡¢@strong{MySQL} ¤¬½Ö´ÖŪ¤Ë¿·
-¤·¤¤Í×µá¤Ø¤Î²óÅú¤òÄä»ß¤¹¤ëÁ°¤Ë¡¢¤³¤Îû¤¤»þ´Ö¤Î´Ö¤Ë¥¹¥¿¥Ã¥¯¤Ç¤­¤ëÀܳ¿ô¤Ç¤¹¡£
-û¤¤´ü´Ö¤Ë¿¤¯¤ÎÀܳ¤ò´üÂÔ¤¹¤ë¾ì¹ç¤Ë¤À¤±¡¢¤³¤ì¤òÁý²Ã¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-¤¤¤¤¤«¤¨¤ë¤Ê¤é¡¢¤³¤ì¤Ï TCP/IP Àܳ¤ÎÆþÎÏ listen ¥­¥å¡¼¤Î¥µ¥¤¥º¤Ç¤¹¡£
-¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Ï¤³¤Î¥­¥å¡¼¤ÎÂ礭¤µ¤òÀ©¸Â¤·¤Æ¤¤¤Þ¤¹¡£
-UNIX ¥·¥¹¥Æ¥à¥³¡¼¥ë @code{listen(2)} ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë¡¢¤µ¤é¤Ë¾ÜºÙ¤¬¤¢¤ê¤Þ¤¹¡£
-¤³¤ÎÃͤòºÇÂç¸Â¤Ë¤·¤¿¤¤¾ì¹ç¡¢¤ª»È¤¤¤ÎOS¤Î¥É¥­¥å¥á¥ó¥È¤ò¸«¤Æ¤¯¤À¤µ¤¤¡£
-@code{back_log} ¤ò¤³¤ÎOS¤ÎÀ©¸ÂÃͤè¤ê¿¤¯¼è¤Ã¤Æ¤â¤ÏÁ´¤¯¸ú²Ì¤¢¤ê¤Þ¤»¤ó¡£
-
-@item @code{thread_cache_size}
-How many threads we should keep keep in a cache for reuse. When a
-client disconnects the clients threads is put in the cache if there
-isn't more than @code{thread_cache_size} threads from before. All new
-threads are first taken from the cache and only when the cache is empty
-a new thread is created. This variable can be increased to improve
-performance if you have a lot of new connections (Normally this doesn't
-however give a notable performance improvement if you have a good
-thread implementation).
-
-@item @code{concurrent_inserts}
-¤â¤· @code{ON} (¤³¤ì¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤¹) ¤Ê¤é¡¢@code{MySQL} ¤Ï¡¢
-@code{SELECT} ¥¯¥¨¥ê¤¬¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë @code{MyISAM} ¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ¡¢
-Ʊ»þ¤Ë @code{INSERT} ¤¬»ÈÍѤǤ­¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
-¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï @code{mysqld} ¤Î¥ª¥×¥·¥ç¥ó¤Ë @code{--safe} ¤« @code{--skip-new} ¤ò
-»ØÄꤹ¤ë¤³¤È¤Ç @code{OFF} ¤Ë¤Ç¤­¤Þ¤¹¡£
-
-@item @code{connect_timeout}
-@code{mysqld} ¥µ¡¼¥Ð¡¼¤¬Àܳ¥Ñ¥±¥Ã¥È¤òÂÔ¤ÄÉÿô¡£ (@code{Bad handshake} ¤òÊÖ¤¹¤Þ¤Ç¤ÎÉÿô)
-
-@item @code{delayed_insert_timeout}
-¤É¤ì¤°¤é¤¤ @code{INSERT DELAYED} ¥¹¥ì¥Ã¥É¤¬ @code{INSERT} ʸ¤òÂԤĤ٤­¤«¡£
-
-@item @code{delayed_insert_limit}
-@code{delayed_insert_limit} ¸Ä¤Î¥ì¥³¡¼¥É¤òÁÞÆþ¤·¤¿¸å¡¢ @code{INSERT DELAYED} ¥Ï¥ó¥É¥é¡¼¤Ï
-ÂÔ¤¿¤µ¤ì¤Æ¤¤¤ë @code{SELECT} ʸ¤¬¤Ê¤¤¤«¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£ ¤â¤·¤¢¤ë¤Ê¤é¡¢
-ÁÞÆþ¤ò³¤±¤ëÁ°¤Ë¤½¤ì¤é¤Î¼Â¹Ô¤òµö¤·¤Þ¤¹¡£
-
-@item @code{delay_key_write}
-¤â¤· enabled ¤Ç¤¢¤ì¤Ð(¤³¤ì¤¬¥Ç¥Õ¥©¥ë¥È)¡¢@strong{MySQL} ¤Ï @code{CREATE TABLE} ʸ¤Î
-@code{DELAY_KEY_WRITE} ¥ª¥×¥·¥ç¥ó¤òº½Å¤·¤Þ¤¹¡£
-@code{DELAY_KEY_WRITE}¥ª¥×¥·¥ç¥ó¤ò»ØÄꤵ¤ì¤Æºî¤é¤ì¤¿¥Æ¡¼¥Ö¥ë¤Î¥­¡¼¥Ð¥Ã¥Õ¥¡¤Ï¡¢
-Ëè²ó¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î¹¹¿·¤Ë¤Ï¥Õ¥é¥Ã¥·¥å¤µ¤ì¤º¡¢¤¿¤À¥Æ¡¼¥Ö¥ë¤¬ÊĤ¸¤é¤ì¤¿¤È¤­¤Ë¤À¤±
-¥Õ¥é¥Ã¥·¥å¤µ¤ì¤Þ¤¹¡£ ¤³¤ì¤Ï¥­¡¼¤Î½ñ¤­½Ð¤·¤ò®¤¯¤·¤Þ¤¹¤¬¡¢¤â¤·¤³¤ì¤ò»ÈÍѤ¹¤ë¤Ê¤é¡¢
-Á´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤ò @code{myisamchk --fast --force} ¤Ç¼«Æ°Åª¤Ë¸¡ºº¤¹¤ë¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¹¡£
-¤â¤· @code{mysqld} ¤ò @code{--delay-key-write_for_all_tables} ¥ª¥×¥·¥ç¥óÉÕ¤­¤Ç
-µ¯Æ°¤·¤¿¾ì¹ç¡¢¤³¤ì¤Ï¡¢Á´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤¬ @code{delay_key_write} ¥ª¥×¥·¥ç¥ó»ØÄꤵ¤ì¤Æ
-ºîÀ®¤µ¤ì¤¿¤â¤Î¤È¤·¤Æ°·¤ï¤ì¤ë»ö¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-¤³¤Î¥Õ¥é¥°¤Ï¡¢@code{mysqld} ¤ò @code{--skip-new} ¤ä @code{--safe-mode} ¥ª¥×¥·¥ç¥ó
-¤Çµ¯Æ°¤¹¤ì¤Ð̵¸ú¤Ë¤¹¤ë¤³¤È¤â½ÐÍè¤Þ¤¹¡£
-
-@item @code{delayed_queue_size}
-What size queue (in rows) should be allocated for handling @code{INSERT
-DELAYED}. If the queue becomes full, any client that does @code{INSERT
-DELAYED} will wait until there is room in the queue again.
-
-@item @code{flush_time}
-¤³¤ì¤¬¤â¤·¡¢Èó¥¼¥í¤Ë¥»¥Ã¥È¤µ¤ì¤¿¤Ê¤é¡¢Ëè @code{flush_time} É䴤ȤË
-Á´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤¬ÊĤ¸¤é¤ì¤Þ¤¹¡£ (¥ê¥½¡¼¥¹¤Î²òÊü¤ÈDisk¤Ø¤Îsync¤Î¤¿¤á¤Ë)
-
-@item @code{init_file}
-¥µ¡¼¥Ð¡¼µ¯Æ°»þ¤Ë¡¢@code{--init-file} ¥ª¥×¥·¥ç¥ó¤ËÍ¿¤¨¤¿¥Õ¥¡¥¤¥ë¤Î̾Á°¤Ç¤¹¡£
-¤³¤Î¥Õ¥¡¥¤¥ë¤Ë¤Ï¡¢¥µ¡¼¥Ð¡¼µ¯Æ°»þ¤Ë¼Â¹Ô¤·¤¿¤¤ SQL ʸ¤ò½ñ¤¤¤Æ¤ª¤­¤Þ¤¹¡£
-
-@item @code{interactive_timeout}
-The number of seconds the server waits for activity on an interactive
-connection before closing it. ¥¤¥ó¥¿¥é¥¯¥Æ¥£¥Ö ¥¯¥é¥¤¥¢¥ó¥È¤òºî¤ë¤Ë¤Ï¡¢
-C API @code{mysql_real_connect()} ¤Ë @code{CLIENT_INTERACTIVE} ¥ª¥×¥·¥ç¥ó¤ò
-¥»¥Ã¥È¤·¤Þ¤¹¡£ See also @code{wait_timeout}.
-
-@item @code{join_buffer_size}
-¤³¤Î¥Ð¥Ã¥Õ¥¡¤Ï(¥¤¥ó¥Ç¥Ã¥¯¥¹Ìµ¤·¤Î)´°Á´¤Ê·ë¹ç¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£¤½¤ì¤Ï2¤Ä¤Î
-¥Æ¡¼¥Ö¥ë´Ö¤Î´°Á´¤Ê·ë¹ç¤´¤È¤Ë1²ó³ä¤êÅö¤Æ¤é¤ì¤Þ¤¹¡£¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎÄɲ䬤Ç
-¤­¤Ê¤¤»þ¡¢¤è¤ê®¤¤´°Á´¤Ê·ë¹ç¤òÆÀ¤ë¤¿¤á¤Ë¡¢¤³¤ì¤òÁý²Ã¤·¤Æ¤¯¤À¤µ¤¤¡£Ä̾
-®¤¤·ë¹ç¤òÆÀ¤ë°ìÈÖÎɤ¤ÊýË¡¤Ï¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÄɲ乤뤳¤È¤Ç¤¹¡£
-
-@c Make texi2html support index @anchor{Index cache size}. Then change
-@c some xrefs to point here
-@item @code{key_buffer_size}
-¥¤¥ó¥Ç¥Ã¥¯¥¹¡¦¥Ö¥í¥Ã¥¯¤Ï¥Ð¥Ã¥Õ¥¡¤µ¤ì¡¢¤½¤·¤ÆÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤Ë¶¦Í­¤µ¤ì¤Þ¤¹¡£
-@code{key_buffer_size} ¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹¡¦¥Ö¥í¥Ã¥¯¤Î¤¿¤á¤Î¥Ð¥Ã¥Õ¥¡¡¦¥µ¥¤¥º¤Ç¤¹¡£
-
-Increase this to get better index handling (for all reads and multiple
-writes) to as much as you can afford; 64M on a 256M machine that mainly
-runs @strong{MySQL} is quite common. If you however make this too big
-(more than 50 % of your total memory?) your system may start to page
-and become REALLY slow. Remember that because @strong{MySQL} does not cache data
-read, that you will have to leave some room for the OS filesystem cache.
-
-You can check the performance of the key buffer by doing @code{show
-status} and examine the variables @code{Key_read_requests},
-@code{Key_reads}, @code{Key_write_requests} and @code{Key_writes}. The
-@code{Key_reads/Key_read_request} ratio should normally be < 0.01.
-The @code{Key_write/Key_write_requests} is usually near 1 if you are
-using mostly updates/deletes but may be much smaller if you tend to
-do updates that affect a lot of rows at the same time or if you are
-using @code{delay_key_write}. @xref{SHOW}.
-
-To get even more speed when writing many rows at the same time use
-@code{LOCK TABLES}. @xref{LOCK TABLES, , @code{LOCK TABLES}}.
-
-@item @code{lower_case_table_names}
-Change all table names to lower case on disk.
-
-@item @code{long_query_time}
-¤â¤·¤¢¤ë¥¯¥¨¥ê¤¬¤³¤ÎÃÍ(ÉÃ)¤è¤ê»þ´Ö¤¬¤«¤«¤ì¤Ð¡¢@code{Slow_queries} ¥«¥¦¥ó¥¿¡¼
-¤¬Áý¤ä¤µ¤ì¤Þ¤¹¡£
-
-@item @code{max_allowed_packet}
-°ì¤Ä¤Î¥Ñ¥±¥Ã¥È¤ÎºÇÂ祵¥¤¥º¡£¥á¥Ã¥»¡¼¥¸¥Ð¥Ã¥Õ¥¡¤Ï @code{net_buffer_length} ¥Ð¥¤¥È¤Ë½é´ü²½¤µ¤ì¤Þ¤¹¤¬¡¢
-@code{max_allowed_packet}¤Þ¤ÇÂ礭¤¯¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤Î¥Ç¥Õ¥©¥ë¥ÈÃͤϡ¢
-Â礭¤Ê¥Ñ¥±¥Ã¥È¡¢´Ö°ã¤Ã¤¿¥Ñ¥±¥Ã¥È¤ò¤ò¼õ¤±¤ë¤Ë¤Ï¾®¤µ¤¤ÃͤǤ¹¡£
-Â礭¤Ê @code{BLOB} ¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¤³¤ì¤òÁý²Ã¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£»ÈÍѤ·¤¿
-¤¤ºÇÂç¤Î @code{BLOB} ¤ÈƱ¤¸¤¯¤é¤¤Â礭¤¯¤¹¤ë¤Ù¤­¤Ç¤¹¡£
-
-@item @code{max_connections}
-µö¤µ¤ì¤ëƱ»þ¥¯¥é¥¤¥¢¥ó¥È¤Î¿ô¡£¤³¤ì¤òÁý²Ã¤¹¤ë¾ì¹ç¤Ï¡¢@code{mysqld} ¤¬»ý¤Ä¥Õ¥¡¥¤
-¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¿ô¤òÁý¤ä¤¹É¬Íפ¬¤¢¤ë¤Ç¤·¤ç¤¦¡£
-¸å½Ò¤Î¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¡¼¤ÎÀ©¸Â¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£ @xref{Too many connections}.
-
-@item @code{max_connect_errors}
-¤â¤·¤¢¤ë¥Û¥¹¥È¤«¤é¤ÎÀܳÃæÃǤ¬¤³¤ÎÃͤò°Ê¾å¤Ë¤Ê¤Ã¤¿¾ì¹ç¡¢¤³¤ì°Ê¸å¡¢
-¤½¤Î¥Û¥¹¥È¤«¤é¤ÎÀܳ¤òµñÀ䤷¤Þ¤¹¡£@code{FLUSH HOSTS} ¥³¥Þ¥ó¥É¤Ç
-¥Û¥¹¥È¤ÎµñÈݤò²ò½ü¤Ç¤­¤Þ¤¹¡£
-
-@item @code{max_delayed_threads}
-¤³¤ÎÃͤòĶ¤¨¤Æ @code{INSERT DELAYED} ¤ò°·¤¦¥¹¥ì¥Ã¥É¤òµ¯Æ°¤Ç¤­¤Þ¤»¤ó¡£
-¤â¤·Á´¤Æ¤Î @code{INSERT DELAYED} ¥¹¥ì¥Ã¥É¤¬»ÈÍѤµ¤ì¤Æ¤¤¤Æ¡¢¤µ¤é¤Ë¿·¤·¤¤¥Æ¡¼¥Ö¥ë¤Ë
-¥Ç¡¼¥¿¤òÁÞÆþ¤·¤è¤¦¤È¤¹¤ë¤È¡¢¤½¤Î¥ì¥³¡¼¥É¤Ï @code{DELAYED} ¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤¤
-¾ì¹ç¤ÈƱÍͤËÁÞÆþ¤µ¤ì¤Þ¤¹¡£
-
-@item @code{max_join_size}
-@code{max_join_size} ¤è¤ê¿¤¤¥ì¥³¡¼¥É¤ò¿¨¤ë¤È¥¨¥é¡¼¤¬ÊÖ¤ê¤Þ¤¹¡£Ä¹¤¤»þ´Ö¤ò¤«¤±¤Æ
-É´Ëü¹Ô¤òÊÖ¤¹¤è¤¦¤Ê @code{WHERE} ¤Ê¤·¤Î·ë¹ç¤òºîÀ®¤¹¤ë¤è¤¦¤Ê¥æ¡¼¥¶¤ò»ý¤Ã¤Æ
-¤¤¤ë¾ì¹ç¤Ë¤³¤ì¤òÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£
-
-@item @code{max_heap_table_size}
-Don't allow creation of heap tables bigger than this.
-
-@item @code{max_sort_length}
-@code{BLOB} ¤Þ¤¿¤Ï @code{TEXT} ¹àÌܾå¤Ç¥½¡¼¥È¤¹¤ë»þ¤Ë»ÈÍѤ¹¤ë¥Ð¥¤¥È¿ô¡£
-(ºÇ½é¤Î @code{max_sort_length} ¥Ð¥¤¥È¤À¤±¤¬¤½¤ì¤¾¤ì¤ÎÃͤǻÈÍѤǤ­¡¢»Ä¤ê¤Ï̵»ë¤µ¤ì¤Þ¤¹)
-
-@item @code{max_tmp_tables}
-(¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤Þ¤À¤Ê¤Ë¤â¹Ô¤¤¤Þ¤»¤ó).
-¥¯¥é¥¤¥¢¥ó¥È¤¬Æ±»þ¤Ë¥ª¡¼¥×¥ó¤Ç¤­¤ë¥Æ¡¼¥Ö¥ë¿ô¤ÎºÇÂçÃÍ¡£
-
-@item @code{max_write_lock_count}
-After this many write locks, allow some read locks to run in between.
-
-@item @code{net_buffer_length}
-ÄÌ¿®¥Ð¥Ã¥Õ¥¡¤¬¥¯¥¨¥ê´Ö¤Ç¤³¤Î¥µ¥¤¥º¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤Þ¤¹¡£¤³¤ì¤ÏÄ̾ï¤ÏÊѹ¹¤¹
-¤Ù¤­¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬¡¢¤È¤Æ¤â¾®¤µ¤Ê¥á¥â¥ê¤·¤«¤Ê¤¤¾ì¹ç¤Ï¡¢¤³¤ì¤ò´üÂÔ¤µ¤ì¤ë
-¥¯¥¨¥ê¤Î¥µ¥¤¥º¤ËÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£
-( ¤³¤ì¤Ï¡¢¥¯¥é¥¤¥¢¥ó¥È¤«¤éÁ÷¤é¤ì¤Æ¤¯¤ëSQLʸ¤ÎŤµÊ¬¤¢¤ì¤Ð¤¤¤¤¤Ç¤·¤ç¤¦¡£
-¤â¤·¹½Ê¸¤¬¤³¤ÎÃͤò¤³¤¨¤¿¾ì¹ç¡¢¥Ð¥Ã¥Õ¥¡¤Ï¼«Æ°Åª¤ËÂ礭¤¯¤Ê¤ê¤Þ¤¹¡£
-¤¿¤À¤· @code{max_allowed_packet} ¥Ð¥¤¥È¤Þ¤Ç¤Ç¤¹)
-
-@item @code{net_retry_count}
-If a read on a communication port is interrupted, retry this many times
-before giving up. This value should be quite high on @code{FreeBSD} as
-internal interrupts is sent to all threads.
-
-@item @code{record_buffer}
-½ç½ø¥¹¥­¥ã¥ó¤ò¹Ô¤¦³Æ¥¹¥ì¥Ã¥É¤¬¡¢¥¹¥­¥ã¥ó¤¹¤ë¥Æ¡¼¥Ö¥ëËè¤Ë¡¢¤³¤Î¥µ¥¤¥º¤Î¥Ð¥Ã
-¥Õ¥¡¤ò³ä¤êÅö¤Æ¤Þ¤¹¡£Â¿¤¯¤Î½ç½ø¥¹¥­¥ã¥ó¤ò¹Ô¤¦¾ì¹ç¤Ï¡¢¤³¤ì¤òÁý²Ã¤µ¤»¤Æ¤¯¤À
-¤µ¤¤¡£
-
-@item @code{query_buffer_size}
-The initial allocation of the query buffer. If most of your queries are
-long (like when inserting blobs), you should increase this!
-
-@item @code{skip_show_databases}
-¤³¤ì¤Ï¡¢ @code{PROCESS_PRIV} ¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¥æ¡¼¥¶¡¼¤¬
- @code{SHOW DATABASES} ¤¹¤ë»ö¤òÁ˻ߤ·¤Þ¤¹¡£ ¤â¤·¡¢Â¾¿Í¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ä
-¥Æ¡¼¥Ö¥ë¤ò¸«¤è¤¦¤È¤¹¤ë¿Í¤¬¤¤¤ë»ö¤ò¡¢¤¢¤Ê¤¿¤¬¿´ÇÛ¤¹¤ë¤Ê¤é¤Ð¡¢
-¤³¤ì¤Ï¥»¥­¥å¥ê¥Æ¥£¤ò¶¯²½¤Ç¤­¤Þ¤¹¡£
-
-@item @code{sort_buffer}
-¥½¡¼¥È¤ò¹Ô¤¦É¬Íפ¬¤¢¤ë³Æ¥¹¥ì¥Ã¥É¤¬¤³¤Î¥µ¥¤¥º¤Î¥Ð¥Ã¥Õ¥¡¤ò³ä¤êÅö¤Æ¤Þ¤¹¡£¤è
-¤ê®¤¤ @code{ORDER BY} ¤Þ¤¿¤Ï @code{GROUP BY} ¤Î¤¿¤á¤Ë¤Ï¤³¤ì¤òÁý¤ä¤·¤Æ¤¯
-¤À¤µ¤¤¡£
-@xref{Temporary files}.
-
-@item @code{table_cache}
-Á´¤Æ¤Î¥¹¥ì¥Ã¥É¤Ë¤Ä¤¤¤Æ¤Î¥ª¡¼¥×¥ó¥Æ¡¼¥Ö¥ë¤Î¿ô¡£¤³¤ì¤òÁý²Ã¤¹¤ë¾ì¹ç¤Ï¡¢
-@code{mysqld}¤¬Í׵᤹¤ë¥ª¡¼¥×¥ó¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Î¿ô¤â
-Áý²Ã¤¹¤ë¤³¤È¤ËÃí°Õ¤·¤Ê¤¤¤È¤¤¤±¤Þ¤»¤ó¡£
-@strong{MySQL} ¤Ï¥æ¥Ë¡¼¥¯¥Æ¡¼¥Ö¥ëËè¤Ë2¤Ä¤Î¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤òɬÍפÈ
-¤·¤Þ¤¹¡£
-¸å½Ò¤Î¥Õ¥¡¥¤¥ë¥Ç¥¹¥¯¥ê¥×¥¿¡¼¤ÎÀ©¸Â¤ÎÀâÌÀ¤ò»²¾È¤Î¤³¤È¡£
-You can check if you
-need to increase the table cache by checking the @code{Opened_tables}
-variable. @xref{SHOW}. If this variable is big and you don't do
-@code{FLUSH TABLES} a lot (which just forces all tables to be closed and
-reopenend), then you should increase the value of this variable.
-
-¥Æ¡¼¥Ö¥ë¥­¥ã¥Ã¥·¥å¤¬¤É¤Î¤è¤¦¤ËƯ¤¯¤«¤Ï¤³¤Á¤é¤ò»²¾È @ref{Table cache}.
-
-@item @code{tmp_table_size}
-¥á¥â¥ê¡¼Æâ¤Î °ì»þ¥Æ¡¼¥Ö¥ë¤¬¤³¤ÎÃͤòĶ¤¨¤è¤¦¤È¤·¤¿¾ì¹ç¡¢@strong{MySQL} ¤Ï
-¼«Æ°Åª¤Ë¡¢¤³¤ì¤ò¡¢disk ¥Ù¡¼¥¹¤Î @code{MyISAM} ¥Æ¡¼¥Ö¥ë¤ËÊÑ´¹¤·¤Þ¤¹¡£
-¿¤¯¤ÎÀè¿ÊŪ¤Ê @code{GROUP BY} ¥¯¥¨¥ê¤ò¹Ô¤¦¾ì¹ç¤Ï¡¢
-¤³¤Î @code{tmp_table_size} ¤òÁý²Ã¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item @code{thread_stack}
-³Æ¥¹¥ì¥Ã¥É¤Î¥¹¥¿¥Ã¥¯¤ÎÂ礭¤µ¡£@code{crash-me} ¤Ë¤è¤Ã¤Æ¸¡½Ð¤µ¤ì¤ë¿¤¯
-¤ÎÀ©¸Â¤¬¤³¤ì¤Ë°Í¸¤·¤Þ¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢Ä̾ï¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤ËÂФ·¤Æ
-½½Ê¬¤È¤Ã¤Æ¤¢¤ê¤Þ¤¹¡£
-@xref{Benchmarks}.
-
-@item @code{wait_timeout}
-¥µ¡¼¥Ð¡¼¤¬¥³¥Í¥¯¥·¥ç¥ó¤òÊĤ¸¤ë¤Þ¤Ç¤Ë¥¢¥¯¥Æ¥£¥Ö¤Ê¥³¥Í¥¯¥·¥ç¥ó¤òÂÔ¤ÄÉÿô¡£
-@code{interactive_timeout} ¤â»²¾È¤Î¤³¤È¡£
-@end table
-
-@strong{MySQL} ¤Ï¤È¤Æ¤â¥¹¥±¡¼¥é¥Ö¥ë¤Ê¥¢¥ë¥´¥ê¥º¥à¤ò»ÈÍѤ·¤Þ¤¹¡£¤½¤Î¤¿¤á
-Ä̾ï¤Ï¤È¤Æ¤â¾¯¤Ê¤¤¥á¥â¥ê¤ÇÆ°ºî¤·¡¢¤Þ¤¿¤è¤êÎɤ¤À­Ç½¤òÆÀ¤ë¤¿¤á¤Ë
-@strong{MySQL} ¤Ë¿¤¯¤Î¥á¥â¥ê¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-When tuning a @strong{MySQL} server, the two most important variables to use
-are @code{key_buffer_size} and @code{table_cache}. You should first feel
-confident that you have these right before trying to change any of the
-other variables.
-
-¿¤¯¤Î¥á¥â¥ê(>=256M)¤È¿¤¯¤Î¥Æ¡¼¥Ö¥ë¤ò»ý¤Ã¤Æ¤¤¤Æ¡¢Å¬Å٤Υ¯¥é¥¤¥¢¥ó¥È¿ô¤ÇºÇÂçÀ­Ç½¤òÆÀ¤¿
-¤¤¾ì¹ç¡¢¼¡¤Î¤è¤¦¤Ê¤â¤Î¤ò»ÈÍѤ·¤Þ¤¹:
-
-@example
-shell> safe_mysqld -O key_buffer=64M -O table_cache=256 \
- -O sort_buffer=4M -O record_buffer=1M &
-@end example
-
-If you have only 128M and only a few tables, but you still do a lot of
-sorting, you can use something like:
-
-@example
-shell> safe_mysqld -O key_buffer=16M -O sort_buffer=1M
-@end example
-
-¿¤¯¤ÎÀܳ¤Ç¾¯¤Ê¤¤¥á¥â¥ê¤·¤«¤Ê¤¤¾ì¹ç¡¢¼¡¤Î¤è¤¦¤Ê¤â¤Î¤ò»ÈÍѤ·¤Þ¤¹:
-
-@example
-shell> safe_mysqld -O key_buffer=512k -O sort_buffer=100k \
- -O record_buffer=100k &
-@end example
-
-or even:
-
-@example
-shell> safe_mysqld -O key_buffer=512k -O sort_buffer=16k \
- -O table_cache=32 -O record_buffer=8k -O net_buffer=1K &
-@end example
-
-¤â¤·¤È¤Æ¤â¿¤¯¤ÎÀܳ¤¬¤¢¤ê¡¢@code{mysqld} ¤¬³ÆÀܳ¤ËÂФ·¤Æ¾¯¤Ê¤¤¥á¥â¥ê¡¼¤Ç
-Æ°ºî¤¹¤ë¤è¤¦¤ËÀßÄꤵ¤ì¤Æ¤¤¤ì¤Ð¡¢¥¹¥ï¥Ã¥×¤ÎÆɤ߽ñ¤­¤Ë¤è¤ë¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤ÎÄã²¼¤¬¤ª¤­¤Þ¤¹¡£
-¤â¤Á¤í¤ó½½Ê¬¤Ê¥á¥â¥ê¡¼¤¬¤¢¤ì¤Ð¡¢Á´¤Æ¤ÎÀܳ¤Ë¤¿¤¤¤·¤Æ @code{mysqld} ¤Î¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹Îɤ¯¤Ê¤ê¤Þ¤¹¡£
-
-@code{mysqld} ¤Ø¤Î¥ª¥×¥·¥ç¥ó¤òÊѹ¹¤¹¤ë¾ì¹ç¡¢¤½¤Î¥µ¡¼¥Ð¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤Ë¤À¤±¤Ë
-Í­¸ú¤Ç¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤Æ²¼¤µ¤¤¡£
-
-¥Ñ¥é¥á¡¼¥¿Êѹ¹¤Î¸ú²Ì¤ò¸«¤ë¤Ë¤Ï¡¢¤³¤Î¤è¤¦¤Ë¤·¤Þ¤¹:
-
-@example
-shell> mysqld -O key_buffer=32m --help
-@end example
-
-@code{--help} ¥ª¥×¥·¥ç¥ó¤ÏºÇ¸å¤Ë¤Ä¤±¤Æ¤¯¤À¤µ¤¤¡£
-¤½¤Î¾¤Î¥ª¥×¥·¥ç¥ó¤ò --help ¤Î¸å¤Ë¤Ä¤±¤ë¤È¡¢¤½¤Î¥ª¥×¥·¥ç¥ó¤ÏÈ¿±Ç¤µ¤ì¤Þ¤»¤ó¡£
-
-@cindex Table cache
-@findex table_cache
-@node Table cache, Creating many tables, Server parameters, System
-@subsection @strong{MySQL} ¤Ï¤É¤Î¤è¤¦¤Ë¥Æ¡¼¥Ö¥ë¤Î¥ª¡¼¥×¥ó & ¥¯¥í¡¼¥º¤ò¹Ô¤Ê¤¦¤«¡©
-
-@code{table_cache} , @code{max_connections} , @code{max_tmp_tables} ¤Ï
-¥µ¡¼¥Ð¡¼¤¬³«¤¤¤¿¾õÂ֤ˤ·¤Æ¤ª¤¯»ö¤¬½ÐÍè¤ë¥Õ¥¡¥¤¥ë¤ÎºÇÂç¿ô¤Ë±Æ¶Á¤·¤Þ¤¹¡£
-¤â¤·¤³¤ì¤é¤ÎÊÑ¿ô¤Î¤¦¤Á¤Î°ì¤Ä¡¢¤¢¤ë¤¤¤ÏÊ£¿ô¤òÁý²Ã¤µ¤»¤ë¤Ê¤é¡¢
-¤¢¤Ê¤¿¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¡¦¥·¥¹¥Æ¥à¤Î¡¢1 ¥×¥í¥»¥¹¤¢¤¿¤ê¤Ë³«¤«¤ì¤ë
- ¥Õ¥¡¥¤¥ë¡¦¥Ç¥¹¥¯¥ê¥×¥¿ ¤ÎºÇÂçÃͤòÁý¤ä¤¹¤³¤È¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¤³¤ÎÀ©¸Â¤òÁý¤ä¤¹¤³¤È¤¬²Äǽ¤Ç¤¹¡£
-¤³¤ì¤ò¤É¤¦¤ä¤Ã¤Æ¹Ô¤¦¤«¤Ï¡¢¤¢¤Ê¤¿¤Î»ÈÍѤ·¤Æ¤¤¤ë OS ¤Î¥É¥­¥å¥á¥ó¥È¤ò¸«¤Æ¤¯¤À¤µ¤¤¡£
-À©¸ÂÃͤÎÊѹ¹ÊýË¡¤Ï¡¢¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Þ¤Á¤Þ¤Á¤À¤«¤é¤Ç¤¹¡£
-
-@code{table_cache} ¤Ï @code{max_connections} ¤Ë´ØÏ¢¤·¤Þ¤¹¡£
-Î㤨¤Ð 200 ¤Î¥³¥Í¥¯¥·¥ç¥ó¤òƱ»þ¤Ë³«¤±¤ë¤Ê¤é¡¢¾¯¤Ê¤¯¤È¤â @code{200 * n} ¤Î
-¥Æ¡¼¥Ö¥ë¡¦¥­¥ã¥Ã¥·¥å¤¬É¬ÍפǤ¹¡£ ¤³¤³¤Ç @code{n} ¤Ï join ¤Ë¤ª¤±¤ë¥Æ¡¼¥Ö¥ë¤Î
-ºÇÂç¿ô¤Ç¤¹¡£
-
-¥ª¡¼¥×¥ó¥Æ¡¼¥Ö¥ë¤Î¥­¥ã¥Ã¥·¥å¤ÏºÇÂç¤Ç @code{table_cache} ¤Þ¤ÇÂ礭¤¯¤Ê¤ê¤Þ¤¹(¥Ç
-¥Õ¥©¥ë¥È¤Ï 64, @code{mysqld} ¤Î¥ª¥×¥·¥ç¥ó @code{-O table_cache=#} ¤ÇÊѹ¹²Äǽ)¡£
-¥­¥ã¥Ã¥·¥å¤¬°ìÇդˤʤäơ¢Â¾¤Î¥¹¥ì¥Ã¥É¤¬¥Æ¡¼¥Ö¥ë¤Î¥ª¡¼¥×¥ó¤ò»î¤ß¤¿»þ¡¢
-¤Þ¤¿¤Ï @code{mysqladmin refresh} @code{mysqladmin flush-tables}
-¤ò»ÈÍѤ·¤¿¾ì¹ç¤ò½ü¤¤¤Æ¡¢¥Æ¡¼¥Ö¥ë¤Ï¥¯¥í¡¼¥º¤µ¤ì¤Þ¤»¤ó¡£
-
-¥­¥ã¥Ã¥·¥å¤¬¤¤¤Ã¤Ñ¤¤¤Ë¤Ê¤Ã¤¿¾ì¹ç¡¢¥µ¡¼¥Ð¡¼¤Ï°Ê²¼¤Î½èÃÖ¤ò¼è¤Ã¤Æ
-¥­¥ã¥Ã¥·¥å¤ò»ÈÍѤǤ­¤ë¤è¤¦¤ËÇÛÃÖ¤·¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-¸½ºß»È¤ï¤ì¤Æ¤¤¤Ê¤¤¥Æ¡¼¥Ö¥ë¤¬²òÊü¤µ¤ì¤Þ¤¹¡£¤â¤Ã¤È¤â»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤¥Æ¡¼¥Ö¥ë¤«¤é¤«¤é½ç¤Ë¡£
-
-@item
-¤â¤·¥­¥ã¥Ã¥·¥å¤¬°ìÇդǥơ¼¥Ö¥ë¤ò²òÊü¤¹¤ë¤³¤È¤¬½ÐÍ褺¡¢¤µ¤é¤Ë¿·¤·¤¤¥Æ¡¼¥Ö¥ë¤Î
-¥ª¡¼¥×¥óÍ׵᤬¤¢¤ë¾ì¹ç¡¢¥­¥ã¥Ã¥·¥å¤Ï°ì»þŪ¤Ê³ÈÄ¥¤òɬÍפȤ·¤Þ¤¹¡£
-
-@item
-¤â¤·¤½¤Î¥­¥ã¥Ã¥·¥å¤¬°ì»þ³ÈÄ¥¤ËÇÛÃÖ¤µ¤ì¤Æ¤¤¤Æ¡¢¤«¤Ä¡¢¥Æ¡¼¥Ö¥ë¤¬»ÈÍѾõÂÖ¤«¤é
-̤»ÈÍѾõÂ֤˰ܹԤ·¤¿¾ì¹ç¡¢¤½¤Î¥Æ¡¼¥Ö¥ë¤ÏÊĤ¸¤é¤ì¡¢¥­¥ã¥Ã¥·¥å¤«¤é²òÊü¤µ¤ì¤Þ¤¹¡£
-@end itemize
-
-¥Æ¡¼¥Ö¥ë¤Ï³ÆƱ»þ¥¢¥¯¥»¥¹¤Ë (ºÆ¤Ó) ¥ª¡¼¥×¥ó¤µ¤ì¤Þ¤¹¡£¤³¤ì¤Ï¡¢Æ±¤¸¥Æ¡¼¥Ö¥ë¤Ç2¤Ä¤Î¥¹¥ì¥Ã
-¥É¤¬¼Â¹Ô¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢¤Þ¤¿¤ÏƱ¤¸¥¯¥¨¥ê¤Ç(@code{AS} ¤Ç)¥Æ¡¼¥Ö¥ë¤ò2²ó¥¢¥¯¥»¥¹
-¤¹¤ë¾ì¹ç¡¢¥Æ¡¼¥Ö¥ë¤Ï2²ó¥ª¡¼¥×¥ó¤¹¤ëɬÍפ¬¤¢¤ë¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£ºÇ½é¤Î¥Æ¡¼¥Ö¥ë¤Î¥ª¡¼
-¥×¥ó¤Ï2¤Ä¤Î¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤ò»ÈÍѤ·¡¢Â³¤¯¥Æ¡¼¥Ö¥ë¤Î³Æ»ÈÍѤÏ1¤Ä¤À¤±¤Î¥Õ¥¡¥¤¥ëµ­½Ò
-»Ò¤ò»ÈÍѤ·¤Þ¤¹¡£
-
-
-@node Creating many tables, Open tables, Table cache, System
-@subsection Drawbacks of creating large numbers of tables in the same database
-
-¤â¤·¤¿¤¯¤µ¤ó¤Î¥Õ¥¡¥¤¥ë¤¬°ì¤Ä¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¾ì¹ç¡¢¥ª¡¼¥×¥ó¡¢¥¯¥í¡¼¥º¡¢
-ºîÀ®Áàºî¤ÏÃÙ¤¯¤Ê¤ë¤Ç¤·¤ç¤¦¡¢ ¤â¤· @code{SELECT} ʸ¤ò¿¤¯¤Î¥Æ¡¼¥Ö¥ë¤ËÂФ·
-¼Â¹Ô¤·¤¿¾ì¹ç¡¢¥Æ¡¼¥Ö¥ë¥­¥ã¥Ã¥·¥å¤¬°ìÇդʤé¤Ð¡¢¤³¤Î¥ª¡¼¥Ð¡¼¥Ø¥Ã¥É¤Ï¿¤¯¤Ê¤ë¤Ç¤·¤ç¤¦¡£
-¤Ê¤¼¤Ê¤é¡¢¤½¤ì¤¾¤ì¤Î¥Æ¡¼¥Ö¥ë¤Ë¤Ä¤­¥ª¡¼¥×¥ó¤·¡¢¥¯¥í¡¼¥º¤·¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¤«¤é¤Ç¤¹¡£
-¤³¤Î¥ª¡¼¥Ð¡¼¥Ø¥Ã¥É¤ò´ËϤ¹¤ë¤Ë¤Ï¡¢¥Æ¡¼¥Ö¥ë¥­¥ã¥Ã¥·¥å¤òÂ礭¤¯¤·¤Þ¤¹¡£
-
-@node Open tables, Memory use, Creating many tables, System
-@subsection ²¿¸Î¤½¤ó¤Ê¤Ë¿¤¯¤Î¥Æ¡¼¥Ö¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë¤Î¤«¡©
-
-@code{mysqladmin status} ¤ò¼Â¹Ô¤¹¤ë¤È¡¢¼¡¤Î¤è¤¦¤Ê¤â¤Î¤¬ÆÀ¤é¤ì¤Þ¤¹:
-
-@example
-Uptime: 426 Running threads: 1 Questions: 11082 Reloads: 1 Open tables: 12
-@end example
-
-³Î¤«¤Ë¤¿¤Ã¤¿6¸Ä¤·¤«¥Æ¡¼¥Ö¥ë¤¬¤Ê¤¤¤Î¤Ë¡¢¤³¤Î¤è¤¦¤Ê·ë²Ì¤¬½Ð¤ë¤Î¤Ç¾¯¡¹¸ÍÏǤï¤ì¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-
-@strong{MySQL} ¤Ï¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Ê¤Î¤Ç¡¢Æ±¤¸¥Æ¡¼¥Ö¥ë¤Ç°ìÅ٤˿¤¯¤Î¥¯¥¨¥ê¤ò»ý¤Æ
-¤Þ¤¹¡£Æ±¤¸¥Õ¥¡¥¤¥ë¾å¤Ç°Û¤Ê¤ë¾õÂÖ¤ò»ý¤Ä2¤Ä¤Î¥¹¥ì¥Ã¥É¤Ç¡¢ÌäÂê¤òºÇ¾®²½¤¹¤ë
-¤¿¤á¡¢Æ±»þ¤ËÆ°ºî¤¹¤ë³Æ¥¹¥ì¥Ã¥É¤Î¤¿¤á¥Æ¡¼¥Ö¥ë¤òºÆ¤Ó¥ª¡¼¥×¥ó¤·¤Þ¤¹¡£¤³¤ì¤Ï¤¤¤¯¤Ä
-¤«¤Î¥á¥â¥ê¤È¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¤Î°ì¤Ä¤Î³ÈÄ¥¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤ò»ÈÍѤ·¤Þ¤¹¡£
-¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤ÏÁ´¤Æ¤Î¥¹¥ì¥Ã¥É´Ö¤Ç¶¦Í­¤µ¤ì¤Þ¤¹¡£
-
-
-@cindex Memory use
-@node Memory use, Internal locking, Open tables, System
-@subsection MySQL ¤Ï¤É¤Î¤è¤¦¤Ë¥á¥â¥ê¤ò»ÈÍѤ¹¤ë¤Î¤«¡©
-
-°Ê²¼¤Ë @code{mysqld} ¥µ¡¼¥Ð¡¼¤¬¤É¤Î¤è¤¦¤Ë¥á¥â¥ê¡¼¤ò»ÈÍѤ¹¤ë¤«¡¢¤¤¤¯¤Ä¤«¼¨¤·¤Þ¤¹¡£
-¥µ¡¼¥Ð¡¼¤ËÍ¿¤¨¤ëÊÑ¿ô̾¤Ï¡¢¥µ¡¼¥Ð¡¼¤Î¥á¥â¥ê¡¼¤Î»ÈÍÑÊý¤Ë´ØÏ¢¤·¤¿Ì¾Á°¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
-
-@itemize @bullet
-@item
-¥­¡¼¥Ð¥Ã¥Õ¥¡ (ÊÑ¿ô @code{key_buffer}) ¤ÏÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤Ç¶¦Í­¤µ¤ì¡¢
-»Ä¤ê¤ÏɬÍ×»þ¤Ë³ä¤êÅö¤Æ¤é¤ì¤Þ¤¹¡£
-@xref{Server parameters}.
-
-@item
-³ÆÀܳ¤Ï¤¤¤¯¤Ä¤«¤Î¥¹¥ì¥Ã¥É¶õ´Ö¤ò»ÈÍѤ·¤Þ¤¹¡¨
-¥¹¥¿¥Ã¥¯ (64K, ÊÑ¿ô @code{thread_stack}), Àܳ¥Ð¥Ã¥Õ¥¡(variable
-@code{net_buffer_length}), ·ë²Ì¥Ð¥Ã¥Õ¥¡(variable
-@code{net_buffer_length})¡£Àܳ¥Ð¥Ã¥Õ¥¡¤È·ë²Ì¥Ð¥Ã¥Õ¥¡¤ÏɬÍפȤʤä¿»þ¡¢
-ưŪ¤ËºÇÂç @code{max_allowed_packet} ¤Þ¤ÇÁý¤¨¤Þ¤¹¡£
-¥¯¥¨¥ê¤¬Áö¤Ã¤Æ¤¤¤ë»þ¡¢¤½¤Î¥¯¥¨¥ê¤Îʸ»ú¤Î¥³¥Ô¡¼¤¬³ä¤êÅö¤Æ¤é¤ì¤Þ¤¹¡£
-
-@item
-Á´¤Æ¤Î¥¹¥ì¥Ã¥É¤ÏƱ¤¸¥Ù¡¼¥¹¥á¥â¥ê¤ò¶¦Í­¤·¤Þ¤¹¡£
-
-@item
-¤Þ¤À memory-mapped ¤ò»ÈÍѤ·¤Æ¤¤¤Þ¤»¤ó (°µ½Ì¥Æ¡¼¥Ö¥ë¤Ï½ü¤­¤Þ¤¹¤¬¡¢¤³¤ì¤ÏÊ̤ÎÏÃ)¡£
-¤³¤ì¤Ï 4GB ¤Î 32bit ¥á¥â¥ê¶õ´Ö¤Ï¿¤¯¤ÎÂ礭¤Ê¥Æ¡¼¥Ö¥ë¤ò°·¤¦¤Ë¤Ï¾®¤µ¤¤¤¿¤á¤Ç¤¹¡£
-64bit ¥¢¥É¥ì¥¹¶õ´Ö¤ò»ý¤Ä¥·¥¹¥Æ¥à¤ò²æ¡¹¤¬¼ê¤ËÆþ¤ì¤¿»þ¡¢²æ¡¹¤Ï mmemory-mapping ¤òÄ̾ï¤Ë¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£
-
-@item
-¥Æ¡¼¥Ö¥ë¤ò±Û¤¨¤Æ½ç¼¡¥¹¥­¥ã¥ó¤ò¹Ô¤Ê¤¦³ÆÍ×µá¤Ï¡¢Æɤ߹þ¤ß¥Ð¥Ã¥Õ¥¡¤ò³ä¤êÅö¤Æ¤Þ¤¹
-(ÊÑ¿ô record_buffer)
-
-@item
-Á´¤Æ¤Î·ë¹ç¤Ï1¥Ñ¥¹¤Ç¹Ô¤Ê¤ï¤ì¡¢Â¿¤¯¤Î·ë¹ç¤Ï°ì»þ¥Æ¡¼¥Ö¥ë¤ò»ÈÍѤ»¤º¤Ë¹Ô¤Ê¤ï
-¤ì¤Þ¤¹¡£Â¿¤¯¤Î°ì»þ¥Æ¡¼¥Ö¥ë¤Ï¥á¥â¥ê¥Ù¡¼¥¹(HEAP)¤Î¥Æ¡¼¥Ö¥ë¤Ç¤¹¡£Â礭¤Ê¥ì¥³¡¼
-¥É¥µ¥¤¥º (= Á´¥Õ¥£¡¼¥ë¥ÉĹ¤Î¹ç·×) ¤ò»ý¤Ä°ì»þ¥Æ¡¼¥Ö¥ë¤Þ¤¿¤Ï¡¢@code{BLOB} ¤ò´Þ¤à
-¥Æ¡¼¥Ö¥ë¤Ï¥Ç¥£¥¹¥¯¾å¤ËÃÖ¤«¤ì¤Þ¤¹¡£
-
-@strong{MySQL} 3.23.2 °ÊÁ°¤Ç¤ÎÌäÂê¤Ï¡¢HEAP ¥Æ¡¼¥Ö¥ë¤¬
-@code{tmp_table_size} ¤Î¥µ¥¤¥º¤ò±Û¤¨¤ë¤È¡¢¥¨¥é¡¼ @code{The table tbl_name is full}
-¤¬½Ð¤ë¤³¤È¤Ç¤¹¡£¾­Íè²æ¡¹¤Ï¡¢É¬Í×»þ¤Ë¥á¥â¥ê (HEAP) ¥Æ¡¼¥Ö¥ë¤ò¥Ç¥£¥¹¥¯¥Ù¡¼
-¥¹ (NISAM) ¥Æ¡¼¥Ö¥ë¤Ë¼«Æ°Åª¤ËÊѹ¹¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢¤³¤ì¤ò½¤Àµ¤·¤Þ¤¹¡£¤³¤Î
-ÌäÂê¤ò²óÈò¤¹¤ë¤¿¤á¡¢@code{mysqld} ¤Ø¤Î @code{tmp_table_size} ¥ª¥×¥·¥ç¥ó¤Þ
-¤¿¤Ï¥¯¥é¥¤¥¢¥ó¥È¦¤Ç SQL ¥ª¥×¥·¥ç¥ó @code{SQL_BIG_TABLES} ¤ÇÁý²Ã¤Ç¤­¤Þ¤¹¡£
-@xref{SET OPTION, , @code{SET OPTION}}.
-@strong{MySQL} 3.20 ¤Ç¤Ï¡¢°ì»þ¥Æ¡¼¥Ö¥ë¤ÎºÇÂ祵¥¤¥º¤Ï
-@code{recordbuffer*16} ¤Ç¤·¤¿¡£¤½¤Î¤¿¤á¡¢¤³¤Î¥Ð¡¼¥¸¥ç¥ó¤ò»ÈÍѤ·¤Æ¤¤¤ë¤È¡¢
-@code{recordbuffer} ¤òÄɲ乤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£ @code{mysqld} ¤ò @code{--big-tables} ¤Ç
-³«»Ï¤¹¤ë¤³¤È¤Ç¡¢¾ï¤Ë°ì»þ¥Æ¡¼¥Ö¥ë¤ò¥Ç¥£¥¹¥¯¾å¤Ë³ÊǼ¤Ç¤­¤Þ¤¹¡£¤·¤«¤·¤³¤ì¤Ï
-¿¤¯¤ÎÊ£»¨¤Ê¥¯¥¨¥ê¤Î®Å٤˱ƶÁ¤·¤Þ¤¹¡£
-
-@item
-¤Û¤È¤ó¤É¤Î¥ê¥¯¥¨¥¹¥È¤Ï¡¢1,2¸Ä¤Î°ì»þ¥Õ¥¡¥¤¥ë¤È¤ï¤º¤«¤Ê¥½¡¼¥È¥Ð¥Ã¥Õ¥¡¤Ø¤Î³ä¤êÅö¤Æ¤ò¹Ô¤¤¤Þ¤¹¡£
-@xref{Temporary files}.
-
-@item
-ÊÑ·Á¤È±é»»»þ¤Ë»ÈÍѤµ¤ì¤ë¤Û¤È¤ó¤ÉÁ´¤Æ¤Î¥á¥â¥ê¤Ï¥í¡¼¥«¥ë¥á¥â¥ê¥¹¥È¥¢Æâ¤Ç¹Ô
-¤Ê¤ï¤ì¤Þ¤¹¡£¾®¤µ¤Ê¹àÌܤËɬÍפȤµ¤ì¤ë¥á¥â¥ê¥ª¡¼¥Ð¡¼¥Ø¥Ã¥É¤Ï¤Ê¤¯¡¢Ä̾ï¤ÎÃÙ
-¤¤¥á¥â¥ê³ä¤êÅö¤Æ/²òÊü¤¬²óÈò¤µ¤ì¤Þ¤¹¡£¥á¥â¥ê¤Ïͽ´ü¤·¤Ê¤¤Â礭¤Êʸ»úÎó¤Ë¤À
-¤±³ä¤êÅö¤Æ¤é¤ì¤Þ¤¹(¤³¤ì¤Ï @code{malloc()} ¤È @code{free()} ¤Ç¹Ô¤Ê¤ï¤ì¤Þ¤¹)¡£
-
-@item
-³Æ¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¤Ï°ìÅÙ¥ª¡¼¥×¥ó¤µ¤ì¡¢¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤Ï³ÆƱ»þ¼Â¹Ô¥¹¥ì¥Ã
-¥ÉËè¤Ë°ìÅÙ¥ª¡¼¥×¥ó¤µ¤ì¤Þ¤¹¡£³ÆƱ»þ¥¹¥ì¥Ã¥É¤Ë¤Ï¡¢¥Æ¡¼¥Ö¥ë¹½Â¤¡¢³Æ¥Õ¥£¡¼¥ë¥É¤Î¹½Â¤¤½¤·
-¤Æ @code{3 * n} ¤Î¥µ¥¤¥º¤Î¥Ð¥Ã¥Õ¥¡¤¬³ä¤êÅö¤Æ¤é¤ì¤Þ¤¹¡£
-( @code{n} ¤Ï @code{BLOB} ·¿¤Î¥Õ¥£¡¼¥ë¥É¤ÎŤµ¤ò´Þ¤á¤Ê¤¤¡¢°ì¥ì¥³¡¼¥É¤ÎºÇÂçŤǤ¹ )
-@code{BLOB} ¤Ï 5 ¤«¤é 8 ¥Ð¥¤¥È + @code{BLOB} ¥Ç¡¼¥¿¤ÎŤµ¤ò»ÈÍѤ·¤Þ¤¹¡£
-
-@item
-@code{BLOB} ¤ò»ý¤Ä³Æ¥Æ¡¼¥Ö¥ë¤Ç¤Ï¡¢¤è¤êÂ礭¤Ê @code{BLOB} ¤ÎÆɤ߹þ¤ß¤Ç¥Ð¥Ã¥Õ¥¡
-¤ÏưŪ¤Ë³ÈÂ礵¤ì¤Þ¤¹¡£¥Æ¡¼¥Ö¥ë¤Î¥¹¥­¥ã¥ó¤ò¤¹¤ë¾ì¹ç¡¢³ä¤êÅö¤Æ¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¤ÏºÇ
-¤âÂ礭¤¤ @code{BLOB} ¤ÈƱ¤¸Â礭¤µ¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-@item
-Á´¤Æ¤Î»ÈÍѤµ¤ì¤Æ¤¤¤ë¥Æ¡¼¥Ö¥ë¤Î¥Æ¡¼¥Ö¥ë¥Ï¥ó¥É¥é¡¼¤Ï¥­¥ã¥Ã¥·¥åÆâ¤ËÊݸ¤µ¤ì¡¢
-FIFO ¤È¤·¤Æ´ÉÍý¤µ¤ì¤Þ¤¹¡£
-Ä̾¥­¥ã¥Ã¥·¥å¤Ï 64 ¸Ä¤Î¥Æ¡¼¥Ö¥ë¤Ç¤¹¡£¥Æ¡¼¥Ö¥ë¤¬ 2 ¤Ä¤Î¼Â¹Ô¤·¤Æ¤¤¤ë¥¹
-¥ì¥Ã¥É¤ÇƱ»þ¤Ë»ÈÍѤµ¤ì¤ë¾ì¹ç¡¢¥­¥ã¥Ã¥·¥åÆâ¤Ë¥Æ¡¼¥Ö¥ë¤Î 2 ¤Ä¤Î¥¨¥ó¥È¥ê¤¬
-¤¢¤ê¤Þ¤¹¡£
-@xref{Table cache}.
-
-@item
-@code{mysqladmin refresh} ¤Ï»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤Á´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤ò¥¯¥í¡¼¥º¤·¡¢
-»ÈÍѤµ¤ì¤Æ¤¤¤ëÁ´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤ò¡¢¼Â¹ÔÃ楹¥ì¥Ã¥É¤¬½ª¤Ã¤¿»þ¤Ë¥¯¥í¡¼¥º¤¹¤ë¤è
-¤¦¤Ë¥Þ¡¼¥¯¤·¤Þ¤¹¡£¤³¤ì¤Ï¿¤¯¤Î»ÈÍÑ¥á¥â¥ê¤ò²òÊü¤¹¤ë¤Î¤ËÍ­¸ú¤Ç¤¹¡£Á´¤Æ¤Î¥í
-¥°¥Õ¥¡¥¤¥ë¤â¥¯¥í¡¼¥º¤ÈºÆ¥ª¡¼¥×¥ó¤µ¤ì¤Þ¤¹¡£
-@end itemize
-
-@strong{mysqld} ¼Â¹Ô»þ¡¢@code{ps} ¤ä¾¤Î¥×¥í¥°¥é¥à¤Ï¡¢¤½¤ì¤¬Â¿¤¯¤Î¥á¥â¥ê
-¤ò»ÈÍѤ·¤Æ¤¤¤ë¤ÈÊó¹ð¤¹¤ë¤Ç¤·¤ç¤¦¡£¤³¤ì¤Ï°Û¤Ê¤Ã¤¿¥á¥â¥ê¥¢¥É¥ì¥¹¾å¤Î¥¹¥ì¥Ã
-¥É¥¹¥¿¥Ã¥¯¤Ë¤è¤Ã¤ÆȯÀ¸¤·¤Þ¤¹¡£Î㤨¤Ð¡¢Solaris ps ¤Ï¥¹¥¿¥Ã¥¯´Ö¤Î̤»ÈÍÑ¥á
-¥â¥ê¤ò»ÈÍÑ¥á¥â¥ê¤È¤·¤Æ·×»»¤·¤Þ¤¹¡£'swap -s' ¤ÇÍ­¸ú¤Ê¥¹¥ï¥Ã¥×¤ò¥Á¥§¥Ã¥¯¤¹
-¤ë¤³¤È¤Ç¤³¤ì¤ò³Î¤«¤á¤é¤ì¤Þ¤¹¡£²æ¡¹¤Ï»ÔÈΤΥá¥â¥ê¥ê¡¼¥¯¸¡½Ð¥×¥í¥°¥é¥à¤Ç
-@code{mysqld} ¤ò¥Æ¥¹¥È¤·¤Þ¤·¤¿¡£¤½¤Î¤¿¤á¡¢¥á¥â¥ê¥ê¡¼¥¯¤ÏÁ´¤¯¤¢¤ê¤Þ¤»¤ó¡£
-
-@node Internal locking, Table locking, Memory use, System
-@subsection @strong{MySQL} ¤Ï¤É¤Î¤è¤¦¤Ë¥Æ¡¼¥Ö¥ë¤ò¥í¥Ã¥¯¤¹¤ë¤«
-
-@strong{MySQL} ¤ÎÁ´¤Æ¤Î¥í¥Ã¥¯¤Ï¥Ç¥Ã¥É¥í¥Ã¥¯¥Õ¥ê¡¼¤Ç¤¹¡£¤³¤ì¤Ï¡¢¾ï¤Ë¥¯¥¨
-¥ê³«»Ï»þ¤Ë°ìÅÙ¥í¥Ã¥¯¤òɬÍפȤ¹¤ëÁ´¤Æ¤òÍ׵ᤷ¡¢¾ï¤ËƱ¤¸½ç¤Ç¥Æ¡¼¥Ö¥ë¤ò¥í¥Ã
-¥¯¤¹¤ë¤³¤È¤Ç´ÉÍý¤µ¤ì¤Þ¤¹¡£
-
-@strong{MySQL} ¤¬»ÈÍѤ¹¤ë @code{WRITE} ¥í¥Ã¥¯¤Ï¼¡¤Î¤è¤¦¤ËƯ¤­¤Þ¤¹:
-
-@itemize @bullet
-@item
-¥Æ¡¼¥Ö¥ë¾å¤Ë¥í¥Ã¥¯¤¬¤Ê¤¤¾ì¹ç write ¥í¥Ã¥¯¤òÃÖ¤­¤Þ¤¹¡£
-@item
-¤½¤¦¤Ç¤Ê¤±¤ì¤Ð write ¥í¥Ã¥¯¥­¥å¡¼¤Ë¥í¥Ã¥¯¤òÃÖ¤­¤Þ¤¹¡£
-@end itemize
-
-@strong{MySQL} ¤Î @code{READ} ¥í¥Ã¥¯¤Ï¼¡¤Î¤è¤¦¤ËÆ°¤­¤Þ¤¹:
-
-@itemize @bullet
-@item
-¥Æ¡¼¥Ö¥ë¾å¤Ë write ¥í¥Ã¥¯¤¬¤Ê¤¤¾ì¹ç read ¥í¥Ã¥¯¤òÃÖ¤­¤Þ¤¹¡£
-@item
-¤½¤¦¤Ç¤Ê¤±¤ì¤Ð read ¥í¥Ã¥¯¥­¥å¡¼¤Ë¥í¥Ã¥¯¤òÃÖ¤­¤Þ¤¹¡£
-@end itemize
-
-¥í¥Ã¥¯¤¬²òÊü¤µ¤ì¤¿¤È¤­¡¢ºÇ½é¤Ë write ¥í¥Ã¥¯¥­¥å¡¼Æâ¤Î¥¹¥ì¥Ã¥É¤Ë¡¢¤½¤Î¸å
-read ¥í¥Ã¥¯¥­¥å¡¼Æâ¤Î¥¹¥ì¥Ã¥É¤Ë¥í¥Ã¥¯¤òÍ¿¤¨¤Þ¤¹¡£
-
-¤³¤ì¤Ï¡¢Æ±¤¸¥Æ¡¼¥Ö¥ë¤Ç¿¤¯¤Î¹¹¿·¤ò¤¹¤ë¾ì¹ç¡¢@code{SELECT} ¹½Ê¸¤Ï
-update ¤¬¤Ê¤¯¤Ê¤ë¤Þ¤ÇÂÔ¤¿¤µ¤ì¤ë¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£
-
-Ʊ¤¸¥Æ¡¼¥Ö¥ë¤Ç¿¤¯¤Î @code{INSERT} ¤È¿¤¯¤Î @code{SELECT} ¤ò¹Ô¤¦¾ì¹ç¡¢¤³¤ì¤ò²ò·è¤¹¤ë¤Ë
-¤Ï¡¢Â¾¤Î¥Æ¡¼¥Ö¥ë¤Ë¹Ô¤òÁÞÆþ¤·¤Æ¡¢¤¿¤Þ¤Ë¡¢¤½¤Î°ì»þ¥Æ¡¼¥Ö¥ë¤«¤éÁ´¤Æ¤Î¥ì¥³¡¼
-¥É¤ò¤â¤¦°ìÊý¤Î¥Æ¡¼¥Ö¥ë¤Ë update ¤·¤Þ¤¹¡£
-
-¤³¤ì¤Ï¼¡¤Î¥³¡¼¥É¤Ç¹Ô¤¨¤Þ¤¹:
-@example
-mysql> LOCK TABLES real_table WRITE, insert_table WRITE;
-mysql> insert into real_table select * from insert_table;
-mysql> delete from insert_table;
-mysql> UNLOCK TABLES;
-@end example
-
-·è¤Þ¤ê¤­¤Ã¤¿¸¡º÷¤ËÍ¥À踢¤òÍ¿¤¨¤ë¤¿¤á¡¢@code{INSERT} ¹½Ê¸¤Ç @code{LOW_PRIORITY} ¤« @code{HIGH_PRIORITY} ¥ª¥×¥·¥ç¥ó¤¬»ÈÍѤǤ­¤Þ¤¹¡£
-@xref{INSERT, , @code{INSERT}}.
-
-°ì¤Ä¤Î¥­¥å¡¼¤À¤±¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë @file{mysys/thr_lock.c} Æâ¤Î¥í¥Ã¥¯¥³¡¼¥É¤òÊѹ¹
-¤¹¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢¤¤¤¯¤Ä¤«¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¤¿¤á¤Ë¡¢
-write ¥í¥Ã¥¯¤Ï read ¥í¥Ã¥¯¤ÈƱ¤¸Í¥Àè½ç°Ì¤Ë¤·¤Þ¤¹¡£
-
-@node Table locking, , Internal locking, System
-@subsection ¥Æ¡¼¥Ö¥ë¡¦¥í¥Ã¥­¥ó¥°¤ÎÌäÂê
-
-@strong{MySQL} ¤Î¥Æ¡¼¥Ö¥ë¡¦¥í¥Ã¥­¥ó¥°¤Î¥³¡¼¥É¤Ï¥Ç¥Ã¥É¥í¥Ã¥¯¡¦¥Õ¥ê¡¼¤Ç¤¹¡£
-
-@strong{MySQL} ¤Ï¤È¤Æ¤â®¤¤¥í¥Ã¥¯¥¹¥Ô¡¼¥É¤òÆÀ¤ë¤¿¤á¤Ë¡¢
-(¥ì¥³¡¼¥É¤Î¥í¥Ã¥¯¤ä¥Õ¥£¡¼¥ë¥É¤Î¥í¥Ã¥¯¤ÎÂå¤ï¤ê¤Ë) ¥Æ¡¼¥Ö¥ë¤Î¥í¥Ã¥¯¤ò»ÈÍѤ·¤Þ¤¹¡£
-Â礭¤Ê¥Æ¡¼¥Ö¥ë¤Ë¤Ï¡¢ ¥Æ¡¼¥Ö¥ë¤Î¥í¥Ã¥¯¤Ï¥ì¥³¡¼¥É¤Î¥í¥Ã¥¯¤è¤ê¤Ï¤ë¤«¤ËÎɤ¤¤Ç¤¹¤¬¡¢
-¤¤¤¯¤Ä¤«¤ÎÍî¤È¤··ê¤¬¤¢¤ê¤Þ¤¹¡£
-
-@strong{MySQL} 3.23.7 °Ê¾å¤Ç¤Ï¡¢¤¢¤ë¥¹¥ì¥Ã¥É¤¬ @code{MyISAM} ¥Æ¡¼¥Ö¥ë¤òÆɤó¤Ç¤¤¤ëºÇÃæ¤Ë¡¢
-Ʊ¤¸¥Æ¡¼¥Ö¥ë¤Ë¥ì¥³¡¼¥É¤òÁÞÆþ¤¹¤ë»ö¤¬¤Ç¤­¤Þ¤¹¡£
-¤³¤ì¤Ï¸½ºß¡¢ºï½ü¤¬¤Ê¤¤¾ì¹ç¤Ë¤Î¤ßÆ°¤­¤Þ¤¹¡£
-
-¥Æ¡¼¥Ö¥ë¤Î¥í¥Ã¥¯¤Ï¤¿¤¯¤µ¤ó¤Î¥¹¥ì¥Ã¥É¤¬Æ±»þ¤Ë¤¢¤ë¥Æ¡¼¥Ö¥ë¤«¤éÆɤ߽Ф¹¤Î¤ò²Äǽ¤Ë¤·¤Þ¤¹¤¬¡¢
-¤â¤·¤¢¤ë¥¹¥ì¥Ã¥É¤¬¤¢¤ë¥Æ¡¼¥Ö¥ë¤ËÂФ·½ñ¹þ¤ßÍ×µá¤ò½Ð¤¹¾ì¹ç¡¢
-¤½¤ì¤Ï¤Þ¤ººÇ½é¤ËÇÓ¾Ū¤Ê¥¢¥¯¥»¥¹¤òÆÀ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó.
-¤½¤Î¹¹¿·¤Î´Ö¡¢¹¹¿·¤¬´°Î»¤¹¤ë¤Þ¤Ç¡¢¤³¤ÎÆÃÄê¤Î¥Æ¡¼¥Ö¥ë¤Ë¥¢¥¯¥»¥¹¤·¤è¤¦¤È¤¹¤ë
-¾¤ÎÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤¬ÂÔ¤¿¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-Ä̾ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¹¹¿·¤Ï @code{SELECT} ¤è¤ê¤â½ÅÍפȤµ¤ì¤ë¤¿¤á¡¢
-¥Æ¡¼¥Ö¥ë¤ò¹¹¿·¤¹¤ëÁ´¤Æ¤Î¥¹¥ì¥Ã¥É¤¬¡¢¥Æ¡¼¥Ö¥ë¤«¤é¾ðÊó¤ò¸¡º÷¤¹¤ë¥¹¥ì¥Ã¥É¤è¤ê¤â
-¹â¤¤Í¥Àè½ç°Ì¤ò»ý¤Á¤Þ¤¹¡£ ¤³¤ì¤Ï ¤¢¤ëÆÃÄê¤Î¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ¡¢Â¿¤¯¤Î½Å¤¤¥¯¥¨¥ê¤¬È¯¹Ô¤µ¤ì
-¤¿¾ì¹ç¤Ë¡¢ ¹¹¿·¤¬ÉÔ´°Á´¤Ë½ª¤ï¤é¤Ê¤¤¤³¤È¤ò³Î¼Â¤Ë¤¹¤ë¤¿¤á¤Ç¤¹¡£
-
-@strong{MySQL 3.23.7} ¤«¤é¡¢@code{max_write_lock_count} ÊÑ¿ô¤¬»ÈÍѤǤ­¤Þ¤¹¡£
-¤³¤ì¤Ï¡¢°ì¤Ä¤Î¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ¡¢»ØÄꤵ¤ì¤¿²ó¿ô¤À¤± INSERT ¤¬¹Ô¤ï¤ì¤¿¸å¤Ë¡¢
-@code{SELECT} ¤òȯ¹Ô¤¹¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
-
-¤³¤Î1¤Ä¤Î¼ç¤ÊÌäÂ꤬°Ê²¼¤Ç¤¹¡§
-
-@itemize @bullet
-@item
-¤¢¤ë¥¯¥é¥¤¥¢¥ó¥È¤¬¼Â¹Ô¤ËŤ¤»þ´Ö¤Î¤«¤«¤ë @code{SELECT} ¤òȯ¹Ô¡£
-@item
-¤½¤Î¸å¤Ë¡¢Â¾¤Î¥¯¥é¥¤¥¢¥ó¥È¤¬¡¢»ÈÍѤµ¤ì¤Æ¤¤¤ë¥Æ¡¼¥Ö¥ë¤ËÂФ· @code{UPDATE} ¤òȯ¹Ô¡¨
-¤³¤Î¥¯¥é¥¤¥¢¥ó¥È¤ÏÀè¤Î @code{SELECT} ¤¬´°Î»¤¹¤ë¤Þ¤ÇÂÔ¤Á¤Þ¤¹
-@item
-¤µ¤é¤Ë¾¤Î¥¯¥é¥¤¥¢¥ó¥È¤¬Æ±¤¸¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ @code{SELECT} ¹½Ê¸¤òȯ¹Ô¡¨
-@code{UPDATE} ¤Ï @code{SELECT} ¤è¤ê¤â¹â¤¤Í¥ÀèÅÙ¤ò»ý¤Ä¤Î¤Ç¡¢
-¤³¤Î @code{SELECT} ¤ÏÀè¤Î @code{UPDATE} ¤¬´°Î»¤¹¤ë¤Þ¤ÇÂÔ¤Á¤Þ¤¹¡£
-¤³¤ì¤Ï°ìÈֺǽé¤Î @code{SELECT} ¤¬ ½ªÎ»¤¹¤ë¤Þ¤ÇÂÔ¤¿¤µ¤ì¤Þ¤¹¡ª
-@end itemize
-
-¤³¤ÎÌäÂê¤Î¤¤¤¯¤Ä¤«¤Î²Äǽ¤Ê²ò·è¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡§
-
-@itemize @bullet
-@item
-@code{SELECT} ¹½Ê¸¤ò®¤¯¼Â¹Ô¤Ç¤­¤ë¤è¤¦¤Ë»î¤ß¤Þ¤¹¡¨ ¤³¤ì¤ò¹Ô¤¦¤Ë¤¢¤¿¤ê¡¢
-¤¤¤¯¤Ä¤«¤Î¥µ¥Þ¥ê¡¼¥Æ¡¼¥Ö¥ë¤òºîÀ®¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤«¤â¤·¤ì¤Þ¤»¤ó.
-
-@item
-@code{mysqld} ¤ò @code{--low-priority-updates} ¥ª¥×¥·¥ç¥ó¤Çµ¯Æ°¡£
-¤³¤ì¤ÏÁ´¤Æ¤Î¤¢¤ë¥Æ¡¼¥Ö¥ë¤ò¹¹¿·¤¹¤ë¹½Ê¸¤ËÂФ·¤Æ¡¢ @code{SELECT} ¹½Ê¸¤è¤ê¤â
-Ä㤤ͥÀèÅÙ¤òÍ¿¤¨¤Þ¤¹¡£ ¤³¤Î¾ì¹ç¡¢Á°½Ò¤Î¥·¥Ê¥ê¥ªÃæ¤ÎºÇ¸å¤Î @code{SELECT} ¹½Ê¸¤Ï
-@code{INSERT} ¹½Ê¸¤¬´°Î»¤¹¤ëÁ°¤Ë¼Â¹Ô¤µ¤ì¤Þ¤¹¡£
-
-@item
-@code{LOW_PRIORITY} °À­»ØÄê¤òÍѤ¤¤Æ¡¢ @code{INSERT},@code{UPDATE},@code{DELETE} ¹½Ê¸
-¤ËÄ㤤ͥÀèÅÙ¤òÍ¿¤¨¤ë¤³¤È¤â½ÐÍè¤Þ¤¹¡£
-
-@item
-Start @code{mysqld} with a low value for @strong{max_write_lock_count} to give
-@code{READ} locks after a certain number of @code{WRITE} locks.
-
-@item
-SQL ¥³¥Þ¥ó¥É¤Î @code{SET SQL_LOW_PRIORITY_UPDATES=1} ¤ò»ÈÍѤ·¤Æ¡¢
-¤¢¤ëÆÃÄê¤Î¥¹¥ì¥Ã¥É¤«¤é¤ÎÁ´¤Æ¤Î¹¹¿·¤ò¡¢Ä㤤ͥÀèÅ٤˻ØÄꤹ¤ë»ö¤¬¤Ç¤­¤Þ¤¹¡£
-@xref{SET OPTION, , @code{SET OPTION}}.
-
-@item
-@code{HIGH_PRIORITY} °À­¤òÍѤ¤¤Æ¡¢ÆÃÄê¤Î @code{SELECT} ¤¬¤È¤Æ¤â½ÅÍפǤ¢¤ë¤È
-»ØÄꤹ¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£. @xref{SELECT, , @code{SELECT}}.
-
-@item
-¤â¤· @code{INSERT} ¤È @code{SELECT} ¤ò¤¢¤ï¤»¤Æ»ÈÍѤ·¤¿¾ì¹ç¤ËÌäÂ꤬µ¯¤­¤¿¾ì¹ç¡¢
-¿·¤·¤¤ @code{MyISAM} ¥Æ¡¼¥Ö¥ë¤ËÀÚ¤êÂؤ¨¤Þ¤¹¡£ ¤³¤ì¤Ï @code{SELECT}
-¤È @code{INSERT} ¤òƱ»þ¤Ë¹Ô¤¨¤Þ¤¹¡£
-
-@item
-¤â¤· @code{INSERT} ¤È @code{SELECT} ¹½Ê¸¤ò¼ç¤Ëº®ºß¤µ¤»¤ë¤Î¤Ê¤é¡¢
-@code{INSERT} ¤Î @code{DELAYED} °À­»ØÄê¤Ï¤³¤ÎÌäÂê¤ò²ò·è¤µ¤»¤ë¤Ç¤·¤ç¤¦¡£
-@xref{INSERT, , @code{INSERT}}.
-
-@item
-¤â¤· @code{SELECT} ¤È @code{DELETE} ¤ÇÌäÂ꤬¤¢¤ë¤Ê¤é¡¢
-@code{DELETE} ¤Î @code{LIMIT} ¥ª¥×¥·¥ç¥ó¤¬½õ¤±¤Ë¤Ê¤ë¤Ç¤·¤ç¤¦¡£
- @xref{DELETE, , @code{DELETE}}.
-@end itemize
-
-@node Data size, MySQL indexes, System, Performance
-@section ²Äǽ¤Ê¸Â¤ê¥Ç¡¼¥¿¤ò¾®¤µ¤¯¤¹¤ë
-
-One of the most basic optimization is to get your data (and indexes) to
-take as little space on the disk (and in memory) as possible. This can
-give huge improvements because disk reads are faster and normally less
-main memory will be used. Indexing also takes less resources if
-done on smaller columns.
-
-@strong{MySQL} supports a lot of different table types and row formats.
-Choosing the right table format may give you a big performance gain.
-@xref{Table types}.
-
-°Ê²¼¤Ëµó¤²¤ë¥Æ¥¯¥Ë¥Ã¥¯¤ò»ÈÍѤ¹¤ì¤Ð¡¢¥Æ¡¼¥Ö¥ë¤Ç¤Î¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤Î¸þ¾å¡¢
-ÊݸÎΰè¤Î½Ì¾®²½¤¬²Äǽ¤Ç¤·¤ç¤¦¡§
-
-@itemize @bullet
-@item
-²Äǽ¤Ê¤é¤Ð¡¢°ìÈÖ¾®¤µ¤Ê·¿¤ò»ÈÍѤ·¤Þ¤¹¡£ @strong{MySQL} ¤Ï
-¥Ç¥£¥¹¥¯¤È¥á¥â¥ê¡¼¤òÀáÌ󤹤뿤¯¤Î·¿¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£
-@item
-¤è¤ê¾®¤µ¤ÊÀ°¿ô·¿¤ò²Äǽ¤Ê¤é¤Ð»ÈÍѤ·¤Þ¤¹¡£ Î㤨¤Ð¡¢
-@code{MEDIUMINT} ¤Ï @code{INT} ¤è¤êÎɤ¤¤Ç¤·¤ç¤¦¡£
-@item
-²Äǽ¤Ê¤é¥Õ¥£¡¼¥ë¥É¤ò @code{NOT NULL} ¤ËÄêµÁ¤·¤Æ¤¯¤À¤µ¤¤¡£¤³¤ì¤ÏÁ´¤Æ¤ò¤è¤ê®¤¯¤·¡¢
-³Æ¥Õ¥£¡¼¥ë¥ÉËè¤Ë1¥Ó¥Ã¥È¤òÀáÌó¤·¤Þ¤¹¡£
-Note that if you really need
-@code{NULL} in your application you should definitely use it. Just avoid
-haveing it on all columns by default.
-@item
-²ÄÊÑĹ¤Î¥Õ¥£¡¼¥ë¥É (@code{VARCHAR}, @code{TEXT}, @code{BLOB}) ¤ò»ý¤¿¤Ê¤¤¾ì¹ç¤Ï¡¢
-¸ÇÄꥵ¥¤¥º¥ì¥³¡¼¥É·Á¼°¤¬»ÈÍѤµ¤ì¤Þ¤¹¡£
-¤³¤ì¤Ï¤«¤Ê¤ê®¤¤¤Ç¤¹¡£¤·¤«¤·¤¢¤¤¤Ë¤¯¤¤¤¯¤é¤«¤ÎÎΰè¤òϲÈñ¤·¤Þ¤¹¡£
-@xref{MyISAM table formats}.
-@item
-¤½¤ì¤¾¤ì¤Î¥Æ¡¼¥Ö¥ë¤Ï²Äǽ¤Ê¸Â¤êû¤¤¥×¥é¥¤¥Þ¥ê¡¦¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ä¤Ù¤­¤Ç¤¹¡£
-¤³¤ì¤Ï£±¥ì¥³¡¼¥É¤ò°ì°Õ¤Ë¤·¡¢¸úΨŪ¤Ë¤·¤Þ¤¹¡£
-@item
-¤½¤ì¤¾¤ì¤Î¥Æ¡¼¥Ö¥ë¤Ë¤Ä¤¤¤Æ¡¢¤É¤Î¥Æ¡¼¥Ö¥ë¤Î·Á¼°¤ò»ÈÍѤ¹¤ë¤«¤ò
-·è¤á¤Þ¤¹¡£ @xref{Table types}.
-@item
-ËÜÅö¤ËɬÍפÊʪ¤Ë¤À¤±¥¤¥ó¥Ç¥Ã¥¯¥¹¤òºîÀ®¤·¤Þ¤¹¡£
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï¸¡º÷¤Ë¤ÏÎɤ¤¤Ç¤¹¤¬¡¢¤è¤ê®¤¯Êݸ¤·¤¿¤¤¾ì¹ç¤Ë¤ÏÎɤ¯¤¢¤ê¤Þ¤»¤ó¡£
-¤â¤·¥Æ¡¼¥Ö¥ë¤ò¥Õ¥£¡¼¥ë¥É¤ÎÁȤ߹ç¤ï¤»¤Ç¥µ¡¼¥Á¤¹¤ë¤³¤È¤¬¤Û¤È¤ó¤É¤Ç¤¢¤ì¤Ð¡¢
-¤½¤ì¤é¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤òºîÀ®¤·¤Þ¤¹¡£ ºÇ½é¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎÉôʬ¤Ï¡¢¤â¤Ã¤È¤â
-»ÈÍѤµ¤ì¤ë¥Õ¥£¡¼¥ë¥É¤Ë¤¹¤Ù¤­¤Ç¤¹¡£
-If you are
-ALWAYS using many columns you should use the column with more duplicates
-first to get better compression of the index.
-@item
-¤â¤·¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬Æ¬¤«¤é¤Î²¿Ê¸»ú¤«¤Ç°ì°ÕÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¤Ê¤é¡¢¤³¤ÎÉôʬ¤Ë¤À¤±
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÄ¥¤ëÊý¤¬Îɤ¤¤Ç¤·¤ç¤¦¡£ @strong{MySQL} ¤Ïʸ»úÎó¥Õ¥£¡¼¥ë¥É¤Î
-°ìÉôʬ¤ËÂФ·¤Æ¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£
-û¤¤¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï¡¢¥Ç¥£¥¹¥¯¥¹¥Ú¡¼¥¹¤òÀáÌ󤹤ë¤À¤±¤Ç¤Ê¤¯¡¢
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î¥­¥ã¥Ã¥·¥å¤Ë¼ý¤Þ¤ê¤ä¤¹¤¯¤Ê¤ë¤³¤È¤Ë¤è¤ê¡¢¥Ç¥£¥¹¥¯¡¦¥·¡¼¥¯¤â¾¯¤Ê¤¯¤Ê¤ë¤Î¤Ç¡¢
-®¤¯¤Ê¤ê¤Þ¤¹¡£ @xref{Server parameters}.
-@item
-¤¤¤¯¤Ä¤«¤Î¾õ¶·²¼¤Ç¡¢¤È¤Æ¤â¤è¤¯Áöºº¤µ¤ì¤ë¥Æ¡¼¥Ö¥ë¤ò£²¤Ä¤Ëʬ³ä¤¹¤ë¤³¤È¤Ï¡¢
-Íø±×¤Ë¤Ê¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£
-This is especially true if it is a dynamic
-format table and it is possible to use a smaller static format table that
-can be used to find the relevant rows when scanning the table.
-@end itemize
-
-@node MySQL indexes, Query Speed, Data size, Performance
-@section MySQL ¤Ï¤É¤Î¤è¤¦¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ¹¤ë¤«¡©
-
-Indexes are used to find rows with a specific value of one column
-fast.
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬¤Ê¤¤¾ì¹ç¡¢@strong{MySQL} ¤Ï¡¢¤½¤Î¥ì¥³¡¼¥É¤¬¸«¤Ä¤«¤ë¤Þ¤Ç¡¢
-ºÇ½é¤Î¥ì¥³¡¼¥É¤«¤é¥Æ¡¼¥Ö¥ë¤ò¤Ê¤á¤Æ¤¤¤­¤Þ¤¹¡£ Â礭¤Ê¥Æ¡¼¥Ö¥ë¤Ç¤Ï¿¤¯¤Î
-¼ê´Ö¤¬¤«¤«¤ê¤Þ¤¹¡£ ¤â¤·Ì䤤¹ç¤ï¤»¤ÎÃæ¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ã¤¿¥Õ¥£¡¼¥ë¥É¤¬
-¤¢¤ë¾ì¹ç¡¢@strong{MySQL} ¤ÏÁ´¤Æ¤Î¥Ç¡¼¥¿¤ò¤ß¤ë¤³¤È¤Ê¤¯¡¢¥Ç¡¼¥¿¤ÎÅÓÃæ¤Î°ÌÃÖ¤ò®¤¯
-ÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¤â¤·¤¢¤ë¥Æ¡¼¥Ö¥ë¤¬1000¥ì¥³¡¼¥É»ý¤Ã¤Æ¤¤¤¿¤È¤¹¤ë¤È¡¢
-½çÈÖ¤ËƬ¤«¤é¤Ê¤á¤Æ¤¤¤¯¤³¤È¤ËÈæ¤Ù¤Æ¡¢¤³¤ì¤Ï¾¯¤Ê¤¯¤È¤â100ÇÜ®¤¤¤³¤È¤Ë
-¤Ê¤ê¤Þ¤¹¡£ Note that is you need to access almost all 1000
-rows it is faster to read sequentially because we then avoid disk seeks.
-
-Á´¤Æ¤Î @strong{MySQL} ¥¤¥ó¥Ç¥Ã¥¯¥¹, @code{PRIMARY}, @code{UNIQUE} ¤½¤·¤Æ @code{INDEX()}
-¤Ï B tree ¤Ë³ÊǼ¤µ¤ì¤Þ¤¹¡£Ê¸»úÎó¤Ï¼«Æ°Åª¤Ë»Ï¤á¤È½ª¤ê¤Î¶õÇò¤¬°µ½Ì¤µ¤ì¤Þ¤¹¡£
-@xref{CREATE INDEX, , @code{CREATE INDEX}}.
-
-Indexes are used to:
-@itemize @bullet
-@item
-@code{WHERE}Àá¤Ë¥Þ¥Ã¥Á¤·¤¿¹Ô¤ÎÁÇÁᤤ¸¡º÷
-
-@item
-join ¤ò¼Â¹Ô¤·¤¿¤È¤­¤Î¾¤Î¥Æ¡¼¥Ö¥ë¤«¤é¤Î¹Ô¤Î¸¡º÷
-
-@item
-Í¿¤¨¤é¤ì¤¿¥Õ¥£¡¼¥ë¥É¤Î @code{MAX()} ¤ä @code{MIN()} Ãͤγä¤ê½Ð¤·
-
-@item
-¥Æ¡¼¥Ö¥ë¤ò¥½¡¼¥È¤«¥°¥ë¡¼¥×²½¤¹¤ë¾ì¹ç¤Ç¡¢¥½¡¼¥È(¥°¥ë¡¼¥×²½)¤¬°ìÈÖº¸(ÀÜƬÉô)¤Î
-¥­¡¼¤ò»ÈÍѤ·¤Æ¹Ô¤ï¤ì¤ë¾ì¹ç(Î㤨¤Ð @code{ORDER BY key_part_1,key_part_2 })¡£
-¤â¤· @code{DESC} »ØÄ꤬¤¢¤ì¤Ð¡¢Á´¤Æ¤Î¥­¡¼¤ÏµÕ½ç¤ËÆɤޤì¤Þ¤¹¡£
-
-The index can also be used even if the @code{ORDER BY} doesn't match the index
-exactly, as long as all the not used index parts and all the extra
-are @code{ORDER BY} columns are constants in the @code{WHERE} clause. The
-following queries will use the index to resolve the @code{ORDER BY} part.
-
-@example
-SELECT * FROM foo ORDER BY key_part1,key_part2,key_part3;
-SELECT * FROM foo WHERE column=constant ORDER BY column, key_part1;
-SELECT * FROM foo WHERE key_part1=const GROUP BY key_part2;
-@end example
-
-@item
-¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤ò»²¾È¤¹¤ë¤³¤È¤Ê¤¯Ãͤò¸¡º÷¤¹¤ë¾ì¹ç¡£
-¤â¤·»ÈÍѤ¹¤ëÁ´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤¬¿ôÃͤǤ«¤Ä¡¢°ìÈÖº¸¤«¤é(ÀÜƬÉô¤«¤é)¥­¡¼¤ò·ÁÀ®¤¹¤ë¾ì¹ç¡¢
-Ãͤϥ¤¥ó¥Ç¥Ã¥¯¥¹¥Ä¥ê¡¼¤«¤é¸¡º÷¤µ¤ì¡¢¤³¤ì¤Ï¤È¤Æ¤â®¤¯¤Ê¤ê¤Þ¤¹¡£
-
-@end itemize
-
-°Ê²¼¤Î¤è¤¦¤Ê @code{SELECT} ʸ¤òȯ¹Ô¤·¤¿¤È¤·¤Þ¤¹¡§
-
-@example
-mysql> SELECT * FROM tbl_name WHERE col1=val1 AND col2=val2;
-@end example
-
-¤â¤· @code{col1} ¤È @code{col2} ¤ËÊ£¿ô¥Õ¥£¡¼¥ë¥É¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬ÄêµÁ¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢
-¤¹¤°¤Ë»×¤Ã¤¿¤È¤ª¤ê¤Î·ë²Ì¤¬ÆÀ¤é¤ì¤Þ¤¹¡£
-If separate single-column
-indexes exist on @code{col1} and @code{col2}, the optimizer tries to
-find the most restrictive index by deciding which index will find fewer
-rows and using that index to fetch the rows.
-
-@cindex Indexes, leftmost prefix of
-@cindex Leftmost prefix of indexes
-¤â¤·¥Æ¡¼¥Ö¥ë¤¬Ê£¿ô¥Õ¥£¡¼¥ë¥É¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ä¤Ê¤é¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎÀÜƬÉô°ìÈÖº¸¤ÎÉôʬ
-¤¬¥ì¥³¡¼¥É¤ò¸«¤Ä¤±¤ë¤¿¤á¤ÎºÇŬ²½¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£Î㤨¤Ð¡¢3¤Ä¤Î¥Õ¥£¡¼¥ë¥É
- @code{(col1,col2,col3)} ¤ËÂФ·¤Æ°ì¤Ä¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ã¤Æ¤¤¤¿¤È¤·¤Þ¤¹¡£
-¤¹¤ë¤È¡¢¤³¤ì¤Ï @code{(col1)}, @code{(col1,col2)} ,
-@code{(col1,col2,col3)} ¤Ç¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬¥µ¡¼¥Á¤µ¤ì¤Þ¤¹¡£
-
-¤â¤·°ìÈÖº¸¤Ë»ØÄꤷ¤Æ¤¤¤ë¥Õ¥£¡¼¥ë¥É¤¬¥¤¥ó¥Ç¥Ã¥¯¥¹¤òºîÀ®¤·¤Æ¤¤¤Ê¤¤¤Ê¤é¡¢
-@strong{MySQL} ¤ÏÉôʬŪ¤Ê¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ·¤Þ¤»¤ó¡£
-
-°Ê²¼¤Î¤è¤¦¤Ê @code{SELECT} ʸ¤òȯ¹Ô¤·¤¿¤È¤·¤Þ¤¹¡§
-
-@example
-mysql> SELECT * FROM tbl_name WHERE col1=val1;
-mysql> SELECT * FROM tbl_name WHERE col2=val2;
-mysql> SELECT * FROM tbl_name WHERE col2=val2 AND col3=val3;
-@end example
-
-¤â¤·¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬ @code{(col1,col2,col3)} ¤Ë¤¢¤ë¤Ê¤é¤Ð¡¢
-¾å¤Ë¼¨¤·¤¿ºÇ½é¤Î¥¯¥¨¥ê¤À¤±¤¬¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ·¤Þ¤¹¡£ÆóÈÖÌÜ»°ÈÖÌܤΥ¯¥¨¥ê¤Ï
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ä¥Õ¥£¡¼¥ë¥É¤òȯư¤·¤Þ¤¹¤¬¡¢
-@code{(col2)} ¤È @code{(col2,col3)} ¤Ï¡¢@code{(col1,col2,col3)} ¤Î
-ÀÜƬÉô°ìÈÖº¸¤Ë»ØÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó¡£
-
-@findex LIKE, and indexes
-@findex LIKE, and wildcards
-@cindex Indexes, and @code{LIKE}
-@cindex Wildcards, and @code{LIKE}
-@strong{MySQL} ¤Ï¡¢¤â¤· @code{LIKE} ¤¬¥ï¥¤¥ë¥É¥«¡¼¥É¤«¤é»Ï¤Þ¤Ã¤Æ¤¤¤Ê¤¯¤Æ¡¢
-¤¢¤ë¼ï¸ÇÄꤵ¤ì¤¿Ê¸»ú¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤ë¤Ê¤é¡¢
-@code{LIKE} ¤Îɾ²Á¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ·¤Þ¤¹¡£
-Î㤨¤Ð¡¢°Ê²¼¤Î @code{SELECT} ʸ¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ·¤Þ¤¹:
-
-@example
-mysql> select * from tbl_name where key_col LIKE "Patrick%";
-mysql> select * from tbl_name where key_col LIKE "Pat%_ck%";
-@end example
-
-°ì¤ÄÌܤÎʸ¤Ï¡¢@code{"Patrick" <= key_col < "Patricl"} ¤È¤Ê¤ë¥ì¥³¡¼¥É¤À¤±¡¢¹Í褵¤ì¤Þ¤¹¡£
-Æó¤ÄÌܤÎʸ¤Ï¡¢@code{"Pat" <= key_col < "Pau"} ¤È¤Ê¤ë¥ì¥³¡¼¥É¤À¤±¡¢¹Í褵¤ì¤Þ¤¹¡£
-
-°Ê²¼¤Î @code{SELECT} ʸ¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ·¤Þ¤»¤ó:
-@example
-mysql> select * from tbl_name where key_col LIKE "%Patrick%";
-mysql> select * from tbl_name where key_col LIKE other_col;
-@end example
-
-ºÇ½é¤Îʸ¤Ï¡¢@code{LIKE} ¤¬¥ï¥¤¥ë¥É¥«¡¼¥Éʸ»ú¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤Þ¤¹¡£
-Æó¤ÄÌܤÎʸ¤Ï¡¢@code{LIKE} ¤¬Äê¿ô¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-
-@findex IS NULL, and indexes
-@cindex Indexes, and @code{IS NULL}
-Searching using @code{column_name IS NULL} will use indexes if column_name
-is an index.
-
-@strong{MySQL} ¤ÏÄ̾°ìÈÖ¾¯¤Ê¤¤¥ì¥³¡¼¥É¿ô¤ò¸«¤Ä¤±¤ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ·¤Þ¤¹¡£
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï¡¢°Ê²¼¤Ë¼¨¤¹±é»»»Ò¤òÍѤ¤¤ÆÈæ³Ó¤Ç¤­¤ë¥Õ¥£¡¼¥ë¥É¤ËÂФ·¤Æ¡¢»ÈÍѤµ¤ì¤Þ¤¹¡§
-@code{=}, @code{>}, @code{>=}, @code{<}, @code{<=}, @code{BETWEEN} ¤½¤·¤Æ
-@code{'something%'} ¤ÎÍͤËƬ¤Ë¥ï¥¤¥ë¥É¥«¡¼¥É¤¬¤Ê¤¤ @code{LIKE}¡£
-
-@code{WHERE} ÀáÆâ¤ÎÁ´¤Æ¤Î @code{AND} ¤Ë¤«¤«¤é¤Ê¤¤¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï¡¢
-Á´¤¯¥¯¥¨¥ê¤ÎºÇŬ²½¤Ë»ÈÍѤµ¤ì¤Þ¤»¤ó¡£
-In other words: To be able to use an
-index, a prefix of the index must be used in every @code{AND} group.
-
-°Ê²¼¤Î @code{WHERE} Àá¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ·¤Þ¤¹¡§
-@example
-... WHERE index_part1=1 AND index_part2=2 AND other_column=3
-... WHERE index=1 OR A=10 AND index=2 /* index = 1 OR index = 2 */
-... WHERE index_part1='hello' AND index_part_3=5
- /* optimized like "index_part1='hello'" */
-... WHERE index1=1 and index2=2 or index1=3 and index3=3;
- /* Can use index on index1 but not on index2 or index 3 */
-@end example
-
-°Ê²¼¤Î @code{WHERE} Àá¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò@strong{»ÈÍѤ·¤Þ¤»¤ó}¡§
-@example
-... WHERE index_part2=1 AND index_part3=2 /* index_part_1 is not used */
-... WHERE index=1 OR A=10 /* Index is not used in both AND parts */
-... WHERE index_part1=1 OR index_part2=10 /* No index spans all rows */
-@end example
-
-@node Query Speed, Tips, MySQL indexes, Performance
-@section ¥Ç¡¼¥¿¤ò¥¢¥¯¥»¥¹¡¦¹¹¿·¤¹¤ë¥¯¥¨¥ê¤Î®ÅÙ
-
-ºÇ½é¤Ë¡¢Á´¤Æ¤Î¥¯¥¨¥ê¤Ë±Æ¶Á¤¹¤ë°ì¤Ä¤Î»öÊÁ¤ò¤Î¤Ù¤Þ¤¹¡§
-¤è¤êÊ£»¨¤Ê¸¢¸Â¤ÎÀßÄê¤ò¹Ô¤¦¤È¡¢¥ª¡¼¥Ð¡¼¥Ø¥Ã¥É¤¬Â¿¤¯¤Ê¤ê¤Þ¤¹¡£
-
-¤â¤·¤¢¤Ê¤¿¤¬¤¤¤«¤Ê¤ë @code{GRANT} ʸ¤â¹Ô¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢
-@strong{MySQL} ¤Ï¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤Î¸¡ºº¤ò¾¯¤·¤·¤«ºÇŬ²½¤·¤Ê¤¤¤Ç¤·¤ç¤¦¡£
-So if you have a very high volume it
-may be worth the time to avoid grants. Otherwise more permission check
-results in a larger overhead.
-
-¤â¤· @strong{MySQL} ´Ø¿ô¤Î¤¢¤ë¤â¤Î¤¬³Î¼Â¤ËÌäÂê¤ò°ú¤­µ¯¤³¤·¤Æ¤¤¤ë¤Î¤Ê¤é¤Ð¡¢
-¾ï¤Ë @strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¦¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤Ê¤ê¤Þ¤¹¡§
-
-@example
-mysql> select benchmark(1000000,1+1);
-+------------------------+
-| benchmark(1000000,1+1) |
-+------------------------+
-| 0 |
-+------------------------+
-1 row in set (0.32 sec)
-@end example
-
-¾å¤ÎÎã¤Ç¤Ï @strong{MySQL} ¤Ï 1,000,000 @code{+} ¼°¤ò 0.32 ÉäǼ¹ԤǤ­¤Æ¤¤¤Þ¤¹
-(¤¿¤ó¤Ê¤ë @code{PentiumII 400MHz} ¥Þ¥·¥ó¤Ç)¡£
-
-Á´¤Æ¤Î @strong{MySQL} ´Ø¿ô¤ÏºÇŬ²½¤µ¤ì¤Æ¤¤¤Þ¤¹¤¬¡¢
-¤¤¤¯¤Ä¤«¤ÏÎã³°¤¬¤¢¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-@code{benchmark(loop_count,expression)}¤Ï¤¢¤Ê¤¿¤Î¥¯¥¨¥ê¤Î
-ÌäÂê¤ò¸«¤Ä¤±¤ë¤¿¤á¤Î¤È¤Æ¤â¤è¤¤¥Ä¡¼¥ë¤Ç¤¹¡£
-
-@menu
-* Estimating performance:: Estimating query performance
-* SELECT speed:: Speed of @code{SELECT} queries
-* Where optimizations:: How MySQL optimizes @code{WHERE} clauses
-* LEFT JOIN optimization:: How MySQL optimizes @code{LEFT JOIN}
-* LIMIT optimization:: How MySQL optimizes @code{LIMIT}
-* Insert speed:: Speed of @code{INSERT} queries
-* Update speed:: Speed of @code{UPDATE} queries
-* Delete speed:: Speed of @code{DELETE} queries
-@end menu
-
-@node Estimating performance, SELECT speed, Query Speed, Query Speed
-@subsection ¥¯¥¨¥ê¤ÎÀ­Ç½É¾²Á
-
-¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢¥Ç¥£¥¹¥¯¡¦¥·¡¼¥¯¤ò¿ô¤¨¤ë¤³¤È¤Ç¤À¤¤¤¿¤¤¤Î¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤òͽ¬¤Ç¤­¤Þ¤¹¡£
-¾®¤µ¤Ê¥Æ¡¼¥Ö¥ë¤Ç¤Ï¡¢Ä̾1²ó¤Î¥Ç¥£¥¹¥¯¡¦¥·¡¼¥¯¤Ç¥ì¥³¡¼¥É¤ò¸«¤Ä¤±¤ì¤ë¤Ç¤·¤ç¤¦
-(¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬¤¿¤Ö¤ó¥­¥ã¥Ã¥·¥å¤µ¤ì¤ë¤Î¤Ç)¡£ Â礭¤Ê¥Æ¡¼¥Ö¥ë¤Ç¤Ï¡¢
-¤ª¤ª¤è¤½¤Îͽ¬¤È¤·¤Æ¡¢(B++ ¥Ä¥ê¡¼¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç)¡¢
-@code{log(row_count) /
-log(index_block_length / 3 * 2 / (index_length + data_pointer_length)) +
-1} ¥·¡¼¥¯¡¢1¥ì¥³¡¼¥É¤ò¸«¤Ä¤±¤ë¤Î¤ËɬÍפȤʤë¤Ç¤·¤ç¤¦¡£
-
-@strong{MySQL} ¤Ç¤Ï¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¡¦¥Ö¥í¥Ã¥¯¤ÏÄ̾ï 1024 ¥Ð¥¤¥È¤Ç¡¢
-¥Ç¡¼¥¿¡¦¥Ý¥¤¥ó¥¿¡¼¤ÏÄ̾ï 4 ¥Ð¥¤¥È¤Ç¤¹¡£ ¤³¤ì¤Ï¡¢
-¥¤¥ó¥Ç¥Ã¥¯¥¹Ä¹¤¬ 3 (medium integer) ¡¢¥Ç¡¼¥¿¤¬ 500,000 ¥ì¥³¡¼¥É¤¢¤ë¥Æ¡¼¥Ö¥ë¤Ç¤Ï¡¢
-@code{log(500,000)/log(1024/3*2/(3+4)) + 1} = 4 ¥·¡¼¥¯¤È¤Ê¤ê¤Þ¤¹¡£
-
-As the above index would require about 500,000 * 7 * 3/2 = 5.2M,
-(assuming that the index buffers are filled to 2/3 (which is typical) )
-you will probably have much of the index in memory and you will probably
-only need 1-2 calls to read data from the OS to find the row.
-
-½ñ¤­¹þ¤ß»þ¤Ë¤Ï¡¢¾å¤Î¾ì¹ç¡¢¿·¤·¤¤¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò½ñ¤­¹þ¤á¤ë¾ì½ê¤ò
-õ¤·½Ð¤¹¤Î¤Ë¡¢4 ¥·¡¼¥¯¤«¤«¤ê¡¢¤µ¤é¤Ë¡¢Ä̾¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò¹¹¿·¤·¡¢
-¥ì¥³¡¼¥É¤ò½ñ¤¯¤Î¤Ë 2 ¥·¡¼¥¯É¬ÍפǤ¹¡£
-
-Note that the above doesn't mean that your application will slowly
-degenerate by N log N! As long as everything is cached by the OS or SQL
-server things will only go marginally slower while the table gets
-bigger. After the data gets too big to be cached, things will start to
-go much slower until your applications is only bound by disk-seeks
-(which increase by N log N). To avoid this, increase the index cache as
-the data grows. @xref{Server parameters}.
-
-@node SELECT speed, Where optimizations, Estimating performance, Query Speed
-@subsection @code{SELECT} ¥¯¥¨¥ê¤Î®ÅÙ
-
-Ä̾ÃÙ¤¤ @code{SELECT ... WHERE} ¤ò®¤¯¤¹¤ë¤Ë¤Ï¡¢
-¤Þ¤ººÇ½é¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬¤¢¤ë¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£@xref{MySQL
-indexes, , @strong{MySQL} indexes}.
-°ã¤¦¥Æ¡¼¥Ö¥ë¤ò»²¾È¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢ÉáÄ̤ϥ¤¥ó¥Ç¥Ã¥¯¥¹¤ò¤È¤â¤Ê¤¦¤Ù¤­¤Ç¤¹¡£
-@code{EXPLAIN} ¥³¥Þ¥ó¥É¤ò»ÈÍѤ¹¤ì¤Ð¡¢@code{SELECT} ¤Ç¤É¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬
-»ÈÍѤµ¤ì¤Æ¤¤¤ë¤«³Îǧ¤Ç¤­¤Þ¤¹¡£
-@xref{EXPLAIN, , @code{EXPLAIN}}.
-
-Some general tips:
-
-@itemize @bullet
-@item
-To help @strong{MySQL} optimize queries better, run @code{myisamchk
---analyze} on a table after it has been loaded with relevant data. This
-updates a value for each index part that indicates the average number of
-rows that have the same value. (For unique indexes, this is always 1,
-of course.). @strong{MySQL} will use this to decide which index to
-choose when you connect two tables with 'a non-constant expression'.
-You can check the result from the @code{analyze} run by doing @code{SHOW
-INDEX FROM table_name} and examining the @code{Cardinality} column.
-
-@item
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤È¥Ç¡¼¥¿¤ò¥¤¥ó¥Ç¥Ã¥¯¥¹½ç¤Ë½¾¤Ã¤Æ¥½¡¼¥È¤¹¤ë¤Ë¤Ï¡¢
-@code{myisamchk --sort-index --sort-records=1} ¤ò»ÈÍѤ·¤Þ¤¹
-(¤â¤· £±ÈÖÌܤΥ¤¥ó¥Ç¥Ã¥¯¥¹½ç¤Ë¥½¡¼¥È¤¹¤ë¤Ê¤é)¡£
-If you
-have a unique index from which you want to read all records in order
-according to that index, this is a good way to make that faster.
-¤·¤«¤·¡¢¤³¤Î¥½¡¼¥ÈÊýË¡¤ÏºÇŬ¾õÂ֤ǤϽñ¤«¤ì¤º¡¢¤Þ¤¿Â礭¤Ê¥Æ¡¼¥Ö¥ë¤Ç¤Ï
-¿¤¯¤Î»þ´Ö¤¬¤«¤«¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡ª
-@end itemize
-
-@cindex Optimizations
-@node Where optimizations, LEFT JOIN optimization, SELECT speed, Query Speed
-@subsection MySQL ¤Ï¤É¤Î¤è¤¦¤Ë @code{WHERE} Àá¤òºÇŬ²½¤¹¤ë¤«¡©
-
-@code{WHERE} ¤ÎºÇŬ²½¤Ï¡¢@code{WHERE} ¤¬¤Û¤È¤ó¤É @code{SELECT} ¤Ç»ÈÍѤµ¤ì¤ë¤¿¤á¡¢
-@code{SELECT} ¤ËÃÖ¤«¤ì¤Æ¤¤¤Þ¤¹¡£ ¤·¤«¤·¡¢Æ±¤¸ºÇŬ²½¤Ï
-@code{DELETE} ¤ä @code{UPDATE} ʸ¤Ç¤â»ÈÍѤµ¤ì¤Þ¤¹¡£
-
-¤³¤Î¥»¥¯¥·¥ç¥ó¤ÎºÇŬ²½¤ÎÀâÌÀ¤Ï¤Þ¤ÀÉÔ½½Ê¬¤Ç¤¹¡£
-¤Ê¤¼¤Ê¤é¡¢ @strong{MySQL} ¤Ï¤È¤Æ¤â¿¤¯¤ÎºÇŬ²½¤ò¹Ô¤Ã¤Æ¤ª¤ê¡¢
-¤½¤ì¤éÁ´¤Æ¤Ë¤Ä¤¤¤Æ¤ÎÀâÌÀ¤ò½ñ¤±¤ë»þ´Ö¤¬¡¢²æ¡¹¤Ï¤È¤ì¤Þ¤»¤ó¡£
-
-@strong{MySQL}¤Ë¤è¤ëºÇŬ²½¤Î¤¤¤¯¤Ä¤«¤ò°Ê²¼¤Ë¼¨¤·¤Þ¤¹:
-
-@itemize @bullet
-@item
-³ç¸Ì¤Î½üµî (Á´¤Æ¤ÎÉÔɬÍפʳç¸Ì¤Ïºï½ü¤µ¤ì¤Þ¤¹):
-@example
- ((a AND b) AND c OR (((a AND b) AND (c AND d))))
--> (a AND b AND c) OR (a AND b AND c AND d)
-@end example
-@item
-Äê¿ô¤ÎÊÝ»ý:
-@example
- (a<b AND b=c) AND a=5
--> b>5 AND b=c AND a=5
-@end example
-@item
-Äê¿ô¾ò·ï¤Î½üµî (Äê¿ôÊÝ»ý¤Î¤¿¤á¤ËɬÍפȤµ¤ì¤Þ¤¹):
-@example
- (B>=5 AND B=5) OR (B=6 AND 5=5) OR (B=7 AND 5=6)
--> B=5 OR B=6
-@end example
-@item
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ë»ÈÍѤµ¤ì¤ëÁ´¤Æ¤Îɽ¸½¤Ï°ìÅÙ¤À¤±É¾²Á¤µ¤ì¤Þ¤¹¡£
-@item
-°ì¤Ä¤Î¥Æ¡¼¥Ö¥ë¾å¤Î @code{WHERE} ¤¬¤Ê¤¤ @code{CONST(*)} ¤Ï¡¢¥Æ¡¼¥Ö¥ë¤«¤é
-ľÀܼè¤ê½Ð¤µ¤ì¤Þ¤¹¡£¤³¤ì¤Ï¤Þ¤¿Æ±¤¸¾ò·ï²¼¤Ç¤ÎǤ°Õ¤Î @code{NOT NULL} ɽ¸½
-¤Î¤¿¤á¤Ë¤â¹Ô¤ï¤ì¤Þ¤¹¡£
-@item
-ÉÔÅö¤ÊÄê¿ôɽ¸½¤ÏÁ᤯¸¡½Ð¤µ¤ì¤Þ¤¹¡£
-@strong{MySQL} ¤ÏÉÔ²Äǽ¤Ê @code{SELECT} ¹½Ê¸¤òÁÇÁ᤯¸«¤Ä¤±¡¢0 ¹Ô¤ò·ë²Ì¤È¤·¤ÆÊÖ¤·¤Þ¤¹¡£
-@item
-@code{GROUP BY} ¤Þ¤¿¤Ï group ´Ø¿ô (@code{COUNT()}, @code{MIN()}...) ¤ò»ÈÍѤ·¤Ê¤¤¾ì¹ç¤Ï¡¢
-@code{HAVING} ¤Ï @code{WHERE} ¤È¥Þ¡¼¥¸¤µ¤ì¤Þ¤¹¡£
-@item
-³Æ¥µ¥Ö·ë¹ç¤Ë¤Ä¤¤¤Æ¤Î®¤¤ @code{WHERE} ɾ²Á¤òÆÀ¤ë¤¿¤á¤Ë¡¢¤Þ¤¿¡¢²Äǽ¤Ê¸Â¤ê
-Á᤯¥ì¥³¡¼¥É¤ò¥¹¥­¥Ã¥×¤¹¤ë¤¿¤á¤Ë¡¢³Æ¥µ¥Ö·ë¹ç¤Ë¤Ä¤¤¤Æ¤è¤ê´Êñ¤Ê
-@code{WHERE} ¤¬¹½ÃÛ¤µ¤ì¤Þ¤¹¡£
-@cindex Constant table
-@cindex Table, constant
-@item
-Á´¤Æ¤ÎÄê¿ô¥Æ¡¼¥Ö¥ë¤ò¥¯¥¨¥ê¡¼Ãæ¤Î¾¤Î¥Æ¡¼¥Ö¥ë¤è¤êÀè¤ËÆɤߤޤ¹¡£
-Äê¿ô¥Æ¡¼¥Ö¥ë¤Ï¼¡¤Ç¤¹:
-@itemize @minus
-@item
-0 ¤Þ¤¿¤Ï 1 ¹Ô¤Î¥Æ¡¼¥Ö¥ë¡£
-@item
-@code{WHERE} Àá¤Ç @code{UNIQUE} ¥¤¥ó¥Ç¥Ã¥¯¥¹¤ä @code{PRIMARY KEY} ¤¬»ÈÍѤµ¤ì¤¿¥Æ¡¼¥Ö¥ë¤Ç¡¢
-¤«¤Ä¡¢Á´¤Æ¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬Äê¿ô¼°¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤Æ¡¢
-¤«¤Ä¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î¥Ñ¡¼¥È¤¬ @code{NOT NULL} ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¥Æ¡¼¥Ö¥ë¡£
-@end itemize
-°Ê²¼¤Î¥Æ¡¼¥Ö¥ë¤Î¤è¤¦¤ËÄê¿ô¤À¤±¤ò»ÈÍѤ¹¤ë¥Æ¡¼¥Ö¥ë:
-@example
-mysql> SELECT * FROM t WHERE primary_key=1;
-mysql> SELECT * FROM t1,t2
- WHERE t1.primary_key=1 AND t2.primary_key=t1.id;
-@end example
-
-@item
-¥Æ¡¼¥Ö¥ë¤ò·ë¹ç¤¹¤ë¤¿¤á¤ËºÇÎɤηë¹ç¤ÎÁȹ礻¤ò¸«¤Ä¤±¤Þ¤¹¡£Á´¤Æ¤Î²ÄǽÀ­¤ò»î¤·¤Æ ¡£
-@code{ORDER BY} ¤Þ¤¿¤Ï @code{GROUP} Æâ¤ÎÁ´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤¬Æ±¤¸¥Æ¡¼¥Ö¥ë¤Î¾ì¹ç¤Ï¡¢
-¤³¤Î¥Æ¡¼¥Ö¥ë¤Ï·ë¹ç»þ¤ËºÇ½é¤ËÍ¥À褵¤ì¤Þ¤¹¡£
-@item
-@code{ORDER BY} Àá¤È @code{GROUP BY} À᤬¤¢¤ë¾ì¹ç¡¢¤Þ¤¿¤Ï @code{ORDER BY} ¤« @code{GROUP BY} ¤¬·ë¹ç¥­¥å¡¼
-Æâ¤ÎºÇ½é¤Î¥Æ¡¼¥Ö¥ë¤Ç¤Ï¤Ê¤¤Â¾¤Î¥Æ¡¼¥Ö¥ë¤«¤é¤Î¹àÌܤò´Þ¤à¾ì¹ç¡¢°ì»þ¥Æ¡¼¥Ö¥ë¤¬À¸À®¤µ¤ì¤Þ¤¹¡£
-@item
-¤â¤· @code{SQL_SMALL_RESULT} ¤ò»ÈÍѤ¹¤ë¤Ê¤é, @strong{MySQL} ¤Ï¥á¥â¥ê¡¼Æâ¤Î°ì¼¡¥Æ¡¼¥Ö¥ë¤ò
-»ÈÍѤ·¤Þ¤¹
-@item
-@code{DISTINCT} ¤Ï¡¢Á´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤ËÂФ¹¤ë @code{GROUP BY} ¤ËÊÑ´¹¤µ¤ì¤ë¤¿¤á¡¢
-@code{ORDER BY} ¤È¹ç¤ï¤·¤¿ @code{DISTINCT} ¤Ï¿¤¯¤Î¾ì¹ç¤Ç°ì»þ¥Æ¡¼¥Ö¥ë¤¬
-ɬÍפˤʤê¤Þ¤¹¡£
-@item
-³Æ¥Æ¡¼¥Ö¥ë¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï¥¯¥¨¥ê¤µ¤ì¡¢ÆÀ¤é¤ì¤ë¹Ô¤Î 30% ̤Ëþ¤ÎÉý¤·¤«¤Ê¤¤ºÇÎɤΥ¤¥ó¥Ç¥Ã¥¯¥¹¤¬»ÈÍѤµ¤ì¤Þ¤¹¡£
-¤½¤Î¤è¤¦¤Ê¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬¸«¤Ä¤±¤é¤ì¤Ê¤¤¾ì¹ç¡¢ÁÇÁᤤ¥Æ¡¼¥Ö¥ë¤ÎÁöºº(quick table scan)¤¬»ÈÍѤµ¤ì¤Þ¤¹¡£
-@item
-Ʊ¤¸¤è¤¦¤Ë¡¢@strong{MySQL} ¤Ï¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤òÅù¤·¤¯Ä´¤Ù¤Ï¤·¤Ê¤¤¥¤¥ó¥Ç¥Ã¥¯¥¹¤«¤é
-¥ì¥³¡¼¥É¤òÆɤळ¤È¤¬²Äǽ¤Ç¤¹¡£¤â¤·Á´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤¬¿ôÃÍ·¿¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ê¤é¡¢
-¥¤¥ó¥Ç¥Ã¥¯¥¹¥Ä¥ê¡¼¤À¤±¤¬¥¯¥¨¥ê¤Î²ò·è¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£
-@item
-³Æ¥ì¥³¡¼¥É¤¬½ÐÎϤµ¤ì¤ëÁ°¤Ë¡¢@code{HAVING} Àá¤ËŬ¹ç¤¹¤ë¤â¤Î¤ò¥¹¥­¥Ã¥×¤·¤Þ¤¹¡£
-@end itemize
-
-°Ê²¼¤Ï¤È¤Æ¤â®¤¤¥¯¥¨¥ê¤ÎÎã¤Ç¤¹:
-
-@example
-mysql> SELECT COUNT(*) FROM tbl_name;
-mysql> SELECT MIN(key_part1),MAX(key_part1) FROM tbl_name;
-mysql> SELECT MAX(key_part2) FROM tbl_name
- WHERE key_part_1=constant;
-mysql> SELECT ... FROM tbl_name
- ORDER BY key_part1,key_part2,... LIMIT 10;
-mysql> SELECT ... FROM tbl_name
- ORDER BY key_part1 DESC,key_part2 DESC,... LIMIT 10;
-@end example
-
-°Ê²¼¤Î¥¯¥¨¥ê¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹¥Ä¥ê¡¼¤Î¤ß¤ò»ÈÍѤ·¤Þ¤¹(¥¤¥ó¥Ç¥Ã¥¯¥¹²½¤µ¤ì¤Æ¤¤¤ë¥Õ¥£¡¼¥ë¥É¤Ï
-¿ôÃÍ·¿¤È²¾Äꤷ¤Þ¤¹)¡§
-
-@example
-mysql> SELECT key_part1,key_part2 FROM tbl_name WHERE key_part1=val;
-mysql> SELECT COUNT(*) FROM tbl_name
- WHERE key_part1=val1 AND key_part2=val2;
-mysql> SELECT key_part2 FROM tbl_name GROUP BY key_part1;
-@end example
-
-°Ê²¼¤Î¥¯¥¨¥ê¤Ï¡¢¥½¡¼¥È¤µ¤ì¤¿¹Ô¤Î¸¡º÷¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ·¤Þ¤¹¡§
-
-@example
-mysql> SELECT ... FROM tbl_name ORDER BY key_part1,key_part2,...
-mysql> SELECT ... FROM tbl_name ORDER BY key_part1 DESC,key_part2 DESC,...
-@end example
-
-@node LEFT JOIN optimization, LIMIT optimization, Where optimizations, Query Speed
-@subsection MySQL ¤Ï¤É¤Î¤è¤¦¤Ë @code{LEFT JOIN} ¤òºÇŬ²½¤¹¤ë¤«¡©
-
-@code{A LEFT JOIN B} ¤Ï @strong{MySQL} ¤Ë°Ê²¼¤Î¤è¤¦¤ËÁȤߤ³¤Þ¤ì¤Æ¤¤¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-The table @code{B} is set to be dependent on table @code{A} and all tables
-that @code{A} is dependent on.
-@item
-¥Æ¡¼¥Ö¥ë @code{A} ¤¬ @code{LEFT JOIN} ¾ò·ïÃæ¤Ë»ÈÍѤµ¤ì¤ëÁ´¤Æ¤Î¥Æ¡¼¥Ö¥ë
-¡Ê¤¿¤À¤· @code{B} ¤Ï½ü¤¯¡Ë¤Ë°Í¸¤¹¤ë¤È¡¢¥»¥Ã¥È¤µ¤ì¤Þ¤¹¡£
-@item
-Á´¤Æ¤Î @code{LEFT JOIN} ¾ò·ï¤¬ @code{WHERE} Àá¤Ë°ÜÆ°¤µ¤ì¤Þ¤¹¡£
-@item
-All standard join optimizations are done, with the exception that a table is
-always read after all tables it is dependent on. If there is a circular
-dependence then @strong{MySQL} will issue an error.
-@item
-Á´¤Æ¤Î @code{WHERE} Àá¤ÎºÇŬ²½¤¬¹Ô¤ï¤ì¤Þ¤¹¡£
-@item
-@code{WHERE} Àá¤Ë¥Þ¥Ã¥Á¤¹¤ë¥ì¥³¡¼¥É¤¬ @code{A} ¤Ë¤¢¤ê¡¢
-@code{LEFT JOIN} ¾ò·ï¤Ë¥Þ¥Ã¥Á¤¹¤ë¥ì¥³¡¼¥É¤¬ @code{B} ¤Ë¤Ê¤¤¾ì¹ç¡¢
-Á´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤¬ @code{NULL} ¤Ë¥»¥Ã¥È¤µ¤ì¤¿ @code{B} ¤Î¥ì¥³¡¼¥É¤¬
-ºîÀ®¤µ¤ì¤Þ¤¹¡£
-@item
-If you use @code{LEFT JOIN} to find rows that doesn't exist in some
-table and you have the following test: @code{column_name IS NULL} in the
-@code{WHERE} part, where column_name is a column that is declared as
-@code{NOT NULL}, then @code{MySQL} will stop searching after more rows
-(for a particular key combination) after it has found one row that
-matches the @code{LEFT JOIN} condition.
-@end itemize
-
-The table read order forced by @code{LEFT JOIN} and @code{STRAIGHT JOIN} will help
-the join optimizer (which calculates in which order tables should be joined) to do
-its work much more quickly as there are fewer table permutations to check.
-
-Note that the above means that if you do a query of type:
-
-@example
-SELECT * FROM a,b LEFT JOIN c ON (c.key=a.key) LEFT JOIN d (d.key=a.key) WHERE b.key=d.key
-@end example
-
-Then @strong{MySQL} will do a full scan on @code{b} as the @code{LEFT JOIN} will
-force it to be read before @code{d}.
-
-The fix in this case is to change the query to:
-
-@example
-SELECT * FROM b,a LEFT JOIN c ON (c.key=a.key) LEFT JOIN d (d.key=a.key) WHERE b.key=d.key
-@end example
-
-@node LIMIT optimization, Insert speed, LEFT JOIN optimization, Query Speed
-@subsection MySQL ¤Ï¤É¤Î¤è¤¦¤Ë @code{LIMIT} ¤òºÇŬ²½¤¹¤ë¤«¡©
-
-In some cases @strong{MySQL} will handle the query differently when you are
-using @code{LIMIT #} and not using @code{HAVING}:
-
-@itemize @bullet
-@item
-¤â¤· @code{LIMIT} ¤ò»ÈÍѤ·¤Æ¸ÂÄꤷ¤¿¿ô¤À¤± select ¤ò¹Ô¤¦¤Ê¤é¡¢ @strong{MySQL} ¤Ï¡¢
-¤¢¤ë¾ì¹ç¡¢¥Æ¡¼¥Ö¥ë¤òÁ´¤ÆÁöºº¤¹¤ë¤è¤ê¤â¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ·¤è¤¦¤È¤·¤Þ¤¹¡£
-@item
-¤â¤· @code{LIMIT #} ¤ò @code{ORDER BY} ¤È¶¦¤Ë»ÈÍѤ¹¤ë¤Ê¤é, @strong{MySQL} ¤Ï
-ºÇ½é¤Î @code{#} ¹Ô¤ò¸«¤Ä¤±¤¿¤é¤¹¤°¤Ë¡¢Á´¥Æ¡¼¥Ö¥ë¤Î¥½¡¼¥È¤Ï¹Ô¤ï¤º¤Ë¡¢
-¥½¡¼¥È¤ò½ª¤ï¤é¤»¤Þ¤¹¡£
-@item
-@code{LIMIT #} ¤ò @code{DISTINCT} ¤È¶¦¤Ë»ÈÍѤ¹¤ë¤Ê¤é, @strong{MySQL} ¤Ï
-@code{#} ¸Ä¤Î°ì°Õ¤Ê¥ì¥³¡¼¥É¤ò¸«¤Ä¤±¤¿»þÅÀ¤Ç½ª¤ï¤ê¤Þ¤¹¡£
-@item
-In some cases a @code{GROUP BY} can be resolved by reading the key in order
-(or do a sort on the key) and then calculate summaries until the
-key value changes. In this case @code{LIMIT #} will not calculate any
-unnecessary @code{GROUP BY}'s.
-@item
-@strong{MySQL} ¤Ï¡¢ºÇ½é¤Î @code{#} ¹Ô¤ò¥¯¥é¥¤¥¢¥ó¥È¤ËÁ÷¤Ã¤¿¤¢¤Èľ¤Ë¡¢
-¥¯¥¨¥ê¤òÃæÃǤ·¤Þ¤¹¡£
-@item
-@code{LIMIT 0} ¤Ï¾ï¤ËÁÇÁ᤯¶õ¤Î·ë²Ì¤òÊÖ¤·¤Þ¤¹¡£
-¤³¤ì¤Ï¥¯¥¨¥ê¤Î¥Á¥§¥Ã¥¯¤ä·ë²Ì¤È¤·¤ÆÆÀ¤é¤ì¤ë¥Õ¥£¡¼¥ë¥É¤Î·¿¤òÆÀ¤ë¤¿¤á¤ËÍøÍѤǤ­¤Þ¤¹¡£
-@item
-°ì»þ¥Æ¡¼¥Ö¥ë¤ÎÂ礭¤µ¤Ï¡¢¥¯¥¨¥ê¤ò²ò·è¤¹¤ë¤¿¤á¤Ë¤É¤ì¤°¤é¤¤¤Î¥¹¥Ú¡¼¥¹¤¬¤¤¤ë¤«¤ò
-·×»»¤¹¤ë¤Î¤Ë¡¢@code{LIMIT #} ¤ò»ÈÍѤ·¤Þ¤¹¡£
-@end itemize
-
-@node Insert speed, Update speed, LIMIT optimization, Query Speed
-@subsection @code{INSERT} ¥¯¥¨¥ê¤Î®ÅÙ
-
-¥ì¥³¡¼¥É¤òÁÞÆþ¤¹¤ë»þ´Ö¤Ï¤ª¤ª¤è¤½¼¡¤«¤é¤Ê¤ê¤Þ¤¹:
-
-@itemize @bullet
-@item
-Àܳ: (3)
-@item
-¥¯¥¨¥ê¤ò¥µ¡¼¥Ð¤ØÁ÷¿®: (2)
-@item
-¥¯¥¨¥ê¤Î²òÀÏ: (2)
-@item
-¥ì¥³¡¼¥É¤ÎÁÞÆþ: (1 x size of record)
-@item
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎÁÞÆþ: (1 x number of indexes)
-@item
-¥¯¥í¡¼¥º: (1)
-@end itemize
-
-¤³¤³¤Ç (¿ô»ú) ¤ÏÈæÎã»þ´Ö¤Ç¤¹¡£¤³¤ì¤Ï¡¢¥Æ¡¼¥Ö¥ë¤Î¥ª¡¼¥×¥ó¤Ë¤«¤«¤ë½é´ü¥ª¡¼¥Ð¡¼¥Ø¥Ã
-¥É(¤³¤ì¤ÏƱ»þ¤ËÆ°ºî¤¹¤ë³Æ¥¯¥¨¥êËè¤Ë1²ó¹Ô¤Ê¤ï¤ì¤Þ¤¹)¤Ï¹Í褵¤ì¤Æ¤¤¤Þ¤»¤ó¡£
-
-¥Æ¡¼¥Ö¥ë¤Î¥µ¥¤¥º¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎÁÞÆþ¤ò N log N ¤ÇÃÙ¤¯¤·¤Þ¤¹ (B-tree)¡£
-
-INSERT ¤ò®¤¯¤¹¤ë¤¤¤¯¤Ä¤«¤ÎÊýË¡¡§
-
-@itemize @bullet
-@item
-¤â¤·Æ±¤¸¥¯¥é¥¤¥¢¥ó¥È¤«¤é¿¤¯¤Î¥ì¥³¡¼¥É¤òƱ»þ¤Ë¥¤¥ó¥µ¡¼¥È¤¹¤ë¤Ê¤é¡¢
-Ê£¿ô¤ÎÃͤ¬½ñ¤±¤ë @code{INSERT} ʸ¤ò»ÈÍѤ·¤Þ¤¹¡£ ¤³¤ì¤Ï¸Ä¡¹¤Ë @code{INSERT} ʸ
-¤òȯ¹Ô¤¹¤ë¾ì¹ç¤ËÈæ¤Ù¤Æ¡¢¤È¤Æ¤â®¤¯¤Ê¤ê¤Þ¤¹¡£
-@item
-¤â¤·°ã¤¦¥¯¥é¥¤¥¢¥ó¥È¤«¤é¿¤¯¤Î¥ì¥³¡¼¥É¤òƱ»þ¤Ë¥¤¥ó¥µ¡¼¥È¤¹¤ë¤Ê¤é¡¢
- @code{INSERT DELAYED} ʸ¤Î»ÈÍѤǡ¢¤è¤ê®¤¯¤Ê¤ë¤Ç¤·¤ç¤¦¡£ @xref{INSERT,
-, @code{INSERT}}.
-@item
-@code{MyISAM} ¤Ç¤Ï¡¢Ê£¿ô¤Î @code{SELECT} ¤¬Áö¤Ã¤Æ¤¤¤ë¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ¡¢
-Ʊ»þ¤Ë¡¢¥ì¥³¡¼¥É¤òÁÞÆþ¤Ç¤­¤Þ¤¹¡£ ¤¿¤À¤·¤½¤Î¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ
-¥ì¥³¡¼¥É¤Îºï½ü¤¬¤Ê¤¤¾ì¹ç¤Ë¡£
-@item
-¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤«¤é¥Æ¡¼¥Ö¥ë¤Ë¥Ç¡¼¥¿¤ò¤¤¤ì¤ë¾ì¹ç¤Ï¡¢ @code{LOAD DATA INFILE} ¤ò
-»ÈÍѤ·¤Þ¤¹¡£ ¤³¤ì¤Ï¤¿¤¯¤µ¤ó¤Î @code{INSERT} ʸ¤Îȯ¹Ô¤ËÈæ¤Ù¤ÆÄ̾ï 20ÇÜ ÄøÅÙ
-®¤¯¤Ê¤ê¤Þ¤¹
-@xref{LOAD DATA, , @code{LOAD DATA}}.
-@item
-¥Æ¡¼¥Ö¥ë¤¬Â¿¤¯¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢¤¢¤ëÊýË¡¤Ç¡¢ @code{LOAD DATA INFILE} ¤Î
-¼Â¹Ô¤ò®¤¯¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£
-°Ê²¼¤Î¼ê½ç¤Ç¹Ô¤¤¤Þ¤¹¡§
-
-@enumerate
-@item
-Optionally create the table with @code{CREATE TABLE}. For example using
-@code{mysql} or Perl-DBI.
-
-@item
-@code{FLUSH TABLES} ¤Î¼Â¹Ô¡£ ¤¢¤ë¤¤¤Ï @code{mysqladmin flush-tables}
-¥³¥Þ¥ó¥É¤Î¼Â¹Ô¡£
-
-@item
-@code{myisamchk --keys-used=0 -rq /path/to/db/tbl_name} ¤Î»ÈÍÑ¡£
-¤³¤ì¤Ï»ØÄꤵ¤ì¤¿¥Æ¡¼¥Ö¥ë¤«¤éÁ´¤Æ¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤òºï½ü¤·¤Þ¤¹¡£
-
-@item
-¤½¤Î¥Æ¡¼¥Ö¥ë¤Ë @code{LOAD DATA INFILE} ¤ò»ÈÍѤ·¤Æ¥Ç¡¼¥¿¤òÆþ¤ì¤Þ¤¹.
-¤³¤ì¤Ï¤¤¤«¤Ê¤ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤â¹¹¿·¤·¤Ê¤¤¤Ç¤·¤ç¤¦¤·¡¢¤½¤Î¤¿¤á¡¢Â®¤¯¤â¤Ê¤ë¤Ç¤·¤ç¤¦¡£
-
-@item
-¤â¤· @code{myisampack} ¤ò¤ª»ý¤Á¤Ç¡¢¥Æ¡¼¥Ö¥ë¤ò°µ½Ì¤·¤¿¤¤¤Ê¤é¡¢
-@code{myisampack} ¤ò¼Â¹Ô¤·¤Þ¤¹. @xref{Compressed format}.
-
-@item
-@code{myisamchk -r -q /path/to/db/tbl_name} ¤Ç¥¤¥ó¥Ç¥Ã¥¯¥¹¤òºÆ¹½ÃÛ.
-¤³¤ì¤Ï disk ¤Ë½ñ¤­¹þ¤àÁ°¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò¥á¥â¥ê¤ËºîÀ®¤·¤Þ¤¹¡£
-¤³¤ì¤Ï¿¤¯¤Î¥Ç¥£¥¹¥¯¥·¡¼¥¯¤òÈò¤±¤ë¤³¤È¤¬½ÐÍè¤ë¤Î¤Ç¤È¤Æ¤â®¤¯¤Ê¤ê¤Þ¤¹¡£
-¤Ç¤­¾å¤¬¤Ã¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹¥Ä¥ê¡¼¤Ï¡¢¥Ð¥é¥ó¥¹¤Î¤è¤¤¤â¤Î¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-@item
-@code{FLUSH TABLES} ¤Î¼Â¹Ô¡£ ¤¢¤ë¤¤¤Ï @code{mysqladmin flush-tables}
-¥³¥Þ¥ó¥É¤Î¼Â¹Ô¡£
-@end enumerate
-
-¤³¤Î¼ê½ç¤Ï¡¢¾­Íè¤Î MySQL ¤Î @code{LOAD DATA INFILE} ¤ËÁȤ߹þ¤à¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-@item
-¥Æ¡¼¥Ö¥ë¤ò¥í¥Ã¥¯¤¹¤ë¤³¤È¤Ç¡¢ÁÞÆþ¤ò®¤¯¤¹¤ë¤³¤È¤â²Äǽ¤Ç¤¹¡§
-
-@example
-mysql> LOCK TABLES a WRITE;
-mysql> INSERT INTO a VALUES (1,23),(2,34),(4,33);
-mysql> INSERT INTO a VALUES (8,26),(6,29);
-mysql> UNLOCK TABLES;
-@end example
-
-¼ç¤Ê®ÅÙº¹¤Ï¡¢Á´¤Æ¤Î @code{INSERT} ¹½Ê¸¤Ç¥¤¥ó¥Ç¥Ã¥¯¥¹¥Ð¥Ã¥Õ¥¡¤¬°ìÅÙ¤À¤±¥Ç¥£¥¹¥¯¤Ë¥Õ
-¥é¥Ã¥·¥å¤µ¤ì¤ë¤³¤È¤Ç¤¹¡£Ä̾ï¤Ï @code{INSERT} ¹½Ê¸¤¬¤¢¤ë¤Î¤ÈƱ¤¸¤¯¤é¤¤Â¿¤¯¤Î¥¤¥ó¥Ç¥Ã
-¥¯¥¹¥Ð¥Ã¥Õ¥¡¥Õ¥é¥Ã¥·¥å¤¬¤¢¤ê¤Þ¤¹¡£Ã±°ì¹½Ê¸¤ÎÁ´¤Æ¤Î¥ì¥³¡¼¥É¤Ï¡¢¥í¥Ã¥¯¤Ê¤·¤ÇÁÞÆþ¤Ç¤­¤Þ¤¹¡£
-
-¥í¥Ã¥¯¤âÊ£¿ôÀܳ¥Æ¥¹¥È¤Î¹ç·×»þ´Ö¤òÄ㤯¤·¤Þ¤¹¤¬¡¢¤¤¤¯¤Ä¤«¤Î¥¹¥ì¥Ã¥É¤ÎºÇÂç
-ÂÔ¤Á»þ´Ö¤Ï¾å¤¬¤ê¤Þ¤¹(¥í¥Ã¥¯¤òÂԤäƤ¤¤ë¤«¤é)¡£
-Î㤨¤Ð:
-
-@example
-thread 1 does 1000 inserts
-thread 2, 3, and 4 does 1 insert
-thread 5 does 1000 inserts
-@end example
-
-¥í¥Ã¥¯¤ò»ÈÍѤ·¤Ê¤¤¾ì¹ç¡¢2, 3 ¤½¤·¤Æ 4 ¤Ï 1 ¤È 5 ¤ÎÁ°¤Ë½ª¤ê¤Þ¤¹¡£¥í¥Ã¥¯¤ò
-»ÈÍѤ¹¤ë¾ì¹ç¡¢2,3,4 ¤Ï 1 ¤ä 5 ¤ÎÁ°¤Ë½ª¤ï¤ë¤³¤È¤Ï¤ª¤½¤é¤¯¤¢¤ê¤Þ¤»¤ó¤¬¡¢¹ç
-·×»þ´Ö¤ÏÌó 40 % ®¤¯¤Ê¤ê¤Þ¤¹¡£
-
-@code{INSERT}, @code{UPDATE} , @code{DELETE} ¤Ï¡¢ @strong{MySQL} ¤Ç¤Ï¤È¤Æ¤â®¤¤¤Î¤Ç¡¢
-1 ¹Ô¤ÇÌó 5 ¤Ä°Ê¾å¡¢Ãͤò ÁÞÆþ¡¦¹¹¿· ¤ò¤¹¤ëÁàºî¤ËÂФ·¤Æ¡¢
-¥í¥Ã¥¯¤òÄɲ乤ì¤Ð¡¢Á´ÈÌŪ¤Ë¤è¤êÎɤ¤À­Ç½¤¬ÆÀ¤é¤ì¤Þ¤¹¡£
-¤È¤Æ¤â¿¤¤ insert ¤ò¹Ô¤Ê¤¦¾ì¹ç¡¢
-¾¤Î¥¹¥ì¥Ã¥É¤Ë¤½¤Î¥í¥Ã¥¯¤·¤¿¥Æ¡¼¥Ö¥ë¤Ø¤Î¥¢¥¯¥»¥¹¤òÍ¿¤¨¤ë¤¿¤á¤Ë ¡¢
-¤À¤¤¤¿¤¤ 1000 ¥ì¥³¡¼¥É¤´¤È¤Ë°ìÅÙ¡¢@code{UNLOCK TABLES} ¤·¤¿¸å¤Ë
- @code{LOCK TABLES} ¤ò¹Ô¤¤¤Þ¤¹¡£ ¤³¤ì¤Ç¤â¤Þ¤ÀÎɤ¤À­Ç½¤¬ÆÀ¤é¤ì¤Þ¤¹¡£
-
-¤â¤Á¤í¤ó @code{LOAD DATA INFILE} ¤Ï¤È¤Æ¤â®¤¤¤Ç¤¹¡£
-@end itemize
-
-@code{LOAD DATA INFILE} ¤È @code{INSERT} ¤ò¶¦¤Ë®¤¯¤¹¤ë¤¿¤á¤Ë¤Ï¡¢
-¥­¡¼¥Ð¥Ã¥Õ¥¡¤òÁý¤ä¤·¤Þ¤¹¡£ @xref{Server parameters}.
-
-@node Update speed, Delete speed, Insert speed, Query Speed
-@subsection @code{UPDATE} ¥¯¥¨¥ê¤Î®ÅÙ
-
-@code{UPDATE} ¥¯¥¨¥ê¤Ï @code{SELECT} ¥¯¥¨¥ê¤Î¤è¤¦¤ËºÇŬ²½¤µ¤ì¤Þ¤¹¤¬¡¢
-½ñ¤­¹þ¤ß¤Î¥ª¡¼¥Ð¡¼¥Ø¥Ã¥É¤¬²Ã¤ï¤ê¤Þ¤¹¡£
-½ñ¤­¹þ¤ß®Å٤ϡ¢¹¹¿·¤µ¤ì¤ë¥Ç¡¼¥¿¤ÎÂ礭¤µ¡¢¹¹¿·¤µ¤ì¤ë¥¤¥ó¥Ç¥Ã¥¯¥¹¿ô¤Ë
-°Í¤ê¤Þ¤¹¡£ Êѹ¹¤µ¤ì¤Ê¤¤¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï¹¹¿·¤µ¤ì¤Þ¤»¤ó¡£
-
-Also another way to get fast updates is to delay updates and then do
-many updates in a row later.
-°ìʸ¤Ç¿¤¯¤Î¹¹¿·¤ò¹Ô¤¨¤Ð¡¢¤â¤·¥Æ¡¼¥Ö¥ë¤¬¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ì¤Ð¡¢
-°ìʸ¤Ç°ì¸Ä¤Å¤Ä¹¹¿·¤¹¤ë¤è¤ê¤â¡¢¤È¤Æ¤â®¤¯¤Ê¤ê¤Þ¤¹¡£
-
-Note that, with dynamic record format, updating a record to
-a longer total length may split the record. So if you do this often
-it is very important to @code{OPTIMIZE TABLE} sometimes.
-@xref{OPTIMIZE TABLE, , @code{OPTIMIZE TABLE}}.
-
-@node Delete speed, , Update speed, Query Speed
-@subsection @code{DELETE} ¥¯¥¨¥ê¤Î®ÅÙ
-
-1¥ì¥³¡¼¥É¤òºï½ü¤¹¤ë»þ´Ö¤Ï¡¢¤Á¤ç¤¦¤É¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î¿ô¤ËÈæÎ㤷¤Þ¤¹¡£
-¤è¤ê®¤¯¥ì¥³¡¼¥É¤òºï½ü¤·¤¿¤¤¤Ê¤é¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¡¦¥­¥ã¥Ã¥·¥å¤ò
-Áý¤ä¤·¤Þ¤¹¡£ @xref{Server parameters}.
-
-¥Æ¡¼¥Ö¥ëÃ椫¤é¥ì¥³¡¼¥É¤ÎÂ礭¤ÊÉôʬ¤ò¾Ã¤¹¤è¤ê¤â¡¢
-Á´¤Æ¤Î¥ì¥³¡¼¥É¤ò¾Ã¤¹¤Û¤¦¤¬¡¢¤È¤Æ¤â®¤¤¤Ç¤¹¡£
-
-@node Tips, Benchmarks, Query Speed, Performance
-@section ºÇŬ²½¤Ë´Ø¤¹¤ë¤½¤Î¾¤Î½õ¸À
-
-Unsorted tips for faster systems:
-
-@itemize @bullet
-@item
-¥³¥Í¥¯¥·¥ç¥ó¥ª¡¼¥Ð¡¼¥Ø¥Ã¥É¤òÈò¤±¤ë¤¿¤á¤Ë¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ·¤Æ¡¢
-Ã༡¥³¥Í¥¯¥·¥ç¥ó¤òÍî¤È¤µ¤Ê¤¤¤è¤¦¤Ë¡¢¾ï¤ËÀܳ¤òÊݤÁ¤Þ¤¹¡£
-If you can't use persistent connections and you are doing a
-lot of new connections to the database, you may want to change the value
-of the @code{thread_cache_size} variable. @xref{Server parameters}.
-@item
-¤¢¤Ê¤¿¤Î¥¯¥¨¥ê¤¬¥Æ¡¼¥Ö¥ë¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ·¤Æ¤¤¤ë¤«¡¢¤¤¤Ä¤â¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£
-@strong{MySQL} ¤Ç¤Ï @code{EXPLAIN} ¥³¥Þ¥ó¥É¤Ç¤³¤ì¤¬¹Ô¤¨¤ì¤Þ¤¹¡£
-@xref{EXPLAIN, Explain, Explain, manual}.
-@item
-¤¿¤¯¤µ¤óÊѹ¹¤µ¤ì¤ë¤è¤¦¤Ê¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ¡¢Ê£»¨¤Ê @code{SELECT} ¥¯¥¨¥ê¤ò
-Èò¤±¤ë¤è¤¦¤Ë»î¤ß¤Þ¤¹¡£ ¤³¤ì¤Ï¥Æ¡¼¥Ö¥ë¡¦¥í¥Ã¥¯¤ÎÌäÂê¤òÈò¤±¤ë¤¿¤á¤Ç¤¹¡£
-@item
-¿·¤·¤¤ @code{MyISAM} ¥Æ¡¼¥Ö¥ë¤Ç¤Ï¡¢¤¢¤ë¥Æ¡¼¥Ö¥ë¤Ë¥ì¥³¡¼¥É¤¬ÁÞÆþ(ºï½ü¤Ï̵¤·¤Ç)
-¤µ¤ì¤Æ¤¤¤ëºÇÃæ¤Ë¡¢Æ±»þ¤Ë¡¢Æ±¤¸¥Æ¡¼¥Ö¥ë¤«¤é¥Ç¡¼¥¿¤òÆɤळ¤È¤¬²Äǽ¤Ç¤¹¡£
-¤³¤ì¤¬¤¢¤Ê¤¿¤Ë¤È¤Ã¤Æ½ÅÍ×¹àÌܤǤ¢¤ë¤Ê¤é¡¢
-¥ì¥³¡¼¥É¤Îºï½ü¤ÎɬÍפΤʤ¤ÊýË¡¤ä¡¢Â¿¤¯¤Î¥ì¥³¡¼¥É¤òºï½ü¤·¤¿¸å¤Ë @code{OPTIMIZE TABLE} ¤ò
-¼Â¹Ô¤¹¤ë¤³¤È¤ò¡¢¹Íθ¤¹¤Ù¤­¤Ç¤¹¡£
-@item
-In some cases it may make sense to introduce a column that is 'hashed'
-based on information from other columns. If this column is short and
-reasonably unique it may be much faster than a big index on many
-columns. In @strong{MySQL} its very easy to use this extra column:
-@code{SELECT * from table where hash='calculated hash on col1 and col2'
-and col_1='constant' and col_2='constant' and ..}
-@item
-¿¤¯¤ÎÊѹ¹¤¬¤Ê¤µ¤ì¤ë¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ¤Ï¡¢Á´¤Æ¤Î @code{VARCHAR} ¤ä @code{BLOB}
-¥Õ¥£¡¼¥ë¥É¤òÈò¤±¤ë¤è¤¦¤Ë»î¤ß¤ë¤Ù¤­¤Ç¤¹¡£
-You will get dynamic row length as soon as you
-are using a single @code{VARCHAR} or @code{BLOB} columns. @xref{Table
-types}.
-@item
-Ä̾¤¢¤ë¥Æ¡¼¥Ö¥ë¤ò°ã¤¦¥Æ¡¼¥Ö¥ë¤Ëʬ¤±¤ë¤³¤È¤Ï¡¢¥ì¥³¡¼¥É¤¬Â礭¤¯¤Ê¤ë
-¤¿¤á¤ËÌòΩ¤Á¤Þ¤»¤ó¡£
-¥ì¥³¡¼¥É¤Ë¥¢¥¯¥»¥¹¤¹¤ëºÝ¡¢¤½¤Î¥ì¥³¡¼¥É¤ÎºÇ½é¤Î¥Ð¥¤¥È¤ò¸«¤Ä¤±¤ë¤¿¤á¤Î
-¥Ç¥£¥¹¥¯¡¦¥·¡¼¥¯¤¬¡¢°ìÈÖ¤«¤«¤ê¤Þ¤¹¡£
-After finding
-the data most new disks can read the whole row fast enough for most
-applications. The only cases it really matters to split up a table is if
-its a dynamic row size table (see above) that you can change to a fixed
-row size. Or if you very often need to scan the table and don't need
-most of the columns. @xref{Table types}.
-@item
-¤â¤·¡¢Â¿¤¯¤Î¥ì¥³¡¼¥É¤«¤é¤Î¾ðÊó¤ò¸µ¤Ë¤·¤¿·×»»(¤¢¤ë¤â¤Î¤Î¥«¥¦¥ó¥È¤È¤«)¤ò
-¤·¤ç¤Ã¤Á¤å¤¦¹Ô¤¦É¬Íפ¬¤¢¤ë¤Ê¤é¡¢¿·¤·¤¤¥Æ¡¼¥Ö¥ë¤òÍÑ°Õ¤·¡¢Ã༡¥«¥¦¥ó¥¿¡¼¤ò
-¹¹¿·¤·¤¿Êý¤¬Â¿Ê¬Îɤ¤¤Ç¤·¤ç¤¦¡£
-@code{UPDATE table set count=count+1 where index_column=constant} ¤Î¹¹¿·¤Ï
-¤È¤Æ¤â®¤¤¤Ç¤¹¡ª
-
-¤³¤ì¤Ï¡¢@strong{MySQL} ¤Î¤è¤¦¤Ê¥Æ¡¼¥Ö¥ë¡¦¥í¥Ã¥­¥ó¥°
-(multiple readers / single writers)¤ò¤â¤Ä¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò
-»È¤¦¾å¤Ç¡¢ËÜÅö¤Ë½ÅÍפʤ³¤È¤Ç¤¹¡£
-This will
-also give better performance with most databases as the row locking
-manager in this case will have less to do.
-@item
-¤â¤·¤¿¤¯¤µ¤ó¤ÎÂ礭¤Ê¥Æ¡¼¥Ö¥ë¤«¤éÅý·×¤ò¼ý½¸¤¹¤ëɬÍפ¬¤¢¤ë¤Ê¤é¡¢
-Á´¥Æ¡¼¥Ö¥ë¤òÁöºº¤¹¤ëÂå¤ï¤ê¤Ë¡¢¥µ¥Þ¥ê¡¼¥Æ¡¼¥Ö¥ë¤ò»ÈÍѤ·¤Þ¤¹¡£
-Maintaing the summarys should be
-much faster than trying to do statistics 'live'. It's much faster to
-re-generate new summary tables from the logs when things changes
-(depending on business decisions) than to have to change the running
-application!
-@item
-If possible one should classify reports as 'live' or 'statistical',
-where data needed for statistical reports are only generated based on
-summary tables that are generated from the actual data.
-@item
-¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¥Ç¥Õ¥©¥ë¥ÈÃͤ¬¤¢¤ë¤È¤¤¤¦»ö¤òÍøÍѤ·¤Æ²¼¤µ¤¤¡£
-Ãͤ¬¥Ç¥Õ¥©¥ë¥È¤È¤Ï°ã¤¦¾ì¹ç¤Ë¸Â¤ê¡¢ÃͤòÁÞÆþ¤·¤Þ¤¹¡£
-¤³¤ì¤Ï @strong{MySQL} ¤¬É¬ÍפȤ¹¤ëʬÀϤò¾¯¤Ê¤¯¤·¡¢¥¤¥ó¥µ¡¼¥È¤Î®ÅÙ¤¬¸þ¾å¤·¤Þ¤¹¡£
-@item
-¤¢¤ë¾ì¹ç¤Ç¤Ï¡¢BLOB ¤Ë¥Ç¡¼¥¿¤ò¥Ñ¥Ã¥¯¤·¤ÆÊݸ¤¹¤ë¤Î¤¬ÊØÍø¤Ç¤¹¡£
-¤³¤Î¾ì¹ç¡¢BLOB ¤ËÆþ¤ì¤¿Ãͤò ¥Ñ¥Ã¥¯¡¦¥¢¥ó¥Ñ¥Ã¥¯ ¤¹¤ë¤¿¤á¤Î¥³¡¼¥É¤ò
-¤¢¤Ê¤¿¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ËÁȤ߹þ¤Þ¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-¤·¤«¤·¤³¤ì¤Ï¡¢Â¿¤¯¤Î¥¢¥¯¥»¥¹¤òÍÞÀ©¤¹¤ë¤Ç¤·¤ç¤¦¡£
-¤³¤ì¤Ï¡¢ÀÅŪ(¸ÇÄêĹ)¥Æ¡¼¥Ö¥ë¹½Â¤¤ËŬ¤·¤Ê¤¤¥Ç¡¼¥¿¤ò»ý¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë
-¼ÂÍѤˤʤê¤Þ¤¹¡£
-@item
-Ä̾¤¢¤Ê¤¿¤ÏÁ´¤Æ¤Î¥Ç¡¼¥¿¤ò¾éŤÎ̵¤¤¤è¤¦¤Ë(¥Ç¡¼¥¿¥Ù¡¼¥¹ÍýÏÀ¤Ç
-Â裳Àµµ¬·Á , 3rd Normal Form , 3NF ¤È¸Æ¤Ð¤ì¤ë)
-¤·¤è¤¦¤È¤¹¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¤¬¡¢¤·¤«¤·¡¢¤è¤ê¥¹¥Ô¡¼¥É¤òµá¤á¤ë¾ì¹ç¤Ï¡¢
-½ÅÊ£¤ä¥µ¥Þ¥ê¡¼¥Æ¡¼¥Ö¥ë¤ÎºîÀ®¤ò¤ª¤½¤ì¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£
-@item
-¥¹¥È¥¢¥É¡¦¥×¥í¥·¡¼¥¸¥ã ¤ä UDF (¥æ¡¼¥¶¡¼ÄêµÁ´Ø¿ô) ¤Ï¤è¤ê¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤òÆÀ¤ë
-¤¿¤á¤Ë¤Ï¤è¤¤ÊýË¡¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-In this case you should however always have a way
-to do this some other (slower) way if you use some database that doesn't
-support this.
-@item
-You can always gain something by caching queries/answers in your
-application and trying to do many inserts/updates at the same time. If
-your database supports lock tables (like @strong{MySQL} and Oracle),
-this should help to ensure that the index cache is only flushed once
-after all updates.
-@item
-¥Ç¡¼¥¿¤ò¤¹¤°¤Ë¤Ï½ñ¤¯É¬Íפ¬¤Ê¤¤¤È¤­¡¢@code{INSERT /*! DELAYED */} ¤ò»ÈÍѤ·¤Þ¤¹¡£
-¤³¤ì¤Ï¡¢°ì²ó¤Î¥Ç¥£¥¹¥¯¤Ø¤Î½ñ¤­¹þ¤ß¤Ç¡¢Â¿¤¯¤Î¥ì¥³¡¼¥É¤¬¤«¤«¤ì¤ë¤Î¤Ç¡¢
-®¤¯¤Ê¤ê¤Þ¤¹¡£
-@item
-SELECT ¤¬¤è¤ê½ÅÍפʾì¹ç¡¢@code{INSERT /*! LOW_PRIORITY */} ¤ò»ÈÍѤ·¤Þ¤¹¡£
-@item
-¥­¥å¡¼¤ò̵»ë¤·¤Æ SELECT ¤òÍ¥ÀèŪ¤Ë¹Ô¤¤¤¿¤¤¤È¤­¤Ï
-@code{SELECT /*! HIGH_PRIORITY */} ¤ò»ÈÍѤ·¤Þ¤¹¡£
-¤³¤ì¤Ï¡¢¤¿¤È¤¨Ã¯¤«¤¬½ñ¤­¹þ¤ß¤òÂԤäƤ¤¤¿¤È¤·¤Æ¤â¡¢¤½¤Î SELECT ¤Ï
-¼Â¹Ô¤µ¤ì¤Þ¤¹¡£
-@item
-Ê£¿ô¹Ô @code{INSERT} ʸ¤Î»ÈÍÑ¡£ ¤³¤ì¤Ï¿¤¯¤Î¥ì¥³¡¼¥É¤ò°ì¤Ä¤Î SQL ¥³¥Þ¥ó¥É¤Ç
-ÁÞÆþ¤¹¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
-(¿¤¯¤Î SQL ¥µ¡¼¥Ð¡¼¤¬¤³¤ì¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤¹)
-@item
-Â礭¤Ê¥Ç¡¼¥¿¤ÎÆɤ߹þ¤ß¤Ë¤Ï @code{LOAD DATA INFILE} ¤ò»ÈÍѤ·¤Þ¤¹¡£
-This if
-faster than normal inserts and will be even faster when @code{myisamchk}
-is integrated in @code{mysqld}.
-@item
-°ì°Õ¤ÎÃͤòºî¤ë¤¿¤á¤Ë¡¢ @code{AUTO_INCREMENT} ¤ò»ÈÍѤ·¤Þ¤¹¡£
-@item
-ưŪ¥Æ¡¼¥Ö¥ë¥Õ¥©¡¼¥Þ¥Ã¥È¤Î»ÈÍÑ»þ¤Ë¤Ï¡¢¥Õ¥é¥°¥á¥ó¥Æ¡¼¥·¥ç¥ó¤òÈò¤±¤ë¤¿¤á¤Ë¡¢
-@code{OPTIMIZE TABLE} ¤ò»þ¡¹»ÈÍѤ·¤Þ¤¹¡£
-@xref{OPTIMIZE TABLE, , @code{OPTIMIZE TABLE}}.
-
-@item
-²Äǽ¤Ê¤é¤Ð @code{HEAP} ¥Æ¡¼¥Ö¥ë¤ò¥¹¥Ô¡¼¥É¥¢¥Ã¥×¤Î¤¿¤á¤Ë»ÈÍѤ·¤Þ¤¹. @xref{Table
-types}.
-@item
-Ä̾ï¤Î Web ¥µ¡¼¥Ð¡¼¤ÎÀßÄê¤Ê¤é¤Ð¡¢¥¤¥á¡¼¥¸¤Ï¥Õ¥¡¥¤¥ë¤ËÊݸ¤¹¤Ù¤­¤Ç¤¹¡£
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤Ï¡¢¤½¤ì¤é¥Õ¥¡¥¤¥ë¤Î»²¾È(¥Ñ¥¹¤È¤«)¤Î¤ß¤òÆþ¤ì¤Þ¤¹¡£
-¤³¤Î¼ç¤ÊÍýͳ¤Ï¡¢Ä̾ï¤Î Web ¥µ¡¼¥Ð¡¼¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤è¤ê¤â¥³¥ó¥Æ¥ó¥Ä¤ò
-¤è¤ê¤è¤¯¥­¥ã¥Ã¥·¥å¤·¤Æ¤¯¤ì¤ë¤«¤é¤Ç¤¹¡£ ¤½¤ì¤Ç¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ¹¤ë¤Ê¤é¡¢
-®¤¤¥·¥¹¥Æ¥à¤ò¤è¤ê´Êñ¤ËÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@item
-½ÅÍפǤʤ¤¥Ç¡¼¥¿¤Ç¡¢¤è¤¯¥¢¥¯¥»¥¹¤µ¤ì¤ëʪ¤Ï¡¢¥á¥â¥ê¥Æ¡¼¥Ö¥ë¤Ë¤¤¤ì¤Þ¤¹¡£
-(like
-information about the last shown banner for users that doesn't have
-cookies)
-@item
-Columns with identical information in different tables should be
-declared identical and have identical names. Before version 3.23 you
-got slow joins otherwise.
-
-̾Á°¤Ïñ½ã¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡Êcustomer ¥Æ¡¼¥Ö¥ë¤Ç¤Ï @code{customer_name} ¤Î
-¤«¤ï¤ê¤Ë @code{name} ¤ò»È¤¦¤È¤«¡Ë¡£ ¾¤Î SQL ¥µ¡¼¥Ð¡¼¤Ø¤Î°Ü¿¢¤ò¹Íθ¤¹¤ë¤Ê¤é¡¢
-̾Á°¤Ï 18 ʸ»ú¤è¤êû¤¯¤¹¤Ù¤­¤Ç¤¹¡£
-@item
-¤â¤·ËÜÅö¤Ë¥Ï¥¤¡¦¥¹¥Ô¡¼¥É¤¬É¬Íפʤ顢SQL ¥µ¡¼¥Ð¡¼¤¬¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ëʪ¤È¤Ï
-°ã¤¦¡¢¥í¡¼¥ì¥Ù¥ë¤Î¥Ç¡¼¥¿Êݸ¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ËÃíÌܤ¹¤Ù¤­¤Ç¤¹¡£
-Î㤨¤Ð¡¢ @strong{MySQL} @code{MyISAM} ¤òľÀÜ¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤Ï¡¢
-SQL ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ò²ð¤·¤Æ¥¢¥¯¥»¥¹¤¹¤ë¤è¤ê¤â¡¢2¡Á5ÇÜ®¤¯¤Ê¤ë¤Ç¤·¤ç¤¦¡£
-¤³¤ì¤ò²Äǽ¤Ë¤¹¤ë¤Ë¤Ï¡¢¤½¤Î¥Ç¡¼¥¿¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ÈƱ¤¸¥Þ¥·¥ó¾å¤Ë¤Ê¤¯¤Æ¤Ï¤Ê¤é¤º¡¢
-Ä̾°ì¤Ä¤Î¥×¥í¥»¥¹¤À¤±¤Ç¥¢¥¯¥»¥¹¤µ¤ì¤ë¤Ù¤­¤Ç¤¹¡£
-(¤Ê¤¼¤Ê¤é¡¢³°Éô¥Õ¥¡¥¤¥ë¥í¥Ã¥¯¤Ï¡¢¤È¤Æ¤âÃÙ¤¤¤«¤é)¡£
-¾å¤ÎÌäÂê¤Ï¡¢@strong{MySQL} ¥µ¡¼¥Ð¡¼Æâ¤Î @code{MyISAM} ¤Î¥í¡¼¥ì¥Ù¥ë¤Î¥³¥Þ¥ó¥É¤Î
-ƳÆþ¤Ç²ò·è¤Ç¤­¤ë¤Ç¤·¤ç¤¦¡£ (¤³¤ì¤Ï¤è¤ê¤è¤¤¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤òÆÀ¤ë¤³¤È¤Î½ÐÍè¤ë¡¢
-´Êñ¤ÊÊýË¡¤Î°ì¤Ä¤Ç¤¹)¡£ By carefully designing the database interface
-it should be quite easy to support this types of optimisations.
-@item
-¿¤¯¤Î¾ì¹ç¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤é¥Ç¡¼¥¿¤ò¥¢¥¯¥»¥¹¤¹¤ëÊý¤¬(Àܳ¤ò°Ý»ý¤·¤Æ¤¤¤ì¤Ð)¡¢
-¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤«¤é¥Ç¡¼¥¿¤ò¥¢¥¯¥»¥¹¤¹¤ë¤è¤ê¤â®¤¤¤Ç¤¹¡£ ¤Ê¤¼¤Ê¤é¡¢
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ï¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤è¤ê¤â¥³¥ó¥Ñ¥¯¥È¤Ë¤Ê¤ê¡Ê¿ôÃͥǡ¼¥¿¤Î¾ì¹ç¡Ë¡¢
-¤³¤Î¤¿¤á¡¢¥Ç¥£¥¹¥¯¥¢¥¯¥»¥¹¤¬¾¯¤Ê¤¯¤Ê¤ë¤«¤é¤Ç¤¹¡£
-¤Þ¤¿¡¢¹Ô¤ä¹àÌܤò¸«¤Ä¤±¤ë¤¿¤á¤Ë¡¢¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤ò²òÀϤ¹¤ëɬÍפâ¾Ê¤±¤Þ¤¹¡£
-@item
-Ê£À½¤â¥¹¥Ô¡¼¥É¥¢¥Ã¥×¤Ë»ÈÍѤǤ­¤ë¤Ç¤·¤ç¤¦¡£ @xref{Replication}.
-@item
-@code{DELAY_KEY_WRITE=1} ¤¬ÄêµÁ¤µ¤ì¤¿¥Æ¡¼¥Ö¥ë¤Ï¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î¹¹¿·¤¬Â®¤¯¤Ê¤ê¤Þ¤¹¡£
-¤³¤ì¤Ï¤½¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¡¦¥Õ¥¡¥¤¥ë¤¬ÊĤ¸¤é¤ì¤ë¤Þ¤Ç¥Ç¥£¥¹¥¯¤Ëµ­Ï¿¤µ¤ì¤Ê¤¤¤«¤é¤Ç¤¹¡£
-¤·¤¿¤¬¤Ã¤Æ¡¢¤Ê¤Ë¤«¤¬ÅÓÃæ¤Ç @code{mysqld} ¤ò¥­¥ë¤·¤Æ¤â¥Æ¡¼¥Ö¥ë¤¬Âç¾æÉפʤ褦¤Ë¤¹¤ë¤¿¤á¡¢
-@code{mysqld} ¤òµ¯Æ°¤¹¤ëÁ°¤Ë¤Ï¡¢@code{myisamchk} ¤ò¤½¤ì¤é¤Î¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ¼Â¹Ô¤¹¤Ù¤­¤Ç¤¹¡£
-As the key information can always be generated
-from the data you should not lose anything by using @code{DELAY_KEY_WRITE}.
-@end itemize
-
-@node Benchmarks, Design, Tips, Performance
-@section Using your own benchmarks
-
-You should definately benchmark your application and database to find
-out where the bottlenecks are. By fixing it (or by replacing the
-bottleneck with a 'dummy module') you can then easily identify the next
-bottleneck (and so on). Even if the overall performance for your
-application is sufficient you should at least make a plan for each
-bottleneck, and decide how to solve it if someday you really need the
-extra performance.
-
-For an example of portable benchmark programs look at the @strong{MySQL}
-benchmark suite. @xref{MySQL Benchmarks, , @strong{MySQL} Benchmarks}. You
-can take any program from this suite and modify it for your needs. By doing this,
-you can try different solutions to your problem and test which is really the
-fastest solution for you.
-
-It is very common that some problems only occur when the system is very
-heavily loaded. We have had many customers who contact us when they
-have a (tested) system in production and have encountered load problems. In
-every one of these cases so far it has been problems with basic design
-(table scans are NOT good at high load) or OS/Library issues. Most of
-this would be a @strong{LOT} easier to fix if the systems were not
-already in production.
-
-To avoid problems like this you should put some effort into benchmarking
-your whole application under the worst possible load! You can use Sasha's
-recent hack for this -
-@uref{http://www.mysql.com/Contrib/mysql-bench-0.6.tar.gz, mysql-super-smack}.
-As the name suggests, it can bring your system down to its knees if you ask it,
-so make sure to use it only on your developement systems.
-
-@node Design, Design Limitations, Benchmarks, Performance
-@section Design choices
-
-@code{MySQL} ¤Ï¡¢¥ì¥³¡¼¥É¤Î¥Ç¡¼¥¿¤È¥¤¥ó¥Ç¥Ã¥¯¥¹¤òÊ̤Υե¡¥¤¥ë¤ËÊݸ¤·¤Þ¤¹¡£
-¾¤Î¿¤¯¤Î(¤Û¤È¤ó¤ÉÁ´¤Æ)¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ç¤Ï¡¢Æ±¤¸¥Õ¥¡¥¤¥ë¤Ë¥Ç¡¼¥¿¤È¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò
-º®ºß¤µ¤»¤ÆÊݸ¤·¤Þ¤¹¡£ ²æ¡¹¤Ï¡¢ºÇ¶á¤Î¥·¥¹¥Æ¥à¤Ë¤Ï¡¢@strong{MySQL} ¤ÎÁªÂò¤ÎÊý¤¬
-Îɤ¤¤È¿®¤¸¤Æ¤¤¤Þ¤¹¡£
-
-Another way to store the row data is to keep the information for each
-column in a separate area (examples are SDBM and Focus). This will cause a
-performance hit for every query that accesses more than one column. Because
-this degenerates so quickly when more than one column is accessed,
-we believe that this model is not good for general purpose databases.
-
-The more common case is that the index and data are stored together
-(like in Oracle/Sybase et al). In this case you will find the row
-information at the leaf page of the index. The good thing with this
-layout is that it, in many cases, depending on how well the index is
-cached, saves a disk read. The bad things with this layout is:
-
-@table @bullet
-@item
-Table scanning is much slower because you have to read through the indexes
-to get at the data.
-@item
-You lose a lot of space as you must duplicate indexes from the nodes
-(as you can't store the row in the nodes).
-@item
-Deletes will degenerate the table over time (as indexes in nodes are
-usually not updated on delete).
-@item
-You can't use only the index table to retrieve data for a query.
-@item
-The index data is harder to cache.
-@end table
-
-@node Design Limitations, Portability, Design, Performance
-@section MySQL design limitations/tradeoffs
-
-Because @strong{MySQL} uses extremely fast table locking (multiple readers /
-single writers) the biggest remaining problem is a mix of a steady stream of
-inserts and slow selects on the same table.
-
-We belive that for a huge number of systems the extremely fast
-performance in other cases make this choice a win. This case is usually
-also possible to solve by having multiple copies of the table, but it
-takes more effort and hardware.
-
-We are also working on some extensions to solve this problem for some
-common application niches.
-
-@node Portability, Internal use, Design Limitations, Performance
-@section Portability
-
-Because all SQL servers implement different parts of SQL, it takes work to
-write portable SQL applications. For very simple selects/inserts it is
-very easy but the more you need the harder it gets. If you want an
-application that is fast with many databases it becomes even harder!
-
-To make a complex application portable you need to choose a number of
-SQL servers that it should work with.
-
-You can use the @strong{MySQL} crash-me program/web-page
-@uref{http://www.mysql.com/crash-me-choose.htmy} to find functions,
-types and limits you can use with a selection of database
-servers. Crash-me now tests far from everything possible but it
-is still comprehensive with about 450 things tested.
-
-For example, you shouldn't have column names longer than 18 characters
-if you want to be able to use Informix or DB2.
-
-Both the @strong{MySQL} benchmarks and crash-me programs are very
-database-independent. By taking a look at how we have handled this, you
-can get a feeling of what you have to do to write your application
-database-independent. The benchmarks themselves can be found in the
-@file{sql-bench} directory in the @strong{MySQL} source
-distribution. They are written in Perl with DBI database interface
-(which solves the access part of the problem).
-
-See @uref{http://www.mysql.com/benchmark.html} the results from this
-benchmark.
-
-As you can see in these results all databases have some weak points. That
-is, they have different design compromises that lead to different
-behavior.
-
-If you strive for database independence you need to get a good feeling
-of each SQL server's bottlenecks. @strong{MySQL} is VERY fast in
-retrieving and updating things, but will have a problem in mixing slow
-readers/writers on the same table. Oracle on the other hand has a big
-problem when you try to access rows that you have recently updated
-(until they are flushed to disk). Transaction databases in general are
-not very good at generating summary tables from log tables as in this
-case row locking is almost useless.
-
-To get your application @emph{really} database-independent you need to define
-an easy extendable interface through which you manipulate your data. As
-C++ is available on most systems, it makes sense to use a C++ classes
-interface to the databases.
-
-If you use some specific feature for some database (like the
-@code{REPLACE} command in @strong{MySQL}), you should code a method for
-the other SQL servers to implement the same feature (but slower). With
-@strong{MySQL} you can use the @code{/*! */} syntax to add
-@strong{MySQL} specific keywords to a query. The code inside
-@code{/**/} will be treated as a comment (ignored) by most other SQL
-servers.
-
-If REAL high performance is more important than exactness, like in some
-web applications, a possibility is to create an application layer that
-caches all results to give you even higher performance. By letting
-old results 'expire' after a while you can keep the cache reasonably
-fresh. This is quite nice in case of extremely high load, in which case
-you can dynamically increase the cache and set the expire timeout higher
-until things get back to normal.
-
-In this case the table creation information should contain information
-of the initial size of the cache and how often the table should normally
-be refreshed.
-
-@node Internal use, , Portability, Performance
-@section What have we used MySQL for?
-
-@strong{MySQL} ¤Î½é´ü¤Î³«È¯´ü¤Ë¤Ï¡¢@strong{MySQL} ¤Ï²æ¡¹¤Î¤â¤Ã¤È¤âÂç¸ý¤Î¸ÜµÒ¤Ë¹ç¤¦¤è¤¦¤Ë
-µ¡Ç½¤¬ºîÀ®¤µ¤ì¤Þ¤·¤¿¡£ Èà¤é¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¥¹¥¦¥§¡¼¥Ç¥óºÇÂç¼ê¤Î¾®Çä¤ê¶È¼Ô
-¤Î¤¿¤á¤Ë¡¢ÁҸˤËÆþ¤ì¤Æ¤¤¤ë¡Ê¾¦Éʡ˥ǡ¼¥¿¤ò¼è¤ê°·¤¤¤Þ¤¹¡£
-
-²æ¡¹¤Ï¡¢¤¹¤Ù¤Æ¤ÎŹ¤«¤é¡¢Á´¥Ü¡¼¥Ê¥¹¡¦¥«¡¼¥É¼è°·¹â¤Î¡¢¤½¤Î½µ´Ö¤Þ¤È¤á¤òÆÀ¤Þ¤¹¡£
-¤½¤·¤Æ¡¢¤½¤ÎŹ¤Î¥ª¡¼¥Ê¤Ë¤È¤Ã¤ÆÍ­±×¤Ê¾ðÊ󡢤½¤ÎŹ¤Î¹­¹ð¥­¥ã¥ó¥Ú¡¼¥ó¤¬
-¤ªµÒ¤Ë¤É¤ÎÄøÅٱƶÁ¤òµÚ¤Ü¤¹¤«¡¢¤òÄ󶡤¹¤ë¤³¤È¤¬¡¢²æ¡¹¤Ëµá¤á¤é¤ì¤Æ¤¤¤Þ¤¹¡£
-
-¤½¤Î¥Ç¡¼¥¿¤Ï¡¢¤È¤Æ¤âÂ礭¤¯¤Æ (Ìó700Ëü/·î ²ó¤Î¼è¤ê°·¤¤)¡¢
-²æ¡¹¤Ï¤½¤Î¸ÜµÒ¤ËÄ󶡤¹¤ëɬÍפΤ¢¤ë¥Ç¡¼¥¿¤ò 4¡Á10ǯʬ¡¢»ý¤Ã¤Æ¤¤¤Þ¤¹¡£
-²æ¡¹¤Ï¡¢¥«¥¹¥¿¥Þ¡¼¤«¤é¡¢Èà¤é¤¬¤³¤Î¥Ç¡¼¥¿¤«¤é¤Ç¤­¤ë¿·¤·¤¤¥ì¥Ý¡¼¥È¤Ë
-¡É¨»þ¤Ë¡É¥¢¥¯¥»¥¹¤·¤¿¤¤¤È¤¤¤¦¡¢Í×µá¤ò¼õ¤±¤Þ¤·¤¿¡£
-
-²æ¡¹¤Ï¤³¤ì¤ò¡¢Á´¤Æ¤Î·î¤´¤È¤Î¾ðÊó¤ò°µ½Ì¤·¤¿ 'transaction' ¥Æ¡¼¥Ö¥ë¤Ë
-Êݸ¤¹¤ë¤³¤È¤Ç²ò·è¤·¤Þ¤·¤¿¡£
-We have a set of simple macros (script) that
-generates summary tables grouped by different criteria (product group,
-customer id, store ...) from the transaction tables.
-¤½¤Î¥ì¥Ý¡¼¥È¤Ï Web ¥Ú¡¼¥¸¤Ç¡¢¤³¤ì¤Ï¾®¤µ¤Ê perl ¥¹¥¯¥ê¥×¥È¤ÇưŪ¤Ë
-ºîÀ®¤µ¤ì¤Þ¤¹¡£ ¤³¤Î perl script ¤Ï Web Page ¤òʬÀϤ·¡¢SQL ʸ¤ò
-¼Â¹Ô¤·¡¢·ë²Ì¤òÁÞÆþ¤·¤Þ¤¹¡£
-We would have used PHP or mod_perl instead but they were
-not available at that time.
-
-²èÁü¥Ç¡¼¥¿¤Î¤¿¤á¤Ë¡¢²æ¡¹¤Ï´Êñ¤Ê¥Ä¡¼¥ë¤ò @code{C} ¤Ç¤«¤­¤Þ¤·¤¿¡£
-¤³¤ì¤Ï SQL ¤Î¥¯¥¨¥ê¤Î·ë²Ì¤ò¸µ¤Ë(·ë²Ì¤Ë¤¤¤¯¤Ä¤«½èÍý¤ò¤·¤Æ) GIF ¤òÄ󶡤·¤Þ¤¹¡£
-¤³¤ì¤âưŪ¤Ë perl ¥¹¥¯¥ê¥×¥È(@code{HTML} ¥Õ¥¡¥¤¥ë¤òʬÀϤ¹¤ë)¤«¤é¼Â¹Ô¤µ¤ì¤Þ¤¹¡£
-
-In most cases a new report can simply be done by copying an existing
-script and modifying the SQL query in it. In some cases we will need to
-add more fields to an existing summary table or generate a new one, but
-this is also quite simple as we keep all transactions tables on disk.
-(Currently we have at least 50G of transactions tables and 200G of other
-customer data).
-
-We also let our customers access the summary tables directly with ODBC
-so that the advanced users can themselves experiment with the data.
-
-²æ¡¹¤Ï¤³¤ì¤é¤ò Sun Ultra SPARCstation (2x200 Mz) ¤Ç°·¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¢
-¤Ê¤ó¤ÎÌäÂê¤â¤¢¤ê¤Þ¤»¤ó¡£
-We recently upgraded one of our servers to a 2
-CPU 400 Mhz UltraSPARC and we are now planning to start handling
-transactions on the product level, which would mean a ten-fold increase
-of data. We think we can keep up with this by just adding more disk to
-our systems.
-
-We are also experimenting with Intel-Linux to be able to get more CPU
-power cheaper. ¸½ºß¡¢²æ¡¹¤Ï¥Ð¥¤¥Ê¥ê¸ß´¹¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ý¤Ã¤Æ¤ª¤ê
-(new in 3.23) ¡¢²æ¡¹¤Ï¤³¤ì¤ò¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î¤¤¤¯¤Ä¤«¤ÎÉôʬ¤Ë»ÈÍѤ·¤Ï¤¸¤á¤ë»ö¤Ç¤·¤ç¤¦¡£
-
-Our initial feelings are that Linux will perform much better on low to
-medium load but Solaris will perform better when you start to get a
-high load because of extreme disk IO, but we don't yet have anything
-conclusive about this. After some discussion with a Linux Kernel
-developer this might be a side effect of Linux giving so much resources
-to the batch job that the interactive performance gets very low. This
-makes the machine feel very slow and unresponsive while big batches are
-going. Hopefully this will be better handled in future Linux Kernels.
-
-@node MySQL Benchmarks, Tools, Performance, Top
-@chapter @strong{MySQL} ¥Ù¥ó¥Á¥Þ¡¼¥¯¥¹¥¤¡¼¥È
-
-¤³¤³¤Ë¤Ï @strong{MySQL} ¥Ù¥ó¥Á¥Þ¡¼¥¯¥¹¥¤¡¼¥È(¤È @code{crash-me})¤Î
-µ»½Ñ¾å¤Î²òÀ⤬½ñ¤«¤ì¤ë¤Ï¤º¤Ç¤¹¤¬¡¢¤Þ¤À½ñ¤«¤ì¤Æ¤¤¤Þ¤»¤ó¡£
-¸½ºß¡¢¥Ù¥ó¥Á¥Þ¡¼¥¯¤Î¥³¡¼¥É¤È·ë²Ì¤Ï¥½¡¼¥¹¤ÎÃæ¤Î @file{sql-bench} ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ê¤Þ¤¹¡£
-(¤â¤Á¤í¤ó Web ¥Ú¡¼¥¸ @uref{http://www.mysql.com/crash-me-choose.htmy} ¤Ë¤â)
-
-¤Ê¤ó¤Î SQL ¼ÂÁõ¤Î¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤¬Îɤ¤¤Î¤«°­¤¤¤Î¤«¤ò¡¢¤É¤ó¤Ê¥æ¡¼¥¶¡¼¤ËÂФ·¤Æ¤â
-¼¨¤¹¤Î¤¬¥Ù¥ó¥Á¥Þ¡¼¥¯¤Ç¤¹¡£
-
-Note that this benchmark is single threaded so it measures the minimum
-time for the operations.
-
-For example (run on the same NT 4.0 machine):
-
-@multitable @columnfractions .6 .2 .2
-@strong{Reading 2000000 rows by index} @tab @strong{Seconds} @tab @strong{Seconds}
-@item mysql @tab 367 @tab 249
-@item mysql_odbc @tab 464
-@item db2_odbc @tab 1206
-@item informix_odbc @tab 121126
-@item ms-sql_odbc @tab 1634
-@item oracle_odbc @tab 20800
-@item solid_odbc @tab 877
-@item sybase_odbc @tab 17614
-@end multitable
-
-@multitable @columnfractions .6 .2 .2
-@strong{Inserting (350768) rows} @tab @strong{Seconds} @tab @strong{Seconds}
-@item mysql @tab 381 @tab 206
-@item mysql_odbc @tab 619
-@item db2_odbc @tab 3460
-@item informix_odbc @tab 2692
-@item ms-sql_odbc @tab 4012
-@item oracle_odbc @tab 11291
-@item solid_odbc @tab 1801
-@item sybase_odbc @tab 4802
-@end multitable
-
-In the above test @strong{MySQL} was run with a 8M index cache.
-
-Note that Oracle is not included because they asked to be removed. All
-Oracle benchmarks has to be passed by Oracle! We believe that makes
-Oracle benchmarks @strong{VERY} biased because the above bechmarks are
-supposed to show what a standard installation can do for a single
-client.
-
-@code{crash-me} ¤Ï¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬¥µ¥Ý¡¼¥È¤¹¤ëµ¡Ç½¡¢Ç½ÎÏ¡¢À©¸Â¤Ë¤Ä¤¤¤Æ¡¢
-¼ÂºÝ¤Ë¥¯¥¨¥ê¤òÁö¤é¤»¤Æ³Îǧ¤·¤Þ¤¹¡£
-Î㤨¤Ð¡¢°Ê²¼¤Î¤è¤¦¤Ê»ö¤Ë¤Ä¤¤¤ÆÄ´¤Ù¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¹àÌܤη¿¤Ï¤Ê¤Ë¤«
-@item
-¥µ¥Ý¡¼¥È¤¹¤ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎºÇÂç¿ô¤Ï
-@item
-¤É¤Î¤è¤¦¤Ê´Ø¿ô¤¬¤¢¤ë¤Î¤«
-@item
-¼õ¤±¤ì¤ë¥¯¥¨¥ê¤ÎÂ礭¤µ¤Ï¤É¤³¤Þ¤Ç¤«
-@item
-@code{VARCHAR} ·¿¤Ï¤É¤³¤Þ¤ÇÂ礭¤¯¤Ç¤­¤ë¤Î¤«
-@end itemize
-
-@node Tools, Maintenance, MySQL Benchmarks, Top
-@chapter @strong{MySQL} ¥æ¡¼¥Æ¥£¥ê¥Æ¥£
-
-@menu
-* Programs:: ¼Â¹Ô¥Õ¥¡¥¤¥ë¤¬¹Ô¤Ê¤¦¤³¤È¤Ï¡©
-* mysql:: ¥³¥Þ¥ó¥É¥é¥¤¥ó¥Ä¡¼¥ë
-* mysqladmin:: Administering a @strong{MySQL} server
-* mysqldump:: Dumping the structure and data from @strong{MySQL} databases and tables
-* mysqlimport:: Importing data from text files
-* mysqlshow::
-* myisampack:: The @strong{MySQL} compressed read-only table generator
-@end menu
-
-@cindex Environment variables
-@node Programs, mysql, Tools, Tools
-@section ÍÍ¡¹¤Ê @strong{MySQL} ¥×¥í¥°¥é¥à¤Î³µÍ×
-
-¥µ¡¼¥Ð¤ÈÄÌ¿®¤¹¤ë @code{mysqlclient} ¥é¥¤¥Ö¥é¥ê¤ò»ÈÍѤ·¤Æ¤¤¤ëÁ´¤Æ¤Î
-@strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¤Ï¼¡¤Î´Ä¶­ÊÑ¿ô¤ò»ÈÍѤ·¤Þ¤¹:
-
-@tindex MYSQL_UNIX_PORT environment variable
-@tindex Environment variable, MYSQL_UNIX_PORT
-@tindex MYSQL_TCP_PORT environment variable
-@tindex Environment variable, MYSQL_TCP_PORT
-@tindex MYSQL_PWD environment variable
-@tindex Environment variable, MYSQL_PWD
-@tindex MYSQL_DEBUG environment variable
-@tindex Environment variable, MYSQL_DEBUG
-@multitable @columnfractions .25 .75
-@item @strong{Name} @tab @strong{Description}
-@item @code{MYSQL_UNIX_PORT} @tab ¥Ç¥Õ¥©¥ë¥È¤Î¥½¥±¥Ã¥È; @code{localhost} ¤Ø¤ÎÀܳ¤Ë»ÈÍѤµ¤ì¤ë
-@item @code{MYSQL_TCP_PORT} @tab ¥Ç¥Õ¥©¥ë¥È¤Î TCP/IP ¥Ý¡¼¥È
-@item @code{MYSQL_PWD} @tab ¥Ç¥Õ¥©¥ë¥È¤Î¥Ñ¥¹¥ï¡¼¥É
-@item @code{MYSQL_DEBUG} @tab ¥Ç¥Ð¥Ã¥°¥ª¥×¥·¥ç¥ó
-@item @code{TMPDIR} @tab °ì»þ tables/files ¤¬ºîÀ®¤µ¤ì¤ë¥Ç¥£¥ì¥¯¥È¥ê
-@end multitable
-
-@code{MYSQL_PWD} ¤Î»ÈÍѤϰÂÁ´¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-@xref{Connecting}.
-
-@tindex MYSQL_HISTFILE environment variable
-@tindex Environment variable, MYSQL_HISTFILE
-@tindex HOME environment variable
-@tindex Environment variable, HOME
-@cindex History file
-@cindex Command line history
-@tindex .mysql_history file
-@file{mysql} ¥¯¥é¥¤¥¢¥ó¥È¤Ï¡¢@code{MYSQL_HISTFILE} ´Ä¶­ÊÑ¿ô¤Ë
-»ØÄꤵ¤ì¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤Ë¥³¥Þ¥ó¥É¥é¥¤¥ó¤ÎÍúÎò¤ò½ñ¤­½Ð¤·¤Þ¤¹¡£
-¥Ç¥Õ¥©¥ë¥È¤ÎÍúÎò¥Õ¥¡¥¤¥ë¤Ï¡¢ @file{$HOME/.mysql_history} ¤Ç¡¢@code{$HOME} ¤Ï
- @code{HOME} ´Ä¶­ÊÑ¿ô¤ÎÃͤǤ¹¡£ @xref{Environment variables}.
-
-Á´¤Æ¤Î @strong{MySQL} ¥×¥í¥°¥é¥à¤Ï¿¤¯¤ÎÍÍ¡¹¤Ê¥ª¥×¥·¥ç¥ó¤ò»ý¤Á¤Þ¤¹¡£¼ï¡¹
-¤Î¥ª¥×¥·¥ç¥ó¤Î´°Á´¤ÊÀâÌÀ¤òÆÀ¤ë¤Ë¤Ï¥¹¥¤¥Ã¥Á @code{--help} ¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£Îã
-¤¨¤Ð@code{mysql --help} ¤ò»î¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤Ç¡¢Á´¤Æ¤Îɸ½à¥¯¥é¥¤¥¢¥ó¥È¤Î¥Ç¥Õ¥©¥ë¥È¤Î¥ª¥×¥·¥ç¥ó¤ò
-Êѹ¹¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£
-@ref{Option files}.
-
-@strong{MySQL} ¥×¥í¥°¥é¥à¤ò°Ê²¼¤Ë¼¨¤·¤Þ¤¹:
-
-@table @code
-
-@cindex @code{myisamchk}
-@item myisamchk
-@strong{MySQL} ¥Æ¡¼¥Ö¥ë¤ò¥Á¥§¥Ã¥¯, ºÇŬ²½¤½¤·¤Æ½¤Éü¤·¤Þ¤¹¡£
-@code{myisamchk} ¤Ë¤Ï¿¤¯¤Îµ¡Ç½¤¬¤¢¤ë¤Î¤Ç¡¢°ì¾Ï³ä¤êÅö¤Æ¤ÆÀâÌÀ¤·¤Æ¤¤¤Þ¤¹¡£
-@xref{Maintenance}.
-
-@cindex @code{make_binary_release}
-@item make_binary_release
-¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤¿ @strong{MySQL} ¤Î¥Ð¥¤¥Ê¥ê¥ê¥ê¡¼¥¹¤òºîÀ®¤·¤Þ¤¹¡£¤³¤ì¤Ï¾
-¤Î MySQL ¥æ¡¼¥¶¤ÎÍøÊؤΤ¿¤á¤Ë¡¢ftp ¤Ç @code{ftp.tcx.se} ¤Î @file{/pub/mysql/Incoming}
-¤ËÁ÷¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@cindex @code{msql2mysql}
-@item msql2mysql
-@code{mSQL} ¥×¥í¥°¥é¥à¤ò @strong{MySQL} ¤ËÊÑ´¹¤¹¤ë¥·¥§¥ë¥¹¥¯¥ê¥×¥È¡£Á´¤Æ
-¤Î¥±¡¼¥¹¤Ç½èÍý¤Ç¤­¤ë¤ï¤±¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¤¬¡¢ÊÑ´¹»þ¤ËÎɤ¤¥¹¥¿¡¼¥È¤òÍ¿¤¨¤Þ¤¹¡£
-
-@cindex Scripts
-@cindex @code{mysql}
-@item mysql
-@code{mysql} ¤Ï´Êñ¤Ê SQL ¥·¥§¥ë (GNU @code{readline} ¤Ä¤­) ¤Ç¤¹¡£¤³¤ì¤ÏÂÐÏÃŪ¤Ê»ÈÍѤä
-ÈóÂÐÏ÷¿Ì䤤¹ç¤ï¤»¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£ÂÐÏÃŪ¤Ë»ÈÍѤµ¤ì¤ë¤È¡¢ASCII ¥Æ¡¼¥Ö¥ë
-·Á¼°¤Ç·ë²Ì¤¬Í¿¤¨¤é¤ì¤Þ¤¹¡£¥Õ¥£¥ë¥¿¤È¤·¤Æ»ÈÍѤµ¤ì¤ë¤È¡¢½ÐÎϤϥ¿¥Ö¤Ç¶èÀÚ¤é
-¤ì¤Þ¤¹¡Ê¤³¤ì¤Ïµ¯Æ°»þ¤Î¥ª¥×¥·¥ç¥ó¤Ç¾¤Î¤â¤Î¤ËÊѹ¹¤Ç¤­¤Þ¤¹¡Ë¡£
-¤¢¤Ê¤¿¤Ï°Ê²¼¤Î¤è¤¦¤Ë´Êñ¤Ë¥¹¥¯¥ê¥×¥È¤ò¼Â¹Ô¤Ç¤­¤Þ¤¹:
-
-@example
-shell> mysql database < script.sql > output.tab
-@end example
-
-¥¯¥é¥¤¥¢¥ó¥È¤Î¥á¥â¥ê¤¬½½Ê¬¤Ç¤Ê¤¤¤³¤È¤Ë¤è¤ëÌäÂ꤬¤¢¤ë¾ì¹ç¤Ï¡¢
-@code{--quick} ¥¹¥¤¥Ã¥Á¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡ª ¤³¤ì¤Ï·ë²Ì¤ò¼è¤ê½Ð¤¹¤Î¤Ë
- @code{mysql_store_result()} ¤ÎÂå¤ï¤ê¤Ë @code{mysql_use_result()} ¤ò»ÈÍÑ
-¤¹¤ë¤è¤¦¤Ë @code{mysql} ¤Ë¶¯À©¤µ¤»¤Þ¤¹¡£
-
-@cindex @code{mysqlaccess}
-@item mysqlaccess
-¥Û¥¹¥È, ¥æ¡¼¥¶¤½¤·¤Æ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÁȹ礻¤Ç¸¢¸Â¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤¿¤á¤Î¥¹¥¯¥ê
-¥×¥È¡£
-
-@cindex @code{mysqladmin}
-@item mysqladmin
-´ÉÍý¥æ¡¼¥Æ¥£¥ê¥Æ¥£¡£¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎºîÀ®/ÇË´þ¡£reload (¿·¤·¤¤¥æ¡¼¥¶¤ÎÆɤß
-¹þ¤ß) ¤È refresh (¥Ç¥£¥¹¥¯¤Ø¤Î¥Æ¡¼¥Ö¥ë¤Î¥Õ¥é¥Ã¥·¥å, ¥í¥°¥Õ¥¡¥¤¥ë¤ÎºÆ¥ª¡¼
-¥×¥ó)¡£¥µ¡¼¥Ð¤Î¥Ð¡¼¥¸¥ç¥ó¤È½èÍý¤È¾õÂÖ¾ðÊó¤âÍ¿¤¨¤Þ¤¹¡£
-@xref{mysqladmin, , @code{mysqladmin}}.
-
-@cindex @code{mysqlbug}
-@item mysqlbug
-@strong{MySQL} ¥Ð¥°¥ì¥Ý¡¼¥È¥¹¥¯¥ê¥×¥È¡£
-¤³¤Î¥¹¥¯¥ê¥×¥È¤Ï @strong{MySQL} ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤Ë¥Ð¥°¥ì¥Ý¡¼¥È¤ò½Ð¤¹ºÝ¡¢
-¾ï¤Ë»ÈÍѤ·¤Þ¤¹¡£
-
-@cindex @code{mysqld}
-@item mysqld
-SQL ¥Ç¡¼¥â¥ó¡£¤³¤ì¤Ï¾ï¤Ë¼Â¹Ô¤µ¤ì¤Æ¤Þ¤¹¡£
-
-@cindex @code{mysqldump}
-@item mysqldump
-@strong{MySQL} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î SQL ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Þ¤¿¤Ï¥¿¥Ö¤Ç¶èÀÚ¤é¤ì¤¿¥Æ
-¥­¥¹¥È¤Î¥Õ¥¡¥¤¥ë¤Ë¥À¥ó¥×¤·¤Þ¤¹¡£Igor Romanenko ¤Ë¤è¤Ã¤ÆÆÈÁÏŪ¤Ë¥¨¥ó¥Ï¥ó
-¥¹¤µ¤ì¤¿¥Õ¥ê¡¼¥¦¥§¥¢¡£
-@xref{mysqldump, , @code{mysqldump}}.
-
-@cindex @code{mysqlimport}
-@item mysqlimport
-°ì¤Ä¤Þ¤¿¤ÏÊ£¿ô¤Î¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤ò¤½¤ì¤¾¤ì¤Î¥Æ¡¼¥Ö¥ë¤ËÆɤ߹þ¤ß¤Þ¤¹¡£@code{LOAD
-DATA INFILE} ¤Ç¥µ¥Ý¡¼¥È¤µ¤ì¤ëÁ´¤Æ¤Î·Á¼°¤ò»ÈÍѤǤ­¤Þ¤¹¡£ @xref{mysqlimport, , @code{mysqlimport}}.
-
-@cindex @code{mysqlshow}
-@item mysqlshow
-¥Ç¡¼¥¿¥Ù¡¼¥¹, ¥Æ¡¼¥Ö¥ë, ¹àÌܤ½¤·¤Æ¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òɽ¼¨¤·¤Þ¤¹¡£
-
-@cindex @code{mysql_install_db}
-@item mysql_install_db
-@strong{MySQL} ¾µÇ§¥Æ¡¼¥Ö¥ë¤ò¥Ç¥Õ¥©¥ë¥È¤Î¸¢¸Â¤ÇºîÀ®¤·¤Þ¤¹¡£¤³¤ì¤ÏÄ̾ºÇ
-½é¤Î @strong{MySQL} ¥ê¥ê¡¼¥¹¤ò¿·¤·¤¤¥·¥¹¥Æ¥à¾å¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë»þ¤Ë°ì²ó
-¤À¤±¼Â¹Ô¤µ¤ì¤Þ¤¹¡£
-
-@cindex @code{replace}
-@item replace
-@code{msql2mysql} ¤Ç»ÈÍѤµ¤ì¤ë¥Ð¥¤¥Ê¥ê¡£¥Õ¥¡¥¤¥ëÆâ¤Þ¤¿¤Ïɸ½àÆþÎϾå¤Îʸ»úÎó¤òÊÑ
-´¹¤¹¤ë¥æ¡¼¥Æ¥£¥ê¥Æ¥£¥×¥í¥°¥é¥à¡£¤è¤êŤ¤Ê¸»úÎó¤ËºÇ½é¤ËŬ¹ç¤¹¤ë¤¿¤áÍ­¸Â¾õ
-ÂÖ¥Þ¥·¥ó¤ò»ÈÍѤ·¤Þ¤¹¡£Ê¸»úÎó¤ò¸ò´¹¤¹¤ë¤¿¤á¤Ë»ÈÍѤǤ­¤Þ¤¹¡£Î㤨¤Ð¡¢
-@code{a} ¤È @code{b} ¤òÍ¿¤¨¤é¤ì¤¿¥Õ¥¡¥¤¥ëÆâ¤Ç¸ò´¹¤·¤Þ¤¹:
-
-@example
-shell> replace a b b a -- file1 file2 ...
-@end example
-
-@cindex @code{safe_mysqld}
-
-@item safe_mysqld
-@code{mysqld} ¥Ç¡¼¥â¥ó¤ò¤¤¤¯¤Ä¤«¤Î°ÂÁ´¤Êµ¡Ç½¤Ç³«»Ï¤·¤Þ¤¹¡£¥¨¥é¡¼»þ¤Ë¤ÏºÆµ¯Æ°¤·¡¢
-¼Â¹Ô»þ¾ðÊó¤ò¥í¥°¥Õ¥¡¥¤¥ë¤Øµ­Æþ¤·¤Þ¤¹¡£
-@end table
-
-@cindex Scripts
-@cindex @code{mysql}
-@node mysql, mysqladmin, Programs, Tools
-@section ¥³¥Þ¥ó¥É¥é¥¤¥ó¥Ä¡¼¥ë¡¡¡Ê @code{mysql} ¡Ë
-
-@code{mysql} ¤Ï¥·¥ó¥×¥ë¤Ê SQL shell ¤Ç¤¹(GNU @code{readline} ¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹).
-¤³¤ì¤ÏÂÐÏå⡼¥É¤È¡¢ÈóÂÐÏå⡼¥É¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£ ÂÐÏå⡼¥É¤Ç»ÈÍѤµ¤ì¤¿¾ì¹ç¡¢
-¥¯¥¨¥ê¤Î·ë²Ì¤Ï ASCII ¥Æ¡¼¥Ö¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ÇÍ¿¤¨¤é¤ì¤Þ¤¹¡£
-ÈóÂÐÏå⡼¥É¤Ç»ÈÍѤµ¤ì¤¿¾ì¹ç(Î㤨¤Ð¥Õ¥£¥ë¥¿¡¼¤È¤·¤Æ)¡¢·ë²Ì¤Ï¥¿¥Ö¶èÀÚ¤ê¤Î
-¥Õ¥©¡¼¥Þ¥Ã¥È¤ÇÊÖ¤ê¤Þ¤¹¡£
-(½ÐÎÏ¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó¤Î¥ª¥×¥·¥ç¥ó¤ÇÊѹ¹¤Ç¤­¤Þ¤¹)
-°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ¥¹¥¯¥ê¥×¥È¤ò¼Â¹Ô¤Ç¤­¤Þ¤¹¡§
-
-@example
-shell> mysql database < script.sql > output.tab
-@end example
-
-¤â¤·¥¯¥é¥¤¥¢¥ó¥È¤Ç¥á¥â¥ê¡¼ÉÔ­¤ÎÌäÂ꤬½Ð¤¿¾ì¹ç¡¢@code{--quick} ¥ª¥×¥·¥ç¥ó¤ò
-»ÈÍѤ·¤Þ¤¹¡ª ¤³¤ì¤Ï @code{mysql} ¤Ë¡¢·ë²Ì¥»¥Ã¥È¤ò¼èÆÀ¤¹¤ëºÝ¤Ë¡¢
-@code{mysql_store_result()} ¤Ç¤Ï¤Ê¤¯ @code{mysql_use_result()} ¤ò
-»ÈÍѤµ¤»¤Þ¤¹¡£
-
-@code{mysql} ¤Î»ÈÍѤϤȤƤâ´Êñ¤Ç¤¹¡§
-@code{mysql database} ¤ä @code{mysql --user=user_name --password=your_password d
-atabase} ¤Î¤è¤¦¤Ë¤·¤Æ¤Ï¤¸¤á¤Þ¤¹¡£
-SQL ʸ¤òÆþÎϤ·¡¢°ìʸ¤ò @samp{;}, @samp{\g} or @samp{\G} ¤Ç½ª¤¨¡¢
-return/enter ¤ò²¡¤·¤Þ¤¹¡£
-
-@code{mysql} ¤Ï°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡§
-
-@table @code
-@item -?, --help
-help ¤òɽ¼¨¤·¤Æ½ªÎ»
-@item -A, --no-auto-rehash
-¼«Æ°¥ê¥Ï¥Ã¥·¥å¤ò¤·¤Ê¤¤¡£ ¥Æ¡¼¥Ö¥ë¤È¥Õ¥£¡¼¥ë¥É¤Î¼èÆÀ¤Ë¤Ï 'rehash' ¤ò»ÈÍѤ·¤Ê¤¯¤Æ¤Ï
-¤Ê¤ê¤Þ¤»¤ó¡£ ¤³¤ì¤Ï @code{mysql} ¤Îµ¯Æ°¤ò®¤¯¤·¤Þ¤¹¡£
-@item -B, --batch
-·ë²Ì¤ò¥¿¥Ö¶èÀڤꡢ£±¥ì¥³¡¼¥É¤Ï£±¹Ô¤Ç½ÐÎϤ·¤Þ¤¹¡£ history ¥Õ¥¡¥¤¥ë¤Ï»ÈÍѤ·¤Þ¤»¤ó¡£
-@item -C, --compress
-¥µ¡¼¥Ð¡¼¡¦¥¯¥é¥¤¥¢¥ó¥È´Ö¤ÎÄÌ¿®¤ò°µ½Ì¤·¤Þ¤¹
-@item -#, --debug[=...]
-¥Ç¥Ð¥Ã¥°¥í¥°¡£ ¥Ç¥Õ¥©¥ë¥È¤Ï 'd:t:o,/tmp/mysql.trace'
-@item -D, --database=..
-»ÈÍѤ¹¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¡£ ¤³¤ì¤Ï @code{my.cnf} ¥Õ¥¡¥¤¥ë¤¬ÊØÍø¤Ç¤¹
-@item -e, --execute=...
-¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Æ½ªÎ»¡£ (Output like with --batch)
-@item -E, --vertical
-¿âľ¤Ë¥ì¥³¡¼¥É¤ò½ÐÎϤ·¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æ¤¤¤Ê¤¯¤Æ¤â¡¢
-SQL ʸ¤ò @code{\G} ¤Ç½ªÎ»¤·¤¿¾ì¹ç¡¢Æ±¤¸¤è¤¦¤Ë¿âľ¤Ë½ÐÎϤ·¤Þ¤¹¡£
-@item -f, --force
-SQL ¥¨¥é¡¼¤¬¤ª¤­¤¿¤È¤·¤Æ¤â¡¢½èÍý¤ò³¤±¤Þ¤¹
-@item -i, --ignore-space
-´Ø¿ô̾¤Î¸å¤í¤Ë¤Ä¤¤¤¿¥¹¥Ú¡¼¥¹¤ò̵»ë¤·¤Þ¤¹
-@item -h, --host=...
-»ØÄꤷ¤¿¥Û¥¹¥È¤ËÀܳ¤·¤Þ¤¹
-@item -H, --html
-·ë²Ì¤ò HTML ¥Õ¥©¡¼¥Þ¥Ã¥È¤ÇÊÖ¤·¤Þ¤¹
-@item -L, --skip-line-numbers
-¥¨¥é¡¼¤Îµ¯¤­¤¿¹Ô¤ÎÈÖ¹æ¤ò½ñ¤­¤Þ¤»¤ó¡£ ¤³¤ì¤Ï¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤ò´Þ¤ó¤À·ë²Ì¤ò
-Èæ³Ó¤¹¤ë¾ì¹ç¤ËÊØÍø¤Ç¤¹¡£
-@item -n, --unbuffered
-¤½¤ì¤¾¤ì¤Î¥¯¥¨¥êËè¤Ë¥Ð¥Ã¥Õ¥¡¤ò¥Õ¥é¥Ã¥·¥å¤·¤Þ¤¹
-@item -N, --skip-column-names
-·ë²Ì¤Ë¡¢¥Õ¥£¡¼¥ë¥É̾¤ò½ñ¤­½Ð¤·¤Þ¤»¤ó¡£
-@item -O, --set-variable var=option
-ÊÑ¿ô¤ËÃͤò¥»¥Ã¥È¤·¤Þ¤¹¡£ @code{--help} lists variables
-@item -o, --one-database
-¥Ç¥Õ¥©¥ë¥È¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¤ß¹¹¿·¤·¤Þ¤¹¡£ ¤³¤ì¤Ï update ¥í¥°¥Õ¥¡¥¤¥ë¤ò
-»ÈÍѤ·¤Æ¹¹¿·¤¹¤ë¾ì¹ç¡¢Â¾¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¹¹¿·¤òÈò¤±¤¿¤¤»þ¤ËÊØÍø¤Ç¤¹¡£
-@item -p[password], --password[=...]
-¥µ¡¼¥Ð¡¼¤ËÀܳ¤¹¤ëºÝ¤Î¥Ñ¥¹¥ï¡¼¥É¡£ ¤â¤·¥Ñ¥¹¥ï¡¼¥É¤¬¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë
-»ØÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¡¢tty ¾å¤Ç¥Ñ¥¹¥ï¡¼¥É¤¬Ì䤤¹ç¤ï¤µ¤ì¤Þ¤¹¡£
-@code{-p} ¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤È¥Ñ¥¹¥ï¡¼¥É¤Î´Ö¤Ë¤Ï
-¥¹¥Ú¡¼¥¹¤¬ÉÔÍפÀ¤È¤¤¤¦¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-@item -P --port=...
-Àܳ¤Ë»ÈÍѤ¹¤ë TCP/IP ¥Ý¡¼¥ÈÈÖ¹æ
-@item -q, --quick
-·ë²Ì¤ò¥­¥ã¥Ã¥·¥å¤»¤º¡¢°ì¥ì¥³¡¼¥É¤Å¤Ä½ÐÎϤ·¤Þ¤¹¡£
-¤³¤ì¤Ï¤â¤·½ÐÎϤòÃæ»ß¤·¤¿¾ì¹ç¡¢¥µ¡¼¥Ð¡¼¤òÃÙ¤¯¤·¤Þ¤¹¡£
-¥Ò¥¹¥È¥ê¥Õ¥¡¥¤¥ë¤Ï»ÈÍѤ·¤Þ¤»¤ó¡£
-@item -r, --raw
-¥¨¥¹¥±¡¼¥×½èÍý¤ò¤·¤Ê¤¤¤ÇÃͤò½ñ¤­½Ð¤·¤Þ¤¹¡£ @code{--batch} ¤È¤È¤â¤Ë»ÈÍѤµ¤ì¤Þ¤¹
-@item -s, --silent
-ÀŽͥ⡼¥É
-@item -S --socket=...
-Àܳ¤Ë»ÈÍѤ¹¤ë ¥½¥±¥Ã¥È¥Õ¥¡¥¤¥ë
-@item -t --table
-ɽ¤Î·Á¼°¤Ç½ÐÎϤ·¤Þ¤¹¡£ ¤³¤ì¤Ï batch ¥â¡¼¥É°Ê³°¤Ç¤Î¥Ç¥Õ¥©¥ë¥È¤Ç¤¹¡£
-@item -T, --exit-info
-Only used when debugging. --exit-info=0 will print some usage information
-one exit.
-@item -u, --user=#
-¥í¥°¥¤¥ó¥æ¡¼¥¶¡¼Ì¾
-@item -U, --safe-updates[=#], --i-am-a-dummy[=#]
-¥­¡¼¤ò»ÈÍѤ¹¤ë @code{UPDATE} and @code{DELETE} ¤Î¤ß¤ò¹Ô¤¤¤Þ¤¹¡£
-¤³¤ì¤Ï¸å½Ò¤·¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¤â¤· @code{my.cnf} ¤Ë½ñ¤¤¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢
-@code{--safe-updates=0} ¤Ç¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¥ê¥»¥Ã¥È¤Ç¤­¤Þ¤¹¡£
-@item -v, --verbose
-¾éĹ½ÐÎÏ¡£ (-v -v -v ¤Ïɽ·Á¼°¤Î½ÐÎϤòÍ¿¤¨¤ë)
-@item -V, --version
-¥Ð¡¼¥¸¥ç¥ó¤òɽ¼¨¤·¤Æ½ªÎ»
-@item -w, --wait
-¤â¤·Àܳ¤¬Íî¤Á¤¿¾ì¹ç¡¢ÃæÃǤ·¤Ê¤¤¤Ç¡¢ÂԤäơ¢ºÆ»î¹Ô¤·¤Þ¤¹¡£
-@end table
-
-¤â¤·¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç 'help' ¤ÈÂǤ俾ì¹ç¡¢@code{mysql} ¤Ï¥µ¥Ý¡¼¥È¤¹¤ë
-¥³¥Þ¥ó¥É¤òɽ¼¨¤·¤Þ¤¹¡§
-
-@example
-mysql> help
-
-MySQL commands:
-help (\h) Display this text
-? (\h) Synonym for `help'
-clear (\c) Clear command
-connect (\r) Reconnect to the server. Optional arguments are db and host
-edit (\e) Edit command with $EDITOR
-exit (\q) Exit mysql. Same as quit
-go (\g) Send command to mysql server
-ego (\G) Send command to mysql server; Display result vertically
-print (\p) Print current command
-quit (\q) Quit mysql
-rehash (\#) Rebuild completion hash
-source (\.) Execute a SQL script file. Takes a file name as an argument
-status (\s) Get status information from the server
-use (\u) Use another database. Takes database name as argument
-@end example
-
-@code{status} ¥³¥Þ¥ó¥É¤Ï¡¢º£»ÈÍѤ·¤Æ¤¤¤ë
-Àܳ¤È¥µ¡¼¥Ð¡¼¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤ò¤¤¤¯¤Ä¤«É½¼¨¤·¤Þ¤¹¡£
-¤â¤· @code{--safe-updates} ¥â¡¼¥É¤Ç»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢ @code{status} ¤Ï
-¤¢¤Ê¤¿¤Î¥¯¥¨¥ê¤Ë±Æ¶Á¤¹¤ë @code{mysql} ÊÑ¿ô¤ÎÃͤòɽ¼¨¤·¤Þ¤¹¡£
-
-½é¿´¼Ô¤ËÊØÍø¤Êµ¯Æ°¥ª¥×¥·¥ç¥ó(@strong{MySQL} 3.23.11 ¤ÇƳÆþ¤µ¤ì¤Þ¤·¤¿)¤Ï¡¢
-@code{--safe-mode} (¤¢¤ë¤¤¤Ï @code{--i-am-a-dummy}) ¤Ç¡¢
-¤³¤ì¤Ï @code{DELETE FROM table_name} ¤ò @code{WHERE} Àá¤ò˺¤ì¤Æ
-¼Â¹Ô¤·¤è¤¦¤È¤·¤¿¾ì¹ç¤Î¤¿¤á¤Ë¤¢¤ê¤Þ¤¹¡£
-¤³¤Î¥ª¥×¥·¥ç¥ó¤¬»ÈÍѤµ¤ì¤ë¤È¡¢ @code{mysql} ¤ÏÀܳ»þ¤Ë @strong{MySQL} ¥µ¡¼¥Ð¡¼¤Ë
-°Ê²¼¤Î¤è¤¦¤Ê¥³¥Þ¥ó¥É¤òÁ÷¤ê¤Þ¤¹¡§
-
-@example
-SET SQL_SAFE_UPDATES=1,SQL_SELECT_LIMIT=#select_limit#,
- SQL_MAX_JOIN_SIZE=#max_join_size#"
-@end example
-
-¤³¤³¤Ç @code{#select_limit#} ¤È @code{#max_join_size#} ¤ÏÊÑ¿ô¤Ç
-¤³¤ì¤é¤Ï @code{mysql} ¥³¥Þ¥ó¥É¤«¤é¥»¥Ã¥È²Äǽ¤Ç¤¹¡£
-@xref{SET OPTION, @code{SET}}.
-
-¤³¤Î¸ú²Ì¤Ï¡§
-
-@itemize bullet
-@item
-¤â¤· @code{WHERE} Àá¤Ç¥­¡¼¤ò»ÈÍѤ·¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢@code{UPDATE} ¤ä @code{DELETE}
-¤Ïµö²Ä¤µ¤ì¤Þ¤»¤ó¡£ ¤·¤«¤·¡¢ @code{LIMIT} ¤ò»ÈÍѤ¹¤ì¤Ð @code{UPDATE/DELETE} ¤ò
-¶¯À©¼Â¹Ô¤Ç¤­¤Þ¤¹¡§
-@example
-UPDATE table_name SET not_key_column=# WHERE not_key_column=# LIMIT 1;
-@end example
-@item
-Á´¤Æ¤Î¿¤­¤Ê·ë²Ì¤Ï¼«Æ°Åª¤Ë @code{#select_limit#} ¥ì¥³¡¼¥É¤Þ¤Ç¤ËÍÞ¤¨¤é¤ì¤Þ¤¹¡£
-@item
-ɾ²Á¤Ë @code{#max_join_size} °Ê¾å¤Î¹Ô¤òɬÍפȤ¹¤ë¤Ç¤¢¤í¤¦ @code{SELECT} ¤Ï
-ÃæÃǤµ¤ì¤Þ¤¹¡£
-@end itemize
-
-@node mysqladmin, mysqldump, mysql, Tools
-@section @strong{MySQL} ¥µ¡¼¥Ð¡¼¤Î´ÉÍý¡¡( @code{mysqladmin} )
-
-´ÉÍý¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¡£¥·¥ó¥¿¥Ã¥¯¥¹¤Ï:
-
-@example
-shell> mysqladmin [OPTIONS] command [command-option] command ...
-@end example
-
-@code{mysqladmin --help} ¤Ë¤è¤Ã¤Æ¡¢¥ª¥×¥·¥ç¥ó¤Î°ìÍ÷¤ò¼ê¤Ë¤¤¤ì¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-¸½ºß¤Î @code{mysqladmin} ¤Ï°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡§
-
-@multitable @columnfractions .3 .7
-@item create databasename @tab ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎºîÀ®
-@item drop databasename @tab ¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¥Æ¡¼¥Ö¥ë¤ÎÁ´ºï½ü¡£
-@item extended-status @tab ¥µ¡¼¥Ð¡¼¤«¤é³ÈÄ¥¥¹¥Æ¡¼¥¿¥¹¤ò¼èÆÀ¡£
-@item flush-hosts @tab ¥­¥ã¥Ã¥·¥å¤µ¤ì¤Æ¤¤¤ëÁ´¥Û¥¹¥È¤ò¥Õ¥é¥Ã¥·¥å¡£
-@item flush-logs @tab Á´¤Æ¤Î¥í¥°¤ò¥Õ¥é¥Ã¥·¥å
-@item flush-tables @tab Á´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤ò¥Õ¥é¥Ã¥·¥å
-@item flush-privileges @tab µö²Ä¥Æ¡¼¥Ö¥ë¤ÎºÆÆɤ߹þ¤ß (reload ¤ÈƱ¤¸)
-@item kill id,id,... @tab mysql ¥¹¥ì¥Ã¥É¤Î kill.
-@item password new-password @tab ¸Å¤¤¥Ñ¥¹¥ï¡¼¥É¤ò new-password ¤ËÊѹ¹
-@item ping @tab mysqld ¤¬À¸¤­¤Æ¤¤¤ë¤«¥Á¥§¥Ã¥¯
-@item processlist @tab ¸½ºß³èÆ°Ãæ¤Î mysql ¥¹¥ì¥Ã¥É¤òɽ¼¨
-@item reload @tab µö²Ä¥Æ¡¼¥Ö¥ë¤ÎºÆÆɤ߹þ¤ß
-@item refresh @tab Á´¥Æ¡¼¥Ö¥ë¤ò¥Õ¥é¥Ã¥·¥å¤·¡¢¥í¥°¥Õ¥¡¥¤¥ë¤ò°ìÅÙÊĤ¸¤Æ³«¤­¤Þ¤¹¡£
-@item shutdown @tab ¥µ¡¼¥Ð¡¼¤ò¥À¥¦¥ó¤µ¤»¤Þ¤¹¡£
-@item slave-start @tab Start slave replication thread
-@item slave-stop @tab Stop slave replication thread
-@item status @tab ¥µ¡¼¥Ð¡¼¤«¤éû¤¤¥¹¥Æ¡¼¥¿¥¹¤òÆÀ¤Þ¤¹¡£
-@item variables @tab ÊÑ¿ô¤Îɽ¼¨
-@item version @tab ¥µ¡¼¥Ð¡¼¤«¤é¥Ð¡¼¥¸¥ç¥ó¤òÆÀ¤Þ¤¹¡£
-@end multitable
-
-Á´¤Æ¤Î¥³¥Þ¥ó¥É¤Ï¡¢¥æ¥Ë¡¼¥¯¤Ê¥×¥ì¥Õ¥£¥Ã¥¯¥¹¤Ç¾Êά²Äǽ¤Ç¤¹¡£
-Î㤨¤Ð¡§
-
-@example
-shell> mysqladmin proc stat
-+----+-------+-----------+----+-------------+------+-------+------+
-| Id | User | Host | db | Command | Time | State | Info |
-+----+-------+-----------+----+-------------+------+-------+------+
-| 6 | monty | localhost | | Processlist | 0 | | |
-+----+-------+-----------+----+-------------+------+-------+------+
-Uptime: 10077 Threads: 1 Questions: 9 Slow queries: 0 Opens: 6 Flush tables: 1 Open tables: 2 Memory in use: 1092K Max memory used: 1116K
-@end example
-
-@code{mysqladmin status} ¥³¥Þ¥ó¥É¤Î·ë²Ì¤Ï¡¢°Ê²¼¤Î¹àÌܤò»ý¤Á¤Þ¤¹:
-
-@multitable @columnfractions .3 .7
-@item Uptime @tab @strong{MySQL} ¥µ¡¼¥Ð¡¼¤Îµ¯Æ°Éÿô
-@item Threads @tab ²ÔƯÃæ¤Î¥¹¥ì¥Ã¥É¿ô (clients)
-@item Questions @tab @code{mysqld} ¤¬³«»Ï¤·¤Æ¤«¤é¤Î¥¯¥é¥¤¥¢¥ó¥È¤«¤é¤Î¥¯¥¨¥ê¿ô
-@item Slow queries @tab @code{long_query_time} Éäè¤ê»þ´Ö¤Î¤«¤«¤Ã¤¿¥¯¥¨¥ê¤Î¿ô
-@item Opens @tab @code{mysqld} ¤¬³«¤¤¤¿¥Æ¡¼¥Ö¥ë¿ô
-@item Flush tables @tab @code{flush ...}, @code{refresh} and @code{reload} ¥³¥Þ¥ó¥É¤Î¼Â¹Ô²ó¿ô
-@item Open tables @tab ¸½ºß³«¤«¤ì¤Æ¤¤¤ë¥Æ¡¼¥Ö¥ë¤Î¿ô
-@item Memory in use @tab mysqld ¤Î¥³¡¼¥É¤Ë¤è¤Ã¤ÆľÀܳä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê (only available when @strong{MySQL} is compiled with --with-debug)
-@item Max memory used @tab mysqld ¤Î¥³¡¼¥É¤Ë¤è¤Ã¤ÆľÀܳä¤êÅö¤Æ¤é¤ì¤ëºÇÂç¥á¥â¥ê¡¼ÎÌ (only available when @strong{MySQL} is compiled with --with-debug)
-@end multitable
-
-If you do @code{mysqladmin shutdown} on a socket (in other words, on a
-the computer where @code{mysqld} is running), @code{mysqladmin} will
-wait until the @code{MySQL} @code{pid-file} is removed to ensure that
-the @code{mysqld server} has stopped properly.
-
-@node mysqldump, mysqlimport, mysqladmin, Tools
-@section @strong{MySQL} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¥Æ¡¼¥Ö¥ë¤«¤é¡¢¹½Â¤¤È¥Ç¡¼¥¿¤ò¥À¥ó¥×¡¡( @code{mysqldump} )
-
-¥Ç¡¼¥¿¥Ù¡¼¥¹¡¢¤¢¤ë¤¤¤Ï¡¢
-¥Ð¥Ã¥¯¥¢¥Ã¥×¡¢Â¾¤ÎSQL¥µ¡¼¥Ð¡¼¤Ø¤Î¥Ç¡¼¥¿¤ò°ÜÆ°¤òÌÜŪ¤È¤·¤¿¥Ç¡¼¥¿¤Î¤Þ¤È¤Þ¤ê¡¢
-¤³¤ì¤é¤ò¥À¥ó¥×¤¹¤ë¤¿¤á¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¡£
-¥À¥ó¥×¤Ï¡¢¥Æ¡¼¥Ö¥ë¤ÎºîÀ®¤Î¤¿¤á¤Î SQL ʸ¤ò´Þ¤ß¤Þ¤¹¡£
-
-@example
-shell> mysqldump [OPTIONS] database [tables]
-OR mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
-OR mysqldump [OPTIONS] --all-databases [OPTIONS]
-@end example
-
-¤â¤·¥Æ¡¼¥Ö¥ë¤ò»ØÄꤻ¤º¡¢@code{--databases} ¤ä @code{--all-databases} ¤ò
-»ÈÍѤ·¤Ê¤«¤Ã¤¿¤Ê¤é¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÁ´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤¬¥À¥ó¥×¤µ¤ì¤Þ¤¹¡£
-
-@code{mysqldump --help} ¤Ë¤è¤Ã¤Æ¡¢¥ª¥×¥·¥ç¥ó¤Î°ìÍ÷¤ò¼ê¤Ë¤¤¤ì¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-¤â¤· @code{mysqldump} ¤ò @code{--quick} ¤ä @code{--opt} ¤Ê¤·¤Ç¼Â¹Ô¤¹¤ë¤Ê¤é¤Ð¡¢
-@code{mysqldump} ¤Ï·ë²Ì¤òɽ¼¨¤¹¤ëÁ°¤Ë¡¢·ë²Ì¤ò¥á¥â¥ê¤ËÁ´¤Æ¥í¡¼¥É¤¹¤ë¤³¤È¤Ë
-Ãí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-¤³¤ì¤ÏÂ礭¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¥À¥ó¥×¤¹¤ëºÝ¤ËÌäÂê¤Ë¤Ê¤ë¤Ç¤·¤ç¤¦¡£
-
-@code{mysqldump} ¤Ï°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡§
-
-@table @code
-@item --add-locks
-¥Æ¡¼¥Ö¥ë¤Î¥À¥ó¥×¤ÎÁ°¤Ë @code{LOCK TABLES} ʸ¤òÄɲä·¡¢
-¥Æ¡¼¥Ö¥ë¤Î¥À¥ó¥×¸å¤Ë @code{UNLOCK TABLE} ʸ¤òÄɲä·¤Þ¤¹¡£
-( ¤¢¤È¤Ç @strong{MySQL} ¤ËÁÞÆþ¤¹¤ë¤È¤­¤Ë¤³¤ì¤Ï®¤¯¤Ê¤ê¤Þ¤¹ ).
-@item --add-drop-table
-¥Æ¡¼¥Ö¥ë¤Î create ʸ¤ÎÁ°¤Ë¡¢@code{drop table} ʸ¤òÄɲä·¤Þ¤¹¡£
-@item -A, --all-databases
-Dump all the databases. This will be same as @code{--databases} with all
-databases selected.
-@item -a, --all
-Include all @strong{MySQL} specific create options.
-@item --allow-keywords
-¥­¡¼¥ï¡¼¥É(ͽÌó¸ì) ¤ÈƱ¤¸Ì¾Á°¤ò¤â¤Ä¥Õ¥£¡¼¥ë¥É¤ÎºîÀ®¤òµö¤·¤Þ¤¹¡£
-¤³¤ì¤Ï¡¢¤½¤ì¤¾¤ì¤Î¥Õ¥£¡¼¥ë¥É¤ÎÁ°¤Ë¡¢¥Æ¡¼¥Ö¥ë̾¤òÉÕ¤±Â­¤·¤Þ¤¹¡£
-@item -c, --complete-insert
-´°Á´¤Ê INSERT ʸ(¥Õ¥£¡¼¥ë¥É̾¤ò½ñ¤¤¤¿Ê¸) ¤ò»ÈÍѤ·¤Þ¤¹¡£
-@item -C, --compress
-¤â¤·¥µ¡¼¥Ð¡¼¤È¥¯¥é¥¤¥¢¥ó¥È¤ÎÁÐÊý¤¬°µ½Ì¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤Ê¤é¤Ð¡¢
-ξ¼Ô¤Î´Ö¤Ç¹Ô¤ï¤ì¤ëÄÌ¿®¤òÁ´¤Æ°µ½Ì¤·¤Þ¤¹¡£
-@item -B, --databases
-To dump several databases. Note the difference in usage; In this case
-no tables are given. All name arguments are regarded as databasenames.
-@code{USE db_name;} will be included in the output before each new database.
-@item --delayed
-@code{INSERT DELAYED} ¥³¥Þ¥ó¥É¤ò»ÈÍѤ·¤Æ¥ì¥³¡¼¥É¤ò INSERT ¤·¤Þ¤¹¡£
-@item -e, --extended-insert
-¿·¤·¤¤¥Þ¥ë¥Á¥é¥¤¥ó @code{INSERT} ¹½Ê¸¤ò»ÈÍѤ·¤Þ¤¹¡£(¤³¤ì¤Ï¤¢¤È¤ÇÁÞÆþ¤¹¤ëºÝ¡¢
-¤è¤ê¥³¥ó¥Ñ¥¯¥È¤«¤Ä®¤¯¤Ê¤ê¤Þ¤¹¡£)
-@item -#, --debug[=option_string]
-Trace usage of the program (for debugging).
-@item --help
-Display a help message and exit.
-@item --fields-terminated-by=...
-@itemx --fields-enclosed-by=...
-@itemx --fields-optionally-enclosed-by=...
-@itemx --fields-escaped-by=...
-@itemx --lines-terminated-by=...
-¤³¤ì¤é¤Î¥ª¥×¥·¥ç¥ó¤Ï @code{-T} ¤È¤È¤â¤Ë»ÈÍѤµ¤ì¡¢
-@code{LOAD DATA INFILE} ¤ÈƱÍͤΰÕÌ£¤ò¤Ê¤·¤Þ¤¹¡£
-@xref{LOAD DATA, , @code{LOAD DATA}}.
-@item -F, --flush-logs
-¥À¥ó¥×¤¹¤ëÁ°¤Ë¡¢ @strong{MySQL} ¥µ¡¼¥Ð¡¼¤Î¥í¥°¥Õ¥¡¥¤¥ë¤ò¥Õ¥é¥Ã¥·¥å¤·¤Þ¤¹¡£
-@item -f, --force,
-¥À¥ó¥×¤ÎÅÓÃæ¤Ç SQL ¥¨¥é¡¼¤¬È¯À¸¤·¤Æ¤â¡¢¥À¥ó¥×¤ò³¤±¤Þ¤¹¡£
-@item -h, --host=..
-»ØÄꤵ¤ì¤¿¥Û¥¹¥È¤Î @strong{MySQL} ¥µ¡¼¥Ð¡¼¤«¤é¥À¥ó¥×¤·¤Þ¤¹¡£
-¥Ç¥Õ¥©¥ë¥È¤Î¥Û¥¹¥È¤Ï @code{localhost}.
-@item -l, --lock-tables.
-¥À¥ó¥×¤ò³«»Ï¤¹¤ë¤È¤­Á´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤ò¥í¥Ã¥¯¤·¤Þ¤¹¡£ The tables are locked with
-@code{READ LOCAL} to allow concurrent inserts in the case of @code{MyISAM}
-tables.
-@item -n, --no-create-db
-'CREATE DATABASE /*!32312 IF NOT EXISTS*/ db_name;' will not be put in the
-output. The above line will be added otherwise, if --databases or
---all-databases option was given.
-@item -t, --no-create-info
-¥Æ¡¼¥Ö¥ë¤ÎºîÀ®¾ðÊó( @code{CREATE TABLE} ʸ) ¤ò½ñ¤­½Ð¤·¤Þ¤»¤ó¡£
-@item -d, --no-data
-¥Æ¡¼¥Ö¥ëÆâ¤Î¥ì¥³¡¼¥É¤ò½ñ¤­½Ð¤·¤Þ¤»¤ó¡£
-¤³¤ì¤Ï¥Æ¡¼¥Ö¥ë¤Î¹½Â¤¤À¤±¤ò¼è¤ê½Ð¤·¤¿¤¤¤È¤­¤Ë¤È¤Æ¤âÊØÍø¤Ç¤¹¡ª
-@item --opt
-@code{--quick --add-drop-table --add-locks --extended-insert --lock-tables} ¤ÈƱ¤¸.
-@strong{MySQL} ¥µ¡¼¥Ð¡¼¤«¤éÆɤ߽Ф¹»þ´Ö¤òºÇû¤Ë¤·¤Æ¤¯¤ì¤Þ¤¹¡£
-@item -pyour_pass, --password[=your_pass]
-¥µ¡¼¥Ð¡¼¤ËÀܳ¤¹¤ëºÝ¤Î¥Ñ¥¹¥ï¡¼¥É¤òÍ¿¤¨¤Þ¤¹¡£
-¤â¤· @samp{=your_pass} Éôʬ¤òÍ¿¤¨¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢
-@code{mysqldump} ¤Ï¥Ñ¥¹¥ï¡¼¥É¤Î¥×¥í¥ó¥×¥È¤ò¤À¤·¤Þ¤¹¡£
-@item -P port_num, --port=port_num
-¥µ¡¼¥Ð¡¼¤ËÀܳ¤¹¤ëºÝ¤Ë»ÈÍѤ¹¤ë TCP/IP ¥Ý¡¼¥ÈÈֹ档
- (¤³¤ì¤Ï @code{localhost} °Ê³°¤Î¥Û¥¹¥È¤Ø¤ÎÀܳ¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£
- @code{localhost} ¤Î¾ì¹ç¤Ï¡¢Unix ¥½¥±¥Ã¥È¤¬»ÈÍѤµ¤ì¤Þ¤¹¡£)
-@item -q, --quick
-¥¯¥¨¥ê¤ò¥Ð¥Ã¥Õ¥¡¤Ë¤¿¤á¹þ¤ß¤Þ¤»¤ó¡£stdout ¤ËľÀܽФ·¤Þ¤¹¡£
-@code{mysql_use_result()} ¤ò¤³¤ì¤Ë»ÈÍѤ·¤Æ¤¤¤Þ¤¹¡£
-@item -S /path/to/socket, --socket=/path/to/socket
-@code{localhost} ¤ËÀܳ¤¹¤ëºÝ¤Î¥½¥±¥Ã¥È¥Õ¥¡¥¤¥ë¤Î»ØÄê (¥Ç¥Õ¥©¥ë¥È¤Ï /tmp/mysql.sock )
-@item --tables
-Overrides option --databases (-B).
-@item -T, --tab=path-to-some-directory
-Í¿¤¨¤é¤ì¤¿¥Æ¡¼¥Ö¥ëËè¤Ë¡¢
-SQL CREATE ʸ¤ò´Þ¤à @code{table_name.sql} ¥Õ¥¡¥¤¥ë¡¢
-¥Ç¡¼¥¿¤ò´Þ¤à @code{table_name.txt} ¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¤Þ¤¹¡£
-@strong{NOTE}:
-¤³¤ì¤Ï @code{mysqld} ¥Ç¡¼¥â¥ó¤¬Áö¤Ã¤Æ¤¤¤ë¥Þ¥·¥ó¾å¤Ç @code{mysqldump} ¤ò
-¼Â¹Ô¤¹¤ë¾ì¹ç¤Ë¤À¤±¡¢Æ°ºî¤·¤Þ¤¹¡£
- @code{.txt} ¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤Ï¡¢
- @code{--fields-xxx} ¤È @code{--lines--xxx} ¥ª¥×¥·¥ç¥ó¤Ë½¾¤¤¤Þ¤¹¡£
-@item -u user_name, --user=user_name
-¥µ¡¼¥Ð¡¼¤ËÀܳ¤¹¤ëºÝ¤Î @strong{MySQL} ¥æ¡¼¥¶¡¼Ì¾¡£
-¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢Unix ¤Î¥í¥°¥¤¥ó̾¤Ë¤Ê¤ê¤Þ¤¹¡£
-@item -O var=option, --set-variable var=option
-ÊÑ¿ô¤ÎÃͤò¥»¥Ã¥È¡£ ²Äǽ¤ÊÊÑ¿ô¤Ï¸å¤Ç¼¨¤·¤·¤Þ¤¹¡£
-@item -v, --verbose
-¾éĹ¥â¡¼¥É¡£ ¥×¥í¥°¥é¥à¤¬²¿¤ò¹Ô¤Ã¤Æ¤¤¤ë¤«¤è¤êɽ¼¨¤·¤Þ¤¹¡£
-@item -V, --version
-¥Ð¡¼¥¸¥ç¥ó¤ò¼¨¤·¤Æ½ªÎ»¡£
-@item -w, --where='where-condition'
-ÁªÂò¤µ¤ì¤¿¥ì¥³¡¼¥É¤Î¤ß¤ò¥À¥ó¥×¡§ ¥¯¥ª¡¼¥È¤Ïɬ¿Ü¤Ç¤¹¡ª
-
-@example
-"--where=user='jimf'" "-wuserid>1" "-wuserid<1"
-@end example
-@item -O net_buffer_length=#, where # < 24M
-When creating multi-row-insert statements (as with option
-@code{--extended-insert} or @code{--opt}), @code{mysqldump} will create
-rows up to @code{net_buffer_length} length. If you increase this
-variable, you should also ensure that the @code{max_allowed_packet}
-variable in the @strong{MySQL} server is bigger than the
-@code{net_buffer_length}.
-@end table
-
-@code{mysqldump} ¤ÎÉáÄ̤λÈÍѤϥǡ¼¥¿¥Ù¡¼¥¹¤Î¥Ð¥Ã¥¯¥¢¥Ã¥×¤Ç¤·¤ç¤¦¡£ @xref{Backup}.
-
-@example
-mysqldump --opt database > backup-file.sql
-@end example
-
-¾¤Î @strong{MySQL} ¥µ¡¼¥Ð¡¼¤Ø¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¥³¥Ô¡¼¤¹¤ë¾ì¹ç¤Ë¤âÊØÍø¤Ç¤¹¡§
-
-@example
-mysqldump --opt database | mysql ---host=remote-host -C database
-@end example
-
-It is possible to dump several databases with one command:
-
-@example
-mysqldump --databases database1 [database2 database3...] > my_databases.sql
-@end example
-
-If all the databases are wanted, one can use:
-
-@example
-mysqldump --all-databases > all_databases.sql
-@end example
-
-
-@node mysqlimport, mysqlshow, mysqldump, Tools
-@section ¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤«¤é¥Ç¡¼¥¿¤ò¼è¤ê¹þ¤à¡¡( @code{mysqlimport} )
-
-@code{mysqlimport} ¤Ï¡¢@code{LOAD DATA INFILE} SQL ¹½Ê¸¤ò¡¢
-¥³¥Þ¥ó¥É¥é¥¤¥ó¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ÇÄ󶡤·¤Þ¤¹¡£
-@code{mysqlimport} ¤Î¥ª¥×¥·¥ç¥ó¤Î¤Û¤È¤ó¤É¤¬¡¢
- @code{LOAD DATA INFILE} ¤Ø¤ÎƱ¤¸¥ª¥×¥·¥ç¥ó¤ËÂбþ¤·¤Þ¤¹¡£
-@xref{LOAD DATA, , @code{LOAD DATA}}.
-
-@code{mysqlimport} ¤Î¼Â¹Ô¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹:
-
-@example
-shell> mysqlimport [options] database textfile1 [textfile2....]
-@end example
-
-@code{mysqlimport} ¤Ï¡¢¥³¥Þ¥ó¥É¥é¥¤¥ó¤Î°ú¿ô¤ËÍ¿¤¨¤é¤ì¤¿¥Õ¥¡¥¤¥ë̾¤Î³ÈÄ¥»Ò¤ò¼è¤ê¡¢
-³ÈÄ¥»Ò¤ò¼è¤Ã¤¿¸å¤Î̾Á°¤ò¡¢¥Õ¥¡¥¤¥ë¤ÎÆâÍƤò¼è¤ê¹þ¤à¥Æ¡¼¥Ö¥ë¤Î̾Á°¤È¤·¤Þ¤¹¡£
-Î㤨¤Ð¡¢@file{patient.txt}, @file{patient.text}, @file{patient} ¤È¤¤¤¦
-¥Õ¥¡¥¤¥ë¤ÏÁ´¤Æ¡¢@code{patient} ¤È¤È¤¤¤¦Ì¾Á°¤Î¥Æ¡¼¥Ö¥ë¤Ë¼è¤ê¹þ¤Þ¤ì¤Þ¤¹¡£
-
-@code{mysqlimport} ¤Ï°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹:
-
-@table @code
-@item -c, --columns=...
-This option takes a comma separated list of field names as an argument.
-The field list is passed to LOAD DATA INFILE MySQL sql command, which
-mysqlimport calls MySQL to execute. For more information, please see
-@code{LOAD DATA INFILE}. @xref{LOAD DATA, , @code{LOAD DATA}}.
-@item -C, --compress
-¥¯¥é¥¤¥¢¥ó¥È¤È¥µ¡¼¥Ð¡¼¤ÎξÊý¤¬°µ½Ì¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¤Ê¤é¡¢
-¥¯¥é¥¤¥¢¥ó¥È¡¦¥µ¡¼¥Ð¡¼´Ö¤Ç¤ä¤ê¼è¤ê¤µ¤ì¤ëÁ´¤Æ¤Î¾ðÊó¤ò°µ½Ì¤·¤Þ¤¹¡£
-
-@item -#, --debug[=option_string]
-¥×¥í¥°¥é¥à¤Î¥È¥ì¡¼¥¹(¥Ç¥Ð¥Ã¥°)
-
-@item -d, --delete
-¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤ò¼è¤ê¹þ¤àÁ°¤Ë¥Æ¡¼¥Ö¥ë¤ò¶õ¤Ë¤·¤Þ¤¹¡£
-
-@item --fields-terminated-by=...
-@itemx --fields-enclosed-by=...
-@itemx --fields-optionally-enclosed-by=...
-@itemx --fields-escaped-by=...
-@itemx --lines-terminated-by=...
-¤³¤ì¤é¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢@code{LOAD DATA INFILE} ¤ÎÂбþ¤¹¤ëʸÀá¤ÈƱ¤¸°ÕÌ£¤Ë¤Ê¤ê¤Þ¤¹¡£
-@xref{LOAD DATA, , @code{LOAD DATA}}.
-
-@item -f, --force
-¥¨¥é¡¼¤ò̵»ë¤·¤Þ¤¹¡£Î㤨¤Ð¡¢¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤ò¼è¤ê¹þ¤à¥Æ¡¼¥Ö¥ë¤¬¤Ê¤¤¾ì¹ç¡¢
-»Ä¤ê¤Î¥Õ¥¡¥¤¥ë¤Î½èÍý¤Ë°Ü¤ê¤Þ¤¹¡£ @code{--force} ¤¬¤Ê¤±¤ì¤Ð¡¢
-¥Æ¡¼¥Ö¥ë¤¬¤Ê¤±¤ì¤Ð @code{mysqlimport} ¤Ï½ªÎ»¤·¤Þ¤¹¡£
-
-@item --help
-¥Ø¥ë¥×¤òɽ¼¨¤·¤Æ½ªÎ»¡£
-
-@item -h host_name, --host=host_name
-̾Á°¤ò»ØÄꤵ¤ì¤¿ @strong{MySQL} ¥µ¡¼¥Ð¡¼¤Ë¥Ç¡¼¥¿¤ò¼è¤êÆþ¤ì¤Þ¤¹¡£
-¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï @code{localhost}.
-
-@item -i, --ignore
-@code{--replace} ¥ª¥×¥·¥ç¥ó¤ÎÀâÌÀ¤ò¸«¤Æ¤¯¤À¤µ¤¤¡£
-
-@item -l, --lock-tables
-¤½¤ì¤¾¤ì¤Î¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤ò½èÍý¤¹¤ëÁ°¤Ë¡¢½ñ¤­¹þ¤Þ¤ì¤ë
-@strong{Á´¤Æ¤Î}¥Æ¡¼¥Ö¥ë¤ò¥í¥Ã¥¯¤·¤Þ¤¹¡£
-¤³¤ì¤Ï³Î¼Â¤Ë¡¢¤¹¤Ù¤Æ¤Î¥Æ¡¼¥Ö¥ë¤ò¥µ¡¼¥Ð¾å¤ÇƱ´ü¤µ¤»¤Þ¤¹¡£
-
-@item -L, --local
-¥¯¥é¥¤¥¢¥ó¥È¤«¤é¤ÎÆþÎÏ¥Õ¥¡¥¤¥ë¤òÆɤߤޤ¹¡£
-¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢@code{localhost} ¤ËÀܳ¤·¤¿¾ì¹ç¡¢¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Ï
-¥µ¡¼¥Ð¡¼¾å¤Ë¤¢¤ë¤È²¾Äꤵ¤ì¤Þ¤¹¡£(@code{localhost} ¤Ï¥Ç¥Õ¥©¥ë¥ÈÃÍ)
-
-@item -pyour_pass, --password[=your_pass]
-¥µ¡¼¥Ð¡¼¤ËÀܳ¤¹¤ë¤È¤­¤Ë»ÈÍѤ¹¤ë¥Ñ¥¹¥ï¡¼¥É¡£
-¤â¤· @samp{=your_pass} ¤Î¤È¤³¤í¤Ë¥Ñ¥¹¥ï¡¼¥É¤ò½ñ¤«¤Ê¤±¤ì¤Ð¡¢
-@code{mysqlimport} ¤Ï¥Ñ¥¹¥ï¡¼¥É¤Î¤¿¤á¤Î¥×¥í¥ó¥×¥È¤ò¤À¤·¤Þ¤¹¡£
-
-@item -P port_num, --port=port_num
-¥Û¥¹¥È¤ËÀܳ¤¹¤ë¤¿¤á¤Î TCP/IP ¥Ý¡¼¥ÈÈֹ档
-(¤³¤ì¤Ï @code{localhost} ¤ò½ü¤¯¥Û¥¹¥È¤Ø¤ÎÀܳ¤Ë»ÈÍѤ·¤Þ¤¹¡£
-@code{localhost} ¤Ø¤Ï¡¢UNIX ¥½¥±¥Ã¥È¤ò»ÈÍѤ·¤Þ¤¹¡£)
-
-@item -r, --replace
-@code{--replace} ¤È @code{--ignore} ¥ª¥×¥·¥ç¥ó¤Ï¡¢
-ÆþÎϤµ¤ì¤Æ¤¤¤ë¥ì¥³¡¼¥É¤Î¥æ¥Ë¡¼¥¯¥­¡¼¤ÎÃͤ¬¡¢
-´û¤Ë¸ºß¤·¤Æ¤¤¤ë¥ì¥³¡¼¥É¤Î¥æ¥Ë¡¼¥¯¥­¡¼¤ÎÃͤÈƱ¤¸¾ì¹ç¡¢
-¤½¤ÎÆþÎϤµ¤ì¤Æ¤¤¤ë¥Ç¡¼¥¿¤Î¼è¤ê°·¤¤¤ò·èÄꤷ¤Þ¤¹¡£
-¤â¤· @code{--replace} ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤Ê¤é¡¢
-´û¤Ë¤¢¤ë¥ì¥³¡¼¥É¤Ï¿·¤·¤¯Æɤޤ줿¥ì¥³¡¼¥É¤ËÃÖ¤­´¹¤¨¤é¤ì¤Þ¤¹¡£
-¤â¤· @code{--ignore} ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤Ê¤é¡¢
-ÆþÎϤµ¤ì¤¿Êª¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£
-¤É¤Á¤é¤Î¥ª¥×¥·¥ç¥ó¤â»ØÄꤷ¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢
-¥­¡¼¤ÎÃͤ¬½Å¤Ê¤Ã¤Æ¤¤¤ë¤È¥¨¥é¡¼¤òȯ¤·¡¢
-¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Î»Ä¤ê¤ÎÉôʬ¤Ï̵»ë¤µ¤ì¤Þ¤¹¡£
-
-@item -s, --silent
-ÀŽͥ⡼¥É¡£¥¨¥é¡¼¤À¤±½ÐÎϤ·¤Þ¤¹¡£
-
-@item -S /path/to/socket, --socket=/path/to/socket
-@code{localhost} ¤Ø¤ÎÀܳ»þ¤Ë»ÈÍѤ¹¤ë¥½¥±¥Ã¥È¥Õ¥¡¥¤¥ë¤ò»ØÄꤷ¤Þ¤¹¡£
-
-@item -u user_name, --user=user_name
-¥µ¡¼¥Ð¡¼¤ÎÀܳ¤Ë»ÈÍѤ¹¤ë @strong{MySQL} ¥æ¡¼¥¶¡¼Ì¾¤Î»ØÄê¡£
-¥Ç¥Õ¥©¥ë¥È¤Ï¡¢Unix ¤Î¥í¥°¥¤¥ó̾¡£
-
-@item -v, --verbose
-¾éĹ¥â¡¼¥É¡£¥×¥í¥°¥é¥à¤¬¤·¤Æ¤¤¤ë»ö¤Ë¤Ä¤¤¤Æ¿¤¯½ÐÎϤ·¤Þ¤¹¡£
-
-@item -V, --version
-¥Ð¡¼¥¸¥ç¥ó¤òɽ¼¨¤·¤Æ½ªÎ»¡£
-@end table
-
-Here follows a sample run of using @code{mysqlimport}:
-
-@example
-$ mysql --version
-mysql Ver 9.33 Distrib 3.22.25, for pc-linux-gnu (i686)
-$ uname -a
-Linux xxx.com 2.2.5-15 #1 Mon Apr 19 22:21:09 EDT 1999 i586 unknown
-$ mysql -e 'CREATE TABLE imptest(id INT, n VARCHAR(30))' test
-$ ed
-a
-100 Max Sydow
-101 Count Dracula
-.
-w imptest.txt
-32
-q
-$ od -c imptest.txt
-0000000 1 0 0 \t M a x S y d o w \n 1 0
-0000020 1 \t C o u n t D r a c u l a \n
-0000040
-$ mysqlimport --local test imptest.txt
-test.imptest: Records: 2 Deleted: 0 Skipped: 0 Warnings: 0
-$ mysql -e 'SELECT * FROM imptest' test
-+------+---------------+
-| id | n |
-+------+---------------+
-| 100 | Max Sydow |
-| 101 | Count Dracula |
-+------+---------------+
-@end example
-
-@node mysqlshow, myisampack, mysqlimport, Tools
-@section Showing databases, tables and columns¡¡¡Ê@code{mysqlshow}¡Ë
-
-@code{mysqlshow} can be used to quickly look at which databases exist,
-their tables, and the table's columns.
-
-With the @code{mysql} program you can get the same information with the
-@code{SHOW} commands. @xref{SHOW}.
-
-@code{mysqlshow} is invoked like this:
-
-@example
-shell> mysqlshow [OPTIONS] [database [table [column]]]
-@end example
-
-@itemize @bullet
-@item
-If no database is given, all matching databases are shown.
-@item
-If no table is given, all matching tables in database are shown.
-@item
-If no column is given, all matching columns and column types in table
-are shown.
-@end itemize
-
-Note that in newer @strong{MySQL} versions you only see those
-database/tables/columns for which you have some privileges.
-
-If the last argument contains a shell or SQL wildcard (@code{*}, @code{?},
-@code{%} or @code{_}) then only what's matched by the wildcard is shown.
-This may cause some confusion when you try to display the columns for a
-table with a @code{_} as in this case @code{mysqlshow} only shows you
-the table names that matches the pattern. This is easily fixed by
-adding an extra @code{%} last on the command line (as a separate
-argument).
-
-@cindex @code{myisampack}
-@cindex @code{pack_isam}
-@node myisampack, , mysqlshow, Tools
-@section @strong{MySQL} ¤Î°µ½Ì¤µ¤ì¤¿Æɤ߹þ¤ßÀìÍѥơ¼¥Ö¥ë¥¸¥§¥Í¥ì¡¼¥¿¡¡( @code{myisampack} ¡¦ @code{pack_isam} )
-
-@code{myisampack} is used to compress MyISAM tables and @code{pack_isam}
-is used to compress ISAM tables. Because ISAM tables are deprecated, we
-will only discuss @code{myisampack} here.
-
-@code{myisampack} ¤Ï¡¢
-1 @strong{MySQL} ¥é¥¤¥»¥ó¥¹°Ê¾å¤Þ¤¿¤Ï @strong{MySQL} ¥µ¥Ý¡¼¥È¤òÃíʸ¤·¤¿»þ¤ËÆÀ
-¤é¤ì¤ëÆÃÊ̤ʥ桼¥Æ¥ê¥Æ¥£¤Ç¤¹¡£¤³¤ì¤é¤Ï¥Ð¥¤¥Ê¥ê¤À¤±¤ÎÇÛÉۤΤ¿¤á¡¢
-¤¤¤¯¤Ä¤«¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¾å¤Ç¤À¤±¤ËÍ­¸ú¤Ç¤¹¡£
-
-In the following we only talk about @code{myisampack}, but everything
-is also true for @code{pack_isam}.
-
-@code{myisampack} ¤Ï¥Æ¡¼¥Ö¥ëÆâ¤Î³Æ¹àÌܤòÊÌ¡¹¤Ë°µ½Ì¤¹¤ë¤è¤¦¤ËƯ¤­¤Þ¤¹¡£Å¸³«¤Î¤¿¤á
-¤Î¾ðÊó¤Ï¡¢¥Æ¡¼¥Ö¥ë¤¬¥ª¡¼¥×¥ó¤µ¤ì¤¿»þ¤Ë¥á¥â¥ê¤ËÆɤޤì¤Þ¤¹¡£¤³¤ì¤Ï¡¢Àµ³Î¤Ë1¥ì¥³¡¼
-¥É¤À¤±¤òŸ³«¤¹¤ëɬÍפ¬¤¢¤ë¤è¤¦¤Ê¡¢¸Ä¡¹¤Î¥ì¥³¡¼¥É¤Ø¤Î¥¢¥¯¥»¥¹»þ¤Ë¤È¤Æ¤âÎÉ
-¤¤À­Ç½¤òÍ¿¤¨¤Þ¤¹¡£MSDOS ¾å¤Î Stacker »ÈÍÑ»þ¤Î¤è¤¦¤Ë¡¢¥Ç¥£¥¹¥¯¥Ö¥í¥Ã¥¯¤Ï
-¤½¤ó¤Ê¤ËÂ礭¤¯¤¢¤ê¤Þ¤»¤ó¡£
-Ä̾@code{myisampack} ¤Ï¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤ò 40¡Á70% ¤Ë¥Ñ¥Ã¥¯¤·¤Þ¤¹¡£
-
-@strong{MySQL} ¤Ï°µ½Ì¤µ¤ì¤¿¥Æ¡¼¥Ö¥ë¤Ç¥á¥â¥ê¥Þ¥Ã¥× (@code{mmap()}) ¤ò»ÈÍѤ·¤Þ¤¹¡£
-@code{mmap()} ¤¬Æ¯¤«¤Ê¤¤¾ì¹ç¤Ï¡¢Ä̾ï¤Î¥Õ¥¡¥¤¥ë¤ÎÆɤ߽ñ¤­¤ò»ÈÍѤ·¤Þ¤¹¡£
-
-¸½ºß @code{myisampack} ¤Ë¤Ï2¤Ä¤ÎÀ©¸Â¤¬¤¢¤ê¤Þ¤¹:
-@itemize @bullet
-@item
-¥Ñ¥Ã¥¯¸å¡¢¥Æ¡¼¥Ö¥ë¤ÏÆɤ߹þ¤ßÀìÍѤˤʤê¤Þ¤¹¡£
-@item
-@code{myisampack} can also pack @code{BLOB} or @code{TEXT} columns. The
-older @code{pack_isam} could not do this.
-@end itemize
-
-¤³¤ì¤é¤ÎÀ©¸Â¤Î½¤Àµ¤Ï TODO ¤Ë¤¢¤ê¤Þ¤¹¤¬¡¢Í¥ÀèÅÙ¤ÏÄ㤤¤Ç¤¹¡£
-
-@code{myisampack} ¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æµ¯Æ°¤·¤Þ¤¹:
-
-@example
-shell> myisampack [options] filename ...
-@end example
-
-¤½¤ì¤¾¤ì¤Î¥Õ¥¡¥¤¥ë̾¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë(@file{.MYI})¤Î̾Á°¤Ç¤¹¡£
-¤â¤·¥Ç¡¼¥¿¥Ç¥£¥ì¥¯¥È¥ê¤Ë¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤ò°ÜÆ°¤·¤Æ¤¤¤Ê¤¤¤Ê¤é¡¢
-¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹¤ò»ØÄꤷ¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£@file{.MYI} ³ÈÄ¥»Ò¤Ï
-¾Êά¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£
-
-@code{myisampack} ¤Ï°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹:
-
-@table @code
-@item -b, --backup
-@code{tbl_name.OLD} ¤È¤·¤Æ¥Ð¥Ã¥¯¥¢¥Ã¥×¤òºîÀ®¤·¤Þ¤¹.
-
-@item -#, --debug=debug_options
-¥Ç¥Ð¥Ã¥¯½ÐÎÏ¡£@code{debug_options} ¤Ï @code{'d:t:o,filename'}.
-
-@item -f, --force
-°ì»þ¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Æ¤¤¤è¤¦¤¬¡¢¥µ¥¤¥º¤¬Â礭¤¯¤Ê¤í¤¦¤¬¡¢¶¯À©Åª¤Ë¥Æ¡¼¥Ö¥ë¤ò
-¥Ñ¥Ã¥¯¤·¤Þ¤¹¡£
-@code{myisampack} ¤Ï¥Æ¡¼¥Ö¥ë¤ò°µ½Ì¤·¤Æ¤¤¤ë´Ö¡¢
-°ì»þ¥Õ¥¡¥¤¥ë¤ò @file{tbl_name.TMD} ¤È¤¤¤¦Ì¾Á°¤ÇºîÀ®¤·¤Þ¤¹¡£
-¤â¤· @code{myisampack} ¤òÅÓÃæ¤Ç kill ¤·¤¿¾ì¹ç¡¢ @file{.TMD} ¥Õ¥¡¥¤¥ë¤¬¾Ã¤µ¤ì¤Æ
-¤¤¤Ê¤¤»ö¤¬¤¢¤ê¤Þ¤¹¡£Ä̾@code{myisampack} ¤Ï @file{tbl_name.TMD} ¥Õ¥¡¥¤¥ë¤¬
-´û¤Ë¸ºß¤¹¤ë¾ì¹ç¤Ï¥¨¥é¡¼¤Ç½ªÎ»¤·¤Þ¤¹¡£ @code{--force} ¤ò»ÈÍѤ¹¤ë¤È¡¢
-@code{myisampack} ¤Ï¤½¤Î¤è¤¦¤Ê¾ì¹ç¤Ç¤â¥Æ¡¼¥Ö¥ë¤ò¥Ñ¥Ã¥¯¤·¤Þ¤¹¡£
-
-@item -?, --help
-¥Ø¥ë¥×¥á¥Ã¥»¡¼¥¸¤ò½ÐÎϤ·¤Æ½ªÎ»¡£
-
-@item -j big_tbl_name, --join=big_tbl_name
-Á´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤ò¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç»ØÄꤷ¤¿ @code{big_tbl_name} °ì¤Ä¤Ë
-¤Þ¤È¤á¤Þ¤¹¡£·ë¹ç¤µ¤ì¤ëÁ´¤Æ¤Î¥Æ¡¼¥Ö¥ëÄêµÁ¤ÏƱ¤¸¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó
-(Ʊ¤¸¹àÌÜ̾¡¢Æ±¤¸¹àÌÜ·¿¡¢Æ±¤¸¥¤¥ó¥Ç¥Ã¥¯¥¹¡¢Åù)
-
-@item -p #, --packlength=#
-Specify the record length storage size, in bytes. The value should be 1, 2
-or 3. (@code{myisampack} stores all rows with length pointers of 1, 2 or 3
-bytes. In most normal cases, @code{myisampack} can determine the right length
-value before it begins packing the file, but it may notice during the packing
-process that it could have used a shorter length. In this case,
-@code{myisampack} will print a note that the next time you pack the same file,
-you could use a shorter record length.)
-
-@item -s, --silent
-Silent mode. Write output only when errors occur.
-
-@item -t, --test
-Don't pack table, only test packing it.
-
-@item -T dir_name, --tmp_dir=dir_name
-Use the named directory as the location in which to write the temporary table.
-
-@item -v, --verbose
-Verbose mode. Write info about progress and packing result.
-
-@item -V, --version
-Display version information and exit.
-
-@item -w, --wait
-Wait and retry if table is in use.
-If the @code{mysqld} server was invoked with the @code{--skip-locking}
-option, it is not a good idea to invoke @code{myisampack} if the table might
-be updated during the packing process.
-@end table
-
-The sequence of commands shown below illustrates a typical table compression
-session:
-
-@example
-shell> ls -l station.*
--rw-rw-r-- 1 monty my 994128 Apr 17 19:00 station.ISD
--rw-rw-r-- 1 monty my 53248 Apr 17 19:00 station.ISM
--rw-rw-r-- 1 monty my 994128 Apr 17 19:00 station.MYD
--rw-rw-r-- 1 monty my 53248 Apr 17 19:00 station.MYI
--rw-rw-r-- 1 monty my 5767 Apr 17 19:00 station.frm
-
-shell> myisamchk -dvv station
-
-MyISAM file: station
-Isam-version: 2
-Creation time: 1996-03-13 10:08:58
-Recover time: 1997-02-02 3:06:43
-Data records: 1192 Deleted blocks: 0
-Datafile: Parts: 1192 Deleted data: 0
-Datafile pointer (bytes): 2 Keyfile pointer (bytes): 2
-Max datafile length: 54657023 Max keyfile length: 33554431
-Recordlength: 834
-Record format: Fixed length
-
-table description:
-Key Start Len Index Type Root Blocksize Rec/key
-1 2 4 unique unsigned long 1024 1024 1
-2 32 30 multip. text 10240 1024 1
-
-Field Start Length Type
-1 1 1
-2 2 4
-3 6 4
-4 10 1
-5 11 20
-6 31 1
-7 32 30
-8 62 35
-9 97 35
-10 132 35
-11 167 4
-12 171 16
-13 187 35
-14 222 4
-15 226 16
-16 242 20
-17 262 20
-18 282 20
-19 302 30
-20 332 4
-21 336 4
-22 340 1
-23 341 8
-24 349 8
-25 357 8
-26 365 2
-27 367 2
-28 369 4
-29 373 4
-30 377 1
-31 378 2
-32 380 8
-33 388 4
-34 392 4
-35 396 4
-36 400 4
-37 404 1
-38 405 4
-39 409 4
-40 413 4
-41 417 4
-42 421 4
-43 425 4
-44 429 20
-45 449 30
-46 479 1
-47 480 1
-48 481 79
-49 560 79
-50 639 79
-51 718 79
-52 797 8
-53 805 1
-54 806 1
-55 807 20
-56 827 4
-57 831 4
-
-shell> myisampack station.MYI
-Compressing station.MYI: (1192 records)
-- Calculating statistics
-
-normal: 20 empty-space: 16 empty-zero: 12 empty-fill: 11
-pre-space: 0 end-space: 12 table-lookups: 5 zero: 7
-Original trees: 57 After join: 17
-- Compressing file
-87.14%
-
-shell> ls -l station.*
--rw-rw-r-- 1 monty my 127874 Apr 17 19:00 station.ISD
--rw-rw-r-- 1 monty my 55296 Apr 17 19:04 station.ISM
--rw-rw-r-- 1 monty my 127874 Apr 17 19:00 station.MYD
--rw-rw-r-- 1 monty my 55296 Apr 17 19:04 station.MYI
--rw-rw-r-- 1 monty my 5767 Apr 17 19:00 station.frm
-
-shell> myisamchk -dvv station
-
-MyISAM file: station
-Isam-version: 2
-Creation time: 1996-03-13 10:08:58
-Recover time: 1997-04-17 19:04:26
-Data records: 1192 Deleted blocks: 0
-Datafile: Parts: 1192 Deleted data: 0
-Datafilepointer (bytes): 3 Keyfile pointer (bytes): 1
-Max datafile length: 16777215 Max keyfile length: 131071
-Recordlength: 834
-Record format: Compressed
-
-table description:
-Key Start Len Index Type Root Blocksize Rec/key
-1 2 4 unique unsigned long 10240 1024 1
-2 32 30 multip. text 54272 1024 1
-
-Field Start Length Type Huff tree Bits
-1 1 1 constant 1 0
-2 2 4 zerofill(1) 2 9
-3 6 4 no zeros, zerofill(1) 2 9
-4 10 1 3 9
-5 11 20 table-lookup 4 0
-6 31 1 3 9
-7 32 30 no endspace, not_always 5 9
-8 62 35 no endspace, not_always, no empty 6 9
-9 97 35 no empty 7 9
-10 132 35 no endspace, not_always, no empty 6 9
-11 167 4 zerofill(1) 2 9
-12 171 16 no endspace, not_always, no empty 5 9
-13 187 35 no endspace, not_always, no empty 6 9
-14 222 4 zerofill(1) 2 9
-15 226 16 no endspace, not_always, no empty 5 9
-16 242 20 no endspace, not_always 8 9
-17 262 20 no endspace, no empty 8 9
-18 282 20 no endspace, no empty 5 9
-19 302 30 no endspace, no empty 6 9
-20 332 4 always zero 2 9
-21 336 4 always zero 2 9
-22 340 1 3 9
-23 341 8 table-lookup 9 0
-24 349 8 table-lookup 10 0
-25 357 8 always zero 2 9
-26 365 2 2 9
-27 367 2 no zeros, zerofill(1) 2 9
-28 369 4 no zeros, zerofill(1) 2 9
-29 373 4 table-lookup 11 0
-30 377 1 3 9
-31 378 2 no zeros, zerofill(1) 2 9
-32 380 8 no zeros 2 9
-33 388 4 always zero 2 9
-34 392 4 table-lookup 12 0
-35 396 4 no zeros, zerofill(1) 13 9
-36 400 4 no zeros, zerofill(1) 2 9
-37 404 1 2 9
-38 405 4 no zeros 2 9
-39 409 4 always zero 2 9
-40 413 4 no zeros 2 9
-41 417 4 always zero 2 9
-42 421 4 no zeros 2 9
-43 425 4 always zero 2 9
-44 429 20 no empty 3 9
-45 449 30 no empty 3 9
-46 479 1 14 4
-47 480 1 14 4
-48 481 79 no endspace, no empty 15 9
-49 560 79 no empty 2 9
-50 639 79 no empty 2 9
-51 718 79 no endspace 16 9
-52 797 8 no empty 2 9
-53 805 1 17 1
-54 806 1 3 9
-55 807 20 no empty 3 9
-56 827 4 no zeros, zerofill(2) 2 9
-57 831 4 no zeros, zerofill(1) 2 9
-@end example
-
-The information printed by @code{myisampack} is described below:
-
-@table @code
-@item normal
-The number of columns for which no extra packing is used.
-
-@item empty-space
-The number of columns containing
-values that are only spaces; these will occupy 1 bit.
-
-@item empty-zero
-The number of columns containing
-values that are only binary 0's; these will occupy 1 bit.
-
-@item empty-fill
-The number of integer columns that don't occupy the full byte range of their
-type; these are changed to a smaller type (for example, an @code{INTEGER}
-column may be changed to @code{MEDIUMINT}).
-
-@item pre-space
-The number of decimal columns that are stored with leading space. In this
-case, each value will contain a count for the number of leading spaces.
-
-@item end-space
-The number of columns that have a lot of trailing space. In this case, each
-value will contain a count for the number of trailing spaces.
-
-@item table-lookup
-The column had only a small number of different values, and that were
-converted to an @code{ENUM} before Huffman compression.
-
-@item zero
-The number of columns for which all values are zero.
-
-@item Original trees
-The initial number of Huffman trees.
-
-@item After join
-The number of distinct Huffman trees left after joining
-trees to save some header space.
-@end table
-
-After a table has been compressed, @code{myisamchk -dvv} prints additional
-information about each field:
-
-@table @code
-@item Type
-The field type may contain the following descriptors:
-
-@table @code
-@item constant
-All rows have the same value.
-
-@item no endspace
-Don't store endspace.
-
-@item no endspace, not_always
-Don't store endspace and don't do end space compression for all values.
-
-@item no endspace, no empty
-Don't store endspace. Don't store empty values.
-
-@item table-lookup
-The column was converted to an @code{ENUM}.
-
-@item zerofill(n)
-The most significant @code{n} bytes in the value are always 0 and are not
-stored.
-
-@item no zeros
-Don't store zeros.
-
-@item always zero
-0 values are stored in 1 bit.
-@end table
-
-@item Huff tree
-The Huffman tree associated with the field.
-
-@item Bits
-The number of bits used in the Huffman tree.
-@end table
-
-After you have run @code{pack_isam}/@code{myisampack} you must run
-@code{isamchk}/@code{myisamchk} to recreate the index. At this time you
-can also sort the index blocks and create statistics that is needed for
-the @strong{MySQL} optimizer to work more efficiently.
-
-@example
-myisamchk -rq --analyze --sort-index table_name.MYI
-isamchk -rq --analyze --sort-index table_name.ISM
-@end example
-
-After you have installed the packed table into the @strong{MySQL} database
-directory you should do @code{mysqladmin flush-tables} to force @code{mysqld}
-to start using the new table.
-
-@node Maintenance, Adding functions, Tools, Top
-@chapter Maintaining a @strong{MySQL} installation
-
-@menu
-* Table maintenance:: Using @code{myisamchk} for table maintenance and crash recovery
-* Maintenance regimen:: Setting up a table maintenance regimen
-* Table-info:: Getting information about a table
-* Crash recovery:: Using @code{myisamchk} for crash recovery
-* Log files:: Log file maintenance
-@end menu
-
-@node Table maintenance, Maintenance regimen, Maintenance, Maintenance
-@section ¥Æ¡¼¥Ö¥ë¤Î¥á¥ó¥Æ¥Ê¥ó¥¹¡¢¥¯¥é¥Ã¥·¥å¤«¤é¤Î½¤Éü¤Î¤¿¤á¤Î @code{myisamchk} »ÈÍÑ
-
-Starting with @strong{MySQL} 3.23.13, you can check tables MyISAM with the
-@code{CHECK TABLE} command. @xref{CHECK TABLE}. You can repair tables
-with the @code{REPAIR TABLE} command. @xref{REPAIR TABLE}.
-
-MyISAM ¥Æ¡¼¥Ö¥ë (@code{.MYI} and @code{.MYD}) ¤Î¸¡ºº¡¦½¤Éü¤Ë¤Ï @code{myisamchk} ¤ò
-»ÈÍѤ·¤Þ¤¹¡£
-ISAM ¥Æ¡¼¥Ö¥ë (@code{.ISM} and @code{.ISD}) ¤Î¸¡ºº¡¦½¤Éü¤Ë¤Ï @code{isamchk} ¤ò
-»ÈÍѤ·¤Þ¤¹¡£
-@xref{Table types}.
-
-°Ê²¼¤Îʸ¤Ï @code{myisamchk} ¤Ë¤Ä¤¤¤Æ½Ò¤Ù¤Æ¤¤¤Þ¤¹¤¬¡¢@code{isamchk} ¤Ë¤â¤¹¤Ù¤Æ
-Åö¤Æ¤Ï¤Þ¤ê¤Þ¤¹¡£
-
-@code{myisamchk} ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ï¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Æ¡¼¥Ö¥ë¤Î¾ðÊó¤òÆÀ¤¿¤ê¡¢
-¥Á¥§¥Ã¥¯¤·¤¿¤ê¡¢¥Æ¡¼¥Ö¥ë¤Î½¤Éü¤äºÇŬ²½¤Ë»ÈÍѤ·¤Þ¤¹¡£
-°Ê²¼¤Î¥»¥¯¥·¥ç¥ó¤Ç¤Ï¡¢ @code{myisamchk} ¤Îµ¯Æ°ÊýË¡(¥ª¥×¥·¥ç¥ó¤ÎÀâÌÀ¤â´Þ¤à)¡¢
-¥Æ¡¼¥Ö¥ë¤ÎÊݼ饹¥±¥¸¥å¡¼¥ë¤Î¤¿¤ÆÊý¡¢
-@code{myisamchk} ¤Î¿§¡¹¤Êµ¡Ç½¤Î»È¤¤Êý¤ò½Ò¤Ù¤Þ¤¹¡£
-
-¤â¤· @code{mysqld} ¤ò @code{--skip-locking} ¤ÇÁö¤é¤»¤Æ¤¤¤ë¤Ê¤é¡¢
-(¤³¤ì¤Ï Linux ¤Ê¤É¡¢¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¥Ç¥Õ¥©¥ë¥È¤Ç¤¹)¡¢
-@code{mysqld} ¤¬¤¢¤ë¥Æ¡¼¥Ö¥ë¤ò»ÈÍѤ·¤Æ¤¤¤ë¤È¤­¡¢¤¢¤Ê¤¿¤ÏƱ¤¸¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ
- @code{myisamchk} ¤Ç³Î¼Â¤Ë¸¡ºº¤Ç¤­¤Þ¤»¤ó¡£¤â¤· @code{myisamchk} Ãæ¤Ë¡¢
-¤À¤ì¤â @code{mysqld} ¤òÄ̤·¤Æ¤½¤Î¥Æ¡¼¥Ö¥ë¤ò¥¢¥¯¥»¥¹¤·¤Ê¤¤¤Î¤¬³Î¼Â¤Ê¤é¡¢
-¥Æ¡¼¥Ö¥ë¤ò¸¡ºº¤¹¤ëÁ°¤Ë @code{mysqladmin flush-tables} ¤ò¹Ô¤¦¤Ù¤­¤Ç¤¹¡£
-¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¡¢¥Æ¡¼¥Ö¥ë¤Î¸¡ººÃæ¤Ï @code{mysqld} ¤òÍî¤È¤¹¤Ù¤­¤Ç¤¹¡£
-¤â¤· @code{mysqld} ¤¬¥Æ¡¼¥Ö¥ë¤ò¹¹¿·Ãæ¤Ë @code{myisamchk} ¤ò¼Â¹Ô¤·¤¿¾ì¹ç¡¢
-¥Æ¡¼¥Ö¥ë¤¬Êѹ¹¤µ¤ì¤¿»Ý¤Î¥ï¡¼¥Ë¥ó¥°¤¬¤Ç¤ë¤Ç¤·¤ç¤¦¡£
-
-¤â¤· @code{--skip-locking} ¤ò»ÈÍѤ·¤Æ¤¤¤Ê¤¤¤Ê¤é¡¢¤¤¤Ä¤Ç¤â @code{myisamchk} ¤Ï
-»ÈÍѤǤ­¤Þ¤¹¡£¤³¤ì¤ò¼Â¹Ô¤·¤Æ¤¤¤ë´Ö¡¢Á´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤ò¹¹¿·¤¹¤ë¥¯¥é¥¤¥¢¥ó¥È¤Ï
-@code{myisamchk} ¤¬½àÈ÷¤Ç¤­¤ë¤Þ¤ÇÂÔ¤Á¤Þ¤¹¡£
-
-¤â¤· @code{myisamchk} ¤ò¥Æ¡¼¥Ö¥ë¤Î½¤Éü¡¢ºÇŬ²½¤Ë»ÈÍѤ¹¤ë¤Ê¤é¡¢¤½¤ÎºÇÃæ¤Ë¡¢
-@code{mysqld} ¤¬¤½¤Î¥Æ¡¼¥Ö¥ë¤òÀäÂФ˻ÈÍѤ·¤Ê¤¤¤è¤¦¤Ë¤·¤Ê¤±¤ì¤Ð
-¤Ê¤ê¤Þ¤»¤ó¡£¤³¤ì¤Ï @code{--skip-locking} ¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¤Ëµ¯¤³¤ê¤¨¤Þ¤¹¡£
-¤â¤· @code{mysqld} ¤ò¥À¥¦¥ó¤µ¤»¤Æ¤¤¤Ê¤¤¤Ê¤é¡¢ºÇÄã @code{myisamchk} ¼Â¹ÔÁ°¤Ë¡¢
- @code{mysqladmin flush-tables} ¤ò¼Â¹Ô¤¹¤Ù¤­¤Ç¤¹¡£
-
-¥Æ¡¼¥Ö¥ë¤Î½¤Éü¤ÈºÇŬ²½¤Î¤¿¤á¤Ë¡¢¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢ @code{OPTIMIZE TABLES}
-¥³¥Þ¥ó¥É¤¬»ÈÍѤǤ­¤Þ¤¹¡£¤·¤«¤·¤³¤ì¤Ï @code{myisamchk} ¤ËÈæ¤Ù¤Æ¡¢
-ÃÙ¤¯¤Æ³Î¼Â¤Ç¤â¤¢¤ê¤Þ¤»¤ó¡£(fatal errorȯÀ¸»þ¤Î¾ì¹ç)¡£¤³¤ì¤Ï
-¤½¤ÎÈ¿ÌÌ¡¢»ÈÍÑÊýË¡¤¬´Êñ¤Ç¥Æ¡¼¥Ö¥ë¤Î¥Õ¥é¥Ã¥·¥å¤òµ¤¤Ë¤«¤±¤ëɬÍפ¬¤¢¤ê¤Þ¤»¤ó¡£
-@xref{OPTIMIZE TABLE, , @code{OPTIMIZE TABLE}}.
-
-@menu
-* myisamchk syntax:: @code{myisamchk} µ¯Æ°¹½Ê¸
-* myisamchk memory:: @code{myisamchk} ¥á¥â¥ê»ÈÍÑ
-@end menu
-
-@node myisamchk syntax, myisamchk memory, Table maintenance, Table maintenance
-@section @code{myisamchk} µ¯Æ°¹½Ê¸
-
-@code{myisamchk} ¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æµ¯Æ°¤·¤Þ¤¹:
-
-@example
-shell> myisamchk [options] tbl_name
-@end example
-
-@code{options} ¤Ë¡¢¤¢¤Ê¤¿¤¬ @code{myisamchk} ¤Ë¤µ¤»¤¿¤¤¤³¤È¤ò»ØÄꤷ¤Þ¤¹¡£
-¤½¤ÎÀâÌÀ¤Ï¸å½Ò¤·¤Þ¤¹¡£(@code{myisamchk --help} ¤È¼Â¹Ô¤¹¤ì¤Ð¡¢¥ª¥×¥·¥ç¥ó¤Î°ìÍ÷¤¬¼è¤ì¤Þ¤¹)¡£
-¥ª¥×¥·¥ç¥ó¤¬¤Ê¤±¤ì¤Ð¡¢ @code{myisamchk} ¤Ïñ¤Ë¥Æ¡¼¥Ö¥ë¤ò¸¡ºº¤¹¤ë¤À¤±¤Ç¤¹¡£
-¤è¤ê¿¤¯¤Î¾ðÊó¤òÆÀ¤¿¤¤¡¢¤¢¤ë¤¤¤Ï¡¢ @code{myisamchk} ¤Ë¸í¤êÄûÀµ¤Î¹ÔÆ°¤ò¼è¤é¤»¤ë»ö¤Ë¤Ä¤¤¤Æ¤Ï¡¢¸å½Ò¤·¤Þ¤¹¡£
-
-@code{tbl_name} ¤Ï¸¡ºº¤·¤¿¤¤¥Æ¡¼¥Ö¥ë̾¤Ç¤¹¡£
-¤â¤·¤É¤³¤«°ã¤¦¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ·¤Æ @code{myisamchk} ¤òÁö¤é¤»¤¿¤¤¤Ê¤é¡¢
- @code{myisamchk} ¤Ë¤Ï¥Õ¥¡¥¤¥ë¤¬¤É¤³¤Ë¤¢¤ë¤«¤ï¤«¤é¤Ê¤¤¤Î¤Ç¡¢
-¥Õ¥¡¥¤¥ë¤Î¥Ñ¥¹¤ò»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-¼ÂºÝ¡¢ @code{myisamchk} ¤Ï¤¢¤Ê¤¿¤¬»ÈÍѤ·¤Æ¤¤¤ë¥Õ¥¡¥¤¥ë¤¬¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ë¤«¤É¤¦¤«¤Ï¹Íθ¤·¤Þ¤»¤ó¡¨
-¤Û¤«¤Î¾ì½ê¤Ë¥Ç¡¼¥¿¥Ù¡¼¥¹¥Æ¡¼¥Ö¥ë¤Î¥Õ¥¡¥¤¥ë¤ò¥³¥Ô¡¼¤·¡¢¤½¤Î¥³¥Ô¡¼¤·¤¿¥Õ¥¡¥¤¥ë¤ËÂФ·¤Æ
-²óÉüÁàºî¤ò¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@code{myisamchk} ¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë¤Ï¡¢Ê£¿ô¤Î¥Æ¡¼¥Ö¥ë̾¤¬»ØÄê¤Ç¤­¤Þ¤¹¡£
-¤Þ¤¿¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë̾(@file{.MYI} ÀÜÈø¸ì¤Î¤Ä¤¤¤¿¥Õ¥¡¥¤¥ë)¤â»ØÄê¤Ç¤­¡¢
-¤µ¤é¤Ë @file{*.MYI} ¤È¤¹¤ì¤Ð¡¢¥Ç¥£¥ì¥¯¥È¥êÆâ¤ÎÁ´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤¬»ØÄê¤Ç¤­¤Þ¤¹¡£
-Î㤨¤Ð¡¢¸½ºß¤Î¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤¬¥Ç¡¼¥¿¡¼¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤Ê¤é¤Ð¡¢
-¤½¤Î¥Ç¥£¥ì¥¯¥È¥êÆâ¤ÎÁ´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ¸¡ºº¤Ç¤­¤Þ¤¹¡§
-
-@example
-shell> myisamchk *.MYI
-@end example
-
-¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤ËÆþ¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¡¢
-¥Ñ¥¹¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤è¤êÁ´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤¬¸¡ºº¤Ç¤­¤Þ¤¹¡§
-
-@example
-shell> myisamchk /path/to/database_dir/*.MYI
-@end example
-
-@strong{MySQL} ¥Ç¡¼¥¿¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ñ¥¹¤Ë¥ï¥¤¥ë¥É¥«¡¼¥É¤ò»ÈÍѤ¹¤ë¤³¤È¤Ë¤è¤ê¡¢
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÁ´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤â¸¡ºº¤Ç¤­¤Þ¤¹¡§
-
-@example
-shell> myisamchk /path/to/datadir/*/*.MYI
-@end example
-
-@code{myisamchk} ¤Ï°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤ò»ý¤Á¤Þ¤¹:
-
-@table @code
-@item -a, --analyze
-¥­¡¼¤ÎʬÉÛ(ÇÛÃÖ)¤òʬÀϤ·¤Þ¤¹¡£
-¤³¤ì¤Ï @strong{MySQL} ¤Î¤¤¤¯¤Ä¤«¤Î·ë¹ç¤ò®¤¯¤·¤Þ¤¹¡£
-
-@item -#, --debug=debug_options
-¥Ç¥Ð¥Ã¥°¥í¥°¤Î½ÐÎÏ¡£
-@code{debug_options} ¤Ï¤è¤¯ @code{'d:t:o,filename'} ¤È¤µ¤ì¤Þ¤¹¡£
-
-@item -d, --description
-¥Æ¡¼¥Ö¥ë¤Ë´Ø¤¹¤ë¤¤¤¯¤é¤«¤Î¾ðÊó¤òɽ¼¨¤·¤Þ¤¹
-
-@item -e, --extend-check
-¥Æ¡¼¥Ö¥ë¤òÈó¾ï¤ËÅ°ÄìŪ¤Ë¸¡ºº¤·¤Þ¤¹¡£
-¶Ëü¤Ê¾ì¹ç¤Ë¤À¤±¤ÇɬÍפȤµ¤ì¤Þ¤¹¡£
-Ä̾ï @code{myisamchk} ¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ê¤·¤ÇÁ´¤Æ¤Î¥¨¥é¡¼¤ò¸«¤Ä¤±¤ë¤Ï¤º¤Ç¤¹¡£
-
-@item -f, --force
-¸Å¤¤°ì»þŪ¤Ê¥Õ¥¡¥¤¥ë¤ò¾å½ñ¤­¤·¤Þ¤¹¡£
-@code{myisamchk} ¤ò @code{-r} ¤Ê¤·¤ÇÁö¤é¤»¤Æ¥Æ¡¼¥Ö¥ë¤ò¸¡ºº¤·¤Æ¤¤¤ë¤È¤­¤Ë¡¢
-@code{-f} ¤ò»ÈÍѤ¹¤ë¤Ê¤é¤Ð¡¢
-@code{myisamchk} ¤Ï¥Á¥ã¥Ã¥¯¤Ç¥¨¥é¡¼¤¬½Ð¤¿¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ¡¢
-¼«Æ°Åª¤Ë @code{-r} ¤òȼ¤Ã¤Æ¡¢¸¡ºº¤òºÆ³«¤·¤Þ¤¹¡£
-
-@item --help
-¥Ø¥ë¥×¤òɽ¼¨¤·¤Æ½ªÎ»¡£
-
-@item -i, --information
-¸¡ºº¤µ¤ì¤¿¥Æ¡¼¥Ö¥ë¤ÎÅý·×¾ðÊó¤òɽ¼¨¡£
-
-@item -k #, --keys-used=#
-@code{-r} ¤È¶¦¤Ë»ÈÍѤ·¤Þ¤¹¡£
-NISAM ¥Æ¡¼¥Ö¥ë¥Ï¥ó¥É¥é¡¼¤ËºÇ½é¤Î @code{#} ¥¤¥ó¥Ç¥Ã¥¯¥¹¤À¤±¤ò¹¹¿·¤¹¤ë¤è¤¦¤Ë»Ø¼¨¤·¤Þ¤¹¡£
-If you are using MyISAM tells which keys to use, where each
-binary bit stands for one key (First key is bit 0).
-¤³¤ì¤Ï¥¤¥ó¥µ¡¼¥È¤ò®¤¯¤·¤Þ¤¹¡ª
-Èó¥¢¥¯¥Æ¥£¥Ö¤Ë¤Ê¤Ã¤¿¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ï¡¢@code{myisamchk -r} ¤ò»ÈÍѤ¹¤ì¤ÐºÆ¤Ó¥¢¥¯¥Æ¥£¥Ö¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-@item -l, --no-symlinks
-½¤Éü»þ¤Ë¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤òÄɤ¤¤Þ¤»¤ó¡£
-Ä̾@code{myisamchk} ¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬»Ø¤·¼¨¤¹¥Æ¡¼¥Ö¥ë¤â½¤Éü¤·¤Þ¤¹¡£
-
-@item -q, --quick
-@code{-r} ¤È¶¦¤Ë»ÈÍѤµ¤ì¡¢½¤Éü¤òÁ᤯¹Ô¤¤¤Þ¤¹¡£
-Ä̾¥ª¥ê¥¸¥Ê¥ë¤Î¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤Ï¸¡ºº¤µ¤ì¤Þ¤»¤ó¡¨
-Æó²ó @code{-q} ¤ò»ØÄꤹ¤ë¤È¡¢¶¯À©Åª¤Ë¥ª¥ê¥¸¥Ê¥ë¤Î¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤â»ÈÍѤ·¤Þ¤¹¡£
-
-@item -r, --recover
-½¤Éü¥â¡¼¥É¡£
-Can fix almost anything except unique keys that aren't unique
-(which is a extremely unlikely error with ISAM/MyISAM tables).
-If you want to recover a table, this is the option to try first. Only if
-myisamchk reports that the table can't be recovered by @code{-r}, you
-should then try @code{-o}. (Note that in the unlikely case that @code{-r}
-fails, the data file is still intact).
-
-@item -o, --safe-recover
-½¤Éü¥â¡¼¥É¡£
-¸Å¤¤½¤ÉüÊýË¡¤ò»ÈÍѤ·¤Þ¤¹ (reads through all rows in order and updates
-all index trees based on the found rows)¡¨
-¤³¤ì¤Ï @code{-r} ¤è¤ê¤âÃÙ¤¤¤Ç¤¹¤¬¡¢ @code{-r} ¤¬°·¤¨¤Ê¤¤¤â¤Î¤â°·¤¨¤Þ¤¹¡£
-Normally one should always first repair with
-@code{-r} and only if this fails use @code{-o}.
-
-@item -O var=option, --set-variable var=option
-ÊÑ¿ô¤ËÃͤòÆþ¤ì¤Þ¤¹¡£²Äǽ¤ÊÊÑ¿ô¤Ï¸å½Ò¤·¤Þ¤¹¡£
-
-@item -s, --silent
-ÀŽͥ⡼¥É¡£
-¥¨¥é¡¼¤Î¤ß¤ò½ÐÎϤ·¤Þ¤¹¡£
-ÆóÅÙ @code{-s} ¤ò»ØÄꤹ¤ë¤È(@code{-ss})¡¢@code{myisamchk} ¤Ï
-¤Û¤È¤ó¤É½ÐÎϤò¤·¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£
-
-@item -S, --sort-index
-¥¤¥ó¥Ç¥Ã¥¯¥¹¥Ö¥í¥Ã¥¯¤Î¥½¡¼¥È¡£
-¤³¤ì¤Ï¡¢¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤Î ``read-next'' ¤ò®¤¯¤·¤Þ¤¹¡£
-
-@item -R index_num, --sort-records=index_num
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ë½¾¤Ã¤Æ¥½¡¼¥È¡£
-¤³¤ì¤Ï¤¢¤Ê¤¿¤Î¥Ç¡¼¥¿¤ò¤è¤ê¤è¤¯ÇÛÃÖ¤·¡¢¤³¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ø¤Î
- @code{SELECT}, @code{ORDER BY} ¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤ò®¤¯¤·¤Þ¤¹¡£
-(¤³¤ÎÁàºî¤ÎºÇ½é¤Î¥½¡¼¥È¤ÏÈó¾ï¤ËÃÙ¤¯¤Ê¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡ª)
-¥Æ¡¼¥Ö¥ë¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ÎÈÖ¹æ¤ò¤ß¤Ä¤±¤ë¤Ë¤Ï @code{SHOW INDEX} ¤ò»ÈÍѤ·¤Þ¤¹¤¬¡¢
-¤³¤ì¤Ï @code{myisamchk} ¤¬¥Æ¡¼¥Ö¥ë¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò¸«¤Ä¤±¤ë¤Î¤ÈƱ¤¸½ç½ø¤Ç¹Ô¤¤¤Þ¤¹¡£
-¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤Ï 1 ¤«¤é»Ï¤Þ¤ê¤Þ¤¹¡£
-
-@item -u, --unpack
-@code{pack_isam} ¤Ç¥Ñ¥Ã¥¯¤µ¤ì¤¿¥Æ¡¼¥Ö¥ë¤ò¥¢¥ó¥Ñ¥Ã¥¯¤·¤Þ¤¹¡£
-
-@item -U, --update-status
-Store in the @file{.MYI} file when the table was checked and if the table was
-crashed. This should be used to get full benefit of the @code{--fast}
-option, but you shouldn't use this if option if the @code{mysqld} server is
-using the table and you are running @code{mysqld} with
-@code{--skip-locking}.
-
-@item -v, --verbose
-¾éĹ¥â¡¼¥É¡£¤è¤ê¿¤¯¾ðÊó¤ò½ÐÎϤ·¤Þ¤¹¡£
-@code{-d} ¤È @code{-e} ¥ª¥×¥·¥ç¥ó¤È¶¦¤Ë»ÈÍѤǤ­¤Þ¤¹¡£
-@code{-v} ¤òÊ£¿ô»ØÄꤹ¤ë¤È(@code{-vv}, @code{-vvv})¡¢¤â¤Ã¤È½ÐÎϤ¬Â¿¤¯¤Ê¤ê¤Þ¤¹¡ª
-
-@item -V, --version
-@code{myisamchk} ¥Ð¡¼¥¸¥ç¥ó¤òɽ¼¨¤·¤Æ½ªÎ»¡£
-
-@item -w, --wait
-¥Æ¡¼¥Ö¥ë¤¬¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤¿¤éÂÔ¤Á¤Þ¤¹¡£
-@end table
-
-@code{--set-variable} (@code{-O}) ¥ª¥×¥·¥ç¥ó¤Ç²Äǽ¤ÊÊÑ¿ô¡§
-
-@example
-key_buffer_size current value: 16776192
-read_buffer_size current value: 262136
-write_buffer_size current value: 262136
-sort_buffer_size current value: 2097144
-sort_key_blocks current value: 16
-decode_bits current value: 9
-@end example
-
-@code{key_buffer_size} is only used when you check the table with @code{-e} or
-repair it with @code{-o}.
-@code{sort_buffer_size} is used when you repair the table with @code{-r}.
-
-If you want a faster repair, set the above variables to about 1/4 of your
-available memory. You can set both variables to big values as only one
-of the above buffers will be used at at time.
-
-@node myisamchk memory, , myisamchk syntax, Table maintenance
-@section @code{myisamchk} ¥á¥â¥ê»ÈÍÑ
-
-@code{myisamchk} ¤òÁö¤é¤¹¾å¤Ç¥á¥â¥ê¡¼¤ÎÇÛʬ¤Ï½ÅÍפǤ¹¡£
-@code{myisamchk} ¤Ï @code{-O} ¥ª¥×¥·¥ç¥ó¤ÇÄêµÁ¤·¤¿°Ê¾å¤Î¥á¥â¥ê¤Ï»ÈÍѤ·¤Þ¤»¤ó¡£
-¤È¤Æ¤âÂ礭¤Ê¥Õ¥¡¥¤¥ë¤Î¤¿¤¤¤·¤Æ @code{myisamchk} ¤ò¤«¤±¤¿¤¤¤Ê¤é¡¢
-¥á¥â¥ê¡¼¤ò¤É¤ì¤¯¤é¤¤»ÈÍѤ¹¤ë¤«¤òºÇ½é¤Ë·è¤á¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-¥Ç¥Õ¥©¥ë¥È¤Ï¸ÇÄê¤ÇÌó 3M ¤À¤±¤ò»ÈÍѤ·¤Þ¤¹¡£Â礭¤ÊÃͤò»ÈÍѤ¹¤ë¤³¤È¤Ç¡¢
-@code{myisamchk} ¤ò¤è¤ê®¤¯Æ°ºî¤Ç¤­¤Þ¤¹¡£
-Î㤨¤Ð¡¢32MBytes¤ÎRAM¤¬¤¢¤ë¤Ê¤é¡¢°Ê²¼¤Î¤è¤¦¤Ë»ØÄê¤Ç¤­¤Þ¤¹
-(¾¤Î¥ª¥×¥·¥ç¥ó¤â»ØÄꤷ¤Æ):
-
-@example
-shell> myisamchk -O sort=16M -O key=16M -O read=1M -O write=1M ...
-@end example
-
-@code{-O sort=16M} ¤Î»ÈÍѤÏ¿¤¯¤Î¾ì¹ç¤ª¤½¤é¤¯½½Ê¬¤Ç¤·¤ç¤¦¡£
-
-¤·¤«¤·¡¢@code{myisamchk} ¤Ï @code{TMPDIR} Æâ¤Ë°ì»þ¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤Þ¤¹¡£
-@code{TMPDIR} ¤¬¥á¥â¥ê¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò»Ø¤·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢´Êñ¤Ë out of
-memory ¥¨¥é¡¼¤òÆÀ¤ë¤Ç¤·¤ç¤¦¡£
-If this happens, set @code{TMPDIR} to point at some directory
-with more space and restart @code{myisamchk}
-
-
-@node Maintenance regimen, Table-info, Table maintenance, Maintenance
-@section ¥Æ¡¼¥Ö¥ë¤ÎÊݼéÂÎÀ©¤ÎÀßÄê
-
-ÌäÂ꤬ȯÀ¸¤¹¤ë¤Þ¤ÇÂԤĤè¤ê¡¢Äê´üŪ¤Ë¥Æ¡¼¥Ö¥ë¤ò¸¡ºº¤¹¤ëÊý¤¬¤è¤ê¤è¤¤¹Í¤¨¤Ç¤¹¡£
-ÊݼéÌÜŪ¤Ë¤Ï¡¢@code{myisamchk -s} ¤Ç¥Æ¡¼¥Ö¥ë¤ò¸¡ºº¤¹¤ë¤Î¤¬¤è¤¤¤Ç¤·¤ç¤¦¡£
-@code{-s} ¥ª¥×¥·¥ç¥ó¤Ï¥µ¥¤¥ì¥ó¥È¥â¡¼¥É¤Ê¤Î¤Ç¡¢¥¨¥é¡¼¤¬µ¯¤­¤¿¾ì¹ç¤Ë¤À¤±¥á¥Ã¥»¡¼¥¸¤ò½ÐÎϤ·¤Þ¤¹¡£
-
-@tindex .pid (process ID) file
-¥µ¡¼¥Ð¡¼¤ò³«»Ï¤¹¤ë¤È¤­¤Ë¥Æ¡¼¥Ö¥ë¤ò¸¡ºº¤¹¤ë¤Î¤â¤è¤¤¹Í¤¨¤Ç¤¹¡£
-Î㤨¤Ð¡¢¹¹¿·ºÇÃæ¤Ë¥Þ¥·¥ó¤¬¥ê¥Ö¡¼¥È¤µ¤ì¤¿¤Ê¤é¡¢Á´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤Ë´Ø¤·¤Æ
-¤½¤Î±Æ¶Á¤¬¤Ê¤¤¤«¸¡ºº¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¡Ê¤³¤ì¤Ï``expected crashed table''¤Ç¤¹¡Ë
-¥ê¥Ö¡¼¥È¸å¤Ë¤â¤·¸Å¤¤ @file{.pid} ¥Õ¥¡¥¤¥ë(¥×¥í¥»¥¹ID) ¤¬¤¢¤ë¤Ê¤é¤Ð¡¢
-24»þ´Ö°ÊÆâ¤ËÊѹ¹¤µ¤ì¤¿¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ @code{myisamchk} ¤òÁö¤é¤»¤Æ¸¡ºº¤µ¤»¤ë¤è¤¦¤Ë¡¢
-@code{safe_mysqld} ¤Ë¥Æ¥¹¥È¤òÄɲ䷤Ƥ⹽¤¤¤Þ¤»¤ó¡£
-(@file{.pid} ¥Õ¥¡¥¤¥ë¤Ï @code{mysqld} µ¯Æ°»þ¤Ëºî¤é¤ì¡¢Ä̾、λ»þ¤Ë¾Ã¤µ¤ì¤Þ¤¹¡£
-¥¹¥¿¡¼¥È»þ¤Ë @file{.pid} ¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë¤Ê¤é @code{mysqld} ¤¬°Û¾ï½ªÎ»¤·¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£)
-
-Îɤ¤¥Æ¥¹¥È¤Ï¡¢@file{.pid} ¥Õ¥¡¥¤¥ë¤ÎºîÀ®»þ´Ö°Ê¹ß¤ËÊѹ¹¤µ¤ì¤¿
-Á´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤ò¸¡ºº¤¹¤ë¥Æ¥¹¥È¤Ç¤¹¡£
-
-Ä̾ï¤Î¥·¥¹¥Æ¥à±¿ÍÑÃæ¤Ë¤â¥Æ¡¼¥Ö¥ë¤ò¸¡ºº¤¹¤Ù¤­¤Ç¤¹¡£
-TcX ¤Ç¤Ï¡¢½µ¤Ë°ìÅÙ¡¢ @code{cron} ¤ò»ÈÍѤ·¤Æ½ÅÍפʥơ¼¥Ö¥ë¤ò¸¡ºº¤·¤Æ¤¤¤Þ¤¹¡£
-@file{crontab} ¥Õ¥¡¥¤¥ë¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ëµ­½Ò¤·¤Þ¤¹¡§
-
-@example
-35 0 * * 0 /path/to/myisamchk -s /path/to/datadir/*/*.MYI
-@end example
-
-¤³¤ì¤Ï²õ¤ì¤¿¥Æ¡¼¥Ö¥ë¤Î¾ðÊó¤ò½ÐÎϤ·¤Þ¤¹¤Î¤Ç¡¢É¬ÍפȤ¢¤é¤Ð¸¡ºº¡¢½¤Éü¤¬¹Ô¤¨¤ë¤ï¤±¤Ç¤¹¡£
-
-ͽÁÛ³°¤Î»ö¸Î¤Ç²õ¤ì¤¿¥Æ¡¼¥Ö¥ë(¥Ï¡¼¥É¥¦¥§¥¢¤Î¥È¥é¥Ö¥ë¤¬¸¶°ø¤ÇÊø²õ)¤ò½ü¤­¡¢
-2,3ǯ´Ö¡¢¥Æ¡¼¥Ö¥ë¤Ï²õ¤ì¤¿¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó(¤³¤ì¤ÏËÜÅö¤ËËÜÅö¤Ç¤¹)¡£
-¤Î¤Ç¡¢°ì½µ´Ö¤Ë°ìÅ٤ΥÁ¥§¥Ã¥¯¤Ç¤â½½Ê¬¤Ç¤¹¡£
-
-24»þ´Ö°ÊÆâ¤ËÊѹ¹¤µ¤ì¤¿Á´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ¡¢
-@code{myisamchk -s} ¤òËèÈռ¹Ԥ¹¤ë»ö¤ò´«¤á¤Þ¤¹¡£
-¤½¤¦¤¹¤ì¤Ð¡¢¤¢¤Ê¤¿¤Ï²æ¡¹¤ÈƱ¤¸¤°¤é¤¤¤Ë @strong{MySQL} ¤ò
-¿®Íꤹ¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-
-@node Table-info, Crash recovery, Maintenance regimen, Maintenance
-@section ¥Æ¡¼¥Ö¥ë¾ðÊó¼èÆÀ
-
-¥Æ¡¼¥Ö¥ë¤«¤é¾ÜºÙ/Åý·×¤òÆÀ¤ë¤¿¤á¤Ë¤Ï¡¢¼¡¤ÎÊýË¡¤ò»ÈÍѤ·¤Þ¤¹¡£¸å¤Ç¤µ¤é¤Ë¾ÜºÙ¤Ê¾ð
-Êó¤ò¤¤¤¯¤Ä¤«ÀâÌÀ¤·¤Þ¤¹¡£
-
-@table @code
-@item myisamchk -d tbl_name
-@code{myisamchk} ¤ò ``describe mode'' ¤Ç¼Â¹Ô¤·¡¢¥Æ¡¼¥Ö¥ë¤ÎÀâÌÀµ­½Ò¤òºî¤ê¤Þ¤¹¡£
-@code{--skip-locking} ¤ò»ØÄꤷ¤Æ @strong{MySQL} ¥µ¡¼¥Ð¡¼¤òµ¯Æ°¤·¤¿¾ì¹ç¡¢
-@code{myisamchk} ¤Ï myisamchk ¼Â¹ÔÃæ¤Ë¹¹¿·¤µ¤ì¤¿¥Æ¡¼¥Ö¥ë¤Ë¤Ä¤¤¤Æ¥¨¥é¡¼¤òÊó¹ð¤·¤Þ¤¹.
-¤·¤«¤· @code{myisamchk} ¤Ï describe mode ¤Ç¤Ï¥Æ¡¼¥Ö¥ë¤òÊѤ¨¤Ê¤¤¤Î¤Ç¡¢
-¥Ç¡¼¥¿¤òÇ˲õ¤¹¤ë´í¸±À­¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-
-@item myisamchk -d -v tbl_name
-@code{myisamchk} ¤¬¤·¤Æ¤¤¤ë¤³¤È¤Ë´Ø¤¹¤ë¡¢¤è¤ê¿¤¯¤Î¾ðÊó¤òºî¤ê½Ð¤¹¤Ë¤Ï¡¢
-@code{-v} ¤ò¤Ä¤±¤Æ¾éĹ¥â¡¼¥É¤ÇÁö¤é¤»¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
-
-@item myisamchk -eis tbl_name
-¥Æ¡¼¥Ö¥ë¤«¤éºÇ¤â½ÅÍפʾðÊó¤À¤±¤ò¼¨¤·¤Þ¤¹¡£
-¥Æ¡¼¥Ö¥ëÁ´ÂΤòÆɤޤʤ±¤ì¤Ð¤Ê¤é¤Ê¤¤¤Î¤Ç¡¢ÃÙ¤¤¤Ç¤¹¡£
-
-@item myisamchk -eiv tbl_name
-@code{-eis} ¤È»÷¤Æ¤¤¤ë¤¬¡¢²¿¤ò¹Ô¤Ã¤Æ¤¤¤ë¤«¤òɽ¼¨¤·¤Þ¤¹¡£
-@end table
-
-@code{myisamchk -d} ½ÐÎϤÎÎã:
-@example
-ISAM file: company.MYI
-Data records: 1403698 Deleted blocks: 0
-Recordlength: 226
-Record format: Fixed length
-
-table description:
-Key Start Len Index Type
-1 2 8 unique double
-2 15 10 multip. text packed stripped
-3 219 8 multip. double
-4 63 10 multip. text packed stripped
-5 167 2 multip. unsigned short
-6 177 4 multip. unsigned long
-7 155 4 multip. text
-8 138 4 multip. unsigned long
-9 177 4 multip. unsigned long
- 193 1 text
-@end example
-
-
-@code{myisamchk -d -v} ½ÐÎϤÎÎã:
-@example
-ISAM file: company.MYI
-Isam-version: 2
-Creation time: 1996-08-28 11:44:22
-Recover time: 1997-01-12 18:35:29
-Data records: 1403698 Deleted blocks: 0
-Datafile: Parts: 1403698 Deleted data: 0
-Datafilepointer (bytes): 3 Keyfile pointer (bytes): 3
-Max datafile length: 3791650815 Max keyfile length: 4294967294
-Recordlength: 226
-Record format: Fixed length
-
-table description:
-Key Start Len Index Type Root Blocksize Rec/key
-1 2 8 unique double 15845376 1024 1
-2 15 10 multip. text packed stripped 25062400 1024 2
-3 219 8 multip. double 40907776 1024 73
-4 63 10 multip. text packed stripped 48097280 1024 5
-5 167 2 multip. unsigned short 55200768 1024 4840
-6 177 4 multip. unsigned long 65145856 1024 1346
-7 155 4 multip. text 75090944 1024 4995
-8 138 4 multip. unsigned long 85036032 1024 87
-9 177 4 multip. unsigned long 96481280 1024 178
- 193 1 text
-@end example
-
-
-@code{myisamchk -eis} ½ÐÎϤÎÎã:
-@example
-Checking ISAM file: company.MYI
-Key: 1: Keyblocks used: 97% Packed: 0% Max levels: 4
-Key: 2: Keyblocks used: 98% Packed: 50% Max levels: 4
-Key: 3: Keyblocks used: 97% Packed: 0% Max levels: 4
-Key: 4: Keyblocks used: 99% Packed: 60% Max levels: 3
-Key: 5: Keyblocks used: 99% Packed: 0% Max levels: 3
-Key: 6: Keyblocks used: 99% Packed: 0% Max levels: 3
-Key: 7: Keyblocks used: 99% Packed: 0% Max levels: 3
-Key: 8: Keyblocks used: 99% Packed: 0% Max levels: 3
-Key: 9: Keyblocks used: 98% Packed: 0% Max levels: 4
-Total: Keyblocks used: 98% Packed: 17%
-
-Records: 1403698 M.recordlength: 226 Packed: 0%
-Recordspace used: 100% Empty space: 0% Blocks/Record: 1.00
-Recordblocks: 1403698 Deleteblocks: 0
-Recorddata: 317235748 Deleted data: 0
-Lost space: 0 Linkdata: 0
-
-User time 1626.51, System time 232.36
-Maximum resident set size 0, Integral resident set size 0
-Non physical pagefaults 0, Physical pagefaults 627, Swaps 0
-Blocks in 0 out 0, Messages in 0 out 0, Signals 0
-Voluntary context switches 639, Involuntary context switches 28966
-@end example
-
-@code{myisamchk -eiv} ½ÐÎϤÎÎã:
-@example
-Checking ISAM file: company.MYI
-Data records: 1403698 Deleted blocks: 0
-- check file-size
-- check delete-chain
-index 1:
-index 2:
-index 3:
-index 4:
-index 5:
-index 6:
-index 7:
-index 8:
-index 9:
-No recordlinks
-- check index reference
-- check data record references index: 1
-Key: 1: Keyblocks used: 97% Packed: 0% Max levels: 4
-- check data record references index: 2
-Key: 2: Keyblocks used: 98% Packed: 50% Max levels: 4
-- check data record references index: 3
-Key: 3: Keyblocks used: 97% Packed: 0% Max levels: 4
-- check data record references index: 4
-Key: 4: Keyblocks used: 99% Packed: 60% Max levels: 3
-- check data record references index: 5
-Key: 5: Keyblocks used: 99% Packed: 0% Max levels: 3
-- check data record references index: 6
-Key: 6: Keyblocks used: 99% Packed: 0% Max levels: 3
-- check data record references index: 7
-Key: 7: Keyblocks used: 99% Packed: 0% Max levels: 3
-- check data record references index: 8
-Key: 8: Keyblocks used: 99% Packed: 0% Max levels: 3
-- check data record references index: 9
-Key: 9: Keyblocks used: 98% Packed: 0% Max levels: 4
-Total: Keyblocks used: 9% Packed: 17%
-
-- check records and index references
-[LOTS OF ROW NUMBERS DELETED]
-
-Records: 1403698 M.recordlength: 226 Packed: 0%
-Recordspace used: 100% Empty space: 0% Blocks/Record: 1.00
-Recordblocks: 1403698 Deleteblocks: 0
-Recorddata: 317235748 Deleted data: 0
-Lost space: 0 Linkdata: 0
-
-User time 1639.63, System time 251.61
-Maximum resident set size 0, Integral resident set size 0
-Non physical pagefaults 0, Physical pagefaults 10580, Swaps 0
-Blocks in 4 out 0, Messages in 0 out 0, Signals 0
-Voluntary context switches 10604, Involuntary context switches 122798
-@end example
-
-¾å¤Ç»ÈÍѤµ¤ì¤¿¥Æ¡¼¥Ö¥ë¤Î¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¥µ¥¤¥º¤ò¤³¤³¤Ë¼¨¤·¤Þ¤¹:
-
-@example
--rw-rw-r-- 1 monty tcx 317235748 Jan 12 17:30 company.ISD
--rw-rw-r-- 1 davida tcx 96482304 Jan 12 18:35 company.ISM
--rw-rw-r-- 1 monty tcx 317235748 Jan 12 17:30 company.MYD
--rw-rw-r-- 1 davida tcx 96482304 Jan 12 18:35 company.MYI
-@end example
-
-@code{myisamchk} ¤¬À¸À®¤¹¤ë¾ðÊó¤ÎÀâÌÀ¤ò°Ê²¼¤Ë¼¨¤·¤Þ¤¹¡£
-``keyfile'' ¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¤Ç¤¹¡£
-``Record'' ¤È ``row'' ¤ÏƱµÁ¤Ç¤¹¡£
-
-@table @code
-@item ISAM file
-ISAM (index) ¥Õ¥¡¥¤¥ë¤Î̾Á°
-
-@item Isam-version
-ISAM ·Á¼°¤Î¥Ð¡¼¥¸¥ç¥ó¡£¸½ºß¤Ï¾ï¤Ë 2 ¡£
-
-@item Creation time
-¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤¬À¸À®¤µ¤ì¤¿»þ¡£
-
-@item Recover time
-¥¤¥ó¥Ç¥Ã¥¯¥¹/¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤¬ºÇ¸å¤ËºÆ¹½ÃÛ¤µ¤ì¤¿»þ¡£
-
-@item Data records
-¥ì¥³¡¼¥É/¹Ô¤Î¿ô¡£
-
-@item Deleted blocks
-ͽÌ󤵤줿Îΰè¤ò¤Þ¤À»ý¤Ã¤Æ¤¤¤ëºï½ü¥Ö¥í¥Ã¥¯¿ô¡£
-¤³¤Î¥¹¥Ú¡¼¥¹¤òºÇ¾®¤Ë¤¹¤ë¤¿¤á¤Ë¼«Ê¬¤Î¥Æ¡¼¥Ö¥ë¤òºÇŬ²½¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@xref{Optimization}.
-
-@item Datafile: Parts
-ưŪ¤Ê¥ì¥³¡¼¥É·Á¼°¤Ë¤¤¤¯¤Ä¤Î¥Ç¡¼¥¿¥Ö¥í¥Ã¥¯¤¬¤¢¤ë¤«¤òɽ¼¨¤·¤Þ¤¹¡£
-ʬ³ä¤Ê¤·¤ÇºÇŬ²½¤µ¤ì¤¿¥Æ¡¼¥Ö¥ë¤Ç¤Ï @code{Data records} ¤ÈƱ¤¸¤Ç¤¹¡£
-
-@item Deleted data
-²þÁ±¤µ¤ì¤Æ¤¤¤Ê¤¤ºï½ü¥Ç¡¼¥¿¤Î¥Ð¥¤¥È¿ô¡£
-¤³¤Î¥¹¥Ú¡¼¥¹¤òºÇ¾®¤Ë¤¹¤ë¤¿¤á¤Ë¼«Ê¬¤Î¥Æ¡¼¥Ö¥ë¤òºÇŬ²½¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@xref{Optimization}.
-
-@item Datafile pointer
-¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤ÎÂ礭¤µ(¥Ð¥¤¥È¿ô)¡£¤³¤ì¤ÏÉáÄÌ 2, 3, 4 ¤Þ¤¿¤Ï 5 ¥Ð
-¥¤¥È¤Ç¤¹¡£Â¿¤¯¤Î¥Æ¡¼¥Ö¥ë¤Ï 2 ¥Ð¥¤¥È¤Ç´ÉÍý¤µ¤ì¤Þ¤¹¤¬¡¢¤³¤ì¤Ï¤Þ¤À
-@strong{MySQL} ¤«¤éÀ©¸æ¤Ç¤­¤Þ¤»¤ó¡£¸ÇÄê¥Æ¡¼¥Ö¥ë¤Ç¤Ï¤³¤ì¤Ï¥ì¥³¡¼¥É¥¢¥É¥ì
-¥¹¤Ç¤¹¡£Æ°Åª¥Æ¡¼¥Ö¥ë¤Ç¤Ï¤³¤ì¤Ï¥Ð¥¤¥È¥¢¥É¥ì¥¹¤Ç¤¹¡£
-
-@item Keyfile pointer
-¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¥Ý¥¤¥ó¥¿¤Î¥Ð¥¤¥È¿ô¡£¤³¤ì¤ÏÉáÄÌ 1, 2 ¤Þ¤¿¤Ï 3 ¥Ð¥¤¥È¤Ç¤¹¡£
-¿¤¯¤Î¥Æ¡¼¥Ö¥ë¤Ï 2 ¥Ð¥¤¥È¤Ç´ÉÍý¤µ¤ì¤Þ¤¹¤¬¡¢¤³¤ì¤Ï @strong{MySQL} ¤Ç¤Ï¼«Æ°Åª¤Ë
-·×»»¤µ¤ì¤Þ¤¹¡£¤³¤ì¤Ï¾ï¤Ë¥Ö¥í¥Ã¥¯¥¢¥É¥ì¥¹¤Ç¤¹¡£
-
-@item Max datafile length
-¥Æ¡¼¥Ö¥ë¤Î¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë (@code{.MYD} ¥Õ¥¡¥¤¥ë) ¤¬³ÍÆÀ¤Ç¤­¤ëŤµ (¥Ð¥¤¥È¿ô)¡£
-
-@item Max keyfile length
-¥Æ¡¼¥Ö¥ë¤Î¥­¡¼¥Õ¥¡¥¤¥ë (@code{.MYI} ¥Õ¥¡¥¤¥ë) ¤¬³ÍÆÀ¤Ç¤­¤ëŤµ (¥Ð¥¤¥È¿ô)¡£
-
-@item Recordlength
-³Æ¥ì¥³¡¼¥É/¹Ô¤¬»ÈÍѤ¹¤ëÎΰè¤ÎÂ礭¤µ(¥Ð¥¤¥È¿ô)¡£
-
-@item Record format
-³Æ¥Æ¡¼¥Ö¥ë¤Î¹Ô¤¬»ý¤Ä·Á¼°¡£¤³¤ÎÎã¤Ç¤Ï @code{Fixed length} ¤ò»ÈÍѤ·¤Þ¤¹¡£
-¾¤ÎÃͤDzÄǽ¤Êʪ¤Ï@code{°µ½Ì}¡¢@code{¥Ñ¥Ã¥¯}¤·¤Þ¤¹¡£
-
-@item table description
-¥Æ¡¼¥Ö¥ëÆâ¤ÎÁ´¤Æ¤Î¥­¡¼¤Î¥ê¥¹¥È¡£³Æ¥­¡¼¤Ë¤Ä¤¤¤Æ¡¢¤¤¤¯¤Ä¤«¤ÎÄã¥ì¥Ù¥ë¾ðÊó¤¬Ä󶡤µ
-¤ì¤Þ¤¹:
-
-@table @code
-@item Key
-¤³¤Î¥­¡¼Èֹ档
-
-@item Start
-¤³¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹Éô¤¬³«»Ï¤¹¤ë¥ì¥³¡¼¥É/¹ÔÆâ¤Î°ÌÃÖ¡£
-
-@item Len
-¥¤¥ó¥Ç¥Ã¥¯¥¹Éô¤ÎŤµ¡£¥Ñ¥Ã¥¯¤µ¤ì¤¿¿ôÃͤǤϡ¢¤³¤ì¤Ï¾ï¤Ë¹àÌܤδ°Á´¤ÊŤµ¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-ʸ»ú·¿¤Ë¤ª¤¤¤Æ¤Ï¡¢Ê¸»ú·¿¤Î¹àÌܤÎƬ¤ÎÉôʬ¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬¤Ä¤¯»ö¤Ë¤Ê¤ê¤Þ¤¹¤Î¤Ç¡¢
-¥¤¥ó¥Ç¥Ã¥¯¥¹¹àÌܤκÇÂ獵¤è¤ê¤â¤³¤ÎÃͤÏû¤¯¤Ê¤ë¤Ç¤·¤ç¤¦¡£
-
-@item Index
-@code{unique} or @code{multip.} (multiple). ¤³¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹Æâ¤Ç¤Ï1¤Ä¤ÎÃͤ¬Ê£¿ô
-²ó¸ºß¤·ÆÀ¤Þ¤¹¡£
-
-@item Type
-¤³¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹Éô¤¬»ý¤Ä¥Ç¡¼¥¿·¿¡£
-¤³¤ì¤Ï NISAM ¥Ç¡¼¥¿·¿¤Ç¡¢
-@code{packed}, @code{stripped} ¤« @code{empty} ¥ª¥×¥·¥ç¥ó¤ò»ý¤Á¤Þ¤¹¡£
-
-@item Root
-¥ë¡¼¥È¥¤¥ó¥Ç¥Ã¥¯¥¹¥Ö¥í¥Ã¥¯¤Î¥¢¥É¥ì¥¹¡£
-
-@item Blocksize
-³Æ¥¤¥ó¥Ç¥Ã¥¯¥¹¥Ö¥í¥Ã¥¯¤Î¥µ¥¤¥º¡£¤³¤ì¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï 1024 ¤Ç¤¹¤¬¡¢¥³¥ó¥Ñ
-¥¤¥ë»þ¤ËÊѹ¹¤Ç¤­¤Þ¤¹¡£
-
-@item Rec/key
-¤³¤ì¤Ï¥ª¥×¥Æ¥£¥Þ¥¤¥¶¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤ëÅý·×ÃͤǤ¹¡£¤³¤Î¥­¡¼¤ÎÃͤ´¤È¤Î¥ì¥³¡¼
-¥É¿ô¤òÃΤ餻¤Þ¤¹¡£¥æ¥Ë¡¼¥¯¥­¡¼¤Ï¾ï¤Ë1¤ÎÃͤò»ý¤Á¤Þ¤¹¡£¤³¤ì¤Ï¥Æ¡¼¥Ö¥ë¤¬¥í¡¼¥É¤µ
-¤ì¤¿(¤Þ¤¿¤ÏÂ礭¤¯Êѹ¹¤µ¤ì¤¿)¸å¤Ë @code{myisamchk -a} ¤Ç¹¹¿·¤µ¤ì¤Þ¤¹¡£¤³¤ì
-¤¬Á´¤¯¹¹¿·¤µ¤ì¤Ê¤¤¾ì¹ç¤Ï¥Ç¥Õ¥©¥ë¥ÈÃͤΠ30 ¤¬Í¿¤¨¤é¤ì¤Þ¤¹¡£
-@end table
-
-@item
-¾å¤ÎºÇ½é¤ÎÎã¤Ç¤Ï¡¢9ÈÖÌܤΥ­¡¼¤Ï2¤Ä¤ÎÉôʬ¤ò¤â¤Ã¤¿¥Þ¥ë¥Á¥Ñ¡¼¥È¥­¡¼¤Ç¤¹¡£
-
-@item Keyblocks used
-»ÈÍѤµ¤ì¤¿¥­¡¼¥Ö¥í¥Ã¥¯¤Î¥Ñ¡¼¥»¥ó¥Æ¡¼¥¸¡£¤³¤Î¥Æ¡¼¥Ö¥ë¤Ï @code{myisamchk} ¤ÇºÆÇÛÃÖ
-¤µ¤ì¤ë¤¿¤á¡¢ÃͤϤȤƤâ¹â¤¯¤Ê¤ê¤Þ¤¹ (ÍýÏÀŪ¤ÊºÇÂç¤Ë¤È¤Æ¤â¶á¤¯¤Ê¤ê¤Þ¤¹)¡£
-
-@item Packed
-@strong{MySQL} ¤Ï°ìÈ̤ÎÀÜÈø¼­¤Ç¥­¡¼¤Î¥Ñ¥Ã¥¯¤ò»î¤ß¤Þ¤¹¡£¤³¤ì¤Ï
-@code{CHAR}/@code{VARCHAR}/@code{DECIMAL} ¥­¡¼¤Ç¤À¤±»ÈÍѤǤ­¤Þ¤¹¡£Ì¾Á°¤Î
-¤è¤¦¤ÊŤ¤Ê¸»úÎó¤Ç¤Ï¡¢¤³¤ì¤Ï»ÈÍÑÎΰè¤ò¸²Ãø¤Ë¸º¤é¤·¤Þ¤¹¡£¾å¤Î»°ÈÖÌܤÎÎã¤Ç¤Ï4ÈÖÌÜ
-¤Î¥­¡¼¤¬10ʸ»úĹ¤Ç¡¢Îΰè¤Î60%¤Î¸º¾¯¤òÆÀ¤Þ¤¹¡£
-
-@item Max levels
-¤³¤Î¥­¡¼¤Î Btree ¤Î¿¼¤µ¡£Ä¹¤¤¥­¡¼¤ò»ý¤ÄÂ礭¤Ê¥Æ¡¼¥Ö¥ë¤Ï¹â¤¤ÃͤòÆÀ¤Þ¤¹¡£
-
-@item Records
-¥Æ¡¼¥Ö¥ë¤¬»ý¤Ã¤Æ¤¤¤ë¹Ô¿ô¡£
-
-@item M.recordlength
-Ê¿¶Ñ¤Î¹ÔĹ¡£¸ÇÄê¥Æ¡¼¥Ö¥ë¤Ç¤Ï¡¢¤³¤ì¤Ï¥ì¥³¡¼¥ÉŤǤ¹¡£
-
-@item Packed
-@strong{MySQL} ¤Ïʸ»úÎó¤ÎºÇ¸å¤«¤é¶õÇò¤ò½ü¤­¤Þ¤¹¡£¤³¤ì¤Ë¤è¤Ã¤ÆÀáÌ󤵤줿
-¥Ñ¡¼¥»¥ó¥Æ¡¼¥¸¤ò @code{Packed} ¤Ï¼¨¤·¤Þ¤¹¡£
-
-@item Recordspace used
-¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤¬»ÈÍѤµ¤ì¤¿¥Ñ¡¼¥»¥ó¥Æ¡¼¥¸¡£
-
-@item Empty space
-¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤¬»ÈÍѤµ¤ì¤Æ¤¤¤Ê¤¤¥Ñ¡¼¥»¥ó¥Æ¡¼¥¸¡£
-
-@item Blocks/Record
-¥ì¥³¡¼¥ÉËè¤Î¥Ö¥í¥Ã¥¯¿ô (i.e., ÃÇÊÒ²½¥ì¥³¡¼¥É¤Î¹½À®¿ô)¡£
-¤³¤ì¤Ï¸ÇÄê·Á¼°¥Æ¡¼¥Ö¥ë¤Ç¤Ï¾ï¤Ë1¤Ç¤¹¡£¤³¤ÎÃͤϲÄǽ¤Ê¸Â
-¤ê 1.0 ¤Ëα¤Þ¤ê¤Þ¤¹¡£¤³¤ì¤¬Â礭¤¹¤®¤ë¾ì¹ç¤Ï¡¢@code{myisamchk} ¤Ç¥Æ¡¼¥Ö¥ë¤òºÆÇÛÃ֤Ǥ­¤Þ¤¹¡£
-@xref{Optimization}.
-
-@item Recordblocks
-»ÈÍѤµ¤ì¤¿¥Ö¥í¥Ã¥¯ (links) ¿ô¡£¸ÇÄê·¿¼°¤Ç¤Ï¤³¤ì¤Ï¥ì¥³¡¼¥É¿ô¤ÈƱ¤¸¤Ç¤¹¡£
-
-@item Deleteblocks
-ºï½ü¤µ¤ì¤¿¥Ö¥í¥Ã¥¯ (links) ¿ô¡£
-
-@item Recorddata
-¥Ç¡¼¥¿¥Õ¥¡¥¤¥ëÃæ¤Ë¤¢¤ë¼ÂºÝ¤Î¥æ¡¼¥¶¥Ç¡¼¥¿¤Î¥Ð¥¤¥È¿ô¡£
-
-@item Deleted data
-¥Ç¡¼¥¿¥Õ¥¡¥¤¥ëÃæ¤Ë¤¢¤ëºï½ü¤µ¤ì¤¿(unused)¥Ç¡¼¥¿¤Î¥Ð¥¤¥È¿ô¡£
-
-@item Lost space
-¥ì¥³¡¼¥É¤¬¤è¤êû¤¤Ä¹¤µ¤Ë¹¹¿·¤µ¤ì¤¿¾ì¹ç¡¢¤¤¤¯¤Ä¤«¤ÎÎΰ褬¼º¤ï¤ì¤Þ¤¹¡£¤³¤ì
-¤Ï¤½¤Î¤è¤¦¤Ê¾Ã¼º¤ÎÁ´¤Æ¤Î¹ç·×¤Ç¤¹¡£in bytes.
-
-@item Linkdata
-ưŪ·Á¼°¤Î»ÈÍÑ»þ¡¢¥Ö¥í¥Ã¥¯¤Ï¥Ý¥¤¥ó¥¿(4¡Á7¥Ð¥¤¥È)¤Ë¥ê¥ó¥¯¤µ¤ì¤Þ¤¹¡£@code{Linkdata}¤Ï
-¤½¤Î¥Ý¥¤¥ó¥¿¤ÎÁ´¤Æ¤Î¹ç·×¤Ç¤¹¡£
-@end table
-
-¥Æ¡¼¥Ö¥ë¤¬ @code{pack_isam} ¤Ç°µ½Ì¤µ¤ì¤Æ¤¤¤ë¤Ê¤é¡¢@code{myisamchk -d} ¤Ï
-¤½¤ì¤¾¤ì¤Î¥Æ¡¼¥Ö¥ë¥³¥é¥à¤Ë´Ø¤¹¤ëÄɲþðÊó¤ò½ÐÎϤ·¤Þ¤¹¡£
-@ref{myisampack, ,@code{myisampack}}. ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-¤³¤Î¾ðÊóÎã¤ÈÀâÌÀµ­½Ò¤Î°ÕÌ£¤¬¤¢¤ê¤Þ¤¹¡£
-
-@node Crash recovery, Log files, Table-info, Maintenance
-@section Using @code{myisamchk} for crash recovery
-
-@strong{MySQL} ¤¬¥Ç¡¼¥¿³ÊǼ¤Ë»ÈÍѤ¹¤ë¥Õ¥¡¥¤¥ë·Á¼°¤Ï¡¢
-¹­ÈϰϤˤ錄¤Ã¤Æ¥Æ¥¹¥È¤µ¤ì¤Þ¤·¤¿¡£¤¬¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Æ¡¼¥Ö¥ë¤¬
-Ç˲õ¤µ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤³°Åª¾õ¶·¤¬¤¢¤ê¤Þ¤¹:
-
-@itemize @bullet
-@item
-@code{mysqld} ¥×¥í¥»¥¹¤¬½ñ¤­¹þ¤ßºÆÃæ¤Ë killed ¤µ¤ì¤¿¾ì¹ç
-@item
-ͽ´ü¤»¤Ì¥³¥ó¥Ô¥å¡¼¥¿¤ÎÄä»ß(Î㤨¤ÐÅŸ»¤¬ÀÚ¤é¤ì¤¿¾ì¹ç)
-@item
-¥Ï¡¼¥É¥¦¥§¥¢¥¨¥é¡¼
-@end itemize
-
-ËÜÀá¤Ç¤Ï¡¢@strong{MySQL} ¤Î¥Ç¡¼¥¿¤Î°·¤¤Êý¡¢¸¡ºº¤ÎÊýË¡¤ò½Ò¤Ù¤Þ¤¹¡£
-¤â¤·¥Æ¡¼¥Ö¥ë¤¬¤¿¤¯¤µ¤ó¥À¥á¤Ë¤Ê¤ë¤Î¤Ç¤¢¤ì¤Ð¡¢
-¤¢¤Ê¤¿¤Ï¡¢¤³¤ÎÍýͳ¤ò¸«¤Ä¤±¤ë¤è¤¦»î¤ß¤ë¤Ù¤­¤Ç¤¹!
-@xref{Debugging server}.
-
-Ç˲õ¤«¤é¤Î½¤Éü¤ò¤¹¤ë¾ì¹ç¡¢¡É¥Ç¡¼¥¿¥Ù¡¼¥¹Æâ¤Î¤½¤ì¤¾¤ì¤Î¥Æ¡¼¥Ö¥ë @code{tbl_name} ¤Ï¡¢
-¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥êÆâ¤Ë¤¢¤ë»°¤Ä¤Î¥Õ¥¡¥¤¥ë¤Ë°ìÃפ¹¤ë¡É¡¢¤³¤ì¤òÍý²ò¤¹¤ë»ö¤Ï
-¤È¤Æ¤â½ÅÍפǤ¹¡§
-
-@multitable @columnfractions .2 .8
-@item @strong{File} @tab @strong{Purpose}
-@item @file{tbl_name.frm} @tab Table definition (form) file
-@item @file{tbl_name.MYD} @tab Data file
-@item @file{tbl_name.MYI} @tab Index file
-@end multitable
-
-¤³¤ì¤é»°¤Ä¤Î¥Õ¥¡¥¤¥ë¤ÏÍÍ¡¹¤ÊÊýË¡¤ÇÇ˲õ¤ò¼õ¤±¤ë»ö¤¬¤¢¤ê¤Þ¤¹¤¬¡¢
-¤³¤Î¾ì¹çºÇ¤âÌäÂ꤬µ¯¤³¤ê¤ä¤¹¤¤¤Î¤Ï¡¢¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤È¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¤Ç¤¹¡£
-
-@code{myisamchk} ¤Ï @file{.MYD} ¥Õ¥¡¥¤¥ë(¥Ç¡¼¥¿)¤Î¥³¥Ô¡¼¤ò°ì¹Ô°ì¹Ô¤ª¤³¤Ê¤¤¤Þ¤¹¡£
-¤³¤Î½¤Íý²áÄø¤ÎºÇ¸å¤Ë¡¢¸Å¤¤ @file{.MYD} ¥Õ¥¡¥¤¥ë¤ò¾Ã¤·¡¢¿·¤·¤¤¥Õ¥¡¥¤¥ë¤ò¥ª¥ê¥¸¥Ê¥ë¤Î̾Á°¤ËÊѹ¹¤·¤Þ¤¹¡£
-¤â¤· @code{--quick} ¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ·¤¿¤Ê¤é¡¢@code{myisamchk} ¤Ï
- @file{.MYD} ¥Õ¥¡¥¤¥ë¤Î°ì»þ¥Õ¥¡¥¤¥ë¤òºî¤ê¤Þ¤»¤ó¡£¤½¤Î¤«¤ï¤ê¡¢@file{.MYD} ¥Õ¥¡¥¤¥ë
-¤¬Àµ¤·¤¤¤È²¾Äꤷ¤Æ¿·¤·¤¤¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¤À¤±¤òºî¤ê¤Þ¤¹¡£
-¤³¤Î»þ @file{.MYD} ¥Õ¥¡¥¤¥ë¤Ï¤¤¤¸¤ê¤Þ¤»¤ó¡£
-¤³¤Î¾ì¹ç¡¢@code{myisamchk} ¤Ï¼«Æ°¤Ç @file{.MYD} ¥Õ¥¡¥¤¥ë¤Î´Ö°ã¤¤¤ò¸¡½Ð¤·¤Æ
-½¤Éü¤òÃæ»ß¤¹¤ë¤Î¤Ç¡¢°ÂÁ´¤Ç¤¹¡£
-
-@code{myisamchk} ¤ËÆó¤Ä @code{--quick} ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
-¤³¤Î¾ì¹ç¡¢@code{myisamchk} ¤Ï¤¤¤¯¤Ä¤«¤Î¥¨¥é¡¼(¥­¡¼¤Î½ÅÊ£¤È¤«)¤Ç¤ÏÃæ»ß¤Ï¤·¤Þ¤»¤ó¡£
-¤«¤ï¤ê¤Ë @file{.MYD} ¥Õ¥¡¥¤¥ë¤òÊѹ¹¤·¤Þ¤¹¡£
-
-Ä̾ï¤Î½¤Íý¤ò¼Â¹Ô¤¹¤ë¤¿¤á¤Ë¥Ç¥£¥¹¥¯¤Î¥¹¥Ú¡¼¥¹¤Î¶õ¤­¤¬¾¯¤·¤·¤«Ìµ¤¤¾ì¹ç¤Ë¸Â¤Ã¤Æ¡¢
- @code{--quick} ¤ÎÆó²ó»ØÄ꤬Ìò¤ËΩ¤Á¤Þ¤¹¡£
-¤³¤Î¾ì¹ç,¤¢¤Ê¤¿¤Ï @code{myisamchk} ¤òÁö¤é¤»¤ëÁ°¤Ë¥Ð¥Ã¥¯¥¢¥Ã¥×¤ò
-¾¯¤Ê¤¯¤È¤â¤È¤ë¤Ù¤­¤Ç¤¹¡£
-
-@menu
-* Check:: ¥Æ¡¼¥Ö¥ë¤Î¥¨¥é¡¼¥Á¥§¥Ã¥¯ÊýË¡
-* Repair:: ¥Æ¡¼¥Ö¥ë¤Î½¤ÉüÊýË¡
-* Optimization:: ¥Æ¡¼¥Ö¥ë¤ÎºÇŬ²½
-@end menu
-
-@cindex Checking tables for errors
-@node Check, Repair, Crash recovery, Crash recovery
-@subsection ¥Æ¡¼¥Ö¥ë¤Î¥¨¥é¡¼¥Á¥§¥Ã¥¯ÊýË¡
-
-¥Æ¡¼¥Ö¥ë¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤Ë¤Ï,°Ê²¼¤Î¥³¥Þ¥ó¥É¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤:
-
-@table @code
-@item myisamchk tbl_name
-¤³¤ì¤Ï¤¹¤Ù¤Æ¤Î¸í¤ê¤Î99.99%¤ò¸«¤Ä¤±¤Þ¤¹¡£
-¤³¤ì¤¬¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Ê¤¤Êª¤Ï¡¢¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤ÎÇ˲õ@strong{¤À¤±}¤Ç¤¹
-(¤³¤ì¤ÏÈó¾ï¤Ë¤Þ¤ì)¡£¤â¤·¥Æ¡¼¥Ö¥ë¤ò¥Á¥§¥Ã¥¯¤·¤¿¤¤¤Ê¤é¡¢¥ª¥×¥·¥ç¥ó¤Ê¤·¤Ç
- @code{myisamchk} ¤òÁö¤é¤¹¤«¡¢@code{-s} or @code{--silent} ¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤Þ¤¹¡£
-
-@item myisamchk -m tbl_name
-This finds 99.999% of all errors. It checks first all index for errors and
-then it reads through all rows. It calculates a checksum for all keys in
-the rows and verifies that they checksum matches the checksum for the keys
-in the index tree.
-
-@item myisamchk -e tbl_name
-¤³¤ì¤ÏÁ´¤Æ¤Î¥Ç¡¼¥¿¤ò´°àú¤ËÅ°ÄìŪ¤Ë¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£
-(@code{-e} ¤Ï ``extended check'' ¤Î°Õ)¡£
-Á´¤Æ¤Î¥­¡¼¤Ë¤Ä¤¤¤Æ¡¢¤½¤ì¤é¤¬¤µ¤¹¹Ô¤¬Àµ¤·¤¤¤«¤ò³Îǧ¤¹¤ë¤¿¤á¤Ë¡¢
-Æɤ߹þ¤ß¥Á¥§¥Ã¥¯¤ò¹Ô¤¤¤Þ¤¹¡£
-¤³¤ì¤Ï¤¿¤¯¤µ¤ó¤Î¥­¡¼¤¬¤¢¤ëÂ礭¤Ê¥Æ¡¼¥Ö¥ë¤Ç¤Ï¡¢À¨¤¯»þ´Ö¤¬¤«¤«¤ê¤Þ¤¹¡£
-@code{myisamchk} ¤ÏÄ̾ºÇ½é¤Î¥¨¥é¡¼¤¬¸«¤Ä¤«¤Ã¤¿»þÅÀ¤Ç»ß¤Þ¤ê¤Þ¤¹¡£
-¤â¤·¤è¤ê¾ðÊó¤¬ÆÀ¤¿¤¤¤Ê¤é¡¢@code{--verbose} (@code{-v}) ¥ª¥×¥·¥ç¥ó¤ò²Ã¤¨¤Þ¤¹¡£
-¤³¤ì¤Ï @code{myisamchk} ¤ò¥¨¥é¡¼¤¬20¸Ä½Ð¤ë¤Þ¤ÇÆ°ºî¤µ¤»Â³¤±¤Þ¤¹¡£
-ÉáÄ̤˻ÈÍѤ¹¤ë¾ì¹ç¤Ï¡¢@code{myisamchk} ¤À¤±¤Ç½½Ê¬¤Ç¤¹¡£(¥Æ¡¼¥Ö¥ë̾°Ê³°¤Î°ú¿ô¤Ï°ìÀÚ̵¤·)
-
-@item myisamchk -e -i tbl_name
-Á°¤Î¥³¥Þ¥ó¥É¤È»÷¤Æ¤¤¤Þ¤¹¤¬¡¢ @code{-i} ¥ª¥×¥·¥ç¥ó¤Ï @code{myisamchk} ¤Ë¤¤¤¯¤é¤«¤Î
-Åý·×¾ðÊó¤ò½Ð¤µ¤»¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
-@end table
-
-@node Repair, Optimization, Check, Crash recovery
-@subsection ¥Æ¡¼¥Ö¥ë¤Î½¤ÉüÊýË¡
-
-¥Æ¡¼¥Ö¥ëÇ˲õ¤ÎÃû¤·¤È¤·¤Æ¡¢¥¯¥¨¥ê¤¬Í½´ü¤»¤ºÃæÃǤ·¤¿¤ê¡¢°Ê²¼¤Î¤è¤¦¤Ê¥¨¥é¡¼¤¬½Ð¤¿¤ê¤·¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-@file{tbl_name.frm} is locked against change
-@item
-Can't find file @file{tbl_name.MYI} (Errcode: ###)
-@item
-Got error ### from table handler (Error 135 is an exception in this case)
-@item
-Unexpected end of file
-@item
-Record file is crashed
-@end itemize
-
-¤³¤ì¤é¤Î¾ì¹ç¡¢¤¢¤Ê¤¿¤Ï¼«Ê¬¤Î¥Æ¡¼¥Ö¥ë¤ò½¤Íý¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-@code{myisamchk} ¤Ï¤Û¤È¤ó¤É¤ÎÌäÂê¤ò¸«¤Ä¤±½Ð¤·½¤Àµ¤·¤Þ¤¹¡£
-
-½¤Éü²áÄø¤Ï°Ê²¼¤Çµ­½Ò¤¹¤ëºÇÂç4¤Ä¤ÎÃʳ¬¤òƧ¤ß¤Þ¤¹¡£
-¤³¤ì¤ò»Ï¤á¤ëÁ°¤Ë¡¢¤¢¤Ê¤¿¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤Ë @code{cd} ¤·¤Æ
-¥Æ¡¼¥Ö¥ë¥Õ¥¡¥¤¥ë¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ò³Îǧ¤¹¤Ù¤­¤Ç¤¹¡£
-¤³¤ì¤é¥Õ¥¡¥¤¥ë¤Ï @code{mysqld} ¤ò¼Â¹Ô¤·¤Æ¤¤¤ëUnix¥æ¡¼¥¶¡¼¤¬Æɤ߹þ¤ß²Äǽ
-¤Ç¤¢¤ë¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤(¸¡ºº¤Î¤¹¤ë¤Î¤Ë¤¢¤Ê¤¿¤Ë¥Õ¥¡¥¤¥ë¤Î¥¢¥¯¥»¥¹¸¢¤âɬÍ×)¡£
-¤â¤·¥Õ¥¡¥¤¥ë¤ÎÊѹ¹¤ò¤¹¤ëɬÍפ¬¤¢¤ë¤Ê¤é¤Ð¡¢¥Õ¥¡¥¤¥ë¤Ø¤Î½ñ¤­¹þ¤ßµö²Ä¤âɬÍפǤ¹¡£
-
-If you are using @strong{MySQL} 3.23.16 and above you can (and should) use the
-@code{CHECK} and @code{REPAIR} commands to check and repair @code{MyISAM}
-tables. @xref{CHECK TABLE}. @xref{REPAIR TABLE}.
-
-The manual section about table maintenence includes the options to
-@code{isamchk}/@code{myisamchk}. @xref{Table maintenance}.
-
-The following section is for the cases where the above command fails or
-if you want to use the extended features that isamchk/myisamchk provides.
-
-If you are going to repair a table from the command line, you must first
-take down the @code{mysqld} server. Note that when you do
-@code{mysqladmin shutdown} on a remote server, the @code{mysqld} server
-will still be alive for a while after @code{mysqladmin} returns until
-all queries are stopped and all keys have been flushed to disk.
-
-@noindent
-@strong{Stage 1: ¥Æ¡¼¥Ö¥ë¤ò¥Á¥§¥Ã¥¯¤¹¤ë}
-
-@code{myisamchk *.MYI} (»þ´Ö¤¬¤«¤«¤Ã¤Æ¤â¤è¤¤¤Ê¤é @code{myisamchk -e *.MYI})
-¤ò¼Â¹Ô¤·¤Þ¤¹¡£
-@code{-s} (silent) ¥ª¥×¥·¥ç¥ó¤ÏÉÔÍפʾðÊó¤Î½ÐÎϤò¤ª¤µ¤¨¤Þ¤¹¡£
-
-If the mysqld server is done you should use the --update option to tell
-@code{myisamchk} to mark the table as 'checked'.
-
-@code{myisamchk} ¤¬¥¨¥é¡¼¤òÊÖ¤·¤¿¾ì¹ç¤Ë¤À¤±¡¢¥Æ¡¼¥Ö¥ë¤ò½¤Éü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-¤³¤Î¾ì¹ç¡¢Stage 2 ¤Ø¿Ê¤ß¤Þ¤¹¡£
-
-¥Á¥§¥Ã¥¯»þ¤Ë´ñ̯¤Ê¥¨¥é¡¼(@code{out of memory} ¥¨¥é¡¼¤Î¤è¤¦¤Ê) ¤¬µ¯¤­¤¿¾ì¹ç¡¢
-¤¢¤ë¤¤¤Ï @code{myisamchk} ¤¬Íî¤Á¤¿¾ì¹ç¡¢Stage 3 ¤Ë¿Ê¤ó¤Ç¤¯¤À¤µ¤¤¡£
-
-@noindent
-@strong{Stage 2: ´Êñ¤Ç°ÂÁ´¤Ê½¤Éü}
-
-¤Þ¤ººÇ½é¤Ë @code{myisamchk -r -q tbl_name} ¤ò»î¤ß¤Æ¤¯¤À¤µ¤¤
-(@code{-r -q} ¤Ï ``quick recovery mode''¤Î°Õ)¡£
-¤³¤ì¤Ï¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤Ë¿¨¤ì¤Ê¤¤¤Ç¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¤Î½¤Íý¤ò»î¤ß¤Þ¤¹¡£
-¤â¤·¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤¬Á´¤Æ¤È¥Ç¡¼¥¿¥Õ¥¡¥¤¥ëÃæ¤ÎÀµ¤·¤¤¾ì½ê¤Ç¤Îºï½ü¥ê¥ó¥¯¥Ý¥¤¥ó¥È¤ò
-´Þ¤ó¤Ç¤¤¤ë¤Ê¤é¡¢¤³¤ì¤ÏÆ°ºî¤·¤Æ¥Æ¡¼¥Ö¥ë¤ò½¤Éü¤·¤Þ¤¹¡£
-À®¸ù¸å¡¢¼¡¤Î¥Æ¡¼¥Ö¥ë¤Î½¤Éü¤Ë¿Ê¤ó¤Ç¤¯¤À¤µ¤¤¡£
-¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¡¢°Ê²¼¤Î¼ê½ç¤Ç»î¤ß¤Æ¤¯¤À¤µ¤¤¡§
-
-@enumerate
-@item
-³¤±¤ëÁ°¤Ë¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤ò¥Ð¥Ã¥¯¥¢¥Ã¥×¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-@code{myisamchk -r tbl_name} ¤ò»ÈÍѤ·¤Þ¤¹(@code{-r} ¤Ï ``recovery mode''¤Î°Õ)¡£
-¤³¤ì¤ÏÉÔÀµ¤Ê¥ì¥³¡¼¥É¤Èºï½ü¤µ¤ì¤¿¥ì¥³¡¼¥É¤ò¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤«¤é¾Ãµî¤·¡¢
-¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë(.MYI)¤òºÆ¹½ÃÛ¤·¤Þ¤¹¡£
-
-@item
-¾åµ­¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢@code{myisamchk --safe-recover tbl_name} ¤ò»ÈÍѤ·¤Æ²¼¤µ¤¤¡£
-Safe recovery ¥â¡¼¥É¤Ï¸Å¤¤ÊýË¡¤ò»ÈÍѤ·¤Æ½¤Éü¤·¤Þ¤¹¡£
-¤³¤ì¤ÏÉáÄ̤ν¤Éü¥â¡¼¥É¤Ç¤Ï¹Ô¤ï¤Ê¤¤Áàºî¤ò¤¤¤¯¤Ä¤«¤â¤Ã¤Æ¤¤¤Þ¤¹¡£(ÃÙ¤¤¤Ç¤¹¤¬)
-@end enumerate
-
-¥Á¥§¥Ã¥¯¤Þ¤¿¤Ï½¤Éü»þ¤Ë¡¢¥á¥â¥êÉÔ­¤Î¤è¤¦¤Ê̯¤Ê¥¨¥é¡¼¤¬¤Ç¤¿¾ì¹ç¡¢¤Þ¤¿¤Ï
-@code{myisamchk} ¤¬¥¯¥é¥Ã¥·¥å¤·¤¿¾ì¹ç¤Ï¡¢Stage 3 ¤Ë¿Ê¤ó¤Ç¤¯¤À¤µ¤¤¡£
-
-@noindent
-@strong{Stage 3: Æñ¤·¤¤½¤Éü}
-
-¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë(.MYI)¤ÎºÇ½é¤Î 16K ¥Ö¥í¥Ã¥¯¤¬Ç˲õ¤µ¤ì¤¿¾ì¹ç¡¢
-¤Þ¤¿¤ÏÉÔÀµ¤Ê¾ðÊó¤ò´Þ¤à¾ì¹ç¡¢¤Þ¤¿¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¤¬¤Ê¤¤¾ì¹ç¤Ë¤À¤±¡¢
-Ëܽ¤ÉüÃʳ¬¤ò·Ð¤Þ¤¹¡£
-¤³¤Î¾ì¹ç¡¢¿·¤·¤¤¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-¼¡¤Î¤è¤¦¤Ë¤·¤Æ¤¯¤À¤µ¤¤:
-
-@enumerate
-@item
-¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë .MYD ¥Õ¥¡¥¤¥ë¤ò¤É¤³¤«°ÂÁ´¾ì½ê¤Ë°ÜÆ°¤·¤Þ¤¹¡£
-
-@item
-¿·¤·¤¤¶õ¤Î¥Ç¡¼¥¿¤È¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¤òºî¤ë¤¿¤á¤Ë¡¢
-¥Æ¡¼¥Ö¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤Þ¤¹¡§
-
-@example
-shell> mysql db_name
-mysql> DELETE FROM tbl_name;
-mysql> quit
-@end example
-
-@item
-¸Å¤¤¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤ò¿·¤·¤¯ºî¤Ã¤¿¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤Ë¥³¥Ô¡¼¤·¤Þ¤¹¡£
-(¸Å¤¤¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤ò move ¤·¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡¨¤Ê¤ó¤éƬ¤ÎÌäÂ꤬µ¯¤­¤Þ¤¹)
-@end enumerate
-
-Stage 2 ¤ËÌá¤Ã¤Æ¤¯¤À¤µ¤¤¡£ @code{myisamchk -r -q} ¤Ï´û¤ËÆ°ºî¤·¤Þ¤¹¡£
-(¤³¤ì¤Ï̵¸Â¥ë¡¼¥×¤Ë¤Ï¤Ê¤ê¤Þ¤»¤ó).
-
-@noindent
-@strong{Stage 4: ¤È¤Æ¤âÆñ¤·¤¤½¤Éü}
-
-¤³¤ì¤Ï¡¢¥Ç¥£¥¹¥¯¥ê¥×¥¿¥Õ¥¡¥¤¥ë(.frm)¤â¥¯¥é¥Ã¥·¥å¤·¤¿¾ì¹ç¤Ë¤À¤±È¯À¸¤·¤Þ¤¹¡£
-¤³¤ì¤ÏȯÀ¸¤¹¤ë¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¡£¤Ê¤¼¤Ê¤é¥Ç¥£¥¹¥¯¥ê¥×¥¿¥Õ¥¡¥¤¥ë¤Ï
-¥Æ¡¼¥Ö¥ë¤¬À¸À®¤µ¤ì¤¿¸å¤Ë½ñ¤«¤ì¤ë¤³¤È¤Ï¤Ê¤¤¤«¤é¤Ç¤¹¡£
-
-@enumerate
-@item
-¥Ç¥£¥¹¥¯¥ê¥×¥¿¥Õ¥¡¥¤¥ë¤ò¥Ð¥Ã¥¯¥¢¥Ã¥×¤«¤é¥ê¥¹¥È¥¢¤·¤Æ¡¢Stage 3 ¤ËÌá¤Ã¤Æ¤¯¤À¤µ¤¤¡£
-¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¤Î¥ê¥¹¥È¥¢¤â¤Ç¤­¤Þ¤¹¡£¤½¤·¤Æ Stage 2 ¤ËÌá¤Ã¤Æ¤¯¤À¤µ¤¤¡£
-¸å¼Ô¤Î¾ì¹ç¡¢@code{myisamchk -r} ¤Ç³«»Ï¤¹¤Ù¤­¤Ç¤¹¡£
-
-@item
-¥Ð¥Ã¥¯¥¢¥Ã¥×¤ò»ý¤Ã¤Æ¤¤¤Ê¤¯¤Æ¤â¡¢¥Æ¡¼¥Ö¥ë¤¬¤É¤Î¤è¤¦¤ËºîÀ®¤µ¤ì¤¿¤«¤òÀµ³Î¤ËÃΤäÆ
-¤¤¤ì¤Ð¡¢Â¾¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹Æâ¤Ë¥Æ¡¼¥Ö¥ë¤Î¥³¥Ô¡¼¤òÀ¸À®¤·¤Þ¤¹¡£
-¿·¤·¤¤¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤òºï½ü¤·¡¢Àè¤Û¤Éºî¤Ã¤¿¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÃæ¤Î
-¥Ç¥£¥¹¥¯¥ê¥×¥¿¥Õ¥¡¥¤¥ë¤È¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¤ò¡¢²õ¤ì¤¿¥Ç¡¼¥¿¥Ù¡¼¥¹Æâ¤Ë
-°ÜÆ°¤·¤Þ¤¹¡£¤³¤ì¤Ï¿·¤·¤¤¥Ç¥£¥¹¥¯¥ê¥×¥¿¥Õ¥¡¥¤¥ë¤È¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¤ò
-Í¿¤¨¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¤¬¡¢¥Ç¡¼¥¿¥Õ¥¡¥¤¥ë¤Ï¤½¤Î¤Þ¤Þ»Ä¤Ã¤Æ¤¤¤Þ¤¹¡£
-Stage 2 ¤Ë¿Ê¤ß¡¢¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¤Î½¤Éü¤ò¹Ô¤Ã¤Æ¤¯¤À¤µ¤¤¡£
-@end enumerate
-
-@node Optimization, , Repair, Crash recovery
-@subsection ¥Æ¡¼¥Ö¥ë¤ÎºÇŬ²½
-
-ÃÇÊÒ²½¤µ¤ì¤¿¥ì¥³¡¼¥É¤Î·ë¹ç¤È¡¢
-¥ì¥³¡¼¥É¤Îºï½ü¤È¹¹¿·¤«¤éÀ¸¤¸¤ë̵Â̤ʥ¹¥Ú¡¼¥¹¤ÎÇÓ½ü¡¢
-¤³¤ì¤é¹Ô¤¦¤Ë¤Ï¡¢½¤Éü¥â¡¼¥É(recovery mode)¤Ç @code{myisamchk} ¤ò¼Â¹Ô¤·¤Þ¤¹¡§
-
-@example
-shell> myisamchk -r tbl_name
-@end example
-
-SQL @code{OPTIMIZE TABLE} ¤Ç¤âƱÍͤ˥ơ¼¥Ö¥ë¤òºÇŬ²½¤Ç¤­¤Þ¤¹¡£
-@code{OPTIMIZE TABLE} ¤Ï´Êñ¤Ç¤¹¤¬¡¢ @code{myisamchk} ¤ÎÊý¤¬Â®¤¤¤Ç¤¹¡£
-
-
-@code{myisamchk} ¤Ë¤Ï¡¢¤¢¤Ê¤¿¤¬¥Æ¡¼¥Ö¥ë¤ÎÀ­Ç½¤ò¸þ¾å¤µ¤»¤ë¤Î¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤ë
-¾¤Î¿¤¯¤Î¥ª¥×¥·¥ç¥ó¤¬¤¢¤ê¤Þ¤¹:
-
-@table @code
-@item -S, --sort-index
-¥¤¥ó¥Ç¥Ã¥¯¥¹¥Ä¥ê¡¼¥Ö¥í¥Ã¥¯¤Î¥½¡¼¥È¡£¹ß½ç¤Ë¥½¡¼¥È¤·¤Þ¤¹¡£
-¤³¤ì¤Ï¥·¡¼¥¯(seek)¤òºÇŬ²½¤·¡¢¥­¡¼¤ò»ÈÍѤ·¤¿¥Æ¡¼¥Ö¥ë¤ÎÁöºº(scan)¤ò®¤¯¤·¤Þ¤¹¡£
-
-@item -R index_num, --sort-records=index_num
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ë¤è¤ë¥½¡¼¥È¡£¤³¤ì¤Ï¤¢¤Ê¤¿¤Î¥Ç¡¼¥¿¤ò¤è¤êÎɤ¯ÇÛÃÖ¤·¡¢
-¤³¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ·¤¿ @code{SELECT} , @code{ORDER BY} Áàºî¤ò®¤¯¤·¤Þ¤¹¡£
-(ºÇ½é¤Ë¤³¤ì¤ò¼Â¹Ô¤·¤Æ¥½¡¼¥È¤¹¤ë¤È¤­¤Ï»þ´Ö¤¬¤È¤Æ¤â¤«¤«¤ê¤Þ¤¹¡ª)
-¥Æ¡¼¥Ö¥ë¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤ò¸«¤Ä¤±¤ë¤¿¤á¤Ë¡¢ @code{SHOW INDEX} ¤ò»ÈÍѤ·¤Þ¤¹¡£
-¤³¤ì¤Ï @code{myisamchk} ¤¬¹Ô¤¦¤Î¤ÈƱÍͤνç¤Ç¥Æ¡¼¥Ö¥ë¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¤òɽ¼¨¤·¤Þ¤¹¡£
-¥¤¥ó¥Ç¥Ã¥¯¥¹ÈÖ¹æ¤Ï 1 ¤«¤é³«»Ï¤µ¤ì¤Þ¤¹¡£
-
-@item -a, --analyze
-¥Æ¡¼¥Ö¥ëÆâ¤Î¥­¡¼ÇÛÃÖ¤ÎʬÀÏ¡£
-¤³¤Î¥Æ¡¼¥Ö¥ë¤«¤é¥ì¥³¡¼¥É¤ò¼èÆÀ¤¹¤ëºÝ¤Ë¡¢
-·ë¹ç(join)¤Î¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤ò¸þ¾å¤µ¤»¤Þ¤¹¡£
-@end table
-
-For a full description of the option see @ref{myisamchk syntax}.
-
-@node Log files, , Crash recovery, Maintenance
-@section Log file maintenance
-
-@strong{MySQL} ¤ò¥í¥°¥Õ¥¡¥¤¥ë¤È¤È¤â¤Ë»ÈÍѤ¹¤ë¾ì¹ç¡¢
-¤¢¤Ê¤¿¤Ï¡¢»þ¡¹¸Å¤¤¥í¥°¥Õ¥¡¥¤¥ë¤ò ¥ê¥à¡¼¥Ö/¥Ð¥Ã¥¯¥¢¥Ã¥× ¤·¡¢
- @strong{MySQL} ¤Ë¿·¤·¤¤¥Õ¥¡¥¤¥ë¤Ë¥í¥°¤ò¼è¤ë¤è¤¦¤Ë»Ø¼¨¤·¤¿¤¤¤È»×¤¦¤³¤È¤Ç¤·¤ç¤¦¡£
-@xref{Update log}.
-
-@code{Redhat} Linux ¤Ë¤ª¤¤¤Æ¤Ï¡¢@code{mysql-log-rotate} ¥¹¥¯¥ê¥×¥È¤ò
-¤³¤ì¤Ë»ÈÍѤǤ­¤Þ¤¹¡£ ¤â¤· RPM ¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥ó¤Î @strong{MySQL} ¤ò
-¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¤Ê¤é¡¢¤³¤Î¥¹¥¯¥ê¥×¥È¤Ï¼«Æ°¤Ç¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤Æ¤¤¤ë¤Ï¤º¤Ç¤¹¡£
-
-¾¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¼«Ê¬¼«¿È¤Çû¤¤¥¹¥¯¥ê¥×¥È¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¡£
-@code{cron} ¤Ç¥í¥°¥Õ¥¡¥¤¥ë¤ò°·¤¦¤è¤¦¤Ë¤·¤Þ¤¹¡£
-
-@code{mysqladmin flush-logs} ¥³¥Þ¥ó¥É¤« @code{FLUSH LOGS} SQLʸ¤Ç¡¢
-@strong{MySQL} ¤Ë¿·¤·¤¤¥í¥°¥Õ¥¡¥¤¥ë¤ò»ÈÍѤµ¤»¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
-¤â¤·¤¢¤Ê¤¿¤¬ @strong{MySQL} 3.21 ¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Ê¤é¡¢
- @code{mysqladmin refresh} ¤ò»ÈÍѤ·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-
-¾åµ­¤Î¥³¥Þ¥ó¥É¤Ï¡¢°Ê²¼¤Î¤è¤¦¤ËÆ°ºî¤·¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-¤â¤·Ä̾ï¤Î¥í¥° (@code{--log}) ¤¬»ÈÍѤµ¤ì¤Æ¤¤¤ë¤Ê¤é¤Ð¡¢¤³¤Î¥í¥°¥Õ¥¡¥¤¥ë¤ò
-°ìÅÙÊĤ¸¤Æ¤«¤éºÆ¤Ó³«¤­¤Þ¤¹¡£
-(@file{mysql.log} ¤¬¥Ç¥Õ¥©¥ë¥È¤Î¥í¥°¥Õ¥¡¥¤¥ë).
-@item
-¤â¤·¹¹¿·¥í¥° (@code{--log-update}) ¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Ê¤é¡¢
-¹¹¿·¥í¥°¤òÊĤ¸¡¢¿·¤·¤¤¥í¥°¥Õ¥¡¥¤¥ë¤ò³«¤­¤Þ¤¹¡£¤½¤Î¤µ¤¤¡¢
-¥í¥°¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¤¤¤ëÈÖ¹æ¤ÏÁý¤¨¤Þ¤¹¡£
-@end itemize
-
-¤â¤·¹¹¿·¥í¥°¤À¤±¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Ê¤é¡¢¤¢¤Ê¤¿¤Ï¡¢¥í¥°¤ò flush ¤¹¤ë¤À¤±¤Ç¤è¤¯¤Æ¡¢
-¤½¤Î»þ¡¢¥Ð¥Ã¥¯¥¢¥Ã¥×¤Î¤¿¤á¸Å¤¤¹¹¿·¥í¥°¥Õ¥¡¥¤¥ë¤ò°ÜÆ°¤·¤Þ¤¹¡£
- ¤â¤·ÉáÄÌ¤Î¥í¥°¤ò»È¤Ã¤Æ¤¤¤ì¤Ð¡¢¤¢¤Ê¤¿¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹:
-
-@example
-shell> cd mysql-data-directory
-shell> mv mysql.log mysql.old
-shell> mysqladmin flush-tables
-@end example
-
-¤³¤¦¤·¤Æ¤ª¤¤¤Æ¡¢@file{mysql.old} ¤ò¥Ð¥Ã¥¯¥¢¥Ã¥×¤·ºï½ü¤·¤Þ¤¹¡£.
-
-@node Adding functions, Adding procedures, Maintenance, Top
-@chapter @strong{MySQL} ¤Ø¤Î¿·¤·¤¤´Ø¿ô¤ÎÄɲÃ
-
-@strong{MySQL}¤Ë¿·¤·¤¤´Ø¿ô¤òÄɲ乤ë¤Ë¤Ï2¤Ä¤ÎÊýË¡¤¬¤¢¤ê¤Þ¤¹:
-
-@itemize @bullet
-@item ¥æ¡¼¥¶ÄêµÁ´Ø¿ô(UDF:user-definable function)¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ̤·¤Æ´Ø¿ô¤òÄɲäǤ­¤Þ¤¹¡£
-¥æ¡¼¥¶ÄêµÁ´Ø¿ô¤Ï¡¢@code{CREATE FUNCTION} ¤È @code{DROP FUNCTION} ¥¹¥Æ¡¼
-¥È¥á¥ó¥È¤ò»ÈÍѤ·¤Æ¡¢Æ°Åª¤ËÄɲᢺï½ü¤µ¤ì¤Þ¤¹¡£
-@xref{CREATE FUNCTION, , @code{CREATE FUNCTION}}.
-
-@item ¥Í¥¤¥Æ¥£¥Ö(¥Ó¥ë¥È¥¤¥ó) @strong{MySQL} ´Ø¿ô¤È¤·¤Æ´Ø¿ô¤òÄɲäǤ­¤Þ¤¹¡£
-¥Í¥¤¥Æ¥£¥Ö´Ø¿ô¤Ï @code{mysqld} ¥µ¡¼¥Ð¤ËÅý¹ç¤µ¤ì¡¢¹±µ×Ū¤ËÍ­¸ú¤Ë¤Ê¤ê¤Þ¤¹¡£
-@end itemize
-
-¤½¤ì¤¾¤ì¤ÎÊýË¡¤Ë¤Ï¡¢Í­Íø¤ÊÅÀ¤ÈÉÔÍø¤ÊÅÀ¤¬¤¢¤ê¤Þ¤¹:
-
-@itemize @bullet
-@item
-¥æ¡¼¥¶ÄêµÁ´Ø¿ô¤ò½ñ¤¯¾ì¹ç¡¢¥µ¡¼¥Ð¼«¿È¤ËÄɲ乤륪¥Ö¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤ò¥¤¥ó
-¥¹¥È¡¼¥ë¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£´Ø¿ô¤ò¥µ¡¼¥Ð¤ËÅý¹ç¤¹¤ë¾ì¹ç¤¢¤½¤ì¤ò¹Ô¤Ê¤¦É¬Í×
-¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-@item
-UDF ¤ò¥Ð¥¤¥Ê¥ê @strong{MySQL} ÇÛÉÛ¤ËÄɲ乤뤳¤È¤¬¤Ç¤­¤Þ¤¹¡£¥Í¥¤¥Æ¥£¥Ö´Ø
-¿ô¤Ï¥½¡¼¥¹ÇÛÉÛ¤ÎÊѹ¹¤¬É¬ÍפǤ¹¡£
-@item
-@strong{MySQL} ÇÛÉÛ¤ò¥¢¥Ã¥×¥°¥ì¡¼¥É¤¹¤ë¾ì¹ç¡¢Á°¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿ UDF
-¤Î»ÈÍѤò·Ñ³¤Ç¤­¤Þ¤¹¡£¥Í¥¤¥Æ¥£¥Ö´Ø¿ô¤Ç¤Ï¡¢¥¢¥Ã¥×¥°¥ì¡¼¥É¤ÎÅÙ¤ËÊѹ¹¤ò·«¤ê
-ÊÖ¤¹É¬Íפ¬¤¢¤ê¤Þ¤¹¡£
-@end itemize
-
-¿·¤·¤¤´Ø¿ô¤òÄɲ乤뤿¤á¤Ë¤É¤Á¤é¤ÎÊýË¡¤ò»ÈÍѤ·¤Æ¤â¡¢@code{ABS()} ¤ä
-@code{SOUNDEX()} ¤Î¤è¤¦¤Ê¥Í¥¤¥Æ¥£¥Ö´Ø¿ô¤ÈƱ¤¸¤è¤¦¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤­¤Þ
-¤¹¡£
-
-@menu
-* Adding UDF:: ¿·¤·¤¤¥æ¡¼¥¶ÄêµÁ´Ø¿ô¤ÎÄɲÃ
-* Adding native function:: ¿·¤·¤¤¥Í¥¤¥Æ¥£¥Ö´Ø¿ô¤ÎÄɲÃ
-@end menu
-
-@cindex Adding user-definable functions
-@cindex User-definable functions, adding
-@cindex Functions, user-definable, adding
-@node Adding UDF, Adding native function, Adding functions, Adding functions
-@section ¿·¤·¤¤¥æ¡¼¥¶ÄêµÁ´Ø¿ô¤ÎÄɲÃ
-
-@menu
-* UDF calling sequences:: UDF calling sequences
-* UDF arguments:: Argument processing
-* UDF return values:: Return values and error handling
-* UDF compiling:: Compiling and installing user-definable functions
-@end menu
-
-UDF µ¡¹½¤¬Æ°ºî¤¹¤ë¤¿¤á¤Ë¤Ï¡¢´Ø¿ô¤Ï C ¤« C++ ¤Ç½ñ¤«¤ì¤ëɬÍפ¬¤¢¤ê¡¢OS ¤¬
-ưŪ¥í¡¼¥Ç¥£¥ó¥°¤ò¥µ¥Ý¡¼¥È¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£@strong{MySQL} ¥½¡¼¥¹ÇÛÉÛ
-¤Ï @file{sql/udf_example.cc} ¤ò´Þ¤ó¤Ç¤¤¤Æ¡¢¤³¤ì¤Ï£µ¤Ä¤Î¿·¤·¤¤´Ø¿ô¤òÄêµÁ
-¤·¤Æ¤¤¤Þ¤¹¡£UDF ¤Î¸Æ¤Ó½Ð¤·ÊýË¡¤¬¤É¤Î¤è¤¦¤ËƯ¤¯¤«¤Ï¤³¤Î¥Õ¥¡¥¤¥ë¤ò»²¹Í¤Ë¤·
-¤Æ¤¯¤À¤µ¤¤¡£
-
-SQL ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ç»ÈÍѤ·¤¿¤¤¤½¤ì¤¾¤ì¤Î´Ø¿ô¤Ë¤Ä¤¤¤Æ¡¢Âбþ¤¹¤ë C (¤Þ¤¿¤Ï
-C++) ´Ø¿ô¤òÄêµÁ¤¹¤Ù¤­¤Ç¤¹¡£²¼¤ÎÀâÌÀ¤Ç¤Ï¡¢Ì¾Á° ``xxx'' ¤¬¥µ¥ó¥×¥ë´Ø¿ô̾¤È
-¤·¤Æ»ÈÍѤµ¤ì¤Æ¤¤¤Þ¤¹¡£SQL ¤È C/C++ »ÈÍÑË¡¤ò distinquish ¤¹¤ë¤¿¤á¤Ë¡¢
-@code{XXX()} (Âçʸ»ú) ¤Ï SQL ´Ø¿ô¸Æ¤Ó½Ð¤·¤òɽ¤ï¤·¡¢@code{xxx()} (¾®Ê¸»ú)
-¤Ï C/C++ ´Ø¿ô¸Æ¤Ó½Ð¤·¤òɽ¤ï¤·¤Þ¤¹¡£
-
-@code{XXX()} ¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¼ÂÁõ¤¹¤ë¤¿¤á¤Ë½ñ¤¯ C/C++ ´Ø¿ô¤Ï:
-
-@table @asis
-@item @code{xxx()} (ɬÍ×)
-¥á¥¤¥ó´Ø¿ô¡£¤³¤ì¤Ï´Ø¿ô·ë²Ì¤¬·×»»¤µ¤ì¤ë¤È¤³¤í¤Ç¤¹¡£SQL ·¿¤È C/C++ ´Ø¿ô¤Î
-Ìá¤êÃÍ·¿¤ÎÂбþ¤Ï¼¡¤Ë¼¨¤·¤Þ¤¹:
-
-@multitable @columnfractions .2 .8
-@item @strong{SQL ·¿} @tab @strong{C/C++ ·¿}
-@item @code{STRING} @tab @code{char *}
-@item @code{INTEGER} @tab @code{long long}
-@item @code{REAL} @tab @code{double}
-@end multitable
-
-@item @code{xxx_init()} (¥ª¥×¥·¥ç¥ó)
-@code{xxx()} ¤Î½é´ü²½´Ø¿ô¡£¤³¤ì¤Ï¼¡¤Î¤è¤¦¤Ë»ÈÍѤµ¤ì¤Þ¤¹:
-
-@itemize @bullet
-@item
-@code{XXX()} ¤Î°ú¿ô¤Î¿ô¤Î¥Á¥§¥Ã¥¯
-@item
-°ú¿ô¤¬Í׵ᤵ¤ì¤ë·¿¤«¤É¤¦¤«¤Î¥Á¥§¥Ã¥¯¡¢¤Þ¤¿¡¢¥á¥¤¥ó´Ø¿ô¤¬¸Æ¤Ð¤ì¤ë»þ¤Ë˾¤à
-·¿¤Ë°ú¿ô¤ò¶¯À©¤¹¤ë¤è¤¦¤Ë @strong{MySQL} ¤ËÅÁ¤¨¤ë
-@item
-¥á¥¤¥ó´Ø¿ô¤¬É¬ÍפȤ¹¤ë¥á¥â¥ê¤Î³ä¤êÅö¤Æ
-@item
-·ë²Ì¤ÎºÇÂçŤλØÄê
-@item
-(@code{REAL} ´Ø¿ô¤Ç¤Ï) ¾®¿ôÉô¤ÎºÇÂç·å¿ô¤Î»ØÄê
-@item
-·ë²Ì¤¬ @code{NULL} ¤Ë¤Ê¤êÆÀ¤ë¤«¤É¤¦¤«¤Î»ØÄê
-@end itemize
-
-@item @code{xxx_deinit()} (¥ª¥×¥·¥ç¥ó)
-@code{xxx()} ¤Î½ªÎ»´Ø¿ô(deinitialization function)¡£¤³¤ì¤Ï½é´ü²½´Ø¿ô¤Ë¤è¤Ã
-¤Æ³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤ò²òÊü¤¹¤Ù¤­¤Ç¤¹¡£
-@end table
-
-SQL ¥¹¥Æ¡¼¥È¥á¥ó¥È¤¬ @code{XXX()} ¤ò¸Æ¤Ó½Ð¤¹¤È¤­¡¢@strong{MySQL} ¤Ï°ú¿ô
-¥Á¥§¥Ã¥¯¤ä¥á¥â¥ê³ä¤êÅö¤Æ¤Î¤è¤¦¤Ë¡¢É¬Íפʥ»¥Ã¥È¥¢¥Ã¥×¤ò¹Ô¤Ê¤ï¤»¤ë¤¿¤á¤Ë¡¢
-½é´ü²½´Ø¿ô @code{xxx_init()} ¤ò¸Æ¤Ó½Ð¤·¤Þ¤¹¡£@code{xxx_init()} ¤¬¥¨¥é¡¼
-¤òÊÖ¤¹¾ì¹ç¡¢SQL ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ï¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤È¶¦¤Ë°Û¾ï½ªÎ»¤·¡¢¥á¥¤¥ó
-´Ø¿ô¤È½ªÎ»´Ø¿ô¤Ï¸Æ¤Ó½Ð¤µ¤ì¤Þ¤»¤ó¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢¥á¥¤¥ó´Ø¿ô
-@code{xxx()} ¤¬³Æ¹ÔËè¤Ë¸Æ¤Ó½Ð¤µ¤ì¤Þ¤¹¡£Á´¤Æ¤Î¹Ô¤¬½èÍý¤µ¤ì¤¿¸å¡¢½ªÎ»´Ø¿ô
-@code{xxx_deinit()} ¤¬¡¢É¬ÍפÊÁݽü¤ò¹Ô¤Ê¤¦¤¿¤á¤Ë¡¢¸Æ¤Ó½Ð¤µ¤ì¤Þ¤¹¡£
-
-Á´¤Æ¤Î´Ø¿ô¤Ï¥¹¥ì¥Ã¥É°ÂÁ´¤Ç¤Ê¤¯¤Æ¤Ï¤¤¤±¤Þ¤»¤ó(¥á¥¤¥ó´Ø¿ô¤À¤±¤Ç¤Ê¤¯¡¢½é´ü
-²½´Ø¿ô¤È½ªÎ»´Ø¿ô¤âƱÍͤǤ¹)¡£¤³¤ì¤ÏÊѹ¹¤µ¤ì¤¦¤ë¥°¥í¡¼¥Ð¥ëÊÑ¿ô¤äÀÅŪÊÑ¿ô
-¤ò³ä¤êÅö¤Æ¤ë¤³¤È¤Ïµö¤µ¤ì¤Ê¤¤¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡ª ¥á¥â¥ê¤¬É¬Íפʾì¹ç¤Ï¡¢
-@code{xxx_init()} ¤Ç³ä¤êÅö¤Æ¡¢@code{xxx_deinit()} ¤Ç¤½¤ì¤ò²òÊü¤¹¤Ù¤­¤Ç¤¹¡£
-
-@node UDF calling sequences, UDF arguments, Adding UDF, Adding UDF
-@subsection UDF ¸Æ¤Ó½Ð¤·¥·¡¼¥±¥ó¥¹
-
-¥á¥¤¥ó´Ø¿ô¤Ï²¼¤Ë¼¨¤¹¤è¤¦¤ËÀë¸À¤µ¤ì¤ë¤Ù¤­¤Ç¤¹¡£Ìá¤êÃÍ·¿¤È°ú¿ô¤Ï¡¢
-@code{CREATE FUNCTION} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ç¡¢SQL ´Ø¿ô @code{XXX()} ¤ÎÌá¤êÃÍ
-¤ò@code{STRING}, @code{INTEGER}, @code{REAL} ¤Î¤É¤ì¤ËÀë¸À¤¹¤ë¤«¤Ë°Í¸¤·
-¤Æ°Û¤Ê¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤:
-
-@noindent
-@code{STRING} ´Ø¿ô¤Ç¤Ï:
-
-@example
-char *xxx(UDF_INIT *initid, UDF_ARGS *args,
- char *result, unsigned long *length,
- char *is_null, char *error);
-@end example
-
-@noindent
-@code{INTEGER} ´Ø¿ô¤Ç¤Ï:
-
-@example
-long long xxx(UDF_INIT *initid, UDF_ARGS *args,
- char *is_null, char *error);
-@end example
-
-@noindent
-@code{REAL} ´Ø¿ô¤Ç¤Ï:
-
-@example
-double xxx(UDF_INIT *initid, UDF_ARGS *args,
- char *is_null, char *error);
-@end example
-
-½é´ü²½¤È½ªÎ»´Ø¿ô¤Ï¼¡¤Î¤è¤¦¤ËÀë¸À¤·¤Þ¤¹:
-
-@example
-my_bool xxx_init(UDF_INIT *initid, UDF_ARGS *args, char *message);
-
-void xxx_deinit(UDF_INIT *initid);
-@end example
-
-@code{initid} °ú¿ô¤Ï£³¤Ä¤Î´Ø¿ôÁ´¤Æ¤ËÅϤµ¤ì¤Þ¤¹¡£¤³¤ì¤Ï @code{UDF_INIT}
-¹½Â¤ÂΤò¼¨¤·¡¢´Ø¿ô´Ö¤Ç¾ðÊó¤òÅÁ㤹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£@code{UDF_INIT}
-¹½Â¤ÂΤΥá¥ó¥Ð¤Ï²¼¤Ë°ìÍ÷¤·¤Þ¤¹¡£½é´ü²½´Ø¿ô¤ÏÊѹ¹¤·¤¿¤¤Á´¤Æ¤Î¥á¥ó¥Ð¤òËä¤á
-¤ë¤Ù¤­¤Ç¤¹¡£(¥á¥ó¥Ð¤Ë¥Ç¥Õ¥©¥ë¥È¤ò»ÈÍѤ¹¤ë¤Ë¤Ï¡¢Ì¤Êѹ¹¤Î¤Þ¤Þ¤Ë¤·¤Æ¤¯¤À¤µ
-¤¤¡£)
-
-@table @code
-@item my_bool maybe_null
-@code{xxx()} ¤¬ @code{NULL} ¤òÊÖ¤¹¾ì¹ç¡¢@code{xxx_init()} ¤Ï
-@code{maybe_null} ¤ò @code{1} ¤ËÀßÄꤹ¤Ù¤­¤Ç¤¹¡£¥Ç¥Õ¥©¥ë¥ÈÃͤϡ¢°ú¿ô¤Î¤¤
-¤º¤ì¤«¤¬ @code{maybe_null} ¤È¤·¤ÆÀë¸À¤µ¤ì¤¿¾ì¹ç¡¢@code{1} ¤Ç¤¹¡£
-
-@item unsigned int decimals
-¾®¿ôÉô¤Î·å¿ô¡£¥Ç¥Õ¥©¥ë¥ÈÃͤϥᥤ¥ó´Ø¿ô¤ËÅϤµ¤ì¤ë°ú¿ô¤Î¾®¿ôÉô¤ÎºÇÂç·å¿ô¤Ç
-¤¹¡£(Î㤨¤Ð¡¢´Ø¿ô¤Ë @code{1.34}, @code{1.345}, @code{1.3} ¤¬ÅϤµ¤ì¤¿¾ì¹ç¡¢
-¥Ç¥Õ¥©¥ë¥È¤Ï 3 ¤Ç¤¹¡£@code{1.345} ¤¬ 3 ·å¤Î¾®¿ôÉô¤ò»ý¤Ä¤¿¤á¤Ç¤¹¡£)
-
-@item unsigned int max_length
-ʸ»úÎó·ë²Ì¤ÎºÇÂçĹ¡£¥Ç¥Õ¥©¥ë¥ÈÃͤϴؿô¤ÎÌá¤êÃÍ·¿¤Ë°Í¸¤·¤Æ°Û¤Ê¤ê¤Þ¤¹¡£Ê¸
-»úÎó´Ø¿ô¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤ÏºÇ¤âŤ¤°ú¿ô¤ÎŤµ¤Ç¤¹¡£À°¿ô´Ø¿ô¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë
-¥È¤Ï 21 ·å¤Ç¤¹¡£¼Â¿ô´Ø¿ô¤Ç¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Ï 13 ¤Ë @code{initid->decimals}
-¤Ç¼¨¤µ¤ì¤ë¾®¿ôÉô¤Î·å¿ô¤ò²Ã¤¨¤¿¤â¤Î¤Ç¤¹¡£(¿ôÃÍ´Ø¿ô¤Ç¤Ï¡¢Ä¹¤µ¤ÏÉä¹æ¤È¾®¿ô
-ÅÀʸ»ú¤ò´Þ¤ß¤Þ¤¹¡£)
-
-@item char *ptr
-¤½¤ì¼«¿È¤ÎÌÜŪ¤Î¤¿¤á¤Ë´Ø¿ô¤¬»ÈÍѤǤ­¤ë¥Ý¥¤¥ó¥¿¤Ç¤¹¡£Î㤨¤Ð¡¢´Ø¿ô¤Ï³ä¤êÅö
-¤Æ¤¿¥á¥â¥ê¤ò´Ø¿ô´Ö¤ÇÅÁ㤹¤ë¤¿¤á¤Ë¡¢@code{initid->ptr} ¤ò»ÈÍѤǤ­¤Þ¤¹¡£
-@code{xxx_init()} ¤Ç¤Ï¡¢¥á¥â¥ê¤ò³ÍÆÀ¤·¡¢¤³¤Î¥Ý¥¤¥ó¥¿¤Ë³ä¤êÅö¤Æ¤Þ¤¹:
-
-@example
-initid->ptr = allocated_memory;
-@end example
-
-@code{xxx()} ¤È @code{xxx_deinit()} ¤Ç¤Ï¡¢@code{initid->ptr} ¤ò»²¾È¤·¤Æ¡¢
-¥á¥â¥ê¤ò»ÈÍѤޤ¿¤Ï²òÊü¤·¤Þ¤¹¡£
-@end table
-
-@node UDF arguments, UDF return values, UDF calling sequences, Adding UDF
-@subsection °ú¿ô½èÍý
-
-@code{args} °ú¿ô¤Ï¼¡¤Ë¼¨¤¹¥á¥ó¥Ð¤ò»ý¤Ä @code{UDF_ARGS} ¹½Â¤ÂΤؤΥݥ¤¥ó
-¥¿¤Ç¤¹:
-
-@table @code
-@item unsigned int arg_count
-°ú¿ô¤Î¿ô¡£´Ø¿ô¤¬ÆÃÄê¤Î°ú¿ô¤Î¿ô¤Ç¸Æ¤Ó½Ð¤µ¤ì¤ë¤³¤È¤ò´üÂÔ¤¹¤ë¾ì¹ç¤Ï¡¢½é´ü²½
-´Ø¿ô¤Ç¤³¤ÎÃͤò¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£Î㤨¤Ð:
-
-@example
-if (args->arg_count != 2)
-@{
- strcpy(message,"XXX() requires two arguments");
- return 1;
-@}
-@end example
-
-
-@item enum Item_result *arg_type
-°ú¿ô¤Î·¿¡£²Äǽ¤Ê·¿¤ÎÃÍ¤Ï @code{STRING_RESULT}, @code{INT_RESULT},
-@code{REAL_RESULT} ¤Ç¤¹¡£
-
-°ú¿ô¤¬Í¿¤¨¤é¤ì¤¿·¿¤Ç¤¢¤ë¤³¤È¤È¡¢¤½¤¦¤Ç¤Ê¤¤¾ì¹ç¥¨¥é¡¼¤òÊÖ¤¹¤³¤È¤ò³Î¼Â¤Ë¤¹
-¤ë¤¿¤á¤Ë¡¢½é´ü²½´Ø¿ô¤Ç @code{arg_type} ÇÛÎó¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£Î㤨
-¤Ð:
-
-@example
-if (args->arg_type[0] != STRING_RESULT
- && args->arg_type[1] != INT_RESULT)
-@{
- strcpy(message,"XXX() requires a string and an integer");
- return 1;
-@}
-@end example
-
-´Ø¿ô¤Î°ú¿ô¤¬ÆÃÄê¤Î·¿¤òÍ׵᤹¤ë¤¿¤á¤ÎÂå°Æ¤È¤·¤Æ¡¢½é´ü²½´Ø¿ô¤ò»ÈÍѤ·¤Æ¡¢
-@code{arg_type} Í×ÁǤòµá¤á¤ë·¿¤ËÀßÄê¤Ç¤­¤Þ¤¹¡£¤³¤ì¤Ï @strong{MySQL} ¤Ë
-@code{xxx()} ¤Î³Æ¸Æ¤Ó½Ð¤·¤Ë¤³¤ì¤é¤Î·¿¤ò°ú¿ô¤Ë¶¯À©¤¹¤ë¤è¤¦¤Ë¤µ¤»¤Þ¤¹¡£Îã
-¤¨¤Ð¡¢ºÇ½é¤Î£²¤Ä¤Î°ú¿ô¤Ëʸ»úÎó¤ÈÀ°¿ô¤ò¶¯À©¤¹¤ë¤è¤¦¤Ë»ØÄꤹ¤ë¤Ë¤Ï¡¢
-@code{xxx_init()} ¤Ç¼¡¤ò¹Ô¤Ê¤Ã¤Æ¤¯¤À¤µ¤¤:
-
-@example
-args->arg_type[0] = STRING_RESULT;
-args->arg_type[1] = INT_RESULT;
-@end example
-
-@item char **args
-@code{args->args} ¤Ï¡¢´Ø¿ô¤¬¸Æ¤Ð¤ì¤ë»þ¤Î°ú¿ô¤Î°ìÈÌŪ¤ÊÆÃÀ­¤Ë¤Ä¤¤¤Æ¡¢¾ðÊó
-¤ò½é´ü²½´Ø¿ô¤ËÅÁ㤷¤Þ¤¹¡£Äê¿ô°ú¿ô @code{i} ¤Ë¤Ä¤¤¤Æ¡¢
-@code{args->args[i]} ¤Ï°ú¿ôÃͤΤò¥Ý¥¤¥ó¥È¤·¤Þ¤¹¡£(ÃͤؤÎÀµ¤·¤¤¥¢¥¯¥»¥¹Êý
-Ë¡¤Ë¤Ä¤¤¤Æ¤Ï¸å½Ò¡£)ÈóÄê¿ô°ú¿ô¤Ë¤Ä¤¤¤Æ¡¢@code{args->args[i]} ¤Ï @code{0}
-¤Ç¤¹¡£Äê¿ô°ú¿ô¤ÏÄê¿ô¤À¤±¤ò»ÈÍѤ¹¤ëɽ¸½¤Ç¡¢@code{3}, @code{4*7-2},
-@code{SIN(3.14)} ¤Ê¤É¤Ç¤¹¡£ÈóÄê¿ô°ú¿ô¤Ï¹Ô¤«¤é¹Ô¤ËÊѹ¹¤µ¤ì¤ëÃͤò»²¾È¤¹¤ë
-ɽ¸½¤Ç¡¢¹àÌÜ̾¤äÈóÄê¿ô°ú¿ô¤Ç¸Æ¤Ó½Ð¤µ¤ì¤ë´Ø¿ô¤Ê¤É¤Ç¤¹¡£
-
-¥á¥¤¥ó´Ø¿ô¤Î¤½¤ì¤¾¤ì¤Î¸Æ¤Ó½Ð¤·¤Ë¤Ä¤¤¤Æ¡¢@code{args->args} ¤Ï¸½ºß½èÍý¤µ¤ì
-¤Æ¤¤¤ë¹Ô¤ËÅϤµ¤ì¤ë¼ÂºÝ¤Î°ú¿ô¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£
-
-´Ø¿ô¤Ï¼¡¤Î¤è¤¦¤Ë°ú¿ô @code{i} ¤ò»²¾È¤Ç¤­¤Þ¤¹:
-
-@itemize @bullet
-@item
-@code{STRING_RESULT} ·¿¤Î°ú¿ô¤Ï¡¢¥Ð¥¤¥Ê¥ê¥Ç¡¼¥¿¤Þ¤¿¤ÏǤ°Õ¤ÎŤµ¤Î¥Ç¡¼¥¿
-¤Î½èÍý¤òµö¤¹¤¿¤á¡¢Ê¸»úÎó¥Ý¥¤¥ó¥¿¡ÜŤµ¤È¤·¤ÆÍ¿¤¨¤é¤ì¤Þ¤¹¡£Ê¸»úÎóÆâÍƤÏ
-@code{args->args[i]} ¤È¤·¤ÆÍ­¸ú¤Ç¡¢Ê¸»úÎóĹ¤Ï @code{args->lengths[i]} ¤Ç
-¤¹¡£Ê¸»úÎó¤Ï NULL ½ªÃ¼¤È¤ß¤Ê¤¹¤Ù¤­¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-
-@item
-@code{INT_RESULT} ·¿¤Î°ú¿ô¤Ë¤Ä¤¤¤Æ¡¢@code{args->args[i]} ¤ò
-@code{long long} Ãͤ˥­¥ã¥¹¥È¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹:
-
-@example
-long long int_val;
-int_val = *((long long*) args->args[i]);
-@end example
-
-@item
-@code{REAL_RESULT} ·¿¤Î°ú¿ô¤Ë¤Ä¤¤¤Æ¡¢@code{args->args[i]} ¤ò
-@code{double} Ãͤ˥­¥ã¥¹¥È¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹:
-
-@example
-double real_val;
-real_val = *((double*) args->args[i]);
-@end example
-@end itemize
-
-@item unsigned long *lengths
-½é´ü²½´Ø¿ô¤Ç¤Ï¡¢@code{lengths} ÇÛÎó¤Ï³Æ°ú¿ô¤Ë¤Ä¤¤¤Æ¤ÎºÇÂçʸ»úÎóŤò¼¨¤·
-¤Þ¤¹¡£¥á¥¤¥ó´Ø¿ô¤Î³Æ¸Æ¤Ó½Ð¤·¤Ë¤Ä¤¤¤Æ¤Ï¡¢@code{lengths} ¤Ï¡¢¸½ºß½èÍý¤µ¤ì
-¤Æ¤¤¤ë¹Ô¤ËÅϤµ¤ì¤ëǤ°Õ¤Îʸ»úÎó°ú¿ô¤Î¼ÂºÝ¤ÎŤµ¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£
-@code{INT_RESULT}, @code{REAL_RESULT} ·¿¤Î°ú¿ô¤Ë¤Ä¤¤¤Æ¤Ï¡¢@code{lengths}
-¤Ï¤Þ¤À°ú¿ô¤ÎºÇÂçŤò´Þ¤ó¤Ç¤¤¤Þ¤¹(½é´ü²½´Ø¿ô¤Ë¤Ä¤¤¤Æ¤Ï)¡£
-@end table
-
-@node UDF return values, UDF compiling, UDF arguments, Adding UDF
-@subsection Ìá¤êÃͤȥ¨¥é¡¼½èÍý
-
-½é´ü²½´Ø¿ô¤Ï¡¢¥¨¥é¡¼¤¬Ìµ¤¤¾ì¹ç¤Ï @code{0} ¤ò¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð @code{1} ¤ò
-ÊÖ¤¹¤Ù¤­¤Ç¤¹¡£¥¨¥é¡¼¤¬È¯À¸¤¹¤ë¾ì¹ç¤Ï¡¢@code{xxx_init()} ¤Ï NULL ½ªÃ¼¥¨¥é¡¼
-¥á¥Ã¥»¡¼¥¸¤ò @code{message} ¥Ñ¥é¥á¡¼¥¿¤Ë³ÊǼ¤¹¤Ù¤­¤Ç¤¹¡£¤³¤Î¥á¥Ã¥»¡¼¥¸¤Ï
-¥¯¥é¥¤¥¢¥ó¥È¤ËÊÖ¤µ¤ì¤Þ¤¹¡£¥á¥Ã¥»¡¼¥¸¥Ð¥Ã¥Õ¥¡¤Ï @code{MYSQL_ERRMSG_SIZE}
-ʸ»úŤǤ¹¤¬¡¢80 ʸ»ú¤è¤ê¾®¤µ¤¯ÊݤĤ褦¤Ë»î¤ß¤ë¤Ù¤­¤Ç¤¹¡£É¸½àŪ¤ÊüËö²è
-Ì̤ÎÉý¤Ë¥Õ¥£¥Ã¥È¤¹¤ë¤è¤¦¤Ë¤Ç¤¹¡£
-
-¥á¥¤¥ó´Ø¿ô @code{xxx()} ¤ÎÊÖ¤¹ÃÍ¤Ï @code{long long} ¤È @code{double} ´Ø
-¿ô¤Ë¤Ä¤¤¤Æ¤Ï´Ø¿ôÃͤǤ¹¡£Ê¸»úÎó´Ø¿ô¤Ë¤Ä¤¤¤Æ¤Ï¡¢@code{result} ¤È
-@code{length} °ú¿ô¤Çʸ»úÎó¤¬ÊÖ¤µ¤ì¤Þ¤¹¡£@code{result} ¤Ï¾¯¤Ê¤¯¤È¤â 255
-¥Ð¥¤¥ÈĹ¤Î¥Ð¥Ã¥Õ¥¡¤Ç¤¹¡£¤³¤ì¤é¤ËÆâÍƤÈÌá¤êÃͤÎŤµ¤òÀßÄꤷ¤Æ¤¯¤À¤µ¤¤¡£Îã
-¤¨¤Ð:
-
-@example
-memcpy(result, "result string", 13);
-*length = 13;
-@end example
-
-ʸ»úÎó´Ø¿ô¤ÏÄ̾ï¤Ï·ë²Ì¤ò¥Ý¥¤¥ó¥È¤¹¤ëÃͤòÊÖ¤·¤Þ¤¹¡£
-
-¥á¥¤¥ó´Ø¿ô¤Ç @code{NULL} ÃͤÎÌá¤êÃͤò¼¨¤¹¤Ë¤Ï¡¢@code{is_null} ¤ò
-@code{1} ¤ËÀßÄꤷ¤Æ¤¯¤À¤µ¤¤:
-
-@example
-*is_null = 1;
-@end example
-
-¥á¥¤¥ó´Ø¿ô¤Ç¥¨¥é¡¼¤ÎÌá¤êÃͤò¼¨¤¹¤Ë¤Ï¡¢@code{error} ¥Ñ¥é¥á¡¼¥¿¤ò @code{1}
-¤ËÀßÄꤷ¤Þ¤¹:
-
-@example
-*error = 1;
-@end example
-
-@code{xxx()} ¤¬Ç¤°Õ¤Î¹Ô¤Ë¤Ä¤¤¤Æ @code{*error} ¤Ë @code{1} ¤òÀßÄꤹ¤ë¾ì¹ç¡¢
-´Ø¿ôÃͤϸ½ºß¤Î¹Ô¤Ë¤Ä¤¤¤Æ¤È¡¢¤½¤Î¸å¤Î @code{XXX()} ¤¬¸Æ¤Ó½Ð¤µ¤ì¤ë¥¹¥Æ¡¼¥È
-¥á¥ó¥È¤Ë¤è¤Ã¤Æ½èÍý¤µ¤ì¤ëǤ°Õ¤Î¹Ô¤Ë¤Ä¤¤¤Æ @code{NULL} ¤Ç¤¹¡£(@code{xxx()}
-¤Ï³¤¯¹Ô¤Ë¤Ä¤¤¤Æ¤Ï¸Æ¤Ó½Ð¤·¤µ¤¨¤µ¤ì¤Þ¤»¤ó¡£) @strong{Ãí°Õ:} 3.22.10 ¤è¤ê
-Á°¤Î @strong{MySQL} ¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢@code{*error} ¤È @code{*is_null} ¤Î
-ξÊý¤ËÀßÄꤹ¤Ù¤­¤Ç¤¹:
-
-@example
-*error = 1;
-*is_null = 1;
-@end example
-
-@node UDF compiling, , UDF return values, Adding UDF
-@subsection ¥æ¡¼¥¶ÄêµÁ´Ø¿ô¤Î¥³¥ó¥Ñ¥¤¥ë¤È¥¤¥ó¥¹¥È¡¼¥ë
-
-UDF ¤ò¼ÂÁõ¤¹¤ë¥Õ¥¡¥¤¥ë¤Ï¥µ¡¼¥Ð¤¬Æ°ºî¤¹¤ë¥Û¥¹¥È¾å¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¥¤¥ó¥¹¥È¡¼
-¥ë¤µ¤ì¤Ê¤¤¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£¤³¤Î½èÍý¤Ï¥µ¥ó¥×¥ë UDF ¥Õ¥¡¥¤¥ë
-@file{udf_example.cc} ¤Ë¤Ä¤¤¤Æ¼¡¤ËÀâÌÀ¤·¤Þ¤¹¡£¤³¤ì¤Ï @strong{MySQL} ¥½¡¼
-¥¹ÇÛÉۤ˴ޤޤì¤Æ¤¤¤Þ¤¹¡£¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¼¡¤Î´Ø¿ô¤ò´Þ¤ß¤Þ¤¹:
-
-@itemize @bullet
-@item
-@code{metaphon()} ¤Ïʸ»úÎó°ú¿ô¤Î metaphon ʸ»úÎó¤òÊÖ¤·¤Þ¤¹¡£¤³¤ì¤Ï»þ¤Ë¤Ï
-soundex ʸ»úÎó¤Ç¤¹¤¬¡¢¤µ¤é¤Ë±Ñ¸ìÍѤËÄ´À°¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-@item
-@code{myfunc_double()} ¤Ï°ú¿ô¤Îʸ»ú¤Î ASCII Ãͤιç·×¤ò°ú¿ô¤ÎŤµ¤Î¹ç·×¤Ç
-³ä¤Ã¤¿ÃͤòÊÖ¤·¤Þ¤¹¡£
-@item
-@code{myfunc_int()} ¤Ï°ú¿ô¤ÎŤµ¤Î¹ç·×¤òÊÖ¤·¤Þ¤¹¡£
-@item
-@code{lookup()} ¤Ï¥Û¥¹¥È̾¤Î IP ÈÖ¹æ¤òÊÖ¤·¤Þ¤¹¡£
-@item
-@code{reverse_lookup()} ¤Ï IP ÈÖ¹æ¤Î¥Û¥¹¥È̾¤òÊÖ¤·¤Þ¤¹¡£¤³¤Î´Ø¿ô¤Ïʸ»úÎó
-@code{"xxx.xxx.xxx.xxx"} ¤Þ¤¿¤Ï£´¤Ä¤Î¿ôÃͤȤȤâ¤Ë¸Æ¤Ð¤ì¤Þ¤¹¡£
-@end itemize
-
-ưŪ¥í¡¼¥É²Äǽ¥Õ¥¡¥¤¥ë¤Ï¡¢¼¡¤Î¤è¤¦¤Ê²¿¤é¤«¤Î¥³¥Þ¥ó¥É¤ò»ÈÍѤ·¤Æ¡¢¶¦Í­¥ª¥Ö
-¥¸¥§¥¯¥È¥Õ¥¡¥¤¥ë¤È¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤ë¤Ù¤­¤Ç¤¹:
-
-@example
-shell> gcc -shared -o udf_example.so myfunc.cc
-@end example
-
-@strong{MySQL} ¥½¡¼¥¹¥Ä¥ê¡¼¤Î @file{sql} ¥Ç¥£¥ì¥¯¥È¥êÆâ¤Ç¼¡¤Î¥³¥Þ¥ó¥É¤ò
-¼Â¹Ô¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢¥·¥¹¥Æ¥à¤Î¥³¥ó¥Ñ¥¤¥é¥ª¥×¥·¥ç¥ó¤ò´Êñ¤ËÀµ¤·¤¯¸«¤Ä¤±½Ð
-¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹:
-
-@example
-shell> make udf_example.o
-@end example
-
-@code{make} ¤¬É½¼¨¤¹¤ë¤â¤Î¤Ë»÷¤¿¥³¥ó¥Ñ¥¤¥ë¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤Ù¤­¤Ç¤¹¤¬¡¢¹Ô
-Ëö¶á¤¯¤Î @code{-c} ¥ª¥×¥·¥ç¥ó¤ò¼è¤ê½ü¤¤¤Æ¡¢@code{-o udf_example.so} ¤ò¹Ô
-Ëö¤Ë¤Ä¤±¤Æ¤¯¤À¤µ¤¤¡£(¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥³¥Þ¥ó¥É¤Ë @code{-c} ¤ò»Ä¤¹
-ɬÍפ¬¤¢¤ê¤Þ¤¹¡£)
-
-UDF ¤ò´Þ¤à¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤È¡¢¤½¤ì¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¤½¤Î
-¤³¤È¤ò @strong{MySQL} ¤ËÃΤ餻¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£@file{udf_example.cc} ¤«
-¤é¤Î¶¦Í­¥ª¥Ö¥¸¥§¥¯¥È¤Î¥³¥ó¥Ñ¥¤¥ë¤Ï¡¢@file{udf_example.so} ¤Î¤è¤¦¤Ê²¿¤«¤Î
-¥Õ¥¡¥¤¥ë̾¤òÄ󶡤·¤Þ¤¹(¼ÂºÝ¤Î̾Á°¤Ï¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ë¤è¤Ã¤ÆÊѤï¤ê¤Þ¤¹)¡£
-¤³¤Î¥Õ¥¡¥¤¥ë¤ò @file{/usr/lib} ¤Î¤è¤¦¤Ê @code{ld} ¤¬Ãµ¤¹¤É¤³¤«¤Î¥Ç¥£¥ì¥¯
-¥È¥ê¤Ë¥³¥Ô¡¼¤·¤Æ¤¯¤À¤µ¤¤¡£Â¿¤¯¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢@code{LD_LIBRARY} ¤Þ¤¿¤Ï
-@code{LD_LIBRARY_PATH} ´Ä¶­ÊÑ¿ô¤òÀßÄꤷ¤Æ¡¢UDF ´Ø¿ô¥Õ¥¡¥¤¥ë¤¬¤¢¤ë¥Ç¥£¥ì
-¥¯¥È¥ê¤ò¼¨¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£@code{dlopen} ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï¥·¥¹¥Æ¥à¾å¤Ç
-»ÈÍѤ¹¤Ù¤­ÊÑ¿ô¤ò¶µ¤¨¤Æ¤¯¤ì¤Þ¤¹¡£¤³¤ì¤ò @code{mysql.server} ¤Þ¤¿¤Ï
-@code{safe_mysqld} ¤ËÀßÄꤷ¡¢@code{mysqld} ¤òºÆµ¯Æ°¤¹¤Ù¤­¤Ç¤¹¡£
-
-¥é¥¤¥Ö¥é¥ê¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤¿¸å¡¢@code{mysqld} ¤Ë¿·¤·¤¤´Ø¿ô¤Ë¤Ä¤¤¤Æ¼¡¤Î
-¥³¥Þ¥ó¥É¤ÇÄÌÃΤ¹¤Ù¤­¤Ç¤¹:
-
-@example
-mysql> CREATE FUNCTION metaphon RETURNS STRING SONAME "udf_example.so";
-mysql> CREATE FUNCTION myfunc_double RETURNS REAL SONAME "udf_example.so";
-mysql> CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "udf_example.so";
-mysql> CREATE FUNCTION lookup RETURNS STRING SONAME "udf_example.so";
-mysql> CREATE FUNCTION reverse_lookup RETURNS STRING SONAME "udf_example.so";
-@end example
-
-´Ø¿ô¤Ï @code{DROP FUNCTION} ¤ò»ÈÍѤ·¤Æºï½ü¤Ç¤­¤Þ¤¹:
-
-@example
-mysql> DROP FUNCTION metaphon;
-mysql> DROP FUNCTION myfunc_double;
-mysql> DROP FUNCTION myfunc_int;
-mysql> DROP FUNCTION lookup;
-mysql> DROP FUNCTION reverse_lookup;
-@end example
-
-@code{CREATE FUNCTION} ¤È @code{DROP FUNCTION} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ï
-@code{mysql} ¥Ç¡¼¥¿¥Ù¡¼¥¹Æâ¤Î¥·¥¹¥Æ¥à¥Æ¡¼¥Ö¥ë @code{func} ¤ò¹¹¿·¤·¤Þ¤¹¡£
-´Ø¿ô¤Î̾Á°¡¢·¿¡¢¶¦Í­¥é¥¤¥Ö¥é¥ê̾¤Ï¥Æ¡¼¥Ö¥ë¤ËÊݸ¤µ¤ì¤Þ¤¹¡£ºîÀ®¤ÈÇË´þµ¡Ç½
-¤Î¤¿¤á¤Ë¤Ï¡¢@code{mysql} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë @strong{insert} ¤È
-@strong{delete} ¸¢¸Â¤ò»ý¤ÄɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-´û¤ËÀ¸À®¤·¤Æ¤¢¤ë´Ø¿ô¤òÄɲ乤뤿¤á¤Ë @code{CREATE FUNCTION} ¤ò»ÈÍѤ¹¤Ù¤­
-¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£´Ø¿ô¤ÎºÆ¥¤¥ó¥¹¥È¡¼¥ë¤¬É¬Íפʾì¹ç¤Ï¡¢@code{DROP FUNCTION}
-¤Ç¤½¤ì¤òºï½ü¤·¡¢¤½¤ì¤«¤é @code{CREATE FUNCTION} ¤ÇºÆ¥¤¥ó¥¹¥È¡¼¥ë¤¹¤Ù¤­¤Ç
-¤¹¡£Î㤨¤Ð¡¢´Ø¿ô¤Î¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤ÎºÆ¥³¥ó¥Ñ¥¤¥ë¤ò¤·¤¿¾ì¹ç¡¢
-@code{mysqld} ¤¬¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤òÆÀ¤ë¤¿¤á¤Ë¡¢¤³¤ì¤ò¹Ô¤Ê¤¦É¬Íפ¬¤¢¤ë¤Ç¤·¤ç
-¤¦¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¡¢¥µ¡¼¥Ð¤Ï¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤Î»ÈÍѤò·Ñ³¤·¤Þ¤¹¡£
-
-@code{mysqld} ¤ò @code{--skip-grant-tables} ¥ª¥×¥·¥ç¥ó¤Çµ¯Æ°¤·¤Ê¤¯¤Æ¤â¡¢
-Í­¸ú¤Ê´Ø¿ô¤Ï¥µ¡¼¥Ð¤Î³«»ÏËè¤ËºÆÆɤ߹þ¤ß¤µ¤ì¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢UDF ½é´ü²½¤ÏÈô
-¤Ð¤µ¤ì¡¢UDF ¤¬Ìµ¸ú¤Ë¤Ê¤ê¤Þ¤¹¡£(Í­¸ú¤Ê´Ø¿ô¤Ï @code{CREATE FUNCTION} ¤Ç¥í¡¼
-¥É¤µ¤ì¤Æ¤¤¤ë¤â¤Î¤Ç¡¢@code{DROP FUNCTION} ¤Çºï½ü¤µ¤ì¤Æ¤¤¤Ê¤¤¤â¤Î¤Ç¤¹¡£)
-
-@cindex Adding native functions
-@cindex Native functions, adding
-@cindex Functions, native, adding
-@node Adding native function, , Adding UDF, Adding functions
-@section ¿·¤·¤¤¥Í¥¤¥Æ¥£¥Ö´Ø¿ô¤ÎÄɲÃ
-
-¥Í¥¤¥Æ¥£¥Ö´Ø¿ô¤òÄɲ乤뤿¤á¤Î¥×¥í¥·¥¸¥ã¤ò°Ê²¼¤Ë¼¨¤·¤Þ¤¹¡£¥Ð¥¤¥Ê¥êÇÛÉÛ¤Ë
-¤Ï¥Í¥¤¥Æ¥£¥Ö´Ø¿ô¤òÄɲäǤ­¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£¥×¥í¥·¥¸¥ã¤Ï
-@strong{MySQL} ¥½¡¼¥¹¥³¡¼¥É¤ÎÊѹ¹¤òɬÍפȤ¹¤ë¤¿¤á¤Ç¤¹¡£@strong{MySQL} ¤ò
-¥½¡¼¥¹ÇÛÉÛ¤«¤é¼«Ê¬¤Ç¥³¥ó¥Ñ¥¤¥ë¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤Þ¤¿¡¢@strong{MySQL}
-¤Î¾¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë°Ü¹Ô¤¹¤ë¾ì¹ç(Î㤨¤Ð¡¢¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤¬¥ê¥ê¡¼¥¹¤µ¤ì¤¿
-»þ)¡¢¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Ç¤³¤Î¥×¥í¥·¥¸¥ã¤ò·«¤êÊÖ¤¹É¬Íפ¬¤¢¤ê¤Þ¤¹¡£
-
-¿·¤·¤¤¥Í¥¤¥Æ¥£¥Ö @strong{MySQL} ´Ø¿ô¤òÄɲ乤뤿¤á¤Ë¤Ï¡¢¼¡¤Î¥¹¥Æ¥Ã¥×¤Ë½¾¤Ã
-¤Æ¤¯¤À¤µ¤¤:
-
-@enumerate
-@item
-@code{sql_functions[]} ÇÛÎóÆâ¤Ç´Ø¿ô̾¤òÄêµÁ¤·¤Æ¤¤¤ë @file{lex.h} ¤Ë£±¹Ô
-Äɲ䷤Ƥ¯¤À¤µ¤¤¡£
-@item
-@file{sql_yacc.yy} ¤Ë£²¹ÔÄɲ䷤Ƥ¯¤À¤µ¤¤¡£°ì¤Ä¤Ï¡¢@code{yacc} ¤¬ÄêµÁ¤¹
-¤Ù¤­¥×¥ê¥×¥í¥»¥Ã¥µ¥·¥ó¥Ü¥ë¤ò»Ø¼¨¤·¤Þ¤¹(¤³¤ì¤Ï¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤ËÄɲ乤٤­
-¤Ç¤¹)¡£¤½¤ì¤«¤é´Ø¿ô¥Ñ¥é¥á¡¼¥¿¤òÄêµÁ¤·¡¢¤³¤ì¤é¤Î¥Ñ¥é¥á¡¼¥¿¤È¤È¤â¤Ë
-``item'' ¤ò @code{simple_expr} ¥Ñ¡¼¥¹µ¬Â§¤ËÄɲä·¤Þ¤¹¡£Î㤨¤Ð¡¢¤³¤ì¤¬¤É
-¤Î¤è¤¦¤ËÆ°ºî¤¹¤ë¤«¤ò¸«¤ë¤Ë¤Ï¡¢@file{sql_yacc.yy} Æâ¤Î @code{SOUNDEX} ¤Î
-Á´¤Æ¤Î½ÐÍè»ö¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£
-@item
-@file{item_func.h} Æâ¤Ç¡¢´Ø¿ô¤¬¿ôÃͤޤ¿¤Ïʸ»úÎó¤Î¤É¤Á¤é¤òÊÖ¤¹¤«¤Ë°Í¸¤·
-¤Æ¡¢@code{Item_num_func} ¤Þ¤¿¤Ï @code{Item_str_func} ¤«¤é·Ñ¾µ¤¹¤ë¥¯¥é¥¹
-¤òÀë¸À¤·¤Æ¤¯¤À¤µ¤¤¡£
-@item
-@file{item_func.cc} Æâ¤Ç¡¢¿ôÃͤޤ¿¤Ïʸ»úÎó¤Î¤É¤Á¤é¤Î´Ø¿ô¤òÄêµÁ¤¹¤ë¤«¤Ë°Í
-¸¤·¤Æ¡¢¼¡¤ÎÀë¸À¤Î°ì¤Ä¤òÄɲ䷤Ƥ¯¤À¤µ¤¤:
-@example
-double Item_func_newname::val()
-longlong Item_func_newname::val_int()
-String *Item_func_newname::Str(String *str)
-@end example
-@item
-¤ª¤½¤é¤¯¼¡¤Î´Ø¿ô¤âÄêµÁ¤¹¤Ù¤­¤Ç¤¹:
-@example
-void Item_func_newname::fix_length_and_dec()
-@end example
-¤³¤Î´Ø¿ô¤ÏÍ¿¤¨¤é¤ì¤¿°ú¿ô¤Ë´ð¤Å¤¤¤Æ¾¯¤Ê¤¯¤È¤â @code{max_length} ¤ò·×»»¤¹
-¤Ù¤­¤Ç¤¹¡£@code{max_length} ¤Ï´Ø¿ô¤¬ÊÖ¤·ÆÀ¤ëʸ»ú¤ÎºÇÂç¿ô¤Ç¤¹¡£¤³¤Î´Ø¿ô¤Ï¡¢
-¥á¥¤¥ó´Ø¿ô¤¬ @code{NULL} ÃͤòÊÖ¤¹¤³¤È¤¬¤Ê¤¤¾ì¹ç¤Ï¡¢@code{maybe_null = 0}
-¤âÀßÄꤹ¤Ù¤­¤Ç¤¹¡£´Ø¿ô¤Ï¡¢°ú¿ô¤Î @code{maybe_null} ÊÑ¿ô¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤³
-¤È¤Ç¡¢´Ø¿ô¤ÎǤ°Õ¤Î°ú¿ô¤¬ @code{NULL} ¤òÊÖ¤·¤¦¤ë¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤Ç¤­¤Þ
-¤¹¡£
-@end enumerate
-
-Á´¤Æ¤Î´Ø¿ô¤Ï¥¹¥ì¥Ã¥É°ÂÁ´¤Ç¤¢¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-ʸ»úÎó´Ø¿ô¤Ë¤Ä¤¤¤Æ¤Ï¡¢¼¡¤Î¤¤¤¯¤Ä¤«¤ÎÄɲø¡Æ¤»ö¹à¤¬¤¢¤ê¤Þ¤¹:
-@itemize @bullet
-@item
-@code{String *str} °ú¿ô¤Ï¡¢·ë²Ì¤òÊÝ»ý¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤ëʸ»úÎó¥Ð¥Ã¥Õ¥¡
-¤òÄ󶡤·¤Þ¤¹¡£
-@item
-´Ø¿ô¤Ï·ë²Ì¤òÊÝ»ý¤¹¤ëʸ»úÎó¤òÊÖ¤¹¤Ù¤­¤Ç¤¹¡£
-@item
-Á´¤Æ¤Î¸½ºß¤Îʸ»úÎó´Ø¿ô¤Ï¡¢ÀäÂФËɬÍפǤʤ¤¸Â¤ê¡¢¥á¥â¥ê³ä¤êÅö¤Æ¤òÈò¤±¤ë¤è
-¤¦¤Ë»î¤ß¤Æ¤¯¤À¤µ¤¤¡ª
-@end itemize
-
-@node Adding procedures, ODBC, Adding functions, Top
-@chapter Adding new procedures to MySQL
-
-In @strong{MySQL}, you can define a procedure in C++ that can access and
-modify the data in a query before it is sent to the client. The modification
-can be done on row by row or @code{GROUP BY} level.
-
-We have created an example procedure in @strong{MySQL} 3.23 to
-show you what can be done.
-
-@menu
-* procedure analyse:: Procedure analyse
-* Writing a procedure:: Writing a procedure.
-@end menu
-
-@node procedure analyse, Writing a procedure, Adding procedures, Adding procedures
-@section Procedure analyse
-
-@code{analyse([max elements,[max memory]])}
-
-This procedure is defined in the @file{sql/sql_analyse.cc}. This
-examines the result from your query and returns an analysis of the
-results.
-
-@itemize @bullet
-@item
-@code{max elements} (default 256) is the maximum number of distinct values
-@code{analyse} will notice per column. This is used by @code{analyse} to check if
-the optimal column type should be of type @code{ENUM}.
-@item
-@code{max memory} (default 8192) is the maximum memory @code{analyse} should
-allocate per column while trying to find all distinct values.
-@end itemize
-
-@example
-SELECT ... FROM ... WHERE ... PROCEDURE ANALYSE([max elements,[max memory]])
-@end example
-
-@node Writing a procedure, , procedure analyse, Adding procedures
-@section Writing a procedure.
-
-For the moment, the only documentation for this is the source. :(
-
-You can find all information about procedures by examining the following files:
-
-@itemize @bullet
-@item @file{sql/sql_analyse.cc}
-@item @file{sql/procedure.h}
-@item @file{sql/procedure.cc}
-@item @file{sql/sql_select.cc}
-@end itemize
-
-@cindex ODBC
-@cindex Windows
-@cindex MyODBC
-@node ODBC, Common programs, Adding procedures, Top
-@chapter @strong{MySQL} ODBC Support
-
-@menu
-* Which ODBC OS:: Operating systems supported by @strong{MyODBC}
-* ODBC administrator:: How to fill in the various fields in the ODBC administrator program
-* ODBC Problems:: How to report problems with @strong{MySQL} ODBC
-* MyODBC clients:: Programs known to work with @strong{MyODBC}
-* ODBC and last_insert_id:: How to get the value of an @code{AUTO_INCREMENT} column in ODBC
-* MyODBC bug report:: Reporting problems with MyODBC
-@end menu
-
-@strong{MySQL} ¤Ï @strong{MyODBC} ¥×¥í¥°¥é¥à¤Ç ODBC µ¡Ç½¤òÄ󶡤·¤Þ¤¹¡£
-
-@node Which ODBC OS, ODBC administrator, ODBC, ODBC
-@section Operating systems supported by @strong{MyODBC}
-
-@strong{MyODBC} ¤Ï 32-bit ODBC (2.50) level 0 driver ¤Ç¡¢
-ODBC ²½¤µ¤ì¤¿¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤¬ @strong{MySQL} ¤ËÀܳ¤¹¤ë¾ì¹ç¤Ë»ÈÍѤ·¤Þ¤¹¡£
-@strong{MyODBC} ¤Ï¡¢Windows95, Windows98, NT ¤È¤Û¤È¤ó¤É¤Î Unix ¤ÇÆ°¤­¤Þ¤¹¡£
-
-Ä̾@strong{MyODBC} ¤Ï Windows ¥Þ¥·¥ó¤Ë¤À¤±¡¢¥¤¥ó¥¹¥È¡¼¥ë¤·¤Þ¤¹¡£
-¡¢¤¢¤Ê¤¿¤Î¥×¥í¥°¥é¥à¤¬ ColdFusion ¤Î¤è¤¦¤Ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤ÎÀܳ¤Ë
-ODBC ¤À¤±¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ë¸Â¤ê¡¢UNIX ¤Ë @strong{MyODBC} ¤¬É¬ÍפǤ¹¡£
-
-@strong{MyODBC} ¤Ï¥Ñ¥Ö¥ê¥Ã¥¯¡¦¥É¥á¥¤¥ó¤Ç¡¢ºÇ¿·¤Îʪ¤Ï°Ê²¼¤Ë¤¢¤ê¤Þ¤¹¡§
-@uref{http://www.mysql.com/download_myodbc.html}.
-
-ÆüËܸìʸ»ú¥³¡¼¥É¤ËÂбþ¤µ¤»¤¿Êª¤Ï¡§
-@uref{http://www.SoftAgency.co.jp/}.
-
-¤â¤·¡¢UNIX ¤Ë @strong{MyODBC} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿¤¤¤Ê¤é¡¢ @strong{ODBC}
-¥Þ¥Í¡¼¥¸¥ã¡¼¤âɬÍפǤ·¤ç¤¦¡£ @strong{MyODBC} ¤Ï UNIX ¤Î ODBC ¥Þ¥Í¡¼¥¸¥ã¡¼
-¤Ç¤âÆ°ºî¤¹¤ë¤³¤È¤¬ÃΤé¤ì¤Æ¤¤¤Þ¤¹¡£ @strong{MySQL} useful links page ¤Î
-@strong{ODBC}-related links Àá¤Ë¡¢¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@xref{Useful Links}.
-
-Windows/NT ¤Î¾ì¹ç¡¢@strong{MyODBC} ¤ò¥¤¥ó¥¹¥È¡¼¥ë»þ¤Ë¤¤¤«¤Î¤è¤¦¤Ê
-¥¨¥é¡¼¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Þ¤»¤ó:
-
-@example
-An error occurred while copying C:\WINDOWS\SYSTEM\MFC30.DLL. Restart Windows
-and try installing again (before running any applications which use ODBC)
-@end example
-
-The problem in this case is that some other program is using ODBC and
-because of how windows is designed, one cannot in this case install new
-ODBC drivers with Microsoft's ODBC setup program. :(
-¤³¤ì¤ò²ò·è¤¹¤ë¤Ë¤Ï¡¢°ìÅÙ ¡Ç¥»¡¼¥Õ¥â¡¼¥É¡Ç¤Ç¥³¥ó¥Ô¥å¡¼¥¿¤òΩ¤Á¾å¤²Ä¾¤·¡¢
-(windows ¥ê¥Ö¡¼¥È»þ¤Ë¡¢F8¥­¡¼¤ò²¡¤¹¤³¤È¤Ç¡¢¥»¡¼¥Õ¥â¡¼¥É¤ÎÁªÂò¤¬²Äǽ¤Ç¤¹)
-@strong{MyODBC} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Æ¡¢¥ê¥Ö¡¼¥È¤·¤Þ¤¹¡£
-
-@itemize @bullet
-@item
-Windows ¥Þ¥·¥ó¤«¤é UNIX ¤Ë ODBC ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò»ÈÍѤ·¤ÆÀܳ¤¹¤ë¤Ë¤Ï¡¢
-¤Þ¤ººÇ½é¤Ë Windows ¥Þ¥·¥ó¤Ë @strong{MyODBC} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤Ê¤¯¤Æ¤Ï
-¤Ê¤ê¤Þ¤»¤ó¡£
-@item
-UNIX ¾å¤Î @strong{MySQL} ¥µ¡¼¥Ð¡¼¤ËÂФ·¤Æ¡¢¥æ¡¼¥¶¡¼¤È Windows ¥Þ¥·¥ó¤Î
-¥¢¥¯¥»¥¹µö²Ä¤òÍ¿¤¨¤Þ¤¹¡£ ¤³¤ì¤Ï¡¢ @code{GRANT} ¥³¥Þ¥ó¥É¤Ç²Äǽ¤Ç¤¹¡£
-@xref{GRANT,,@code{GRANT}}.
-@item
-ODBC DSN ¤ò°Ê²¼¤Î¤è¤¦¤Ë¤·¤ÆºîÀ®¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡§
-
-@itemize @bullet
-@item
-Windows ¥Þ¥·¥ó¤Î¥³¥ó¥È¥í¡¼¥ë¥Ñ¥Í¥ë¤ò³«¤¯
-@item
-ODBC ¥¢¥¤¥³¥ó¤ò¥À¥Ö¥ë¥¯¥ê¥Ã¥¯
-@item
-"¥æ¡¼¥µ¡¼DSN" ¤ò¥¯¥ê¥Ã¥¯
-@item
-"ÄɲÃ..." ¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯
-@item
-¿·¤·¤¤¥Ç¡¼¥¿¥½¡¼¥¹ ¤Î²èÌ̤«¤é¡¢@strong{MySQL} ¤òÁª¤Ó¡¢´°Î»¥Ü¥¿¥ó¤ò¥¯¥ê¥Ã¥¯¡£
-@item
-TCX @strong{MySQL} Driver ¤Î¥Ç¥Õ¥©¥ë¥ÈÀßÄ꤬¸½¤ì¤Þ¤¹¡£
-@xref{ODBC administrator}.
-@end itemize
-
-@item
-¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤òµ¯Æ°¤·¡¢¥³¥ó¥È¥í¡¼¥ë¥Ñ¥Í¥ë¤ÇÀßÄꤷ¤¿ ODBC DSN ¤òÁª¤Ó¤Þ¤¹
-@end itemize
-
-MyODBC ¤ÎÀßÄê²èÌ̤ˤϡ¢@strong{MySQL} Àܳ»þ¤Î¥ª¥×¥·¥ç¥ó¤¬¤¤¤¯¤Ä¤«
-ÀßÄê¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
-¤â¤·ÌäÂ꤬¤¢¤ë¾ì¹ç¤Ï¡¢¤³¤ì¤é¤ò»î¤·¤Þ¤¹¡£
-
-
-@node ODBC administrator, ODBC Problems, Which ODBC OS, ODBC
-@section ODBC ´ÉÍý¥×¥í¥°¥é¥à¤Î³Æ¼ï¹àÌܤòËä¤á¤ë¤Ë¤Ï¡©
-
-Windows95 ¾å¤Î¥µ¡¼¥Ð̾¤Îµ­½Ò¤Ë¤Ï3¤Ä¤Î²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹:
-
-@itemize @bullet
-@item
-¥µ¡¼¥Ð¤Î IP ¥¢¥É¥ì¥¹¤Î»ÈÍÑ
-@item
-¥Õ¥¡¥¤¥ë @file{\windows\lmhosts} ¤Ø¤Î¼¡¤Î¾ðÊó¤ÎÄɲÃ:
-
-@example
-ip hostname
-@end example
-
-Î㤨¤Ð¡§
-
-@example
-194.216.84.21 my
-@end example
-
-@item
-DNS ¤ò»ÈÍѤ¹¤ë¤è¤¦¤ËÀßÄꤷ¤Þ¤¹¡£
-@end itemize
-
-@code{ODBC setup} ¤òËä¤á¤ëÊýË¡¤ÎÎã:
-@example
-Windows DSN name: test
-Description: This is my test database
-MySql Database: test
-Server: 194.216.84.21
-User: monty
-Password: my_password
-Port:
-@end example
-
-@code{Windows DSN name} ¹àÌܤÎÃͤϡ¢¤¢¤Ê¤¿¤Îwindows ODBC setup ¤Ë¤ª¤±¤ë
-°ì°Õ¤Î̾Á°¤Ç¤¹¡£
-
-ODBC setup ²èÌ̤ǡ¢@code{Server}, @code{User}, @code{Password}, @code{Port}
- ¥Õ¥£¡¼¥ë¥É¤òÀßÄꤹ¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£
-¤·¤«¤·¡¢¤³¤³¤ÇÀßÄê¤ò¤¹¤ë¤È¡¢¸å¤Ç¥µ¡¼¥Ð¡¼¤ËÀܳ¤¹¤ëºÝ¤Ë¡¢
-ÀßÄꤷ¤¿Ãͤ¬¥Ç¥Õ¥©¥ë¥ÈÃͤȤ·¤Æ»ÈÍѤµ¤ì¤Þ¤¹¡£
-»ÈÍÑ»þ¤ËÃͤòÊѹ¹¤¹¤ë¥ª¥×¥·¥ç¥ó¤Ï¤¢¤ê¤Þ¤¹¡£
-
-¥Ý¡¼¥ÈÈֹ椬ÀßÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤Ê¤é¡¢¥Ç¥Õ¥©¥ë¥È¥Ý¡¼¥È (@value{default_port}) ¤¬»ÈÍѤµ¤ì¤Þ¤¹¡£
-
-¤â¤·¥ª¥×¥·¥ç¥ó¤ò @code{Read options from C:\my.cnf} ¤Ë¤¹¤ë¤È,
-@code{client} ¤È @code{odbc} ¥°¥ë¡¼¥×¤Ï @file{C:\my.cnf} ¥Õ¥¡¥¤¥ë¤«¤éÆɤޤì¤Þ¤¹¡£
-@code{mysql_options()} ¤Ç»ÈÍѤǤ­¤ëÁ´¤Æ¤Î¥ª¥×¥·¥ç¥ó¤¬ÍøÍѲÄǽ¤Ç¤¹¡£
-@xref{mysql_options}.
-
-
-@node ODBC Problems, MyODBC clients, ODBC administrator, ODBC
-@section @strong{MyODBC}¤Ç¤ÎÌäÂê¤ò¤É¤Î¤è¤¦¤ËÊó¹ð¤¹¤Ù¤­¤«¡©
-
-@strong{MyODBC} ¤Ï°Ê²¼¤Ç¥Æ¥¹¥È¤µ¤ì¤Þ¤·¤¿¡§ Access, Admndemo.exe, C++-Builder,
-Borland Builder 4, Centura Team Developer (formerly Gupta SQL/Windows),
-ColdFusion (on Solaris and NT with svc pack 5), Crystal Reports,
-DataJunction, Delphi, ERwin, Excel, iHTML, FileMaker Pro, FoxPro, Notes
-4.5/4.6, SBSS, Perl DBD-ODBC, Paradox, Powerbuilder, Powerdesigner 32
-bit, VC++ and Visual Basic.
-
-@strong{MyODBC} ¤ÇÆ°ºî¤¹¤ë¾¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤Ä¤¤¤Æ¤âÃΤäƤ¤¤ë¤Ê¤é¡¢
-@email{myodbc@@lists.mysql.com} ¤Þ¤Ç¥á¡¼¥ë¤ò¤¯¤À¤µ¤¤¡ª
-
-With some programs you may get an error like:
-@code{Another user has modifies the record that you have modified}. In most
-cases this can be solved by doing one of the following things:
-
-@itemize @bullet
-@item
-Add a primary key for the table if there isn't one already.
-@item
-Add a timestamp column if there isn't one already.
-@item
-Only use double float fields. Some programs may fails when they comparing
-single floats.
-@end itemize
-
-If the above doesn't help, you should do a @code{MyODBC} trace file and
-from this try to figure out why things goes wrong.
-
-@node MyODBC clients, ODBC and last_insert_id, ODBC Problems, ODBC
-@section @strong{MyODBC}¤ÇÆ°ºî¤¹¤ë¤³¤È¤¬ÃΤé¤ì¤Æ¤¤¤ë¥×¥í¥°¥é¥à
-
-¿¤¯¤Î¥×¥í¥°¥é¥à¤¬ @strong{MyODBC} ¤ÇÆ°ºî¤·¤Þ¤¹¡£¤³¤ì¤é¤Ï²æ¡¹¼«¿È¤¬¥Æ¥¹¥È¤·¤¿¤«¡¢
-¤Þ¤¿¤Ï²¿¿Í¤«¤Î¾¤Î¥æ¡¼¥¶¤«¤éÆ°ºî¤¹¤ë¤È¤¤¤¦³Î¾Ú¤òÆÀ¤¿¤â¤Î¤Ç¤¹:
-
-@table @asis
-@item @strong{Program}
-@strong{Comment}
-@item Access
-Access ¤òÆ°ºî¤µ¤»¤ë¤Ë¤Ï:
-@itemize @bullet
-@item
-¥Æ¡¼¥Ö¥ë¤Ë¥×¥é¥¤¥Þ¥ê¥­¡¼¤òÀßÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-@item
-¹¹¿·²Äǽ¤Ê¥Æ¡¼¥Ö¥ë¤ÎÁ´¤Æ¤Ë¡¢timestamp ¤ò»ý¤¿¤»¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-@item
-¥À¥Ö¥ë¥Õ¥í¡¼¥È·¿¤À¤±¤¬(¼Â¿ô¤Ë)»ÈÍѤǤ­¤Þ¤¹¡£Access¤Ç¤Ï¥·¥ó¥°¥ë¥Õ¥í¡¼¥È¤ÈÈæ³Ó¤Ï¼ºÇÔ¤·¤Þ¤¹¡£
-@item
-@strong{MySQL} ¤ËÀܳ¤¹¤ëºÝ¤Ï¡¢'Return matching rows' ¥ª¥×¥·¥ç¥ó¤ò¥»¥Ã¥È¤·¤Þ¤¹¡£
-@item
-NT ¾å¤Î Access ¤Ï @code{BLOB} ¥Õ¥£¡¼¥ë¥É¤ò @code{OLE OBJECTS} ¤Èǧ¼±¤·¤Þ¤¹¡£
-¤â¤· @code{MEMO} ¥Õ¥£¡¼¥ë¥É¤òÂå¤ï¤ê¤Ë»ÈÍѤ·¤¿¤¤¤Ê¤é¡¢ @code{ALTER TABLE} ¤ò»È¤Ã¤Æ¡¢
-@code{TEXT} ·¿¤Ë¥Õ¥£¡¼¥ë¥É¤òÊѹ¹¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-@item
-Access ¤Ï @code{DATE} ¥Õ¥£¡¼¥ë¥É¤ò¤¤¤Ä¤âÀµ¤·¤¯°·¤¦¤³¤È¤¬½ÐÍè¤Þ¤»¤ó¡£
-¤â¤·¤³¤ì¤é¤ÎÌäÂ꤬¤¢¤Ã¤¿¾ì¹ç¡¢¥Õ¥£¡¼¥ë¥É·¿¤ò @code{DATETIME} ¤ËÊѤ¨¤Æ¤¯¤À¤µ¤¤¡£
-@end itemize
-@item
-¥¢¥¯¥»¥¹¤Ï¡¢@strong{MySQL} ¤¬Íý²ò¤Ç¤­¤Ê¤¤´Ö°ã¤Ã¤¿ SQL ¥¯¥¨¥ê¤ò
-ºîÀ®¤¹¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£ ¤³¤ì¤Ï¥¢¥¯¥»¥¹¤Î¥á¥Ë¥å¡¼¤«¤é
-@code{"Query|SQLSpecific|Pass-Through"} ¤òÁªÂò¤¹¤ì¤Ð
-ľ¤¹¤³¤È¤¬²Äǽ¤Ç¤¹¡£
-@item Borland Builder 4
-When you start a query you can use the property @code{Active} or use the
-method @code{Open}. Note that @code{Active} will start by automatically issue
-a @code{SELECT * FROM ...} query that may not be a good thing if your tables
-are big!
-
-@item ColdFusion (On Unix)
-The following information is taken from the ColdFusion documentation:
-
-Use the following information to configure ColdFusion Server for Linux
-to use the unixODBC driver with @strong{MyODBC} for @strong{MySQL} data
-sources. Allaire has verified that @strong{MyODBC} version 2.50.26
-works with @strong{MySQL} version 3.22.27 and ColdFusion for Linux. (Any
-newer version should also work). You can download @strong{MyODBC} at
-@uref{http://www.mysql.com/download_myodbc.html}
-
-ColdFusion 4.5.1 allows you to us the ColdFusion Administrator to add
-the @strong{MySQL} data source. However, the driver is not included with
-ColdFusion 4.5.1. Before the @strong{MySQL} driver will appear in the ODBC
-datasources drop-down list, you must build and copy the @strong{MyODBC} driver
-to @file{/opt/coldfusion/lib/libmyodbc.so}.
-
-@item DataJunction
-You have to change it to output @code{VARCHAR} rather than @code{ENUM}, as
-it exports the latter in a manner that causes @strong{MySQL} grief.
-@item Excel
-Æ°ºî¡£Some tips:
-@itemize @bullet
-@item
-ÆüÉÕ¤ËÌäÂ꤬µ¯¤­¤¿¾ì¹ç¡¢@code{CONCAT()} ´Ø¿ô¤ò»ÈÍѤ·¡¢Ê¸»ú¤È¤·¤Æ SELECT ¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
-Î㤨¤Ð¡§
-@example
-select CONCAT(rise_time), CONCAT(set_time)
- from sunrise_sunset;
-@end example
-¤³¤ÎÊýË¡¤Çʸ»ú¤È¤·¤ÆÊ֤äƤ­¤¿Ãͤò¡¢Excel97 ¤Ç»þ´Ö¤È¤·¤Æ°·¤¦¤è¤¦¤Ë¤¹¤Ù¤­¤Ç¤¹¡£
-
-¤³¤ÎÎã¤Î @code{CONCAT()} ¤ÎÌÜŪ¤Ï¡¢¥Õ¥£¡¼¥ë¥É¤Î·¿¤¬Ê¸»úÎó¤Ç¤¢¤ë¤È ODBC ¤ò¤À¤Þ¤¹¤³¤È¤Ç¤¹¡£
-@code{CONCAT()} ¤¬¤Ê¤±¤ì¤Ð¡¢ODBC ¤Ï¥Õ¥£¡¼¥ë¥É¤Î·¿¤¬ÆüÉդȤ狼¤ë¤Î¤Ç¡¢
-Excel ¤¬º£Å٤Ϥ½¤ì¤òÍý²ò¤Ç¤­¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£
-
-¤³¤ì¤Ï Excel ¤Î¥Ð¥°¤Ç¤¹¡£¤Ê¤¼¤Ê¤éʸ»ú¤ò¼«Æ°¤ÇÆüÉÕ¤Ëľ¤¹¤Î¤Ç¤¹¤«¤é¡£
-¤³¤ì¤Ïñ¤Ë¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Î¾ðÊó¤ò°·¤¦¾ì¹ç¤Ê¤é¤Ð¤¤¤¤¤Î¤Ç¤¹¤¬¡¢
-³Æ¹àÌܤη¿¤òÃΤ餻¤ë ODBC Àܳ¤Î¾ðÊó¤ò°·¤¦¾ì¹ç¤Ï¡¢¤È¤Æ¤â¶ò¤«¤ÊÊýË¡¤Ç¤¹¡£
-@end itemize
-@item odbcadmin
-ODBC ¤Î¥Æ¥¹¥È¥×¥í¥°¥é¥à.
-@item Delphi
-DBE 3.2 °Ê¾å¤òɬ¤º»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
-@strong{MySQL} ¤ËÀܳ¤¹¤ëºÝ¤Ë¤Ï¡¢'Don't optimize column width' ¥ª¥×¥·¥ç¥ó¤ò¥»¥Ã¥È¤·¤Þ¤¹¡£
-
-ODBC¥¨¥ó¥È¥ê¤ÈBDE¥¨¥ó¥È¥ê¤ÎξÊý¤ò¥»¥Ã¥È¥¢¥Ã¥×¤¹¤ë¤ª¤ê¤ËÌò¤ËΩ¤Ä¤Ç¤¢¤í¤¦
- Delphi ¤Î¥³¡¼¥ÉÎã¤ò¼¨¤·¤Þ¤¹
-( BDE ¤Ï Delphi Super Page ¤«¤é̵½þ¤ÇÆÀ¤é¤ì¤ë BDE Alias Editor ¤¬É¬ÍפǤ¹)¡£
-: (Thanks to Bryan Brunton @email{bryan@@flesherfab.com} for this)
-
-@example
-fReg:= TRegistry.Create;
- fReg.OpenKey('\Software\ODBC\ODBC.INI\DocumentsFab', True);
- fReg.WriteString('Database', 'Documents');
- fReg.WriteString('Description', ' ');
- fReg.WriteString('Driver', 'C:\WINNT\System32\myodbc.dll');
- fReg.WriteString('Flag', '1');
- fReg.WriteString('Password', '');
- fReg.WriteString('Port', ' ');
- fReg.WriteString('Server', 'xmark');
- fReg.WriteString('User', 'winuser');
- fReg.OpenKey('\Software\ODBC\ODBC.INI\ODBC Data Sources', True);
- fReg.WriteString('DocumentsFab', 'MySQL');
- fReg.CloseKey;
- fReg.Free;
-
- Memo1.Lines.Add('DATABASE NAME=');
- Memo1.Lines.Add('USER NAME=');
- Memo1.Lines.Add('ODBC DSN=DocumentsFab');
- Memo1.Lines.Add('OPEN MODE=READ/WRITE');
- Memo1.Lines.Add('BATCH COUNT=200');
- Memo1.Lines.Add('LANGDRIVER=');
- Memo1.Lines.Add('MAX ROWS=-1');
- Memo1.Lines.Add('SCHEMA CACHE DIR=');
- Memo1.Lines.Add('SCHEMA CACHE SIZE=8');
- Memo1.Lines.Add('SCHEMA CACHE TIME=-1');
- Memo1.Lines.Add('SQLPASSTHRU MODE=SHARED AUTOCOMMIT');
- Memo1.Lines.Add('SQLQRYMODE=');
- Memo1.Lines.Add('ENABLE SCHEMA CACHE=FALSE');
- Memo1.Lines.Add('ENABLE BCD=FALSE');
- Memo1.Lines.Add('ROWSET SIZE=20');
- Memo1.Lines.Add('BLOBS TO CACHE=64');
- Memo1.Lines.Add('BLOB SIZE=32');
-
- AliasEditor.Add('DocumentsFab','MySQL',Memo1.Lines);
-@end example
-
-@item C++Builder
-BDE 3.0¤Ç,¥Æ¥¹¥È¤µ¤ì¤Þ¤·¤¿¡£Í£°ì¤ÎÃΤé¤ì¤¿ÌäÂê¤Ï¡¢
-¥Æ¡¼¥Ö¥ë¥¹¥­¡¼¥Þ¤¬ÊѲ½¤¹¤ë»þ¡¢¥¯¥¨¥ê¥Õ¥£¡¼¥ë¥É¤¬¹¹¿·¤µ¤ì¤Ê¤¤¤³¤È¤Ç¤¹¡£
-BDE ¤Ï¡¢index PRIMARY ¤À¤±¤òǧ¼±¤·¡¢¥×¥é¥¤¥Þ¥ê¡¼¥­¡¼¤Ïǧ¼±¤·¤Æ¤¤¤Ê¤¤¤è¤¦¤Ë»×¤¨¤Þ¤¹¡£¤³¤ì¤Ï¤µ¤Û¤ÉÌäÂê¤Ç¤Ï¤Ê¤¤¤Ç¤¹¤¬¡£
-@item Visual Basic
-¥Æ¡¼¥Ö¥ë¤Î¹¹¿·¤ò²Äǽ¤Ë¤¹¤ë¤¿¤á¡¢¥Æ¡¼¥Ö¥ë¤Ë¥×¥é¥¤¥Þ¥ê¡¼¥­¡¼¤òºîÀ®¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-
-Visual Basic with ADO can't handle big integers; This means that some queries
-like @code{SHOW PROCESSLIST} will not work properly. The fix is to set
-add the option @code{OPTION=16834} in the ODBC connect string or set
-the @code{Change BIGINT columns to INT} option in the MyODBC connect screen.
-@end table
-
-@node ODBC and last_insert_id, MyODBC bug report, MyODBC clients, ODBC
-@section @code{AUTO_INCREMENT} ¥Õ¥£¡¼¥ë¥É¤ÎÃͤò ODBC ¤ÇÆÀ¤ëÊýË¡
-
-¶¦Ä̤ÎÌäÂê¤Ï¡¢@code{INSERT} ¤Ç¼«Æ°Åª¤ËÀ¸À®¤µ¤ì¤ëID¤ÎÃͤòÆÀ¤ë¤³¤È¤Ç¤¹¡£
-ODBC¤Ç¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹( ÎãÃæ¤Î @code{auto} ¤¬ @code{AUTO_INCREMENT} ¥Õ¥£¡¼¥ë¥É¤Ç¤¹)¡§
-
-@example
-INSERT INTO foo (auto,text) VALUES(NULL,'text');
-SELECT LAST_INSERT_ID();
-@end example
-
-¤â¤·¤¯¤Ï¡¢Â¾¤Î¥Æ¡¼¥Ö¥ë¤ËID¤òÁÞÆþ¤¹¤ë¤À¤±¤Ê¤é°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-
-@example
-INSERT INTO foo (auto,text) VALUES(NULL,'text');
-INSERT INTO foo2 (id,text) VALUES(LAST_INSERT_ID(),'text');
-@end example
-
-¤¤¤¯¤Ä¤«¤ÎODBC¥¢¥×¥ê¥±¡¼¥·¥ç¥ó(¾¯¤Ê¤¯¤È¤âDelphi¤ÈAccess)¤Ï¡¢
-¿·¤·¤¯ÁÞÆþ¤µ¤ì¤¿¹Ô¤ò¸«¤Ä¤±¤ë¤Î¤Ë¡¢°Ê²¼¤Î¥¯¥¨¥ê¤¬»ÈÍѤǤ­¤Þ¤¹¡§
-@example
-SELECT * FROM tbl_name WHERE auto IS NULL;
-@end example
-
-@node MyODBC bug report, , ODBC and last_insert_id, ODBC
-@section Reporting problems with MyODBC
-
-¤â¤· @strong{MyODBC} »ÈÍÑ»þ¤ËÆñ¤·¤¤ÌäÂê¤Ë¤¢¤¿¤Ã¤¿¾ì¹ç¡¢
-ODBC ¥Þ¥Í¡¼¥¸¥ã¤Î¥í¥°¥Õ¥¡¥¤¥ë (ODBCADMIN ¤«¤é¥ê¥¯¥¨¥¹¥È¤·¤¿¤È¤­¤Î¥í¥°)
-¤È @strong{MyODBC} ¤Î¥í¥°¤ò¼è¤ê»Ï¤á¤ë¤Ù¤­¤Ç¤¹¡£
-¤³¤ì¤Ï¤¤¤«¤Ê¤ëÌäÂê¤Ë¤â²ò·è¤Î»å¸ý¤Ë¤Ê¤ë¤Ï¤º¤Ç¤¹¡£
-@strong{MyODBC} ¥í¥°¤ò¼è¤ë¤Ë¤Ï¡¢ @strong{MyODBC} connect/configure ²èÌ̤Î
- 'Trace MyODBC' ¥ª¥×¥·¥ç¥ó¤ò¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£
-¥í¥°¤Ï @file{C:\myodbc.log} ¤Ë½ñ¤­½Ð¤µ¤ì¤Þ¤¹¡£
-¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ¹¤ë¤ËÅö¤¿¤ê¡¢ @code{MYSQL2.DLL} ¤Ç¤Ï¤Ê¤¯¡¢
- @code{MYSQL.DLL} ¤ò»ÈÍѤ·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡ª
-
-MyODBC ¤¬ @strong{MySQL} ¥µ¡¼¥Ð¡¼¤ËÁ÷¤Ã¤Æ¤¤¤ë¥¯¥¨¥ê¤ò³Îǧ¤·¤Þ¤¹¡¨
-¤³¤ì¤Ï @file{myodbc.log} ¥Õ¥¡¥¤¥ëÃæ¤Ë¡¢@code{>mysql_real_query} ¤È
-¤¤¤¦Ê¸»úÎ󤬴ޤޤì¤Æ¤¤¤ë¹Ô¤Ç¤¹¡£
-
-¤Þ¤¿¡¢MyODBC ¤« @strong{MySQL} ¤Î¥¨¥é¡¼¤ò¸«¤Ä¤±¤ë¤¿¤á¤Ë¤Ï¡¢
-Ʊ¤¸¥³¥Þ¥ó¥É¤ò¡¢@code{mysql} ¥³¥Þ¥ó¥É¤ä @code{admndemo} ¤Ç¤â»î¤¹¤Ù¤­¤Ç¤¹¡£
-
-¤â¤·¡¢ÌäÂê¤òȯ¸«¤·¤¿¤Ê¤é¡¢´Ø·¸¤¹¤ë¹Ô¤ò¡ÊºÇÂç40¹Ô¡Ë @email{myodbc@@lists.mysql.com} ¤Ë
-Á÷¤Ã¤Æ¤¯¤À¤µ¤¤¡£ MyODBC ¤ä ODBC ¤Î¥í¥°¥Õ¥¡¥¤¥ëÁ´¤Æ¤òÁ÷¤é¤Ê¤¤¤è¤¦¤Ë
-¤·¤Æ¤¯¤À¤µ¤¤¡ª
-
-¤â¤·ÌäÂê¤ò¸«¤Ä¤±¤ë¤³¤È¤¬½ÐÍè¤Ê¤«¤Ã¤¿¾ì¹ç¡¢MyODBC ¥í¥°¥Õ¥¡¥¤¥ë¡¢
-ODBC ¥í¥°¥Õ¥¡¥¤¥ë¡¢ÌäÂê¤ÎÀâÌÀ¤¹¤ë README ¥Õ¥¡¥¤¥ë¤ò´Þ¤ó¤À
-¥¢¡¼¥«¥¤¥Ö(tar ¤« zip) ¤òºîÀ®¤·¤Þ¤¹¡£
-¤³¤ì¤ò @uref{ftp://www.mysql.com/pub/mysql/secret}. ¤ËÁ÷¤ê¤Þ¤¹¡£
-TCX ¤À¤±¤¬¡¢¥¢¥Ã¥×¥í¡¼¥É¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤¹¡£
-
-¤â¤·ÌäÂê¤ò¸«¤ë¤¿¤á¤Î¥×¥í¥°¥é¥à¤âºî¤Ã¤Æ¤¤¤ë¤Ê¤é¡¢¤½¤ì¤âƱ»þ¤ËÁ÷¤ê¤Þ¤¹¡£
-
-¤â¤·¤½¤Î¥×¥í¥°¥é¥à¤¬Â¾¤Î SQL ¥µ¡¼¥Ð¡¼¤ÇÆ°¤¯¤Ê¤é¡¢
-¾¤Î SQL ¥µ¡¼¥Ð¡¼¤ÇƱ¤¸¤³¤È¤ò¤·¤¿¾ì¹ç¤Î ODBC ¥í¥°¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤Ù¤­¤Ç¤¹¡£
-
-¿¤¯¤Î¾ðÊó¤ò¤¢¤Ê¤¿¤¬Ä󶡤¹¤ì¤Ð¡¢²æ¡¹¤ÏÌäÂê¤ò²ò·è¤·¤ä¤¹¤¯¤Ê¤ë¤³¤È¤ò
-ǰƬ¤Ë¤ª¤¤¤Æ¤¯¤À¤µ¤¤¡£
-
-@node Common programs, Problems, ODBC, Top
-@chapter ¤¤¤¯¤Ä¤«¤Î°ìÈÌŪ¤Ê¥×¥í¥°¥é¥à¤Ç¤Î @code{MySQL} ¤Î»ÈÍÑ
-
-@menu
-* Apache:: Apache ¤Ç¤Î MySQL ¤Î»ÈÍÑ
-@end menu
-
-@node Apache, , Common programs, Common programs
-@section Apache ¤Ç¤Î MySQL ¤Î»ÈÍÑ
-
-Contrib ¤Ë¤Ï¡¢
-@strong{MySQL} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÅÐÏ¿¤·¤Æ¤¤¤ë¥æ¡¼¥¶¡¼¤Ç
-ǧ¾Ú¤¬½ÐÍè¤ë¤è¤¦¤Ë¤Ê¤ë¥×¥í¥°¥é¥à¤È¡¢
-¥í¥°¤ò @strong{MySQL} ¥Æ¡¼¥Ö¥ë¤Ë½ñ¤­¹þ¤à¥×¥í¥°¥é¥à¤¬
-´Þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£ @xref{Contrib}.
-
-°Ê²¼¤Î¤è¤¦¤Ë Apache ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤Ëµ­½Ò¤¹¤ì¤Ð¡¢
-Apache ¤Î¥í¥°¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ò¡¢@code{MySQL} ¤ËÆɤߤ䤹¤¤Êª¤ËÊѹ¹¤Ç¤­¤Þ¤¹¡§
-
-@example
-LogFormat \
- "\"%h\",%@{%Y%m%d%H%M%S@}t,%>s,\"%b\",\"%@{Content-Type@}o\", \
- \"%U\",\"%@{Referer@}i\",\"%@{User-Agent@}i\""
-@end example
-
-¤³¤¦¤¹¤ì¤Ð¡¢@strong{MySQL} ¤Ç¡¢°Ê²¼¤Î¤è¤¦¤Ë¤Ç¤­¤Þ¤¹¡§
-
-@example
-LOAD DATA INFILE '/local/access_log' INTO TABLE table_name
-FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\'
-@end example
-
-@node Problems, Common problems, Common programs, Top
-@chapter ÌäÂê¤È¤è¤¯¤¢¤ë¥¨¥é¡¼
-
-@menu
-* What is crashing:: How to determinate what is causing problems
-* Crashing:: What to do if @strong{MySQL} keeps crashing
-* Common errors:: Some common errors when using @strong{MySQL}
-* Full disk:: How @strong{MySQL} handles a full disk
-* Multiple sql commands:: How to run SQL commands from a text file
-* Temporary files:: Where @strong{MySQL} stores temporary files
-* Problems with mysql.sock:: How to protect @file{/tmp/mysql.sock}
-* Error Access denied:: @code{Access denied} error
-* Changing MySQL user :: How to run @strong{MySQL} as a normal user
-* Resetting permissions:: How to reset a forgotten password.
-* File permissions :: Problems with file permissions
-* Not enough file handles:: File not found
-* Using DATE:: Problems using @code{DATE} columns
-* Timezone problems:: Timezone problems
-* Case sensitivity:: Case sensitivity in searches
-* Problems with NULL:: Problems with @code{NULL} values
-* Problems with alias:: Problems with @code{alias}
-* Deleting from related tables:: Deleting rows from related tables
-* No matching rows:: Solving problems with no matching rows
-* ALTER TABLE problems:: Problems with @code{ALTER TABLE}.
-* Change column order:: How to change the order of columns in a table
-@end menu
-
-@menu
-* Crashing:: What to do if @strong{MySQL} keeps crashing
-@end menu
-
-@node What is crashing, Crashing, Problems, Problems
-@section How to determinate what is causing problems
-
-When you run into problems, the first thing you should do is to find out
-which program / piece of equipment is causing problems.
-
-@itemize @bullet
-@item
-If you have one of the following symptoms, then it is probably a hardware
-(like memory, motherboard, CPU, or harddisk) or kernel problem:
-@itemize @bullet
-@item
-The keyboard doesn't work. This can normally be checked by pressing
-Caps Lock; If the Caps Lock light doesn't change you have to replace
-your keyboard. (Before doing this, you should however try to reboot
-your computer and check all cables to the keyboard :)
-@item
-The mouse pointer doesn't move.
-@item
-The machine doesn't answer to a remote machine's pings.
-@item
-Different, unrelated programs don't behave correctly.
-@item
-If your system rebooted unexpectedly (a faulty user level program should
-NEVER be able to take down your system).
-@end itemize
-
-In this case you should start by checking all your cables and run some
-diagnostic tool to check your hardware!
-You should also check if there are any patches, updates or service
-packs for your operating system that could likely solve your problems.
-Check also that all your libraries (like glibc) are up to date.
-
-It's always good to use a machine with ECC memory to discover
-memory problems early!
-@item
-If your keyboard is locked up, you may be able to fix this by
-logging into your machine from another machine and execute
-@code{kbd_mode -a} on it.
-
-@item
-Please examine your system log file, (/var/log/messages or similar) for
-reasons for your problems. If you think the problem is in @strong{MySQL}
-then you should also examine @strong{MySQL}'s log files. @xref{Update log}.
-
-@item
-If you don't think you have hardware problems, you should try to find
-out which program is causing problems.
-
-Try using @code{top}, @code{ps}, @code{taskmanager} or some similar program,
-to check which program is taking all CPU, or is locking the machine.
-
-@item
-Check with @code{top}, @code{df} or a similar programs if you are out of
-memory, disk space, open files or some other critical resource.
-
-@item
-If the problem is some runaway process, you can always try to kill if. If it
-doesn't want to die, this is probably a bug in the operating system.
-@end itemize
-
-If after you have examined all other possibilities and you have
-concluded that its the @strong{MySQL} server or a @strong{MySQL} client
-that is causing the problem, it's time to do a bug report for our
-mailing list or our support team. In the bug report, try to describe
-very detailed how the system is behaving and what you think is
-happening. You should also state why you think it's @strong{MySQL} that
-is causing the problems. Take in consideration all the situations in
-this chapter. State any problems exactly how they appear when you
-examine your system.. Use the 'cut and paste' method for any output
-and/or error messages from programs and/or log files!
-
-Try to describe very detailed which program is not working and all
-symptoms you see! We have in the past got many bug reports that just
-states "the system doesn't work". This doesn't provide us with any
-information of what could be the problem.
-
-If a program fails, it's always useful to know:
-
-@itemize @bullet
-@item
-Has the program in question made a segmentation fault (core dumped)?
-@item
-Is the program taking the whole CPU? Check with @code{top}. Let the
-program run for a while, it may be evaluating something heavy.
-@item
-If it's the @code{mysqld} server that is causing problems; Can you
-do @code{mysqladmin -u root ping}, or @code{mysqladmin -u root processlist}?
-@item
-What does a client program say (try with @code{mysql} for example)
-when you try to connect to the @strong{MySQL} server?
-Does the client jam? Do you get any output from the program?
-@end itemize
-
-When send a bug report, you should of course follow the outlines
-described in this manual. @xref{Asking questions}.
-
-@node Crashing, Common errors, What is crashing, Problems
-@subsection @strong{MySQL} ¤¬¥¯¥é¥Ã¥·¥å¤¹¤ë¾ì¹ç¤Ë¹Ô¤¦¤³¤È
-
-Á´¤Æ¤Î @strong{MySQL} ¥Ð¡¼¥¸¥ç¥ó¤Ï¥ê¥ê¡¼¥¹¤ÎÁ°¤Ë¿¤¯¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤Ç
-¥Æ¥¹¥È¤µ¤ì¤Þ¤¹¡£ ¤³¤ì¤Ï @strong{MySQL} ¤Ë¤¤¤«¤Ê¤ë¥Ð¥°¤â¤Ê¤¤¤È¤¤¤¦¤³¤È¤ò
-°ÕÌ£¤·¤Þ¤¹¤¬¡¢È¯¸«¤¹¤ë¤Î¤¬º¤Æñ¤Ç¡¢¤ï¤º¤«¤Ê¥Ð¥°¤¬¤¢¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-¤â¤·ÌäÂ꤬¤¢¤Ã¤¿¾ì¹ç¡¢²¿¤¬¥·¥¹¥Æ¥à¤ò¥¯¥é¥Ã¥·¥å¤·¤Æ¤¤¤ë¤«¤ò¸«¤Ä¤±¤è¤¦¤È¤¹¤ë»ö¤Ï¡¢
-ÌäÂê¤òÁ᤯½¤Àµ¤¹¤ë¤¿¤á¤Î¤è¤êÎɤ¤µ¡²ñ¤Ç¤â¤¢¤ê¤Þ¤¹¡£
-
-¤Þ¤ººÇ½é¤Ë, ¤½¤ÎÌäÂê¤Ç @code{mysqld} ¥Ç¡¼¥â¥ó¤¬»à¤Ê¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤«¤É¤¦¤«¤«, ¤Þ¤¿
-¤Ï¤½¤ÎÌäÂ꤬¥¯¥é¥¤¥¢¥ó¥È¤Ç½èÍý¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¤Ù¤­¤Ç¤¹¡£
-@code{mysqladmin version} ¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢ @code{mysqld} ¥µ¡¼¥Ð¡¼¤¬
-¤É¤ì¤°¤é¤¤²ÔƯ¤·¤Æ¤¤¤¿¤«¤ï¤«¤ê¤Þ¤¹¡£ ¤â¤· @code{mysqld} ¤¬»à¤ó¤Ç¤¤¤¿¤Ê¤é¡¢
-¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ë¤è¤Ã¤Æ¤¢¤ë¤Î¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹. mysqld¤¬»à¤ó¤À¤Ê¤é¡¢
-¤½¤Î¸¶°ø¤ò @file{mysql-data-directory/'hostname'.err} ¤Ç¸«¤Ä¤±¤ì¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-
-Many crashes of @strong{MySQL} is caused by corrupted index / data
-files. @strong{MySQL} will update the data on disk, with the
-@code{write()} system call, after every SQL statement and before the
-client is notified about the result (this is not true if you are running
-with @code{delayed_key_writes}, in which case only the data is written).
-This means that the data is safe even if mysqld crashes as the OS will
-ensure that the not flushed data is written to disk.
-You can force @strong{MySQL} to sync everything to disk by starting
-@code{mysqld} with @code{--flush}.
-
-The above means that normally you shouldn't get corrupted tables unless:
-
-@itemize @bullet
-@item
-Someone/something killed @code{mysqld} or the machine in the middle
-of an update.
-@item
-You have found a bug in @code{mysqld} that caused it to die in the
-middle of an update.
-@item
-Someone is manipulating the data/index files outside of @strong{mysqld}
-without locking the table properly.
-@item
-If you are running many @code{mysqld} servers on the same data on a
-system that doesn't support good file system locks (normally handled by
-the @code{lockd} deamon.) or if you are running
-multiple servers with @code{--skip-locking}
-@item
-You have a crashed index/data file that contains very wrong data that
-got mysqld confused.
-@item
-You have found a bug in the data storage code. This isn't that likely,
-but it's at least possible. In this case you can try to change the file
-type to another database handler by using @code{ALTER TABLE} on a
-repaired copy of the table!
-@end itemize
-
-²¿¤«¤¬¥¯¥é¥Ã¥·¥å¤¹¤ëÍýͳ¤òÃΤë¤Î¤ÏÈó¾ï¤ËÆñ¤·¤¤¤Î¤Ç¡¢¤Þ¤º¡¢Â¾¤Î¿Í¤ÇÆ°¤¯¤â
-¤Î¤¬¤¢¤Ê¤¿¤Ç¥¯¥é¥Ã¥·¥å¤¹¤ë¤Î¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£¼¡¤Î¤³¤È¤ò¹Ô¤Ã
-¤Æ¤¯¤À¤µ¤¤¡£
-
-@itemize @bullet
-@item
-@code{mysqld} ¥Ç¡¼¥â¥ó¤ò @code{mysqladmin shutdown} ¤ÇÄä»ß¤·, Á´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤Ç
-@code{myisamchk --silent --force */*.MYI} ¤ò¼Â¹Ô¤·¡¢¤½¤·¤Æ @code{mysqld} ¥Ç¡¼¥â¥ó¤ò
-ºÆµ¯Æ°¤·¤Þ¤¹. ¤³¤ì¤Ï¤­¤ì¤¤¤Ê¾õÂÖ¤«¤é³«»Ï¤¹¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
-@xref{Maintenance}.
-
-@item
-@code{mysqld --log} ¤ò»ÈÍѤ·¡¢¥í¥°¤Î¾ðÊ󤫤éÆÃÄê¤Î¥¯¥¨¥ê¤¬¥µ¡¼¥Ð¡¼¤ò¥­¥ë¤·¤Æ¤¤¤ë¤«¤ò
-¸«¤Ä¤±½Ð¤·¤Æ¤¯¤À¤µ¤¤¡£ 95% ¤Î¥Ð¥°¤ÏÆÃÄê¤Î¥¯¥¨¥ê¤Ë´Ø·¸¤¬¤¢¤ê¤Þ¤¹¡ª
-Ä̾盧¤ì¤Ï¡¢ @strong{MySQL} ¤¬ºÆµ¯Æ°¤µ¤ì¤ëÁ°¤Î¡¢¥í¥°¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Î¥¯¥¨¥ê¤Î°ì¤Ä¤Ç¤¹¡£
-
-¤³¤ì¤ò¡¢°Ê²¼¤Î¼ê½ç¤Ç³Îǧ¤¹¤ë¤³¤È¤â½ÐÍè¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-@strong{MySQL} ¥Ç¡¼¥â¥ó¤ò ( @code{mysqladmin shutdown} ¤Ç) Ää»ß¡£
-@item
-@strong{MySQL} ¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤ò¥Ð¥Ã¥¯¥¢¥Ã¥×¡£
-(As the server is stopped, you can just copy the files to some other
-directory)
-@item
-Á´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤¬Àµ¤·¤¤¤Î¤«¤ò¡¢@code{myisamchk -s */*.MYI} ¤Ç¥Á¥§¥Ã¥¯¡£
-¤â¤·¥Æ¡¼¥Ö¥ë¤¬²õ¤ì¤Æ¤¤¤ë¤è¤¦¤Ê¤é¡¢
-@code{myisamchk -r path-to-table.MYI} ¤Ç¤½¤ì¤ò½¤Àµ¡£
-You should take the backup
-before checking the tables as the problem could be related to corrupted
-tables.
-@item
-¥í¥°¥Õ¥¡¥¤¥ë¤ò @strong{MySQL} ¥Ç¡¼¥¿¥Ç¥£¥ì¥¯¥È¥ê¤«¤éºï½ü (¤« °ÜÆ°)¡£
-@item
-@code{safe_mysqld --log-update} ¤« @code{safe_mysql --log --log-update} ¤Ç¥µ¡¼¥Ð¡¼µ¯Æ°¡£
-@item
-If @code{mysqld} now dies, you have two options:
-@itemize @bullet
-@item
-First take a backup of your backup database. (Just copy the file(s)
-somewhere again). This is because we want to keep the original start
-situation untouched. Start a mysqld process on the other backup database
-(you can do this with option @code{--datadir=/path/to/backup/}).
-@item
-Just restore the backup on your original database and restart @code{mysqld}.
-You will not any lose information, because you have the @code{log-update} file.
-@end itemize
-@item
-
-Now you can test if the problem is a specific update statement by executing
-@code{mysql database_name < path-to-log-update-file}.
-
-You can also use the script @code{mysql_find_rows} to just execute some of the
-update statements if you want to narrow down the problem.
-
-If mysqld now crashes, then you have something repeatable
-available. Please mail @email{bugs@@lists.mysql.com}, or
-@email{developers@@mysql.com}, or (if you are a support customer) to
-@email{support@@mysql.com} about the problem and the @strong{MySQL} team
-will fix it as soon as possible.
-@end itemize
-
-@item
-¥Ù¥ó¥Á¥Þ¡¼¥¯¤ò»î¤·¤Þ¤·¤¿¤«¡© ¤³¤ì¤Ï @strong{MySQL} ¤ò¤è¤êÎɤ¯¥Æ¥¹¥È¤·¤Þ
-¤¹¡£¤¢¤Ê¤¿¤Î¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò¥·¥ß¥å¥ì¡¼¥È¤¹¤ë¥³¡¼¥É¤òÄɲ乤뤳¤È¤â¤Ç¤­
-¤Þ¤¹¡£¥Ù¥ó¥Á¥Þ¡¼¥¯¤Ï¥½¡¼¥¹ÇÛÉÛ¤Ç¤Ï @strong{MySQL} ¥¤¥ó¥¹¥È¡¼¥ë¥Ç¥£¥ì¥¯¥È
-¥êÇÛ²¼¤Î @file{bench} ¥Ç¥£¥ì¥¯¥È¥ê¤Ë¡¢¥Ð¥¤¥Ê¥êÇÛÉÛ¤Ç¤Ï @file{sql-bench}
-¥Ç¥£¥ì¥¯¥È¥ê¤Ë¸«¤Ä¤±¤é¤ì¤Þ¤¹¡£
-
-@item
-@code{fork_test.pl} ¤È @code{fork2_test.pl} ¤ò»î¤·¤Þ¤¹¡£
-
-@item
-¥¨¥é¡¼¤¬¤Ê¤¤¤«¡¢@file{mysql-data-directory/'hostname'.err} ¥Õ¥¡¥¤¥ë¤ò³Îǧ¤·¤Þ¤¹¡£
-
-@item
-¥Ç¥Ð¥Ã¥°ÍÑ¤Ë @strong{MySQL} ¤ò¥³¥ó¥Õ¥£¥°¤¹¤ë¤È¡¢²¿¤«¤¬°­¤¯¤Ê¤ë¾ì¹ç¤Ë¥¨¥é¡¼
-¤ò¸«¤Ä¤±½Ð¤¹¤Î¤¬¤è¤ê´Êñ¤Ë¤Ê¤ê¤Þ¤¹¡£@code{configure} ¤Ë
-@code{--with-debug} ¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤Æ @strong{MySQL} ¤òºÆ¥³¥ó¥Õ¥£¥°¤·¡¢
-ºÆ¥³¥ó¥Ñ¥¤¥ë¤·¤Æ¤¯¤À¤µ¤¤¡£@xref{Debugging server}.
-
-@item
-¥Ç¥Ð¥Ã¥°ÍÑ¤Ë @strong{MySQL} ¤ò¥³¥ó¥Õ¥£¥°¤¹¤ë¤È¡¢¤¤¤¯¤Ä¤«¤Î¥¨¥é¡¼¤ò¸¡½Ð¤Ç
-¤­¤ë°ÂÁ´¤Ê¥á¥â¥ê³ä¤êÅö¤Æ¤ò´Þ¤á¤Þ¤¹¡£¤³¤ì¤Ï²¿¤¬µ¯¤­¤Æ¤¤¤ë¤«¤Ë¤Ä¤¤¤Æ¤Î¿¤¯
-¤Î½ÐÎϤâÄ󶡤·¤Þ¤¹¡£
-
-@item
-¤¢¤Ê¤¿¤Î OS ¤ÎºÇ¿·¤Î¥Ñ¥Ã¥Á¤òŬÍѤ·¤Þ¤·¤¿¤«¡©
-
-@item
-@code{--skip-locking} ¥ª¥×¥·¥ç¥ó¤ò @code{mysqld} ¤Ë»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£¤¤
-¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¾å¤Ç¤Ï¡¢@code{lockd} ¥í¥Ã¥¯¥Þ¥Í¡¼¥¸¥ã¤ÏÀµ¤·¤¯Æ°¤­¤Þ¤»¤ó;
-@code{--skip-locking} ¥ª¥×¥·¥ç¥ó¤Ï @code{mysqld} ¤Ë³°Éô¥í¥Ã¥­¥ó¥°¤ò»ÈÍÑ
-¤·¤Ê¤¤¤è¤¦¤ËÅÁ¤¨¤Þ¤¹¡£(¤³¤ì¤ÏƱ¤¸¥Ç¡¼¥¿¾å¤Ç2¤Ä¤Î @code{mysqld} ¥µ¡¼¥Ð¤ò
-Æ°¤¹¤³¤È¤¬¤Ç¤­¤º¡¢@code{myisamchk} ¤Î»ÈÍÑ»þ¤ËÃí°Õ¤·¤Ê¤±¤ì¤Ð¤¤¤±¤Ê¤¤¤³¤È¤ò
-°ÕÌ£¤·¤Þ¤¹¡£¤·¤«¤·¡¢¥Æ¥¹¥È¤È¤·¤Æ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»î¤¹¤³¤È¤Ï»Ø¼¨¤Ç¤­¤Þ¤¹¡£)
-
-@item
-@code{mysqld} ¤¬Æ°¤¤¤Æ¤¤¤ë¤Î¤Ë±þÅú¤¬¤Ê¤¤¤è¤¦¤Ë¸«¤¨¤¿»þ
-@code{mysqladmin -u root processlist} ¤ò»î¤·¤Þ¤·¤¿¤«¡© »þ¡¹
-@code{mysqld} ¤Ï¤½¤¦»×¤¨¤Æ¤â»à¤ó¤Ç¤¤¤Þ¤»¤ó¡£ÌäÂê¤ÏÁ´¤Æ¤ÎÀܳ¤¬»ÈÍÑÃæ¤Ç¤¢
-¤ë¤³¤È¤«¡¢¤¤¤¯¤Ä¤«¤ÎÆâÉô¥í¥Ã¥¯ÌäÂ꤬¤¢¤ë¤³¤È¤Ç¤¹¡£@code{mysqladmin
-processlist} ¤ÏÄ̾盧¤ì¤é¤Î¾ì¹ç¤Ç¤âÀܳ¤òºî¤ë¤³¤È¤¬¤Ç¤­¡¢¸½ºß¤ÎÀܳ¿ô¤È
-¤½¤ì¤é¤Î¾õÂ֤ˤĤ¤¤Æ¤ÎÍ­ÍѤʾðÊó¤òÄ󶡤Ǥ­¤Þ¤¹¡£
-
-@item
-Ê̤Υ¦¥£¥ó¥É¥¦¤Ç¡¢Åý·×½ÐÎϤΤ¿¤á¤Ë¥³¥Þ¥ó¥É @code{mysqladmin -i 5 status}
-¤ò¥¯¥¨¥êÃæ¡¢¹Ô¤Ã¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-¼¡¤ò»î¤·¤Æ¤¯¤À¤µ¤¤:
-@enumerate
-@item
-@code{gdb} (¤Þ¤¿¤Ï¾¤Î¥Ç¥Ð¥Ã¥¬) ¤«¤é @code{mysqld} ¤ò³«»Ï¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-¤¢¤Ê¤¿¤Î¥Æ¥¹¥È¥¹¥¯¥ê¥×¥È¤ò¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-Print the backtrace and the local variables at the 3 lowest levels. In gdb you
-can do this with the following commands when @code{mysqld} has crashed inside
-gdb:
-
-@example
-backtrace
-info local
-up
-info local
-up
-info local
-@end example
-
-With gdb you can also examine which threads there exists with @code{info
-threads} and switch to a specific thread with @code{thread #}, where
-@code{#} is the thread id.
-@end enumerate
-
-@item
-@strong{MySQL} ¤Ë¥¯¥é¥Ã¥·¥å¤Þ¤¿¤Ï´Ö°ã¤Ã¤¿¿¶¤ëÉñ¤¤¤ò¤µ¤»¤ë¤¢¤Ê¤¿¤Î¥¢¥×¥ê
-¥±¡¼¥·¥ç¥ó¤Î¥·¥ß¥å¥ì¡¼¥È¤ò Perl ¥¹¥¯¥ê¥×¥È¤Ç»î¤ß¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-¤Þ¤¿¤ÏÄ̾ï¤Î¥Ð¥°¥ì¥Ý¡¼¥È¤òÁ÷¤Ã¤Æ¤¯¤À¤µ¤¤¡£@xref{Bug reports}¡£¤·¤«¤·Ä̾ï
-¤è¤ê¤â¤µ¤é¤Ë¾ÜºÙ¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£@strong{MySQL} ¤Ï¿¤¯¤Î¿Í¤Î¤¿¤á¤ËƯ¤¤¤Æ
-¤¤¤ë¤¿¤á¡¢¥¯¥é¥Ã¥·¥å¤Ï¤¢¤Ê¤¿¤Î¥³¥ó¥Ô¥å¡¼¥¿¤À¤±¤Ë¸ºß¤¹¤ë²¿¤«(Î㤨¤Ð¡¢¤¢
-¤Ê¤¿¤ÎÆÃÊ̤ʥ·¥¹¥Æ¥à¥é¥¤¥Ö¥é¥ê¤Ë´ØÏ¢¤·¤¿¥¨¥é¡¼)¤«¤éÀ¸¤¸¤Æ¤¤¤ë¤È»×¤ï¤ì¤Þ
-¤¹¡£
-@item
-¤â¤·²ÄÊÑĹ¤Î¥ì¥³¡¼¥É¤ò°·¤¦¥Æ¡¼¥Ö¥ë¤ÇÌäÂ꤬¤¢¤Ã¤¿¾ì¹ç¡¢
-¤â¤·¡¢@code{BLOB/TEXT} ¥Õ¥£¡¼¥ë¥É¤Ï»ÈÍѤ·¤Æ¤ª¤é¤º¡¢@code{VARCHAR} ¥Õ¥£¡¼¥ë¥É
-¤À¤±»ÈÍѤ·¤Æ¤¤¤ë¤Ê¤é¡¢Á´¤Æ¤Î @code{VARCHAR} ¥Õ¥£¡¼¥ë¥É¤ò
- @code{ALTER TABLE} ¤Ç @code{CHAR} ¤ËÊѹ¹¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
-¤³¤ì¤Ï @strong{MySQL} ¤Ë¸ÇÄêĹ¥ì¥³¡¼¥É¤ò»ÈÍѤµ¤»¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
-¸ÇÄêĹ¥ì¥³¡¼¥É¤Ï¾¯¤·Í¾Ê¬¤ÊÎΰè¤ò¤È¤ê¤Þ¤¹¤¬¡¢¤è¤ê¥¨¥é¡¼¤ËÂФ·¤Æ
-¶¯¤¯¤Ê¤ê¤Þ¤¹¡£
-
-¸½ºß¤Î²ÄÊÑĹ¤Î¥ì¥³¡¼¥É¤Î¥³¡¼¥É¤Ï TCX ¤Ç¾¯¤Ê¤¯¤È¤â£³Ç¯°Ê¾åÌäÂê¤Ê¤¯
-»ÈÍѤµ¤ì¤Æ¤¤¤Þ¤¹¡£ ¤·¤«¤·²ÄÊÑĹ¤Î¥ì¥³¡¼¥É¤Ï¤è¤ê¥¨¥é¡¼¤Î·¹¸þ¤¬¤¢¤ê¡¢
-¾åµ­¤Î»öÊÁ¤ò»î¤¹¤³¤È¤ÏÎɤ¤¥¢¥¤¥Ç¥¢¤Ç¤¹¡ª
-@end itemize
-
-@node Common errors, Full disk, Crashing, Problems
-@section @strong{MySQL}»ÈÍÑ»þ¤Î¤è¤¯¤¢¤ë¤¤¤¯¤Ä¤«¤Î¥¨¥é¡¼
-
-@menu
-* Gone away:: @code{MySQL server has gone away} error
-* Can not connect to server:: @code{Can't connect to [local] MySQL server} error
-* Blocked host:: @code{Host '...' is blocked} error
-* Too many connections:: @code{Too many connections} error
-* Out of memory:: @code{Out of memory} error
-* Packet too large:: @code{Packet too large} error
-* Full table:: @code{The table is full} error
-* Commands out of sync:: @code{Commands out of sync} error in client
-* Ignoring user:: @code{Ignoring user} error
-* Cannot find table:: @code{Table 'xxx' doesn't exist} error
-@end menu
-
-@node Gone away, Can not connect to server, Common errors, Common errors
-@subsection @code{MySQL server has gone away} ¥¨¥é¡¼
-
-¤³¤Î¥»¥¯¥·¥ç¥ó¤Ï @code{Lost connection to server
-during query} ¥¨¥é¡¼¤Ë´Ø¤¹¤ë¤³¤È¤â¥«¥Ð¡¼¤·¤Þ¤¹¡£
-
-@code{MySQL server has gone away} ¥¨¥é¡¼¤Î¤â¤Ã¤È¤â°ìÈÌŪ¤ÊÍýͳ¤Ï¡¢¥µ¡¼¥Ð
-¤¬¥¿¥¤¥à¥¢¥¦¥È¤ÇÀܳ¤ò¥¯¥í¡¼¥º¤·¤¿¤³¤È¤Ç¤¹¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢²¿¤âµ¯¤­¤Ê¤¤
-¾ì¹ç¡¢¥µ¡¼¥Ð¤Ï 8 »þ´Ö¸å¤ËÀܳ¤ò¥¯¥í¡¼¥º¤·¤Þ¤¹¡£
-¤³¤Î»þ´Ö¤Ï mysqld µ¯Æ°»þ¤Î @code{wait_timeout} ÊÑ¿ô¤ËÍ¿¤¨¤ë¤³¤È¤Ë¤è¤ê¡¢Êѹ¹¤Ç¤­¤Þ¤¹¡£
-
-@code{mysqladmin version} ¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ç @strong{MySQL} ¤¬»à¤ó¤Ç¤¤¤ë¤«¤É¤¦¤«¡¢
-¤Þ¤¿ uptime ¤Ï¤É¤ì¤°¤é¤¤¤«¡¢¥Á¥§¥Ã¥¯¤Ç¤­¤Þ¤¹¡£
-
-¥¹¥¯¥ê¥×¥È¤Î¾ì¹ç¤Ï¡¢¼«Æ°Åª¤ËºÆÀܳ¤¹¤ë¤¿¤á¤Ë¥¯¥é¥¤¥¢¥ó¥È¤«¤é¥¯¥¨¥ê¤òºÆȯ
-¹Ô¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-¤³¤Î¾ì¹ç¡¢Ä̾盧¤ì¤é¤Î¥¨¥é¡¼¥³¡¼¥É¤òÆÀ¤Þ¤¹:
-(OS °Í¸¤Ç¤¹):
-
-@multitable @columnfractions .3 .7
-@item @code{CR_SERVER_GONE_ERROR} @tab ¥¯¥é¥¤¥¢¥ó¥È¤¬¥µ¡¼¥Ð¡¼¤ËÌ䤤¹ç¤ï¤»¤òÁ÷¤ë¤³¤È¤¬¤Ç¤­¤Ê¤«¤Ã¤¿
-@item @code{CR_SERVER_LOST} @tab ¥¯¥é¥¤¥¢¥ó¥È¤¬¥µ¡¼¥Ð¡¼¤Ë½ñ¤­¹þ¤ß¤ò¹Ô¤Ã¤¿¤È¤­¤Ë¤Ï¥¨¥é¡¼¤Ï̵¤«¤Ã¤¿¤±¤ì¤É¤â¡¢Ì䤤¹ç¤ï¤»¤ËÂФ·¤Æ´°Á´¤Ë²óÅú¤¬Ê֤äƤ³¤Ê¤¤
-@end multitable
-
-´Ö°ã¤Ã¤Æ¤¤¤ë¤«Â礭¤¹¤®¤ë¥¯¥¨¥ê¤ò¥µ¡¼¥Ð¤ËÁ÷¤Ã¤¿¾ì¹ç¤Ë¤â¤³¤Î¥¨¥é¡¼¤¬È¯À¸¤·
-¤Þ¤¹¡£@code{mysqld} ¤¬´Ö°ã¤Ã¤¿¥Ö¥í¥Ã¥¯¤òÆÀ¤¿¾ì¹ç¡¢¥¯¥é¥¤¥¢¥ó¥È¤Î²¿¤«¤¬´Ö°ã¤Ã¤¿
-¤È¸«¤Ê¤·¡¢Àܳ¤ò¥¯¥í¡¼¥º¤·¤Þ¤¹¡£Â礭¤Ê¥¯¥¨¥ê¤¬É¬Íפʾì¹ç¡¢Î㤨¤ÐÂ礭¤Ê
-@code{BLOB} ¤ÇƯ¤«¤»¤ë¾ì¹ç¤Ï¡¢@code{mysqld} ¤ò¥ª¥×¥·¥ç¥ó @code{-O max_query_size=#}
-(¥Ç¥Õ¥©¥ë¥È 1M) ¤Çµ¯Æ°¤¹¤ë¤³¤È¤Ç¥¯¥¨¥êÀ©¸Â¤òÁý²Ã¤Ç¤­¤Þ¤¹¡£³ÈÄ¥¥á¥â¥ê
-¤ÏÍ×µá¤Ë¤è¤Ã¤Æ³ä¤êÅö¤Æ¤é¤ì¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢@code{mysqld} ¤ÏÂ礭¤Ê¥¯¥¨¥ê¤òȯ¹Ô¤·
-¤¿»þ¤äÂ礭¤Ê·ë²Ì¹Ô¤òÊÖ¤¹É¬ÍפΤ¢¤ë»þ¤À¤±¡¢Â¿¤¯¤Î¥á¥â¥ê¤ò»ÈÍѤ·¤Þ¤¹¡ª
-
-
-@node Can not connect to server, Blocked host, Gone away, Common errors
-@subsection @code{Can't connect to [local] MySQL server} ¥¨¥é¡¼
-
-UNIX ¾å¤Î @strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¤Ï @code{mysqld} ¥µ¡¼¥Ð¤Ë2¤Ä¤Î°Û¤Ê¤ëÊýË¡¤ÇÀܳ¤Ç¤­¤Þ
-¤¹: Unix ¥½¥±¥Ã¥È, ¤³¤ì¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¾å¤Î¥Õ¥¡¥¤¥ë(¥Ç¥Õ¥©¥ë¥È
-@file{/tmp/mysql.sock})¤òÄ̤·¤ÆÀܳ¤·¤Þ¤¹¡£¤Þ¤¿¤Ï TCP/IP, ¤³¤ì¤Ï¥Ý¡¼¥ÈÈÖ
-¹æ¤òÄ̤·¤ÆÀܳ¤·¤Þ¤¹¡£Unix ¥½¥±¥Ã¥È¤Ï TCP/IP ¤è¤ê¤â®¤¤¤Ç¤¹¤¬¡¢¥µ¡¼¥Ð¤È
-Ʊ¤¸¥³¥ó¥Ô¥å¡¼¥¿¤«¤éÀܳ¤¹¤ë»þ¤·¤«»È¤¨¤Þ¤»¤ó¡£Unix ¥½¥±¥Ã¥È¤Ï¡¢¥Û¥¹¥È̾
-¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¤«¡¢ÆÃÊ̤ʥۥ¹¥È̾ @code{localhost} ¤ò»ØÄꤷ¤¿¾ì¹ç¤Ë»ÈÍѤµ¤ì
-¤Þ¤¹¡£
-
-On Windows you can connect only with TCP/IP if the @code{mysqld} server
-is running on Win95/Win98. If it's running on NT, you can also connect
-with named pipes. The name of the named pipe is @code{MySQL}. If you
-don't give a hostname when connecting to @code{mysqld}, a @strong{MySQL} client
-will first try to connect to the named pipe and if this doesn't work it
-will connect to the TCP/IP port. You can force the use of named pipes
-on Windows by using @code{.} as the hostname.
-
-(2002) @code{Can't connect to ...} ¥¨¥é¡¼¤Ï¡¢Ä̾@strong{MySQL} ¥µ¡¼¥Ð¡¼¤¬
-¥·¥¹¥Æ¥à¾å¤ËÁö¤Ã¤Æ¤¤¤Ê¤¤¤«¡¢¤¢¤Ê¤¿¤¬¡¢´Ö°ã¤Ã¤¿¥½¥±¥Ã¥È¥Õ¥¡¥¤¥ë¤ä
-TCP/IP ¥Ý¡¼¥È¤ò»ÈÍѤ·¤Æ @code{mysqld} ¤ËÀܳ¤·¤è¤¦¤È¤¹¤ë¾ì¹ç¤Ë¤ª¤­¤Þ¤¹¡£
-
-Start by check
-¥µ¡¼¥Ð¡¼¾å¤Ë @code{mysqld} ¤È¤¤¤¦¥×¥í¥»¥¹¤¬Áö¤Ã¤Æ¤¤¤ë¤« ( @code{ps} ¤ò»ÈÍѤ·¤Æ¡£ Windows ¤Î¾ì¹ç¤Ï¥¿¥¹¥¯¥Þ¥Í¡¼¥¸¥ã¤Ç¤ß¤Æ)
-³Îǧ¤¹¤ë¤³¤È¤«¤é³«»Ï¤·¤Æ¤¯¤À¤µ¤¤¡ª
-@xref{Starting server}.
-
-@code{mysqld} ¥×¥í¥»¥¹¤¬Áö¤Ã¤Æ¤¤¤ë¤Ê¤é¡¢°ã¤¦Àܳ¤ò»î¤¹¤³¤È¤Ç¥µ¡¼¥Ð¡¼¤ò
-³Îǧ¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡Ê¤â¤Á¤í¤ó¡¢¥Ý¡¼¥ÈÈÖ¹æ¤È¥½¥±¥Ã¥È¤Î¥Ñ¥¹¤Ï¤¢¤Ê¤¿¤¬
-¥»¥Ã¥È¥¢¥Ã¥×¤·¤¿¤â¤Î¤È¤Ï°ã¤¦¤Ç¤·¤ç¤¦¡Ë¡§
-
-@example
-shell> mysqladmin version
-shell> mysqladmin variables
-shell> mysqladmin -h `hostname` version variables
-shell> mysqladmin -h `hostname` --port=3306 version
-shell> mysqladmin -h 'ip for your host' version
-shell> mysqladmin --socket=/tmp/mysql.sock version
-@end example
-
-@code{hostname} ¥³¥Þ¥ó¥É¤Ï¥Õ¥©¥ï¡¼¥É¥¯¥ª¡¼¥È¤Ç¤Ê¤¯¥Ð¥Ã¥¯¥¯¥ª¥Æ¡¼¥·¥ç¥ó¤Ç
-°Ï¤ó¤Ç¤¤¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡¨ ¤³¤ì¤Ï @code{¥Û¥¹¥È̾} (¥«¥ì¥ó¥È¤Î¥Û¥¹¥È̾)
-¤ò @code{mysqladmin} ¥³¥Þ¥ó¥É¤ËÍ¿¤¨¤Þ¤¹¡£
-
-@code{Can't connect to local MySQL server} ¥¨¥é¡¼¤¬µ¯¤³¤ê¤¦¤ëÍýͳ¤È¤·¤Æ¡§
-
-@itemize @bullet
-@item @code{mysqld} is not running.
-@item MIT-pthreads ¤ò»ÈÍѤ¹¤ë¥·¥¹¥Æ¥à¾å¤Ç¼Â¹Ô¤·¤Æ¤¤¤ë¡£
-¥Í¥¤¥Æ¥£¥Ö¥¹¥ì¥Ã¥É¤ò»ý¤¿¤Ê¤¤¥·¥¹¥Æ¥à¾å¤Ç¼Â¹Ô¤·¤Æ¤¤¤ë¾ì¹ç @code{mysqld} ¤Ï MIT-pthreads ¥Ñ¥Ã¥±¡¼¥¸¤ò»ÈÍѤ·¤Þ¤¹¡£
-@xref{Which OS}.
-MIT-pthreads ¥¹¥ì¥Ã¥É¤Ï¥½¥±¥Ã¥È¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤»¤ó¡£
-¤½¤Î¤¿¤á¡¢¥µ¡¼¥Ð¤ËÀܳ¤¹¤ë»þ¤Ï¾ï¤Ë¥Û¥¹¥È̾¤òÍ¿¤¨¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-¥µ¡¼¥Ð¡¼¤Ø¤ÎÀܳ¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤¿¤á¤Ë¡¢°Ê²¼¤ò»î¤·¤Æ¤¯¤À¤µ¤¤¡§
-@example
-shell> mysqladmin -h `hostname` version
-@end example
-
-@item 狼¤¬ @code{mysqld} ¤¬»ÈÍѤ¹¤ë unix ¥½¥±¥Ã¥È ¤òºï½ü¤·¤¿ (default @file{/tmp/mysqld.sock}).
-¤À¤ì¤«¤¬ @code{cron} ¤Ç @strong{MySQL} ¥½¥±¥Ã¥È¤òºï½ü¤·¤Æ¤¤¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£(Î㤨¤Ð @file{/tmp} ¥Ç¥£¥ì¥¯¥È¥ê¤«¤é¸Å¤¤¥Õ¥¡¥¤¥ë¤òºï½ü¤¹¤ë¤è¤¦¤Ê¥¯¥í¡¼¥ó¤Ç)¡£
-¤¤¤Ä¤Ç¤â @code{mysqladmin version} ¤ò¼Â¹Ô¤·¤Æ
-@code{mysqladmin} ¤¬»ÈÍѤ¹¤ë¥½¥±¥Ã¥È¤¬ËÜÅö¤Ë¸ºß¤¹¤ë¤«¤ò¥Á¥§¥Ã¥¯¤Ç¤­¤Þ¤¹¡£
-¤³¤Î¾ì¹ç¤Î½¤Àµ¤Ï¡¢@file{mysqld.sock} ¤ò¾Ã¤µ¤Ê¤¤¤è¤¦¤Ë @code{cron} ¤òÊѹ¹¤¹¤ë¤«¡¢¤Þ¤¿¤Ï¥½¥±¥Ã¥È¤ò¤É¤³¤«Â¾¤Î¾ì½ê¤Ë°Ü¤¹¤³¤È¤Ç¤¹¡£
-
-@strong{MySQL} ¤ò ./configure ¤¹¤ë¾ì¹ç¤Ë¥½¥±¥Ã¥È¤ò»ØÄꤹ¤ë¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹:
-@example
-shell> ./configure --with-unix-socket-path=/path/to/socket
-@end example
-
-¤Þ¤¿¡¢@code{safe_mysqld} ¤ò @code{--socket=/path/to/socket} ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æµ¯Æ°¤·¤Æ¤â¹½¤¤¤Þ¤»¤ó¤·¡¢
-@code{MYSQL_UNIX_PORT} ´Ä¶­ÊÑ¿ô¤ò¥»¥Ã¥È¤·¤Æ @strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¤ò¼Â¹Ô¤·¤Æ¤â¤«¤Þ¤¤¤Þ¤»¤ó¡£
-
-@item @code{--socket=/path/to/socket} ¥ª¥×¥·¥ç¥ó¤Ç @code{mysqld} ¥µ¡¼¥Ð¡¼¤òµ¯Æ°¤Ç¤­¤Þ¤¹¡£
-¤â¤·¥µ¡¼¥Ð¡¼¤Î¥½¥±¥Ã¥È¤Î¥Ñ¥¹¤òÊѤ¨¤¿¾ì¹ç¡¢@strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¤Ë¡¢¿·¤·¤¤¥Ñ¥¹¤ò¶µ¤¨¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-¤³¤Î¾ì¹ç¡¢ @code{MYSQL_UNIX_PORT} ´Ä¶­ÊÑ¿ô¤ËÀßÄꤹ¤ë¤³¤È¤Ë¤è¤ê²Äǽ¤Ç¤¹¡£
-¥½¥±¥Ã¥È¤Î¥Æ¥¹¥È¤ò¤¹¤ë¾ì¹ç¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-
-@example
-shell> mysqladmin --socket=/path/to/socket version
-@end example
-
-@item
-Linux ¤ò»ÈÍѤ·¤Æ¤¤¤Æ¥¹¥ì¥Ã¥É¤¬°ì¤Ä»à¤ó¤À¤È¤­¡Ê¥³¥¢¥À¥ó¥×¤·¤¿¡Ë¡£
-¤³¤Î¾ì¹ç¡¢Â¾¤Î @code{mysqld} ¥¹¥ì¥Ã¥É¤ò¥­¥ë¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-¤¿¤È¤¨¤Ð¡¢@code{mysql_zap} ¥¹¥¯¥ê¥×¥È¤ò¡¢¿·¤·¤¯ @strong{MySQL} ¥µ¡¼¥Ð¡¼¤ò
-µ¯Æ°¤¹¤ëÁ°¤Ë¼Â¹Ô¤·¤Þ¤¹¡£ @xref{Crashing}.
-@end itemize
-
-¤â¤· @code{Can't connect to MySQL server on some_hostname} ¥¨¥é¡¼¤Î¾ì¹ç,
-²¿¤¬ÌäÂê¤Ê¤Î¤«¤ò¸«¤Ä¤±¤ë¤¿¤á¤Ë¡¢°Ê²¼¤Î¼ê½ç¤òƧ¤ß¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-¤â¤· @code{telnet your-host-name tcp-ip-port-number} ¤ò¼Â¹Ô¤¹¤ë¤È
-¥µ¡¼¥Ð¡¼¤¬¥¢¥Ã¥×¤¹¤ë¤Ê¤é¡¢ @code{RETURN} ¤ò²¿²ó¤«¤¿¤¿¤¤¤Æ¤¯¤À¤µ¤¤¡£
-¤â¤·¤³¤Î¥Ý¡¼¥È¤Ç @strong{MySQL} ¥µ¡¼¥Ð¡¼¤¬Áö¤Ã¤Æ¤¤¤ë¤Ê¤é¡¢
-Áö¤Ã¤Æ¤¤¤ë @strong{MySQL} ¥µ¡¼¥Ð¡¼¤Î¥Ð¡¼¥¸¥ç¥ó¥Ê¥ó¥Ð¡¼¤ò´Þ¤ó¤À
-¥ì¥¹¥Ý¥ó¥¹¤¬ÆÀ¤é¤ì¤ë¤Ï¤º¤Ç¤¹¡£
-¤â¤· @code{telnet: Unable to connect to remote host: Connection refused} ¤Î¤è¤¦¤Ê
-¥¨¥é¡¼¤Ë¤Ê¤Ã¤¿¤Ê¤é¤Ð¡¢¤³¤Î¥Ý¡¼¥È¤ò»ÈÍѤ·¤Æ¤¤¤ë¥µ¡¼¥Ð¡¼¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-
-@item
-¥í¡¼¥«¥ë¤Î¥Þ¥·¥ó¤Î @code{mysqld} ¥Ç¡¼¥â¥ó¤ËÀܳ¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
-@code{mysqld} ¤¬»ÈÍѤ¹¤ë¤è¤¦¤Ë»ØÄꤵ¤ì¤¿ TCP/IP ¥Ý¡¼¥È¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£
-¡Ê@code{mysqladmin variables} ¤ÇÆÀ¤é¤ì¤ë @code{port} ÊÑ¿ô¡Ë
-
-@item
-@code{mysqld} ¥µ¡¼¥Ð¡¼¤¬ @code{--skip-networking} ¥ª¥×¥·¥ç¥ó¤Çµ¯Æ°¤µ¤ì¤Æ¤¤¤Ê¤¤¤«
-³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£
-@end itemize
-
-@node Blocked host, Too many connections, Can not connect to server, Common errors
-@subsection @code{Host '...' is blocked} ¥¨¥é¡¼
-
-°Ê²¼¤Î¥¨¥é¡¼¤Î¾ì¹ç¡§
-
-@example
-Host 'hostname' is blocked because of many connection errors.
-Unblock with 'mysqladmin flush-hosts'
-@end example
-
-¤³¤ì¤Ï @code{mysqld} ¤¬Â¿¤¯¤Î @code{'hostname'} ¥Û¥¹¥È¤«¤é¤ÎÀܳ¥¨¥é¡¼(@code{max_connect_errors})
-¤ò¼õ¤±¤¿¾ì¹ç¤ËȯÀ¸¤·¤Þ¤¹¡£
-¤³¤Î @code{max_connect_errors} ÂçÎÌȯÀ¸¸å¡¢@code{mysqld} ¤Ï²¿¤«(¥¯¥é¥Ã¥«¡¼¤Ë¤è¤ë¥µ¡¼¥Ð¡¼¤Ø¤Î¥¢¥¿¥Ã¥¯¤Ê¤É)¤¬µ¯¤³¤Ã¤¿¤ÈȽÃǤ·¡¢¤³¤Î¥Û¥¹¥È¤«¤é¤ÎÀܳ¤ò¤¤¤Ã¤µ¤¤µñÈݤ¹¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
-¤³¤ì¤ò²ò½ü¤¹¤ë¤Ë¤Ï¡¢@code{mysqladmin flush-hosts} ¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤·¤Þ¤¹¡£
-
-¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢10²ó¤ÎÀܳ¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë¡¢@code{mysqld} ¤Ï¤½¤Î¥Û¥¹¥È¤òµñÈݤ·¤Þ¤¹¡£
-¤³¤ÎÃͤϰʲ¼¤Î¤è¤¦¤Ë¤·¤Æ´Êñ¤ËÊѹ¹¤Ç¤­¤Þ¤¹¡§
-
-@example
-shell> safe_mysqld -O max_connect_errors=10000 &
-@end example
-
-¤â¤·¤³¤Î¥¨¥é¡¼¤¬¤¢¤ë¥Û¥¹¥È¤ËÂФ·¤ÆȯÀ¸¤¹¤ë¤Ê¤é¤Ð¡¢¤Þ¤ººÇ½é¤Ë¤½¤Î¥Û¥¹¥È¤«¤é¤Î TCP/IP Àܳ¤ËÉÔ¶ñ¹ç¤¬¤Ê¤¤¤«¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£
-¤â¤· TCP/IP Àܳ¤¬Æ°ºî¤·¤Æ¤¤¤Ê¤¤¤è¤¦¤Ê¤é¡¢ @code{max_connect_errors} ÃͤòÁý¤ä¤¹¤³¤È¤Ï¤è¤¯¤Ê¤¤¤³¤È¤Ç¤¹¡ª
-
-@node Too many connections, Out of memory, Blocked host, Common errors
-@subsection @code{Too many connections} ¥¨¥é¡¼
-
-¤â¤· @strong{MySQL} ¤ËÀܳ¤·¤è¤¦¤È¤·¤Æ @code{Too many connections} ¤È¤Ê¤Ã¤¿¾ì¹ç¡¢
-¤³¤ì¤Ï´û¤Ë @code{max_connections} ʬ¡¢¥¯¥é¥¤¥¢¥ó¥È¤«¤é @code{mysqld} ¥µ¡¼¥Ð¡¼¤Ø¤Î
-Àܳ¤¬¹Ô¤ï¤ì¤Æ¤¤¤Þ¤¹¡£
-
-¤â¤·¥Ç¥Õ¥©¥ë¥È¤Î100¤è¤ê¤â¿¤¤Àܳ¤òɬÍפȤ¹¤ë¤Ê¤é¤Ð¡¢
-@code{max_connections} ÊÑ¿ô¤Ë¿¤¯¤ÎÃͤòÍ¿¤¨¤Æ¡¢@code{mysqld} ¤ò
-¥ê¥¹¥¿¡¼¥È¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-
-¼ÂºÝ¤Ï¡¢@code{mysqld} ¤Ï (@code{max_connections}+1) ¸Ä¤Î¥¯¥é¥¤¥¢¥ó¥È¤«¤é¤ÎÀܳ¤òµö¤·¤Æ¤¤¤Þ¤¹¡£
-ºÇ¸å¤Î£±¸Ä¤Ï¡¢ @code{process} ¸¢¸Â¤ò¤â¤Ä¥æ¡¼¥¶¡¼¤Î¤¿¤á¤Ë¼è¤Ã¤Æ¤¢¤ê¤Þ¤¹¡£
-By not giving this privilege to normal users (they shouldn't need this), an
-administrator with this privilege can login and use @code{SHOW PROCESSLIST}
-to find out what could be wrong. @xref{SHOW}.
-
-@node Out of memory, Packet too large, Too many connections, Common errors
-@subsection @code{Out of memory} ¥¨¥é¡¼
-
-¥¯¥¨¥ê¤ò¹Ô¤Ã¤Æ¡¢¼¡¤Î¥¨¥é¡¼¤Î¤è¤¦¤Ê¤â¤Î¤òÆÀ¤¿¾ì¹ç:
-
-@example
-mysql: Out of memory at line 42, 'malloc.c'
-mysql: needed 8136 byte (8k), memory in use: 12481367 bytes (12189k)
-ERROR 2008: MySQL client ran out of memory
-@end example
-
-¥¨¥é¡¼¤Ï @strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È @code{mysql} ¤Ë´Ø·¸¤¹¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£¥¨
-¥é¡¼¤ÎÍýͳ¤Ïñ½ã¤Ç¡¢¥¯¥é¥¤¥¢¥ó¥È¤¬·ë²ÌÁ´ÂΤò³ÊǼ¤¹¤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤ò»ý¤Ã
-¤Æ¤¤¤Ê¤¤¤³¤È¤Ç¤¹¡£
-
-¤³¤ÎÌäÂê¤ò²ò·è¤¹¤ë¤Ë¤¢¤¿¤ê¡¢¤Þ¤ººÇ½é¤Ë¥¯¥¨¥ê¡¼¤¬Àµ¤·¤¤¤«³Îǧ¤·¤Æ¤¯¤À¤µ¤¤¡£
-¤½¤Î¥¯¥¨¥ê¡¼¤ÏÂçÎ̤ηë²Ì¤òÊÖ¤¹¤â¤Î¤Ç¤·¤ç¤¦¤«¡©
-¤â¤·¤½¤¦¤Ê¤é¡¢@code{mysql --quick} ¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
-¤³¤ì¤Ï·ë²Ì¤ò¼è¤ê½Ð¤¹¤¿¤á¤Ë @code{mysql_use_result()} ¤ò»ÈÍѤ·¤Þ¤¹¡£
-¤³¤ì¤Ï¥¯¥é¥¤¥¢¥ó¥È¤Î¥í¡¼¥ÉÉÔ­¤òÊ䤤¤Þ¤¹(¥µ¡¼¥Ð¡¼¤è¤ê¿¤¤Îΰè¤Ï¼è¤ì¤Þ¤»¤ó)¡£
-
-@node Packet too large, Full table, Out of memory, Common errors
-@subsection @code{Packet too large} ¥¨¥é¡¼
-
-@strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¤¬ @code{max_allowed_packet} ¤è¤ê¤âÂ礭¤Ê¥Ö¥í¥Ã¥¯¤ò @code{mysqld} ¥µ¡¼¥Ð¡¼¤«¤éÆÀ¤¿»þ¡¢@code{Packet too large} ¥¨¥é¡¼¤òȯ¤·¤Þ¤¹¡£
-
-@code{mysql} ¥¯¥é¥¤¥¢¥ó¥È¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢@code{mysql --set-variable=max_allowed_packet=8M}
- ¤Ç¥¯¥é¥¤¥¢¥ó¥È¤ò³«»Ï¤¹¤ë¤³¤È¤Ç¡¢¥Ð¥Ã¥Õ¥¡¤òÂ礭¤¯ÀßÄê¤Ç¤­¤Þ¤¹¡£
-
-¤â¤·(@code{DBI} ¤Î¤è¤¦¤Ë)ºÇÂç¥Ñ¥±¥Ã¥È¥µ¥¤¥º¤ò»ØÄê¤Ç¤­¤Ê¤¤¥¯¥é¥¤¥¢¥ó¥È¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢
-¥Ñ¥±¥Ã¥È¥µ¥¤¥º¤ò»ØÄꤷ¤Æ¥µ¡¼¥Ð¡¼¤òΩ¤Á¾å¤²Ä¾¤·¤Þ¤¹¡£
-¤³¤ì¤Ï @code{mysqld} ¤Î¥ª¥×¥·¥ç¥ó¤Î @code{max_allowed_packet} ¤ËÂ礭¤ÊÃͤòÀßÄꤹ¤ë¤³¤È¤Ç¹Ô¤¤¤Þ¤¹¡£
-Î㤨¤Ð¡¢ @code{BLOB} ·¿¤ÎµöÍÆÈϰϤ¤¤Ã¤Ñ¤¤¤Î¥Ç¡¼¥¿¤ò¥Æ¡¼¥Ö¥ë¤ËÆþ¤ì¤ë¾ì¹ç¡¢
-@code{--set-variable=max_allowed_packet=24M} ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æ¥µ¡¼¥Ð¡¼¤òµ¯Æ°¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-@cindex The table is full
-@node Full table, Commands out of sync, Packet too large, Common errors
-@subsection @code{The table is full} ¥¨¥é¡¼
-
-¤³¤Î¥¨¥é¡¼¤Ï¡¢¸Å¤¤ @strong{MySQL} ¥Ð¡¼¥¸¥ç¥ó¤Ë¤ª¤¤¤Æ¡¢
-¥á¥â¥êÆâ°ì»þ¥Æ¡¼¥Ö¥ë¤¬ @code{tmp_table_size} ¤è¤ê¤âÂ礭¤¯¤Ê¤Ã
-¤¿»þ¤ËȯÀ¸¤·¤Þ¤¹¡£¤³¤ÎÌäÂê¤ò²óÈò¤¹¤ë¤¿¤á¤Ë¡¢@code{mysqld} ¤Î¥ª¥×¥·¥ç¥ó @code{-O
-tmp_table_size=#} ¤ÇÁý²Ã¡¢¤Þ¤¿¤Ï¡¢SQL ¥ª¥×¥·¥ç¥ó @code{SQL_BIG_TABLES}
-¤òÌäÂê¤Î¥¯¥¨¥ê¤ÎÁ°¤Ë»ÈÍѤǤ­¤Þ¤¹¡£@xref{SET OPTION, , @code{SET OPTION}}.
-
-@code{mysqld} ¤ò @code{--big-tables} ¥ª¥×¥·¥ç¥ó»ØÄꤷ¤Æµ¯Æ°¤·¤Þ¤¹¡£
-¤³¤ì¤ÏÁ´¤Æ¤Î¥¯¥¨¥ê¡¼¤ËÂФ·¤Æ @code{SQL_BIG_TABLES} ¤ò»ÈÍѤ¹¤ë¤Î¤ÈƱ¤¸¤Ç¤¹¡£
-
-In @strong{MySQL} 3.23 in-memory temporary tables will automaticly be
-converted to a disk based @code{MyISAM} table after the table size gets
-bigger than @code{tmp_table_size}.
-
-@cindex Commands out of sync
-@node Commands out of sync, Ignoring user, Full table, Common errors
-@subsection @code{Commands out of sync} error in client
-
-@code{Commands out of sync; You can't run this command now} ¤ò¥¯¥é¥¤¥¢¥ó
-¥È¥³¡¼¥ÉÃæ¤ÇÆÀ¤¿¾ì¹ç¡¢¥¯¥é¥¤¥¢¥ó¥È´Ø¿ô¤ò´Ö°ã¤Ã¤¿½çÈ֤ǸƤӽФ·¤Þ¤·¤¿¡ª
-
-¤³¤ì¤ÏÎ㤨¤Ð¡¢@code{mysql_use_result()} ¤ò»ÈÍѤ·¤Æ¤¤¤Æ¡¢@code{mysql_free_result()}
-¤ò¹Ô¤¦Á°¤Ë¿·¤·¤¤¥¯¥¨¥ê¤Î¼Â¹Ô¤ò»î¤ß¤¿¾ì¹ç¤ËȯÀ¸¤·¤Þ¤¹¡£¤³¤ì¤Ï¤Þ¤¿¡¢¥Ç¡¼¥¿
-¤òÊÖ¤¹£²¤Ä¤Î¥¯¥¨¥ê¤Î¼Â¹Ô¤ò¡¢´Ö¤Ë @code{mysql_use_result()} ¤ä
-@code{mysql_store_result()} ̵¤·¤Ç»î¤ß¤¿¾ì¹ç¤Ë¤âȯÀ¸¤·¤Þ¤¹¡£
-
-
-@node Ignoring user, Cannot find table, Commands out of sync, Common errors
-@subsection @code{Ignoring user} ¥¨¥é¡¼
-
-°Ê²¼¤Î¥¨¥é¡¼¤Î¾ì¹ç¡§
-
-@code{Found wrong password for user: 'some_user@@some_host'; Ignoring user}
-
-¤³¤ì¤Ï @code{mysqld} ¤Î³«»Ï¤Þ¤¿¤Ï 'reload' »þ¤Ë @code{user} ¥Æ¡¼¥Ö¥ëÆâ¤ËÀµ¤·¤¤¥Ñ¥¹¥ï¡¼
-¥É¤ò»ý¤¿¤Ê¤¤¥¨¥ó¥È¥ê¤ò¸«¤Ä¤±¤¿¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£
-¤³¤ì¤Ïñ¤Ë¥¨¥ó¥È¥ê¤¬µö²Ä¥·¥¹¥Æ¥à¤ËµñÈݤµ¤ì¤Æ¤¤¤ë¤À¤±¤Ç¤¹¡£
-
-µ¯¤³¤êÆÀ¤ë¤³¤È¤È¤½¤Î²ò·è:
-
-@itemize @bullet
-@item
-¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Î @code{mysqld} ¤ò¡¢¸Å¤¤¥Ð¡¼¥¸¥ç¥óÍѤΠ@code{user} ¥Æ¡¼¥Ö¥ë¤ÇÁö¤é¤»¤Æ¤¤¤ë¤Î¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-@code{mysqlshow mysql user} ¤ò¹Ô¤¦¤³¤È¤Ë¤è¤Ã¤Æ¤³¤ì¤ò¸¡¾Ú¤Ç¤­¤Þ¤¹¡£
-¥Ñ¥¹¥ï¡¼¥É¥Õ¥£¡¼¥ë¥É¤¬ 16 ʸ»ú¤è¤ê¤âû¤¤¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£
-¤â¤·¤½¤¦¤Ê¤é¡¢¤³¤ì¤ò½¤Àµ¤¹¤ë¤¿¤á¤Ë¡¢@code{scripts/add_long_password} ¥¹¥¯¥ê¥×¥È¤ò¼Â¹Ô¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-¥æ¡¼¥¶¡¼¤¬¸Å¤¤¥Ñ¥¹¥ï¡¼¥É(ºÇÂç8ʸ»ú) ¤ò»ÈÍѤ·¤Æ¤¤¤Æ¡¢@code{mysqld} ¤ò @code{--old-protocol} ¥ª¥×¥·¥ç¥ó¤Çµ¯Æ°¤·¤Æ¤¤¤Ê¤¤¤Î¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-¿·¤·¤¤¥Ñ¥¹¥ï¡¼¥É¤Ç @code{user} ¥Æ¡¼¥Ö¥ëÆâ¤Î¥æ¡¼¥¶¤ò¹¹¿·¤¹¤ë¤«¡¢@code{--old-protocol}
-ÉÕ¤­¤Ç @code{mysqld} ¤òºÆµ¯Æ°¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-@findex PASSWORD()
-@code{user} ¥Æ¡¼¥Ö¥ë¤Î¥Ñ¥¹¥ï¡¼¥É¤ò¡¢@code{PASSWORD()} ´Ø¿ô¤ò»ÈÍѤ·¤Ê¤¤¤ÇÅÐÏ¿¤·¤¿¤Î¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-¤³¤Î¾ì¹ç¡¢@code{user} ¥Æ¡¼¥Ö¥ë¤Î¥Ñ¥¹¥ï¡¼¥É¤ò¡¢@code{mysql} ¤ò»ÈÍѤ·¤Æ¹¹¿·¤·¤Þ¤¹¡£
-@code{PASSWORD()} ´Ø¿ô¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ»ÈÍѤ·¤Þ¤¹¡§
-
-@example
-mysql> update user set password=PASSWORD('your password')
- where user='XXX';
-@end example
-@end itemize
-
-@node Cannot find table, , Ignoring user, Common errors
-@subsection @code{Table 'xxx' doesn't exist} error
-
-¤â¤· @code{Table 'xxx' doesn't exist} ¤« @code{Can't find file: 'xxx' (errno: 2)}
- ¥¨¥é¡¼¤¬½Ð¤¿¾ì¹ç¡¢»ÈÍѤ·¤Æ¤¤¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë @code{xxx} ¤È¤¤¤¦Ì¾Á°¤Î¥Æ¡¼¥Ö¥ë¤¬
-¸«ÉÕ¤«¤é¤Ê¤«¤Ã¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹
-
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¥Æ¡¼¥Ö¥ë¤ÎÊݸ¤Ë¡¢@strong{MySQL} ¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤È¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¡¢
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¥Æ¡¼¥Ö¥ë¤Î̾Á°¤Ï@strong{¥±¡¼¥¹°Í¸}¤Ç¤¹!
-(Win32 ¤Ç¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¥Æ¡¼¥Ö¥ë̾¤Ï¥±¡¼¥¹Èó°Í¸¤Ç¤¹¡£
-¥¯¥¨¥êÃæ¤Î¥Æ¡¼¥Ö¥ë¤ËÂФ¹¤ëÌ䤤¹ç¤ï¤»¤ÏÁ´¤Æ¡¢Æ±¤¸¥±¡¼¥¹¤Ç½ñ¤«¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡ª)
-
-@code{SHOW TABLES} ¤ò»ÈÍѤ·¤Æ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Æ¡¼¥Ö¥ë¤ò³Îǧ¤Ç¤­¤Þ¤¹. @xref{SHOW, , @code{SHOW}}.
-
-@cindex Full disk
-@cindex Disk full
-@node Full disk, Multiple sql commands, Common errors, Problems
-@section @strong{MySQL} ¤Ï¥Õ¥ë¥Ç¥£¥¹¥¯¤ò¤É¤Î¤è¤¦¤Ë°·¤¦¤«¡©
-
-@noindent
-¥Ç¥£¥¹¥¯¥Õ¥ë¤¬µ¯¤­¤¿¾ì¹ç @strong{MySQL} ¤Ï¼¡¤Î¤³¤È¤ò¹Ô¤¤¤Þ¤¹:
-
-@itemize @bullet
-@item
-¸½ºß¤Î¹Ô¤ò½ñ¤¯¤Î¤Ë½½Ê¬¤ÊÎΰ褬¤¢¤ë¤«¤É¤¦¤«¤ò1ʬËè¤Ë1²ó¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£½½
-ʬ¤Ê¥Ç¥£¥¹¥¯¤¬¤¢¤ë¾ì¹ç¤Ï¡¢²¿¤âµ¯¤­¤Ê¤«¤Ã¤¿¤è¤¦¤Ë·Ñ³¤·¤Þ¤¹¡£
-@item
-6ʬËè¤Ë¥í¥°¥Õ¥¡¥¤¥ë¤Ë¥Ç¥£¥¹¥¯¥Õ¥ë¤ò·Ù¹ð¤¹¤ë¥¨¥ó¥È¥ê¤ò½ñ¤­½Ð¤·¤Þ¤¹¡£
-@end itemize
-
-@noindent
-¤³¤ÎÌäÂê¤Î¾ì¹ç¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-·Ñ³¤¹¤ë¤¿¤á¤Ë¤Ï¡¢Á´¤Æ¤Î¥ì¥³¡¼¥É¤òÁÞÆþ¤¹¤ë¤Î¤Ë½½Ê¬¤ÊÎΰè¤ò²òÊü¤¹¤ëɬÍפ¬
-¤¢¤ê¤Þ¤¹¡£
-@item
-¥¹¥ì¥Ã¥É¤ò¥¢¥Ü¡¼¥È¤¹¤ë¤¿¤á¤Ë¤Ï¡¢@code{mysqladmin kill} ¤ò¥¹¥ì¥Ã¥É¤ËÁ÷¤ë
-ɬÍפ¬¤¢¤ê¤Þ¤¹¡£¥¹¥ì¥Ã¥É¤Ï¼¡¤Ë(1ʬ)¥Ç¥£¥¹¥¯¤ò¥Á¥§¥Ã¥¯¤·¤¿»þ¤Ë¥¢¥Ü¡¼¥È¤·
-¤Þ¤¹¡£
-@item
-¾¤Î¥¹¥ì¥Ã¥É¤¬ ``disk full'' ¤¬È¯À¸¤·¤¿¥Æ¡¼¥Ö¥ë¤ÇÂÔ¤¿¤µ¤ì¤ë¤³¤È¤ËÃí°Õ¤·¤Æ
-¤¯¤À¤µ¤¤¡£Â¿¤¯¤Î ``locked'' ¥¹¥ì¥Ã¥É¤¬¤¢¤ë¾ì¹ç¡¢disk full ¤òÂԤİì¤Ä¤Î¥¹¥ì¥Ã
-¥É¤ò kill ¤¹¤ë¤³¤È¤Ç¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤Î·Ñ³¤òµö¤·¤Þ¤¹¡£
-@end itemize
-
-
-@node Multiple sql commands, Temporary files, Full disk, Problems
-@section ¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤«¤é SQL ¥³¥Þ¥ó¥É¤ò¼Â¹Ô
-
-@code{mysql} ¥¯¥é¥¤¥¢¥ó¥È¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤ÆÂÐÏÃŪ¤Ë»ÈÍѤ·¤Þ¤¹¡§
-
-@example
-shell> mysql database
-@end example
-
-¤·¤«¤· SQL ¥³¥Þ¥ó¥É¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤¤¤Æ¤ª¤­¡¢¤½¤ì¤ò @code{mysql} ¤ËÆɤ߹þ¤Þ¤»¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë @file{text_file} ¤Ë¼Â¹Ô¤·¤¿¤¤¥³¥Þ¥ó¥É¤ò½ñ¤¤¤Æ¤ª¤­¡¢
-°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ @code{mysql} ¤òµ¯Æ°¤·¤Þ¤¹¡§
-
-@example
-shell> mysql database < text_file
-@end example
-
-¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤ÎÀèƬ¤Ë @code{USE db_name} ¹½Ê¸¤ò½ñ¤¯¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
-¤³¤Î¾ì¹ç¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¤ò¥³¥Þ¥ó¥É¥é¥¤¥ó¤ËÍ¿¤¨¤ëɬÍפÏ̵¤¯¡¢°Ê²¼¤Î¤è¤¦¤Ë¤Ç¤­¤Þ¤¹¡§
-
-@example
-shell> mysql < text_file
-@end example
-
-@xref{Programs}.
-
-
-@node Temporary files, Problems with mysql.sock, Multiple sql commands, Problems
-@section @strong{MySQL} ¤¬°ì»þ¥Õ¥¡¥¤¥ë¤ò³ÊǼ¤¹¤ë¾ì½ê
-
-@strong{MySQL} ¤Ï°ì»þ¥Õ¥¡¥¤¥ë¤ò³ÊǼ¤¹¤ë¾ì½ê¤È¤·¤Æ @code{TMPDIR} ´Ä¶­ÊÑ¿ô¤ÎÃͤò
-»ÈÍѤ·¤Þ¤¹¡£@code{TMPDIR} ¤òÀßÄꤷ¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢@strong{MySQL} ¤Ï¥·¥¹¥Æ¥à¤Î¥Ç¥Õ¥©
-¥ë¥È¤ò»ÈÍѤ·¤Þ¤¹¡£Ä̾ï¤Ï @file{/tmp} ¤Þ¤¿¤Ï @file{/usr/tmp} ¤Ç¤¹¡£@code{TMPDIR} ¤¬¾®¤µ
-¤¹¤®¤ë¾ì¹ç¡¢@code{safe_mysqld} ¤òÊÔ½¸¤·¤Æ¡¢½½Ê¬¤ÊÎΰ褬¤¢¤ë¾¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò»Ø
-¤¹¤è¤¦¤Ë @code{TMPDIR} ¤òÀßÄꤹ¤Ù¤­¤Ç¤¹¡ª
-@code{--tmpdir} ¥ª¥×¥·¥ç¥ó¤ò @code{mysqld} ¤ËÍ¿¤¨¤ë¤³¤È¤Ç¡¢°ì»þ¥Õ¥¡¥¤¥ë¥Ç¥£¥ì¥¯¥È¥ê¤ò»ØÄꤹ¤ë¤³¤È¤â²Äǽ¤Ç¤¹¡£
-
-@strong{MySQL} ¤ÏÁ´¤Æ¤Î°ì»þ¥Õ¥¡¥¤¥ë¤ò ``±£¤·¥Õ¥¡¥¤¥ë'' ¤È¤·¤ÆÀ¸À®¤·¤Þ¤¹¡£
-¤³¤ì¤Ï @code{mysqld} ¤¬½ªÎ»¤·¤¿¾ì¹ç¤Ë¡¢°ì»þ¥Õ¥¡¥¤¥ë¤¬ºï½ü¤µ¤ì¤Ê¤¤¤³¤È¤ò³Î¼Â¤Ë¤·
-¤Þ¤¹¡£±£¤·¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ¹¤ë '°­¤¤' ¦Ì̤ϡ¢¾®¤µ¤¹¤®¤ë°ì»þ¥Ç¥£¥¹¥¯¤ò°ìÇÕ
-¤Ë¤¹¤ëÂ礭¤Ê°ì»þ¥Õ¥¡¥¤¥ë¤ò¸«¤Ä¤±¤é¤ì¤Ê¤¤¤³¤È¤Ç¤¹¡£
-
-¥½¡¼¥È»þ (@code{ORDER BY} ¤Þ¤¿¤Ï @code{GROUP BY})¡¢@strong{MySQL} ¤ÏÄ̾ï°ì¤Ä¤Þ¤¿¤ÏÆó¤Ä
-¤Î°ì»þ¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ·¤Þ¤¹¡£É¬ÍפʺÇÂç¤Î¥Ç¥£¥¹¥¯ÍÆÎ̤Ï:
-
-@example
-(length of what is sorted + sizeof(database pointer))
-* number of matched rows
-* 2
-@end example
-
-@code{sizeof(database_pointer)} ¤ÏÄ̾¤Ç¤¹¤¬¡¢¾­ÍèËÜÅö¤ËÂ礭¤Ê¥Æ¡¼¥Ö¥ë
-¤Î¤¿¤á¤ËÂ礭¤¯¤Ê¤ë¤³¤È¤â¤¢¤ê¤Þ¤¹¡£
-
-¤¤¤¯¤Ä¤«¤Î @code{SELECT} ¥¯¥¨¥ê¤Ï°ì»þŪ¤Ê SQL ¥Æ¡¼¥Ö¥ë¤âÀ¸À®¤·¤Þ¤¹¡£¤³¤ì¤é¤Ï±£
-¤·¥Õ¥¡¥¤¥ë¤Ç¤Ï¤Ê¤¯¡¢@file{SQL_*} ¤È¤¤¤¦Ì¾Á°¤Ç¤¹¡£
-
-@code{ALTER TABLE} , @code{OPTIMIZE TABLE} ¤Ï°ì»þ¥Æ¡¼¥Ö¥ë¤ò¥ª¥ê¥¸¥Ê¥ë¥Æ¡¼¥Ö¥ë¤ÈƱ¤¸¥Ç¥£¥ì¥¯¥È¥ê
-Æâ¤ËÀ¸À®¤·¤Þ¤¹¡£
-
-
-@node Problems with mysql.sock, Error Access denied, Temporary files, Problems
-@section @file{/tmp/mysql.sock} ¤òºï½ü¤«¤é¼é¤ëÊýË¡
-
-¤â¤·Ã¯¤«¤Ë @strong{MySQL} ¤Î¥½¥±¥Ã¥È¥Õ¥¡¥¤¥ë @file{/tmp/mysql.sock} ¤¬¾Ã¤µ¤ì¤ë¤Ê¤é¡¢
-¤Û¤È¤ó¤É¤Î Unix ¤¬¤½¤¦¤Ç¤¢¤ë¤è¤¦¤Ë¡¢ @file{/tmp} ¤Ë @code{sticky} ¥Ó¥Ã¥È¤ò¤¿¤Æ¤ÆÊݸ¤Þ¤¹¡£
-@code{root} ¤Ç¥í¥°¥¤¥ó¤·¤Æ¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-
-@example
-shell> chmod +t /tmp
-@end example
-
-¤³¤ì¤Ï¥Õ¥¡¥¤¥ë¤Î¥ª¡¼¥Ê¡¼¤È¥¹¡¼¥Ñ¡¼¥æ¡¼¥¶¡¼(@code{root}) ¤Î¤ß¤¬¡¢
- @file{/tmp} ¤Î¥Õ¥¡¥¤¥ë¤ò¾Ã¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@code{sticky} ¥Ó¥Ã¥È¤¬Î©¤Ã¤Æ¤¤¤ë¤«³Îǧ¤¹¤ë¤Ë¤Ï¡¢ @code{ls -ld /tmp} ¤ò¹Ô¤¤¤Þ¤¹¡£
-¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ÎºÇ¸å¤Î¥Ó¥Ã¥È¤¬ @code{t} ¤Ê¤é¤Ð¡¢¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-
-@node Error Access denied, Changing MySQL user , Problems with mysql.sock, Problems
-@section @code{Access denied} ¥¨¥é¡¼
-
-@xref{Privileges}.¡¡@xref{Access denied}.
-
-
-@node Changing MySQL user , Resetting permissions, Error Access denied, Problems
-@section °ìÈ̥桼¥¶¤Ç @strong{MySQL} ¤òÆ°¤«¤¹ÊýË¡
-
-@code{mysqld} (@strong{MySQL} ¥µ¡¼¥Ð) ¤Ïï¤Ç¤â³«»Ï¤·¼Â¹Ô¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@code{mysqld} ¤ò¥æ¡¼¥¶ @code{user_name} ¤Ç¼Â¹Ô¤¹¤ë¤è¤¦¤ËÊѹ¹¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¼¡¤ò¹Ô¤Ê¤¦É¬Íפ¬
-¤¢¤ê¤Þ¤¹:
-
-@enumerate
-@item
-¥µ¡¼¥Ð¡¼¤ò»ß¤á¤Þ¤¹ (use @code{mysqladmin shutdown}).
-
-@item
-@code{user_name} ¤¬Æɤ߽ñ¤­¤Ç¤­¤ë¤è¤¦¤Ë¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤È¤½¤ÎÃæ¤Î¥Õ¥¡¥¤¥ë¤Î¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤òÊѹ¹¤·¤Þ¤¹¡£(¤³¤ì¤Ï Unix @code{root} ¥æ¡¼¥¶¡¼¤Ç¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ë¤Ç¤·¤ç¤¦)¡§
-
-@example
-shell> chown -R user_name /path/to/mysql/datadir
-@end example
-
-@strong{MySQL} ¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Ç¥£¥ì¥¯¥È¥ê¡¼¤ä¥Õ¥¡¥¤¥ë¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Î¾ì¹ç¡¢
-¤³¤ì¤é¥ê¥ó¥¯¤ÎÀè¤Î¥Ç¥£¥ì¥¯¥È¥ê¤È¥Õ¥¡¥¤¥ë¤âÊѹ¹¤·¤Þ¤¹¡£@code{chown -R} ¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯Àè¤òÊѹ¹¤·¤Æ¤¯¤ì¤Þ¤»¤ó¡£
-
-@item
-¥æ¡¼¥¶ @code{user_name} ¤Ç¥µ¡¼¥Ð¤òµ¯Æ°¤·¤Þ¤¹¡£¤Þ¤¿¤Ï @strong{MySQL} 3.22 °Ê¹ß¤ò»ÈÍѤ¹¤ë
-¾ì¹ç¤Ï¡¢@code{mysqld} ¤ò Unix @code{root} ¤Çµ¯Æ°¤· @code{--user=user_name} ¥¹¥¤¥Ã¥Á¤ò»ÈÍѤ·¤Þ¤¹¡£
-@code{mysqld} ¤Ï¡¢Àܳ¤òµö²Ä¤¹¤ëÁ°¤Ë¡¢Í¿¤¨¤é¤ì¤¿ Unix user @code{user_name} ¤Ç¼Â¹Ô¤¹¤ë¤è¤¦¤ËÀÚ¤êÂؤ¨¤Þ¤¹¡£
-
-@item
-¥·¥¹¥Æ¥àºÆµ¯Æ°»þ¡¢ @code{mysql.server} ¤ò»ÈÍѤ·¤Æ @code{mysqld} ¤òµ¯Æ°¤¹¤ë¾ì¹ç¡¢¥æ¡¼¥¶
-@code{user_name} ¤Ø¤Î @code{su} ¤ò¹Ô¤Ê¤¦¤è¤¦¤Ë¤Þ¤¿¤Ï @code{--user} ¥¹¥¤¥Ã¥Á¤ò»ÈÍѤ·¤Æ @code{mysqld} ¤òµ¯Æ°¤¹¤ë¤è¤¦¤Ë @code{mysql.server} ¤ò Êѹ¹¤¹¤Ù¤­¤Ç¤¹¡£
-(No changes to @code{safe_mysqld} are necessary.)
-@end enumerate
-
-¤³¤Î»þÅÀ¤Ç¡¢¤¢¤Ê¤¿¤Î @code{mysqld} ¥×¥í¥»¥¹¤Ï Unix user @code{user_name} ¤ÇÀµ¾ï¤ËÆ°ºî¤·¤Þ¤¹¡£
-
-°ì¤Ä¤Î¤³¤È¤ÏÊѤï¤ê¤Þ¤»¤ó¡£¤½¤ì¤Ï¸¢¸Âµö²Ä¥Æ¡¼¥Ö¥ë¤Ç¤¹¡£¥Ç¥Õ¥©¥ë¥È
-(¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¥Æ¡¼¥Ö¥ë¥¤¥ó¥¹¥È¡¼¥ë¥¹¥¯¥ê¥×¥È@code{mysql_install_db}¼Â¹Ô¸å¤Î¸¢¸Â) ¤Ç¤Ï¡¢@code{mysql}¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¤ä¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎºîÀ®¡¢ÇË´þ¤Ï¥æ¡¼¥¶ @strong{MySQL} user @code{root} ¤À¤±¤Ç¤¹¡£
-¤³¤ì¤òÊѹ¹¤·¤Ê¤¤¤È¡¢¤½¤ì¤Ï¤½¤Î¤Þ¤Þ¤Ç¤¹¡£
-@code{root} °Ê³°¤ÎUnix user¤Ç¥í¥°¥¤¥ó¤·¤Æ¤¤¤ë»þ¤Ç¤â¡¢¤¢¤Ê¤¿¤Ï
-@strong{MySQL} @code{root} user ¤È¤·¤Æ¥¢¥¯¥»¥¹¤Ï²Äǽ¤Ç¤¹ - ¤¿¤À¥×¥í¥°¥é¥à¤Ë @code{-u root} ¤ò¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤Ë¥ª¥×¥·¥ç¥ó»ØÄꤹ¤ë¤À¤±¤Ç¤¹¡£
-
-@strong{MySQL} ¤Ë @code{root} ¤È¤·¤Æ¥¢¥¯¥»¥¹¤¹¤ë¤Ë¤Ï¡¢
-¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç @code{-u root} ¤ò»ÈÍѤ¹¤ë¤À¤±¤Ç¤¤¤¤¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-Unix @code{root} user ¤ä @strong{MySQL} ¤òÁö¤é¤»¤Æ¤¤¤ë Unix ¥æ¡¼¥¶¡¼¤Ç¤¢¤ëɬÍפÏ@emph{¤Ê¤¤}¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-@strong{MySQL} ¤Î¥¢¥¯¥»¥¹¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤È@strong{MySQL} ¤Î¥æ¡¼¥¶¤Ï¡¢
-UNIX ¥æ¡¼¥¶¤È¤Ï´°Á´¤ËÊ̤Τâ¤Î¤Ç¤¹¡£UNIX ¥æ¡¼¥¶¤Ë´Ø·¸¤¹¤ë¤Î¤Ï¡¢¥¯¥é¥¤¥¢¥ó
-¥È¤Ë @code{-u} ¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ·¤Ê¤¤¾ì¹ç¤À¤±¤Ç¤¹¡£¤³¤Î¾ì¹ç¡¢¥¯¥é¥¤¥¢¥ó¥È¤Ï
-@strong{MySQL} ¤Ø¤Î¥í¥°¥¤¥ó¤ò¡¢¤¢¤Ê¤¿¤Î UNIX ¥í¥°¥¤¥ó̾¤Ç»î¤ß¤Þ¤¹¡£
-
-¤¢¤Ê¤¿¤Î UNIX ¥Þ¥·¥ó¤½¤ì¼«¿È¤¬°ÂÁ´¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢¾¯¤Ê¤¯¤È¤â @strong{MySQL} ¥¢
-¥¯¥»¥¹¥Æ¡¼¥Ö¥ë¤Î @strong{MySQL} @code{root} ¥æ¡¼¥¶¤Ë¤Ï¥Ñ¥¹¥ï¡¼¥É¤òÀßÄꤹ¤Ù¤­¤Ç¤¹¡£
-¤É¤³¤«¤Î狼¤¬ @code{mysql -u root db_name} ¤ò¹Ô¤Ê¤¤¡¢Èब˾¤à¤³¤È¤ÎÁ´¤Æ¤ò¼Â¹Ô¤Ç¤­¤Æ¤·¤Þ¤¦¤«¤é¤Ç¤¹¡£
-
-
-@node Resetting permissions, File permissions , Changing MySQL user , Problems
-@section ˺¤ì¤¿¥Ñ¥¹¥ï¡¼¥É¤ò¥ê¥»¥Ã¥È¤¹¤ë
-
-¤â¤· @strong{MySQL} ¤Î @code{root} ¥æ¡¼¥¶¡¼¤Î¥Ñ¥¹¥ï¡¼¥É¤ò˺¤ì¤¿¾ì¹ç¡¢
-¤³¤ì¤ò°Ê²¼¤Î¤è¤¦¤Ë¤·¤ÆÆþ¤ìľ¤¹¤³¤È¤¬²Äǽ¤Ç¤¹¡£
-
-@enumerate
-@item
-@code{mysqld} ¥µ¡¼¥Ð¡¼¤ò @code{kill} ¤ÇÍî¤È¤¹¡£
-(@code{kill -9} ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡ª)
-PID ÈÖ¹æ¤ÏÄ̾ï @strong{MySQL} ¥Ç¡¼¥¿¥Ç¥£¥ì¥¯¥È¥ê¤Ë @code{.pid} ¥Õ¥¡¥¤¥ë¤È¤·¤Æ
-½ñ¤«¤ì¤Æ¤¤¤Þ¤¹¡§
-
-@example
-kill `cat /mysql-data-directory/hostname.pid`
-@end example
-
-¤³¤ì¤ò¡¢ UNIX @code{root} ¥æ¡¼¥¶¡¼¤«¡¢@strong{MySQL} ¥µ¡¼¥Ð¡¼¤ò¼Â¹Ô¤·¤¿
-¥æ¡¼¥¶¡¼¤Ç¹Ô¤¤¤Þ¤¹¡£
-
-@item
-@code{mysqld} ¤ò @code{--skip-grant-tables} ¥ª¥×¥·¥ç¥ó¤Çµ¯Æ°¡£
-
-@item
-@code{mysql -h hostname mysql} ¤Ç@code{mysqld} ¥µ¡¼¥Ð¡¼¤ËÀܳ¤·¡¢
-@code{GRANT} ¥³¥Þ¥ó¥É¤Ç¥Ñ¥¹¥ï¡¼¥É¤òÊѹ¹¤·¤Þ¤¹¡£ @xref{GRANT,,@code{GRANT}}.
-@code{mysqladmin -h hostname -u user password 'new password'}
-¤Ç¤âÊѹ¹²Äǽ¤Ç¤¹¡£
-
-@item
-µö²Ä¥Æ¡¼¥Ö¥ë¤òÆɤ߹þ¤ß¤Þ¤¹¡§
-@code{mysqladmin -h hostname flush-privileges} ¤«¡¢SQL ʸ¤Î
-@code{FLUSH PRIVILEGES} ¤ò¼Â¹Ô¤·¤Þ¤¹¡£
-@end enumerate
-
-
-@node File permissions , Not enough file handles, Resetting permissions, Problems
-@section ¥Õ¥¡¥¤¥ë¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ÎÌäÂê
-
-¥Õ¥¡¥¤¥ë¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó¤ÎÌäÂ꤬¤¢¤ë¾ì¹ç¡¢
-Î㤨¤Ð¡¢¥Æ¡¼¥Ö¥ë¤ÎÀ¸À®»þ¤Ë @code{mysql} ¤¬¼¡¤ò½ÐÎϤ¹¤ë¾ì¹ç:
-
-@example
-ERROR: Can't find file: 'path/with/filename.frm' (Errcode: 13)
-@end example
-
-@tindex UMASK environment variable
-@tindex Environment variable, UMASK
-¤³¤ì¤Ï @code{UMASK} ´Ä¶­ÊÑ¿ô¤¬ @code{mysqld} µ¯Æ°»þ¤Ë´Ö°ã¤Ã¤Æ¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¤È¹Í¤¨¤é¤ì¤Þ¤¹¡£
-¥Ç¥Õ¥©¥ë¥È¤Î umask ¤Ï @code{0660} ¤Ç¤¹.
-¤³¤ì¤Ï°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ @code{safe_mysqld} Ω¤Á¾å¤²»þ¤ËÊѹ¹¤Ç¤­¤Þ¤¹:
-
-@example
-shell> UMASK=384 # = 600 in octal
-shell> export UMASK
-shell> /path/to/safe_mysqld &
-@end example
-
-@tindex UMASK_DIR environment variable
-@tindex Environment variable, UMASK_DIR
-By default @strong{MySQL} will create database and @code{RAID}
-directories with permission type 0700. You can modify this behaviour by
-setting the the @code{UMASK_DIR} variable. If you set this, new
-directories are created with the combined @code{UMASK} and
-@code{UMASK_DIR}. For example, if you want to give group access to
-all new directories, you can do:
-
-@example
-shell> UMASK_DIR=504 # = 770 in octal
-shell> export UMASK_DIR
-shell> /path/to/safe_mysqld &
-@end example
-
-@xref{Environment variables}.
-
-@node Not enough file handles, Using DATE, File permissions , Problems
-@section File not found
-
-@code{ERROR '...' not found (Errcode: 23)}, @code{Can't open file: ... (errno: 24)}
- ¤ä @code{errcode 23} @code{errno 24} ¤Î¥¨¥é¡¼¤ò @strong{MySQL} ¤«¤éÆÀ¤¿¾ì¹ç¡¢
-¤³¤ì¤Ï @strong{MySQL} ¤Ë½½Ê¬¤Ê¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤¬³ä¤êÅö¤Æ¤é¤ì¤Ê¤«¤Ã¤¿¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£
-@code{perror #} ¤Ï¤µ¤é¤ËÆɤߤ䤹¤¤·Á¼°¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òÍ¿¤¨¤Þ¤¹:
-
-@example
-shell> perror 23
-File table overflow
-shell> perror 24
-Too many open files
-@end example
-
-¤³¤ì¤Ï @code{mysqld} ¤¬Â¿¤¯¤Î¥Õ¥¡¥¤¥ë¤ò³«¤³¤¦¤È¤·¤¿¤³¤È¤Ëµ¯°ø¤·¤Þ¤¹¡£
-@code{mysqld} ¤Ë°ìÅ٤˳«¤¯¥Õ¥¡¥¤¥ë¿ô¤ò¿¤¯³«¤«¤Ê¤¤¤è¤¦¤·¤¿¤ê¡¢¤¢¤ë¤¤¤Ï¡¢
-@code{mysqld} ¤¬°·¤¨¤ë¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤Î¿ô¤òÍ¿¤¨¤¿¤ê¤Ç¤­¤Þ¤¹¡£
-
-@code{mysqld} ¤¬°ìÅ٤˳«¤¯¥Õ¥¡¥¤¥ë¤Î¿ô¤ò¾¯¤Ê¤¯¤¹¤ë¤Ë¤Ï¡¢@code{-O table_cache=32} ¥ª¥×¥·¥ç¥ó(¥Ç¥Õ¥©¥ë¥È¤Ï64)¤ò @code{safe_mysqld} ¤ËÍ¿¤¨¤ë¤³¤È¤Ç²Äǽ¤Ç¤¹¡£
-¤Þ¤¿¡¢@code{max_connections} ¤ÎÃÍ(¥Ç¥Õ¥©¥ë¥È¤Ï90)¤ò¾¯¤Ê¤¯¤¹¤ë¤Ê¤é¤Ð¡¢³«¤¯¥Õ¥¡¥¤¥ë¿ô¤â¾¯¤Ê¤¯¤Ç¤­¤Þ¤¹¡£
-
-@tindex ulimit
-@code{mysqld} ¤¬¼è¤ê°·¤¨¤ë¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤Î¿ô¤òÊѹ¹¤¹¤ë¤Ë¤Ï¡¢ @code{safe_mysqld} ¤òÊÔ½¸¤·¤Þ¤¹¡£
-¤³¤ÎÃæ¤Ë @code{ulimit -n 256} ¤¬¥³¥á¥ó¥È¥¢¥¦¥È¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-¤³¤Î¥³¥á¥ó¥È¤ò¤Ï¤º¤·(@code{'#'}ʸ»ú¤ò¾Ã¤¹)¡¢256 ¤ò @code{mysqld} ¤¬°·¤¦¿ô¤ËÊѹ¹¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@code{ulimit} ¤Ï¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤ÎÀ©¸ÂÆâ¤Ç¤·¤«¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤Î¿ô¤ò»ØÄê¤Ç¤­¤Þ¤»¤ó¡£
-¤â¤· OS ¤ÎÀ©¸Â°Ê¾å¤Ë¥Õ¥¡¥¤¥ëµ­½Ò»Ò¤Î¥ª¡¼¥×¥ó¿ô¤òÁý¤ä¤·¤¿¤¤¾ì¹ç¡¢
-¤ª»È¤¤¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Î¥É¥­¥å¥á¥ó¥È¤ò¸«¤ÆÂн褷¤Æ¤¯¤À¤µ¤¤¡£
-
-@code{tcsh} ¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¤Ï @code{ulimit} ¤ÏÆ°¤«¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡ª
-@code{tcsh} ¤Ï¸½ºß¤ÎÀ©¸Â¤ò¤¢¤Ê¤¿¤¬Ì䤤¹ç¤ï¤»¤Æ¤â¡¢°ã¤Ã¤¿ÃͤòÊó¹ð¤¹¤ë¤Ç¤·¤ç¤¦¡£
-¤³¤Î¾ì¹ç¡¢@code{safe_mysqld} ¤Ï @code{sh} ¤Çµ¯Æ°¤¹¤Ù¤­¤Ç¤¹¡ª
-
-
-@node Using DATE, Timezone problems, Not enough file handles, Problems
-@section @code{DATE} ¥Õ¥£¡¼¥ë¥É»ÈÍÑ»þ¤ÎÌäÂê
-
-ÆüÉÕ @code{DATE} ¤Î·Á¼°¤Ï @code{'YYYY-MM-DD'} ¤Ç¤¹¡£ANSI SQL ¤Ë½¾¤Ã¤Æ¼ÂºÝ¤Ë¤Ï¾¤Î¤Ïµö¤µ¤ì¤Þ
-¤»¤ó¡£¹¹¿·¤Þ¤¿¤Ï @code{SELECT} ʸÃæ¤Î WHERE ÀáÆâ¤Ç¤Ï¤³¤Î·Á¼°¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£¤¹¤Ê¤ï¤Á:
-
-@example
-mysql> SELECT * FROM tbl_name WHERE date >= '1997-05-05';
-@end example
-
-ÍøÊؤΤ¿¤á @strong{MySQL} ¤Ï¡¢ÆüÉÕ¤¬¿ôÃͤÎʸ̮¤Ç»ÈÍѤµ¤ì¤ë¤È¡¢ÆüÉÕ¤ò¼«Æ°Åª¤Ë¿ô
-ÃͤËÊÑ´¹¤·¤Þ¤¹¡£¤³¤ì¤Ë¤è¤ê¡¢¹¹¿·¤È @code{TIMESTAMP}, @code{DATE} ¤Þ¤¿¤Ï
-@code{DATETIME} ¥Õ¥£¡¼¥ë¥É¤Ç¤Î @code{WHERE} »þ¤Ë¡¢¤ï¤ê¤È¼«Í³¤ËÆüÉÕ¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-(¤³¤Îµ­½Ò¤òµö¤¹¤¿¤á¡¢¶çÆɵ­¹æ¤òÆüÉդΥ»¥Ñ¥ì¡¼¥¿¡¼¤È¤·¤Æ»ÈÍѤ·¤Þ¤¹¡£
-Î㤨¤Ð¡¢@code{'1998-08-15'} ¤È @code{'1998#08#15'} ¤ÏƱ°ì¤Ç¤¹.)
-¤â¤·¤í¤ó¥»¥Ñ¥ì¡¼¥¿¡¼¤Î¤Ê¤¤µ­½Ò(Î㡧@code{'19980815'})¤âÆüÉդȤ·¤ÆÊÑ´¹¤·¤Æ¤¯¤ì¤Þ¤¹¡£
-
-ÆÃÊ̤ÊÆüÉÕ @code{'0000-00-00'} ¤Ï @code{'0000-00-00'} ¤È¤·¤Æ³ÊǼ¤µ¤ì¼è¤ê½Ð¤µ¤ì¤Þ¤¹¡£
-@strong{MyODBC} ¤òÄ̤·¤Æ @code{'0000-00-00'} ÆüÉÕ¤ò»ÈÍѤ¹¤ë»þ¡¢@strong{MyODBC} 2.50.12 °Ê¾å¤Ç¤Ï¼«
-ưŪ¤Ë @code{NULL} ¤ËÊÑ´¹¤µ¤ì¤Þ¤¹¡£ODBC ¤Ï¤³¤ÎÆüÉդμïÎà¤ò°·¤¨¤Ê¤¤¤¿¤á¤Ç¤¹¡£
-
-¤³¤ì¤Ï¼¡¤¬Æ°¤¯¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹:
-
-@example
-mysql> INSERT INTO tbl_name (idate) VALUES (19970505);
-mysql> INSERT INTO tbl_name (idate) VALUES ('19970505');
-mysql> INSERT INTO tbl_name (idate) VALUES ('97-05-05');
-mysql> INSERT INTO tbl_name (idate) VALUES ('1997.05.05');
-mysql> INSERT INTO tbl_name (idate) VALUES ('1997 05 05');
-mysql> INSERT INTO tbl_name (idate) VALUES ('0000-00-00');
-
-mysql> SELECT idate FROM tbl_name WHERE idate >= '1997-05-05';
-mysql> SELECT idate FROM tbl_name WHERE idate >= 19970505;
-mysql> SELECT mod(idate,100) FROM tbl_name WHERE idate >= 19970505;
-mysql> SELECT idate FROM tbl_name WHERE idate >= '19970505';
-@end example
-
-@noindent
-¼¡¤ÏÆ°¤­¤Þ¤»¤ó:
-
-@example
-mysql> SELECT idate FROM tbl_name WHERE STRCMP(idate,'19970505')=0;
-@end example
-
-@code{STRCMP()} ¤Ïʸ»úÎó´Ø¿ô¤Ç¡¢@code{idate} ¤òʸ»ú¤ËÊÑ´¹¤·¤Æ¡¢Ê¸»úÈæ³Ó¤ò¹Ô¤¤¤Þ¤¹¡£
-@code{'19970505'} ¤ÏÆüÉդˤÏÊÑ´¹¤·¤Æ¤¯¤ì¤º¡¢ÆüÉÕ¤ÎÈæ³Ó¤â¹Ô¤¤¤Þ¤»¤ó¡£
-
-@strong{MySQL} ¤ÏÆüÉÕ¤¬Àµ¤·¤¤¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤·¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À
-¤µ¤¤¡£´Ö°ã¤Ã¤¿ÆüÉÕ(Î㤨¤Ð @code{'1998-2-31'})¤ò³ÊǼ¤¹¤ë¤È¡¢¤½¤Î´Ö°ã¤Ã¤¿ÆüÉÕ¤¬³ÊǼ
-¤µ¤ì¤Þ¤¹¡£ÆüÉÕ¤¬Á´ÂÎŪ¤ËÉÔ²Äǽ¤Ê¾ì¹ç¡¢@code{0} ¤¬ @code{DATE} ¥Õ¥£¡¼¥ë¥É¤Ë³ÊǼ¤µ¤ì¤Þ¤¹¡£
-¤³¤ì¤Ï¼ç¤Ë®ÅÙ¤ÎÌäÂê¤Ç¡¢ÆüÉդΥÁ¥§¥Ã¥¯¤Ï¥µ¡¼¥Ð¤Ç¤Ï¤Ê¤¯¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ç¤È²æ¡¹
-¤Ï¹Í¤¨¤Æ¤¤¤Þ¤¹¡£
-
-@cindex Timezone problems
-@tindex TZ environment variable
-@tindex Environment variable, TZ
-@node Timezone problems, Case sensitivity, Using DATE, Problems
-@section Timezone problems
-
-¤â¤· @code{SELECT NOW()} ¤¬¤¢¤Ê¤¿¤Î¥í¡¼¥«¥ë»þ´Ö¤Ç¤Ï¤Ê¤¯ GMT ¤òÊÖ¤¹¤Ê¤é¡¢
- @code{TZ} ´Ä¶­ÊÑ¿ô¤ò¥í¡¼¥«¥ë¤ÎTimezone ¤ËÀßÄꤷ¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-´Ä¶­ÊÑ¿ô¤ÎÀßÄê¤Ï¡¢¥µ¡¼¥Ð¡¼¤ò¼Â¹Ô¤¹¤ëÁ°¤Ë¹Ô¤ï¤ì¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-¤¿¤È¤¨¤Ð¡¢@code{safe_mysqld} ¤ä @code{mysql.server} ¥¹¥¯¥ê¥×¥È¤Ç
-¹Ô¤¤¤Þ¤¹¡£
-
-
-@cindex Case sensitivity, in searches
-@cindex Chinese
-@cindex Big5 Chinese character encoding
-@node Case sensitivity, Problems with NULL, Timezone problems, Problems
-@section ¸¡º÷»þ¤Î¥±¡¼¥¹°Í¸
-
-¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï @strong{MySQL} ¥Õ¥£¡¼¥ë¥É¤Ï¥±¡¼¥¹Èó°Í¸¤Ç¤¹ (¤·¤«¤·¡¢¥±¡¼¥¹Èó°Í
-¸¤Ë¤Ê¤é¤Ê¤¤¤¤¤¯¤Ä¤«¤Îʸ»ú¥»¥Ã¥È¤Ï¤¢¤ê¤Þ¤¹such as @code{czech})¡£
-¤³¤ì¤Ï¡¢@code{col_name LIKE 'a%'}
-¤Ç¸¡º÷¤·¤¿¾ì¹ç¡¢@code{A} ¤Þ¤¿¤Ï @code{a} ¤Ç»Ï¤Þ¤ëÁ´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤òÆÀ¤ë¤³¤È¤ò
-°ÕÌ£¤·¤Þ¤¹¡£¸¡º÷¤ò¥±¡¼¥¹°Í¸¤Ë¤·¤¿¤¤¤Î¤Ê¤é¡¢»Ï¤Þ¤ê¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤Ë¤Ï
-@code{INDEX(column, "A")=0} ¤Î¤è¤¦¤Ê¤³¤È¤ò¡¢¤Þ¤¿¡¢Ê¸»úÎóÁ´ÂΤ¬Æ±¤¸¤«¤É¤¦
-¤«¤Ë¤Ï @code{STRCMP(column, "A") = 0} ¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
-
-ñ½ã¤ÊÈæ³ÓÁàºî @code{>=, >, =, <, <=}¡¢¥½¡¼¥È¤½¤·¤Æ¥°¥ë¡¼¥×²½¤Ï¡¢Ê¸»ú ``sort value''
-¾å¤Ç¹Ô¤ï¤ì¤Þ¤¹¡£Æ±¤¸¥½¡¼¥ÈÃͤÎʸ»ú (like E, e and @'e)¤ÏƱ¤¸Ê¸»ú¤È
-¤·¤Æ°·¤ï¤ì¤Þ¤¹¡ª
-
-@code{LIKE} Èæ³Ó¤Ï³Æʸ»ú¤ÎÂçʸ»ú¤Ç¹Ô¤ï¤ì¤Þ¤¹
-(E == e but E <> @'e)
-
-@code{column} ¤ò¤¤¤Ä¤Ç¤â¥±¡¼¥¹°Í¸¤Ç°·¤¤¤¿¤¤¾ì¹ç¤Ï¡¢¤½¤ì¤ò @code{BINARY}
-¤È¤·¤ÆÀë¸À¤·¤Æ¤¯¤À¤µ¤¤¡£@xref{CREATE TABLE, , @code{CREATE TABLE}}.
-
-big5 ¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°¤È¸Æ¤Ð¤ì¤ëÃæ¹ñ¸ì¥Ç¡¼¥¿¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢Á´¤Æ¤Î
-ʸ»ú¹àÌܤò @code{BINARY} ¤Ë¤·¤Æ¤¯¤À¤µ¤¤¡£¤³¤ì¤Ï¡¢big5 ¥¨¥ó¥³¡¼¥Ç¥£¥ó¥°Ê¸
-»ú¤Î¥½¡¼¥È½ç¤¬ ascii ¥³¡¼¥É¤¬´ð¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤¿¤á¡¢µ¡Ç½¤·¤Þ¤¹¡£
-
-
-@cindex NULL values vs. empty values
-@tindex NULL
-@node Problems with NULL, Problems with alias, Case sensitivity, Problems
-@section @code{NULL} ÃͤǤÎÌäÂê
-
-SQL ¤Î½é¿´¼Ô¤Î¤¢¤ê¤¬¤Á¤Êº®Íð¤Ï¡¢@code{NULL} Ãͤ¬¶õʸ»úÎó @code{''} ¤ÈƱ¤¸Êª¤À¤È¹Í¤¨¤ë¤³
-¤È¤Ç¤¹¡£¤³¤ì¤ÏÀµ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡ª Î㤨¤Ð¡¢¼¡¤Î¥¹¥Æ¡¼¥È¥á¥ó¥È¤ÏÁ´¤¯Ê̤Τâ
-¤Î¤Ç¤¹:
-
-@example
-mysql> INSERT INTO my_table (phone) VALUES (NULL);
-mysql> INSERT INTO my_table (phone) VALUES ("");
-@end example
-
-ξÊý¤Îʸ¤È¤â @code{phone} ¥Õ¥£¡¼¥ë¥É¤ËÃͤòÁÞÆþ¤·¤Æ¤¤¤Þ¤¹¤¬¡¢
-½é¤á¤Î¤Ï @code{NULL} ÃͤòÁÞÆþ¤·¡¢ÆóÈÖÌܤΤ϶õʸ»úÎó¤òÁÞÆþ¤·¤Æ¤¤¤Þ¤¹¡£
-½é¤á¤Î¤Ï ``ÅÅÏÃÈÖ¹æ¤òÃΤé¤Ê¤¤'' ¤È¸«¤Ê¤µ¤ì¡¢ÆóÈÖÌÜ¤Î¤Ï ``Èà½÷¤ÏÅÅÏäò
-»ý¤Ã¤Æ¤¤¤Ê¤¤'' ¤È¸«¤Ê¤µ¤ì¤Þ¤¹¡£
-
-SQL ¤Ç¤Ï¡¢ @code{NULL} ¤Ï¾¤ÎÁ´¤Æ¤ÎÃÍ(¤¿¤È¤¨ @code{NULL} ¤Ç¤â)¤ÈÈæ³Ó¤·¤¿»þ¤Ë¡¢¾ï¤Ëµ¶¤Ë
-¤Ê¤ëÃͤǤ¹¡£ @code{NULL} ¤ò´Þ¤à¼°¤Ï¡¢ÆäËÃǤ꤬¤Ê¤±¤ì¤Ð¡¢¾ï¤Ë @code{NULL} ÃͤòÀ¸À®¤·¤Þ
-¤¹¡£¼¡¤Î¹àÌܤÏÁ´¤Æ @code{NULL} ¤òÊÖ¤·¤Þ¤¹:
-
-@example
-mysql> SELECT NULL,1+NULL,CONCAT('Invisible',NULL);
-@end example
-
-@code{NULL} Ãͤ¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ë¹àÌܤò¸¡º÷¤¹¤ë¾ì¹ç¡¢
- @code{=NULL} ¥Æ¥¹¥È¤ò¹Ô¤ï¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£
-¤³¤ì¤Ï @code{expr = NULL} ¤¬ FALSE ¤Ê¤Î¤Ç¡¢¤Ê¤ó¤Î¹Ô¤âÊÖ¤·¤Þ¤»¤ó¡£
-Î㤨¤Ð°Ê²¼¤ÎÎ㡧
-
-@example
-mysql> SELECT * FROM my_table WHERE phone = NULL;
-@end example
-
-@code{NULL} Ãͤò»ý¤Ä¥Õ¥£¡¼¥ë¥É¤ò¸¡º÷¤·¤¿¤¤¾ì¹ç¤Ï¡¢@code{IS NULL} ¥Æ¥¹¥È¤ò»ÈÍѤ·¤Ê¤¯¤Æ¤Ï¤¤¤±¤Þ
-¤»¤ó¡£¼¡¤Ï @code{NULL} ÅÅÏÃÈÖ¹æ¤È¶õ¤ÎÅÅÏÃÈÖ¹æ¤ò¸«¤Ä¤±¤ëÊýË¡¤ò¼¨¤·¤Æ¤¤¤Þ¤¹:
-
-@example
-mysql> SELECT * FROM my_table WHERE phone IS NULL;
-mysql> SELECT * FROM my_table WHERE phone = "";
-@end example
-
-@strong{MySQL} ¤Ç¤Ï¡¢Â¾¤Î¿¤¯¤Î SQL ¥µ¡¼¥Ð¤Î¤è¤¦¤Ë¡¢@code{NULL} Ãͤò»ý¤Ä
-¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥£¡¼¥ë¥É¤ò»ý¤Æ¤Þ¤»¤ó¡£¤³¤ì¤é¤Î¥Õ¥£¡¼¥ë¥É¤Ï @code{NOT NULL} ¤ÈÀë¸À¤·¤Ê
-¤¯¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£
-¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¡¢@code{NULL} ¤òÀßÄꤹ¤ë¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£
-
-@findex LOAD DATA INFILE
-@code{LOAD DATA INFILE} ¤Ç¥Ç¡¼¥¿¤òÆɤ߹þ¤à¤È¤­¤Ï¡¢¶õ¤Î¥Õ¥£¡¼¥ë¥É¤Ï @code{''} ¤Ç¹¹¿·¤µ¤ì¤Þ¤¹¡£
-¹àÌܤò @code{NULL} Ãͤˤ·¤¿¤¤¾ì¹ç¤Ï¡¢¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ëÃæ¤Ë @code{\N} ¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£
-¥ê¥Æ¥é¥ë¤È¤·¤Æ¤Î @code{'NULL'} ¸ì¤¬¡¢¤¢¤ë¾õ¶·²¼¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤Þ¤¹¡£
-@xref{LOAD DATA, , @code{LOAD DATA}}.
-
-@code{ORDER BY} »ÈÍÑ»þ, @code{NULL} ÃͤϺǽé¤ËÄ󼨤µ¤ì¤Þ¤¹.
-@code{DESC} ¤ò»ÈÍѤ·¤Æ¹ß½ç¤Ë¥½¡¼¥È¤¹¤ë»þ¡¢@code{NULL} ÃͤϺǸå¤Ë¤Ê¤ê¤Þ¤¹¡£
-@code{GROUP BY} »ÈÍÑ»þ, Á´¤Æ¤Î @code{NULL} ÃͤÏÅù¤·¤¤¤È¸«¤Ê¤µ¤ì¤Þ¤¹¡£
-
-@code{NULL} ½èÍý¤ò¼ê½õ¤±¤¹¤ë¤¿¤á¡¢¼¡¤Î´Ø¿ô¤ò»ÈÍѤǤ­¤Þ¤¹:
-@code{IS NULL}, @code{IS NOT NULL}, @code{IFNULL()}.
-
-@cindex @code{TIMESTAMP}, and @code{NULL} values
-@cindex @code{AUTO_INCREMENT}, and @code{NULL} values
-@cindex @code{NULL} values, and @code{TIMESTAMP} columns
-@cindex @code{NULL} values, and @code{AUTO_INCREMENT} columns
-¤¤¤¯¤Ä¤«¤Î¹àÌÜ·¿¤Ç¤Ï¡¢@code{NULL} Ãͤϥϥó¥É¥ë¤È¤·¤Æ°·¤ï¤ì¤Þ¤¹¡£
-¤â¤·¥Æ¡¼¥Ö¥ëÆâ¤ÎºÇ½é¤Î @code{TIMESTAMP} ¹à¤Ë @code{NULL} ¤òÁÞÆþ¤¹¤ë¤Ê¤é¡¢
-¸½ºß¤ÎÆüÉդȻþ¹ï¤¬ÁÞÆþ¤µ¤ì¤Þ¤¹¡£¤â¤· @code{AUTO_INCREMENT} ¹à¤Ë@code{NULL} ÃͤòÁÞÆþ¤¹¤ë¤Ê¤é¡¢
-¼¡¤Î¥·¡¼¥±¥ó¥¹Èֹ椬ÁÞÆþ¤µ¤ì¤Þ¤¹¡£
-
-@tindex alias
-@node Problems with alias, Deleting from related tables, Problems with NULL, Problems
-@section @code{alias} ¤ÎÌäÂê
-
-@code{GROUP BY}, @code{ORDER BY}, @code{HAVING} Àá¤Ë¤ª¤¤¤Æ
-¹àÌܤò»²¾È¤¹¤ë¤ËÅö¤¿¤ê¥¨¥¤¥ê¥¢¥¹¤¬»ÈÍѤǤ­¤Þ¤¹¡£
-¥¨¥¤¥ê¥¢¥¹¤Ï¹àÌܤȤ·¤Æ¤è¤êÎɤ¤Ì¾¾Î¤òÍ¿¤¨¤ë¤Î¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡§
-
-@example
-SELECT SQRT(a*b) as rt FROM table_name GROUP BY rt HAVING rt > 0;
-SELECT id,COUNT(*) AS cnt FROM table_name GROUP BY id HAVING cnt > 0;
-SELECT id AS "Customer identity" FROM table_name;
-@end example
-
- ANSI SQL ¤¬ @code{WHERE} ÀáÆâ¤Ç¥¨¥¤¥ê¥¢¥¹¤ò»²¾È¤¹¤ë¤³¤È¤ò
-µö²Ä¤·¤Æ¤¤¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£¤³¤ì¤Ï @code{WHERE} ¤¬¼Â¹Ô¤µ¤ì¤ë»þÅÀ¤Ç
-¹àÌܤÎÃͤ¬¤Þ¤À·èÄꤵ¤ì¤Æ¤¤¤Ê¤¤¤«¤é¤Ç¤¹¡£Î㤨¤Ð¡¢°Ê²¼¤Î¥¯¥¨¥ê¤Ï @strong{¤¢¤ä¤Þ¤ê¤Ç¤¹}¡§
-
-@example
-SELECT id,COUNT(*) AS cnt FROM table_name WHERE cnt > 0 GROUP BY id;
-@end example
-
-¤É¤Î¹Ô¤¬ @code{GROUP BY} ¤Ë´Þ¤Þ¤ì¤ë¤«¤ò·è¤á¤ë¤¿¤á¤Ë @code{WHERE} ¹½Ê¸¤¬
-¼Â¹Ô¤µ¤ì¤ë°ìÊý¤Ç¡¢
-ÆÀ¤é¤ì¤¿·ë²Ì¤Î¤É¤Î¹Ô¤ò»È¤¦¤«³ÎÄꤹ¤ë¤¿¤á¤Ë @code{HAVING} ¤¬»ÈÍѤµ¤ì¤Þ¤¹¡£
-
-
-@node Deleting from related tables, No matching rows, Problems with alias, Problems
-@section Deleting rows from related tables
-
-@strong{MySQL} ¤Ï¸½ºß sub-select ¤Ï̤¥µ¥Ý¡¼¥È¤Ç¡¢¤Þ¤¿
- @code{DELETE} ¹½Ê¸¤ÇÊ£¿ô¤Î¥Æ¡¼¥Ö¥ë¤ò°·¤¦»ö¤â¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Þ¤»¤ó¡£
-¤·¤¿¤¬¤Ã¤Æ¡¢£²¤Ä¤Î¥Æ¡¼¥Ö¥ë¤Ë´ØÏ¢¤¹¤ë¥ì¥³¡¼¥É¤ò¾Ã¤¹¤Ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ¹Ô¤¤¤Þ¤¹¡§
-
-@enumerate
-@item
-¤¤¤¯¤Ä¤«¤Î @code{WHERE} ¾ò·ï¤ò»ÈÍѤ·¤Æ¡¢´ðËܤȤʤë¥Æ¡¼¥Ö¥ë¤«¤é¹Ô¤ò @code{SELECT}
-@item
-Ʊ¤¸¾ò·ï²¼¤Ç¡¢´ðËܤȤʤë¥Æ¡¼¥Ö¥ë¤Ë´Þ¤Þ¤ì¤ë¹Ô¤ò @code{DELETE}
-@item
-@code{DELETE FROM related_table WHERE related_column IN (selected_rows)}
-@end enumerate
-
-@code{related_column} ¤Î¥¯¥¨¥ê¤Î¹ç·×ʸ»ú¿ô¤¬¡¢1,048,576 (¥Ç¥Õ¥©¥ë¥È¤Ï @code{max_allowed_packet} ¤ÎÃÍ) ¤ò¤³¤¨¤ë¾ì¹ç¡¢
-¤½¤ì¤ò¤¤¤¯¤Ä¤«¤Ëʬ³ä¤·¤Æ¡¢Ê£¿ô¤Î @code{DELETE} ¹½Ê¸¤Ë¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-
-@code{related_column} ¤¬¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ç¡¢100-1000 ¤Î@code{related_column}¤À¤±¤ò¾Ã¤¹¾ì¹ç¡¢
-¤è¤ê¤Ï¤ä¤¯ @code{DELETE} ¤Ç¤­¤Þ¤¹¡£
-¤â¤· @code{related_column} ¤¬¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ç¤Ê¤¤¾ì¹ç¡¢¤½¤Î®ÅÙ¤Ï @code{IN} Àá¤Î°ú¿ô¤Î¿ô¤Ë̵´Ø·¸¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-
-@node No matching rows, ALTER TABLE problems, Deleting from related tables, Problems
-@section Solving problems with no matching rows
-
-Ê£»¨¤Ê¥¯¥¨¥ê¡¼¤ò¹Ô¤Ã¤Æ¡¢¤â¤·¤Ê¤ó¤Î·ë²Ì¤âÊÖ¤µ¤Ê¤±¤ì¤Ð¡¢
-¤½¤Î¥¯¥¨¥ê¡¼¤Î²¿¤¬°­¤¤¤«¤ò¸«¤Ä¤±¤ë¤¿¤á¡¢°Ê²¼¤Î¼ê³¤­¤ò¹Ô¤¤¤Þ¤¹¡§
-
-@enumerate
-@item
-@code{EXPLAIN} ¤ò»ÈÍѤ·¤Æ¥¯¥¨¥ê¡¼¤ò¥Æ¥¹¥È¤·¡¢ÌÀÇò¤Ê´Ö°ã¤¤¤ò¸«¤Ä¤±¤Þ¤¹¡£
-@xref{EXPLAIN, , @code{EXPLAIN}}.
-
-@item
-@code{WHERE} Àá¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë¥Õ¥£¡¼¥ë¥É¤À¤±¤ò Select ¤·¤Æ¤ß¤Þ¤¹
-
-@item
-·ë²Ì¤¬Ê֤äƤ¯¤ë¤Þ¤Ç¡¢°ì¤Ä°ì¤Ä¥¯¥¨¥ê¡¼¤«¤é¥Æ¡¼¥Ö¥ë¤ò¼è¤ê½ü¤¤¤Æ¤¤¤­¤Þ¤¹¡£
-¥Æ¡¼¥Ö¥ë¤¬Â礭¤¤¾ì¹ç¡¢@code{LIMIT 10} ¤ò¥¯¥¨¥ê¡¼¤Ç»ÈÍѤ¹¤ë¤³¤È¤ÏÎɤ¯¤¢¤ê¤Þ¤»¤ó¡£
-
-@item
-¹Ô¤Ë¥Þ¥Ã¥Á¤¹¤Ù¤­¤Ç¤¢¤í¤¦¹à¤ò @code{SELECT} ¤·¤Æ¤ß¤Þ¤¹¡£
-¤½¤Î¾ì¹ç¡¢select ¤¹¤ë¤Î¤Ï¡¢¾åµ­¤ÇºÇ¸å¤Ë¼è¤ê½ü¤¤¤¿¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ¹Ô¤¤¤Þ¤¹¡£
-
-@item
-¤â¤· @code{FLOAT} ¤« @code{DOUBLE} ·¿¤Î¤â¤Î¤ò¿ô»ú¤ÈÈæ³Ó¤¹¤ë¤Ê¤é¡¢
- @code{=} ¤Ï»ÈÍѤ·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡ª¤³¤ì¤Ï¤Û¤È¤ó¤É¤Î¥³¥ó¥Ô¥å¡¼¥¿¸À¸ì¤Ë¤ª¤¤¤Æ¡¢
-ÉâÆ°¾®¿ôÅÀ¤ÎÃͤϤԤ俤ê¤ÎÃͤˤʤé¤Ê¤¤¤«¤é¤Ç¤¹¡£
-
-@example
-mysql> SELECT * FROM table_name WHERE float_column=3.5;
- ->
-mysql> SELECT * FROM table_name WHERE float_column between 3.45 and 3.55;
-@end example
-
-In most cases, changing the @code{FLOAT} to a @code{DOUBLE} will fix this!
-
-@item
-¤â¤·¤Ê¤Ë¤â°­¤¤¤È¤³¤í¤ò¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Ê¤«¤Ã¤¿¾ì¹ç¡¢
-¾®¤µ¤Ê¥Æ¥¹¥È¤ò¤Ä¤¯¤Ã¤Æ @code{mysql test < query.sql} ¤ò¹Ô¤Ã¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£
-@code{mysqldump --quick database tables > query.sql} ¤Ç¥Æ¥¹¥È¥Õ¥¡¥¤¥ë¤òºîÀ®¤Ç¤­¤Þ¤¹¡£
-¤³¤Î¥Õ¥¡¥¤¥ë¤ò¥¨¥Ç¥£¥¿¡¼¤ÇÊÔ½¸¤·¡¢¤¤¤¯¤Ä¤«¤Îinsert¹Ô¤ò(¿¤¹¤®¤ë¤Ê¤é)¾Ã¤·¤Þ¤¹¡£
-¤½¤·¤Æ¥Õ¥¡¥¤¥ë¤ÎºÇ¸å¤Ëselect¹½Ê¸¤òÉÕ¤±Â­¤·¤Þ¤¹¡£
-
-¥Æ¥¹¥È¤ò¹Ô¤¦¤Ë¤Ï¡§
-
-@example
-shell> mysqladmin create test2
-shell> mysql test2 < query.sql
-@end example
-
-@code{mysqlbug} ¤ò»ÈÍѤ·¤Æ @email{mysql@@lists.mysql.com} ¤Ë¥Æ¥¹¥È¤òÅê¹Æ¤·¤Æ¤¯¤À¤µ¤¤¡£
-@end enumerate
-
-@node ALTER TABLE problems, Change column order, No matching rows, Problems
-@section Problems with @code{ALTER TABLE}.
-
-¤â¤· @code{ALTER TABLE} ¤¬°Ê²¼¤Î¤è¤¦¤Ê¥¨¥é¡¼¤Ç»à¤ó¤À¾ì¹ç¡§
-
-@example
-Error on rename of './database/name.frm' to './database/B-a.frm' (Errcode: 17)
-@end example
-
-¤³¤ì¤Ï°ÊÁ°¤Î @code{ALTER TABLE} ¤Ç @strong{MySQL} ¤¬¥¯¥é¥Ã¥·¥å¤·¤Æ¤ª¤ê¡¢
-@file{A-something} ¤« @file{B-something} ¤È¤¤¤¦Ì¾Á°¤Î¡¢¸í¤Ã¤¿¾ðÊó¤òή¤·¤Æ¤¤¤ë
-¸Å¤¤¥Æ¡¼¥Ö¥ë¤¬Â¸ºß¤·¤Æ¤¤¤Þ¤¹¡£
-¤³¤Î¾ì¹ç¡¢@strong{MySQL} ¥Ç¡¼¥¿¥Ç¥£¥ì¥¯¥È¥ê¤ËÆþ¤ê¡¢@code{A-} ¤ä @code{B-} ¤Ç»Ï¤Þ¤ë
-̾Á°¤ò»ý¤Ä¥Õ¥¡¥¤¥ë¤òÁ´¤Æ¾Ã¤·¤Þ¤¹¡£
-(¾Ã¤¹Âå¤ï¤ê¤Ë¤É¤³¤«¤Ë°ÜÆ°¤·¤Æ¤â¹½¤¤¤Þ¤»¤ó¡£)
-
-@code{ALTER TABLE} ¤Ï°Ê²¼¤Î¤è¤¦¤ËÆ°ºî¤·¤Þ¤¹:
-
-@itemize @bullet
-@item Êѹ¹Í×µá¤Î¤¢¤Ã¤¿ @file{A-xxx} ¤È¤¤¤¦Ì¾Á°¤Î¿·¤·¤¤¥Æ¡¼¥Ö¥ë¤òºîÀ®¡£
-@item ¸µ¤Î¥Æ¡¼¥Ö¥ëÆâ¤ÎÁ´¤Æ¤Î¹Ô¤ò @file{A-xxx} ¤Ë¥³¥Ô¡¼¡£
-@item ¸µ¤Î¥Æ¡¼¥Ö¥ë¤ò @file{B-xxx} ¤Ë̾¾ÎÊѹ¹¡£
-@item @file{A-xxx} ¤Ï¸µ¤Î¥Æ¡¼¥Ö¥ë̾¤Ë̾¾ÎÊѹ¹¤µ¤ì¤ë¡£
-@item @file{B-xxx} ¤Ï¾Ãµî¤µ¤ì¤ë¡£
-@end itemize
-
-¤â¤·Ì¾¾ÎÊѹ¹¤ÎºÝ¤ËÌäÂ꤬¤¢¤ë¤È¡¢@strong{MySQL} ¤ÏÊѹ¹¤ò¼è¤ê¾Ã¤¹¤è¤¦¤ËÆ°¤­¤Þ¤¹¡£
-Ã×̿Ū¤ÊÌäÂ꤬µ¯¤­¤¿¾ì¹ç(¤¢¤ê¤¨¤Þ¤»¤ó¤¬)¡¢@strong{MySQL} ¤Ï¸µ¤Î¸Å¤¤¥Æ¡¼¥Ö¥ë¤ò
- @file{B-xxx} ¤È¤¤¤¦Ì¾Á°¤Î¤Þ¤Þ¤Ë¤·¤Æ¤ª¤­¤Þ¤¹¡£Ã±¤Ë̾¾ÎÊѹ¹¤¹¤ì¤Ð¥Ç¡¼¥¿¤ÏÌá¤ê¤Þ¤¹¡£
-
-@node Change column order, , ALTER TABLE problems, Problems
-@section How to change the order of columns in a table
-
-The whole point of SQL is to abstract the application from the data
-storage format. You should always specify the order in wish you wish to
-retrieve your data. For example:
-
-@example
-SELECT col_name1, col_name2, col_name3 FROM tbl_name;
-@end example
-
-will return columns in the order @code{col_name1}, @code{col_name2}, @code{col_name3}, whereas:
-
-@example
-SELECT col_name1, col_name3, col_name2 FROM tbl_name;
-@end example
-
-will return columns in the order @code{col_name1}, @code{col_name3}, @code{col_name2}.
-
-You should @strong{NEVER}, in an application, use @code{SELECT *} and
-retrieve the columns based on their position, because the order in which columns are
-returned @strong{CANNOT} be guaranteed over time; A simple change to
-your database may cause your application to fail rather dramatically.
-
-If you want to change the order of columns anyway, you can do it as follows:
-
-@enumerate
-@item
-Create a new table with the columns in the right order.
-@item
-Execute
-@code{INSERT INTO new_table SELECT fields-in-new_table-order FROM old_table}.
-@item
-Drop or rename @code{old_table}
-@item
-@code{ALTER TABLE new_table RENAME old_table}
-@end enumerate
-
-@node Common problems, Clients, Problems, Top
-@chapter Solving some common problems with @strong{MySQL}
-
-@cindex Replication
-@menu
-* Log Replication:: ¹¹¿·¥í¥°¤ò»ÈÍѤ·¤¿¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÊ£À½
-* Backup:: ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Ð¥Ã¥¯¥¢¥Ã¥×
-* Update log:: The update log
-* Multiple servers:: Ʊ°ì¥Þ¥·¥ó¾å¤ËÊ£¿ô¤Î @strong{MySQL} ¥µ¡¼¥Ð¡¼¤òÁö¤é¤»¤ë
-@end menu
-
-@cindex Database replication
-@cindex Log Replication, database
-@node Log Replication, Backup, Common problems, Common problems
-@section ¹¹¿·¥í¥°¤ò»ÈÍѤ·¤¿¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÊ£À½
-
-Now that master-slave internal replication is available starting in 3.23.15, this is the recommended way.
-However, it is still possible to replicate a database by using the update log.
-@xref{Update log}. ¤³¤ì¤Ï¡¢°ì¤Ä¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬¥Þ¥¹¥¿¡¼(¼ç)¤È¤·¤ÆÆ°ºî¤Õ¤ë¤Þ¤Ã¤Æ¤ª¤ê
-(Á´¤Æ¤Î¥Ç¡¼¥¿Êѹ¹¤¬¤³¤³¤Ç¹Ô¤ï¤ì¤Þ¤¹)¡¢¤«¤Ä¡¢°ì¤Ä°Ê¾å¤Î¾¤Î¥µ¡¼¥Ð¡¼¤¬¥¹¥ì¡¼¥Ö(½¾)¤È
-¤·¤ÆÆ°ºî¤·¤Æ¤¤¤ë¤³¤È¤òÍ׵ᤷ¤Þ¤¹¡£
-¥¹¥ì¡¼¥Ö¤ò¹¹¿·¤¹¤ë¤Ë¤Ï
-@code{mysql < update_log} ¤ò¼Â¹Ô¤¹¤ë¤À¤±¤Ç¤¹¡£
-¥¹¥ì¡¼¥Ö¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Û¥¹¥È¡¢¥æ¡¼¥¶¡¼¡¢¥Ñ¥¹¥ï¡¼¥É¤ò¥³¥Þ¥ó¥É¤Î¥ª¥×¥·¥ç¥ó¤ËÍ¿¤¨¡¢
-¥Þ¥¹¥¿¡¼¤«¤é¼èÆÀ¤·¤¿¹¹¿·¥í¥°¤òÆþÎϤ˻ÈÍѤ·¤Þ¤¹¡£
-
-¤â¤·¡¢¥Æ¡¼¥Ö¥ë¤«¤é¤Ê¤Ë¤âºï½ü¤·¤Ê¤¤¾ì¹ç¡¢ @code{TIMESTAMP} ¥Õ¥£¡¼¥ë¥É¤ò»ÈÍѤ¹¤ì¤Ð¡¢
-ºÇ¸å¤ÎÊ£À½»þ°Ê¸å¤Ë¡¢¿·µ¬¤ËÁÞÆþ¤µ¤ì¤¿¤â¤Î¤äÊѹ¹¤µ¤ì¤¿¤â¤Î¤À¤±¤ò
-¥ß¥é¡¼¥µ¡¼¥Ð¡¼¤Ë¥³¥Ô¡¼¤Ç¤­¤Þ¤¹¡£(ºÇ¸å¤ÎÊ£À½¤ò¹Ô¤Ã¤¿»þ´Ö¤ÈÈæ³Ó¤¹¤ì¤ÐÃê½Ð¤Ç¤­¤Þ¤¹)
-
-¹¹¿·¥í¥°(ºï½ü¤Î¤¿¤á)¤È¥¿¥¤¥à¥¹¥¿¥ó¥×(Ç)¤ÎξÊý¤ò»ÈÍѤ¹¤ë2¤Ä¤ÎÊýË¡¤Î
-¹¹¿·¥·¥¹¥Æ¥à¤òºî¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤·¤«¤·¤³¤Î¾ì¹ç¤Ï¡¢Æ±¤¸¥Ç¡¼¥¿¤¬Î¾Â¦¤ÇÊÑ
-¹¹¤µ¤ì¤¿»þ¤Ë¡¢¤¢¤Ê¤¿¤¬¾×ÆͤòÁàºî¤Ç¤­¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£¤¢¤Ê¤¿¤Ï¤ª¤½¤é¤¯
-²¿¤¬¹¹¿·¤µ¤ì¤¿¤«¤ò·èÄꤹ¤ë¤Î¤ò½õ¤±¤ë¤¿¤á¤Ë¡¢¸Å¤¤¥Ð¡¼¥¸¥ç¥ó¤òÊÝ»ý¤·¤¿¤¤¤Ç
-¤·¤ç¤¦¡£
-
-¤³¤Î»þ¹Ô¤¦Ê£À½¤Ë¤Ï SQL ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ç¹Ô¤ï¤ì¤ë¤¿¤á¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¹¹¿·¤¹
-¤ë¥¹¥Æ¡¼¥È¥á¥ó¥ÈÃæ¤Ç¼¡¤Î´Ø¿ô¤Ï»È¤Ã¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£¤³¤ì¤é¤Ï¾¤Î
-¥³¥Ô¡¼¸µ¤Î¥µ¡¼¥Ð¤È¤Ï°ã¤¦ÃͤòÊÖ¤¹¤«¤é¤Ç¤¹:
-
-@itemize @bullet
-@item @code{DATABASE()}
-@item @code{GET_LOCK()} and @code{RELEASE_LOCK()}
-@item @code{RAND()}
-@item @code{USER()}, @code{SYSTEM_USER()} or @code{SESSION_USER()}
-@item @code{VERSION()}, @code{CONNECT_ID()}
-@end itemize
-
-Á´¤Æ¤Î»þ¹ï´Ø¿ô¤Ï¡¢É¬Íפʾì¹ç¤Ë¥ß¥é¡¼¤Ë¥¿¥¤¥à¥¹¥¿¥ó¥×¤òÁ÷¤ë¤è¤¦¤Ë¤·¤Æ¡¢°Â
-Á´¤Ë»ÈÍѤǤ­¤Þ¤¹¡£@code{LAST_INSERT_ID()} ¤â°ÂÁ´¤Ë»ÈÍѤǤ­¤Þ¤¹¡£
-
-
-@cindex Backups
-@node Backup, Update log, Log Replication, Common problems
-@section ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Ð¥Ã¥¯¥¢¥Ã¥×
-
-@strong{MySQL} ¥Æ¡¼¥Ö¥ë¤Ï¥Õ¥¡¥¤¥ë¤È¤·¤Æ³ÊǼ¤µ¤ì¤ë¤¿¤á¡¢¥Ð¥Ã¥¯¥¢¥Ã¥×¤ò¹Ô
-¤¦¤Î¤Ï´Êñ¤Ç¤¹¡£Ì·½â¤Î¤Ê¤¤¥Ð¥Ã¥¯¥¢¥Ã¥×¤òÆÀ¤ë¤¿¤á¤Ë¤Ï¡¢@code{LOCK TABLES}
-¤ò´ØÏ¢¤¹¤ë¥Æ¡¼¥Ö¥ë¤Ç¹Ô¤Ã¤Æ¤¯¤À¤µ¤¤¡£@xref{LOCK TABLES, , @code{LOCK TABLES}}.
-Æɤ߹þ¤ß¥í¥Ã¥¯¤À
-¤±¤¬É¬ÍפʤΤǡ¢¤½¤Î¥Æ¡¼¥Ö¥ë¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤Î¥Õ¥¡¥¤¥ë¤Î¥³¥Ô¡¼
-¤¬¹Ô¤ï¤ì¤Æ¤¤¤ë´Ö¤â¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤Ï¥¯¥¨¥ê¤ò·Ñ³¤Ç¤­¤Þ¤¹¡£¤â¤·¤¯¤Ï¡¢¥Æ¡¼¥Ö¥ë¤ò
-SQL ¥ì¥Ù¥ë¤Ç¥Ð¥Ã¥¯¥¢¥Ã¥×¤·¤¿¤¤¤Î¤Ç¤¢¤ì¤Ð¡¢@code{SELECT INTO OUTFILE} ¤ò»È
-ÍѤǤ­¤Þ¤¹¡£
-
-¾¤ÎÊýË¡¤Ï @code{mysqldump} ¥×¥í¥°¥é¥à¤ò»ÈÍѤ¹¤ë¤³¤È¤Ç¤¹:
-
-@enumerate
-@item
-¥Õ¥ë¥Ð¥Ã¥¯¥¢¥Ã¥×¤ò¤È¤ë¤Ë¤Ï¡§
-
-@example
-shell> mysqldump --tab=/path/to/some/dir --opt --full
-@end example
-
-¼ã¤·¥µ¡¼¥Ð¡¼¤¬¤¤¤Ã¤µ¤¤¥Ç¡¼¥¿¤ÎÊѹ¹¤ò¤·¤Ê¤¤¤Î¤Ç¤¢¤ì¤Ð¡¢
-ñ¤ËÁ´¤Æ¤Î¥Æ¡¼¥Ö¥ë¥Õ¥¡¥¤¥ë(@file{*.frm}, @file{*.MYD}, @file{*.MYI} files)¤ò
-¥³¥Ô¡¼¤¹¤ë¤À¤±¤Ç¤â¹½¤¤¤Þ¤»¤ó¡£
-The script @code{mysqlhotcopy} does use this method.
-
-@item
-@cindex Log file, names
-@code{mysqld} ¤ò»ß¤á¡¢¤½¤·¤Æ @code{--log-update[=file_name]} ¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤Æµ¯Æ°¤·¤Þ¤¹¡£
-@xref{Update log}. ¥í¥°¥Õ¥¡¥¤¥ë¤Ï¡¢ @code{mysqldump} ¼Â¹Ô¸å¤Ë¹Ô¤ï¤ì¤¿¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÊѹ¹¤ò
-Ê£À½¤¹¤ë¤¿¤á¤Î¾ðÊó¤òÍ¿¤¨¤Æ¤¯¤ì¤Þ¤¹¡£
-@end enumerate
-
-¤â¤·¥ê¥¹¥È¥¢¤ò¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¾ì¹ç¡¢¤Þ¤ººÇ½é¤Ë @code{myisamchk -r} ¤ò¼Â¹Ô¤·¤Æ
-¥Æ¡¼¥Ö¥ë¤Î½¤Éü¤ò»î¤ß¤Æ¤¯¤À¤µ¤¤¡£
-¤Û¤È¤ó¤É¤Î¾ì¹ç¡¢99.9% ½¤Éü¤Ï¤Ç¤­¤ë¤Ï¤º¤Ç¤¹¡£
-¤â¤· @code{myisamchk} ¤¬¼ºÇÔ¤·¤¿¾ì¹ç¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-(This will only work if you have started @strong{MySQL} with
-@code{--log-update}. @xref{Update log}.)
-
-@enumerate
-@item
-¥ª¥ê¥¸¥Ê¥ë¤Î @code{mysqldump} ¥Ð¥Ã¥¯¥¢¥Ã¥×¥Ç¡¼¥¿¤ò¥ê¥¹¥È¥¢¤·¤Þ¤¹¡£
-@item
-°Ê²¼¤Î¥³¥Þ¥ó¥É¤Î¤è¤¦¤Ë¤·¤Æ¡¢¹¹¿·¥í¥°¤Ëµ­Ï¿¤µ¤ì¤Æ¤¤¤ëÊѹ¹¤òŬÍѤ·¤Þ¤¹¡£
-@example
-shell> ls -1 -t -r hostname.[0-9]* | xargs cat | mysql
-@end example
-@end enumerate
-
-@code{ls} ¤Ï¡¢Á´¤Æ¤Î¹¹¿·¥í¥°¥Õ¥¡¥¤¥ë¤òÀµ¤·¤¤½ç¤ÇÆÀ¤ë¤¿¤á¤Ë¹Ô¤ï¤ì¤Þ¤¹¡£
-
-@code{SELECT * INTO OUTFILE 'file_name' FROM tbl_name} ¤Ç¤ÎÁªÂòŪ¥Ð¥Ã¥¯¥¢¥Ã¥×¤È
-@code{LOAD DATA FROM INFILE 'file_name' REPLACE ...} ¤Ç¤Î¥ê¥¹¥È¥¢¤ò¹Ô¤¦
-¤³¤È¤â¤Ç¤­¤Þ¤¹¡£½ÅÊ£¥ì¥³¡¼¥É¤òÈò¤±¤ë¤¿¤á¤Ë¤Ï¡¢¥Æ¡¼¥Ö¥ëÆâ¤Ë @code{PRIMARY KEY}
- or a @code{UNIQUE} ¤¬É¬ÍפǤ¹¡£@code{REPLACE} ¤Ï¡¢'½ÅÊ£¥¤¥ó¥Ç¥Ã¥¯¥¹' ¾×Æͤ¬¤¢¤Ã¤¿¾ì¹ç¡¢
-¿·¤·¤¤¥ì¥³¡¼¥É¤òÁÞÆþ¤¹¤ë»þ¤Ë¸Å¤¤¥ì¥³¡¼¥É¤¬¿·¤·¤¤¤â¤Î¤ËÃÖ¤­´¹¤¨¤é¤ì¤ë¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£
-
-@cindex Update log
-@node Update log, Multiple servers, Backup, Common problems
-@section ¹¹¿·¥í¥°
-
-@code{--log-update=file_name}¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ·¤Æ@code{mysqld}¤òµ¯Æ°¤¹¤ë¤È¡¢
-¥Ç¡¼¥¿¤ò¹¹¿·¤·¤¿Á´¤Æ¤ÎSQL¥³¥Þ¥ó¥É¤ò¥í¥°¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¤Þ¤¹¡£
-¤â¤· file_name ¤¬Í¿¤¨¤é¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢¥Û¥¹¥È̾¤¬¥Ç¥Õ¥©¥ë¥È¤Ç»ÈÍѤµ¤ì¤Þ¤¹¡£
-¤â¤· file_name ¤Ë¥Ç¥£¥ì¥¯¥È¥ê¥Ñ¥¹¤¬´Þ¤Þ¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢
-¤³¤Î¥Õ¥¡¥¤¥ë¤Ï¥Ç¡¼¥¿¥Ç¥£¥ì¥¯¥È¥ê¤Ë½ñ¤«¤ì¤Þ¤¹¡£
-¤â¤· file_name ¤¬³ÈÄ¥¤ò»ý¤¿¤Ê¤«¤Ã¤¿¤Ê¤é¡¢@code{mysqld} ¤Ï
-@code{file_name.#} ¤È¤¤¤¦·Á¤Ç¥í¥°¥Õ¥¡¥¤¥ë¤òºîÀ®¤·¤Þ¤¹¡£
-¤³¤Î¥í¥°¥Õ¥¡¥¤¥ë¤Ï¥Ç¡¼¥¿¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤«¤«¤ì¡¢
-¤½¤Î̾Á°¤Ï @code{file_name.#} ¤È¤¤¤¦·Á¼°¤Î̾Á°¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
-
-@code{#} ¤Ï @code{mysqladmin refresh} ¤« @code{mysqladmin flush-logs} ¤ò¼Â¹Ô¤¹¤ëÅ٤ˡ¢
-¤¢¤ë¤¤¤Ï @code{FLUSH LOGS} ¹½Ê¸¤ò¼Â¹Ô¤·¤¿¤ê¡¢¥µ¡¼¥Ð¡¼¤ò¥ê¥¹¥¿¡¼¥È¤¹¤ëÅÙ¤Ë
-¼«Æ°Åª¤ËÁý¤¨¤ë¿ô»ú¤Ç¤¹¡£
-
-¤â¤· @code{--log} ¤« @code{-l} ¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢¥í¥°¥Õ¥¡¥¤¥ë¤Î̾Á°¤Ï
-@code{mysqld} ¤ÏÁ´Éô¤Î¥í¥°¤ò @file{hostname.log} ¤Ë½ñ¤­½Ð¤·¤Þ¤¹¡£
-¤³¤Î¾ì¹ç¡¢¥ê¥¹¥¿¡¼¥È¤ä¤ê¥Õ¥ì¥Ã¥·¥å¤ò¹Ô¤Ã¤Æ¤â¿·¤·¤¯¥í¥°¥Õ¥¡¥¤¥ë¤òºî¤ê¤Þ¤»¤ó¡£
-(°ìÅÙ¥¯¥í¡¼¥º¤·¤ÆºÆÅÙ¥ª¡¼¥×¥ó¤·¤Þ¤¹¤¬¡£)
-¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢@code{mysql.server} ¥¹¥¯¥ê¥×¥È¤Ï @code{-l} ¥ª¥×¥·¥ç¥ó¤òÉղä·¤Æ
-@strong{MySQL} ¥µ¡¼¥Ð¡¼¤òµ¯Æ°¤·¤Þ¤¹¡£
-¤â¤· @strong{MySQL} ¤Î¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤ò¤¢¤²¤ÆËÜÈִĶ­¤Ê¤É¤Ç»ÈÍѤ·¤¿¤¤¾ì¹ç¡¢
-@code{mysql.server} ¥¹¥¯¥ê¥×¥È¤«¤é @code{-l} ¥ª¥×¥·¥ç¥ó¤ò³°¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-¹¹¿·¥í¥°¤Ï¡¢¼ÂºÝ¤Ë¹¹¿·¤µ¤ì¤¿¥Ç¡¼¥¿¤Î¥¹¥Æ¡¼¥È¥á¥ó¥È¤À¤±¤ò½ñ¤¯¤¿¤á¡¢¤­¤Ó¤­¤Ó¤ÈÆ°ºî¤·¤Þ¤¹¡£
-@code{WHERE} ¤ò»ÈÍѤ·¤¿ @code{UPDATE} ¤« @code{DELETE} ¤Ç·ë²Ì¤¬ÆÀ¤é¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¡¢
-¥í¥°¤Ï½ñ¤­½Ð¤µ¤ì¤Þ¤»¤ó¡£
-¤¹¤Ç¤Ë¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ëÃͤˡ¢¤â¤¦°ìÅÙ¹àÌܤò¹¹¿·¤¹¤ë¤è¤¦¤Ê @code{UPDATE} ¤â¥¹¥­¥Ã¥×¤µ¤ì¤Þ¤¹¡£
-
-¥í¥°¥Õ¥¡¥¤¥ë¤Î¹¹¿·¤Ë½¾¤Ã¤Æ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¹¹¿·¤·¤¿¤¤¾ì¹ç¤Ï¡¢¼¡¤ò¹Ô¤¤¤Þ¤¹
-(¹¹¿·¥í¥°¥Õ¥¡¥¤¥ë̾¤ò @file{file_name.#} ¤È²¾Äꤷ¤Þ¤¹):
-
-@example
-shell> ls -1 -t -r file_name.[0-9]* | xargs cat | mysql
-@end example
-
-@code{ls} ¤ÏÁ´¤Æ¤Î¥í¥°¥Õ¥¡¥¤¥ë¤òÀµ¤·¤¯Ê¤٤뤿¤á¤Ë»ÈÍѤ·¤Æ¤¤¤Þ¤¹¡£
-
-¤³¤ì¤Ï¡¢¥¯¥é¥Ã¥·¥å¸å¤Ë¥Ð¥Ã¥¯¥¢¥Ã¥×¤·¤¿¾õÂÖ¤Þ¤ÇÌá¤ê¤¿¤¤¡¢¤¢¤ë¤¤¤Ï¡¢
-¥Ð¥Ã¥¯¥¢¥Ã¥×¤·¤¿¸å¤«¤é¥¯¥é¥Ã¥·¥å¤¹¤ë¤Þ¤Ç¤Î´Ö¤Î¥Ç¡¼¥¿¤Î¹¹¿·¤ò¹Ô¤¤¤¿¤¤¡¢
-¤½¤ó¤Ê¾ì¹ç¤Ë»È¤¨¤Þ¤¹¡£
-
-@cindex Database replication
-@cindex Replication, database
-@cindex Database mirroring
-@cindex Mirroring, database
-¥í¥°¤Ï°ã¤¦¥Û¥¹¥È¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥ß¥é¡¼¤ä¥Þ¥¹¥¿¡¼¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÊ£À½¤òºî¤ë¾ì¹ç¤Ë¤âÍøÍѤǤ­¤Þ¤¹¡£
-@xref{Replication}.
-
-@cindex Multiple servers
-@node Multiple servers, , Update log, Common problems
-@section Ʊ°ì¥Þ¥·¥ó¾å¤ËÊ£¿ô¤Î @strong{MySQL} ¥µ¡¼¥Ð¡¼¤òÁö¤é¤»¤ë
-
-Ʊ¤¸¥Þ¥·¥ó¾å¤ÇÊ£¿ô¤Î¥µ¡¼¥Ð¡¼¤òÁö¤é¤»¤¿¤¤¾ì¹ç¤¬¤¢¤ê¤Þ¤¹¡£
-Î㤨¤Ð¡¢¤¹¤Ç¤Ë¸ºß¤·¤Æ¤¤¤ë¥µ¡¼¥Ð¡¼¤Ï¤½¤Î¤Þ¤Þ¤Ë¤·¤Æ¤ª¤¤¤Æ¡¢¿·¤·¤¤ @strong{MySQL} ¤ò¥Æ¥¹¥È¤·¤¿¤¤¾ì¹ç¤ä¡¢
-¤¢¤ë¤¤¤Ï¡¢¥¤¥ó¥¿¡¼¥Í¥Ã¥È¥×¥í¥Ð¥¤¥À¡¼¤ò±Ä¤ó¤Ç¤¤¤Æ¡¢@strong{MySQL} ¤ò¤½¤ì¤¾¤ì¤Î¸ÜµÒÍѤËÄ󶡤·¤¿¤¤¾ì¹ç¤Ê¤É¡£
-
-Ê£¿ô¤Î¥µ¡¼¥Ð¡¼¤ò¤¿¤Á¤¢¤²¤ë¾ì¹ç¡¢´Êñ¤ÊÊýË¡¤È¤·¤Æ¡¢
-TCP/IP ¥Ý¡¼¥È¡¢¥½¥±¥Ã¥È¥Õ¥¡¥¤¥ë¤òÊѤ¨¤Æ¡¢¥µ¡¼¥Ð¡¼¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ëÊýË¡¤¬¤¢¤ê¤Þ¤¹¡£
-
-¤½¤Ç¤ËÁö¤Ã¤Æ¤¤¤ë¥µ¡¼¥Ð¡¼¤¬¥Ç¥Õ¥©¥ë¥È¤Î¥Ý¡¼¥ÈÈÖ¹æ¤È¥½¥±¥Ã¥È¥Õ¥¡¥¤¥ë¤ÇÆ°ºî¤·¤Æ¤¤¤ë¤È¤·¤Þ¤¹¡£
-¿·¤·¤¯¥µ¡¼¥Ð¡¼¤òºî¤ë¤Ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë @code{configure} ¤·¤Þ¤¹¡§
-
-@example
-shell> ./configure --with-tcp-port=port_number \
- --with-unix-socket=file_name \
- --prefix=/usr/local/mysql-3.22.9
-@end example
-
-@code{port_number} ¤È @code{file_name} ¤Ë¤Ï¡¢¥Ç¥Õ¥©¥ë¥È¤Î¥Ý¡¼¥ÈÈֹ桢¥½¥±¥Ã¥È¥Õ¥¡¥¤¥ë¤È¤Ï°ã¤¦¤â¤Î¤ò»ØÄꤷ¤Þ¤¹¡£
-¤½¤·¤Æ @code{--prefix} ¤ò¡¢¤¹¤Ç¤ËÁö¤Ã¤Æ¤¤¤ë @strong{MySQL} ¤Î¥¤¥ó¥¹¥È¡¼¥ëÀè¤È¤Ï°ã¤¦¥Ç¥£¥ì¥¯¥È¥ê¡¼¤Ë»ØÄꤷ¤Þ¤¹¡£
-
-¸½ºßÁö¤Ã¤Æ¤¤¤ë @strong{MySQL} ¥µ¡¼¥Ð¡¼¤Î¥½¥±¥Ã¥È¤È¥Ý¡¼¥È¤òÃΤë¤Ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-
-@example
-shell> mysqladmin -h hostname --port=port_number variables
-@end example
-
-¤¢¤Ê¤¿¤¬»ÈÍѤ·¤Æ¤¤¤ë¥Ý¡¼¥È¤Ë @strong{MySQL} ¥µ¡¼¥Ð¡¼¤¬Áö¤Ã¤Æ¤¤¤ì¤Ð¡¢
-¤³¤ì¤ÏÊѹ¹²Äǽ¤Ê @strong{MySQL} ÊÑ¿ô¤ò(¥½¥±¥Ã¥È¥Õ¥¡¥¤¥ë¤Î̾Á°¤â´Þ¤ó¤Ç)½ÐÎϤ·¤Þ¤¹¡£
-
-Ω¤Á¾å¤²¥¹¥¯¥ê¥×¥È(¤ª¤½¤é¤¯ @file{mysql.server} ¥Õ¥¡¥¤¥ë)¤òÊÔ½¸¤·¤Æ
-Ê£¿ô¤Î @strong{MySQL} ¥µ¡¼¥Ð¡¼¤òΩ¤Á¤¢¤²¤Æ¤â¹½¤¤¤Þ¤»¤ó¡£
-
-¤³¤Î¾ì¹ç¡¢ @strong{MySQL} ¥µ¡¼¥Ð¡¼¤òºÆ¥³¥ó¥Ñ¥¤¥ë¤¹¤ëɬÍפϤ¢¤ê¤Þ¤»¤ó¡£
-@code{safe_mysqld} ¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Æ¥µ¡¼¥Ð¡¼¤òµ¯Æ°¤¹¤ì¤Ð¡¢¥Ý¡¼¥È¤È¥½¥±¥Ã¥È¤òÊѹ¹¤Ç¤­¤Þ¤¹¡§
-
-@example
-shell> /path/to/safe_mysqld --socket=file-name --port=port_number
-@end example
-
-¤â¤·¡¢Â¾¤Î¥µ¡¼¥Ð¡¼¤¬¥í¥®¥ó¥°¤ò¹Ô¤Ã¤Æ¤¤¤ë¥Ç¥£¥ì¥¯¥È¥ê¤ÈƱ¤¸¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤ò¡¢
-¿·¤·¤¤¥µ¡¼¥Ð¡¼¤Ç»ÈÍѤ¹¤ë¤Î¤Ç¤¢¤ì¤Ð¡¢¥í¥°¥Õ¥¡¥¤¥ë¤Î̾Á°¤ò»ØÄꤹ¤Ù¤­¤Ç¤¹¡£
-( @code{safe_mysqld} ¤Ë @code{--log} ¤È @code{--log-update} ¤ò»ØÄꤹ¤ë)
-¤½¤¦¤·¤Ê¤¤¤È¡¢Î¾Êý¤Î¥µ¡¼¥Ð¡¼¤¬Æ±¤¸¥í¥°¥Õ¥¡¥¤¥ë¤Ë½ñ¤­¹þ¤â¤¦¤È¤¹¤ë¤«¤é¤Ç¤¹¡£
-
-@strong{Warning}: Ä̾Æó¤Ä¥µ¡¼¥Ð¡¼¤ËƱ¤¸¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÁàºî¤µ¤»¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡ª
-¤â¤·»ÈÍѤ·¤Æ¤¤¤ë OS ¤¬ fault-free system locking ¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤Ê¤¤¤È¡¢
-¤³¤ì¤ÏÈá»´¤Ê¤³¤È¤Ë¤Ê¤ë¤Ç¤·¤ç¤¦¡ª
-
-¤â¤·Æó¤ÄÌܤΥµ¡¼¥Ð¡¼¤Ë°ã¤¦¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤ò»ÈÍѤµ¤»¤¿¤¤¾ì¹ç¡¢
- @code{safe_mysqld} ¤Ë @code{--datadir=path} ¥ª¥×¥·¥ç¥ó¤ò»ØÄꤷ¤Þ¤¹¡£
-
-@example
-shell> /path/to/safe_mysqld --datadir=/new/path/to/datadir \
- --socket=file-name --port=file-name
-@end example
-
-¤â¤·°ã¤¦¥Ý¡¼¥È¤ÇÁö¤Ã¤Æ¤¤¤ë @strong{MySQL} ¥µ¡¼¥Ð¡¼¤Ë¡¢
-¤³¤ì¤Þ¤¿°ã¤¦¥Ý¡¼¥È¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ëºî¤é¤ì¤¿¥¯¥é¥¤¥¢¥ó¥È¤«¤éÀܳ¤·¤¿¤¤¾ì¹ç¡¢
-°Ê²¼¤Î¤è¤¦¤Ë¤·¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-¥¯¥é¥¤¥¢¥ó¥È¤ò @code{--host 'hostname' --port=port_numer} ¤«
-@code{[--host localhost] --socket=file_name} ¥ª¥×¥·¥ç¥ó¤Çµ¯Æ°¤·¤Þ¤¹¡£
-
-@item
-C ¤¢¤ë¤¤¤Ï Perl ¥×¥í¥°¥é¥à¤Î¾ì¹ç¡¢¥Ý¡¼¥È¤È¥½¥±¥Ã¥È¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡§
-
-@item
-@tindex MYSQL_UNIX_PORT environment variable
-@tindex MYSQL_TCP_PORT environment variable
-@tindex Environment variable, MYSQL_UNIX_PORT
-@tindex Environment variable, MYSQL_TCP_PORT
-@code{MYSQL_UNIX_PORT} ¤È @code{MYSQL_TCP_PORT} ´Ä¶­ÊÑ¿ô¤Ë UNIX ¥½¥±¥Ã¥È¥Õ¥¡¥¤¥ë¤È
- TCP/IP ¤Î¥Ý¡¼¥ÈÈÖ¹æ¤È¥»¥Ã¥È¤·¡¢¥¯¥é¥¤¥¢¥ó¥È¤òΩ¤Á¤¢¤²¤Þ¤¹¡£
-¤â¤·¡¢¤³¤Î¥Ý¡¼¥ÈÈÖ¹æ¤ä¥½¥±¥Ã¥È¥Õ¥¡¥¤¥ë¤ò¾ï¤Ë»ÈÍѤ¹¤ë¤Î¤Ç¤¢¤ì¤Ð¡¢
- @file{.login} ¥Õ¥¡¥¤¥ë¤«¤Ê¤Ë¤«¤Ë´Ä¶­ÊÑ¿ô¤ò¥»¥Ã¥È¤¹¤ë¤è¤¦¤Ë½ñ¤¤¤Æ¤ª¤±¤Ð¤è¤¤¤Ç¤·¤ç¤¦¡£
-@xref{Environment variables}. @xref{Programs}.
-
-@item
-@tindex .my.cnf file
-¤¢¤Ê¤¿¤Î¥Û¡¼¥à¥Ç¥£¥ì¥¯¥È¥ê¤Î @file{.my.cnf} ¥Õ¥¡¥¤¥ë¤Ë¡¢
-Ä̾ï»ÈÍѤ¹¤ë¥Ý¡¼¥ÈÈÖ¹æ¤È¥½¥±¥Ã¥È¥Õ¥¡¥¤¥ë¤ò½ñ¤¯¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
-@xref{Option files}.
-@end itemize
-
-@node Clients, Comparisons, Common problems, Top
-@chapter @strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¥Ä¡¼¥ë¤È API
-
-@menu
-* C:: @strong{MySQL} C API
-* C API datatypes:: C API ¥Ç¡¼¥¿·¿
-* C API function overview:: C API ´Ø¿ô³µÍ×
-* C API functions:: C API ´Ø¿ôÀâÌÀ
-* Perl:: @strong{MySQL} Perl API
-* Eiffel:: @strong{MySQL} Eiffel wrapper
-* Java:: @strong{MySQL} Java connectivity (JDBC)
-* PHP:: @strong{MySQL} PHP API
-* Cplusplus:: @strong{MySQL} C++ APIs
-* Python:: @strong{MySQL} Python APIs
-* Tcl:: @strong{MySQL} Tcl APIs
-* Ruby:: @strong{MySQL} Ruby API
-@end menu
-
-@node C, C API datatypes, Clients, Clients
-@section @strong{MySQL} C API
-
-C API ¥³¡¼¥É¤Ï @strong{MySQL} ¤È¤È¤â¤ËÇÛÉÛ¤µ¤ì¤Þ¤¹¡£¤³¤ì¤Ï
-@code{libmysqlclient} ¥é¥¤¥Ö¥é¥ê¤Ë´Þ¤Þ¤ì¡¢C ¥×¥í¥°¥é¥à¤«¤é¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø
-¤Î¥¢¥¯¥»¥¹¤òµö¤·¤Þ¤¹¡£
-
-MySQL ¥½¡¼¥¹¥Ç¥£¥¹¥È¥ê¥Ó¥å¡¼¥·¥ç¥óÆâ¤Î¥¯¥é¥¤¥¢¥ó¥È¤Î¿¤¯¤Ï C ¤Ç½ñ¤«¤ì¤Æ¤¤¤Þ¤¹¡£C API ¤Î»È
-ÍÑË¡¤ò¼¨¤¹Îã¤òõ¤¹¤Ê¤é¡¢¤³¤ì¤é¤Î¥¯¥é¥¤¥¢¥ó¥È¤òÄ´¤Ù¤Æ¤¯¤À¤µ¤¤¡£
-
-¾¤Î¥¯¥é¥¤¥¢¥ó¥È API ¤Î¿¤¯(Java ¤ò½ü¤¯Á´¤Æ)¤Ï¡¢@strong{MySQL} ¥µ¡¼¥Ð¤È
-¤ÎÄÌ¿®¤Ë¤³¤Î¥é¥¤¥Ö¥é¥ê¤ò»ÈÍѤ·¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢Î㤨¤Ð¡¢Â¾¤Î¥¯¥é¥¤¥¢¥ó¥È¥×
-¥í¥°¥é¥à¤Ç»ÈÍѤµ¤ì¤ë¤Î¤ÈƱ¤¸´Ä¶­ÊÑ¿ô¤Î¿¤¯¤ÎÍøÅÀ¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤½
-¤ì¤é¤Ï¥é¥¤¥Ö¥é¥ê¤«¤é»²¾È¤µ¤ì¤ë¤«¤é¤Ç¤¹¡£¤³¤ì¤é¤ÎÊÑ¿ô¤Î¥ê¥¹¥È¤Ë¤Ä¤¤¤Æ¤Ï
-@ref{Programs} ¤ò»²¾È¤·¤Æ²¼¤µ¤¤¡£
-
-¥¯¥é¥¤¥¢¥ó¥È¤ÏºÇÂçÄÌ¿®¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤ò»ý¤Á¤Þ¤¹¡£ºÇ½é¤Ë³ä¤êÅö¤Æ¤é¤ì¤ë¥Ð¥Ã
-¥Õ¥¡¤Î¥µ¥¤¥º(16K ¥Ð¥¤¥È)¤Ï¼«Æ°Åª¤ËºÇÂ祵¥¤¥º(¥Ç¥Õ¥©¥ë¥È¤Ï 24M)¤Þ¤ÇÁý²Ã¤·
-¤Þ¤¹¡£¥Ð¥Ã¥Õ¥¡¥µ¥¤¥º¤ÏɬÍפ˱þ¤¸¤ÆÁý²Ã¤¹¤ë¤¿¤á¡¢Ã±½ã¤Ë¥Ç¥Õ¥©¥ë¥È¤ÎºÇÂçÀ©
-¸Â¤òÁý²Ã¤·¤Æ¤â¡¢¤µ¤é¤ËÆâÉô¤Ç»ñ¸»¤ò»ÈÍѤ¹¤ë¤³¤È¤Ï¤¢¤ê¤Þ¤»¤ó¡£¤³¤Î¥µ¥¤¥º¥Á¥§¥Ã
-¥¯¤Ï¼ç¤Ë´Ö°ã¤Ã¤¿¥¯¥¨¥ê¤ÈÄÌ¿®¥Ñ¥±¥Ã¥È¤Î¤¿¤á¤Î¥Á¥§¥Ã¥¯¤Ç¤¹¡£
-
-ÄÌ¿®¥Ð¥Ã¥Õ¥¡¤Ï°ì¤Ä¤Î SQL ¥¹¥Æ¡¼¥È¥á¥ó¥È(¥¯¥é¥¤¥¢¥ó¥È¤«¤é¥µ¡¼¥Ð¤Ø¤ÎÄÌ¿®)¤È¡¢
-ÊÖ¤µ¤ì¤ë¥Ç¡¼¥¿(¥µ¡¼¥Ð¤«¤é¥¯¥é¥¤¥¢¥ó¥È¤Ø¤ÎÄÌ¿®)¤Î£±¥ì¥³¡¼¥É¤ò´Þ¤à¤Î¤Ë
-½½Ê¬Â礭¤¯¤Ê¤¯¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£³Æ¥¹¥ì¥Ã¥É¤Î
-ÄÌ¿®¥Ð¥Ã¥Õ¥¡¤Ï¡¢Ç¤°Õ¤Î¥ì¥³¡¼¥É¤ä¥¯¥¨¥ê¤ò½èÍý¤¹¤ë¤¿¤á¤Ë¡¢»ØÄꤵ¤ì¤¿À©¸Â¤Þ¤ÇưŪ
-¤ËÁýÂ礷¤Þ¤¹¡£Î㤨¤Ð¡¢ºÇÂç 16M ¤Î¥Ç¡¼¥¿¤ò´Þ¤à @code{BLOB} Ãͤ¬¤¢¤ë¾ì¹ç¡¢
-¾¯¤Ê¤¯¤È¤â 16M ¤òÄÌ¿®¥Ð¥Ã¥Õ¥¡À©¸Â¤È¤·¤Æ»ý¤ÄɬÍפ¬¤¢¤ê¤Þ¤¹(¥µ¡¼¥Ð¤È¥¯¥é¥¤
-¥¢¥ó¥È¤ÎξÊý¤Ç)¡£
-¥¯¥é¥¤¥¢¥ó¥È¤Î¥Ç¥Õ¥©¥ë¥È¤ÎºÇÂçÃÍ¤Ï 24M ¤Ç¤¹¤¬¡¢¥µ¡¼¥Ð¤ÎºÇÂçÃͤΥǥե©¥ë¥È¤Ï
-1M ¤Ç¤¹¡£¤³¤ì¤Ï¥µ¡¼¥Ðµ¯Æ°»þ¤Ë¡¢@code{max_allowed_packet} ¥Ñ¥é¥á¡¼¥¿¤Î
-ÃͤòÊѹ¹¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢Áý¤ä¤¹¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
-@xref{Server parameters}.
-
-@strong{MySQL} ¥µ¡¼¥Ð¤Ï¡¢³Æ¥¯¥¨¥ê¸å¤Ë³ÆÄÌ¿®¥Ð¥Ã¥Õ¥¡¤ò
-@code{net_buffer_length} ¥Ð¥¤¥È¤Ë½Ì¾®¤·¤Þ¤¹¡£
-¥¯¥é¥¤¥¢¥ó¥È¤Ç¤Ï¡¢Àܳ¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥Ð¥Ã¥Õ¥¡¤Î¥µ¥¤¥º¤Ï¡¢Àܳ¤¬ÊĤ¸¤é¤ì¤ë¤Þ¤Ç¸º¾¯¤·¤Þ¤»¤ó¡£
-¥¯¥é¥¤¥¢¥ó¥È¥á¥â¥ê¤ÏÀܳ¤¬¥¯¥í¡¼¥º¤µ¤ì¤¿»þ¤ËÄ´À°¤µ¤ì¤Þ¤¹¡£
-
-¥¹¥ì¥Ã¥É¥×¥í¥°¥é¥ß¥ó¥°¤ò¹Ô¤Ê¤¦¾ì¹ç¤Ï¡¢@strong{MySQL} C API ¤ò
-@code{--with-thread-safe-client} ÉÕ¤­¤Ç¥³¥ó¥Ñ¥¤¥ë¤¹¤Ù¤­¤Ç¤¹¡£¤³¤ì¤Ï C
-API ¤òÀܳËè¤Î¥¹¥ì¥Ã¥É°ÂÁ´¤Ë¤·¤Þ¤¹¡£¼¡¤Î¾ì¹ç¤Ë¸Â¤ê¡¢£²¤Ä¤Î¥¹¥ì¥Ã¥É¤ÏƱ¤¸ÀÜ
-³¤ò¶¦Í­¤Ç¤­¤Þ¤¹:
-
-@table @asis
-@item
-£²¤Ä¤Î¥¹¥ì¥Ã¥É¤¬Æ±¤¸Àܳ¾å¤ÇƱ»þ¤Ë @strong{MySQL} ¤Ë¥¯¥¨¥ê¤òÁ÷¿®¤¹¤ë¤³¤È¤Ï
-¤Ç¤­¤Þ¤»¤ó¡£ÆÃ¤Ë @code{mysql_query()} ¤È @code{mysql_store_result()} ¤Î´Ö
-¤Ç¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤¬Æ±¤¸Àܳ¤ò»ÈÍѤ·¤Ê¤¤¤³¤È¤ò³Î¼Â¤Ë¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-@item
-¿¤¯¤Î¥¹¥ì¥Ã¥É¤¬ @code{mysql_store_result()} ¤Ç¼è¤ê½Ð¤µ¤ì¤¿ÊÌ¡¹¤Î·ë²Ì¥»¥Ã
-¥È¤Ë¥¢¥¯¥»¥¹¤Ç¤­¤Þ¤¹¡£
-@item
-@code{mysql_use_result} ¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢·ë²Ì¥»¥Ã¥È¤¬¥¯¥í¡¼¥º¤µ¤ì¤ë¤Þ¤Ç¡¢Â¾
-¤Î¥¹¥ì¥Ã¥É¤¬Æ±¤¸Àܳ¾å¤Ç²¿¤â¿Ò¤Í¤Ê¤¤¤³¤È¤ò³Î¼Â¤Ë¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-@end table
-
-@node C API datatypes, C API function overview, C, Clients
-@section C API ¥Ç¡¼¥¿·¿
-@table @code
-
-@tindex MYSQL C type
-@item MYSQL
-¤³¤Î¹½Â¤ÂΤϰì¤Ä¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹Àܳ¤Î¥Ï¥ó¥É¥ë¤òɽ¤ï¤·¤Þ¤¹¡£¤³¤ì¤Ï¤Û¤È¤ó¤ÉÁ´¤Æ
-¤Î @strong{MySQL} ´Ø¿ô¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£
-
-@tindex MYSQL_RES C type
-@item MYSQL_RES
-¤³¤Î¹½Â¤ÂΤϥ쥳¡¼¥É¤òÊÖ¤¹¥¯¥¨¥ê(@code{SELECT}, @code{SHOW}, @code{DESCRIBE}, @code{EXPLAIN})¤Î·ë²Ì¤òɽ¤ï
-¤·¤Þ¤¹¡£¥¯¥¨¥ê¤«¤éÊÖ¤µ¤ì¤ë¾ðÊó¤Ï¡¢¤³¤ÎÀá¤Î»Ä¤ê¤Ç¤Ï@emph{·ë²Ì¥»¥Ã¥È}¤È¸Æ
-¤Ð¤ì¤Þ¤¹¡£
-
-@tindex MYSQL_ROW C type
-@item MYSQL_ROW
-¤³¤ì¤Ï¥Ç¡¼¥¿¤Î£±¥ì¥³¡¼¥É¤Î°ÂÁ´¤Ê·¿É½¸½¤Ç¤¹¡£¤³¤ì¤Ï¸½ºß¥Ð¥¤¥Èʸ»úÎó¤ÎÇÛÎó¤È¤·¤Æ¼Â
-Áõ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£(¥Õ¥£¡¼¥ë¥ÉÃͤ¬¥Ð¥¤¥Ê¥ê¥Ç¡¼¥¿¤ò´Þ¤à¤³¤È¤¬¤¢¤ë¾ì¹ç¡¢¤³¤ì¤ò NULL
-½ªÃ¼Ê¸»úÎó¤È¤·¤Æ°·¤¦¤³¤È¤Ï¤Ç¤­¤Þ¤»¤ó¡£¤½¤Î¤è¤¦¤ÊÃͤÏÆâÉô¤Ë NULL ¥Ð¥¤¥È¤ò´Þ
-¤à¤³¤È¤¬¤¢¤ë¤«¤é¤Ç¤¹¡£) @code{mysql_fetch_row()} ¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤ê¥ì¥³¡¼¥É¤¬³ÍÆÀ
-¤µ¤ì¤Þ¤¹¡£
-
-@tindex MYSQL_FIELD C type
-@item MYSQL_FIELD
-¤³¤Î¹½Â¤ÂΤϥե£¡¼¥ë¥É¤Ë¤Ä¤¤¤Æ¤Î¾ðÊ󡢤Ĥޤê¥Õ¥£¡¼¥ë¥É¤Î̾Á°¡¢·¿¡¢¥µ¥¤¥º
-Åù¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£¤³¤Î¥á¥ó¥Ð¤Ï¸å¤Ç¤µ¤é¤Ë¾ÜºÙ¤ËÀâÌÀ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-@code{mysql_fetch_field()} ¤ò·«¤êÊÖ¤·¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤ê¡¢³Æ¥Õ¥£¡¼¥ë¥É¤Î
-@code{MYSQL_FIELD} ¹½Â¤ÂΤòÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-¥Õ¥£¡¼¥ë¥ÉÃͤϤ³¤Î¹½Â¤ÂΤΰìÉô¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó; ¤½¤ì¤Ï @code{MYSQL_ROW} ¹½Â¤
-ÂΤ˴ޤޤì¤Æ¤¤¤Þ¤¹¡£
-
-@tindex MYSQL_FIELD_OFFSET C type
-@item MYSQL_FIELD_OFFSET
-¤³¤ì¤Ï¡¢@strong{MySQL} ¥Õ¥£¡¼¥ë¥É¥ê¥¹¥È¤Ø¤Î¥ª¥Õ¥»¥Ã¥È¤Î°ÂÁ´¤Ê·¿É½¸½¤Ç¤¹¡£
-(@code{mysql_field_seek()} ¤Ç»ÈÍѤµ¤ì¤Þ¤¹¡£)¥ª¥Õ¥»¥Ã¥È¤Ï¥ì¥³¡¼¥ÉÆâ¤Î¥Õ¥£¡¼¥ë¥É
-ÈÖ¹æ¤Ç¡¢0 ¤«¤é»Ï¤Þ¤ê¤Þ¤¹¡£
-
-@tindex my_ulonglong C type
-@tindex my_ulonglong values, printing
-@item my_ulonglong
-¥ì¥³¡¼¥É¿ô¤È @code{mysql_affected_rows()},
-@code{mysql_num_rows()} ¤½¤·¤Æ @code{mysql_insert_id()} ¤Ë»ÈÍѤµ¤ì¤ë·¿¤Ç¤¹¡£
-¤³¤Î·¿¤Ï @code{0} ¤«¤é @code{1.84e19} ¤ÎÈϰϤòÍ¿¤¨¤Þ¤¹¡£
-
-¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¡¢@code{my_ulonglong} ·¿¤ÎÃͤòɽ¼¨¤·¤è¤¦¤È¤·¤Æ¤â¡¢Æ°ºî
-¤·¤Ê¤¤¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£¤³¤ÎÃͤòɽ¼¨¤¹¤ë¤Ë¤Ï¡¢@code{unsigned long} ¤ËÊÑ´¹
-¤·¡¢@code{%lu} ½ÐÎϽñ¼°¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£Îã:
-@example
-printf (Number of rows: %lu\n", (unsigned long) mysql_num_rows(result));
-@end example
-@end table
-
-@noindent
-@code{MYSQL_FIELD} ¹½Â¤ÂΤϼ¡¤Î¥á¥ó¥Ð¤ò´Þ¤ß¤Þ¤¹:
-
-@table @code
-@item char * name
-¥Õ¥£¡¼¥ë¥É¤Î̾Á°¡£null½ªÃ¼Ê¸»úÎó¡£
-
-@item char * table
-¤³¤Î¥Õ¥£¡¼¥ë¥É¤ò´Þ¤à¥Æ¡¼¥Ö¥ë¤Î̾Á°¡£·×»»¤µ¤ì¤¿¥Õ¥£¡¼¥ë¥É¤Ç¤Ê¤¤¾ì¹ç¤Î¤ßÍ­
-¸ú¤Ç¤¹¡£·×»»¤µ¤ì¤¿¥Õ¥£¡¼¥ë¥É¤Ç¤Ï¡¢@code{table} Ãͤ϶õʸ»úÎó¤Ç¤¹¡£
-
-@item char * def
-¤³¤Î¥Õ¥£¡¼¥ë¥É¤Î¥Ç¥Õ¥©¥ë¥ÈÃÍ¡£null½ªÃ¼Ê¸»úÎó¡£
-¤³¤ì¤Ï @code{mysql_list_fields()} »ÈÍÑ»þ¤Ë¤À¤±ÀßÄꤵ¤ì¤Þ¤¹¡£
-
-@item enum enum_field_types type
-¥Õ¥£¡¼¥ë¥É¤Î·¿¡£
-@code{type} Ãͤϼ¡¤Î°ì¤Ä¤Ç¤¹:
-
-@multitable @columnfractions .3 .55
-@item @strong{·¿¤ÎÃÍ} @tab @strong{·¿¤Î°ÕÌ£}
-@item @code{FIELD_TYPE_TINY} @tab @code{TINYINT} ¥Õ¥£¡¼¥ë¥É
-@item @code{FIELD_TYPE_SHORT} @tab @code{SMALLINT} ¥Õ¥£¡¼¥ë¥É
-@item @code{FIELD_TYPE_LONG} @tab @code{INTEGER} ¥Õ¥£¡¼¥ë¥É
-@item @code{FIELD_TYPE_INT24} @tab @code{MEDIUMINT} ¥Õ¥£¡¼¥ë¥É
-@item @code{FIELD_TYPE_LONGLONG} @tab @code{BIGINT} ¥Õ¥£¡¼¥ë¥É
-@item @code{FIELD_TYPE_DECIMAL} @tab @code{DECIMAL} ¤Þ¤¿¤Ï @code{NUMERIC} ¥Õ¥£¡¼¥ë¥É
-@item @code{FIELD_TYPE_FLOAT} @tab @code{FLOAT} ¥Õ¥£¡¼¥ë¥É
-@item @code{FIELD_TYPE_DOUBLE} @tab @code{DOUBLE} ¤Þ¤¿¤Ï @code{REAL} ¥Õ¥£¡¼¥ë¥É
-@item @code{FIELD_TYPE_TIMESTAMP} @tab @code{TIMESTAMP} ¥Õ¥£¡¼¥ë¥É
-@item @code{FIELD_TYPE_DATE} @tab @code{DATE} ¥Õ¥£¡¼¥ë¥É
-@item @code{FIELD_TYPE_TIME} @tab @code{TIME} ¥Õ¥£¡¼¥ë¥É
-@item @code{FIELD_TYPE_DATETIME} @tab @code{DATETIME} ¥Õ¥£¡¼¥ë¥É
-@item @code{FIELD_TYPE_YEAR} @tab @code{YEAR} ¥Õ¥£¡¼¥ë¥É
-@item @code{FIELD_TYPE_STRING} @tab ʸ»úÎó (@code{CHAR} ¤Þ¤¿¤Ï @code{VARCHAR}) ¥Õ¥£¡¼¥ë¥É
-@item @code{FIELD_TYPE_BLOB} @tab @code{BLOB} ¤Þ¤¿¤Ï @code{TEXT} ¥Õ¥£¡¼¥ë¥É (ºÇÂçŤò³ÎÄꤹ¤ë¤Ë¤Ï @code{max_length} ¤ò»ÈÍѤ·¤Æ²¼¤µ¤¤)
-@item @code{FIELD_TYPE_SET} @tab @code{SET} ¥Õ¥£¡¼¥ë¥É
-@item @code{FIELD_TYPE_ENUM} @tab @code{ENUM} ¥Õ¥£¡¼¥ë¥É
-@item @code{FIELD_TYPE_NULL} @tab @code{NULL}·¿ ¥Õ¥£¡¼¥ë¥É
-@item @code{FIELD_TYPE_CHAR} @tab Èó¿ä¾©; @code{FIELD_TYPE_TINY} ¤òÂå¤ï¤ê¤Ë»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤
-@end multitable
-
-@code{IS_NUM()} ¥Þ¥¯¥í¤Ç¡¢¥Õ¥£¡¼¥ë¥É¤¬¿ôÃÍ¥¿¥¤¥×¤«¤É¤¦¤«¤ò¥Æ¥¹¥È¤Ç¤­¤Þ¤¹¡£
-¥Õ¥£¡¼¥ë¥É¤¬¿ôÃͤξì¹ç¡¢@code{type} ¥á¥ó¥Ð¤ò @code{IS_NUM()} ¤ËÅϤ¹¤È
-TRUE ¤Èɾ²Á¤·¤Þ¤¹:
-
-@example
-if (IS_NUM(field->type))
- printf("Field is numeric\n");
-@end example
-
-@item unsigned int length
-¥Õ¥£¡¼¥ë¥É¤ÎÉý¡£¤³¤ì¤Ï¥Æ¡¼¥Ö¥ëÄêµÁ¤Ç»ØÄꤵ¤ì¤¿¤â¤Î¤Ç¤¹¡£
-
-@item unsigned int max_length
-·ë²Ì¥»¥Ã¥È¤Î¥Õ¥£¡¼¥ë¥É¤ÎºÇÂçÉý(¼ÂºÝ¤Î·ë²Ì¥»¥Ã¥È¤ÎÃæ¤Î¥ì¥³¡¼¥É¤ÎºÇĹ¥Õ¥£¡¼¥ë¥ÉÃÍ
-¤ÎŤµ)¡£@code{mysql_store_result()} ¤Þ¤¿¤Ï @code{mysql_list_fields()} ¤ò
-»ÈÍѤ¹¤ë¾ì¹ç¤Ï¡¢¤³¤ì¤Ï¥Õ¥£¡¼¥ë¥É¤ÎºÇÂçÉý¤Ë¤Ê¤ê¤Þ¤¹¡£
-@code{mysql_use_result()} ¤ò»ÈÍѤ¹¤ë¾ì¹ç¤Ï¡¢¤³¤ÎÊÑ¿ô¤ÎÃÍ¤Ï 0 ¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-@item unsigned int flags
-¥Õ¥£¡¼¥ë¥É¤Î¼ï¡¹¤Î¥Ó¥Ã¥È¥Õ¥é¥°¡£@code{flags} ÃÍ¤Ï 0 ¤Þ¤¿¤Ï¼¡¤Î¥Ó¥Ã¥È¤Î°ì¤Ä
-°Ê¾å¤ÎÁȤ߹ç¤ï¤»¤Ç¤¹:
-
-@multitable @columnfractions .3 .55
-@item @strong{¥Õ¥é¥°¤ÎÃÍ} @tab @strong{¥Õ¥é¥°¤Î°ÕÌ£}
-@item @code{NOT_NULL_FLAG} @tab ¥Õ¥£¡¼¥ë¥É¤Ï @code{NULL} ¤Ë¤Ç¤­¤Ê¤¤
-@item @code{PRI_KEY_FLAG} @tab ¥Õ¥£¡¼¥ë¥É¤Ï¥×¥é¥¤¥Þ¥ê¥­¡¼¤Î°ìÉô¤Ç¤¢¤ë
-@item @code{UNIQUE_KEY_FLAG} @tab ¥Õ¥£¡¼¥ë¥É¤Ï¥æ¥Ë¡¼¥¯¥­¡¼¤Î°ìÉô¤Ç¤¢¤ë
-@item @code{MULTIPLE_KEY_FLAG} @tab ¥Õ¥£¡¼¥ë¥É¤ÏÈó¥æ¥Ë¡¼¥¯¥­¡¼¤Î°ìÉô¤Ç¤¢¤ë
-@item @code{UNSIGNED_FLAG} @tab ¥Õ¥£¡¼¥ë¥É¤Ï @code{UNSIGNED} °À­¤ò»ý¤Ã¤Æ¤¤¤ë
-@item @code{ZEROFILL_FLAG} @tab ¥Õ¥£¡¼¥ë¥É¤Ï @code{ZEROFILL} °À­¤ò»ý¤Ã¤Æ¤¤¤ë
-@item @code{BINARY_FLAG} @tab ¥Õ¥£¡¼¥ë¥É¤Ï @code{BINARY} °À­¤ò»ý¤Ã¤Æ¤¤¤ë
-@item @code{AUTO_INCREMENT_FLAG} @tab ¥Õ¥£¡¼¥ë¥É¤Ï @code{AUTO_INCREMENT} °À­¤ò»ý¤Ã¤Æ¤¤¤ë
-@item @code{ENUM_FLAG} @tab ¥Õ¥£¡¼¥ë¥É¤Ï @code{ENUM} ¤Ç¤¢¤ë (Èó¿ä¾©)
-@item @code{BLOB_FLAG} @tab ¥Õ¥£¡¼¥ë¥É¤Ï @code{BLOB} ¤Þ¤¿¤Ï @code{TEXT} ¤Ç¤¢¤ë (Èó¿ä¾©)
-@item @code{TIMESTAMP_FLAG} @tab ¥Õ¥£¡¼¥ë¥É¤Ï @code{TIMESTAMP} ¤Ç¤¢¤ë (Èó¿ä¾©)
-@end multitable
-
-@code{BLOB_FLAG}, @code{ENUM_FLAG}, @code{TIMESTAMP_FLAG} ¤Î»ÈÍѤϿ侩¤µ
-¤ì¤Þ¤»¤ó¡£¤³¤ì¤é¤Ï·¿¤Î°À­¤Ç¤Ï¤Ê¤¯¥Õ¥£¡¼¥ë¥É¤Î·¿¤ò¼¨¤¹¤«¤é¤Ç¤¹¡£Âå¤ï¤ê
-¤Ë @code{field->type} ¤ò @code{FIELD_TYPE_BLOB}, @code{FIELD_TYPE_ENUM},
-@code{FIELD_TYPE_TIMESTAMP} ¤ËÂФ·¤Æ¥Æ¥¹¥È¤¹¤ëÊý¤ò¤ª´«¤á¤·¤Þ¤¹¡£
-
-@noindent
-¼¡¤ÎÎã¤Ï @code{flags} ÃͤÎŵ·¿Åª¤Ê»ÈÍѤò¼¨¤·¤Æ¤¤¤Þ¤¹:
-
-@example
-if (field->flags & NOT_NULL_FLAG)
- printf("Field can't be null\n");
-@end example
-
-@code{flags} Ãͤο¿µ¶¾õÂÖ¤òÄ´¤Ù¤ë¤¿¤á¤Ë¡¢¼¡¤ÎÊØÍø¤Ê¥Þ¥¯¥í¤ò»ÈÍѤǤ­
-¤Þ¤¹:
-
-@multitable @columnfractions .3 .5
-@item @code{IS_NOT_NULL(flags)} @tab ¤³¤Î¥Õ¥£¡¼¥ë¥É¤¬ @code{NOT NULL} ¤È¤·¤ÆÄêµÁ¤µ¤ì¤Æ¤¤¤ì¤Ð¿¿
-@item @code{IS_PRI_KEY(flags)} @tab ¤³¤Î¥Õ¥£¡¼¥ë¥É¤¬¥×¥é¥¤¥Þ¥ê¥­¡¼¤Ê¤é¤Ð¿¿
-@item @code{IS_BLOB(flags)} @tab ¤³¤Î¥Õ¥£¡¼¥ë¥É¤¬ @code{BLOB} ¤Þ¤¿¤Ï @code{TEXT} ¤Ê¤é¤Ð¿¿ (Èó¿ä¾©; Âå¤ï¤ê¤Ë @code{field->type} ¤ò¥Æ¥¹¥È¤·¤Æ²¼¤µ¤¤)
-@end multitable
-
-@item unsigned int decimals
-¿ôÃÍ¥Õ¥£¡¼¥ë¥É¤Î¾®¿ôÉô·å¿ô¡£
-@end table
-
-@node C API function overview, C API functions, C API datatypes, Clients
-@section C API ´Ø¿ô³µÍ×
-
-C API ¤Ë¤Ï¼¡¤Ë°ìÍ÷¤µ¤ì¤¿´Ø¿ô¤¬Â¸ºß¤·¤Þ¤¹¡£¤³¤ì¤é¤Î´Ø¿ô¤Ï¼¡¤ÎÀá¤Ç¤«¤Ê
-¤ê¾ÜºÙ¤ËÀâÌÀ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-@xref{C API functions}¡£
-
-@multitable @columnfractions .3 .7
-@item @strong{mysql_affected_rows()} @tab
-ºÇ¸å¤Î @code{UPDATE}, @code{DELETE}, @code{INSERT} ¥¯¥¨¥ê¤Ë¤è¤Ã¤Æ±Æ¶Á¤µ
-¤ì¤¿¥ì¥³¡¼¥É¿ô¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_close()} @tab
-¥µ¡¼¥ÐÀܳ¤ò¥¯¥í¡¼¥º¤·¤Þ¤¹¡£
-
-@item @strong{mysql_connect()} @tab
-@strong{MySQL} ¥µ¡¼¥Ð¤ËÀܳ¤·¤Þ¤¹¡£¤³¤Î´Ø¿ô¤Ï¿ä¾©¤µ¤ì¤Þ¤»¤ó; Âå¤ï¤ê¤Ë
-@code{mysql_real_connect()} ¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item @strong{mysql_change_user()} @tab
-ÀܳÃæ¤Î¤Î¥æ¡¼¥¶¤È¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÊѹ¹¤·¤Þ¤¹¡£
-
-@item @strong{mysql_create_db()} @tab
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÀ¸À®¤·¤Þ¤¹¡£¤³¤Î´Ø¿ô¤Ï¿ä¾©¤µ¤ì¤Þ¤»¤ó; Âå¤ï¤ê¤Ë SQL ¥³¥Þ¥ó
-¥É @code{CREATE DATABASE} ¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item @strong{mysql_data_seek()} @tab
-¥¯¥¨¥ê·ë²Ì¥»¥Ã¥ÈÃæ¤ÎǤ°Õ¤Î¥ì¥³¡¼¥É¤Ë¥·¡¼¥¯¤·¤Þ¤¹¡£
-
-@item @strong{mysql_debug()} @tab
-Í¿¤¨¤é¤ì¤¿Ê¸»úÎó¤Ç @code{DBUG_PUSH} ¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£
-
-@item @strong{mysql_drop_db()} @tab
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÇË´þ¤·¤Þ¤¹¡£¤³¤Î´Ø¿ô¤Ï¿ä¾©¤µ¤ì¤Þ¤»¤ó; Âå¤ï¤ê¤Ë SQL ¥³¥Þ¥ó
-¥É @code{DROP DATABASE} ¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item @strong{mysql_dump_debug_info()} @tab
-¥µ¡¼¥Ð¤Ë¡¢¥Ç¥Ð¥Ã¥°¾ðÊó¤ò¥í¥°¤Ë½ñ¤­½Ð¤µ¤»¤Þ¤¹¡£
-
-@item @strong{mysql_eof()} @tab
-·ë²Ì¥»¥Ã¥È¤ÎºÇ¸å¤Î¥ì¥³¡¼¥É¤¬Æɤޤ줿¤«¤É¤¦¤«¤òȽÄꤷ¤Þ¤¹¡£¤³¤Î´Ø¿ô¤Ï¿ä¾©¤µ¤ì¤Þ¤»
-¤ó; Âå¤ï¤ê¤Ë @code{mysql_errno()} ¤Þ¤¿¤Ï @code{mysql_error()} ¤ò»ÈÍѤ·¤Æ²¼
-¤µ¤¤¡£
-
-@item @strong{mysql_errno()} @tab
-ºÇ¸å¤Î @strong{MySQL} ´Ø¿ô¤«¤é¤Î¥¨¥é¡¼ÈÖ¹æ¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_error()} @tab
-ºÇ¸å¤Î @strong{MySQL} ´Ø¿ô¤«¤é¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_real_escape_string()} @tab
-Escapes special characters in a string for use in a SQL statement taking
-into account the current charset of the connection.
-
-@item @strong{mysql_escape_string()} @tab
-SQL ¥¹¥Æ¡¼¥È¥á¥ó¥ÈÆâ¤Ç»ÈÍѤ¹¤ë¤¿¤á¤Ëʸ»úÎóÃæ¤ÎÆüìʸ»ú¤ò¥¨¥¹¥±¡¼¥×¤·¤Þ¤¹¡£
-
-@item @strong{mysql_fetch_field()} @tab
-¥Æ¡¼¥Ö¥ë¤Î¼¡¤Î¥Õ¥£¡¼¥ë¥É¤Î·¿¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_fetch_field_direct()} @tab
-¥Æ¡¼¥Ö¥ë¤Î¡¢ÈÖ¹æ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥£¡¼¥ë¥É¤Î·¿¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_fetch_fields()} @tab
-Á´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¹½Â¤ÂΤÎÇÛÎó¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_fetch_lengths()} @tab
-¸½ºß¤Î¥ì¥³¡¼¥ÉÃæ¤ÎÁ´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤ÎŤµ¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_fetch_row()} @tab
-·ë²Ì¥»¥Ã¥È¤«¤é¼¡¤Î¥ì¥³¡¼¥É¤ò¼è¤ê½Ð¤·¤Þ¤¹¡£
-
-@item @strong{mysql_field_seek()} @tab
-»ØÄꤵ¤ì¤¿¥Õ¥£¡¼¥ë¥É¾å¤Ë¥Õ¥£¡¼¥ë¥É¥«¡¼¥½¥ë¤òÃÖ¤­¤Þ¤¹¡£
-
-@item @strong{mysql_field_count()} @tab
-ºÇ¸å¤Î¥¯¥¨¥ê¤Î·ë²Ì¤Î¥Õ¥£¡¼¥ë¥É¤Î¿ô¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_field_tell()} @tab
-ºÇ¸å¤Î @code{mysql_fetch_field()} ¤Ç»ÈÍѤµ¤ì¤¿¥Õ¥£¡¼¥ë¥É¥«¡¼¥½¥ë¤Î°ÌÃÖ¤òÊÖ
-¤·¤Þ¤¹¡£
-
-@item @strong{mysql_free_result()} @tab
-·ë²Ì¥»¥Ã¥È¤Ë¤è¤Ã¤Æ»ÈÍѤµ¤ì¤¿¥á¥â¥ê¤ò²òÊü¤·¤Þ¤¹¡£
-
-@item @strong{mysql_get_client_info()} @tab
-¥¯¥é¥¤¥¢¥ó¥È¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_get_host_info()} @tab
-Àܳ¤òÀâÌÀ¤¹¤ëʸ»úÎó¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_get_proto_info()} @tab
-Àܳ¤Ë»ÈÍѤµ¤ì¤ë¥×¥í¥È¥³¥ë¥Ð¡¼¥¸¥ç¥ó¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_get_server_info()} @tab
-¥µ¡¼¥Ð¤Î¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_info()} @tab
-ºÇ¸å¤Ë¼Â¹Ô¤µ¤ì¤¿¥¯¥¨¥ê¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_init()} @tab
-@code{MYSQL} ¹½Â¤ÂΤò³ÍÆÀ¤Þ¤¿¤Ï½é´ü²½¤·¤Þ¤¹¡£
-
-@item @strong{mysql_insert_id()} @tab
-@code{AUTO_INCREMENT} ¥Õ¥£¡¼¥ë¥É¤ËºÇ¸å¤ËÀ¸À®¤µ¤ì¤¿ ID ¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_kill()} @tab
-»ØÄꤵ¤ì¤¿¥¹¥ì¥Ã¥É¤ò»¦¤·¤Þ¤¹¡£
-
-@item @strong{mysql_list_dbs()} @tab
-´Ê°×Àµµ¬É½¸½¤ËŬ¹ç¤¹¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_list_fields()} @tab
-´Ê°×Àµµ¬É½¸½¤ËŬ¹ç¤¹¤ë¥Õ¥£¡¼¥ë¥É̾¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_list_processes()} @tab
-¸½ºß¤Î¥µ¡¼¥Ð¥¹¥ì¥Ã¥É¤Î¥ê¥¹¥È¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_list_tables()} @tab
-´Ê°×Àµµ¬É½¸½¤ËŬ¹ç¤¹¤ë¥Æ¡¼¥Ö¥ë̾¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_num_fields()} @tab
-·ë²Ì¥»¥Ã¥ÈÃæ¤Î¥Õ¥£¡¼¥ë¥É¿ô¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_num_rows()} @tab
-·ë²Ì¥»¥Ã¥ÈÃæ¤Î¥ì¥³¡¼¥É¿ô¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_options()} @tab
-@code{mysql_connect()} ¤Î¤¿¤á¤ÎÀܳ¥ª¥×¥·¥ç¥ó¤òÀßÄꤷ¤Þ¤¹¡£
-
-@item @strong{mysql_ping()} @tab
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬Æ°ºî¤·¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£
-ɬÍפǤ¢¤ì¤ÐºÆÀܳ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_query()} @tab
-NULL ½ªÃ¼Ê¸»úÎó¤È¤·¤Æµ­½Ò¤µ¤ì¤¿ SQL ¥¯¥¨¥ê¤ò¼Â¹Ô¤·¤Þ¤¹¡£
-
-@item @strong{mysql_real_connect()} @tab
-@strong{MySQL} ¥µ¡¼¥Ð¤ËÀܳ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_real_query()} @tab
-¿ô¤¨¤é¤ì¤¿Ê¸»úÎó¤È¤·¤Æµ­½Ò¤µ¤ì¤¿ SQL ¥¯¥¨¥ê¤ò¼Â¹Ô¤·¤Þ¤¹¡£
-
-@item @strong{mysql_reload()} @tab
-¸¢¸Â¥Æ¡¼¥Ö¥ë¤òºÆÆɤ߹þ¤ß¤¹¤ë¤è¤¦¤Ë¥µ¡¼¥Ð¤Ë»Ø¼¨¤·¤Þ¤¹¡£
-
-@item @strong{mysql_row_seek()} @tab
-·ë²Ì¥»¥Ã¥ÈÆâ¤Î¤¢¤ë¥ì¥³¡¼¥É¤Ø¥·¡¼¥¯¤·¤Þ¤¹¡£@code{mysql_row_tell()} ¤«¤éÊÖ¤µ¤ì¤ëÃͤò
-»ÈÍѤ·¤Þ¤¹¡£
-
-@item @strong{mysql_row_tell()} @tab
-¥ì¥³¡¼¥É¥«¡¼¥½¥ë¤Î°ÌÃÖ¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_select_db()} @tab
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÁªÂò¤·¤Þ¤¹¡£
-
-@item @strong{mysql_shutdown()} @tab
-¥Ç¡¼¥¿¥Ù¡¼¥¹¥µ¡¼¥Ð¤ò¥·¥ã¥Ã¥È¥À¥¦¥ó¤·¤Þ¤¹¡£
-
-@item @strong{mysql_start_slave()} @tab
-Starts slave replication thread
-
-@item @strong{mysql_stat()} @tab
-ʸ»úÎó¤Ç¥µ¡¼¥Ð¾õÂÖ¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_store_result()} @tab
-¥¯¥é¥¤¥¢¥ó¥È¤Ë´°Á´¤Ê·ë²Ì¥»¥Ã¥È¤ò¼è¤ê½Ð¤·¤Þ¤¹¡£
-
-@item @strong{mysql_stop_slave()} @tab
-Stops slave replication thread
-
-@item @strong{mysql_thread_id()} @tab
-¸½ºß¤Î¥¹¥ì¥Ã¥É ID ¤òÊÖ¤·¤Þ¤¹¡£
-
-@item @strong{mysql_thread_save()} @tab
-Returns 1 if the clients are compiled as threadsafe.
-
-@item @strong{mysql_use_result()} @tab
-³Æ¥ì¥³¡¼¥É¤ÎưŪ·ë²Ì¥»¥Ã¥È¤ò½é´ü²½¤·¤Þ¤¹¡£
-@end multitable
-
-¥µ¡¼¥Ð¤ØÀܳ¤¹¤ë¤Ë¤Ï¡¢Àܳ¥Ï¥ó¥É¥é¤ò½é´ü²½¤¹¤ë¤¿¤á¤Ë @code{mysql_init()}
-¤ò¸Æ¤Ó¤À¤·¡¢¤½¤ì¤«¤é @code{mysql_real_connect()} ¤ò¤½¤Î¥Ï¥ó¥É¥é¤Ç¸Æ¤Ó¤À¤·
-¤Þ¤¹ (¥Û¥¹¥È̾¡¢¥æ¡¼¥¶Ì¾¡¢¥Ñ¥¹¥ï¡¼¥É¤Î¤è¤¦¤Ê¾¤Î¾ðÊó¤Ë²Ã¤¨¤Æ)¡£
-Upon connection, @code{mysql_real_connect()} sets the
-@code{reconnect} flag (part of the MYSQL structure) to a value of
-@code{1}. This flag indicates, in the event that a query cannot be
-performed because of a lost connection, to try reconnecting to the
-server before giving up.
-¤½¤ÎÀܳ¤Ç
-¤Î½èÍý¤¬½ªÎ»¤·¤¿»þ¤Ï¡¢Àܳ¤ò½ªÎ»¤µ¤»¤ë¤¿¤á¤Ë @code{mysql_close()} ¤ò¸Æ¤Ó¤À
-¤·¤Þ¤¹¡£
-
-Àܳ¤¬Í­¸ú¤Ê´Ö¤Ï¡¢¥¯¥é¥¤¥¢¥ó¥È¤Ï @code{mysql_query()} ¤Þ¤¿¤Ï
-@code{mysql_real_query()} ¤ò»ÈÍѤ·¤Æ SQL ¥¯¥¨¥ê¤ò¥µ¡¼¥Ð¤ËÁ÷¿®¤Ç¤­¤Þ¤¹¡£¤³
-¤Î£²¤Ä¤Î°ã¤¤¤Ï¡¢@code{mysql_query()} ¤Ï NULL½ªÃ¼Ê¸»úÎó¤È¤·¤Æ¥¯¥¨¥ê¤¬µ­½Ò¤µ
-¤ì¤ë¤³¤È¤ò´üÂÔ¤¹¤ë¤Î¤ËÂФ·¡¢@code{mysql_real_query()} ¤Ï¿ô¤¨¤é¤ì¤¿Ê¸»úÎó¤ò
-´üÂÔ¤¹¤ë¤³¤È¤Ç¤¹¡£Ê¸»úÎ󤬥Х¤¥Ê¥ê¥Ç¡¼¥¿(NUL¥Ð¥¤¥È¤ò´Þ¤ß¤³¤È¤¬¤¢¤ë)¤ò´Þ¤à
-¾ì¹ç¤Ï¡¢@code{mysql_real_query()} ¤ò»ÈÍѤ¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-Èó@code{SELECT} ¥¯¥¨¥ê(Î㤨¤Ð¡¢@code{INSERT}, @code{UPDATE},
-@code{DELETE})¤Ç¤Ï¡¢¤É¤ì¤¯¤é¤¤¤Î¥ì¥³¡¼¥É¤¬±Æ¶Á(Êѹ¹)¤µ¤ì¤¿¤«¤ò
-@code{mysql_affected_rows()} ¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¸«¤Ä¤±½Ð¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@code{SELECT} ¥¯¥¨¥ê¤Ç¤Ï¡¢ÁªÂò¤µ¤ì¤¿¥ì¥³¡¼¥É¤ò·ë²Ì¥»¥Ã¥È¤È¤·¤Æ¼è¤ê½Ð¤·¤Þ¤¹¡£
-(Ãí°Õ: ¤¤¤¯¤Ä¤«¤Î¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ï¡¢¥ì¥³¡¼¥É¤òÊÖ¤¹¤È¤¤¤¦ÅÀ¤Ç
-@code{SELECT}¤Ë»÷¤Æ¤¤¤Þ¤¹¡£¤½¤ì¤Ï @code{SHOW}, @code{DESCRIBE},
-@code{EXPLAIN} ¤Ç¤¹¡£¤³¤ì¤é¤Ï @code{SELECT} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤ÈƱ¤¸ÊýË¡¤Ç°·¤ï
-¤ì¤ë¤Ù¤­¤Ç¤¹¡£)
-
-¥¯¥é¥¤¥¢¥ó¥È¤¬·ë²Ì¥»¥Ã¥È¤ò½èÍý¤¹¤ë¤Ë¤Ï£²¤Ä¤ÎÊýË¡¤¬¤¢¤ê¤Þ¤¹¡£°ì¤ÄÌܤϡ¢
-@code{mysql_store_result()} ¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢·ë²Ì¥»¥Ã¥ÈÁ´ÂΤò°ìÅ٤ˤ¹¤Ù¤Æ
-¼è¤ê½Ð¤¹¤³¤È¤Ç¤¹¡£¤³¤Î´Ø¿ô¤Ï¥µ¡¼¥Ð¤«¤é¥¯¥¨¥ê¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë¤¹¤Ù¤Æ¤Î¥ì¥³¡¼
-¥É¤ò¼èÆÀ¤·¡¢¤½¤ì¤ò¥¯¥é¥¤¥¢¥ó¥È¤Ë³ÊǼ¤·¤Þ¤¹¡£Æó¤ÄÌܤϡ¢
-@code{mysql_use_result()} ¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢¥ì¥³¡¼¥É¤´¤È¤Î·ë²Ì¥»¥Ã¥È¼è¤ê½Ð
-¤·¤ò½é´ü²½¤¹¤ë¤³¤È¤Ç¤¹¡£¤³¤Î´Ø¿ô¤Ï¼è¤ê½Ð¤·¤ò½é´ü²½¤·¤Þ¤¹¤¬¡¢¼ÂºÝ¤Ë¤Ï¥µ¡¼¥Ð
-¤«¤é²¿¤Î¥ì¥³¡¼¥É¤âÆÀ¤Þ¤»¤ó¡£
-
-¤É¤Á¤é¤Î¾ì¹ç¤Ç¤â¡¢@code{mysql_fetch_row()} ¤ò¸Æ¤Ó½Ð¤·¤Æ¥ì¥³¡¼¥É¤Ë¥¢¥¯¥»¥¹
-¤·¤Þ¤¹¡£@code{mysql_store_result()} ¤Ç¤Ï¡¢@code{mysql_fetch_row()} ¤Ï´û¤Ë
-¥µ¡¼¥Ð¤«¤é¼èÆÀ¤·¤Æ¤¢¤ë¥ì¥³¡¼¥É¤Ë¥¢¥¯¥»¥¹¤·¤Þ¤¹¡£
-@code{mysql_use_result()} ¤Ç¤Ï¡¢@code{mysql_fetch_row()} ¤Ï¼ÂºÝ¤Ë¥µ¡¼¥Ð¤«
-¤é¥ì¥³¡¼¥É¤ò¼è¤ê½Ð¤·¤Þ¤¹¡£³Æ¥ì¥³¡¼¥É¤Î¥Ç¡¼¥¿ÃͤΥµ¥¤¥º¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤Ï
-@code{mysql_fetch_lengths()} ¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤ÇÆÀ¤é¤ì¤Þ¤¹¡£
-
-·ë²Ì¥»¥Ã¥È¤Ç¤Î½èÍý¤¬½ª¤Ã¤¿¸å¤Ï¡¢@code{mysql_free_result()} ¤ò¸Æ¤Ó½Ð¤·¡¢¤½
-¤ì¤¬»ÈÍѤ·¤Æ¤¤¤¿¥á¥â¥ê¤ò²òÊü¤·¤Æ²¼¤µ¤¤¡£
-
-¤³¤Î£²¤Ä¤Î¼è¤ê½Ð¤·µ¡¹½¤ÏÁêÊäŪ¤Ê¤â¤Î¤Ç¤¹¡£¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤Ï¡¢É¬ÍפË
-¤è¤Ã¤Æ¤â¤Ã¤È¤âŬÀڤʥ¢¥×¥í¡¼¥Á¤òÁªÂò¤¹¤Ù¤­¤Ç¤¹¡£´·ÎãŪ¤Ë¡¢¥¯¥é¥¤¥¢¥ó¥È¤Ï°ì
-ÈÌ¤Ë @code{mysql_store_result()} ¤ò»ÈÍѤ¹¤ë·¹¸þ¤Ë¤¢¤ê¤Þ¤¹¡£
-
-@code{mysql_store_result()} ¤ÎÍøÅÀ¤Ï¡¢¤¹¤Ù¤Æ¤Î¥ì¥³¡¼¥É¤ò¥¯¥é¥¤¥¢¥ó¥È¤Ë¼è¤Ã
-¤ÆÍè¤ë¤¿¤á¡¢Ï¢Â³¤·¤Æ¥ì¥³¡¼¥É¤ò¥¢¥¯¥»¥¹¤Ç¤­¤ë¤À¤±¤Ç¤Ê¤¯¡¢·ë²Ì¥»¥Ã¥ÈÃæ¤Î¸½ºß
-¤Î¥ì¥³¡¼¥É°ÌÃÖ¤òÊѹ¹¤¹¤ë¤¿¤á¤Ë¡¢@code{mysql_data_seek()} ¤ä
-@code{mysql_row_seek()} ¤ò»ÈÍѤ·¤Æ¡¢·ë²Ì¥»¥Ã¥È¤ÎÃæ¤ò¸å¤äÁ°¤Ë°ÜÆ°¤¹¤ë¤³¤È¤¬
-¤Ç¤­¤Þ¤¹¡£¤Þ¤¿¡¢@code{mysql_num_rows()} ¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢¥ì¥³¡¼¥É¿ô¤ò¸«¤Ä
-¤±¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£°ìÊý¡¢@code{mysql_store_result()} ¤ÎɬÍ×¥á¥â¥ê¤Ï¡¢Â礭
-¤Ê·ë²Ì¥»¥Ã¥È¤Ç¤Ï¤È¤Æ¤â¹â¤¯¡¢out-of-memory ¾õÂÖ¤ËÁø¶ø¤¹¤ë²ÄǽÀ­¤¬¹â¤¯¤Ê¤ê¤Þ
-¤¹¡£
-
-@code{mysql_use_result()} ¤ÎÍøÅÀ¤Ï¡¢°ìÅ٤˰ì¤Ä¤Î¥ì¥³¡¼¥É¤À¤±¤òÊÝ»ý¤¹¤ë¤¿¤á¡¢
-¥¯¥é¥¤¥¢¥ó¥È¤¬·ë²Ì¥»¥Ã¥È¤ËÍ׵᤹¤ë¥á¥â¥ê¤¬¾¯¤Ê¤¤¤³¤È¤Ç¤¹¡Ê¤½¤·¤Æ¡¢³äÅö¤Î¥ª¡¼
-¥Ð¡¼¥Ø¥Ã¥É¤â¾¯¤Ê¤¤¤Î¤Ç¡¢@code{mysql_use_result()} ¤Ï¤è¤ê®¤¯¤Ê¤ê¤Þ¤¹¡Ë¡£ÉÔ
-Íø¤ÊÅÀ¤Ï¡¢¥µ¡¼¥Ð¤Î¹´Â«¤òÈò¤±¤ë¤¿¤á¡¢³Æ¥ì¥³¡¼¥É¤òÁÇÁ᤯½èÍý¤¹¤ëɬÍפ¬¤¢¤ë¤³
-¤È¡¢·ë²Ì¥»¥Ã¥ÈÃæ¤Ç¥ì¥³¡¼¥É¤Î¥é¥ó¥À¥à¥¢¥¯¥»¥¹¤¬¤Ç¤­¤Ê¤¤¤³¤È¡Ê¥ì¥³¡¼¥É¤ò½çÈÖ
-¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤·¤«¤Ç¤­¤Þ¤»¤ó¡Ë¡¢¤½¤·¤Æ¡¢¤¹¤Ù¤Æ¤Î¥ì¥³¡¼¥É¤ò¼è¤ê½Ð¤µ¤Ê¤¤
-¸Â¤ê¡¢·ë²Ì¥»¥Ã¥ÈÃæ¤Ë¤¤¤¯¤Ä¤Î¥ì¥³¡¼¥É¤¬¤¢¤ë¤«¤òÃΤ뤳¤È¤¬¤Ç¤­¤Ê¤¤¤³¤È¤Ç¤¹¡£
-¤µ¤é¤Ë¡¢¤¢¤Ê¤¿¤¬Ãµ¤·¤Æ¤¤¤ë¾ðÊó¤ò¡¢¸¡º÷¤ÎÅÓÃæ¤Ç¸«¤Ä¤±¤ë¤³¤È¤¬¤Ç¤­¤Æ¡¢ÌäÂ꤬
-²ò·è¤·¤¿¤È¤·¤Æ¤â¡¢¤¹¤Ù¤Æ¤Î¥ì¥³¡¼¥É¤ò¼è¤ê½Ð¤µ@emph{¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó}¡£
-
-API ¤Ï¥¯¥é¥¤¥¢¥ó¥È¤¬¥¯¥¨¥ê¤¬ @code{SELECT} ¤Ç¤¢¤ë¤«¤É¤¦¤«¤òÃΤ뤳¤È¤Ê¤·¤Ë¡¢
-¡ÊɬÍ×»þ¤À¤±¥ì¥³¡¼¥É¤ò¼è¤ê½Ð¤¹¡Ë¥¯¥¨¥ê¤ËŬÀڤ˱þÅú¤Ç¤­¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£
-¤½¤ì¤¾¤ì¤Î @code{mysql_query()}¡Ê¤Þ¤¿¤Ï @code{mysql_real_query()}¡Ë¤Î¸å¤Ç¡¢
-@code{mysql_store_result()} ¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢¤³¤ì¤¬²Äǽ¤Ç¤¹¡£·ë²Ì¥»¥Ã¥È¤Î
-¸Æ¤Ó½Ð¤·¤¬À®¸ù¤¹¤ë¤È¡¢¥¯¥¨¥ê¤Ï @code{SELECT} ¤Ç¤¢¤ê¡¢¥ì¥³¡¼¥É¤òÆɤळ¤È¤¬
-¤Ç¤­¤Þ¤¹¡£·ë²Ì¥»¥Ã¥È¸Æ¤Ó½Ð¤·¤¬¼ºÇÔ¤·¤¿¾ì¹ç¤Ï¡¢·ë²Ì¤¬¼ÂºÝ¤Ë´üÂÔ¤µ¤ì¤¿¤â¤Î¤Ç
-¤¢¤ë¤«¤É¤¦¤«¤ò³ÎÄꤹ¤ë¤¿¤á¤Ë¡¢@code{mysql_field_count()} ¤ò¸Æ¤Ó½Ð¤·¤Æ¤¯¤À
-¤µ¤¤¡£@code{mysql_field_count()} ¤¬ 0 ¤òÊÖ¤¹¾ì¹ç¤Ï¡¢¥¯¥¨¥ê¤Ï¥Ç¡¼¥¿¤òÊÖ¤·¤Þ
-¤»¤ó¡Ê¥¯¥¨¥ê¤¬ @code{INSERT}, @code{UPDATE}, @code{DELETE} Åù¤Ç¤¢¤ë¤³¤È¤ò
-¼¨¤·¤Þ¤¹¡Ë¡£¤Ä¤Þ¤ê¥ì¥³¡¼¥É¤¬Ê֤뤳¤È¤ò´üÂԤǤ­¤Þ¤»¤ó¡£
-@code{mysql_field_count()} ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢¥¯¥¨¥ê¤Ï¥ì¥³¡¼¥É¤òÊÖ¤¹¤Ù¤­¤Ê
-¤Î¤Ë¡¢ÊÖ¤µ¤Ê¤«¤Ã¤¿¤È¤¤¤¦¤³¤È¤Ç¤¹¡£¤³¤ì¤Ï¥¯¥¨¥ê¤¬ @code{SELECT} ¤Ç¼ºÇÔ¤·¤¿
-¤È¤¤¤¦¤³¤È¤ò¼¨¤·¤Þ¤¹¡£¤³¤ì¤ò¤É¤Î¤è¤¦¤Ë¹Ô¤Ê¤¦¤³¤È¤¬¤Ç¤­¤ë¤«¤ÎÎã¤Ï¡¢
-@code{mysql_field_count()} ¤ÎÀâÌÀ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@code{mysql_store_result()} ¤È @code{mysql_use_result()} ¤Ï¤É¤Á¤é¤â¡¢·ë²Ì
-¥»¥Ã¥È¤òºî¤ë¥Õ¥£¡¼¥ë¥É¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¡Ê¥Õ¥£¡¼¥ë¥É¤Î¿ô¡¢¤½¤Î̾Á°¤ä·¿¤Ê¤É¡Ë¤ò
-³ÍÆÀ¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£@code{mysql_fetch_field()} ¤ò·«¤êÊÖ¤·¸Æ¤Ó½Ð¤¹¤³¤È
-¤Ç½çÈ֤ˡ¢¤Þ¤¿¤Ï¡¢@code{mysql_fetch_field_direct()} ¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¥ì¥³¡¼
-¥ÉÆâ¤Î¥Õ¥£¡¼¥ë¥ÉÈÖ¹æ¤Ç¡¢¥ì¥³¡¼¥ÉÆâ¤Î¥Õ¥£¡¼¥ë¥É¾ðÊó¤Ë¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­
-¤Þ¤¹¡£¸½ºß¤Î¥Õ¥£¡¼¥ë¥É¥«¡¼¥½¥ë°ÌÃÖ¤Ï @code{mysql_field_seek()} ¤ò¸Æ¤Ó½Ð¤¹
-¤³¤È¤ÇÊѹ¹¤Ç¤­¤Þ¤¹¡£¥Õ¥£¡¼¥ë¥É¥«¡¼¥½¥ë¤ÎÀßÄê¤Ï¡¢¤½¤Î¸å¤Î
-@code{mysql_fetch_field()} ¸Æ¤Ó½Ð¤·¤Ë±Æ¶Á¤·¤Þ¤¹¡£
-@code{mysql_fetch_fields()} ¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ç¡¢°ìÅ٤ˤ¹¤Ù¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤Î¾ð
-Êó¤òÆÀ¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£
-
-¥¨¥é¡¼¤Î¸¡½Ð¡¢Êó¹ð¤Ë¤Ä¤¤¤Æ¤Ï¡¢@code{mysql_errno()} ¤È
-@code{mysql_error()} ´Ø¿ô¤ÎÊýË¡¤Ë¤è¤Ã¤Æ¡¢@strong{MySQL} ¤Ï¥¨¥é¡¼¾ðÊó¤Ø¤Î¥¢
-¥¯¥»¥¹¤òÄ󶡤·¤Þ¤¹¡£¤³¤ì¤é¤Ï¡¢ºÇ¸å¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿À®¸ù¤Þ¤¿¤Ï¼ºÇÔ¤·ÆÀ¤ë´Ø¿ô¤Ë
-¤Ä¤¤¤Æ¤Î¥¨¥é¡¼¥³¡¼¥É¤È¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òÊÖ¤·¡¢¥¨¥é¡¼¤¬¤¤¤Ä²¿¤ÇȯÀ¸¤·¤¿¤«¤ò
-³ÎÄꤹ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@node C API functions, Perl, C API function overview, Clients
-@section C API ´Ø¿ôÀâÌÀ
-
-@menu
-* mysql_affected_rows:: @code{mysql_affected_rows()}
-* mysql_close:: @code{mysql_close()}
-* mysql_connect:: @code{mysql_connect()}
-* mysql_change_user:: @code{mysql_change_user()}
-* mysql_create_db:: @code{mysql_create_db()}
-* mysql_data_seek:: @code{mysql_data_seek()}
-* mysql_debug:: @code{mysql_debug()}
-* mysql_drop_db:: @code{mysql_drop_db()}
-* mysql_dump_debug_info:: @code{mysql_dump_debug_info()}
-* mysql_eof:: @code{mysql_eof()}
-* mysql_errno:: @code{mysql_errno()}
-* mysql_error:: @code{mysql_error()}
-* mysql_escape_string:: @code{mysql_escape_string()}
-* mysql_fetch_field:: @code{mysql_fetch_field()}
-* mysql_fetch_fields:: @code{mysql_fetch_fields()}
-* mysql_fetch_field_direct:: @code{mysql_fetch_field_direct()}
-* mysql_fetch_lengths:: @code{mysql_fetch_lengths()}
-* mysql_fetch_row:: @code{mysql_fetch_row()}
-* mysql_field_count:: @code{mysql_field_count()}
-* mysql_field_seek:: @code{mysql_field_seek()}
-* mysql_field_tell:: @code{mysql_field_tell()}
-* mysql_free_result:: @code{mysql_free_result()}
-* mysql_get_client_info:: @code{mysql_get_client_info()}
-* mysql_get_host_info:: @code{mysql_get_host_info()}
-* mysql_get_proto_info:: @code{mysql_get_proto_info()}
-* mysql_get_server_info:: @code{mysql_get_server_info()}
-* mysql_info:: @code{mysql_info()}
-* mysql_init:: @code{mysql_init()}
-* mysql_insert_id:: @code{mysql_insert_id()}
-* mysql_kill:: @code{mysql_kill()}
-* mysql_list_dbs:: @code{mysql_list_dbs()}
-* mysql_list_fields:: @code{mysql_list_fields()}
-* mysql_list_processes:: @code{mysql_list_processes()}
-* mysql_list_tables:: @code{mysql_list_tables()}
-* mysql_num_fields:: @code{mysql_num_fields()}
-* mysql_num_rows:: @code{mysql_num_rows()}
-* mysql_options:: @code{mysql_options()}
-* mysql_ping:: @code{mysql_ping()}
-* mysql_query:: @code{mysql_query()}
-* mysql_real_connect:: @code{mysql_real_connect()}
-* mysql_real_escape_string:: @code{mysql_real_escape_string()}
-* mysql_real_query:: @code{mysql_real_query()}
-* mysql_reload:: @code{mysql_reload()}
-* mysql_row_seek:: @code{mysql_row_seek()}
-* mysql_row_tell:: @code{mysql_row_tell()}
-* mysql_select_db:: @code{mysql_select_db()}
-* mysql_shutdown:: @code{mysql_shutdown()}
-* mysql_stat:: @code{mysql_stat()}
-* mysql_store_result:: @code{mysql_store_result()}
-* mysql_thread_id:: @code{mysql_thread_id()}
-* mysql_use_result:: @code{mysql_use_result()}
-* NULL mysql_store_result:: Why is it that after @code{mysql_query()} returns success, @code{mysql_store_result()} sometimes returns @code{NULL?}
-* Query results:: What results can I get from a query?
-* Getting unique ID:: How can I get the unique ID for the last inserted row?
-* C API linking problems:: Problems linking with the C API
-* Thread-safe clients:: How to make a thread-safe client
-@end menu
-
-°Ê²¼¤ÎÀâÌÀ¤Ç¤Ï¡¢@code{NULL} ¤Î°ú¿ô¤Þ¤¿¤ÏÌá¤êÃÍ¤Ï C ¥×¥í¥°¥é¥ß¥ó¥°¸À¸ì¤Ç
-¤Î @code{NULL} ¤ò°ÕÌ£¤·¤Þ¤¹¡£@strong{MySQL} @code{NULL} ÃͤǤϤ¢¤ê¤Þ¤»¤ó¡£
-
-´Ø¿ô¤ÏÄ̾ï¥Ý¥¤¥ó¥¿¤«À°¿ô¤ÎÃͤòÊÖ¤·¤Þ¤¹¡£¤·¤«¤·´Ø¿ôÀâÌÀ¤Ëµ­½Ò¤¬¤¢¤ë¾ì¹ç¡¢
-¥Ý¥¤¥ó¥¿¤òÊÖ¤¹´Ø¿ô¤Ï¡¢À®¸ù¤ò¼¨¤¹¤¿¤á¤ËÈó @code{NULL} ÃͤòÊÖ¤·¡¢¥¨¥é¡¼¤ò¼¨¤¹¤¿
-¤á¤Ë @code{NULL} ¤òÊÖ¤·¤Þ¤¹¡£À°¿ô¤òÊÖ¤¹´Ø¿ô¤Ï¡¢À®¸ù¤ò¼¨¤¹¤¿¤á¤Ë 0 ¤òÊÖ¤·¡¢
-¥¨¥é¡¼¤ò¼¨¤¹¤¿¤á¤ËÈó0¤òÊÖ¤·¤Þ¤¹¡£``Èó0'' ¤Ï´Ø¿ôÀâÌÀ¤¬Â¾¤Ë½Ò¤Ù¤Æ¤¤¤Ê¤¤¸Â
-¤ê¡¢¤½¤Î°ÕÌ£¤Ë¤Ê¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤; ´Ø¿ôÀâÌÀ¤¬Â¾¤Ë½Ò¤Ù¤Æ¤¤¤ë¾ì¹ç¡¢
-¤³¤ì¤é¤ËÂФ·¤Æ 0 °Ê³°¤Î¸ÇÍ­¤ÎÃͤò¥Æ¥¹¥È¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤:
-
-@example
-if (result) /* Àµ¤·¤¤ */
- ... error ...
-
-if (result < 0) /* ´Ö°ã¤¤ */
- ... error ...
-
-if (result == -1) /* ´Ö°ã¤¤ */
- ... error ...
-@end example
-
-´Ø¿ô¤¬¥¨¥é¡¼¤òÊÖ¤¹¤È¤­¡¢´Ø¿ôÀâÌÀ¤Î @strong{¥¨¥é¡¼} À᤬µ¯¤êÆÀ¤ë¥¨¥é¡¼¤Î
-¼ïÎà¤ò°ìÍ÷¤·¤Æ¤¤¤Þ¤¹¡£@code{mysql_errno()} ¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤Æ¤É¤ì¤¬È¯À¸
-¤·¤¿¤«¤ò¸«¤Ä¤±½Ð¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¥¨¥é¡¼¤òɽ¸½¤¹¤ëʸ»úÎó¤Ï
-@code{mysql_error()} ¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤ÆÆÀ¤é¤ì¤Þ¤¹¡£
-
-@findex @code{mysql_affected_rows()}
-@node mysql_affected_rows, mysql_close, C API functions, C API functions
-@subsection @code{mysql_affected_rows()}
-
-@code{my_ulonglong mysql_affected_rows(MYSQL *mysql)}
-
-@subsubheading ÀâÌÀ
-
-ºÇ¸å¤Î @code{UPDATE}, @code{DELETE}, @code{INSERT} ¥¯¥¨¥ê¤Ë¤è¤Ã¤Æ±Æ¶Á¤µ
-¤ì¤¿(Êѹ¹¤µ¤ì¤¿)¹Ô¿ô¤òÊÖ¤·¤Þ¤¹¡£@code{UPDATE}, @code{DELETE}, @code{INSERT} ¥¹¥Æ¡¼¥È
-¥á¥ó¥È¤Ç¤Î @code{mysql_query()} ľ¸å¤Ë¸Æ¤Ó½Ð¤·¤Þ¤¹¡£@code{SELECT} ¥¹¥Æ¡¼¥È
-¥á¥ó¥È¤Ç¤Ï¡¢¤³¤ì¤Ï @code{mysql_num_rows()} ¤Ë»÷¤¿Æ°¤­¤ò¤·¤Þ¤¹¡£
-
-@code{mysql_affected_rows()} ¤Ï¸½ºß¥Þ¥¯¥í¤È¤·¤Æ¼ÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-0 ¤è¤êÂ礭¤¤À°¿ô¤Ï±Æ¶Á¤µ¤ì¤¿¹Ô¿ô¤Þ¤¿¤Ï¼è¤ê½Ð¤µ¤ì¤¿¹Ô¿ô¤ò¼¨¤·¤Þ¤¹¡£¥¯¥¨¥ê
-¤Î @code{WHERE} Àá¤ËŬ¹ç¤·¤¿¥ì¥³¡¼¥É¤¬¤Ê¤¤¾ì¹ç¤Þ¤¿¤Ï¥¯¥¨¥ê¤¬¤Þ¤À¼Â¹Ô¤µ¤ì
-¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï 0 ¤Ç¤¹¡£¥¯¥¨¥ê¤¬¥¨¥é¡¼¤òÊÖ¤·¤¿¤«¡¢@code{SELECT} ¥¯¥¨¥ê¤Ë
-¤Ä¤¤¤Æ @code{mysql_store_result()} ¤¬¸Æ¤Ð¤ì¤ëÁ°¤Ë
-@code{mysql_affected_rows()} ¤¬¸Æ¤Ð¤ì¤¿¾ì¹ç¤Ï -1 ¤Ç¤¹¡£
-
-@subsubheading ¥¨¥é¡¼
-
-̵¤·¡£
-
-@subsubheading Îã
-
-@example
-mysql_query(&mysql,"UPDATE products SET cost=cost*1.25 WHERE group=10");
-printf("%d products updated",mysql_affected_rows(&mysql));
-@end example
-
-@findex @code{mysql_close()}
-@node mysql_close, mysql_connect, mysql_affected_rows, C API functions
-@subsection @code{mysql_close()}
-
-@code{void mysql_close(MYSQL *mysql)}
-
-@subsubheading ÀâÌÀ
-Á°¤Ë¥ª¡¼¥×¥ó¤µ¤ì¤¿Àܳ¤ò¥¯¥í¡¼¥º¤·¤Þ¤¹¡£¥Ï¥ó¥É¥ë¤¬ @code{mysql_init()} ¤Þ
-¤¿¤Ï @code{mysql_connect()} ¤Ç¼«Æ°Åª¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¾ì¹ç¡¢
-@code{mysql_close()} ¤Ï @code{mysql} ¤Ç¼¨¤µ¤ì¤ëÀܳ¥Ï¥ó¥É¥ë¤Î²òÊü¤â¹Ô¤Ê¤¤
-¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-̵¤·¡£
-
-@subsubheading ¥¨¥é¡¼
-
-@table @code
-@item CR_COMMANDS_OUT_OF_SYNC
-ÉÔÅö¤Ê½ç¤Ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤¿¡£
-
-@item CR_SERVER_GONE_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤¬¤¤¤Ê¤¯¤Ê¤Ã¤¿¡£
-
-@item CR_SERVER_LOST
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¯¥¨¥êÃæ¤Ë¼º¤ï¤ì¤¿¡£
-
-@item CR_UNKNOWN_ERROR
-̤ÃΤΥ¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-@end table
-
-@findex @code{mysql_connect()}
-@node mysql_connect, mysql_change_user, mysql_close, C API functions
-@subsection @code{mysql_connect()}
-
-@code{MYSQL *mysql_connect(MYSQL *mysql, const char *host, const char *user, const char *passwd)}
-
-@subsubheading ÀâÌÀ
-
-¤³¤Î´Ø¿ô¤Ï¿ä¾©¤µ¤ì¤Þ¤»¤ó¡£Âå¤ï¤ê¤Ë @code{mysql_real_connect()} ¤Î»ÈÍѤò
-¤ª´«¤á¤·¤Þ¤¹¡£
-
-@code{mysql_connect()} ¤Ï @code{host} ¾å¤ÇÆ°ºî¤·¤Æ¤¤¤ë @strong{MySQL} ¥Ç¡¼
-¥¿¥Ù¡¼¥¹¥¨¥ó¥¸¥ó¤Ø¤ÎÀܳ¤Î³ÎΩ¤ò»î¤ß¤Þ¤¹¡£@code{mysql_get_client_info()}
-¤ò½ü¤¯Â¾¤Î¤¹¤Ù¤Æ¤Î API ´Ø¿ô¤ò¼Â¹Ô¤¹¤ëÁ°¤Ë@code{mysql_connect()} ¤¬À®¸ù½ªÎ»
-¤·¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-¥Ñ¥é¥á¡¼¥¿¤Î°ÕÌ£¤Ï @code{mysql_real_connect()} ¤ÎÂбþ¤¹¤ë¥Ñ¥é¥á¡¼¥¿¤ÈƱ¤¸¤Ç¤¹¤¬¡¢
-Àܳ¥Ñ¥é¥á¡¼¥¿¤Ï @code{NULL} ¤Ë¤Ç¤­¤ë¤³¤È¤¬°Û¤Ê¤ê¤Þ¤¹¡£¤³¤Î¾ì¹ç C API ¤ÏÀÜ
-³¹½Â¤ÂΤ˼«Æ°Åª¤Ë¥á¥â¥ê¤ò³ä¤êÅö¤Æ¡¢@code{mysql_close()} ¸Æ¤Ó½Ð¤·»þ¤Ë¤½¤ì
-¤ò²òÊü¤·¤Þ¤¹¡£¤³¤Î¥¢¥×¥í¡¼¥Á¤ÎÉÔÍø¤ÊÅÀ¤ÏÀܳ¤¬¼ºÇÔ¤·¤¿¾ì¹ç¤Ë¥¨¥é¡¼¥á¥Ã¥»¡¼
-¥¸¤ò¼è¤ê½Ð¤¹¤³¤È¤¬¤Ç¤­¤Ê¤¤¤³¤È¤Ç¤¹¡£¡Ê@code{mysql_errno()} ¤Þ¤¿¤Ï
-@code{mysql_error()} ¤«¤é¥¨¥é¡¼¾ðÊó¤òÆÀ¤ë¤Ë¤Ï¡¢Àµ¤·¤¤ @code{MYSQL} ¥Ý¥¤¥ó
-¥¿¤òÄ󶡤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¡Ë
-
-@subsubheading Ìá¤êÃÍ
-
-@code{mysql_real_connect()} ¤ÈƱ¤¸
-
-@subsubheading ¥¨¥é¡¼
-
-@code{mysql_real_connect()} ¤ÈƱ¤¸
-
-@findex @code{mysql_change_user()}
-@node mysql_change_user, mysql_create_db, mysql_connect, C API functions
-@subsection @code{mysql_change_user()}
-
-@code{my_bool mysql_change_user(MYSQL *mysql, const char *user, const
-char *password, const char *db)}
-
-@subsubheading ÀâÌÀ
-
-¥æ¡¼¥¶¤òÊѹ¹¤·¡¢@code{mysql} ¤Ç¼¨¤µ¤ì¤¿Àܳ¾å¤Ç¡¢@code{db} ¤Ç¼¨¤µ¤ì¤¿¥Ç¡¼
-¥¿¥Ù¡¼¥¹¤¬¥Ç¥Õ¥©¥ë¥È¡Ê¸½ºß¤Î¡Ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë¤Ê¤ê¤Þ¤¹¡£¤½¤Î¸å¤Î¥¯¥¨¥ê¤Ç¤Ï¡¢
-ÌÀ¼¨Åª¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î»ØÄê¤ò´Þ¤ó¤Ç¤¤¤Ê¤¤¥Æ¡¼¥Ö¥ë»²¾È¤Ë¤Ä¤¤¤Æ¡¢¤³¤Î¥Ç¡¼¥¿¥Ù¡¼
-¥¹¤¬¥Ç¥Õ¥©¥ë¥È¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-¤³¤Î´Ø¿ô¤Ï @strong{MySQL} 3.23.3 ¤ÇƳÆþ¤µ¤ì¤Þ¤·¤¿¡£
-
-@code{mysql_change_user()} ¤ÏÀܳ¤µ¤ì¤¿¥æ¡¼¥¶¤¬Ç§¾Ú¤µ¤ì¤Ê¤¤¾ì¹ç¡¢¤Þ¤¿¤Ï¥Ç¡¼
-¥¿¥Ù¡¼¥¹¤ò»ÈÍѤ¹¤ë¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ë¼ºÇÔ¤·¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢¥æ¡¼¥¶¤È¥Ç¡¼
-¥¿¥Ù¡¼¥¹¤ÏÊѹ¹¤µ¤ì¤Þ¤»¤ó¡£
-
-¥Ç¥Õ¥©¥ë¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò»ý¤Á¤¿¤¯¤Ê¤¤¾ì¹ç¡¢@code{db} ¥Ñ¥é¥á¡¼¥¿¤ò
-@code{NULL} ¤ËÀßÄê¤Ç¤­¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-À®¸ù»þ 0¡£¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤ÏÈó0¡£
-
-@subsubheading ¥¨¥é¡¼
-
-@code{mysql_real_connect()} ¤«¤éÆÀ¤é¤ì¤ë¤â¤Î¤ÈƱ¤¸¤Ç¤¹¡£
-
-@table @code
-@item CR_COMMANDS_OUT_OF_SYNC
-ÉÔÅö¤Ê½ç¤Ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤¿¡£
-@item CR_SERVER_GONE_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤¬¤¤¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item CR_SERVER_LOST
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¯¥¨¥êÃæ¤Ë¼º¤ï¤ì¤¿¡£
-@item CR_UNKNOWN_ERROR
-̤ÃΤΥ¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-@item ER_UNKNOWN_COM_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤Ï¤³¤Î¥³¥Þ¥ó¥É¤ò¼ÂÁõ¤·¤Æ¤¤¤Ê¤¤¡Ê¤ª¤½¤é¤¯¸Å¤¤¥µ¡¼¥Ð¡Ë¡£
-@item ER_ACCESS_DENIED_ERROR
-¥æ¡¼¥¶¤Þ¤¿¤Ï¥Ñ¥¹¥ï¡¼¥É¤¬´Ö°ã¤Ã¤Æ¤¤¤ë¡£
-@item ER_BAD_DB_ERROR
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬Â¸ºß¤·¤Ê¤¤¡£
-@item ER_DBACCESS_DENIED_ERROR
-¥æ¡¼¥¶¤¬¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¥¢¥¯¥»¥¹¸¢¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤¡£
-@item ER_WRONG_DB_NAME
-¥Ç¡¼¥¿¥Ù¡¼¥¹Ì¾¤¬Ä¹²á¤®¤ë¡£
-@end table
-
-@subsubheading Îã
-
-@example
-if (mysql_change_user(&mysql, "user", "password", "new_database"))
-@{
- fprintf(stderr, "Failed to change user. Error: %s\n",
- mysql_error(&mysql));
-@}
-@end example
-
-@findex @code{mysql_create_db()}
-@node mysql_create_db, mysql_data_seek, mysql_change_user, C API functions
-@subsection @code{mysql_create_db()}
-
-@code{int mysql_create_db(MYSQL *mysql, const char *db)}
-
-@subsubheading ÀâÌÀ
-@code{db} °ú¿ô¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿¥Ç¡¼¥¿¥Ù¡¼¥¹¤òºîÀ®¤·¤Þ¤¹¡£
-
-¤³¤Î´Ø¿ô¤Ï¿ä¾©¤µ¤ì¤Þ¤»¤ó¡£Âå¤ï¤ê¤Ë @code{mysql_query()} ¤ò»È¤Ã¤Æ¡¢SQL
-@code{CREATE DATABASE} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤òȯ¹Ô¤¹¤ë¤³¤È¤ò¤ª´«¤á¤·¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎºîÀ®¤¬À®¸ù¤·¤¿¾ì¹ç¤Ï0¡£¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤ÏÈó0¡£
-
-@subsubheading ¥¨¥é¡¼
-@table @code
-
-@item CR_COMMANDS_OUT_OF_SYNC
-ÉÔÅö¤Ê½ç¤Ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤¿¡£
-
-@item CR_SERVER_GONE_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤¬¤¤¤Ê¤¯¤Ê¤Ã¤¿¡£
-
-@item CR_SERVER_LOST
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¯¥¨¥êÃæ¤Ë¼º¤ï¤ì¤¿¡£
-
-@item CR_UNKNOWN_ERROR
-̤ÃΤΥ¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-@end table
-
-@subsubheading Îã
-
-@example
-if(mysql_create_db(&mysql, "my_database"))
-@{
- fprintf(stderr, "Failed to create new database. Error: %s\n",
- mysql_error(&mysql));
-@}
-@end example
-
-@findex @code{mysql_data_seek()}
-@node mysql_data_seek, mysql_debug, mysql_create_db, C API functions
-@subsection @code{mysql_data_seek()}
-
-@code{void mysql_data_seek(MYSQL_RES *result, unsigned long long offset)}
-
-@subsubheading ÀâÌÀ
-¥¯¥¨¥ê·ë²Ì¥»¥Ã¥ÈÃæ¤ÎǤ°Õ¤Î¥ì¥³¡¼¥É¤Ë¥·¡¼¥¯¤·¤Þ¤¹¡£¤³¤ì¤Ï¡¢·ë²Ì¥»¥Ã¥È¹½Â¤ÂÎ
-¤¬¥¯¥¨¥ê¤Î¤¹¤Ù¤Æ¤Î·ë²Ì¤ò»ý¤Ã¤Æ¤¤¤ë¤³¤È¤òÍ׵ᤷ¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢
-@code{mysql_data_seek()} ¤Ï @code{mysql_store_result()} ¤È¶¦¤Ë¤À¤±»ÈÍѤµ¤ì¡¢
-@code{mysql_use_result()} ¤È¶¦¤Ë¤Ï»ÈÍѤǤ­¤Þ¤»¤ó¡£
-
-¥ª¥Õ¥»¥Ã¥È¤ÎÃÍ¤Ï @code{0} ¤«¤é @code{mysql_num_rows(result)-1} ¤Ç¤Ê¤¯¤Æ¤Ï
-¤Ê¤ê¤Þ¤»¤ó¡£
-
-@subsubheading Ìá¤êÃÍ
-
-̵¤·¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@findex @code{mysql_debug()}
-@node mysql_debug, mysql_drop_db, mysql_data_seek, C API functions
-@subsection @code{mysql_debug()}
-
-@code{void mysql_debug(char *debug)}
-
-@subsubheading ÀâÌÀ
-Í¿¤¨¤é¤ì¤¿Ê¸»úÎó¤Ç @code{DBUG_PUSH} ¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£@code{mysql_debug()}
-¤Ï Fred Fish ¤¬ºîÀ®¤·¤¿ debug library ¤ò»ÈÍѤ·¤Þ¤¹¡£¤³¤Î´Ø¿ô¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¤Ï¡¢¥Ç¥Ð¥Ã
-¥°¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤è¤¦¤Ë¡¢¥¯¥é¥¤¥¢¥ó¥È¥é¥¤¥Ö¥é¥ê¤ò¥³¥ó¥Ñ¥¤¥ë¤¹¤ëɬÍפ¬¤¢¤ê
-¤Þ¤¹¡£
-@xref{Debugging server}. @xref{Debugging client}.
-
-@subsubheading Ìá¤êÃÍ
-
-̵¤·¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@subsubheading Îã
-
-¼¡¤Ë¼¨¤·¤¿¸Æ¤Ó½Ð¤·¤Ï¡¢¥¯¥é¥¤¥¢¥ó¥È¥é¥¤¥Ö¥é¥ê¤¬¡¢¥¯¥é¥¤¥¢¥ó¥È¥Þ¥·¥ó¾å¤Î
-@file{/tmp/client.trace} ¤Ë¥È¥ì¡¼¥¹¥Õ¥¡¥¤¥ë¤òÀ¸À®¤·¤Þ¤¹:
-
-@example
-mysql_debug("d:t:O,/tmp/client.trace");
-@end example
-
-@findex @code{mysql_drop_db()}
-@node mysql_drop_db, mysql_dump_debug_info, mysql_debug, C API functions
-@subsection @code{mysql_drop_db()}
-
-@code{int mysql_drop_db(MYSQL *mysql, const char *db)}
-
-@subsubheading ÀâÌÀ
-@code{db} °ú¿ô¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÇË´þ¤·¤Þ¤¹¡£
-
-¤³¤Î´Ø¿ô¤Ï¿ä¾©¤µ¤ì¤Þ¤»¤ó¡£Âå¤ï¤ê¤Ë @code{mysql_query()} ¤ò»È¤Ã¤Æ¡¢SQL
-@code{DROP DATABASE} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤òȯ¹Ô¤¹¤ë¤³¤È¤ò¤ª´«¤á¤·¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÇË´þ¤¬À®¸ù¤·¤¿¾ì¹ç¤Ï0¡£¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤ÏÈó0¡£
-
-@subsubheading ¥¨¥é¡¼
-
-@table @code
-@item CR_COMMANDS_OUT_OF_SYNC
-ÉÔÅö¤Ê½ç¤Ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤¿¡£
-@item CR_SERVER_GONE_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤¬¤¤¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item CR_SERVER_LOST
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¯¥¨¥êÃæ¤Ë¼º¤ï¤ì¤¿¡£
-@item CR_UNKNOWN_ERROR
-̤ÃΤΥ¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-@end table
-
-@subsubheading Îã
-
-@example
-if(mysql_drop_db(&mysql, "my_database"))
- fprintf(stderr, "Failed to drop the database: Error: %s\n",
- mysql_error(&mysql));
-@end example
-
-@findex @code{mysql_dump_debug_info()}
-@node mysql_dump_debug_info, mysql_eof, mysql_drop_db, C API functions
-@subsection @code{mysql_dump_debug_info()}
-
-@code{int mysql_dump_debug_info(MYSQL *mysql)}
-
-@subsubheading ÀâÌÀ
-
-¤¤¤¯¤Ä¤«¤Î¥Ç¥Ð¥Ã¥°¾ðÊó¤ò¥í¥°¤Ë¥À¥ó¥×¤¹¤ë¤è¤¦¤Ë¥µ¡¼¥Ð¤Ë»Ø¼¨¤·¤Þ¤¹¡£¤³¤ÎÆ°
-ºî¤ò¤¹¤ë¤¿¤á¤Ë¤Ï¡¢Àܳ¤µ¤ì¤¿¥æ¡¼¥¶¤¬ @strong{process} ¸¢¤ò»ý¤Ã¤Æ¤¤¤Ê¤±
-¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-
-@subsubheading Ìá¤êÃÍ
-
-¥³¥Þ¥ó¥É¤¬À®¸ù¤·¤¿¾ì¹ç¤Ï0¡£¥³¥Þ¥ó¥É¤¬¼ºÇÔ¤·¤¿¾ì¹ç¤ÏÈó0¡£
-
-@subsubheading ¥¨¥é¡¼
-@table @code
-@item CR_COMMANDS_OUT_OF_SYNC
-ÉÔÅö¤Ê½ç¤Ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤¿¡£
-@item CR_SERVER_GONE_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤¬¤¤¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item CR_SERVER_LOST
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¯¥¨¥êÃæ¤Ë¼º¤ï¤ì¤¿¡£
-@item CR_UNKNOWN_ERROR
-̤ÃΤΥ¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-@end table
-
-@findex @code{mysql_eof()}
-@node mysql_eof, mysql_errno, mysql_dump_debug_info, C API functions
-@subsection @code{mysql_eof()}
-
-@code{my_bool mysql_eof(MYSQL_RES *result)}
-
-@subsubheading ÀâÌÀ
-
-¤³¤Î´Ø¿ô¤Ï¿ä¾©¤µ¤ì¤Þ¤»¤ó¡£@code{mysql_errno()} ¤« @code{mysql_error()} ¤¬
-Âå¤ï¤ê¤Ë»ÈÍѤǤ­¤Þ¤¹¡£
-
-@code{mysql_eof()} ¤Ï·ë²Ì¥»¥Ã¥È¤ÎºÇ¸å¤Î¥ì¥³¡¼¥É¤¬Æɤޤ줿¤«¤É¤¦¤«¤òÄ´¤Ù¤Þ
-¤¹¡£
-
-@code{mysql_store_result()} ¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤Æ¡¢·ë²Ì¥»¥Ã¥È¤òÆþ¼ê¤·¤¿¾ì¹ç¡¢
-¥¯¥é¥¤¥¢¥ó¥È¤Ï°ì¤Ä¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ç¤¹¤Ù¤Æ¤Î¥»¥Ã¥È¤ò¼õ¤±¼è¤ê¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢
-@code{mysql_fetch_row()} ¤«¤éÊÖ¤µ¤ì¤ë @code{NULL} ¤Ï¡¢¾ï¤Ë·ë²Ì¥»¥Ã¥È¤Î½ªÃ¼
-¤Ë㤷¤¿¤³¤È¤ò°ÕÌ£¤·¡¢@code{mysql_eof()} ¤ò¸Æ¤ÖɬÍפϤ¢¤ê¤Þ¤»¤ó¡£
-
-°ìÊý¡¢·ë²Ì¥»¥Ã¥È¼è¤ê½Ð¤·¤Î½é´ü²½¤Î¤¿¤á¤Ë @code{mysql_use_result()} ¤ò»ÈÍÑ
-¤¹¤ë¾ì¹ç¡¢¥»¥Ã¥È¤Î¥ì¥³¡¼¥É¤Ï @code{mysql_fetch_row()} ¤ò·«¤êÊÖ¤·¸Æ¤Ö¤³¤È¤Ë
-¤è¤ê¡¢¤Ò¤È¤Ä¤º¤Ä¥µ¡¼¥Ð¤«¤é³ÍÆÀ¤µ¤ì¤Þ¤¹¡£¤³¤Î½èÍýÃæ¤ËÀܳ¾å¤Ç¥¨¥é¡¼¤¬È¯À¸¤·
-ÆÀ¤ë¤¿¤á¡¢@code{mysql_fetch_row()} ¤«¤é¤ÎÌá¤êÃÍ @code{NULL} ¤Ï¡¢Ä̾ïɬ¤º¤·
-¤â·ë²Ì¥»¥Ã¥È¤Î½ªÃ¼¤Ë㤷¤¿¤³¤È¤ò°ÕÌ£¤·¤Þ¤»¤ó¡£¤³¤Î¾ì¹ç
-@code{mysql_eof()} ¤ò»ÈÍѤ·¤Æ¡¢²¿¤¬µ¯¤³¤Ã¤¿¤«¤ò¸¡½Ð¤Ç¤­¤Þ¤¹¡£·ë²Ì¥»¥Ã¥È¤Î
-½ªÃ¼¤Ë㤷¤¿¾ì¹ç¤Ï @code{mysql_eof()} ¤ÏÈó0ÃͤòÊÖ¤·¡¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç
-¤Ï 0 ¤òÊÖ¤·¤Þ¤¹¡£
-
-Îò»ËŪ¤Ë @code{mysql_eof()} ¤Ïɸ½à @strong{MySQL} ¥¨¥é¡¼´Ø¿ô
-@code{mysql_errno()} ¤È @code{mysql_error()} °ÊÁ°¤ËÁ̤ê¤Þ¤¹¡£¤³¤ì¤é¤Î¥¨¥é¡¼
-´Ø¿ô¤ÏƱ¤¸¾ðÊó¤òÄ󶡤¹¤ë¤Î¤Ç¡¢¤³¤ì¤é¤Î»ÈÍѤ¬ @code{mysql_eof()} ¤è¤ê¤â¹¥¤Þ
-¤ì¤Þ¤¹¡£@code{mysql_eof()} ¤Ï¸½ºß¿ä¾©¤µ¤ì¤Þ¤»¤ó¡£¡Ê¼ÂºÝ¡¢¤³¤ì¤é¤Ï¿¤¯¤Î¾ð
-Êó¤òÄ󶡤·¤Þ¤¹¡£¥¨¥é¡¼´Ø¿ô¤Ï¥¨¥é¡¼¤¬È¯À¸¤·¤¿»þ¤Î¥¨¥é¡¼¤ÎÍýͳ¤ò¼¨¤·¤Þ¤¹¤¬¡¢
-@code{mysql_eof()} ¤Ï¿¿µ¶ÃͤÀ¤±¤òÊÖ¤·¤Þ¤¹¡£¡Ë
-
-@subsubheading Ìá¤êÃÍ
-
-¥¨¥é¡¼¤¬È¯À¸¤·¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï0¡£·ë²Ì¥»¥Ã¥È¤Î½ªÃ¼¤Ë㤷¤¿¾ì¹ç¤ÏÈó0¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@subsubheading Îã
-
-¼¡¤ÎÎã¤Ï @code{mysql_eof} ¤Î»ÈÍÑÊýË¡¤ò¼¨¤·¤Þ¤¹:
-
-@example
-mysql_query(&mysql,"SELECT * FROM some_table");
-result = mysql_use_result(&mysql);
-while((row = mysql_fetch_row(result)))
-@{
- // do something with data
-@}
-if(!mysql_eof(result)) // mysql_fetch_row() failed due to an error
-@{
- fprintf(stderr, "Error: %s\n", mysql_error(&mysql));
-@}
-@end example
-
-¤·¤«¤·¡¢É¸½à @strong{MySQL} ¥¨¥é¡¼´Ø¿ô¤ÇƱ¤¸¸ú²Ì¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹:
-
-@example
-mysql_query(&mysql,"SELECT * FROM some_table");
-result = mysql_use_result(&mysql);
-while((row = mysql_fetch_row(result)))
-@{
- // do something with data
-@}
-if(mysql_errno(&mysql)) // mysql_fetch_row() failed due to an error
-@{
- fprintf(stderr, "Error: %s\n", mysql_error(&mysql));
-@}
-@end example
-
-@findex @code{mysql_errno()}
-@node mysql_errno, mysql_error, mysql_eof, C API functions
-@subsection @code{mysql_errno()}
-
-@code{unsigned int mysql_errno(MYSQL *mysql)}
-
-@subsubheading ÀâÌÀ
-
-@code{mysql} ¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿Àܳ¾å¤Ç¡¢ºÇ¸å¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿ API ´Ø¿ô¤ÎÀ®ÈݤΥ¨¥é¡¼¥³¡¼
-¥É¤òÊÖ¤·¤Þ¤¹¡£Ìá¤êÃÍ0¤Ï¥¨¥é¡¼¤¬È¯À¸¤·¤Ê¤«¤Ã¤¿¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£¥¯¥é¥¤¥¢
-¥ó¥È¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸ÈÖ¹æ¤Ï @file{errmsg.h} ¤Ë¥ê¥¹¥È¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¥µ¡¼¥Ð
-¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸ÈÖ¹æ¤Ï @file{mysqld_error.h} ¤Ë¥ê¥¹¥È¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ:
-
-¥¨¥é¡¼¥³¡¼¥ÉÃÍ¡£¥¨¥é¡¼¤¬È¯À¸¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï0¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@findex @code{mysql_error()}
-@node mysql_error, mysql_escape_string, mysql_errno, C API functions
-@subsection @code{mysql_error()}
-
-@code{char *mysql_error(MYSQL *mysql)}
-
-@subsubheading ÀâÌÀ
-
-@code{mysql} ¤Ë¤è¤Ã¤Æ»ØÄꤵ¤ì¤¿Àܳ¾å¤Ç¡¢ @code{mysql_error()} ¤Ï
-ºÇ¸å¤Ë¸Æ¤Ó½Ð¤µ¤ì¤¿ API ´Ø¿ô¤ÎÀ®Èݤò¡¢¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤È¤·¤ÆÊÖ¤·¤Þ¤¹¡£
-¥¨¥é¡¼È¯À¸¤·¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¶õʸ»úÎó (@code{""}) ¤¬ÊÖ¤µ¤ì¤Þ¤¹¡£
-¤³¤ì¤Ï¼¡¤Î£²¤Ä¤Î¥Æ¥¹¥È¤¬Æ±¤¸¤Ç¤¢¤ë¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹:
-
-@example
-if(mysql_errno(&mysql))
-@{
- // an error occurred
-@}
-
-if(mysql_error(&mysql)[0] != '\0')
-@{
- // an error occurred
-@}
-@end example
-
-¥¯¥é¥¤¥¢¥ó¥È¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤Î¸À¸ì¤Ï @strong{MySQL} ¥¯¥é
-¥¤¥¢¥ó¥È¥é¥¤¥Ö¥é¥ê¤ÎºÆ¥³¥ó¥Ñ¥¤¥ë¤ÇÊѹ¹¤Ç¤­¤Þ¤¹¡£¸½ºß¤Ï¤¤¤¯¤Ä¤«¤Î¸À¸ì¤Ç½ñ¤«¤ì¤¿
-¥¯¥é¥¤¥¢¥ó¥È¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òÁªÂò¤Ç¤­¤Þ¤¹¡£
-@xref{Languages}.
-
-@subsubheading Ìá¤êÃÍ
-
-¥¨¥é¡¼¤òɽ¤ï¤¹Ê¸»úÎó¡£
-¥¨¥é¡¼¤¬È¯À¸¤·¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¶õʸ»úÎó¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@findex @code{mysql_escape_string()}
-@node mysql_escape_string, mysql_fetch_field, mysql_error, C API functions
-@subsection @code{mysql_escape_string()}
-
-You should use @code{mysql_real_escape_string()} instead!
-
-This is identical to @code{mysql_real_escape_string()} except that it takes
-the connection as the first argument. @code{mysql_real_escape_string()}
-will escape the string according to the current character set while @code{mysql_escape_string()}
-does not respect the current charset setting.
-
-@findex @code{mysql_fetch_field()}
-@node mysql_fetch_field, mysql_fetch_fields, mysql_escape_string, C API functions
-@subsection @code{mysql_fetch_field()}
-
-@code{MYSQL_FIELD *mysql_fetch_field(MYSQL_RES *result)}
-
-@subsubheading ÀâÌÀ
-
-·ë²Ì¥»¥Ã¥È¤Î°ì¤Ä¤Î¥Õ¥£¡¼¥ë¥É¤ÎÄêµÁ¤ò @code{MYSQL_FIELD} ¹½Â¤ÂΤȤ·¤ÆÊÖ¤·¤Þ
-¤¹¡£·ë²Ì¥»¥Ã¥ÈÆâ¤ÎÁ´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤Ä¤¤¤Æ¾ðÊó¤ò¼è¤ê½Ð¤¹¤Ë¤Ï¡¢¤³¤Î´Ø¿ô¤ò·«
-¤êÊÖ¤·¸Æ¤ó¤Ç¤¯¤À¤µ¤¤¡£@code{mysql_fetch_field()} ¤Ï¥Õ¥£¡¼¥ë¥É¤¬»Ä¤Ã¤Æ¤¤¤Ê
-¤¤¤È @code{NULL} ¤òÊÖ¤·¤Þ¤¹¡£
-
-@code{mysql_fetch_field()} ¤Ï¡¢¿·¤·¤¤ @code{SELECT} ¥¯¥¨¥ê¤ò¼Â¹Ô¤¹¤ë¤¿¤Ó¤Ë¡¢
-ºÇ½é¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òÊÖ¤¹¤è¤¦¤Ë¥ê¥»¥Ã¥È¤µ¤ì¤Þ¤¹¡£
-@code{mysql_fetch_field()} ¤ÇÊÖ¤µ¤ì¤ë¥Õ¥£¡¼¥ë¥É¤Ï
-@code{mysql_field_seek()} ¤Î¸Æ¤Ó½Ð¤·¤Ë¤â±Æ¶Á¤ò¤¦¤±¤Þ¤¹¡£
-
-¥Æ¡¼¥Ö¥ë¤ò @code{SELECT} ¤¹¤ë¤¿¤á¤Ë @code{mysql_query()} ¤ò¸Æ¤Ó¡¢¤·¤«¤·¤Þ
-¤À @code{mysql_store_result()} ¤ò¸Æ¤ó¤Ç¤¤¤Ê¤¤¾ì¹ç¡¢
-@code{mysql_fetch_field()} ¤ò @code{BLOB} ¥Õ¥£¡¼¥ë¥É¤ÎŤµ¤ÎÌ䤤¹ç¤ï¤»¤Ë»È
-ÍѤ¹¤ë¤È¡¢@strong{MySQL} ¤Ï¥Ç¥Õ¥©¥ë¥È¤Î blob Ĺ (8K bytes) ¤òÊÖ¤·¤Þ¤¹¡£
-(8K ¥µ¥¤¥º¤Ë¤Ê¤ë¤Î¤Ï¡¢@strong{MySQL} ¤Ï @code{BLOB} ¤ÎºÇÂçŤòÃΤé¤Ê¤¤¤«¤é
-¤Ç¤¹¡£¤³¤ì¤Ï¤¤¤Ä¤«¥³¥ó¥Õ¥£¥°²Äǽ¤Ë¤Ê¤ë¤Ù¤­¤Ç¤¹¡£) °ìÅÙ·ë²Ì¥»¥Ã¥È¤ò¼è¤ê½Ð¤»
-¤Ð¡¢@code{field->max_length} ¤Ï»ØÄꤷ¤¿¥¯¥¨¥êÆâ¤Ç¤Î¤³¤Î¥Õ¥£¡¼¥ë¥É¤ÎºÇÂçÃÍ
-¤ÎŤµ¤ò´Þ¤ß¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-¸½ºß¤Î¥Õ¥£¡¼¥ë¥É¤Î @code{MYSQL_FIELD} ¹½Â¤ÂΡ£¥Õ¥£¡¼¥ë¥É¤¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï
-@code{NULL}¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@subsubheading Îã
-
-@example
-MYSQL_FIELD *field;
-
-while((field = mysql_fetch_field(result)))
-@{
- printf("field name %s\n", field->name);
-@}
-@end example
-
-@findex @code{mysql_fetch_fields()}
-@node mysql_fetch_fields, mysql_fetch_field_direct, mysql_fetch_field, C API functions
-@subsection @code{mysql_fetch_fields()}
-
-@code{MYSQL_FIELD *mysql_fetch_fields(MYSQL_RES *result)}
-
-@subsubheading ÀâÌÀ
-
-·ë²Ì¥»¥Ã¥È¤Î¤¹¤Ù¤Æ¤Î @code{MYSQL_FIELD} ¹½Â¤ÂΤÎÇÛÎó¤òÊÖ¤·¤Þ¤¹¡£³Æ¹½Â¤ÂΤÏ
-·ë²Ì¥»¥Ã¥È¤Î°ì¤Ä¤Î¥Õ¥£¡¼¥ë¥É¤Î¥Õ¥£¡¼¥ë¥ÉÄêµÁ¤òÄ󶡤·¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-·ë²Ì¥»¥Ã¥È¤ÎÁ´¤Æ¤Î¹àÌܤΠ@code{MYSQL_FIELD} ¹½Â¤ÂΤÎÇÛÎó¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@subsubheading Îã
-
-@example
-unsigned int num_fields;
-unsigned int i;
-MYSQL_FIELD *fields;
-
-num_fields = mysql_num_fields(result);
-fields = mysql_fetch_fields(result);
-for(i = 0; i < num_fields; i++)
-@{
- printf("Field %u is %s\n", i, fields[i].name);
-@}
-@end example
-
-@findex @code{mysql_fetch_field_direct()}
-@node mysql_fetch_field_direct, mysql_fetch_lengths, mysql_fetch_fields, C API functions
-@subsection @code{mysql_fetch_field_direct()}
-
-@code{MYSQL_FIELD *mysql_fetch_field_direct(MYSQL_RES *result, unsigned int fieldnr)}
-
-@subsubheading ÀâÌÀ
-
-·ë²Ì¥»¥Ã¥ÈÃæ¤Î¥Õ¥£¡¼¥ë¥É¤ò¼¨¤¹¥Õ¥£¡¼¥ë¥ÉÈÖ¹æ @code{fieldnr} ¤¬Í¿¤¨¤é¤ì¡¢¤½
-¤Î¥Õ¥£¡¼¥ë¥É¤Î¥Õ¥£¡¼¥ë¥ÉÄêµÁ¤ò @code{MYSQL_FIELD} ¹½Â¤ÂΤȤ·¤ÆÊÖ¤·¤Þ¤¹¡£¤³
-¤Î´Ø¿ô¤ÏǤ°Õ¤Î¥Õ¥£¡¼¥ë¥É¤Ë¤Ä¤¤¤Æ¤ÎÄêµÁ¤ò¼è¤ê½Ð¤¹¤³¤È¤Ë»ÈÍѤǤ­¤Þ¤¹¡£
-@code{fieldnr} ¤ÎÃÍ¤Ï 0 ¤«¤é @code{mysql_num_fields(result)-1} ¤ÎÈϰϤˤ¹
-¤Ù¤­¤Ç¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-»ØÄꤵ¤ì¤¿¥Õ¥£¡¼¥ë¥É¤Î @code{MYSQL_FIELD} ¹½Â¤ÂΡ£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@subsubheading Îã
-
-@example
-unsigned int num_fields;
-unsigned int i;
-MYSQL_FIELD *field;
-
-num_fields = mysql_num_fields(result);
-for(i = 0; i < num_fields; i++)
-@{
- field = mysql_fetch_field_direct(result, i);
- printf("Field %u is %s\n", i, field->name);
-@}
-@end example
-
-@findex @code{mysql_fetch_lengths()}
-@node mysql_fetch_lengths, mysql_fetch_row, mysql_fetch_field_direct, C API functions
-@subsection @code{mysql_fetch_lengths()}
-
-@code{unsigned long *mysql_fetch_lengths(MYSQL_RES *result)}
-
-@subsubheading ÀâÌÀ
-
-·ë²Ì¥»¥Ã¥ÈÃæ¤Î¸½ºß¤Î¥ì¥³¡¼¥É¤Î¥Õ¥£¡¼¥ë¥É¤ÎŤµ¤òÊÖ¤·¤Þ¤¹¡£¥Õ¥£¡¼¥ë¥É¤ÎÃͤò¥³¥Ô¡¼¤¹¤ë¾ì¹ç¡¢
-¤³¤ÎŤµ¾ðÊó¤ÏºÇŬ²½¤Ë¤âÍ­ÍѤǤ¹¡£@code{strlen()} ¤Î¸Æ¤Ó½Ð¤·¤ò²óÈò¤Ç¤­¤ë
-¤¿¤á¤Ç¤¹¡£
-¤µ¤é¤Ë¡¢·ë²Ì¥»¥Ã¥È¤¬¥Ð¥¤¥Ê¥ê¥Ç¡¼¥¿¤ò»ý¤Ä¾ì¹ç¤Ï¡¢¥Ç¡¼¥¿¤Î¥µ¥¤¥º¤òÆÃÄꤹ¤ë¤¿¤á¤Ë¤³¤Î´Ø¿ô¤ò@emph{»È¤ï¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó}¡£
-¤Ê¤¼¤Ê¤é @code{strlen()} ¤Ï NULL ʸ»ú¤ò´Þ¤à¥Õ¥£¡¼¥ë¥É¤Ë¤Ä¤¤¤Æ¤Î·ë²Ì¤òÀµ¤·¤¯ÊÖ¤µ¤Ê¤¤¤«¤é¤Ç¤¹¡£
-
-¶õ¥Õ¥£¡¼¥ë¥É¤ÎŤµ¤È @code{NULL} Ãͤò´Þ¤à¥Õ¥£¡¼¥ë¥É¤ÎŤµ¤Ï 0 ¤Ç¤¹¡£¤³¤Î£²
-¤Ä¤Î¥±¡¼¥¹¤ò¶èÊ̤¹¤ëÊýË¡¤Ë¤Ä¤¤¤Æ¤Ï¡¢@code{mysql_fetch_row()} ¤ÎÀâÌÀ¤ò»²¾È
-¤·¤Æ²¼¤µ¤¤¡£
-
-@subsubheading Ìá¤êÃÍ
-
-³Æ¥Õ¥£¡¼¥ë¥É¤Î¥µ¥¤¥º (½ªÃ¼ NUL ʸ»ú¤Ï´Þ¤ß¤Þ¤»¤ó)¤òÄ󶡤¹¤ë unsigned long
-À°¿ô¤ÎÇÛÎó¡£
-¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï @code{NULL}¡£
-
-@subsubheading ¥¨¥é¡¼
-@code{mysql_fetch_lengths()} ¤Ï·ë²Ì¥»¥Ã¥È¤Î¸½ºß¤Î¥ì¥³¡¼¥É¤Ë¤Ä¤¤¤Æ¤À¤±Í­¸ú
-¤Ç¤¹¡£@code{mysql_fetch_row()} ¤ò¸Æ¤Ó½Ð¤¹Á°¡¢¤Þ¤¿¤Ï·ë²Ì¤ÎÁ´¤Æ¤Î¥ì¥³¡¼¥É¤ò
-¼è¤ê½Ð¤·¤¿¸å¤Ë¤³¤ì¤ò¸Æ¤ó¤À¾ì¹ç¡¢@code{NULL} ¤¬ÊÖ¤µ¤ì¤Þ¤¹¡£
-
-@subsubheading Îã
-
-@example
-MYSQL_ROW row;
-unsigned long *lengths;
-unsigned int num_fields;
-unsigned int i;
-
-row = mysql_fetch_row(result);
-if (row)
-@{
- num_fields = mysql_num_fields(result);
- lengths = mysql_fetch_lengths(result);
- for(i = 0; i < num_fields; i++)
- @{
- printf("Column %u is %lu bytes in length.\n", i, lengths[i]);
- @}
-@}
-@end example
-
-@findex @code{mysql_fetch_row()}
-@node mysql_fetch_row, mysql_field_count, mysql_fetch_lengths, C API functions
-@subsection @code{mysql_fetch_row()}
-
-@code{MYSQL_ROW mysql_fetch_row(MYSQL_RES *result)}
-
-@subsubheading ÀâÌÀ
-
-·ë²Ì¥»¥Ã¥È¤Î¼¡¤Î¥ì¥³¡¼¥É¤ò¼è¤ê½Ð¤·¤Þ¤¹¡£@code{mysql_store_result()} ¤Î¸å¤Ë»ÈÍѤ¹¤ë¤È¡¢
-¤³¤ì°Ê¾å¼è¤ê½Ð¤¹¥ì¥³¡¼¥É¤¬¤Ê¤¤»þ¤Ï¡¢@code{NULL} ¤òÊÖ¤·¤Þ¤¹¡£
-@code{mysql_use_result()} ¤Î¸å¤Ë»ÈÍѤ¹¤ë¤Ê¤é¡¢
-¤³¤ì°Ê¾å¼è¤ê½Ð¤¹¥ì¥³¡¼¥É¤¬¤Ê¤¤¾ì¹ç¤ä¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ë @code{NULL} ¤òÊÖ¤·¤Þ¤¹¡£
-
-¥ì¥³¡¼¥ÉÆâ¤ÎÃͤοô¤Ï @code{mysql_num_fields(result)} ¤Ë¤è¤Ã¤ÆÍ¿¤¨¤é¤ì¤Þ¤¹¡£
-@code{row} ¤¬ @code{mysql_fetch_row()} ¤Î¸Æ¤Ó½Ð¤·¤«¤é¤ÎÌá¤êÃͤòÊÝ»ý¤¹¤ë¾ì
-¹ç¡¢ÃͤؤΥݥ¤¥ó¥¿¤Ï @code{row[0]} ¤«¤é
-@code{row[mysql_num_fields(result)-1} ¤È¤·¤Æ¥¢¥¯¥»¥¹¤µ¤ì¤Þ¤¹¡£¥ì¥³¡¼¥ÉÆâ¤Î
-@code{NULL} ÃͤÏ@code{NULL} ¥Ý¥¤¥ó¥¿¤Ë¤è¤Ã¤Æ¼¨¤µ¤ì¤Þ¤¹¡£
-
-¥ì¥³¡¼¥É¤Î¥Õ¥£¡¼¥ë¥ÉÃͤÎŤµ¤Ï¡¢@code{mysql_fetch_lengths()} ¤Î¸Æ¤Ó½Ð¤·¤Ç
-³ÍÆÀ¤Ç¤­¤Þ¤¹¡£¶õ¥Õ¥£¡¼¥ë¥É¤È @code{NULL} ¤ò´Þ¤à¥Õ¥£¡¼¥ë¥É¤Ï¤É¤Á¤é¤âŤµ
-0 ¤ò»ý¤Á¤Þ¤¹; ¥Õ¥£¡¼¥ë¥ÉÃͤΥݥ¤¥ó¥¿¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤³¤È¤Ç¡¢¤³¤ì¤é¤ò¶èÊ̤Ǥ­
-¤Þ¤¹¡£¥Ý¥¤¥ó¥¿¤¬ @code{NULL} ¤Î¾ì¹ç¡¢¥Õ¥£¡¼¥ë¥É¤Ï @code{NULL} ¤Ç¤¹; ¤½¤¦¤Ç
-¤Ê¤±¤ì¤Ð¥Õ¥£¡¼¥ë¥É¤Ï¶õ¤Ç¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-¼¡¤Î¥ì¥³¡¼¥É¤Î @code{MYSQL_ROW} ¹½Â¤ÂΡ¢¥¨¥é¡¼¤¬È¯À¸¤·¤¿¤«¡¢¤â¤¦¼è¤ê½Ð¤¹¥ì
-¥³¡¼¥É¤¬¤Ê¤¤¾ì¹ç¤Ï @code{NULL}¡£
-
-@subsubheading ¥¨¥é¡¼
-
-@table @code
-@item CR_SERVER_LOST
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¯¥¨¥êÃæ¤Ë¼º¤ï¤ì¤¿¡£
-@item CR_UNKNOWN_ERROR
-̤ÃΤΥ¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-@end table
-
-@subsubheading Îã
-
-@example
-MYSQL_ROW row;
-unsigned int num_fields;
-unsigned int i;
-
-num_fields = mysql_num_fields(result);
-while ((row = mysql_fetch_row(result)))
-@{
- unsigned long *lengths;
- lengths = mysql_fetch_lengths(result);
- for(i = 0; i < num_fields; i++)
- @{
- printf("[%.*s] ", (int) lengths[i], row[i] ? row[i] : "NULL");
- @}
- printf("\n");
-@}
-@end example
-
-@findex @code{mysql_field_count()}
-@node mysql_field_count, mysql_field_seek, mysql_fetch_row, C API functions
-@subsection @code{mysql_field_count()}
-
-@code{unsigned int mysql_field_count(MYSQL *mysql)}
-
-3.22.24 ¤è¤êÁ°¤Î @code{MySQL} ¥Ð¡¼¥¸¥ç¥ó¤ò»ÈÍѤ·¤Æ¤¤¤ë¾ì¹ç¡¢
-@code{unsigned int mysql_num_fields(MYSQL *mysql)} ¤òÂå¤ï¤ê¤Ë»ÈÍѤ¹¤Ù¤­¤Ç
-¤¹¡£
-
-@subsubheading ÀâÌÀ
-
-Àܳ¾å¤ÎºÇ¸å¤Î¥¯¥¨¥ê¤Î¥Õ¥£¡¼¥ë¥É¿ô¤òÊÖ¤·¤Þ¤¹¡£
-
-¤³¤Î´Ø¿ô¤ÏÄ̾ï @code{mysql_store_result()} ¤¬ @code{NULL} ¤òÊÖ¤·¤¿»þ¡Ê¤½¤·
-¤Æ¤³¤Î¤è¤¦¤Ë·ë²Ì¥»¥Ã¥È¥Ý¥¤¥ó¥¿¤ò»ý¤Ã¤Æ¤¤¤Ê¤¤»þ¡Ë¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢
-@code{mysql_store_result()} ¤¬¶õ¤Ç¤Ê¤¤·ë²Ì¤òÄ󶡤¹¤Ù¤­¤«¤É¤¦¤«¤òÄ´¤Ù¤ë¤¿¤á
-¤Ë¡¢@code{mysql_field_count()} ¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤³¤ì¤Ï¡¢¥¯¥¨¥ê¤¬
-@code{SELECT}¡Ê¤Þ¤¿¤Ï @code{SELECT}¤Ë»÷¤¿¡Ë¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ç¤¢¤ë¤«¤òÃΤ뤳
-¤È̵¤·¤Ë¡¢¥¯¥é¥¤¥¢¥ó¥È¥×¥í¥°¥é¥à¤Ë¡¢Å¬ÀڤʹÔÆ°¤ò¤È¤é¤»¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£²¼
-¤Ë¼¨¤µ¤ì¤ëÎã¤Ï¡¢¤³¤ì¤ò¤É¤Î¤è¤¦¤Ë¹Ô¤Ê¤¦¤³¤È¤¬¤Ç¤­¤ë¤«¤òÀâÌÀ¤·¤Æ¤¤¤Þ¤¹¡£
-
-@xref{NULL mysql_store_result, , @code{NULL mysql_store_result()}}.
-
-@subsubheading Ìá¤êÃÍ
-
-·ë²Ì¥»¥Ã¥ÈÃæ¤Î¥Õ¥£¡¼¥ë¥ÉÈÖ¹æ¤òɽ¤¹ unsigned integer¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@subsubheading Îã
-
-@example
-MYSQL_RES *result;
-unsigned int num_fields;
-unsigned int num_rows;
-
-if (mysql_query(&mysql,query_string))
-@{
- // error
-@}
-else // query succeeded, process any data returned by it
-@{
- result = mysql_store_result(&mysql);
- if (result) // there are rows
- @{
- num_fields = mysql_num_fields(result);
- // retrieve rows, then call mysql_free_result(result)
- @}
- else // mysql_store_result() returned nothing; should it have?
- @{
- if(mysql_field_count(&mysql) == 0)
- @{
- // query does not return data
- // (it was not a SELECT)
- num_rows = mysql_affected_rows(&mysql);
- @}
- else // mysql_store_result() should have returned data
- @{
- fprintf(stderr, "Error: %s\n", mysql_error(&mysql));
- @}
- @}
-@}
-@end example
-
-Ê̤ÎÊýË¡¤Ï¡¢@code{mysql_field_count(&mysql)} ¸Æ¤Ó½Ð¤·¤ò
-@code{mysql_errno(&mysql)} ¤ËÃÖ¤­´¹¤¨¤ë¤³¤È¤Ç¤¹¡£¤³¤Î¾ì¹ç¡¢¥¹¥Æ¡¼¥È¥á¥ó¥È
-¤¬ @code{SELECT} ¤«¤É¤¦¤«¤ò @code{mysql_field_count()} ¤ÎÃͤ«¤é¿ä¬¤¹¤ë¤Î
-¤Ç¤Ï¤Ê¤¯¡¢Ä¾ÀÜ @code{mysql_store_result()} ¤«¤é¤Î¥¨¥é¡¼¤ò¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£
-
-@findex @code{mysql_field_seek()}
-@node mysql_field_seek, mysql_field_tell, mysql_field_count, C API functions
-@subsection @code{mysql_field_seek()}
-
-@code{MYSQL_FIELD_OFFSET mysql_field_seek(MYSQL_RES *result, MYSQL_FIELD_OFFSET offset)}
-
-@subsubheading ÀâÌÀ
-
-Í¿¤¨¤é¤ì¤¿¥ª¥Õ¥»¥Ã¥È¤Ë¥Õ¥£¡¼¥ë¥É¥«¡¼¥½¥ë¤òÀßÄꤷ¤Þ¤¹¡£¼¡¤Î
-@code{mysql_fetch_field()} ¤Î¸Æ¤Ó½Ð¤·¤Ï¤½¤Î¥ª¥Õ¥»¥Ã¥È¤ËÂбþ¤·¤¿¥Õ¥£¡¼¥ë¥É¤ò¼è
-¤ê½Ð¤·¤Þ¤¹¡£
-
-¥ì¥³¡¼¥É¤ÎºÇ½é¤Ë¥·¡¼¥¯¤¹¤ë¤Ë¤Ï¡¢0 ¤Î @code{offset} ÃͤòÅϤ·¤Æ¤¯¤À¤µ¤¤¡£
-
-@subsubheading Ìá¤êÃÍ
-
-¥Õ¥£¡¼¥ë¥É¥«¡¼¥½¥ë¤ÎÁ°¤ÎÃÍ¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@findex @code{mysql_field_tell()}
-@node mysql_field_tell, mysql_free_result, mysql_field_seek, C API functions
-@subsection @code{mysql_field_tell()}
-
-@code{MYSQL_FIELD_OFFSET mysql_field_tell(MYSQL_RES *result)}
-
-@subsubheading ÀâÌÀ
-
-ºÇ¸å¤Î @code{mysql_fetch_field()} ¤Ë»ÈÍѤ·¤¿¥Õ¥£¡¼¥ë¥É¥«¡¼¥½¥ë¤Î°ÌÃÖ¤òÊÖ
-¤·¤Þ¤¹¡£¤³¤ÎÃÍ¤Ï @code{mysql_field_seek()} ¤Ø¤Î°ú¿ô¤È¤·¤Æ»ÈÍѤǤ­¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-¥Õ¥£¡¼¥ë¥É¥«¡¼¥½¥ë¤Î¸½ºß¤Î¥ª¥Õ¥»¥Ã¥È¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@findex @code{mysql_free_result()}
-@node mysql_free_result, mysql_get_client_info, mysql_field_tell, C API functions
-@subsection @code{mysql_free_result()}
-
-@code{void mysql_free_result(MYSQL_RES *result)}
-
-@subsubheading ÀâÌÀ
-
-@code{mysql_store_result()}, @code{mysql_use_result()},
-@code{mysql_list_dbs()} Åù¤Ë¤è¤Ã¤Æ·ë²Ì¥»¥Ã¥È¤Ë³ä¤êÅö¤Æ¤é¤ì¤¿¥á¥â¥ê¤ò²òÊü
-¤·¤Þ¤¹¡£·ë²Ì¥»¥Ã¥È¤Ç²¿¤«¤ò¹Ô¤Ê¤Ã¤¿»þ¡¢@code{mysql_free_result()} ¤ò¸Æ¤Ó
-½Ð¤·¤Æ¤½¤ì¤¬»ÈÍѤ·¤¿¥á¥â¥ê¤ò²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-̵¤·¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@findex @code{mysql_get_client_info()}
-@node mysql_get_client_info, mysql_get_host_info, mysql_free_result, C API functions
-@subsection @code{mysql_get_client_info()}
-
-@code{char *mysql_get_client_info(void)}
-
-@subsubheading ÀâÌÀ
-
-¥¯¥é¥¤¥¢¥ó¥È¥é¥¤¥Ö¥é¥ê¥Ð¡¼¥¸¥ç¥ó¤òɽ¤ï¤¹Ê¸»úÎó¤òÊÖ¤·¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-@strong{MySQL} ¥¯¥é¥¤¥¢¥ó¥È¥é¥¤¥Ö¥é¥ê¥Ð¡¼¥¸¥ç¥ó¤òɽ¤ï¤¹Ê¸»úÎó¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@findex @code{mysql_get_host_info()}
-@node mysql_get_host_info, mysql_get_proto_info, mysql_get_client_info, C API functions
-@subsection @code{mysql_get_host_info()}
-
-@code{char *mysql_get_host_info(MYSQL *mysql)}
-
-@subsubheading ÀâÌÀ
-
-»ÈÍÑÃæ¤ÎÀܳ¥¿¥¤¥×¤òɽ¤ï¤¹Ê¸»úÎó¤òÊÖ¤·¤Þ¤¹¡£¥µ¡¼¥Ð¤Î¥Û¥¹¥È̾¤ò´Þ¤ß¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-¥µ¡¼¥Ð¥Û¥¹¥È̾¤ÈÀܳ¥¿¥¤¥×¤òɽ¤ï¤¹Ê¸»úÎó¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@findex @code{mysql_get_proto_info()}
-@node mysql_get_proto_info, mysql_get_server_info, mysql_get_host_info, C API functions
-@subsection @code{mysql_get_proto_info()}
-
-@code{unsigned int mysql_get_proto_info(MYSQL *mysql)}
-
-@subsubheading ÀâÌÀ
-
-¸½ºß¤ÎÀܳ¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë¥×¥í¥È¥³¥ë¥Ð¡¼¥¸¥ç¥ó¤òÊÖ¤·¤Þ¤¹¡£
-
-@subsubheading Return values
-
-¸½ºß¤ÎÀܳ¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë¥×¥í¥È¥³¥ë¥Ð¡¼¥¸¥ç¥ó¤òɽ¤ï¤¹Éä¹æ̵¤·À°¿ôÃÍ¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@findex @code{mysql_get_server_info()}
-@node mysql_get_server_info, mysql_info, mysql_get_proto_info, C API functions
-@subsection @code{mysql_get_server_info()}
-
-@code{char *mysql_get_server_info(MYSQL *mysql)}
-
-@subsubheading ÀâÌÀ
-
-¥µ¡¼¥Ð¤Î¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òɽ¤ï¤¹Ê¸»úÎó¤òÊÖ¤·¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-¥µ¡¼¥Ð¤Î¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤òɽ¤ï¤¹Ê¸»úÎó¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@findex @code{mysql_info()}
-@node mysql_info, mysql_init, mysql_get_server_info, C API functions
-@subsection @code{mysql_info()}
-
-@code{char * mysql_info(MYSQL *mysql)}
-
-@subsubheading ÀâÌÀ
-
-ºÇ¤âºÇ¶á¤Ë¼Â¹Ô¤µ¤ì¤¿¥¯¥¨¥ê¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤òʸ»úÎó¤ÇÊÖ¤·¤Þ¤¹¡£¤¬¡¢
-°Ê²¼¤Ëµó¤²¤ë¹½Ê¸¤Ë¸Â¤ê¤Þ¤¹¡£
-¾¤Î¹½Ê¸¤Ç¤Ï@code{mysql_info()} ¤Ï @code{NULL} ¤òÊÖ¤·¤Þ¤¹¡£
-ʸ»úÎó¤Î·Á¼°
-¤Ï¥¯¥¨¥ê¤Î·¿¤Ë¤è¤Ã¤ÆÍÍ¡¹¤Ç¤¹¡£¼¡¤ËÀâÌÀ¤·¤Þ¤¹ (¿ôÃͤÏÎã¤Ç¤¹; ʸ»úÎó¤Ï¥¯¥¨
-¥ê¤ËŬ¤·¤¿Ãͤò´Þ¤ß¤Þ¤¹):
-
-@table @code
-@item INSERT INTO ... SELECT ...
-String format: @code{Records: 100 Duplicates: 0 Warnings: 0}
-@item INSERT INTO ... VALUES (...),(...),(...)...
-String format: @code{Records: 3 Duplicates: 0 Warnings: 0}
-@item LOAD DATA INFILE ...
-String format: @code{Records: 1 Deleted: 0 Skipped: 0 Warnings: 0}
-@item ALTER TABLE
-String format: @code{Records: 3 Duplicates: 0 Warnings: 0}
-@item UPDATE
-String format: @code{Rows matched: 40 Changed: 40 Warnings: 0}
-@end table
-
-Ãí°Õ: Ê£¿ô¤ÎÃͥꥹ¥È¤¬¥¹¥Æ¡¼¥È¥á¥ó¥ÈÃæ¤Ëµ­½Ò¤µ¤ì¤¿¾ì¹ç¤Ë¤À¤±¡¢
-@code{mysql_info()} ¤Ï¡¢@code{INSERT ... VALUES} ¥¹¥Æ¡¼¥È¥á¥ó¥È¤ËÈó
-@code{NULL}ÃͤòÊÖ¤·¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-ºÇ¤âºÇ¶á¤Ë¼Â¹Ô¤µ¤ì¤¿¥¯¥¨¥ê¤Ë¤Ä¤¤¤Æ¤ÎÄɲþðÊó¤òɽ¤ï¤¹Ê¸»úÎó¡£¥¯¥¨¥ê¤ËÍ­¸ú
-¤Ê¾ðÊ󤬤ʤ¤¾ì¹ç¤Ï @code{NULL} ¥Ý¥¤¥ó¥¿¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@findex @code{mysql_init()}
-@node mysql_init, mysql_insert_id, mysql_info, C API functions
-@subsection @code{mysql_init()}
-
-@code{MYSQL * mysql_init(MYSQL *mysql)}
-
-@subsubheading ÀâÌÀ
-
-@code{mysql_real_connect()} ¤ËŬ¤·¤¿ @code{MYSQL} ¥ª¥Ö¥¸¥§¥¯¥È¤Î³ä¤êÅö¤Æ
-¤Þ¤¿¤Ï½é´ü²½¤ò¹Ô¤Ê¤¤¤Þ¤¹¡£°ú¿ô¤¬ @code{NULL} ¥Ý¥¤¥ó¥¿¤Î¾ì¹ç¡¢´Ø¿ô¤Ï¿·¤·
-¤¤¥ª¥Ö¥¸¥§¥¯¥È¤ò³ä¤êÅö¤Æ¤Æ½é´ü²½¤·ÊÖ¤·¤Þ¤¹¡£¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¥ª¥Ö¥¸¥§¥¯¥È¤Ï
-½é´ü²½¤µ¤ì¡¢¥ª¥Ö¥¸¥§¥¯¥È¤Î¥¢¥É¥ì¥¹¤¬ÊÖ¤µ¤ì¤Þ¤¹¡£¿·¤·¤¤¥ª¥Ö¥¸¥§¥¯¥È¤¬³ä¤ê
-Åö¤Æ¤é¤ì¤¿¾ì¹ç¡¢@code{mysql_close()} ¤Ï¤³¤Î¥ª¥Ö¥¸¥§¥¯¥È¤ò²òÊü¤·¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-½é´ü²½¤µ¤ì¤¿ @code{MYSQL*} ¥Ï¥ó¥É¥ë¡¢¤Þ¤¿¤Ï¿·¤·¤¤¥ª¥Ö¥¸¥§¥¯¥È¤ò³ä¤êÅö¤Æ
-¤ë¤Î¤Ë½½Ê¬¤Ê¥á¥â¥ê¤¬¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï @code{NULL} ¥Ý¥¤¥ó¥¿¡£
-
-@subsubheading ¥¨¥é¡¼
-¥á¥â¥êÉÔ­¤Î¾ì¹ç¤Ï @code{NULL} ¤¬ÊÖ¤µ¤ì¤Þ¤¹¡£
-
-@findex @code{mysql_insert_id()}
-@node mysql_insert_id, mysql_kill, mysql_init, C API functions
-@subsection @code{mysql_insert_id()}
-
-@code{my_ulonglong mysql_insert_id(MYSQL *mysql)}
-
-@subsubheading ÀâÌÀ
-
-Á°¤Î¥¯¥¨¥ê¤Ë¤è¤Ã¤Æ @code{AUTO_INCREMENT} ¥Õ¥£¡¼¥ë¥É¤ËÀ¸À®¤µ¤ì¤¿ ID ¤òÊÖ¤·¤Þ¤¹¡£
-@code{AUTO_INCREMENT} ¥Õ¥£¡¼¥ë¥É¤ò´Þ¤à¥Æ¡¼¥Ö¥ë¤Ë @code{INSERT} ¥¯¥¨¥ê¤ò
-¼Â¹Ô¤·¤¿¸å¤Ç¡¢¤³¤Î´Ø¿ô¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
-
-Ãí°Õ: Á°¤Î¥¯¥¨¥ê¤¬ @code{AUTO_INCREMENT} ÃͤòÀ¸À®¤·¤Ê¤«¤Ã¤¿¾ì¹ç¡¢
-@code{mysql_insert_id()} ¤Ï @code{0} ¤òÊÖ¤·¤Þ¤¹¡£¸å¤Î¤¿¤á¤ËÃͤòÊݸ¤¹¤ëɬ
-Íפ¬¤¢¤ë¾ì¹ç¡¢ÃͤòÀ¸À®¤¹¤ë¥¯¥¨¥ê¤Îľ¸å¤Ë @code{mysql_insert_id()} ¤ò¸Æ¤Ó½Ð
-¤¹¤³¤È¤Ëµ¤¤ò¤Ä¤±¤Æ¤¯¤À¤µ¤¤¡£
-
-¤Þ¤¿¡¢SQL @code{LAST_INSERT_ID()} ¾ï¤ËºÇ¸å¤ËÀ¸À®¤µ¤ì¤¿
-@code{AUTO_INCREMENT} Ãͤò´Þ¤ß¡¢¥¯¥¨¥ê´Ö¤Ç¥ê¥»¥Ã¥È¤µ¤ì¤Ê¤¤¤³¤È¤ËÃí°Õ¤·¤Æ²¼
-¤µ¤¤¡£¤½¤Î´Ø¿ô¤ÎÃͤϥµ¡¼¥ÐÆâ¤ÇÊݼ餵¤ì¤ë¤«¤é¤Ç¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-Á°¤Î¥¯¥¨¥ê¤Ë¤è¤Ã¤Æ¹¹¿·¤µ¤ì¤¿ @code{AUTO_INCREMENT} ¥Õ¥£¡¼¥ë¥É¤ÎÃÍ¡£Àܳ¾å
-¤ÎÁ°¤Î¥¯¥¨¥ê¤¬¤Ê¤¤¾ì¹ç¡¢¥¯¥¨¥ê¤¬ @code{AUTO_INCREMENT} Ãͤò¹¹¿·¤·¤Ê¤«¤Ã¤¿
-¾ì¹ç¤Ë¤Ï 0 ¤¬ÊÖ¤ê¤Þ¤¹¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@findex @code{mysql_kill()}
-@node mysql_kill, mysql_list_dbs, mysql_insert_id, C API functions
-@subsection @code{mysql_kill()}
-
-@code{int mysql_kill(MYSQL *mysql, unsigned long pid)}
-
-@subsubheading ÀâÌÀ
-
-@code{pid} ¤Ç»ØÄꤵ¤ì¤¿¥¹¥ì¥Ã¥É¤ò»¦¤¹¤è¤¦¤Ë¥µ¡¼¥Ð¤ËÍê¤ß¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-À®¸ù»þ0¡£¼ºÇÔ»þÈó0¡£
-
-@subsubheading ¥¨¥é¡¼
-
-@table @code
-@item CR_COMMANDS_OUT_OF_SYNC
-ÉÔÅö¤Ê½ç¤Ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤¿¡£
-@item CR_SERVER_GONE_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤¬¤¤¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item CR_SERVER_LOST
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¯¥¨¥êÃæ¤Ë¼º¤ï¤ì¤¿¡£
-@item CR_UNKNOWN_ERROR
-̤ÃΤΥ¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-@end table
-
-@findex @code{mysql_list_dbs()}
-@node mysql_list_dbs, mysql_list_fields, mysql_kill, C API functions
-@subsection @code{mysql_list_dbs()}
-
-@code{MYSQL_RES *mysql_list_dbs(MYSQL *mysql, const char *wild)}
-
-@subsubheading ÀâÌÀ
-
-¥µ¡¼¥Ð¾å¤Î¡¢@code{wild} °ú¿ô¤Ç»ØÄꤵ¤ì¤¿´Ê°×Àµµ¬É½¸½¤ËŬ¹ç¤¹¤ë¡¢¥Ç¡¼¥¿¥Ù¡¼
-¥¹Ì¾¤«¤é¤Ê¤ë·ë²Ì¥»¥Ã¥È¤òÊÖ¤·¤Þ¤¹¡£@code{wild} ¤Ï¥ï¥¤¥ë¥É¥«¡¼¥Éʸ»ú
-@samp{%} ¤Þ¤¿¤Ï @samp{_} ¤ò´Þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤Þ¤¿¡¢Á´¤Æ¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹
-¤ËŬ¹ç¤¹¤ë¤è¤¦¤Ë @code{NULL} ¥Ý¥¤¥ó¥¿¤Ë¤Ç¤­¤Þ¤¹¡£@code{mysql_list_dbs()}
-¤Î¸Æ¤Ó½Ð¤·¤Ï¥¯¥¨¥ê @code{SHOW databases [LIKE wild]} ¤ò¼Â¹Ô¤¹¤ë¤Î¤ÈƱÍÍ
-¤Ç¤¹¡£
-
-@code{mysql_free_result()} ¤Ç·ë²Ì¥»¥Ã¥È¤ò²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-À®¸ù»þ @code{MYSQL_RES} ·ë²Ì¥»¥Ã¥È¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï @code{NULL}¡£
-
-@subsubheading ¥¨¥é¡¼
-
-@table @code
-@item CR_COMMANDS_OUT_OF_SYNC
-ÉÔÅö¤Ê½ç¤Ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤¿¡£
-@item CR_OUT_OF_MEMORY
-¥á¥â¥êÉÔ­¡£
-@item CR_SERVER_GONE_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤¬¤¤¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item CR_SERVER_LOST
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¯¥¨¥êÃæ¤Ë¼º¤ï¤ì¤¿¡£
-@item CR_UNKNOWN_ERROR
-̤ÃΤΥ¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-@end table
-
-@findex @code{mysql_list_fields()}
-@node mysql_list_fields, mysql_list_processes, mysql_list_dbs, C API functions
-@subsection @code{mysql_list_fields()}
-
-@code{MYSQL_RES *mysql_list_fields(MYSQL *mysql, const char *table, const char *wild)}
-
-@subsubheading ÀâÌÀ
-
-Í¿¤¨¤é¤ì¤¿¥Æ¡¼¥Ö¥ëÆâ¤Î¡¢@code{wild} °ú¿ô¤Ç»ØÄꤵ¤ì¤¿´Ê°×Àµµ¬É½¸½¤ËŬ¹ç¤¹¤ë
-¥Õ¥£¡¼¥ë¥É̾¤«¤é¤Ê¤ë·ë²Ì¥»¥Ã¥È¤òÊÖ¤·¤Þ¤¹¡£@code{wild} ¤Ï¥ï¥¤¥ë¥É¥«¡¼
-¥Éʸ»ú @samp{%} ¤Þ¤¿¤Ï @samp{_} ¤ò´Þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤Þ¤¿¡¢Á´¤Æ¤Î¥Õ¥£¡¼
-¥ë¥É¤ËŬ¹ç¤¹¤ë¤è¤¦¤Ë @code{NULL} ¥Ý¥¤¥ó¥¿¤Ë¤Ç¤­¤Þ¤¹¡£
-@code{mysql_list_fields()} ¤Ï¥¯¥¨¥ê @code{SHOW COLUMNS FROM table [LIKE
-wild]} ¤ò¼Â¹Ô¤¹¤ë¤Î¤ÈƱÍͤǤ¹¡£
-
-Ãí°Õ: @code{mysql_list_fields()} ¤ÎÂå¤ï¤ê¤Ë @code{SHOW COLUMNS FROM
-tbl_name} ¤Î»ÈÍѤò´«¤á¤Þ¤¹¡£
-
-@code{mysql_free_result()} ¤Ç·ë²Ì¥»¥Ã¥È¤ò²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-À®¸ù»þ @code{MYSQL_RES} ·ë²Ì¥»¥Ã¥È¡£¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç¤Ï @code{NULL}¡£
-
-@subsubheading ¥¨¥é¡¼
-
-@table @code
-@item CR_COMMANDS_OUT_OF_SYNC
-ÉÔÅö¤Ê½ç¤Ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤¿¡£
-@item CR_SERVER_GONE_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤¬¤¤¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item CR_SERVER_LOST
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¯¥¨¥êÃæ¤Ë¼º¤ï¤ì¤¿¡£
-@item CR_UNKNOWN_ERROR
-̤ÃΤΥ¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-@end table
-
-@findex @code{mysql_list_processes()}
-@node mysql_list_processes, mysql_list_tables, mysql_list_fields, C API functions
-@subsection @code{mysql_list_processes()}
-
-@code{MYSQL_RES *mysql_list_processes(MYSQL *mysql)}
-
-@subsubheading ÀâÌÀ
-
-¸½ºß¤Î¥µ¡¼¥Ð¥¹¥ì¥Ã¥É¤ò¼¨¤¹·ë²Ì¥»¥Ã¥È¤òÊÖ¤·¤Þ¤¹¡£¤³¤ì¤Ï @code{mysqladmin
-processlist} ¤ä @code{SHOW PROCESSLIST} ¥¯¥¨¥ê¤Ç
-Êó¹ð¤µ¤ì¤ë¤â¤Î¤ÈƱ¤¸¼ïÎà¤Î¾ðÊó¤Ç¤¹¡£
-
-@code{mysql_free_result()} ¤Ç·ë²Ì¥»¥Ã¥È¤ò²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-À®¸ù»þ @code{MYSQL_RES} ·ë²Ì¥»¥Ã¥È¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï @code{NULL}¡£
-
-@subsubheading ¥¨¥é¡¼
-
-@table @code
-@item CR_COMMANDS_OUT_OF_SYNC
-ÉÔÅö¤Ê½ç¤Ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤¿¡£
-@item CR_SERVER_GONE_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤¬¤¤¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item CR_SERVER_LOST
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¯¥¨¥êÃæ¤Ë¼º¤ï¤ì¤¿¡£
-@item CR_UNKNOWN_ERROR
-̤ÃΤΥ¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-@end table
-
-@findex @code{mysql_list_tables()}
-@node mysql_list_tables, mysql_num_fields, mysql_list_processes, C API functions
-@subsection @code{mysql_list_tables()}
-
-@code{MYSQL_RES *mysql_list_tables(MYSQL *mysql, const char *wild)}
-
-@subsubheading ÀâÌÀ
-
-@code{wild} °ú¿ô¤Ç»ØÄꤵ¤ì¤¿´Ê°×Àµµ¬É½¸½¤ËŬ¹ç¤¹¤ë¡¢¸½ºß¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹
-Æâ¤Î¥Æ¡¼¥Ö¥ë̾¤«¤é¤Ê¤ë·ë²Ì¥»¥Ã¥È¤òÊÖ¤·¤Þ¤¹¡£@code{wild} ¤Ï¥ï¥¤¥ë¥É¥«¡¼¥É
-ʸ»ú @samp{%} ¤Þ¤¿¤Ï @samp{_} ¤ò´Þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤Þ¤¿¡¢Á´¤Æ¤Î¥Æ¡¼¥Ö¥ë
-¤ËŬ¹ç¤¹¤ë¤è¤¦¤Ë @code{NULL} ¥Ý¥¤¥ó¥¿¤Ë¤Ç¤­¤Þ¤¹¡£
-@code{mysql_list_tables()} ¤Ï¥¯¥¨¥ê @code{SHOW tables [LIKE wild]} ¤ò¼Â
-¹Ô¤¹¤ë¤Î¤ÈƱÍͤǤ¹¡£
-
-@code{mysql_free_result()} ¤Ç·ë²Ì¥»¥Ã¥È¤ò²òÊü¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-À®¸ù»þ @code{MYSQL_RES} ·ë²Ì¥»¥Ã¥È¡£¼ºÇÔ¤·¤¿¾ì¹ç¤Ï @code{NULL}¡£
-
-@subsubheading ¥¨¥é¡¼
-
-@table @code
-@item CR_COMMANDS_OUT_OF_SYNC
-ÉÔÅö¤Ê½ç¤Ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤¿¡£
-@item CR_SERVER_GONE_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤¬¤¤¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item CR_SERVER_LOST
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¯¥¨¥êÃæ¤Ë¼º¤ï¤ì¤¿¡£
-@item CR_UNKNOWN_ERROR
-̤ÃΤΥ¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-@end table
-
-@findex @code{mysql_num_fields()}
-@findex @code{mysql_field_count()}
-@node mysql_num_fields, mysql_num_rows, mysql_list_tables, C API functions
-@subsection @code{mysql_num_fields()}
-
-@code{unsigned int mysql_num_fields(MYSQL_RES *result)}
-
-¤Þ¤¿¤Ï
-
-@code{unsigned int mysql_num_fields(MYSQL *mysql)}
-
-ÆóÈÖÌܤηÁ¼°¤Ï @strong{MySQL} 3.23 °Ê¾å¤Ç¤ÏÆ°ºî¤·¤Þ¤»¤ó¡£@code{MYSQL*} °ú
-¿ô¤òÄ̤¹¾ì¹ç¤Ï¡¢Âå¤ï¤ê¤Ë @code{unsigned int mysql_field_count(MYSQL*mysql)}
-¤ò»ÈÍѤ·¤Ê¤¯¤Æ¤Ï¤¤¤±¤Þ¤»¤ó¡£
-
-@subsubheading ÀâÌÀ
-
-·ë²Ì¥»¥Ã¥ÈÃæ¤Î¥Õ¥£¡¼¥ë¥É¿ô¤òÊÖ¤·¤Þ¤¹¡£
-
-Ãí°Õ: ·ë²Ì¥»¥Ã¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤Þ¤¿¤ÏÀܳ¥Ï¥ó¥É¥ë¤Î¤¤¤º¤ì¤«¤«¤é¥Õ¥£¡¼¥ë¥É¤Î¿ô
-¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£@code{mysql_store_result()} ¤Þ¤¿¤Ï
-@code{mysql_use_result()} ¤¬ @code{NULL} ¤òÊÖ¤·¤¿¡Ê¤Ä¤Þ¤ê·ë²Ì¥»¥Ã¥È¥Ý¥¤¥ó
-¥¿¤¬Ìµ¤¤¡Ë¾ì¹ç¡¢Àܳ¥Ï¥ó¥É¥ë¤ò»ÈÍѤ·¤Þ¤¹¡£¤³¤Î¾ì¹ç¡¢
-@code{mysql_field_count()} ¤ò¸Æ¤Ó½Ð¤·¤Æ¡¢@code{mysql_store_result()} ¤¬¶õ
-¤Ç¤Ê¤¤·ë²Ì¤òÄ󶡤¹¤Ù¤­¤«¤É¤¦¤«¤ò·èÄê¤Ç¤­¤Þ¤¹¡£¤³¤ì¤Ë¤è¤ê¡¢¥¯¥é¥¤¥¢¥ó¥È¥×¥í
-¥°¥é¥à¤Ï¥¯¥¨¥ê¤¬ @code{SELECT}¡Ê¤Þ¤¿¤Ï @code{SELECT} ¤Ë»÷¤¿¡Ë¥¹¥Æ¡¼¥È¥á¥ó
-¥È¤À¤Ã¤¿¤«¤É¤¦¤«¤òÃΤ뤳¤È¤Ê¤·¤Ë¡¢Å¬ÀڤʹÔÆ°¤ò¼è¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£°Ê²¼¤Ë¼¨
-¤¹Îã¤Ï¤³¤ì¤ò¤É¤Î¤è¤¦¤Ë¹Ô¤Ê¤¦¤«¤òÀâÌÀ¤·¤Æ¤¤¤Þ¤¹¡£
-
-@xref{NULL mysql_store_result, , @code{NULL mysql_store_result()}}.
-
-@subsubheading Ìá¤êÃÍ
-
-·ë²Ì¥»¥Ã¥ÈÃæ¤Î¥Õ¥£¡¼¥ë¥É¿ô¤òɽ¤ï¤¹Éä¹æ̵¤·À°¿ô¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@subsubheading Îã
-
-@example
-MYSQL_RES *result;
-unsigned int num_fields;
-unsigned int num_rows;
-
-if (mysql_query(&mysql,query_string))
-@{
- // error
-@}
-else // query succeeded, process any data returned by it
-@{
- result = mysql_store_result(&mysql);
- if (result) // there are rows
- @{
- num_fields = mysql_num_fields(result);
- // retrieve rows, then call mysql_free_result(result)
- @}
- else // mysql_store_result() returned nothing; should it have?
- @{
- if (mysql_errno(&mysql))
- @{
- fprintf(stderr, "Error: %s\n", mysql_error(&mysql));
- @}
- else if (mysql_field_count(&mysql) == 0)
- @{
- // query does not return data
- // (it was not a SELECT)
- num_rows = mysql_affected_rows(&mysql);
- @}
- @}
-@}
-@end example
-
-¡Ê·ë²Ì¥»¥Ã¥È¤¬ÊÖ¤ë¤Ù¤­¥¯¥¨¥ê¤Ç¤¢¤ë¤³¤È¤òÃΤäƤ¤¤ë¾ì¹ç¤Î¡ËÊýË¡¤Ï¡¢
-@code{mysql_errno(&mysql)} ¥³¡¼¥ë¤ò @code{mysql_field_count(&mysql)} ¤¬
-0 ¤«¤É¤¦¤«¤Î¥Á¥§¥Ã¥¯¤ËÃÖ¤­´¹¤¨¤ë¤³¤È¤Ç¤¹¡£¤³¤ì¤Ï²¿¤«¤¬°­¤¤¾ì¹ç¤Ë¤À¤±µ¯¤³¤ê
-¤Þ¤¹¡£
-
-@findex @code{mysql_num_rows()}
-@node mysql_num_rows, mysql_options, mysql_num_fields, C API functions
-@subsection @code{mysql_num_rows()}
-
-@code{my_ulonglong mysql_num_rows(MYSQL_RES *result)}
-
-@subsubheading ÀâÌÀ
-
-·ë²Ì¥»¥Ã¥ÈÃæ¤Î¥ì¥³¡¼¥É¿ô¤òÊÖ¤·¤Þ¤¹¡£
-
-@code{mysql_num_rows()} ¤Î»ÈÍѤϡ¢·ë²Ì¥»¥Ã¥È¤òÊÖ¤¹¤Î¤Ë
-@code{mysql_store_result()} ¤« @code{mysql_use_result()} ¤Î¤É¤Á¤é¤ò»ÈÍѤ¹
-¤ë¤«¤Ë°Í¸¤·¤Þ¤¹¡£@code{mysql_store_result()} ¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢
-@code{mysql_num_rows()} ¤Ï¤¹¤°¤Ë¸Æ¤Ö¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@code{mysql_use_result()} ¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢·ë²Ì¥»¥Ã¥È¤ÎÁ´¤Æ¤Î¥ì¥³¡¼¥É¤¬¼è¤ê
-½Ð¤µ¤ì¤ë¤Þ¤Ç¡¢@code{mysql_num_rows()} ¤ÏÀµ¤·¤¤ÃͤòÊÖ¤·¤Þ¤»¤ó¡£
-
-@subsubheading Ìá¤êÃÍ
-
-·ë²Ì¥»¥Ã¥È¤Î¥ì¥³¡¼¥É¿ô¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@findex @code{mysql_options()}
-@node mysql_options, mysql_ping, mysql_num_rows, C API functions
-@subsection @code{mysql_options()}
-
-@code{int mysql_options(MYSQL *mysql, enum mysql_option option, const char *arg)}
-
-@subsubheading ÀâÌÀ
-
-ÆÃÊ̤ÊÀܳ¥ª¥×¥·¥ç¥ó¤òÀßÄꤷ¡¢Àܳ¤Î¿¶Éñ¤¤¤Ë±Æ¶Á¤òÍ¿¤¨¤ë¤¿¤á¤Ë»ÈÍѤǤ­¤Þ¤¹¡£
-¤³¤Î´Ø¿ô¤ÏÊ£¿ô¤Î¥ª¥×¥·¥ç¥ó¤òÀßÄꤹ¤ë¤¿¤á¤ËÊ£¿ô²ó¸Æ¤Ö¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@code{mysql_options()} ¤Ï @code{mysql_init()} ¤Î¸å¤Ç¡¢
-@code{mysql_connect()} ¤ä @code{mysql_real_connect()} ¤ÎÁ°¤Ë¸Æ¤Ð¤ì¤Ê¤±¤ì¤Ð
-¤Ê¤ê¤Þ¤»¤ó¡£
-
-@code{option} °ú¿ô¤ÏÀßÄꤷ¤¿¤¤¥ª¥×¥·¥ç¥ó¤Ç¤¹; @code{arg} °ú¿ô¤Ï¥ª¥×¥·¥ç¥ó
-¤ËÂФ¹¤ëÃͤǤ¹¡£¥ª¥×¥·¥ç¥ó¤¬À°¿ô¤Î¾ì¹ç¡¢@code{arg} ¤ÏÀ°¿ôÃͤؤΥݥ¤¥ó¥¿¤Ç
-¤¹¡£
-
-Í­¸ú¤Ê¥ª¥×¥·¥ç¥óÃÍ:
-
-@multitable @columnfractions .25 .25 .5
-@item @strong{¥ª¥×¥·¥ç¥ó} @tab @strong{°ú¿ô·¿} @tab @strong{µ¡Ç½}
-@item @code{MYSQL_OPT_CONNECT_TIMEOUT} @tab @code{unsigned int *} @tab Àܳ¥¿¥¤¥à¥¢¥¦¥È¡ÊÉáˡ£
-@item @code{MYSQL_OPT_COMPRESS} @tab »ÈÍѤ·¤Ê¤¤ @tab °µ½Ì¥¯¥é¥¤¥¢¥ó¥È¡¿¥µ¡¼¥Ð¥×¥í¥È¥³¥ë¤ò»ÈÍѤ¹¤ë¡£
-@item @code{MYSQL_OPT_NAMED_PIPE} @tab »ÈÍѤ·¤Ê¤¤ @tab NT ¾å¤Î @strong{MySQL} ¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤Ë̾Á°Éեѥ¤¥×¤ò»ÈÍѤ¹¤ë¡£
-@item @code{MYSQL_INIT_COMMAND} @tab @code{char *} @tab @strong{MySQL} ¥µ¡¼¥Ð¤Ø¤ÎÀܳ»þ¤Ë¼Â¹Ô¤¹¤ë¥³¥Þ¥ó¥É¡£ºÆÀܳ»þ¤Ë¼«Æ°Åª¤ËºÆ¼Â¹Ô¤µ¤ì¤ë¡£
-@item @code{MYSQL_READ_DEFAULT_FILE} @tab @code{char *} @tab @file{my.cnf} ¤ÎÂå¤ï¤ê¤Ë»ØÄꤵ¤ì¤¿¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤«¤é¥ª¥×¥·¥ç¥ó¤òÆɤ߹þ¤à¡£
-@item @code{MYSQL_READ_DEFAULT_GROUP} @tab @code{char *} @tab @file{my.cnf} ¤Þ¤¿¤Ï @code{MYSQL_READ_DEFAULT_FILE} ¤Ç»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤«¤é»ØÄꤵ¤ì¤¿¥°¥ë¡¼¥×¤Î¥ª¥×¥·¥ç¥ó¤òÆɤ߹þ¤à¡£
-@end multitable
-
-Ãí°Õ: @code{MYSQL_READ_DEFAULT_FILE} ¤È @code{MYSQL_READ_DEFAULT_GROUP} ¤ò
-»ÈÍѤ¹¤ë¾ì¹ç¡¢@code{client} ¥°¥ë¡¼¥×¤¬¾ï¤ËÆɤޤì¤Þ¤¹¡£
-
-¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ëÃæ¤Ë»ØÄꤵ¤ì¤ë¥°¥ë¡¼¥×¤Ï¼¡¤Î¥ª¥×¥·¥ç¥ó¤ò´Þ¤à¤³¤È¤¬¤Ç¤­¤Þ
-¤¹:
-
-@multitable @columnfractions .3 .7
-@item @code{compress} @tab °µ½Ì¥¯¥é¥¤¥¢¥ó¥È¡¿¥µ¡¼¥Ð¥×¥í¥È¥³¥ë¤ò»ÈÍѤ¹¤ë¡£
-@item @code{database} @tab Àܳ̿ÎáÃæ¤Ç¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬»ØÄꤵ¤ì¤Ê¤¤¾ì¹ç¡¢¤³¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÀܳ¤¹¤ë¡£
-@item @code{debug} @tab ¥Ç¥Ð¥Ã¥°¥ª¥×¥·¥ç¥ó
-@item @code{host} @tab ¥Ç¥Õ¥©¥ë¥È¥Û¥¹¥È̾
-@item @code{init-command} @tab @strong{MySQL} ¥µ¡¼¥Ð¤Ø¤ÎÀܳ»þ¤Ë¼Â¹Ô¤¹¤ë¥³¥Þ¥ó¥É¡£ºÆÀܳ»þ¤Ë¼«Æ°Åª¤ËºÆ¼Â¹Ô¤µ¤ì¤ë¡£
-@item @code{password} @tab ¥Ç¥Õ¥©¥ë¥È¥Ñ¥¹¥ï¡¼¥É
-@item @code{pipe} @tab NT ¾å¤Î @strong{MySQL} ¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤Ë̾Á°Éեѥ¤¥×¤ò»ÈÍѤ¹¤ë¡£
-@item @code{port} @tab ¥Ç¥Õ¥©¥ë¥È¥Ý¡¼¥ÈÈÖ¹æ
-@item @code{return-found-rows} @tab @code{UPDATE} »ÈÍÑ»þ¡¢@code{mysql_info()} ¤¬¹¹¿·¤µ¤ì¤¿¹Ô¤ÎÂå¤ï¤ê¤Ë¸«¤Ä¤«¤Ã¤¿¹Ô¤òÊÖ¤¹¤è¤¦¤Ë¤¹¤ë¡£
-@item @code{socket} @tab ¥Ç¥Õ¥©¥ë¥È¥½¥±¥Ã¥ÈÈÖ¹æ
-@item @code{timeout} @tab Àܳ¥¿¥¤¥à¥¢¥¦¥È¡ÊÉáˡ£
-@item @code{user} @tab ¥Ç¥Õ¥©¥ë¥È¥æ¡¼¥¶
-@end multitable
-
-¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤Ë¤Ä¤¤¤Æ¤Î¤µ¤é¤Ê¤ë¾ðÊó¤Ï¡¢@ref{Option files} ¤ò»²¾È¤·¤Æ
-²¼¤µ¤¤¡£
-
-@subsubheading Ìá¤êÃÍ
-
-À®¸ù¤Î¾ì¹ç¤Ï0¡£Ì¤ÃΤΥª¥×¥·¥ç¥ó¤ò»ÈÍѤ·¤¿¾ì¹ç¤ÏÈó0¡£
-
-@subsubheading Îã
-
-@example
-MYSQL mysql;
-
-mysql_init(&mysql);
-mysql_options(&mysql,MYSQL_OPT_COMPRESS,0);
-mysql_options(&mysql,MYSQL_READ_DEFAULT_GROUP,"odbc");
-if (!mysql_real_connect(&mysql,"host","user","passwd","database",0,NULL,0))
-@{
- fprintf(stderr, "Failed to connect to database: Error: %s\n",
- mysql_error(&mysql));
-@}
-@end example
-
-¾åµ­¤Ï¡¢°µ½Ì¥¯¥é¥¤¥¢¥ó¥È¡¿¥µ¡¼¥Ð¥×¥í¥È¥³¥ë¤ò»ÈÍѤ·¡¢@code{my.cnf} ¥Õ¥¡¥¤¥ë
-Ãæ¤Î @code{odbc} ¥»¥¯¥·¥ç¥ó¤«¤éÄɲ媥ץ·¥ç¥ó¤òÆɤà¤è¤¦¤Ë¡¢¥¯¥é¥¤¥¢¥ó¥È¤Ë
-Í׵ᤷ¤Þ¤¹¡£
-
-@findex @code{mysql_ping()}
-@node mysql_ping, mysql_query, mysql_options, C API functions
-@subsection @code{mysql_ping()}
-
-@code{int mysql_ping(MYSQL *mysql)}
-
-@subsubheading ÀâÌÀ
-
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬Æ°ºî¤·¤Æ¤¤¤ë¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£¥À¥¦¥ó¤·¤Æ¤¤¤ë¾ì¹ç
-¤Ï¡¢¼«Æ°Åª¤ËºÆÀܳ¤ò»î¤ß¤Þ¤¹¡£
-
-¤³¤Î´Ø¿ô¤Ï¡¢Ä¹¤¤´ÖÀŤ«¤Ë¤·¤Æ¤¤¤ë¥¯¥é¥¤¥¢¥ó¥È¤¬¡¢¥µ¡¼¥Ð¤¬Àܳ¤ò¥¯¥í¡¼¥º¤·
-¤¿¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¡Ê¤ÈºÆÀܳ¡Ë¤¹¤ë¤¿¤á¤Ë»ÈÍѤǤ­¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-¥µ¡¼¥Ð¤¬À¸¤­¤Æ¤¤¤ë¾ì¹ç0¡£Â¾¤ÎÃͤϥ¨¥é¡¼¤ò¼¨¤·¤Þ¤¹¡£
-
-@subsubheading ¥¨¥é¡¼
-
-@table @code
-@item CR_COMMANDS_OUT_OF_SYNC
-ÉÔÅö¤Ê½ç¤Ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤¿¡£
-@item CR_SERVER_GONE_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤¬¤¤¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item CR_UNKNOWN_ERROR
-̤ÃΤΥ¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-@end table
-
-@findex @code{mysql_query()}
-@node mysql_query, mysql_real_connect, mysql_ping, C API functions
-@subsection @code{mysql_query()}
-
-@code{int mysql_query(MYSQL *mysql, const char *query)}
-
-@subsubheading ÀâÌÀ
-NULL ½ªÃ¼Ê¸»úÎó @code{query} ¤Ç¼¨¤µ¤ì¤ë SQL ¥¯¥¨¥ê¤ò¼Â¹Ô¤·¤Þ¤¹¡£¥¯¥¨¥ê¤Ï¤Ò
-¤È¤Ä¤Î SQL ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£½ªÃ¼¤Î¥»¥ß¥³¥í¥ó
-(@samp{;})¤ä @code{\g} ¤ò¥¹¥Æ¡¼¥È¥á¥ó¥È¤ËÄɲ乤٤­¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-
-@code{mysql_query()} ¤Ï¥Ð¥¤¥Ê¥ê¥Ç¡¼¥¿¤ò´Þ¤à¥¯¥¨¥ê¤Ë¤Ï»ÈÍѤǤ­¤Þ¤»¤ó¡Ê¥Ð
-¥¤¥Ê¥ê¥Ç¡¼¥¿¤Ï @samp{\0} ʸ»ú¤ò´Þ¤à¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£¤³¤ì¤Ï¥¯¥¨¥êʸ»úÎó¤Î
-ºÇ¸å¤È¤·¤Æ²ò¼á¤µ¤ì¤Þ¤¹¡Ë¡£¤³¤Î¾ì¹ç¡¢@code{mysql_real_query()} ¤òÂå¤ï¤ê¤Ë
-»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
-
-If you want to know if the query should return a result set or not, you can
-use @code{mysql_field_count()} to check for this.
-@xref{mysql_field_count, @code{mysql_field_count}}.
-
-@subsubheading Ìá¤êÃÍ
-
-¥¯¥¨¥ê¤¬À®¸ù¤·¤¿¾ì¹ç¤Ï0¡£¥¯¥¨¥ê¤¬¼ºÇÔ¤·¤¿¾ì¹ç¤ÏÈó0¡£
-
-@subsubheading ¥¨¥é¡¼
-
-@table @code
-@item CR_COMMANDS_OUT_OF_SYNC
-ÉÔÅö¤Ê½ç¤Ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤¿¡£
-@item CR_SERVER_GONE_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤¬¤¤¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item CR_SERVER_LOST
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¯¥¨¥êÃæ¤Ë¼º¤ï¤ì¤¿¡£
-@item CR_UNKNOWN_ERROR
-̤ÃΤΥ¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-@end table
-
-@findex @code{mysql_real_connect()}
-@node mysql_real_connect, mysql_real_escape_string, mysql_query, C API functions
-@subsection @code{mysql_real_connect()}
-
-@code{MYSQL *mysql_real_connect(MYSQL *mysql, const char *host,
- const char *user, const char *passwd, const char *db,
- unsigned int port, const char *unix_socket,
- unsigned int client_flag)}
-
-@subsubheading ÀâÌÀ
-
-@code{host} ¾å¤ÇÆ°ºî¤·¤Æ¤¤¤ë @strong{MySQL} ¥Ç¡¼¥¿¥Ù¡¼¥¹¥¨¥ó¥¸¥ó¤Ø¤ÎÀܳ
-¤Î³ÎΩ¤ò»î¤ß¤Þ¤¹¡£
-@code{mysql_get_client_info()} °Ê³°¤Î¾¤Î API ´Ø¿ô¤ò¼Â¹Ô¤¹¤ëÁ°¤Ë¡¢
-@code{mysql_real_connect()} ¤¬À®¸ù¤·¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-@code{mysql_real_connect()} ¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë¡¢@code{MYSQL} ¹½Â¤ÂΤò³ÍÆÀ¤Þ
-¤¿¤Ï½é´ü²½¤¹¤ë¤¿¤á¤Ë @code{mysql_init()} ¤ò¸Æ¤ÖɬÍפ¬¤¢¤ë¤³¤È¤ËÃí°Õ¤·¤Æ
-¤¯¤À¤µ¤¤¡£
-
-@itemize @bullet
-@item
-ºÇ½é¤Î¥Ñ¥é¥á¡¼¥¿¤Ï´û¸¤Î @code{MYSQL} ¹½Â¤ÂΤΥ¢¥É¥ì¥¹¤Ç¤¹¡£
-@code{mysql_real_connect()} ¤ò¸Æ¤ÖÁ°¤Ë¡¢@code{MYSQL} ¹½Â¤ÂΤνé´ü²½¤Î¤¿¤á
-¤Ë @code{mysql_init()} ¤ò¸Æ¤ÖɬÍפ¬¤¢¤ê¤Þ¤¹¡£¸å½Ò¤ÎÎã¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-@code{host} ¤ÎÃͤϥۥ¹¥È̾¤« IP ¥¢¥É¥ì¥¹¤Î¤É¤Á¤é¤Ç¤â²Äǽ¤Ç¤¹¡£
-@code{host} ¤¬ @code{NULL} ¤Þ¤¿¤Ïʸ»úÎó @code{"localhost"} ¤Î¾ì¹ç¤Ï¥í¡¼
-¥«¥ë¥Û¥¹¥È¤Ø¤ÎÀܳ¤È¤ß¤Ê¤µ¤ì¤Þ¤¹¡£OS ¤¬¥½¥±¥Ã¥È¤ò¥µ¥Ý¡¼¥È¤¹¤ë¾ì¹ç(Unix)
-¤Þ¤¿¤Ï̾Á°¤Ä¤­¥Ñ¥¤¥×¤ò¥µ¥Ý¡¼¥È¤¹¤ë¾ì¹ç(Win32)¡¢¥µ¡¼¥Ð¤Ø¤Î TCP/IP Àܳ¤Î
-Âå¤ï¤ê¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£
-
-@item
-@code{user} ¥Ñ¥é¥á¡¼¥¿¤Ï¥æ¡¼¥¶¤Î @strong{MySQL} ¥í¥°¥¤¥ó ID ¤¬Æþ¤Ã¤Æ¤¤¤Þ¤¹¡£
-@code{user} ¤¬ @code{NULL} ¤Î¾ì¹ç¡¢¸½ºß¤Î¥æ¡¼¥¶¤È¤ß¤Ê¤µ¤ì¤Þ¤¹¡£Windows
-ODBC ²¼¤Ç¤Ï¡¢¸½ºß¤Î¥æ¡¼¥¶¤ÏÌÀ¼¨Åª¤Ë»ØÄꤵ¤ì¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£Unix ²¼¤Ç
-¤Ï¸½ºß¤Î¥í¥°¥¤¥ó̾¤¬Å¬ÍѤµ¤ì¤Þ¤¹¡£
-Windows ODBC ¤Ç¤Ï, ¥«¥ì¥ó¥È¤Î¥æ¡¼¥¶¡¼Ì¾¤òÍ¿¤¨¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-@xref{ODBC administrator}.
-
-@item
-@code{passwd} ¥Ñ¥é¥á¡¼¥¿¤Ï @code{user} ¤Î¥Ñ¥¹¥ï¡¼¥É¤¬Æþ¤Ã¤Æ¤¤¤Þ¤¹¡£
-¤â¤· @code{passwd} ¤¬ @code{NULL} ¤Î¾ì¹ç¡¢¶õÇò¤Î¥Ñ¥¹¥ï¡¼¥É¥Õ¥£¡¼¥ë¥É¤ò»ý¤Ä
-@code{user} ¥Æ¡¼¥Ö¥ëÆâ¤Î¥ì¥³¡¼¥É¤À¤±¤¬Å¬¹ç¥Á¥§¥Ã¥¯¤µ¤ì¤Þ¤¹¡£¤³¤Î¤è¤¦¤ÊÊý
-Ë¡¤Ç¡¢¥Ñ¥¹¥ï¡¼¥É¤¬µ­½Ò¤µ¤ì¤¿¤«¤É¤¦¤«¤Ë¤è¤Ã¤Æ¥æ¡¼¥¶¤¬°Û¤Ê¤ë¸¢¸Â¤òÆÀ¤ë¤è¤¦
-¤Ë¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹´ÉÍý¼Ô¤¬ @strong{MySQL} Æø¢¥·¥¹¥Æ¥à¤òÀßÄꤹ¤ë¤³¤È¤¬¤Ç¤­
-¤Þ¤¹¡£
-
-Ãí°Õ: @code{mysql_connect()} ¤ò¸Æ¤Ó½Ð¤¹Á°¤Ë @code{passwd} ¤ò°Å¹æ²½¤·¤Ê¤¤
-¤Ç¤¯¤À¤µ¤¤¡£¥Ñ¥¹¥ï¡¼¥É¤Î°Å¹æ²½¤Ï¥¯¥é¥¤¥¢¥ó¥È API ¤Ç¼«Æ°Åª¤Ë½èÍý¤µ¤ì¤Þ¤¹¡£
-
-@item
-@code{db} ¤¬ @code{NULL} ¤Ç¤Ê¤¤¾ì¹ç¡¢Àܳ¤Ï¤³¤ÎÃͤò¥Ç¥Õ¥©¥ë¥È¥Ç¡¼¥¿¥Ù¡¼
-¥¹¤Ë¥»¥Ã¥È¤·¤Þ¤¹¡£
-
-@item
-@code{port} ¤¬ 0 ¤Ç¤Ê¤¤¾ì¹ç¡¢ÃÍ¤Ï TCP/IP Àܳ¤Î¥Ý¡¼¥ÈÈÖ¹æ¤È¤·¤Æ»ÈÍѤµ¤ì
-¤Þ¤¹¡£@code{host} ¥Ñ¥é¥á¡¼¥¿¤¬Àܳ¤Î¥¿¥¤¥×¤ò·èÄꤹ¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ
-¤¤¡£
-
-@item
-@code{unix_socket} ¤¬ @code{NULL} ¤Ç¤Ê¤¤¾ì¹ç¡¢Ê¸»úÎó¤Ï»ÈÍѤµ¤ì¤ë¥½¥±¥Ã¥È
-¤Þ¤¿¤Ï̾Á°¤Ä¤­¥Ñ¥¤¥×¤òµ­½Ò¤·¤Þ¤¹¡£@code{host} ¥Ñ¥é¥á¡¼¥¿¤¬Àܳ¤Î¥¿¥¤¥×¤ò
-·èÄꤹ¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@item
-client_flag ¤ÎÃͤÏÄ̾ï 0 ¤Ç¤¹¤¬¡¢¤È¤Æ¤âÆüì¤Ê¾õ¶·¤Î¤¿¤á¼¡¤Î¥Õ¥é¥°¤ÎÁȤß
-¹ç¤ï¤»¤òÀßÄê¤Ç¤­¤Þ¤¹:
-
-@multitable @columnfractions .25 .7
-@item @strong{¥Õ¥é¥°Ì¾} @tab @strong{¥Õ¥é¥°¤Î°ÕÌ£}
-@item @code{CLIENT_FOUND_ROWS} @tab ±Æ¶Á¤µ¤ì¤¿¹Ô¿ô¤Ç¤Ï¤Ê¤¯¸«¤Ä¤«¤Ã¤¿¹Ô¿ô¤òÊÖ¤·¤Þ¤¹
-@item @code{CLIENT_NO_SCHEMA} @tab @code{db_name.tbl_name.col_name} ¤òµö¤·¤Þ¤»¤ó¡£¤³¤ì¤Ï ODBC ¤Î¤¿¤á¤Ç¤¹; ¤½¤Î¹½Ê¸¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢¥Ñ¡¼¥µ¤¬¥¨¥é¡¼¤òÀ¸À®¤·¤Þ¤¹¡£¤³¤ì¤Ï¤¤¤¯¤Ä¤«¤Î ODBC ¥×¥í¥°¥é¥à¤Î¥Ð¥°¤Î¥È¥é¥Ã¥×¤ËÌòΩ¤Á¤Þ¤¹¡£
-@item @code{CLIENT_COMPRESS} @tab °µ½Ì¥×¥í¥È¥³¥ë¤ò»ÈÍѤ·¤Þ¤¹
-@item @code{CLIENT_ODBC} @tab ¥¯¥é¥¤¥¢¥ó¥È¤¬ ODBC ¥¯¥é¥¤¥¢¥ó¥È¡£¤³¤ì¤Ï @code{mysqld} ¤ò¤µ¤é¤Ë ODBC-¥Õ¥ì¥ó¥É¥ê¤ËÊѹ¹¤·¤Þ¤¹¡£
-@end multitable
-@end itemize
-
-@code{mysql_real_connect()} ¤ÎºÇ½é¤Î°ú¿ô¤Ë @code{NULL} ¥Ý¥¤¥ó¥¿¤òµ­½Ò¤¹
-¤ë¤³¤È¤â¤Ç¤­¤Þ¤¹¡£¤³¤ì¤Ï C API ¤¬Àܳ¹½Â¤ÂΤΥá¥â¥ê¤ò³ä¤êÅö¤Æ¡¢
-@code{mysql_close()} ¸Æ¤Ó½Ð¤·»þ¤Ë¼«Æ°Åª¤Ë²òÊü¤µ¤ì¤Þ¤¹¡£¤³¤ÎÊýË¡¤ÎÉÔÍø¤Ê
-ÅÀ¤Ï¡¢Àܳ¤¬¼ºÇÔ¤·¤¿¾ì¹ç¤Ë @code{mysql_real_connect()} ¤«¤é¤Î¥¨¥é¡¼¥á¥Ã
-¥»¡¼¥¸¤ò¼è¤ê½Ð¤¹¤³¤È¤¬¤Ç¤­¤Ê¤¤¤³¤È¤Ç¤¹¡£
-
-ºÇ½é¤Î°ú¿ô¤¬ @code{NULL} ¥Ý¥¤¥ó¥¿¤Ç¤Ê¤¤¾ì¹ç¤Ï¡¢Â¸ºß¤¹¤ë @code{MYSQL} ¹½
-¤ÂΤΥ¢¥É¥ì¥¹¤Ç¤¢¤ë¤Ù¤­¤Ç¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-Àܳ¤¬À®¸ù¤·¤¿¾ì¹ç¤Ï @code{MYSQL*} Àܳ¥Ï¥ó¥É¥ë¤Ç¤¹¡£Àܳ¤¬¼ºÇÔ¤·¤¿¾ì¹ç
-¤Ï C @code{NULL} ¥Ý¥¤¥ó¥¿¤Ç¤¹¡£
-Àܳ¤ËÀ®¸ù¤¹¤ë¤È¡¢ºÇ½é¤Î¥Ñ¥é¥á¡¼¥¿¤¬ @code{NULL} ¤Ç¤Ê¤¤¾ì¹ç¡¢Ìá¤êÃͤϤ½¤Î¥Ñ¥é
-¥á¡¼¥¿¤ÎÃͤÈƱ¤¸¤Ç¤¹¡£
-
-@subsubheading ¥¨¥é¡¼
-
-@table @code
-@item CR_CONN_HOST_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤Ë¼ºÇÔ¤·¤¿¡£
-
-@item CR_CONNECTION_ERROR
-¥í¡¼¥«¥ë @strong{MySQL} ¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤Ë¼ºÇÔ¤·¤¿¡£
-
-@item CR_IPSOCK_ERROR
-IP ¥½¥±¥Ã¥È¤ÎÀ¸À®¤Ë¼ºÇÔ¤·¤¿¡£
-
-@item CR_OUT_OF_MEMORY
-¥á¥â¥êÉÔ­¡£
-
-@item CR_SOCKET_CREATE_ERROR
-Unix ¥½¥±¥Ã¥È¤ÎÀ¸À®¤Ë¼ºÇÔ¤·¤¿¡£
-
-@item CR_UNKNOWN_HOST
-¥Û¥¹¥È̾¤Î IP ¥¢¥É¥ì¥¹¤ò¸«¤Ä¤±¤ë¤Î¤Ë¼ºÇÔ¤·¤¿¡£
-
-@item CR_VERSION_ERROR
-°Û¤Ê¤ë¥×¥í¥È¥³¥ë¥Ð¡¼¥¸¥ç¥ó¤ò»ÈÍѤ¹¤ë¥¯¥é¥¤¥¢¥ó¥È¥é¥¤¥Ö¥é¥ê¤Ç¥µ¡¼¥Ð¤Ø¤ÎÀÜ
-³¤ò»î¤ß¤¿·ë²Ì¤Î¥×¥í¥È¥³¥ë¥ß¥¹¥Þ¥Ã¥Á¡£¤³¤ì¤Ï¡¢¤È¤Æ¤â¸Å¤¤¥¯¥é¥¤¥¢¥ó¥È¥é¥¤
-¥Ö¥é¥ê¤ò»ÈÍѤ·¤Æ¡¢@code{--old-protocol} ¥ª¥×¥·¥ç¥óÉÕ¤­¤Ç³«»Ï¤·¤Æ¤¤¤Ê¤¤¿·
-¤·¤¤¥µ¡¼¥Ð¤ËÀܳ¤¹¤ë¾ì¹ç¤ËȯÀ¸¤·¤Þ¤¹¡£
-
-@item CR_NAMEDPIPEOPEN_ERROR;
-Win32 ¾å¤Î̾Á°¤Ä¤­¥Ñ¥¤¥×¤ÎÀ¸À®¤Ë¼ºÇÔ¤·¤¿¡£
-
-@item CR_NAMEDPIPEWAIT_ERROR;
-Win32 ¾å¤Î̾Á°¤Ä¤­¥Ñ¥¤¥×¤Î wait ¤Ë¼ºÇÔ¤·¤¿¡£
-
-@item CR_NAMEDPIPESETSTATE_ERROR;
-Win32 ¾å¤Î¥Ñ¥¤¥×¥Ï¥ó¥É¥é¤Î³ÍÆÀ¤Ë¼ºÇÔ¤·¤¿¡£
-@end table
-
-@subsubheading Îã
-
-@example
-MYSQL mysql;
-
-mysql_init(&mysql);
-mysql_options(&mysql,MYSQL_READ_DEFAULT_GROUP,"your_prog_name");
-if (!mysql_real_connect(&mysql,"host","user","passwd","database",0,NULL,0))
-@{
- fprintf(stderr, "Failed to connect to database: Error: %s\n",
- mysql_error(&mysql));
-@}
-@end example
-
-By using @code{mysql_options()} the @strong{MySQL} library will read the
-@code{[client]} and @code{your_prog_name} sections in the @code{my.cnf}
-file which will ensure that your program will work, even if someone has
-set up @strong{MySQL} in some non-standard way.
-
-Note that upon connection, @code{mysql_real_connect()} sets the @code{reconnect}
-flag (part of the MYSQL structure) to a value of @code{1}. This flag indicates,
-in the event that a query cannot be performed because of a lost connection, to
-try reconnecting to the server before giving up.
-
-
-@findex @code{mysql_real_escape_string()}
-@node mysql_real_escape_string, mysql_real_query, mysql_real_connect, C API functions
-@subsection @code{mysql_real_escape_string()}
-
-@code{unsigned int mysql_real_escape_string(MYSQL *mysql, char *to, const char *from, unsigned int length)}
-
-@subsubheading ÀâÌÀ
-
-@code{from} ¤Îʸ»úÎó¤ò¡¢SQL ¥¹¥Æ¡¼¥È¥á¥ó¥È¤È¤·¤Æ¥µ¡¼¥Ð¤ËÁ÷¤ë¤³¤È¤¬¤Ç¤­¤ë
-¤è¤¦¤Ë¡¢¸½ºß¤Î¥­¥ã¥é¥¯¥¿¡¦¥»¥Ã¥È¤ò¹Íθ¤·¤Ê¤¬¤éÊÑ´¹¤·¤Þ¤¹¡£
-·ë²Ì¤Ï @code{to} ¤ËÆþ¤ê¡¢½ªÃ¼ null ʸ»ú¤òÄɲä·¤Þ¤¹¡£
-ÊÑ´¹¤µ¤ì¤ëʸ»úÎó¤Ï @samp{NUL} (ASCII 0), @samp{\n}, @samp{\r}, @samp{\},
-@samp{'}, @samp{"}, Control-Z ¤Ç¤¹¡£(@pxref{Literals}).
-
-@code{from} ¤Ç¼¨¤µ¤ì¤ëʸ»úÎó
-¤Ï@code{length} ¥Ð¥¤¥ÈĹ¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
-@code{to} ¥Ð¥Ã¥Õ¥¡¤Ë¤Ï¾¯¤Ê¤¯¤È¤â @code{length*2+1} ¥Ð¥¤¥ÈŤò³ä¤êÅö¤Æ¤ë
-ɬÍפ¬¤¢¤ê¤Þ¤¹¡£¡ÊºÇ°­¤Î¾ì¹ç¡¢¤½¤ì¤¾¤ì¤Îʸ»ú¤¬£²¥Ð¥¤¥È¤ËÊÑ´¹¤µ¤ì¤ë¤³¤È¤¬¤¢
-¤ê¡¢¤µ¤é¤Ë½ªÃ¼ null ¥Ð¥¤¥È¤Î¤¿¤á¤Î¾ì½ê¤¬É¬ÍפǤ¹¡£¡Ë
-@code{mysql_escape_string()} ¤¬Éüµ¢¤¹¤ë¤È¤­¡¢@code{to}
-¤ÎÆâÍÆ¤Ï @code{NUL} ½ªÃ¼Ê¸»úÎó¤Ë¤Ê¤ê¤Þ¤¹¡£
-Ìá¤êÃͤÏÊÑ´¹¤µ¤ì¤¿Ê¸»úÎó¤ÎŤµ¤Ç¤¹¡£½ªÃ¼ null ʸ»ú¤Ï´Þ¤ß¤Þ¤»¤ó¡£
-
-@subsubheading Îã
-
-@example
-char query[1000],*end;
-
-end = strmov(query,"INSERT INTO test_table values(");
-*end++ = '\'';
-end += mysql_real_escape_string(&mysql, end,"What's this",11);
-*end++ = '\'';
-*end++ = ',';
-*end++ = '\'';
-end += mysql_real_escape_string(&mysql, end,"binary data: \0\r\n",16);
-*end++ = '\'';
-*end++ = ')';
-
-if (mysql_real_query(&mysql,query,(unsigned int) (end - query)))
-@{
- fprintf(stderr, "Failed to insert row, Error: %s\n",
- mysql_error(&mysql));
-@}
-@end example
-
-¾åµ­¤Î @code{strmov()} ´Ø¿ô¤Ï @code{mysqlclient} ¥é¥¤¥Ö¥é¥ê¤Ë´Þ¤Þ¤ì¤Æ¤¤
-¤Æ¡¢@code{strcpy()} ¤Î¤è¤¦¤ËƯ¤­¤Þ¤¹¤¬¡¢ºÇ½é¤Î°ú¿ô¤Î½ª¤ê¤Î null ¤Ø¤Î¥Ý¥¤
-¥ó¥¿¤òÊÖ¤·¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-@code{to} ¤ØÃÖ¤«¤ì¤¿ÃͤÎŤµ¡£½ªÃ¼ null ʸ»ú¤Ï´Þ¤ß¤Þ¤»¤ó¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-
-@findex @code{mysql_real_query()}
-@node mysql_real_query, mysql_reload, mysql_real_escape_string, C API functions
-@subsection @code{mysql_real_query()}
-
-@code{int mysql_real_query(MYSQL *mysql, const char *query, unsigned int length)}
-
-@subsubheading ÀâÌÀ
-
-@code{query} ¤Ç¼¨¤µ¤ì¤ë SQL ¥¯¥¨¥ê¤ò¼Â¹Ô¤·¤Þ¤¹¡£¤³¤ì¤Ï @code{length} ¥Ð
-¥¤¥ÈŤǤ¹¡£¥¯¥¨¥ê¤Ï¤Ò¤È¤Ä¤Î SQL ¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ç¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£½ªÃ¼
-¤Î¥»¥ß¥³¥í¥ó(@samp{;})¤ä @code{\g} ¤ò¥¹¥Æ¡¼¥È¥á¥ó¥È¤ËÄɲ乤٤­¤Ç¤Ï¤¢¤ê¤Þ
-¤»¤ó¡£
-
-¥Ð¥¤¥Ê¥ê¥Ç¡¼¥¿¤ò´Þ¤à¥¯¥¨¥ê¤Ï @code{mysql_real_query()} ¤ò»È
-ÍÑ@emph{¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó}¡£¥Ð¥¤¥Ê¥ê¥Ç¡¼¥¿¤Ï @samp{\0} ʸ»ú¤ò´Þ¤à¤³¤È
-¤¬¤¢¤ë¤«¤é¤Ç¤¹¡£
-¤Þ¤¿¡¢@code{mysql_real_query()} ¤Ï @code{mysql_query()} ¤è¤ê¤â®¤¤¤Ç¤¹¡£
-¥¯¥¨¥ê¤Î @code{strlen()} ¤ò¸Æ¤Ð¤Ê¤¤¤«¤é¤Ç¤¹¡£
-
-If you want to know if the query should return a result set or not, you can
-use @code{mysql_field_count()} to check for this.
-@xref{mysql_field_count, @code{mysql_field_count}}.
-
-@subsubheading Ìá¤êÃÍ
-
-¥¯¥¨¥ê¤¬À®¸ù¤·¤¿¾ì¹ç¤Ï0¡£¥¯¥¨¥ê¤¬¼ºÇÔ¤·¤¿¾ì¹ç¤ÏÈó0¡£
-
-@subsubheading ¥¨¥é¡¼
-
-@table @code
-@item CR_COMMANDS_OUT_OF_SYNC
-ÉÔÅö¤Ê½ç¤Ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤¿¡£
-@item CR_SERVER_GONE_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤¬¤¤¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item CR_SERVER_LOST
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¯¥¨¥êÃæ¤Ë¼º¤ï¤ì¤¿¡£
-@item CR_UNKNOWN_ERROR
-̤ÃΤΥ¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-@end table
-
-@findex @code{mysql_reload()}
-@node mysql_reload, mysql_row_seek, mysql_real_query, C API functions
-@subsection @code{mysql_reload()}
-
-@code{int mysql_reload(MYSQL *mysql)}
-
-@subsubheading ÀâÌÀ
-
-@strong{MySQL} ¥µ¡¼¥Ð¤Ë¡¢¥¢¥¯¥»¥¹¸¢¥Æ¡¼¥Ö¥ë¤òºÆÆɤ߹þ¤ß¤¹¤ë¤è¤¦¤Ë°ÍÍꤷ
-¤Þ¤¹¡£Àܳ¤µ¤ì¤¿¥æ¡¼¥¶¤Ï @strong{reload} ¸¢¸Â¤ò»ý¤ÄɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-¤³¤Î´Ø¿ô¤Ï¿ä¾©¤µ¤ì¤Þ¤»¤ó¡£Âå¤ï¤ê¤Ë¡¢SQL @code{FLUSH PRIVILEGES} ¥¹¥Æ¡¼¥È¥á
-¥ó¥È¤òȯ¹Ô¤¹¤ë @code{mysql_query()} ¤Î»ÈÍѤ¬¿ä¾©¤µ¤ì¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-À®¸ù»þ0¡£¼ºÇÔ»þÈó0¡£
-
-@subsubheading ¥¨¥é¡¼
-
-@table @code
-@item CR_COMMANDS_OUT_OF_SYNC
-ÉÔÅö¤Ê½ç¤Ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤¿¡£
-@item CR_SERVER_GONE_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤¬¤¤¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item CR_SERVER_LOST
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¯¥¨¥êÃæ¤Ë¼º¤ï¤ì¤¿¡£
-@item CR_UNKNOWN_ERROR
-̤ÃΤΥ¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-@end table
-
-@findex @code{mysql_row_seek()}
-@node mysql_row_seek, mysql_row_tell, mysql_reload, C API functions
-@subsection @code{mysql_row_seek()}
-
-@code{MYSQL_ROW_OFFSET mysql_row_seek(MYSQL_RES *result, MYSQL_ROW_OFFSET offset)}
-
-@subsubheading ÀâÌÀ
-¥ì¥³¡¼¥É¥«¡¼¥½¥ë¤ò¥¯¥¨¥ê·ë²Ì¥»¥Ã¥ÈÃæ¤ÎÀäÂХ쥳¡¼¥É¤ËÀßÄꤷ¤Þ¤¹¡£¤³¤ì¤Ï¡¢·ë
-²Ì¥»¥Ã¥È¹½Â¤ÂΤ¬¥¯¥¨¥ê¤Î¤¹¤Ù¤Æ¤Î·ë²Ì¤ò»ý¤Ã¤Æ¤¤¤ë¤³¤È¤òÍ׵ᤷ¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢
-@code{mysql_row_seek()} ¤Ï @code{mysql_store_result()} ¤È¶¦¤Ë¤À¤±»ÈÍѤǤ­¡¢
-@code{mysql_use_result()} ¤È¶¦¤Ë¤Ï»ÈÍѤǤ­¤Þ¤»¤ó¡£
-
-¥ª¥Õ¥»¥Ã¥È¤Ï @code{mysql_row_tell()} ¤Þ¤¿¤Ï @code{mysql_row_seek()} ¸Æ¤Ó¤À
-¤·¤«¤é¤ÎÌá¤êÃͤǤ¢¤ë¤Ù¤­¤Ç¤¹¡£¤³¤ÎÃͤÏñ½ã¤Ê¥ì¥³¡¼¥ÉÈÖ¹æ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó;¥ì
-¥³¡¼¥ÉÈÖ¹æ¤ò»ÈÍѤ·¤Æ·ë²Ì¥»¥Ã¥ÈÆâ¤Î¥ì¥³¡¼¥É¤Ë¥·¡¼¥¯¤·¤¿¤¤¾ì¹ç¤Ï¡¢
-@code{mysql_data_seek()} ¤òÂå¤ï¤ê¤Ë»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£
-
-@subsubheading Ìá¤êÃÍ
-
-¥ì¥³¡¼¥É¥«¡¼¥½¥ë¤ÎÁ°¤ÎÃÍ¡£¤³¤ÎÃͤϤ½¤Î¸å¤Î @code{mysql_row_seek()} ¸Æ¤Ó¤À
-¤·¤ËÅϤ¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@findex @code{mysql_row_tell()}
-@node mysql_row_tell, mysql_select_db, mysql_row_seek, C API functions
-@subsection @code{mysql_row_tell()}
-
-@code{MYSQL_ROW_OFFSET mysql_row_tell(MYSQL_RES *result)}
-
-@subsubheading ÀâÌÀ
-
-ºÇ¸å¤Î @code{mysql_fetch_row()} ¤Ë¤Ä¤¤¤Æ¥ì¥³¡¼¥É¥«¡¼¥½¥ë¤Î¸½ºß¤Î°ÌÃÖ¤òÊÖ¤·¤Þ¤¹¡£
-¤³¤ÎÃÍ¤Ï @code{mysql_row_seek()} ¤Ø¤Î°ú¿ô¤È¤·¤Æ»ÈÍѤǤ­¤Þ¤¹¡£
-
-@code{mysql_row_tell()} ¤Ï @code{mysql_store_result()} ¤Î¸å¤Ë¤À¤±»ÈÍѤ¹¤Ù
-¤­¤Ç¡¢@code{mysql_use_result()} ¤Î¸å¤Ë¤Ï»ÈÍѤ¹¤Ù¤­¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-
-@subsubheading Ìá¤êÃÍ
-
-¹Ô¥«¡¼¥½¥ë¤Î¸½ºß¤Î¥ª¥Õ¥»¥Ã¥È¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@findex @code{mysql_select_db()}
-@node mysql_select_db, mysql_shutdown, mysql_row_tell, C API functions
-@subsection @code{mysql_select_db()}
-
-@code{int mysql_select_db(MYSQL *mysql, const char *db)}
-
-@subsubheading ÀâÌÀ
-
-@code{mysql} ¤Ç¼¨¤µ¤ì¤ë¸½ºß¤ÎÀܳ¤Ë¡¢¥Ç¥Õ¥©¥ë¥È(¸½ºß¤Î)¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¤·
-¤Æ @code{db} ¤Ç¼¨¤µ¤ì¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë»Ø¼¨¤·¤Þ¤¹¡£°Ê¹ß¤Î¥¯
-¥¨¥ê¤Ç¤Ï¡¢ÌÀ¼¨Åª¤Ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò»ØÄꤷ¤Ê¤¤¥Æ¡¼¥Ö¥ë»²¾È¤Ë¤Ä¤¤¤Æ¡¢¤³¤Î¥Ç¡¼
-¥¿¥Ù¡¼¥¹¤¬¥Ç¥Õ¥©¥ë¥È¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-Àܳ¤µ¤ì¤¿¥æ¡¼¥¶¤¬¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò»ÈÍѤ¹¤ë¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤ë¤È¾ÚÌÀ¤µ¤ì¤Ê¤±¤ì
-¤Ð¡¢@code{mysql_select_db()} ¤Ï¼ºÇÔ¤·¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-À®¸ù»þ0¡£¼ºÇÔ»þÈó0¡£
-
-@subsubheading ¥¨¥é¡¼
-
-@table @code
-@item CR_COMMANDS_OUT_OF_SYNC
-ÉÔÅö¤Ê½ç¤Ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤¿¡£
-@item CR_SERVER_GONE_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤¬¤¤¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item CR_SERVER_LOST
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¯¥¨¥êÃæ¤Ë¼º¤ï¤ì¤¿¡£
-@item CR_UNKNOWN_ERROR
-̤ÃΤΥ¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-@end table
-
-@findex @code{mysql_shutdown()}
-@node mysql_shutdown, mysql_stat, mysql_select_db, C API functions
-@subsection @code{mysql_shutdown()}
-
-@code{int mysql_shutdown(MYSQL *mysql)}
-
-@subsubheading ÀâÌÀ
-
-¥Ç¡¼¥¿¥Ù¡¼¥¹¥µ¡¼¥Ð¤Ë¥·¥ã¥Ã¥È¥À¥¦¥ó¤¹¤ë¤è¤¦¤ËÍ׵ᤷ¤Þ¤¹¡£Àܳ¤µ¤ì¤¿¥æ¡¼¥¶
-¤Ï @strong{shutdown} ¸¢¸Â¤ò»ý¤Ã¤Æ¤¤¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-À®¸ù»þ0¡£¼ºÇÔ»þÈó0¡£
-
-@subsubheading ¥¨¥é¡¼
-
-@table @code
-@item CR_COMMANDS_OUT_OF_SYNC
-ÉÔÅö¤Ê½ç¤Ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤¿¡£
-@item CR_SERVER_GONE_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤¬¤¤¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item CR_SERVER_LOST
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¯¥¨¥êÃæ¤Ë¼º¤ï¤ì¤¿¡£
-@item CR_UNKNOWN_ERROR
-̤ÃΤΥ¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-@end table
-
-@findex @code{mysql_stat()}
-@node mysql_stat, mysql_store_result, mysql_shutdown, C API functions
-@subsection @code{mysql_stat()}
-
-@code{char *mysql_stat(MYSQL *mysql)}
-
-@subsubheading ÀâÌÀ
-
-@code{mysqladmin status} ¤ÇÄ󶡤µ¤ì¤ë¤Î¤ÈƱÍͤξðÊó¤òʸ»úÎó¤È¤·¤ÆÊÖ¤·¤Þ
-¤¹¡£¤³¤ì¤ÏÉäǤΠuptime ¤È¡¢¼Â¹ÔÃæ¤Î¥¹¥ì¥Ã¥É¿ô¡¢Ì䤤¹ç¤ï¤»¿ô¡¢ºÆÆɤ߹þ¤ß
-¿ô¡¢¥ª¡¼¥×¥ó¥Æ¡¼¥Ö¥ë¿ô¤ò´Þ¤ß¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-¥µ¡¼¥Ð¾õÂÖ¤òɽ¤ï¤¹Ê¸»úÎó¡£¥¨¥é¡¼¤¬È¯À¸¤·¤¿¾ì¹ç @code{NULL}¡£
-
-@subsubheading ¥¨¥é¡¼
-
-@table @code
-@item CR_COMMANDS_OUT_OF_SYNC
-ÉÔÅö¤Ê½ç¤Ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤¿¡£
-@item CR_SERVER_GONE_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤¬¤¤¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item CR_SERVER_LOST
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¯¥¨¥êÃæ¤Ë¼º¤ï¤ì¤¿¡£
-@item CR_UNKNOWN_ERROR
-̤ÃΤΥ¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-@end table
-
-@findex @code{mysql_store_result()}
-@node mysql_store_result, mysql_thread_id, mysql_stat, C API functions
-@subsection @code{mysql_store_result()}
-
-@code{MYSQL_RES *mysql_store_result(MYSQL *mysql)}
-
-@subsubheading ÀâÌÀ
-
-¥Ç¡¼¥¿¤ò¼è¤ê½Ð¤¹¥¯¥¨¥ê(@code{SELECT}, @code{SHOW}, @code{DESCRIBE},
-@code{EXPLAIN})¤¬À®¸ù¤¹¤ëËè¤Ë¡¢@code{mysql_store_result()} ¤Þ¤¿¤Ï
-@code{mysql_use_result()} ¤ò¸Æ¤Ó½Ð¤¹É¬Íפ¬¤¢¤ê¤Þ¤¹¡£
-
-If you want to know if the query should return a result set or not, you can
-use @code{mysql_field_count()} to check for this.
-@xref{mysql_field_count, @code{mysql_field_count}}.
-
-@code{mysql_store_result()} ¤Ï¥¯¥¨¥ê¤Î¤¹¤Ù¤Æ¤Î·ë²Ì¤ò¥¯¥é¥¤¥¢¥ó¥È¤ØÆɤ߹þ¤ß¡¢
-@code{MYSQL_RES} ¹½Â¤ÂΤò³ä¤êÅö¤Æ¡¢¤³¤Î¹½Â¤ÂΤ˷ë²Ì¤òÇÛÃÖ¤·¤Þ¤¹¡£
-
-@code{mysql_store_results()} returns a null pointer if the query didn't return
-a result sets (If the query was for example an @code{INSERT} statement).
-
-@code{mysql_store_results()} returns also null pointer if reading of the
-result set failed. You can check if you got an error by checking if
-@code{mysql_error()} doesn't return a null pointer, if
-@code{mysql_errno()} returns <> 0 or if @code{mysql_field_count()}
-returns <> 0.
-
-ÊÖ¤µ¤ì¤ë¥ì¥³¡¼¥É¤¬Ìµ¤¤¾ì¹ç¡¢¶õ¤Î·ë²Ì¥»¥Ã¥È¤¬ÊÖ¤µ¤ì¤Þ¤¹¡£ (¶õ¤Î·ë²Ì¥»¥Ã¥È¤Ï
-@code{NULL} Ìá¤êÃͤȤϰۤʤê¤Þ¤¹¡£)
-
-°ìÅÙ @code{mysql_store_result()} ¤ò¸Æ¤Ó½Ð¤·¤Æ null ¥Ý¥¤¥ó¥¿¡¼¤Ç¤Ê¤¤
-·ë²Ì¤òÆÀ¤ë»ö¤¬¤Ç¤­¤¿¤é¡¢·ë²Ì¥»¥Ã¥ÈÃæ¤Ë¤¤¤¯¤Ä¤Î¥ì
-¥³¡¼¥É¤¬¤¢¤ë¤«¤ò¸«¤Ä¤±¤ë¤¿¤á¤Ë¡¢@code{mysql_num_rows()} ¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç
-¤­¤Þ¤¹¡£
-
-·ë²Ì¥»¥Ã¥È¤«¤é¥ì¥³¡¼¥É¤ò¼è¤ê½Ð¤¹¤¿¤á¤Ë @code{mysql_fetch_row()} ¤ò¸Æ¤Ó½Ð¤¹
-¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£¤Þ¤¿¡¢·ë²Ì¥»¥Ã¥ÈÆâ¤Î¸½ºß¤Î¥ì¥³¡¼¥É°ÌÃÖ¤òÀßÄê¡¿¼èÆÀ¤¹¤ë¤¿¤á
-¤Ë @code{mysql_row_seek()} ¤È @code{mysql_row_tell()} ¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­
-¤Þ¤¹¡£
-
-°ìÅÙ·ë²Ì¥»¥Ã¥È¤Ç¹Ô¤Ê¤¦¤È¡¢@code{mysql_free_result()} ¤ò¸Æ¤Ó½Ð¤¹É¬Íפ¬¤¢
-¤ê¤Þ¤¹¡£
-
-@xref{NULL mysql_store_result, , @code{NULL mysql_store_result()}}.
-
-@subsubheading Ìá¤êÃÍ
-
-·ë²Ì¤Î @code{MYSQL_RES} ·ë²Ì¹½Â¤ÂΡ£¥¨¥é¡¼¤¬¤¢¤ë¾ì¹ç @code{NULL}¡£
-
-@subsubheading ¥¨¥é¡¼
-
-@table @code
-@item CR_COMMANDS_OUT_OF_SYNC
-ÉÔÅö¤Ê½ç¤Ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤¿¡£
-@item CR_OUT_OF_MEMORY
-¥á¥â¥êÉÔ­¡£
-@item CR_SERVER_GONE_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤¬¤¤¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item CR_SERVER_LOST
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¯¥¨¥êÃæ¤Ë¼º¤ï¤ì¤¿¡£
-@item CR_UNKNOWN_ERROR
-̤ÃΤΥ¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-@end table
-
-@findex @code{mysql_thread_id()}
-@node mysql_thread_id, mysql_use_result, mysql_store_result, C API functions
-@subsection @code{mysql_thread_id()}
-
-@code{unsigned long mysql_thread_id(MYSQL *mysql)}
-
-@subsubheading ÀâÌÀ
-
-¸½ºß¤ÎÀܳ¤Î¥¹¥ì¥Ã¥É ID ¤òÊÖ¤·¤Þ¤¹¡£¤³¤ÎÃͤϡ¢¥¹¥ì¥Ã¥É¤ò»¦¤¹¤¿¤á¤Î
-@code{mysql_kill()} ¤Ø¤Î°ú¿ô¤È¤·¤Æ»ÈÍѤǤ­¤Þ¤¹¡£
-
-Àܳ¤¬¼º¤ï¤ì¤Æ¡¢@code{mysql_ping()} ¤ÇºÆÀܳ¤·¤¿¾ì¹ç¡¢¥¹¥ì¥Ã¥É ID ¤ÏÊѹ¹¤µ
-¤ì¤Þ¤¹¡£¤³¤ì¤Ï¥¹¥ì¥Ã¥É ID ¤ò¸å¤Ç»È¤¦¤¿¤á¤Ë¼èÆÀ¤·¤Æ³ÊǼ¤¹¤Ù¤­¤Ç¤Ï¤Ê¤¤¤³¤È¤ò
-°ÕÌ£¤·¤Þ¤¹¡£É¬Íפʻþ¤Ë¤½¤ì¤ò¼èÆÀ¤¹¤Ù¤­¤Ç¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-¸½ºß¤ÎÀܳ¤Î¥¹¥ì¥Ã¥É ID¡£
-
-@subsubheading ¥¨¥é¡¼
-̵¤·¡£
-
-@findex @code{mysql_use_result()}
-@node mysql_use_result, NULL mysql_store_result, mysql_thread_id, C API functions
-@subsection @code{mysql_use_result()}
-
-@code{MYSQL_RES *mysql_use_result(MYSQL *mysql)}
-
-@subsubheading ÀâÌÀ
-
-¥Ç¡¼¥¿¤ò¼è¤ê½Ð¤¹¥¯¥¨¥ê(@code{SELECT}, @code{SHOW}, @code{DESCRIBE},
-@code{EXPLAIN})¤¬À®¸ù¤¹¤ëËè¤Ë¡¢ @code{mysql_store_result()} ¤Þ¤¿¤Ï
-@code{mysql_use_result()} ¤ò¸Æ¤Ó½Ð¤¹É¬Íפ¬¤¢¤ê¤Þ¤¹¡£
-
-@code{mysql_use_result()} ¤Ï·ë²Ì¥»¥Ã¥È¸¡º÷¤ò³«»Ï¤·¤Þ¤¹¤¬,
-@code{mysql_store_result()} ¤Î¤è¤¦¤Ë¡¢¼ÂºÝ¤Ë¥¯¥é¥¤¥¢¥ó¥È¤Ë·ë²Ì¥»¥Ã¥È¤òÆɤß
-¼è¤ê¤Þ¤»¤ó. Âå¤ï¤ê¤Ë¡¢³Æ¥ì¥³¡¼¥É¤Ï @code{mysql_fetch_row()} ¸Æ¤Ó¤À¤·¤¬¹Ô¤Ê
-¤ï¤ì¤ë¤³¤È¤Ë¤è¤ê¡¢¸Ä¡¹¤Ë¼è¤ê½Ð¤µ¤ì¤Þ¤¹¡£
-@code{mysql_use_result()} ¤Ï¥¯¥¨¥ê¤Î·ë²Ì¤ò¡¢°ì»þ¥Æ¡¼¥Ö¥ë¤ä¥í¡¼¥«¥ë¥Ð¥Ã¥Õ¥¡
-¤Ë³ÊǼ¤¹¤ë¤³¤È̵¤¯¡¢¥µ¡¼¥Ð¤«¤éľÀÜÆɤ߹þ¤ß¤Þ¤¹¡£¤³¤ì¤Ï
-@code{mysql_store_result()} ¤è¤ê¤â¤¤¤¯¤é¤«Â®¤¯¡¢¾¯¤Ê¤¤¥á¥â¥ê¤ò»ÈÍѤ·¤Þ¤¹¡£
-¤³¤Î¾ì¹ç¡¢¥¯¥é¥¤¥¢¥ó¥È¤Ï¸½ºß¤Î¹Ô¤ÈÀܳ¥Ð¥Ã¥Õ¥¡
-( @code{max_allowed_packet} bytes ¤Þ¤ÇÁý²Ã¤¹¤ë ) ¤Î¥á¥â¥ê¤À¤±¤ò³ä¤êÅö¤Æ¤Þ¤¹¡£
-
-°ìÊý¡¢¥¯¥é¥¤¥¢¥ó¥È¦¤Ç³Æ¹Ô¤Ë
-¤Ä¤¤¤Æ¿¤¯¤Î½èÍý¤ò¹Ô¤Ê¤¦¾ì¹ç¤ä¡¢¥æ¡¼¥¶¤¬ @code{^S} (¥¹¥¯¥í¡¼¥ëÄä»ß) ¤òÆþ
-ÎϤǤ­¤ë¤è¤¦¤Ê²èÌ̤˽ÐÎϤòÁ÷¤ë¾ì¹ç¤Ï¡¢@code{mysql_use_result()} ¤ò»ÈÍѤ¹
-¤Ù¤­¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£¤³¤ì¤Ï¥µ¡¼¥Ð¤ÈÏ¢·È¤·¤Æ¤ª¤ê¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤¬
-¥Ç¡¼¥¿¤¬¼è¤ê½Ð¤µ¤ì¤ë¥Æ¡¼¥Ö¥ë¤ò¹¹¿·¤¹¤ë»ö¤ò¼ÙË⤷¤Þ¤¹¡£
-
-@code{mysql_use_result()} »ÈÍÑ»þ¡¢@code{NULL} Ãͤò¼è¤ê½Ð¤¹¤Þ¤Ç
-@code{mysql_fetch_row()} ¤ò¼Â¹Ô¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤½¤¦¤·¤Ê¤¤¤È¡¢¼¡¤Î¥¯
-¥¨¥ê¤ÏÁ°¤Î¥¯¥¨¥ê¤«¤é·ë²Ì¤ò¼è¤ê½Ð¤·¤Þ¤¹¡£¤³¤ì¤ò˺¤ì¤ë¤È¡¢C API ¤Ï¥¨¥é¡¼
-@code{Commands out of sync; You can't run this command now} ¤òÍ¿¤¨¤Þ¤¹¡ª
-
-@code{mysql_use_result()} ¤«¤éÊÖ¤µ¤ì¤ë·ë²Ì¤Ç¤Ï¡¢
-@code{mysql_data_seek()}, @code{mysql_row_seek()},
-@code{mysql_row_tell()}, @code{mysql_num_rows()},
-@code{mysql_affected_rows()} ¤ò»ÈÍѤǤ­¤Þ¤»¤ó¡£
-¤Þ¤¿¡¢@code{mysql_use_result()} ¤¬½ªÎ»¤¹¤ë¤Þ¤Ç¾¤Î¥¯¥¨¥ê¤Îȯ¹Ô¤â¤Ç¤­¤Þ¤»
-¤ó¡£(Á´¤Æ¤Î¹Ô¤ò¥Õ¥§¥Ã¥Á¤·¤¿¸å¤Ë¡¢¥Õ¥§¥Ã¥Á¤µ¤ì¤¿¹Ô¿ô¤òÃΤ뤿¤á¤Ë
-@code{mysql_num_rows} ¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£)
-
-°ìÅÙ·ë²Ì¥»¥Ã¥È¤Ç¹Ô¤Ê¤¦¤È¡¢@code{mysql_free_result()} ¤ò¸Æ¤Ó½Ð¤¹É¬Íפ¬¤¢
-¤ê¤Þ¤¹¡£
-
-@subsubheading Ìá¤êÃÍ
-
-·ë²Ì¤Î @code{MYSQL_RES} ·ë²Ì¹½Â¤ÂΡ£¥¨¥é¡¼¤¬¤¢¤ë¾ì¹ç @code{NULL}¡£
-
-@subsubheading ¥¨¥é¡¼
-
-@table @code
-@item CR_COMMANDS_OUT_OF_SYNC
-ÉÔÅö¤Ê½ç¤Ë¥³¥Þ¥ó¥É¤¬¼Â¹Ô¤µ¤ì¤¿¡£
-@item CR_OUT_OF_MEMORY
-¥á¥â¥êÉÔ­¡£
-@item CR_SERVER_GONE_ERROR
-@strong{MySQL} ¥µ¡¼¥Ð¤¬¤¤¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item CR_SERVER_LOST
-¥µ¡¼¥Ð¤Ø¤ÎÀܳ¤¬¥¯¥¨¥êÃæ¤Ë¼º¤ï¤ì¤¿¡£
-@item CR_UNKNOWN_ERROR
-̤ÃΤΥ¨¥é¡¼¤¬È¯À¸¤·¤¿¡£
-@end table
-
-@node NULL mysql_store_result, Query results, mysql_use_result, C API functions
-@subsection @code{mysql_query()} ¤¬À®¸ù¤òÊÖ¤·¤¿¸å¡¢@code{mysql_store_result()} ¤¬ @code{NULL} ¤òÊÖ¤¹»þ¤¬¤¢¤ë¤Î¤Ï²¿¸Î¡©
-
-@code{mysql_query()} ¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤·¤¿¸å¤Ë
-@code{mysql_store_result()} ¤¬ @code{NULL} ¤òÊÖ¤¹¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£¤³¤ì¤¬
-µ¯¤³¤Ã¤¿¤È¤­¡¢¼¡¤Î¾ò·ï¤Î¤É¤ì¤«¤ÎȯÀ¸¤ò°ÕÌ£¤·¤Þ¤¹:
-
-@itemize @bullet
-@item
-@code{malloc()} ¤¬¼ºÇÔ¤·¤¿ (Î㤨¤Ð¡¢·ë²Ì¥»¥Ã¥È¤¬Â礭²á¤®¤¿¾ì¹ç)¡£
-
-@item
-¥Ç¡¼¥¿¤¬Æɤá¤Ê¤«¤Ã¤¿ (Àܳ¤Î¥¨¥é¡¼)¡£
-
-@item
-¥¯¥¨¥ê¤¬¥Ç¡¼¥¿¤òÊÖ¤µ¤Ê¤«¤Ã¤¿ (@code{INSERT}, @code{UPDATE}, @code{DELETE})¡£
-@end itemize
-
-¥¹¥Æ¡¼¥È¥á¥ó¥È¤¬¶õ¤Ç¤Ê¤¤·ë²Ì¤òÄ󶡤¹¤ë¤«¤É¤¦¤«¤Ï
-@code{mysql_field_count()} ¤Î¸Æ¤Ó½Ð¤·¤Ë¤è¤Ã¤Æ¤¤¤Ä¤Ç¤â¥Á¥§¥Ã¥¯¤Ç¤­¤Þ¤¹¡£
-@code{mysql_field_count()} ¤¬ 0 ¤òÊÖ¤¹¾ì¹ç¡¢·ë²Ì¤Ï¶õ¤ÇºÇ¸å¤Î¥¯¥¨¥ê¤ÏÃͤò
-ÊÖ¤µ¤Ê¤¤¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ç¤¹ (Î㤨¤Ð¡¢@code{INSERT} ¤ä @code{DELETE})¡£
-@code{mysql_field_count()} ¤¬Èó 0 ÃͤòÊÖ¤¹¾ì¹ç¡¢¥¹¥Æ¡¼¥È¥á¥ó¥È¤Ï¶õ¤Ç¤Ê¤¤
-·ë²Ì¤òÄ󶡤·¤Þ¤¹¡£
-Îã¤Ï@code{mysql_field_count()} ´Ø¿ô¤ÎÀâÌÀ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-@code{mysql_error()} ¤Þ¤¿¤Ï @code{mysql_errno()} ¤ò¸Æ¤Ó½Ð¤¹¤³¤È¤Ë¤è¤Ã¤Æ
-¥¨¥é¡¼¤Î¥Æ¥¹¥È¤â¤Ç¤­¤Þ¤¹¡£
-
-@node Query results, Getting unique ID, NULL mysql_store_result, C API functions
-@subsection ¥¯¥¨¥ê¤«¤éÆÀ¤é¤ì¤ë·ë²Ì¤Ï²¿¤«¡©
-
-¥¯¥¨¥ê¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤ë·ë²Ì¥»¥Ã¥È¤Ë²Ã¤¨¤Æ¡¢¼¡¤Î¾ðÊó¤âÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹:
-
-@itemize @bullet
-@item
-@code{mysql_affected_rows()} ¤Ï¡¢@code{INSERT}, @code{UPDATE} ¤Þ¤¿¤Ï
-@code{DELETE} ¤ò¹Ô¤Ê¤Ã¤¿»þ¤ÎºÇ¸å¤Î¥¯¥¨¥ê¤Ç¡¢±Æ¶Á¤µ¤ì¤¿¹Ô¿ô¤òÊÖ¤·¤Þ¤¹¡£
-@code{WHERE} À᤬¤Ê¤¤ @code{DELETE} ¤¬»ÈÍѤµ¤ì¤Æ¡¢¥Æ¡¼¥Ö¥ë¤¬ÀÚ¤êµÍ¤á¤é¤ì
-¤¿¾ì¹ç¤ÏÎã³°¤Ç¤¹¡£¤³¤ì¤Ï¤È¤Æ¤â®¤¤¤Ç¤¹¡ª ¤³¤Î¾ì¹ç¡¢
-@code{mysql_affected_rows()} ¤Ï±Æ¶Á¤µ¤ì¤¿¹Ô¿ô¤ò 0 ¤ÈÊÖ¤·¤Þ¤¹¡£
-
-@item
-@code{mysql_num_rows()} ¤Ï·ë²Ì¥»¥Ã¥È¤Î¥ì¥³¡¼¥É¿ô¤òÊÖ¤·¤Þ¤¹¡£
-@code{mysql_store_result()} ¤Ç¤Ï¡¢@code{mysql_num_rows()} ¤Ï
-@code{mysql_store_result()} ¤¬Éüµ¢¤·¤¿¤¹¤°¸å¤Ë¸Æ¤Ó½Ð¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@code{mysql_use_result()} ¤Ç¤Ï¡¢@code{mysql_num_rows()} ¤Ï
-@code{mysql_fetch_row()} ¤Ç¤¹¤Ù¤Æ¤Î¥ì¥³¡¼¥É¤ò¼è¤ê½Ð¤·¤¿¸å¤Ë¤À¤±¸Æ¤Ö½Ð¤¹¤³
-¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@item
-@code{mysql_insert_id()} ¤Ï¡¢@code{AUTO_INCREMENT} ¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ä¥Æ¡¼
-¥Ö¥ë¤Ë¹Ô¤òÁÞÆþ¤·¤¿ºÇ¸å¤Î¥¯¥¨¥ê¤Ë¤è¤Ã¤ÆÀ¸À®¤µ¤ì¤¿ ID ¤òÊÖ¤·¤Þ¤¹¡£
-@xref{mysql_insert_id, , @code{mysql_insert_id()}}.
-
-@item
-¤¤¤¯¤Ä¤«¤Î¥¯¥¨¥ê (@code{LOAD DATA INFILE...}, @code{INSERT INTO ...
-SELECT ...}, @code{UPDATE}) ¤ÏÄɲþðÊó¤òÊÖ¤·¤Þ¤¹¡£·ë²Ì¤Ï
-@code{mysql_info()} ¤ÇÊÖ¤µ¤ì¤Þ¤¹¡£
-ÊÖ¤¹Ê¸»úÎó¤Î·Á¼°¤Ë¤Ä¤¤¤Æ¤Ï¡¢@code{mysql_info()} ¤ÎÀâÌÀ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-@code{mysql_info()} ¤ÏÄɲþðÊ󤬤ʤ¤¾ì
-¹ç¤Ï @code{NULL} ¥Ý¥¤¥ó¥¿¤òÊÖ¤·¤Þ¤¹¡£
-@end itemize
-
-@node Getting unique ID, C API linking problems, Query results, C API functions
-@subsection ºÇ¸å¤ËÁÞÆþ¤µ¤ì¤¿¹Ô¤Î¥æ¥Ë¡¼¥¯ ID ¤ò¤É¤Î¤è¤¦¤ËÆÀ¤é¤ì¤ë¤«¡©
-
-@code{AUTO_INCREMENT} °À­¤ò»ý¤Ä¹àÌܤò´Þ¤à¥Æ¡¼¥Ö¥ë¤Ë¥ì¥³¡¼¥É¤òÁÞÆþ¤¹¤ë¾ì
-¹ç¡¢@code{mysql_insert_id()} ´Ø¿ô¤ÇÍ¿¤¨¤é¤ì¤¿ ID ¤òÆÀ¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-@code{mysql_query()} ¤ËÅϤ¹¥¯¥¨¥êʸ»úÎóÆâ¤Î@code{LAST_INSERT_ID()} ´Ø¿ô
-¤ò»ÈÍѤ¹¤ë¤³¤È¤Ç¤â¡¢ID ¤ò¼è¤ê½Ð¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-¼¡¤Î¥³¡¼¥É¤ò¼Â¹Ô¤¹¤ë¤³¤È¤Ç¡¢@code{AUTO_INCREMENT} ¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬»ÈÍѤµ¤ì
-¤¿¤«¤É¤¦¤«¥Á¥§¥Ã¥¯¤Ç¤­¤Þ¤¹¡£¤³¤ì¤Ï¡¢¥¯¥¨¥ê¤¬ @code{AUTO_INCREMENT} ¥¤¥ó
-¥Ç¥Ã¥¯¥¹¤òȼ¤¦ @code{INSERT} ¤À¤Ã¤¿¤«¤É¤¦¤«¤â¥Á¥§¥Ã¥¯¤Ç¤­¤Þ¤¹:
-
-@example
-if (mysql_error(&mysql)[0] == 0 &&
- mysql_num_fields(result) == 0 &&
- mysql_insert_id(&mysql) != 0)
-@{
- used_id = mysql_insert_id(&mysql);
-@}
-@end example
-
-À¸À®¤µ¤ì¤¿ºÇ¸å¤Î ID ¤ÏÀܳËè¤Ë¥µ¡¼¥ÐÆâ¤Ç°Ý»ý¤µ¤ì¤Æ¤¤¤Þ¤¹¡£Â¾¤Î¥¯¥é¥¤¥¢¥ó¥È
-¤Ë¤è¤Ã¤ÆÊѹ¹¤Ï¤µ¤ì¤Þ¤»¤ó¡£Â¾¤Î @code{AUTO_INCREMENT} ¹àÌܤòÈó¥Þ¥¸¥Ã¥¯ÃÍ
-(¤¹¤Ê¤ï¤Á¡¢@code{NULL} ¤Ç¤Ê¤¯ @code{0} ¤Ç¤Ê¤¤ÃÍ) ¤Ç¹¹¿·¤¹¤ë¾ì¹ç¤Ç¤â¡¢¤½¤ì¤ÏÊѹ¹
-¤µ¤ì¤Þ¤»¤ó¡£
-
-¤Þ¤¿¡¢Â¾¤Î¥Æ¡¼¥Ö¥ë¤Ë¤½¤Î ID ¤òÁÞÆþ¤·¤è¤¦¤È¤¹¤ë¾ì¹ç¡¢¼¡¤Ç¹Ô¤Ê¤¦¤³¤È¤¬¤Ç¤­¤Þ¤¹:
-
-@example
-INSERT INTO foo (auto,text)
- VALUES(NULL,'text'); # generate ID by inserting NULL
-INSERT INTO foo2 (id,text)
- VALUES(LAST_INSERT_ID(),'text'); # use ID in second table
-@end example
-
-@node C API linking problems, Thread-safe clients, Getting unique ID, C API functions
-@subsection C API ¤Ç¤Î¥ê¥ó¥¯¤ÎÌäÂê
-
-C API ¤Ç¥ê¥ó¥¯¤¹¤ë»þ¡¢¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¾å¤Ç¤Ï¼¡¤Î¥¨¥é¡¼¤Ë¤Ê¤ê¤Þ¤¹:
-
-@example
-gcc -g -o client test.o -L/usr/local/lib/mysql -lmysqlclient -lsocket -lnsl
-
-Undefined first referenced
- symbol in file
-floor /usr/local/lib/mysql/libmysqlclient.a(password.o)
-ld: fatal: Symbol referencing errors. No output written to client
-@end example
-
-¤³¤ì¤Ï¡¢¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à¾å¤Ç¤Ï¡¢¥³¥ó¥Ñ¥¤¥ë/¥ê¥ó¥¯¹Ô¤ÎºÇ¸å¤Ë¡¢math ¥é¥¤¥Ö
-¥é¥ê (@code{-lm}) ¤ò´Þ¤á¤ëɬÍפ¬¤¢¤ë¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹¡£
-
-@node Thread-safe clients, , C API linking problems, C API functions
-@subsection ¥¹¥ì¥Ã¥É°ÂÁ´¥¯¥é¥¤¥¢¥ó¥È¤òºî¤ëÊýË¡
-
-¥¯¥é¥¤¥¢¥ó¥È¤Ï `¤Û¤È¤ó¤É' ¥¹¥ì¥Ã¥É°ÂÁ´¤Ç¤¹¡£°ìÈÖÂ礭¤ÊÌäÂê¤Ï
-@file{net.c} (¥½¥±¥Ã¥È¤«¤éÆɤ߹þ¤ß¤ò¤¹¤ë¥µ¥Ö¥ë¡¼¥Á¥ó¤ò´Þ¤à¥Õ¥¡¥¤¥ë) ¤¬³ä
-¤ê¹þ¤ß°ÂÁ´¤Ç¤Ê¤¤¤³¤È¤Ç¤¹¡£¤³¤ì¤Ï¡¢¥µ¡¼¥Ð¤«¤é¤ÎŤ¤Æɤ߹þ¤ß¤òÃæÃǤǤ­¤ë¤è
-¤¦¤Ë¡¢¼«¿È¤Î¥¢¥é¡¼¥à¤ò»ý¤Á¤¿¤¤¤À¤í¤¦¤È¤¤¤¦¹Íθ¤Ç¹Ô¤Ê¤ï¤ì¤Þ¤·¤¿¡£
-If you
-install an interrupt handlers for the @code{SIGPIPE} interrupt,
-the socket handling should be thread safe.
-
-ɸ½à¥¯¥é¥¤¥¢¥ó¥È¥é¥¤¥Ö¥é¥ê¤Ï¥¹¥ì¥Ã¥É¥ª¥×¥·¥ç¥ó¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£
-
-¥¹¥ì¥Ã¥É°ÂÁ´¥¯¥é¥¤¥¢¥ó¥È(MySQL¥µ¡¼¥Ð¡¼¤È¤ÎÄÌ¿®»þ¤Ë¡¢
-¾¤Î¥¹¥ì¥Ã¥É¤¬¥¯¥é¥¤¥¢¥ó¥È¤Î¥¹¥ì¥Ã¥É¤Ë interrupt ¤ò¤«¤±¤¿¤ê¡¢
-¥¿¥¤¥à¥¢¥¦¥È¤ò¥»¥Ã¥È¤·¤¿¤ê¤¹¤ë)
-¤òÆÀ¤ë¤¿¤á¤Ë¤Ï¡¢@code{-lmysys}, @code{-lstring},
-@code{-ldbug} ¥é¥¤¥Ö¥é¥ê¤È¥µ¡¼¥Ð¤¬»ÈÍѤ¹¤ë @code{net_serv.o} ¤ò»ÈÍѤ·¤Þ
-¤¹¡£
-
-If you don't need interrupts or timeouts you can just compile the client
-library @code{(mysqlclient)} to be thread safe and use this. In this
-case you don't have to worry about the @code{net_serv.o} object file or
-the other @strong{MySQL} libraries.
-
-¥¹¥ì¥Ã¥É¥¯¥é¥¤¥¢¥ó¥È¤ò»ÈÍѤ¹¤ë»þ¡¢@file{thr_alarm.c} ¥ë¡¼¥Á¥ó¤òÂ礤¤Ë»È
-ÍѤǤ­¤Þ¤¹¡£@code{mysys} ¥é¥¤¥Ö¥é¥ê¤«¤é¤Î¥ë¡¼¥Á¥ó¤ò»ÈÍѤ¹¤ë¾ì¹ç¡¢³Ð¤¨¤Æ
-¤ª¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¤³¤È¤Ï @code{my_init()} ¤òºÇ½é¤Ë¸Æ¤Ö¤³¤È¤À¤±¤Ç¤¹¡ª
-
-@code{mysql_real_connect()} ¤ò½ü¤¯Á´¤Æ¤Î´Ø¿ô¤Ï¸½ºß¥¹¥ì¥Ã¥É°ÂÁ´¤Ç¤¹¡£¥¹¥ì¥Ã
-¥É°ÂÁ´¥¯¥é¥¤¥¢¥ó¥È¥é¥¤¥Ö¥é¥ê¤ò¥³¥ó¥Ñ¥¤¥ë¤·¡¢¤½¤ì¤ò¥¹¥ì¥Ã¥É°ÂÁ´¤Ê¥Þ¥Ê¡¼¤Ç»È
-ÍѤ¹¤ë¤¿¤á¤ÎÊýË¡¤ò¡¢¼¡¤ÎÃí°Õ¤ÇÀâÌÀ¤·¤Þ¤¹¡£(¤³¤Î
-@code{mysql_real_connect()} ¤Ë¤Ä¤¤¤Æ¤ÎÃí°Õ¤Ï¡¢¼ÂºÝ¤Ë¤Ï
-@code{mysql_connect()} ¤Ë¤âÍ­¸ú¤Ç¤¹¡£¤·¤«¤· @code{mysql_connect()} ¤Ï¿ä¾©
-¤µ¤ì¤Þ¤»¤ó¤Î¤Ç¡¢¤È¤Ë¤«¤¯ @code{mysql_real_connect()} ¤ò»ÈÍѤ¹¤Ù¤­¤Ç¤¹¡£)
-
-@code{mysql_real_connect()} ¤ò¥¹¥ì¥Ã¥É°ÂÁ´¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï¡¢¥¯¥é¥¤¥¢¥ó¥È¤ò¼¡¤Î
-¥³¥Þ¥ó¥É¤ÇºÆ¥³¥ó¥Ñ¥¤¥ë¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹:
-
-@example
-shell> ./configure --enable-thread-safe-client
-@end example
-
-This will ensure that the client library will use the header files required
-for thread safe programs and also that @code{mysql_real_connect()} will use
-a thread safe version of the @code{gethostbyname()} call.
-
-ɸ½à¥¯¥é¥¤¥¢¥ó¥È¤Î¥ê¥ó¥¯»þ¤Ë̤ÄêµÁ¥·¥ó¥Ü¥ë¤Î¤¿¤á¤¤¤¯¤Ä¤«¤Î¥¨¥é¡¼¤¬½Ð¤ë¤Ç
-¤·¤ç¤¦¡£¤³¤ì¤Ï¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï pthread ¥é¥¤¥Ö¥é¥ê¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¤¿¤á¤Ç¤¹¡£
-
-@c ·ë²Ì¤Î @file{libmysqld.a} ¥é¥¤¥Ö¥é¥ê¤Ï¸½ºß¥¹¥ì¥Ã¥É°ÂÁ´¤Ç¤¹¡£
-
-@c 2¤Ä¤Î¥¹¥ì¥Ã¥É¤ÏƱ¤¸Àܳ¥Ï¥ó¥É¥ë (@code{mysql_connect()} ¤ÇÊÖ¤µ¤ì¤ë¤â¤Î)
-@c ¤òƱ»þ¤Ë»ÈÍѤǤ­¤Þ¤»¤ó¡£2¤Ä¤Î¥¹¥ì¥Ã¥É¤¬¡¢@code{mysql_store_result()} ¤Ç
-@c ºîÀ®¤µ¤ì¤¿°Û¤Ê¤ë @code{MYSQL_RES} ¥Ý¥¤¥ó¥¿¤ò»ÈÍѤǤ­¤ë¤È¤·¤Æ¤â¤Ç¤¹¡£
-
-·ë²Ì¤Î @file{libmysqlclient.a} ¥é¥¤¥Ö¥é¥ê¤Ï¥¹¥ì¥Ã¥É°ÂÁ´¤Ç¤¹¡£¤³¤ì¤Î°ÕÌ£¤¹
-¤ë¤³¤È¤Ï¡¢Æ±¤¸Àܳ¥Ï¥ó¥É¥ë(@code{mysql_real_connect()} ¤ÇÊÖ¤µ¤ì¤ë)¤Ë¡¢Æ±»þ
-¤Ë£²¤Ä¤Î¥¹¥ì¥Ã¥É¤«¤é¥¯¥¨¥ê¤ò¹Ô¤Ê¤ï¤Ê¤¤¸Â¤ê¡¢¥¯¥é¥¤¥¢¥ó¥È¥³¡¼¥É¤Ï¥¹¥ì¥Ã¥É°Â
-Á´¤È¤¤¤¦¤³¤È¤Ç¤¹; ¥¯¥é¥¤¥¢¥ó¥È¡¿¥µ¡¼¥Ð¥×¥í¥È¥³¥ë¤Ï¡¢Í¿¤¨¤é¤ì¤¿Àܳ¾å¤ÇƱ»þ
-¤Ë°ì¤Ä¤ÎÍ×µá¤À¤±¤òµö¤·¤Þ¤¹¡£Ê£¿ô¤Î¥¹¥ì¥Ã¥É¤«¤éƱ¤¸Àܳ¤ò»ÈÍѤ·¤¿¤¤¾ì¹ç¤Ï¡¢
-@code{mysql_query()} ¤È @code{mysql_store_result()} ¤ÎÁȤ߹ç¤ï¤»¤Î¤Þ¤ï¤ê¤Ç
-mutex lock ¤ò¹Ô¤Ê¤¦É¬Íפ¬¤¢¤ê¤Þ¤¹¡£°ìÅÙ @code{mysql_store_result()} ¤ÎÍÑ°Õ
-¤¬¤Ç¤­¤ë¤È¡¢¥í¥Ã¥¯¤Ï²òÊü¤Ç¤­¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤¬Æ±¤¸Àܳ¤Ë¥¯¥¨¥ê¤ò¹Ô¤Ê¤¦¤³¤È¤¬
-¤Ç¤­¤Þ¤¹¡£(¾¤Î¸ÀÍդǸÀ¤¦¤È¡¢Àµ¤·¤¤¥í¥Ã¥¯¥×¥í¥È¥³¥ë¤ò»ÈÍѤ¹¤ë¸Â¤ê¡¢Ê̤Υ¹
-¥ì¥Ã¥É¤Ï¡¢@code{mysql_store_result()} ¤ÇÀ¸À®¤µ¤ì¤ëÊ̤Π@code{MYSQL_RES} ¥Ý
-¥¤¥ó¥¿¤ò»ÈÍѤǤ­¤Þ¤¹¡£) POSIX ¥¹¥ì¥Ã¥É¤Ç¥×¥í¥°¥é¥à¤ò¹Ô¤Ê¤¦¾ì¹ç¡¢
-@code{pthread_mutex_lock()} ¤È @code{pthread_mutex_unlock()} ¤ò¡¢mutex
-lock ¤Î³ÎΩ¤È²òÊü¤Ë»ÈÍѤǤ­¤Þ¤¹¡£
-
-@code{mysql_store_result()} ¤Ç¤Ê¤¯ @code{mysql_use_result()} ¤ò»ÈÍѤ¹¤ë¾ì
-¹ç¡¢@code{mysql_use_result()} ¤Î²ó¤ê¤È @code{mysql_fetch_row()} ¸Æ¤Ó½Ð¤·¤Ë
-¥í¥Ã¥¯¤¬É¬ÍפǤ¹¡£¤·¤«¤·¡¢¥¹¥ì¥Ã¥É²½¥¯¥é¥¤¥¢¥ó¥È¤ËËÜÅö¤Ë°ìÈÖÎɤ¤¤Î¤Ï¡¢
-@code{mysql_use_result()} ¤ò»ÈÍѤ·¤Ê¤¤¤³¤È¤Ç¤¹¡£
-
-@node Perl, Eiffel, C API functions, Clients
-@section @strong{MySQL} Perl API
-
-¤³¤³¤Ç¤Ï Perl @code{DBI} ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ë¤Ä¤¤¤Æ½Ò¤Ù¤ë¡£
-°ÊÁ°¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ï @code{mysqlperl} ¤Ç¤¢¤Ã¤¿¡£
-@code{DBI}/@code{DBD} ¤¬ Perl ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤È¤·¤Æ¸½ºß¿ä¾©¤µ¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢
-@code{mysqlperl} ¤Ë´Ø¤·¤Æ¤Ï¤³¤³¤Ç¤Ï½Ò¤Ù¤Ê¤¤¡£
-
-@menu
-* DBI with DBD:: @code{DBI} with @code{DBD::mysql}
-* Perl DBI Class:: The @code{DBI} interface
-* DBI-info:: More @code{DBI}/@code{DBD} information
-@end menu
-
-@node DBI with DBD, Perl DBI Class, Perl, Perl
-@subsection @code{DBI} with @code{DBD::mysql}
-
-@code{DBI} ¤Ï¿¤¯¤Î¥Ç¡¼¥¿¡¼¥Ù¡¼¥¹¤È¤Î°ìÈÌŪ¤Ê¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤Ç¤¢¤ë¡£
-¤³¤ì¤Ï¡¢Â¿¤¯¤Î¥Ç¡¼¥¿¡¼¥Ù¡¼¥¹¤ÈÆ°ºî¤¹¤ë¥¹¥¯¥ê¥×¥È¤òÊѹ¹¤Ê¤·¤Ë½ñ¤±¤ë¤³¤È¤ò°ÕÌ£¤¹¤ë¡£
-¤½¤Î¤¿¤á¤Ë¤Ï¡¢¤½¤ì¤¾¤ì¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹ÍѤΥǡ¼¥¿¥Ù¡¼¥¹¥É¥é¥¤¥Ð (DBD) ¤¬É¬ÍפǤ¢¤ë¡£
-@strong{MySQL} ¤Ç¤Ï¡¢¤½¤Î¥É¥é¥¤¥Ð¤Ï @code{DBD::mysql} ¤Ç¤¢¤ë¡£
-
-Perl5 DBI ¤Ë´Ø¤¹¤ë¾ÜºÙ¤Ï¡¢@code{DBI}¥¦¥§¥Ã¥Ö¥Ú¡¼¥¸¤ò»²¾È¤Î¤³¤È¡§
-@example
-@uref{http://www.symbolstone.org/technology/perl/DBI/index.html}
-@end example
-Object Oriented Programming (OOP) ¤Ë´Ø¤¹¤ë¾ÜºÙ¤Ï¡¢Perl OOP ¥Ú¡¼¥¸¤ò»²¾È¤Î¤³¤È¡§
-@example
-@uref{http://language.perl.com/info/documentation.html}
-@end example
-
-Installation instructions for @strong{MySQL} Perl support are given in
-@ref{Perl support}.
-
-@cindex @code{DBI} Perl module
-@node Perl DBI Class, DBI-info, DBI with DBD, Perl
-@subsubsection The @code{DBI} interface
-
-@noindent
-@strong{Portable DBI methods}
-
-@multitable @columnfractions .3 .7
-@item @code{connect} @tab ¥Ç¡¼¥¿¥Ù¡¼¥¹¥µ¡¼¥Ð¤ÈÀܳ¤¹¤ë
-@item @code{disconnect} @tab ¥Ç¡¼¥¿¥Ù¡¼¥¹¥µ¡¼¥Ð¤È¤ÎÀܳ¤òÀÚ¤ë
-@item @code{prepare} @tab SQLʸ¤òÀßÄꤹ¤ë
-@item @code{execute} @tab ÀßÄꤵ¤ì¤¿SQLʸ¤ò¼Â¹Ô¤¹¤ë
-@item @code{do} @tab SQLʸ¤òÀßÄꤷ¡¢¼Â¹Ô¤¹¤ë
-@item @code{quote} @tab ÁÞÆþ¤¹¤ë¤¿¤á¤Î¥¯¥©¡¼¥Èʸ»ú¡¢¤Þ¤¿¤Ï @code{BLOB} ÃÍ
-@item @code{fetchrow_array} @tab ¥Õ¥£¡¼¥ë¥É¤ÎÇÛÎó¤È¤·¤Æ¼¡¤Î¥ì¥³¡¼¥É¤ò¼è¤ê½Ð¤¹
-@item @code{fetchrow_arrayref} @tab ¥Õ¥£¡¼¥ë¥É¤ÎÇÛÎ󻲾ȤȤ·¤Æ¼¡¤Î¥ì¥³¡¼¥É¤ò¼è¤ê½Ð¤¹
-@item @code{fetchrow_hashref} @tab ¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤Ø¤Î»²¾È¤È¤·¤Æ¼¡¤Î¥ì¥³¡¼¥É¤ò¼è¤ê½Ð¤¹
-@item @code{fetchall_arrayref} @tab ÇÛÎó¤ÎÇÛÎó¤È¤·¤ÆÁ´¥Ç¡¼¥¿¤ò¼è¤ê½Ð¤¹
-@item @code{finish} @tab Ì¿Îá¤ò½ªÎ»¤·¡¢¥ê¥½¡¼¥¹¤«¤é¥·¥¹¥Æ¥à¤òÀÚ¤êÎ¥¤¹
-@item @code{rows} @tab ±Æ¶Á¤Î¤¢¤Ã¤¿¥ì¥³¡¼¥É¤Î¿ô¤òÊÖ¤¹
-@item @code{data_sources} @tab ¥í¡¼¥«¥ë¥Û¥¹¥È¾å¤ÇÍøÍѤǤ­¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÇÛÎó¤òÊÖ¤¹
-@item @code{ChopBlanks} @tab @code{fetchrow_*} ¥á¥½¥Ã¥É¤¬¶õÇò¤ò¼è¤ê½ü¤¯¤«¤É¤¦¤«¤ò´ÉÍý¤¹¤ë
-@item @code{NUM_OF_PARAMS} @tab ÀßÄꤵ¤ì¤¿Ì¿ÎáʸÃæ¤Î placeholder ¤Î¿ô
-@item @code{NULLABLE} @tab ¤É¤Î¥Õ¥£¡¼¥ë¥É¤Ë @code{NULL} Ãͤ¬¤¢¤ë¤«¡©
-@item @code{trace} @tab Perform tracing for debugging
-@end multitable
-
-@noindent
-@strong{MySQL ¸ÇÍ­¥á¥½¥Ã¥É}
-
-@multitable @columnfractions .3 .7
-@item @code{insertid} @tab ºÇ¸å¤Î @code{AUTO_INCREMENT} ÃÍ
-@item @code{is_blob} @tab ¤É¤Î¥Õ¥£¡¼¥ë¥É¤¬ @code{BLOB} ¤«¡©
-@item @code{is_key} @tab ¤É¤Î¥Õ¥£¡¼¥ë¥É¤¬¥­¡¼¤«¡©
-@item @code{is_num} @tab ¤É¤Î¥Õ¥£¡¼¥ë¥É¤¬¿ôÃÍ·¿¤«¡©
-@item @code{is_pri_key} @tab ¤É¤Î¥Õ¥£¡¼¥ë¥É¤¬¥×¥é¥¤¥Þ¥ê¥­¡¼¤«¡©
-@item @code{is_not_null} @tab ¤É¤Î¥Õ¥£¡¼¥ë¥É¤¬ @code{NULL} Ãͤ«¡©¡¡@code{NULLABLE} »²¾È¡£
-@item @code{length} @tab ÍøÍѲÄǽ¤Ê¥Õ¥£¡¼¥ë¥É¥µ¥¤¥º¤ÎºÇÂçÃÍ
-@item @code{max_length} @tab ¼ÂºÝ¤Ë¸ºß¤·¤Æ¤¤¤ë¥Õ¥£¡¼¥ë¥É¥µ¥¤¥º¤ÎºÇÂçÃÍ
-@item @code{NAME} @tab ¥Õ¥£¡¼¥ë¥É̾
-@item @code{NUM_OF_FIELDS} @tab ÊÖ¤µ¤ì¤¿¥Õ¥£¡¼¥ë¥É¤Î¿ô
-@item @code{table} @tab ÊÖ¤µ¤ì¤¿¥»¥Ã¥È¤Î¥Æ¡¼¥Ö¥ë̾
-@item @code{type} @tab Á´¤Æ¤Î¥Õ¥£¡¼¥ë¥É¤Î·¿
-@item @code{_CreateDB} @tab ¥Ç¡¼¥¿¥Ù¡¼¥¹¤òºîÀ®¤¹¤ë
-@item @code{_DropDB} @tab ¥Ç¡¼¥¿¥Ù¡¼¥¹¤òºï½ü¤¹¤ë¡£ @strong{¡ö¡ö¡ö¤³¤Î¥á¥½¥Ã¥É¤Ï´í¸±¤Ç¤¢¤ë¡ö¡ö¡ö}
-@end multitable
-
-°Ê²¼¤ÎÀá¤Ë¡¢¤è¤ê¾ÜºÙ¤Ê Perl ¥á¥½¥Ã¥É¤Î²òÀ⤬¤¢¤ë¡£
-Variables used for method return values have these meanings:
-
-@table @code
-@item $dbh
-Database handle
-
-@item $sth
-Statement handle
-
-@item $rc
-Return code (often a status)
-
-@item $rv
-Return value (often a row count)
-@end table
-
-@noindent
-@strong{ÈÆÍÑ DBI ¥á¥½¥Ã¥É}
-
-@table @code
-
-Generally the 'do' statement is MUCH faster (and is preferable)
-than prepare/execute for statements that doesn't contain parameters.
-
-@findex DBI->connect()
-@findex connect() DBI method
-@item connect($data_source, $username, $password)
-¥Ç¡¼¥¿¥½¡¼¥¹¤È¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹Àܳ¤ò¤¹¤ë¤¿¤á¤Ë @code{connect} ¤ò»È¤¦¡£
-@code{$data_source} ÃÍ¤Ï @code{DBI:driver_name:} ¤Ç¤Ï¤¸¤á¤ë¤³¤È¡£
-@code{DBD::mysql} ¥É¥é¥¤¥Ð¡¼¤òÍѤ¤¤¿ @code{connect} ¤Î»ÈÍÑÎ㡧
-@example
-$dbh = DBI->connect("DBI:mysql:$database", $user, $password);
-$dbh = DBI->connect("DBI:mysql:$database:$hostname",
- $user, $password);
-$dbh = DBI->connect("DBI:mysql:$database:$hostname:$port",
- $user, $password);
-@end example
-¥æ¡¼¥¶¡¼Ì¾¤Þ¤¿¤Ï¥Ñ¥¹¥ï¡¼¥É¤¬Ì¤ÀßÄê¤Î¾ì¹ç¡¢ @code{DBI} ¤Ï´Ä¶­ÊÑ¿ô¤Ç¤¢¤ë
- @code{DBI_USER} ¤È @code{DBI_PASS} ¤ò¤½¤ì¤¾¤ì»È¤¦¡£
-¥Û¥¹¥È̾¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¤Ï¡¢@code{'localhost'} ¤¬¥Ç¥Õ¥©¥ë¥È¤È¤Ê¤ë¡£
-¥Ý¡¼¥ÈÈÖ¹æ¤ò»ØÄꤷ¤Ê¤¤¾ì¹ç¤Ï¡¢@strong{MySQL} ¥Ý¡¼¥È¡Ê@value{default_port}¡Ë
-¤¬¥Ç¥Õ¥©¥ë¥È¤È¤Ê¤ë¡£
-
-As of @code{Msql-Mysql-modules} version 1.2009,
-the @code{$data_source} value allows certain modifiers:
-
-@table @code
-@item mysql_read_default_file=file_name
-Read @file{filename} as an option file. For information on option files,
-see @ref{Option files}.
-
-@item mysql_read_default_group=group_name
-The default group when reading an option file is normally the
-@code{[client]} group. By specifying the @code{mysql_read_default_group}
-option, the default group becomes the @code{[group_name]} group.
-
-@item mysql_compression=1
-Use compressed communication between the client and server (@strong{MySQL}
-3.22.3 or later).
-
-@item mysql_socket=/path/to/socket
-Specify the pathname of the Unix socket that is used to connect
-to the server (@strong{MySQL} 3.21.15 or later).
-@end table
-
-Multiple modifiers may be given; each must be preceded by a semicolon.
-
-For example, if you want to avoid hardcoding the user name and password into
-a @code{DBI} script, you can take them from the user's @file{~/.my.cnf}
-option file instead by writing your @code{connect} call like this:
-
-@example
-$dbh = DBI->connect("DBI:mysql:$database"
- . ";mysql_read_default_file=$ENV@{HOME@}/.my.cnf",
- $user, $password);
-@end example
-
-This call will read options defined for the @code{[client]} group in the
-option file. If you wanted to do the same thing, but use options specified
-for the @code{[perl]} group as well, you could use this:
-
-@example
-$dbh = DBI->connect("DBI:mysql:$database"
- . ";mysql_read_default_file=$ENV@{HOME@}/.my.cnf"
- . ";mysql_read_default_group=perl",
- $user, $password);
-@end example
-
-@findex DBI->disconnect
-@findex disconnect DBI method
-@item disconnect
-@code{disconnect} ¥á¥½¥Ã¥É¤Ï¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤È¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ï¥ó¥É¥ë¤òÀÚÃǤ¹¤ë¡£
-¥×¥í¥°¥é¥à¤ò½ªÎ»¤¹¤ëľÁ°¤Ë¸Æ¤Ó½Ð¤µ¤ì¤ë¤Î¤¬Åµ·¿Åª¤Ç¤¢¤ë¡£
-Î㡧
-@example
-$rc = $dbh->disconnect;
-@end example
-
-@findex DBI->prepare()
-@findex prepare() DBI method
-@item prepare($statement)
-¥Ç¡¼¥¿¥Ù¡¼¥¹¥¨¥ó¥¸¥ó¤Ç¼Â¹Ô¤¹¤ë¤¿¤á¤ÎSQLʸ¤òÀßÄꤷ¡¢@code{execute} ¥á¥½¥Ã¥É¤Ç
-»ÈÍѽÐÍè¤ë¥¹¥Æ¡¼¥È¥á¥ó¥È¥Ï¥ó¥É¥ë @code{($sth)} ¤òÊÖ¤¹¡£
-Typically you handle @code{SELECT} statements (and @code{SELECT}-like statements
-such as @code{SHOW}, @code{DESCRIBE} and @code{EXPLAIN}) by means of
-@code{prepare} and @code{execute}.
-Î㡧
-@example
-$sth = $dbh->prepare($statement)
- or die "Can't prepare $statement: $dbh->errstr\n";
-@end example
-
-@findex DBI->execute
-@findex execute DBI method
-@item execute
-@code{execute} ¥á¥½¥Ã¥É¤Ï¡¢ÀßÄꤵ¤ì¤¿SQLʸ¤ò¼Â¹Ô¤¹¤ë¡£Èó @code{SELECT} ʸ¤Î¤È¤­¤Ï¡¢
-±Æ¶Á¤Î¤¢¤Ã¤¿¥ì¥³¡¼¥É¤Î¿ô¤òÊÖ¤¹¡£ ¤â¤·¤Ê¤ó¤ÎÊѲ½¤â¤Ê¤«¤Ã¤¿¤Ê¤é¡¢ @code{execute} ¤Ï @code{"0E0"}
-(¤³¤ì¤Ï Perl ¤Ç¤Ï ¥¼¥í °·¤¤¤Ç¤¹¤¬¡¢ ¿¿ ¤Ç¤â¤¢¤ë) ¤òÊÖ¤¹¡£
-@code{SELECT} ʸ¤Î¤È¤­¤Ï¡¢SQLÍ×µá¤ò³«»Ï¤¹¤ë¤Î¤ß¤Ç¤¢¤ë¡£
-¥Ç¡¼¥¿¤òÁàºî¤¹¤ë @code{fetch_*} ¥á¥½¥Ã¥É¤ÎÆâ¤Î°ì¤Ä¤òµ­½Ò¤¹¤ëɬÍפ¬¤¢¤ë¡£
-Î㡧
-@example
-$rv = $sth->execute
- or die "can't execute the query: $sth->errstr;
-@end example
-
-@findex DBI->do()
-@findex do() DBI method
-@item do($statement)
-@code{do} ¥á¥½¥Ã¥É¤ÏSQLʸ¤òÀßÄꡦ¼Â¹Ô¤·¡¢±Æ¶Á¤Î¤¢¤Ã¤¿¥ì¥³¡¼¥É¤Î¿ô¤òÊÖ¤¹¡£
-¤³¤Î¥á¥½¥Ã¥É¤Ï¡¢¡ÖÈó select¡×ʸ¡¢¤¹¤Ê¤ï¤Á¡¢¹âÅ١ʥɥ饤¥Ð¡¼¤Î¸Â³¦¤Î¤¿¤á¡Ë¤ÇÀßÄê¤Ç¤­¤Ê¤¤Ê¸¡¢
-°ìÅ٤μ¹ԡÊinserts, deletes ¤Ê¤É¡Ë¤ÇºÑ¤àʸ¤Î¤È¤­¤Ë°ìÈÌŪ¤ËÍѤ¤¤é¤ì¤ë¡£
-Î㡧
-@example
-$rv = $dbh->do($statement)
- or die "Can't execute $statement: $dbh- >errstr\n";
-@end example
-
-@findex DBI->quote()
-@findex quote() DBI method
-@cindex Quoting strings
-@cindex Strings, quoting
-@item quote($string)
-@code{quote} ¥á¥½¥Ã¥É¤Ï¡¢Ê¸»úÎóÃæ¤Ë¥¨¥¹¥±¡¼¥×ʸ»ú¤¬¤¢¤ë¤È¤­¤ËÍѤ¤¤é¤ì¡¢
-¥¯¥©¡¼¥Èʸ»ú¤òʸ¤Î³°Â¦¤ËÉղ乤롣
-Î㡧
-@example
-$sql = $dbh->quote($string)
-@end example
-
-@findex DBI->fetchrow_array
-@findex fetchrow_array DBI method
-@item fetchrow_array
-¤³¤Î¥á¥½¥Ã¥É¤Ï¥Ç¡¼¥¿¤Î¼¡¤Î¥ì¥³¡¼¥É¤ò¼è¤ê½Ð¤·¡¢¥Õ¥£¡¼¥ë¥É¤ÎÃͤÎÇÛÎó¤È¤·¤ÆÊÖ¤¹¡£
-Î㡧
-@example
-while(@@row = $sth->fetchrow_array) @{
- print qw($row[0]\t$row[1]\t$row[2]\n);
-@}
-@end example
-
-@findex DBI->fetchrow_arrayref
-@findex fetchrow_arrayref DBI method
-@item fetchrow_arrayref
-¤³¤Î¥á¥½¥Ã¥É¤Ï¥Ç¡¼¥¿¤Î¼¡¤Î¥ì¥³¡¼¥É¤ò¼è¤ê½Ð¤·¡¢¥Õ¥£¡¼¥ë¥É¤ÎÃͤÎÇÛÎó¤Ø¤Î»²¾È¤È¤·¤ÆÊÖ¤¹¡£
-Î㡧
-@example
-while($row_ref = $sth->fetchrow_arrayref) @{
- print qw($row_ref->[0]\t$row_ref->[1]\t$row_ref->[2]\n);
-@}
-@end example
-
-@findex DBI->fetchrow_hashref
-@findex fetchrow_hashref DBI method
-@item fetchrow_hashref
-¤³¤Î¥á¥½¥Ã¥É¤Ï¥Ç¡¼¥¿¤Î¥ì¥³¡¼¥É¤ò¼è¤ê½Ð¤·¡¢Ì¾Á°¡¦ÃͤΥڥ¢¤Î¥Õ¥£¡¼¥ë¥É¤ò´Þ¤ó¤À
-¥Ï¥Ã¥·¥å¥Æ¡¼¥Ö¥ë¤Ø¤Î»²¾È¤òÊÖ¤¹¡£¤³¤Î¥á¥½¥Ã¥É¤Ï¡¢¾å¤Ç¼¨¤·¤¿ÇÛÎó»²¾È
-¡ÊÌõÃí¡§@code{fetchrow_arrayref}¡Ë¤è¤ê¤â¤«¤Ê¤ê¸úΨŪ¤Ç¤Ï¤Ê¤¤¡£Î㡧
-@example
-while($hash_ref = $sth->fetchrow_hashref) @{
- print qw($hash_ref->@{firstname@}\t$hash_ref->@{lastname@}\t\
- $hash_ref- > title@}\n);
-@}
-@end example
-
-@findex DBI->fetchall_arrayref
-@findex fetchall_arrayref DBI method
-@item fetchall_arrayref
-¤³¤Î¥á¥½¥Ã¥É¤Ï¡¢SQLʸ¤è¤êÊÖ¤µ¤ì¤¿¥Ç¡¼¥¿¡Ê¥ì¥³¡¼¥É¡Ë¤ÎÁ´¤Æ¤òÆÀ¤ë¤¿¤á¤Ë»È¤¦¡£
-¤³¤Î¥á¥½¥Ã¥É¤Ï¡¢³Æ¥ì¥³¡¼¥É¤Ø¤Î»²¾È¤ÎÇÛÎó¤ÎÇÛÎó¤Ø¤Î»²¾È¤òÊÖ¤¹¡£
-Æþ¤ì»Ò¤Î¥ë¡¼¥×¤ò»È¤Ã¤Æ¥Ç¡¼¥¿¤òÍøÍÑ¡¦É½¼¨¤¹¤ë¡£Î㡧
-@example
-my $table = $sth->fetchall_arrayref
- or die "$sth->errstr\n";
-my($i, $j);
-for $i ( 0 .. $#@{$table@} ) @{
- for $j ( 0 .. $#@{$table->[$i]@} ) @{
- print "$table->[$i][$j]\t";
- @}
- print "\n";
-@}
-@end example
-
-@findex DBI->finish
-@findex finish DBI method
-@item finish
-¤½¤Î¥¹¥Æ¡¼¥È¥á¥ó¥È¥Ï¥ó¥É¥ë¤«¤é¤½¤ì°Ê¾å¥Ç¡¼¥¿¤ò¼è¤ê½Ð¤µ¤Ê¤¤¤³¤È¤ò¼¨¤¹¡£¥¹¥Æ¡¼¥È¥á¥ó¥È¥Ï¥ó¥É¥ë¤ä¡¢¤Ä¤«¤ó¤Ç¤¤¤¿¥·¥¹¥Æ¥à¥ê¥½¡¼¥¹¤ò²òÊü¤¹¤ë¤¿¤á¤Ë¤³¤Î¥á¥½¥Ã¥É¤ò¸Æ¤Ó½Ð¤¹¡£Î㡧
-@example
-$rc = $sth->finish;
-@end example
-
-@findex DBI->rows
-@findex rows DBI method
-@item rows
-ºÇ¸å¤ÎÌ¿Îá¤Ë¤è¤ê¡¢¡Ê¥Ç¡¼¥¿¤Î¹¹¿·¡¢ºï½ü¡¢¤Ê¤É¤Ç¡Ë±Æ¶Á¤Î¤¢¤Ã¤¿¥ì¥³¡¼¥É¤Î¿ô¤òÊÖ¤¹¡£
-¤³¤Î¥á¥½¥Ã¥É¤Ï @code{do} ¤¢¤ë¤¤¤Ï Èó @code{SELECT} @code{execute} ʸ¤ò
-¼Â¹Ô¤·¤¿¸å¤Ë¡¢¤¿¤¤¤Æ¤¤»È¤ï¤ì¤ë¡£Î㡧
-Example:
-@example
-$rv = $sth->rows;
-@end example
-
-@findex DBI->@{NULLABLE@}
-@findex NULLABLE DBI method
-@item NULLABLE
-ÇÛÎó¤Î³ÆÍ×ÁǤËÂФ·¡¢¥Ö¡¼¥ëÃͤÎÇÛÎó¤Ø¤Î»²¾È¤òÊÖ¤¹¡£
-TRUE ¤Ç¤¢¤ì¤Ð¤½¤Î¥Õ¥£¡¼¥ë¥É¤Ë @code{NULL} Ãͤ¬´Þ¤Þ¤ì¤Æ¤¤¤ë¤³¤È¤ò¼¨¤¹¡£Î㡧
-Example:
-@example
-$null_possible = $sth->@{NULLABLE@};
-@end example
-
-@findex DBI->@{NUM_OF_FIELDS@}
-@findex NUM_OF_FIELDS DBI method
-@item NUM_OF_FIELDS
-¤³¤Î°À­¤Ï¡¢@code{SELECT} ʸ¤ä @code{SHOW FIELDS} ʸ¤Ë¤è¤Ã¤ÆÊÖ¤µ¤ì¤¿
-¥Õ¥£¡¼¥ë¥É¤Î¿ô¤ò¼¨¤·¤Æ¤¤¤ë¡£Ì¿Îáʸ¤¬·ë²Ì¤òÊÖ¤·¤¿¤«¤É¤¦¤«¤ò¥Á¥§¥Ã¥¯¤¹¤ë¤Î¤Ë¡¢
-¤³¤ì¤ò»È¤¦¤³¤È¤¬½ÐÍè¤ë¡§£°Ãͤϡ¢@code{INSERT}, @code{DELETE} ¤Þ¤¿¤Ï
- @code{UPDATE} ¤Î¤è¤¦¤ÊÈó @code{SELECT} ʸ¤ò¼¨¤·¤Æ¤¤¤ë¡£Î㡧
-Example:
-@example
-$nr_of_fields = $sth->@{NUM_OF_FIELDS@};
-@end example
-
-@findex DBI->data_sources()
-@findex data_sources() DBI method
-@item data_sources($driver_name)
-¤³¤Î¥á¥½¥Ã¥É¤Ï¡¢@code{'localhost'} ¥Û¥¹¥È¾å¤Î @strong{MySQL} ¥µ¡¼¥Ð¤Ç
-ÍøÍѲÄǽ¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î̾Á°¤ò´Þ¤ó¤ÀÇÛÎó¤òÊÖ¤¹¡£Î㡧
-@example
-@@dbs = DBI->data_sources("mysql");
-@end example
-
-@findex DBI->@{ChopBlanks@}
-@findex ChopBlanks DBI method
-@item ChopBlanks
-¤³¤Î°À­¤Ï¡¢ @code{fetchrow_*} ¥á¥½¥Ã¥É¤¬ÊÖ¤êÃͤ«¤éÁ°¸å¤Î¶õÇò¤ò
-½üµî¤¹¤ë¤«¤É¤¦¤«¤ò·èÄꤹ¤ë¡£Î㡧
-@example
-$sth->@{'ChopBlanks'@} =1;
-@end example
-
-@findex DBI->trace
-@findex trace DBI method
-@item trace($trace_level)
-@itemx trace($trace_level, $trace_filename)
-The @code{trace} method enables or disables tracing. When invoked as a
-@code{DBI} class method, it affects tracing for all handles. When invoked as
-a database or statement handle method, it affects tracing for the given
-handle (and any future children of the handle). Setting @code{$trace_level}
-to 2 provides detailed trace information. Setting @code{$trace_level} to 0
-disables tracing. Trace output goes to the standard error output by
-default. If @code{$trace_filename} is specified, the file is opened in
-append mode and output for @emph{all} traced handles is written to that
-file. Example:
-@example
-DBI->trace(2); # trace everything
-DBI->trace(2,"/tmp/dbi.out"); # trace everything to /tmp/dbi.out
-$dth->trace(2); # trace this database handle
-$sth->trace(2); # trace this statement handle
-@end example
-
-@tindex DBI_TRACE environment variable
-@tindex Environment variable, DBI_TRACE
-You can also enable @code{DBI} tracing by setting the @code{DBI_TRACE}
-environment variable. Setting it to a numeric value is equivalent to calling
-@code{DBI->(value)}. Setting it to a pathname is equivalent to calling
-@code{DBI->(2,value)}.
-
-@end table
-
-@noindent
-@strong{MySQL ¸ÇÍ­¥á¥½¥Ã¥É}
-
-The methods shown below are @strong{MySQL}-specific and not part of the
-@code{DBI} standard. Several of them are now deprecated:
-@code{is_blob}, @code{is_key}, @code{is_num}, @code{is_pri_key},
-@code{is_not_null}, @code{length}, @code{max_length}, and @code{table}.
-Where @code{DBI}-standard alternatives exist, they are noted below.
-
-@table @code
-@findex DBI->@{insertid@}
-@findex insertid DBI method
-@cindex AUTO_INCREMENT, using with DBI
-@item insertid
-@strong{MySQL} ¤ÎÆÃħ¤Ç¤¢¤ë @code{AUTO_INCREMENT} ¤ò»È¤¦¤È¤­¡¢
-¿·¤·¤¤¼«Æ°·«¤ê¾å¤¬¤êÃͤ¬¤³¤³¤Ëµ­²±¤µ¤ì¤ë¡£Î㡧
-Example:
-@example
-$new_id = $sth->@{insertid@};
-@end example
-
-As an alternative, you can use @code{$dbh->@{'mysql_insertid'@}}.
-
-@findex DBI->@{is_blob@}
-@findex is_blob DBI method
-@item is_blob
-ÇÛÎó¤Î³ÆÍ×ÁǤËÂФ·¡¢¥Ö¡¼¥ëÃͤÎÇÛÎó¤Ø¤Î»²¾È¤òÊÖ¤¹¡£TRUE ¤Ç¤¢¤ì¤Ð
-¤½¤Î¥Õ¥£¡¼¥ë¥É¤¬ @code{BLOB} ÃͤǤ¢¤ë¤³¤È¤ò¼¨¤¹¡£Î㡧
-@example
-$keys = $sth->@{is_blob@};
-@end example
-
-@findex DBI->@{is_key@}
-@findex is_key DBI method
-@item is_key
-ÇÛÎó¤Î³ÆÍ×ÁǤËÂФ·¡¢¥Ö¡¼¥ëÃͤÎÇÛÎó¤Ø¤Î»²¾È¤òÊÖ¤¹¡£TRUE ¤Ç¤¢¤ì¤Ð
-¤½¤Î¥Õ¥£¡¼¥ë¥É¤¬¥­¡¼¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£
-Î㡧
-@example
-$keys = $sth->@{is_key@};
-@end example
-
-@findex DBI->@{is_num@}
-@findex is_num DBI method
-@item is_num
-ÇÛÎó¤Î³ÆÍ×ÁǤËÂФ·¡¢¥Ö¡¼¥ëÃͤÎÇÛÎó¤Ø¤Î»²¾È¤òÊÖ¤¹¡£TRUE ¤Ç¤¢¤ì¤Ð
-¤½¤Î¥Õ¥£¡¼¥ë¥É¤¬¿ôÃÍ·¿¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£
-Î㡧
-@example
-$nums = $sth->@{is_num@};
-@end example
-
-@findex DBI->@{is_pri_key@}
-@findex is_pri_key DBI method
-@item is_pri_key
-ÇÛÎó¤Î³ÆÍ×ÁǤËÂФ·¡¢¥Ö¡¼¥ëÃͤÎÇÛÎó¤Ø¤Î»²¾È¤òÊÖ¤¹¡£TRUE ¤Ç¤¢¤ì¤Ð
-¤½¤Î¥Õ¥£¡¼¥ë¥É¤¬¥×¥é¥¤¥Þ¥ê¡¼¥­¡¼¤Ç¤¢¤ë¤³¤È¤ò¼¨¤¹¡£
-Î㡧
-@example
-$pri_keys = $sth->@{is_pri_key@};
-@end example
-
-@findex DBI->@{is_not_null@}
-@findex is_not_null DBI method
-@item is_not_null
-ÇÛÎó¤Î³ÆÍ×ÁǤËÂФ·¡¢¥Ö¡¼¥ëÃͤÎÇÛÎó¤Ø¤Î»²¾È¤òÊÖ¤¹¡£FALSE ¤Ç¤¢¤ì¤Ð
-¤½¤Î¥Õ¥£¡¼¥ë¥É¤¬ @code{NULL} Ãͤò´Þ¤à¤³¤È¤ò¼¨¤¹¡£
-Î㡧
-@example
-$not_nulls = $sth->@{is_not_null@};
-@end example
-
-@code{is_not_null} is deprecated;
-Á°½Ò¤Î @code{NULLABLE} °À­¤ò»ÈÍѤ¹¤ë¤Û¤¦¤¬Ë¾¤Þ¤·¤¤¡£¤½¤ì¤¬ DBI ¤Îɸ½à¤Ç¤¢¤ë¡£
-
-@findex DBI->@{length@}
-@findex length DBI method
-@findex DBI->@{max_length@}
-@findex max_length DBI method
-@item length
-@itemx max_length
-¤½¤ì¤¾¤ì¤Î¥á¥½¥Ã¥É¤Ï¡¢¥Õ¥£¡¼¥ë¥É¥µ¥¤¥º¤ÎÇÛÎó¤Ø¤Î»²¾È¤òÊÖ¤¹¡£@code{length} ÇÛÎó¤Ï¡¢
-¡Ê¥Æ¡¼¥Ö¥ëµ­½Ò¤ÇÄêµÁ¤µ¤ì¤¿¡Ë³Æ¥Õ¥£¡¼¥ë¥É¤ÎÍøÍѲÄǽºÇÂçÃͤò¼¨¤¹¡£
-@code{max_length} ÇÛÎó¤Ï¡¢¥Æ¡¼¥Ö¥ëÃæ¤Ë¼ÂºÝ¤Ë¸ºß¤·¤Æ¤¤¤ëºÇÂçÃͤò¼¨¤¹¡£Î㡧
-
-@example
-$lengths = $sth->@{length@};
-$max_lengths = $sth->@{max_length@};
-@end example
-
-@findex DBI->@{NAME@}
-@findex NAME DBI method
-@item NAME
-¥Õ¥£¡¼¥ë¥É̾¤ÎÇÛÎó¤Ø¤Î»²¾È¤òÊÖ¤¹¡£
-Î㡧
-@example
-$names = $sth->@{NAME@};
-@end example
-
-@findex DBI->@{table@}
-@findex table DBI method
-@item table
-¥Æ¡¼¥Ö¥ë̾¤ÎÇÛÎó¤Ø¤Î»²¾È¤òÊÖ¤¹¡£
-Î㡧
-@example
-$tables = $sth->@{table@};
-@end example
-
-@findex DBI->@{type@}
-@findex type DBI method
-@item type
-¥Õ¥£¡¼¥ë¥É¤Î·¿¤ÎÇÛÎó¤Ø¤Î»²¾È¤òÊÖ¤¹¡£
-Î㡧
-@example
-$types = $sth->@{type@};
-@end example
-
-@end table
-
-@node DBI-info, , Perl DBI Class, Perl
-@subsection @code{DBI}/@code{DBD} ¤Ë´Ø¤¹¤ë¤½¤ì°Ê¾å¤Î¾ðÊó
-
-@code{DBI} ¤Ë´Ø¤¹¤ë¤½¤ì°Ê¾å¤Î¾ðÊó¤Ï @code{perldoc} ¥³¥Þ¥ó¥É¤ÇÆÀ¤é¤ì¤ë¡£
-
-@example
-perldoc DBI
-perldoc DBI::FAQ
-perldoc DBD::mysql
-@end example
-
-¾¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ËÊÑ´¹¤¹¤ë¥Ä¡¼¥ë¡¢@code{pod2man}, @code{pod2html} ¤Ê¤É¤â
-»È¤¦¤³¤È¤¬½ÐÍè¤ë¡£
-
-¤½¤·¤Æ¤â¤Á¤í¤ó¡¢@code{DBI} ¤ÎºÇ¿·¾ðÊó¤Ï @code{DBI} ¥¦¥§¥Ã¥Ö¥Ú¡¼¥¸¤Ç¸«¤ë¤³¤È¤¬½ÐÍè¤ë¡§
-@example
-@uref{http://www.symbolstone.org/technology/perl/DBI/index.html}
-@end example
-
-@node Eiffel, Java, Perl, Clients
-@section @strong{MySQL} Eiffel wrapper
-
-The @strong{MySQL} @uref{http://www.mysql.com/Contrib/,Contrib directory}
-contains an Eiffel wrapper written by Michael Ravits
-
-You can also find this at:
-@url{http://www.netpedia.net/hosting/newplayer/}
-
-@node Java, PHP, Eiffel, Clients
-@section @strong{MySQL} Java connectivity (JDBC)
-
-There are 2 supported JDBC drivers for @strong{MySQL} (the twz and mm driver).
-You can find a copy of these at @uref{http://www.mysql.com/Contrib}.
-For documentation consult any JDBC documentation and the
-drivers own documentation for @strong{MySQL} specific features.
-
-@node PHP, Cplusplus, Java, Clients
-@section @strong{MySQL} PHP API
-
-PHP is a server-side, HTML embedded scripting language that may be used to
-create dynamic web pages. It contains support for accessing several
-databases, including @strong{MySQL}. PHP may be run as a separate program,
-or compiled as a module for use with the Apache web server.
-
-The distribution and documentation are available at the
-@uref{http://www.php.net/, PHP website}.
-
-@menu
-* PHP problems::
-@end menu
-
-@node PHP problems, , PHP, PHP
-@subsection Common problems with MySQL and PHP
-
-@itemize bullet
-@item Error: "Maximum Execution Time Exeeded"
-This is a PHP limit; Go into the @file{php3.ini} file and set the maximum
-execution time up from 30 seconds to something higher, as needed.
-It is also not a bad idea to double the ram allowed per script to 16 instead of
-8 MB.
-@item Error: "Fatal error: Call to unsupported or undefined function mysql_connect() in .."
-This means that your PHP version isn't compiled with @strong{MySQL} support.
-You can either compile a dynamic @strong{MySQL} module and load it into PHP or
-recompile PHP with built-in @code{MySQL} support. This is described in
-detail in the PHP manual.
-@end itemize
-
-@node Cplusplus, Python, PHP, Clients
-@section @strong{MySQL} C++ APIs
-
-Two API's is available in the @strong{MySQL}
-@uref{http://www.mysql.com/Contrib/,Contrib directory}.
-
-@node Python, Tcl, Cplusplus, Clients
-@section @strong{MySQL} Python APIs
-
-The @strong{MySQL} @uref{http://www.mysql.com/Contrib/,Contrib directory}
-contains a Python
-interface written by Joseph Skinner.
-
-You can also use the Python interface to iODBC to access a
-@strong{MySQL} server.
-@uref{http://starship.skyport.net/~lemburg/,mxODBC}
-
-@node Tcl, Ruby, Python, Clients
-@section @strong{MySQL} Tcl APIs
-
-@uref{http://www.binevolve.com/~tdarugar/tcl-sql/, Tcl at binevolve}.
-The
-@uref{http://www.mysql.com/Contrib,Contrib directory} contains a Tcl
-interface that is based on msqltcl 1.50.
-
-@cindex Ruby
-@node Ruby, , Tcl, Clients
-@section @strong{MySQL} Ruby API
-
-°Ê²¼¤Î¥µ¥¤¥È¤Ë¡¢Ruby ¤Î MySQL ¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤¬¤¢¤ê¤Þ¤¹¡£
-
-@uref{http://www.tmtm.org/, www.tmtm.org ¤È¤ß¤¿¤Þ¤µ¤Ò¤í»á¤Î Web ¥Ú¡¼¥¸}
-
-@node Comparisons, MySQL internals, Clients, Top
-@chapter How @strong{MySQL} compares to other databases
-
-@menu
-* Compare mSQL:: @strong{MySQL} ¤È @code{mSQL} ¤È¤ÎÈæ³Ó
-* Compare PostgreSQL:: @strong{MySQL} ¤È @code{PostgreSQL} ¤È¤ÎÈæ³Ó
-@end menu
-
-@node Compare mSQL, Compare PostgreSQL, Comparisons, Comparisons
-@section @strong{MySQL} ¤È @code{mSQL} ¤È¤ÎÈæ³Ó
-
-¤³¤ÎÀá¤Ï¡¢@strong{MySQL} ³«È¯¼Ô¤Ë¤è¤Ã¤Æ½ñ¤«¤ì¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢¤½¤Î¤Ä¤â¤ê¤Ç
-Æɤó¤Ç²¼¤µ¤¤¡£¤·¤«¤·²æ¡¹¤¬ÃΤäƤ¤¤ë»ö¼Â¾å¤Î´Ö°ã¤¤¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-
-For a list of all supported limits, functions and types, see the
-@uref{http://www.mysql.com/crash-me-choose.htmy, @code{crash-me} web page}.
-
-@table @strong
-@item Performance
-
-¿¿¤Î®ÅÙÈæ³Ó¤Î¤¿¤á¤Ï¡¢Áý²Ã¤¹¤ë @strong{MySQL} ¥Ù¥ó¥Á¥Þ¡¼¥¯¥¹¥¤¡¼¥È¤ò¸«¤Æ²¼¤µ¤¤
-@xref{Benchmarks}.
-
-Because there is no thread creation overhead, a small parser, few features and
-simple security, @code{mSQL} should be quicker at:
-
-@itemize @bullet
-@item
-Tests that perform repeated connects and disconnects, running a very simple
-query during each connection.
-@item
-@code{INSERT} operations into very simple tables with few columns and keys.
-@item
-@code{CREATE TABLE} and @code{DROP TABLE}.
-@item
-@code{SELECT} on something that isn't an index. (A table scan is very
-easy.)
-@end itemize
-
-¤³¤ì¤é¤Î¥ª¥Ú¥ì¡¼¥·¥ç¥ó¤Ï¤È¤Æ¤âñ½ã¤Ê¤Î¤Ç¡¢³«»Ï¤Î¥ª¡¼¥Ð¡¼¥Ø¥Ã¥É¤¬¹â¤¯¤Ê¤ë
-»þ¤Ë¤½¤ì¤é¤òÎɤ¯¤¹¤ë¤Î¤ÏÆñ¤·¤¤¤Ç¤¹¡£Àܳ¤¬³ÎΩ¤µ¤ì¤¿¸å¤Ï @strong{MySQL}
-¤Ï¤È¤Æ¤âÎɤ¤À­Ç½¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-¾¤Î¤â¤Î¤Ç¤Ï @strong{MySQL} ¤Ï @code{mSQL} ¤ä¿¤¯¤Î¾¤Î SQL ¼ÂÁõ¤è¤ê¤È¤Æ
-¤â®¤¤¤Ç¤¹:
-
-@itemize @bullet
-@item
-Complex @code{SELECT} operations.
-@item
-Â礭¤Ê·ë²Ì¤Î¼è¤ê½Ð¤· (@strong{MySQL} ¤Ï¤è¤êÎɤ¯, ¤è¤ê®¤¯¤½¤·¤Æ¤è¤ê°ÂÁ´
-¤Ê¥×¥í¥È¥³¥ë¤ò»ý¤Á¤Þ¤¹)
-@item
-²ÄÊÑĹʸ»úÎó¤ò»ý¤Ä¥Æ¡¼¥Ö¥ë¡£@strong{MySQL} ¤Ï¤µ¤é¤Ë¸úΨŪ¤Ê½èÍý¤ò»ý¤Á¡¢ @code{VARCHAR}
-¾å¤Ë¥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ý¤Ä¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@item
-¿¤¯¤Î¥Õ¥£¡¼¥ë¥É¤ò»ý¤Ä¥Æ¡¼¥Ö¥ë¤Î½èÍý¡£
-@item
-Â礭¤Ê¥ì¥³¡¼¥ÉĹ¤Î¥Æ¡¼¥Ö¥ë¤Î½èÍý¡£
-@item
-@code{SELECT} with many expressions.
-@item
-@code{SELECT} on large tables.
-@item
-Ʊ»þ¤Ë¿¤¯¤ÎÀܳ¤ò½èÍý¤·¤Þ¤¹¡£@strong{MySQL} ¤Ï´°Á´¤Ê¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Ç¤¹¡£
-³ÆÀܳ¤Ï¤½¤ì¼«¿È¤Î¥¹¥ì¥Ã¥É¤ò»ý¤Á¤Þ¤¹¡£¤³¤ì¤Ï¡¢¤½¤ì¤é¤¬Â¾¤òÂÔ¤ÄɬÍפ¬¤Ê¤¤
-¤³¤È¤ò°ÕÌ£¤·¤Þ¤¹(Ʊ¤¸¥Æ¡¼¥Ö¥ë¤òÊѹ¹¤¹¤ë¥¯¥¨¥ê¤¬¼Â¹Ô¤µ¤ì¤ë¾ì¹ç¤ò½ü¤¯)¡£
-@code{mSQL} ¤Ç¤Ï¡¢Á´¤Æ¤Î¾¤ÎÀܳ¤Ï¡¢ºÇ½é¤Î¤â¤Î - ¥¯¥¨¥ê¤¬Ä¹¤¤¤«Ã»¤¤¤«¤Ë
-´Ø¤ï¤é¤º - ¤¬¼Â¹Ô¤µ¤ì¡¢½ª¤ï¤ë¤Þ¤ÇÂÔ¤ÄɬÍפ¬¤¢¤ê¤Þ¤¹¡£¤½¤Î¸å¼¡¤ÎÀܳ¤¬Í¿
-¤¨¤é¤ì¡¢Â¾¤ÎÁ´¤Æ¤ÏºÆ¤ÓÂÔ¤Á¤Þ¤¹¡£
-@item
-Joins.
-@code{mSQL} can become pathologically slow if you change the order of tables
-in a @code{SELECT}. In the benchmark suite, a time more than 15000 times
-slower than @strong{MySQL} was seen. This is due to @code{mSQL}'s lack of a
-join optimizer to order tables in the optimal order. However, if you put the
-tables in exactly the right order in @code{mSQL}2 and the @code{WHERE} is
-simple and uses index columns, the join will be relatively fast!
-@xref{Benchmarks}.
-@item
-@code{ORDER BY} and @code{GROUP BY}.
-@item
-@code{DISTINCT}.
-@item
-@code{TEXT} ¤Þ¤¿¤Ï @code{BLOB} ¥Õ¥£¡¼¥ë¥É¤Î»ÈÍÑ¡£
-@end itemize
-
-@item SQL Features
-
-@itemize @bullet
-@item @code{GROUP BY} and @code{HAVING}.
-@code{mSQL} does not support @code{GROUP BY} at all.
-@strong{MySQL} ¤Ï @code{HAVING} ¤òȼ¤¦´°Á´¤Ê @code{GROUP BY} ¤ä¡¢¼¡¤Î´Ø
-¿ô @code{count()}, @code{avg()}, @code{min()}, @code{max()},
-@code{sum()} ¤½¤·¤Æ @code{std()} ¤ò¥µ¥Ý¡¼¥È¤·¤Þ¤¹¡£@code{min()} ¤È
-@code{max()} ¤Ïʸ»úÎó¤Î°ú¿ô¤â¼è¤ì¤Þ¤¹¡£@code{count(*)} ¤Ï¡¢¥¯¥¨¥êÆ⤬¤³
-¤ì¤À¤±¤Î¾ì¹ç¤Ë¤È¤Æ¤â®¤¯ÊÖ¤µ¤ì¤ë¤è¤¦¤ËºÇŬ²½¤µ¤ì¤Þ¤¹¡£@code{mSQL} ¤Ï
-@code{GROUP BY} ¤òÁ´¤¯¥µ¥Ý¡¼¥È¤·¤Þ¤»¤ó¡£
-
-@item @code{INSERT} and @code{UPDATE} with calculations.
-@strong{MySQL} can do calculations in an @code{INSERT} or @code{UPDATE}.
-For example:
-@example
-mysql> UPDATE SET x=x*10+y WHERE x<20;
-@end example
-
-@item Aliasing.
-@strong{MySQL} ¤Ï¥Õ¥£¡¼¥ë¥É¤Î¥¨¥¤¥ê¥¢¥¹Ì¾¤ò»ý¤Á¤Þ¤¹¡£
-
-@item Qualifying column names.
-In @strong{MySQL}, if a column name is unique among the tables used in a
-query, you do not have to use the full qualifier.
-
-@item @code{SELECT} with functions.
-@strong{MySQL} has many functions (too many to list here; see @ref{Functions}).
-
-@end itemize
-
-@item ÎΰèǽÎÏ
-¤³¤ì¤Ï¡¢¥Æ¡¼¥Ö¥ë¤ò¤É¤Î¤è¤¦¤Ë¾®¤µ¤¯¤Ç¤­¤ë¤«¤Ç¤¹¡£
-
-@strong{MySQL} ¤Ï¤È¤Æ¤âÀºÌ©¤Ê·¿¤ò»ý¤Á¤Þ¤¹¡£¤È¤Æ¤â¾®¤µ¤¤Îΰè¤ò»ÈÍѤ¹¤ë¥Æ¡¼¥Ö¥ë¤òºîÀ®¤Ç¤­
-¤ë¤¿¤á¤Ç¤¹¡£@strong{MySQL} ¥Ç¡¼¥¿·¿¤ÎÍ­ÍѤÊÎã¤Ï¡¢3¥Ð¥¤¥ÈŤΠ@code{MEDIUMINT}
-¤Ç¤¹¡£10,000,000 ¥ì¥³¡¼¥É¤ò»ý¤Ä¾ì¹ç¡¢1¥ì¥³¡¼¥É¤¢¤¿¤ê1¥Ð¥¤¥È¤ÎÀáÌó¤Ç¤â¤È
-¤Æ¤â½ÅÍפǤ¹¡£
-
-@code{mSQL2} ¤Ï4¤Ä¤Î·¿(char,text,int,real)¤·¤«¤Ê¤¤¤Î¤Ç¡¢¾®¤µ¤Ê¥Æ¡¼¥Ö¥ë¤ò
-ÆÀ¤ë¤Î¤ÏÆñ¤·¤¤¤Ç¤¹¡£
-
-@item °ÂÄêÀ­
-¤³¤ì¤òµÒ´ÑŪ¤ËȽÃǤ¹¤ë¤Î¤ÏÆñ¤·¤¤¤Ç¤¹¡£@strong{MySQL} ¤Î°ÂÄêÀ­¤Ë¤Ä¤¤¤Æ¤Ï
-@ref{Stability} ¤ò»²¾È¤·¤Æ¤¯¤À¤µ¤¤¡£
-
-²æ¡¹¤Ë¤Ï @code{mSQL} °ÂÄêÀ­¤Î·Ð¸³¤¬¤¢¤ê¤Þ¤»¤ó¡£¤½¤Î¤¿¤á¡¢²æ¡¹¤Ï¤³¤ì¤Ë¤Ä
-¤¤¤Æ¤Ï²¿¤â¸À¤¨¤Þ¤»¤ó¡£
-
-@item ²Á³Ê
-¤â¤¦°ì¤Ä¤Î½ÅÍפÊÌäÂê¤Ï¤â¤Á¤í¤ó¥é¥¤¥»¥ó¥¹¤Ç¤¹¡£@strong{MySQL} ¤Ï
-@code{mSQL} ¤è¤ê¤â½ÀÆð¤Ê¥é¥¤¥»¥ó¥¹¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£¤½¤·¤Æ @code{mSQL} ¤è
-¤ê¤â¤è¤ê°Â¤¤¤Ç¤¹¡£¾¯¤Ê¤¯¤È¤â¡¢¤¢¤Ê¤¿¤¬»ÈÍѤòÁªÂò¤·¤¿À½ÉÊÁ´¤Æ¤Ë¡¢¥é¥¤¥»¥ó
-¥¹¤Þ¤¿¤Ï email ¥µ¥Ý¡¼¥È¤Ø¤Î»Ùʧ¤¤¤ò¹Íθ¤¹¤ë¤³¤È¤ò³Ð¤¨¤Æ¤¤¤Æ²¼¤µ¤¤¡£
-@strong{MySQL} ¤ò´Þ¤á¤¿À½ÉʤòÇä¤ë¾ì¹ç¡¢¤â¤Á¤í¤ó¤³¤Î¥é¥¤¥»¥ó¥¹¤Î³ÍÆÀ¤¬Í×µá
-¤µ¤ì¤Þ¤¹¡£
-
-
-@item Perl interfaces
-@strong{MySQL} ¤Ï´ðËÜŪ¤Ë @code{mSQL} ¤ÈƱ¤¸ perl ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤È¡¢¤¤¤¯¤Ä¤«¤ÎÄÉ
-²Ãµ¡Ç½¤ò»ý¤Á¤Þ¤¹¡£
-
-@item JDBC (Java)
-@strong{MySQL} currently has 4 JDBC drivers:
-@itemize @bullet
-@item
-The gwe driver: A Java interface by GWE technologies (not supported anymore).
-@item
-The jms driver: An improved gwe driver by Xiaokun Kelvin ZHU
-@email{X.Zhu@@brad.ac.uk}.
-@item
-The twz driver: A type 4 JDBC driver by Terrence W. Zellers
-@email{zellert@@voicenet.com}. This is commercial but is free for private
-and educational use.
-@item
-The mm driver: A type 4 JDBC driver by Mark Matthews
-@email{mmatthew@@ecn.purdue.edu}. This is released under the GPL.
-@end itemize
-
-The recommended drivers are the twz or mm driver. Both are reported to work
-excellently.
-
-We know that @code{mSQL} has a JDBC driver, but we have too little experience
-with it to compare.
-
-@item ³«È¯¤Î®ÅÙ
-@strong{MySQL} ¤Ï¤È¤Æ¤â¾®¤µ¤¤³«È¯¥Á¡¼¥à¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¤¬¡¢²æ¡¹¤Ï C ¤È C++ ¤Î¥³¡¼¥Ç¥£
-¥ó¥°¤ò¤È¤Æ¤â®¤¯¹Ô¤Ê¤¤¤Þ¤¹¡£¥¹¥ì¥Ã¥É¡¢´Ø¿ô¡¢ @code{GROUP BY} ¤Ê¤É¤Ï¤Þ¤À
-@code{mSQL} ¤Ë¤Ï¼ÂÁõ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¤Î¤Ç¡¢it has a lot of chatching up to
-do. ¤³¤Î¾å¤Ç¤¤¤¯¤Ä¤«¤Î¸«Ä̤·¤òÆÀ¤ë¤¿¤á¤Ë¡¢µîǯ¤Î @code{mSQL} @file{HISTORY} ¥Õ¥¡
-¥¤¥ë¤ò¸«¤Æ¡¢@strong{MySQL} Reference Manual News Àá¤ÈÈæ³Ó¤Ç¤­¤Þ¤¹(@pxref{News})¡£Â®¤¯³«È¯¤µ¤ì¤¿Â¿¤¯¤Î¤â¤Î
-¤¬¡¢¤«¤Ê¤êÌÀÇò¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-@item ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¥×¥í¥°¥é¥à
-@code{mSQL} ¤È @strong{MySQL} ¤Ï¿¤¯¤Î¶½Ì£¿¼¤¤¥µ¡¼¥É¥Ñ¡¼¥Æ¥£¥Ä¡¼¥ë¤ò»ý¤Ã
-¤Æ¤¤¤Þ¤¹¡£¾å°Ì¤Ø¤Î°Ü¹Ô (@code{mSQL} -> @strong{MySQL}) ¤Ï¤È¤Æ¤â´Êñ¤Ç¤¹¡£
-@strong{MySQL} ¤Ï¡¢¤Û¤È¤ó¤ÉÁ´¤Æ¤Î¶½Ì£¿¼¤¤ @code{mSQL} ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò
-»ý¤Ã¤Æ¤¤¤Þ¤¹¡£
-
-@strong{MySQL} ¤Ë¤Ï¡¢´Êñ¤Ê @code{msql2mysql} ¥×¥í¥°¥é¥à¤¬ÍÑ°Õ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-¤³¤ì¤Ï¡¢@code{mSQL} ¤È @strong{MySQL} ¤Î C API ´Ø¿ô¤Î¥¹¥Ú¥ë¤Î°ã¤¤¤ò½¤Àµ¤¹¤ë¥×¥í¥°¥é¥à¤Ç¤¹¡£
-For example, it changes instances of @code{msqlConnect()} to
-@code{mysql_connect()}.
-@code{mSQL} ¤«¤é MySQL ¤Ø¤ÎÊÑ´¹¤ÏÄ̾¿ôʬ»ÈÍѤ¹¤ë¤À¤±¤Ç¤¹¡£
-@end table
-
-@menu
-* Using mSQL tools:: How to convert @code{mSQL} tools for @strong{MySQL}
-* Protocol differences:: How @code{mSQL} and @strong{MySQL} client/server communications protocols differ
-* Syntax differences:: How @code{mSQL} 2.0 SQL syntax differs from @strong{MySQL}
-@end menu
-
-@node Using mSQL tools, Protocol differences, Compare mSQL, Compare mSQL
-@subsection How to convert @code{mSQL} tools for MySQL
-
-According to our experience, it would just take a few hours to convert tools
-such as @code{msql-tcl} and @code{msqljava} that use the
-@code{mSQL} C API so that they work with the @strong{MySQL} C API.
-
-The conversion procedure is:
-
-@enumerate
-@item
-¥·¥§¥ë¥¹¥¯¥ê¥×¥È @code{msql2mysql} ¤ò¥½¡¼¥¹¤Ë¼Â¹Ô¤·¤Þ¤¹¡£¥Ð¥¤¥Ê¥ê¥×¥í¥°¥é¥à
-@code{replace} ¤¬É¬ÍפǤ¹¡£¤³¤ì¤Ï @strong{MySQL} ¤ÇÇÛÉÛ¤µ¤ì¤Þ¤¹¡£
-@item
-Compile.
-@item
-Á´¤Æ¤Î¥³¥ó¥Ñ¥¤¥é¥¨¥é¡¼¤ò½¤Éü¤·¤Þ¤¹.
-@end enumerate
-
-@strong{MySQL} ¤È @code{mSQL} ´Ö¤Î C API ¤Î°ã¤¤:
-@itemize @bullet
-@item
-@strong{MySQL} ¤Ï @code{MYSQL} ¹½Â¤ÂΤòÀܳ·¿¤È¤·¤Æ»ÈÍѤ·¤Þ¤¹ (@code{mSQL} ¤Ï
-@code{int} ¤ò»ÈÍѤ·¤Þ¤¹)¡£
-@item
-@code{mysql_connect()} ¤Ï @code{MYSQL} ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤ò¥Ñ¥é¥á¡¼¥¿¤È¤·¤Æ»ÈÍѤ·¤Þ¤¹¡£¤½
-¤ì¤ò¥°¥í¡¼¥Ð¥ë¤ËÄêµÁ¤·¤¿¤ê¡¢¤½¤Î³ÍÆÀ¤Ë @code{malloc()} ¤ò»ÈÍѤ¹¤ë¤Î¤Ï´Êñ¤Ç¤¹¡£
-@code{mysql_connect()} also takes two parameters for specifying the user and
-password. You may set these to @code{NULL, NULL} for default use.
-@item
-@code{mysql_error()} ¤Ï @code{MYSQL} ¹½Â¤ÂΤò¥Ñ¥é¥á¡¼¥¿¤È¤·¤Æ»ÈÍѤ·¤Þ¤¹¡£¸Å¤¤¥³¡¼¥É¤ò°Ü
-¹Ô¤¹¤ë¾ì¹ç¡¢¤¢¤Ê¤¿¤Î¸Å¤¤ @code{msql_error()} ¥³¡¼¥É¤Ø¥Ñ¥é¥á¡¼¥¿¤òÄɲ䷤Ƥ¯¤À¤µ¤¤¡£
-@item
-@strong{MySQL} returns an error number and a text error message for all
-errors. @code{mSQL} returns only a text error message.
-@item
-Some incompatibilities exist as a result of @strong{MySQL} supporting
-multiple connections to the server from the same process.
-@end itemize
-
-@node Protocol differences, Syntax differences, Using mSQL tools, Compare mSQL
-@subsection How @code{mSQL} and MySQL client/server communications protocols differ
-
-There are enough differences that it is impossible (or at least not easy)
-to support both.
-
-The most significant ways in which the @strong{MySQL} protocol differs
-from the @code{mSQL} protocol are listed below:
-
-@itemize @bullet
-@item
-¥á¥Ã¥»¡¼¥¸¥Ð¥Ã¥Õ¥¡¤Ï¿¤¯¤Î·ë²Ì¹Ô¤ò´Þ¤á¤Þ¤¹¡£
-@item
-¼ÁÌä¤Þ¤¿¤Ï²óÅú¤¬¸½ºß¤Î¥Ð¥Ã¥Õ¥¡¤è¤ê¤âÂ礭¤¤¾ì¹ç¡¢¥µ¡¼¥Ð¤È¥¯¥é¥¤¥¢¥ó¥È¤Î¥³
-¥ó¥Õ¥£¥°²ÄǽÀ©¸Â¤Þ¤Ç¡¢¥á¥Ã¥»¡¼¥¸¥Ð¥Ã¥Õ¥¡¤ÏưŪ¤ËÁýÂ礵¤ì¤Þ¤¹¡£
-@item
-Á´¤Æ¤Î¥Ñ¥±¥Ã¥È¤Ï¡¢¥Ñ¥±¥Ã¥È¤Î½ÅÊ£¤ä¸«¼º¤¤¤ò¸«¤Ä¤±½Ð¤¹¤¿¤á¤Ë¡¢ÈÖ¹æ¤Å¤±¤µ
-¤ì¤Æ¤¤¤Þ¤¹¡£
-@item
-Á´¤Æ¤Î¹àÌÜ¤Ï ASCII ¤ÇÁ÷¤é¤ì¡¢¹àÌܤιԤÈŤµ¤Ï¥Ñ¥Ã¥¯¤µ¤ì¤¿¥Ð¥¤¥Ê¥ê¥³¡¼¥Ç¥£¥ó
-¥°(1,2 ¤Þ¤¿¤Ï 3 ¥Ð¥¤¥È)¤ÇÁ÷¤é¤ì¤Þ¤¹¡£
-@item
-@strong{MySQL} ¤Ï¥Ð¥Ã¥Õ¥¡¤µ¤ì¤Ê¤¤·ë²Ì¤ÇÆɤ߹þ¤ß²Äǽ¤Ç¤¹(¥¯¥é¥¤¥¢¥ó¥ÈÆâ¤Ë´°Á´¤Ê¥»¥Ã
-¥È¤ò³ÊǼ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤»¤ó)¡£
-@item
-°ì¤Ä¤Î½ñ¤­¹þ¤ß/Æɤ߹þ¤ß¤¬ 30 Éðʾ夫¤«¤ë¤È¡¢¥µ¡¼¥Ð¤ÏÀܳ¤ò¥¯¥í¡¼¥º¤·¤Þ
-¤¹¡£
-@item
-Àܳ¤Ç 8 »þ´Ö²¿¤âµ¯¤­¤Ê¤¤¤È¡¢¥µ¡¼¥Ð¤ÏÀܳ¤ò¥¯¥í¡¼¥º¤·¤Þ¤¹¡£
-@end itemize
-
-@node Syntax differences, , Protocol differences, Compare mSQL
-@subsection @strong{MySQL} & @code{mSQL} 2.0 ´Ö¤Î SQL ¹½Ê¸¤Î°ã¤¤¤Ï¡©
-
-@noindent
-@strong{Column types}
-
-@table @code
-@item @strong{MySQL}
-¾¤Ë²Ã¤¨¼¡¤Î¹àÌÜ¥ª¥×¥·¥ç¥ó·¿¤ò»ý¤Á¤Þ¤¹ (among others; see
-@pxref{CREATE TABLE, , @code{CREATE TABLE}}):
-@itemize @bullet
-@item
-@code{ENUM} type for one of a set of strings.
-@item
-@code{SET} type for many of a set of strings.
-@item
-@code{BIGINT} type for 64-bit integers.
-@end itemize
-@item
-@strong{MySQL} also supports
-the following additional type attributes:
-@itemize @bullet
-@item
-À°¿ô¹àÌܤؤΠ@code{UNSIGNED} ¥ª¥×¥·¥ç¥ó
-@item
-À°¿ô¹àÌܤؤΠ@code{ZEROFILL} ¥ª¥×¥·¥ç¥ó
-@item
-@code{PRIMARY KEY} ¤â´Þ¤ßÁ´¤Æ¤ÎÀ°¿ô¹àÌܤؤΠ@code{AUTO_INCREMENT} ¥ª¥×¥·¥ç¥ó
-@xref{mysql_insert_id, , @code{mysql_insert_id()}}.
-@item
-Á´¤Æ¤Î¹àÌܤؤΠ@code{DEFAULT} ÃÍ
-@end itemize
-@item mSQL2
-@code{mSQL} column types correspond to the @strong{MySQL} types shown below:
-@multitable @columnfractions .15 .85
-@item @code{mSQL} @strong{type} @tab @strong{Corresponding @strong{MySQL} type}
-@item @code{CHAR(len)} @tab @code{CHAR(len)}
-@item @code{TEXT(len)} @tab @code{TEXT(len)}. @code{len} is the maximal length.
-And @code{LIKE} works.
-@item @code{INT} @tab @code{INT}. With many more options!
-@item @code{REAL} @tab @code{REAL}. Or @code{FLOAT}. Both 4- and 8-byte versions are available.
-@item @code{UINT} @tab @code{INT UNSIGNED}
-@item @code{DATE} @tab @code{DATE}. Uses ANSI SQL format rather than @code{mSQL}'s own format.
-@item @code{TIME} @tab @code{TIME}
-@item @code{MONEY} @tab @code{DECIMAL(12,2)}. A fixed-point value with two decimals.
-@end multitable
-@end table
-
-@noindent
-@strong{Index creation}
-
-@table @code
-@item @strong{MySQL}
-Indexes may be specified at table creation time with the @code{CREATE TABLE}
-statement.
-@item mSQL
-Indexes must be created after the table has been created, with separate
-@code{CREATE INDEX} statements.
-@end table
-
-@noindent
-@strong{To insert a unique identifier into a table}
-
-@table @code
-@item @strong{MySQL}
-Use @code{AUTO_INCREMENT} as a column type
-specifier.
-@xref{mysql_insert_id, , @code{mysql_insert_id()}}.
-@item mSQL
-Create a @code{SEQUENCE} on a table and select the @code{_seq} column.
-@end table
-
-@noindent
-@strong{To obtain a unique identifier for a row}
-
-@table @code
-@item @strong{MySQL}
-Add a @code{PRIMARY KEY} or @code{UNIQUE} key to the table and use this.
-New in 3.23.11: If the @code{PRIMARY} or @code{UNIQUE} key consists of only one
-column and this is of type integer, one can also refer to it as
-@code{_rowid}.
-@item mSQL
-Use the @code{_rowid} column. Observe that @code{_rowid} may change over time
-depending on many factors.
-@end table
-
-@noindent
-@strong{To get the time a column was last modified}
-
-@table @code
-@item @strong{MySQL}
-Add a @code{TIMESTAMP} column to the table. This column is automatically set
-to the current date and time for @code{INSERT} or @code{UPDATE} statements if
-you don't give the column a value or if you give it a @code{NULL} value.
-
-@item mSQL
-Use the @code{_timestamp} column.
-@end table
-
-@noindent
-@strong{@code{NULL} value comparisons}
-
-@table @code
-@item @strong{MySQL}
-@strong{MySQL} follows
-ANSI SQL and a comparison with @code{NULL} is always @code{NULL}.
-@item mSQL
-In @code{mSQL}, @code{NULL = NULL} is TRUE. You
-must change @code{=NULL} to @code{IS NULL} and @code{<>NULL} to
-@code{IS NOT NULL} when porting old code from @code{mSQL} to @strong{MySQL}.
-@end table
-
-@noindent
-@strong{String comparisons}
-
-@table @code
-@item @strong{MySQL}
-Normally, string comparisons are performed in case-independent fashion with
-the sort order determined by the current character set (ISO-8859-1 Latin1 by
-default). If you don't like this, declare your columns with the
-@code{BINARY} attribute, which causes comparisons to be done according to the
-ASCII order used on the @strong{MySQL} server host.
-@item mSQL
-All string comparisons are performed in case-sensitive fashion with
-sorting in ASCII order.
-@end table
-
-@noindent
-@strong{Case-insensitive searching}
-
-@table @code
-@item @strong{MySQL}
-@code{LIKE} is a case-insensitive or case-sensitive operator, depending on
-the columns involved. If possible, @strong{MySQL} uses indexes if the
-@code{LIKE} argument doesn't start with a wildcard character.
-@item mSQL
-Use @code{CLIKE}.
-@end table
-
-@noindent
-@strong{Handling of trailing spaces}
-
-@table @code
-@item @strong{MySQL}
-Strips all spaces at the end of @code{CHAR} and @code{VARCHAR}
-columns. Use a @code{TEXT} column if this behavior is not desired.
-@item mSQL
-Retains trailing space.
-@end table
-
-@noindent
-@strong{@code{WHERE} clauses}
-
-@table @code
-@item @strong{MySQL}
-@strong{MySQL} correctly prioritizes everything (@code{AND} is evaluated
-before @code{OR}). To get @code{mSQL} behavior in @strong{MySQL}, use
-parentheses (as shown below).
-@item mSQL
-Evaluates everything from left to right. This means that some logical
-calculations with more than three arguments cannot be expressed in any
-way. It also means you must change some queries when you upgrade to
-@strong{MySQL}. You do this easily by adding parentheses. Suppose you
-have the following @code{mSQL} query:
-@example
-mysql> SELECT * FROM table WHERE a=1 AND b=2 OR a=3 AND b=4;
-@end example
-To make @strong{MySQL} evaluate this the way that @code{mSQL} would,
-you must add parentheses:
-@example
-mysql> SELECT * FROM table WHERE (a=1 AND (b=2 OR (a=3 AND (b=4))));
-@end example
-@end table
-
-@noindent
-@strong{Access control}
-
-@table @code
-@item @strong{MySQL}
-Has tables to store grant (permission) options per user, host and
-database. @xref{Privileges}.
-@item mSQL
-Has a file @file{mSQL.acl} in which you can grant read/write privileges for
-users.
-@item
-@end table
-
-@node Compare PostgreSQL, , Compare mSQL, Comparisons
-@section How @strong{MySQL} compares to PostgreSQL
-
-We would first like to note that @code{PostgreSQL} and @strong{MySQL}
-are both widely used products but their design goals are completely
-different. This means that for some applications @strong{MySQL} is more
-suitable and for others @code{PostgreSQL} is more suitable. When
-choosing which database to use you should first check if the databases
-feature set is good enough to satisfy your application. If you need
-speed then @strong{MySQL} is probably your best choice, if you need some
-of the extra features that @code{PostgreSQL} can offer you should use
-@code{PostgreSQL}.
-
-@code{PostgreSQL} ¤Ï¤µ¤é¤Ë¿Ê¤ó¤Àµ¡Ç½¤ò¤¤¤¯¤Ä¤«»ý¤Ã¤Æ¤¤¤Þ¤¹¡£¥æ¡¼¥¶ÄêµÁ·¿¡¢¥È¥ê
-¥¬¡¢¥ë¡¼¥ë¡¢¥È¥é¥ó¥¶¥¯¥·¥ç¥ó¤Î¤è¤¦¤Ê¡£
-(currently it's
-has about same symantic as @code{MySQL}'s transactions in that the
-transaction is not 100 % atomic)
-¤·¤«¤· ANSI SQL ¤È ODBC ¤Îɸ½à·¿¤È
-µ¡Ç½¤Î¿¤¯¤¬·ç¤±¤Æ¤¤¤Þ¤¹¡£¥µ¥Ý¡¼¥È/̤¥µ¥Ý¡¼¥È¤Î·¿/´Ø¿ô¤Î´°Á´¤Ê°ìÍ÷¤Ï
-@uref{http://www.mysql.com/crash-me-choose.htmy, @code{crash-me} web page} ¤ò¸«¤Æ¤¯¤À¤µ¤¤¡£
-
-Ä̾@code{PostgreSQL} ¤Ï @strong{MySQL} ¤è¤ê¤È¤Æ¤âÃÙ¤¤¤Ç¤¹¡£
-@xref{Benchmarks}. This is due largely to they have only
-transaction safe tables and that their transactions system is not as
-sophisticated as Berkeley DB's. In @strong{MySQL} you can decide per
-table if you want the table to be fast or take the speed penalty of
-making it transaction safe.
-
-The most important things that @code{PostgreSQL} supports that @strong{MySQL}
-don't yet support:
-
-@table @code
-@item Sub select
-@item Foregin keys
-@item Stored procedures
-@item An extendable type system.
-@item A way to extend the SQL to handle new key types (like R-trees)
-@end table
-
-@strong{MySQL} on the other hand supports a many ANSI SQL constructs
-that @code{PostgreSQL} doesn't support; Most of these can be found at the
-@uref{http://www.mysql.com/crash-me-choose.htmy, @code{crash-me} web page}.
-
-If you really need the rich type system @code{PostgreSQL} offers and you
-can afford the speed penalty of having to do everything transaction
-safe, you should take a look at @code{PostgreSQL}.
-@node MySQL internals, Environment variables, Comparisons, Top
-@chapter MySQL internals
-
-This chapter describes a lot of things that you need to know when
-working on the @strong{MySQL} code.
-
-@menu
-* MySQL threads::
-@end menu
-
-@node MySQL threads, , MySQL internals, MySQL internals
-@section MySQL threads
-
-@strong{MySQL} ¥µ¡¼¥Ð¡¼¤Ï°Ê²¼¤Î¥¹¥ì¥Ã¥É¤òºîÀ®¤·¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-TCP/IP Àܳ¥Ï¥ó¥É¥ë¤Ï¡¢Á´¤Æ¤ÎÀܳÍ×µá¤ò°·¤¤¡¢¤µ¤é¤Ë¡¢
-ǧ¾Ú¤ò¹Ô¤¦¤¿¤á¤Î¥¹¥ì¥Ã¥ÉSQL¥¯¥¨¥ê¤ò½èÍý¤¹¤ë¥¹¥ì¥Ã¥É¤òÀ¸À®¤·¤Þ¤¹
-@item
-NT¤Ç¤Ï¡¢¥Í¡¼¥à¥É¡¦¥Ñ¥¤¥×¡¦¥Ï¥ó¥É¥é¡¼¡¦¥¹¥ì¥Ã¥É¤¬¤¢¤ê¤Þ¤¹¡£
-¤³¤ì¤Ï¥Í¡¼¥à¥É¡¦¥Ñ¥¤¥×¤ÎÀܳÍ×µá¤ËÂФ·¡¢TCP/IPÀܳ¥¹¥ì¥Ã¥É¤ÈƱÍͤËÆ°¤­¤Þ¤¹¡£
-@item
-¥·¥°¥Ê¥ë¥¹¥ì¥Ã¥É¤Ï¡¢Á´¤Æ¤Î¥·¥°¥Ê¥ë¤ò°·¤¤¤Þ¤¹¡£
-This thread also normally handles
-alarms and calls @code{process_alarm()} to force timeouts on connections
-that have been idle too long.
-@item
-If compiled with @code{-DUSE_ALARM_THREAD}, a dedicated thread that
-handles alarms is created. This is only used on some systems where
-there are some problems with @code{sigwait()} or if one wants to use the
-@code{thr_alarm()} code in ones application without a dedicated signal
-handling thread.
-@item
-¤â¤· @code{--flush-time} ¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ·¤¿¤Ê¤é¡¢
-Á´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤ò°ìÄê´ü´Ö¤Ç¥Õ¥é¥Ã¥·¥å¤¹¤ë¤¿¤á¤À¤±¤Î¥¹¥ì¥Ã¥É¤òºî¤ê¤Þ¤¹¡£
-@item
-Every connection has its own thread.
-@item
-Every different table on which one uses @code{INSERT DELAYED} gets its
-own thread.
-@item
-If you use @code{--master-host} , slave replication thread will be started to read and apply
-updates from the master.
-@end itemize
-
-@code{mysqladmin processlist} only shows the connection and @code{INSERT
-DELAYED} threads.
-
-
-@page
-@node Environment variables, Users, MySQL internals, Top
-@appendix Environment variables
-
-Here follows a list of all environment variables that are used directly or
-indirectly by @strong{MySQL}. Most of these can also be found at other
-places in this manual.
-
-Note that any options on the command line will take precedence over
-values specified in configuration files and environment variables, and
-values in configuration files take precedence over values in environment
-variables.
-
-In many cases its preferable to use a configure file instead of environment
-variables to modify the behaviour of @strong{MySQL}. @xref{Option files}.
-
-@tindex CCX environment variable
-@tindex Environment variable, CCX
-@tindex CC environment variable
-@tindex Environment variable, CC
-@tindex CFLAGS environment variable
-@tindex Environment variable, CFLAGS
-@tindex CXXFLAGS environment variable
-@tindex Environment variable, CXXFLAGS
-@tindex DBI_USER environment variable
-@tindex Environment variable, DBI_USER
-@tindex DBI_TRACE environment variable
-@tindex Environment variable, DBI_TRACE
-@tindex HOME environment variable
-@tindex Environment variable, HOME
-@tindex LD_RUN_PATH environment variable
-@tindex Environment variable, LD_RUN_PATH
-@tindex MYSQL_DEBUG environment variable
-@tindex Environment variable, MYSQL_DEBUG
-@tindex MYSQL_HISTFILE environment variable
-@tindex Environment variable, MYSQL_HISTFILE
-@tindex MYSQL_HOST environment variable
-@tindex Environment variable, MYSQL_HOST
-@tindex MYSQL_PWD environment variable
-@tindex Environment variable, MYSQL_PWD
-@tindex MYSQL_TCP_PORT environment variable
-@tindex Environment variable, MYSQL_TCP_PORT
-@tindex MYSQL_UNIX_PORT environment variable
-@tindex Environment variable, MYSQL_UNIX_PORT
-@tindex PATH environment variable
-@tindex Environment variable, PATH
-@tindex TMPDIR environment variable
-@tindex Environment variable, TMPDIR
-@tindex TZ environment variable
-@tindex Environment variable, TZ
-@tindex UMASK_DIR environment variable
-@tindex Environment variable, UMASK_DIR
-@tindex UMASK environment variable
-@tindex Environment variable, UMASK
-@tindex USER environment variable
-@tindex Environment variable, USER
-
-@multitable @columnfractions .2 .8
-@item @code{CCX} @tab Set this to your C++ compiler when running configure.
-@item @code{CC} @tab Set this to your C compiler when running configure.
-@item @code{CFLAGS} @tab Flags for your C compiler when running configure.
-@item @code{CXXFLAGS} @tab Flags for your C++ compiler when running configure.
-@item @code{DBI_USER} @tab The default user name for Perl DBI.
-@item @code{DBI_TRACE} @tab Used when tracing Perl DBI.
-@item @code{HOME} @tab The default path for the @code{mysql} history file is @file{$HOME/.mysql_history}.
-@item @code{LD_RUN_PATH} @tab Used to specify where your @code{libmysqlclient.so} is.
-@item @code{MYSQL_DEBUG} @tab Debug-trace options when debugging
-@item @code{MYSQL_HISTFILE} @tab The path to the @code{mysql} history file.
-@item @code{MYSQL_HOST} @tab Default host name used by the @code{mysql} command line prompt.
-@item @code{MYSQL_PWD} @tab The default password when connecting to mysqld. Note that use of this is insecure!
-@item @code{MYSQL_TCP_PORT} @tab The default TCP/IP port.
-@item @code{MYSQL_UNIX_PORT} @tab The default socket; used for connections to @code{localhost}.
-@item @code{PATH} @tab Used by the shell to finds the @strong{MySQL} programs.
-@item @code{TMPDIR} @tab The directory where temporary tables/files are created.
-@item @code{TZ} @tab This should be set to your local timezone. @xref{Timezone problems}.
-@item @code{UMASK_DIR} @tab The user-directory creation mask when creating directories. Note that this is anded with @code{UMSK} !
-@item @code{UMASK} @tab The user-file creation mask when creating files.
-@item @code{USER} @tab The default user on Windows to use when connection to @code{mysqld}.
-@end multitable
-
-@page
-@node Users, Contrib, Environment variables, Top
-@appendix Some MySQL users
-
-@appendixsec General news sites
-
-@itemize @bullet
-
-@item @uref{http://www.yahoo.com/, Yahoo!}
-
-@item @uref{http://slashdot.org/, Slashdot: A pro-Linux/tech news and comment/discussion site}
-
-@item @uref{http://www.linux.com/, All about Linux}
-
-@item @uref{http://www.linuxtoday.com/, Linuxtoday}
-
-@item @uref{http://www.32bitsonline.com/, 32Bits Online: because there's
-more than one way to compute}
-
-@item @uref{http://www.freshmeat.net/, Freshmeat: News about new versions of computer related stuff}
-
-@end itemize
-
-@appendixsec Some Web search engines
-
-@itemize @bullet
-
-@item @uref{http://www.aaa.com.au, AAA Matilda Web Search}
-
-@item @uref{http://www.whatsnu.com/, What's New}
-
-@item @uref{http://www.aladin.de/, Aladin}
-
-@item @uref{http://www.columbus-finder.de/, Columbus Finder}
-
-@item @uref{http://www.spider.de/, Spider}
-
-@item @uref{http://www.blitzsuche.de/, Blitzsuche}
-
-@item @uref{http://www.indoseek.co.id, Indoseek Indonesia}
-
-@item @uref{http://www.yaboo.dk/, Yaboo - Yet Another BOOkmarker}
-
-@item @uref{http://www.yahoosuck.com, Yahoosuck}
-
-@item @uref{http://www.ozsearch.com.au, OzSearch Internet Guide}
-
-@item @uref{http://www.splatsearch.com/, Splat! Search}
-
-@end itemize
-
-@appendixsec Some Information search engines concentrated on some area
-
-@itemize @bullet
-
-@item @uref{http://www.tucows.com/, TuCows Network; Free Software archive}
-
-@item @uref{http://www.jobvertise.com,Jobvertise: Post and search for jobs}
-
-@item @uref{http://www.musicdatabase.com, The Music Database}
-
-@item @uref{http://www.soccersearch.com, Fotball (Soccer) search page}
-
-@item @uref{http://www.headrush.net/takedown, TAKEDOWN - wrestling}
-
-@item @uref{http://www.lyrics.net, The International Lyrics Network}
-
-@item @uref{http://TheMatrix.com/~matrix/band_search.phtml, Musicians looking for other musicians (Free Service)}
-
-@item @uref{http://www.addall.com/AddBooks/Stores.html,AddALL books searching and price comparison}
-
-@item @uref{http://www.herbaria.harvard.edu/Data/Gray/gray.html,Harvard's Gray Herbarium Index of Plant Names}
-
-@item @uref{http://www.game-developer.com/,The Game Development Search Engine}
-
-@item @uref{http://www.i-run.com/html/cookbook.html,My-Recipe.com; Cookbook at i-run.com}
-
-@item @uref{www.theinnkeeper.com, The Innkeeper Vacation Guides}
-
-@item @uref{http://www.macgamedatabase.com/, The Mac Game Database uses PHP and MySQL}
-@c From: Marc Antony Vose <suzerain@suzerain.com>
-
-@item @uref{http://www.csse.monash.edu.au/publications/, Research
-Publications at Monash University in Australia}
-
-@item @uref{http://www.ipielle.emr.it/bts/index.html,
-Occupational Health & Safety website databse (a project for the ECC)}
-@c c.presutti@ipielle.emr.it
-
-@item @uref{http://data.mch.mcgill.ca/, Bioinformatics databases at the
-Montreal Children's Hospital using MySQL}
-@c saeed@www.debelle.mcgill.ca
-@end itemize
-
-@appendixsec Online magazines
-
-@itemize @bullet
-@item @uref{http://www.spoiler.com, Spoiler Webzine}.
-An online magazine featuring music, literature, arts, and design content.
-@item @uref{http://www.linux-magazin.de/newsflash/, Daily news about Linux in German language}
-@item @uref{http://www.betazine.com,Betazine - The Ultimate Online Beta Tester's Magazine}
-@item @uref{http://www.currents.net/ccinfo/aboutcc.html,Computer Currents Magazine}
-@end itemize
-
-@appendixsec Web sites that use MySQL as a backed
-
-@itemize @bullet
-
-@item @uref{http://lindev.jmc.tju.edu/qwor, Qt Widget and Object Repository}
-
-@item @uref{http://www.samba-choro.com.br, Brazilian samba site (in Portuguese)}
-
-@item @uref{http://pgss.iss.uw.edu.pl/en_index.ISS, Polish General Social Survey}
-
-@item @uref{http://www.expo2000.com, Expo2000} World-wide distribution of
-tickets for this event is implemented using @strong{MySQL} and tcl/tk. More than
-5000 travel-agencies all over the world have access to it.
-
-@item @uref{http://www.freevote.com/, FreeVote.com is a free voting
-service with millions of users.}
-
-@item @uref{http://f1.tauzero.se, Forza Motorsport}
-@end itemize
-
-@appendixsec Some Domain/Internet/Web and related services
-
-@itemize @bullet
-
-@item @uref{http://www.wix.com/mysql-hosting, Registry of Web providers that
-support @strong{MySQL}}
-
-@item @uref{http://www.yi.org/, Dynamic DNS Services}
-
-@item @uref{http://www.dynodns.net/, Dynamic domain name service}
-
-@item @uref{http://www.ods.org/, Open DNS Project; free dynamic DNS service}
-
-@c @item @uref{http://dynodns.net, Free dynamic DNS implementation}
-@c EMAIL: A Moore <amoore@mooresystems.com>
-
-@item @uref{http://www.fdns.net/, Free 3rd level domains}
-
-@item @uref{http://worldcommunity.com/, Online Database}
-
-@item @uref{http://www.bigbiz.com, BigBiz Internet Services}
-
-@item @uref{http://virt.circle.net, The Virt Gazette}
-
-@item @uref{http://www.california.com, Global InfoNet Inc}
-
-@item @uref{http://www.webhosters.com, WebHosters - A Guide to WWW Providers}
-
-@item @uref{http://online.dn.ru, Internet information server}
-
-@item @uref{http://www.stopbit.com, A technology news site}
-
-@item @uref{http://www.worldnetla.net, WorldNet Communications - An Internet Services Provider}
-
-@item @uref{http://www.netizen.com.au/, Netizen: Australian-based web consultancy}
-
-@item @uref{http://www.trainingpages.co.uk, Search site for training courses in the UK}
-
-@item @uref{http://chat.nitco.com, Gannon Chat (GPL). Written in Perl and Javascript}
-
-@item @uref{http://www.addurls.com/,A general links directory}
-
-@item @uref{http://www.bookmarktracker.com, A web-based bookmark management service}
-
-@item @uref{http://www.cdrom.com,Walnut Creek CDROM}
-
-@item @uref{http://www.wwwthreads.org/, WWWThreads; Interactive discussion Forums}
-
-@item @uref{http://pvmon.portici.enea.it/Meteo, In Italian; Storage data from meteo station}
-
-@item @uref{http://www.buysell.net/, Online "Person To Person" Auction}
-
-@item @uref{http://tips.pair.com,Tips on web development}
-
-@item @uref{http://www.mailfriends.com, Mailfriends.com is a FREE service for
-everybody who wants to find friends over the internet.}
-
-@item @uref{http://www.uninova.com/cgi-bin/wctelnets?list, Web Page Telnet BBS List}
-
-@item @uref{http://www.uninova.com/cnc.html,UniNova Digital Postcards}
-
-@c @item @uref{http://cabinboy.powersurfr.com, An Internet RFC search engine}
-
-@item @uref{http://www.dslreports.com, DSL providers search with reviews}
-Made with @strong{MySQL} and Modperl, all pages are generated dynamically out of
-the @strong{MySQL} database
-@end itemize
-
-@appendixsec Web sites that use @code{PHP} and MySQL
-
-@itemize @bullet
-@c @item @uref{http://www.wh200th.com, White House 200th Anniversary site}
-
-@item @uref{http://war.jgaa.com:8080/support/index.php3, Jgaa's Internet - Official Support Site}
-
-@item @uref{http://io.incluso.com, Ionline - online publication:} @strong{MySQL},
-PHP, Java, Web programming, DB development
-
-@item @uref{http://www.baboo.com, BaBoo(Browse and bookmark). Free web-based bookmark manager and Calendar}
-
-@item @uref{http://www.courses.pjc.cc.fl.us/Schedule/index.php, Course
-Schedule System at Pensacola Junior College}
-
-@item @uref{http://www.fccj.org, Florida Community College at Jacksonville}
-
-@item @uref{http://www.32bit.com/, 32bit.com; An extensive shareware / freeware archive}
-
-@item @uref{http://www.jokes2000.com/, Jokes 2000}
-@c Added 990604; EMAIL: ah@dybdahl.dk
-
-
-@item @uref{http://www.burken.nu/ , Burken.NU} Burken is a webhotel that
-provides scripts, among other things, for remote users, like counters,
-guestbooks etc.
-@c Added 990608; EMAIL: spacedmp@SpaceDump.Burken.NU (Anders Olausson)
-
-@item @uref{http://tips.pair.com, tips.pair.com} Contains tips on html,
-javascript, 2d/3d graphics and PHP3/MySQL. All pages are generated from
-a database.
-@c Added 990614; EMAIL: downey@image.dk (Rune Madsen)
-
-@end itemize
-
-@appendixsec Some MySQL consultants
-
-@itemize @bullet
-
-@item @uref{http://www.ayni.com, Ayni AG}
-
-@item @uref{http://worldcommunity.com/, Online Database}
-
-@item @uref{http://www2.dataguard.no/,DataGuard (Uses @strong{MySQL} and PHP)}
-
-@item @uref{http://wwits.net/programs/mysql.phtml, WWITS (Uses @strong{MySQL} and PHP)}
-
-@item @uref{http://www.worldcommunity.com/, WCN - The World Community Network}
-
-@item @uref{http://www.chipcastle.com, Chip Castle Dot Com Inc}
-@c Added 990603 EMAIL: chip@chipcastle.com (Chip Castle)
-
-
-@item @uref{http://www.cyber.com.au/, Cybersource Pty. Ltd}
-
-@item @uref{http://www.spring.de, Spring infotainment gmbh & co. kg}
-@c added 990905 "Oliver Pischke" <opischke@spring.de>
-
-@item @uref{http://www.wamdesign.com/, Develops websites using MySQL}
-@c Added 990905; max@wamdesign.com
-
-@item @uref{http://www.berkeleyconsultants.com, Berkeley Consultants Group}
-
-@end itemize
-
-@appendixsec Programming
-
-@itemize @bullet
-@item @uref{http://www.perl.org/cpan-testers, The Perl CPAN Testers results page}
-@end itemize
-
-
-@appendixsec Uncategorized pages
-
-@itemize @bullet
-
-@item @uref{http://www.feature-showcase.com/htmls/demo_mysql.sql,
-AZC.COM's Feature Showcase}
-
-@item @uref{http://www.teach.org.uk/subjects/trainingcourse/g.html, Course Search}
-
-@item @uref{http://www.northerbys.com, Northerbys Online Auctions}
-
-@item @uref{http://www.schiphol.nl/flights/home.htm, Amsterdam Airport Schiphol}
-
-@item @uref{http://TheMatrix.com/seventhsin/query.phtml, CD database}
-
-@item @uref{http://TheMatrix.com/~flmm/GEAR.html, Used Audio Gear Database}
-
-@item @uref{http://www.kiss.de/musik-mueller, Musical note-sheets}
-
-@item @uref{http://www.bagism.com, Bagism - A John Lennon fan page}
-
-@item @uref{http://www.selftaught.com/, US Folk art broker}
-
-@item @uref{http://organizer.net/, Mail reading on the web}
-
-@item @uref{http://www.mypage.org/, Free home pages on www.somecoolname.mypage.org}
-
-@item @uref{http://www.schulweb.de/, Der Server f@"ur Schulen im Web (In German)}
-
-@item @uref{http://www.ald.net/, Auldhaefen Online Services}
-
-@item @uref{http://www.cary.net/, CaryNET Information Center}
-
-@item @uref{http://www.dataden.com/, Dataden Computer Systems}
-
-@item @uref{http://andree.grm.se/, Andr@'emuseet (In Swedish)}
-
-@item @uref{http://www.him.net/, HOMESITE Internet Marketing}
-
-@item @uref{http://www.jade-v.com/techinfo.html, Jade-V Network Services }
-
-@item @uref{http://ww2010.atmos.uiuc.edu/(Gl)/abt/aknw/tech.rxml,
-Weather World 2010 Technical Credits} @*
-
-@item @uref{http://gimp.foebud.org/registry/doc/, About The Gimp plugin registry}
-
-@item @uref{http://www.fast-inc.com/Products/Archiver/database.html, Java tool
-Archiver technical detail (Slightly optimistic about @strong{MySQL}
-ANSI-92 compliance)}
-
-@item @uref{http://www.gamesdomain.com/cheats/usrcheat.phtml, Games Domain Cheats Database}
-
-@item @uref{http://www.kcilink.com/poweredby/, The "Powered By" Page (Kcilink)}
-
-@item @uref{http://www.netcasting.net/index.whtml, Netcasting}
-
-@item @uref{http://homepages.tig.com.au/~mjj/nbltips, NBL (Australian National Basketball League) tipping}
-
-@item @uref{http://www.cgishop.com/, CGI shop}
-
-@item @uref{http://www.whirlycott.com/, Whirlycott: Website Design}
-
-@item @uref{http://www.mtp.dk, Museum Tusculanum Press}
-
-@item @uref{http://csdgi.historie.ku.dk/biblio, Centro Siciliano di Documentazione}
-
-@item @uref{http://caribou.dyn.ml.org:8000, Quake statistics database}
-
-@item @uref{http://www.astroforum.ch, Astroforum: Astrologie and related things (in German)}
-
-@item @uref{http://www.opendebate.com, OpenDebate - Interactive Polls & Open Discussion}
-
-@item @uref{http://vermeer.organik.uni-erlangen.de/dissertationen/, Online chemical dissertation server}
-
-@item @uref{http://www.freschinfo.com, FreSch! The Free Scholarship Search Service}
-
-@item @uref{http://www.nada.kth.se/~staffanu/pinball, Stockholm Pinball Locator}
-
-@item @uref{http://www.hek.com, HEK A construction company}
-
-@item @uref{http://www.nbi.nl, Elsevier Bussines Information}
-
-@item @uref{http://vaccination.medicallink.se/, Medical Links (Using ColdFusion and @strong{MySQL})}
-
-@item @uref{http://www.joblink-usa.com, Search for jobs & people at JobLink-USA}
-
-@item @uref{http://www.skydive.net/competfs, Competition Formation Skydiving}
-
-@item @uref{http://www.galaxy-net.net/Galaxy-NET Telecommunications, E-commerce and internal accounting}
-
-@item @uref{http://www.borsen.dk/, Denmark's leading business daily newspaper Borsen}
-
-@item @uref{http://tmmm.simplenet.com/indb/, The Internet NES Database}
-
-@item @uref{http://www.russia.cz, Travel agency in Prague in 3 languages}
-
-@item @uref{http://www.linkstation.de, Linkstation}
-
-@item @uref{http://www.peoplestaff.com, Searchable online database at Peoplestaff}
-
-@item @uref{http://www.dreamhorse.com, A searchable database system for horse classified ads}
-
-@item @uref{http://pootpoot.com/,The Poot site}
-
-@item @uref{http://grateful.net/hw_html/,"Playin' in the LAN"; a network monitoring suite}
-
-@c Update from Christopher Milton <cmilton@bwn.net> 1999-12-21
-@item @uref{http://www.usapa.army.mil,U.S. Army Publishing Agency}
-
-@item @uref{http://www.nekretnine.co.yu/,Realestate handling in Yugoslavia}
-
-@item @uref{http://demo.cpsoft.com/pims/devFAQ.html, PIMS; a Patient Information Management System}
-
-@item @uref{http://cpsoft.com,Pilkington Software Inc}
-
-@item @uref{http://www.no-quarter.org/,A Vietnam Veteran's Memorial (The Wall) database.}
-
-@item @uref{http://www.gamers-union.com/,Gamer's Union specializes inauctions of used & out of print gaming material}
-
-@item @uref{http://www.montereyhigh.com/office/dbul.php3, A daily bulletin at Monterey High school}
-
-@item @uref{http://www.myEastside.com,Community-owned site serving Lake
-Washington's Eastside residents and businesses}
-
-@item @uref{http://bowling-france.net/,French bowling site}.
-@end itemize
-
-Send any additions to this list to @email{webmaster@@mysql.com}.
-
-@page
-@node Contrib, Credits, Users, Top
-@appendix Contributed programs
-
-Many users of @strong{MySQL} have contributed @emph{very} useful support
-tools and addons.
-
-@ifclear web
-A list of what is available at @uref{http://www.mysql.com/Contrib}
-(or any mirror) is shown below.
-If you want to build @strong{MySQL} support for the Perl @code{DBI}/@code{DBD}
-interface, you should fetch the @code{Data-Dumper}, @code{DBI}, and
-@code{Msql-Mysql-modules} files and install them.
-@xref{Perl support}.
-@end ifclear
-
-
-@uref{http://www.mysql.com/Contrib/00-README, 00-README}
-This listing.
-
-@appendixsec API's
-
-@itemize @bullet
-@item Perl modules
-@itemize @bullet
-@item @uref{http://www.mysql.com/Contrib/Data-Dumper-2.101.tar.gz, Data-Dumper-2.101.tar.gz}
-Perl @code{Data-Dumper} module. Useful with @code{DBI}/@code{DBD} support for
-older perl installations.
-
-@item @uref{http://www.mysql.com/Contrib/DBI-1.13.tar.gz, DBI-1.13.tar.gz}
-Perl @code{DBI} module.
-
-@item @uref{http://www.mysql.com/Contrib/KAMXbase1.0.tar.gz,KAMXbase1.0.tar.gz}
-Convert between @file{.dbf} files and @strong{MySQL} tables. Perl
-module written by Pratap Pereira @email{pereira@@ee.eng.ohio-state.edu},
-extened by Kevin A. McGrail @email{kmcgrail@@digital1.peregrinehw.com}.
-This converter can handle MEMO fields.
-
-@item @uref{http://www.mysql.com/Contrib/Msql-Mysql-modules-1.2209.tar.gz, Msql-Mysql-modules-1.2209.tar.gz}
-Perl @code{DBD} module to access mSQL and @strong{MySQL} databases..
-
-@item @uref{http://www.mysql.com/Contrib/Data-ShowTable-3.3.tar.gz, Data-ShowTable-3.3.tar.gz}
-Perl @code{Data-ShowTable} module. Useful with @code{DBI}/@code{DBD} support.
-@end itemize
-
-@item JDBC
-@itemize @bullet
-@item @uref{http://www.mysql.com/Contrib/mm.mysql.jdbc-1.2c.tar.gz, mm.mysql.jdbc-1.2c.tar.gz}
-The mm JDBC driver for @strong{MySQL}. This is a production release
-and is actively developed. By Mark Matthews
-(@email{mmatthew@@ecn.purdue.edu}).
-
-@item @uref{http://www.mysql.com/Contrib/mm.mysql.jdbc-2.0pre5.tar.gz, mm.mysql.jdbc-2.0pre5.tar.gz}
-The mm JDBC driver for @strong{MySQL}. This is a pre-release beta version
-and is actively developed. By Mark Matthews
-(@email{mmatthew@@ecn.purdue.edu}).
-The two drivers above have an LGPL
-license. Please check @uref{http://www.worldserver.com/mm.mysql/} for
-the latest drivers (and other JDBC information) because these drivers may be ou
-updated as frequently.
-
-@item @uref{http://www.mysql.com/Contrib/twz1jdbcForMysql-1.0.4-GA.tar.gz, twz1jdbcForMysql-1.0.4-GA.tar.gz}
-The twz driver: A type 4 JDBC driver by Terrence W. Zellers
-@email{zellert@@voicenet.com}. This is commercial but is free for
-private and educational use.
-@c no answer from server 990830
-@c You can always find the latest driver at @uref{http://www.voicenet.com/~zellert/tjFM/}.
-@item
-@item @uref{http://www.mysql.com/Contrib/pmdamysql.tgz,pmdamysql.tgz}
-A @strong{MySQL} PMDA. Provides @strong{MySQL} server status and configuration
-variables.
-@end itemize
-
-@item C++
-@itemize @bullet
-
-@item @uref{http://www.mysql.com/Contrib/mysql-c++-0.02.tar.gz, mysql-c++-0.02.tar.gz}
-@strong{MySQL} C++ wrapper library. By Roland Haenel,
-@email{rh@@ginster.net}.
-
-@item @uref{http://www.mysql.com/Contrib/MyDAO.tar.gz, MyDAO}
-@strong{MySQL} C++ API. By Satish @email{spitfire@@pn3.vsnl.net.in}. Inspired
-by Roland Haenel's C++ API and Ed Carp's MyC library.
-
-@item @uref{http://www.mysql.com/download_mysql++.html, mysql++}
-@strong{MySQL} C++ API (More than just a wrapper library). Originally by
-@email{kevina@@clark.net}. Nowadays maintained by Sinisa at TCX.
-
-@item @uref{http://nelsonjr.homepage.com/NJrAPI,NJrAPI}
-A C++ database independent library that supports @strong{MySQL}.
-@end itemize
-
-@item Delphi
-@itemize @bullet
-@item @uref{http://www.mysql.com/Contrib/delphi-interface.gz, delphi-interface.gz}
-Delphi interface to @code{libmysql.dll}, by Blestan Tabakov,
-@email{root@@tdg.bis.bg}.
-
-@item @uref{http://www.mysql.com/Contrib/DelphiMySQL2.zip, DelphiMySQL2.zip}
-Delphi interface to @code{libmysql.dll}, by @email{bsilva@@umesd.k12.or.us}
-
-@item @uref{http://www.mysql.com/Contrib/Udmysel.pas, Udmysql.pas}
-A wrapper for libmysql.dll for usage in Delphi. By Reiner Sombrowsky.
-
-@item @uref{http://www.fichtner.net/delphi/mysql.delphi.phtml, A Delphi interface to @strong{MySQL}.}
-With source code. By Matthias Fichtner.
-
-@item @uref{http://www.productivity.org/projects/mysql/, @strong{TmySQL}
-A library to use @strong{MySQL} with Delphi}
-
-@item @uref{http://www.geocities.com/CapeCanaveral/2064/mysql.html, Delphi TDataset-component}
-@end itemize
-
-@item @uref{http://www.mysql.com/Contrib/mysql-ruby-2.2.0.tar.gz, mysql-ruby-2.2.0.tar.gz}
-@strong{MySQL} Ruby module. By TOMITA Masahiro @email{tommy@@tmtm.org}
-@uref{http://www.netlab.co.jp/ruby/,Ruby} is an Object-Oriented Interpreter Language.
-
-@item @uref{http://www.mysql.com/Contrib/JdmMysqlDriver-0.1.0.tar.gz,JdmMysqlDriver-0.1.0.tar.gz}
-A VisualWorks 3.0 Smalltalk driver for @strong{MySQL}. By
-@email{joshmiller@@earthlink.net}
-
-@item @uref{http://www.mysql.com/Contrib/Db.py, Db.py}
-Python module with caching. By @email{gandalf@@rosmail.com}.
-
-@item @uref{http://www.mysql.com/Contrib/MySQLmodule-1.4.tar.gz, MySQLmodule-1.4.tar.gz}
-Python interface for @strong{MySQL}. By Joseph Skinner @email{joe@@earthlight.co.nz}; Modified by Joerg Senekowitsch @email{senekow@@ibm.net}
-
-@item @uref{http://www.mysql.com/Contrib/mysql_mex_1_1.tar.gz, mysql_mex_1_1.tar.gz}
-An interface program for the Matlab program by MathWorks. The interface
-is done by Kimmo Uutela and John Fisher (not by Mathworks).
-Check @uref{http://boojum.hut.fi/~kuutela/mysqlmex.html,mysqlmex.html}
-for more information.
-
-@item @uref{http://www.mysql.com/Contrib/mysqltcl-1.53.tar.gz, mysqltcl-1.53.tar.gz}
-Tcl interface for @strong{MySQL}. Based on @file{msqltcl-1.50.tar.gz}.
-Updated by Tobias Ritzau, @email{tobri@@ida.liu.se}.
-
-@item @uref{http://www.mysql.com/Contrib/MyC-0.1.tar.gz, MyC-0.1.tar.gz}
-A Visual Basic-like API, by Ed Carp.
-
-@item @uref{http://www.mysql.com/Contrib/sqlscreens-1.0.1.tar.gz, sqlscreens-1.0.1.tar.gz}
-Tcl/TK code to generate database screens. By Jean-Francois Dockes.
-
-@item @uref{http://www.mysql.com/Contrib/Vdb-dflts-2.1.tar.gz, Vdb-dflts-2.1.tar.gz}
-This is a new version of a set of library utilities intended
-to provide a generic interface to SQL database engines such that your
-application becomes a 3-tiered application. The advantage is that you
-can easily switch between and move to other database engines by
-implementing one file for the new backend without needing to make any
-changes to your applications. By @email{damian@@cablenet.net}.
-
-@item @uref{http://www.mysql.com/Contrib/DbFramework-1.10.tar.gz, DbFramework-1.10.tar.gz}
-DbFramework is a collection of classes for manipulating @strong{MySQL}
-databases. The classes are loosely based on the CDIF Data Model
-Subject Area. By Paul Sharpe @email{paul@@miraclefish.com}.
-
-@item @uref{http://www.mysql.com/Contrib/pike-mysql-1.4.tar.gz, pike-mysql-1.4.tar.gz}
-@strong{MySQL} module for pike. For use with the Roxen web server.
-
-@item @uref{http://www.mysql.com/Contrib/squile.tar.gz, squile.tar.gz}
-Module for @code{guile} that allows @code{guile} to interact with SQL
-databases. By Hal Roberts.
-
-@item @uref{http://www.mysql.com/Contrib/stk-mysql.tar.gz, stk-mysql.tar.gz}
-Interface for Stk. Stk is the Tk widgets with Scheme underneath instead of Tcl.
-By Terry Jones
-
-@item @uref{http://www.mysql.com/Contrib/eiffel-wrapper-1.0.tar.gz,eiffel-wrapper-1.0.tar.gz}.
-Eiffel wrapper by Michael Ravits.
-@end itemize
-
-@appendixsec Clients
-
-@itemize @bullet
-@item Graphical clients
-@itemize @bullet
-@item @uref{http://www.mysql.com/download_clients.html, mysqlgui homepage}
-The @strong{MySQL} GUI client homepage. By Sinisa at TCX.
-@item @uref{http://www.mysql.com/Contrib/kmysqladmin-0.4.1.tar.gz, kmysqladmin-0.4.1.tar.gz}
-@item @uref{http://www.mysql.com/Contrib/kmysqladmin-0.4.1-1.src.rpm, kmysqladmin-0.4.1-1.src.rpm}
-@item @uref{http://www.mysql.com/Contrib/kmysqladmin-0.4.1-1.i386.rpm, kmysqladmin-0.4.1-1.i386.rpm}
-An administration tool for the @strong{MySQL} server using QT / KDE. Tested
-only on Linux.
-
-@item @uref{http://www.mysql.com/Contrib/mysql-admin-using-java+swing.tar.gz, Java client
-using Swing} By Fredy Fischer, @email{se-afs@@dial.eunet.ch}. Ypu can
-always find the latest version
-@uref{http://www.trash.net/~ffischer/admin/index.html, here}.
-
-@item @uref{http://www.mysql.com/Contrib/mysqlwinadmn.zip, mysqlwinadmn.zip}
-Win32 GUI (binary only) to administrate a database, by David B. Mansel,
-@email{david@@zhadum.org}.
-
-@item @uref{http://www.mysql.com/Contrib/netadmin.zip, netadmin.zip} A
-administrator tool for @strong{MySQL} on Windows 95/98 and Windows NT
-4.0. Only tested with @strong{MySQL} 3.23.5 - 3.23.7. Written using the
-Tmysql components.
-
-You can write queries and show tables, indexes, table syntax and
-administrate user,host and database and so on. The is still beta and
-have still some bugs. you can test the program with all features. Please
-send bugs and hints to Marco Suess @email{ms@@it-netservice.de}. Original
-URL @url{http://www.it-netservice.de/pages/software/index.html}.
-
-@item @uref{http://www.mysql.com/Contrib/xmysqladmin-1.0.tar.gz, xmysqladmin-1.0.tar.gz}
-A front end to the @strong{MySQL} database engine. It allows reloads,
-status check, process control, myisamchk, grant/revoke privileges,
-creating databases, dropping databases, create, alter, browse and drop
-tables. Originally by Gilbert Therrien, @email{gilbert@@ican.net} but
-now in public domain and supported by TcX.
-
-@item @uref{http://www.mysql.com/Contrib/xmysql-1.9.tar.gz, xmysql-1.9.tar.gz}
-@item @uref{http://web.wt.net/~dblhack, xmysql home page}
-A front end to the @strong{MySQL} database engine. It allows for simple
-queries and table maintenance, as well as batch queries. By Rick
-Mehalick, @email{dblhack@@wt.net}.
-Requires @uref{http://bragg.phys.uwm.edu/xforms,xforms 0.88} to work.
-@item @uref{http://www.tamos.net/sw/dbMetrix,dbMetrix}
-An open source client for exploring databases and executing SQL. Supports
-@strong{MySQL}, Oracle, PostgreSQL and mSQL.
-@item @uref{http://www.multimania.com/bbrox/GtkSQL,GtkSQL}
-A query tool for @strong{MySQL} and PostgreSQL.
-@item @uref{http://dbman.linux.cz/,dbMan}
-A query tool written in Perl. Uses DBI and Tk.
-@item @uref{http://www.mysql.com/Downloads/Win32/ArtronicWINAdmin.exe,Atronic's
-@strong{MySQL} client for Win32}
-@item @uref{http://www.mysql.com/Contrib/mascon1.exe, mascon1.exe}
-You can get the newest one from
-@uref{http://www.SciBit.com,http://www.SciBit.com}.
-@item @uref{http://www.virtualbeer.net/dbui/,DBUI}
-DBUI is a Gtk graphical database editor.
-@end itemize
-
-@item Web clients
-@itemize @bullet
-@item @uref{http://www.mysql.com/Contrib/mysqladmin-atif-1.0.tar.gz, mysqladmin-atif-1.0.tar.gz}
-WWW @strong{MySQL} administrator for the @code{user,} @code{db} and
-@code{host} tables. By Tim Sailer, modified by Atif Ghaffar
-@email{aghaffar@@artemedia.ch}.
-
-@item @uref{http://www.mysql.com/Contrib/mysql-webadmin-1.0a8-rz.tar.gz, mysql-webadmin-1.0a8-rz.tar.gz}
-A tool written in PHP-FI to administrate @strong{MySQL} databases
-remotely over the web within a Web-Browser. By Peter Kuppelwieser,
-@email{peter.kuppelwieser@@kantea.it}. Updated by Wim Bonis, bonis@@kiss.de.
-Not maintained anymore!
-
-@item @uref{http://www.mysql.com/Contrib/mysqladm.tar.gz, mysqladm.tar.gz}
-@strong{MySQL} Web Database Administration written in Perl. By Tim
-Sailer.
-
-@item @uref{http://www.mysql.com/Contrib/mysqladm-2.tar.gz, mysqladm-2.tar.gz}
-Updated version of @file{mysqladm.tar.gz}, by High Tide.
-
-@item @uref{http://www.mysql.com/Contrib/billowmysql.zip, billowmysql.zip}
-Updated version of @file{mysqladm.tar.gz}, by Ying Gao.
-
-@item @uref{http://www.mysql.com/Contrib/myadmin-0.4.tar.gz, myadmin-0.4.tar.gz}
-@item @uref{http://myadmin.cheapnet.net/, MyAdmin home page}
-A web based mysql administrator by Mike Machado.
-
-@item @uref{http://www.mysql.com/Contrib/phpMyAdmin_2.0.1.tar.gz,phpMyAdmin_2.0.1.tar.gz}
-A set of PHP3-scripts to adminstrate @strong{MySQL} over the WWW.
-
-@item @uref{http://www.htmlwizard.net/phpMyAdmin/, phpMyAdmin home page}
-A PHP3 tool in the spirit of mysql-webadmin, by Tobias Ratschiller, tobias@@dnet.it
-
-@item @uref{http://www.mysql.com/Contrib/useradm.tar.gz, useradm.tar.gz}
-@strong{MySQL} administrator in PHP. By Ofni Thomas
-@email{othomas@@vaidsystems.com}.
-@end itemize
-@item @uref{http://www.mysql.com/Contrib/mysql-editor.tar.gz,mysql-editor.tar.gz}
-This cgi scripts in Perl enables you to edit content of Mysql
-database. By Tomas Zeman.
-@end itemize
-
-
-@appendixsec Web tools
-
-@itemize @bullet
-
-@item @uref{http://www.mysql.com/Contrib/mod_mysql_include_1.0.tar.gz, mod_mysql_include_1.0.tar.gz}
-Apache module to include HTML from MySQL queries into your pages, and run update queries.
-Originally written to implement a simple fast low-overhead banner-rotation system.
-By Sasha Pachev.
-
-@item @uref{http://www.odbsoft.com/cook/sources.htm}
-This package has various functions for generating html code from a SQL
-table structure and for generating SQL statements (Select, Insert,
-Update, Delete) from an html form. You can build a complete forms
-interface to a SQL database (query, add, update, delete) without any
-programming! By Marc Beneteau, @email{marc@@odbsoft.com}.
-
-@item @uref{http://www.mysql.com/Contrib/sqlhtml.tar.gz, sqlhtml.tar.gz}
-SQL/HTML is an HTML database manager for @strong{MySQL} using @code{DBI} 1.06.
-
-@item @uref{http://www.mysql.com/Contrib/udmsearch-2.2.1b.tar.gz, UdmSearch 2.2.1b (stable version)}
-@item @uref{http://www.mysql.com/Contrib/udmsearch-3.0.5.tar.gz, UdmSearch 3.0.5 (development version)}
-@item @uref{http://mysearch.udm.net, UdmSearch home page}
-A @strong{MySQL}- and PHP- based search engine over HTTP. By
-Alexander I. Barkov @email{bar@@izhcom.ru}.
-
-@item @uref{http://www.mysql.com/Contrib/wmtcl.doc, wmtcl.doc}
-@item @uref{http://www.mysql.com/Contrib/wmtcl.lex, wmtcl.lex}
-With this you can write HTML files with inclusions of TCL code. By
-@email{vvs@@scil.npi.msu.su}.
-
-@item @uref{http://www.mysql.com/Contrib/www-sql-0.5.7.lsm, www-sql-0.5.7.lsm}
-@item @uref{http://www.mysql.com/Contrib/www-sql-0.5.7.tar.gz, www-sql-0.5.7.tar.gz}
-A CGI program that parses an HTML file containing special tags, parses
-them and inserts data from a @strong{MySQL} database.
-
-@item @uref{http://www.mysql.com/Contrib/genquery.zip, genquery.zip}
-Perl SQL database interface package for html.
-
-@item @uref{http://www.mysql.com/Contrib/cgi++-0.8.tar.gz, cgi++-0.8.tar.gz}
-A macro-processor to simply writing CGI/Database programs in C++ by Sasha Pachev.
-
-@item @uref{http://www.mysql.com/Contrib/webboard-1.0.zip, WebBoard 1.0}
-EU-Industries Internet-Message-Board.
-
-@item @uref{http://www.mysql.com/Contrib/DBIx-TextIndex-0.02.tar.gz, DBIx-TextIndex-0.02.tar.gz}
-Full-text searching with Perl on @code{BLOB}/@code{TEXT} columns by Daniel Koch.
-@end itemize
-
-@appendixsec Performance Benchmarking tools
-
-@itemize @bullet
-@item @uref{http://www.mysql.com/Contrib/mysql-bench-0.6.tar.gz, mysql-super-smack and friends}
-User-customizable multi-threaded tool set to benchmark @strong{MySQL}. By Sasha Pachev.
-@end itemize
-
-@appendixsec Authentication tools
-
-@itemize @bullet
-@item @uref{http://www.mysql.com/Contrib/ascend-radius-mysql-0.7.1.patch.gz,
-ascend-radius-mysql-0.7.1.patch.gz}
-This is authentication and logging patch using @strong{MySQL} for
-Ascend-Radius. By @email{takeshi@@SoftAgency.co.jp}.
-
-@item @uref{http://www.mysql.com/Contrib/icradius-0.10.tar.gz, icradius 0.10}
-@uref{http://www.mysql.com/Contrib/icradius.README, icradius readme file}
-
-@item @uref{http://www.mysql.com/Contrib/checkpassword-0.81-mysql-0.6.5.patch.gz,
-checkpassword-0.81-mysql-0.6.5.patch.gz}
-@strong{MySQL} authentication patch for QMAIL and checkpassword. These are
-useful for management user(mail,pop account) by @strong{MySQL}.
-By @email{takeshi@@SoftAgency.co.jp}
-
-@item @uref{http://www.mysql.com/Contrib/jradius-diff.gz, jradius-diff.gz}
-@strong{MySQL} support for Livingston's Radius 2.01. Authentication and
-Accounting. By Jose de Leon, @email{jdl@@thevision.net}
-
-@item @uref{http://www.mysql.com/Contrib/mod_auth_mysql-2.20.tar.gz, mod_auth_mysql-2.20.tar.gz}
-Apache authentication module for @strong{MySQL}. By Zeev Suraski,
-@email{bourbon@@netvision.net.il}.
-
-@strong{Please} register this module at:
-@url{http://bourbon.netvision.net.il/mysql/mod_auth_mysql/register.html}. The
-registering information is only used for statistical purposes and will
-encourage further development of this module!
-
-@item @uref{http://www.mysql.com/Contrib/mod_log_mysql-1.05.tar.gz, mod_log_mysql-1.05.tar.gz}
-@strong{MySQL} logging module for Apache. By Zeev Suraski,
-@email{bourbon@@netvision.net.il}.
-
-@item @uref{http://www.mysql.com/Contrib/mypasswd-2.0.tar.gz, mypasswd-2.0.tar.gz}
-Extra for @code{mod_auth_mysql}. This is a little tool that allows you
-to add/change user records storing group and/or password entries in
-@strong{MySQL} tables. By Harry Brueckner, @email{brueckner@@respublica.de}.
-
-@item @uref{http://www.mysql.com/Contrib/mysql-passwd.README, mysql-passwd.README}
-@item @uref{http://www.mysql.com/Contrib/mysql-passwd-1.2.tar.gz, mysql-passwd-1.2.tar.gz}
-Extra for @code{mod_auth_mysql}. This is a two-part system for use with
-@code{mod_auth_mysql}.
-
-@item @uref{http://www.mysql.com/Contrib/pam_mysql.tar.gz, pam_mysql.tar.gz}
-This module authenticates users via @code{pam}, using @strong{MySQL}.
-
-@item @uref{http://www.mysql.com/Contrib/nsapi_auth_mysql.tar, nsapi_auth_mysql.tar}
-Netscape Web Server API (NSAPI) functions to authenticate (BASIC) users
-against @strong{MySQL} tables. By Yuan John Jiang.
-
-@item @uref{http://www.mysql.com/Contrib/qmail-1.03-mysql-0.6.5.patch.gz,
-qmail-1.03-mysql-0.6.5.patch.gz}
-Patch for qmail to authenticate users from a @strong{MySQL} table.
-
-@item @uref{http://www.mysql.com/Contrib/pwcheck_mysql-0.1.tar.gz,pwcheck_mysql-0.1.tar.gz}
-An authentication module for the Cyrus IMAP server. By Aaron Newsome.
-@end itemize
-
-@appendixsec Converters
-
-@itemize @bullet
-@item @uref{http://www.mysql.com/Contrib/dbf2mysql-1.13.tgz, dbf2mysql-1.13.tgz}
-Convert between @file{.dbf} files and @strong{MySQL} tables. By Maarten
-Boekhold, @email{boekhold@@cindy.et.tudelft.nl}, and Michael Widenius.
-This converter can't handle MEMO fields.
-
-@item @uref{http://www.mysql.com/Contrib/dbf2mysql.zip, dbf2mysql.zip}
-Convert between FoxPro @file{.dbf} files and @strong{MySQL} tables on Win32.
-By Alexander Eltsyn, @email{ae@@nica.ru} or @email{ae@@usa.net}.
-
-@item @uref{http://www.mysql.com/Contrib/dump2h-1.20.gz, dump2h-1.20.gz}
-Convert from @code{mysqldump} output to a C header file. By Harry Brueckner,
-@email{brueckner@@mail.respublica.de}.
-
-@item @uref{http://www.mysql.com/Contrib/exportsql.txt, exportsql.txt}
-A script that is similar to @code{access_to_mysql.txt}, except that this
-one is fully configurable, has better type conversion (including
-detection of @code{TIMESTAMP} fields), provides warnings and suggestions
-while converting, quotes @strong{all} special characters in text and
-binary data, and so on. It will also convert to @code{mSQL} v1 and v2,
-and is free of charge for anyone. See
-@uref{http://www.cynergi.net/prod/exportsql/} for latest version. By
-Pedro Freire, @email{support@@cynergi.net}. Note: Doesn't work with
-Access2!
-@item @uref{http://www.mysql.com/Contrib/access_to_mysql.txt, access_to_mysql.txt}
-Paste this function into an Access module of a database which has the
-tables you want to export. See also @code{exportsql}. By Brian Andrews.
-Note: Doesn't work with Access2!
-
-@item @uref{http://www.mysql.com/Contrib/importsql.txt, importsql.txt}
-A script that does the exact reverse of @code{exportsql.txt}. That is,
-it imports data from @strong{MySQL} into an Access database via
-ODBC. This is very handy when combined with exportsql, because it lets you
-use Access for all DB design and administration, and synchronize with
-your actual @strong{MySQL} server either way. Free of charge. See
-@uref{http://www.netdive.com/freebies/importsql/} for any updates.
-Created by Laurent Bossavit of NetDIVE.
-@strong{Note:} Doesn't work with Access2!
-
-@item @uref{http://www.mysql.com/Contrib/msql2mysqlWrapper-1.0.tgz, /msql2mysqlWrapper 1.0}
-A C wrapper from @code{mSQL} to @strong{MySQL}. By @email{alfred@@sb.net}
-
-@item @uref{http://www.mysql.com/Contrib/sqlconv.pl, sqlconv.pl}
-A simple script that can be used to copy fields from one @strong{MySQL} table to
-another in bulk. Basically, you can run @code{mysqldump} and pipe it to
-the @code{sqlconv.pl} script and the script will parse through the
-@code{mysqldump} output and will rearrange the fields so they can be
-inserted into a new table. An example is when you want to create a new
-table for a different site you are working on, but the table is just a
-bit different (ie - fields in different order, etc.).
-By Steve Shreeve.
-@end itemize
-
-@appendixsec Using MySQL with other products
-
-@itemize @bullet
-@item @uref{http://www.mysql.com/Contrib/emacs-sql-mode.tar.gz, emacs-sql-mode.tar.gz}
-Raw port of a SQL mode for XEmacs. Supports completion. Original by
-Peter D. Pezaris @email{pez@@atlantic2.sbi.com} and partial
-@strong{MySQL} port by David Axmark.
-
-@item @uref{http://www.mysql.com/Downloads/Win32/MyAccess97_Ver_1_01.zip, MyAccess97 1.01}
-MyAccess is an AddIn for Access 97 and handles a lot of maintanance work
-for @strong{MySQL} databases.
-
-@item @uref{http://www.mysql.com/Downloads/Win32/MyAccess2000_Ver_1_01.zip, MyAccess2000 1.01}
-MyAccess is an AddIn for Access 2000 and handles a lot of maintanance work
-for @strong{MySQL} databases.
-
-@uref{http://www.mysql.com/Downloads/Win32/MyAccess-1.01.readme,
-MyAccess-readme}. By Hubertus Hiden.
-
-@item @uref{http://www.mysql.com/Contrib/radius-0.3.tar.gz, radius-0.3.tar.gz}
-Patches for @code{radiusd} to make it support @strong{MySQL}. By Wim Bonis,
-@email{bonis@@kiss.de}.
-@end itemize
-
-@appendixsec Useful tools
-
-@itemize @bullet
-@item @uref{http://www.mysql.com/Contrib/mysql_watchdog.pl, mysql_watchdog.pl}
-Monitor the @strong{MySQL} daemon for possible lockups. By Yermo Lamers,
-@email{yml@@yml.com}.
-
-@item @uref{http://www.mysql.com/Contrib/mysqltop.tar.gz, mysqltop.tar.gz}
-Sends a query in a fixed time interval to the server and shows the
-resulting table. By Thomas Wana.
-@item @uref{http://www.mysql.com/Contrib/mysql_structure_dumper.tar.gz,mysql_structure_dumper.tar.gz}
-Prints out the structure of the all tables in a database. By Thomas Wana.
-
-@item @uref{http://www.mysql.com/Contrib/mysql_structure_dumper.tgz, structure_dumper.tgz}
-Prints the structure of every table in a database. By Thomas Wana.
-
-@item @uref{http://www.mysql.com/Contrib/mysqlsync, mysqlsync-1.0-alpha.tar.gz}.
-A perl script to keep remote copies of a @strong{MySQL} database in sync with a
-central master copy. By Mark Jeftovic. @email{markjr@@easydns.com}
-@item @uref{http://www.mysql.com/Contrib/MySQLTutor-0.2.tar.gz, MySQLTutor}.
-MySQLTutor. A tutor of @strong{MySQL} for beginners
-
-@item @uref{http://www.mysql.com/Contrib/MySQLDB.zip, MySQLDB.zip}
-A COM library for @strong{MySQL} by Alok Singh.
-@item @uref{http://www.mysql.com/Contrib/MySQLDB-readme.html, MySQLDB-readme.html}
-
-@item @uref{http://www.mysql.com/Contrib/mysql_replicate.pl, mysql_replicate.pl}
-Perl program that handles replication. By @email{elble@@icculus.nsg.nwu.edu}
-
-@item @uref{http://www.mysql.com/Contrib/DBIx-TextIndex-0.02.tar.gz, DBIx-TextIndex-0.02.tar.gz}
-Perl program that uses reverse indexing to handle text searching.
-By Daniel Koch.
-@end itemize
-
-@appendixsec RPMs for common tools (Most are for RedHat 6.1)
-
-@itemize @bullet
-@item @uref{http://www.mysql.com/Contrib/perl-Data-ShowTable-3.3-2.i386.rpm,perl-Data-ShowTable-3.3-2.i386.rpm}
-@item @uref{http://www.mysql.com/Contrib/perl-Msql-Mysql-modules-1.2210-2.i386.rpm,perl-Msql-Mysql-modules-1.2210-2.i386.rpm}
-@item @uref{http://www.mysql.com/Contrib/php-pg-3.0.13-1.i386.rpm,php-pg-3.0.13-1.i386.rpm}
-@item @uref{http://www.mysql.com/Contrib/php-pg-manual-3.0.13-1.i386.rpm,php-pg-manual-3.0.13-1.i386.rpm}
-@item @uref{http://www.mysql.com/Contrib/php-pg-mysql-3.0.13-1.i386.rpm,php-pg-mysql-3.0.13-1.i386.rpm}
-@item @uref{http://www.mysql.com/Contrib/phpMyAdmin-2.0.5-1.noarch.rpm,phpMyAdmin-2.0.5-1.noarch.rpm}
-@end itemize
-
-@appendixsec Useful functions
-@itemize @bullet
-@item @uref{http://www.mysql.com/Contrib/mysnprintf.c,mysnprintf.c}
-sprintf() function for SQL queries that can escape blobs. By Chunhua Liu.
-@end itemize
-
-@appendixsec Uncategorized
-
-@itemize @bullet
-
-@item @uref{http://www.mysql.com/Contrib/findres.pl, findres.pl}
-Find reserved words in tables. By Nem W Schlecht.
-
-@item @uref{http://www.mysql.com/Contrib/handicap.tar.gz, handicap.tar.gz}
-Performance handicapping system for yachts. Uses PHP. By
-@email{rhill@@stobyn.ml.org}.
-
-@item @uref{http://www.mysql.com/Contrib/hylalog-1.0.tar.gz, hylalog-1.0.tar.gz}
-Store @code{hylafax} outgoing faxes in a @strong{MySQL} database. By Sinisa
-Milivojevic, @email{sinisa@@mysql.com}.
-
-@item @uref{http://www.mysql.com/Contrib/mrtg-mysql-1.0.tar.gz, mrtg-mysql-1.0.tar.gz}
-@strong{MySQL} status plotting with MRTG, by Luuk de Boer, @email{luuk@@wxs.nl}.
-
-@item @uref{http://www.mysql.com/Contrib/wuftpd-2.4.2.18-mysql_support.2.tar.gz, wuftpd-2.4.2.18-mysql_support.2.tar.gz}
-Patches to add logging to @strong{MySQL} for WU-ftpd. By Zeev Suraski,
-@email{bourbon@@netvision.net.il}.
-
-@item @uref{http://www.mysql.com/Contrib/wu-ftpd-2.6.0-mysql.4.tar.gz,wu-ftpd-2.6.0-mysql_support.4.tar.gz}
-Patches to add logging to @strong{MySQL} for WU-ftpd 2.6.0. By,
-@email{takeshi@@SoftAgency.co.jp}, based on Zeev Suraski wuftpd patches.
-
-@item @uref{http://www.mysql.com/Contrib/Old-Versions, Old-Versions}
-Previous versions of things found here that you probably won't be
-interested in.
-@end itemize
-
-
-@page
-@node Credits, News, Contrib, Top
-@appendix Contributors to MySQL
-
-Contributors to the @strong{MySQL} distribution are listed below, in
-somewhat random order:
-
-@table @asis
-@item Michael (Monty) Widenius
-Has written the following parts of @strong{MySQL}:
-@itemize @bullet
-@item
-All the main code in @code{mysqld}.
-@item
-New functions for the string library.
-@item
-Most of the @code{mysys} library.
-@item
-The @code{ISAM} and @code{MyISAM} libraries (B-tree index file
-handlers with index compression and different record formats).
-@item
-The @code{heap} library. A memory table system with our superior full dynamic
-hashing. In use since 1981 and published around 1984.
-@item
-The @code{replace} program (look into it, it's COOL!).
-@item
-@strong{MyODBC}, the ODBC driver for Windows95.
-@item
-Fixing bugs in MIT-pthreads to get it to work for @strong{MySQL}. And
-also Unireg, a curses-based application tool with many utilities.
-@item
-Porting of @code{mSQL} tools like @code{msqlperl}, @code{DBD}/@code{DBI} and
-@code{DB2mysql}.
-@item
-Most parts of crash-me and the @strong{MySQL} benchmarks.
-@end itemize
-@item David Axmark
-@itemize @bullet
-@item
-Coordinator and main writer for the @strong{Reference Manual}, including
-enhancements to @code{texi2html}. Also automatic website updating from
-this manual.
-@item
-Autoconf, Automake and @code{libtool} support.
-@item
-The licensing stuff.
-@item
-Parts of all the text files. (Nowadays only the @file{README} is
-left. The rest ended up in the manual.)
-@item
-Our Mail master.
-@item
-Lots of testing of new features.
-@item
-Our in-house ``free'' software lawyer.
-@item
-Mailing list maintainer (who never has the time to do it right...)
-@item
-Our original portability code (more than 10 years old now). Nowadays
-only some parts of @code{mysys} are left.
-@item
-Someone for Monty to call in the middle of the night when he just got
-that new feature to work. :-)
-@end itemize
-@item Paul DuBois
-Help with making the Reference Manual correct and understandable. That
-includes rewriting Monty's and David's attempts at English into English
-as other people know it.
-@item Gianmassimo Vigazzola @email{qwerg@@mbox.vol.it} or @email{qwerg@@tin.it}
-The initial port to Win32/NT.
-@item Kim Aldale
-Helped to rewrite Monty's and David's early attempts at English into
-English.
-@item Allan Larsson (The BOSS at TcX)
-For all the time he has allowed Monty to spend on this ``maybe useful''
-tool (@strong{MySQL}). Dedicated user (and bug finder) of Unireg & @strong{MySQL}.
-@item Per Eric Olsson
-For more or less constructive criticism and real testing of the dynamic
-record format.
-@item Irena Pancirov @email{irena@@mail.yacc.it}
-Win32 port with Borland compiler. @code{mysqlshutdown.exe} and
-@code{mysqlwatch.exe}
-@item David J. Hughes
-For the effort to make a shareware SQL database. We at TcX started with
-@code{mSQL}, but found that it couldn't satisfy our purposes so instead we
-wrote a SQL interface to our application builder Unireg. @code{mysqladmin}
-and @code{mysql} are programs that were largely influenced by their
-@code{mSQL} counterparts. We have put a lot of effort into making the
-@strong{MySQL} syntax a superset of @code{mSQL}. Many of the APIs ideas are
-borrowed from @code{mSQL} to make it easy to port free @code{mSQL} programs
-to @strong{MySQL}. @strong{MySQL} doesn't contain any code from @code{mSQL}.
-Two files in the distribution (@file{client/insert_test.c} and
-@file{client/select_test.c}) are based on the corresponding (non-copyrighted)
-files in the @code{mSQL} distribution, but are modified as examples showing
-the changes necessary to convert code from @code{mSQL} to @strong{MySQL}.
-(@code{mSQL} is copyrighted David J. Hughes.)
-@item Fred Fish
-For his excellent C debugging and trace library. Monty has made a number
-of smaller improvements to the library (speed and additional options).
-@item Richard A. O'Keefe
-For his public domain string library.
-@item Henry Spencer
-For his regex library, used in @code{WHERE column REGEXP regexp}.
-@item Free Software Foundation
-From whom we got an excellent compiler (@code{gcc}), the @code{libc} library
-(from which we have borrowed @file{strto.c} to get some code working in Linux)
-and the @code{readline} library (for the @code{mysql} client).
-@item Free Software Foundation & The XEmacs development team
-For a really great editor/environment used by almost everybody at TcX/detron.
-@item Patrick Lynch
-For helping us acquire @code{www.mysql.com}.
-@item Fred Lindberg
-For setting up qmail to handle @strong{MySQL} mailing list and for the
-incredible help we got in managing the @strong{MySQL} mailing lists.
-@item Igor Romanenko @email{igor@@frog.kiev.ua}
-@code{mysqldump} (previously @code{msqldump}, but ported and enhanced by
-Monty).
-@item Tim Bunce, Alligator Descartes
-For the @code{DBD} (Perl) interface.
-@item Andreas Koenig @email{a.koenig@@mind.de}
-For the Perl interface to @strong{MySQL}.
-@item Eugene Chan @email{eugene@@acenet.com.sg}
-For porting PHP to @strong{MySQL}.
-@item Michael J. Miller Jr. @email{mke@@terrapin.turbolift.com}
-For the first @strong{MySQL} manual. And a lot of spelling/language
-fixes for the FAQ (that turned into the @strong{MySQL} manual a long
-time ago).
-@item Giovanni Maruzzelli @email{maruzz@@matrice.it}
-For porting iODBC (Unix ODBC).
-@item Chris Provenzano
-Portable user level pthreads. From the copyright: This product includes
-software developed by Chris Provenzano, the University of California,
-Berkeley, and contributors. We are currently using version 1_60_beta6
-patched by Monty (see @file{mit-pthreads/Changes-mysql}).
-@item Xavier Leroy @email{Xavier.Leroy@@inria.fr}
-The author of LinuxThreads (used by @strong{MySQL} on Linux).
-@item Zarko Mocnik @email{zarko.mocnik@@dem.si}
-Sorting for Slovenian language and the @file{cset.tar.gz} module that makes
-it easier to add other character sets.
-@item "TAMITO" @email{tommy@@valley.ne.jp}
-The @code{_MB} character set macros and the ujis and sjis character sets.
-@item Yves Carlier @email{Yves.Carlier@@rug.ac.be}
-@code{mysqlaccess}, a program to show the access rights for a user.
-@item Rhys Jones @email{rhys@@wales.com} (And GWE Technologies Limited)
-For the JDBC, a module to extract data from @strong{MySQL} with a Java
-client.
-@item Dr Xiaokun Kelvin ZHU @email{X.Zhu@@brad.ac.uk}
-Further development of the JDBC driver and other @strong{MySQL}-related
-Java tools.
-@item James Cooper @email{pixel@@organic.com}
-For setting up a searchable mailing list archive at his site.
-@item Rick Mehalick @email{Rick_Mehalick@@i-o.com}
-For @code{xmysql}, a graphical X client for @strong{MySQL}.
-@item Doug Sisk @email{sisk@@wix.com}
-For providing RPM packages of @strong{MySQL} for RedHat Linux.
-@item Diemand Alexander V. @email{axeld@@vial.ethz.ch}
-For providing RPM packages of @strong{MySQL} for RedHat Linux-Alpha.
-@item Antoni Pamies Olive @email{toni@@readysoft.es}
-For providing RPM versions of a lot of @strong{MySQL} clients for Intel
-and SPARC.
-@item Jay Bloodworth @email{jay@@pathways.sde.state.sc.us}
-For providing RPM versions for @strong{MySQL} 3.21 versions.
-@item Jochen Wiedmann @email{wiedmann@@neckar-alb.de}
-For maintaining the Perl @code{DBD::mysql} module.
-@item Therrien Gilbert @email{gilbert@@ican.net}, Jean-Marc Pouyot @email{jmp@@scalaire.fr}
-French error messages.
-@item Petr snajdr, @email{snajdr@@pvt.net}
-Czech error messages.
-@item Jaroslaw Lewandowski @email{jotel@@itnet.com.pl}
-Polish error messages.
-@item Miguel Angel Fernandez Roiz
-Spanish error messages.
-@item Roy-Magne Mo @email{rmo@@www.hivolda.no}
-Norwegian error messages and testing of 3.21.#.
-@item Timur I. Bakeyev @email{root@@timur.tatarstan.ru}
-Russian error messages.
-@item @email{brenno@@dewinter.com} && Filippo Grassilli @email{phil@@hyppo.com}
-Italian error messages.
-@item Dirk Munzinger @email{dirk@@trinity.saar.de}
-German error messages.
-@item Billik Stefan @email{billik@@sun.uniag.sk}
-Slovak error messages.
-@item Stefan Saroiu @email{tzoompy@@cs.washington.edu}
-Romanian error messages.
-@item Peter Feher
-Hungarian error messages
-@item David Sacerdote @email{davids@@secnet.com}
-Ideas for secure checking of DNS hostnames.
-@item Wei-Jou Chen @email{jou@@nematic.ieo.nctu.edu.tw}
-Some support for Chinese(BIG5) characters.
-@item Wei He @email{hewei@@mail.ied.ac.cn}
-A lot of functionality for the Chinese(GBK) character set.
-@item Zeev Suraski @email{bourbon@@netvision.net.il}
-@code{FROM_UNIXTIME()} time formatting, @code{ENCRYPT()} functions, and
-@code{bison} advisor.
-Active mailing list member.
-@item Luuk de Boer @email{luuk@@wxs.nl}
-Ported (and extended) the benchmark suite to @code{DBI}/@code{DBD}. Have
-been of great help with @code{crash-me} and running benchmarks. Some new
-date functions. The mysql_setpermissions script.
-@item Jay Flaherty @email{fty@@utk.edu}
-Big parts of the Perl @code{DBI}/@code{DBD} section in the manual.
-@item Paul Southworth @email{pauls@@etext.org}, Ray Loyzaga @email{yar@@cs.su.oz.au}
-Proof-reading of the Reference Manual.
-@item Alexis Mikhailov @email{root@@medinf.chuvashia.su}
-User definable functions (UDFs); @code{CREATE FUNCTION} and
-@code{DROP FUNCTION}.
-@item Andreas F. Bobak @email{bobak@@relog.ch}
-The @code{AGGREGATE} extension to UDF functions.
-@item Ross Wakelin @email{R.Wakelin@@march.co.uk}
-Help to set up InstallShield for @strong{MySQL}-Win32.
-@item Jethro Wright III @email{jetman@@li.net}
-The @file{libmysql.dll} library.
-@item James Pereria @email{jpereira@@iafrica.com}
-Mysqlmanager, a Win32 GUI tool for administrating @strong{MySQL}.
-@item Curt Sampson @email{cjs@@portal.ca}
-Porting of MIT-pthreads to NetBSD/Alpha and NetBSD 1.3/i386.
-@item Sinisa Milivojevic @email{sinisa@@mysql.com}
-Compression (with @code{zlib}) to the client/server protocol.
-Perfect hashing for the lexical analyzer phase.
-@item Antony T. Curtis @email{antony.curtis@@olcs.net}
-Porting of @strong{MySQL} to OS/2.
-@item Martin Ramsch @email{m.ramsch@@computer.org}
-Examples in the @strong{MySQL} Tutorial.
-@item Tim Bunce
-Author of @code{mysqlhotcopy}.
-@item Steve Harvey
-For making @code{mysqlaccess} more secure.
-@item Jeremy Cole @email{jeremy@@spaceapes.com}
-Proofreading and editing this fine manual.
-@end table
-
-Other contributors, bugfinders and testers: James H. Thompson, Maurizio
-Menghini, Wojciech Tryc, Luca Berra, Zarko Mocnik, Wim Bonis, Elmar
-Haneke, @email{jehamby@@lightside}, @email{psmith@@BayNetworks.COM},
-@email{duane@@connect.com.au}, Ted Deppner @email{ted@@psyber.com},
-Mike Simons, Jaakko Hyv@"atti.
-
-And lots of bug report/patches from the folks on the mailing list.
-
-And a big tribute to those that help us answer questions on the
-@code{mysql@@lists.mysql.com} mailing list:
-
-@table @asis
-@item Daniel Koch @email{dkoch@@amcity.com}
-Irix setup.
-@item Luuk de Boer @email{luuk@@wxs.nl}
-Benchmark questions.
-@item Tim Sailer @email{tps@@users.buoy.com}
-@code{DBD-mysql} questions.
-@item Boyd Lynn Gerber @email{gerberb@@zenez.com}
-SCO related questions.
-@item Richard Mehalick @email{RM186061@@shellus.com}
-@code{xmysql}-related questions and basic installation questions.
-@item Zeev Suraski @email{bourbon@@netvision.net.il}
-Apache module configuration questions (log & auth), PHP-related
-questions, SQL syntax related questions and other general questions.
-@item Francesc Guasch @email{frankie@@citel.upc.es}
-General questions.
-@item Jonathan J Smith @email{jsmith@@wtp.net}
-Questions pertaining to OS-specifics with Linux, SQL syntax, and other
-things that might be needing some work.
-@item David Sklar @email{sklar@@student.net}
-Using @strong{MySQL} from PHP and Perl.
-@item Alistair MacDonald @email{A.MacDonald@@uel.ac.uk}
-Not yet specified, but is flexible and can handle Linux and maybe HP-UX.
-Will try to get user to use @code{mysqlbug}.
-@item John Lyon @email{jlyon@@imag.net}
-Questions about installing @strong{MySQL} on Linux systems, using either
-@file{.rpm} files, or compiling from source.
-@item Lorvid Ltd. @email{lorvid@@WOLFENET.com}
-Simple billing/license/support/copyright issues.
-@item Patrick Sherrill @email{patrick@@coconet.com}
-ODBC and VisualC++ interface questions.
-@item Randy Harmon @email{rjharmon@@uptimecomputers.com}
-@code{DBD}, Linux, some SQL syntax questions.
-@end table
-
-@node News, Bugs, Credits, Top
-@appendix @strong{MySQL} change history
-
-¿·¤·¤¤Êѹ¹¤ò @strong{MySQL} ¤Ë»Ü¤¹¤ÈƱ»þ¤Ë¡¢¥Þ¥Ë¥å¥¢¥ë¤òÊѹ¹¤¹¤ë¤³¤È¤ËÃí°Õ¤·¤Æ¤¯¤À¤µ¤¤¡£
-¤â¤·¥Þ¥Ë¥å¥¢¥ë¤Ë¤«¤«¤ì¤Æ¤¤¤ë¤Î¤Ë
-@uref{http://www.mysql.com/download.html,@strong{MySQL} download page} ¤Ë
-¿·¤·¤¤¥Ð¡¼¥¸¥ç¥ó¤Î MySQL ¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¡¢¤½¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï¤Þ¤À¥ê¥ê¡¼¥¹¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡ª
-
-@menu
-* News-3.23.x:: Changes in release 3.23.x (Released as alpha)
-* News-3.22.x:: Changes in release 3.22.x (Recommended version)
-* News-3.21.x:: Changes in release 3.21.x
-* News-3.20.x:: Changes in release 3.20.x
-* News-3.19.x:: Changes in release 3.19.x
-@end menu
-
-@node News-3.23.x, News-3.22.x, News, News
-@appendixsec Changes in release 3.23.x (Released as alpha)
-
-¥ê¥ê¡¼¥¹3.23¡¢¤ª¤è¤Ó¥ê¥ê¡¼¥¹3.22¤È3.21¤È¤Î°ã¤¤¤Ï¡¢
-3.23¤¬¿·¤·¤¤ISAM¥é¥¤¥Ö¥é¥ê( MyISAM )¤ò´Þ¤à¤È¤¤¤¦¤³¤È¤Ç¤¹¡£
-¤³¤ì¤Ï¸Å¤¤ISAM¤è¤ê¡¢SQL¤Ë¤È¤Ã¤Æ¤è¤ê¥Á¥å¡¼¥Ë¥ó¥°¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-
-3.23¥ê¥ê¡¼¥¹¤Ï³«È¯Ãæ¤Ç¡¢µ¡Ç½¤Ï®¤¤¥Ú¡¼¥¹¤ÇÉÕ¤±²Ã¤¨¤é¤ì¤ë¤Ç¤·¤ç¤¦¡£
-¤µ¤·¤¢¤¿¤ê¡¢²æ¡¹¤Ï¡¢¤³¤Î¥ê¥ê¡¼¥¹¤ò¡¢¤³¤Î¥ê¥ê¡¼¥¹¤Î¤ß¤Ë¤¢¤ëµ¡Ç½
-(Âç¥Õ¥¡¥¤¥ë¤Î¥µ¥Ý¡¼¥È¡¢¤ª¤è¤Ó¡¢¥Þ¥·¥óÈó°Í¸¤Î¥Æ¡¼¥Ö¥ë)¤ò
-ɬÍפȤ·¤Æ¤¤¤ë¥æ¡¼¥¶¡¼¤ËÂФ·¤Æ¤Î¤ß¡¢¿äÁ¦¤·¤Þ¤¹¡£
-( MySQL 3.23¤ÎÁ´¤Æ¤Î¿·¤·¤¤µ¡Ç½¤Ï¡¢¹­¤¯¥Æ¥¹¥È¤µ¤ì¤Þ¤¹¡£
-¤·¤«¤·¡¢¤³¤Î¥ê¥ê¡¼¥¹¤¬Â¿¤¯¤Î¿··¿¥³¡¼¥É¤ò´Þ¤à¤Î¤Ç¡¢¤¹¤Ù¤Æ¤ò¥Æ¥¹¥È¤¹¤ë¤³¤È¤¬Æñ¤·¤¤¤Ç¤¹)¡£
-
-We are not adding any more new features that are likely to break any
-old code in @strong{MySQL} 3.23 so this version should stabilise pretty soon
-and will soon be declared beta, gamma and release.
-
-@menu
-* News-3.23.18:: Changes in release 3.23.18
-* News-3.23.17:: Changes in release 3.23.17
-* News-3.23.16:: Changes in release 3.23.16
-* News-3.23.15:: Changes in release 3.23.15
-* News-3.23.14:: Changes in release 3.23.14
-* News-3.23.13:: Changes in release 3.23.13
-* News-3.23.12:: Changes in release 3.23.12
-* News-3.23.11:: Changes in release 3.23.11
-* News-3.23.10:: Changes in release 3.23.10
-* News-3.23.9:: Changes in release 3.23.9
-* News-3.23.8:: Changes in release 3.23.8
-* News-3.23.7:: Changes in release 3.23.7
-* News-3.23.6:: Changes in release 3.23.6
-* News-3.23.5:: Changes in release 3.23.5
-* News-3.23.4:: Changes in release 3.23.4
-* News-3.23.3:: Changes in release 3.23.3
-* News-3.23.2:: Changes in release 3.23.2
-* News-3.23.1:: Changes in release 3.23.1
-* News-3.23.0:: Changes in release 3.23.0
-@end menu
-
-@node News-3.23.18, News-3.23.17, News-3.23.x, News-3.23.x
-@appendixsubsec Changes in release 3.23.18
-@itemize @bullet
-@item
-Fixed a problem from 3.23.17 when choosing character set on the client side.
-@item
-Added @code{FLUSH TABLES WITH READ LOCK} to make a global lock suitable to
-make a copy of @strong{MySQL} data files.
-@item
-@code{CREATE TABLE ... SELECT ... PROCEDURE} now works.
-@item
-Internal temporary tables will now uses compressed index when using
-@code{GROUP BY} on @code{VARCHAR/CHAR} columns.
-@item
-Fixed a problem when locking the same table with both a @code{READ} and a
-@code{WRITE} lock.
-@item
-Fixed problem with myisamchk and @code{RAID} tables.
-@end itemize
-
-@node News-3.23.17, News-3.23.16, News-3.23.18, News-3.23.x
-@appendixsubsec Changes in release 3.23.17
-@itemize @bullet
-@item
-Fixed a bug in @code{find_in_set()} when the first argument was @code{NULL}.
-@item
-Added table locks to Berkeley DB.
-@item
-Fixed a bug with @code{LEFT JOIN} and @code{ORDER BY} where the first
-table had only one matching row.
-@item
-Added 4 sample @code{my.cfg} example files in the @file{support-files}
-directory.
-@item
-Fixed @code{duplicated key} problem when doing big @code{GROUP BY}'s.
-(This bug was probably introduced in 3.23.15).
-@item
-Changed syntax for @code{INNER JOIN} to match ANSI SQL.
-@item
-Added @code{NATURAL JOIN} syntax.
-@item
-A lot of fixes in the @code{BDB} interface.
-@item
-Added handling of @code{--no-defaults} and @code{--defaults-file} to
-@code{safe_mysqld.sh} and @code{mysql_install_db.sh}.
-@item
-Fixed bug in reading compressed tables with many threads.
-@item
-Fixed that @code{USE INDEX} works with @code{PRIMARY} keys.
-@item
-Added @code{BEGIN} statement to start a transaction in @code{AUTOCOMMIT} mode.
-@item
-Added symbolic links support for Win32.
-@item
-Changed protocol to let client know if the server is in AUTOCOMMIT mode
-and if there is a pending transaction. If there is a pending transaction
-the client library will give an error before reconnecting to the server to
-let the client know that the server did a rollback.
-The protocol is still backward compatible with old clients
-@item
-@code{KILL} now works on a thread that is locked on a 'write' to a dead client.
-@item
-Fixed memory leak in the replication slave thread
-@item
-Added new option @code{log-slave-updates} to allow daisy-chaining the slaves
-@item
-Fixed compile error on FreeBSD and other systems where @code{pthread_t}
-is not the same as @code{int}
-@item
-Fixed master shutdown aborting the slave thread
-@item
-Fixed a race condition in @code{INSERT DELAYED} code when doing
-@code{ALTER TABLE}.
-@item
-Added deadlock detection sanity checks to @code{INSERT DELAYED}
-@end itemize
-
-@node News-3.23.16, News-3.23.15, News-3.23.17, News-3.23.x
-@appendixsubsec Changes in release 3.23.16
-@itemize @bullet
-@item
-Added option @code{TYPE=QUICK} to @code{CHECK} and @code{REPAIR}.
-@item
-Fixed bug in @code{REPAIR TABLE} when the table was in use by other threads.
-@item
-Added a thread cache to make it possible to debug @strong{MySQL} with
-@code{gdb} when one does a lot of reconnects. This will also improve
-systems where you can't use persistent connections.
-@item
-Lots of fixes in the Berekely DB interface.
-@item
-@code{UPDATE IGNORE} will not abort if an update results in a
-@code{DUPLICATE_KEY} error.
-@item
-Put @code{CREATE TEMPORARY TABLE} commands in the update log.
-@item
-Fixed bug in handling of masked IP numbers in the privilege tables.
-@item
-Fixed bug with @code{delayed_key_writes} tables and @code{CHECK TABLE}.
-@item
-Added @code{replicate-do-db} and @code{replicate-ignore-db} options to
-restrict which databases get replicated
-@item
-Added @code{SQL_LOG_BIN} option
-@end itemize
-
-@node News-3.23.15, News-3.23.14, News-3.23.16, News-3.23.x
-@appendixsubsec Changes in release 3.23.15
-@itemize @bullet
-@item
-To start @code{mysqld} as @code{root} one must now use the @code{--user=root} option.
-@item
-Added interface to Berkeley DB. (This is not yet functional; Play with it at
-your own risk!)
-@item
-Replication between master and slaves.
-@item
-Fixed bug that other threads could steal a lock when a thread had
-a lock on a table and did a @code{FLUSH TABLES} command.
-@item
-Added the @code{slow_launch_time} variable and the @code{Slow_launch_threads}
-status variable to @code{mysqld}. These can be examined with
-@code{mysqladmin variables} and @code{mysqladmin extended-status}.
-@item
-Added functions @code{INET_NTOA()} and @code{INET_ATON()}.
-@item
-The default type of @code{IF()} now depends on the second and
-third arguments and not only on the second argument.
-@item
-Fixed case when @code{myisamchk} could go into a loop when trying to
-repair a crashed table.
-@item
-Don't write @code{INSERT DELAYED} to update log if @code{SQL_LOG_UPDATE=0}.
-@item
-Fixed problem with @code{REPLACE} on @code{HEAP} tables.
-@item
-Added possible character sets and time zone to @code{SHOW VARIABLES}.
-@item
-Fixed bug in locking code that could result it locking problems with
-concurrent inserts under high load.
-@item
-Fixed a problem with @code{DELETE} of many rows on a table with
-compressed keys where @strong{MySQL} scanned the index to find the rows.
-@item
-Fixed problem with @code{CHECK} on table with deleted keyblocks.
-@item
-Fixed a bug in reconnect (at the client side) where it didn't free memory
-properly in some contexts.
-@item
-Fixed problems in update log when using @code{LAST_INSERT_ID()} to update
-a table with an auto_increment key.
-@item
-Added function @code{NULLIF()}.
-@item
-Fixed bug when using @code{LOAD DATA INFILE} on a table with
-@code{BLOB/TEXT} columns.
-@item
-Optimised MyISAM to be faster when inserting keys in sorted order.
-@item
-@code{EXPLAIN SELECT..} now also prints out whether @strong{MySQL} needs to
-create a temporary table or use file sorting when resolving the @code{SELECT}.
-@item
-Added optimization to skip @code{ORDER BY} parts where the part is a
-constant expression in the @code{WHERE} part. Indexes can now be used
-even if the @code{ORDER BY} doesn't match the index exactly, as long as
-all the not used index parts and all the extra @code{ORDER BY}
-columns are constants in the @code{WHERE} clause. @xref{MySQL indexes}.
-@item
-@code{UPDATE} and @code{DELETE} on a whole unique key in the @code{WHERE} part,
-is now faster than before.
-@item
-Changed @code{RAID_CHUNKSIZE} to be in 1024 byte increments.
-@item
-Fixed coredump in LOAD_FILE(NULL) - you have to be as stupid as Sasha to try this :-)
-@end itemize
-
-@node News-3.23.14, News-3.23.13, News-3.23.15, News-3.23.x
-@appendixsubsec Changes in release 3.23.14
-@itemize @bullet
-@item
-Fixed a bug in @code{CONCAT()} where one of the arguments was a function
-that returned a modified argument.
-@item
-@code{myisamchk} ¤ÎÃ×̿Ū¤Ê¥Ð¥°¤ò½¤Àµ¤·¤¿¡£ ¤³¤Î¥Ð¥°¤Ï¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ëÃæ¤Î
-¥Ø¥Ã¥À¡¼¤ò¡¢¥Æ¡¼¥Ö¥ë¤ò¥Á¥§¥Ã¥¯¤·¤Æ¤¤¤ë¤À¤±¤Ê¤Î¤Ë¤â¤«¤«¤ï¤é¤º¡¢¹¹¿·¤·¤Æ¤¤¤¿¡£
-This confused the
-@code{mysqld} daemon if it updated the same table at the same time. Now
-the status in the index file is only updated if one uses
-@code{--update-state}. With older @code{myisamchk} versions you shoul
-use @code{--read-only} when only checking tables, if there is the
-slightest chance that the @code{mysqld} server is working on the table at the
-same time!
-@item
-Fixed that @code{DROP TABLE} is logged in the update log.
-@item
-Fixed problem when searching on @code{DECIMAL()} key field
-where the column data contained leading zeros.
-@item
-auto_increment ¤¬ºÇ½é¤Î¥­¡¼¤Ç¤Ê¤¤¾ì¹ç¤Î @code{myisamchk} ¤Î¥Ð¥°¤ò½¤Àµ¡£
-@item
-Allow @code{DATETIME} in ISO8601 format: 2000-03-12T12:00:00
-@item
-ưŪ¥­¥ã¥é¥¯¥¿¥»¥Ã¥È¡£ £±¸Ä¤Î @code{mysqld} ¥Ð¥¤¥Ê¥ê¤Ç¡¢Â¿¤¯¤Î°ã¤¦
-¥­¥ã¥é¥¯¥¿¥»¥Ã¥È¤ò°·¤¨¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£
-(@code{mysqld} ¥¹¥¿¡¼¥È»þ¤Ë»ØÄê¤Ç¤­¤Þ¤¹).
-@item
-@code{REPAIR TABLE} ¥³¥Þ¥ó¥É¤òÄɲá£
-@item
-@code{mysql_thread_safe()} C API ´Ø¿ô¤òÄɲá£
-@item
-@code{UMASK_DIR} ´Ä¶­ÊÑ¿ô¤òÄɲá£
-@item
-@code{CONNECTION_ID()} ´Ø¿ô¤òÄɲÃ
-@item
-When using @code{=} on @code{BLOB} or @code{VARCHAR BINARY} keys, where
-only a part of the column was indexed, the whole column of the result
-row wasn't compared.
-@item
-sjis ¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È¤Î @code{ORDER BY} ¤ÎÌäÂê¤ò½¤Àµ
-@item
-When running in ANSI mode, don't allow columns to be used that aren't in
-the @code{GROUP BY} part.
-@end itemize
-
-@node News-3.23.13, News-3.23.12, News-3.23.14, News-3.23.x
-@appendixsubsec Changes in release 3.23.13
-@itemize @bullet
-@item
-Fixed problem when doing locks on the same table more than 2 times in
-the same @code{LOCK TABLE} command; This fixed the problem one got when running
-the test-ATIS test with @code{--fast}.
-@item
-@code{SQL_BUFFER_RESULT} ¥ª¥×¥·¥ç¥ó¤ò @code{SELECT} ¤ËÄɲÃ
-@item
-Removed end space from double/float numbers in results from temporary
-tables.
-@code{CHECK TABLE} ¥³¥Þ¥ó¥É¤ÎÄɲá£
-@item
-Added changes for MyISAM in 3.23.12 that didn't get into the source
-distribution because of CVS problems.
-@item
-Fixed bug so that mysqladmin shutdown will wait for the local server to close
-down.
-@item
-Fixed a possible endless loop when calculating timestamp.
-@item
-Added print_defaults to the .rpm files. Removed mysqlbug from the client
-rpm file.
-@end itemize
-
-@node News-3.23.12, News-3.23.11, News-3.23.13, News-3.23.x
-@appendixsubsec Changes in release 3.23.12
-@itemize @bullet
-@item
-Fixed bug in @code{MyISAM} involving @code{REPLACE ... SELECT} which could
-give a corrupted table.
-@item
-Fixed bug in @code{myisamchk} where it wrongly reset the auto_increment value.
-@item
-Linux Alpha ÍѤË¿¤¯¤Î¥Ñ¥Ã¥Á¤òÄɲÃ. @strong{MySQL} now appears to be relatively
-stable on Alpha.
-@item
-½ÅÊ£¤·¤¿¥ì¥³¡¼¥É¤ò®¤¯¸«¤Ä¤±¤ë¤¿¤á¤Î¥Ï¥Ã¥·¥å²½¤µ¤ì¤¿¥­¡¼¤ò»ÈÍѤ¹¤ë¤¿¤á¤Ë¡¢
-@code{HEAP} °ì»þ¥Æ¡¼¥Ö¥ë¾å¤Î @code{DISTINCT} ¤òÊѹ¹¤·¤¿¡£
-This mostly concerns queries of
-type @code{SELECT DISTINCT ... GROUP BY ..}. This fixes a problem where
-not all duplicates were removed in queries of the above type.
-¿·¤·¤¯Äɲä·¤¿¥³¡¼¥É¤Ï¡¢¤È¤Æ¤â®¤¤¡£
-@item
-MacOS X ¤Ç @code{MySQL} ¤ò¥³¥ó¥Ñ¥¤¥ë¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¥Ñ¥Ã¥Á¤ÎÄɲÃ
-@item
-¥ª¥×¥·¥ç¥ó @code{IF NOT EXISTS} ¤ò @code{CREATE DATABASE} ¤ËÄɲÃ.
-@item
-¿¤¯¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤òƱ»þ¤Ë¥À¥ó¥×¤Ç¤­¤ë¤è¤¦¤Ë¡¢
-@code{--all-databases} ¤È @code{--databases} ¥ª¥×¥·¥ç¥ó¤ò @code{mysqldump} ¤ËÄɲá£
-@item
-@code{MyISAM} ·¿¥Æ¡¼¥Ö¥ëÃæ¤Î°µ½Ì¤·¤¿ @code{DECIMAL()} ¥¤¥ó¥Ç¥Ã¥¯¥¹¤Î¥Ð¥°¤ò½¤Àµ¤·¤¿¡£
-@item
-0 ¤ò timestamp ¤ËÊݸ¤·¤¿¤È¤­¤Î¥Ð¥°¤ò½¤Àµ¤·¤¿¡£
-@item
-¥í¡¼¥«¥ë¤ÎÀܳ¤Ç @code{mysqladmin shutdown} ¤ò¼Â¹Ô¤·¤¿¾ì¹ç¤Ë¡¢@code{mysqladmin} ¤Ï
-½ªÎ»Á°¤Ë pidfile ¤¬Ìµ¤¯¤Ê¤ë¤Þ¤ÇÂԤĤ褦¤Ë¤Ê¤Ã¤¿¡£
-@item
-¤¤¤¯¤Ä¤«¤Î @code{COUNT(DISTINCT ...)} ¥¯¥¨¥ê¤Ç¥³¥¢¤òÅǤ¤¤¿¤Î¤ò½¤Àµ¤·¤¿¡£
-@item
-Fixed that @code{myisamchk} works properly with RAID:ed tables.
-@item
-Fixed problem with @code{LEFT JOIN} and @code{key_field IS NULL}.
-@item
-Fixed bug in @code{net_clear()} which could give the error @code{Aborted
-connection} in the @strong{MySQL} clients.
-@item
-Added options @code{USE INDEX (key_list)} and @code{IGNORE INDEX (key_list)} as
-join parameters in @code{SELECT}.
-@item
-@code{DELETE} and @code{RENAME} should now work on @code{RAID} tables.
-@end itemize
-
-@node News-3.23.11, News-3.23.10, News-3.23.12, News-3.23.x
-@appendixsubsec Changes in release 3.23.11
-@itemize @bullet
-@item
-@code{ALTER TABLEL tbl_name ADD (field_list)} ʸ¤òµö²Ä¤·¤¿¡£
-@item
-Fixed problem with optimizer that could sometimes use wrong keys.
-@item
-@code{GRANT/REVOKE ALL PRIVILEGES} ¤¬ @code{GRANT OPTION} ¤Ë±Æ¶Á¤·¤Ê¤«¤Ã¤¿¤Î¤ò½¤Àµ¡£
-@item
-Removed extra @code{)} from the output of @code{SHOW GRANTS}
-@item
-Fixed problem when storing numbers in timestamps.
-@item
-Fix problem with timezones that have half hour offsets.
-@item
-@code{CREATE} ʸ¤Ç¤Î @code{UNIQUE INDEX} ¤Î»ÈÍѤòµö²Ä¡£
-@item
-@code{mysqlhotcopy} - ¥í¡¼¥«¥ë¤Î @strong{MySQL} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¥Ð¥Ã¥¯¥¢¥Ã¥×¤¹¤ë
-¥Ä¡¼¥ë¡£ By Tim Bunce.
-@item
-¿·¤·¤¤ @code{mysqlaccess}. Thanks to Steve Harvey for this.
-@item
-@code{--i-am-a-dummy} ¤È @code{--safe-updates} ¥ª¥×¥·¥ç¥ó¤ò @code{mysql} ¤ËÄɲá£
-@item
-@code{select_limit} ¤È @code{max_join_size} ÊÑ¿ô¤ò @code{mysql} ¤ËÄɲá£
-@item
-SQL ¤ÎÊÑ¿ô¤òÄɲ᧠@code{SQL_MAX_JOIN_SIZE} ¤È @code{SQL_SAFE_UPDATES}.
-@item
-Added @code{READ LOCAL} lock that doesn't lock the table for concurrent
-inserts. (This is used by @code{mysqldump}).
-@item
-Changed that @code{LOCK TABLES .. READ} doesn't anymore allow concurrent
-inserts.
-@item
-¥ª¥×¥·¥ç¥ó @code{--skip-delay-key-write} ¤ò @code{mysqld} ¤ËÄɲá£
-@item
-Fixed security problem in the protocol regarding password checking.
-@item
-@code{_rowid} can now be used as an alias for an integer type unique indexed
-column.
-@item
-Added back blocking of @code{SIGPIPE} when compiling with @code{--thread-safe-clients}
-to make things safe for old clients.
-@end itemize
-
-@node News-3.23.10, News-3.23.9, News-3.23.11, News-3.23.x
-@appendixsubsec Changes in release 3.23.10
-@itemize @bullet
-@item
-Fixed bug in 3.23.9 where memory wasn't properly freed when doing
-@code{LOCK TABLES}.
-@end itemize
-
-@node News-3.23.9, News-3.23.8, News-3.23.10, News-3.23.x
-@appendixsubsec Changes in release 3.23.9
-@itemize @bullet
-@item
-Fixed problem that affected queries that did arithmetic on group functions.
-@item
-Fixed problem with timestamps and @code{INSERT DELAYED}.
-@item
-Fixed that @code{date_column BETWEEN const_date AND const_date} works.
-@item
-Fixed problem when only changing a 0 to @code{NULL} in a table with
-@code{BLOB/TEXT} columns.
-@item
-Fixed bug in range optimizer when using many key parts and or on the middle
-key parts: @code{WHERE K1=1 and K3=2 and (K2=2 and K4=4 or K2=3 and K4=5)}
-@item
-@code{source} ¥³¥Þ¥ó¥É¤ò @code{mysql} ¤ËÄɲᣠ¤³¤ì¤Ï @code{mysql} ¥¯¥é¥¤¥¢¥ó¥ÈÆâ
-¤Ç¡¢¥Ð¥Ã¥Á¥Õ¥¡¥¤¥ë¤òÆɤळ¤È¤¬¤Ç¤­¤ë¡£ Original patch by Matthew Vanecek.
-@item
-@code{WITH GRANT OPTION} ¥ª¥×¥·¥ç¥ó¤ÎÃ×̿Ū¤Ê¥Ð¥°¤ò½¤Àµ
-@item
-Don't give an unnecessary @code{GRANT} error when using tables from many
-databases in the same query.
-@item
-Added VIO wrapper (needed for SSL support ; By Andrei Errapart and
-Tnu Samuel).
-@item
-Fixed optimizer problem on @code{SELECT} when using many overlapping indexes.
-@strong{MySQL} should now be able to choose keys even better when there
-is many keys to choose from.
-@item
-Changed optimizer to prefer a range key instead of a ref key when the
-range key can uses more columns than the ref key (which only can use
-columns with =). For example, the following type of queries should now
-be faster: @code{SELECT * from key_part_1=const and key_part_2 > const2}
-@item
-Fixed bug that a change of all @code{VARCHAR} columns to @code{CHAR} columns
-didn't change row type from dynamic to fixed.
-@item
-Disabled floating point exceptions for FreeBSD to fix core dump when
-doing @code{SELECT floor(pow(2,63))}.
-@item
-@code{mysqld} ¤Îµ¯Æ°¥ª¥×¥·¥ç¥ó @code{--delay-key-write} ¤ò
-@code{--delay-key-write-for-all-tables} ¤ËÊѹ¹
-@item
-Added @code{read-next-on-key} to @code{HEAP} tables. This should fix all
-problems with @code{HEAP} tables when using not @code{UNIQUE} keys.
-@item
-ÊÑ¿ô¤Î¥Ç¥Õ¥©¥ë¥È¤òɽ¼¨¤¹¤ë¥ª¥×¥·¥ç¥ó¤ò¥¯¥é¥¤¥¢¥ó¥È¤ËÄɲÃ
-@item
-@code{mysqld} ¤Ë @code{--log-slow-queries} ¤òÄɲᣠ¤³¤ì¤Ï»þ´Ö¤Î¤«¤«¤Ã¤¿
-Á´¤Æ¤Î¥¯¥¨¥ê¤òÊÌ¤Î¥í¥°¥Õ¥¡¥¤¥ë¤Ëµ­Ï¿¤¹¤ë¡£¤É¤Î¤¯¤é¤¤»þ´Ö¤¬¤«¤«¤Ã¤¿¤«¤¬µ­¤µ¤ì¤ë
-@item
-@code{WHERE key_column=RAND(...)} ¤ò¹Ô¤Ã¤¿¤È¤­¥³¥¢¤òÅǤ¯¥Ð¥°¤ò½¤Àµ
-@item
-Fixed optimization bug in @code{SELECT .. LEFT JOIN ... key_column IS NULL},
-when @code{key_column} could contain @code{NULL} values.
-@item
-Fixed problem with 8-bit characters as separators in @code{LOAD DATA INFILE}.
-@end itemize
-
-@node News-3.23.8, News-3.23.7, News-3.23.9, News-3.23.x
-@appendixsubsec Changes in release 3.23.8
-@itemize @bullet
-@item
-8G ¤è¤êÂ礭¤Ê¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥¡¥¤¥ë¤ò°·¤Ã¤¿¾ì¹ç¤ÎÌäÂê¤ò½¤Àµ¡£
-@item
-NetBSD ÍѤκǿ·¤Î mit-pthread ¤Î¥Ñ¥Ã¥Á¤òÄɲá£
-@item
-¥¿¥¤¥à¥¾¡¼¥ó < GMT - 11 ¤Î¾ì¹ç¤ÎÌäÂê¤ò½¤Àµ¡£
-@item
-@code{NISAM} Ãæ¤Î¥Ñ¥Ã¥¯¤µ¤ì¤¿¥­¡¼¤Îºï½ü»þ¤Î¥Ð¥°¤ò½¤Àµ¡£
-@item
-¤¤¤¯¤Ä¤« @code{ORDER BY ... DESC} ¥¯¥¨¥ê¤ò¼Â¹Ô¤·¤¿ºÝ¤Î @code{ISAM} ¤ÎÌäÂê¤ò½¤Àµ¡£
-@item
-Fixed bug when doing a join on a text key which didn't covert the whole key.
-@item
-¥ª¥×¥·¥ç¥ó @code{--delay-key-write} ¤¬ delayed key writing ¤òÍ­¸ú¤Ë¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¤Î¤ò½¤Àµ¡£
-@item
-Fixed update of @code{TEXT} column which only involved case changes.
-@item
-Fixed that @code{INSERT DELAYED} doesn't update timestamps that are given.
-@item
-@code{YEARWEEK()} ´Ø¿ô¤ÎÄɲäȡ¢@code{x}, @code{X}, @code{v},
-@code{V} ¥ª¥×¥·¥ç¥ó¤Î @code{DATE_FORMAT()} ¤Ø¤ÎÄɲá£
-@item
-Fixed problem with @code{MAX(indexed_column)} and HEAP tables.
-@item
-Fixed problem with @code{BLOB NULL} keys and @code{LIKE} "prefix%".
-@item
-Fixed problem with @code{MyISAM} and fixed length rows < 5 bytes.
-@item
-Fixed problem that could cause @strong{MySQL} to touch freed memory when
-doing very complicated @code{GROUP BY} queries.
-@item
-Fixed core dump if you got a crashed table where an @code{ENUM} field value
-was too big.
-@end itemize
-
-@node News-3.23.7, News-3.23.6, News-3.23.8, News-3.23.x
-@appendixsubsec Changes in release 3.23.7
-@itemize @bullet
-@item
-Linux´Ä¶­²¼¤Ë¤ª¤¤¤Æ¡¢@code{pthread_mutex_timedwait} ¤ÎÌäÂê¤òÈò¤±¤ë¤è¤¦¤Ë¤·¤¿¡£
-¤³¤Î´Ø¿ô¤Ï @code{INSERT DELAYED} ¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤¿¡£ @xref{Linux}.
-@item
-Fixed that one will get at 'disk full' error message if one gets disk full
-when doing sorting (instead of waiting until we got more disk space).
-@item
-@code{MyISAM} ¤Ç¡¢¥­¡¼¤¬ 250 ʸ»ú¤òĶ¤¨¤¿¾ì¹ç¤Î¥Ð¥°¤ò½¤Àµ¡£
-@item
-@code{MyISAM} ¤Ë¤ª¤¤¤Æ¡¢Â¾¤Î¥¹¥ì¥Ã¥É¤¬Æɤó¤Ç¤¤¤ë¥Æ¡¼¥Ö¥ë¤ËÂФ·¡¢
-¾¤Î¥¹¥ì¥Ã¥É¤¬ @code{INSERT} ¤òƱ»þ¤Ë¹Ô¤¦¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£
-@item
-Added variable @code{max_write_lock_count} to @code{mysqld} to force a
-@code{READ} lock after a certain number of @code{WRITE} locks.
-@item
-Inverted flag @code{delayed_key_write} on @code{show variables}.
-@item
-@code{concurrency} ÊÑ¿ô¤ò @code{thread_concurrency} ¤Ë²þ̾¡£
-@item
-°Ê²¼¤Î´Ø¿ô¤¬¥Þ¥ë¥Á¥Ð¥¤¥È¡¦¥»¡¼¥Õ¤Ë¤Ê¤Ã¤¿¡§
-@code{LOCATE(substr,str)}, @code{POSITION(substr IN str)},
-@code{LOCATE(substr,str,pos)}, @code{INSTR(str,substr)},
-@code{LEFT(str,len)}, @code{RIGHT(str,len)},
-@code{SUBSTRING(str,pos,len)}, @code{SUBSTRING(str FROM pos FOR len)},
-@code{MID(str,pos,len)}, @code{SUBSTRING(str,pos)}, @code{SUBSTRING(str
-FROM pos)}, @code{SUBSTRING_INDEX(str,delim,count)}, @code{RTRIM(str)},
-@code{TRIM([[BOTH | TRAILING] [remstr] FROM] str)},
-@code{REPLACE(str,from_str,to_str)}, @code{REVERSE(str)},
-@code{INSERT(str,pos,len,newstr)}, @code{LCASE(str)}, @code{LOWER(str)},
-@code{UCASE(str)} and @code{UPPER(str)}; Patch by Wei He.
-@item
-Fix core dump when releasing a lock from a non-existant table.
-@item
-Remove locks on tables before starting to remove duplicates.
-@item
-@code{FULL} ¥ª¥×¥·¥ç¥ó¤ò @code{SHOW PROCESSLIST} ¤ËÄɲá£
-@item
-@code{--verbose} ¥ª¥×¥·¥ç¥ó¤ò @code{mysqladmin} ¤ËÄɲá£
-@item
-HEAP ¤Î MyISAM ¤Ø¤Î¼«Æ°ÊÑ´¹»þ¤Î¥Ð¥°¤ò½¤Àµ¡£
-@item
-HEAP ¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ¡¢insert + delete + insert + scan table ¤ò¹Ô¤Ã¤¿ºÝ¤Î
-¥Ð¥°¤ò½¤Àµ¡£
-@item
-Alpha ¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¾å¤Ç¤Î¡¢@code{REPLACE()} ¤È @code{LOAD DATA INFILE}
-¤Î¥Ð¥°¤ò½¤Àµ¡£
-@item
-@code{mysqld} ÊÑ¿ô¤Ë @code{interactive_timeout} ¤òÄɲÃ.
-@item
-@code{mysql_data_seek()} ¤Î°ú¿ô¤ò @code{ulong} ¤«¤é @code{ulonglong} ¤Ë
-Êѹ¹.
-@end itemize
-
-@node News-3.23.6, News-3.23.5, News-3.23.7, News-3.23.x
-@appendixsubsec Changes in release 3.23.6
-
-@itemize @bullet
-@item
-@code{mysqld} ¤Ë @code{-O lower_case_table_names=@{0|1@}} ¥ª¥×¥·¥ç¥ó¤òÄɲá£
-¤³¤ì¤Ï¥Æ¡¼¥Ö¥ë̾¤ò¶¯À©Åª¤Ë¾®Ê¸»ú¤Ë¤·¤Þ¤¹¡£
-@item
-@code{SELECT ... INTO DUMPFILE} Äɲá£
-@item
-mysqld ¤Ë @code{--ansi} ¥ª¥×¥·¥ç¥ó¤òÄɲᣠ¤³¤ì¤Ï¤¤¤¯¤Ä¤«¤Î´Ø¿ô¤ò
-@code{ANSI SQL} ¸ß´¹¤Ë¤·¤Þ¤¹¡£
-@item
-Temporary tables now starts with @code{#sql}.
-@item
-Added quoting of identifiers with @code{`} (@code{"} in @code{--ansi} mode).
-@item
-Changed to use snprintf() when printing floats to avoid some buffer
-overflows on FreeBSD.
-@item
-FreeBSD ¾å¤Ç¡¢@code{floor()} ¤ò¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¥»¡¼¥Õ¤Ë¤·¤¿¡£
-@item
-@code{--quote-names} ¥ª¥×¥·¥ç¥ó¤ò @code{mysqldump} ¤ËÄɲÃ
-@item
-Fixed bug that one could make a part of a @code{PRIMARY KEY NOT NULL}.
-@item
-Fixed @code{encrypt()} to be thread safe and not reuse buffer.
-@item
-MyODBC ¤Î @code{mysql_odbc_escape_string()} ´Ø¿ô¤¬¡¢big5 ¤ò¥µ¥Ý¡¼¥È¤·¤¿¡£
-@item
-Rewrote the table handler to use classes. This introduces a lot of new code,
-but will make table handling faster and better.
-@item
-¥æ¡¼¥¶¡¼ÄêµÁÊÑ¿ô¤Î¥Ñ¥Ã¥Á(Sasha¤Ë¤è¤ë)¤òÄɲá£
-@item
-Changed that @code{FLOAT} and @code{DOUBLE} (without any length modifiers) are
-not anymore fixed decimal point numbers.
-@item
-@code{FLOAT(X)} ¤Î°ÕÌ£¤òÊѹ¹: X <=24 ¤Ê¤é¤Ð¡¢¤³¤ì¤Ï @code{FLOAT} ¤ÈƱ¤¸¤Ç¡¢
-24 < X <= 53 ¤Ç¤¢¤ë¤Ê¤é¤Ð @code{DOUBLE} ¤ÈƱ¤¸¤Ë¤Ê¤ê¤Þ¤¹¡£
-@item
-@code{DECIMAL(X)} ¤Ï @code{DECIMAL(X,0)} ¤Î¥¨¥¤¥ê¥¢¥¹¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
-¤Þ¤¿ @code{DECIMAL} ¤Ï @code{DECIMAL(10,0)} ¤Î¥¨¥¤¥ê¥¢¥¹¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
-The same goes for @code{NUMERIC}.
-@item
-@code{ROW_FORMAT=@{default | dynamic | static | compressed@}} ¥ª¥×¥·¥ç¥ó¤ò
-@code{CREATE_TABLE} ¤ËÄɲÃ.
-@item
-@code{DELETE FROM table_name} ¤¬°ì»þ¥Æ¡¼¥Ö¥ë¤ÇÆ°¤«¤Ê¤«¤Ã¤¿¡£
-@item
-@code{CHAR_LENGTH()} ´Ø¿ô¤ò¥Þ¥ë¥Á¥Ð¥¤¥È¥»¡¼¥Õ¤ËÊѹ¹
-@item
-@code{ORD(string)} ´Ø¿ô¤ÎÄɲÃ.
-@end itemize
-
-@node News-3.23.5, News-3.23.4, News-3.23.6, News-3.23.x
-@appendixsubsec Changes in release 3.23.5
-
-@itemize @bullet
-@item
-¿·¤·¤¤¥Ç¡¼¥¿¥Ï¥ó¥É¥ê¥ó¥°Ãæ¤Î¤¤¤¯¤Ä¤«¤Î Y2K ÌäÂê¤ò½¤Àµ¡£
-@item
-@code{SELECT DISTINCT ... ORDER BY RAND()} ¤ÎÌäÂê¤ò½¤Àµ¡£
-@item
-Sergei A. Golubchik ¤Ë¤è¤ë MyISAM ¤Î¥ì¥Ù¥ë¤Ç¤Î¥Æ¥­¥¹¥È¥µ¡¼¥Á¤Î¥Ñ¥Ã¥Á¤òÄɲÃ
-@item
-¥­¡¼Ìµ¤·¤Çfull JOIN ¤ò»ÈÍѤ·¤¿ºÝ¤Î¥­¥ã¥Ã¥·¥å¥ª¡¼¥Ð¡¼¥Õ¥í¡¼¤ÎÌäÂê¤ò½¤Àµ¡£
-@item
-¤¤¤¯¤Ä¤«¤Î configure ¤ÎÌäÂê¤ò½¤Àµ¡£
-@item
-Some small changes to make parsing faster.
-@item
-ALTER TABLE + adding a column after the last field didn't work.
-@item
-2¤Ä¤Î¥­¡¼Ãæ¤Çauto_increment¥Õ¥£¡¼¥ë¥É¤ò»ÈÍѤ·¤¿¤È¤­¤ÎÌäÂê¤ò½¤Àµ¡£
-@item
-@code{MyISAM} ¤Ç auto_increment ¤ò¥µ¥Ö¥Ñ¡¼¥È¤È¤·¤Æ»ÈÍѤǤ­¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡§
-@code{ CREATE TABLE foo (a int not null auto_increment, b char(5), primary key (b,a)) }
-@item
-Fixed bug in @code{MyISAM} with packed char keys that could be @code{NULL}.
-@item
-¥Õ¥£¡¼¥ë¥É̾¤ò @code{CREATE TABLE table_name SELECT ... } »þ¤Ë¤È¤·¤¿¾ì¹ç¡¢Æ°¤«¤Ê¤«¤Ã¤¿¡£
-@item
-Allow use of @code{NATIONAL} and @code{NCHAR} when defining character columns.
- This is the same as not using @code{BINARY}.
-@item
-@code{NULL} ¤Î¥Õ¥£¡¼¥ë¥É¤ò @code{PRIMARY KEY} ( @code{UNIQUE} ¥­¡¼) ¤Ë¤Ï
-µö¤µ¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item
-Clear @code{LAST_INSERT_ID} if one uses this in ODBC:
-@code{WHERE auto_increment_column IS NULL}. This seems to fix some problems
-@item
-@code{WHERE auto_increment_column IS NULL} ¤ò»ÈÍѤ·¤ÆºÇ¸å¤Ë¥ì¥³¡¼¥É¤¬ÁÞÆþ¤µ¤ì¤¿¸å¤Ë¡¢
-@code{SET SQL_AUTO_IS_NULL=0|1} ¤Ï¥µ¡¼¥Á¤Î¥Ï¥ó¥É¥ê¥ó¥°¤Î on/off ¤Ë¤Ê¤Ã¤¿¡£
-@item
-Added new @code{mysqld} variable concurrency for Solaris.
-@item
-@code{--relative} ¥ª¥×¥·¥ç¥ó¤ò @code{mysqladmin} ¤ËÄɲá£
-¤³¤ì¤Ï @code{extended-status} ¤ÇÊѹ¹¤Î¥â¥Ë¥¿¡¼¤ò¤¹¤ë¾ì¹ç¡¢¤è¤êÊØÍø¤Ë¤Ê¤Ã¤¿¡£
-@item
-¶õ¤Î¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ @code{COUNT(DISTINCT..)} ¤ò»ÈÍѤ·¤¿ºÝ¤Î¥Ð¥°¤ò½¤Àµ¡£
-@item
-Ãæ¹ñ¸ì¤Î¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È @code{GBK} ¤òÄɲá£
-@item
-@code{LOAD DATA INFILE} ¤ò @code{BLOB} ¥Õ¥£¡¼¥ë¥É¤Ë»ÈÍѤ·¤¿ºÝ¤ÎÌäÂê¤ò½¤Àµ¡£
-@item
-ÏÀÍý±é»»»Ò @code{~} (negation) ¤òÄɲá£
-@item
-@code{UDF} ´Ø¿ô¤Ç¤ÎÌäÂê¤ò½¤Àµ¡£
-@end itemize
-
-@node News-3.23.4, News-3.23.3, News-3.23.5, News-3.23.x
-@appendixsubsec Changes in release 3.23.4
-
-@itemize @bullet
-@item
-@code{DATETIME} ·¿¤ò @code{TIME} ¥Õ¥£¡¼¥ë¥É¤ËÁÞÆþ¤¹¤ë¤È¤­¡¢'day' ¤ò
-Êݸ¤·¤è¤¦¤È»î¤ß¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item
-low endian ¤Î¥Þ¥·¥ó¤Ç float/double ¤ÎÊݸ¤ÎÌäÂê¤ò½¤Àµ¡£
-(¤³¤ì¤Ï @code{SUM()} ¤Ë±Æ¶Á¤¹¤ë.)
-@item
-TCP/IP Àܳ¤Î connect timeout ¤òÄɲá£
-@item
-¥¤¥ó¥Ç¥Ã¥¯¥¹¾å¤Ç¡¢ @code{NULL} Ãͤò»ý¤Ä¤«¤â¤·¤ì¤Ê¤¤¤â¤Î¤Ë @code{LIKE} "%" ¤·¤¿ºÝ¤ÎÌäÂê¤ò½¤Àµ¡£
-@item
-@code{REVOKE ALL PRIVILEGES} ¤¬Á´¤Æ¤Î¸¢¸Â¤ò¼è¤ê¾Ã¤·¤Æ¤¤¤Ê¤«¤Ã¤¿¤Î¤ò½¤Àµ¡£
-@item
-¥ª¥ê¥¸¥Ê¥ë¤Î¥Æ¡¼¥Ö¥ë̾¤ÈƱ¤¸Ì¾Á°¤Ç°ì»þ¥Æ¡¼¥Ö¥ë¤òºî¤ì¤ë¤è¤¦¤Ë¤·¤¿¡£
-@item
-¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ø¤Î¸¢¸Â¤ò¤¢¤ë¥æ¡¼¥¶¡¼¤ËÍ¿¤¨¤¿ºÝ¡¢
-¤½¤Î¥æ¡¼¥¶¡¼¤Ï¾¤Î¥æ¡¼¥¶¡¼¤Ë¸¢¸Â¤òÍ¿¤¨¤ë¤³¤È¤¬½ÐÍè¤Ê¤«¤Ã¤¿¡£
-@item
-¿·¥³¥Þ¥ó¥É¡§ @code{SHOW GRANTS FOR user} (by Sinisa).
-@item
-¿· @code{date_add} syntax: @code{date/datetime + INTERVAL # interval_type}.
-By Joshua Chamas.
-@item
-@code{LOAD DATA REPLACE} ¤Î¸¢¸Â¤Î¥Á¥§¥Ã¥¯¤ò½¤Àµ¡£
-@item
-Solaris 2.7 ¾å¤Ç¤Î¡¢²õ¤ì¤¿ include ¥Õ¥¡¥¤¥ë¤ò¼«Æ°½¤Àµ¡£
-@item
-big file system ¤ò¸¡½Ð¤¹¤ëºÝ¤Î¤¤¤¯¤Ä¤«¤Î configure ¤ÎÌäÂê¤ò½¤Àµ¡£
-@item
-@code{REGEXP} ¤Ï¥±¡¼¥¹Èó°Í¸¤Ë¤Ê¤Ã¤¿¡£¤â¤·¥Ð¥¤¥Ê¥êʸ»ú¤Ç¤Ê¤¤¾ì¹ç¤Ï¡£
-@end itemize
-
-@node News-3.23.3, News-3.23.2, News-3.23.4, News-3.23.x
-@appendixsubsec Changes in release 3.23.3
-
-@itemize @bullet
-@item
-NetBSD ¾å¤Ç¤Î MIT-pthreads ¥Ñ¥Ã¥Á¤òÄɲá£
-@item
-MyISAM Ãæ¤Î range bug ¤ò½¤Àµ¡£
-@item
-@code{ORDER BY} ¤Î¥Ç¥Õ¥©¥ë¥È¤¬ºÆ¤Ó @code{ASC} ¤Ë¤Ê¤Ã¤¿¡£
-@item
-@code{LIMIT} ¤ò @code{UPDATE} ¤ËÄɲá£
-@item
-¿·¥¯¥é¥¤¥¢¥ó¥È´Ø¿ô¡§ @code{mysql_change_user()}.
-@item
-@code{SHOW VARIABLES} ¤Ë¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È¤òÄɲá£
-@item
-@code{--[whitespace]} ¥³¥á¥ó¥È¤ò¥µ¥Ý¡¼¥È¤·¤¿¡£
-@item
-Allow @code{INSERT into tbl_name VALUES ()}, that is, you may now specify
-an empty value list to insert a row in which each column is set to its
-default value.
-@item
-Changed @code{SUBSTRING(text FROM pos)} to conform to ANSI SQL. (Before this
-construct returned the rightmost 'pos' characters).
-@item
-¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¾å¤Ç @code{GROUP BY} ¤ò¤È¤â¤Ê¤Ã¤¿ @code{SUM(..)} ¤Ï 0 ¤òÊÖ¤¹¤è¤¦¤Ë¤Ê¤Ã¤¿¡£
-@item
-@code{SHOW TABLE STATUS} ¤Î½ÐÎϤòÊѹ¹¡£
-@item
-@code{DELAY_KEY_WRITE} ¥ª¥×¥·¥ç¥ó¤ò @code{CREATE TABLE} ¤ËÄɲá£
-@item
-@code{AUTO_INCREMENT} ¤ò¤¤¤«¤Ê¤ë¥­¡¼¤ÎÉôʬ¤Ë»ÈÍѤǤ­¤ë¤è¤¦¤Ë¤·¤¿¡£
-@item
-@code{YEAR(NOW())} , @code{YEAR(CURDATE())} ¤ÎÌäÂê¤ò½¤Àµ¡£
-@item
-Added @code{CASE} construct.
-@item
-¿·´©¿ô @code{COALESCE()}.
-@end itemize
-
-@node News-3.23.2, News-3.23.1, News-3.23.3, News-3.23.x
-@appendixsubsec Changes in release 3.23.2
-
-@itemize @bullet
-@item
-Fixed range optimizer bug: @code{SELECT * FROM table_name WHERE
-key_part1 >= const AND (key_part2 = const OR key_part2 = const)}. The
-bug was that some rows could be duplicated in the result.
-@item
-Running @code{myisamchk} without @code{-a} updated the index
-distribution wrong.
-@item
-@code{SET SQL_LOW_PRIORITY_UPDATES=1} gave parse error before.
-@item
-@code{WHERE} Àá¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë¥¤¥ó¥Ç¥Ã¥¯¥¹¥Õ¥£¡¼¥ë¥É¤ò¹¹¿·¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡§
-@code{UPDATE tbl_name SET KEY=KEY+1 WHERE KEY > 100}
-@item
-Date handling should now be a bit faster.
-@item
-Added handling of fuzzy dates (dates where day or month is 0):
-(Like: 1999-01-00)
-@item
-Fixed optimization of @code{SELECT ... WHERE key_part1=const1 AND
-key_part_2=const2 AND key_part1=const4 AND key_part2=const4} ; Indextype
-should be @code{range} instead of @code{ref}.
-@item
-Linux Alpha ¾å¤Ç @code{egcs} 1.1.2 optimizer ¤Î¥Ð¥°(@code{BLOB} »ÈÍÑ»þ)¤ò½¤Àµ¡£
-@item
-Fixed problem with @code{LOCK TABLES} combined with @code{DELETE FROM table}.
-@item
-MyISAM ¥Æ¡¼¥Ö¥ë¤Ï @code{NULL} ÃÍ¤È @code{BLOB/TEXT} ¥Õ¥£¡¼¥ë¥É¤Ë¥­¡¼¤òµö¤¹¤è¤¦¤Ë¤Ê¤Ã¤¿¡£
-@item
-°Ê²¼¤ÎJOIN¤¬¤è¤ê®¤¯¤Ê¤Ã¤¿¡§
-@code{SELECT ... FROM t1 LEFT JOIN t2 ON ... WHERE t2.not_null_column IS NULL}.
-@item
-@code{ORDER BY} and @code{GROUP BY} can be done on functions.
-@item
-Changed handling of 'const_item' to allow handling of @code{ORDER BY RAND()}.
-@item
-@code{WHERE key_column = function} ¤Ç¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬»ÈÍѤµ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£
-@item
-Î㤨¥Õ¥£¡¼¥ë¥É¤¬Á´¤¯Æ±¤¸¤Ë¥Ñ¥Ã¥¯¤µ¤ì¤Æ¤¤¤Ê¤¯¤Æ¤â¡¢
-@code{WHERE key_column = column_name} ¤Ç¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬»ÈÍѤµ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£
-@item
-@code{WHERE column_name IS NULL} ¤Ç¥¤¥ó¥Ç¥Ã¥¯¥¹¤¬»ÈÍѤµ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£
-@item
-Changed heap tables to be stored in low_byte_first order (to make it easy
-to convert to MyISAM tables)
-@item
-Automatic change of HEAP temporary tables to MyISAM tables in case of
-'table is full' errors.
-@item
-@code{--init-file=file_name} ¥ª¥×¥·¥ç¥ó¤ò @code{mysqld} ¤ËÄɲá£
-@item
-@code{COUNT(DISTINCT value,[value,...])}
-@item
-@code{CREATE TEMPORARY TABLE} now creates a temporary table, in its own
-namespace, that is automatically deleted if connection is dropped.
-@item
-¿·Í½Ìó¸ì (@code{CASE} ¤òÍ×µá): @code{CASE, THEN, WHEN, ELSE and END}.
-@item
-¿·´Ø¿ô @code{EXPORT_SET()} , @code{MD5()}.
-@item
-GB2312 Ãæ¹ñ¸ì¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È¤ò¥µ¥Ý¡¼¥È¡£
-@end itemize
-
-@node News-3.23.1, News-3.23.0, News-3.23.2, News-3.23.x
-@appendixsubsec Changes in release 3.23.1
-
-@itemize @bullet
-@item
-¤¤¤¯¤Ä¤«¤Î¥³¥ó¥Ñ¥¤¥ëÌäÂê¤ò½¤Àµ¤·¤¿¡£
-@end itemize
-
-@node News-3.23.0, , News-3.23.1, News-3.23.x
-@appendixsubsec Changes in release 3.23.0
-
-@itemize @bullet
-@item
-¿¤¯¤Î¿·¤·¤¤ÆÃħ¤òÈ÷¤¨¤¿¿·¤·¤¤¥Æ¡¼¥Ö¥ë¡¦¥Ï¥ó¥É¥é¡¼¡¦¥é¥¤¥Ö¥é¥ê( @code{MyISAM} )¡£
-@xref{MyISAM}.
-@item
-¥á¥â¥ê¡¼Æâ¤Ë @code{HEAP} ¥Æ¡¼¥Ö¥ë¤òºîÀ®¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
-¤³¤ì¤Ïõº÷¤¬¤È¤Æ¤â®¤¤¤Ç¤¹¡£
-@item
-ÂçÍÆÎÌ¥Õ¥¡¥¤¥ë¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ëOS¾å¤Ç¡¢Âç¥Õ¥¡¥¤¥ë (63 bit) ¤Î¥µ¥Ý¡¼¥È¡£
-@item
-¿·¤·¤¤´Ø¿ô @code{LOAD_FILE(filename)} ¡£ ¤³¤ì¤Ï¥Õ¥¡¥¤¥ë¤ÎÃæ¿È¤òʸ»úÎóÃͤȤ·¤ÆÆɤߤޤ¹¡£
-@item
-¿·¤·¤¤±é»»»Ò @code{<=>} ¡£ ¤³¤ì¤Ï¡¢ @code{=} ¤Î¤è¤¦¤Ë¿¶¤ëÉñ¤¤¤Þ¤¹¤¬¡¢
-¤â¤·Î¾Êդΰú¿ô¤¬ @code{NULL} ¤Ê¤é¡¢¿¿¤òÊÖ¤·¤Þ¤¹¡£
-¤³¤ì¤Ï¥Æ¡¼¥Ö¥ë´Ö¤ÎÊѹ¹¤ÎÈæ³Ó¤ËÌòΩ¤Á¤Þ¤¹¡£
-@item
-ODBC 3.0 @code{EXTRACT(interval FROM datetime)} ´Ø¿ô¤ÎÄɲá£
-@item
-@code{FLOAT(X)} ¥Õ¥£¡¼¥ë¥É¤Ï¡¢Êݸ¤·¤¿Ãͤò´Ý¤á¤Þ¤»¤ó¡£
-¤³¤ì¤Ï¸¡º÷¤µ¤ì¤¿¤È¤­¤Ë ²Ê³Øɽµ­ (1.0 E+10) ¤Ë¤Ê¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
-@item
-@code{REPLACE} ¤¬Á°¤è¤ê¤â®¤¯¤Ê¤Ã¤¿¡£
-@item
-@code{LIKE} ʸ»úÈæ³Ó¤ò @code{=} ¤Î¤è¤Ë¿¶¤ëÉñ¤¦¤è¤¦¤ËÊѹ¹¡¨
-¤³¤ì¤Ï @code{'e' LIKE '@'e'} ¤¬¿¿¤Ë¤Ê¤ë¤È¤¤¤¦¤³¤È¤Ç¤¹¡£
-@item
-@code{SHOW TABLE STATUS} ¤Ï¥Æ¡¼¥Ö¥ë¤Ë¤Ä¤¤¤Æ¤Î¾ðÊó¤ò¿¤¯½Ð¤¹¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
-@item
-@code{LIKE} ¤ò @code{SHOW STATUS} ¥³¥Þ¥ó¥É¤ËÄɲá£
-@item
-@code{SHOW COLUMNS} ¤Ë Privileges ¹àÌܤòÄɲá£
-@item
-@code{SHOW INDEX} ¤Ë @code{packed} ¤È @code{comment} ¹àÌܤòÄɲá£
-@item
-¥Æ¡¼¥Ö¥ë¤Ø¤Î¥³¥á¥ó¥È¤òÄɲᣠ( @code{CREATE TABLE ... COMMENT "xxx"}).
-@item
-@code{UNIQUE} ¤ò¼¡¤Î¤è¤¦¤ËÄɲá§
-@code{CREATE TABLE table_name (col int not null UNIQUE)}
-@item
-¿· create ¹½Ê¸¡§ @code{CREATE TABLE table_name SELECT ....}
-@item
-¿· create ¹½Ê¸¡§ @code{CREATE TABLE IF NOT EXISTS ...}
-@item
-@code{CHAR(0)} ¥Õ¥£¡¼¥ë¥É¤ÎºîÀ®¤òµö²Ä¤·¤¿¡£
-@item
-@code{DATE_FORMAT()} ¤Ï¡¢¥Õ¥©¡¼¥Þ¥Ã¥Èʸ»ú¤ÎÁ°¤Ë @samp{%} ¤¬É¬Íפˤʤä¿¡£
-@item
-@code{DELAYED} ¤¬Í½Ìó¸ì¤Ë¤Ê¤Ã¤¿¡£ (sorry about that :( ).
-@item
-¥×¥í¥»¥¸¥ã¡¼¤ÎÎã¤òÄɲ᧠@code{analyse}, file: @file{sql_analyse.c}.
-¤³¤ì¤Ï¥¯¥¨¥ê¤Î¥Ç¡¼¥¿¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤Þ¤¹¡£ °Ê²¼¤ÎÍͤˤ·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡§
-@example
-SELECT ... FROM ... WHERE ... PROCEDURE ANALYSE([max elements,[max memory]])
-@end example
-¤³¤Î ¥×¥í¥»¥¸¥ã¡¼¤Ï¡¢¥Æ¡¼¥Ö¥ë¤Î¥Ç¡¼¥¿¤ò¥Á¥§¥Ã¥¯¤·¤¿¤¤»þ¤Ë¡¢¤È¤Æ¤âÌòΩ¤Á¤Þ¤¹¡ª
-@item
-@code{BINARY} cast to force a string to be compared case sensitively.
-@item
-@code{--skip-show-database} ¥ª¥×¥·¥ç¥ó¤ò @code{mysqld} ¤ËÄɲá£
-@item
-@code{BLOB}/@code{TEXT} ¥Õ¥£¡¼¥ë¥É¤Ë¤ª¤¤¤Æ¡¢ @code{UPDATE} ¤µ¤ì¤¿
-¥ì¥³¡¼¥É¤ò¥Á¥§¥Ã¥¯¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
-@item
-@code{INNER JOIN} ¤ÎÄɲᣠ@strong{Ãí°Õ}: @code{INNER} ¤ÏͽÌó¸ì¤Ë¤Ê¤ê¤Þ¤·¤¿¡ª
-@item
-@strong{MySQL} ¥Æ¡¼¥Ö¥ë¤Î¥Û¥¹¥È¤Ë¥Í¥Ã¥È¥Þ¥¹¥¯¤ò¥µ¥Ý¡¼¥È¤·¤¿¡£
-@code{IP/NETMASK} ¤È¤·¤Æ¡¢¥Í¥Ã¥È¥Þ¥¹¥¯¤ò»ØÄê¤Ç¤­¤Þ¤¹¡£
-@item
-If you compare a @code{NOT NULL DATE/DATETIME} column with @code{IS
-NULL}, this is changed to a compare against @code{0} to satisfy some ODBC
-applications. (By @email{shreeve@@uci.edu}).
-@item
-@code{NULL IN (...)} ¤Ï @code{0} ¤Ç¤Ï¤Ê¤¯ @code{NULL} ¤òÊÖ¤·¤Þ¤¹¡£ ¤³¤ì¤Ï
- @code{null_column NOT IN (...)} ¤¬ @code{NULL} Ãͤ˥ޥåÁ¤·¤Ê¤¤¤Î¤ò³Î¼Â¤Ë¤·¤Þ¤¹¡£
-@item
-@code{TIME} ¥Õ¥£¡¼¥ë¥ÉÃæ¤Ë¡¢ÉâÆ°¾®¿ôÅÀ¤ÎÃͤòÆþ¤ì¤ë¤Î¤ò½¤Àµ¡£
-@item
-Changed parsing of @code{TIME} strings to be more strict. Now the
-fractional second part is detected (and currently skipped). The
-following formats are supported:
-@table @code
-@item [[DAYS] [H]H:]MM:]SS[.fraction]
-@item [[[[[H]H]H]H]MM]SS[.fraction]
-@end table
-@item
-Detect (and ignore) second fraction part from @code{DATETIME}.
-@item
-@code{LOW_PRIORITY} °À­¤ò @code{LOAD DATA INFILE} ¤ËÄɲá£
-@item
-¥Ç¥Õ¥©¥ë¥È¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹Ì¾¤ò¡¢¥Õ¥£¡¼¥ë¥É¤Î̾Á°¤ÈƱ¤¸¥±¡¼¥¹¤Ë¤·¤¿¡£
-@item
-¥Ç¥Õ¥©¥ë¥È¤ÎÀܳ¿ô¤ò 100 ¤ËÊѹ¹¡£
-@item
-@code{LOAD DATA INFILE} »þ¤Ë¡¢¤è¤êÂ礭¤Ê¥Ð¥Ã¥Õ¥¡¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë¤·¤¿¡£
-@item
-@code{DECIMAL(x,y)} ¤Ï ANSI SQL ¤Ë½¾¤Ã¤ÆÆ°ºî¤¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£
-@item
-Added aggregate UDF functions. Thanks to Andreas F. Bobak
-@email{bobak@@relog.ch} for this!
-@item
-@code{LAST_INSERT_ID()} is now updated for @code{INSERT INTO ... SELECT}.
-@item
-Some small changes to the join table optimizer to make some joins faster.
-@item
-@code{SELECT DISTINCT} ¤¬À¨¤¯Â®¤¯¤Ê¤Ã¤¿¡¨
-¤³¤ì¤Ï @code{MyISAM} ¤Î¿·¤·¤¤ @code{UNIQUE} ¤ò»ÈÍѤ·¤Þ¤¹¡£
-@strong{MySQL} 3.22 ¤È°ì¤Ä°ã¤¦ÅÀ¤Ï¡¢ @code{DISTINCT} ¤Î½ÐÎϤ¬
-¥½¡¼¥È¤µ¤ì¤Ê¤¤¤È¤¤¤¦»ö¤Ç¤¹¡£
-@item
-Á´¤Æ¤Î C ¥¯¥é¥¤¥¢¥ó¥È API ¤¬¡¢¶¦Í­¥é¥¤¥Ö¥é¥ê¤ò½ÀÆð¤ËºîÀ®¤¹¤ë¤¿¤á¡¢
-¥Þ¥¯¥í¤«¤é´Ø¿ô¤Ë¤Ê¤ê¤Þ¤·¤¿¡£ ¤³¤Î¤¿¤á¡¢ @code{mysql_num_fields()} ¤ò
-@code{MYSQL} ¤È¤È¤·¤Æ¥³¡¼¥ë¤Ç¤­¤º¡¢¤³¤ÎÂå¤ï¤ê¤Ë @code{mysql_field_count()} ¤ò
-»ÈÍѤ·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-@item
-@code{LIBWRAP} ¤ÎÄɲÃ; Patch by Henning P . Schmiedehausen.
-@item
-Don't allow @code{AUTO_INCREMENT} for other than numerical columns.
-@item
-@code{AUTO_INCREMENT} ¤Î»ÈÍѤϡ¢¥Õ¥£¡¼¥ë¥É¤ò¼«Æ°Åª¤Ë
-@code{NOT NULL} ¤Ë¤·¤Þ¤¹¡£
-@item
-Show @code{NULL} as the default value for AUTO_INCREMENT columns.
-@item
-@code{SQL_BIG_RESULT} ¤ÎÄɲÃ; @code{SQL_SMALL_RESULT} ¤¬¥Ç¥Õ¥©¥ë¥È¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
-@item
-Added a shared library RPM. This enchancement was contributed by David
-Fox (dsfox@@cogsci.ucsd.edu).
-@item
-@code{--enable-large-files/--disable-large-files} ¥¹¥¤¥Ã¥Á¤ò @code{configure} ¤Ë
-ÄɲᣠSee @file{configure.in} for some systems where this is
-automatically turned off because of broken implementations.
-@item
-@code{readline} 4.0 ¤Ë¥¢¥Ã¥×¥°¥ì¡¼¥É
-@item
-¿·¤·¤¤ @code{CREATE TABLE} ¥ª¥×¥·¥ç¥ó¡§ @code{PACK_KEYS} ¤È @code{CHECKSUM}.
-@item
-@code{mysqld} ¥ª¥×¥·¥ç¥ó¤Ë @code{--default-table-type} ¤òÄɲá£
-@end itemize
-
-@node News-3.22.x, News-3.21.x, News-3.23.x, News
-@appendixsec Changes in release 3.22.x
-
-3.22 ¤Ï¤è¤êÁ᤯¡¢¤è¤ê°ÂÁ´¤Ê¥³¡¼¥É¤ò¤â¤Á¡¢¤¿¤¯¤µ¤ó¤Î¿·¤·¤¤µ¡Ç½¤¬À¹¤ê¹þ¤Þ¤ì¤Æ¤¤¤Þ¤¹¡£
-¤³¤ì¤é¤ÎÊѹ¹¤ò 3.21 ¤Ë¹Ô¤ï¤Ê¤¤¤Î¤Ï¡¢3.21 ¤Î°ÂÄêÅÙ¤òÊݤĤ¿¤á¤Ë¤Ï¤È¤Æ¤â¿¤¯¤ÎÊѹ¹¤¬É¬ÍפȤµ¤ì¤ë¤«¤é¤Ç¤¹¡£
-¤³¤ì¤é¤ÎÊѹ¹¤Ï¥á¥¸¥ã¡¼¥Ð¡¼¥¸¥ç¥ó¤ÎÊѹ¹¤Ç¤Ï¤Ê¤¤¤Î¤Ç¡¢´Êñ¤Ë¾ã³²¤â¤Ê¤¯ 3.22 ¤Ë¥¢¥Ã¥×¥°¥ì¡¼¥É¤¬¤Ç¤­¤Þ¤¹¡£
-@xref{Upgrading-from-3.21}.
-
-3.22 ¤Ï¿·¤·¤¤ @code{DBD-mysql} (1.20xx) ¥É¥é¥¤¥Ð¡¼¤Î¤ß¤ò¿·¤·¤¤Àܳ¥×¥í¥È¥³¥ë¤ËÂФ·¤Æ»ÈÍѤ·¤Þ¤¹¡ª
-
-@menu
-* News-3.22.35:: Changes in release 3.22.35
-* News-3.22.34:: Changes in release 3.22.34
-* News-3.22.33:: Changes in release 3.22.33
-* News-3.22.32:: Changes in release 3.22.32
-* News-3.22.31:: Changes in release 3.22.31
-* News-3.22.30:: Changes in release 3.22.30
-* News-3.22.29:: Changes in release 3.22.29
-* News-3.22.28:: Changes in release 3.22.28
-* News-3.22.27:: Changes in release 3.22.27
-* News-3.22.26:: Changes in release 3.22.26
-* News-3.22.25:: Changes in release 3.22.25
-* News-3.22.24:: Changes in release 3.22.24
-* News-3.22.23:: Changes in release 3.22.23
-* News-3.22.22:: Changes in release 3.22.22
-* News-3.22.21:: Changes in release 3.22.21
-* News-3.22.20:: Changes in release 3.22.20
-* News-3.22.19:: Changes in release 3.22.19
-* News-3.22.18:: Changes in release 3.22.18
-* News-3.22.17:: Changes in release 3.22.17
-* News-3.22.16:: Changes in release 3.22.16
-* News-3.22.15:: Changes in release 3.22.15
-* News-3.22.14:: Changes in release 3.22.14
-* News-3.22.13:: Changes in release 3.22.13
-* News-3.22.12:: Changes in release 3.22.12
-* News-3.22.11:: Changes in release 3.22.11
-* News-3.22.10:: Changes in release 3.22.10
-* News-3.22.9:: Changes in release 3.22.9
-* News-3.22.8:: Changes in release 3.22.8
-* News-3.22.7:: Changes in release 3.22.7
-* News-3.22.6:: Changes in release 3.22.6
-* News-3.22.5:: Changes in release 3.22.5
-* News-3.22.4:: Changes in release 3.22.4
-* News-3.22.3:: Changes in release 3.22.3
-* News-3.22.2:: Changes in release 3.22.2
-* News-3.22.1:: Changes in release 3.22.1
-* News-3.22.0:: Changes in release 3.22.0
-@end menu
-
-@node News-3.22.35, News-3.22.34, News-3.22.x, News-3.22.x
-@appendixsubsec Changes in release 3.22.35
-@itemize @bullet
-@item
-Fixed problem with @code{STD()}.
-@item
-Merged changes from the newest @code{ISAM} library from 3.23.
-@item
-Fixed problem with @code{INSERT DELAYED}.
-@item
-Fixed a bug core dump when using a @code{LEFT JOIN}/@code{STRAIGHT_JOIN}
-on a table with only one row.
-@end itemize
-
-@node News-3.22.34, News-3.22.33, News-3.22.35, News-3.22.x
-@appendixsubsec Changes in release 3.22.34
-@itemize @bullet
-@item
-Fixed problem with @code{GROUP BY} on @code{TINYBLOB} columns; This
-caused bugzilla to not show rows in some queries.
-@item
-Had to do total recompile of the Windows binary version as VC++ didn't
-compile all relevant files for 3.22.33 :(
-@end itemize
-
-@node News-3.22.33, News-3.22.32, News-3.22.34, News-3.22.x
-@appendixsubsec Changes in release 3.22.33
-@itemize @bullet
-@item
-Fixed problems in windows when locking tables with @code{LOCK TABLE}
-@item
-Quicker kill of @code{SELECT DISTINCT} queries.
-@end itemize
-
-@node News-3.22.32, News-3.22.31, News-3.22.33, News-3.22.x
-@appendixsubsec Changes in release 3.22.32
-@itemize @bullet
-@item
-¿ôÃͤò timestamps ¤ËÊݸ¤¹¤ëºÝ¤ÎÌäÂê¤ò½¤Àµ¤·¤¿¡£
-@item
-Fix problem with timezones that have half hour offsets.
-@item
-@code{mysqlhotcopy} - ¥í¡¼¥«¥ë¤Î @strong{MySQL} ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¥³¥Ô¡¼¤¹¤ë
-¥Ä¡¼¥ë. By Tim Bunce.
-@item
-@code{mysqlaccess} ¤¬¿·¤·¤¯¤Ê¤Ã¤¿. Thanks to Steve Harvey for this.
-@item
-Fixed security problem in the protocol regarding password checking.
-@item
-Fixed problem that affected queries that did arithmetic on @code{GROUP} functions.
-@item
-Fixed a bug in the @code{ISAM} code when deleting rows on tables with
-packed indexes.
-@end itemize
-
-@node News-3.22.31, News-3.22.30, News-3.22.32, News-3.22.x
-@appendixsubsec Changes in release 3.22.31
-
-@itemize @bullet
-@item
-Win32 ¤Ç¤Î¤¤¤¯¤Ä¤«¤Î¾®¤µ¤Ê¥Ð¥°½¤Àµ
-@end itemize
-
-
-@node News-3.22.30, News-3.22.29, News-3.22.31, News-3.22.x
-@appendixsubsec Changes in release 3.22.30
-
-@itemize @bullet
-@item
-Fixed optimizer problem on @code{SELECT} when using many overlapping indexes.
-@item
-Disabled floating point exceptions for FreeBSD to fix core dump when
-doing @code{SELECT floor(pow(2,63))}.
-@item
-Added print of default arguments options to all clients.
-@item
-@code{WITH GRANT OPTION} ¥ª¥×¥·¥ç¥ó¤ÎÃ×̿Ū¤Ê¥Ð¥°¤ò½¤Àµ.
-@item
-Fixed non-critical Y2K problem when writing short date to log files.
-@end itemize
-
-@node News-3.22.29, News-3.22.28, News-3.22.30, News-3.22.x
-@appendixsubsec Changes in release 3.22.29
-
-@itemize @bullet
-@item
-Upgraded the configure and include files to match the latest 3.23 version.
-This should increase portability and make it easier to build shared libraries.
-@item
-NetBSD ÍѤκǿ·¤Î mit-pthread ¤Î¥Ñ¥Ã¥Á¤òÄɲá£
-@item
-¥¿¥¤¥à¥¾¡¼¥ó < GMT - 11 ¤Î¾ì¹ç¤ÎÌäÂê¤ò½¤Àµ¡£
-@item
-@code{NISAM} Ãæ¤Î¥Ñ¥Ã¥¯¤µ¤ì¤¿¥­¡¼¤Îºï½ü»þ¤Î¥Ð¥°¤ò½¤Àµ¡£
-@item
-Fixed problem that could cause @strong{MySQL} to touch freed memory when
-doing very complicated @code{GROUP BY} queries.
-@item
-Fixed core dump if you got a crashed table where an @code{ENUM} field value
-was too big.
-@item
-Added @code{mysqlshutdown.exe} and @code{mysqlwatch.exe} to the Windows
-distribution.
-@item
-¥­¡¼¤ËÂФ·¤Æ @code{ORDER BY} ¤ò¹Ô¤Ã¤¿¤È¤­¤ÎÌäÂê¤ò½¤Àµ
-@item
-Fixed that @code{INSERT DELAYED} doesn't update timestamps that are given.
-
-@end itemize
-
-@node News-3.22.28, News-3.22.27, News-3.22.29, News-3.22.x
-@appendixsubsec Changes in release 3.22.28
-
-@itemize @bullet
-@item
-Fixed problem with @code{LEFT JOIN} and @code{COUNT()} on a column which
-was declared @code{NULL} + and it had a @code{DEFAULT} value.
-@item
-@code{CONCAT()} ¤ò¤¢¤ë @code{WHERE} Àá¤Ç»ÈÍѤ·¤¿ºÝ¤Ë¥³¥¢¡¦¥À¥ó¥×¤¹¤ëÌäÂê¤ò½¤Àµ¤·¤¿¡£
-@item
-Fixed problem with @code{AVG()} and @code{STD()} with @code{NULL} values.
-@end itemize
-
-@node News-3.22.27, News-3.22.26, News-3.22.28, News-3.22.x
-@appendixsubsec Changes in release 3.22.27
-
-@itemize @bullet
-@item
-@file{my_ctype.h} Ãæ¤Î¡¢Â¾¤Î¥­¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È¤Î¥×¥í¥È¥¿¥¤¥×¤ò½¤Àµ¡£
-@item
-configure Ãæ¤Î¡¢Âç¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¸¡½Ð¤¹¤ëÉôʬ¤ÎÌäÂê¤ò½¤Àµ¡£
-@item
-Â礭¤ÊBLOB¥Õ¥£¡¼¥ë¥É¤ò¥½¡¼¥È¤·¤¿¤È¤­¤Î¥Ð¥°¤ò½¤Àµ¡£
-@item
-@code{ROUND()} will now work on Win32.
-@end itemize
-
-@node News-3.22.26, News-3.22.25, News-3.22.27, News-3.22.x
-@appendixsubsec Changes in release 3.22.26
-
-@itemize @bullet
-@item
-¶õ¤Î @code{BLOB/TEXT} ¥Õ¥£¡¼¥ë¥É¤ò @code{REVERSE()} ¤·¤¿ºÝ¤Ë¥³¥¢¥À¥ó¥×¤·¤¿¤Î¤ò½¤Àµ¡£
-@item
-@code{/*! */} ¥Ð¡¼¥¸¥ç¥óÈÖ¹æ ¤ò³ÈÄ¥¤·¤¿
-@item
-Changed @code{SUBSTRING(text FROM pos)} to conform to ANSI SQL. (Before this
-construct returned the rightmost 'pos' characters).
-@item
-Fixed problem with @code{LOCK TABLES} combined with @code{DELETE FROM table}
-@item
-@code{INSERT ... SELECT} ¤¬ @code{SQL_BIG_TABLES} ¤ò»ÈÍѤ·¤Æ¤¤¤Ê¤«¤Ã¤¿¤Î¤ò½¤Àµ¡£
-@item
-@code{SET SQL_LOW_PRIORITY_UPDATES=#} ¤¬Æ°¤¤¤Æ¤Ê¤«¤Ã¤¿¡£
-@item
-µö²Ä¤ò @code{GRANT ... IDENTIFIED BY} ¤ÇÊѹ¹¤·¤Æ¤âľ¤Ë¥Ñ¥¹¥ï¡¼¥É¤¬
-È¿±Ç¤µ¤ì¤Ê¤«¤Ã¤¿¤Î¤ò½¤Àµ¡£
-@item
-°Ê²¼¤ÎºÇŬ²½¤Î¥Ð¥°¤ò½¤Àµ¡§
-@code{SELECT * FROM table_name WHERE key_part1 >= const AND (key_part2 = const OR key_part2 = const)}
-@item
-Fixed bug in compression key handling in ISAM.
-@end itemize
-
-@node News-3.22.25, News-3.22.24, News-3.22.26, News-3.22.x
-@appendixsubsec Changes in release 3.22.25
-
-@itemize @bullet
-@item
-¥¤¥ó¥¹¥È¡¼¥ë»þ¤Î¾®¤µ¤ÊÌäÂê¤ò½¤Àµ¡£
-@end itemize
-
-@node News-3.22.24, News-3.22.23, News-3.22.25, News-3.22.x
-@appendixsubsec Changes in release 3.22.24
-
-@itemize @bullet
-@item
-@code{DATA} ¤ÏͽÌó¸ì¤Ç¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item
-¤¿¤Ã¤¿£±¥ì¥³¡¼¥É¤·¤«¤Ê¤¤¥Æ¡¼¥Ö¥ë¤ÎºÇŬ²½¤Î¥Ð¥°¤ò½¤Àµ¡£
-@item
-@code{LOCK TABLES table_name READ; FLUSH TABLES;} ¤ò»ÈÍѤ·¤¿ºÝ¤Î¥Ð¥°½¤Àµ¡£
-@item
-HP-UX ¤Î¥Ñ¥Ã¥Á¤òŬÍÑ¡£
-@item
-@code{isamchk} ¤¬ Win32 ¾å¤ÇÆ°¤¯¤è¤¦¤Ë¤Ê¤Ã¤¿¡£
-@item
-Changed @file{configure} to not use big file handling on Linux as this
-crashes some RedHat 6.0 systems
-@end itemize
-
-@node News-3.22.23, News-3.22.22, News-3.22.24, News-3.22.x
-@appendixsubsec Changes in release 3.22.23
-
-@itemize @bullet
-@item
-Autoconf 2.13, Automake 1.4, @code{libtool} 1.3.2 ¤ò»ÈÍѤ¹¤ë¤è¤¦¤Ë¥¢¥Ã¥×¥°¥ì¡¼¥É¡£
-@item
-Better support for SCO in @code{configure}.
-@item
-Added option @code{--defaults-file=###} to option file handling to force use
-of only one specific option file.
-@item
-@code{MySQL} 3.23 ¤Î¥­¡¼¥ï¡¼¥É¤ò̵»ë¤¹¤ë¤è¤¦¤Ë
-@code{CREATE} ¹½Ê¸¤ò³ÈÄ¥¤·¤¿¡£
-@item
-@code{LOCK TABLES} ¤Ç¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¥Æ¡¼¥Ö¥ë¤Ë @code{INSERT DELAYED} ¤ò
-»ÈÍѤ·¤¿ºÝ¤Î¡¢¥Ç¥Ã¥É¥í¥Ã¥¯¤ÎÌäÂê¤ò½¤Àµ¡£
-@item
-¾¤Î¥¹¥ì¥Ã¥É¤Ë¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¥Æ¡¼¥Ö¥ë¤Ë @code{DROP TABLE} ¤ò»ÈÍѤ·¤¿ºÝ¤Î
-ÌäÂê¤ò½¤Àµ¡£
-@item
-@code{GRANT/REVOKE} ¥³¥Þ¥ó¥É¤ò update log ¤ËÄɲá£
-@item
-¿·¤·¤¤¥¨¥é¡¼¹àÌܤò¸¡½Ð¤¹¤ë¤è¤¦¤Ë @code{isamchk} ¤ò½¤Àµ¡£
-@item
-@code{NATURAL LEFT JOIN} ¤Î¥Ð¥°¤ò½¤Àµ¡£
-@end itemize
-
-@node News-3.22.22, News-3.22.21, News-3.22.23, News-3.22.x
-@appendixsubsec Changes in release 3.22.22
-
-@itemize @bullet
-@item
-@code{mysql_init()} ¤Î¸å¤ËľÀÜ @code{mysql_close()} ¤òÆɤó¤À¤È¤­¤ÎÌäÂê¤ò½¤Àµ¡£
-(C API)
-@item
-Better client error message when you can't open socket.
-@item
-¿·¤·¤¤delayed_insert ¥¹¥ì¥Ã¥É¤¬ºîÀ®¤Ç¤­¤Ê¤«¤Ã¤¿¤È¤­¤Î
- @code{delayed_insert_thread} ¿ô¤Îɽ¼¨¤ò½¤Àµ¡£
-@item
- @code{CONCAT()} ¤Î°ú¿ô¤ò¿¤¯¤·¤¿¾ì¹ç¤Î¥Ð¥°¤ò½¤Àµ¡£
-@item
-DEC 3.2 ¤È SCO ¤Î¥Ñ¥Ã¥Á¤ÎÄɲá£
-@item
-NT ¤Î¥µ¡¼¥Ó¥¹¤È¤·¤Æ @strong{MySQL} ¤ò¥¤¥ó¥¹¥È¡¼¥ë¤·¤¿ºÝ¤Î
-¥Ñ¥¹¤ÎÌäÂê¤ò½¤Àµ¡£
-@item
-@strong{MySQL}-Win32 ¤Ï VC++ 6.0 ¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£
-(VC++ 5.0 ¤Î¤«¤ï¤ê¤Ë)
-@item
-@strong{MySQL}-Win32 ¤Î¿·¤·¤¤¥¤¥ó¥¹¥È¡¼¥é¡¼
-@end itemize
-
-@node News-3.22.21, News-3.22.20, News-3.22.22, News-3.22.x
-@appendixsubsec Changes in release 3.22.21
-
-@itemize @bullet
-@item
-¥Æ¡¼¥Ö¥ë¤¬Â¾¤Î¥¹¥ì¥Ã¥É¤Ë¥í¥Ã¥¯¤µ¤ì¤¿¤È¤­¤Î¡¢@code{DELETE FROM TABLE} ¤Î
-ÌäÂê¤ò½¤Àµ¡£
-@item
-Fixed bug in @code{LEFT JOIN} involving empty tables.
-@item
-@code{mysql.db} ¥Õ¥£¡¼¥ë¥É¤ò @code{char(32)} ¤«¤é @code{char(60)} ¤ËÊѹ¹¡£
-@item
-@code{MODIFY} ¤È @code{DELAYED} ¤ÏͽÌó¸ì¤Ç¤Ê¤¯¤Ê¤Ã¤¿¡£
-@item
- @code{TIME} ¥Õ¥£¡¼¥ë¥É¤ËÆü¤Ë¤Á¤òÆþ¤ì¤è¤¦¤È¤·¤¿¤È¤­¤Î¥Ð¥°¤ò½¤Àµ¡£
-@item
-@code{GRANT} ¥³¥Þ¥ó¥É¤Ç¿·¤·¤¤ @strong{MySQL} ¥æ¡¼¥¶¡¼¤òÅÐÏ¿¤·¤¿¸å¤Ë
-@code{Host '..' is not allowed to connect to this MySQL server} ¤È¤Ê¤ëÌäÂê¤ò½¤Àµ¡£
-@item
-Linux ¾å¤Ç @code{TCP_NODELAY} ¤ò»ÈÍѤ¹¤ë¤è¤¦¤ËÊѹ¹¡£ (¤³¤ì¤Ï TCP/IP Àܳ¤ò®¤¯¤·¤Þ¤¹)
-@end itemize
-
-@node News-3.22.20, News-3.22.19, News-3.22.21, News-3.22.x
-@appendixsubsec Changes in release 3.22.20
-
-@itemize @bullet
-@item
-Fixed @code{STD()} for big tables when result should be 0.
-@item
-¤¤¤¯¤Ä¤«¤ÎOS ¤Çupdate log ¤¬²þ¹Ô¤òÆþ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¤Î¤ò½¤Àµ¡£
-@item
-@code{INSERT DELAYED} had some garbage at end in the update log.
-@end itemize
-
-@node News-3.22.19, News-3.22.18, News-3.22.20, News-3.22.x
-@appendixsubsec Changes in release 3.22.19
-
-@itemize @bullet
-@item
-@code{mysql_install_db} ¤Î¥Ð¥°½¤Àµ¡£ (from 3.22.17).
-@item
-¥Ç¥Õ¥©¥ë¥È¤Î¥­¡¼¥­¥ã¥Ã¥·¥å¤ò 8M ¤ËÊѹ¹¡£
-@item
-@code{BLOB} ¥Õ¥£¡¼¥ë¥É¤Ç°ì»þ¥Æ¡¼¥Ö¥ë¤¬É¬ÍפȤµ¤ì¤ë¥¯¥¨¥ê¤ÎÌäÂê¤ò½¤Àµ¡£
-@end itemize
-
-@node News-3.22.18, News-3.22.17, News-3.22.19, News-3.22.x
-@appendixsubsec Changes in release 3.22.18
-
-@itemize @bullet
-@item
-Linux¾å¤Ç¡¢3.22.17¤ÎÃ×̿Ū¤ÊÌäÂê¤Î½¤Àµ¡¨ @code{shutdown} ¸å¡¢Á´¤Æ¤Î
-¥¹¥ì¥Ã¥É¤¬³Î¼Â¤Ë»à¤Ê¤Ê¤«¤Ã¤¿¡£
-@item
-@code{-O flush-time=#} ¥ª¥×¥·¥ç¥ó¤ò @code{mysqld} ¤ËÄɲᣠThis is mostly
-useful on Win32 and tells how often @strong{MySQL} should close all
-unused tables and flush all updated tables to disk.
-@item
-@code{VARCHAR} ¥Õ¥£¡¼¥ë¥É¤È @code{CHAR} ¤òÈæ³Ó¤·¤¿ºÝ¤Ë¥­¡¼¤ò¸ú²ÌŪ¤Ë
-»ÈÍѤ·¤Æ¤¤¤Ê¤«¤Ã¤¿¤Î¤ò½¤Àµ¡£
-@end itemize
-
-@node News-3.22.17, News-3.22.16, News-3.22.18, News-3.22.x
-@appendixsubsec Changes in release 3.22.17
-
-@itemize @bullet
-@item
-@code{--log-update} ¤ò»ÈÍѤ·¤¿¤È¤­¤È¥Ç¥Õ¥©¥ë¥È¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò»ØÄꤷ¤Ê¤¤¤Ç
-Àܳ¤·¤¿¤È¤­¤Î¥³¥¢¥À¥ó¥×¤ò½¤Àµ¤·¤¿¡£
-@item
-¤¤¤¯¤Ä¤«¤Î @code{configure} ¤È°Ü¿¢À­¤ÎÌäÂê¤ò½¤Àµ¤·¤¿¡£
-@item
-Using @code{LEFT JOIN} on tables that had circular dependencies caused
-@code{mysqld} to hang forever.
-@end itemize
-
-@node News-3.22.16, News-3.22.15, News-3.22.17, News-3.22.x
-@appendixsubsec Changes in release 3.22.16
-
-@itemize @bullet
-@item
-@code{mysqladmin processlist} could kill the server if a new user logged in.
-@item
-@code{DELETE FROM table_name WHERE key_column=column_name} ¤¬
-¥Þ¥Ã¥Á¤¹¤ë¹Ô¤ò1¹Ô¤â¸«¤Ä¤±¤ì¤Ê¤¤¤Î¤ò½¤Àµ
-@item
-@code{DATE_ADD(column,...)} ¤¬Æ°¤«¤Ê¤¤¤Î¤ò½¤Àµ
-@item
-@code{INSERT DELAYED} could deadlock with status 'upgrading lock'
-@item
-2ʸ»ú°Ê¾å¤Î¥½¥ë¥È¤¬»ÈÍѤǤ­¤ë¤è¤¦¤Ë¡¢@code{ENCRYPT()} ¤ò³ÈÄ¥¡£
-@item
-@code{longlong2str} ¤Ï°ÊÁ°¤è¤ê¤«¤Ê¤ê®¤¯¤Ê¤Ã¤¿¡£@code{Intel x86} ÍѤË
-¤³¤Î¥³¡¼¥É¤ÏºÇŬ²½¤µ¤ì¤¿¥¢¥»¥ó¥Ö¥é¤Ç½ñ¤­Ä¾¤·¤¿
-@item
-@code{ALTER TABLE} ¤Ë @code{MODIFY} ¥­¡¼¥ï¡¼¥É¤òÄɲÃ
-@end itemize
-
-@node News-3.22.15, News-3.22.14, News-3.22.16, News-3.22.x
-@appendixsubsec Changes in release 3.22.15
-
-@itemize @bullet
-@item
-@code{GRANT} ¤ò @code{IDENTIFIED BY} ¤È¶¦¤Ë»ÈÍѤ·¤¿ºÝ¡¢¸¢¸Â¾ðÊ󤬥եé¥Ã¥·¥å¤µ¤ì¤ë¤Þ¤Ç
-Í­¸ú¤Ë¤Ê¤é¤Ê¤¤
-@item
-Name change of some variables in @code{SHOW STATUS}.
-@item
-Fixed problem with @code{ORDER BY} with 'only index' optimization when there
-were multiple key definitions for a used column.
-@item
-@code{DATE} and @code{DATETIME} columns are now up to 5 times faster than
-before.
-@item
-@code{INSERT DELAYED} can be used to let the client do other things while the
-server inserts rows into a table.
-@item
-¤â¤·2¤Ä¤Î°ã¤¦¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥Æ¡¼¥Ö¥ë¤ò»ÈÍѤ·¤¿¾ì¹ç¡¢
-@code{LEFT JOIN USING (col1,col2)} ¤¬Æ°ºî¤·¤Ê¤«¤Ã¤¿
-@item
-@code{LOAD DATA LOCAL INFILE} ¤¬¥Õ¥¡¥¤¥ë¤¬¤Ê¤¤¤¿¤á¤ÎÍýͳ¤Ç UNIX ¤Ç¤ÏÆ°ºî¤·¤Ê¤«¤Ã¤¿
-@item
-¤È¤Æ¤âû¤¤¹Ô(<4¥Ð¥¤¥È)¤·¤«¤Ê¤¤ @code{VARCHAR}/@code{BLOB} ¤Ç¤ÎÌäÂê¤Î½¤Àµ¡¨
-error 127 ¤¬¤³¤Î¹Ô¤ò¾Ãµî¤¹¤ë¾ì¹ç¤Ëµ¯¤­¤ë²ÄǽÀ­¤¬¤¢¤Ã¤¿
-@item
-Updating @code{BLOB/TEXT} through formulas didn't work for short (< 256 char)
-strings.
-@item
-¿·¤·¤¤¥Û¥¹¥È¾å¤Ç @code{GRANT} ¤ò¼Â¹Ô¤·¤¿¾ì¹ç¡¢¤½¤Î¥Û¥¹¥È¤«¤é¤ÎºÇ½é¤Î¥³¥Í¥¯¥·¥ç¥ó¤Ç
-@code{mysqld} ¤¬»à¤Ì²ÄǽÀ­¤¬¤¢¤Ã¤¿
-@item
-¥¨¥¤¥ê¥¢¥¹Ì¾¤ÈƱ¤¸¹àÌÜ̾¤ò @code{ORDER BY} ¤Ç»ÈÍѤ¹¤ë¾ì¹ç¤Î¥Ð¥°¤ò½¤Àµ
-name as an alias.
-@item
-Added @code{BENCHMARK(loop_count,expression)} function to time expressions.
-@end itemize
-
-@node News-3.22.14, News-3.22.13, News-3.22.15, News-3.22.x
-@appendixsubsec Changes in release 3.22.14
-
-@itemize @bullet
-@item
-¥·¥§¥ë¥¹¥¯¥ê¥×¥È¤«¤é¤Îµ¯Æ°¤Î¤¿¤á¤Ë¡¢@code{mysqld} ¤Î°ú¿ô¤¬¤Ê¤¤¾ì¹ç¤òµö²Ä¤·¤¿¡£
-@item
-Setting a @code{TIMESTAMP} column to @code{NULL} didn't record the timestamp
-value in the update log.
-@item
-Fixed lock handler bug when one did
-@code{INSERT INTO TABLE ... SELECT ... GROUP BY}.
-@item
-Added a patch for @code{localtime_r()} on Win32 so that it will not crash
-anymore if your date is > 2039, but instead will return a time of all zero.
-@item
-Names for
-user-defined functions are no longer case sensitive.
-@item
-Added escape of @code{^Z} (ASCII 26) to @code{\Z} as @code{^Z} doesn't
-work with pipes on Win32.
-@item
-¾­Íè¤Î @strong{MySQL} ¥ê¥ê¡¼¥¹¤Î¤¿¤á¤Ë¡¢@code{mysql_fix_privileges} ¤Ï¡¢
-UDF ¤Î¥µ¥Ý¡¼¥È¤Î¤¿¤á¤Ë¡¢¿·¤·¤¤¹àÌܤò @code{mysql.func} ¤ËÄɲ乤롣
-( type enum ('function','aggregate') NOT NULL ¤¬Äɲ䵤줿 )
-@end itemize
-
-@node News-3.22.13, News-3.22.12, News-3.22.14, News-3.22.x
-@appendixsubsec Changes in release 3.22.13
-
-@itemize @bullet
-@item
-Saving @code{NOW()}, @code{CURDATE()} or @code{CURTIME()} directly in a
-column didn't work.
-@item
-@code{WHERE} À᤬̵¤¤¾ì¹ç¡¢@code{SELECT COUNT(*) ... LEFT JOIN ...} ¤¬Æ°¤«¤Ê¤«¤Ã¤¿
-@item
-UnixWare 7.0.x ¤Ç @strong{MySQL} ¤ò¥³¥ó¥Õ¥£¥°¤Ç¤­¤ë¤è¤¦¤Ë @file{config.guess} ¤ò¹¹¿·
-UnixWare 7.0.x.
-@item
-Changed the implementation of @code{pthread_cond()} on the Win32 version.
-@code{get_lock()} now correctly times out on Win32!
-@end itemize
-
-@node News-3.22.12, News-3.22.11, News-3.22.13, News-3.22.x
-@appendixsubsec Changes in release 3.22.12
-
-@itemize @bullet
-@item
-@code{WHERE} Àá¤Ç @code{DATE_ADD()} ¤È @code{DATE_SUB()} ¤ò»ÈÍѤ·¤¿ºÝ¤ÎÌäÂê¤ò½¤Àµ
-@item
-@code{GRANT ... TO user IDENTIFIED BY 'password'} ¹½Ê¸¤Ç¥Ñ¥¹¥ï¡¼¥É¤ò¥»¥Ã¥È¤Ç¤­¤ë¤è¤¦¤Ë¤·¤¿
-@item
-¿¤¯¤Î¥Æ¡¼¥Ö¥ë¤ò @code{SELECT} ¤·¤Æ @code{GRANT} ¤ò³Îǧ¤¹¤ëºÝ¤Î¥Ð¥°¤ò½¤Àµ
-@item
-RPM ÇÛÉۤǤΠ@code{mysql_fix_privilege_tables} ¥Õ¥¡¥¤¥ë¤ÎÄɲá£
-¤³¤ì¤Ï¥¯¥é¥¤¥¢¥ó¥È¥Ñ¥Ã¥±¡¼¥¸¤Ë´Þ¤ó¤À¤¿¤á¡¢¥Ç¥Õ¥©¥ë¥È¤Ç¤Ïµ¯Æ°¤µ¤ì¤Ê¤¤¡£
-@item
-@code{SQL_SMALL_RESULT} ¥ª¥×¥·¥ç¥ó¤ò @code{SELECT} ¤ËÄɲá£
-¤³¤ì¤Ï¶¯À©Åª¤Ë®¤¤°ì»þ¥Æ¡¼¥Ö¥ë¤ò»ÈÍѤ¹¤ë¡£
-·ë²Ì¤¬¾®¤µ¤¤¤È¤ï¤«¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ë»ÈÍѤ¹¤ë¤ÈÍ­¸ú¡£
-@item
-¾®¿ôÅÀ¤ò¤Ä¤±¤Ê¤¯¤Æ¤â¼Â¿ô¤¬»ÈÍѤǤ­¤ë¤è¤¦¤Ë¤·¤¿
-@item
-@code{DATE_ADD}/@code{DATE_SUB()} ¤Î·ë²Ì¡¢½½Ê¬¤ÊÆü¿ô¤òÆÀ¤é¤ì¤Ê¤¤¾ì¹ç¡¢
-Æü¿ô¤ò·î¤ÎºÇÂçÆü¤Ë¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
-@item
-@code{GRANT} ¤¬¥«¥é¥à¤ò¥±¡¼¥¹Èó°Í¸¤ÇÈæ³Ó¤·¤Æ¤¤¤¿¤Î¤ò½¤Àµ
-@item
-¤¢¤ë¹½Ê¸¤ÎÁȤ߹ç¤ï¤»¤Ç @code{ALTER TABLE} ¤¬ core ¤ò¤Ï¤¯¥Ð¥°¤¬
- @file{sql_list.h} ¤Ë¤¢¤Ã¤¿¤Î¤Ç¤³¤ì¤ò½¤Àµ
-@item
-The hostname in @code{user@@hostname} can now include @samp{.} and @samp{-}
-without quotes in the context of the @code{GRANT}, @code{REVOKE} and
-@code{SET PASSWORD FOR ...} statements.
-@item
-Â礭¤Ê°ì»þ¥Õ¥¡¥¤¥ë¤òɬÍפȤ¹¤ë¥Æ¡¼¥Ö¥ë¤Ø¤Î @code{isamchk} ¤ò½¤Àµ
-@end itemize
-
-@node News-3.22.11, News-3.22.10, News-3.22.12, News-3.22.x
-@appendixsubsec Changes in release 3.22.11
-
-@itemize @bullet
-@item
-@strong{½ÅÍ×}: 3.22.11¤Ë¥¢¥Ã¥×¥°¥ì¡¼¥É¤¹¤ë¾ì¹ç¡¢É¬¤º @code{mysql_fix_privilege_tables} ¥¹¥¯¥ê¥×¥È¤ò¼Â¹Ô¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡ª
-¤³¤ì¤Ï¿·¤·¤¤ @code{GRANT} ¥·¥¹¥Æ¥à¤Î¤¿¤á¤Ë¼Â¹Ô¤·¤Þ¤¹¡£
-¤â¤·¤³¤ì¤ò¹Ô¤ï¤Ê¤±¤ì¤Ð¡¢@code{ALTER TABLE} ¤ä @code{CREATE INDEX}, @code{DROP INDEX} ¤ò
-¼Â¹Ô¤·¤è¤¦¤È¤¹¤ë¤È @code{Access denied} ¤Ë¤Ê¤ê¤Þ¤¹¡£
-@item
-¥Æ¡¼¥Ö¥ë¡¢¥«¥é¥à¤´¤È¤Ë¥æ¡¼¥¶¡¼¤Î¥¢¥¯¥»¥¹¤ËÂФ·¤Æµö²Ä¤äµñÈݤòÀßÄê¤Ç¤­¤Þ¤¹
-@item
-@code{USER()} ¤ò @code{user@@host} ¤òÊÖ¤¹¤è¤¦¤ËÊѹ¹
-@item
-¾¤Î¥æ¡¼¥¶¡¼¤Î @code{PASSWORD} ¤ò¥»¥Ã¥È¤¹¤ë¹½Ê¸¤òÊѹ¹
-@item
-¿·¥³¥Þ¥ó¥É¡§@code{FLUSH STATUS} ¤Ï¤Û¤È¤ó¤É¤Î¥¹¥Æ¡¼¥¿¥¹ÊÑ¿ô¤ò¥¼¥í¤Ë¥»¥Ã¥È¤·¤Þ¤¹
-@item
-¿·¥¹¥Æ¡¼¥¿¥¹ÊÑ¿ô¡§ @code{aborted_threads}, @code{aborted_connects}.
-@item
-¿·¥ª¥×¥·¥ç¥ó¡§ @code{connection_timeout}
-@item
-¥½¡¼¥È¤Î¥µ¥Ý¡¼¥È (by Pruet Boonma
-@email{pruet@@ds90.intanon.nectec.or.th}).
-@item
-¥¹¥í¥Ð¥­¥¢¸ì¤ÈÆüËܸì¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸
-@item
-Configuration and portability fixes.
-@item
-Added option @code{SET SQL_WARNINGS=1} to get a warning count also for simple
-inserts.
-@item
-FreeBSD ¾å¤Ç¥·¥ã¥Ã¥È¥À¥¦¥ó¤¹¤ë¤¿¤á¤Ë¡¢@code{SIGQUIT} ¤Î¤«¤ï¤ê¤Ë @code{SIGTERM} ¤ò»ÈÍѤ·¤Þ¤¹
-@item
-@code{mysql} ¤Ë ¥ª¥×¥·¥ç¥ó @code{\G} (print vertically) ÄɲÃ
-@item
-@code{SELECT HIGH_PRIORITY} ... killed @code{mysqld}.
-@item
-@code{IS NULL} on a @code{AUTO_INCREMENT} column in a @code{LEFT JOIN} didn't
-work as expected.
-@item
-New function @code{MAKE_SET()}.
-@end itemize
-
-@node News-3.22.10, News-3.22.9, News-3.22.11, News-3.22.x
-@appendixsubsec Changes in release 3.22.10
-
-@itemize @bullet
-@item
-mysql_install_db ¤Ï @strong{MySQL} ¥µ¡¼¥Ð¡¼¤òµ¯Æ°¤·¤Ê¤¯¤Ê¤ê¤Þ¤·¤¿!
-mysql_install_db ¤ò¹Ô¤Ã¤¿¸å¤Ë¡¢@code{safe_mysqld} ¤Ç mysqld ¤ò³«»Ï¤µ¤»¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-¤·¤«¤· @strong{MySQL} ¤Î RPM ¥Ñ¥Ã¥±¡¼¥¸¤Ï¥µ¡¼¥Ð¡¼¤ò¤¿¤Á¤¢¤²¤ë¤è¤¦¤Ë¤·¤Æ¤¤¤Þ¤¹¡£
-@item
-@code{--bootstrap} ¤ò @code{mysqld} ¤ËÄɲá£@code{mysql_install_db} ¤Ï¤³¤ì¤ò»ÈÍѤ·¤Þ¤¹¡£
-¤³¤Î°ú¿ô¤Ï RPM ¥Ñ¥Ã¥±¡¼¥¸¤Ç @strong{MySQL} ¤Î¥¤¥ó¥¹¥È¡¼¥ë¤ò´Êά²½¤·¤Þ¤¹¡£
-@item
-@code{+, - (sign and minus), *, /, %, ABS() and MOD()} ¤Î¥³¡¼¥É¤ò½¤Àµ¡£
-@code{BIGINT}¤Ç»ÈÍѤ·¤¿¾ì¹ç¤Î´í¸±À­¤ò²óÈò¤·¤Þ¤·¤¿(64 bit safe).
-@item
-@code{ALTER TABLE} ¤¬ mysqld ¤ò¥¯¥é¥Ã¥·¥å¤µ¤»¤ë¥Ð¥°¤ò½¤Àµ¡£
-@item
-½ÅÊ£¤·¤¿¥­¡¼·ë²Ì¤òÆÀ¤¿¾ì¹ç¡¢@strong{MySQL}¤Ï¾ï¤Ë¤½¤Î»Ý¤òÊó¹ð¤¹¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
-(°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢@code{INSERT} ¤Î»þ¤Ë¤·¤«¥á¥Ã¥»¡¼¥¸¤¬½Ð¤Þ¤»¤ó¤Ç¤·¤¿)
-@item
-New syntax: @code{INSERT INTO table_name SET column=value,column=value,...}
-@item
-@file{.err} ¥í¥°¥Õ¥¡¥¤¥ë¤Î¥í¥°µ­Ï¿¤Ë¡¢time stamp ¤ò¤Ä¤±¤ë¤è¤¦¤Ë¤·¤Þ¤·¤¿¡£
-@item
-@code{MYSQL_INIT_COMMAND} ¥ª¥×¥·¥ç¥ó¤ò @code{mysql_options()} ¤ËÄɲá£
-(ÀܳÍ׵᤹¤ë¾ì¹ç¤Ë»ÈÍѤǤ­¤ë)
-@item
-@code{MYSQL_READ_DEFAULT_FILE} ¤È @code{MYSQL_READ_DEFAULT_GROUP} ¤ò
- @code{mysql_options()}¤ËÄɲá£
-@strong{MySQL} ¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤«¤é°Ê²¼¤Î¥Ñ¥é¥á¡¼¥¿¡¼¤òÆɤ߼è¤ë¡§
-@code{port},
-@code{socket}, @code{compress}, @code{password}, @code{pipe}, @code{timeout},
-@code{user}, @code{init-command}, @code{host} and @code{database}
- (ÌõÃí)¥ª¥×¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤Î¥Ç¥Õ¥©¥ë¥È¤Ï /etc/my.cnf , install_directory/share/mysql/my.cnf
-@item
-UDF ¹½Ê¸¤Ë @code{maybe_null} ¤òÄɲÃ
-@item
-Added option @code{IGNORE} to @code{INSERT} statemants with many rows.
-@item
-koi8 ¥­¥ã¥é¥¯¥¿¡¼¤ò¥½¡¼¥È¤¹¤ë¾ì¹ç¤ÎÌäÂê¤ò½¤Àµ¡£
-koi8¤ò»ÈÍѤ·¤Æ¤¤¤ë¥æ¡¼¥¶¡¼¤Ï¡¢@code{CHAR} ¤ä @code{VARCHAR} ¥«¥é¥à¤ò
-¥¤¥ó¥Ç¥Ã¥¯¥¹¤Ë¤·¤Æ¤¤¤ë¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ¡¢@strong{ɬ¤º} @code{isamchk -rq} ¤ò¼Â¹Ô¤¹¤ë¤³¤È¡£
-@item
-¿·µ¬¥¹¥¯¥ê¥×¥È @code{mysql_setpermission} (Luuk de Boer ºî)
-¤³¤ì¤Ï»ØÄꤵ¤ì¤¿¥Ç¡¼¥¿¥Ù¡¼¥¹¤ËÂФ·¤Æ¥¢¥¯¥»¥¹¤òµö²Ä¤¹¤ë¥æ¡¼¥¶¡¼¤ò
-´Êñ¤ËÅÐÏ¿¤·¤Æ¤¯¤ì¤Þ¤¹¡£
-@item
-Allow use of hexadecimal strings (0x...) when specifying a constant string
-(like in the column separators with @code{LOAD DATA INFILE}).
-@item
-OS/2 ¤Ë°Ü¿¢ (thanks to Antony T. Curtis @email{antony.curtis@@olcs.net}).
-@item
-@code{SHOW STATUS} ¤Ç¤ÎÊÑ¿ô¤òÁý¤ä¤·¤Þ¤·¤¿¡£¤Þ¤¿¡¢@code{SHOW VARIABLES} ¤Î
-¤è¤¦¤Ê½ÐÎÏ¥Õ¥©¡¼¥Þ¥Ã¥È¤ËÊѹ¹¤·¤Þ¤·¤¿¡£
-@item
-@code{extended-status} ¥³¥Þ¥ó¥É¤ò @code{mysqladmin} ¤ËÄɲá£
-¤³¤ì¤Ï¿·¤·¤¤¥¹¥Æ¥¤¥¿¥¹ÊÑ¿ô¤òɽ¼¨¤·¤Þ¤¹
-@end itemize
-
-@node News-3.22.9, News-3.22.8, News-3.22.10, News-3.22.x
-@appendixsubsec Changes in release 3.22.9
-
-@itemize @bullet
-@item
-@code{SET SQL_LOG_UPDATE=0} caused a lockup of the server.
-@item
-New SQL command: @code{FLUSH [ TABLES | HOSTS | LOGS | PRIVILEGES ] [, ...]}
-@item
-New SQL command: @code{KILL} @code{thread_id} .
-@item
-AIX, DEC OSF1 4.x ¤Ç @strong{MySQL} ¤ò´Êñ¤Ë¥³¥ó¥Ñ¥¤¥ë¤Ç¤­¤ë¤è¤¦¤Ë
-include ¥Õ¥¡¥¤¥ë¤òÊѹ¹¡£
-@item
-@code{ALTER TABLE} ¤ò»ÈÍѤ·¤Æ @code{INT} ¤«¤é¥µ¥¤¥º¤Î¾®¤µ¤¤ @code{CHAR()} ¤Ë
-Êѹ¹¤¹¤ë¾ì¹ç¤Ë¤ª¤­¤Æ¤¤¤¿ÉÔ¶ñ¹ç¤ò½¤Àµ¡£
-@item
-@code{SELECT HIGH_PRIORITY} Äɲá£
-@code{SELECT} ¤Ë¤ª¤¤¤Æ¡¢¤¿¤È¤¨Â¾¤Î @code{SELECT} ¤òÂԤäƤ¤¤ë¥¹¥ì¥Ã¥É¤¬¤¢¤Ã¤¿¤È¤·¤Æ¤â¡¢
-@code{WRITE LOCK} ¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@item
-Moved wild_compare to string class to be able to use @code{LIKE} on
-@code{BLOB}/@code{TEXT} columns with \0.
-@item
-Added @code{ESCAPE} option to @code{LIKE}
-@item
-@code{mysqladmin debug} ¤Ë¤ª¤¤¤Æ¡¢¤è¤ê¿¤¯¤Î½ÐÎϤ¬ÆÀ¤é¤ì¤ë¤è¤¦¤Ë¤·¤¿¡£
-@item
-Win32 ¤Ë¤ª¤¤¤Æ¡¢@code{--flush} ¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤Æ @code{mysqld} ¤òµ¯Æ°¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ê¤Þ¤·¤¿¡£
-¤³¤ì¤Ï¥¢¥Ã¥×¥Ç¡¼¥È¤¬½ª¤ï¤Ã¤¿¸å¤Ç¤¹¤Ù¤Æ¤Î¥Æ¡¼¥Ö¥ë¤ò¥Ç¥£¥¹¥¯¤Ë¥Õ¥é¥Ã¥·¥å¤·¤Þ¤¹¡£
-¤³¤Î¥ª¥×¥·¥ç¥ó¤Ë¤è¤ê NT/Win98 ¾å¤Ç¤¹¤´¤¯°ÂÁ´¤ËÆ°¤«¤¹¤³¤È¤¬¤Ç¤­¤Þ¤¹¤¬¡¢
-@strong{¤È¤Æ¤â} ÃÙ¤¯¤Ê¤ê¤Þ¤¹¡£
-@end itemize
-
-@node News-3.22.8, News-3.22.7, News-3.22.9, News-3.22.x
-@appendixsubsec Changes in release 3.22.8
-
-@itemize @bullet
-@item
-Czech character sets should now work much better. You must also install
-@uref{ftp://www.mysql.com/pub/mysql/Downloads/Patches/czech-3.22.8-patch}.
-This patch should also be installed if you are using a character set with
-uses @code{my_strcoll()}! The patch should always be safe to install (for any system),
-but as this patch changes ISAM internals it's not yet in the default
-distribution.
-@item
-@code{DATE_ADD()} and @code{DATE_SUB()} didn't work with group functions.
-@item
-@code{mysql} will now also try to reconnect on @code{USE DATABASE} commands.
-@item
-Fix problem with @code{ORDER BY} and @code{LEFT JOIN} and @code{const} tables.
-@item
-Fixed problem with @code{ORDER BY} if the first @code{ORDER BY} column
-was a key and the rest of the @code{ORDER BY} columns wasn't part of the key.
-@item
-Fixed a big problem with @code{OPTIMIZE TABLE}.
-@item
-@strong{MySQL} clients on NT will now by default first try to connect with
-named pipes and after this with TCP/IP.
-@item
-Fixed a problem with @code{DROP TABLE} and @code{mysqladmin shutdown} on Win32
-(a fatal bug from 3.22.6).
-@item
-Fixed problems with @code{TIME columns} and negative strings.
-@item
-Added an extra thread signal loop on shutdown to avoid some error messages
-from the client.
-@item
-@strong{MySQL} now uses the next available number as extension for the update
-log file.
-@item
-Added patches for UNIXWARE 7.
-@end itemize
-
-@node News-3.22.7, News-3.22.6, News-3.22.8, News-3.22.x
-@appendixsubsec Changes in release 3.22.7
-
-@itemize @bullet
-@item
-Added @code{LIMIT} clause for the @code{DELETE} statement.
-@item
-You can now use the @code{/*! ... */} syntax to hide @strong{MySQL}-specific
-keywords when you write portable code. @strong{MySQL} will parse the code
-inside the comments as if the surrounding @code{/*!} and @code{*/} comment
-characters didn't exist.
-@item
-@code{OPTIMIZE TABLE tbl_name} can now be used to reclaim disk space
-after many deletes. Currently, this uses @code{ALTER TABLE} to re-generate
-the table, but in the future it will use an integrated @code{isamchk}
-for more speed.
-@item
-Upgraded @code{libtool} to get the configure more portable.
-@item
-Fixed slow @code{UPDATE} and @code{DELETE} operations when using
-@code{DATETIME} or @code{DATE} keys.
-@item
-Changed optimizer to make it better at deciding when to do a full join
-and when using keys.
-@item
-You can now use @code{mysqladmin proc} to display information about your own
-threads. Only users with the @strong{Process_priv} privilege can get
-information about all threads.
-@item
-Added handling of formats @code{YYMMDD}, @code{YYYYMMDD},
-@code{YYMMDDHHMMSS} for numbers when using @code{DATETIME} and
-@code{TIMESTAMP} types. (Formerly these formats only worked with strings.)
-@item
-Added connect option @code{CLIENT_IGNORE_SPACE} to allow use of spaces
-after function names and before @samp{(} (Powerbuilder requires this).
-This will make all function names reserved words.
-@item
-Added the @code{--log-long-format} option to @code{mysqld} to enable timestamps
-and INSERT_ID's in the update log.
-@item
-Added @code{--where} option to @code{mysqldump} (patch by Jim Faucette).
-@item
-The lexical analyzer now uses ``perfect hashing'' for faster parsing of SQL
-statements.
-@end itemize
-
-@node News-3.22.6, News-3.22.5, News-3.22.7, News-3.22.x
-@appendixsubsec Changes in release 3.22.6
-
-@itemize @bullet
-@item
-Faster @code{mysqldump}.
-@item
-For the @code{LOAD DATA INFILE} statement, you can now use the new @code{LOCAL}
-keyword to read the file from the client. @code{mysqlimport} will
-automatically use @code{LOCAL} when importing with the TCP/IP protocol.
-@item
-Fixed small optimize problem when updating keys.
-@item
-Changed makefiles to support shared libraries.
-@item
-@strong{MySQL}-NT can now use named pipes, which means that you can now use
-@strong{MySQL}-NT without having to install TCP/IP.
-@end itemize
-
-@node News-3.22.5, News-3.22.4, News-3.22.6, News-3.22.x
-@appendixsubsec Changes in release 3.22.5
-
-@itemize @bullet
-@item
-All table lock handing is changed to avoid some very subtle
-deadlocks when using @code{DROP TABLE}, @code{ALTER TABLE}, @code{DELETE FROM
-TABLE} and @code{mysqladmin flush-tables} under heavy usage.
-Changed locking code to get better handling of locks of different types.
-@item
-Updated @code{DBI} to 1.00 and @code{DBD} to 1.2.0.
-@item
-Added a check that the error message file contains error messages suitable for
-the current version of @code{mysqld}. (To avoid errors if you accidentally
-try to use an old error message file.)
-@item
-All count structures in the client (@code{affected_rows()},
-@code{insert_id()},...) are now of type @code{BIGINT} to allow 64-bit values
-to be used.
-This required a minor change in the @strong{MySQL} protocol which should affect
-only old clients when using tables with @code{AUTO_INCREMENT} values > 24M.
-@item
-The return type of @code{mysql_fetch_lengths()} has changed from @code{uint *}
-to @code{ulong *}. This may give a warning for old clients but should work
-on most machines.
-@item
-Change @code{mysys} and @code{dbug} libraries to allocate all thread variables
-in one struct. This makes it easier to make a threaded @file{libmysql.dll}
-library.
-@item
-Use the result from @code{gethostname()} (instead of @code{uname()}) when
-constructing @file{.pid} file names.
-@item
-New better compressed server/client protocol.
-@item
-@code{COUNT()}, @code{STD()} and @code{AVG()} are extended to handle more than
-4G rows.
-@item
-You can now store values in the range @code{-838:59:59} <= x <=
-@code{838:59:59} in a @code{TIME} column.
-@item
-@strong{WARNING: INCOMPATIBLE CHANGE!!}
-If you set a @code{TIME} column to too short a value, @strong{MySQL} now
-assumes the value is given as: @code{[[[D ]HH:]MM:]SS} instead of
-@code{HH[:MM[:SS]]}.
-@item
-@code{TIME_TO_SEC()} and @code{SEC_TO_TIME()} can now handle negative times
-and hours up to 32767.
-@item
-Added new option
-@code{SET OPTION SQL_LOG_UPDATE=@{0|1@}} to allow users with
-the @strong{process} privilege to bypass the update log.
-(Modified patch from Sergey A Mukhin @email{violet@@rosnet.net}.)
-@item
-Fixed fatal bug in @code{LPAD()}.
-@item
-Initialize line buffer in @file{mysql.cc} to make @code{BLOB} reading from
-pipes safer.
-@item
-Added @code{-O max_connect_errors=#} option to @code{mysqld}.
-Connect errors are now reset for each correct connection.
-@item
-Increased the default value of @code{max_allowed_packet} to @code{1M} in
-@code{mysqld}.
-@item
-Added @code{--low-priority-updates} option to @code{mysqld}, to give
-table-modifying operations (@code{INSERT}, @code{REPLACE}, @code{UPDATE},
-@code{DELETE}) lower priority than retrievals. You can now use
-@code{@{INSERT | REPLACE | UPDATE | DELETE@} LOW_PRIORITY ...} You can
-also use @code{SET OPTION SQL_LOW_PRIORITY_UPDATES=@{0|1@}} to change
-the priority for one thread. One side effect is that @code{LOW_PRIORITY}
-is now a reserved word. :(
-@item
-Add support for @code{INSERT INTO table ... VALUES(...),(...),(...)},
-to allow inserting multiple rows with a single statement.
-@item
-@code{INSERT INTO tbl_name} is now also cached when used with @code{LOCK TABLES}.
-(Previously only @code{INSERT ... SELECT} and @code{LOAD DATA INFILE} were
-cached.)
-@item
-Allow @code{GROUP BY} functions with @code{HAVING}:
-@example
-mysql> SELECT col FROM table GROUP BY col HAVING COUNT(*)>0;
-@end example
-@item
-@code{mysqld} will now ignore trailing @samp{;} characters in queries. This
-is to make it easier to migrate from some other SQL servers that require the
-trailing @samp{;}.
-@item
-Fix for corrupted fixed-format output generated by @code{SELECT INTO OUTFILE}.
-@item
-@strong{WARNING: INCOMPATIBLE CHANGE!!}
-Added Oracle @code{GREATEST()} and @code{LEAST()} functions. You must now use
-these instead of the @code{MAX()} and @code{MIN()} functions to get the
-largest/smallest value from a list of values. These can now handle @code{REAL},
-@code{BIGINT} and string (@code{CHAR} or @code{VARCHAR}) values.
-@item
-@strong{WARNING: INCOMPATIBLE CHANGE!!}
-@code{DAYOFWEEK()} had offset 0 for Sunday. Changed the offset to 1.
-@item
-Give an error for queries that mix @code{GROUP BY} columns and fields when
-there is no @code{GROUP BY} specification.
-@item
-Added @code{--vertical} option to @code{mysql}, for printing results in
-vertical mode.
-@item
-Index-only optimization; some queries are now resolved using
-only indexes. Until @strong{MySQL} 4.0, this works only for numeric columns.
-@xref{MySQL indexes, , @strong{MySQL} indexes}.
-@item
-Lots of new benchmarks.
-@item
-A new C API chapter and lots of other improvements in the manual.
-@end itemize
-
-@node News-3.22.4, News-3.22.3, News-3.22.5, News-3.22.x
-@appendixsubsec Changes in release 3.22.4
-
-@itemize @bullet
-@item
-Added @code{--tmpdir} option to @code{mysqld}, for specifying the location
-of the temporary file directory.
-@item
-@strong{MySQL} now automatically changes a query from an ODBC client:
-@example
-SELECT ... FROM table WHERE auto_increment_column IS NULL
-@end example
-to:
-@example
-SELECT ... FROM table WHERE auto_increment_column == LAST_INSERT_ID()
-@end example
-This allows some ODBC programs (Delphi, Access) to retrieve the newly
-inserted row to fetch the @code{AUTO_INCREMENT} id.
-@item
-@code{DROP TABLE} now waits for all users to free a table before deleting it.
-@item
-Fixed small memory leak in the new connect protocol.
-@item
-New functions @code{BIN()}, @code{OCT()}, @code{HEX()} and @code{CONV()} for
-converting between different number bases.
-@item
-Added function @code{SUBSTRING()} with 2 arguments.
-@item
-If you created a table with a record length smaller than 5, you couldn't
-delete rows from the table.
-@item
-Added optimization to remove const reference tables from @code{ORDER BY} and
-@code{GROUP BY}.
-@item
-@code{mysqld} now automatically disables system locking on Linux and Win32,
-and for systems that use MIT-pthreads. You can force the use of locking
-with the @code{--enable-locking} option.
-@item
-Added @code{--console} option to @code{mysqld}, to force a console window
-(for error messages) when using Win32.
-@item
-Fixed table locks for Win32.
-@item
-Allow @samp{$} in identifiers.
-@item
-Changed name of user-specific configuration file from @file{my.cnf} to
-@file{.my.cnf} (Unix only).
-@item
-Added @code{DATE_ADD()} and @code{DATE_SUB()} functions.
-@end itemize
-
-@node News-3.22.3, News-3.22.2, News-3.22.4, News-3.22.x
-@appendixsubsec Changes in release 3.22.3
-
-@itemize @bullet
-@item
-Fixed a lock problem (bug in @strong{MySQL} 3.22.1) when closing temporary tables.
-@item
-Added missing @code{mysql_ping()} to the client library.
-@item
-Added @code{--compress} option to all @strong{MySQL} clients.
-@item
-Changed @code{byte} to @code{char} in @file{mysql.h} and @file{mysql_com.h}.
-@end itemize
-
-@node News-3.22.2, News-3.22.1, News-3.22.3, News-3.22.x
-@appendixsubsec Changes in release 3.22.2
-
-@itemize @bullet
-@item
-Searching on multiple constant keys that matched more than 30% of the rows
-didn't always use the best possible key.
-@item
-New functions @code{<<}, @code{>>}, @code{RPAD()} and @code{LPAD()}.
-@item
-You can now save default options (like passwords) in a configuration file
-(@file{my.cnf}).
-@item
-Lots of small changes to get @code{ORDER BY} to work when no records are found
-when using fields that are not in @code{GROUP BY} (@strong{MySQL} extension).
-@item
-Added @code{--chroot} option to @code{mysqld}, to start @code{mysqld} in
-a chroot environment (by Nikki Chumakov @email{nikkic@@cityline.ru}).
-@item
-Trailing spaces are now ignored when comparing case-sensitive strings;
-this should fix some problems with ODBC and flag 512!
-@item
-Fixed a core-dump bug in the range optimizer.
-@item
-Added @code{--one-thread} option to @code{mysqld}, for debugging with
-LinuxThreads (or @code{glibc}). (This replaces the @code{-T32} flag)
-@item
-Added @code{DROP TABLE IF EXISTS} to prevent an error from occurring if the
-table doesn't exist.
-@item
-@code{IF} and @code{EXISTS} are now reserved words (they would have to
-be sooner or later).
-@item
-Added lots of new options to @code{mysqldump}.
-@item
-Server error messages are now in @file{mysqld_error.h}.
-@item
-The server/client protocol now supports compression.
-@item
-All bug fixes from @strong{MySQL} 3.21.32.
-@end itemize
-
-@node News-3.22.1, News-3.22.0, News-3.22.2, News-3.22.x
-@appendixsubsec Changes in release 3.22.1
-
-@itemize @bullet
-@item
-Added new C API function @code{mysql_ping()}.
-@item
-Added new API functions @code{mysql_init()} and @code{mysql_options()}.
-You now MUST call @code{mysql_init()} before you call
-@code{mysql_real_connect()}.
-You don't have to call @code{mysql_init()} if you only use
-@code{mysql_connect()}.
-@item
-Added @code{mysql_options(...,MYSQL_OPT_CONNECT_TIMEOUT,...)} so you can set a
-timeout for connecting to a server.
-@item
-Added @code{--timeout} option to @code{mysqladmin}, as a test of
-@code{mysql_options()}.
-@item
-Added @code{AFTER column} and @code{FIRST} options to
-@code{ALTER TABLE ... ADD columns}.
-This makes it possible to add a new column at some specific location
-within a row in an existing table.
-@item
-@code{WEEK()} now takes an optional argument to allow handling of weeks when
-the week starts on Monday (some European countries). By default,
-@code{WEEK()} assumes the week starts on Sunday.
-@item
-@code{TIME} columns weren't stored properly (bug in @strong{MySQL} 3.22.0).
-@item
-@code{UPDATE} now returns information about how many rows were
-matched and updated, and how many ``warnings'' occurred when doing the update.
-@item
-Fixed incorrect result from @code{FORMAT(-100,2)}.
-@item
-@code{ENUM} and @code{SET} columns were compared in binary (case-sensitive)
-fashion; changed to be case insensitive.
-@end itemize
-
-@node News-3.22.0, , News-3.22.1, News-3.22.x
-@appendixsubsec Changes in release 3.22.0
-
-@itemize @bullet
-@item
-New (backward compatible) connect protocol that allows you to
-specify the database to use when connecting, to get much faster
-connections to a specific database.
-
-The @code{mysql_real_connect()} call is changed to:
-
-@example
-mysql_real_connect(MYSQL *mysql, const char *host, const char *user,
- const char *passwd, const char *db, uint port,
- const char *unix_socket, uint client_flag)
-@end example
-@item
-Each connection is handled by its own thread, rather than by the
-master @code{accept()} thread. This fixes permanently the telnet bug
-that was a topic on the mail list some time ago.
-@item
-All TCP/IP connections are now checked with backward resolution of
-the hostname to get better security. @code{mysqld} now has a local hostname
-resolver cache so connections should actually be faster than before,
-even with this feature.
-@item
-A site automatically will be blocked from future connections if someone
-repeatedly connects with an ``improper header'' (like when one uses telnet).
-@item
-You can now refer to tables in different databases with references of the form
-@code{tbl_name@@db_name} or @code{db_name.tbl_name}. This makes it possible to
-give a user read access to some tables and write access to others simply by
-keeping them in different databases!
-@item
-Added @code{--user} option to @code{mysqld}, to allow it to run
-as another Unix user (if it is started as the Unix @code{root} user).
-@item
-Added caching of users and access rights (for faster access rights checking)
-@item
-Normal users (not anonymous ones) can change their password with
-@code{mysqladmin password 'new_password'}. This uses encrypted passwords
-that are not logged in the normal @strong{MySQL} log!
-@item
-All important string functions are now coded in assembler for x86 Linux
-machines. This gives a speedup of 10% in many cases.
-@item
-For tables that have many columns, the column names are now hashed for
-much faster column name lookup (this will speed up some benchmark
-tests a lot!)
-@item
-Some benchmarks are changed to get better individual timing.
-(Some loops were so short that a specific test took < 2 seconds. The
-loops have been changed to take about 20 seconds to make it easier
-to compare different databases. A test that took 1-2 seconds before
-now takes 11-24 seconds, which is much better)
-@item
-Re-arranged @code{SELECT} code to handle some very specific queries
-involving group functions (like @code{COUNT(*)}) without a @code{GROUP BY} but
-with @code{HAVING}. The following now works:
-@example
-mysql> SELECT count(*) as C FROM table HAVING C > 1;
-@end example
-@item
-Changed the protocol for field functions to be faster and avoid some
-calls to @code{malloc()}.
-@item
-Added @code{-T32} option to @code{mysqld}, for running all queries under the
-main thread. This makes it possible to debug @code{mysqld} under Linux with
-@code{gdb}!
-@item
-Added optimization of @code{not_null_column IS NULL} (needed for some Access
-queries).
-@item
-Allow @code{STRAIGHT_JOIN} to be used between two tables to force the optimizer
-to join them in a specific order.
-@item
-String functions now return @code{VARCHAR} rather than @code{CHAR} and
-the column type is now @code{VARCHAR} for fields saved as @code{VARCHAR}.
-This should make the @strong{MyODBC} driver better, but may break some old
-@strong{MySQL} clients that don't handle @code{FIELD_TYPE_VARCHAR} the same
-way as @code{FIELD_TYPE_CHAR}.
-@item
-@code{CREATE INDEX} and @code{DROP INDEX} are now implemented through
-@code{ALTER TABLE}.
-@code{CREATE TABLE} is still the recommended (fast) way to create indexes.
-@item
-Added @code{--set-variable} option @code{wait_timeout} to @code{mysqld}.
-@item
-Added time column to @code{mysqladmin processlist} to show how long a query
-has taken or how long a thread has slept.
-@item
-Added lots of new variables to @code{show variables} and some new to
-@code{show status}.
-@item
-Added new type @code{YEAR}. @code{YEAR} is stored in 1 byte with allowable
-values of 0, and 1901 to 2155.
-@item
-Added new @code{DATE} type that is stored in 3 bytes rather than 4 bytes.
-All new tables are created with the new date type if you don't use the
-@code{--old-protocol} option to @code{mysqld}.
-@item
-Fixed bug in record caches; for some queries, you could get
-@code{Error from table handler: #} on some operating systems.
-@item
-Added @code{--enable-assembler} option to @code{configure}, for x86 machines
-(tested on Linux + @code{gcc}). This will enable assembler functions for the
-most important string functions for more speed!
-@end itemize
-
-@node News-3.21.x, News-3.20.x, News-3.22.x, News
-@appendixsec Changes in release 3.21.x
-
-@menu
-* News-3.21.33:: Changes in release 3.21.33
-* News-3.21.32:: Changes in release 3.21.32
-* News-3.21.31:: Changes in release 3.21.31
-* News-3.21.30:: Changes in release 3.21.30
-* News-3.21.29:: Changes in release 3.21.29
-* News-3.21.28:: Changes in release 3.21.28
-* News-3.21.27:: Changes in release 3.21.27
-* News-3.21.26:: Changes in release 3.21.26
-* News-3.21.25:: Changes in release 3.21.25
-* News-3.21.24:: Changes in release 3.21.24
-* News-3.21.23:: Changes in release 3.21.23
-* News-3.21.22:: Changes in release 3.21.22
-* News-3.21.21a:: Changes in release 3.21.21a
-* News-3.21.21:: Changes in release 3.21.21
-* News-3.21.20:: Changes in release 3.21.20
-* News-3.21.19:: Changes in release 3.21.19
-* News-3.21.18:: Changes in release 3.21.18
-* News-3.21.17:: Changes in release 3.21.17
-* News-3.21.16:: Changes in release 3.21.16
-* News-3.21.15:: Changes in release 3.21.15
-* News-3.21.14b:: Changes in release 3.21.14b
-* News-3.21.14a:: Changes in release 3.21.14a
-* News-3.21.13:: Changes in release 3.21.13
-* News-3.21.12:: Changes in release 3.21.12
-* News-3.21.11:: Changes in release 3.21.11
-* News-3.21.10:: Changes in release 3.21.10
-* News-3.21.9:: Changes in release 3.21.9
-* News-3.21.8:: Changes in release 3.21.8
-* News-3.21.7:: Changes in release 3.21.7
-* News-3.21.6:: Changes in release 3.21.6
-* News-3.21.5:: Changes in release 3.21.5
-* News-3.21.4:: Changes in release 3.21.4
-* News-3.21.3:: Changes in release 3.21.3
-* News-3.21.2:: Changes in release 3.21.2
-* News-3.21.0:: Changes in release 3.21.0
-@end menu
-
-@node News-3.21.33, News-3.21.32, News-3.21.x, News-3.21.x
-@appendixsubsec Changes in release 3.21.33
-
-@itemize @bullet
-@item
-Fixed problem when sending @code{SIGHUP} to @code{mysqld};
-@code{mysqld} core dumped when starting from boot on some systems.
-@item
-Fixed problem with losing a little memory for some connections.
-@item
-@code{DELETE FROM tbl_name} without a @code{WHERE} condition is now done the
-long way when you use @code{LOCK TABLES} or if the table is in use, to
-avoid race conditions.
-@item
-@code{INSERT INTO TABLE (timestamp_column) VALUES (NULL);} didn't set timestamp.
-@end itemize
-
-@node News-3.21.32, News-3.21.31, News-3.21.33, News-3.21.x
-@appendixsubsec Changes in release 3.21.32
-
-@itemize @bullet
-@item
-Fixed some possible race conditions when doing many reopen/close on the same
-tables under heavy load! This can happen if you execute @code{mysqladmin
-refresh} often. This could in some very rare cases corrupt the header of the
-index file and cause error 126 or 138.
-
-@item
-Fixed fatal bug in @code{refresh()} when running with the @code{--skip-locking}
-option.
-There was a ``very small'' time gap after a @code{mysqladmin refresh} when
-a table could be corrupted if one thread updated a table while another
-thread did @code{mysqladmin refresh} and another thread started a new update
-ont the same table before the first thread had finished.
-A refresh (or @code{--flush-tables}) will now not return until all used tables
-are closed!
-@item
-@code{SELECT DISTINCT} with a @code{WHERE} clause that didn't match any rows
-returned a row in some contexts (bug only in 3.21.31).
-@item
-@code{GROUP BY} + @code{ORDER BY} returned one empty row when no rows where
-found.
-@item
-Fixed a bug in the range optimizer that wrote
-@code{Use_count: Wrong count for ...} in the error log file.
-@end itemize
-
-@node News-3.21.31, News-3.21.30, News-3.21.32, News-3.21.x
-@appendixsubsec Changes in release 3.21.31
-@itemize @bullet
-@item
-Fixed a sign extension problem for the @code{TINYINT} type on Irix.
-@item
-Fixed problem with @code{LEFT("constant_string",function)}.
-@item
-Fixed problem with @code{FIND_IN_SET()}.
-@item
-@code{LEFT JOIN} core dumped if the second table is used with a constant
-@code{WHERE/ON} expression that uniquely identifies one record.
-@item
-Fixed problems with @code{DATE_FORMAT()} and incorrect dates.
-@code{DATE_FORMAT()} now ignores @code{'%'} to make it possible to extend
-it more easily in the future.
-@end itemize
-
-@node News-3.21.30, News-3.21.29, News-3.21.31, News-3.21.x
-@appendixsubsec Changes in release 3.21.30
-@itemize @bullet
-@item
-@code{mysql} now returns an exit code > 0 if the query returned an error.
-@item
-Saving of command line history to file in @code{mysql} client.
-By Tommy Larsen @email{tommy@@mix.hive.no}.
-@item
-Fixed problem with empty lines that were ignored in @file{mysql.cc}.
-@item
-Save the pid of the signal handler thread in the pid file instead
-of the pid of the main thread.
-@item
-@email{tommy@@valley.ne.jp} ¤Ë¤è¤ëÆüËܸ쥭¥ã¥é¥¯¥¿¡¼¥»¥Ã¥È(SJIS, UJIS)¤Î¥µ¥Ý¡¼¥È.
-@item
-Changed @code{safe_mysqld} to redirect startup messages to
-@code{'hostname'.err} instead
-of @code{'hostname'.log} to reclaim file space on @code{mysqladmin refresh}.
-@item
-@code{ENUM} always had the first entry as default value.
-@item
-@code{ALTER TABLE} wrote two entries to the update log.
-@item
-@code{sql_acc()} now closes the @code{mysql} grant tables after a reload to
-save table space and memory.
-@item
-Changed @code{LOAD DATA} to use less memory with tables and @code{BLOB}
-columns.
-@item
-Sorting on a function which made a division / 0 produced a wrong set
-in some cases.
-@item
-Fixed @code{SELECT} problem with @code{LEFT()} when using the czech character
-set.
-@item
-Fixed problem in @code{isamchk}; it couldn't repair a packed table in a very
-unusual case.
-@item
-@code{SELECT} statements with @code{&} or @code{|} (bit functions) failed on
-columns with @code{NULL} values.
-@item
-When comparing a field = field, where one of the fields was a part key,
-only the length of the part key was compared.
-@end itemize
-
-@node News-3.21.29, News-3.21.28, News-3.21.30, News-3.21.x
-@appendixsubsec Changes in release 3.21.29
-@itemize @bullet
-@item
-@code{LOCK TABLES} + @code{DELETE from tbl_name} never removed locks properly.
-@item
-Fixed problem when grouping on an @code{OR} function.
-@item
-Fixed permission problem with @code{umask()} and creating new databases.
-@item
-Fixed permission problem on result file with @code{SELECT ... INTO OUTFILE ...}
-@item
-Fixed problem in range optimizer (core dump) for a very complex query.
-@item
-Fixed problem when using @code{MIN(integer)} or @code{MAX(integer)} in
-@code{GROUP BY}.
-@item
-Fixed bug on Alpha when using integer keys. (Other keys worked on Alpha).
-@item
-Fixed bug in @code{WEEK("XXXX-xx-01")}.
-@end itemize
-
-@node News-3.21.28, News-3.21.27, News-3.21.29, News-3.21.x
-@appendixsubsec Changes in release 3.21.28
-@itemize @bullet
-@item
-Fixed socket permission (clients couldn't connect to Unix socket on Linux).
-@item
-Fixed bug in record caches; for some queries, you could get
-@code{Error from table handler: #} on some operating systems.
-@end itemize
-
-@node News-3.21.27, News-3.21.26, News-3.21.28, News-3.21.x
-@appendixsubsec Changes in release 3.21.27
-@itemize @bullet
-@item
-Added user level lock functions @code{GET_LOCK(string,timeout)},
-@code{RELEASE_LOCK(string)}.
-@item
-Added @code{opened_tables} to @code{show status}.
-@item
-Changed connect timeout to 3 seconds to make it somewhat harder
-for crackers to kill @code{mysqld} through telnet + TCP/IP.
-@item
-Fixed bug in range optimizer when using
-@code{WHERE key_part_1 >= something AND key_part_2 <= something_else}.
-@item
-Changed @code{configure} for detection of FreeBSD 3.0 9803xx and above
-@item
-@code{WHERE} with string_column_key = constant_string didn't always find
-all rows if the column had many values differing only with characters of
-the same sort value (like e and @'e).
-@item
-Strings keys looked up with 'ref' were not compared in case-sensitive fashion.
-@item
-Added @code{umask()} to make log files non-readable for normal users.
-@item
-Ignore users with old (8-byte) password on startup if not using
-@code{--old-protocol} option to @code{mysqld}.
-@item
-@code{SELECT} which matched all key fields returned the values in the
-case of the matched values, not of the found values. (Minor problem.)
-@end itemize
-
-@node News-3.21.26, News-3.21.25, News-3.21.27, News-3.21.x
-@appendixsubsec Changes in release 3.21.26
-@itemize @bullet
-@item
-@code{FROM_DAYS(0)} now returns "0000-00-00".
-@item
-In @code{DATE_FORMAT()}, PM and AM were swapped for hours 00 and 12.
-@item
-Extended the default maximum key size to 256.
-@item
-Fixed bug when using @code{BLOB}/@code{TEXT} in @code{GROUP BY} with many
-tables.
-@item
-An @code{ENUM} field that is not declared @code{NOT NULL} has @code{NULL} as
-the default value.
-(Previously, the default value was the first enumeration value.)
-@item
-Fixed bug in the join optimizer code when using many part keys
-on the same key: @code{INDEX (Organization,Surname(35),Initials(35))}.
-@item
-Added some tests to the table order optimizer to get some cases with
-@code{SELECT ... FROM many_tables} much faster.
-@item
-Added a retry loop around @code{accept()} to possibly fix some problems on some
-Linux machines.
-@end itemize
-
-@node News-3.21.25, News-3.21.24, News-3.21.26, News-3.21.x
-@appendixsubsec Changes in release 3.21.25
-@itemize @bullet
-@item
-Changed @code{typedef 'string'} to @code{typedef 'my_string'} for better
-portability.
-@item
-You can now kill threads that are waiting on a disk full condition.
-@item
-Fixed some problems with UDF functions.
-@item
-Added long options to @code{isamchk}. Try @code{isamchk --help}.
-@item
-Fixed a bug when using 8 bytes long (alpha); @code{filesort()} didn't work.
-Affects @code{DISTINCT}, @code{ORDER BY} and @code{GROUP BY} on 64-bit
-processors.
-@end itemize
-
-@node News-3.21.24, News-3.21.23, News-3.21.25, News-3.21.x
-@appendixsubsec Changes in release 3.21.24
-@itemize @bullet
-@item
-Dynamic loadable functions. Based on source from Alexis Mikhailov.
-@item
-You couldn't delete from a table if no one had done a @code{SELECT} on the
-table.
-@item
-Fixed problem with range optimizer with many @code{OR} operators on key parts
-inside each other.
-@item
-Recoded @code{MIN()} and @code{MAX()} to work properly with strings and
-@code{HAVING}.
-@item
-Changed default umask value for new files from @code{0664} to @code{0660}.
-@item
-Fixed problem with @code{LEFT JOIN} and constant expressions in the @code{ON}
-part.
-@item
-Added Italian error messages from @email{brenno@@dewinter.com}.
-@item
-@code{configure} now works better on OSF1 (tested on 4.0D).
-@item
-Added hooks to allow @code{LIKE} optimization with international character
-support.
-@item
-Upgraded @code{DBI} to 0.93.
-@end itemize
-
-@node News-3.21.23, News-3.21.22, News-3.21.24, News-3.21.x
-@appendixsubsec Changes in release 3.21.23
-@itemize @bullet
-@item
-The following symbols are now reserved words:
-@code{TIME}, @code{DATE}, @code{TIMESTAMP}, @code{TEXT}, @code{BIT},
-@code{ENUM}, @code{NO}, @code{ACTION}, @code{CHECK}, @code{YEAR},
-@code{MONTH}, @code{DAY}, @code{HOUR}, @code{MINUTE}, @code{SECOND},
-@code{STATUS}, @code{VARIABLES}.
-@item
-Setting a @code{TIMESTAMP} to @code{NULL} in @code{LOAD DATA INFILE ...} didn't
-set the current time for the @code{TIMESTAMP}.
-@item
-Fix @code{BETWEEN} to recognize binary strings. Now @code{BETWEEN} is
-case sensitive.
-@item
-Added @code{--skip-thread-priority} option to @code{mysqld}, for systems
-where @code{mysqld}'s thread scheduling doesn't work properly (BSDI 3.1).
-@item
-Added ODBC functions @code{DAYNAME()} and @code{MONTHNAME()}.
-@item
-Added function @code{TIME_FORMAT()}. This works like @code{DATE_FORMAT()},
-but takes a time string (@code{'HH:MM:DD'}) as argument.
-@item
-Fixed unlikely(?) key optimizer bug when using @code{OR}s of key parts
-inside @code{AND}s.
-@item
-Added command @code{variables} to @code{mysqladmin}.
-@item
-A lot of small changes to the binary releases.
-@item
-Fixed a bug in the new protocol from @strong{MySQL} 3.21.20.
-@item
-Changed @code{ALTER TABLE} to work with Win32 (Win32 can't rename open files).
-Also fixed a couple of small bugs in the Win32 version.
-@item
-All standard @strong{MySQL} clients are now ported to @strong{MySQL}-Win32.
-@item
-@strong{MySQL} can now be started as a service on NT.
-@end itemize
-
-@node News-3.21.22, News-3.21.21a, News-3.21.23, News-3.21.x
-@appendixsubsec Changes in release 3.21.22
-@itemize @bullet
-@item
-Starting with this version, all @strong{MySQL} distributions will be
-configured, compiled and tested with @code{crash-me} and the benchmarks on
-the following platforms: SunOS 5.6 sun4u, SunOS 5.5.1 sun4u, SunOS 4.14 sun4c,
-SunOS 5.6 i86pc, Irix 6.3 mips5k, HP-UX 10.20 hppa, AIX 4.2.1 ppc,
-OSF1 V4.0 alpha, FreeBSD 2.2.2 i86pc and BSDI 3.1 i386.
-@item
-Fix @code{COUNT(*)} problems when the @code{WHERE} clause didn't match any
-records. (Bug from 3.21.17.)
-@item
-Removed that @code{NULL = NULL} is true. Now you must use @code{IS NULL}
-or @code{IS NOT NULL} to test whether or not a value is @code{NULL}.
-(This is according to ANSI SQL but may break
-old applications that are ported from @code{mSQL}.)
-You can get the old behavior by compiling with @code{-DmSQL_COMPLIANT}.
-@item
-Fixed bug that core dumped when using many @code{LEFT OUTER JOIN} clauses.
-@item
-Fixed bug in @code{ORDER BY} on string formula with possible @code{NULL} values.
-@item
-Fixed problem in range optimizer when using <= on sub index.
-@item
-Added functions @code{DAYOFYEAR()}, @code{DAYOFMONTH()}, @code{MONTH()},
-@code{YEAR()}, @code{WEEK()}, @code{QUARTER()}, @code{HOUR()}, @code{MINUTE()},
-@code{SECOND()} and @code{FIND_IN_SET()}.
-@item
-Added command @code{SHOW VARIABLES}.
-@item
-Added support of ``long constant strings'' from ANSI SQL:
-@example
-mysql> SELECT 'first ' 'second'; -> 'first second'
-@end example
-@item
-Upgraded mSQL-Mysql-modules to 1.1825.
-@item
-Upgraded @code{mysqlaccess} to 2.02.
-@item
-Fixed problem with Russian character set and @code{LIKE}.
-@item
-Ported to OpenBSD 2.1.
-@item
-New Dutch error messages.
-@end itemize
-
-@node News-3.21.21a, News-3.21.21, News-3.21.22, News-3.21.x
-@appendixsubsec Changes in release 3.21.21a
-@itemize @bullet
-@item
-Configure changes for some operating systems.
-@end itemize
-
-@node News-3.21.21, News-3.21.20, News-3.21.21a, News-3.21.x
-@appendixsubsec Changes in release 3.21.21
-@itemize @bullet
-@item
-Fixed optimizer bug when using
-@code{WHERE data_field = date_field2 AND date_field2 = constant}.
-@item
-Added command @code{SHOW STATUS}.
-@item
-Removed @file{manual.ps} from the source distribution to make it smaller.
-@end itemize
-
-@node News-3.21.20, News-3.21.19, News-3.21.21, News-3.21.x
-@appendixsubsec Changes in release 3.21.20
-@itemize @bullet
-@item
-Changed the maximum table name and column name lengths from 32 to 64.
-@item
-Aliases can now be of ``any'' length.
-@item
-Fixed @code{mysqladmin stat} to return the right number of queries.
-@item
-Changed protocol (downward compatible) to mark if a column has the
-@code{AUTO_INCREMENT} attribute or is a @code{TIMESTAMP}. This is needed for
-the new Java driver.
-@item
-Added Hebrew sorting order by Zeev Suraski.
-@item
-Solaris 2.6: Fixed @code{configure} bugs and increased maximum table size
-from 2G to 4G.
-@end itemize
-
-@node News-3.21.19, News-3.21.18, News-3.21.20, News-3.21.x
-@appendixsubsec Changes in release 3.21.19
-@itemize @bullet
-@item
-Upgraded @code{DBD} to 1823. This version implements @code{mysql_use_result} in
-@code{DBD-Mysql}.
-@item
-Benchmarks updated for empress (by Luuk).
-@item
-Fixed a case of slow range searching.
-@item
-Configure fixes (@file{Docs} directory).
-@item
-Added function @code{REVERSE()} (by Zeev Suraski).
-@end itemize
-
-@node News-3.21.18, News-3.21.17, News-3.21.19, News-3.21.x
-@appendixsubsec Changes in release 3.21.18
-@itemize @bullet
-@item
-Issue error message if client C functions are called in wrong order.
-@item
-Added automatic reconnect to the @file{libmysql.c} library. If a write command
-fails, an automatic reconnect is done.
-@item
-Small sort sets no longer use temporary files.
-@item
-Upgraded @code{DBI} to 0.91.
-@item
-Fixed a couple of problems with @code{LEFT OUTER JOIN}.
-@item
-Added @code{CROSS JOIN} syntax. @code{CROSS} is now a reserved word.
-@item
-Recoded @code{yacc}/@code{bison} stack allocation to be even safer and to allow
-@strong{MySQL} to handle even bigger expressions.
-@item
-Fixed a couple of problems with the update log.
-@item
-@code{ORDER BY} was slow when used with key ranges.
-@end itemize
-
-@node News-3.21.17, News-3.21.16, News-3.21.18, News-3.21.x
-@appendixsubsec Changes in release 3.21.17
-@itemize @bullet
-@item
-Changed documentation string of @code{--with-unix-socket-path} to avoid
-confusion.
-@item
-Added ODBC and ANSI SQL style @code{LEFT OUTER JOIN}.
-@item
-The following are new reserved words: @code{LEFT}, @code{NATURAL},
-@code{USING}.
-@item
-The client library now uses the value of the environment variable
-@code{MYSQL_HOST} as the default host if it's defined.
-@item
-@code{SELECT col_name, SUM(expr)} now returns @code{NULL} for @code{col_name}
-when there are matching rows.
-@item
-Fixed problem with comparing binary strings and @code{BLOB}s with ASCII
-characters over 127.
-@item
-Fixed lock problem: when freeing a read lock on a table with multiple
-read locks, a thread waiting for a write lock would have been given the lock.
-This shouldn't affect data integrity, but could possibly make @code{mysqld}
-restart if one thread was reading data that another thread modified.
-@item
-@code{LIMIT offset,count} didn't work in @code{INSERT ... SELECT}.
-@item
-Optimized key block caching. This will be quicker than the old algorithm when
-using bigger key caches.
-@end itemize
-
-@node News-3.21.16, News-3.21.15, News-3.21.17, News-3.21.x
-@appendixsubsec Changes in release 3.21.16
-
-@itemize @bullet
-@item
-Added ODBC 2.0 & 3.0 functions @code{POWER()}, @code{SPACE()},
-@code{COT()}, @code{DEGREES()}, @code{RADIANS()}, @code{ROUND(2 arg)}
-and @code{TRUNCATE()}.
-@item
-@strong{WARNING: INCOMPATIBLE CHANGE!!} @code{LOCATE()} parameters were
-swapped according to ODBC standard. Fixed.
-@item
-Added function @code{TIME_TO_SEC()}.
-@item
-In some cases, default values were not used for @code{NOT NULL} fields.
-@item
-Timestamp wasn't always updated properly in @code{UPDATE SET ...} statements.
-@item
-Allow empty strings as default values for @code{BLOB} and @code{TEXT}, to
-be compatible with @code{mysqldump}.
-@end itemize
-
-@node News-3.21.15, News-3.21.14b, News-3.21.16, News-3.21.x
-@appendixsubsec Changes in release 3.21.15
-
-@itemize @bullet
-@item
-@strong{WARNING: INCOMPATIBLE CHANGE!!} @code{mysqlperl} is now from
-Msql-Mysql-modules. This means that @code{connect()} now takes
-@code{host}, @code{database}, @code{user}, @code{password} arguments! The old
-version took @code{host}, @code{database}, @code{password}, @code{user}.
-@item
-Allow @code{DATE '1997-01-01'}, @code{TIME '12:10:10'} and
-@code{TIMESTAMP '1997-01-01 12:10:10'} formats required by ANSI SQL.
-@strong{WARNING: INCOMPATIBLE CHANGE!!} This has the unfortunate
-side-effect that you no longer can have columns named @code{DATE}, @code{TIME}
-or @code{TIMESTAMP}. :( Old columns can still be accessed through
-@code{tablename.columnname}!)
-@item
-Changed Makefiles to hopefully work better with BSD systems. Also,
-@file{manual.dvi} is now included in the distribution to avoid having stupid
-@code{make} programs trying to rebuild it.
-@item
-@code{readline} library upgraded to version 2.1.
-@item
-A new sortorder german-1. That is a normal ISO-Latin1 with a german sort
-order.
-@item
-Perl @code{DBI}/@code{DBD} is now included in the distribution. @code{DBI}
-is now the recommended way to connect to @strong{MySQL} from Perl.
-@item
-New portable benchmark suite with @code{DBD}, with test results from
-@code{mSQL} 2.0.3, @strong{MySQL}, PostgreSQL 6.2.1 and Solid server 2.2.
-@item
-@code{crash-me} is now included with the benchmarks; This is a Perl program
-designed to find as many limits as possible in a SQL server. Tested with
-@code{mSQL}, PostgreSQL, Solid and @strong{MySQL}.
-@item
-Fixed bug in range-optimizer that crashed @strong{MySQL} on some queries.
-@item
-Table and column name completion for @code{mysql} command line tool, by Zeev
-Suraski and Andi Gutmans.
-@item
-Added new command @code{REPLACE} that works like @code{INSERT} but
-replaces conflicting records with the new record. @code{REPLACE INTO
-TABLE ... SELECT ...} works also.
-@item
-Added new commands @code{CREATE DATABASE db_name} and @code{DROP
-DATABASE db_name}.
-@item
-Added @code{RENAME} option to @code{ALTER TABLE}: @code{ALTER TABLE name
-RENAME AS new_name}.
-@item
-@code{make_binary_distribution} now includes @file{libgcc.a} in
-@file{libmysqlclient.a}. This should make linking work for people who don't
-have @code{gcc}.
-@item
-Changed @code{net_write()} to @code{my_net_write()} because of a name
-conflict with Sybase.
-@item
-@cindex ODBC compatibility
-@cindex Compatibility, with ODBC
-New function @code{DAYOFWEEK()} compatible with ODBC.
-@item
-Stack checking and @code{bison} memory overrun checking to make @strong{MySQL}
-safer with weird queries.
-@end itemize
-
-@node News-3.21.14b, News-3.21.14a, News-3.21.15, News-3.21.x
-@appendixsubsec Changes in release 3.21.14b
-
-@itemize @bullet
-@item
-Fixed a couple of small @code{configure} problems on some platforms.
-@end itemize
-
-@node News-3.21.14a, News-3.21.13, News-3.21.14b, News-3.21.x
-@appendixsubsec Changes in release 3.21.14a
-
-@itemize @bullet
-@item
-Ported to SCO Openserver 5.0.4 with FSU Pthreads.
-@item
-HP-UX 10.20 should work.
-@item
-Added new function @code{DATE_FORMAT()}.
-@item
-Added @code{NOT IN}.
-@item
-Added automatic removal of 'ODBC function conversions': @code{@{fn now() @}}
-@item
-Handle ODBC 2.50.3 option flags.
-@item
-Fixed comparison of @code{DATE} and @code{TIME} values with @code{NULL}.
-@item
-Changed language name from germany to german to be consistent with
-the other language names.
-@item
-Fixed sorting problem on functions returning a @code{FLOAT}. Previously, the
-values were converted to @code{INT}s before sorting.
-@item
-Fixed slow sorting when sorting on key field when using
-@code{key_column=constant}.
-@item
-Sorting on calculated @code{DOUBLE} values sorted on integer results instead.
-@item
-@code{mysql} no longer needs a database argument.
-@item
-Changed the place where @code{HAVING} should be. According to ANSI, it should
-be after @code{GROUP BY} but before @code{ORDER BY}. @strong{MySQL} 3.20
-incorrectly had it last.
-@item
-Added Sybase command @code{USE DATABASE} to start using another database.
-@item
-Added automatic adjusting of number of connections and table cache size
-if the maximum number of files that can be opened is less than needed.
-This should fix that @code{mysqld} doesn't crash even if you haven't done a
-@code{ulimit -n 256} before starting @code{mysqld}.
-@item
-Added lots of limit checks to make it safer when running with too little
-memory or when doing weird queries.
-@end itemize
-
-@node News-3.21.13, News-3.21.12, News-3.21.14a, News-3.21.x
-@appendixsubsec Changes in release 3.21.13
-
-@itemize @bullet
-@item
-Added retry of interrupted reads and clearing of @code{errno}.
-This makes Linux systems much safer!
-@item
-Fixed locking bug when using many aliases on the same table in the same
-@code{SELECT}.
-@item
-Fixed bug with @code{LIKE} on number key.
-@item
-New error message so you can check whether the connection was lost while
-the command was running or whether the connection was down from the start.
-@item
-Added @code{--table} option to @code{mysql} to print in table format.
-Moved time and row information after query result.
-Added automatic reconnect of lost connections.
-@item
-Added @code{!=} as a synonym for @code{<>}.
-@item
-Added function @code{VERSION()} to make easier logs.
-@item
-New multi-user test @file{tests/fork_test.pl} to put some strain on the
-thread library.
-@end itemize
-
-@node News-3.21.12, News-3.21.11, News-3.21.13, News-3.21.x
-@appendixsubsec Changes in release 3.21.12
-
-@itemize @bullet
-@item
-Fixed @code{ftruncate()} call in MIT-pthreads. This made @code{isamchk}
-destroy the @file{.ISM} files on (Free)BSD 2.x systems.
-@item
-Fixed broken @code{__P_} patch in MIT-pthreads.
-@item
-Many memory overrun checks. All string functions now return @code{NULL}
-if the returned string should be longer than @code{max_allowed_packet} bytes.
-@item
-Changed the name of the @code{INTERVAL} type to @code{ENUM}, because
-@code{INTERVAL} is used in ANSI SQL.
-@item
-In some cases, doing a @code{JOIN} + @code{GROUP} + @code{INTO OUTFILE},
-the result wasn't grouped.
-@item
-@code{LIKE} with @code{'_'} as last character didn't work. Fixed.
-@item
-Added extended ANSI SQL @code{TRIM()} function.
-@item
-Added @code{CURTIME()}.
-@item
-Added @code{ENCRYPT()} function by Zeev Suraski.
-@item
-Fixed better @code{FOREIGN KEY} syntax skipping. New reserved words:
-@code{MATCH}, @code{FULL}, @code{PARTIAL}.
-@item
-@code{mysqld} now allows IP number and hostname to the @code{--bind-address}
-option.
-@item
-Added @code{SET OPTION CHARACTER SET cp1251_koi8} to enable conversions of
-data to/from cp1251_koi8.
-@item
-Lots of changes for Win95 port. In theory, this version should now be
-easily portable to Win95.
-@item
-Changed the @code{CREATE COLUMN} syntax of @code{NOT NULL} columns to be after
-the @code{DEFAULT} value, as specified in the ANSI SQL standard. This will
-make @code{mysqldump} with @code{NOT NULL} and default values incompatible with
-@strong{MySQL} 3.20.
-@item
-Added many function name aliases so the functions can be used with
-ODBC or ANSI SQL92 syntax.
-@item
-Fixed syntax of @code{ALTER TABLE tbl_name ALTER COLUMN col_name SET DEFAULT
-NULL}.
-@item
-Added @code{CHAR} and @code{BIT} as synonyms for @code{CHAR(1)}.
-@item
-Fixed core dump when updating as a user who has only @strong{select} privilege.
-@item
-@code{INSERT ... SELECT ... GROUP BY} didn't work in some cases. An
-@code{Invalid use of group function} error occurred.
-@item
-When using @code{LIMIT}, @code{SELECT} now always uses keys instead of record
-scan. This will give better performance on @code{SELECT} and a @code{WHERE}
-that matches many rows.
-@item
-Added Russian error messages.
-@end itemize
-
-@node News-3.21.11, News-3.21.10, News-3.21.12, News-3.21.x
-@appendixsubsec Changes in release 3.21.11
-
-@itemize @bullet
-@item
-Configure changes.
-@item
-@strong{MySQL} now works with the new thread library on BSD/OS 3.0.
-@item
-Added new group functions @code{BIT_OR()} and @code{BIT_AND()}.
-@item
-Added compatibility functions @code{CHECK} and @code{REFERENCES}.
-@code{CHECK} is now a reserved word.
-@item
-Added @code{ALL} option to @code{GRANT} for better compatibility. (@code{GRANT}
-is still a dummy function.)
-@item
-Added partly-translated dutch messages.
-@item
-Fixed bug in @code{ORDER BY} and @code{GROUP BY} with @code{NULL} columns.
-@item
-Added function @code{last_insert_id()} to retrieve last @code{AUTO_INCREMENT}
-value. This is intended for clients to ODBC that can't use the
-@code{mysql_insert_id()} API function, but can be used by any client.
-@item
-Added @code{--flush-logs} option to @code{mysqladmin}.
-@item
-Added command @code{STATUS} to @code{mysql}.
-@item
-Fixed problem with @code{ORDER BY}/@code{GROUP BY} because of bug in @code{gcc}.
-@item
-Fixed problem with @code{INSERT ... SELECT ... GROUP BY}.
-@end itemize
-
-@node News-3.21.10, News-3.21.9, News-3.21.11, News-3.21.x
-@appendixsubsec Changes in release 3.21.10
-
-@itemize @bullet
-@item
-New @code{mysqlaccess}.
-@item
-@code{CREATE} now supports all ODBC types and the @code{mSQL} @code{TEXT} type.
-All ODBC 2.5 functions are also supported (added @code{REPEAT}). This provides
-better portability.
-@item
-Added text types @code{TINYTEXT}, @code{TEXT}, @code{MEDIUMTEXT} and
-@code{LONGTEXT}. These are actually @code{BLOB}types, but all searching is
-done in case-insensitive fashion.
-@item
-All old @code{BLOB} fields are now @code{TEXT} fields. This only
-changes that all searching on strings is done in case-sensitive fashion.
-You must do an @code{ALTER TABLE} and change the field type to @code{BLOB}
-if you want to have tests done in case-sensitive fashion.
-@item
-Fixed some @code{configure} issues.
-@item
-Made the locking code a bit safer. Fixed very unlikely
-deadlock situation.
-@item
-Fixed a couple of bugs in the range optimizer. Now the new range benchmark
-@code{test-select} works.
-@end itemize
-
-@node News-3.21.9, News-3.21.8, News-3.21.10, News-3.21.x
-@appendixsubsec Changes in release 3.21.9
-
-@itemize @bullet
-@item
-Added @code{--enable-unix-socket=pathname} option to @code{configure}.
-@item
-Fixed a couple of portability problems with include files.
-@item
-Fixed bug in range calculation that could return empty
-set when searching on multiple key with only one entry (very rare).
-@item
-Most things ported to FSU Pthreads, which should allow @strong{MySQL} to
-run on SCO. @xref{SCO}.
-@end itemize
-
-@node News-3.21.8, News-3.21.7, News-3.21.9, News-3.21.x
-@appendixsubsec Changes in release 3.21.8
-
-@itemize @bullet
-@item
-Works now in Solaris 2.6.
-@item
-Added handling of calculation of @code{SUM()} functions.
-For example, you can now use @code{SUM(column)/COUNT(column)}.
-@item
-Added handling of trigometric functions:
-@code{PI()}, @code{ACOS()}, @code{ASIN()}, @code{ATAN()}, @code{COS()},
-@code{SIN()} and @code{TAN()}.
-@item
-New languages: norwegian, norwegian-ny and portuguese.
-@item
-Fixed parameter bug in @code{net_print()} in @file{procedure.cc}.
-@item
-Fixed a couple of memory leaks.
-@item
-Now allow also the old @code{SELECT ... INTO OUTFILE} syntax.
-@item
-Fixed bug with @code{GROUP BY} and @code{SELECT} on key with many values.
-@item
-@code{mysql_fetch_lengths()} sometimes returned incorrect lengths when you used
-@code{mysql_use_result()}. This affected at least some cases of
-@code{mysqldump --quick}.
-@item
-Fixed bug in optimization of @code{WHERE const op field}.
-@item
-Fixed problem when sorting on @code{NULL} fields.
-@item
-Fixed a couple of 64-bit (Alpha) problems.
-@item
-Added @code{--pid-file=#} option to @code{mysqld}.
-@item
-Added date formatting to @code{FROM_UNIXTIME()}, originally by Zeev Suraski.
-@item
-Fixed bug in @code{BETWEEN} in range optimizer (Did only test = of the first
-argument).
-@item
-Added machine-dependent files for MIT-pthreads i386-SCO. There is probably
-more to do to get this to work on SCO 3.5.
-@end itemize
-
-@node News-3.21.7, News-3.21.6, News-3.21.8, News-3.21.x
-@appendixsubsec Changes in release 3.21.7
-
-@itemize @bullet
-@item
-Changed @file{Makefile.am} to take advantage of Automake 1.2.
-@item
-Added the beginnings of a benchmark suite.
-@item
-Added more secure password handling.
-@item
-Added new client function @code{mysql_errno()}, to get the error number of
-the error message. This makes error checking in the client much easier.
-This makes the new server incompatible with the 3.20.x server when running
-without @code{--old-protocol}. The client code is backward compatible.
-More information can be found in the @file{README} file!
-@item
-Fixed some problems when using very long, illegal names.
-@end itemize
-
-@node News-3.21.6, News-3.21.5, News-3.21.7, News-3.21.x
-@appendixsubsec Changes in release 3.21.6
-
-@itemize @bullet
-@item
-Fixed more portability issues (incorrect @code{sigwait} and @code{sigset}
-defines).
-@item
-@code{configure} should now be able to detect the last argument to
-@code{accept()}.
-@end itemize
-
-@node News-3.21.5, News-3.21.4, News-3.21.6, News-3.21.x
-@appendixsubsec Changes in release 3.21.5
-
-@itemize @bullet
-@item
-Should now work with FreeBSD 3.0 if used with
-@file{FreeBSD-3.0-libc_r-1.0.diff},
-which can be found at @uref{http://www.mysql.com/Download/Patches}.
-@item
-Added new option @code{-O tmp_table_size=#} to @code{mysqld}.
-@item
-New function @code{FROM_UNIXTIME(timestamp)} which returns a date string in
-'YYYY-MM-DD HH:MM:DD' format.
-@item
-New function @code{SEC_TO_TIME(seconds)} which returns a string in
-'HH:MM:SS' format.
-@item
-New function @code{SUBSTRING_INDEX()}, originally by Zeev Suraski.
-@end itemize
-
-@node News-3.21.4, News-3.21.3, News-3.21.5, News-3.21.x
-@appendixsubsec Changes in release 3.21.4
-
-@itemize @bullet
-@item
-Should now configure and compile on OSF1 4.0 with the DEC compiler.
-@item
-Configuration and compilation on BSD/OS 3.0 works, but due to some bugs in
-BSD/OS 3.0, @code{mysqld} doesn't work on it yet.
-@item
-Configuration and compilation on FreeBSD 3.0 works, but I couldn't get
-@code{pthread_create} to work.
-@end itemize
-
-@node News-3.21.3, News-3.21.2, News-3.21.4, News-3.21.x
-@appendixsubsec Changes in release 3.21.3
-
-@itemize @bullet
-@item
-Added reverse check lookup of hostnames to get better security.
-@item
-Fixed some possible buffer overflows if filenames that are too long are used.
-@item
-@code{mysqld} doesn't accept hostnames that start with digits followed by a
-@code{'.'}, because the hostname may look like an IP number.
-@item
-Added @code{--skip-networking} option to @code{mysqld}, to only allow socket
-connections. (This will not work with MIT-pthreads!)
-@item
-Added check of too long table names for alias.
-@item
-Added check if database name is okay.
-@item
-Added check if too long table names.
-@item
-Removed incorrect @code{free()} that killed the server on
-@code{CREATE DATABASE} or @code{DROP DATABASE}.
-@item
-Changed some @code{mysqld} @code{-O} options to better names.
-@item
-Added @code{-O join_cache_size=#} option to @code{mysqld}.
-@item
-Added @code{-O max_join_size=#} option to @code{mysqld}, to be able to set a
-limit how big queries (in this case big = slow) one should be able to handle
-without specifying @code{SET OPTION SQL_BIG_SELECTS=1}. A # = is about 10
-examined records. The default is ``unlimited''.
-@item
-When comparing a @code{TIME}, @code{DATE}, @code{DATETIME} or @code{TIMESTAMP}
-column to a constant, the constant is converted to a time value before
-performing the comparison.
-This will make it easier to get ODBC (particularly Access97) to work with
-the above types. It should also make dates easier to use and the comparisons
-should be quicker than before.
-@item
-Applied patch from Jochen Wiedmann that allows @code{query()} in
-@code{mysqlperl} to take a query with @code{\0} in it.
-@item
-Storing a timestamp with a 2-digit year (@code{YYMMDD}) didn't work.
-@item
-Fix that timestamp wasn't automatically updated if set in an @code{UPDATE}
-clause.
-@item
-Now the automatic timestamp field is the FIRST timestamp field.
-@item
-@code{SELECT * INTO OUTFILE}, which didn't correctly if the outfile already
-existed.
-@item
-@code{mysql} now shows the thread ID when starting or doing a reconnect.
-@item
-Changed the default sort buffer size from 2M to 1M.
-@end itemize
-
-@node News-3.21.2, News-3.21.0, News-3.21.3, News-3.21.x
-@appendixsubsec Changes in release 3.21.2
-
-@itemize @bullet
-@item
-The range optimizer is coded, but only 85% tested. It can be enabled with
-@code{--new}, but it crashes core a lot yet...
-@item
-More portable. Should compile on AIX and alpha-digital.
-At least the @code{isam} library should be relatively 64-bit clean.
-@item
-New @code{isamchk} which can detect and fix more problems.
-@item
-New options for @code{isamlog}.
-@item
-Using new version of Automake.
-@item
-Many small portability changes (from the AIX and alpha-digital port)
-Better checking of pthread(s) library.
-@item
-czech error messages by @email{snajdr@@pvt.net}.
-@item
-Decreased size of some buffers to get fewer problems on systems with little
-memory. Also added more checks to handle ``out of memory'' problems.
-@item
-@code{mysqladmin}: you can now do @code{mysqladmin kill 5,6,7,8} to kill
-multiple threads.
-@item
-When the maximum connection limit is reached, one extra connection by a user
-with the @strong{PROCESS_ACL} privilege is granted.
-@item
-Added @code{-O backlog=#} option to @code{mysqld}.
-@item
-Increased maximum packet size from 512K to 1024K for client.
-@item
-Almost all of the function code is now tested in the internal test suite.
-@item
-@code{ALTER TABLE} now returns warnings from field conversions.
-@item
-Port changed to 3306 (got it reserved from ISI).
-@item
-Added a fix for Visual FoxBase so that any schema name from a table
-specification is automatically removed.
-@item
-New function @code{ASCII()}.
-@item
-Removed function @code{BETWEEN(a,b,c)}. Use the standard ANSI
-synax instead: @code{expr BETWEEN expr AND expr}.
-@item
-@strong{MySQL} no longer has to use an extra temporary table when sorting
-on functions or @code{SUM()} functions.
-@item
-Fixed bug that you couldn't use @code{tbl_name.field_name} in @code{UPDATE}.
-@item
-Fixed @code{SELECT DISTINCT} when using 'hidden group'. For example:
-@example
-mysql> SELECT DISTINCT MOD(some_field,10) FROM test
- GROUP BY some_field;
-@end example
-Note: @code{some_field} is normally in the @code{SELECT} part. ANSI SQL should
-require it.
-@end itemize
-
-@node News-3.21.0, , News-3.21.2, News-3.21.x
-@appendixsubsec Changes in release 3.21.0
-
-@itemize @bullet
-@item
-New reserved words used: @code{INTERVAL}, @code{EXPLAIN}, @code{READ},
-@code{WRITE}, @code{BINARY}.
-@item
-Added ODBC function @code{CHAR(num,...)}.
-@item
-New operator @code{IN}. This uses a binary search to find a match.
-@item
-New command @code{LOCK TABLES tbl_name [AS alias] @{READ|WRITE@} ...}
-@item
-Added @code{--log-update} option to @code{mysqld}, to get a log suitable for
-incremental updates.
-@item
-New command @code{EXPLAIN SELECT ...} to get information about how the
-optimizer will do the join.
-@item
-For easier client code, the client should no longer use
-@code{FIELD_TYPE_TINY_BLOB}, @code{FIELD_TYPE_MEDIUM_BLOB},
-@code{FIELD_TYPE_LONG_BLOB} or @code{FIELD_TYPE_VAR_STRING} (as
-previously returned by @code{mysql_list_fields}). You should instead only use
-@code{FIELD_TYPE_BLOB} or @code{FIELD_TYPE_STRING}. If you want exact
-types, you should use the command @code{SHOW FIELDS}.
-@item
-Added varbinary syntax: @code{0x######} which can be used as a string
-(default) or a number.
-@item
-@code{FIELD_TYPE_CHAR} is renamed to @code{FIELD_TYPE_TINY}.
-@item
-Changed all fields to C++ classes.
-@item
-Removed FORM struct.
-@item
-Fields with @code{DEFAULT} values no longer need to be @code{NOT NULL}.
-@item
-New field types:
-@table @code
-@item ENUM
-A string which can take only a couple of defined values. The value is
-stored as a 1-3 byte number that is mapped automatically to a string.
-This is sorted according to string positions!
-@item SET
-A string which may have one or many string values separated with ','.
-The string is stored as a 1-, 2-, 3-, 4- or 8-byte number where each bit stands
-for a specific set member. This is sorted according to the unsigned value
-of the stored packed number.
-@end table
-@item
-Now all function calculation is done with @code{double} or @code{long long}.
-This will provide the full 64-bit range with bit functions and fix some
-conversions that previously could result in precision losses. One should
-avoid using @code{unsigned long long} columns with full 64-bit range
-(numbers bigger than 9223372036854775807) because calculations are done
-with @code{signed long long}.
-@item
-@code{ORDER BY} will now put @code{NULL} field values first. @code{GROUP BY}
-will also work with @code{NULL} values.
-@item
-Full @code{WHERE} with expressions.
-@item
-New range optimizer that can resolve ranges when some keypart prefix is
-constant. Example:
-@example
-mysql> SELECT * FROM tbl_name
- WHERE key_part_1="customer"
- AND key_part_2>=10 AND key_part_2<=10;
-@end example
-@end itemize
-
-@node News-3.20.x, News-3.19.x, News-3.21.x, News
-@appendixsec Changes in release 3.20.x
-
-Changes from 3.20.18 to 3.20.32b are not documented here because the
-3.21 release branched here. And the relevant changes are also
-documented as changes to the 3.21 version.
-
-@menu
-* News-3.20.18:: Changes in release 3.20.18
-* News-3.20.17:: Changes in release 3.20.17
-* News-3.20.16:: Changes in release 3.20.16
-* News-3.20.15:: Changes in release 3.20.15
-* News-3.20.14:: Changes in release 3.20.14
-* News-3.20.13:: Changes in release 3.20.13
-* News-3.20.11:: Changes in release 3.20.11
-* News-3.20.10:: Changes in release 3.20.10
-* News-3.20.9:: Changes in release 3.20.9
-* News-3.20.8:: Changes in release 3.20.8
-* News-3.20.7:: Changes in release 3.20.7
-* News-3.20.6:: Changes in release 3.20.6
-* News-3.20.3:: Changes in release 3.20.3
-* News-3.20.0:: Changes in releases 3.20.0
-@end menu
-
-@node News-3.20.18, News-3.20.17, News-3.20.x, News-3.20.x
-@appendixsubsec Changes in release 3.20.18
-
-@itemize @bullet
-@item
-Added @code{-p#} (remove @code{#} directories from path) to @code{isamlog}.
-All files are written with a relative path from the database directory
-Now @code{mysqld} shouldn't crash on shutdown when using the
-@code{--log-isam} option.
-@item
-New @code{mysqlperl} version. It is now compatible with @code{msqlperl-0.63}.
-@item
-New @code{DBD} module available at @uref{http://www.mysql.com/Contrib}
-site.
-@item
-Added group function @code{STD()} (standard deviation).
-@item
-The @code{mysqld} server is now compiled by default without debugging
-information. This will make the daemon smaller and faster.
-@item
-Now one usually only has to specify the @code{--basedir} option to
-@code{mysqld}. All other paths are relative in a normal installation.
-@item
-@code{BLOB} columns sometimes contained garbage when used with a @code{SELECT}
-on more than one table and @code{ORDER BY}.
-@item
-Fixed that calculations that are not in @code{GROUP BY} work as expected
-(ANSI SQL extension).
-Example:
-@example
-mysql> SELECT id,id+1 FROM table GROUP BY id;
-@end example
-@item
-The test of using @code{MYSQL_PWD} was reversed. Now @code{MYSQL_PWD} is
-enabled as default in the default release.
-@item
-Fixed conversion bug which caused @code{mysqld} to core dump with
-Arithmetic error on Sparc-386.
-@item
-Added @code{--unbuffered} option to @code{mysql}, for new @code{mysqlaccess}.
-@item
-When using overlapping (unnecessary) keys and join over many tables,
-the optimizer could get confused and return 0 records.
-@end itemize
-
-@node News-3.20.17, News-3.20.16, News-3.20.18, News-3.20.x
-@appendixsubsec Changes in release 3.20.17
-
-@itemize @bullet
-@item
-You can now use @code{BLOB} columns and the functions @code{IS NULL} and
-@code{IS NOT NULL} in the @code{WHERE} clause.
-@item
-All communication packets and row buffers are now allocated dynamically
-on demand. The default value of @code{max_allowed_packet} is now 64K for
-the server and 512K for the client. This is mainly used to catch
-incorrect packets that could trash all memory. The server limit may be
-changed when it is started.
-@item
-Changed stack usage to use less memory.
-@item
-Changed @code{safe_mysqld} to check for running daemon.
-@item
-The @code{ELT()} function is renamed to @code{FIELD()}. The new
-@code{ELT()} function returns a value based on an index: @code{FIELD()}
-is the inverse of @code{ELT()} Example: @code{ELT(2,"A","B","C")} returns
-@code{"B"}. @code{FIELD("B","A","B","C")} returns @code{2}.
-@item
-@code{COUNT(field)}, where @code{field} could have a @code{NULL} value, now
-works.
-@item
-A couple of bugs fixed in @code{SELECT ... GROUP BY}.
-@item
-Fixed memory overrun bug in @code{WHERE} with many unoptimizable brace levels.
-@item
-Fixed some small bugs in the grant code.
-@item
-If hostname isn't found by @code{get_hostname}, only the IP is checked.
-Previously, you got @code{Access denied}.
-@item
-Inserts of timestamps with values didn't always work.
-@item
-@code{INSERT INTO ... SELECT ... WHERE} could give the error
-@code{Duplicated field}.
-@item
-Added some tests to @code{safe_mysqld} to make it ``safer''.
-@item
-@code{LIKE} was case sensitive in some places and case insensitive in others.
-Now @code{LIKE} is always case insensitive.
-@item
-@file{mysql.cc}: Allow @code{'#'} anywhere on the line.
-@item
-New command @code{SET OPTION SQL_SELECT_LIMIT=#}. See the FAQ for more details.
-@item
-New version of the @code{mysqlaccess} script.
-@item
-Change @code{FROM_DAYS()} and @code{WEEKDAY()} to also take a full
-@code{TIMESTAMP} or @code{DATETIME} as argument. Before they only took a
-number of type @code{YYYYMMDD} or @code{YYMMDD}.
-@item
-Added new function @code{UNIX_TIMESTAMP(timestamp_column)}.
-@end itemize
-
-@node News-3.20.16, News-3.20.15, News-3.20.17, News-3.20.x
-@appendixsubsec Changes in release 3.20.16
-
-@itemize @bullet
-@item
-More changes in MIT-pthreads to get them safer. Fixed also some link
-bugs at least in SunOS.
-@item
-Changed @code{mysqld} to work around a bug in MIT-pthreads. This makes multiple
-small @code{SELECT} operations 20 times faster. Now @code{lock_test.pl} should
-work.
-@item
-Added @code{mysql_FetchHash(handle)} to @code{mysqlperl}.
-@item
-The @code{mysqlbug} script is now distributed built to allow for reporting
-bugs that appear during the build with it.
-@item
-Changed @file{libmysql.c} to prefer @code{getpwuid()} instead of
-@code{cuserid()}.
-@item
-Fixed bug in @code{SELECT} optimizer when using many tables with the same
-column used as key to different tables.
-@item
-Added new latin2 and Russian KOI8 character tables.
-@item
-Added support for a dummy @code{GRANT} command to satisfy Powerbuilder.
-@end itemize
-
-@node News-3.20.15, News-3.20.14, News-3.20.16, News-3.20.x
-@appendixsubsec Changes in release 3.20.15
-
-@itemize @bullet
-@item
-Fixed fatal bug @code{packets out of order} when using MIT-pthreads.
-@item
-Removed possible loop when a thread waits for command from client
-and @code{fcntl()} fails. Thanks to Mike Bretz for finding this bug.
-@item
-Changed alarm loop in @file{mysqld.cc} because shutdown didn't always
-succeed in Linux.
-@item
-Removed use of @code{termbits} from @file{mysql.cc}. This conflicted with
-@code{glibc} 2.0.
-@item
-Fixed some syntax errors for at least BSD and Linux.
-@item
-Fixed bug when doing a @code{SELECT} as superuser without a database.
-@item
-Fixed bug when doing @code{SELECT} with group calculation to outfile.
-@end itemize
-
-@node News-3.20.14, News-3.20.13, News-3.20.15, News-3.20.x
-@appendixsubsec Changes in release 3.20.14
-
-@itemize @bullet
-@item
-If one gives @code{-p} or @code{--password} option to @code{mysql} without
-an argument, the user is solicited for the password from the tty.
-@item
-Added default password from @code{MYSQL_PWD} (by Elmar Haneke).
-@item
-Added command @code{kill} to @code{mysqladmin} to kill a specific
-@strong{MySQL} thread.
-@item
-Sometimes when doing a reconnect on a down connection this succeeded
-first on second try.
-@item
-Fixed adding an @code{AUTO_INCREMENT} key with @code{ALTER_TABLE}.
-@item
-@code{AVG()} gave too small value on some @code{SELECT}s with
-@code{GROUP BY} and @code{ORDER BY}.
-@item
-Added new @code{DATETIME} type (by Giovanni Maruzzelli
-@email{maruzz@@matrice.it}).
-@item
-Fixed that define @code{DONT_USE_DEFAULT_FIELDS} works.
-@item
-Changed to use a thread to handle alarms instead of signals on Solaris to
-avoid race conditions.
-@item
-Fixed default length of signed numbers. (George Harvey
-@email{georgeh@@pinacl.co.uk}.)
-@item
-Allow anything for @code{CREATE INDEX}.
-@item
-Add prezeros when packing numbers to @code{DATE}, @code{TIME} and
-@code{TIMESTAMP}.
-@item
-Fixed a bug in @code{OR} of multiple tables (gave empty set).
-@item
-Added many patches to MIT-pthreads. This fixes at least one lookup bug.
-@end itemize
-
-@node News-3.20.13, News-3.20.11, News-3.20.14, News-3.20.x
-@appendixsubsec Changes in release 3.20.13
-
-@itemize @bullet
-@item
-Added ANSI SQL94 @code{DATE} and @code{TIME} types.
-@item
-Fixed bug in @code{SELECT} with @code{AND}-@code{OR} levels.
-@item
-Added support for Slovenian characters. The @file{Contrib} directory contains
-source and instructions for adding other character sets.
-@item
-Fixed bug with @code{LIMIT} and @code{ORDER BY}.
-@item
-Allow @code{ORDER BY} and @code{GROUP BY} on items that aren't in the
-@code{SELECT} list.
-(Thanks to Wim Bonis @email{bonis@@kiss.de}, for pointing this out.)
-@item
-Allow setting of timestamp values in @code{INSERT}.
-@item
-Fixed bug with @code{SELECT ... WHERE ... = NULL}.
-@item
-Added changes for @code{glibc} 2.0. To get @code{glibc} to work, you should
-add the @file{gibc-2.0-sigwait-patch} before compiling @code{glibc}.
-@item
-Fixed bug in @code{ALTER TABLE} when changing a @code{NOT NULL} field to
-allow @code{NULL} values.
-@item
-Added some ANSI92 synonyms as field types to @code{CREATE TABLE}.
-@code{CREATE TABLE} now allows @code{FLOAT(4)} and @code{FLOAT(8)} to mean
-@code{FLOAT} and @code{DOUBLE}.
-@item
-New utility program @code{mysqlaccess} by @email{Yves.Carlier@@rug.ac.be}.
-This program shows the access rights for a specific user and the grant
-rows that determine this grant.
-@item
-Added @code{WHERE const op field} (by @email{bonis@@kiss.de}).
-@end itemize
-
-@node News-3.20.11, News-3.20.10, News-3.20.13, News-3.20.x
-@appendixsubsec Changes in release 3.20.11
-
-@itemize @bullet
-@item
-When using @code{SELECT ... INTO OUTFILE}, all temporary tables are ISAM
-instead of HEAP to allow big dumps.
-@item
-Changed date functions to be string functions. This fixed some ``funny''
-side effects when sorting on dates.
-@item
-Extended @code{ALTER TABLE} according to SQL92.
-@item
-Some minor compability changes.
-@item
-Added @code{--port} and @code{--socket} options to all utility programs and
-@code{mysqld}.
-@item
-Fixed MIT-pthreads @code{readdir_r()}. Now @code{mysqladmin create database}
-and @code{mysqladmin drop database} should work.
-@item
-Changed MIT-pthreads to use our @code{tempnam()}. This should fix the ``sort
-aborted'' bug.
-@item
-Added sync of records count in @code{sql_update}. This fixed slow updates
-on first connection. (Thanks to Vaclav Bittner for the test.)
-@end itemize
-
-@node News-3.20.10, News-3.20.9, News-3.20.11, News-3.20.x
-@appendixsubsec Changes in release 3.20.10
-
-@itemize @bullet
-@item
-New insert type: @code{INSERT INTO ... SELECT ...}
-@item
-@code{MEDIUMBLOB} fixed.
-@item
-Fixed bug in @code{ALTER TABLE} and @code{BLOB}s.
-@item
-@code{SELECT ... INTO OUTFILE} now creates the file in the current
-database directory.
-@item
-@code{DROP TABLE} now can take a list of tables.
-@item
-Oracle synonym @code{DESCRIBE} (@code{DESC}).
-@item
-Changes to @code{make_binary_distribution}.
-@item
-Added some comments to installation instructions about @code{configure}'s
-C++ link test.
-@item
-Added @code{--without-perl} option to @code{configure}.
-@item
-Lots of small portability changes.
-@end itemize
-
-@node News-3.20.9, News-3.20.8, News-3.20.10, News-3.20.x
-@appendixsubsec Changes in release 3.20.9
-
-@itemize @bullet
-@item
-@code{ALTER TABLE} didn't copy null bit. As a result, fields that were allowed
-to have @code{NULL} values were always @code{NULL}.
-@item
-@code{CREATE} didn't take numbers as @code{DEFAULT}.
-@item
-Some compatibility changes for SunOS.
-@item
-Removed @file{config.cache} from old distribution.
-@end itemize
-
-@node News-3.20.8, News-3.20.7, News-3.20.9, News-3.20.x
-@appendixsubsec Changes in release 3.20.8
-
-@itemize @bullet
-@item
-Fixed bug with @code{ALTER TABLE} and multi-part keys.
-@end itemize
-
-@node News-3.20.7, News-3.20.6, News-3.20.8, News-3.20.x
-@appendixsubsec Changes in release 3.20.7
-
-@itemize @bullet
-@item
-New commands: @code{ALTER TABLE}, @code{SELECT ... INTO OUTFILE} and
-@code{LOAD DATA INFILE}.
-@item
-New function: @code{NOW()}.
-@item
-Added new field @strong{file_priv} to @code{mysql/user} table.
-@item
-New script @code{add_file_priv} which adds the new field @strong{file_priv}
-to the @code{user} table. This script must be executed if you want to
-use the new @code{SELECT ... INTO} and @code{LOAD DATA INFILE ...} commands
-with a version of @strong{MySQL} earlier than 3.20.7.
-@item
-Fixed bug in locking code, which made @code{lock_test.pl} test fail.
-@item
-New files @file{NEW} and @file{BUGS}.
-@item
-Changed @file{select_test.c} and @file{insert_test.c} to include
-@file{config.h}.
-@item
-Added command @code{status} to @code{mysqladmin} for short logging.
-@item
-Increased maximum number of keys to 16 and maximum number of key parts to 15.
-@item
-Use of sub keys. A key may now be a prefix of a string field.
-@item
-Added @code{-k} option to @code{mysqlshow}, to get key information for a table.
-@item
-Added long options to @code{mysqldump}.
-@end itemize
-
-@node News-3.20.6, News-3.20.3, News-3.20.7, News-3.20.x
-@appendixsubsec Changes in release 3.20.6
-
-@itemize @bullet
-@item
-Portable to more systems because of MIT-pthreads, which will
-be used automatically if @code{configure} cannot find a @code{-lpthreads}
-library.
-@item
-Added GNU-style long options to almost all programs. Test with
-@code{@kbd{program} --help}.
-@item
-Some shared library support for Linux.
-@item
-The FAQ is now in @file{.texi} format and is available in @file{.html},
-@file{.txt} and @file{.ps} formats.
-@item
-Added new SQL function @code{RAND([init])}.
-@item
-Changed @code{sql_lex} to handle @code{\0} unquoted, but the client can't send
-the query through the C API, because it takes a str pointer.
-You must use @code{mysql_real_query()} to send the query.
-@item
-Added API function @code{mysql_get_client_info()}.
-@item
-@code{mysqld} now uses the @code{N_MAX_KEY_LENGTH} from @file{nisam.h} as
-the maximum allowed key length.
-@item
-The following now works:
-@example
-mysql> SELECT filter_nr,filter_nr FROM filter ORDER BY filter_nr;
-@end example
-Previously, this resulted in the error:
-@code{Column: 'filter_nr' in order clause is ambiguous}.
-@item
-@code{mysql} now outputs @code{'\0'}, @code{'\t'}, @code{'\n'} and @code{'\\'}
-when encountering ASCII 0, tab, newline or @code{'\'} while writing
-tab-separated output.
-This is to allow printing of binary data in a portable format.
-To get the old behavior, use @code{-r} (or @code{--raw}).
-@item
-Added german error messages (60 of 80 error messages translated).
-@item
-Added new API function @code{mysql_fetch_lengths(MYSQL_RES *)}, which
-returns an array of of column lengths (of type @code{uint}).
-@item
-Fixed bug with @code{IS NULL} in @code{WHERE} clause.
-@item
-Changed the optimizer a little to get better results when searching on a key
-part.
-@item
-Added @code{SELECT} option @code{STRAIGHT_JOIN} to tell the optimizer that
-it should join tables in the given order.
-@item
-Added support for comments starting with @code{'--'} in @file{mysql.cc}
-(Postgres syntax).
-@item
-You can have @code{SELECT} expressions and table columns in a @code{SELECT}
-which are not used in the group part. This makes it efficient to implement
-lookups. The column that is used should be a constant for each group because
-the value is calculated only once for the first row that is found for a group.
-@example
-mysql> SELECT id,lookup.text,sum(*) FROM test,lookup
- WHERE test.id=lookup.id GROUP BY id;
-@end example
-@item
-Fixed bug in @code{SUM(function)} (could cause a core dump).
-@item
-Changed @code{AUTO_INCREMENT} placement in the SQL query:
-@example
-INSERT into table (auto_field) values (0);
-@end example
-inserted 0, but it should insert an @code{AUTO_INCREMENT} value.
-@item
-@file{mysqlshow.c}: Added number of records in table. Had to change the
-client code a little to fix this.
-@item
-@code{mysql} now allows doubled @code{''} or @code{""} within strings for
-embedded @code{'} or @code{"}.
-@item
-New math functions:
-@code{EXP()}, @code{LOG()}, @code{SQRT()}, @code{ROUND()}, @code{CEILING()}.
-@end itemize
-
-@node News-3.20.3, News-3.20.0, News-3.20.6, News-3.20.x
-@appendixsubsec Changes in release 3.20.3
-
-@itemize @bullet
-@item
-The @code{configure} source now compiles a thread-free client library
-@code{-lmysqlclient}. This is the only library that needs to be linked
-with client applications. When using the binary releases, you must
-link with @code{-lmysql -lmysys -ldbug -lstrings} as before.
-@item
-New @code{readline} library from @code{bash-2.0}.
-@item
-LOTS of small changes to @code{configure} and makefiles (and related source).
-@item
-It should now be possible to compile in another directory using
-@code{VPATH}. Tested with GNU Make 3.75.
-@item
-@code{safe_mysqld} and @code{mysql.server} changed to be more compatible
-between the source and the binary releases.
-@item
-@code{LIMIT} now takes one or two numeric arguments.
-If one argument is given, it indicates the maximum number of rows in
-a result. If two arguments are given, the first argument indicates the offset
-of the first row to return, the second is the maximum number of rows.
-With this it's easy to do a poor man's next page/previous page WWW
-application.
-@item
-Changed name of SQL function @code{FIELDS()} to @code{ELT()}.
-Changed SQL function @code{INTERVALL()} to @code{INTERVAL()}.
-@item
-Made @code{SHOW COLUMNS} a synonym for @code{SHOW FIELDS}.
-Added compatibility syntax @code{FRIEND KEY} to @code{CREATE TABLE}. In
-@strong{MySQL}, this creates a non-unique key on the given columns.
-@item
-Added @code{CREATE INDEX} and @code{DROP INDEX} as compatibility functions.
-In @strong{MySQL}, @code{CREATE INDEX} only checks if the index exists and
-issues an error if it doesn't exist. @code{DROP INDEX} always succeeds.
-@item
-@file{mysqladmin.c}: added client version to version information.
-@item
-Fixed core dump bug in @code{sql_acl} (core on new connection).
-@item
-Removed @code{host}, @code{user} and @code{db} tables from database @code{test}
-in the distribution.
-@item
-@code{FIELD_TYPE_CHAR} can now be signed (-128 - 127) or unsigned (0 - 255)
-Previously, it was always unsigned.
-@item
-Bug fixes in @code{CONCAT()} and @code{WEEKDAY()}.
-@item
-Changed a lot of source to get @code{mysqld} to be compiled with SunPro
-compiler.
-@item
-SQL functions must now have a @code{'('} immediately after the function name
-(no intervening space).
-For example, @code{'user('} is regarded as beginning a function call, and
-@code{'user ('} is regarded as an identifier @code{user} followed by a
-@code{'('}, not as a function call.
-@end itemize
-
-@node News-3.20.0, , News-3.20.3, News-3.20.x
-@appendixsubsec Changes in release 3.20.0
-
-@itemize @bullet
-@item
-The source distribution is done with @code{configure} and Automake.
-It will make porting much easier. The @code{readline} library is included
-in the distribution.
-@item
-Separate client compilation:
-the client code should be very easy to compile on systems which
-don't have threads.
-@item
-The old Perl interface code is automatically compiled and installed.
-Automatic compiling of @code{DBD} will follow when the new @code{DBD} code
-is ported.
-@item
-Dynamic language support: @code{mysqld} can now be started with Swedish
-or English (default) error messages.
-@item
-New functions: @code{INSERT()}, @code{RTRIM()}, @code{LTRIM()} and
-@code{FORMAT()}.
-@item
-@code{mysqldump} now works correctly for all field types (even
-@code{AUTO_INCREMENT}). The format for @code{SHOW FIELDS FROM tbl_name}
-is changed so the @code{Type} column contains information suitable for
-@code{CREATE TABLE}. In previous releases, some @code{CREATE TABLE}
-information had to be patched when recreating tables.
-@item
-Some parser bugs from 3.19.5 (@code{BLOB} and @code{TIMESTAMP}) are corrected.
-@code{TIMESTAMP} now returns different date information depending on its
-create length.
-@item
-Changed parser to allow a database, table or field name to
-start with a number or @code{'_'}.
-@item
-All old C code from Unireg changed to C++ and cleaned up. This makes
-the daemon a little smaller and easier to understand.
-@item
-A lot of small bug fixes done.
-@item
-New @file{INSTALL} files (not final version) and some info regarding porting.
-@end itemize
-
-@node News-3.19.x, , News-3.20.x, News
-@appendixsec Changes in release 3.19.x
-
-@menu
-* News-3.19.5:: Changes in release 3.19.5
-* News-3.19.4:: Changes in release 3.19.4
-* News-3.19.3:: Changes in release 3.19.3
-@end menu
-
-@node News-3.19.5, News-3.19.4, News-3.19.x, News-3.19.x
-@appendixsubsec Changes in release 3.19.5
-
-@itemize @bullet
-@item
-Some new functions, some more optimization on joins.
-@item
-Should now compile clean on Linux (2.0.x).
-@item
-Added functions @code{DATABASE()}, @code{USER()}, @code{POW()},
-@code{LOG10()} (needed for ODBC).
-@item
-In a @code{WHERE} with an @code{ORDER BY} on fields from only one table,
-the table is now preferred as first table in a multi-join.
-@item
-@code{HAVING} and @code{IS NULL} or @code{IS NOT NULL} now works.
-@item
-A group on one column and a sort on a group function (@code{SUM()},
-@code{AVG()}...) didn't work together. Fixed.
-@item
-@code{mysqldump}: Didn't send password to server.
-@end itemize
-
-@node News-3.19.4, News-3.19.3, News-3.19.5, News-3.19.x
-@appendixsubsec Changes in release 3.19.4
-
-@itemize @bullet
-@item
-Fixed horrible locking bug when inserting in one thread and reading
-in another thread.
-@item
-Fixed one-off decimal bug. 1.00 was output as 1.0.
-@item
-Added attribute @code{'Locked'} to process list as info if a query is
-locked by another query.
-@item
-Fixed full magic timestamp. Timestamp length may now be 14, 12, 10, 8, 6, 4
-or 2 bytes.
-@item
-Sort on some numeric functions could sort incorrectly on last number.
-@item
-@code{IF(arg,syntax_error,syntax_error)} crashed.
-@item
-Added functions @code{CEILING()}, @code{ROUND()}, @code{EXP()}, @code{LOG()} and @code{SQRT()}.
-@item
-Enhanced @code{BETWEEN} to handle strings.
-@end itemize
-
-@node News-3.19.3, , News-3.19.4, News-3.19.x
-@appendixsubsec Changes in release 3.19.3
-
-@itemize @bullet
-@item
-Fixed @code{SELECT} with grouping on @code{BLOB} columns not to return
-incorrect @code{BLOB} info. Grouping, sorting and distinct on @code{BLOB}
-columns will not yet work as
-expected (probably it will group/sort by the first 7 characters in the
-@code{BLOB}). Grouping on formulas with a fixed string size (use @code{MID()}
-on a @code{BLOB}) should work.
-@item
-When doing a full join (no direct keys) on multiple tables with @code{BLOB}
-fields, the @code{BLOB} was garbage on output.
-@item
-Fixed @code{DISTINCT} with calculated columns.
-@end itemize
-
-@node Bugs, TODO, News, Top
-@appendix MySQL ¤Ç¤Î´ûÃΤΥ¨¥é¡¼¤È·ç¤±¤Æ¤¤¤ë¥Ç¥¶¥¤¥ó
-
-@itemize @bullet
-@item
-MIT-pthread ¤ò»ÈÍѤ¹¤ë¤È¤­¡¢Â¾¤Î¥Ç¥£¥ì¥¯¥È¥ê¤Ç¥Ó¥ë¥É½ÐÍè¤Þ¤»¤ó¡£
-¤³¤ì¤Ï MIT-pthread ¤ÎÊѹ¹¤òÍ׵᤹¤ë¤¿¤á¡¢²æ¡¹¤Ï¡¢¤³¤ì¤ò½¤Àµ¤·¤½¤¦¤Ë¤Ê¤¤¤Ç¤¹¡£
-@item
-@code{BLOB} values can't ``reliably'' be used in @code{GROUP BY} or
-@code{ORDER BY} or @code{DISTINCT}.
-¤³¤ì¤é¤Î¾ì¹ç¡¢ @code{BLOB} ¤ÎÈæ³Ó¤ÎºÝ¤Ë¤ÏºÇ½é¤Î @code{max_sort_length} ¥Ð¥¤¥È
-¡Ê¥Ç¥Õ¥©¥ë¥È1024¡Ë¤À¤±¤¬»ÈÍѤµ¤ì¤Þ¤¹¡£
-¤³¤ì¤Ï @code{mysqld} ¤Î @code{-O max_sort_length} ¥ª¥×¥·¥ç¥ó¤ÇÊѹ¹²Äǽ¤Ç¤¹¡£
-A workaround for most cases is to use a substring:
-@code{SELECT DISTINCT LEFT(blob,2048) FROM tbl_name}.
-@item
-Calculation is done with @code{BIGINT} or @code{DOUBLE} (both are
-normally 64 bits long). It depends on the function which precision one
-gets. The general rule is that bit functions are done with @code{BIGINT}
-precision, @code{IF}, and @code{ELT()} with @code{BIGINT} or @code{DOUBLE}
-precision and the rest with @code{DOUBLE} precision. One should try to
-avoid using bigger unsigned long long values than 63 bits
-(9223372036854775807) for anything else than bit fields!
-@item
-Á´¤Æ¤Îʸ»ú·¿¤Î¥Õ¥£¡¼¥ë¥É¡¢@code{BLOB} ¤È @code{TEXT} ¤Ï¤Î¤¾¤¤¤Æ¡¢¤Ï¡¢
-¸¡º÷¤µ¤ì¤ë¤È¤­¤ËºÇ¸å¤Ë¤Ä¤¤¤Æ¤¤¤ë¥¹¥Ú¡¼¥¹¤ò¼«Æ°¤Ç¼è¤ê½ü¤­¤Þ¤¹¡£
- @code{CHAR} ·¿¤Ç¤Ï¤³¤ì¤Ï OK ¤Ç¡¢¤³¤ÎÆÃħ¤Ï ANSI SQL92 ¤Ë½¾¤Ã¤Æ¤¤¤ë¤È¸«¤Ê¤µ¤ì¤ë¤Ç¤·¤ç¤¦¡£
-@strong{MySQL} ¤Î¥Ð¥°¤Ï¡¢ @code{VARCHAR} ¤Ç¤âƱÍͤ˹ԤäƤ·¤Þ¤¦¤³¤È¤Ç¤¹¡£
-@item
-°ì¤Ä¤Î¥Æ¡¼¥Ö¥ë¤Ë @code{ENUM} ¤È @code{SET} ¥Õ¥£¡¼¥ë¥É¤Ï 255 ¤Þ¤Ç¤·¤«»ý¤Æ¤Þ¤»¤ó¡£
-@item
-@code{safe_mysqld} re-directs all messages from @code{mysqld} to the
-@code{mysqld} log. One problem with this is that if you execute
-@code{mysqladmin refresh} to close and reopen the log,
-@code{stdout} and @code{stderr} are still redirected to the old log.
-If you use @code{--log} extensively, you should edit @code{safe_mysqld} to
-log to @file{'hostname'.err} instead of @file{'hostname'.log} so you can
-easily reclaim the space for the old log by deleting the old one and
-executing @code{mysqladmin refresh}.
-@item
-In the @code{UPDATE} statement, columns are updated from left to right.
-If you refer to a updated column, you will get the updated value instead of the
-original value. For example:
-@example
-mysql> UPDATE tbl_name SET KEY=KEY+1,KEY=KEY+1
-@end example
-will update @code{KEY} with @code{2} instead of with @code{1}.
-@item
-You can't use temporary tables more than once in the same query.
-
-@example
-select * from temporary_table, temporary_table as t2;
-@end example
-
-@item
-Because @strong{MySQL} allows you to work with table types that doesn't
-support transactions (and thus can't @code{rollback} data) some things
-behaves a little different in @strong{MySQL} than in other SQL servers:
-(This is just to ensure that @strong{MySQL} never need to do a rollback
-for a SQL command). This may be a little akward at times as column
-values must be checked in the application, but this will actually give
-you a nice speed increase as it allows @strong{MySQL} to do some
-optimizations that otherwice would be hard to do.
-
-If you set a colum to a wrong value, @strong{MySQL} will instead of doing
-a rollback instead store the @code{best possible value} in the column.
-
-@itemize @bullet
-@item
-If you try to store a value outside of the range in a numerical column,
-@strong{MySQL} will instead store the smallest or biggest possible value in
-the column.
-@item
-If you try to store a string, that doesn't start with a number, into a
-numerical column @strong{MySQL} will store 0 into it.
-@item
-If you try to to store @code{NULL} into a column that doesn't take
-@code{NULL} values, @code{MySQL} will store 0 or @code{''} (empty
-string) in it instead. (This behavour can however be changed with the
--DDONT_USE_DEFAULT_FIELDS compile option).
-@item
-@strong{MySQL} allows you to store some wrong date values into
-@code{DATE} and @code{DATETIME} columns. (Like 2000-02-31 or 2000-02-00).
-If the date is totally wrong, @strong{MySQL} will store the special
-0000-00-00 date value in the column.
-@item
-If you set an @code{enum} to an not supported value, it will be set to
-the error value 'empty string', with numeric value 0.
-@end itemize
-@item
-If you execute a @code{PROCEDURE} on a query with returns an empty set then
-in some cases the @code{PROCEDURE} will not transform the columns.
-@end itemize
-
-The following is known bugs in earlier versions of @strong{MySQL}:
-
-@itemize @bullet
-@item
-You can get a hanged thread if you do a @code{DROP TABLE} on a table that is
-one among many tables that is locked with @code{LOCK TABLES}.
-
-@item
-In the following case you can get a core dump:
-@enumerate
-@item
-Delayed insert handler has pending inserts to a table.
-@item
-@code{LOCK table} with @code{WRITE}
-@item
-@code{FLUSH TABLES}
-@end enumerate
-
-@item
-Before @strong{MySQL} 3.23.2 an @code{UPDATE} that updated a key with
-a @code{WHERE} on the same key may have failed because the key was used to
-search for records and the same row may have been found multiple times:
-
-@example
-UPDATE tbl_name SET KEY=KEY+1 WHERE KEY > 100;
-@end example
-
-A workaround is to use:
-
-@example
-mysql> UPDATE tbl_name SET KEY=KEY+1 WHERE KEY+0 > 100;
-@end example
-
-This will work because @strong{MySQL} will not use index on expressions in
-the @code{WHERE} clause.
-@item
-@strong{MySQL} 3.23 ¤è¤êÁ°¤Ç¤Ï¡¢Á´¤Æ¤Î¿ôÃÍ·¿¤Ç¡¢¾¯¿ôÉôʬ¤¬ºï¤é¤ì¤Æ¤·¤Þ¤¤¤Þ¤¹¡£
-¤³¤ì¤Ï¡¢¤½¤Î¥Õ¥£¡¼¥ë¥É¤¬²¿·å¤Î¾®¿ôÉô¤ò»ý¤Ä¤«¡¢ÄêµÁ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤«¤Ã¤¿¡¢¤È
-¤¤¤¦¤³¤È¤Ç¤¹¡£ Á´¤Æ¤Î·ë²Ì¤Ï10¿Ê¤Î¿ô¤ÇÀµ¤·¤¯Ê֤äƤ­¤Þ¤·¤¿¡£
-@end itemize
-
-For platform-specific bugs, see the sections about compiling and porting.
-
-@cindex TODO
-@node TODO, Porting, Bugs, Top
-@appendix MySQL ¤Ë¾­Íè²Ã¤¨¤¿¤¤¤â¤Î (The TODO)
-
-@menu
-* TODO future:: Things that must done in the very near future
-* TODO sometime:: Things that have to be done sometime
-* TODO unplanned:: Some things we don't have any plans to do
-@end menu
-
-¤³¤Î¥ê¥¹¥È¤Î¤¹¤Ù¤Æ¤Ï¡¢¤½¤ì¤¬½ª¤ï¤ë¤À¤í¤¦½çÈ֤˽ñ¤«¤ì¤Æ¤¤¤Þ¤¹¡£
-¤â¤·¤¢¤Ê¤¿¤¬Í¥Àè½ç°Ì¤Ë±Æ¶Á¤òµÚ¤Ü¤·¤¿¤±¤ì¤Ð¡¢¤É¤¦¤«¥é¥¤¥»¥ó¥¹¤«¥µ¥Ý¡¼¥ÈÅÐÏ¿¤·¤Æ¡¢
-²æ¡¹¤Ë¤¢¤Ê¤¿¤¬¤è¤ê®¤¯Íߤ·¤¤¤â¤Î¤ò¸À¤Ã¤Æ¤¯¤À¤µ¤¤¡£
-@xref{Licensing and Support}.
-
-@node TODO future, TODO sometime, TODO, TODO
-@appendixsec ¶á¤¤¾­Íè¤Ë´°Î»¤»¤Í¤Ð¤Ê¤é¤Ê¤¤¤â¤Î
-
-@itemize @bullet
-@item
-Fail safe replication.
-@item
-Optimize, test and document transactions safe tables
-@item
-ÉûÌ䤤¹ç¤ï¤»¡£ @code{select id from t where grp in (select grp from g where u > 100)}
-@item
-mysqld ¤Ë¡¢Æ±»þ¤Ë¿¤¯¤Î¥­¥ã¥é¥¯¥¿¡¦¥»¥Ã¥È¤ò¥µ¥Ý¡¼¥È¤µ¤»¤ë
-@item
-¤â¤·Â¾¤Î disk ¤Ë symlink ¤µ¤ì¤Æ¤¤¤ë¥Æ¡¼¥Ö¥ë¤ËÂФ·¤Æ @code{ALTER TABLE} ¤ò
-¼Â¹Ô¤·¤¿¾ì¹ç¡¢°ì»þ¥Æ¡¼¥Ö¥ë¤ò¤³¤Î disk ¤ËºîÀ®¤¹¤ë¤è¤¦¤Ë¤¹¤ë
-@item
-@code{RENAME table as table, table as table [,...]}
-@item
-Allow users to change startup options.
-@item
-FreeBSD and MIT-pthreads; Do sleeping threads take CPU?
-@item
-Check if locked threads take any CPU.
-@item
-Change to use mkstemp() instead of tempnam() for system that supports the call.
-We need to add a my_mkstemp() function in mysys and also change the cache
-code to not create the filename until we do the actual open.
-@item
-¥­¡¼¤ÎÉôʬ¤Ç¤Î JOIN ¤òµö¤¹ (ºÇŬ²½ÌäÂê)
-@item
-Entry for @code{DECRYPT()}.
-@item
- @file{.frm} ¥Õ¥¡¥¤¥ë¤Ë @code{FOREIGN} ¥­¡¼¤ÎÄêµÁ¤òµ­²±¤¹¤ë¡£
-@item
-¥µ¡¼¥Ð¡¼¥µ¥¤¥É¤Î¥«¡¼¥½¥ë
-@item
-Check if @code{lockd} works with modern Linux kernels; If not, we have
-to fix @code{lockd}! To test this, start @code{mysqld} with
-@code{--enable-locking} and run the different fork* test suits. They shouldn't
-give any errors if @code{lockd} works.
-@item
-Allow SQL variables in @code{LIMIT}, like in @code{LIMIT @@a,@@b}.
-@item
-¼«Æ°¤Ç @code{DEFAULT} Ãͤò¥Õ¥£¡¼¥ë¥É¤ËÄɲ䷤ʤ¤¡£
-@code{DEFAULT} ¤ò»ý¤¿¤Ê¤¤¥Õ¥£¡¼¥ë¥É¤ò´Þ¤Þ¤Ê¤¤ @code{INSERT} ¤Î»ÈÍѤÏ
-¥¨¥é¡¼¤Ë¤¹¤ë
-@item
-¥¯¥¨¥ê¡¼¤È·ë²Ì¤Î¥­¥ã¥Ã¥·¥å¡£
-This should be done as a separated
-module that examines each query and if this is query is in the cache
-the cached result should be returned. When one updates a table one
-should remove as few queries as possible from the cache.
-This should give a big speed bost on machines with much RAM where
-queries are often repeated (like WWW applications).
-One idea would be to only cache queries of type:
-@code{SELECT CACHED ....}
-@item
-Fix @file{libmysql.c} to allow two @code{mysql_query()} commands in a row
-without reading results or give a nice error message when one does this.
-@item
-@code{BIT} ·¿¤ò 1 bit ¼è¤ë¤è¤¦¤ËºÇŬ²½ ¡Êº£ @code{BIT} ¤Ï°ìʸ»ú¤È¤ê¤Þ¤¹¡Ë
-@item
-¤Ê¤¼¤¤¤¯¤Ä¤«¤Î FreeBSD ¥·¥¹¥Æ¥à¤Ç MIT-pthreads @code{ctime()} ¤¬Æ°¤«¤Ê¤¤¤«¸¡¾Ú¡£
-@item
-Check if locked threads take any CPU.
-@item
-¹¹¿·¤Ë @code{ORDER BY} ¤òÄɲᣠThis would be handy with functions like:
-@code{generate_id(start,step)}.
-@item
-@code{TIMESTAMP} ¤È @code{AUTO_INCREMENT} ¥Õ¥£¡¼¥ë¥É¤ò¹¹¿·¤·¤Ê¤¤¤è¤¦¤Ë¡¢
- @code{IMAGE} ¥ª¥×¥·¥ç¥ó¤ò @code{LOAD DATA INFILE} ¤ËÄɲá£
-@item
-@code{LOAD DATA INFILE} ¤Ë°Ê²¼¤Îʸ¤òÍý²ò¤µ¤»¤ë¡§
-@example
-LOAD DATA INFILE 'file_name.txt' INTO TABLE tbl_name
-TEXT_FIELDS (text_field1, text_field2, text_field3)
-SET table_field1=concatenate(text_field1, text_field2), table_field3=23
-IGNORE text_field3
-@end example
-@item
-ËÜÅö¤Î @code{VARCHAR} ¤Î¥µ¥Ý¡¼¥È (MyISAM ¤Ë¤Ï¤³¤Î¥µ¥Ý¡¼¥È¤¬´û¤Ë¤¢¤ê¤Þ¤¹)
-@item
- @code{mysql} ¤«¤é¼«Æ°Åª¤Ë netscape ¤Ë½ÐÎÏ
-@item
-@code{LOCK DATABASES}. (¤¤¤í¤¤¤í¤Ê¥ª¥×¥·¥ç¥óÉÕ¤­¤Ç)
-@item
-@code{NATURAL JOIN}.
-@item
-Change sort to allocate memory in ``hunks'' to get better memory utilization.
-@item
-@code{DECIMAL} ¤È @code{NUMERIC} ·¿¤Ï »Ø¿ôɽ¼¨¤Î¿ô»ú¤òÆɤळ¤È¤¬½ÐÍè¤Þ¤»¤ó¡§
-¤³¤ì¤ò½¤Àµ¤¹¤ë¤Ë¤Ï¡¢
-@code{Field_decimal::store(const char *from,uint len)} ¤òºÆ¥³¡¼¥É¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó
-@item
-Fix @code{mysql.cc} to do fewer @code{malloc()} calls when hashing field
-names.
-@item
-´Ø¿ô¡§
-ADD_TO_SET(value,set) ¤È REMOVE_FROM_SET(value,set)
-@item
-@code{t1 JOIN t2 ON ...} ¤È @code{t1 JOIN t2 USING ...} ¤Î»ÈÍѤÎÄɲá£
-¸½ºß¡¢ @code{LEFT JOIN} ¤Î¤ß¤¬»ÈÍѤǤ­¤Þ¤¹¡£
-@item
-@code{unsigned long long} ·¿¤Î´°Á´¤Ê¥µ¥Ý¡¼¥È¡£
-@item
-@code{CASE} ´Ø¿ô
-@item
-@code{show status} ¤Ë¤â¤Ã¤È¿¤¯¤ÎÊÑ¿ô¤ò¡£
-@code{INSERT}/@code{DELETE}/@code{UPDATE} ʸ¤Î¥«¥¦¥ó¥È¡£
- ¥ì¥³¡¼¥É¤ÎÆɤ߹þ¤ß¤È¹¹¿·¤Î¥«¥¦¥ó¥È¡£
- 1¥Æ¡¼¥Ö¥ë¤Ç¤ÎSELECT¤ÈJOIN¤òȼ¤Ã¤¿SELECT¤Î¥«¥¦¥ó¥È¡£
- SELECT Ãæ¤Î¥Æ¡¼¥Ö¥ë¤Î¿ô¤Î¥«¥¦¥ó¥È¡£
- ¥­¡¼¥Ð¥Ã¥Õ¥¡¤Î reaad/write ¤Î¥Ò¥Ã¥È¿ô(ÍýÏÀÃͤȼ¿ô)¤Î¥«¥¦¥ó¥È¡£
- @code{ORDER BY}, @code{GROUP BY}, °ì»þ¥Æ¡¼¥Ö¥ë¤ÎºîÀ®¤Î¥«¥¦¥ó¥È
-@item
-¤â¤·¥¯¥¨¥ê¤ÎÅÓÃæ¤Ç @code{mysql} ¤òÃæÃǤ·¤¿¾ì¹ç¡¢¤¢¤Ê¤¿¤Ï¾¤«¤éÀܳ¤·¤Æ
-Áö¤Ã¤Æ¤¤¤ë¥¯¥¨¥ê¤ò kill ¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-ºÇ½ªÅª¤Ë¤Ï¡¢¤³¤¦¤¤¤Ã¤¿¤³¤È¤Ï¥µ¡¼¥Ð¡¼Æâ¤Ç¸¡ÃΤµ¤ì¤ë¤è¤¦¤Ë»î¤ß¤ë¤Ù¤­¤Ç¤¹¡£
-@item
-¥Æ¡¼¥Ö¥ë¤Î¾ðÊó¤Î¤¿¤á¤Î¥Ï¥ó¥É¥é¡¼¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹¤ÎÄɲá£
- ¤½¤ì¤ò¥·¥¹¥Æ¥à¥Æ¡¼¥Ö¥ë¤È¤·¤Æ»È¤¨¤ë¤è¤¦¤Ë¡£
-¤³¤ì¤Ï¤â¤·¤¢¤Ê¤¿¤¬¤¹¤Ù¤Æ¤Î¥Æ¡¼¥Ö¥ë¤Ë¤Ä¤¤¤Æ¾ðÊó¤ò¥ê¥¯¥¨¥¹¥È¤·¤¿¾ì¹ç¤Ï
-¾¯¤·ÃÙ¤¯¤Ê¤ë¤Ç¤·¤ç¤¦¡£ ¤·¤«¤·¤È¤Æ¤â½ÀÆðÀ­¤¬¤¢¤ê¤Þ¤¹¡£
-´ðËÜŪ¤Ê¥Æ¡¼¥Ö¥ë¤Ø¤Î @code{SHOW INFO FROM tbl_name} ¤Ç¤Ï¼Â¹Ô¤µ¤ì¤ë¤Ù¤­¤Ç¤¹¡£
-@item
-UNICODE ¤Î¥µ¥Ý¡¼¥È
-@item
-@code{NATURAL JOIN}.
-@item
-Oracle like @code{CONNECT BY PRIOR ...} to search hierarchy structures.
-@item
-@code{RENAME DATABASE}
-@item
-@code{mysqladmin copy database new-database}.
-@item
-Processlist ¤Ï queries/thread ¤Î¿ô¤òɽ¼¨¤¹¤Ù¤­¡£
-@item
-@code{DELETE} ¤È @code{REPLACE} ¥ª¥×¥·¥ç¥ó¤ò @code{UPDATE} ʸ¤ËÄɲᣠ(
-¤³¤ì¤Ï¹¹¿·Ãæ¤Ëµ¯¤³¤Ã¤¿¥­¡¼¤Î½ÅÊ£¥¨¥é¡¼¤Î¤¢¤ë¥ì¥³¡¼¥É¤ò
-Á´¤Æºï½ü¤¹¤ë¤Ç¤·¤ç¤¦).
-@item
-Change the format of @code{DATETIME} to store fractions of seconds.
-@item
-ANSI92 ¤È ODBC 3.0 ·¿¤Ç¤«¤±¤Æ¤¤¤ëʪÁ´¤Æ¤òÄɲá£
-@item
-Change table names from empty strings to @code{NULL} for calculated columns.
-@item
-Don't use 'Item_copy_string' on numerical values to avoid
-number->string->number conversion in case of:
-@code{SELECT COUNT(*)*(id+0) FROM table_name GROUP BY id}
-@item
-Make it possible to use the new GNU regexp library instead of the current
-one (The GNU library should be much faster than the old one).
-@item
-Change that @code{ALTER TABLE} doesn't abort clients that executes
-@code{INSERT DELAYED}.
-@item
-Allow @code{select a from crash_me left join crash_me2 using (a)}; In this
-case a is assumed to come from the crash_me table.
-@item
-@code{LOAD DATA INFILE 'file_name' INTO TABLE 'table_name' ERRORS TO err_table_name}
-which would cause any errors/warnings to be logged into the err_table_name
-table. That table would have a structure like:
-
-line_number - line number in data file
-error_message - the error/warning message
-and maybe
- data_line - the line from the data file
-@item
-Fix that when columns referenced in an @code{UPDATE} clause contains the old
-values before the update started.
-@item
-Allow update of varibles in @code{UPDATE} statements. For example:
-@code{UPDATE TABLE foo SET @@a=a+b,a=@@a, b=@@a+c}
-@item
-@code{myisamchk}, @code{REPAIR} and @code{OPTIMIZE TABLE} should be able
-to handle cases where the data and/or index files are symbolic links.
-@item
-Add simulation of @code{pread()}/@code{pwrite()} on windows to enable
-concurrent inserts.
-@end itemize
-
-@node TODO sometime, TODO unplanned, TODO future, TODO
-@appendixsec ¤¤¤Ä¤«¤Ï¹Ô¤¦¤Ù¤­¤â¤Î
-
-@itemize @bullet
-@item
-Implement function: @code{get_changed_tables(timeout,table1,table2,...)}
-@item
-Atomic updates; This includes a language that one can even use for
-a set of stored procedures.
-@item
-@code{update items,month set items.price=month.price where items.id=month.id;}
-@item
-Change reading through tables to use memmap when possible. Now only
-compressed tables use memmap.
-@item
-Add a new privilege @strong{'Show_priv'} for @code{SHOW} commands.
-@item
-Make the automatic timestamp code nicer. Add timestamps to the update
-log with @code{SET TIMESTAMP=#;}
-@item
-Use read/write mutex in some places to get more speed.
-@item
-Full foreign key support. One probably wants to implement a procedural
-language first.
-@item
-Simple views (first on one table, later on any expression).
-@item
-Automatically close some tables if a table, temporary table or temporary files
-gets error 23 (not enough open files).
-@item
-When one finds a field=#, change all occurrences of field to #. Now this
-is only done for some simple cases.
-@item
-Change all const expressions with calculated expressions if possible.
-@item
-Optimize key = expression. At the moment only key = field or key =
-constant are optimized.
-@item
-Join some of the copy functions for nicer code.
-@item
-Change @file{sql_yacc.yy} to an inline parser to reduce its size and get
-better error messages (5 days).
-@item
-Change the parser to use only one rule per different number of arguments
-in function.
-@item
-Use of full calculation names in the order part. (For ACCESS97)
-@item
-@code{UNION}, @code{MINUS}, @code{INTERSECT} and @code{FULL OUTER JOIN}.
-(Currently only @code{LEFT OUTER JOIN} is supported)
-@item
-Allow @code{UNIQUE} on fields that can be @code{NULL}.
-@item
-@code{SQL_OPTION MAX_SELECT_TIME=#} to put a time limit on a query.
-@item
-Make the update log to a database.
-@item
-Negative @code{LIMIT} to retrieve data from the end.
-@item
-Alarm around client connect/read/write functions.
-@item
-Make a @code{mysqld} version which isn't multithreaded (3-5 days).
-@item
-Please note the changes to @code{safe_mysqld}: according to FSSTND (which
-Debian tries to follow) PID files should go into @file{/var/run/<progname>.pid}
-and log files into @file{/var/log}. It would be nice if you could put the
-"DATADIR" in the first declaration of "pidfile" and "log", so the
-placement of these files can be changed with a single statement.
-@item
-Better dynamic record layout to avoid fragmentation.
-@item
-@code{UPDATE SET blob=read_blob_from_file('my_gif') where id=1;}
-@item
-Allow a client to request logging.
-@item
-Add use of @code{zlib()} for @code{gzip}-ed files to @code{LOAD DATA INFILE}.
-@item
-Fix sorting and grouping of @code{BLOB} columns (partly solved now).
-@item
-Stored procedures. This is currently not regarded to be very
-important as stored procedures are not very standardized yet.
-Another problem is that true stored procedures make it much harder for
-the optimizer and in many cases the result is slower than before
-We will, on the other hand, add a simple (atomic) update language that
-can be used to write loops and such in the @strong{MySQL} server.
-@item
-Change to use semaphores when counting threads. One should first implement
-a semaphore library to MIT-pthreads.
-@item
-Don't assign a new @code{AUTO_INCREMENT} value when one sets a column to 0.
-Use @code{NULL} instead.
-@item
-Add full support for @code{JOIN} with parentheses.
-@item
-Reuse threads for systems with a lot of connections.
-@item
-As an alternative for one thread / connection manage a pool of threads
-to handle the queries.
-@item
-Allow one to get more than one lock with @code{GET_LOCK}. When doing this,
-one must also handle the possible deadlocks this change will introduce.
-@end itemize
-
-Time is given according to amount of work, not real time. TcX's main
-business is the use of @strong{MySQL} not the development of it. But
-because TcX is a very flexible company, we have put a lot of resources
-into the development of @strong{MySQL}.
-
-@node TODO unplanned, , TODO sometime, TODO
-@appendixsec ¹Ô¤¦Í½Äê¤Î¤Ê¤¤Êª
-
-@itemize @bullet
-@item
-Nothing; In the long run we plan to be fully ANSI 92 / ANSI 99 compliant.
-@end itemize
-
-@node Porting, Regexp, TODO, Top
-@appendix ¾¤Î¥·¥¹¥Æ¥à¤Ø¤Î°Ü¿¢¤Ë¤Ä¤¤¤Æ
-
-A working Posix thread library is needed for the server. On Solaris 2.5
-we use Sun PThreads (the native thread support in 2.4 and earlier
-versions are not good enough) and on Linux we use LinuxThreads by Xavier
-Leroy, @email{Xavier.Leroy@@inria.fr}.
-
-The hard part of porting to a new Unix variant without good native
-thread support is probably to port MIT-pthreads. See
-@file{mit-pthreads/README} and
-@uref{http://www.humanfactor.com/pthreads/, Programming POSIX Threads}.
-
-The @strong{MySQL} distribution includes a patched version of
-Provenzano's Pthreads from MIT (see
-@uref{http://www.mit.edu:8001/people/proven/pthreads.html, MIT Pthreads
-web page}). This can be used for some operating systems that do not
-have POSIX threads.
-
-It is also possible to use another user level thread package named
-FSU Pthreads (see
-@uref{http://www.informatik.hu-berlin.de/~mueller/pthreads.html, FSU Pthreads
-home page}). This implementation is being used for the SCO port.
-
-See the @file{thr_lock.c} and @file{thr_alarm.c} programs in the @file{mysys}
-directory for some tests/examples of these problems.
-
-Both the server and the client need a working C++ compiler (we use @code{gcc}
-and have tried SparcWorks). Another compiler that is known to work is the
-Irix @code{cc}.
-
-To compile only the client use @code{./configure --without-server}.
-
-There is currently no support for only compiling the server, nor is it
-likly to be added unless someone has a good reason for it.
-
-If you want/need to change any @file{Makefile} or the configure script you must
-get Automake and Autoconf. We have used the @code{automake-1.2} and
-@code{autoconf-2.12} distributions.
-
-All steps needed to remake everything from the most basic files.
-
-@example
-/bin/rm */.deps/*.P
-/bin/rm -f config.cache
-aclocal
-autoheader
-aclocal
-automake
-autoconf
-./configure --with-debug --prefix='your installation directory'
-
-# The makefiles generated above need GNU make 3.75 or newer.
-# (called gmake below)
-gmake clean all install init-db
-@end example
-
-If you run into problems with a new port, you may have to do some debugging
-of @strong{MySQL}!
-@xref{Debugging server}.
-
-@strong{Note:} Before you start debugging @code{mysqld}, first get the test
-programs @code{mysys/thr_alarm} and @code{mysys/thr_lock} to work. This
-will ensure that your thread installation has even a remote chance to work!
-
-@menu
-* Debugging server:: Debugging a @strong{MySQL} server
-* Debugging client:: Debugging a @strong{MySQL} client
-* RTS-threads:: Comments about RTS threads
-* Thread packages:: Differences between different thread packages
-@end menu
-
-@node Debugging server, Debugging client, Porting, Porting
-@appendixsec MySQL server ¤Î¥Ç¥Ð¥Ã¥°
-
-¤â¤·¤¢¤Ê¤¿¤¬ @strong{MySQL} ¤Î¤È¤Æ¤â¿·¤·¤¤¤¢¤ëµ¡Ç½¤ò»È¤Ã¤Æ¤¤¤ë¾ì¹ç¡¢
- @code{--skip-new} (¤³¤ì¤ÏÁ´¤¯¿·¤·¤¤¡¢ÀøºßŪ¤Ë´í¸±¤Êµ¡Ç½¤ò̵¸ú¤Ë¤·¤Þ¤¹)
-¤Þ¤¿¤Ï @code{--safe-mode} (¤³¤ì¤ÏÌäÂê¤òÀ¸¤¸¤µ¤»¤ë¤«¤â¤·¤ì¤Ê¤¤Â¿¤¯¤ÎºÇŬ²½¤ò̵¸ú¤Ë¤·¤Þ¤¹)
-¥ª¥×¥·¥ç¥ó¤Ç mysqld ¤ò¼Â¹Ô¤µ¤»¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-@xref{Crashing}.
-
-¤â¤· @code{mysqld} ¤¬µ¯Æ°¤·¤Ê¤¤¤è¤¦¤Ê¤é¡¢ @code{my.cnf} ¤¬Ìµ¤¤¤«¥Á¥§¥Ã¥¯¤·¤Æ¤¯¤À¤µ¤¤¡£
-@code{my.cnf} ¤Î°ú¿ô¤Ï @code{mysqld --print-defaults} ¤Ç¥Á¥§¥Ã¥¯¤Ç¤­¤Þ¤¹¡£
-¤Þ¤¿ @code{mysqld --no-defaults ...} ¤Çµ¯Æ°¤¹¤ë¤³¤È¤Ë¤è¤ê¡¢
- @code{my.cnf} ¤ò̵»ë¤¹¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£
-
-¤â¤·¤¢¤ë¤È¤Æ¤âÆüì¤ÊÌäÂ꤬¤¢¤ì¤Ð¡¢¤¢¤Ê¤¿¤Ï¡¢¤¤¤Ä¤â @strong{MySQL} ¤ò
-¥Ç¥Ð¥Ã¥°¤¹¤ë¤è¤¦»î¤ß¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ ¤³¤ì¤ò¹Ô¤¦¤Ë¤Ï¡¢ @strong{MySQL} ¤ò
- @code{--with-debug} ¥ª¥×¥·¥ç¥óÉÕ¤­¤Ç configure ¤·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-@strong{MySQL} ¤¬¥Ç¥Ð¥Ã¥®¥ó¥°¤òÍ­¸ú¤Ë¤·¤Æ¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Æ¤¤¤ë¤«¤ò
-ÃΤë¤Ë¤Ï¡¢ @code{mysqld --help} ¤È¤·¤Þ¤¹¡£ ¤â¤· @code{--debug} ¥Õ¥é¥°¤¬
-¥ê¥¹¥È¤µ¤ì¤Æ¤¤¤ì¤Ð¥Ç¥Ð¥Ã¥°¤¬Í­¸ú¤Ç¤¹¡£ @code{mysqladmin ver} ¤â
-@code{mysqld} ¤Î¥Ð¡¼¥¸¥ç¥ó¤ò¥ê¥¹¥È¤Ç¤­¤Þ¤¹¡£ ¤³¤Î¾ì¹ç¤Ï
- @code{mysql ... -debug} ¤È¡¢¥Ð¡¼¥¸¥ç¥óÈÖ¹æ¤Ëɽ¼¨¤µ¤ì¤ë¤Ç¤·¤ç¤¦¡£
-
-gcc ¤« egcs ¤Î¾ì¹ç¡¢¿ä¾©¤¹¤ë configure ¤Î¥é¥¤¥ó¤Ï¡§
-
-@example
-CC=gcc CFLAGS="-O6" CXX=gcc CXXFLAGS="-O6 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-debug
-@end example
-
-¤³¤ì¤Ï @code{libstdc++} ¥é¥¤¥Ö¥é¥ê¤È C++ ¤ÎÎã³°¤Ë¤è¤ëÌäÂê¤òÈò¤±¤ë¤³¤È¤¬½ÐÍè¤ë¤Ç¤·¤ç¤¦¡£
-(many compilers have problems with C++ exceptions in threaded
-code).
-
-If @code{mysqld} stops crashing when you compile it with
-@code{--with-debug}, you have probably found a compiler bug or a timing
-bug within @strong{MySQL}. In this case you can try to add @code{-g} to
-the @code{CFLAGS} and @code{CXXFLAGS} variables above and not use
-@code{--with-debug}. If @code{mysqld} now dies, you can at least
-attach to it with @code{gdb} or use @code{gdb} on the core file to find out what happened.
-
-¤â¤· @code{mysqld} ¥µ¡¼¥Ð¡¼¤Î¥¯¥é¥Ã¥·¥å¤òľ¤Ë°ú¤­µ¯¤³¤¹¤³¤È¤¬¤Ç¤­¤ë¤Ê¤é¡¢
-¤¢¤Ê¤¿¤Ï¤³¤Î¥È¥ì¡¼¥¹¥Õ¥¡¥¤¥ë¤òºîÀ®¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡§
-
-@code{mysqld} ¥µ¡¼¥Ð¡¼¤ò¥È¥ì¡¼¥¹¥í¥°¥Õ¥¡¥¤¥ë @file{/tmp/mysql.trace} ¥ª¥×¥·¥ç¥ó¤Çµ¯Æ°¡£
-¤³¤Î¥í¥°¥Õ¥¡¥¤¥ë¤Ï¤È¤Æ¤âÂ礭¤¯¤Ê¤ê¤Þ¤¹¡£
-
-@code{mysqld --debug --log}
-
-¤«
-
-@code{mysqld --debug=d,info,error,query,general,where:O,/tmp/mysql.trace}
-
-¤³¤ì¤Ï½ÅÍפʥ¿¥°¤Î¤ß¤ò½ÐÎϤ·¤Þ¤¹¡£
-
- @strong{MySQL} ¤ò¥Ç¥Ð¥Ã¥°¤Ç configure ¤¹¤ë¤È¡¢¼«Æ°¤Ç¿¤¯¤Î°ÂÁ´¤Ê¸¡ºº´Ø¿ô¤¬
-enable ¤Ë¤Ê¤ê¤Þ¤¹¡£ ¤³¤ì¤Ï @code{mysqld} ¤Î¾õÂÖ¤ò¥â¥Ë¥¿¡¼¤Ç¤­¤Þ¤¹¡£
-¤â¤·¤½¤ì¤é´Ø¿ô¤¬¤Ê¤Ë¤« ``ͽ´ü¤»¤Ì¤³¤È'' ¤òȯ¸«¤·¤¿¤é¡¢¤½¤ì¤é¤ò
-@code{stderr} ¤Ë½ñ¤­½Ð¤·¤Þ¤¹¡£ ¤³¤ì¤Ï @code{safe_mysqld} ¤¬¼õ¤±¼è¤Ã¤Æ error ¥í¥°¤Ë
-½ñ¤­½Ð¤·¤Þ¤¹¡ª ¤³¤Î¤³¤È¤Ï¤É¤¦¤¤¤¦¤³¤È¤«¤È¤¤¤¦¤È¡¢ @strong{MySQL} ¤Ëͽ´ü¤»¤Ì¤³¤È¤¬
-µ¯¤­¤¿¾ì¹ç¡¢¤Þ¤ººÇ½é¤Ë¤¹¤Ù¤­¤³¤È¤Ï¡¢ @strong{MySQL} ¤ò¥Ç¥Ð¥Ã¥°Í­¸ú¤Ë¤·¤Æ
-configure ¤¹¤ë¤³¤È¤Ç¤¹¡ª ¡Ê¼¡¤Ë¡¢¤â¤Á¤í¤ó¡¢ @email{mysql@@lists.mysql.com} ¤Ë
-¥á¡¼¥ë¤òÁ÷¤ê¡¢help ¤òʹ¤¯¤³¤È¤Ç¤¹¡£ Á´¤Æ¤Î¥Ð¥°¥ì¥Ý¡¼¥È¡¢@strong{MySQL} ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ë
-´ØÏ¢¤¹¤ë¼ÁÌä¤Ï¡¢ @code{mysqlbug} ¥¹¥¯¥ê¥×¥È¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡ª¡Ë
-
-¤Û¤È¤ó¤É¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¤â¤· @code{mysqld} ¤¬¥¯¥é¥Ã¥·¥å¤¹¤ë¤Ê¤é¡¢
- @code{gdb} ¤«¤é @code{mysqld} ¤òµ¯Æ°¤µ¤»¤Æ¿¤¯¤Î¾ðÊó¤òÆÀ¤ë¤³¤È¤¬²Äǽ¤Ç¤¹¡£
-
-Linux ¾å¤Ç¤Î¤¤¤¯¤Ä¤«¤Î @code{gdb} ¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢
- @code{mysqld} ¥¹¥ì¥Ã¥É¤Î¥Ç¥Ð¥Ã¥°¤ò²Äǽ¤Ë¤¹¤ë¾ì¹ç¡¢
- @code{run --one-thread} ¤ò»ÈÍѤ·¤Ê¤¯¤Æ¤Ï¤Ê¤ê¤Þ¤»¤ó¡£
-¤³¤Î¾ì¹ç¡¢°ìÅ٤ˤ¿¤À°ì¤Ä¤Îactive¤Ê¥¹¥ì¥Ã¥É¤À¤±¤ò»ý¤Ä¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
-
-It's very hard to debug @strong{MySQL} under @code{gdb} if you do a lot of
-new connections the whole time as @code{gdb} doesn't free the memory for
-old threads. You can avoid this problem by starting @code{mysqld} with
-@code{-O thread_cache_size= 'max_connections +1'}. In most cases just
-using @code{-O thread_cache_size= 5'} will help a lot!
-
-¤â¤· Linux ¾å¤Ç gdb 4.17.x ¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Ê¤é¡¢ @file{.gdb} ¥Õ¥¡¥¤¥ë¤ò
-¤¤¤«¤Ë¤·¤¿¤¬¤Ã¤Æ¡¢¥«¥ì¥ó¥È¤Î¥Ç¥£¥ì¥¯¥È¥ê¡¼¤Ë¥¤¥ó¥¹¥È¡¼¥ë¤¹¤Ù¤­¤Ç¤¹¡§
-
-@example
-set print sevenbit off
-handle SIGUSR1 nostop noprint
-handle SIGUSR2 nostop noprint
-handle SIGWAITING nostop noprint
-handle SIGLWP nostop noprint
-handle SIGPIPE nostop
-handle SIGALRM nostop
-handle SIGHUP nostop
-handle SIGTERM nostop noprint
-@end example
-
-If you have problems debugging threads with gdb, you should download
-gdb 5.x and try this instead. The new gdb version has very improved
-thread handling!
-
-°Ê²¼¤Ï mysqld ¤Î¥Ç¥Ð¥Ã¥°Îã¤Ç¤¹¡§
-
-@example
-shell> gdb /usr/local/libexec/mysqld
-gdb> run
-...
-back # mysqld ¤¬¥¯¥é¥Ã¥·¥å¤·¤¿ºÝ¡¢¤³¤ì¤ò¹Ô¤¤¤Þ¤¹
-info locals
-up
-info locals
-up
-...
-(until you get some information about local variables)
-
-quit
-@end example
-
-¾åµ­¤Î½ÐÎϤò¡¢ @code{mysqlbug} ¤ÇºîÀ®¤·¤¿¥á¡¼¥ë¤Ë´Þ¤ß¡¢
-¤½¤·¤Æ @code{mysql@@lists.mysql.com}. ¤ËÁ÷¤Ã¤Æ¤¯¤À¤µ¤¤¡£
-
-¤â¤· @code{mysqld} ¤¬¥Ï¥ó¥°¤¹¤ë¤Ê¤é¡¢
- @code{strace} ¤ä @code{/usr/proc/bin/pstack} ¤Î¤è¤¦¤Ê
-¥·¥¹¥Æ¥à¥Ä¡¼¥ë¤ò»ÈÍѤ·¤Æ @code{mysqld} ¤¬¤É¤³¤Ç¥Ï¥ó¥°¤·¤Æ¤¤¤ë¤«
-Ä´¤Ù¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£
-
-¤â¤· @code{mysqld} ¤¬ CPU ¤ä ¥á¥â¥ê¡¼ ¤ò¿©¤¤»Ï¤á¤¿¤ê¡¢``¥Ï¥ó¥°'' ¤·¤¿¤ê¤¹¤ë¤Ê¤é¡¢
- @code{mysqladmin processlist status} ¤ò»ÈÍѤ·¤Æ狼¤¬Â¿¤¯¤Î»þ´Ö¤Î¤«¤«¤ë
-¥¯¥¨¥ê¤ò¼Â¹Ô¤·¤Æ¤¤¤ë¤«³Î¤«¤á¤ë¤³¤È¤¬½ÐÍè¤Þ¤¹¡£
-¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤ÎÌäÂê¤ä¿·¤·¤¤¥¯¥é¥¤¥¢¥ó¥È¤¬Àܳ¤Ç¤­¤Ê¤¤¤È¤­¤ÎÌäÂê¤È
-¤â¤·¤¢¤Ê¤¿¤¬¹Í¤¨¤ë¤Ê¤é¡¢
-¤¤¤¯¤Ä¤«¤Î¥¦¥¤¥ó¥É¥¦¤Ç @code{mysqladmin -i10 processlist status} ¤ò
-¼Â¹Ô¤¹¤ë¤Î¤Ï¤è¤¤¹Í¤¨¤Ç¤·¤ç¤¦¡£
-
-¤â¤· @code{mysqld} ¤¬»à¤ó¤À¤ê¥Ï¥ó¥°¤·¤¿¤ê¤¹¤ë¤Ê¤é¡¢ @code{mysqld} ¤ò
-@code{--log} ¤Çµ¯Æ°¤¹¤Ù¤­¤Ç¤¹¡£ ºÆ¤Ó @code{mysqld} ¤¬»à¤ó¤À¤é¡¢
-¤¢¤Ê¤¿¤Ï¥í¥°¥Õ¥¡¥¤¥ëÃæ¤Î¡¢ @code{mysqld} ¤ò kill ¤¹¤ë¥¯¥¨¥ê¤ò¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£
-@code{mysqld} ¤ò @code{--log} ¥ª¥×¥·¥ç¥ó¤Çµ¯Æ°¤¹¤ëÁ°¤Ë¡¢
-Á´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤ò @code{myisamchk} ¤Ç¥Á¥§¥Ã¥¯¤¹¤Ù¤­¤Ç¤¹¡£
-¡ÊÁ°¤Î¥¯¥é¥Ã¥·¥å»þ¤Ë¥Æ¡¼¥Ö¥ë¤¬²õ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¤Î¤Ç¡Ë
-@xref{Maintenance}.
-
-¤â¤· @code{mysqld --log} ¤Ç¥í¥°¥Õ¥¡¥¤¥ë¤ò»ÈÍѤ¹¤ë¤Ê¤é¡¢'hostname' ¥í¥°¥Õ¥¡¥¤¥ë¡¢
-¤³¤ì¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤Ë¤¢¤ê¤Þ¤¹¤¬¡¢¤³¤ì¤ò¥Á¥§¥Ã¥¯¤·¡¢ÌäÂê¤ò°ú¤­µ¯¤³¤¹¥¯¥¨¥ê
-¤ò¸«¤Ä¤±¤Þ¤¹¡£
-mysqld ¤¬Å¬Àڤ˥¤¥ó¥Ç¥Ã¥¯¥¹¤ò»ÈÍѤ¹¤ë¤Î¤Ë»þ´Ö¤¬¤È¤Æ¤â¤«¤«¤ëÁ´¤Æ¤Î @code{SELECT} ʸ¤ò
- @code{EXPLAIN} ¤Ç¼Â¹Ô¤¹¤ë¤³¤È¤ò»î¤ß¤Þ¤¹¡£ @xref{EXPLAIN, , @code{EXPLAIN}}.
-¤Þ¤¿¡¢@code{mysql} ¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ç¤Ï½ÐÍè¤Ê¤«¤Ã¤¿¡¢Ê£»¨¤Ê¥¯¥¨¥ê¤â¥Æ¥¹¥È¤¹¤Ù¤­¤Ç¤¹¡£
-
-¤â¤·¥¨¥é¡¼¥í¥°¥Õ¥¡¥¤¥ë(@file{hostname.err})Ãæ¤Ë @code{mysqld restarted} ¤È¤¤¤¦Ê¸¤¬¤¢¤ë¤Ê¤é¡¢
-@code{mysqld} ¤ò¼ºÇÔ¤µ¤»¤ë¥¯¥¨¥ê¤ò¸«¤Ä¤±¤Þ¤¹¡£
-¤â¤·¤³¤ì¤¬µ¯¤­¤ë¤Ê¤é¡¢@code{myisamchk} (@pxref{Maintenance}) ¤ÇÁ´¤Æ¤Î¥Æ¡¼¥Ö¥ë¤ò¥Á¥§¥Ã¥¯¤·¡¢
-@strong{MySQL} ¥í¥°¥Õ¥¡¥¤¥ë¤Ë¤¢¤ë¤½¤Î¥¯¥¨¥ê¤ò¥Æ¥¹¥È¤¹¤Ù¤­¤Ç¤¹¡£
-¤â¤·¤½¤Î¤è¤¦¤Ê¥¯¥¨¥ê¤ò¤ß¤Ä¤±¤¿¤Ê¤é¡¢¤Þ¤ººÇ½é¤ËºÇ¿·¤Î @strong{MySQL} ¤Ë¥¢¥Ã¥×¥°¥ì¡¼¥É
-¤·¤Æ¤ß¤Æ¤¯¤À¤µ¤¤¡£ ¤â¤·¤½¤ì¤Ç¤â¤À¤á¤Ç¡¢¤«¤Ä @code{mysql} ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤Î
-¥¢¡¼¥«¥¤¥Ö¤Ë¤â¤Ê¤Ë¤â¸«¤Ä¤±¤ë¤³¤È¤¬½ÐÍè¤Ê¤«¤Ã¤¿¤Ê¤é¡¢ @email{mysql@@lists.mysql.com} ¤Ë
-¥Ð¥°¥ì¥Ý¡¼¥È¤ò½Ð¤¹¤Ù¤­¤Ç¤¹¡£ ¥á¡¼¥ê¥ó¥°¥ê¥¹¥È¤Î¥¢¡¼¥«¥¤¥Ö¤Ø¤Î¥ê¥ó¥¯¤Ï
-@uref{http://www.mysql.com/doc.html, @strong{MySQL} documentation page}.
-
-¤â¤·ÉÔÀµ¤Ê¥Æ¡¼¥Ö¥ë¤ò¤¨¤¿¤ê¡¢ @code{mysqld} ¤¬¾ï¤Ë¤¤¤¯¤Ä¤«¤Î update ¥³¥Þ¥ó¥É¤Ç
-¼ºÇÔ¤¹¤ë¤Ê¤é¡¢°Ê²¼¤Î¤è¤¦¤Ë¤·¤Æ¤³¤Î¥Ð¥°¤ÎºÆ¸½¤ò¥Æ¥¹¥È¤·¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-mysqld daemon Ää»ß (@code{mysqladmin shutdown} ¤Ç)
-@item
-@code{myisamchk -s database/*.MYI} ¤ÇÁ´¥Æ¡¼¥Ö¥ë¤ò¥Á¥§¥Ã¥¯.
-@code{myisamchk -r database/table.MYI} ¤Ç°­¤¤¥Æ¡¼¥Ö¥ë¤ò½¤Àµ¡£
-@item
-@code{mysqld} ¤ò @code{--log-update} ¤Ç¥¹¥¿¡¼¥È. @xref{Update log}.
-@item
-²õ¤ì¤¿¥Æ¡¼¥Ö¥ë¤òÆÀ¤¿»þ¡¢@code{mysqld server} ¤òÄä»ß¡£
-@item
-¥Ð¥Ã¥¯¥¢¥Ã¥×¤ò¥ê¥¹¥È¥¢
-@item
-@code{mysqld} server ¤ò @code{--log-update} @strong{¤Ê¤·¤Ç} µ¯Æ°¡£
-@item
-@code{mysql < update-log} ¤ÇºÆ¼Â¹Ô¡£ update log ¤Ï
-@strong{MySQL} ¥Ç¡¼¥¿¥Ù¡¼¥¹¥Ç¥£¥ì¥¯¥È¥ê¤Ë
-@code{your-hostname.#} ¤È¤¤¤¦Ì¾Á°¤ÇÊݸ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£
-@item
-¤³¤ì¤Ç¤â¤·ºÆ¤Ó¥Æ¡¼¥Ö¥ë¤¬¤ª¤«¤·¤¯¤Ê¤ë¤Ê¤é¡¢ @code{ISAM} ¥³¡¼¥ÉÃæ¤Î
-ºÆ¸½²Äǽ¤Ê¥Ð¥°¤ò¸«¤Ä¤±¤¿¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡ª
-¤³¤Î¥Æ¡¼¥Ö¥ë¤È update log ¤ò @uref{ftp://www.mysql.com/pub/mysql/secret} ¤Ë
-FTP ¤Ç put ¤·¤Þ¤¹¡£ ¤ï¤ì¤ï¤ì¤Ï¤³¤ì¤ò¤Ç¤­¤ë¸Â¤ê®¤¯½¤Àµ¤·¤Þ¤¹¡ª
-@end itemize
-
-@code{mysqladmin debug} ¥³¥Þ¥ó¥É¤Ï»ÈÍÑÃæ¤Î¥í¥Ã¥¯¡¢»ÈÍѤ·¤Æ¤¤¤ë¥á¥â¤ê¡¢
-¥¯¥¨¥ê¤Î»ÈÍѤξðÊó¤ò¡¢mysql ¥í¥°¥Õ¥¡¥¤¥ë¤Ë¤¤¤¯¤Ä¤«¥À¥ó¥×¤·¤Þ¤¹
-¤³¤ì¤Ï¤¤¤¯¤Ä¤«¤ÎÌäÂê²ò·è¤ËÌòΩ¤Á¤Þ¤¹¡£ ¤³¤Î¥³¥Þ¥ó¥É¤Ï¡¢ @strong{MySQL} ¤ò
-¥Ç¥Ð¥Ã¥°²Äǽ¤Ç¥³¥ó¥Ñ¥¤¥ë¤·¤Æ¤¤¤Ê¤¯¤Æ¤â¡¢¤¤¤¯¤Ä¤«¤ÎÌòΩ¤Ä¾ðÊó¤âÄ󶡤·¤Þ¤¹¡£
-
-¤¤¤¯¤Ä¤«¤Î¥Æ¡¼¥Ö¥ë¤Ç¤À¤ó¤À¤óÃÙ¤¯¤Ê¤ëÌäÂê¤Ç¤¢¤ë¤Ê¤é¡¢ @code{OPTIMIZE TABLE} ¤«
-@code{myisamchk} ¤Ç¥Æ¡¼¥Ö¥ë¤ò½¤Éü¤·¡¢ºÇŬ²½¤ò»î¤ß¤ë¤Ù¤­¤Ç¤¹¡£
-ÃÙ¤¤¥¯¥¨¥ê¤Ï¡¢ @code{EXPLAIN} ¤Ç¤â¥Á¥§¥Ã¥¯¤Ç¤­¤Þ¤¹¡£
-@xref{Maintenance}.
-
-¤³¤Î¥Þ¥Ë¥å¥¢¥ë¤Î OS ¸ÇÍ­¤ÎÌäÂê ¤ÎÀá¤âÆɤà¤Ù¤­¤Ç¤¹¡£
-@xref{Source install system issues}.
-
-@findex DBI->trace
-@findex trace DBI method
-@tindex DBI_TRACE environment variable
-@tindex Environment variable, DBI_TRACE
-¤â¤· Perl @code{DBI} ¤ò»ÈÍѤ·¤Æ¤¤¤ë¤Ê¤é¡¢
- @code{trace} ¥á¥½¥Ã¥É¡¢¤¢¤ë¤¤¤Ï@code{DBI_TRACE} ´Ä¶­ÊÑ¿ô¤Ç
-¥Ç¥Ð¥Ã¥°¾ðÊó¤òÍ­¸ú¤Ë¤Ç¤­¤Þ¤¹¡£
-@xref{Perl DBI Class, , Perl @code{DBI} Class}.
-
-@node Debugging client, RTS-threads, Debugging server, Porting
-@appendixsec Debugging a MySQL client
-
-To be able to debug a @strong{MySQL} client with the integrated debug package,
-you should configure @strong{MySQL} with @code{--with-debug}.
-@xref{configure options}.
-
-@tindex MYSQL_DEBUG environment variable
-@tindex Environment variable, MYSQL_DEBUG
-Before running a client, you should set the @code{MYSQL_DEBUG} environment
-variable:
-
-@example
-shell> MYSQL_DEBUG=d:t:O,/tmp/client.trace
-shell> export MYSQL_DEBUG
-@end example
-
-This causes clients to generate a trace file in @file{/tmp/client.trace}.
-
-If you have problems with your own client code, you should attempt to
-connect to the server and run your query using a client that is known to
-work. Do this by running @code{mysql} in debugging mode (assuming you
-have compiled @strong{MySQL} with debugging on):
-
-@example
-shell> mysql --debug=d:t:O,/tmp/client.trace
-@end example
-
-This will provide useful information in case you mail a bug report.
-@xref{Bug reports}.
-
-If your client crashes at some 'legal' looking code, you should check
-that your @file{mysql.h} include file matches your mysql library file.
-A very common mistake is to use an old @file{mysql.h} file from an old
-@strong{MySQL} installation with new @strong{MySQL} library.
-
-@node RTS-threads, Thread packages, Debugging client, Porting
-@appendixsec Comments about RTS threads
-
-I have tried to use the RTS thread packages with @strong{MySQL} but
-stumbled on the following problems:
-
-They use an old version of a lot of POSIX calls and it is very tedious to
-make wrappers for all functions. I am inclined to think that it would
-be easier to change the thread libraries to the newest POSIX
-specification.
-
-Some wrappers are already written. See @file{mysys/my_pthread.c} for more info.
-
-At least the following should be changed:
-
-@code{pthread_get_specific} should use one argument.
-@code{sigwait} should take two arguments.
-A lot of functions (at least @code{pthread_cond_wait},
-@code{pthread_cond_timedwait})
-should return the error code on error. Now they return -1 and set @code{errno}.
-
-Another problem is that user-level threads use the @code{ALRM} signal and this
-aborts a lot of functions (@code{read}, @code{write}, @code{open}...).
-@strong{MySQL} should do a retry on interrupt on all of these but it is
-not that easy to verify it.
-
-The biggest unsolved problem is the following:
-
-To get thread-level alarms I changed @file{mysys/thr_alarm.c} to wait between
-alarms with @code{pthread_cond_timedwait()}, but this aborts with error
-@code{EINTR}. I tried to debug the thread library as to why this happens,
-but couldn't find any easy solution.
-
-If someone wants to try @strong{MySQL} with RTS threads I suggest the
-following:
-
-@itemize @bullet
-@item
-Change functions @strong{MySQL} uses from the thread library to POSIX.
-This shouldn't take that long.
-@item
-Compile all libraries with the @code{-DHAVE_rts_threads}.
-@item
-Compile @code{thr_alarm}.
-@item
-If there are some small differences in the implementation, they may be fixed
-by changing @file{my_pthread.h} and @file{my_pthread.c}.
-@item
-Run @code{thr_alarm}. If it runs without any ``warning'', ``error'' or aborted
-messages, you are on the right track. Here follows a successful run on
-Solaris:
-@example
-Main thread: 1
-Tread 0 (5) started
-Thread: 5 Waiting
-process_alarm
-Tread 1 (6) started
-Thread: 6 Waiting
-process_alarm
-process_alarm
-thread_alarm
-Thread: 6 Slept for 1 (1) sec
-Thread: 6 Waiting
-process_alarm
-process_alarm
-thread_alarm
-Thread: 6 Slept for 2 (2) sec
-Thread: 6 Simulation of no alarm needed
-Thread: 6 Slept for 0 (3) sec
-Thread: 6 Waiting
-process_alarm
-process_alarm
-thread_alarm
-Thread: 6 Slept for 4 (4) sec
-Thread: 6 Waiting
-process_alarm
-thread_alarm
-Thread: 5 Slept for 10 (10) sec
-Thread: 5 Waiting
-process_alarm
-process_alarm
-thread_alarm
-Thread: 6 Slept for 5 (5) sec
-Thread: 6 Waiting
-process_alarm
-process_alarm
-
-...
-thread_alarm
-Thread: 5 Slept for 0 (1) sec
-end
-@end example
-@end itemize
-
-@node Thread packages, , RTS-threads, Porting
-@appendixsec ¥¹¥ì¥Ã¥É¥Ñ¥Ã¥±¡¼¥¸´Ö¤Î°ã¤¤¤Ï²¿¡©
-
-@strong{MySQL} ¤Ï»ÈÍѤµ¤ì¤ë¥¹¥ì¥Ã¥É¥Ñ¥Ã¥±¡¼¥¸¤ËÈó¾ï¤Ë°Í¸¤·¤Æ¤¤¤Þ¤¹¡£
-¤½¤Î¤¿¤á¡¢@strong{MySQL} ¤ËÎɤ¤¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¤òÁªÂò¤¹¤ë»þ¤Ë¤Ï¡¢
-¥¹¥ì¥Ã¥É¥Ñ¥Ã¥±¡¼¥¸¤¬Èó¾ï¤Ë½ÅÍפǤ¹¡£
-
-¾¯¤Ê¤¯¤È¤â3¤Ä¤Î¥¿¥¤¥×¤Î¥¹¥ì¥Ã¥É¥Ñ¥Ã¥±¡¼¥¸¤¬¤¢¤ê¤Þ¤¹¡§
-
-@itemize @bullet
-@item
-¥·¥ó¥°¥ë¥×¥í¥»¥¹Æâ¤Î¥æ¡¼¥¶¥¹¥ì¥Ã¥É¡£
-¥¹¥ì¥Ã¥ÉÀÚÂؤ¨¤Ï¥¢¥é¡¼¥à¤Ç´ÉÍý¤µ¤ì¡¢
-¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¤Ï¥í¥Ã¥¯¤òȼ¤¦Èó¥¹¥ì¥Ã¥É°ÂÁ´´Ø¿ô¤Î¤¹¤Ù¤Æ¤ò´ÉÍý¤·¤Þ¤¹¡£
-Æ°ºîÃ楹¥ì¥Ã¥É¤¬¥Ç¡¼¥¿¤òÂÔ¤ÄɬÍפ¬¤¢¤ë¾ì¹ç¡¢read, write ¤½¤·¤Æ select ¤Ï¡¢
-Ä̾¾¤Î¥¹¥ì¥Ã¥É¤ËÀÚÂؤ¨¤ë¥¹¥ì¥Ã¥É¸ÇÍ­¤Î select ¤Ç´ÉÍý¤µ¤ì¤Þ¤¹¡£
-¤â¤·¥æ¡¼¥¶¡¦¥¹¥ì¥Ã¥É¥Ñ¥Ã¥±¡¼¥¸¤¬É¸½à¥é¥¤¥Ö¥é¥ê (FreeBSD ¤È BSDI ¥¹¥ì¥Ã¥É) ¤Ë
-Åý¹ç¤µ¤ì¤Æ¤¤¤ë¤Ê¤é¡¢¥¹¥ì¥Ã¥É¥Ñ¥Ã¥±¡¼¥¸¤Î¥ª¡¼¥Ð¡¼¥Ø¥Ã¥É¤Ï¡¢Á´¤Æ¤ÎÈó°ÂÁ´¥³¡¼¥ë¤ò
-¥Þ¥Ã¥×¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¥¹¥ì¥Ã¥É¥Ñ¥Ã¥±¡¼¥¸(MIT-¥¹¥ì¥Ã¥É, FSU-¥¹¥ì¥Ã¥É, RTS ¥¹¥ì¥Ã¥É)
-¤è¤ê¤â¾¯¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£
-¾¤Î´Ä¶­(Î㤨¤Ð SCO)¤Ç¤Ï¡¢Á´¤Æ¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥¹¥ì¥Ã¥É°ÂÁ´¤Ê¤Î¤Ç¡¢
-¥Þ¥Ã¥Ô¥ó¥°¤Ï¤È¤Æ¤â´Êñ¤Ë¹Ô¤Ê¤ï¤ì¤Þ¤¹(SCO ¾å¤Î FSU-¥¹¥ì¥Ã¥É)¡£
-Downside: Á´¤Æ¤Î¥Þ¥Ã¥×¤µ¤ì¤ë¥³¡¼¥ë¤Ï¾¯¤·»þ´Ö¤¬¤«¤«¤ê¡¢Á´¤Æ¤Î¾õ¶·¤ò
-½èÍý²Äǽ¤Ë¤¹¤ë¤³¤È¤Ï¡¢¤È¤Æ¤âº¤Æñ¤Ç¤¹¡£
-Ä̾¥¹¥ì¥Ã¥É¥Ñ¥Ã¥±¡¼¥¸¤Ë¤è¤Ã¤Æ½èÍý¤Ç¤­¤Ê¤¤¥·¥¹¥Æ¥à¥³¡¼¥ë¤¬¤¤¤¯¤Ä¤«¤¢¤ê¤Þ¤¹
-(MIT-¥¹¥ì¥Ã¥É¤È¥½¥±¥Ã¥È¤Î¤è¤¦¤Ë)¡£ ¥¹¥ì¥Ã¥É¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¤Ï¾ï¤ËºÇ
-Ŭ¤È¤¤¤¦¤ï¤±¤Ç¤Ï¤¢ ¤ê¤Þ¤»¤ó¡£
-@item
-ÊÌ¤Î¥×¥í¥»¥¹¤Ê¤¤¤Î¥æ¡¼¥¶¥¹¥ì¥Ã¥É¡£
-¥¹¥ì¥Ã¥ÉÀÚÂؤ¨¤Ï¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ¹Ô¤Ê¤ï¤ì¡¢Á´¤Æ¤Î¥Ç¡¼¥¿¤Ï¥¹¥ì¥Ã¥É´Ö¤Ç¶¦Í­¤µ¤ì¤Þ¤¹¡£
-¥¹¥ì¥Ã¥É¥Ñ¥Ã¥±¡¼¥¸¤Ï¡¢¥¹¥ì¥Ã ¥É´Ö¤Î¥Ç¡¼¥¿¶¦Í­¤òµö²Ä¤¹¤ë¤¿¤á¤Ëɸ½à¥¹¥ì¥Ã¥É¥³¡¼¥ë¤ò´ÉÍý¤·¤Þ¤¹¡£
-LinuxThreads ¤Ï¤³¤ÎÊýË¡¤ò»ÈÍѤ·¤Æ¤¤¤Þ¤¹¡£
-Downside: ¿¤¯¤Î¥×¥í¥»¥¹¡£¥¹¥ì¥Ã¥ÉÀ¸À®¤ÏÃÙ¤¤¤Ç¤¹¡£
-¤â¤·°ì¤Ä¤Î¥¹¥ì¥Ã¥É¤¬»à¤Ì¤È¡¢»Ä¤ê¤ÏÄ̾ï¥Ï¥ó¥°¤·¤Æ»Ä¤ê¡¢ºÆµ¯Æ°Á°¤Ë ¤½¤ì¤éÁ´¤Æ
-¤ò kill ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£¥¹¥ì¥Ã¥ÉÀÚÂؤ¨¤Ï¤¤¤¯¤é¤«¹â²Á(expensive)¤Ç¤¹¡£
-@item
-¥«¡¼¥Í¥ë¥¹¥ì¥Ã¥É¡£
-¥¹¥ì¥Ã¥ÉÀÚÂؤ¨¤Ï¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¤«¥«¡¼¥Í¥ë¤Ë¤è¤Ã¤Æ½èÍý¤µ¤ì¡¢
-¤È¤Æ¤â®¤¤¤Ç¤¹¡£ Á´¤Æ¤Ï°ì¤Ä¤Î¥×¥í¥»¥¹Æâ¤Ç¹Ô¤Ê¤ï¤ì¤Þ¤¹¤¬¡¢
-¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢@code{ps} ¤¬°Û¤Ê¤Ã¤¿¥¹¥ì¥Ã¥É¤ò¼¨¤·¤Þ¤¹¡£
-¤â¤·°ì¤Ä¤Î¥¹¥ì¥Ã¥É¤¬¥¢¥Ü¡¼¥È¤·¤¿¾ì¹ç¡¢¥×¥í¥»¥¹Á´ÂΤ¬¥¢¥Ü¡¼¥È¤·¤Þ¤¹¡£
-¿¤¯¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï¥¹¥ì¥Ã¥É°ÂÁ´¤Ç¡¢¥ª¡¼¥Ð¡¼¥Ø¥Ã¥É¤Ï¤È¤Æ¤â¾¯¤Ê¤¤¤Ç¤¹¡£
-Solaris, HP/UX, AIX ¤½¤·¤Æ OSF1 ¤¬¥«¡¼¥Í¥ë¥¹¥ì¥Ã¥É¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£
-@end itemize
-
-¤¤¤¯¤Ä¤«¤Î¥·¥¹¥Æ¥à¤Ç¤Ï¡¢¥«¡¼¥Í¥ë¥¹¥ì¥Ã¥É¤Ï¡¢¥·¥¹¥Æ¥à¥é¥¤¥Ö¥é¥êÆâ¤Ç¡¢
-¥æ¡¼¥¶¥ì¥Ù¥ë¥¹¥ì¥Ã¥É¤ÎÅý¹ç¤Ë¤è¤Ã¤Æ´ÉÍý¤µ¤ì¤Þ¤¹¡£
-¤³¤Î¾ì¹ç¡¢¥¹¥ì¥Ã¥ÉÀÚÂؤ¨¤Ï¥¹¥ì¥Ã¥É¥é¥¤¥Ö¥é¥ê¤Ë¤è¤Ã¤Æ¤À¤±¹Ô¤Ê¤ï¤ì¡¢
-¥«¡¼¥Í¥ë¤Ï¼ÂºÝ¤Ë¤Ï 'thread aware' ¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£
-
-
-@node Regexp, Unireg, Porting, Top
-@appendix MySQL ¤ÎÀµµ¬É½¸½¤Îʸˡ¤Ë¤Ä¤¤¤Æ
-
-A regular expression (regex) is a powerful way of specifying a complex search.
-
-@strong{MySQL} ¤ÏÀµµ¬É½¸½¤Î regular Henry Spencers ¼ÂÁõ¤ò»ÈÍѤ·¤Þ¤¹¡£
-¤½¤·¤Æ¤³¤ì¤Ï POSIX 1003.2 ¤Ë°ìÃפ¹¤ë¤³¤È¤¬
-ÌÜŪ¤Ç¤¹¡£@strong{MySQL} ¤Ï³ÈÄ¥ ¥Ð¡¼¥¸¥ç¥ó¤ò»ÈÍѤ·¤Þ¤¹¡£
-
-¤³¤ì¤Ï¾ÜºÙ¤ò¾Ê¤¤¤¿´Êñ¤Ê¥ê¥Õ¥¡¥ì¥ó¥¹¤Ç¤¹¡£
-¤µ¤é¤ËÀµ³Î¤Ê¾ðÊó¤Ï Henry Spencers @code{regex(7)} ¥Þ¥Ë¥å¥¢¥ë¤ò¸«¤Æ¤¯¤À¤µ¤¤¡£
-¤³¤ì¤Ï¥½¡¼¥¹ÇÛÉۤ˴ޤޤì¤Æ¤¤¤Þ¤¹¡£ @xref{Credits}.
-
-Àµµ¬É½¸½¤Ïʸ»úÎó¤ÎÁȤ߹ç¤ï¤»¤Æµ­½Ò¤µ¤ì¤Þ¤¹¡£
-¤â¤Ã¤È¤â´Êñ¤Ê¾ì¹ç¤Ï¡¢ÈóÆüìʸ»ú¤Î°ìʸ»ú¤Ç¤¹¡£Î㤨¤Ð¡¢
-regexp @code{hello} ¤Ï @code{hello} ¤ÈŬ¹ç¤·¡¢ ¾¤Ë¤ÏŬ¹ç¤·¤Þ¤»¤ó¡£
-
-´Êñ¤Ç¤Ê¤¤Àµµ¬É½¸½¤Ï¡¢1¤Ä¤Îʸ»úÎó°Ê¾å¤ËŬ¹ç¤Ç¤­¤ë¤è¤¦¤Ê¡¢¤¤¤¯¤Ä¤«¤Î
-Æüì¤Ê¹½À®¤ò»ÈÍѤ·¤Þ¤¹¡£Î㤨¤Ð¡¢regexp @code{hello|word} ¤Ï
-ʸ»úÎó @code{hello} ¤Èʸ»úÎó @code{word} ¤ËŬ¹ç¤·¤Þ¤¹¡£
-
-¤½¤·¤Æ¤µ¤é¤ËÊ£»¨¤ÊÎã regexp @code{B[an]*s} ¤Ï¡¢
-ʸ»úÎó @code{Bananas}, @code{Baaaaas}, @code{Bs} ¤Î¤É¤ì¤«¡¢
-¤½¤·¤Æ @code{B} ¤Ç»Ï¤Þ¤ê @code{a} ¤ä @code{n} ¤¬
-Ǥ°Õ¤Î¿ô³¤­¡¢@code{s} ¤Ç½ª¤ï¤ë¤è¤¦¤Ê¾¤Îʸ»úÎó¤ËŬ¹ç¤·¤Þ¤¹¡£
-
-Àµµ¬É½¸½¤Ç¤Ï¡¢¼¡¤ÎÆüìʸ»ú/¹½À®¤¬»ÈÍѤǤ­¤Þ¤¹¡§
-@table @code
-@item ^
-ʸ»úÎóÁ´ÂΤλϤޤꡣ
-@example
-mysql> select "fo\nfo" REGEXP "^fo$"; -> 0
-mysql> select "fofo" REGEXP "^fo"; -> 1
-@end example
-@item $
-ʸ»úÎóÁ´ÂΤνª¤ê¡£
-@example
-mysql> select "fo\no" REGEXP "^fo\no$"; -> 1
-mysql> select "fo\no" REGEXP "^fo$"; -> 0
-@end example
-@item .
-Ǥ°Õ¤Îʸ»ú (²þ¹Ô´Þ¤à)¡£
-@example
-mysql> select "fofo" REGEXP "^f.*"; -> 1
-mysql> select "fo\nfo" REGEXP "^f.*"; -> 1
-@end example
-@item a*
-0¸Ä°Ê¾å¤Îʸ»ú @code{a} ¤Îʤӡ£
-@example
-mysql> select "Ban" REGEXP "^Ba*n"; -> 1
-mysql> select "Baaan" REGEXP "^Ba*n"; -> 1
-mysql> select "Bn" REGEXP "^Ba*n"; -> 1
-@end example
-@item a+
-ʸ»ú @code{a} ¤¬ 1¸Ä°Ê¾åʤ֡£
-@example
-mysql> select "Ban" REGEXP "^Ba+n"; -> 1
-mysql> select "Bn" REGEXP "^Ba+n"; -> 0
-@end example
-@item a?
-0 ¤Þ¤¿¤Ï 1¸Ä¤Îʸ»ú @code{a}¡£
-@example
-mysql> select "Bn" REGEXP "^Ba?n"; -> 1
-mysql> select "Ban" REGEXP "^Ba?n"; -> 1
-mysql> select "Baan" REGEXP "^Ba?n"; -> 0
-@end example
-@item de|abc
-@code{de} ¤« @code{abc} ¤Ë¥Þ¥Ã¥Á¡£
-@example
-mysql> select "pi" REGEXP "pi|apa"; -> 1
-mysql> select "axe" REGEXP "pi|apa"; -> 0
-mysql> select "apa" REGEXP "pi|apa"; -> 1
-mysql> select "apa" REGEXP "^(pi|apa)$"; -> 1
-mysql> select "pi" REGEXP "^(pi|apa)$"; -> 1
-mysql> select "pix" REGEXP "^(pi|apa)$"; -> 0
-@end example
-@item (abc)*
-ʸ»úÎó @code{abc} ¤Î 0 ²ó°Ê¾å¤ÎʤӤ˥ޥåÁ¡£
-@example
-mysql> select "pi" REGEXP "^(pi)*$"; -> 1
-mysql> select "pip" REGEXP "^(pi)*$"; -> 0
-mysql> select "pipi" REGEXP "^(pi)*$"; -> 1
-@end example
-@item @{1@}
-@itemx @{2,3@}
-¿¤¯¤ÎȯÀ¸¤ËŬ¹ç¤¹¤ë regexp ¤Îµ­½Ò¤¹¤ë°ìÈÌŪ¤ÊÊýË¡¡£
-The is a more general way of writing regexps that match many
-occurrences of the previous atom.
-@table @code
-@item a*
-Can be written as @code{a@{0,@}}.
-@item a+
-Can be written as @code{a@{1,@}}.
-@item a?
-Can be written as @code{a@{0,1@}}.
-@end table
-¤µ¤é¤ËÀµ³Î¤Ë¤Ï¡¢1¤Ä¤ÎÀ°¿ô i ¤È¥³¥ó¥Þ̵¤·¤ò´Þ¤à½¤¾þ¤¬Â³¤¯¥¢¥È¥à¤Ï¡¢
-¸·Ì©¤Ë¥¢¥È¥à¤ËŬ¹ç¤¹¤ë @code{i} ²ó¤ÎʤӤËŬ¹ç¤·¤Þ¤¹¡£
-À°¿ô @code{i} ¤È¥³¥ó¥Þ¤ò´Þ¤à½¤¾þ¤¬Â³¤¯¥¢¥È¥à¤Ï¡¢
-¥¢¥È¥à¤ËŬ¹ç¤¹¤ë @code{i} ²ó°Ê¾å¤ÎʤӤËŬ¹ç¤·¤Þ¤¹¡£
-À°¿ô @code{i} ¤È @code{j} ¤ò´Þ¤àÁõ¾þ¤¬Â³¤¯¥¢¥È¥à¤Ï¡¢
-¥¢¥È¥à¤ËŬ ¹ç¤¹¤ë @code{i} ²ó¤«¤é @code{j} ²ó¤Þ¤Ç¤ÎʤӤËŬ¹ç¤·¤Þ¤¹¡£
-
-ξÊý¤Î°ú¿ô¤Ï @code{0 >= value <= RE_DUP_MAX (default 255)} ¤Ç¤Ê¤¤¤È¤¤ ¤±¤Þ¤»¤ó¡£
-¤½¤·¤Æ¡¢2¤Ä¤¢¤ë¾ì¹ç¡¢2ÈÖÌܤÏ1ÈÖÌܤè¤ê¤âÂ礭¤¤¤«Æ±¤¸¤Ç¤Ê¤¤¤È¤¤¤±¤Þ¤»¤ó¡£
-@item [a-dX]
-@itemx [^a-dX]
-@code{a}, @code{b}, @code{c}, @code{d}, @code{X} ¤Î¤É¤ì¤«¤Îʸ»ú
- (@code{^} ¤ò»ÈÍѤ¹¤ë¤È¤É¤ì¤Ç¤â¤Ê¤¤Ê¸»ú) ¤Ë¥Þ¥Ã¥Á¡£
-@code{]} ʸ»ú¤ò´Þ¤á¤ë¤Ë¤Ï¡¢ @code{[} ¤Î¤¢¤È¤Ë³¤¤¤Æ¤¹¤°¤Ë½ñ¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£
-
-@code{-} ʸ»ú¤ò´Þ¤á¤ë¤Ë¤ÏºÇ½é¤«ºÇ¸å¤Ë½ñ¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹¡£
-@code{[0-9]} ¤ÏǤ°Õ ¤Î10¿Ê¿ôÃͤËŬ¹ç¤·¤Þ¤¹¡£ @code{[]} ¥Ú¥¢ÆâÉô¤ÎÄêµÁ¤µ¤ì¤¿
-°ÕÌ£¤ò»ý¤¿¤Ê¤¤Á´¤Æ¤Îʸ»ú¤Ï¡¢Æüì¤Ê°ÕÌ£¤ò»ý¤¿¤º¡¢¤½¤ì¼«¿È¤Ë¤À¤±Å¬¹ç¤·¤Þ¤¹¡£
-@example
-mysql> select "aXbc" REGEXP "[a-dXYZ]"; -> 1
-mysql> select "aXbc" REGEXP "^[a-dXYZ]$"; -> 0
-mysql> select "aXbc" REGEXP "^[a-dXYZ]+$"; -> 1
-mysql> select "aXbc" REGEXP "^[^a-dXYZ]+$"; -> 0
-mysql> select "gheis" REGEXP "^[^a-dXYZ]+$"; -> 1
-mysql> select "gheisa" REGEXP "^[^a-dXYZ]+$"; -> 0
-@end example
-@item [[.characters.]]
-¾È¹çÍ×ÁÇ(collating element)¤Îʸ»ú¤Îʤӡ£
-ʤӤϳç¸Ìɽ¸½¥ê¥¹¥È¤Î°ì¤Ä¤ÎÍ×ÁǤǤ¹¡£
-Ê£¿ôʸ»ú¤Î¾È¹çÍ×ÁǤò´Þ¤à³ç¸Ìɽ¸½¤Ï°ì¤Ä°Ê¾å¤Îʸ»ú¤ËŬ¹ç¤·¤Þ¤¹¡£
-Î㤨¤Ð¡¢¾È¹çʤӤ¬ @code{ch} ¾È¹çÍ×ÁǤò´Þ¤à¾ì¹ç¡¢
-Àµµ¬É½¸½ @code{[[.ch.]]*c} ¤Ï @code{chchcc} ¤ÎºÇ½é¤Î5ʸ»ú¤ËŬ¹ç¤·¤Þ¤¹¡£
-
-@item [=character_class=]
-ƱÅù¤Î¥¯¥é¥¹¡£¤½¤Î°ì¤Ä¤ÈÅù¤·¤¤Á´¤Æ¤Î¾È¹çÍ×ÁǤÎʸ»ú¤ÎʤӤòɽ¤·¤Þ¤¹¡£¤½¤ì¼«¿È¤â´Þ¤ß¤Þ¤¹¡£
-
-Î㤨¤Ð¡¢@code{o} ¤È @code{(+)} ¤¬Æ±Åù¥¯¥é¥¹¤Î¥á¥ó¥Ð¤Ç¤¢¤ë¾ì¹ç¡¢
- @code{[[=o=]]}, @code{[[=(+)=]]}, @code{[[=(+)=]]} ¤ÏÁ´¤ÆƱµÁ¸ì¤Ç¤¹¡£
-ƱÅù¥¯¥é¥¹¤ÏÈϰϤνªÎ»°ÌÃ֤ˤϤʤê¤Þ¤»¤ó¡£
-
-@item [:character_class:]
-³ç¸Ìɽ¸½¤ÎÆâÉô¤Ç¡¢@code{[:} ¤È @code{:]} ¤Ç³ç¤é¤ì¤¿Ê¸»ú¥¯¥é¥¹¤Î̾Á°¤Ï¡¢
-¤½¤Î¥¯¥é¥¹¤Ë°¤¹¤ëÁ´¤Æ¤Îʸ»ú¤Î¥ê¥¹¥È¤òɽ¤·¤Þ¤¹¡£É¸½àʸ»ú¥¯¥é¥¹Ì¾¤Ï:
-
-@multitable @columnfractions .33 .33 .33
-@item alnum @tab digit @tab punct
-@item alpha @tab graph @tab space
-@item blank @tab lower @tab upper
-@item cntrl @tab print @tab xdigit
-@end multitable
-
-¤³¤ì¤é¤Ï @code{ctype(3)} ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ëµ­ºÜ¤µ¤ì¤Æ¤¤¤ëʸ»ú¥¯¥é¥¹¤òɽ¤·¤Þ¤¹¡£
-¥í¥±¡¼¥ë¤¬Â¾¤Î¤òÄ󶡤¹¤ë¤³¤È¤â¤¢¤ê¤Þ¤¹¡£Ê¸»ú¥¯¥é¥¹¤ÏÈϰϤνªÎ»°ÌÃ֤Ȥ·¤Æ¤Ï»È¤¨¤Þ¤»¤ó¡£
-@example
-mysql> select "justalnums" REGEXP "[[:alnum:]]+"; -> 1
-mysql> select "!!" REGEXP "[[:alnum:]]+"; -> 0
-@end example
-
-@item [[:<:]]
-@itemx [[:>:]]
-¤½¤ì¤¾¤ì¡¢Ã±¸ì¤Î»Ï¤á¤È½ª¤ê¤Î¶õʸ»úÎó¤ËŬ¹ç¤·¤Þ¤¹¡£Ã±¸ì¤Ï¡¢Ã±¸ìʸ»ú¤¬Á°¸å
-¤Ë¤Ê¤¤Ã±¸ìʸ»ú¤ÎʤӤȤ·¤ÆÄêµÁ¤µ¤ì¤Þ¤¹¡£Ã±¸ìʸ»ú¤Ï alnum ʸ»ú
- (@code{ctype(3)} ¤ÇÄêµÁ¤µ¤ì¤Þ¤¹) ¤È²¼Àþ(underscore ¡¨ @code{_})¤Ç¤¹¡£
-@example
-mysql> select "a word a" REGEXP "[[:<:]]word[[:>:]]"; -> 1
-mysql> select "a xword a" REGEXP "[[:<:]]word[[:>:]]"; -> 0
-@end example
-@end table
-
-@example
-mysql> select "weeknights" REGEXP "^(wee|week)(knights|nights)$"; -> 1
-@end example
-
-@node Unireg, Public license, Regexp, Top
-@appendix UNIREG ¤È¤Ï²¿¤«¡©
-
-UNIREG ¤Ï²æ¡¹¤Î tty ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¥Ó¥ë¥À¤Ç¤¹¡£
-¤³¤ì¤Ï²æ¡¹¤Î (@strong{MySQL} ¤Ç»ÈÍѤµ¤ì¤ë) ISAM ¤Ø¤ÎÄã¥ì¥Ù¥ëÀܳ¤Ë»ÈÍѤ·¤Þ¤¹¡£
-¤³¤ì¤¬¤È¤Æ¤â®¤¤¤¿¤á¤Ç¤¹¡£¤³¤ì¤Ï 1979 ǯ¤«¤é (UNIX ¾å¤Ç C ¤Ï 1986 ǯ¤«¤é) ¸ºß¤·¤Æ¤¤¤Þ¤·¤¿¡£
-
-UNIREG ¤Ï¼¡¤Î¥³¥ó¥Ý¡¼¥Í¥ó¥È¤ò»ý¤Á¤Þ¤¹:
-
-@itemize @bullet
-@item
-°ì¤Ä¤Î¥Æ¡¼¥Ö¥ë¤Î»²¾È¡£¹¹¿·/¾È²ñ¤Ë¡£
-@item
-Ê£¿ô¤Î¥Æ¡¼¥Ö¥ë¤Î»²¾È (1¥¹¥¯¥í¡¼¥ëÈϰϤÇ)¡£
-@item
-¥Æ¡¼¥Ö¥ë¤ÎÀ¸À® (@strong{MySQL} ¤Ç¤ÏºîÀ®¤Ç¤­¤Ê¤¤Âô»³¤Î¹àÌÜ¥¿¥°¤Ç)¡£
-¤³¤ì¤Ï (tty ¤Ç ¤Î) WYSIWYG ¤Ç¤¹¡£¥¹¥¯¥ê¡¼¥ó¤È UNIREG ¥×¥í¥ó¥×¥È¤ò¹àÌܤ´¤È¤Ë¥Ç¥¶¥¤¥ó¤Ç¤­¤Þ¤¹¡£
-@item
-¥ì¥Ý¡¼¥ÈÀ¸À®¡£
-@item
-Âô»³¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£ (¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤Ø¤Î¥Æ¡¼¥Ö¥ë¤Î¹â®¥¨¥­¥¹¥Ý¡¼¥È/¥¤¥ó¥Ý¡¼ ¥È¡¢¥Æ¡¼¥Ö¥ëÆâÍƤβòÀÏ...)¡£
-@item
-¶¯ÎϤÊÊ£¿ô¥Æ¡¼¥Ö¥ë¤Î¹¹¿· (²æ¡¹¤ÏÉÑÈˤˤ³¤ì¤ò»ÈÍѤ·¤Þ¤¹)¡£
-BASIC ¤Ë»÷¤¿¸À¸ì¤Ç¿ ¤¯¤Îµ¡Ç½¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£
-@item
-ưŪ¤Ê¸À¸ì(¸½ºß¤Ï¥¹¥¦¥§¡¼¥Ç¥ó¸ì¤È¥Õ¥£¥ó¥é¥ó¥É¸ì)¡£
-狼¤¬±Ñ¸ì¥Ð¡¼¥¸¥ç¥ó¤òÍߤ·¤¤¤Î¤Ê¤é¡¢ËÝÌõ¤·¤Ê¤¤¤È¤¤¤±¤Ê¤¤¤¤¤¯¤Ä¤«¤Î¥Õ¥¡¥¤¥ë¤¬¤¢¤ê¤Þ¤¹¡£
-@item
-ÂÐÏÃŪ¤Ë¤Þ¤¿¤Ï¥Ð¥Ã¥Á¤Ç¹¹¿·¤ò¼Â¹Ô¤¹¤ëµ¡Ç½¡£
-@item
-Emacs ¤Ë»÷¤¿¥­¡¼ÄêµÁ¡£¥­¡¼¥Ü¡¼¥É¥Þ¥¯¥íÉÕ¤­¡£
-@item
-Á´Éô¤Ç 800k ¤Î¥Ð¥¤¥Ê¥ê¡£
-@item
-@code{convform} ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¡£°Û¤Ê¤ëʸ»ú¥»¥Ã¥È´Ö¤Ç @file{.frm} ¤È¥Æ¥­¥¹¥È¥Õ¥¡¥¤¥ë¤òÊÑ´¹¤·¤Þ¤¹¡£
-@item
-@code{mpack_isam} ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¡£ ISAM ¥Æ¡¼¥Ö¥ë¤ò¥Ñ¥Ã¥¯¤·¤Þ¤¹(50-80% ¾®¤µ¤¯¤Ç¤­¤Þ¤¹)¡£
-¤³¤Î¥Æ¡¼¥Ö¥ë¤ÏÉáÄ̤Υơ¼¥Ö¥ë¤ÈƱ¤¸¤è¤¦¤Ë @strong{MySQL} ¤ÇÆɤ߹þ¤ß¤Ç¤­¤Þ¤¹¡£
-1 ¥ì¥³¡¼ ¥É¤À¤±°µ½Ì²ò½ü / ¥¢¥¯¥»¥¹¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
-@code{BLOB} ¤ä @code{TEXT} ¹àÌܤÎÁàºî¤È¹¹¿·¤Ï(¤Þ¤À)¤Ç¤­¤Þ¤»¤ó¡£
-@end itemize
-
-²æ¡¹¤Ï¡¢UNIREG ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ç¿¤¯¤Î²æ¡¹¤ÎÀ½Éʥǡ¼¥¿¥Ù¡¼¥¹¤ò¹¹¿·¤·¡¢
-@strong{MySQL} (¤½¤·¤Æ¤¤¤¯¤Ä¤«¤ÎÆüì¤Ê¾ì¹ç¡¢UNIREG ¥ì¥Ý¡¼¥ÈÀ¸À®¥×¥í¥°¥é¥à) ¤òÄ̤·¤Æ
-Web ¥Ú¡¼¥¸¤òÄ󶡤·¤Þ¤¹¡£
-
-UNIREG ¤Ï 3M ¤Î¥Ç¥£¥¹¥¯Îΰè¤ò»ÈÍѤ·¡¢¾¯¤Ê¤¯¤È¤â¼¡¤Î¥×¥é¥Ã¥È¥Õ¥©¡¼¥à¾å¤ÇÆ°ºî¤·¤Þ¤¹:
- SUN OS 4.x, Solaris, Linux, HP/UX, ICL Unix, DNIX, SCO ¤½¤· ¤Æ MSDOS¡£
-
-UNIREG ¤Ï¸½ºß¥¹¥¦¥§¡¼¥Ç¥ó¸ì¤È¥Õ¥£¥ó¥é¥ó¥É¸ì¤Ç¤Î¤ßÍ­¸ú¤Ç¤¹¡£
-
-UNIREG ¤Î²Á³Ê¤Ï 10,000 ¥¹¥¦¥§¡¼¥Ç¥ó kr (Ìó 1500$ US) ¤Ç¤¹¡£
-¤¿¤À¤·¡¢¤³¤ì¤Ï¥µ¥Ý¡¼¥È¤ò´Þ¤ß¤Þ¤¹¡£ UNIREG ¤Ï¥Ð¥¤¥Ê¥ê¤ÇÇÛÉÛ¤µ¤ì¤Þ¤¹
- (¤·¤«¤·Á´¤Æ¤Î ISAM ¥½¡¼¥¹¤Ï @strong{MySQL} Æâ¤Ë¸«¤Ä¤±¤é¤ì¤Þ¤¹)¡£
-Ä̾²æ¡¹¤Ï¸ÜµÒ¤Î¥µ¥¤¥È¤Ë¤Æ¸ÜµÒÍѤ˥Х¤¥Ê¥ê¤ò¥³¥ó¥Ñ¥¤¥ë¤·¤Þ¤¹¡£
-
-¿·¤·¤¤³«È¯¤Ï @strong{MySQL} ¤Ë½¸Ã椷¤Æ¤¤¤Þ¤¹¡£
-
-@page
-@c This node name is special
-@node Public license, Win license, Unireg, Top
-@appendix The MySQL server license for non Microsoft operating systems
-
-@center @strong{MySQL FREE PUBLIC LICENSE}
-@center (Version 4, March 5, 1995)
-
-@center Copyright (C) 1995, 1996 TcX AB & MySQL Finland AB & Detron HB
-@center Stockholm SWEDEN, Helsingfors FINLAND and Uppsala SWEDEN
-@center All rights reserved.
-
-NOTE: This license is not the same as any of the GNU Licenses published
-by the Free Software Foundation. Its terms are substantially different
-from those of the GNU Licenses. If you are familiar with the GNU
-Licenses, please read this license with extra care.
-
-This License applies to the computer program known as "MySQL". The
-"Program", below, refers to such program, and a "work based on the
-Program" means either the Program or any derivative work of the Program,
-as defined in the United States Copyright Act of 1976, such as a
-translation or a modification. The Program is a copyrighted work whose
-copyright is held by TcX Datakonsult AB and MySQL Finland AB and Detron
-HB.
-
-This License does not apply when running "MySQL" on any Microsoft
-operating system. Microsoft operating systems include all versions of
-Microsoft Windows NT and Microsoft Windows.
-
-BY MODIFYING OR DISTRIBUTING THE PROGRAM (OR ANY WORK BASED ON THE
-PROGRAM), YOU INDICATE YOUR ACCEPTANCE OF THIS LICENSE TO DO SO, AND ALL
-ITS TERMS AND CONDITIONS FOR COPYING, DISTRIBUTING OR MODIFYING THE
-PROGRAM OR WORKS BASED ON IT. NOTHING OTHER THAN THIS LICENSE GRANTS
-YOU PERMISSION TO MODIFY OR DISTRIBUTE THE PROGRAM OR ITS DERIVATIVE
-WORKS. THESE ACTIONS ARE PROHIBITED BY LAW. IF YOU DO NOT ACCEPT THESE
-TERMS AND CONDITIONS, DO NOT MODIFY OR DISTRIBUTE THE PROGRAM.
-
-@enumerate
-@item
-Licenses.
-
-Licensor hereby grants you the following rights, provided that you
-comply with all of the restrictions set forth in this License and
-provided, further, that you distribute an unmodified copy of this
-License with the Program:
-
-@enumerate a
-@item
-You may copy and distribute literal (i.e., verbatim) copies of the
-Program's source code as you receive it throughout the world, in any
-medium.
-@item
-You may modify the Program, create works based on the Program and
-distribute copies of such throughout the world, in any medium.
-@end enumerate
-
-@item
-Restrictions.
-
-This license is subject to the following restrictions:
-@enumerate a
-@item
-Distribution of the Program or any work based on the Program by a
-commercial organization to any third party is prohibited if any payment is
-made in connection with such distribution, whether directly (as in payment
-for a copy of the Program) or indirectly (as in payment for some service
-related to the Program, or payment for some product or service that
-includes a copy of the Program "without charge"; these are only examples,
-and not an exhaustive enumeration of prohibited activities). However, the
-following methods of distribution involving payment shall not in and of
-themselves be a violation of this restriction:
-
-@enumerate A
-@item
-Posting the Program on a public access information storage and retrieval
-service for which a fee is received for retrieving information (such as
-an on-line service), provided that the fee is not content-dependent
-(i.e., the fee would be the same for retrieving the same volume of
-information consisting of random data).
-@item
-Distributing the Program on a CD-ROM, provided that the files containing
-the Program are reproduced entirely and verbatim on such CD-ROM, and
-provided further that all information on such CD-ROM be redistributable
-for non-commercial purposes without charge.
-@end enumerate
-@item
-Activities other than copying, distribution and modification of the
-Program are not subject to this License and they are outside its scope.
-Functional use (running) of the Program is not restricted, and any
-output produced through the use of the Program is subject to this
-license only if its contents constitute a work based on the Program
-(independent of having been made by running the Program).
-@item
-You must meet all of the following conditions with respect to the
-distribution of any work based on the Program:
-@enumerate A
-@item
-If you have modified the Program, you must cause your work to carry
-prominent notices stating that you have modified the Program's files and
-the date of any change;
-@item
-You must cause any work that you distribute or publish, that in whole or
-in part contains or is derived from the Program or any part thereof, to
-be licensed as a whole and at no charge to all third parties under the
-terms of this License;
-@item
-If the modified program normally reads commands interactively when run,
-you must cause it, at each time the modified program commences
-operation, to print or display an announcement including an appropriate
-copyright notice and a notice that there is no warranty (or else, saying
-that you provide a warranty). Such notice must also state that users
-may redistribute the Program only under the conditions of this License
-and tell the user how to view the copy of this License included with the
-Program. (Exception: if the Program itself is interactive but does not
-normally print such an announcement, your work based on the Program is
-not required to print an announcement.);
-@item
-You must accompany any such work based on the Program with the complete
-corresponding machine-readable source code, delivered on a medium
-customarily used for software interchange. The source code for a work
-means the preferred form of the work for making modifications to it.
-For an executable work, complete source code means all the source code
-for all modules it contains, plus any associated interface definition
-files, plus the scripts used to control compilation and installation of
-the executable code. However, the source code distributed need not
-include anything that is normally distributed (in either source or
-binary form) with the major components (compiler, kernel, and so on) of
-the operating system on which the executable runs, unless that component
-itself accompanies the executable code;
-@item
-If you distribute any written or printed material at all with the
-Program or any work based on the Program, such material must include
-either a written copy of this License, or a prominent written indication
-that the Program or the work based on the Program is covered by this
-License and written instructions for printing and/or displaying the copy
-of the License on the distribution medium;
-@item
-You may not impose any further restrictions on the recipient's
-exercise of the rights granted herein.
-
-If distribution of executable or object code is made by offering the
-equivalent ability to copy from a designated place, then offering
-equivalent ability to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source code along with the object code.
-@end enumerate
-@end enumerate
-@item
-Reservation of Rights.
-
-No rights are granted to the Program except as expressly set forth
-herein. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt otherwise
-to copy, modify, sublicense or distribute the Program is void, and will
-automatically terminate your rights under this License. However, parties
-who have received copies, or rights, from you under this License will not
-have their licenses terminated so long as such parties remain in full
-compliance.
-
-@item
-Other Restrictions.
-
-If the distribution and/or use of the Program is restricted in certain
-countries for any reason, Licensor may add an explicit geographical
-distribution limitation excluding those countries, so that distribution
-is permitted only in or among countries not thus excluded. In such case,
-this License incorporates the limitation as if written in the body of
-this License.
-
-@item
-Limitations.
-
-THE PROGRAM IS PROVIDED TO YOU "AS IS," WITHOUT WARRANTY. THERE IS NO
-WARRANTY FOR THE PROGRAM, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
-NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE
-ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH
-YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
-NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL LICENSOR, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE
-PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS
-OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR
-THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-@end enumerate
-
-@c This node name is special
-@node Win license, Function Index, Public license, Top
-@appendix The MySQL license for Microsoft operating systems
-
-@center @strong{MySQL shareware license for Microsoft operating systems}
-@center (Version 1, September 4, 1998)
-
-@center Copyright (C) 1998 TcX AB & MySQL Finland AB & Detron HB
-@center Stockholm SWEDEN, Helsingfors FINLAND and Uppsala SWEDEN
-@center All rights reserved.
-
-This License applies to the computer program known as "MySQL".
-
-This License applies when running MySQL on any Microsoft operating system.
-Microsoft operating systems include all versions of Microsoft Windows NT
-and Microsoft Windows.
-
-YOU SHOULD CAREFULLY READ THE FOLLOWING TERMS AND CONDITIONS BEFORE
-USING, COPYING OR DISTRIBUTING MySQL. BY USING, COPYING AND DISTRIBUTING
-MySQL, YOU INDICATE YOUR ACCEPTANCE OF THIS LICENSE TO DO SO, AND ALL
-ITS TERMS AND CONDITIONS FOR USING, COPYING AND DISTRIBUTING MySQL OR
-WORKS BASED ON IT. NOTHING OTHER THAN THIS LICENSE GRANTS YOU
-PERMISSION TO USE, COPY OR DISTRIBUTE MySQL OR ITS DERIVATIVE
-WORKS. THESE ACTIONS ARE PROHIBITED BY LAW. IF YOU DO NOT ACCEPT THESE
-TERMS AND CONDITIONS, DO NOT USE, COPY OR DISTRIBUTE MySQL.
-
-@enumerate
-@item
-Evaluation and License Registration.
-
-This is an evaluation version of MySQL for Win32. Subject to the terms
-below, you are hereby licensed to use MySQL for evaluation purposes
-without charge for a period of 30 days. If you use MySQL after the 30
-day evaluation period the registration and purchase of a MySQL license
-is required.
-
-The price for a MySQL license is currently 200 US dollars and email
-support starts from 200 US dollars/year. Quantity discounts are
-available. If you pay by credit card, the currency is EURO (The European
-Unions common currency) so the prices will differ slightly.
-
-The easiest way to register or find options about how to pay for MySQL
-is to use the license form at TcX's secure server at
-@uref{https://www.mysql.com/license.htmy}. This can be used also when
-paying with credit card over the Internet.
-
-Other applicable methods for paying are SWIFT payments, cheques and
-credit cards.
-
-Payment should be made to:
-
-@example
-Postgirot Bank AB
-105 06 STOCKHOLM, SWEDEN
-
-TCX DataKonsult AB
-BOX 6434
-11382 STOCKHOLM, SWEDEN
-
-SWIFT address: PGSI SESS
-Account number: 96 77 06 - 3
-@end example
-
-Specify: license and/or support and your name and email address.
-
-In Europe and Japan, EuroGiro (that should be cheaper) can be used to
-the same account.
-
-If you want to pay by cheque make it payable to "MySQL Finland AB" and
-mail it to the address below.
-
-@example
-TCX DataKonsult AB
-BOX 6434
-11382 STOCKHOLM, SWEDEN
-@end example
-For more information about commercial licensing, please contact:
-
-@example
-David Axmark
-Kungsgatan 65 B
-753 21 UPPSALA
-SWEDEN
-Voice Phone +46-18-10 22 80 GMT 9-21. Swedish and English spoken
-Fax +46-8-729 69 05 Email *much* preferred.
-E-Mail: mysql-licensing@@mysql.com
-@end example
-
-For more about the license prices and commercial support, like email
-support, please refer to the MySQL manual. @xref{Cost}. @xref{Support}.
-
-The use of MySQL or any work based on MySQL after the 30-day evaluation
-period is in violation of international copyright laws.
-
-@item
-Registered version of MySQL.
-
-After you have purchased a MySQL license we will send you a receipt by
-paper mail. You are allowed to use MySQL or any work based on MySQL
-after the 30-days evaluation period. The use of MySQL is, however,
-restricted to one physical computer, but there are no restrictions on
-concurrent uses of MySQL or the number of MySQL servers run on the
-computer.
-
-We will also email you an address and password for a password-protected
-WWW page that always has the newest MySQL-Win32 version. Our current
-policy is that a user with the MySQL license can get free upgrades. The
-best way to ensure that you get the best possible support is to purchase
-commercial support!
-
-@item
-Registration for use in education and university or government-sponsored
-research.
-
-You may obtain a MySQL license for the use in education and university
-or government-sponsored research for free. In that case, send a detailed
-application for licensing MySQL for such use to the email address
-@email{mysql-licensing@@mysql.com}.
-
-The following information is required in the application:
-@itemize @bullet
-@item
-The name of the school or institute.
-@item
-A short description of the school or institute and of the type of
-education, resarch or other functions it provides.
-@item
-A detailed report of the use of MySQL in the institution.
-@end itemize
-
-In this case you will be provided with a license that entitles you to
-use MySQL in a specified manner.
-
-@item
-Distribution.
-
-Provided that you verify that you are distributing an evaluation or
-educational/research version of MySQL you are hereby licensed to make as
-many literal (i.e., verbatim) copies of the evaluation version of MySQL
-and documentation as you wish.
-
-@item
-Restrictions.
-
-The client code of MySQL is in the Public Domain or under the GPL (for
-example the code for readline) license. You are not allowed to modify,
-recompile, translate or create derivative works based upon any part of
-the server code of MySQL.
-
-@item
-Reservation of Rights.
-
-No rights are granted to MySQL except as expressly set forth herein.
-You may not copy or distribute MySQL except as expressly provided under
-this License. Any attempt otherwise to copy or distribute MySQL is void,
-and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-@item
-Other Restrictions.
-
-If the distribution and/or use of MySQL is restricted in certain
-countries for any reason, the Licensor may add an explicit geographical
-distribution limitation excluding those countries, so that distribution
-is permitted only in or among countries not thus excluded. In such case,
-this License incorporates the limitation as if written in the body of
-this License.
-
-@item
-Limitations.
-
-MySQL IS PROVIDED TO YOU "AS IS," WITHOUT WARRANTY. THERE IS NO WARRANTY
-FOR MySQL, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE ENTIRE RISK AS TO
-THE QUALITY AND PERFORMANCE OF MySQL IS WITH YOU. SHOULD MySQL PROVE
-DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
-CORRECTION.
-
-IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL THE LICENSOR, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
-MySQL AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE MySQL (INCLUDING BUT NOT LIMITED TO LOSS OF DATA
-OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF MySQL TO OPERATE WITH ANY OTHER PROGRAMS), EVEN
-IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-@end enumerate
-
-@page
-@node Function Index, Concept Index, Win license, Top
-@unnumbered SQL command, type and function index
-
-@printindex fn
-
-@page
-@node Concept Index, , Function Index, Top
-@unnumbered Concept Index
-
-@printindex cp
-
-@summarycontents
-@contents
-
-@bye
diff --git a/Docs/manual_toc.html b/Docs/manual_toc.html
deleted file mode 100644
index b9014e5efb9..00000000000
--- a/Docs/manual_toc.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<html>
-<head>
-<title>Place holder for manual_toc.html</title>
-</head>
-<body>
-This is just a place holder for the autogenerated manual_toc.html
-to make "make dist" happy.
-</body>
-</html>
diff --git a/Docs/section.Infolinks.texi b/Docs/section.Infolinks.texi
deleted file mode 100644
index 828722e0e56..00000000000
--- a/Docs/section.Infolinks.texi
+++ /dev/null
@@ -1,880 +0,0 @@
-@c FIX AGL 20011108 Extracted from manual.texi.
-@c Contains links to MySQL related info (books, articles). To web portals!
-
-
-@node MySQL-Books, General-SQL, Questions, MySQL Information Sources
-@subsection Books About MySQL
-
-For the latest book information, with user comments, please visit
-@uref{http://www.mysql.com/portal/books/html/}.
-
-While this manual is still the right place for up to date technical
-information, its primary goal is to contain everything there is to know
-about MySQL. It is sometimes nice to have a bound book to read
-in bed or while you travel. Here is a list of books about MySQL and
-related subjects (in English).
-
-By purchasing a book through these hyperlinks provided herein, you are
-contributing to the development of MySQL.
-
-@emph{MySQL}
-@multitable @columnfractions .3 .7
-@item Available @tab @uref{http://service.bfast.com/bfast/click?bfmid=2181&sourceid=34233559&bfpid=0735709211&bfmtype=book} (Barnes and Noble)
-@item Publisher @tab New Riders
-@item Author @tab Paul DuBois
-@item Pub Date @tab 1st Edition December 1999
-@item ISBN @tab 0735709211
-@item Pages @tab 800
-@item Price @tab $49.99 US
-@item Downloadable examples @tab
- @uref{http://www.kitebird.com/mysql-book/} (@code{samp_db} distribution)
-@item Errata @tab
-@uref{http://www.kitebird.com/mysql-book/errata.html}
-@end multitable
-
-Foreword by Michael ``Monty'' Widenius, MySQL Moderator.
-@*
-
-In @emph{MySQL}, Paul DuBois provides you with a comprehensive guide to
-one of the most popular relational database systems. Paul has
-contributed to the online documentation for MySQL and is an
-active member of the MySQL community. The principal MySQL
-developer, Monty Widenius, and a network of his fellow developers
-reviewed the manuscript, and provided Paul with the kind of insight
-no one else could supply.
-@*
-
-Instead of merely giving you a general overview of MySQL, Paul
-teaches you how to make the most of its capabilities. Through two
-sample database applications that run throughout the book, he
-gives you solutions to problems you're sure to face. He helps you
-integrate MySQL efficiently with third-party tools, such as PHP
-and Perl, enabling you to generate dynamic Web pages through
-database queries. He teaches you to write programs that access
-MySQL databases, and also provides a comprehensive set of
-references to column types, operators, functions, SQL syntax,
-MySQL programming, C API, Perl @code{DBI}, and PHP API.
-@emph{MySQL} simply gives you the kind of information you won't find
-anywhere else.
-@*
-
-If you use MySQL, this book provides you with:
-@itemize @bullet
-@item
-An introduction to MySQL and SQL.
-@item
-Coverage of MySQL's data types and how to use them.
-@item
-Thorough treatment of how to write client programs in C.
-@item
-A guide to using the Perl @code{DBI} and PHP APIs for developing
-command-line and Web-based applications.
-@item
-Tips on administrative issues such as user accounts, backup,
-crash recovery, and security.
-@item
-Help in choosing an ISP for MySQL access.
-@item
-A comprehensive reference for MySQL's data types, operators,
-functions, and SQL statements and utilities.
-@item
-Complete reference guides for MySQL's C API, the Perl @code{DBI} API,
-and PHP's MySQL-related functions.
-@end itemize
-@*
-
-@emph{MySQL & mSQL}
-@multitable @columnfractions .3 .7
-@item Available @tab @uref{http://service.bfast.com/bfast/click?bfmid=2181&sourceid=34233559&bfpid=1565924347&bfmtype=book} (Barnes and Noble)
-@item Publisher @tab O'Reilly
-@item Authors @tab Randy Jay Yarger, George Reese & Tim King
-@item Pub Date @tab 1st Edition July 1999
-@item ISBN @tab 1-56592-434-7, Order Number: 4347
-@item Pages @tab 506
-@item Price @tab $34.95
-@end multitable
-
-This book teaches you how to use MySQL and @code{mSQL}, two popular
-and robust database products that support key subsets of SQL on both Linux
-and Unix systems. Anyone who knows basic C, Java, Perl, or Python can
-write a program to interact with a database, either as a stand-alone
-application or through a Web page. This book takes you through the
-whole process, from installation and configuration to programming
-interfaces and basic administration. Includes plenty of tutorial
-material.
-@*
-
-@emph{Sams' Teach Yourself MySQL in 21 Days}
-@multitable @columnfractions .3 .7
-@item Available @tab @uref{http://service.bfast.com/bfast/click?bfmid=2181&sourceid=34233559&bfpid=0672319144&bfmtype=book} (Barnes and Noble)
-@item Publisher @tab Sams
-@item Authors @tab Mark Maslakowski and Tony Butcher
-@item Pub Date @tab June 2000
-@item ISBN @tab 0672319144
-@item Pages @tab 650
-@item Price @tab $39.99
-@end multitable
-
-Sams' @emph{Teach Yourself MySQL in 21 Days} is for intermediate Linux users
-who want to move into databases. A large share of the audience is Web
-developers who need a database to store large amounts of information that
-can be retrieved via the Web.
-
-Sams' @emph{Teach Yourself MySQL in 21 Days} is a practical, step-by-step
-tutorial. The reader will learn to design and employ this open source
-database technology into his or her website using practical, hands-on
-examples to follow.
-@*
-
-@emph{E-Commerce Solutions with MySQL}
-@multitable @columnfractions .3 .7
-@item Available @tab @uref{http://service.bfast.com/bfast/click?bfmid=2181&sourceid=34233559&bfpid=0761524452&bfmtype=book} (Barnes and Noble)
-@item Publisher @tab Prima Communications, Inc.
-@item Authors @tab N/A
-@item Pub Date @tab January 2000
-@item ISBN @tab 0761524452
-@item Pages @tab 500
-@item Price @tab $39.99
-@end multitable
-
-No description available.
-@*
-
-@emph{MySQL and PHP from Scratch}
-@multitable @columnfractions .3 .7
-@item Available @tab @uref{http://service.bfast.com/bfast/click?bfmid=2181&sourceid=34233559&bfpid=0789724405&bfmtype=book} (Barnes and Noble)
-@item Publisher @tab Que
-@item Authors @tab N/A
-@item Pub Date @tab September 2000
-@item ISBN @tab 0789724405
-@item Pages @tab 550
-@item Price @tab $34.99
-@end multitable
-
-This book puts together information on installing, setting up, and
-troubleshooting Apache, MySQL, PHP3, and IMP into one complete
-volume. You also learn how each piece is part of a whole by learning,
-step-by-step, how to create a web-based e-mail system. Learn to run
-the equivalent of Active Server Pages (ASP) using PHP3, set up an
-e-commerce site using a database and the Apache web server, and create
-a data entry system (such as sales, product quality tracking, customer
-preferences, etc) that no installation in the PC.
-@*
-
-@emph{Professional MySQL Programming}
-@multitable @columnfractions .3 .7
-@item Available @tab @uref{http://shop.barnesandnoble.com/bookSearch/isbnInquiry.asp?isbn=1861005164} (Barnes and Noble)
-@item Publisher @tab Wrox Press, Inc.
-@item Authors @tab N/A
-@item Pub Date @tab Late 2001
-@item ISBN @tab 1861005164
-@item Pages @tab 1000
-@item Price @tab $49.99
-@end multitable
-
-No description available.
-@*
-
-@emph{Professional Linux Programming}
-@multitable @columnfractions .3 .7
-@item Available @tab @uref{http://service.bfast.com/bfast/click?bfmid=2181&sourceid=34233559&bfpid=1861003013&bfmtype=book} (Barnes and Noble)
-@item Publisher @tab Wrox Press, Inc.
-@item Authors @tab N/A
-@item Pub Date @tab September 2000
-@item ISBN @tab 1861003013
-@item Pages @tab 1155
-@item Price @tab $47.99
-@end multitable
-
-In this follow-up to the best-selling @emph{Beginning Linux Programming},
-you will learn from the authors' real-world knowledge and experience of
-developing software for Linux; you'll be taken through the development
-of a sample 'DVD Store' application, with 'theme' chapters addressing
-different aspects of its implementation. Meanwhile, individual
-``take-a-break'' chapters cover important topics that go beyond the
-bounds of the central theme. All focus on the practical aspects of
-programming, showing how crucial it is to choose the right tools for
-the job, use them as they should be used, and get things right first
-time.
-@*
-
-@emph{PHP and MySQL Web Development}
-@multitable @columnfractions .3 .7
-@item Available @tab @uref{http://service.bfast.com/bfast/click?bfmid=2181&sourceid=34233559&bfpid=0672317842&bfmtype=book} (Barnes and Noble)
-@item Publisher @tab Sams
-@item Authors @tab Luke Welling, Laura Thomson
-@item Pub Date @tab March 2001
-@item ISBN @tab 0672317842
-@item Pages @tab 700
-@item Price @tab $49.99
-@end multitable
-
-@emph{PHP and MySQL Web Development} introduces you to the advantages
-of implementing both MySQL and PHP. These advantages are detailed
-through the provision of both statistics and several case studies. A
-practical web application is developed throughout the book, providing
-you with the tools necessary to implement a functional online
-database. Each function is developed separately, allowing you the
-choice to incorporate only those parts that you would like to
-implement. Programming concepts of the PHP language are highlighted,
-including functions which tie MySQL support into a PHP script and
-advanced topics regarding table manipulation.
-@*
-
-@strong{Books recommended by the MySQL Developers}
-
-@emph{SQL-99 Complete, Really}
-@multitable @columnfractions .3 .7
-@item Available @tab @uref{http://service.bfast.com/bfast/click?bfmid=2181&sourceid=34233559&bfpid=0879305681&bfmtype=book} (Barnes and Noble)
-@item Publisher @tab CMP Books
-@item Authors @tab Peter Gulutzan, Trudy Pelzer
-@item Pub Date @tab April 1999
-@item ISBN @tab 0879305681
-@item Pages @tab 1104
-@item Price @tab $55.96
-@end multitable
-
-This book contains complete descriptions of the new standards for
-syntax, data structures, and retrieval processes of SQL databases. As
-an example-based reference manual, it includes all of the CLI
-functions, information, schema tables, and status codes, as well as a
-working SQL database provided on the companion disk.
-@*
-
-@emph{C, A reference manual}
-@multitable @columnfractions .3 .7
-@item Available @tab @uref{http://service.bfast.com/bfast/click?bfmid=2181&sourceid=34233559&bfpid=0133262243&bfmtype=book} (Barnes and Noble)
-@item Publisher @tab Prentice Hall
-@item Authors @tab Samuel P. Harbison, Guy L. Steele
-@item Pub Date @tab September 1994
-@item ISBN @tab 0133262243
-@item Pages @tab 480
-@item Price @tab $35.99
-@end multitable
-
-A new and improved revision of the bestselling C language
-reference. This manual introduces the notion of "Clean C", writing C
-code that can be compiled as a C++ program, C programming style that
-emphasizes correctness, portability, maintainability, and
-incorporates the ISO C Amendment 1 (1994) which specifies new
-facilities for writing portable, international programs in C.
-@*
-
-@emph{C++ for Real Programmers}
-@multitable @columnfractions .3 .7
-@item Available @tab @uref{http://service.bfast.com/bfast/click?bfmid=2181&sourceid=34233559&bfpid=0120499428&bfmtype=book} (Barnes and Noble)
-@item Publisher @tab Academic Press, Incorporated
-@item Authors @tab Jeff Alger, Jim Keogh
-@item Pub Date @tab February 1998
-@item ISBN @tab 0120499428
-@item Pages @tab 388
-@item Price @tab $39.95
-@end multitable
-
-@emph{C++ For Real Programmers} bridges the gap between C++ as described
-in beginner and intermediate-level books and C++ as it is practiced by
-experts. Numerous valuable techniques are described, organised into
-three simple themes: indirection, class hierarchies, and memory
-management. It also provides in-depth coverage of template creation,
-exception handling, pointers and optimisation techniques. The focus of
-the book is on ANSI C++ and, as such, is compiler independent.
-
-@emph{C++ For Real Programmers} is a revision of
-@emph{Secrets of the C++ Masters} and includes a new appendix comparing C++
-with Java. The book comes with a 3.5" disk for Windows with source code.
-@*
-
-@emph{Algorithms in C}
-@multitable @columnfractions .3 .7
-@item Available @tab @uref{http://service.bfast.com/bfast/click?bfmid=2181&sourceid=34233559&bfpid=0201514257&bfmtype=book} (Barnes and Noble)
-@item Publisher @tab Addison Wesley Longman, Inc.
-@item Authors @tab Robert Sedgewick
-@item Pub Date @tab April 1990
-@item ISBN @tab 0201514257
-@item Pages @tab 648
-@item Price @tab $45.75
-@end multitable
-
-@emph{Algorithms in C} describes a variety of algorithms in a number of
-areas of interest, including: sorting, searching, string-processing, and
-geometric, graph and mathematical algorithms. The book emphasizes
-fundamental techniques, providing readers with the tools to confidently
-implement, run, and debug useful algorithms.
-@*
-
-@emph{Multithreaded Programming with Pthreads}
-@multitable @columnfractions .3 .7
-@item Available @tab @uref{http://service.bfast.com/bfast/click?bfmid=2181&sourceid=34233559&bfpid=0136807291&bfmtype=book} (Barnes and Noble)
-@item Publisher @tab Prentice Hall
-@item Authors @tab Bil Lewis, Daniel J. Berg
-@item Pub Date @tab October 1997
-@item ISBN @tab 0136807291
-@item Pages @tab 432
-@item Price @tab $34.95
-@end multitable
-
-Based on the best-selling @emph{Threads Primer},
-@emph{Multithreaded Programming with Pthreads} gives you a solid
-understanding of Posix threads: what they are, how they work, when to use
-them, and how to optimise them. It retains the clarity and humor of
-@emph{Threads Primer}, but includes expanded comparisons to Win32 and OS/2
-implementations. Code examples tested on all of the major UNIX platforms
-are featured along with detailed explanations of how and why they use threads.
-@*
-
-@emph{Programming the PERL DBI: Database Programming with PERL}
-@multitable @columnfractions .3 .7
-@item Available @tab @uref{http://service.bfast.com/bfast/click?bfmid=2181&sourceid=34233559&bfpid=1565926994&bfmtype=book} (Barnes and Noble)
-@item Publisher @tab O'Reilly & Associates, Incorporated
-@item Authors @tab Alligator Descartes, Tim Bunce
-@item Pub Date @tab February 2000
-@item ISBN @tab 1565926994
-@item Pages @tab 400
-@item Price @tab $27.96
-@end multitable
-
-@emph{Programming the Perl DBI} is coauthored by Alligator Descartes, one
-of the most active members of the DBI community, and by Tim Bunce, the
-inventor of DBI. For the uninitiated, the book explains the architecture
-of DBI and shows you how to write DBI-based programs. For the experienced
-DBI dabbler, this book explains DBI's nuances and the peculiarities of each
-individual DBD.
-
-The book includes:
-@itemize @bullet
-@item
-An introduction to DBI and its design.
-@item
-How to construct queries and bind parameters.
-@item
-Working with database, driver, and statement handles.
-@item
-Debugging techniques.
-@item
-Coverage of each existing DBD.
-@item
-A complete reference to DBI.
-@end itemize
-@*
-
-
-@node General-SQL, Useful Links, MySQL-Books, MySQL Information Sources
-@subsection General SQL Information and Tutorials
-
-The MySQL book portal is split into different sections to make it easy
-to locate books for various purposes.
-@uref{http://www.mysql.com/portal/books/html/}
-
-Tutorials can be found at:
-@uref{http://www.mysql.com/portal/development/html/development-61-1.html}
-
-@node Useful Links, , General-SQL, MySQL Information Sources
-@subsection Useful MySQL-related Links
-
-The MySQL development portal is the ultimate source of MySQL related
-links. @uref{http://www.mysql.com/portal/development/html/}
-
-Apart from the following links, you can find and download a lot of
-MySQL programs, tools and APIs in the Contrib directory
-(@uref{http://www.mysql.com/Downloads/Contrib/}).
-@cindex @code{Contrib} directory
-
-@cindex URLs to MySQL information
-@cindex MySQL related information URLs
-@subheading Tutorials and Manuals
-
-@table @asis
-@item @uref{http://michael.bacarella.com/research/mysqlmyths.html} (MySQL Myths Debunked)
-MySQL used in the real world.
-
-@item @uref{http://www.4t2.com/mysql/}
-Information about the German MySQL mailing list.
-
-@item @uref{http://www2.rent-a-database.de/mysql/}
-MySQL handbook in German.
-
-@item @uref{http://www.bitmover.com:8888/home/bk/mysql/}
-Web access to the MySQL BitKeeper repository.
-
-@item @uref{http://www.analysisandsolutions.com/code/mybasic.htm}
-Beginners MySQL Tutorial on how to install and set up
-MySQL on a Windows machine.
-
-@item @uref{http://www.devshed.com/Server_Side/MySQL/}
-A lot of MySQL tutorials.
-
-@item @uref{http://mysql.hitstar.com/}
-MySQL manual in Chinese.
-
-@item @uref{http://www.linuxplanet.com/linuxplanet/tutorials/1046/1/}
-Setting Up a MySQL-based website.
-
-@item @uref{http://www.hotwired.com/webmonkey/backend/tutorials/tutorial1.html}
-MySQL-Perl tutorial.
-
-@item @uref{http://www.iserver.com/support/contrib/perl5/modules.html}
-Installing new Perl modules that require locally installed modules.
-
-@item @uref{http://www.hotwired.com/webmonkey/databases/tutorials/tutorial4.html}
-PHP/MySQL Tutorial.
-
-@item @uref{http://www.useractive.com/}
-Hands on tutorial for MySQL.
-@end table
-
-@subheading MySQL Discussion Forums
-
-@table @asis
-@item @uref{http://www.weberdev.com/}
-Examples using MySQL; (check Top 20)
-
-@item @uref{http://futurerealm.com/forum/futureforum.htm}
-FutureForum Web Discussion Software.
-@end table
-
-@subheading Porting MySQL/Using MySQL on Different Systems
-
-@table @asis
-@item @uref{http://www.entropy.ch/software/macosx/mysql/}
-Binary of MySQL for Mac OS X Client. Includes information of how to
-build and use MySQL on Mac OS X.
-
-@item @uref{http://xclave.macnn.com/MySQL/}
-The Mac OS Xclave. Running MySQL on Mac OS X.
-
-@item @uref{http://www.prnet.de/RegEx/mysql.html}
-MySQL for Mac OS X Server.
-
-@item @uref{http://www.latencyzero.com/macosx/mysql.html}
-Building MySQL for Mac OS X.
-
-@item @uref{http://www.essencesw.com/Software/mysqllib.html}
-New Client libraries for the Mac OS Classic (Macintosh).
-
-@item @uref{http://www.lilback.com/macsql/}
-Client libraries for Mac OS Classic (Macintosh).
-
-@item @uref{http://sixk.maniasys.com/index_en.html}
-MySQL for Amiga
-@end table
-
-@subheading Perl-related Links
-
-@table @asis
-@item @uref{http://dbimysql.photoflux.com/}
-Perl DBI with MySQL FAQ.
-@end table
-
-@c FIX We should get longer descriptions for things in this category!
-@subheading Commercial Applications that Support MySQL
-
-@table @asis
-@item @uref{http://www.supportwizard.com/}
-SupportWizard; Interactive helpdesk on the Web. This product includes a
-licensed copy of MySQL.
-
-@item @uref{http://www.sonork.com/}
-Sonork, Instant Messenger that is not only Internet oriented. It's
-focused on private networks and on small to medium companies. Client
-is free, server is free for up to 5 seats.
-
-@item @uref{http://www.stweb.org/}
-StWeb - Stratos Web and Application server - An easy-to-use, cross
-platform, Internet/Intranet development and deployment system for
-development of web-enabled applications. The standard version of StWeb
-has a native interface to MySQL database.
-
-@item @uref{http://www.rightnowtech.com/}
-Right Now Web; Web automation for customer service.
-
-@item @uref{http://www.icaap.org/Bazaar/}
-Bazaar; Interactive Discussion Forums with Web interface.
-
-@cindex PhoneSweep
-@item @uref{http://www.phonesweep.com/}
-PhoneSweepT is the world's first commercial Telephone Scanner. Many break-ins
-in recent years have come not through the Internet, but through unauthorised
-dial-up modems. PhoneSweep lets you find these modems by repeatedly placing
-phone calls to every phone number that your organisation
-controls. PhoneSweep has a built-in expert system that can recognise
-more than 250 different kinds of remote-access programs, including
-Carbon Copy(TM), pcANYWHERE(TM), and Windows NT RAS. All information is stored
-in the SQL database. It then generates a comprehensive report detailing
-which services were discovered on which dial-up numbers in your organisation.
-@end table
-
-@subheading SQL Clients and Report Writers
-
-@table @asis
-@item @uref{http://www.urbanresearch.com/software/utils/urbsql/} (urSQL)
-SQL Editor and Query Utility. Custom syntax highlighting, editable
-results grid, exportable result-sets, basic MySQL admin functions,
-Etc.. For Windows.
-
-@item @uref{http://www.edatanew.com/} (MySQL Data Manager)
-MySQL Data Manager * is platform independent web client
-(written in perl) for MySQL server over TCP/IP.
-
-@item @uref{http://ksql.sourceforge.net/}
-KDE MySQL client.
-
-@item @uref{http://www.ecker-software.de/}
-A Windows GUI client by David Ecker.
-
-@item @uref{http://www.icaap.org/software/kiosk/}
-Kiosk; a MySQL client for database management. Written in Perl.
-Will be a part of Bazaar.
-
-@item @uref{http://www.casestudio.com/}
-Db design tool that supports MySQL 3.23.
-
-@item @uref{http://home.skif.net/~voland/zeos/eng/}
-Zeos - A client that supports MySQL, Interbase and PostgreSQL.
-
-@item @uref{http://www.geocities.com/SiliconValley/Ridge/4280/GenericReportWriter/grwhome.html}
-A free report writer in Java
-
-@item @uref{http://www.javaframework.de/}
-MySQLExport - Export of MySQL create statements and data in a lot of
-different formats (SQL, HTML, CVS, text, ZIP, GZIP...).
-
-@item @uref{http://dlabs.4t2.com/}
-M2D, a MySQL Administration client for Windows. M2D supports
-administration of MySQL databases, creation of new databases and
-tables, editing, and more.
-
-@item @uref{http://dlabs.4t2.com/}
-Dexter, a small server written in Perl which can be used as a proxy server for
-MySQL or as a database extender.
-
-@item @uref{http://www.scibit.com/Products/Software/Utils/Mascon.asp}
-Mascon is a powerful Win32 GUI for administering MySQL databases.
-
-@item @uref{http://www.rtlabs.com/}
-MacSQL Monitor. GUI for MySQL, ODBC, and JDBC databases for the Mac OS.
-@end table
-
-@subheading Distributions that Include MySQL
-
-@c FIX add the rest (at least a couple more Linuxes)
-
-@table @asis
-@item @uref{http://www.suse.com/}
-SuSE Linux (6.1 and above)
-
-@item @uref{http://www.redhat.com/}
-RedHat Linux (7.0 and above)
-
-@item @uref{http://distro.conectiva.com.br/}
-Conectiva Linux (4.0 and above)
-@end table
-
-@subheading Web Development Tools that Support MySQL
-
-@table @asis
-@item @uref{http://www.php.net/}
-PHP: A server-side HTML-embedded scripting language.
-
-@item @uref{http://www.midgard-project.org/}
-The Midgard Application Server; a powerful Web development environment
-based on MySQL and PHP.
-
-@cindex dbServ
-@item @uref{http://www.dbServ.de/}
-dbServ is an extension to a web server to integrate database output into
-your HTML code. You may use any HTML function in your output. Only the
-client will stop you. It works as standalone server or as Java servlet.
-
-@item @uref{http://www.chilisoft.com/}
-Platform independent ASP from Chili!Soft
-
-@item @uref{http://www.voicenet.com/~zellert/tjFM/}
-A JDBC driver for MySQL.
-
-@item @uref{http://www.wernhart.priv.at/php/}
-MySQL + PHP demos.
-
-@item @uref{http://www.dbwww.com/}
-ForwardSQL: HTML interface to manipulate MySQL databases.
-
-@item @uref{http://www.daa.com.au/~james/www-sql/}
-WWW-SQL: Display database information.
-
-@item @uref{http://www.heitml.com/}
-HeiTML: A server-side extension of HTML and a 4GL language at the same time.
-
-@item @uref{http://hawkeye.net/}
-Hawkeye Internet Server Suite.
-
-@item @uref{http://www.webgroove.com/}
-WebGroove Script: HTML compiler and server-side scripting language.
-
-@item @uref{http://www.ihtml.com/}
-A server-side website scripting language.
-
-@item @uref{ftp://ftp.igc.apc.org/pub/myodbc/README}
-How to use MySQL with ColdFusion on Solaris.
-
-@item @uref{http://calistra.com/MySQL/}
-Calistra's ODBC MySQL Administrator.
-
-@item @uref{http://phpclub.net/}
-PHPclub - Tips and tricks for PHP.
-
-@item @uref{http://www.widgetchuck.com/}
-The Widgetchuck; Website Tools and Gadgets
-
-@item @uref{http://www.adcycle.com/}
-AdCycle - advertising management software.
-
-@cindex pwPage
-@item @uref{http://sourceforge.net/projects/pwpage/}
-pwPage - provides an extremely fast and simple approach to the creation
-of database forms. That is, if a database table exists and an HTML page
-has been constructed using a few simple guidelines, pwPage can be
-immediately used for table data selections, insertions, updates, deletions
-and selectable table content reviewing.
-
-@item @uref{http://www.omnis-software.com/products/studio/studio.html}
-OMNIS Studio is a rapid application development (RAD) tool.
-@end table
-
-@subheading Database Design Tools with MySQL Support
-
-@table @asis
-@item @uref{http://www.mysql.com/documentation/dezign/}
-"DeZign for databases" is a database development tool that uses an
-entity relationship diagram (ERD).
-@end table
-
-@subheading Web Servers with MySQL Tools
-
-@table @asis
-@item @uref{ftp://ftp.kcilink.com/pub/}
-mod_auth_mysql, An Apache authentication module.
-
-@item @uref{http://www.roxen.com/}
-The Roxen Challenger Web server.
-@end table
-
-@subheading Extensions for Other Programs
-
-@table @asis
-@item @uref{http://www.seawood.org/msql_bind/}
-MySQL support for BIND (The Internet Domain Name Server).
-
-@item @uref{http://www.inet-interactive.com/sendmail/}
-MySQL support for Sendmail and Procmail.
-@end table
-
-@subheading Using MySQL with Other Programs
-
-@table @asis
-@item @uref{http://www.iserver.com/support/addonhelp/database/mysql/msaccess.html}
-Using MySQL with Access.
-
-@item @uref{http://www.iserver.com/support/contrib/perl5/modules.html}
-Installing new Perl modules that require locally installed modules.
-@end table
-
-@subheading ODBC-related Links
-
-@table @asis
-@item @uref{http://www.iodbc.org/}
-Popular iODBC Driver Manager (libiodbc) now available as Open Source.
-
-@item @uref{http://users.ids.net/~bjepson/freeODBC/}
-The FreeODBC Pages.
-
-@item @uref{http://genix.net/unixODBC/}
-The unixODBC Project goals are to develop and promote unixODBC to be the
-definitive standard for ODBC on the Linux platform. This is to include GUI
-support for KDE.
-
-@item @uref{http://www.sw-soft.com/products/BtrieveODBC/}
-A MySQL-based ODBC driver for Btrieve.
-@end table
-
-@subheading @strong{API}-related Links
-
-@table @asis
-@item @uref{http://www.jppp.com/}
-Partially implemented TDataset-compatible components for MySQL.
-
-@item @uref{http://www.riverstyx.net/qpopmysql/}
-qpopmysql - A patch to allow POP3 authentication from a MySQL
-database. There's also a link to Paul Khavkine's patch for Procmail to
-allow any MTA to deliver to users in a MySQL database.
-
-@item @uref{http://www.essencesw.com/Software/mysqllib.html}
-New Client libraries for the Mac OS Classic (Macintosh).
-
-@item @uref{http://www.lilback.com/macsql/}
-Client libraries for the Macintosh.
-
-@item @uref{http://www.essencesw.com/Plugins/mysqlplug.html}
-Plugin for REALbasic (for Macintosh)
-
-@item @uref{http://www.iis.ee.ethz.ch/~neeri/macintosh/gusi-qa.html}
-A library that emulates BSD sockets and pthreads on Macintosh. This can
-be used if you want to compile the MySQL client library on Mac.
-It could probably even be sued to port MySQL to Macintosh, but we
-don't know of anyone that has tried that.
-
-@cindex SCMDB
-@item @uref{http://www.dedecker.net/jessie/scmdb/}
-SCMDB - an add-on for SCM that ports the MySQL C library to scheme
-(SCM). With this library scheme developers can make connections to a
-MySQL database and use embedded SQL in their programs.
-@end table
-
-@subheading Other MySQL-related Links
-
-@table @asis
-@item @uref{http://www.satisoft.com/} (SAT)
-The Small Application Toolkit (SAT) is a collection of utilities
-intended to simplify the development of small, multi-user, GUI based
-applications in a (Microsoft -or- X) Windows Client / Unix Server
-environment.
-
-@item @uref{http://www.wix.com/mysql-hosting/}
-Registry of Web providers who support MySQL.
-
-@item @uref{http://www.softagency.co.jp/mysql/index.en.html}
-Links about using MySQL in Japan/Asia.
-
-@item @uref{http://abattoir.cc.ndsu.nodak.edu/~nem/mysql/udf/}
-MySQL UDF Registry.
-
-@item @uref{http://www.open.com.au/products.html}
-Commercial Web defect tracking system.
-
-@item @uref{http://www.stonekeep.com/pts/}
-PTS: Project Tracking System.
-
-@item @uref{http://tomato.nvgc.vt.edu/~hroberts/mot/}
-Job and software tracking system.
-
-@item @uref{http://www.cynergi.net/exportsql/}
-ExportSQL: A script to export data from Access95+.
-
-@item @uref{http://SAL.KachinaTech.COM/H/1/MYSQL.html}
-SAL (Scientific Applications on Linux) MySQL entry.
-
-@item @uref{http://www.infotech-nj.com/itech/index.shtml}
-A consulting company which mentions MySQL in the right company.
-
-@item @uref{http://www.pmpcs.com/}
-PMP Computer Solutions. Database developers using MySQL and
-@code{mSQL}.
-
-@item @uref{http://www.dedserius.com/y2kmatrix/}
-Y2K tester.
-@end table
-
-@subheading SQL and Database Interfaces
-
-@table @asis
-@item @uref{http://java.sun.com/products/jdbc/}
-The JDBC database access API.
-
-@item @uref{http://www.gagme.com/mysql/}
-Patch for @code{mSQL} Tcl.
-
-@item @uref{http://www.amsoft.ru/easysql/}
-EasySQL: An ODBC-like driver manager.
-
-@item @uref{http://www.lightlink.com/hessling/rexxsql.html}
-A REXX interface to SQL databases.
-
-@c @item @uref{http://www.mytcl.cx/}
-@c Tcl interface based on tcl-sql with many bugfixes.
-
-@item @uref{http://www.binevolve.com/~tdarugar/tcl-sql/}
-Tcl interface for MySQL.
-
-@item @uref{http://www.contrib.andrew.cmu.edu/~shadow/sql.html}
-SQL Reference Page with a lot of interesting links.
-
-@end table
-
-@subheading Examples of MySQL Use
-
-@table @asis
-@c Added 990601
-@c EMAIL: thuss@little6.com (Todd Huss)
-@item @uref{http://www.little6.com/about/linux/}
-Little6 Inc., An online contract and job finding site that is powered by
-MySQL, PHP3, and Linux.
-
-@c Added 990521
-@c EMAIL: info@worldrecords.com (Jim Rota)
-@item @uref{http://www.worldrecords.com/}
-World Records - A search engine for information about music that uses
-MySQL and PHP.
-
-@item @uref{http://www.webtechniques.com/archives/1998/01/note/}
-A Contact Database using MySQL and PHP.
-
-@item @uref{http://modems.rosenet.net/mysql/}
-Web based interface and Community Calendar with PHP.
-
-@item @uref{http://www.odbsoft.com/cook/sources.htm}
-Perl package to generate html from a SQL table structure and for generating
-SQL statements from an html form.
-
-@item @uref{http://www.gusnet.cx/proj/telsql/}
-Basic telephone database using @code{DBI}/@code{DBD}.
-
-@item @uref{http://tecfa.unige.ch/guides/java/staf2x/ex/jdbc/coffee-break/}
-JDBC examples by Daniel K. Schneider.
-
-@item @uref{http://www.ooc.com/}
-Object Oriented Concepts Inc; CORBA applications with examples in source.
-
-@c EMAIL: paul@sword.damocles.com (Paul Bannister)
-@item @uref{http://www.stopbit.com/}
-Stopbit - A technology news site using MySQL and PHP.
-
-@item @uref{http://www.penguinservices.com/scripts/}
-Online shopping cart system.
-
-@c Added 990928 from editor@city-gallery.com
-@cindex Old Photo Album
-@item @uref{http://www.city-gallery.com/album/}
-Old Photo Album - The album is a collaborative popular history of photography
-project that generates all pages from data stored in a MySQL
-database. Pages are dynamically generated through a php3 interface to the
-database content. Users contribute images and descriptions. Contributed
-images are stored on the web server to avoid storing them in the database
-as BLOBs. All other information is stored on the shared MySQL server.
-@end table
-
-@subheading General Database Links
-
-@table @asis
-@item @uref{http://black.hole-in-the.net/guy/webdb/}
-Homepage of the webdb-l (Web Databases) mailing list.
-
-@item @uref{http://www.symbolstone.org/technology/perl/DBI/}
-Perl @code{DBI}/@code{DBD} modules homepage.
-
-@item @uref{http://www.student.uni-koeln.de/cygwin/}
-Cygwin tools. Unix on top of Windows.
-
-@cindex Tek-Tips forums
-@cindex forums, Tek-Tips
-@item @uref{http://www.tek-tips.com/}
-Tek-Tips Forums are 800+ independent peer-to-peer non-commercial support
-forums for Computer Professionals. Features include automatic e-mail
-notification of responses, a links library, and member confidentiality
-guaranteed.
-
-@item @uref{http://www.public.asu.edu/~peterjn/btree/}
-B-Trees: Balanced Tree Data Structures.
-
-@item @uref{http://www.fit.qut.edu.au/~maire/baobab/lecture/sld001.htm}
-A lecture about B-Trees.
-@end table
-
-
diff --git a/Docs/section.Testimonials.texi b/Docs/section.Testimonials.texi
deleted file mode 100644
index e757a6a92d0..00000000000
--- a/Docs/section.Testimonials.texi
+++ /dev/null
@@ -1,31 +0,0 @@
-@c FIX AGL 20011108 Extracted from manual.texi.
-@c Should only be on website with new submits by webform.
-
-
-@node MySQL Testimonials, Contrib, Users, Top
-@appendix MySQL Testimonials
-
-@cindex MySQL Testimonials
-
-The section 'MySQL Users' contains a lot of different links to
-MySQL users but doesn't provide that much information about how
-they are using MySQL. @xref{Users}. This section gives you an idea
-of how other MySQL users are using MySQL to solve their problems.
-
-Please note that all new stories are added on the MySQL website,
-@uref{http://www.mysql.com/}.
-Do let us know about @emph{your} success story too!
-
-@itemize @bullet
-@item
-@strong{Peter Zaitsev of Spylog.ru} writes:
-I think you might be interested in my database size. The whole database
-is currently on 15 servers and I think it's about 60.000 of tables
-containing about 5.000.000.000 of rows. My mostly loaded server
-currently holds about 10.000 of tables with 1.000.000.000 of rows in it.
-Hugest tables have about 50.000.000 of rows, and this value will raise
-as soon as I'll move to 2.4 kernel with large files. Currently I have to
-delete much of logs for large sites to hold table sizes in 2Gb.
-
-@item
-
diff --git a/Docs/section.Users.texi b/Docs/section.Users.texi
deleted file mode 100644
index 3c8d219fa16..00000000000
--- a/Docs/section.Users.texi
+++ /dev/null
@@ -1,414 +0,0 @@
-@c FIX AGL 20011108 Extracted from manual.texi.
-@c Should only be on website.
-
-
-@node Users, Contrib, Problems, Top
-@appendix MySQL Users
-
-@cindex users, of MySQL
-@cindex news sites
-
-This appendix lists users of MySQL that have given us permission
-to list them in our documentation. It is by far not a complete list, but
-should give you a general idea of who uses MySQL and what it can
-be used for.
-
-@appendixsec General News Sites
-
-@itemize @bullet
-
-@item @uref{http://www.yahoo.com/} (Yahoo!)
-
-@item @uref{http://slashdot.org/} (Slashdot: A pro-Linux/tech news and comment/discussion site)
-
-@item @uref{http://www.linux.com/} (All about Linux)
-
-@item @uref{http://www.linuxtoday.com/} (Linuxtoday)
-
-@item @uref{http://www.32bitsonline.com/} (32Bits Online: because there's
-more than one way to compute)
-
-@item @uref{http://www.freshmeat.net/} (Freshmeat: News about new versions of computer-related stuff)
-
-@end itemize
-
-@cindex search engines, web
-@cindex web search engines
-@appendixsec Web Search Engines
-
-@itemize @bullet
-
-@item @uref{http://www.aaa.com.au/} (AAA Matilda Web Search)
-@item @uref{http://www.whatsnu.com/} (What's New)
-@item @uref{http://www.aladin.de/} (Aladin)
-@item @uref{http://www.columbus-finder.de/} (Columbus Finder)
-@item @uref{http://www.spider.de/} (Spider)
-@item @uref{http://www.blitzsuche.de/} (Blitzsuche)
-@item @uref{http://www.indoseek.co.id/} (Indoseek Indonesia)
-@item @uref{http://www.yaboo.dk/} (Yaboo - Yet Another BOOkmarker)
-@item @uref{http://www.ozsearch.com.au/} (OzSearch Internet Guide)
-@item @uref{http://www.splatsearch.com/} (Splat! Search)
-@item @uref{http://osdls.library.arizona.edu/} (The Open Source Digital Library System Project)
-@end itemize
-
-@appendixsec Information Search Engines Specialising in a Particular Area
-
-@itemize @bullet
-
-@item @uref{http://www.spylog.ru/} (SpyLOG ; A very popular Web counter site)
-
-@item @uref{http://www.tucows.com/} (TuCows Network; Free Software archive)
-
-@item @uref{http://www.jobvertise.com/} (Jobvertise: Post and search for jobs)
-
-@item @uref{http://www.musicdatabase.com/} (The Music Database)
-
-@item @uref{http://www.soccersearch.com/} (Football -Soccer- search page)
-
-@item @uref{http://www.headrush.net/takedown} (TAKEDOWN - wrestling)
-
-@item @uref{http://www.lyrics.net/} (The International Lyrics Network)
-
-@item @uref{http://TheMatrix.com/~matrix/band_search.phtml} (Musicians looking for other musicians; free service)
-
-@item @uref{http://www.addall.com/AddBooks/Stores.html} (AddALL books searching and price comparison)
-
-@item @uref{http://www.herbaria.harvard.edu/Data/Gray/gray.html} (Harvard's Gray Herbarium Index of Plant Names)
-
-@item @uref{http://www.game-developer.com/} (The Game Development Search Engine)
-
-@item @uref{http://www.theinnkeeper.com/} (The Innkeeper Vacation Guides)
-
-@item @uref{http://www.macgamedatabase.com/} (The Mac Game Database uses PHP and MySQL)
-@c From: Marc Antony Vose <suzerain@suzerain.com>
-
-@item @uref{http://www.csse.monash.edu.au/publications/} (Research
-Publications at Monash University in Australia)
-
-@item @uref{http://www.ipielle.emr.it/bts/}
-(Occupational Health & Safety Website database; a project for the ECC)
-@c c.presutti@ipielle.emr.it
-
-@item @uref{http://data.mch.mcgill.ca/} (Bioinformatics databases at the
-Montreal Children's Hospital using MySQL)
-@c saeed@www.debelle.mcgill.ca
-@end itemize
-
-@cindex online magazines
-@cindex magazines, online
-@appendixsec Online Magazines
-
-@itemize @bullet
-@item @uref{http://www.spoiler.com/} (Spoiler Webzine)
-An online magazine featuring music, literature, arts, and design content.
-@item @uref{http://www.linux-magazin.de/newsflash/} (Daily news about Linux in German language)
-@item @uref{http://www.betazine.com/} (Betazine - The Ultimate Online Beta Tester's Magazine)
-@item @uref{http://www.currents.net/ccinfo/aboutcc.html} (Computer Currents Magazine)
-@end itemize
-
-@cindex websites
-@appendixsec Websites that Use MySQL as a Backend
-
-@itemize @bullet
-
-@item @uref{http://liftoff.msfc.nasa.gov/} (NASA)
-@item @uref{http://kids.msfc.nasa.gov/} (NASA KIDS)
-@item @uref{http://science.nasa.gov/} (Sience@@NASA)
-
-@item @uref{http://www.handy.de/} (handy.de)
-
-@item @uref{http://lindev.jmc.tju.edu/qwor/} (Qt Widget and Object Repository)
-
-@item @uref{http://www.samba-choro.com.br/} (Brazilian samba site; in Portuguese)
-
-@item @uref{http://pgss.iss.uw.edu.pl/en_index.ISS} (Polish General Social Survey)
-
-@item @uref{http://www.expo2000.com/} Expo2000 - world-wide distribution of
-tickets for this event is implemented using MySQL and Tcl/Tk. More than
-5000 travel agencies all over the world have access to it.
-
-@item @uref{http://www.freevote.com/} FreeVote.com is a free voting
-service with millions of users.
-
-@item @uref{http://f1.tauzero.se/} (Forza Motorsport)
-
-@item @uref{http://www.dreamhost.com/} (DreamHost Web Hosting)
-
-@end itemize
-
-@cindex services
-@appendixsec Domain/Internet/Web and Related Services
-
-@itemize @bullet
-
-@item @uref{http://www.wix.com/mysql-hosting/} (Registry of Web providers that
-support MySQL)
-
-@item @uref{http://www.yi.org/} (Dynamic DNS Services)
-
-@item @uref{http://www.dynodns.net/} (Dynamic domain name service)
-
-@item @uref{http://www.ods.org/} (Open DNS Project; free dynamic DNS service)
-
-@c @item @uref{http://dynodns.net/} (Free dynamic DNS implementation)
-@c EMAIL: A Moore <amoore@mooresystems.com>
-
-@item @uref{http://www.hn.org/} (Hammernode; Public DNS Servers)
-
-@item @uref{http://www.fdns.net/} (Free 3rd level domains)
-
-@item @uref{http://worldcommunity.com/} (Online Database)
-
-@item @uref{http://www.bigbiz.com/} (BigBiz Internet Services)
-
-@item @uref{http://virt.circle.net/} (The Virt Gazette)
-
-@item @uref{http://www.california.com/} (Global InfoNet Inc)
-
-@item @uref{http://www.webhosters.com/} (WebHosters - A Guide to WWW Providers)
-
-@item @uref{http://online.dn.ru/} (Internet information server)
-
-@item @uref{http://www.worldnetla.net/} (WorldNet Communications - An Internet Services Provider)
-
-@item @uref{http://www.netizen.com.au/} (Netizen: Australian-based Web consultancy)
-
-@item @uref{http://www.trainingpages.co.uk/} (Search site for training courses in the UK)
-
-@item @uref{http://chat.nitco.com/} (Gannon Chat; GPL. Written in Perl and Javascript)
-
-@item @uref{http://www.addurls.com/} (A general links directory)
-
-@item @uref{http://www.bookmarktracker.com/} (A Web-based bookmark management service)
-
-@item @uref{http://www.cdrom.com/} (Walnut Creek CDROM)
-
-@item @uref{http://www.wwwthreads.org/} (WWWThreads; Interactive discussion Forums)
-
-@item @uref{http://pvmon.portici.enea.it/Meteo/} (In Italian; Storage data from meteo station)
-
-@item @uref{http://www.buysell.net/} (Online "Person To Person" Auction)
-
-@item @uref{http://tips.pair.com/} (Tips on Web development)
-
-@item @uref{http://www.mailfriends.com/} (Mailfriends.com is a FREE service for
-everybody who wants to find friends over the internet)
-
-@item @uref{http://www.uninova.com/cgi-bin/wctelnets?list} (Web Page Telnet BBS List)
-
-@item @uref{http://www.uninova.com/cnc.html} (UniNova Digital Postcards)
-
-@c @item @uref{http://cabinboy.powersurfr.com/} (An Internet RFC search engine)
-
-@item @uref{http://www.dslreports.com/} (DSL-provider search with reviews)
-Made with MySQL and Modperl, all pages are generated dynamically out of
-the MySQL database
-@end itemize
-
-@cindex PHP, websites
-@appendixsec Websites that Use @code{PHP} and MySQL
-
-@itemize @bullet
-@c @item @uref{http://www.wh200th.com/} (White House 200th Anniversary site)
-
-@item @uref{http://support.jgaa.com/} (Jgaa's Internet - Official Support Site)
-
-@item @uref{http://io.incluso.com/} (Ionline - online publication) MySQL,
-PHP, Java, Web programming, DB development
-
-@item @uref{http://www.baboo.com/} (BaBoo - Browse and Bookmark. Free Web-based bookmark manager and Calendar)
-
-@item @uref{http://www.courses.pjc.cc.fl.us/Schedule/}
-(Course Schedule System at Pensacola Junior College)
-
-@item @uref{http://www.fccj.org/} (Florida Community College at Jacksonville)
-
-@item @uref{http://www.32bit.com/} (32bit.com; An extensive shareware / freeware archive)
-
-@item @uref{http://www.jokes2000.com/} (Jokes 2000)
-@c Added 990604; EMAIL: ah@dybdahl.dk
-
-@item @uref{http://www.burken.nu/}
-Burken is a webhotel that provides scripts, among other things,
-for remote users, like counters, guestbooks etc.
-@c Added 990608; EMAIL: spacedmp@SpaceDump.Burken.NU (Anders Olausson)
-
-@item @uref{http://tips.pair.com/}
-Contains tips on html, javascript, 2d/3d graphics, and PHP3/MySQL.
-All pages are generated from a database.
-@c Added 990614; EMAIL: downey@image.dk (Rune Madsen)
-
-@item @uref{http://www.softwarezrus.com/}
-Ecommerce site that is selling computers.
-@end itemize
-
-@cindex consultants, list of
-@appendixsec MySQL Consultants
-
-@itemize @bullet
-
-@item @uref{http://www.ayni.com/} (Ayni AG)
-
-@item @uref{http://worldcommunity.com/} (Online Database)
-
-@item @uref{http://www2.dataguard.no/} (DataGuard; Uses MySQL and PHP)
-
-@item @uref{http://wwits.net/programs/mysql.phtml} (WWITS; uses MySQL and PHP)
-
-@item @uref{http://www.worldcommunity.com/} (WCN - The World Community Network)
-
-@item @uref{http://www.chipcastle.com/} (Chip Castle Dot Com Inc)
-@c Added 990603 EMAIL: chip@chipcastle.com (Chip Castle)
-
-@item @uref{http://www.cyber.com.au/} (Cybersource Pty. Ltd)
-
-@item @uref{http://www.spring.de/} (Spring infotainment gmbh & co. kg)
-@c added 990905 "Oliver Pischke" <opischke@spring.de>
-
-@item @uref{http://www.wamdesign.com/} (Wam Design develops websites using MySQL)
-@c Added 990905; max@wamdesign.com
-
-@item @uref{http://www.berkeleyconsultants.com/} (Berkeley Consultants Group)
-
-@item @uref{http://www.jammconsulting.com/} (JAMM Consulting Inc)
-
-@end itemize
-
-@c Commented out by Arjen 011018, section is empty!
-@c appendixsec Programming
-
-@cindex web pages, miscellaneous
-@appendixsec Uncategorised Pages
-
-@itemize @bullet
-
-@item @uref{http://www.feature-showcase.com/htmls/demo_mysql.sql} (AZC.COM's Feature Showcase)
-
-@item @uref{http://www.teach.org.uk/subjects/trainingcourse/g.html} (Course Search)
-
-@item @uref{http://www.northerbys.com/} (Northerbys Online Auctions)
-
-@item @uref{http://www.schiphol.nl/flights/home.htm} (Amsterdam Airport Schiphol)
-
-@item @uref{http://TheMatrix.com/seventhsin/query.phtml} (CD database)
-
-@item @uref{http://TheMatrix.com/~flmm/GEAR.html} (Used Audio Gear Database)
-
-@item @uref{http://www.kiss.de/musik-mueller/} (Musical note-sheets)
-
-@item @uref{http://www.bagism.com/} (Bagism; A John Lennon fan page)
-
-@item @uref{http://www.selftaught.com/} (US Folk art broker)
-
-@item @uref{http://organizer.net/} (Mail reading on the Web)
-
-@item @uref{http://www.mypage.org/} (Free home pages on www.somecoolname.mypage.org)
-
-@item @uref{http://www.schulweb.de/} (Der Server f@"ur Schulen im Web - in German)
-
-@item @uref{http://www.ald.net/} (Auldhaefen Online Services)
-
-@item @uref{http://www.cary.net/} (CaryNET Information Center)
-
-@item @uref{http://www.dataden.com/} (Dataden Computer Systems)
-
-@item @uref{http://andree.grm.se/} (Andr@'emuseet; in Swedish)
-
-@item @uref{http://www.him.net/} (HOMESITE Internet Marketing)
-
-@item @uref{http://www.jade-v.com/techinfo.html} (Jade-V Network Services)
-
-@item @uref{http://ww2010.atmos.uiuc.edu/(Gl)/abt/aknw/tech.rxml}
-Weather World 2010 Technical Credits
-
-@item @uref{http://gimp.foebud.org/registry/doc/}
-About The Gimp plugin registry
-
-@item @uref{http://www.fast-inc.com/Products/Archiver/database.html}
-Java tool; archiver technical detail (Slightly optimistic about MySQL
-ANSI-92 compliance)
-
-@item @uref{http://www.gamesdomain.com/cheats/usrcheat.phtml} (Games Domain Cheats Database)
-
-@item @uref{http://www.kcilink.com/poweredby/} (The "Powered By" Page; Kcilink)
-
-@item @uref{http://www.netcasting.net/index.whtml} (Netcasting)
-
-@item @uref{http://homepages.tig.com.au/~mjj/nbltips} (NBL: Australian National Basketball League; tipping)
-
-@item @uref{http://www.cgishop.com/} (CGI shop)
-
-@item @uref{http://www.whirlycott.com/} (Whirlycott: Website Design)
-
-@item @uref{http://www.mtp.dk/} (Museum Tusculanum Press)
-
-@item @uref{http://csdgi.historie.ku.dk/biblio/} (Centro Siciliano di Documentazione)
-
-@item @uref{http://caribou.dyn.ml.org:8000/} (Quake statistics database)
-
-@item @uref{http://www.astroforum.ch/} (Astroforum: Astrologie and related things; in German)
-
-@item @uref{http://www.opendebate.com/} (OpenDebate - Interactive Polls & Open Discussion)
-
-@item @uref{http://vermeer.organik.uni-erlangen.de/dissertationen/} (Online chemical dissertation server)
-
-@item @uref{http://www.freschinfo.com/} (FreSch! The Free Scholarship Search Service)
-
-@item @uref{http://www.nada.kth.se/~staffanu/pinball/} (Stockholm Pinball Locator)
-
-@item @uref{http://www.hek.com/} (HEK - a construction company)
-
-@item @uref{http://www.ebi.nl/} (Elsevier Business Information)
-
-@item @uref{http://vaccination.medicallink.se/} (Medical Links; using ColdFusion and MySQL)
-
-@item @uref{http://www.joblink-usa.com/} (Search for jobs & people at JobLink-USA)
-
-@item @uref{http://www.skydive.net/competfs/} (Competition Formation Skydiving)
-
-@item @uref{http://www.galaxy-net.net/} (Galaxy-NET Telecommunications; E-commerce and internal accounting)
-
-@item @uref{http://www.borsen.dk/} (Denmark's leading business daily newspaper B@o{}rsen)
-
-@item @uref{http://tmmm.simplenet.com/indb/} (The Internet NES Database)
-
-@item @uref{http://www.russia.cz/} (Travel agency in Prague in 3 languages)
-
-@item @uref{http://www.linkstation.de/} (Linkstation)
-
-@item @uref{http://www.peoplestaff.com/} (Searchable online database at Peoplestaff)
-
-@item @uref{http://www.dreamhorse.com/} (A searchable database system for horse classified ads)
-
-@item @uref{http://pootpoot.com/} (The Poot site)
-
-@item @uref{http://grateful.net/hw_html/} ("Playin' in the LAN"; a network monitoring suite)
-
-@c Update from Christopher Milton <cmilton@bwn.net> 1999-12-21
-@item @uref{http://www.usapa.army.mil/} (U.S. Army Publishing Agency)
-
-@item @uref{http://www.nekretnine.co.yu/} (Realestate handling in Yugoslavia)
-
-@item @uref{http://demo.cpsoft.com/pims/devFAQ.html} (PIMS; a Patient Information Management System)
-
-@item @uref{http://cpsoft.com/} (Pilkington Software Inc)
-
-@item @uref{http://www.no-quarter.org/} (A Vietnam Veteran's Memorial - The Wall - database)
-
-@item @uref{http://www.gamers-union.com/} (Gamer's Union specializes in auctions of used & out-of-print gaming material)
-
-@item @uref{http://www.montereyhigh.com/office/dbul.php3} (A daily bulletin at Monterey High school)
-
-@item @uref{http://www.myEastside.com/} (Community-owned site serving Lake
-Washington's Eastside residents and businesses)
-
-@item @uref{http://bowling-france.net/} (French bowling site)
-@end itemize
-
-Send any additions to this list to @email{webmaster@@mysql.com}.
-
-@page
-
-
-
-
diff --git a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Clients and Tools.fgl b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Clients and Tools.fgl
index 7bba3d7474a..ed1e42e65b6 100755
--- a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Clients and Tools.fgl
+++ b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Clients and Tools.fgl
@@ -15,6 +15,7 @@ file7=C:\mysql\bin\mysqlc.exe
file8=C:\mysql\bin\mysqlcheck.exe
file9=C:\mysql\bin\mysqldump.exe
file20=C:\mysql\bin\winmysqladmin.exe
+file21=C:\mysql\bin\myisam_ftdump.exe
file10=C:\mysql\bin\mysqlimport.exe
fulldirectory=
file11=C:\mysql\bin\mysqlshow.exe
diff --git a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Development.fgl b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Development.fgl
index 6f9df51965b..f56c51fce05 100755
--- a/VC++Files/InstallShield/4.0.XX-classic/File Groups/Development.fgl
+++ b/VC++Files/InstallShield/4.0.XX-classic/File Groups/Development.fgl
@@ -219,6 +219,7 @@ file32=C:\mysql\scripts\mysqlbug.sh
file21=C:\mysql\scripts\mysql_setpermission
file10=C:\mysql\scripts\mysql_find_rows
fulldirectory=
+file44=C:\mysql\scripts\mysql_fix_privilege_tables.sql
file33=C:\mysql\scripts\mysqld_multi
file22=C:\mysql\scripts\mysql_setpermission.pl
file11=C:\mysql\scripts\mysql_find_rows.pl
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 3f875b574f6..8a626c56253 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
@@ -135,6 +135,7 @@ file1=C:\mysql\my-large.cnf
file2=C:\mysql\my-medium.cnf
file3=C:\mysql\my-small.cnf
file4=C:\mysql\MySQLEULA.txt
+file5=C:\mysql\README.txt
SubDir0=bin
SubDir1=share
SubDir2=Embedded
diff --git a/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.rul b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.rul.old
index df143b493c4..df143b493c4 100755
--- a/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.rul
+++ b/VC++Files/InstallShield/4.0.XX-classic/Script Files/Setup.rul.old
diff --git a/VC++Files/InstallShield/4.0.XX-classic/Script Files/setup.rul b/VC++Files/InstallShield/4.0.XX-classic/Script Files/setup.rul
new file mode 100755
index 00000000000..73d61114075
--- /dev/null
+++ b/VC++Files/InstallShield/4.0.XX-classic/Script Files/setup.rul
@@ -0,0 +1,641 @@
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// IIIIIII SSSSSS
+// II SS InstallShield (R)
+// II SSSSSS (c) 1996-1997, InstallShield Software Corporation
+// II SS (c) 1990-1996, InstallShield Corporation
+// IIIIIII SSSSSS All Rights Reserved.
+//
+//
+// This code is generated as a starting setup template. You should
+// modify it to provide all necessary steps for your setup.
+//
+//
+// File Name: Setup.rul
+//
+// Description: InstallShield script
+//
+// Comments: This template script performs a basic setup on a
+// Windows 95 or Windows NT 4.0 platform. With minor
+// modifications, this template can be adapted to create
+// new, customized setups.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+
+ // Include header file
+#include "sdlang.h"
+#include "sddialog.h"
+
+////////////////////// string defines ////////////////////////////
+
+#define UNINST_LOGFILE_NAME "Uninst.isu"
+
+//////////////////// installation declarations ///////////////////
+
+ // ----- DLL prototypes -----
+
+
+ // your DLL prototypes
+
+
+ // ---- script prototypes -----
+
+ // generated
+ prototype ShowDialogs();
+ prototype MoveFileData();
+ prototype HandleMoveDataError( NUMBER );
+ prototype ProcessBeforeDataMove();
+ prototype ProcessAfterDataMove();
+ prototype SetupRegistry();
+ prototype SetupFolders();
+ prototype CleanUpInstall();
+ prototype SetupInstall();
+ prototype SetupScreen();
+ prototype CheckRequirements();
+ prototype DialogShowSdWelcome();
+ prototype DialogShowSdShowInfoList();
+ prototype DialogShowSdAskDestPath();
+ prototype DialogShowSdSetupType();
+ prototype DialogShowSdComponentDialog2();
+ prototype DialogShowSdFinishReboot();
+
+ // your prototypes
+
+
+ // ----- global variables ------
+
+ // generated
+ BOOL bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup;
+ STRING svDir;
+ STRING svName, svCompany, svSerial;
+ STRING szAppPath;
+ STRING svSetupType;
+
+
+ // your global variables
+
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// MAIN PROGRAM
+//
+// The setup begins here by hiding the visible setup
+// window. This is done to allow all the titles, images, etc. to
+// be established before showing the main window. The following
+// logic then performs the setup in a series of steps.
+//
+///////////////////////////////////////////////////////////////////////////////
+program
+ Disable( BACKGROUND );
+
+ CheckRequirements();
+
+ SetupInstall();
+
+ SetupScreen();
+
+ if (ShowDialogs()<0) goto end_install;
+
+ if (ProcessBeforeDataMove()<0) goto end_install;
+
+ if (MoveFileData()<0) goto end_install;
+
+ if (ProcessAfterDataMove()<0) goto end_install;
+
+ if (SetupRegistry()<0) goto end_install;
+
+ if (SetupFolders()<0) goto end_install;
+
+
+ end_install:
+
+ CleanUpInstall();
+
+ // If an unrecoverable error occurred, clean up the partial installation.
+ // Otherwise, exit normally.
+
+ if (bInstallAborted) then
+ abort;
+ endif;
+
+endprogram
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: ShowDialogs //
+// //
+// Purpose: This function manages the display and navigation //
+// the standard dialogs that exist in a setup. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function ShowDialogs()
+ NUMBER nResult;
+ begin
+
+ Dlg_Start:
+ // beginning of dialogs label
+
+ Dlg_SdWelcome:
+ nResult = DialogShowSdWelcome();
+ if (nResult = BACK) goto Dlg_Start;
+
+ Dlg_SdShowInfoList:
+ nResult = DialogShowSdShowInfoList();
+ if (nResult = BACK) goto Dlg_SdWelcome;
+
+ Dlg_SdAskDestPath:
+ nResult = DialogShowSdAskDestPath();
+ if (nResult = BACK) goto Dlg_SdShowInfoList;
+
+ Dlg_SdSetupType:
+ nResult = DialogShowSdSetupType();
+ if (nResult = BACK) goto Dlg_SdAskDestPath;
+
+ Dlg_SdComponentDialog2:
+ if ((nResult = BACK) && (svSetupType != "Custom") && (svSetupType != "")) then
+ goto Dlg_SdSetupType;
+ endif;
+ nResult = DialogShowSdComponentDialog2();
+ if (nResult = BACK) goto Dlg_SdSetupType;
+
+ return 0;
+
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: ProcessBeforeDataMove //
+// //
+// Purpose: This function performs any necessary operations prior to the //
+// actual data move operation. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function ProcessBeforeDataMove()
+ STRING svLogFile;
+ NUMBER nResult;
+ begin
+
+ InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY );
+
+ svLogFile = UNINST_LOGFILE_NAME;
+
+ nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 );
+ if (nResult < 0) then
+ MessageBox( @ERROR_UNINSTSETUP, WARNING );
+ endif;
+
+ szAppPath = TARGETDIR; // TODO : if your application .exe is in a subdir of TARGETDIR then add subdir
+
+ if ((bIs32BitSetup) && (bIsShellExplorer)) then
+// RegDBSetItem( REGDB_APPPATH, szAppPath );
+// RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY );
+ RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME );
+ endif;
+
+ // TODO : update any items you want to process before moving the data
+ //
+
+ return 0;
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: MoveFileData //
+// //
+// Purpose: This function handles the data movement for //
+// the setup. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function MoveFileData()
+ NUMBER nResult, nDisk;
+ begin
+
+ nDisk = 1;
+ SetStatusWindow( 0, "" );
+ Disable( DIALOGCACHE );
+ Enable( STATUS );
+ StatusUpdate( ON, 100 );
+ nResult = ComponentMoveData( MEDIA, nDisk, 0 );
+
+ HandleMoveDataError( nResult );
+
+ Disable( STATUS );
+
+ return nResult;
+
+ end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: HandleMoveDataError //
+// //
+// Purpose: This function handles the error (if any) during the move data //
+// operation. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function HandleMoveDataError( nResult )
+ STRING szErrMsg, svComponent , svFileGroup , svFile;
+ begin
+
+ svComponent = "";
+ svFileGroup = "";
+ svFile = "";
+
+ switch (nResult)
+ case 0:
+ return 0;
+ default:
+ ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult );
+ szErrMsg = @ERROR_MOVEDATA + "\n\n" +
+ @ERROR_COMPONENT + " " + svComponent + "\n" +
+ @ERROR_FILEGROUP + " " + svFileGroup + "\n" +
+ @ERROR_FILE + " " + svFile;
+ SprintfBox( SEVERE, @TITLE_CAPTIONBAR, szErrMsg, nResult );
+ bInstallAborted = TRUE;
+ return nResult;
+ endswitch;
+
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: ProcessAfterDataMove //
+// //
+// Purpose: This function performs any necessary operations needed after //
+// all data has been moved. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function ProcessAfterDataMove()
+ begin
+
+ // TODO : update self-registered files and other processes that
+ // should be performed after the data has been moved.
+
+
+ return 0;
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: SetupRegistry //
+// //
+// Purpose: This function makes the registry entries for this setup. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function SetupRegistry()
+ NUMBER nResult;
+
+ begin
+
+ // TODO : Add all your registry entry keys here
+ //
+ //
+ // RegDBCreateKeyEx, RegDBSetKeyValueEx....
+ //
+
+ nResult = CreateRegistrySet( "" );
+
+ return nResult;
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// Function: SetupFolders
+//
+// Purpose: This function creates all the folders and shortcuts for the
+// setup. This includes program groups and items for Windows 3.1.
+//
+///////////////////////////////////////////////////////////////////////////////
+function SetupFolders()
+ NUMBER nResult;
+
+ begin
+
+
+ // TODO : Add all your folder (program group) along with shortcuts (program items)
+ //
+ //
+ // CreateProgramFolder, AddFolderIcon....
+ //
+
+ nResult = CreateShellObjects( "" );
+
+ return nResult;
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: CleanUpInstall //
+// //
+// Purpose: This cleans up the setup. Anything that should //
+// be released or deleted at the end of the setup should //
+// be done here. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function CleanUpInstall()
+ begin
+
+
+ if (bInstallAborted) then
+ return 0;
+ endif;
+
+ DialogShowSdFinishReboot();
+
+ if (BATCH_INSTALL) then // ensure locked files are properly written
+ CommitSharedFiles(0);
+ endif;
+
+ return 0;
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: SetupInstall //
+// //
+// Purpose: This will setup the installation. Any general initialization //
+// needed for the installation should be performed here. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function SetupInstall()
+ begin
+
+ Enable( CORECOMPONENTHANDLING );
+
+ bInstallAborted = FALSE;
+
+ if (bIs32BitSetup) then
+ svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME;
+ else
+ svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME16 ^ @PRODUCT_NAME16; // use shorten names
+ endif;
+
+ TARGETDIR = svDir;
+
+ SdProductName( @PRODUCT_NAME );
+
+ Enable( DIALOGCACHE );
+
+ return 0;
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: SetupScreen //
+// //
+// Purpose: This function establishes the screen look. This includes //
+// colors, fonts, and text to be displayed. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function SetupScreen()
+ begin
+
+ Enable( FULLWINDOWMODE );
+ Enable( INDVFILESTATUS );
+ SetTitle( @TITLE_MAIN, 24, WHITE );
+
+ SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text.
+
+ Enable( BACKGROUND );
+
+ Delay( 1 );
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: CheckRequirements //
+// //
+// Purpose: This function checks all minimum requirements for the //
+// application being installed. If any fail, then the user //
+// is informed and the setup is terminated. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function CheckRequirements()
+ NUMBER nvDx, nvDy, nvResult;
+ STRING svResult;
+
+ begin
+
+ bWinNT = FALSE;
+ bIsShellExplorer = FALSE;
+
+ // Check screen resolution.
+ GetExtents( nvDx, nvDy );
+
+ if (nvDy < 480) then
+ MessageBox( @ERROR_VGARESOLUTION, WARNING );
+ abort;
+ endif;
+
+ // set 'setup' operation mode
+ bIs32BitSetup = TRUE;
+ GetSystemInfo( ISTYPE, nvResult, svResult );
+ if (nvResult = 16) then
+ bIs32BitSetup = FALSE; // running 16-bit setup
+ return 0; // no additional information required
+ endif;
+
+ // --- 32-bit testing after this point ---
+
+ // Determine the target system's operating system.
+ GetSystemInfo( OS, nvResult, svResult );
+
+ if (nvResult = IS_WINDOWSNT) then
+ // Running Windows NT.
+ bWinNT = TRUE;
+
+ // Check to see if the shell being used is EXPLORER shell.
+ if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then
+ if (nvResult >= 4) then
+ bIsShellExplorer = TRUE;
+ endif;
+ endif;
+
+ elseif (nvResult = IS_WINDOWS95 ) then
+ bIsShellExplorer = TRUE;
+
+ endif;
+
+end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: DialogShowSdWelcome //
+// //
+// Purpose: This function handles the standard welcome dialog. //
+// //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function DialogShowSdWelcome()
+ NUMBER nResult;
+ STRING szTitle, szMsg;
+ begin
+
+ szTitle = "";
+ szMsg = "";
+ nResult = SdWelcome( szTitle, szMsg );
+
+ return nResult;
+ end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: DialogShowSdShowInfoList //
+// //
+// Purpose: This function displays the general information list dialog. //
+// //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function DialogShowSdShowInfoList()
+ NUMBER nResult;
+ LIST list;
+ STRING szTitle, szMsg, szFile;
+ begin
+
+ szFile = SUPPORTDIR ^ "infolist.txt";
+
+ list = ListCreate( STRINGLIST );
+ ListReadFromFile( list, szFile );
+ szTitle = "";
+ szMsg = " ";
+ nResult = SdShowInfoList( szTitle, szMsg, list );
+
+ ListDestroy( list );
+
+ return nResult;
+ end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: DialogShowSdAskDestPath //
+// //
+// Purpose: This function asks the user for the destination directory. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function DialogShowSdAskDestPath()
+ NUMBER nResult;
+ STRING szTitle, szMsg;
+ begin
+
+ szTitle = "";
+ szMsg = "";
+ nResult = SdAskDestPath( szTitle, szMsg, svDir, 0 );
+
+ TARGETDIR = svDir;
+
+ return nResult;
+ end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: DialogShowSdSetupType //
+// //
+// Purpose: This function displays the standard setup type dialog. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function DialogShowSdSetupType()
+ NUMBER nResult, nType;
+ STRING szTitle, szMsg;
+ begin
+
+ switch (svSetupType)
+ case "Typical":
+ nType = TYPICAL;
+ case "Custom":
+ nType = CUSTOM;
+ case "Compact":
+ nType = COMPACT;
+ case "":
+ svSetupType = "Typical";
+ nType = TYPICAL;
+ endswitch;
+
+ szTitle = "";
+ szMsg = "";
+ nResult = SetupType( szTitle, szMsg, "", nType, 0 );
+
+ switch (nResult)
+ case COMPACT:
+ svSetupType = "Compact";
+ case TYPICAL:
+ svSetupType = "Typical";
+ case CUSTOM:
+ svSetupType = "Custom";
+ endswitch;
+
+ return nResult;
+ end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: DialogShowSdComponentDialog2 //
+// //
+// Purpose: This function displays the custom component dialog. //
+// //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function DialogShowSdComponentDialog2()
+ NUMBER nResult;
+ STRING szTitle, szMsg;
+ begin
+
+ if ((svSetupType != "Custom") && (svSetupType != "")) then
+ return 0;
+ endif;
+
+ szTitle = "";
+ szMsg = "";
+ nResult = SdComponentDialog2( szTitle, szMsg, svDir, "" );
+
+ return nResult;
+ end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: DialogShowSdFinishReboot //
+// //
+// Purpose: This function will show the last dialog of the product. //
+// It will allow the user to reboot and/or show some readme text. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function DialogShowSdFinishReboot()
+ NUMBER nResult, nDefOptions;
+ STRING szTitle, szMsg1, szMsg2, szOption1, szOption2;
+ NUMBER bOpt1, bOpt2;
+ begin
+
+ if (!BATCH_INSTALL) then
+ bOpt1 = FALSE;
+ bOpt2 = FALSE;
+ szMsg1 = "";
+ szMsg2 = "";
+ szOption1 = "";
+ szOption2 = "";
+ nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 );
+ return 0;
+ endif;
+
+ nDefOptions = SYS_BOOTMACHINE;
+ szTitle = "";
+ szMsg1 = "";
+ szMsg2 = "";
+ nResult = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 );
+
+ return nResult;
+ end;
+
+ // --- include script file section ---
+
+#include "sddialog.rul"
+
+
+
diff --git a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Clients and Tools.fgl b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Clients and Tools.fgl
index 7bba3d7474a..ed1e42e65b6 100755
--- a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Clients and Tools.fgl
+++ b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Clients and Tools.fgl
@@ -15,6 +15,7 @@ file7=C:\mysql\bin\mysqlc.exe
file8=C:\mysql\bin\mysqlcheck.exe
file9=C:\mysql\bin\mysqldump.exe
file20=C:\mysql\bin\winmysqladmin.exe
+file21=C:\mysql\bin\myisam_ftdump.exe
file10=C:\mysql\bin\mysqlimport.exe
fulldirectory=
file11=C:\mysql\bin\mysqlshow.exe
diff --git a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Development.fgl b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Development.fgl
index 401509e9b7a..02e01d564aa 100755
--- a/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Development.fgl
+++ b/VC++Files/InstallShield/4.0.XX-gpl/File Groups/Development.fgl
@@ -220,6 +220,7 @@ file32=C:\mysql\scripts\mysqlbug.sh
file21=C:\mysql\scripts\mysql_setpermission
file10=C:\mysql\scripts\mysql_find_rows
fulldirectory=
+file44=C:\mysql\scripts\mysql_fix_privilege_tables.sql
file33=C:\mysql\scripts\mysqld_multi
file22=C:\mysql\scripts\mysql_setpermission.pl
file11=C:\mysql\scripts\mysql_find_rows.pl
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 64883f7f369..c54ff378a55 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
@@ -132,12 +132,12 @@ file1=C:\mysql\share\greek\errmsg.txt
fulldirectory=
[TopDir]
-file0=C:\mysql\Readme
-file1=C:\mysql\mysqlbug.txt
-file2=C:\mysql\my-huge.cnf
-file3=C:\mysql\my-large.cnf
-file4=C:\mysql\my-medium.cnf
-file5=C:\mysql\my-small.cnf
+file0=C:\mysql\mysqlbug.txt
+file1=C:\mysql\my-huge.cnf
+file2=C:\mysql\my-large.cnf
+file3=C:\mysql\my-medium.cnf
+file4=C:\mysql\my-small.cnf
+file5=C:\mysql\README.txt
SubDir0=bin
SubDir1=share
SubDir2=Embedded
diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.rul b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.rul.old
index df143b493c4..df143b493c4 100755
--- a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.rul
+++ b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/Setup.rul.old
diff --git a/VC++Files/InstallShield/4.0.XX-gpl/Script Files/setup.rul b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/setup.rul
new file mode 100755
index 00000000000..73d61114075
--- /dev/null
+++ b/VC++Files/InstallShield/4.0.XX-gpl/Script Files/setup.rul
@@ -0,0 +1,641 @@
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// IIIIIII SSSSSS
+// II SS InstallShield (R)
+// II SSSSSS (c) 1996-1997, InstallShield Software Corporation
+// II SS (c) 1990-1996, InstallShield Corporation
+// IIIIIII SSSSSS All Rights Reserved.
+//
+//
+// This code is generated as a starting setup template. You should
+// modify it to provide all necessary steps for your setup.
+//
+//
+// File Name: Setup.rul
+//
+// Description: InstallShield script
+//
+// Comments: This template script performs a basic setup on a
+// Windows 95 or Windows NT 4.0 platform. With minor
+// modifications, this template can be adapted to create
+// new, customized setups.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+
+ // Include header file
+#include "sdlang.h"
+#include "sddialog.h"
+
+////////////////////// string defines ////////////////////////////
+
+#define UNINST_LOGFILE_NAME "Uninst.isu"
+
+//////////////////// installation declarations ///////////////////
+
+ // ----- DLL prototypes -----
+
+
+ // your DLL prototypes
+
+
+ // ---- script prototypes -----
+
+ // generated
+ prototype ShowDialogs();
+ prototype MoveFileData();
+ prototype HandleMoveDataError( NUMBER );
+ prototype ProcessBeforeDataMove();
+ prototype ProcessAfterDataMove();
+ prototype SetupRegistry();
+ prototype SetupFolders();
+ prototype CleanUpInstall();
+ prototype SetupInstall();
+ prototype SetupScreen();
+ prototype CheckRequirements();
+ prototype DialogShowSdWelcome();
+ prototype DialogShowSdShowInfoList();
+ prototype DialogShowSdAskDestPath();
+ prototype DialogShowSdSetupType();
+ prototype DialogShowSdComponentDialog2();
+ prototype DialogShowSdFinishReboot();
+
+ // your prototypes
+
+
+ // ----- global variables ------
+
+ // generated
+ BOOL bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup;
+ STRING svDir;
+ STRING svName, svCompany, svSerial;
+ STRING szAppPath;
+ STRING svSetupType;
+
+
+ // your global variables
+
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// MAIN PROGRAM
+//
+// The setup begins here by hiding the visible setup
+// window. This is done to allow all the titles, images, etc. to
+// be established before showing the main window. The following
+// logic then performs the setup in a series of steps.
+//
+///////////////////////////////////////////////////////////////////////////////
+program
+ Disable( BACKGROUND );
+
+ CheckRequirements();
+
+ SetupInstall();
+
+ SetupScreen();
+
+ if (ShowDialogs()<0) goto end_install;
+
+ if (ProcessBeforeDataMove()<0) goto end_install;
+
+ if (MoveFileData()<0) goto end_install;
+
+ if (ProcessAfterDataMove()<0) goto end_install;
+
+ if (SetupRegistry()<0) goto end_install;
+
+ if (SetupFolders()<0) goto end_install;
+
+
+ end_install:
+
+ CleanUpInstall();
+
+ // If an unrecoverable error occurred, clean up the partial installation.
+ // Otherwise, exit normally.
+
+ if (bInstallAborted) then
+ abort;
+ endif;
+
+endprogram
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: ShowDialogs //
+// //
+// Purpose: This function manages the display and navigation //
+// the standard dialogs that exist in a setup. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function ShowDialogs()
+ NUMBER nResult;
+ begin
+
+ Dlg_Start:
+ // beginning of dialogs label
+
+ Dlg_SdWelcome:
+ nResult = DialogShowSdWelcome();
+ if (nResult = BACK) goto Dlg_Start;
+
+ Dlg_SdShowInfoList:
+ nResult = DialogShowSdShowInfoList();
+ if (nResult = BACK) goto Dlg_SdWelcome;
+
+ Dlg_SdAskDestPath:
+ nResult = DialogShowSdAskDestPath();
+ if (nResult = BACK) goto Dlg_SdShowInfoList;
+
+ Dlg_SdSetupType:
+ nResult = DialogShowSdSetupType();
+ if (nResult = BACK) goto Dlg_SdAskDestPath;
+
+ Dlg_SdComponentDialog2:
+ if ((nResult = BACK) && (svSetupType != "Custom") && (svSetupType != "")) then
+ goto Dlg_SdSetupType;
+ endif;
+ nResult = DialogShowSdComponentDialog2();
+ if (nResult = BACK) goto Dlg_SdSetupType;
+
+ return 0;
+
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: ProcessBeforeDataMove //
+// //
+// Purpose: This function performs any necessary operations prior to the //
+// actual data move operation. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function ProcessBeforeDataMove()
+ STRING svLogFile;
+ NUMBER nResult;
+ begin
+
+ InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY );
+
+ svLogFile = UNINST_LOGFILE_NAME;
+
+ nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 );
+ if (nResult < 0) then
+ MessageBox( @ERROR_UNINSTSETUP, WARNING );
+ endif;
+
+ szAppPath = TARGETDIR; // TODO : if your application .exe is in a subdir of TARGETDIR then add subdir
+
+ if ((bIs32BitSetup) && (bIsShellExplorer)) then
+// RegDBSetItem( REGDB_APPPATH, szAppPath );
+// RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY );
+ RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME );
+ endif;
+
+ // TODO : update any items you want to process before moving the data
+ //
+
+ return 0;
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: MoveFileData //
+// //
+// Purpose: This function handles the data movement for //
+// the setup. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function MoveFileData()
+ NUMBER nResult, nDisk;
+ begin
+
+ nDisk = 1;
+ SetStatusWindow( 0, "" );
+ Disable( DIALOGCACHE );
+ Enable( STATUS );
+ StatusUpdate( ON, 100 );
+ nResult = ComponentMoveData( MEDIA, nDisk, 0 );
+
+ HandleMoveDataError( nResult );
+
+ Disable( STATUS );
+
+ return nResult;
+
+ end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: HandleMoveDataError //
+// //
+// Purpose: This function handles the error (if any) during the move data //
+// operation. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function HandleMoveDataError( nResult )
+ STRING szErrMsg, svComponent , svFileGroup , svFile;
+ begin
+
+ svComponent = "";
+ svFileGroup = "";
+ svFile = "";
+
+ switch (nResult)
+ case 0:
+ return 0;
+ default:
+ ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult );
+ szErrMsg = @ERROR_MOVEDATA + "\n\n" +
+ @ERROR_COMPONENT + " " + svComponent + "\n" +
+ @ERROR_FILEGROUP + " " + svFileGroup + "\n" +
+ @ERROR_FILE + " " + svFile;
+ SprintfBox( SEVERE, @TITLE_CAPTIONBAR, szErrMsg, nResult );
+ bInstallAborted = TRUE;
+ return nResult;
+ endswitch;
+
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: ProcessAfterDataMove //
+// //
+// Purpose: This function performs any necessary operations needed after //
+// all data has been moved. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function ProcessAfterDataMove()
+ begin
+
+ // TODO : update self-registered files and other processes that
+ // should be performed after the data has been moved.
+
+
+ return 0;
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: SetupRegistry //
+// //
+// Purpose: This function makes the registry entries for this setup. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function SetupRegistry()
+ NUMBER nResult;
+
+ begin
+
+ // TODO : Add all your registry entry keys here
+ //
+ //
+ // RegDBCreateKeyEx, RegDBSetKeyValueEx....
+ //
+
+ nResult = CreateRegistrySet( "" );
+
+ return nResult;
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// Function: SetupFolders
+//
+// Purpose: This function creates all the folders and shortcuts for the
+// setup. This includes program groups and items for Windows 3.1.
+//
+///////////////////////////////////////////////////////////////////////////////
+function SetupFolders()
+ NUMBER nResult;
+
+ begin
+
+
+ // TODO : Add all your folder (program group) along with shortcuts (program items)
+ //
+ //
+ // CreateProgramFolder, AddFolderIcon....
+ //
+
+ nResult = CreateShellObjects( "" );
+
+ return nResult;
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: CleanUpInstall //
+// //
+// Purpose: This cleans up the setup. Anything that should //
+// be released or deleted at the end of the setup should //
+// be done here. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function CleanUpInstall()
+ begin
+
+
+ if (bInstallAborted) then
+ return 0;
+ endif;
+
+ DialogShowSdFinishReboot();
+
+ if (BATCH_INSTALL) then // ensure locked files are properly written
+ CommitSharedFiles(0);
+ endif;
+
+ return 0;
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: SetupInstall //
+// //
+// Purpose: This will setup the installation. Any general initialization //
+// needed for the installation should be performed here. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function SetupInstall()
+ begin
+
+ Enable( CORECOMPONENTHANDLING );
+
+ bInstallAborted = FALSE;
+
+ if (bIs32BitSetup) then
+ svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME;
+ else
+ svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME16 ^ @PRODUCT_NAME16; // use shorten names
+ endif;
+
+ TARGETDIR = svDir;
+
+ SdProductName( @PRODUCT_NAME );
+
+ Enable( DIALOGCACHE );
+
+ return 0;
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: SetupScreen //
+// //
+// Purpose: This function establishes the screen look. This includes //
+// colors, fonts, and text to be displayed. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function SetupScreen()
+ begin
+
+ Enable( FULLWINDOWMODE );
+ Enable( INDVFILESTATUS );
+ SetTitle( @TITLE_MAIN, 24, WHITE );
+
+ SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text.
+
+ Enable( BACKGROUND );
+
+ Delay( 1 );
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: CheckRequirements //
+// //
+// Purpose: This function checks all minimum requirements for the //
+// application being installed. If any fail, then the user //
+// is informed and the setup is terminated. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function CheckRequirements()
+ NUMBER nvDx, nvDy, nvResult;
+ STRING svResult;
+
+ begin
+
+ bWinNT = FALSE;
+ bIsShellExplorer = FALSE;
+
+ // Check screen resolution.
+ GetExtents( nvDx, nvDy );
+
+ if (nvDy < 480) then
+ MessageBox( @ERROR_VGARESOLUTION, WARNING );
+ abort;
+ endif;
+
+ // set 'setup' operation mode
+ bIs32BitSetup = TRUE;
+ GetSystemInfo( ISTYPE, nvResult, svResult );
+ if (nvResult = 16) then
+ bIs32BitSetup = FALSE; // running 16-bit setup
+ return 0; // no additional information required
+ endif;
+
+ // --- 32-bit testing after this point ---
+
+ // Determine the target system's operating system.
+ GetSystemInfo( OS, nvResult, svResult );
+
+ if (nvResult = IS_WINDOWSNT) then
+ // Running Windows NT.
+ bWinNT = TRUE;
+
+ // Check to see if the shell being used is EXPLORER shell.
+ if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then
+ if (nvResult >= 4) then
+ bIsShellExplorer = TRUE;
+ endif;
+ endif;
+
+ elseif (nvResult = IS_WINDOWS95 ) then
+ bIsShellExplorer = TRUE;
+
+ endif;
+
+end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: DialogShowSdWelcome //
+// //
+// Purpose: This function handles the standard welcome dialog. //
+// //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function DialogShowSdWelcome()
+ NUMBER nResult;
+ STRING szTitle, szMsg;
+ begin
+
+ szTitle = "";
+ szMsg = "";
+ nResult = SdWelcome( szTitle, szMsg );
+
+ return nResult;
+ end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: DialogShowSdShowInfoList //
+// //
+// Purpose: This function displays the general information list dialog. //
+// //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function DialogShowSdShowInfoList()
+ NUMBER nResult;
+ LIST list;
+ STRING szTitle, szMsg, szFile;
+ begin
+
+ szFile = SUPPORTDIR ^ "infolist.txt";
+
+ list = ListCreate( STRINGLIST );
+ ListReadFromFile( list, szFile );
+ szTitle = "";
+ szMsg = " ";
+ nResult = SdShowInfoList( szTitle, szMsg, list );
+
+ ListDestroy( list );
+
+ return nResult;
+ end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: DialogShowSdAskDestPath //
+// //
+// Purpose: This function asks the user for the destination directory. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function DialogShowSdAskDestPath()
+ NUMBER nResult;
+ STRING szTitle, szMsg;
+ begin
+
+ szTitle = "";
+ szMsg = "";
+ nResult = SdAskDestPath( szTitle, szMsg, svDir, 0 );
+
+ TARGETDIR = svDir;
+
+ return nResult;
+ end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: DialogShowSdSetupType //
+// //
+// Purpose: This function displays the standard setup type dialog. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function DialogShowSdSetupType()
+ NUMBER nResult, nType;
+ STRING szTitle, szMsg;
+ begin
+
+ switch (svSetupType)
+ case "Typical":
+ nType = TYPICAL;
+ case "Custom":
+ nType = CUSTOM;
+ case "Compact":
+ nType = COMPACT;
+ case "":
+ svSetupType = "Typical";
+ nType = TYPICAL;
+ endswitch;
+
+ szTitle = "";
+ szMsg = "";
+ nResult = SetupType( szTitle, szMsg, "", nType, 0 );
+
+ switch (nResult)
+ case COMPACT:
+ svSetupType = "Compact";
+ case TYPICAL:
+ svSetupType = "Typical";
+ case CUSTOM:
+ svSetupType = "Custom";
+ endswitch;
+
+ return nResult;
+ end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: DialogShowSdComponentDialog2 //
+// //
+// Purpose: This function displays the custom component dialog. //
+// //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function DialogShowSdComponentDialog2()
+ NUMBER nResult;
+ STRING szTitle, szMsg;
+ begin
+
+ if ((svSetupType != "Custom") && (svSetupType != "")) then
+ return 0;
+ endif;
+
+ szTitle = "";
+ szMsg = "";
+ nResult = SdComponentDialog2( szTitle, szMsg, svDir, "" );
+
+ return nResult;
+ end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: DialogShowSdFinishReboot //
+// //
+// Purpose: This function will show the last dialog of the product. //
+// It will allow the user to reboot and/or show some readme text. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function DialogShowSdFinishReboot()
+ NUMBER nResult, nDefOptions;
+ STRING szTitle, szMsg1, szMsg2, szOption1, szOption2;
+ NUMBER bOpt1, bOpt2;
+ begin
+
+ if (!BATCH_INSTALL) then
+ bOpt1 = FALSE;
+ bOpt2 = FALSE;
+ szMsg1 = "";
+ szMsg2 = "";
+ szOption1 = "";
+ szOption2 = "";
+ nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 );
+ return 0;
+ endif;
+
+ nDefOptions = SYS_BOOTMACHINE;
+ szTitle = "";
+ szMsg1 = "";
+ szMsg2 = "";
+ nResult = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 );
+
+ return nResult;
+ end;
+
+ // --- include script file section ---
+
+#include "sddialog.rul"
+
+
+
diff --git a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Clients and Tools.fgl b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Clients and Tools.fgl
index 7bba3d7474a..ed1e42e65b6 100755
--- a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Clients and Tools.fgl
+++ b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Clients and Tools.fgl
@@ -15,6 +15,7 @@ file7=C:\mysql\bin\mysqlc.exe
file8=C:\mysql\bin\mysqlcheck.exe
file9=C:\mysql\bin\mysqldump.exe
file20=C:\mysql\bin\winmysqladmin.exe
+file21=C:\mysql\bin\myisam_ftdump.exe
file10=C:\mysql\bin\mysqlimport.exe
fulldirectory=
file11=C:\mysql\bin\mysqlshow.exe
diff --git a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Development.fgl b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Development.fgl
index df4c058f8ce..292cc867909 100755
--- a/VC++Files/InstallShield/4.0.XX-pro/File Groups/Development.fgl
+++ b/VC++Files/InstallShield/4.0.XX-pro/File Groups/Development.fgl
@@ -219,6 +219,7 @@ file32=C:\mysql\scripts\mysqlbug.sh
file21=C:\mysql\scripts\mysql_setpermission
file10=C:\mysql\scripts\mysql_find_rows
fulldirectory=
+file44=C:\mysql\scripts\mysql_fix_privilege_tables.sql
file33=C:\mysql\scripts\mysqld_multi
file22=C:\mysql\scripts\mysql_setpermission.pl
file11=C:\mysql\scripts\mysql_find_rows.pl
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 3f875b574f6..8a626c56253 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
@@ -135,6 +135,7 @@ file1=C:\mysql\my-large.cnf
file2=C:\mysql\my-medium.cnf
file3=C:\mysql\my-small.cnf
file4=C:\mysql\MySQLEULA.txt
+file5=C:\mysql\README.txt
SubDir0=bin
SubDir1=share
SubDir2=Embedded
diff --git a/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.rul b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.rul.old
index df143b493c4..df143b493c4 100755
--- a/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.rul
+++ b/VC++Files/InstallShield/4.0.XX-pro/Script Files/Setup.rul.old
diff --git a/VC++Files/InstallShield/4.0.XX-pro/Script Files/setup.rul b/VC++Files/InstallShield/4.0.XX-pro/Script Files/setup.rul
new file mode 100755
index 00000000000..73d61114075
--- /dev/null
+++ b/VC++Files/InstallShield/4.0.XX-pro/Script Files/setup.rul
@@ -0,0 +1,641 @@
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// IIIIIII SSSSSS
+// II SS InstallShield (R)
+// II SSSSSS (c) 1996-1997, InstallShield Software Corporation
+// II SS (c) 1990-1996, InstallShield Corporation
+// IIIIIII SSSSSS All Rights Reserved.
+//
+//
+// This code is generated as a starting setup template. You should
+// modify it to provide all necessary steps for your setup.
+//
+//
+// File Name: Setup.rul
+//
+// Description: InstallShield script
+//
+// Comments: This template script performs a basic setup on a
+// Windows 95 or Windows NT 4.0 platform. With minor
+// modifications, this template can be adapted to create
+// new, customized setups.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+
+ // Include header file
+#include "sdlang.h"
+#include "sddialog.h"
+
+////////////////////// string defines ////////////////////////////
+
+#define UNINST_LOGFILE_NAME "Uninst.isu"
+
+//////////////////// installation declarations ///////////////////
+
+ // ----- DLL prototypes -----
+
+
+ // your DLL prototypes
+
+
+ // ---- script prototypes -----
+
+ // generated
+ prototype ShowDialogs();
+ prototype MoveFileData();
+ prototype HandleMoveDataError( NUMBER );
+ prototype ProcessBeforeDataMove();
+ prototype ProcessAfterDataMove();
+ prototype SetupRegistry();
+ prototype SetupFolders();
+ prototype CleanUpInstall();
+ prototype SetupInstall();
+ prototype SetupScreen();
+ prototype CheckRequirements();
+ prototype DialogShowSdWelcome();
+ prototype DialogShowSdShowInfoList();
+ prototype DialogShowSdAskDestPath();
+ prototype DialogShowSdSetupType();
+ prototype DialogShowSdComponentDialog2();
+ prototype DialogShowSdFinishReboot();
+
+ // your prototypes
+
+
+ // ----- global variables ------
+
+ // generated
+ BOOL bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup;
+ STRING svDir;
+ STRING svName, svCompany, svSerial;
+ STRING szAppPath;
+ STRING svSetupType;
+
+
+ // your global variables
+
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// MAIN PROGRAM
+//
+// The setup begins here by hiding the visible setup
+// window. This is done to allow all the titles, images, etc. to
+// be established before showing the main window. The following
+// logic then performs the setup in a series of steps.
+//
+///////////////////////////////////////////////////////////////////////////////
+program
+ Disable( BACKGROUND );
+
+ CheckRequirements();
+
+ SetupInstall();
+
+ SetupScreen();
+
+ if (ShowDialogs()<0) goto end_install;
+
+ if (ProcessBeforeDataMove()<0) goto end_install;
+
+ if (MoveFileData()<0) goto end_install;
+
+ if (ProcessAfterDataMove()<0) goto end_install;
+
+ if (SetupRegistry()<0) goto end_install;
+
+ if (SetupFolders()<0) goto end_install;
+
+
+ end_install:
+
+ CleanUpInstall();
+
+ // If an unrecoverable error occurred, clean up the partial installation.
+ // Otherwise, exit normally.
+
+ if (bInstallAborted) then
+ abort;
+ endif;
+
+endprogram
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: ShowDialogs //
+// //
+// Purpose: This function manages the display and navigation //
+// the standard dialogs that exist in a setup. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function ShowDialogs()
+ NUMBER nResult;
+ begin
+
+ Dlg_Start:
+ // beginning of dialogs label
+
+ Dlg_SdWelcome:
+ nResult = DialogShowSdWelcome();
+ if (nResult = BACK) goto Dlg_Start;
+
+ Dlg_SdShowInfoList:
+ nResult = DialogShowSdShowInfoList();
+ if (nResult = BACK) goto Dlg_SdWelcome;
+
+ Dlg_SdAskDestPath:
+ nResult = DialogShowSdAskDestPath();
+ if (nResult = BACK) goto Dlg_SdShowInfoList;
+
+ Dlg_SdSetupType:
+ nResult = DialogShowSdSetupType();
+ if (nResult = BACK) goto Dlg_SdAskDestPath;
+
+ Dlg_SdComponentDialog2:
+ if ((nResult = BACK) && (svSetupType != "Custom") && (svSetupType != "")) then
+ goto Dlg_SdSetupType;
+ endif;
+ nResult = DialogShowSdComponentDialog2();
+ if (nResult = BACK) goto Dlg_SdSetupType;
+
+ return 0;
+
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: ProcessBeforeDataMove //
+// //
+// Purpose: This function performs any necessary operations prior to the //
+// actual data move operation. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function ProcessBeforeDataMove()
+ STRING svLogFile;
+ NUMBER nResult;
+ begin
+
+ InstallationInfo( @COMPANY_NAME, @PRODUCT_NAME, @PRODUCT_VERSION, @PRODUCT_KEY );
+
+ svLogFile = UNINST_LOGFILE_NAME;
+
+ nResult = DeinstallStart( svDir, svLogFile, @UNINST_KEY, 0 );
+ if (nResult < 0) then
+ MessageBox( @ERROR_UNINSTSETUP, WARNING );
+ endif;
+
+ szAppPath = TARGETDIR; // TODO : if your application .exe is in a subdir of TARGETDIR then add subdir
+
+ if ((bIs32BitSetup) && (bIsShellExplorer)) then
+// RegDBSetItem( REGDB_APPPATH, szAppPath );
+// RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY );
+ RegDBSetItem( REGDB_UNINSTALL_NAME, @UNINST_DISPLAY_NAME );
+ endif;
+
+ // TODO : update any items you want to process before moving the data
+ //
+
+ return 0;
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: MoveFileData //
+// //
+// Purpose: This function handles the data movement for //
+// the setup. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function MoveFileData()
+ NUMBER nResult, nDisk;
+ begin
+
+ nDisk = 1;
+ SetStatusWindow( 0, "" );
+ Disable( DIALOGCACHE );
+ Enable( STATUS );
+ StatusUpdate( ON, 100 );
+ nResult = ComponentMoveData( MEDIA, nDisk, 0 );
+
+ HandleMoveDataError( nResult );
+
+ Disable( STATUS );
+
+ return nResult;
+
+ end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: HandleMoveDataError //
+// //
+// Purpose: This function handles the error (if any) during the move data //
+// operation. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function HandleMoveDataError( nResult )
+ STRING szErrMsg, svComponent , svFileGroup , svFile;
+ begin
+
+ svComponent = "";
+ svFileGroup = "";
+ svFile = "";
+
+ switch (nResult)
+ case 0:
+ return 0;
+ default:
+ ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult );
+ szErrMsg = @ERROR_MOVEDATA + "\n\n" +
+ @ERROR_COMPONENT + " " + svComponent + "\n" +
+ @ERROR_FILEGROUP + " " + svFileGroup + "\n" +
+ @ERROR_FILE + " " + svFile;
+ SprintfBox( SEVERE, @TITLE_CAPTIONBAR, szErrMsg, nResult );
+ bInstallAborted = TRUE;
+ return nResult;
+ endswitch;
+
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: ProcessAfterDataMove //
+// //
+// Purpose: This function performs any necessary operations needed after //
+// all data has been moved. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function ProcessAfterDataMove()
+ begin
+
+ // TODO : update self-registered files and other processes that
+ // should be performed after the data has been moved.
+
+
+ return 0;
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: SetupRegistry //
+// //
+// Purpose: This function makes the registry entries for this setup. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function SetupRegistry()
+ NUMBER nResult;
+
+ begin
+
+ // TODO : Add all your registry entry keys here
+ //
+ //
+ // RegDBCreateKeyEx, RegDBSetKeyValueEx....
+ //
+
+ nResult = CreateRegistrySet( "" );
+
+ return nResult;
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// Function: SetupFolders
+//
+// Purpose: This function creates all the folders and shortcuts for the
+// setup. This includes program groups and items for Windows 3.1.
+//
+///////////////////////////////////////////////////////////////////////////////
+function SetupFolders()
+ NUMBER nResult;
+
+ begin
+
+
+ // TODO : Add all your folder (program group) along with shortcuts (program items)
+ //
+ //
+ // CreateProgramFolder, AddFolderIcon....
+ //
+
+ nResult = CreateShellObjects( "" );
+
+ return nResult;
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: CleanUpInstall //
+// //
+// Purpose: This cleans up the setup. Anything that should //
+// be released or deleted at the end of the setup should //
+// be done here. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function CleanUpInstall()
+ begin
+
+
+ if (bInstallAborted) then
+ return 0;
+ endif;
+
+ DialogShowSdFinishReboot();
+
+ if (BATCH_INSTALL) then // ensure locked files are properly written
+ CommitSharedFiles(0);
+ endif;
+
+ return 0;
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: SetupInstall //
+// //
+// Purpose: This will setup the installation. Any general initialization //
+// needed for the installation should be performed here. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function SetupInstall()
+ begin
+
+ Enable( CORECOMPONENTHANDLING );
+
+ bInstallAborted = FALSE;
+
+ if (bIs32BitSetup) then
+ svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME;
+ else
+ svDir = "C:\\mysql"; //PROGRAMFILES ^ @COMPANY_NAME16 ^ @PRODUCT_NAME16; // use shorten names
+ endif;
+
+ TARGETDIR = svDir;
+
+ SdProductName( @PRODUCT_NAME );
+
+ Enable( DIALOGCACHE );
+
+ return 0;
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: SetupScreen //
+// //
+// Purpose: This function establishes the screen look. This includes //
+// colors, fonts, and text to be displayed. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function SetupScreen()
+ begin
+
+ Enable( FULLWINDOWMODE );
+ Enable( INDVFILESTATUS );
+ SetTitle( @TITLE_MAIN, 24, WHITE );
+
+ SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION ); // Caption bar text.
+
+ Enable( BACKGROUND );
+
+ Delay( 1 );
+ end;
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: CheckRequirements //
+// //
+// Purpose: This function checks all minimum requirements for the //
+// application being installed. If any fail, then the user //
+// is informed and the setup is terminated. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function CheckRequirements()
+ NUMBER nvDx, nvDy, nvResult;
+ STRING svResult;
+
+ begin
+
+ bWinNT = FALSE;
+ bIsShellExplorer = FALSE;
+
+ // Check screen resolution.
+ GetExtents( nvDx, nvDy );
+
+ if (nvDy < 480) then
+ MessageBox( @ERROR_VGARESOLUTION, WARNING );
+ abort;
+ endif;
+
+ // set 'setup' operation mode
+ bIs32BitSetup = TRUE;
+ GetSystemInfo( ISTYPE, nvResult, svResult );
+ if (nvResult = 16) then
+ bIs32BitSetup = FALSE; // running 16-bit setup
+ return 0; // no additional information required
+ endif;
+
+ // --- 32-bit testing after this point ---
+
+ // Determine the target system's operating system.
+ GetSystemInfo( OS, nvResult, svResult );
+
+ if (nvResult = IS_WINDOWSNT) then
+ // Running Windows NT.
+ bWinNT = TRUE;
+
+ // Check to see if the shell being used is EXPLORER shell.
+ if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then
+ if (nvResult >= 4) then
+ bIsShellExplorer = TRUE;
+ endif;
+ endif;
+
+ elseif (nvResult = IS_WINDOWS95 ) then
+ bIsShellExplorer = TRUE;
+
+ endif;
+
+end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: DialogShowSdWelcome //
+// //
+// Purpose: This function handles the standard welcome dialog. //
+// //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function DialogShowSdWelcome()
+ NUMBER nResult;
+ STRING szTitle, szMsg;
+ begin
+
+ szTitle = "";
+ szMsg = "";
+ nResult = SdWelcome( szTitle, szMsg );
+
+ return nResult;
+ end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: DialogShowSdShowInfoList //
+// //
+// Purpose: This function displays the general information list dialog. //
+// //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function DialogShowSdShowInfoList()
+ NUMBER nResult;
+ LIST list;
+ STRING szTitle, szMsg, szFile;
+ begin
+
+ szFile = SUPPORTDIR ^ "infolist.txt";
+
+ list = ListCreate( STRINGLIST );
+ ListReadFromFile( list, szFile );
+ szTitle = "";
+ szMsg = " ";
+ nResult = SdShowInfoList( szTitle, szMsg, list );
+
+ ListDestroy( list );
+
+ return nResult;
+ end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: DialogShowSdAskDestPath //
+// //
+// Purpose: This function asks the user for the destination directory. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function DialogShowSdAskDestPath()
+ NUMBER nResult;
+ STRING szTitle, szMsg;
+ begin
+
+ szTitle = "";
+ szMsg = "";
+ nResult = SdAskDestPath( szTitle, szMsg, svDir, 0 );
+
+ TARGETDIR = svDir;
+
+ return nResult;
+ end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: DialogShowSdSetupType //
+// //
+// Purpose: This function displays the standard setup type dialog. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function DialogShowSdSetupType()
+ NUMBER nResult, nType;
+ STRING szTitle, szMsg;
+ begin
+
+ switch (svSetupType)
+ case "Typical":
+ nType = TYPICAL;
+ case "Custom":
+ nType = CUSTOM;
+ case "Compact":
+ nType = COMPACT;
+ case "":
+ svSetupType = "Typical";
+ nType = TYPICAL;
+ endswitch;
+
+ szTitle = "";
+ szMsg = "";
+ nResult = SetupType( szTitle, szMsg, "", nType, 0 );
+
+ switch (nResult)
+ case COMPACT:
+ svSetupType = "Compact";
+ case TYPICAL:
+ svSetupType = "Typical";
+ case CUSTOM:
+ svSetupType = "Custom";
+ endswitch;
+
+ return nResult;
+ end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: DialogShowSdComponentDialog2 //
+// //
+// Purpose: This function displays the custom component dialog. //
+// //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function DialogShowSdComponentDialog2()
+ NUMBER nResult;
+ STRING szTitle, szMsg;
+ begin
+
+ if ((svSetupType != "Custom") && (svSetupType != "")) then
+ return 0;
+ endif;
+
+ szTitle = "";
+ szMsg = "";
+ nResult = SdComponentDialog2( szTitle, szMsg, svDir, "" );
+
+ return nResult;
+ end;
+
+
+///////////////////////////////////////////////////////////////////////////////
+// //
+// Function: DialogShowSdFinishReboot //
+// //
+// Purpose: This function will show the last dialog of the product. //
+// It will allow the user to reboot and/or show some readme text. //
+// //
+///////////////////////////////////////////////////////////////////////////////
+function DialogShowSdFinishReboot()
+ NUMBER nResult, nDefOptions;
+ STRING szTitle, szMsg1, szMsg2, szOption1, szOption2;
+ NUMBER bOpt1, bOpt2;
+ begin
+
+ if (!BATCH_INSTALL) then
+ bOpt1 = FALSE;
+ bOpt2 = FALSE;
+ szMsg1 = "";
+ szMsg2 = "";
+ szOption1 = "";
+ szOption2 = "";
+ nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 );
+ return 0;
+ endif;
+
+ nDefOptions = SYS_BOOTMACHINE;
+ szTitle = "";
+ szMsg1 = "";
+ szMsg2 = "";
+ nResult = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 );
+
+ return nResult;
+ end;
+
+ // --- include script file section ---
+
+#include "sddialog.rul"
+
+
+
diff --git a/VC++Files/client/mysqlclient.dsp b/VC++Files/client/mysqlclient.dsp
index 2a1b52d54ee..46a4d2c89eb 100644
--- a/VC++Files/client/mysqlclient.dsp
+++ b/VC++Files/client/mysqlclient.dsp
@@ -7,25 +7,25 @@
CFG=mysqlclient - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "mysqlclient.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "mysqlclient.mak" CFG="mysqlclient - Win32 Debug"
-!MESSAGE
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE
!MESSAGE "mysqlclient - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "mysqlclient - Win32 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=xicl6.exe
+CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "mysqlclient - Win32 Release"
@@ -48,7 +48,7 @@ RSC=rc.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=xilink6.exe -lib
+LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_release\mysqlclient.lib"
@@ -72,11 +72,11 @@ LIB32=xilink6.exe -lib
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=xilink6.exe -lib
+LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_debug\mysqlclient.lib"
-!ENDIF
+!ENDIF
# Begin Target
@@ -252,7 +252,7 @@ SOURCE=..\mysys\mf_iocache2.c
# ADD CPP /Od
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -310,6 +310,10 @@ SOURCE=..\mysys\my_error.c
# End Source File
# Begin Source File
+SOURCE=..\mysys\my_file.c
+# End Source File
+# Begin Source File
+
SOURCE=..\mysys\my_fopen.c
# End Source File
# Begin Source File
@@ -486,6 +490,10 @@ SOURCE=..\strings\strnmov.c
# End Source File
# Begin Source File
+SOURCE=..\strings\strtod.c
+# End Source File
+# Begin Source File
+
SOURCE=..\strings\strtoll.c
# End Source File
# Begin Source File
diff --git a/VC++Files/comp_err/comp_err.dsp b/VC++Files/comp_err/comp_err.dsp
index d9fc740ced8..e28855aed41 100644
--- a/VC++Files/comp_err/comp_err.dsp
+++ b/VC++Files/comp_err/comp_err.dsp
@@ -7,24 +7,24 @@
CFG=comp_err - Win32 Release
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "comp_err.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "comp_err.mak" CFG="comp_err - Win32 Release"
-!MESSAGE
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE
!MESSAGE "comp_err - Win32 Release" (based on "Win32 (x86) Console Application")
-!MESSAGE
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=xicl6.exe
+CPP=cl.exe
RSC=rc.exe
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
@@ -45,9 +45,9 @@ RSC=rc.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=xilink6.exe
+LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib_release\mysys.lib wsock32.lib ..\lib_release\strings.lib ..\lib_release\dbug.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBC.lib" /out:"Release/comp-err.exe"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\lib_release\mysys.lib wsock32.lib ..\lib_release\strings.lib ..\lib_release\dbug.lib /nologo /subsystem:console /machine:I386 /nodefaultlib:"LIBC.lib" /out:"../client_release/comp-err.exe"
# Begin Target
# Name "comp_err - Win32 Release"
diff --git a/VC++Files/innobase/innobase.dsp b/VC++Files/innobase/innobase.dsp
index 42d7001bdd4..713e3153d17 100644
--- a/VC++Files/innobase/innobase.dsp
+++ b/VC++Files/innobase/innobase.dsp
@@ -168,14 +168,6 @@ SOURCE=.\buf\buf0rea.c
# End Source File
# Begin Source File
-SOURCE=.\com\com0com.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\com\com0shm.c
-# End Source File
-# Begin Source File
-
SOURCE=.\data\data0data.c
# End Source File
# Begin Source File
@@ -280,10 +272,6 @@ SOURCE=.\mtr\mtr0mtr.c
# End Source File
# Begin Source File
-SOURCE=.\odbc\odbc0odbc.c
-# End Source File
-# Begin Source File
-
SOURCE=.\os\os0file.c
# End Source File
# Begin Source File
diff --git a/VC++Files/libmysql/libmysql.def b/VC++Files/libmysql/libmysql.def
deleted file mode 100755
index 726a53864f3..00000000000
--- a/VC++Files/libmysql/libmysql.def
+++ /dev/null
@@ -1,94 +0,0 @@
-LIBRARY LIBMYSQL
-DESCRIPTION 'MySQL 3.23 Client Library'
-VERSION 2.5
-EXPORTS
- mysql_affected_rows
- mysql_close
- mysql_connect
- mysql_create_db
- mysql_data_seek
- mysql_debug
- mysql_drop_db
- mysql_dump_debug_info
- mysql_eof
- mysql_errno
- mysql_error
- mysql_escape_string
- mysql_fetch_field
- mysql_fetch_field_direct
- mysql_fetch_fields
- mysql_fetch_lengths
- mysql_fetch_row
- mysql_field_count
- mysql_field_seek
- mysql_field_tell
- mysql_free_result
- mysql_get_client_info
- mysql_get_host_info
- mysql_get_proto_info
- mysql_get_server_info
- mysql_info
- mysql_init
- mysql_insert_id
- mysql_kill
- mysql_list_dbs
- mysql_list_fields
- mysql_list_processes
- mysql_list_tables
- mysql_num_fields
- mysql_num_rows
- mysql_odbc_escape_string
- mysql_options
- mysql_ping
- mysql_query
- mysql_real_connect
- mysql_real_query
- mysql_refresh
- mysql_row_seek
- mysql_row_tell
- mysql_select_db
- mysql_shutdown
- mysql_stat
- mysql_store_result
- mysql_thread_id
- mysql_use_result
- bmove_upp
- delete_dynamic
- _dig_vec
- init_dynamic_array
- insert_dynamic
- int2str
- is_prefix
- list_add
- list_delete
- max_allowed_packet
- my_casecmp
- my_init
- my_end
- my_strdup
- my_malloc
- my_memdup
- my_no_flags_free
- my_realloc
- my_thread_end
- my_thread_init
- net_buffer_length
- set_dynamic
- strcend
- strdup_root
- strfill
- strinstr
- strmake
- strmov
- strxmov
- myodbc_remove_escape
- mysql_thread_safe
- mysql_character_set_name
- mysql_change_user
- mysql_send_query
- mysql_read_query_result
- mysql_real_escape_string
- load_defaults
- free_defaults
-
-
diff --git a/VC++Files/libmysql/libmysql.dsp b/VC++Files/libmysql/libmysql.dsp
index 0f94574b3cc..8b36016f8c1 100644
--- a/VC++Files/libmysql/libmysql.dsp
+++ b/VC++Files/libmysql/libmysql.dsp
@@ -487,6 +487,10 @@ SOURCE=..\strings\strnmov.c
# End Source File
# Begin Source File
+SOURCE=..\strings\strtod.c
+# End Source File
+# Begin Source File
+
SOURCE=..\strings\strtoll.c
# End Source File
# Begin Source File
@@ -495,6 +499,10 @@ SOURCE=..\strings\strxmov.c
# End Source File
# Begin Source File
+SOURCE=..\strings\strxnmov.c
+# End Source File
+# Begin Source File
+
SOURCE=..\mysys\thr_mutex.c
# End Source File
# Begin Source File
diff --git a/VC++Files/libmysqld/libmysqld.dsp b/VC++Files/libmysqld/libmysqld.dsp
index 36d9fcb653c..9df0eb0f92b 100644
--- a/VC++Files/libmysqld/libmysqld.dsp
+++ b/VC++Files/libmysqld/libmysqld.dsp
@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /I "../libmysqld" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FD /c
# SUBTRACT CPP /WX /Fr
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
@@ -70,7 +70,7 @@ LINK32=xilink6.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LIBMYSQLD_EXPORTS" /YX /FD /GZ /c
-# ADD CPP /nologo /MT /W3 /Z7 /Od /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /D "_DEBUG" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c
+# ADD CPP /nologo /MT /W3 /Z7 /Od /I "../include" /I "../sql" /I "../regex" /I "../bdb/build_win32" /I "../zlib" /I "libmysqld" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c
# SUBTRACT CPP /Fr
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
@@ -271,10 +271,6 @@ SOURCE=..\sql\net_serv.cpp
# End Source File
# Begin Source File
-SOURCE=..\sql\opt_ft.cpp
-# End Source File
-# Begin Source File
-
SOURCE=..\sql\opt_range.cpp
# End Source File
# Begin Source File
diff --git a/VC++Files/my_print_defaults/my_print_defaults.dsp b/VC++Files/my_print_defaults/my_print_defaults.dsp
index 25f5332eb0f..80178116930 100644
--- a/VC++Files/my_print_defaults/my_print_defaults.dsp
+++ b/VC++Files/my_print_defaults/my_print_defaults.dsp
@@ -7,25 +7,25 @@
CFG=my_print_defaults - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "my_print_defaults.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "my_print_defaults.mak" CFG="my_print_defaults - Win32 Debug"
-!MESSAGE
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE
!MESSAGE "my_print_defaults - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "my_print_defaults - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=xicl6.exe
+CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "my_print_defaults - Win32 Release"
@@ -39,6 +39,7 @@ RSC=rc.exe
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "release"
# PROP Intermediate_Dir "release"
+# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
@@ -47,9 +48,9 @@ RSC=rc.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=xilink6.exe
+LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /machine:I386 /out:"../client_release/my_print_defaults.exe"
!ELSEIF "$(CFG)" == "my_print_defaults - Win32 Debug"
@@ -71,11 +72,11 @@ LINK32=xilink6.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=xilink6.exe
+LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"LIBCMTD.lib" /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /nodefaultlib:"LIBCMTD.lib" /out:"../client_debug/my_print_defaults.exe" /pdbtype:sept
-!ENDIF
+!ENDIF
# Begin Target
diff --git a/VC++Files/myisam_ftdump/myisam_ftdump.dsp b/VC++Files/myisam_ftdump/myisam_ftdump.dsp
new file mode 100755
index 00000000000..71701f3c656
--- /dev/null
+++ b/VC++Files/myisam_ftdump/myisam_ftdump.dsp
@@ -0,0 +1,103 @@
+# Microsoft Developer Studio Project File - Name="myisam_ftdump" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=myisam_ftdump - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "myisam_ftdump.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "myisam_ftdump.mak" CFG="myisam_ftdump - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "myisam_ftdump - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "myisam_ftdump - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "myisam_ftdump - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "release"
+# PROP Intermediate_Dir "release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../myisam" /D "NDEBUG" /D "DBUG_OFF" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FR /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/myisam_ftdump.exe"
+
+!ELSEIF "$(CFG)" == "myisam_ftdump - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "debug"
+# PROP Intermediate_Dir "debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../myisam" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /FD /c
+# SUBTRACT CPP /Fr
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/myisam_ftdump.exe" /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "myisam_ftdump - Win32 Release"
+# Name "myisam_ftdump - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\myisam\myisam_ftdump.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/VC++Files/myisampack/myisampack.dsp b/VC++Files/myisampack/myisampack.dsp
index d4d05ec4591..3331b6e17f8 100644
--- a/VC++Files/myisampack/myisampack.dsp
+++ b/VC++Files/myisampack/myisampack.dsp
@@ -7,19 +7,19 @@
CFG=myisampack - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "myisampack.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "myisampack.mak" CFG="myisampack - Win32 Debug"
-!MESSAGE
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE
!MESSAGE "myisampack - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "myisampack - Win32 Debug" (based on "Win32 (x86) Console Application")
-!MESSAGE
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
@@ -51,7 +51,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /machine:I386
+# ADD LINK32 wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib uuid.lib setargv.obj /nologo /subsystem:console /machine:I386 /out:"../client_release/myisampack.exe"
!ELSEIF "$(CFG)" == "myisampack - Win32 Debug"
@@ -76,9 +76,9 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=xilink6.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib wsock32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setargv.obj /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/myisampack.exe" /pdbtype:sept
-!ENDIF
+!ENDIF
# Begin Target
diff --git a/VC++Files/mysql.dsw b/VC++Files/mysql.dsw
index ea391362b84..e0df167f58d 100644
--- a/VC++Files/mysql.dsw
+++ b/VC++Files/mysql.dsw
@@ -38,6 +38,9 @@ Package=<5>
Package=<4>
{{{
+ Begin Project Dependency
+ Project_Dep_Name mysys
+ End Project Dependency
}}}
###############################################################################
@@ -231,6 +234,30 @@ Package=<4>
###############################################################################
+Project: "myisam_ftdump"=".\myisam_ftdump\myisam_ftdump.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name dbug
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name myisam
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name mysys
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name strings
+ End Project Dependency
+}}}
+
+###############################################################################
+
Project: "myisamchk"=".\myisamchk\myisamchk.dsp" - Package Owner=<4>
Package=<5>
@@ -797,3 +824,4 @@ Package=<3>
}}}
###############################################################################
+
diff --git a/VC++Files/mysqldemb/mysqldemb.dsp b/VC++Files/mysqldemb/mysqldemb.dsp
index 4a14401ed29..91cd90a65ed 100644
--- a/VC++Files/mysqldemb/mysqldemb.dsp
+++ b/VC++Files/mysqldemb/mysqldemb.dsp
@@ -41,7 +41,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /I "../zlib" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FD /c
+# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /I "../zlib" /I "../libmysqld" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /D "__WIN__" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x416 /d "NDEBUG"
# ADD RSC /l 0x416 /d "NDEBUG"
@@ -65,7 +65,7 @@ LIB32=xilink6.exe -lib
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Z7 /Od /I "../zlib" /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Z7 /Od /I "../zlib" /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /I "../libmysqld" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "MYSQL_SERVER" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /D "__WIN__" /FD /GZ /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x416 /d "_DEBUG"
# ADD RSC /l 0x416 /d "_DEBUG"
@@ -220,10 +220,6 @@ SOURCE=..\sql\net_serv.cpp
# End Source File
# Begin Source File
-SOURCE=..\sql\opt_ft.cpp
-# End Source File
-# Begin Source File
-
SOURCE=..\sql\opt_range.cpp
# End Source File
# Begin Source File
diff --git a/VC++Files/mysqlserver/mysqlserver.dsp b/VC++Files/mysqlserver/mysqlserver.dsp
index d8df71ebbb2..d4f4af454d0 100644
--- a/VC++Files/mysqlserver/mysqlserver.dsp
+++ b/VC++Files/mysqlserver/mysqlserver.dsp
@@ -41,7 +41,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
-# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /O2 /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /I "../libmysqld" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "DBUG_OFF" /D "USE_TLS" /YX /FD /c
# ADD BASE RSC /l 0x416 /d "NDEBUG"
# ADD RSC /l 0x416 /d "NDEBUG"
BSC32=bscmake.exe
@@ -64,7 +64,7 @@ LIB32=xilink6.exe -lib
# PROP Intermediate_Dir "Debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
-# ADD CPP /nologo /MTd /W3 /Z7 /Od /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Z7 /Od /I "../include" /I "../regex" /I "../sql" /I "../bdb/build_win32" /I "libmysqld" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "HAVE_BERKELEY_DB" /D "USE_SYMDIR" /D "SIGNAL_WITH_VIO_CLOSE" /D "HAVE_DLOPEN" /D "EMBEDDED_LIBRARY" /D "HAVE_INNOBASE_DB" /D "USE_TLS" /YX /FD /GZ /c
# ADD BASE RSC /l 0x416 /d "_DEBUG"
# ADD RSC /l 0x416 /d "_DEBUG"
BSC32=bscmake.exe
diff --git a/VC++Files/mysys/mysys.dsp b/VC++Files/mysys/mysys.dsp
index 1ec566b5216..a7be57d94c0 100644
--- a/VC++Files/mysys/mysys.dsp
+++ b/VC++Files/mysys/mysys.dsp
@@ -7,26 +7,26 @@
CFG=mysys - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "mysys.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "mysys.mak" CFG="mysys - Win32 Debug"
-!MESSAGE
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE
!MESSAGE "mysys - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "mysys - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE "mysys - Win32 Max" (based on "Win32 (x86) Static Library")
-!MESSAGE
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=xicl6.exe
+CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "mysys - Win32 Release"
@@ -42,14 +42,14 @@ RSC=rc.exe
# PROP Intermediate_Dir "release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_SYMLINK" /FD /c
# SUBTRACT CPP /WX /Fr /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=xilink6.exe -lib
+LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_release\mysys.lib"
@@ -66,14 +66,14 @@ LIB32=xilink6.exe -lib
# PROP Intermediate_Dir "debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /FD /c
+# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /I "../include" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /D "USE_SYMDIR" /D "USE_SYMLINK" /FD /c
# SUBTRACT CPP /Fr
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=xilink6.exe -lib
+LIB32=link.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_debug\mysys.lib"
@@ -91,18 +91,18 @@ LIB32=xilink6.exe -lib
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /MT /W3 /O2 /I "../include" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /FD /c
# SUBTRACT BASE CPP /YX
-# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_SYMDIR" /FD /c
+# ADD CPP /nologo /G6 /MT /W3 /O2 /I "../include" /I "../zlib" /D "NDEBUG" /D "DBUG_OFF" /D "_WINDOWS" /D "USE_SYMDIR" /D "USE_SYMLINK" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=xilink6.exe -lib
+LIB32=link.exe -lib
# ADD BASE LIB32 /nologo /out:"..\lib_release\mysys.lib"
# ADD LIB32 /nologo /out:"..\lib_release\mysys-max.lib"
-!ENDIF
+!ENDIF
# Begin Target
@@ -121,7 +121,7 @@ SOURCE=.\array.c
!ELSEIF "$(CFG)" == "mysys - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -330,10 +330,18 @@ SOURCE=.\my_gethostbyname.c
# End Source File
# Begin Source File
+SOURCE=.\my_gethwaddr.c
+# End Source File
+# Begin Source File
+
SOURCE=.\my_getopt.c
# End Source File
# Begin Source File
+SOURCE=.\my_getsystime.c
+# End Source File
+# Begin Source File
+
SOURCE=.\my_getwd.c
# End Source File
# Begin Source File
@@ -390,6 +398,10 @@ SOURCE=.\my_open.c
# End Source File
# Begin Source File
+SOURCE=.\my_file.c
+# End Source File
+# Begin Source File
+
SOURCE=.\my_pread.c
# End Source File
# Begin Source File
@@ -516,7 +528,7 @@ SOURCE=.\thr_lock.c
!ELSEIF "$(CFG)" == "mysys - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
diff --git a/VC++Files/sql/mysqld.dsp b/VC++Files/sql/mysqld.dsp
index dbf65a11166..4bb8488308c 100644
--- a/VC++Files/sql/mysqld.dsp
+++ b/VC++Files/sql/mysqld.dsp
@@ -7,28 +7,28 @@
CFG=mysqld - Win32 Release
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "mysqld.mak".
-!MESSAGE
+!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
+!MESSAGE
!MESSAGE NMAKE /f "mysqld.mak" CFG="mysqld - Win32 Release"
-!MESSAGE
+!MESSAGE
!MESSAGE Possible choices for configuration are:
-!MESSAGE
+!MESSAGE
!MESSAGE "mysqld - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "mysqld - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE "mysqld - Win32 nt" (based on "Win32 (x86) Console Application")
!MESSAGE "mysqld - Win32 Max nt" (based on "Win32 (x86) Console Application")
!MESSAGE "mysqld - Win32 Max" (based on "Win32 (x86) Console Application")
-!MESSAGE
+!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=xicl6.exe
+CPP=cl.exe
RSC=rc.exe
!IF "$(CFG)" == "mysqld - Win32 Release"
@@ -52,7 +52,7 @@ RSC=rc.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=xilink6.exe
+LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-opt.exe"
# SUBTRACT LINK32 /debug
@@ -78,7 +78,7 @@ LINK32=xilink6.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=xilink6.exe
+LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_debug\dbug.lib ..\lib_debug\vio.lib ..\lib_debug\isam.lib ..\lib_debug\merge.lib ..\lib_debug\mysys.lib ..\lib_debug\strings.lib ..\lib_debug\regex.lib ..\lib_debug\heap.lib ..\lib_debug\bdb.lib ..\lib_debug\innodb.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"../client_debug/mysqld.exe" /pdbtype:sept
@@ -105,7 +105,7 @@ LINK32=xilink6.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=xilink6.exe
+LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\dbug.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /debug /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-nt.exe"
# SUBTRACT LINK32 /pdb:none /debug
@@ -133,7 +133,7 @@ LINK32=xilink6.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=xilink6.exe
+LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-nt.exe"
# SUBTRACT BASE LINK32 /pdb:none /debug
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys-max.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\zlib.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib /nologo /subsystem:console /map /machine:I386 /out:"../client_release/mysqld-max-nt.exe"
@@ -162,12 +162,12 @@ LINK32=xilink6.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LINK32=xilink6.exe
+LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\mysys.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib /nologo /subsystem:console /pdb:none /debug /machine:I386 /out:"../client_release/mysqld-opt.exe"
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib ..\lib_release\vio.lib ..\lib_release\isam.lib ..\lib_release\merge.lib ..\lib_release\myisam.lib ..\lib_release\myisammrg.lib ..\lib_release\mysys-max.lib ..\lib_release\strings.lib ..\lib_release\regex.lib ..\lib_release\heap.lib ..\lib_release\innodb.lib ..\lib_release\bdb.lib ..\lib_release\zlib.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"../client_release/mysqld-max.exe"
# SUBTRACT LINK32 /debug
-!ENDIF
+!ENDIF
# Begin Target
@@ -193,7 +193,7 @@ SOURCE=.\client.c
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -213,7 +213,7 @@ SOURCE=.\derror.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -237,7 +237,7 @@ SOURCE=.\field.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -257,7 +257,7 @@ SOURCE=.\field_conv.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -277,7 +277,7 @@ SOURCE=.\filesort.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -329,7 +329,7 @@ SOURCE=.\handler.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -348,7 +348,7 @@ SOURCE=.\hash_filo.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -371,7 +371,7 @@ SOURCE=.\hostname.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -391,7 +391,7 @@ SOURCE=.\init.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -411,7 +411,7 @@ SOURCE=.\item.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -431,7 +431,7 @@ SOURCE=.\item_buff.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -451,7 +451,7 @@ SOURCE=.\item_cmpfunc.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -503,7 +503,7 @@ SOURCE=.\item_strfunc.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -527,7 +527,7 @@ SOURCE=.\item_sum.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -546,7 +546,7 @@ SOURCE=.\item_timefunc.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -566,7 +566,7 @@ SOURCE=.\item_uniq.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -586,7 +586,7 @@ SOURCE=.\key.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -606,7 +606,7 @@ SOURCE=.\lock.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -626,7 +626,7 @@ SOURCE=.\log.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -649,7 +649,7 @@ SOURCE=.\mf_iocache.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -673,7 +673,7 @@ SOURCE=.\mysqld.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -696,7 +696,7 @@ SOURCE=.\nt_servc.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -705,10 +705,6 @@ SOURCE=.\nt_servc.h
# End Source File
# Begin Source File
-SOURCE=.\opt_ft.cpp
-# End Source File
-# Begin Source File
-
SOURCE=.\opt_range.cpp
!IF "$(CFG)" == "mysqld - Win32 Release"
@@ -723,7 +719,7 @@ SOURCE=.\opt_range.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -754,7 +750,7 @@ SOURCE=.\password.c
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -774,7 +770,7 @@ SOURCE=.\procedure.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -802,7 +798,7 @@ SOURCE=.\records.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -858,7 +854,7 @@ SOURCE=.\sql_acl.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -882,7 +878,7 @@ SOURCE=.\sql_base.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -938,7 +934,7 @@ SOURCE=.\sql_db.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -958,7 +954,7 @@ SOURCE=.\sql_delete.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -998,7 +994,7 @@ SOURCE=.\sql_insert.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -1018,7 +1014,7 @@ SOURCE=.\sql_lex.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -1038,7 +1034,7 @@ SOURCE=.\sql_list.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -1058,7 +1054,7 @@ SOURCE=.\sql_load.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -1082,7 +1078,7 @@ SOURCE=.\sql_map.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -1102,7 +1098,7 @@ SOURCE=.\sql_parse.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -1134,7 +1130,7 @@ SOURCE=.\sql_select.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -1154,7 +1150,7 @@ SOURCE=.\sql_show.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -1178,7 +1174,7 @@ SOURCE=.\sql_string.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -1198,7 +1194,7 @@ SOURCE=.\sql_table.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -1218,7 +1214,7 @@ SOURCE=.\sql_test.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -1246,7 +1242,7 @@ SOURCE=.\sql_update.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -1266,7 +1262,7 @@ SOURCE=.\sql_yacc.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -1310,7 +1306,7 @@ SOURCE=.\thr_malloc.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -1330,7 +1326,7 @@ SOURCE=.\time.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# Begin Source File
@@ -1354,7 +1350,7 @@ SOURCE=.\unireg.cpp
!ELSEIF "$(CFG)" == "mysqld - Win32 Max"
-!ENDIF
+!ENDIF
# End Source File
# End Target
diff --git a/VC++Files/strings/MASM6x/strings.dsp b/VC++Files/strings/MASM6x/strings.dsp
index 1f54910bf58..e7b1c161d83 100644
--- a/VC++Files/strings/MASM6x/strings.dsp
+++ b/VC++Files/strings/MASM6x/strings.dsp
@@ -84,10 +84,6 @@ LIB32=link.exe -lib
# Name "strings - Win32 Debug"
# Begin Source File
-SOURCE=.\atof.c
-# End Source File
-# Begin Source File
-
SOURCE=.\bchange.c
# End Source File
# Begin Source File
@@ -160,6 +156,10 @@ SOURCE=.\str2int.c
# End Source File
# Begin Source File
+SOURCE=.\strnlen.c
+# End Source File
+# Begin Source File
+
SOURCE=.\Strings.asm
!IF "$(CFG)" == "strings - Win32 Release"
@@ -191,6 +191,10 @@ InputName=Strings
# End Source File
# Begin Source File
+SOURCE=.\strtod.c
+# End Source File
+# Begin Source File
+
SOURCE=.\strtol.c
# End Source File
# Begin Source File
diff --git a/VC++Files/strings/noMASM/strings.dsp b/VC++Files/strings/noMASM/strings.dsp
index 6e2dbb3c013..ffec20f3a59 100644
--- a/VC++Files/strings/noMASM/strings.dsp
+++ b/VC++Files/strings/noMASM/strings.dsp
@@ -25,7 +25,7 @@ CFG=strings - Win32 Debug
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
-CPP=cl.exe
+CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "strings - Win32 Release"
@@ -48,7 +48,7 @@ RSC=rc.exe
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=link.exe -lib
+LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_release\strings.lib"
@@ -65,14 +65,14 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
-# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "_WINDOWS" /FD /c
+# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /I "../include" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
-LIB32=link.exe -lib
+LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:"..\lib_debug\strings.lib"
@@ -84,10 +84,6 @@ LIB32=link.exe -lib
# Name "strings - Win32 Debug"
# Begin Source File
-SOURCE=.\atof.c
-# End Source File
-# Begin Source File
-
SOURCE=.\bchange.c
# End Source File
# Begin Source File
@@ -100,10 +96,6 @@ SOURCE=.\bfill.c
# End Source File
# Begin Source File
-SOURCE=.\bmove.c
-# End Source File
-# Begin Source File
-
SOURCE=.\bmove512.c
# End Source File
# Begin Source File
@@ -116,6 +108,10 @@ SOURCE=".\ctype-big5.c"
# End Source File
# Begin Source File
+SOURCE=".\ctype-bin.c"
+# End Source File
+# Begin Source File
+
SOURCE=".\ctype-czech.c"
# End Source File
# Begin Source File
@@ -124,6 +120,10 @@ SOURCE=".\ctype-euc_kr.c"
# End Source File
# Begin Source File
+SOURCE=".\ctype-extra.c"
+# End Source File
+# Begin Source File
+
SOURCE=".\ctype-gb2312.c"
# End Source File
# Begin Source File
@@ -132,7 +132,15 @@ SOURCE=".\ctype-gbk.c"
# End Source File
# Begin Source File
-SOURCE=".\ctype-latin1_de.c"
+SOURCE=".\ctype-latin1.c"
+# End Source File
+# Begin Source File
+
+SOURCE=".\ctype-mb.c"
+# End Source File
+# Begin Source File
+
+SOURCE=".\ctype-simple.c"
# End Source File
# Begin Source File
@@ -144,10 +152,22 @@ SOURCE=".\ctype-tis620.c"
# End Source File
# Begin Source File
+SOURCE=".\ctype-ucs2.c"
+# End Source File
+# Begin Source File
+
SOURCE=".\ctype-ujis.c"
# End Source File
# Begin Source File
+SOURCE=".\ctype-utf8.c"
+# End Source File
+# Begin Source File
+
+SOURCE=".\ctype-win1250ch.c"
+# End Source File
+# Begin Source File
+
SOURCE=.\ctype.c
# End Source File
# Begin Source File
@@ -168,23 +188,23 @@ SOURCE=.\longlong2str.c
# End Source File
# Begin Source File
-SOURCE=.\r_strinstr.c
+SOURCE=.\my_strtoll10.c
# End Source File
# Begin Source File
-SOURCE=.\str2int.c
+SOURCE=.\my_vsnprintf.c
# End Source File
# Begin Source File
-SOURCE=.\strappend.c
+SOURCE=.\r_strinstr.c
# End Source File
# Begin Source File
-SOURCE=.\strcend.c
+SOURCE=.\str2int.c
# End Source File
# Begin Source File
-SOURCE=.\strcont.c
+SOURCE=.\strcend.c
# End Source File
# Begin Source File
@@ -196,10 +216,6 @@ SOURCE=.\strfill.c
# End Source File
# Begin Source File
-SOURCE=.\strinstr.c
-# End Source File
-# Begin Source File
-
SOURCE=.\strmake.c
# End Source File
# Begin Source File
@@ -208,15 +224,11 @@ SOURCE=.\strmov.c
# End Source File
# Begin Source File
-SOURCE=.\strnlen.c
-# End Source File
-# Begin Source File
-
SOURCE=.\strnmov.c
# End Source File
# Begin Source File
-SOURCE=.\strstr.c
+SOURCE=.\strtod.c
# End Source File
# Begin Source File
@@ -242,5 +254,9 @@ SOURCE=.\strxmov.c
SOURCE=.\strxnmov.c
# End Source File
+# Begin Source File
+
+SOURCE=.\xml.c
+# End Source File
# End Target
# End Project
diff --git a/VC++Files/strings/strings.dsp b/VC++Files/strings/strings.dsp
index 030acdb7451..5755d5d4c99 100644
--- a/VC++Files/strings/strings.dsp
+++ b/VC++Files/strings/strings.dsp
@@ -84,10 +84,6 @@ LIB32=xilink6.exe -lib
# Name "strings - Win32 Debug"
# Begin Source File
-SOURCE=.\atof.c
-# End Source File
-# Begin Source File
-
SOURCE=.\bchange.c
# End Source File
# Begin Source File
@@ -192,6 +188,10 @@ SOURCE=.\longlong2str.c
# End Source File
# Begin Source File
+SOURCE=.\strnlen.c
+# End Source File
+# Begin Source File
+
SOURCE=.\my_strtoll10.c
# End Source File
# Begin Source File
@@ -232,6 +232,10 @@ SOURCE=.\strnmov.c
# End Source File
# Begin Source File
+SOURCE=.\strtod.c
+# End Source File
+# Begin Source File
+
SOURCE=.\strtol.c
# End Source File
# Begin Source File
diff --git a/acinclude.m4 b/acinclude.m4
index d3a404e5fb0..2eb45b2e8ce 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1252,7 +1252,6 @@ 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/odbc/libodbc.a\
\$(top_builddir)/innobase/srv/libsrv.a\
\$(top_builddir)/innobase/dict/libdict.a\
\$(top_builddir)/innobase/que/libque.a\
@@ -1276,7 +1275,6 @@ dnl circular references.
\$(top_builddir)/innobase/page/libpage.a\
\$(top_builddir)/innobase/rem/librem.a\
\$(top_builddir)/innobase/thr/libthr.a\
- \$(top_builddir)/innobase/com/libcom.a\
\$(top_builddir)/innobase/sync/libsync.a\
\$(top_builddir)/innobase/data/libdata.a\
\$(top_builddir)/innobase/mach/libmach.a\
diff --git a/client/Makefile.am b/client/Makefile.am
index 612a5f01f8d..7400717731d 100644
--- a/client/Makefile.am
+++ b/client/Makefile.am
@@ -19,7 +19,8 @@
#AUTOMAKE_OPTIONS = nostdinc
INCLUDES = -I$(top_srcdir)/include $(openssl_includes)
LIBS = @CLIENT_LIBS@
-LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysql/libmysqlclient.la
+DEPLIB= ../libmysql/libmysqlclient.la
+LDADD = @CLIENT_EXTRA_LDFLAGS@ $(DEPLIB)
bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \
mysqldump mysqlimport mysqltest mysqlbinlog mysqlmanagerc mysqlmanager-pwgen
noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \
@@ -27,18 +28,18 @@ noinst_HEADERS = sql_string.h completion_hash.h my_readline.h \
mysql_SOURCES = mysql.cc readline.cc sql_string.cc completion_hash.cc
mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) $(CXXLDFLAGS)
mysqlbinlog_LDADD = $(LDADD) $(CXXLDFLAGS)
-mysql_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
-mysqladmin_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
-mysqlcheck_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
-mysqlshow_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
-mysqldump_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
-mysqlimport_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
+mysql_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
+mysqladmin_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
+mysqlcheck_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
+mysqlshow_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
+mysqldump_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
+mysqlimport_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
mysqltest_SOURCES= mysqltest.c
-mysqltest_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
+mysqltest_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
mysqlbinlog_SOURCES = mysqlbinlog.cc ../mysys/mf_tempdir.c
-mysqlbinlog_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
+mysqlbinlog_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
mysqlmanagerc_SOURCES = mysqlmanagerc.c
-mysqlmanagerc_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES)
+mysqlmanagerc_DEPENDENCIES= $(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
sql_src=log_event.h mysql_priv.h log_event.cc
# Fix for mit-threads
diff --git a/client/client_priv.h b/client/client_priv.h
index 910de1f03e9..aa1de85f489 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -43,4 +43,5 @@ enum options_client
OPT_PROMPT, OPT_IGN_LINES,OPT_TRANSACTION,OPT_MYSQL_PROTOCOL,
OPT_SHARED_MEMORY_BASE_NAME, OPT_FRM, OPT_SKIP_OPTIMIZATION,
OPT_COMPATIBLE, OPT_RECONNECT, OPT_DELIMITER, OPT_SECURE_AUTH,
+ OPT_OPEN_FILES_LIMIT, OPT_SET_CHARSET
};
diff --git a/client/mysql.cc b/client/mysql.cc
index b79dda51317..52582481234 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -25,7 +25,7 @@
* Matt Wagner <matt@mysql.com>
* Jeremy Cole <jcole@mysql.com>
* Tonu Samuel <tonu@mysql.com>
- * Harrison Fisk <hcfisk@buffalo.edu>
+ * Harrison Fisk <harrison@mysql.com>
*
**/
@@ -289,10 +289,25 @@ static const char *server_default_groups[]=
{ "server", "embedded", "mysql_SERVER", 0 };
#ifdef HAVE_READLINE
+/*
+ HIST_ENTRY is defined for libedit, but not for the real readline
+ Need to redefine it for real readline to find it
+*/
+#if !defined(USE_LIBEDIT_INTERFACE)
+typedef struct _hist_entry {
+ const char *line;
+ const char *data;
+} HIST_ENTRY;
+#endif
+
extern "C" int add_history(const char *command); /* From readline directory */
extern "C" int read_history(const char *command);
extern "C" int write_history(const char *command);
+extern "C" HIST_ENTRY *history_get(int num);
+extern "C" int history_length;
+static int not_in_history(const char *line);
static void initialize_readline (char *name);
+static void fix_history(String *final_command);
#endif
static COMMANDS *find_command (char *name,char cmd_name);
@@ -410,8 +425,9 @@ int main(int argc,char *argv[])
}
#endif
sprintf(buff, "%s",
+#ifndef NOT_YET
"Type 'help;' or '\\h' for help. Type '\\c' to clear the buffer.\n");
-#ifdef NOT_YET
+#else
"Type 'help [[%]function name[%]]' to get help on usage of function.\n");
#endif
put_info(buff,INFO_INFO);
@@ -604,10 +620,10 @@ static struct my_option my_long_options[] =
(gptr*) &current_user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"safe-updates", 'U', "Only allow UPDATE and DELETE that uses keys.",
- (gptr*) &safe_updates, (gptr*) &safe_updates, 0, GET_BOOL, OPT_ARG, 0, 0,
+ (gptr*) &safe_updates, (gptr*) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
{"i-am-a-dummy", 'U', "Synonym for option --safe-updates, -U.",
- (gptr*) &safe_updates, (gptr*) &safe_updates, 0, GET_BOOL, OPT_ARG, 0, 0,
+ (gptr*) &safe_updates, (gptr*) &safe_updates, 0, GET_BOOL, NO_ARG, 0, 0,
0, 0, 0, 0},
{"verbose", 'v', "Write more. (-v -v -v gives the table output format).", 0,
0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -937,7 +953,7 @@ static int read_lines(bool execute_commands)
if (glob_buffer.is_empty()) // If buffer was emptied
in_string=0;
#ifdef HAVE_READLINE
- if (status.add_to_history)
+ if (status.add_to_history && not_in_history(line))
add_history(line);
#endif
continue;
@@ -1014,7 +1030,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
if (!line[0] && buffer.is_empty())
return 0;
#ifdef HAVE_READLINE
- if (status.add_to_history && line[0])
+ if (status.add_to_history && line[0] && not_in_history(line))
add_history(line);
#endif
#ifdef USE_MB
@@ -1169,6 +1185,75 @@ int no_completion()
return 0; /* No filename completion */
}
+/* glues pieces of history back together if in pieces */
+static void fix_history(String *final_command)
+{
+ int total_lines = 1;
+ char *ptr = final_command->c_ptr();
+ String fixed_buffer; /* Converted buffer */
+ char str_char = '\0'; /* Character if we are in a string or not */
+
+ /* find out how many lines we have and remove newlines */
+ while (*ptr != '\0')
+ {
+ switch (*ptr) {
+ /* string character */
+ case '"':
+ case '\'':
+ case '`':
+ if (str_char == '\0') /* open string */
+ str_char = *ptr;
+ else if (str_char == *ptr) /* close string */
+ str_char = '\0';
+ fixed_buffer.append(ptr,1);
+ break;
+ case '\n':
+ /*
+ not in string, change to space
+ if in string, leave it alone
+ */
+ fixed_buffer.append(str_char == '\0' ? " " : "\n");
+ total_lines++;
+ break;
+ case '\\':
+ fixed_buffer.append('\\');
+ /* need to see if the backslash is escaping anything */
+ if (str_char)
+ {
+ ptr++;
+ /* special characters that need escaping */
+ if (*ptr == '\'' || *ptr == '"' || *ptr == '\\')
+ fixed_buffer.append(ptr,1);
+ else
+ ptr--;
+ }
+ break;
+
+ default:
+ fixed_buffer.append(ptr,1);
+ }
+ ptr++;
+ }
+ if (total_lines > 1)
+ add_history(fixed_buffer.ptr());
+}
+
+/*
+ returns 0 if line matches the previous history entry
+ returns 1 if the line doesn't match the previous history entry
+*/
+static int not_in_history(const char *line)
+{
+ HIST_ENTRY *oldhist = history_get(history_length);
+ int num;
+
+ if (oldhist == 0)
+ return 1;
+ if (strcmp(oldhist->line,line) == 0)
+ return 0;
+ return 1;
+}
+
static void initialize_readline (char *name)
{
/* Allow conditional parsing of the ~/.inputrc file. */
@@ -1631,6 +1716,10 @@ com_help(String *buffer __attribute__((unused)),
static int
com_clear(String *buffer,char *line __attribute__((unused)))
{
+#ifdef HAVE_READLINE
+ if (status.add_to_history)
+ fix_history(buffer);
+#endif
buffer->length(0);
return 0;
}
@@ -1690,6 +1779,16 @@ com_go(String *buffer,char *line __attribute__((unused)))
timer=start_timer();
error= mysql_real_query_for_lazy(buffer->ptr(),buffer->length());
+
+#ifdef HAVE_READLINE
+ if (status.add_to_history)
+ {
+ buffer->append(vertical ? "\\G" : delimiter);
+ /* Append final command onto history */
+ fix_history(buffer);
+ }
+#endif
+
if (error)
{
buffer->length(0); // Remove query on error
@@ -3088,6 +3187,8 @@ static const char* construct_prompt()
processed_prompt.append(' ');
break;
case 'R':
+ if (t->tm_hour < 10)
+ processed_prompt.append('0');
add_int_to_prompt(t->tm_hour);
break;
case 'r':
@@ -3095,6 +3196,8 @@ static const char* construct_prompt()
getHour = t->tm_hour % 12;
if (getHour == 0)
getHour=12;
+ if (getHour < 10)
+ processed_prompt.append('0');
add_int_to_prompt(getHour);
break;
case 'm':
@@ -3120,6 +3223,8 @@ static const char* construct_prompt()
processed_prompt.append(strtok(dateTime,"\n"));
break;
case 's':
+ if (t->tm_sec < 10)
+ processed_prompt.append('0');
add_int_to_prompt(t->tm_sec);
break;
case 'w':
diff --git a/client/mysqladmin.c b/client/mysqladmin.c
index f263d321a7b..a2cce3782d6 100644
--- a/client/mysqladmin.c
+++ b/client/mysqladmin.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (C) 2000-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
@@ -140,7 +140,7 @@ static struct my_option my_long_options[] =
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"port", 'P', "Port number to use for connection.", (gptr*) &tcp_port,
- (gptr*) &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (gptr*) &tcp_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, 0},
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"relative", 'r',
@@ -440,6 +440,7 @@ static my_bool sql_connect(MYSQL *mysql, uint wait)
}
}
+
/*
Execute a command.
Return 0 on ok
@@ -450,6 +451,14 @@ static my_bool sql_connect(MYSQL *mysql, uint wait)
static int execute_commands(MYSQL *mysql,int argc, char **argv)
{
const char *status;
+ /*
+ MySQL documentation relies on the fact that mysqladmin will
+ execute commands in the order specified, e.g.
+ mysqladmin -u root flush-privileges password "newpassword"
+ to reset a lost root password.
+ If this behaviour is ever changed, Docs should be notified.
+ */
+
struct rand_struct rand_st;
for (; argc > 0 ; argv++,argc--)
@@ -787,9 +796,26 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv)
}
if (mysql_query(mysql,buff))
{
- my_printf_error(0,"unable to change password; error: '%s'",
- MYF(ME_BELL),mysql_error(mysql));
- return -1;
+ if (mysql_errno(mysql)!=1290)
+ {
+ my_printf_error(0,"unable to change password; error: '%s'",
+ MYF(ME_BELL),mysql_error(mysql));
+ return -1;
+ }
+ else
+ {
+ /*
+ We don't try to execute 'update mysql.user set..'
+ because we can't perfectly find out the host
+ */
+ my_printf_error(0,"\n"
+ "You cannot use 'password' command as mysqld runs\n"
+ " with grant tables disabled (was started with"
+ " --skip-grant-tables).\n"
+ "Use: \"mysqladmin flush-privileges password '*'\""
+ " instead", MYF(ME_BELL));
+ return -1;
+ }
}
argc--; argv++;
break;
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 345c7f0b945..0951fdbcbae 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -37,12 +37,13 @@
** 10 Jun 2003: SET NAMES and --no-set-names by Alexander Barkov
*/
-#define DUMP_VERSION "10.5"
+#define DUMP_VERSION "10.6"
#include <my_global.h>
#include <my_sys.h>
#include <m_string.h>
#include <m_ctype.h>
+#include <assert.h>
#include "client_priv.h"
#include "mysql.h"
@@ -63,7 +64,6 @@
#define SHOW_NULL 2
#define SHOW_DEFAULT 4
#define SHOW_EXTRA 5
-#define QUOTE_CHAR '`'
/* Size of buffer for dump's select query */
#define QUERY_LENGTH 1536
@@ -78,17 +78,19 @@ static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick= 1, extended_insert= 1,
lock_tables=1,ignore_errors=0,flush_logs=0,replace=0,
ignore=0,opt_drop=1,opt_keywords=0,opt_lock=1,opt_compress=0,
opt_delayed=0,create_options=1,opt_quoted=0,opt_databases=0,
- opt_alldbs=0,opt_create_db=0,opt_first_slave=0,opt_set_names=0,
- opt_autocommit=0,opt_master_data,opt_disable_keys=1,opt_xml=0,
- opt_delete_master_logs=0, tty_password=0,
+ opt_alldbs=0,opt_create_db=0,opt_first_slave=0,opt_set_charset,
+ opt_autocommit=0,opt_master_data,opt_disable_keys=1,opt_xml=0,
+ opt_delete_master_logs=0, tty_password=0,
opt_single_transaction=0, opt_comments= 0, opt_compact= 0;
-static MYSQL mysql_connection,*sock=0;
+
+static MYSQL mysql_connection,*sock=0;
static char insert_pat[12 * 1024],*opt_password=0,*current_user=0,
*current_host=0,*path=0,*fields_terminated=0,
*lines_terminated=0, *enclosed=0, *opt_enclosed=0, *escaped=0,
*where=0,
*opt_compatible_mode_str= 0,
*err_ptr= 0;
+static char compatible_mode_normal_str[255];
static char *default_charset= (char*) MYSQL_UNIVERSAL_CLIENT_CHARSET;
static ulong opt_compatible_mode= 0;
static uint opt_mysql_port= 0, err_len= 0;
@@ -111,6 +113,15 @@ const char *compatible_mode_names[]=
"ANSI",
NullS
};
+#define MASK_ANSI_QUOTES \
+(\
+ (1<<2) | /* POSTGRESQL */\
+ (1<<3) | /* ORACLE */\
+ (1<<4) | /* MSSQL */\
+ (1<<5) | /* DB2 */\
+ (1<<6) | /* MAXDB */\
+ (1<<10) /* ANSI */\
+)
TYPELIB compatible_mode_typelib= {array_elements(compatible_mode_names) - 1,
"", compatible_mode_names};
@@ -162,7 +173,7 @@ static struct my_option my_long_options[] =
(gptr*) &opt_delayed, (gptr*) &opt_delayed, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"delete-master-logs", OPT_DELETE_MASTER_LOGS,
- "Delete logs on master after backup. This will automagically enable --first-slave.",
+ "Delete logs on master after backup. This automatically enables --first-slave.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"disable-keys", 'K',
"'/*!40000 ALTER TABLE tb_name DISABLE KEYS */; and '/*!40000 ALTER TABLE tb_name ENABLE KEYS */; will be put in the output.", (gptr*) &opt_disable_keys,
@@ -181,11 +192,14 @@ static struct my_option my_long_options[] =
"Fields in the i.file are opt. enclosed by ...", (gptr*) &opt_enclosed,
(gptr*) &opt_enclosed, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0 ,0, 0},
{"fields-escaped-by", OPT_ESC, "Fields in the i.file are escaped by ...",
- (gptr*) &escaped, (gptr*) &escaped, 0, GET_STR, NO_ARG, 0, 0, 0, 0, 0, 0},
+ (gptr*) &escaped, (gptr*) &escaped, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"first-slave", 'x', "Locks all tables across all databases.",
(gptr*) &opt_first_slave, (gptr*) &opt_first_slave, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
- {"flush-logs", 'F', "Flush logs file in server before starting dump.",
+ {"flush-logs", 'F', "Flush logs file in server before starting dump. "
+ "Note that if you dump many databases at once (using the option "
+ "--databases= or --all-databases), the logs will be flushed for "
+ "each database dumped.",
(gptr*) &flush_logs, (gptr*) &flush_logs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"force", 'f', "Continue even if we get an sql-error.",
@@ -201,7 +215,7 @@ static struct my_option my_long_options[] =
{"lock-tables", 'l', "Lock all tables for read.", (gptr*) &lock_tables,
(gptr*) &lock_tables, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
{"master-data", OPT_MASTER_DATA,
- "This will cause the master position and filename to be appended to your output. This will automagically enable --first-slave.",
+ "This causes the master position and filename to be appended to your output. This automatically enables --first-slave.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-autocommit", OPT_AUTOCOMMIT,
"Wrap tables with autocommit/commit statements.",
@@ -220,9 +234,12 @@ static struct my_option my_long_options[] =
{"no-data", 'd', "No row information.", (gptr*) &dFlag, (gptr*) &dFlag, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"no-set-names", 'N',
- "'SET NAMES charset_name' will not be put in the output.",
- (gptr*) &opt_set_names, (gptr*) &opt_set_names, 0, GET_BOOL, NO_ARG, 0, 0,
- 0, 0, 0, 0},
+ "'SET NAMES charset_name' will not be put in the output. Deprecated, use --set-charset or --skip-set-charset to enable/disable charset settings instead",
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"set-charset", OPT_SET_CHARSET,
+ "'SET NAMES charset_name' will be put in the output",
+ (gptr*) &opt_set_charset, (gptr*) &opt_set_charset, 0, GET_BOOL, NO_ARG, 1,
+ 0, 0, 0, 0, 0},
{"set-variable", 'O',
"Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@@ -364,15 +381,20 @@ static void write_header(FILE *sql_file, char *db_name)
fprintf(sql_file, "-- Server version\t%s\n",
mysql_get_server_info(&mysql_connection));
}
- if (!opt_set_names)
+ 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(md_result_file,"\
+ if (!path)
+ {
+ fprintf(md_result_file,"\
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\n\
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\n\
-/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=NO_AUTO_VALUE_ON_ZERO */;\n\
");
+ }
+ fprintf(sql_file,
+ "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=\"%s%s%s\" */;\n",
+ path?"":"NO_AUTO_VALUE_ON_ZERO",compatible_mode_normal_str[0]==0?"":",",
+ compatible_mode_normal_str);
}
- return;
} /* write_header */
@@ -382,12 +404,15 @@ static void write_footer(FILE *sql_file)
fputs("</mysqldump>\n", sql_file);
else if (!opt_compact)
{
- fprintf(md_result_file,"\n\
-/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\n\
+ fprintf(sql_file,"\n/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\n");
+ if (!path)
+ {
+ fprintf(md_result_file,"\
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;\n\
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;\n");
- if (!opt_set_names)
- fprintf(md_result_file,
+ }
+ if (opt_set_charset)
+ fprintf(sql_file,
"/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n");
fputs("\n", sql_file);
}
@@ -431,6 +456,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_protocol = MYSQL_PROTOCOL_PIPE;
#endif
break;
+ case 'N':
+ opt_set_charset= 0;
+ break;
case 'T':
opt_disable_keys=0;
break;
@@ -450,7 +478,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
exit(0);
case (int) OPT_OPTIMIZE:
extended_insert= opt_drop= opt_lock= quick= create_options=
- opt_disable_keys= lock_tables= 1;
+ opt_disable_keys= lock_tables= opt_set_charset= 1;
if (opt_single_transaction) lock_tables=0;
break;
case (int) OPT_SKIP_OPTIMIZATION:
@@ -461,7 +489,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
if (opt_compact)
{
opt_comments= opt_drop= opt_disable_keys= opt_lock= 0;
- opt_set_names= 1;
+ opt_set_charset= 0;
}
case (int) OPT_TABLES:
opt_databases=0;
@@ -469,9 +497,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case (int) OPT_COMPATIBLE:
{
char buff[255];
+ char *end= compatible_mode_normal_str;
+ int i;
+ ulong mode;
opt_quoted= 1;
- opt_set_names= 1;
+ opt_set_charset= 0;
opt_compatible_mode_str= argument;
opt_compatible_mode= find_set(&compatible_mode_typelib,
argument, strlen(argument),
@@ -482,6 +513,27 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
fprintf(stderr, "Invalid mode to --compatible: %s\n", buff);
exit(1);
}
+#if !defined(DBUG_OFF)
+ {
+ uint size_for_sql_mode= 0;
+ const char **ptr;
+ for (ptr= compatible_mode_names; *ptr; ptr++)
+ size_for_sql_mode+= strlen(*ptr);
+ size_for_sql_mode+= sizeof(compatible_mode_names)-1;
+ DBUG_ASSERT(sizeof(compatible_mode_normal_str)>=size_for_sql_mode);
+ }
+#endif
+ mode= opt_compatible_mode;
+ for (i= 0, mode= opt_compatible_mode; mode; mode>>= 1, i++)
+ {
+ if (mode & 1)
+ {
+ end= strmov(end, compatible_mode_names[i]);
+ end= strmov(end, ",");
+ }
+ }
+ if (end!=compatible_mode_normal_str)
+ end[-1]= 0;
break;
}
case (int) OPT_MYSQL_PROTOCOL:
@@ -583,6 +635,7 @@ static void safe_exit(int error)
*/
static int dbConnect(char *host, char *user,char *passwd)
{
+ char buff[20+FN_REFLEN];
DBUG_ENTER("dbConnect");
if (verbose)
{
@@ -602,7 +655,7 @@ static int dbConnect(char *host, char *user,char *passwd)
if (shared_memory_base_name)
mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name);
#endif
- if (!opt_set_names)
+ if (opt_set_charset)
mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset);
if (!(sock= mysql_real_connect(&mysql_connection,host,user,passwd,
NULL,opt_mysql_port,opt_mysql_unix_port,
@@ -611,6 +664,16 @@ static int dbConnect(char *host, char *user,char *passwd)
DBerror(&mysql_connection, "when trying to connect");
return 1;
}
+ sprintf(buff, "/*!40100 SET @@SQL_MODE=\"%s\" */",
+ compatible_mode_normal_str);
+ if (mysql_query(sock, buff))
+ {
+ fprintf(stderr, "%s: Can't set the compatible mode %s (error %s)\n",
+ my_progname, compatible_mode_normal_str, mysql_error(sock));
+ mysql_close(sock);
+ safe_exit(EX_MYSQLERR);
+ return 1;
+ }
return 0;
} /* dbConnect */
@@ -659,17 +722,19 @@ static my_bool test_if_special_chars(const char *str)
static char *quote_name(const char *name, char *buff, my_bool force)
{
char *to= buff;
+ char qtype= (opt_compatible_mode & MASK_ANSI_QUOTES) ? '\"' : '`';
+
if (!force && !opt_quoted && !test_if_special_chars(name))
return (char*) name;
- *to++= QUOTE_CHAR;
+ *to++= qtype;
while (*name)
{
- if (*name == QUOTE_CHAR)
- *to++= QUOTE_CHAR;
+ if (*name == qtype)
+ *to++= qtype;
*to++= *name++;
}
- to[0]=QUOTE_CHAR;
- to[1]=0;
+ to[0]= qtype;
+ to[1]= 0;
return buff;
} /* quote_name */
@@ -842,31 +907,6 @@ static uint getTableStructure(char *table, char* db)
/* Make an sql-file, if path was given iow. option -T was given */
char buff[20+FN_REFLEN];
- if (opt_compatible_mode)
- {
- char *end;
- uint i;
-
- sprintf(buff, "/*!40100 SET @@sql_mode=\"");
- end= strend(buff);
- for (i= 0; opt_compatible_mode; opt_compatible_mode>>= 1, i++)
- {
- if (opt_compatible_mode & 1)
- {
- end= strmov(end, compatible_mode_names[i]);
- end= strmov(end, ",");
- }
- }
- end= strmov(end-1, "\" */");
- if (mysql_query(sock, buff))
- {
- fprintf(stderr, "%s: Can't set the compatible mode '%s' (%s)\n",
- my_progname, table, mysql_error(sock));
- safe_exit(EX_MYSQLERR);
- DBUG_RETURN(0);
- }
- }
-
sprintf(buff,"show create table %s", result_table);
if (mysql_query(sock, buff))
{
@@ -1153,7 +1193,11 @@ static uint getTableStructure(char *table, char* db)
strpos=strmov(strpos,"(");
}
if (sql_file != md_result_file)
+ {
+ fputs("\n", sql_file);
+ write_footer(sql_file);
my_fclose(sql_file, MYF(MY_WME));
+ }
DBUG_RETURN(numFields);
} /* getTableStructure */
@@ -1709,7 +1753,7 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
if (opt_xml)
fputs("</database>\n", md_result_file);
if (lock_tables)
- mysql_query(sock,"UNLOCK_TABLES");
+ mysql_query(sock,"UNLOCK TABLES");
return 0;
} /* dump_selected_tables */
@@ -1843,6 +1887,7 @@ int main(int argc, char **argv)
{
MYSQL_ROW row;
MYSQL_RES *master;
+ compatible_mode_normal_str[0]= 0;
MY_INIT(argv[0]);
if (get_options(&argc, &argv))
@@ -1940,7 +1985,8 @@ MASTER_LOG_POS=%s ;\n",row[0],row[1]);
}
}
dbDisconnect(current_host);
- write_footer(md_result_file);
+ if (!path)
+ write_footer(md_result_file);
if (md_result_file != stdout)
my_fclose(md_result_file, MYF(0));
my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR));
diff --git a/client/mysqltest.c b/client/mysqltest.c
index bb1151fa178..be5dac1c9d9 100644
--- a/client/mysqltest.c
+++ b/client/mysqltest.c
@@ -109,6 +109,7 @@ MYSQL_MANAGER* manager=0;
static char **default_argv;
static const char *load_default_groups[]= { "mysqltest","client",0 };
+static char line_buffer[MAX_DELIMITER], *line_buffer_pos= line_buffer;;
static FILE* file_stack[MAX_INCLUDE_DEPTH];
static FILE** cur_file;
@@ -128,6 +129,8 @@ static CHARSET_INFO *charset_info= &my_charset_latin1;
static int embedded_server_arg_count=0;
static char *embedded_server_args[MAX_SERVER_ARGS];
+static my_bool display_result_vertically= FALSE, display_metadata= FALSE;
+
static const char *embedded_server_groups[] = {
"server",
"embedded",
@@ -212,7 +215,10 @@ Q_WAIT_FOR_SLAVE_TO_STOP,
Q_REQUIRE_VERSION,
Q_ENABLE_WARNINGS, Q_DISABLE_WARNINGS,
Q_ENABLE_INFO, Q_DISABLE_INFO,
+Q_ENABLE_METADATA, Q_DISABLE_METADATA,
Q_EXEC, Q_DELIMITER,
+Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS,
+Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL,
Q_UNKNOWN, /* Unknown command. */
Q_COMMENT, /* Comments, ignored. */
@@ -284,8 +290,14 @@ const char *command_names[]=
"disable_warnings",
"enable_info",
"disable_info",
+ "enable_metadata",
+ "disable_metadata",
"exec",
"delimiter",
+ "vertical_results",
+ "horizontal_results",
+ "query_vertical",
+ "query_horizontal",
0
};
@@ -441,10 +453,10 @@ static void free_used_memory()
my_free((gptr) (*q),MYF(0));
}
for (i=0; i < 10; i++)
- {
- if (var_reg[i].alloced_len)
- my_free(var_reg[i].str_val, MYF(MY_WME));
- }
+ {
+ if (var_reg[i].alloced_len)
+ my_free(var_reg[i].str_val, MYF(MY_WME));
+ }
while (embedded_server_arg_count > 1)
my_free(embedded_server_args[--embedded_server_arg_count],MYF(0));
delete_dynamic(&q_lines);
@@ -862,44 +874,59 @@ int do_exec(struct st_query* q)
char buf[1024];
FILE *res_file;
char *cmd= q->first_argument;
+ DBUG_ENTER("do_exec");
while (*cmd && my_isspace(charset_info, *cmd))
cmd++;
if (!*cmd)
die("Missing argument in exec\n");
- if (q->record_file[0])
- {
- init_dynamic_string(&ds_tmp, "", 16384, 65536);
- ds= &ds_tmp;
- }
- else
- ds= &ds_res;
+ DBUG_PRINT("info", ("Executing '%s'", cmd));
if (!(res_file= popen(cmd, "r")) && q->abort_on_error)
die("popen() failed\n");
- while (fgets(buf, sizeof(buf), res_file))
- replace_dynstr_append_mem(ds, buf, strlen(buf));
- pclose(res_file);
-
- if (glob_replace)
- free_replace();
- if (record)
+ if (disable_result_log)
{
- if (!q->record_file[0] && !result_file)
- die("At line %u: Missing result file", start_lineno);
- if (!result_file)
- str_to_file(q->record_file, ds->str, ds->length);
+ while (fgets(buf, sizeof(buf), res_file))
+ {
+ buf[strlen(buf)-1]=0;
+ DBUG_PRINT("exec_result",("%s", buf));
+ }
}
- else if (q->record_file[0])
+ else
{
- error= check_result(ds, q->record_file, q->require_file);
+ if (q->record_file[0])
+ {
+ init_dynamic_string(&ds_tmp, "", 16384, 65536);
+ ds= &ds_tmp;
+ }
+ else
+ ds= &ds_res;
+
+ while (fgets(buf, sizeof(buf), res_file))
+ replace_dynstr_append_mem(ds, buf, strlen(buf));
+
+ if (glob_replace)
+ free_replace();
+
+ if (record)
+ {
+ if (!q->record_file[0] && !result_file)
+ die("At line %u: Missing result file", start_lineno);
+ if (!result_file)
+ str_to_file(q->record_file, ds->str, ds->length);
+ }
+ else if (q->record_file[0])
+ {
+ error= check_result(ds, q->record_file, q->require_file);
+ }
+ if (ds == &ds_tmp)
+ dynstr_free(&ds_tmp);
}
- if (ds == &ds_tmp)
- dynstr_free(&ds_tmp);
+ pclose(res_file);
- return error;
+ DBUG_RETURN(error);
}
int var_query_set(VAR* v, const char* p, const char** p_end)
@@ -1034,7 +1061,7 @@ int do_system(struct st_query* q)
eval_expr(&v, p, 0); /* NULL terminated */
if (v.str_val_len)
{
- char expr_buf[512];
+ char expr_buf[1024];
if ((uint)v.str_val_len > sizeof(expr_buf) - 1)
v.str_val_len = sizeof(expr_buf) - 1;
memcpy(expr_buf, v.str_val, v.str_val_len);
@@ -1628,24 +1655,49 @@ int do_while(struct st_query* q)
}
-my_bool end_of_query(int c, char* p)
+/*
+ Read characters from line buffer or file. This is needed to allow
+ my_ungetc() to buffer MAX_DELIMITER characters for a file
+
+ NOTE:
+ This works as long as one doesn't change files (with 'source file_name')
+ when there is things pushed into the buffer. This should however not
+ happen for any tests in the test suite.
+*/
+
+int my_getc(FILE *file)
+{
+ if (line_buffer_pos == line_buffer)
+ return fgetc(file);
+ return *--line_buffer_pos;
+}
+
+void my_ungetc(int c)
+{
+ *line_buffer_pos++= (char) c;
+}
+
+
+my_bool end_of_query(int c)
{
- uint i, j;
- int tmp[MAX_DELIMITER]= {0};
+ uint i;
+ char tmp[MAX_DELIMITER];
+
+ if (c != *delimiter)
+ return 0;
- for (i= 0; c == *(delimiter + i) && i < delimiter_length;
- i++, c= fgetc(*cur_file))
+ for (i= 1; i < delimiter_length &&
+ (c= my_getc(*cur_file)) == *(delimiter + i);
+ i++)
tmp[i]= c;
- tmp[i]= c;
- for (j= i; j > 0 && i != delimiter_length; j--)
- ungetc(tmp[j], *cur_file);
if (i == delimiter_length)
- {
- ungetc(tmp[i], *cur_file);
- *p= 0;
- return 1;
- }
+ return 1; /* Found delimiter */
+
+ /* didn't find delimiter, push back things that we read */
+ my_ungetc(c);
+ while (i > 1)
+ my_ungetc(tmp[--i]);
return 0;
}
@@ -1663,7 +1715,7 @@ int read_line(char* buf, int size)
for (; p < buf_end ;)
{
no_save= 0;
- c= fgetc(*cur_file);
+ c= my_getc(*cur_file);
if (feof(*cur_file))
{
if ((*cur_file) != stdin)
@@ -1678,8 +1730,11 @@ int read_line(char* buf, int size)
switch(state) {
case R_NORMAL:
/* Only accept '{' in the beginning of a line */
- if (end_of_query(c, p))
+ if (end_of_query(c))
+ {
+ *p= 0;
return 0;
+ }
else if (c == '\'')
state = R_Q1;
else if (c == '"')
@@ -1715,7 +1770,7 @@ int read_line(char* buf, int size)
*buf= 0;
return 0;
}
- else if (end_of_query(c, p) || c == '{')
+ else if (end_of_query(c) || c == '{')
{
*p= 0;
return 0;
@@ -1735,8 +1790,11 @@ int read_line(char* buf, int size)
state= R_ESC_SLASH_Q1;
break;
case R_ESC_Q_Q1:
- if (end_of_query(c, p))
+ if (end_of_query(c))
+ {
+ *p= 0;
return 0;
+ }
if (c != '\'')
state= R_NORMAL;
else
@@ -1753,8 +1811,11 @@ int read_line(char* buf, int size)
state= R_ESC_SLASH_Q2;
break;
case R_ESC_Q_Q2:
- if (end_of_query(c, p))
+ if (end_of_query(c))
+ {
+ *p= 0;
return 0;
+ }
if (c != '"')
state= R_NORMAL;
else
@@ -1772,6 +1833,7 @@ int read_line(char* buf, int size)
return feof(*cur_file);
}
+
static char read_query_buf[MAX_QUERY];
int read_query(struct st_query** q_ptr)
@@ -1779,11 +1841,12 @@ int read_query(struct st_query** q_ptr)
char *p = read_query_buf, * p1 ;
int expected_errno;
struct st_query* q;
+ DBUG_ENTER("read_query");
if (parser.current_line < parser.read_lines)
{
get_dynamic(&q_lines, (gptr) q_ptr, parser.current_line) ;
- return 0;
+ DBUG_RETURN(0);
}
if (!(*q_ptr= q= (struct st_query*) my_malloc(sizeof(*q), MYF(MY_WME))) ||
insert_dynamic(&q_lines, (gptr) &q))
@@ -1795,14 +1858,14 @@ int read_query(struct st_query** q_ptr)
memcpy((gptr) q->expected_errno, (gptr) global_expected_errno,
sizeof(global_expected_errno));
q->expected_errors= global_expected_errors;
- q->abort_on_error= global_expected_errno[0] == 0;
+ q->abort_on_error= global_expected_errors == 0;
bzero((gptr) global_expected_errno, sizeof(global_expected_errno));
global_expected_errors=0;
q->type = Q_UNKNOWN;
q->query_buf= q->query= 0;
if (read_line(read_query_buf, sizeof(read_query_buf)))
- return 1;
+ DBUG_RETURN(1);
if (*p == '#')
{
@@ -1856,7 +1919,7 @@ int read_query(struct st_query** q_ptr)
q->first_argument= p;
q->end= strend(q->query);
parser.read_lines++;
- return 0;
+ DBUG_RETURN(0);
}
@@ -1894,7 +1957,7 @@ static struct my_option my_long_options[] =
{"password", 'p', "Password to use when connecting to server.",
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection.", (gptr*) &port,
- (gptr*) &port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (gptr*) &port, 0, GET_INT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, 0},
{"quiet", 's', "Suppress all normal output.", (gptr*) &silent,
(gptr*) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"record", 'r', "Record output of test_file into result file.",
@@ -2110,6 +2173,7 @@ static void append_result(DYNAMIC_STRING *ds, MYSQL_RES *res)
{
MYSQL_ROW row;
uint num_fields= mysql_num_fields(res);
+ MYSQL_FIELD *fields= !display_result_vertically ? 0 : mysql_fetch_fields(res);
unsigned long *lengths;
while ((row = mysql_fetch_row(res)))
{
@@ -2130,11 +2194,22 @@ static void append_result(DYNAMIC_STRING *ds, MYSQL_RES *res)
val= "NULL";
len= 4;
}
- if (i)
+ if (!display_result_vertically)
+ {
+ if (i)
+ dynstr_append_mem(ds, "\t", 1);
+ replace_dynstr_append_mem(ds, val, len);
+ }
+ else
+ {
+ dynstr_append(ds, fields[i].name);
dynstr_append_mem(ds, "\t", 1);
- replace_dynstr_append_mem(ds, val, len);
+ replace_dynstr_append_mem(ds, val, len);
+ dynstr_append_mem(ds, "\n", 1);
+ }
}
- dynstr_append_mem(ds, "\n", 1);
+ if (!display_result_vertically)
+ dynstr_append_mem(ds, "\n", 1);
}
free_replace_column();
}
@@ -2149,7 +2224,8 @@ static void append_result(DYNAMIC_STRING *ds, MYSQL_RES *res)
int run_query(MYSQL* mysql, struct st_query* q, int flags)
{
MYSQL_RES* res= 0;
- int i, error= 0, err= 0, counter= 0;
+ uint i;
+ int error= 0, err= 0, counter= 0;
DYNAMIC_STRING *ds;
DYNAMIC_STRING ds_tmp;
DYNAMIC_STRING eval_query;
@@ -2233,7 +2309,8 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
goto end; /* Ok */
}
}
- DBUG_PRINT("info",("i: %d expected_errors: %d", i, q->expected_errors));
+ DBUG_PRINT("info",("i: %d expected_errors: %d", i,
+ q->expected_errors));
dynstr_append_mem(ds, "ERROR ",6);
replace_dynstr_append_mem(ds, mysql_sqlstate(mysql),
strlen(mysql_sqlstate(mysql)));
@@ -2276,16 +2353,65 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
{
if (res)
{
- int num_fields= mysql_num_fields(res);
- MYSQL_FIELD *fields= mysql_fetch_fields(res);
+ MYSQL_FIELD *field, *field_end;
+ uint num_fields= mysql_num_fields(res);
- for (i = 0; i < num_fields; i++)
+ if (display_metadata)
{
- if (i)
+ dynstr_append(ds,"Catalog\tDatabase\tTable\tTable_alias\tColumn\tColumn_alias\tName\tType\tLength\tMax length\tIs_null\tFlags\tDecimals\tCharsetnr\n");
+ for (field= mysql_fetch_fields(res), field_end= field+num_fields ;
+ field < field_end ;
+ field++)
+ {
+ char buff[22];
+ dynstr_append_mem(ds, field->catalog, field->catalog_length);
+ dynstr_append_mem(ds, "\t", 1);
+ dynstr_append_mem(ds, field->db, field->db_length);
+ dynstr_append_mem(ds, "\t", 1);
+ dynstr_append_mem(ds, field->org_table, field->org_table_length);
+ dynstr_append_mem(ds, "\t", 1);
+ dynstr_append_mem(ds, field->table, field->table_length);
+ dynstr_append_mem(ds, "\t", 1);
+ dynstr_append_mem(ds, field->org_name, field->org_name_length);
+ dynstr_append_mem(ds, "\t", 1);
+ dynstr_append_mem(ds, field->name, field->name_length);
+ dynstr_append_mem(ds, "\t", 1);
+ int10_to_str((int) field->type, buff, 10);
+ dynstr_append(ds, buff);
+ dynstr_append_mem(ds, "\t", 1);
+ int10_to_str((int) field->length, buff, 10);
+ dynstr_append(ds, buff);
+ dynstr_append_mem(ds, "\t", 1);
+ int10_to_str((int) field->max_length, buff, 10);
+ dynstr_append(ds, buff);
+ dynstr_append_mem(ds, "\t", 1);
+ dynstr_append_mem(ds, (char*) (IS_NOT_NULL(field->flags) ?
+ "N" : "Y"), 1);
dynstr_append_mem(ds, "\t", 1);
- dynstr_append(ds, fields[i].name);
+
+ int10_to_str((int) field->flags, buff, 10);
+ dynstr_append(ds, buff);
+ dynstr_append_mem(ds, "\t", 1);
+ int10_to_str((int) field->decimals, buff, 10);
+ dynstr_append(ds, buff);
+ dynstr_append_mem(ds, "\t", 1);
+ int10_to_str((int) field->charsetnr, buff, 10);
+ dynstr_append(ds, buff);
+ dynstr_append_mem(ds, "\n", 1);
+ }
+ }
+ if (!display_result_vertically)
+ {
+ field= mysql_fetch_fields(res);
+ for (i = 0; i < num_fields; i++)
+ {
+ if (i)
+ dynstr_append_mem(ds, "\t", 1);
+ replace_dynstr_append_mem(ds, field[i].name,
+ strlen(field[i].name));
+ }
+ dynstr_append_mem(ds, "\n", 1);
}
- dynstr_append_mem(ds, "\n", 1);
append_result(ds, res);
}
@@ -2308,17 +2434,20 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
mysql_free_result(warn_res);
}
}
- if (!disable_info && mysql_info(mysql))
+ if (!disable_info)
{
- dynstr_append(ds, "info: ");
- dynstr_append(ds, mysql_info(mysql));
- dynstr_append_mem(ds, "\n", 1);
+ char buf[40];
+ sprintf(buf,"affected rows: %lu\n",(ulong) mysql_affected_rows(mysql));
+ dynstr_append(ds, buf);
+ if (mysql_info(mysql))
+ {
+ dynstr_append(ds, "info: ");
+ dynstr_append(ds, mysql_info(mysql));
+ dynstr_append_mem(ds, "\n", 1);
+ }
}
}
- if (glob_replace)
- free_replace();
-
if (record)
{
if (!q->record_file[0] && !result_file)
@@ -2339,6 +2468,7 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags)
mysql_error(mysql);
end:
+ free_replace();
last_result=0;
if (ds == &ds_tmp)
dynstr_free(&ds_tmp);
@@ -2352,10 +2482,12 @@ void get_query_type(struct st_query* q)
{
char save;
uint type;
+ DBUG_ENTER("get_query_type");
+
if (*q->query == '}')
{
q->type = Q_END_BLOCK;
- return;
+ DBUG_VOID_RETURN;
}
if (q->type != Q_COMMENT_WITH_COMMAND)
q->type = Q_QUERY;
@@ -2366,8 +2498,10 @@ void get_query_type(struct st_query* q)
q->query[q->first_word_len]=save;
if (type > 0)
q->type=(enum enum_commands) type; /* Found command */
+ DBUG_VOID_RETURN;
}
+
static byte *get_var_key(const byte* var, uint* len,
my_bool __attribute__((unused)) t)
{
@@ -2539,6 +2673,8 @@ int main(int argc, char **argv)
case Q_DISABLE_WARNINGS: disable_warnings=1; break;
case Q_ENABLE_INFO: disable_info=0; break;
case Q_DISABLE_INFO: disable_info=1; break;
+ case Q_ENABLE_METADATA: display_metadata=1; break;
+ case Q_DISABLE_METADATA: display_metadata=0; break;
case Q_SOURCE: do_source(q); break;
case Q_SLEEP: do_sleep(q, 0); break;
case Q_REAL_SLEEP: do_sleep(q, 1); break;
@@ -2557,12 +2693,33 @@ int main(int argc, char **argv)
strmake(delimiter, q->first_argument, sizeof(delimiter) - 1);
delimiter_length= strlen(delimiter);
break;
+ case Q_DISPLAY_VERTICAL_RESULTS: display_result_vertically= TRUE; break;
+ case Q_DISPLAY_HORIZONTAL_RESULTS:
+ display_result_vertically= FALSE; break;
case Q_LET: do_let(q); break;
case Q_EVAL_RESULT: eval_result = 1; break;
case Q_EVAL:
if (q->query == q->query_buf)
q->query= q->first_argument;
/* fall through */
+ case Q_QUERY_VERTICAL:
+ case Q_QUERY_HORIZONTAL:
+ {
+ my_bool old_display_result_vertically= display_result_vertically;
+ if (!q->query[q->first_word_len])
+ {
+ /* This happens when we use 'query_..' on it's own line */
+ q_send_flag=1;
+ 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);
+ display_result_vertically= old_display_result_vertically;
+ break;
+ }
case Q_QUERY:
case Q_REAP:
{
diff --git a/config.guess b/config.guess
index 27ccc69772b..ef65f9b4ea9 100755
--- a/config.guess
+++ b/config.guess
@@ -1,9 +1,9 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-timestamp='2001-08-21'
+timestamp='2003-07-02'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -24,8 +24,9 @@ timestamp='2001-08-21'
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
-# Written by Per Bothner <bothner@cygnus.com>.
-# Please send patches to <config-patches@gnu.org>.
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
@@ -87,30 +88,42 @@ if test $# != 0; then
exit 1
fi
+trap 'exit 1' 1 2 15
-dummy=dummy-$$
-trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
-# CC_FOR_BUILD -- compiler used by this script.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
-set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int dummy(){}" > $dummy.c ;
- for c in cc gcc c89 ; do
- ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
- if test $? = 0 ; then
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
- rm -f $dummy.c $dummy.o $dummy.rel ;
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ;
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac'
+esac ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
@@ -136,29 +149,30 @@ esac
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
- # Netbsd (nbsd) targets should (where applicable) match one or
+ # NetBSD (nbsd) targets should (where applicable) match one or
# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the
# object file format.
- # Determine the machine/vendor (is the vendor relevant).
- case "${UNAME_MACHINE}" in
- amiga) machine=m68k-unknown ;;
- arm32) machine=arm-unknown ;;
- atari*) machine=m68k-atari ;;
- sun3*) machine=m68k-sun ;;
- mac68k) machine=m68k-apple ;;
- macppc) machine=powerpc-apple ;;
- hp3[0-9][05]) machine=m68k-hp ;;
- ibmrt|romp-ibm) machine=romp-ibm ;;
- *) machine=${UNAME_MACHINE}-unknown ;;
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently, or will in the future.
- case "${UNAME_MACHINE}" in
- i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k)
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep __ELF__ >/dev/null
@@ -175,75 +189,112 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
;;
esac
# The OS release
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit 0 ;;
+ amiga:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ arc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ hp300:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mac68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ macppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme88k:OpenBSD:*:*)
+ echo m88k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvmeppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ pmax:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sgi:OpenBSD:*:*)
+ echo mipseb-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sun3:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ wgrisc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ *:OpenBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
alpha:OSF1:*:*)
if test $UNAME_RELEASE = "V4.0"; then
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
fi
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- cat <<EOF >$dummy.s
- .data
-\$Lformat:
- .byte 37,100,45,37,120,10,0 # "%d-%x\n"
-
- .text
- .globl main
- .align 4
- .ent main
-main:
- .frame \$30,16,\$26,0
- ldgp \$29,0(\$27)
- .prologue 1
- .long 0x47e03d80 # implver \$0
- lda \$2,-1
- .long 0x47e20c21 # amask \$2,\$1
- lda \$16,\$Lformat
- mov \$0,\$17
- not \$1,\$18
- jsr \$26,printf
- ldgp \$29,0(\$26)
- mov 0,\$16
- jsr \$26,exit
- .end main
-EOF
- eval $set_cc_for_build
- $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
- if test "$?" = 0 ; then
- case `./$dummy` in
- 0-0)
- UNAME_MACHINE="alpha"
- ;;
- 1-0)
- UNAME_MACHINE="alphaev5"
- ;;
- 1-1)
- UNAME_MACHINE="alphaev56"
- ;;
- 1-101)
- UNAME_MACHINE="alphapca56"
- ;;
- 2-303)
- UNAME_MACHINE="alphaev6"
- ;;
- 2-307)
- UNAME_MACHINE="alphaev67"
- ;;
- 2-1307)
- UNAME_MACHINE="alphaev68"
- ;;
- esac
- fi
- rm -f $dummy.s $dummy
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
exit 0 ;;
+ Alpha*:OpenVMS:*:*)
+ echo alpha-hp-vms
+ exit 0 ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
@@ -256,29 +307,11 @@ EOF
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit 0;;
- amiga:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
exit 0 ;;
- arc64:OpenBSD:*:*)
- echo mips64el-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- arc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- hkmips:OpenBSD:*:*)
- echo mips-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- pmax:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sgi:OpenBSD:*:*)
- echo mips-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- wgrisc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
exit 0 ;;
*:OS/390:*:*)
echo i370-ibm-openedition
@@ -300,6 +333,13 @@ EOF
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit 0 ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit 0 ;;
+ DRS?6000:UNIX_SV:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7 && exit 0 ;;
+ esac ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit 0 ;;
@@ -328,7 +368,7 @@ EOF
echo m68k-sun-sunos${UNAME_RELEASE}
exit 0 ;;
sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
@@ -342,12 +382,6 @@ EOF
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit 0 ;;
- sparc*:NetBSD:*)
- echo `uname -p`-unknown-netbsd${UNAME_RELEASE}
- exit 0 ;;
- atari*:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
@@ -374,18 +408,6 @@ EOF
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit 0 ;;
- sun3*:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;;
@@ -402,6 +424,7 @@ EOF
echo clipper-intergraph-clix${UNAME_RELEASE}
exit 0 ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
@@ -423,16 +446,20 @@ EOF
exit (-1);
}
EOF
- eval $set_cc_for_build
- $CC_FOR_BUILD $dummy.c -o $dummy \
- && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && rm -f $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
+ $CC_FOR_BUILD -o $dummy $dummy.c \
+ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+ && exit 0
echo mips-mips-riscos${UNAME_RELEASE}
exit 0 ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
exit 0 ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit 0 ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit 0 ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit 0 ;;
@@ -493,6 +520,7 @@ EOF
exit 0 ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <sys/systemcfg.h>
@@ -504,9 +532,7 @@ EOF
exit(0);
}
EOF
- eval $set_cc_for_build
- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
+ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
echo rs6000-ibm-aix3.2.5
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
@@ -515,7 +541,7 @@ EOF
fi
exit 0 ;;
*:AIX:*:[45])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
@@ -555,10 +581,8 @@ EOF
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
- case "${HPUX_REV}" in
- 11.[0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
@@ -567,12 +591,13 @@ EOF
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
esac ;;
esac
- fi ;;
- esac
- if [ "${HP_ARCH}" = "" ]; then
- sed 's/^ //' << EOF >$dummy.c
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include <stdlib.h>
@@ -605,12 +630,21 @@ EOF
exit (0);
}
EOF
- eval $set_cc_for_build
- (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy`
- if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
- rm -f $dummy.c $dummy
- fi ;;
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ # avoid double evaluation of $set_cc_for_build
+ test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit 0 ;;
ia64:HP-UX:*:*)
@@ -618,6 +652,7 @@ EOF
echo ia64-hp-hpux${HPUX_REV}
exit 0 ;;
3050*:HI-UX:*:*)
+ eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include <unistd.h>
int
@@ -643,9 +678,7 @@ EOF
exit (0);
}
EOF
- eval $set_cc_for_build
- $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
+ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
echo unknown-hitachi-hiuxwe2
exit 0 ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
@@ -673,9 +706,6 @@ EOF
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit 0 ;;
- hppa*:OpenBSD:*:*)
- echo hppa-unknown-openbsd
- exit 0 ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit 0 ;;
@@ -694,9 +724,6 @@ EOF
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit 0 ;;
- CRAY*X-MP:*:*:*)
- echo xmp-cray-unicos
- exit 0 ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
@@ -709,27 +736,21 @@ EOF
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
- CRAY*T3D:*:*:*)
- echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit 0 ;;
- CRAY-2:*:*:*)
- echo cray2-cray-unicos
- exit 0 ;;
+ *:UNICOS/mp:*:*)
+ echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit 0 ;;
- hp300:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit 0 ;;
@@ -739,11 +760,22 @@ EOF
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit 0 ;;
- *:FreeBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit 0 ;;
- *:OpenBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ *:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
+ # Determine whether the default compiler uses glibc.
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #if __GLIBC__ >= 2
+ LIBC=gnu
+ #else
+ LIBC=
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ # GNU/FreeBSD systems have a "k" prefix to indicate we are using
+ # FreeBSD's kernel, but not the complete OS.
+ case ${LIBC} in gnu) kernel_only='k' ;; esac
+ echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
exit 0 ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
@@ -754,11 +786,17 @@ EOF
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit 0 ;;
+ x86:Interix*:[34]*)
+ echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
+ exit 0 ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit 0 ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
- echo i386-pc-interix
+ echo i586-pc-interix
exit 0 ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
@@ -778,6 +816,9 @@ EOF
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-${VENDOR}-linux
exit 0 ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux
+ exit 0 ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-${VENDOR}-linux
exit 0 ;;
@@ -785,19 +826,48 @@ EOF
echo ${UNAME_MACHINE}-${VENDOR}-linux
exit 0 ;;
mips:Linux:*:*)
- case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in
- big) echo mips-${VENDOR}-linux && exit 0 ;;
- little) echo mipsel-${VENDOR}-linux && exit 0 ;;
- esac
- case `sed -n '/^system type/s/^.*: \([^ ]*\).*/\1/p' < /proc/cpuinfo` in
- SGI|sgi) echo mips-${VENDOR}-linux-gnu && exit 0 ;;
- esac
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips
+ #undef mipsel
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mipsel
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ test x"${CPU}" != x && echo "${CPU}-${VENDOR}-linux" && exit 0
+ ;;
+ mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips64
+ #undef mips64el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mips64el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips64
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ test x"${CPU}" != x && echo "${CPU}-${VENDOR}-linux" && exit 0
;;
- ppc:Linux:*:*|ppc64:Linux:*:*)
+ ppc:Linux:*:*)
echo powerpc-${VENDOR}-linux
exit 0 ;;
ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
+ echo powerpc64-${VENDOR}-linux
exit 0 ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -810,7 +880,7 @@ EOF
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ if test "$?" = 0 ; then LIBC="-libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-${VENDOR}-linux${LIBC}
exit 0 ;;
parisc:Linux:*:* | hppa:Linux:*:*)
@@ -827,6 +897,9 @@ EOF
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit 0 ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-${VENDOR}-linux
+ exit 0 ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-${VENDOR}-linux
exit 0 ;;
@@ -840,7 +913,8 @@ EOF
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
# problems with other programs or directories called `ld' in the path.
- ld_supported_targets=`cd /; ld --help 2>&1 \
+ # Set LC_ALL=C to ensure ld outputs messages in English.
+ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
| sed -ne '/supported targets:/!d
s/[ ][ ]*/ /g
s/.*supported targets: *//
@@ -852,7 +926,7 @@ EOF
;;
a.out-i386-linux)
echo "${UNAME_MACHINE}-${VENDOR}-linuxaout"
- exit 0 ;;
+ exit 0 ;;
coff-i386)
echo "${UNAME_MACHINE}-${VENDOR}-linuxcoff"
exit 0 ;;
@@ -863,33 +937,29 @@ EOF
exit 0 ;;
esac
# Determine whether the default compiler is a.out or elf
- cat >$dummy.c <<EOF
-#include <features.h>
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
-#ifdef __ELF__
-# ifdef __GLIBC__
-# if __GLIBC__ >= 2
- printf ("%s-${VENDOR}-linux\n", argv[1]);
-# else
- printf ("%s-${VENDOR}-linuxlibc1\n", argv[1]);
-# endif
-# else
- printf ("%s-${VENDOR}-linuxlibc1\n", argv[1]);
-# endif
-#else
- printf ("%s-${VENDOR}-linuxaout\n", argv[1]);
-#endif
- return 0;
-}
-EOF
eval $set_cc_for_build
- $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0
- rm -f $dummy.c $dummy
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #ifdef __ELF__
+ # ifdef __GLIBC__
+ # if __GLIBC__ >= 2
+ LIBC=gnu
+ # else
+ LIBC=gnulibc1
+ # endif
+ # else
+ LIBC=gnulibc1
+ # endif
+ #else
+ #ifdef __INTEL_COMPILER
+ LIBC=gnu
+ #else
+ LIBC=gnuaout
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ test x"${LIBC}" != x && echo "${UNAME_MACHINE}-${VENDOR}-linux-${LIBC}" | sed 's/linux-gnu/linux/' && exit 0
test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
;;
i*86:DYNIX/ptx:4*:*)
@@ -906,6 +976,23 @@ EOF
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit 0 ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit 0 ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit 0 ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit 0 ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit 0 ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
@@ -927,22 +1014,19 @@ EOF
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
- (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
- (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686
- (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit 0 ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit 0 ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
@@ -966,9 +1050,15 @@ EOF
# "miniframe"
echo m68010-convergent-sysv
exit 0 ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit 0 ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit 0 ;;
M68*:*:R3V[567]*:*)
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0)
+ 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@@ -985,9 +1075,6 @@ EOF
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit 0 ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit 0 ;;
@@ -1059,6 +1146,9 @@ EOF
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
exit 0 ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
@@ -1066,18 +1156,24 @@ EOF
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit 0 ;;
*:Darwin:*:*)
- echo `uname -p`-apple-darwin${UNAME_RELEASE}
+ case `uname -p` in
+ *86) UNAME_PROCESSOR=i686 ;;
+ powerpc) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit 0 ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
- if test "${UNAME_MACHINE}" = "x86pc"; then
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
- echo `uname -p`-${UNAME_MACHINE}-nto-qnx
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
exit 0 ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit 0 ;;
- NSR-[KW]:NONSTOP_KERNEL:*:*)
+ NSR-[DGKLNPTVW]:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit 0 ;;
*:NonStop-UX:*:*)
@@ -1100,11 +1196,6 @@ EOF
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit 0 ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit 0 ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit 0 ;;
@@ -1123,14 +1214,15 @@ EOF
*:ITS:*:*)
echo pdp10-unknown-its
exit 0 ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
exit 0 ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+eval $set_cc_for_build
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
# include <sys/types.h>
@@ -1245,9 +1337,7 @@ main ()
}
EOF
-eval $set_cc_for_build
-$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
-rm -f $dummy.c $dummy
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
# Apollos put the system type in the environment.
diff --git a/config.sub b/config.sub
index 83f4b0151e0..9952c14c714 100755
--- a/config.sub
+++ b/config.sub
@@ -1,9 +1,9 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-timestamp='2001-08-13'
+timestamp='2003-07-04'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -29,7 +29,8 @@ timestamp='2001-08-13'
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
-# Please send patches to <config-patches@gnu.org>.
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@@ -117,7 +118,7 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
+ nto-qnx* | linux-gnu* | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
@@ -226,31 +227,44 @@ case $basic_machine in
1750a | 580 \
| a29k \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
| c4x | clipper \
- | d10v | d30v | dsp16xx \
- | fr30 \
+ | d10v | d30v | dlx | dsp16xx \
+ | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
+ | ip2k \
| m32r | m68000 | m68k | m88k | mcore \
- | mips16 | mips64 | mips64el | mips64orion | mips64orionel \
- | mips64vr4100 | mips64vr4100el | mips64vr4300 \
- | mips64vr4300el | mips64vr5000 | mips64vr5000el \
- | mipsbe | mipsel | mipsle | mipstx39 | mipstx39el \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64vr | mips64vrel \
+ | mips64orion | mips64orionel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
| mn10200 | mn10300 \
+ | msp430 \
| ns16k | ns32k \
- | openrisc \
+ | openrisc | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
- | s390 | s390x \
- | sh | sh[34] | sh[34]eb | shbe | shle \
- | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \
+ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
| strongarm \
- | tahoe | thumb | tic80 | tron \
- | v850 \
+ | tahoe | thumb | tic4x | tic80 | tron \
+ | v850 | v850e \
| we32k \
- | x86 | xscale \
+ | x86 | xscale | xstormy16 | xtensa \
| z8k)
basic_machine=$basic_machine-unknown
;;
@@ -277,38 +291,55 @@ case $basic_machine in
580-* \
| a29k-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alphapca5[67]-* | arc-* \
- | arm-* | armbe-* | armle-* | armv*-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* \
| bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c54x-* \
- | clipper-* | cray2-* | cydra-* \
- | d10v-* | d30v-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | clipper-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
| elxsi-* \
- | f30[01]-* | f700-* | fr30-* | fx80-* \
+ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* \
| m32r-* \
- | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | mcore-* \
- | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
- | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipsel-* \
- | mipsle-* | mipstx39-* | mipstx39el-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | msp430-* \
+ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
- | s390-* | s390x-* \
- | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \
- | sparc-* | sparc64-* | sparc86x-* | sparclite-* \
- | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* \
- | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
- | v850-* | vax-* \
+ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tron-* \
+ | v850-* | v850e-* | vax-* \
| we32k-* \
- | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \
+ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
+ | xtensa-* \
| ymp-* \
| z8k-*)
;;
@@ -342,6 +373,9 @@ case $basic_machine in
basic_machine=a29k-none
os=-bsd
;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
amdahl)
basic_machine=580-amdahl
os=-sysv
@@ -373,6 +407,10 @@ case $basic_machine in
basic_machine=ns32k-sequent
os=-dynix
;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
convex-c1)
basic_machine=c1-convex
os=-bsd
@@ -393,16 +431,8 @@ case $basic_machine in
basic_machine=c38-convex
os=-bsd
;;
- cray | ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- cray2)
- basic_machine=cray2-cray
- os=-unicos
- ;;
- [cjt]90)
- basic_machine=${basic_machine}-cray
+ cray | j90)
+ basic_machine=j90-cray
os=-unicos
;;
crds | unos)
@@ -417,6 +447,14 @@ case $basic_machine in
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
@@ -597,12 +635,6 @@ case $basic_machine in
basic_machine=m68k-atari
os=-mint
;;
- mipsel*-linux*)
- basic_machine=mipsel-unknown
- ;;
- mips*-linux*)
- basic_machine=mips-unknown
- ;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
@@ -617,6 +649,10 @@ case $basic_machine in
basic_machine=m68k-rom68k
os=-coff
;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
msdos)
basic_machine=i386-pc
os=-msdos
@@ -689,6 +725,10 @@ case $basic_machine in
np1)
basic_machine=np1-gould
;;
+ nv1)
+ basic_machine=nv1-cray
+ os=-unicosmp
+ ;;
nsr-tandem)
basic_machine=nsr-tandem
;;
@@ -696,6 +736,10 @@ case $basic_machine in
basic_machine=hppa1.1-oki
os=-proelf
;;
+ or32 | or32-*)
+ basic_machine=or32-unknown
+ os=-coff
+ ;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
@@ -718,51 +762,55 @@ case $basic_machine in
pbb)
basic_machine=m68k-tti
;;
- pc532 | pc532-*)
+ pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
- pentium | p5 | k5 | k6 | nexgen)
+ pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
- pentiumpro | p6 | 6x86 | athlon)
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc
;;
- pentiumii | pentium2)
+ pentiumii | pentium2 | pentiumiii | pentium3)
basic_machine=i686-pc
;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-*)
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
- pentiumii-* | pentium2-*)
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=power-ibm
;;
ppc) basic_machine=powerpc-unknown
- ;;
- ppc64) basic_machine=powerpc-unknown
;;
ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown
- ;;
+ ;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64) basic_machine=powerpc64-unknown
- ;;
+ ;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown
- ;;
+ ;;
ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
@@ -783,10 +831,26 @@ case $basic_machine in
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
sa29200)
basic_machine=a29k-amd
os=-udi
;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
sequent)
basic_machine=i386-sequent
;;
@@ -794,7 +858,10 @@ case $basic_machine in
basic_machine=sh-hitachi
os=-hms
;;
- sparclite-wrs)
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
@@ -861,19 +928,35 @@ case $basic_machine in
os=-dynix
;;
t3e)
- basic_machine=t3e-cray
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
os=-unicos
;;
tic54x | c54x*)
basic_machine=tic54x-unknown
os=-coff
;;
+ tic55x | c55x*)
+ basic_machine=tic55x-unknown
+ os=-coff
+ ;;
+ tic6x | c6x*)
+ basic_machine=tic6x-unknown
+ os=-coff
+ ;;
tx39)
basic_machine=mipstx39-unknown
;;
tx39el)
basic_machine=mipstx39el-unknown
;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
tower | tower-32)
basic_machine=m68k-ncr
;;
@@ -898,8 +981,8 @@ case $basic_machine in
os=-vms
;;
vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
+ basic_machine=f301-fujitsu
+ ;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
@@ -920,17 +1003,13 @@ case $basic_machine in
basic_machine=hppa1.1-winbond
os=-proelf
;;
- windows32)
- basic_machine=i386-pc
- os=-windows32-msvcrt
+ xps | xps100)
+ basic_machine=xps100-honeywell
;;
- xmp)
- basic_machine=xmp-cray
+ ymp)
+ basic_machine=ymp-cray
os=-unicos
;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
@@ -951,16 +1030,6 @@ case $basic_machine in
op60c)
basic_machine=hppa1.1-oki
;;
- mips)
- case $os in
- linux*)
- basic_machine=mips-unknown
- ;;
- *)
- basic_machine=mips-mips
- ;;
- esac
- ;;
romp)
basic_machine=romp-ibm
;;
@@ -980,13 +1049,16 @@ case $basic_machine in
we32k)
basic_machine=we32k-att
;;
- sh3 | sh4 | sh3eb | sh4eb)
+ sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
sparc | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
- cydra)
+ cydra)
basic_machine=cydra-cydrome
;;
orion)
@@ -1001,10 +1073,6 @@ case $basic_machine in
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
- c4x*)
- basic_machine=c4x-none
- os=-coff
- ;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
@@ -1060,17 +1128,19 @@ case $os in
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
+ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux* | -uxpv* | -beos* | -mpeix* | -udk* \
- | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos*)
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1082,8 +1152,10 @@ case $os in
;;
esac
;;
+ -nto-qnx*)
+ ;;
-nto*)
- os=-nto-qnx
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \
@@ -1119,14 +1191,20 @@ case $os in
-acis*)
os=-aos
;;
+ -atheos*)
+ os=-atheos
+ ;;
-386bsd)
os=-bsd
;;
-ctix* | -uts*)
os=-sysv
;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
-ns2 )
- os=-nextstep2
+ os=-nextstep2
;;
-nsk*)
os=-nsk
@@ -1165,8 +1243,14 @@ case $os in
-xenix)
os=-xenix
;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
;;
-none)
;;
@@ -1199,10 +1283,14 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
pdp10-*)
os=-tops20
;;
- pdp11-*)
+ pdp11-*)
os=-none
;;
*-dec | vax-*)
@@ -1229,6 +1317,9 @@ case $basic_machine in
mips*-*)
os=-elf
;;
+ or32-*)
+ os=-coff
+ ;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
@@ -1292,19 +1383,19 @@ case $basic_machine in
*-next)
os=-nextstep3
;;
- *-gould)
+ *-gould)
os=-sysv
;;
- *-highlevel)
+ *-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
- *-sgi)
+ *-sgi)
os=-irix
;;
- *-siemens)
+ *-siemens)
os=-sysv4
;;
*-masscomp)
@@ -1376,7 +1467,7 @@ case $basic_machine in
-ptx*)
vendor=sequent
;;
- -vxsim* | -vxworks*)
+ -vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
-aux*)
diff --git a/configure.in b/configure.in
index b07f970a651..dcd963c5130 100644
--- a/configure.in
+++ b/configure.in
@@ -192,6 +192,11 @@ AC_PROG_RANLIB
#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
@@ -346,7 +351,7 @@ AC_SUBST(CXXFLAGS)
AC_SUBST(LD)
AC_SUBST(INSTALL_SCRIPT)
-export CC CFLAGS LD LDFLAGS
+export CC CXX CFLAGS LD LDFLAGS AR
if test "$GXX" = "yes"
then
@@ -1008,7 +1013,7 @@ case $SYSTEM_TYPE in
*darwin5*)
if test "$ac_cv_prog_gcc" = "yes"
then
- FLAGS="-traditional-cpp -DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH -DFN_NO_CASE_SENCE"
+ 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"
@@ -1018,7 +1023,16 @@ case $SYSTEM_TYPE in
*darwin6*)
if test "$ac_cv_prog_gcc" = "yes"
then
- FLAGS="-DHAVE_DARWIN_THREADS -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DHAVE_BROKEN_REALPATH -DFN_NO_CASE_SENCE"
+ 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"
@@ -1054,7 +1068,7 @@ case $SYSTEM_TYPE in
echo "Using --with-named-thread=-lpthread"
with_named_thread="-lpthread"
fi
- CXXFLAGS="-D_BOOL"
+ CXXFLAGS="$CXXFLAGS -D_BOOL"
;;
*aix4.3*)
echo "Adding defines for AIX"
@@ -1821,29 +1835,32 @@ AC_TYPE_SIGNAL
MYSQL_TYPE_QSORT
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF
-AC_CHECK_FUNCS(alarm bmove \
- chsize ftruncate rint finite isnan fpsetmask fpresetsticky\
- cuserid fcntl fconvert poll \
- getrusage getpwuid getcwd getrlimit getwd index stpcpy locking longjmp \
- perror pread realpath readlink rename \
- socket strnlen madvise mallinfo mkstemp \
- strtol strtoul strtoll strtoull snprintf tempnam thr_setconcurrency \
- gethostbyaddr_r gethostbyname_r getpwnam \
- bfill bzero bcmp strstr strpbrk strerror \
- tell atod memcpy memmove \
- setupterm strcasecmp sighold vidattr lrand48 localtime_r gmtime_r \
- sigset sigthreadmask pthread_sigmask pthread_setprio pthread_setprio_np \
- pthread_setschedparam pthread_attr_setprio pthread_attr_setschedparam \
- pthread_attr_create pthread_getsequence_np pthread_attr_setstacksize \
- pthread_attr_getstacksize \
- pthread_condattr_create rwlock_init pthread_rwlock_rdlock \
- fsync fdatasync fchmod getpass getpassphrase initgroups mlockall)
+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_FUNCS(fseeko,
+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!");
@@ -2691,7 +2708,7 @@ then
esac
(cd $bdb/build_unix && \
sh $rel_srcdir/$bdb/dist/configure $bdb_conf_flags) || \
- AC_MSG_ERROR([could not configure Berkeley DB])
+ AC_MSG_ERROR([could not configure Berkeley DB])
dnl echo "bdb = '$bdb'; inc = '$bdb_includes', lib = '$bdb_libs'"
echo "END OF BERKELEY DB CONFIGURATION"
@@ -2730,25 +2747,7 @@ EOF
then
innodb_conf_flags=""
sql_server_dirs="$sql_server_dirs innobase"
- echo "CONFIGURING FOR INNODB"
- if test ! -d "innobase"; then
- # This should only happen when doing a VPATH build
- echo "NOTICE: I have to make the Innobase directory: `pwd`/innobase"
- mkdir "innobase" || exit 1
- fi
- rel_srcdir=
- case "$srcdir" in
- /* ) rel_srcdir="$srcdir" ;;
- * ) rel_srcdir="../$srcdir" ;;
- esac
- if test "x$enable_dependency_tracking" == xno
- then
- innodb_conf_flags=--disable-dependency-tracking
- fi
- (cd innobase && sh $rel_srcdir/innobase/configure --host=$host $innodb_conf_flags) \
- || AC_MSG_ERROR([could not configure INNODB])
-
- echo "END OF INNODB CONFIGURATION"
+ AC_CONFIG_SUBDIRS(innobase)
fi
#
# END of configuration for optional table handlers
diff --git a/extra/replace.c b/extra/replace.c
index 8e007e3a971..a44c33a4694 100644
--- a/extra/replace.c
+++ b/extra/replace.c
@@ -14,12 +14,16 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* Replace strings in textfile
- This program replace strings in a file or on stdin/stdout.
- It accepts a list of from-strings and to-strings and replaces all
- occurents of from-strings to to-strings.
- The first occurents of a found string is matched. If there are more than
- one possibly replace the longer from-string is replaced.
+/*
+ Replace strings in textfile
+
+ This program replaces strings in files or from stdin to stdout.
+ It accepts a list of from-string/to-string pairs and replaces
+ each occurrence of a from-string with the corresponding to-string.
+ The first occurrence of a found string is matched. If there is more
+ than one possibility for the string to replace, longer matches
+ are preferred before shorter matches.
+
Special characters in from string:
\^ Match start of line.
\$ Match end of line.
@@ -167,7 +171,7 @@ register char **argv[];
break;
case '#':
DBUG_PUSH (++pos);
- pos= (char*) " "; /* Skipp rest of arguments */
+ pos= (char*) " "; /* Skip rest of arguments */
break;
case 'V':
version=1;
@@ -179,12 +183,13 @@ register char **argv[];
if (version)
break;
puts("This software comes with ABSOLUTELY NO WARRANTY. This is free software,\nand you are welcome to modify and redistribute it under the GPL license\n");
- puts("This program replace strings in a file or on stdin/stdout.\n"
- "It accepts a list of from-strings and to-strings and replaces\n"
- "all occurents of from-strings to to-strings.\n"
- "The first occurents of a found string is matched. Longer matches\n"
- "are prefered before shorter matches.\n\n"
- "Special characters in from string:\n"
+ puts("This program replaces strings in files or from stdin to stdout.\n"
+ "It accepts a list of from-string/to-string pairs and replaces\n"
+ "each occurrence of a from-string with the corresponding to-string.\n"
+ "The first occurrence of a found string is matched. If there is\n"
+ "more than one possibility for the string to replace, longer\n"
+ "matches are preferred before shorter matches.\n\n"
+ "A from-string can contain these special characters:\n"
" \\^ Match start of line.\n"
" \\$ Match end of line.\n"
" \\b Match space-character, start of line or end of line.\n"
@@ -237,7 +242,7 @@ POINTER_ARRAY *from_array,*to_array;
(*argv)++;
}
if (*argc)
- { /* Skipp "--" argument */
+ { /* Skip "--" argument */
(*argc)--;
(*argv)++;
}
@@ -949,9 +954,11 @@ static void free_buffer()
}
-/* Fill the buffer retaining the last n bytes at the beginning of the
- newly filled buffer (for backward context). Returns the number of new
- bytes read from disk. */
+/*
+ Fill the buffer retaining the last n bytes at the beginning of the
+ newly filled buffer (for backward context). Returns the number of new
+ bytes read from disk.
+*/
static int fill_buffer_retaining(fd,n)
File fd;
diff --git a/heap/hp_delete.c b/heap/hp_delete.c
index 73e431e6e66..c918cf37f05 100644
--- a/heap/hp_delete.c
+++ b/heap/hp_delete.c
@@ -60,13 +60,17 @@ err:
DBUG_RETURN(my_errno);
}
+
/*
-Remove one key from rb-tree
+ Remove one key from rb-tree
*/
+
int hp_rb_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo,
const byte *record, byte *recpos, int flag)
{
heap_rb_param custom_arg;
+ uint old_allocated;
+ int res;
if (flag)
info->last_pos= NULL; /* For heap_rnext/heap_rprev */
@@ -74,14 +78,31 @@ int hp_rb_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo,
custom_arg.keyseg= keyinfo->seg;
custom_arg.key_length= hp_rb_make_key(keyinfo, info->recbuf, record, recpos);
custom_arg.search_flag= SEARCH_SAME;
- return tree_delete(&keyinfo->rb_tree, info->recbuf, &custom_arg);
+ old_allocated= keyinfo->rb_tree.allocated;
+ res= tree_delete(&keyinfo->rb_tree, info->recbuf, &custom_arg);
+ info->s->index_length+= (keyinfo->rb_tree.allocated-old_allocated);
+ return res;
}
- /* Remove one key from hash-table */
- /* Flag is set if we want's to correct info->current_ptr */
+
+/*
+ Remove one key from hash-table
+
+ SYNPOSIS
+ hp_delete_key()
+ info Hash handler
+ keyinfo key definition of key that we want to delete
+ record row data to be deleted
+ recpos Pointer to heap record in memory
+ flag Is set if we want's to correct info->current_ptr
+
+ RETURN
+ 0 ok
+ # error number
+*/
int hp_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo,
- const byte *record, byte *recpos, int flag)
+ const byte *record, byte *recpos, int flag)
{
ulong blength,pos2,pos_hashnr,lastpos_hashnr;
HASH_INFO *lastpos,*gpos,*pos,*pos3,*empty,*last_ptr;
diff --git a/heap/hp_extra.c b/heap/hp_extra.c
index 46e3f529f34..dd41d6c5f19 100644
--- a/heap/hp_extra.c
+++ b/heap/hp_extra.c
@@ -21,6 +21,10 @@
#include "heapdef.h"
+static void heap_extra_keyflag(register HP_INFO *info,
+ enum ha_extra_function function);
+
+
/* set extra flags for database */
int heap_extra(register HP_INFO *info, enum ha_extra_function function)
@@ -41,8 +45,37 @@ int heap_extra(register HP_INFO *info, enum ha_extra_function function)
case HA_EXTRA_READCHECK:
info->opt_flag|= READ_CHECK_USED;
break;
+ case HA_EXTRA_CHANGE_KEY_TO_UNIQUE:
+ case HA_EXTRA_CHANGE_KEY_TO_DUP:
+ heap_extra_keyflag(info, function);
+ break;
default:
break;
}
DBUG_RETURN(0);
} /* heap_extra */
+
+
+/*
+ Start/Stop Inserting Duplicates Into a Table, WL#1648.
+ */
+static void heap_extra_keyflag(register HP_INFO *info,
+ enum ha_extra_function function)
+{
+ uint idx;
+
+ for (idx= 0; idx< info->s->keys; idx++)
+ {
+ switch (function) {
+ case HA_EXTRA_CHANGE_KEY_TO_UNIQUE:
+ info->s->keydef[idx].flag|= HA_NOSAME;
+ break;
+ case HA_EXTRA_CHANGE_KEY_TO_DUP:
+ info->s->keydef[idx].flag&= ~(HA_NOSAME);
+ break;
+ default:
+ break;
+ }
+ }
+}
+
diff --git a/heap/hp_hash.c b/heap/hp_hash.c
index d30cbc9b82f..d040f37aea0 100644
--- a/heap/hp_hash.c
+++ b/heap/hp_hash.c
@@ -20,6 +20,38 @@
#include <m_ctype.h>
#include <assert.h>
+
+
+/*
+ Find out how many rows there is in the given range
+
+ SYNOPSIS
+ hp_rb_records_in_range()
+ info HEAP handler
+ inx Index to use
+ start_key Start of range. Null pointer if from first key
+ start_key_len Length of start key
+ start_search_flag Flag if start key should be included or not
+ end_key End of range. Null pointer if to last key
+ end_key_len Length of end key
+ end_search_flag Flag if start key should be included or not
+
+ NOTES
+ start_search_flag can have one of the following values:
+ HA_READ_KEY_EXACT Include the key in the range
+ HA_READ_AFTER_KEY Don't include key in range
+
+ end_search_flag can have one of the following values:
+ HA_READ_BEFORE_KEY Don't include key in range
+ HA_READ_AFTER_KEY Include all 'end_key' values in the range
+
+ RETURN
+ HA_POS_ERROR Something is wrong with the index tree.
+ 0 There is no matching keys in the given range
+ number > 0 There is approximately 'number' matching rows in
+ the range.
+*/
+
ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key,
uint start_key_len,
enum ha_rkey_function start_search_flag,
@@ -30,6 +62,7 @@ ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key,
HP_KEYDEF *keyinfo= info->s->keydef + inx;
TREE *rb_tree = &keyinfo->rb_tree;
heap_rb_param custom_arg;
+ DBUG_ENTER("hp_rb_records_in_range");
info->lastinx= inx;
custom_arg.keyseg= keyinfo->seg;
@@ -59,10 +92,12 @@ ha_rows hp_rb_records_in_range(HP_INFO *info, int inx, const byte *start_key,
end_pos= rb_tree->elements_in_tree + (ha_rows)1;
}
+ DBUG_PRINT("info",("start_pos: %lu end_pos: %lu", (ulong) start_pos,
+ (ulong) end_pos));
if (start_pos == HA_POS_ERROR || end_pos == HA_POS_ERROR)
- return HA_POS_ERROR;
- return end_pos < start_pos ? (ha_rows) 0 :
- (end_pos == start_pos ? (ha_rows) 1 : end_pos - start_pos);
+ DBUG_RETURN(HA_POS_ERROR);
+ DBUG_RETURN(end_pos < start_pos ? (ha_rows) 0 :
+ (end_pos == start_pos ? (ha_rows) 1 : end_pos - start_pos));
}
/* Search after a record based on a key */
diff --git a/heap/hp_info.c b/heap/hp_info.c
index e10d140e1f6..2e56d030234 100644
--- a/heap/hp_info.c
+++ b/heap/hp_info.c
@@ -47,13 +47,13 @@ ulong heap_position_old(HP_INFO *info)
int heap_info(reg1 HP_INFO *info,reg2 HEAPINFO *x, int flag )
{
DBUG_ENTER("heap_info");
- x->records = info->s->records;
- x->deleted = info->s->deleted;
- x->reclength = info->s->reclength;
- x->data_length = info->s->data_length;
- x->index_length= info->s->index_length;
- x->max_records = info->s->max_records;
- x->errkey = info->errkey;
+ x->records = info->s->records;
+ x->deleted = info->s->deleted;
+ x->reclength = info->s->reclength;
+ x->data_length = info->s->data_length;
+ x->index_length = info->s->index_length;
+ x->max_records = info->s->max_records;
+ x->errkey = info->errkey;
if (flag & HA_STATUS_AUTO)
x->auto_increment= info->s->auto_increment + 1;
DBUG_RETURN(0);
diff --git a/heap/hp_write.c b/heap/hp_write.c
index f92d8caa633..3b0ec76d616 100644
--- a/heap/hp_write.c
+++ b/heap/hp_write.c
@@ -99,6 +99,7 @@ int hp_rb_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *record,
byte *recpos)
{
heap_rb_param custom_arg;
+ uint old_allocated;
info->last_pos= NULL; /* For heap_rnext/heap_rprev */
custom_arg.keyseg= keyinfo->seg;
@@ -113,12 +114,14 @@ int hp_rb_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *record,
custom_arg.search_flag= SEARCH_SAME;
keyinfo->rb_tree.flag= 0;
}
+ old_allocated= keyinfo->rb_tree.allocated;
if (!tree_insert(&keyinfo->rb_tree, (void*)info->recbuf,
custom_arg.key_length, &custom_arg))
{
my_errno= HA_ERR_FOUND_DUPP_KEY;
return 1;
}
+ info->s->index_length+= (keyinfo->rb_tree.allocated-old_allocated);
return 0;
}
diff --git a/include/config-win.h b/include/config-win.h
index 10490fd2f91..518f445861a 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -95,6 +95,7 @@ functions */
#define LONGLONG_MAX ((__int64) 0x7FFFFFFFFFFFFFFF)
#define ULONGLONG_MAX ((unsigned __int64) 0xFFFFFFFFFFFFFFFF)
#define LL(A) ((__int64) A)
+#define ULL(A) ((unsigned __int64) A)
/* Type information */
@@ -323,7 +324,7 @@ inline double ulonglong2double(ulonglong value)
#define FN_ROOTDIR "\\"
#define FN_NETWORK_DRIVES /* Uses \\ to indicate network drives */
#define FN_NO_CASE_SENCE /* Files are not case-sensitive */
-#define MY_NFILE 1024
+#define OS_FILE_LIMIT 2048
#define DO_NOT_REMOVE_THREAD_WRAPPERS
#define thread_safe_increment(V,L) InterlockedIncrement((long*) &(V))
diff --git a/include/errmsg.h b/include/errmsg.h
index 8f3ddfa9796..140ff531248 100644
--- a/include/errmsg.h
+++ b/include/errmsg.h
@@ -63,27 +63,30 @@ extern const char *client_errors[]; /* Error messages */
#define CR_PROBE_MASTER_CONNECT 2025
#define CR_SSL_CONNECTION_ERROR 2026
#define CR_MALFORMED_PACKET 2027
+#define CR_WRONG_LICENSE 2028
/* new 4.1 error codes */
-#define CR_NULL_POINTER 2028
-#define CR_NO_PREPARE_STMT 2029
-#define CR_NOT_ALL_PARAMS_BOUND 2030
-#define CR_DATA_TRUNCATED 2031
-#define CR_NO_PARAMETERS_EXISTS 2032
-#define CR_INVALID_PARAMETER_NO 2033
-#define CR_INVALID_BUFFER_USE 2034
-#define CR_UNSUPPORTED_PARAM_TYPE 2035
+#define CR_NULL_POINTER 2029
+#define CR_NO_PREPARE_STMT 2030
+#define CR_PARAMS_NOT_BOUND 2031
+#define CR_DATA_TRUNCATED 2032
+#define CR_NO_PARAMETERS_EXISTS 2033
+#define CR_INVALID_PARAMETER_NO 2034
+#define CR_INVALID_BUFFER_USE 2035
+#define CR_UNSUPPORTED_PARAM_TYPE 2036
-#define CR_SHARED_MEMORY_CONNECTION 2036
-#define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2037
-#define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2038
-#define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2039
-#define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2040
-#define CR_SHARED_MEMORY_FILE_MAP_ERROR 2041
-#define CR_SHARED_MEMORY_MAP_ERROR 2042
-#define CR_SHARED_MEMORY_EVENT_ERROR 2043
-#define CR_SHARED_MEMORY_CONNECT_ABANDODED_ERROR 2044
-#define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2045
-#define CR_CONN_UNKNOW_PROTOCOL 2046
-#define CR_INVALID_CONN_HANDLE 2047
-#define CR_SECURE_AUTH 2048
+#define CR_SHARED_MEMORY_CONNECTION 2037
+#define CR_SHARED_MEMORY_CONNECT_REQUEST_ERROR 2038
+#define CR_SHARED_MEMORY_CONNECT_ANSWER_ERROR 2039
+#define CR_SHARED_MEMORY_CONNECT_FILE_MAP_ERROR 2040
+#define CR_SHARED_MEMORY_CONNECT_MAP_ERROR 2041
+#define CR_SHARED_MEMORY_FILE_MAP_ERROR 2042
+#define CR_SHARED_MEMORY_MAP_ERROR 2043
+#define CR_SHARED_MEMORY_EVENT_ERROR 2044
+#define CR_SHARED_MEMORY_CONNECT_ABANDODED_ERROR 2045
+#define CR_SHARED_MEMORY_CONNECT_SET_ERROR 2046
+#define CR_CONN_UNKNOW_PROTOCOL 2047
+#define CR_INVALID_CONN_HANDLE 2048
+#define CR_SECURE_AUTH 2049
+#define CR_FETCH_CANCELLED 2050
+#define CR_NO_DATA 2051
diff --git a/include/ft_global.h b/include/ft_global.h
index c30b0665216..94f6ad9ef51 100644
--- a/include/ft_global.h
+++ b/include/ft_global.h
@@ -52,7 +52,7 @@ extern const char *ft_precompiled_stopwords[];
extern ulong ft_min_word_len;
extern ulong ft_max_word_len;
extern ulong ft_query_expansion_limit;
-extern const char *ft_boolean_syntax;
+extern char ft_boolean_syntax[15];
int ft_init_stopwords(void);
void ft_free_stopwords(void);
@@ -63,6 +63,7 @@ void ft_free_stopwords(void);
#define FT_EXPAND 4 /* query expansion */
FT_INFO *ft_init_search(uint,void *, uint, byte *, uint, byte *);
+my_bool ft_boolean_check_syntax_string(const byte *);
#ifdef __cplusplus
}
diff --git a/include/heap.h b/include/heap.h
index 3702d88ac70..c5f2be81fb7 100644
--- a/include/heap.h
+++ b/include/heap.h
@@ -138,6 +138,7 @@ typedef struct st_heap_info
TREE_ELEMENT *parents[MAX_TREE_HEIGHT+1];
TREE_ELEMENT **last_pos;
uint lastkey_len;
+ my_bool implicit_emptied;
#ifdef THREAD
THR_LOCK_DATA lock;
#endif
diff --git a/include/m_ctype.h b/include/m_ctype.h
index 88c3418fc0d..e5f1c4fc3c0 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -111,7 +111,7 @@ typedef struct my_collation_handler_st
uchar *, uint, const uchar *, uint);
my_bool (*like_range)(struct charset_info_st *,
const char *s, uint s_length,
- int w_prefix, int w_one, int w_many,
+ pchar w_prefix, pchar w_one, pchar w_many,
uint res_length,
char *min_str, char *max_str,
uint *min_len, uint *max_len);
@@ -135,6 +135,7 @@ typedef struct my_collation_handler_st
extern MY_COLLATION_HANDLER my_collation_mb_bin_handler;
extern MY_COLLATION_HANDLER my_collation_8bit_bin_handler;
extern MY_COLLATION_HANDLER my_collation_8bit_simple_ci_handler;
+extern MY_COLLATION_HANDLER my_collation_ucs2_uca_handler;
typedef struct my_charset_handler_st
@@ -144,7 +145,7 @@ typedef struct my_charset_handler_st
int (*mbcharlen)(struct charset_info_st *, uint);
uint (*numchars)(struct charset_info_st *, const char *b, const char *e);
uint (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos);
- uint (*wellformedlen)(struct charset_info_st *,
+ uint (*well_formed_len)(struct charset_info_st *,
const char *b,const char *e, uint nchars);
uint (*lengthsp)(struct charset_info_st *, const char *ptr, uint length);
@@ -210,7 +211,8 @@ typedef struct charset_info_st
uint strxfrm_multiply;
uint mbminlen;
uint mbmaxlen;
- char max_sort_char; /* For LIKE optimization */
+ uint16 min_sort_char;
+ uint16 max_sort_char; /* For LIKE optimization */
MY_CHARSET_HANDLER *cset;
MY_COLLATION_HANDLER *coll;
@@ -237,13 +239,13 @@ extern CHARSET_INFO my_charset_tis620_thai_ci;
extern CHARSET_INFO my_charset_tis620_bin;
extern CHARSET_INFO my_charset_ucs2_general_ci;
extern CHARSET_INFO my_charset_ucs2_bin;
+extern CHARSET_INFO my_charset_ucs2_general_uca;
extern CHARSET_INFO my_charset_ujis_japanese_ci;
extern CHARSET_INFO my_charset_ujis_bin;
extern CHARSET_INFO my_charset_utf8_general_ci;
extern CHARSET_INFO my_charset_utf8_bin;
extern CHARSET_INFO my_charset_cp1250_czech_ci;
-
/* declarations for simple charsets */
extern int my_strnxfrm_simple(CHARSET_INFO *, uchar *, uint, const uchar *,
uint);
@@ -300,11 +302,18 @@ void my_fill_8bit(CHARSET_INFO *cs, char* to, uint l, int fill);
my_bool my_like_range_simple(CHARSET_INFO *cs,
const char *ptr, uint ptr_length,
- int escape, int w_one, int w_many,
+ pbool escape, pbool w_one, pbool w_many,
uint res_length,
char *min_str, char *max_str,
uint *min_length, uint *max_length);
+my_bool my_like_range_ucs2(CHARSET_INFO *cs,
+ const char *ptr, uint ptr_length,
+ pbool escape, pbool w_one, pbool w_many,
+ uint res_length,
+ char *min_str, char *max_str,
+ uint *min_length, uint *max_length);
+
int my_wildcmp_8bit(CHARSET_INFO *,
const char *str,const char *str_end,
@@ -313,7 +322,7 @@ int my_wildcmp_8bit(CHARSET_INFO *,
uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e);
uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
-uint my_wellformedlen_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
+uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
int my_mbcharlen_8bit(CHARSET_INFO *, uint c);
@@ -330,7 +339,7 @@ int my_wildcmp_mb(CHARSET_INFO *,
int escape, int w_one, int w_many);
uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
-uint my_wellformedlen_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
+uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
uint my_instr_mb(struct charset_info_st *,
const char *b, uint b_length,
const char *s, uint s_length,
@@ -340,23 +349,14 @@ uint my_instr_mb(struct charset_info_st *,
extern my_bool my_parse_charset_xml(const char *bug, uint len,
int (*add)(CHARSET_INFO *cs));
-#undef _U
-#undef _L
-#undef _NMR
-#undef _SPC
-#undef _PNT
-#undef _CTR
-#undef _B
-#undef _X
-
-#define _U 01 /* Upper case */
-#define _L 02 /* Lower case */
-#define _NMR 04 /* Numeral (digit) */
-#define _SPC 010 /* Spacing character */
-#define _PNT 020 /* Punctuation */
-#define _CTR 040 /* Control character */
-#define _B 0100 /* Blank */
-#define _X 0200 /* heXadecimal digit */
+#define _MY_U 01 /* Upper case */
+#define _MY_L 02 /* Lower case */
+#define _MY_NMR 04 /* Numeral (digit) */
+#define _MY_SPC 010 /* Spacing character */
+#define _MY_PNT 020 /* Punctuation */
+#define _MY_CTR 040 /* Control character */
+#define _MY_B 0100 /* Blank */
+#define _MY_X 0200 /* heXadecimal digit */
#define my_isascii(c) (!((c) & ~0177))
@@ -365,22 +365,23 @@ extern my_bool my_parse_charset_xml(const char *bug, uint len,
#define my_toprint(c) ((c) | 64)
#define my_toupper(s,c) (char) ((s)->to_upper[(uchar) (c)])
#define my_tolower(s,c) (char) ((s)->to_lower[(uchar) (c)])
-#define my_isalpha(s, c) (((s)->ctype+1)[(uchar) (c)] & (_U | _L))
-#define my_isupper(s, c) (((s)->ctype+1)[(uchar) (c)] & _U)
-#define my_islower(s, c) (((s)->ctype+1)[(uchar) (c)] & _L)
-#define my_isdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _NMR)
-#define my_isxdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _X)
-#define my_isalnum(s, c) (((s)->ctype+1)[(uchar) (c)] & (_U | _L | _NMR))
-#define my_isspace(s, c) (((s)->ctype+1)[(uchar) (c)] & _SPC)
-#define my_ispunct(s, c) (((s)->ctype+1)[(uchar) (c)] & _PNT)
-#define my_isprint(s, c) (((s)->ctype+1)[(uchar) (c)] & (_PNT | _U | _L | _NMR | _B))
-#define my_isgraph(s, c) (((s)->ctype+1)[(uchar) (c)] & (_PNT | _U | _L | _NMR))
-#define my_iscntrl(s, c) (((s)->ctype+1)[(uchar) (c)] & _CTR)
+#define my_isalpha(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_U | _MY_L))
+#define my_isupper(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_U)
+#define my_islower(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_L)
+#define my_isdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_NMR)
+#define my_isxdigit(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_X)
+#define my_isalnum(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_U | _MY_L | _MY_NMR))
+#define my_isspace(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_SPC)
+#define my_ispunct(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_PNT)
+#define my_isprint(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B))
+#define my_isgraph(s, c) (((s)->ctype+1)[(uchar) (c)] & (_MY_PNT | _MY_U | _MY_L | _MY_NMR))
+#define my_iscntrl(s, c) (((s)->ctype+1)[(uchar) (c)] & _MY_CTR)
/* Some macros that should be cleaned up a little */
#define my_isvar(s,c) (my_isalnum(s,c) || (c) == '_')
#define my_isvar_start(s,c) (my_isalpha(s,c) || (c) == '_')
+#define my_binary_compare(s) ((s)->state & MY_CS_BINSORT)
#define use_strnxfrm(s) ((s)->state & MY_CS_STRNXFRM)
#define my_strnxfrm(s, a, b, c, d) ((s)->coll->strnxfrm((s), (a), (b), (c), (d)))
#define my_strnncoll(s, a, b, c, d) ((s)->coll->strnncoll((s), (a), (b), (c), (d)))
@@ -391,7 +392,11 @@ extern my_bool my_parse_charset_xml(const char *bug, uint len,
#define use_mb(s) ((s)->cset->ismbchar != NULL)
#define my_ismbchar(s, a, b) ((s)->cset->ismbchar((s), (a), (b)))
+#ifdef USE_MB
#define my_mbcharlen(s, a) ((s)->cset->mbcharlen((s),(a)))
+#else
+#define my_mbcharlen(s, a) 1
+#endif
#define my_caseup(s, a, l) ((s)->cset->caseup((s), (a), (l)))
#define my_casedn(s, a, l) ((s)->cset->casedn((s), (a), (l)))
diff --git a/include/m_string.h b/include/m_string.h
index d72342fb3c1..c86801ae2d2 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -125,8 +125,8 @@ extern void bmove_align(gptr dst,const gptr src,uint len);
#ifdef HAVE_purify
#include <assert.h>
#define memcpy_overlap(A,B,C) \
-DBUG_ASSERT((A) == (B) || ((A)+(C)) <= (B) || ((B)+(C)) <= (A)); \
-bmove((byte*) key,(byte*) from,(size_t) length);
+DBUG_ASSERT((A) <= (B) || ((B)+(C)) <= (A)); \
+bmove((byte*) (A),(byte*) (B),(size_t) (C));
#else
#define memcpy_overlap(A,B,C) memcpy((A), (B), (C))
#endif /* HAVE_purify */
@@ -201,7 +201,7 @@ extern int strcmp(const char *, const char *);
extern size_t strlen(const char *);
#endif
#endif
-#ifndef HAVE_STRNLEN
+#ifndef HAVE_STRNLEN
extern uint strnlen(const char *s, uint n);
#endif
@@ -215,7 +215,9 @@ extern char *strstr(const char *, const char *);
#endif
extern int is_prefix(const char *, const char *);
-/* Conversion rutins */
+/* Conversion routines */
+double my_strtod(const char *str, char **end);
+double my_atof(const char *nptr);
#ifdef USE_MY_ITOA
extern char *my_itoa(int val,char *dst,int radix);
diff --git a/include/my_base.h b/include/my_base.h
index 89b46de520f..d23a70b8a55 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -28,6 +28,11 @@
#include <my_sys.h>
#include <m_string.h>
#include <errno.h>
+
+#ifndef EOVERFLOW
+#define EOVERFLOW 84
+#endif
+
#ifdef MSDOS
#include <share.h> /* Neaded for sopen() */
#endif
@@ -126,13 +131,22 @@ enum ha_extra_function {
HA_EXTRA_IGNORE_DUP_KEY, /* Dup keys don't rollback everything*/
HA_EXTRA_NO_IGNORE_DUP_KEY,
/*
- Instructs InnoDB to retrieve all columns, not just those where
- field->query_id is the same as the current query id
+ Instructs InnoDB to retrieve all columns (except in key read), not just
+ those where field->query_id is the same as the current query id
*/
HA_EXTRA_RETRIEVE_ALL_COLS,
+ /*
+ Instructs InnoDB to retrieve at least all the primary key columns
+ */
+ HA_EXTRA_RETRIEVE_PRIMARY_KEY,
HA_EXTRA_PREPARE_FOR_DELETE,
HA_EXTRA_PREPARE_FOR_UPDATE, /* Remove read cache if problems */
- HA_EXTRA_PRELOAD_BUFFER_SIZE /* Set buffer size for preloading */
+ HA_EXTRA_PRELOAD_BUFFER_SIZE, /* Set buffer size for preloading */
+ /*
+ On-the-fly switching between unique and non-unique key inserting.
+ */
+ HA_EXTRA_CHANGE_KEY_TO_UNIQUE,
+ HA_EXTRA_CHANGE_KEY_TO_DUP
};
/* The following is parameter to ha_panic() */
diff --git a/include/my_global.h b/include/my_global.h
index 8523df629a2..e1ae49aeb3e 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -300,7 +300,9 @@ C_MODE_END
#ifndef CONFIG_SMP
#define CONFIG_SMP
#endif
+C_MODE_START
#include <asm/atomic.h>
+C_MODE_END
#endif
#include <errno.h> /* Recommended by debian */
/* We need the following to go around a problem with openssl on solaris */
@@ -389,8 +391,8 @@ typedef unsigned short ushort;
#define sgn(a) (((a) < 0) ? -1 : ((a) > 0) ? 1 : 0)
#define swap(t,a,b) { register t dummy; dummy = a; a = b; b = dummy; }
#define test(a) ((a) ? 1 : 0)
-#define set_if_bigger(a,b) { if ((a) < (b)) (a)=(b); }
-#define set_if_smaller(a,b) { if ((a) > (b)) (a)=(b); }
+#define set_if_bigger(a,b) do { if ((a) < (b)) (a)=(b); } while(0)
+#define set_if_smaller(a,b) do { if ((a) > (b)) (a)=(b); } while(0)
#define test_all_bits(a,b) (((a) & (b)) == (b))
#define set_bits(type, bit_count) (sizeof(type)*8 <= (bit_count) ? ~(type) 0 : ((((type) 1) << (bit_count)) - (type) 1))
#define array_elements(A) ((uint) (sizeof(A)/sizeof(A[0])))
@@ -529,7 +531,7 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define FN_EXTCHAR '.'
#define FN_HOMELIB '~' /* ~/ is used as abbrev for home dir */
#define FN_CURLIB '.' /* ./ is used as abbrev for current dir */
-#define FN_PARENTDIR ".." /* Parentdirectory; Must be a string */
+#define FN_PARENTDIR ".." /* Parent directory; Must be a string */
#define FN_DEVCHAR ':'
#ifndef FN_LIBCHAR
@@ -540,7 +542,10 @@ typedef SOCKET_SIZE_TYPE size_socket;
#define FN_LIBCHAR '/'
#define FN_ROOTDIR "/"
#endif
-#define MY_NFILE 1024 /* This is only used to save filenames */
+#endif
+#define MY_NFILE 64 /* This is only used to save filenames */
+#ifndef OS_FILE_LIMIT
+#define OS_FILE_LIMIT 65535
#endif
/* #define EXT_IN_LIBNAME */
@@ -588,14 +593,6 @@ typedef SOCKET_SIZE_TYPE size_socket;
/* Some defines of functions for portability */
-#ifndef HAVE_ATOD
-#define atod atof
-#endif
-#ifdef USE_MY_ATOF
-#define atof my_atof
-extern void init_my_atof(void);
-extern double my_atof(const char*);
-#endif
#undef remove /* Crashes MySQL on SCO 5.0.0 */
#ifndef __WIN__
#ifdef OS2
@@ -684,6 +681,10 @@ extern double my_atof(const char*);
#define FLT_MAX ((float)3.40282346638528860e+38)
#endif
+#ifndef HAVE_ISINF
+#define isinf(X) 0
+#endif
+
/* Define missing math constants. */
#ifndef M_PI
#define M_PI 3.14159265358979323846
@@ -709,7 +710,7 @@ typedef long long my_ptrdiff_t;
#define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double))
/* Size to make adressable obj. */
#define ALIGN_PTR(A, t) ((t*) MY_ALIGN((A),sizeof(t)))
- /* Offset of filed f in structure t */
+ /* Offset of field f in structure t */
#define OFFSET(t, f) ((size_t)(char *)&((t *)0)->f)
#define ADD_TO_PTR(ptr,size,type) (type) ((byte*) (ptr)+size)
#define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((byte*) (A) - (byte*) (B))
@@ -859,6 +860,14 @@ typedef char bool; /* Ordinary boolean values 0 1 */
#endif
#endif
+#ifndef ULL
+#ifdef HAVE_LONG_LONG
+#define ULL(A) A ## ULL
+#else
+#define ULL(A) A ## UL
+#endif
+#endif
+
/*
Defines to make it possible to prioritize register assignments. No
longer that important with modern compilers.
@@ -1129,10 +1138,10 @@ typedef union {
*((T)+1)=(((A) >> 16));\
*((T)+0)=(((A) >> 24)); }
-#define doubleget(V,M) memcpy((byte*) &V,(byte*) (M),sizeof(double))
-#define doublestore(T,V) memcpy((byte*) (T),(byte*) &V,sizeof(double))
-#define longlongget(V,M) memcpy((byte*) &V,(byte*) (M),sizeof(ulonglong))
-#define longlongstore(T,V) memcpy((byte*) (T),(byte*) &V,sizeof(ulonglong))
+#define doubleget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(double))
+#define doublestore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(double))
+#define longlongget(V,M) memcpy_fixed((byte*) &V,(byte*) (M),sizeof(ulonglong))
+#define longlongstore(T,V) memcpy_fixed((byte*) (T),(byte*) &V,sizeof(ulonglong))
#else
diff --git a/include/my_handler.h b/include/my_handler.h
index 618d1df1a6e..18a6234d3f6 100644
--- a/include/my_handler.h
+++ b/include/my_handler.h
@@ -58,7 +58,7 @@ typedef struct st_HA_KEYSEG /* Key-portion */
}
extern int mi_compare_text(CHARSET_INFO *, uchar *, uint, uchar *, uint ,
- my_bool);
+ my_bool, my_bool);
extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
register uchar *b, uint key_length, uint nextflag,
uint *diff_pos);
diff --git a/include/my_pthread.h b/include/my_pthread.h
index cf04d078c70..602a4439575 100644
--- a/include/my_pthread.h
+++ b/include/my_pthread.h
@@ -392,6 +392,11 @@ struct tm *gmtime_r(const time_t *clock, struct tm *res);
#define pthread_condattr_destroy pthread_condattr_delete
#endif
+/* FSU THREADS */
+#if !defined(HAVE_PTHREAD_KEY_DELETE) && !defined(pthread_key_delete)
+#define pthread_key_delete(A) pthread_dummy(0)
+#endif
+
#ifdef HAVE_CTHREADS_WRAPPER /* For MacOSX */
#define pthread_cond_destroy(A) pthread_dummy(0)
#define pthread_mutex_destroy(A) pthread_dummy(0)
diff --git a/include/my_sys.h b/include/my_sys.h
index d24bef11182..f08ac6a1fef 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -202,26 +202,13 @@ extern char NEAR curr_dir[]; /* Current directory for user */
extern int (*error_handler_hook)(uint my_err, const char *str,myf MyFlags);
extern int (*fatal_error_handler_hook)(uint my_err, const char *str,
myf MyFlags);
+extern uint my_file_limit;
/* charsets */
extern CHARSET_INFO *default_charset_info;
extern CHARSET_INFO *all_charsets[256];
extern CHARSET_INFO compiled_charsets[];
-extern uint get_charset_number(const char *cs_name, uint cs_flags);
-extern uint get_collation_number(const char *name);
-extern const char *get_charset_name(uint cs_number);
-
-extern CHARSET_INFO *get_charset(uint cs_number, myf flags);
-extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
-extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
- uint cs_flags, myf my_flags);
-extern void free_charsets(void);
-extern char *get_charsets_dir(char *buf);
-extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
-extern my_bool init_compiled_charsets(myf flags);
-extern void add_compiled_collation(CHARSET_INFO *cs);
-
/* statistics */
extern ulong my_cache_w_requests, my_cache_write, my_cache_r_requests,
my_cache_read;
@@ -288,14 +275,16 @@ enum file_type
FILE_BY_MKSTEMP, FILE_BY_DUP
};
-extern struct my_file_info
+struct st_my_file_info
{
my_string name;
enum file_type type;
#if defined(THREAD) && !defined(HAVE_PREAD)
pthread_mutex_t mutex;
#endif
-} my_file_info[MY_NFILE];
+};
+
+extern struct st_my_file_info *my_file_info;
typedef struct st_my_tmpdir
{
@@ -423,6 +412,11 @@ typedef struct st_io_cache /* Used when cacheing files */
IO_CACHE_CALLBACK pre_read;
IO_CACHE_CALLBACK post_read;
IO_CACHE_CALLBACK pre_close;
+ /*
+ Counts the number of times, when we were forced to use disk. We use it to
+ increase the binlog_cache_disk_use status variable.
+ */
+ ulong disk_writes;
void* arg; /* for use by pre/post_read */
char *file_name; /* if used with 'open_cached_file' */
char *dir,*prefix;
@@ -618,7 +612,7 @@ extern void pack_dirname(my_string to,const char *from);
extern uint unpack_dirname(my_string to,const char *from);
extern uint cleanup_dirname(my_string to,const char *from);
extern uint system_filename(my_string to,const char *from);
-extern my_string unpack_filename(my_string to,const char *from);
+extern uint unpack_filename(my_string to,const char *from);
extern my_string intern_filename(my_string to,const char *from);
extern my_string directory_file_name(my_string dst, const char *src);
extern int pack_filename(my_string to, const char *name, size_s max_length);
@@ -675,9 +669,9 @@ extern int my_b_safe_write(IO_CACHE *info,const byte *Buffer,uint Count);
extern int my_block_write(IO_CACHE *info, const byte *Buffer,
uint Count, my_off_t pos);
-extern int _flush_io_cache(IO_CACHE *info, int need_append_buffer_lock);
+extern int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock);
-#define flush_io_cache(info) _flush_io_cache((info),1)
+#define flush_io_cache(info) my_b_flush_io_cache((info),1)
extern int end_io_cache(IO_CACHE *info);
extern uint my_b_fill(IO_CACHE *info);
@@ -726,11 +720,14 @@ extern void my_free_lock(byte *ptr,myf flags);
#define my_free_lock(A,B) my_free((A),(B))
#endif
#define alloc_root_inited(A) ((A)->min_malloc != 0)
+#define clear_alloc_root(A) bzero((void *) (A), sizeof(MEM_ROOT))
extern void init_alloc_root(MEM_ROOT *mem_root, uint block_size,
uint pre_alloc_size);
extern gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size);
extern void free_root(MEM_ROOT *root, myf MyFLAGS);
extern void set_prealloc_root(MEM_ROOT *root, char *ptr);
+extern void reset_root_defaults(MEM_ROOT *mem_root, uint block_size,
+ uint prealloc_size);
extern char *strdup_root(MEM_ROOT *root,const char *str);
extern char *strmake_root(MEM_ROOT *root,const char *str,uint len);
extern char *memdup_root(MEM_ROOT *root,const char *str,uint len);
@@ -746,6 +743,26 @@ extern uint my_bit_log2(ulong value);
extern uint my_count_bits(ulonglong v);
extern void my_sleep(ulong m_seconds);
extern ulong crc32(ulong crc, const uchar *buf, uint len);
+extern uint my_set_max_open_files(uint files);
+void my_free_open_file_info(void);
+
+ulonglong my_getsystime(void);
+my_bool my_gethwaddr(uchar *to);
+
+/* character sets */
+extern uint get_charset_number(const char *cs_name, uint cs_flags);
+extern uint get_collation_number(const char *name);
+extern const char *get_charset_name(uint cs_number);
+
+extern CHARSET_INFO *get_charset(uint cs_number, myf flags);
+extern CHARSET_INFO *get_charset_by_name(const char *cs_name, myf flags);
+extern CHARSET_INFO *get_charset_by_csname(const char *cs_name,
+ uint cs_flags, myf my_flags);
+extern void free_charsets(void);
+extern char *get_charsets_dir(char *buf);
+extern my_bool my_charset_same(CHARSET_INFO *cs1, CHARSET_INFO *cs2);
+extern my_bool init_compiled_charsets(myf flags);
+extern void add_compiled_collation(CHARSET_INFO *cs);
#ifdef __WIN__
extern my_bool have_tcpip; /* Is set if tcpip is used */
diff --git a/include/my_tree.h b/include/my_tree.h
index 0e705e19bba..14d8593b6dc 100644
--- a/include/my_tree.h
+++ b/include/my_tree.h
@@ -22,7 +22,9 @@ extern "C" {
#include "my_base.h" /* get 'enum ha_rkey_function' */
-#define MAX_TREE_HEIGHT 40 /* = max 1048576 leafs in tree */
+/* Worst case tree is half full. This gives use 2^(MAX_TREE_HEIGHT/2) leafs */
+#define MAX_TREE_HEIGHT 64
+
#define ELEMENT_KEY(tree,element)\
(tree->offset_to_key ? (void*)((byte*) element+tree->offset_to_key) :\
*((void**) (element+1)))
diff --git a/include/myisam.h b/include/myisam.h
index 2285f996464..ed4f4aff8fe 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -38,7 +38,7 @@ extern "C" {
/* The following defines can be increased if necessary */
#define MI_MAX_KEY 32 /* Max allowed keys */
#define MI_MAX_KEY_SEG 16 /* Max segments for key */
-#define MI_MAX_KEY_LENGTH 500
+#define MI_MAX_KEY_LENGTH 1000
#define MI_MAX_KEY_BUFF (MI_MAX_KEY_LENGTH+MI_MAX_KEY_SEG*6+8+8)
#define MI_MAX_POSSIBLE_KEY_BUFF (1024+6+6) /* For myisam_chk */
@@ -93,7 +93,7 @@ typedef struct st_mi_isaminfo /* Struct from h_info */
typedef struct st_mi_create_info
{
- char *index_file_name, *data_file_name; /* If using symlinks */
+ const char *index_file_name, *data_file_name; /* If using symlinks */
ha_rows max_rows;
ha_rows reloc_rows;
ulonglong auto_increment;
diff --git a/include/mysql.h b/include/mysql.h
index cd5d01d6f44..852d633facf 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -77,6 +77,8 @@ extern char *mysql_unix_port;
#define IS_NUM_FIELD(f) ((f)->flags & NUM_FLAG)
#define INTERNAL_NUM_FIELD(f) (((f)->type <= FIELD_TYPE_INT24 && ((f)->type != FIELD_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)) || (f)->type == FIELD_TYPE_YEAR)
+#define HAVE_DEPRECATED_411_API 1
+
typedef struct st_mysql_field {
char *name; /* Name of column */
char *org_name; /* Original column name, if an alias */
@@ -183,6 +185,12 @@ struct st_mysql_options {
char *client_ip;
/* Refuse client connecting to server if it uses old (pre-4.1.1) protocol */
my_bool secure_auth;
+
+ /* function pointers for local infile support */
+ int (*local_infile_init)(void **, const char *);
+ int (*local_infile_read)(void *, char *, unsigned int);
+ void (*local_infile_end)(void *);
+ int (*local_infile_error)(void *, char *, unsigned int);
};
enum mysql_status
@@ -254,6 +262,11 @@ typedef struct st_mysql
LIST *stmts; /* list of all statements */
const struct st_mysql_methods *methods;
void *thd;
+ /*
+ Points to boolean flag in MYSQL_RES or MYSQL_STMT. We set this flag
+ from mysql_stmt_close if close had to cancel result set of this object.
+ */
+ my_bool *unbuffered_fetch_owner;
} MYSQL;
typedef struct st_mysql_res {
@@ -268,6 +281,8 @@ typedef struct st_mysql_res {
MYSQL_ROW row; /* If unbuffered read */
MYSQL_ROW current_row; /* buffer to current row */
my_bool eof; /* Used by mysql_fetch_row */
+ /* mysql_stmt_close() had to cancel this result */
+ my_bool unbuffered_fetch_cancelled;
const struct st_mysql_methods *methods;
} MYSQL_RES;
@@ -375,6 +390,23 @@ my_bool STDCALL mysql_slave_query(MYSQL *mysql, const char *q,
my_bool STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q,
unsigned long length);
+/* local infile support */
+
+#define LOCAL_INFILE_ERROR_LEN 512
+
+void
+mysql_set_local_infile_handler(MYSQL *mysql,
+ int (*local_infile_init)(void **, const char *),
+ int (*local_infile_read)(void *, char *,
+ unsigned int),
+ void (*local_infile_end)(void *),
+ int (*local_infile_error)(void *, char*,
+ unsigned int));
+
+void
+mysql_set_local_infile_default(MYSQL *mysql);
+
+
/*
enable/disable parsing of all queries to decide if they go on master or
slave
@@ -477,7 +509,11 @@ my_bool STDCALL mysql_read_query_result(MYSQL *mysql);
*/
/* statement state */
-enum PREP_STMT_STATE { MY_ST_UNKNOWN, MY_ST_PREPARE, MY_ST_EXECUTE };
+enum enum_mysql_stmt_state
+{
+ MYSQL_STMT_INIT_DONE= 1, MYSQL_STMT_PREPARE_DONE, MYSQL_STMT_EXECUTE_DONE,
+ MYSQL_STMT_FETCH_DONE
+};
/*
client TIME structure to handle TIME, DATE and TIMESTAMP directly in
@@ -523,31 +559,36 @@ typedef struct st_mysql_bind
/* statement handler */
typedef struct st_mysql_stmt
{
- MYSQL *mysql; /* connection handle */
- MYSQL_BIND *params; /* input parameters */
- MYSQL_RES *result; /* resultset */
- MYSQL_BIND *bind; /* row binding */
- MYSQL_FIELD *fields; /* prepare meta info */
+ MEM_ROOT mem_root; /* root allocations */
LIST list; /* list to keep track of all stmts */
- unsigned char *current_row; /* unbuffered row */
- unsigned char *last_fetched_buffer; /* last fetched column buffer */
- char *query; /* query buffer */
- MEM_ROOT mem_root; /* root allocations */
- my_ulonglong last_fetched_column; /* last fetched column */
- my_ulonglong affected_rows; /* copy of mysql->affected_rows
- after statement execution */
+ MYSQL *mysql; /* connection handle */
+ MYSQL_BIND *params; /* input parameters */
+ MYSQL_BIND *bind; /* output parameters */
+ MYSQL_FIELD *fields; /* result set metadata */
+ MYSQL_DATA result; /* cached result set */
+ MYSQL_ROWS *data_cursor; /* current row in cached result */
+ /* copy of mysql->affected_rows after statement execution */
+ my_ulonglong affected_rows;
+ my_ulonglong insert_id; /* copy of mysql->insert_id */
+ /*
+ mysql_stmt_fetch() calls this function to fetch one row (it's different
+ for buffered, unbuffered and cursor fetch).
+ */
+ int (*read_row_func)(struct st_mysql_stmt *stmt,
+ unsigned char **row);
unsigned long stmt_id; /* Id for prepared statement */
unsigned int last_errno; /* error code */
- unsigned int param_count; /* parameters count */
- unsigned int field_count; /* fields count */
- enum PREP_STMT_STATE state; /* statement state */
+ unsigned int param_count; /* inpute parameters count */
+ unsigned int field_count; /* number of columns in result set */
+ enum enum_mysql_stmt_state state; /* statement state */
char last_error[MYSQL_ERRMSG_SIZE]; /* error message */
char sqlstate[SQLSTATE_LENGTH+1];
- my_bool long_alloced; /* flag to indicate long alloced */
- my_bool send_types_to_server; /* Types sent to server */
- my_bool param_buffers; /* param bound buffers */
- my_bool res_buffers; /* output bound buffers */
- my_bool result_buffered; /* Results buffered */
+ /* Types of input parameters should be sent to server */
+ my_bool send_types_to_server;
+ my_bool bind_param_done; /* input buffers were supplied */
+ my_bool bind_result_done; /* output buffers were supplied */
+ /* mysql_stmt_close() had to cancel this result */
+ my_bool unbuffered_fetch_cancelled;
} MYSQL_STMT;
@@ -570,48 +611,70 @@ typedef struct st_mysql_methods
MYSQL_FIELD * (*list_fields)(MYSQL *mysql);
my_bool (*read_prepare_result)(MYSQL *mysql, MYSQL_STMT *stmt);
int (*stmt_execute)(MYSQL_STMT *stmt);
- MYSQL_DATA *(*read_binary_rows)(MYSQL_STMT *stmt);
+ int (*read_binary_rows)(MYSQL_STMT *stmt);
int (*unbuffered_fetch)(MYSQL *mysql, char **row);
void (*free_embedded_thd)(MYSQL *mysql);
- const char *(*read_statistic)(MYSQL *mysql);
- int (*next_result)(MYSQL *mysql);
+ const char *(*read_statistics)(MYSQL *mysql);
+ my_bool (*next_result)(MYSQL *mysql);
+ int (*read_change_user_result)(MYSQL *mysql, char *buff, const char *passwd);
#endif
} MYSQL_METHODS;
+#ifdef HAVE_DEPRECATED_411_API
+/* Deprecated calls (since MySQL 4.1.2) */
+
+/* Use mysql_stmt_init + mysql_stmt_prepare instead */
MYSQL_STMT * STDCALL mysql_prepare(MYSQL * mysql, const char *query,
unsigned long length);
-int STDCALL mysql_execute(MYSQL_STMT * stmt);
-unsigned long STDCALL mysql_param_count(MYSQL_STMT * stmt);
-my_bool STDCALL mysql_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
-my_bool STDCALL mysql_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
+#define mysql_execute mysql_stmt_execute
+#define mysql_fetch mysql_stmt_fetch
+#define mysql_fetch_column mysql_stmt_fetch_column
+#define mysql_bind_param mysql_stmt_bind_param
+#define mysql_bind_result mysql_stmt_bind_result
+#define mysql_param_count mysql_stmt_param_count
+#define mysql_param_result mysql_stmt_param_metadata
+#define mysql_get_metadata mysql_stmt_result_metadata
+#define mysql_send_long_data mysql_stmt_send_long_data
+
+#endif /* HAVE_DEPRECATED_411_API */
+
+MYSQL_STMT * STDCALL mysql_stmt_init(MYSQL *mysql);
+int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query,
+ unsigned long length);
+int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt);
+int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt);
+int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind,
+ unsigned int column,
+ unsigned long offset);
+int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt);
+unsigned long STDCALL mysql_stmt_param_count(MYSQL_STMT * stmt);
+my_bool STDCALL mysql_stmt_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
+my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd);
my_bool STDCALL mysql_stmt_close(MYSQL_STMT * stmt);
my_bool STDCALL mysql_stmt_reset(MYSQL_STMT * stmt);
my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt);
+my_bool STDCALL mysql_stmt_send_long_data(MYSQL_STMT *stmt,
+ unsigned int param_number,
+ const char *data,
+ unsigned long length);
+MYSQL_RES *STDCALL mysql_stmt_result_metadata(MYSQL_STMT *stmt);
+MYSQL_RES *STDCALL mysql_stmt_param_metadata(MYSQL_STMT *stmt);
unsigned int STDCALL mysql_stmt_errno(MYSQL_STMT * stmt);
const char *STDCALL mysql_stmt_error(MYSQL_STMT * stmt);
const char *STDCALL mysql_stmt_sqlstate(MYSQL_STMT * stmt);
-my_bool STDCALL mysql_commit(MYSQL * mysql);
-my_bool STDCALL mysql_rollback(MYSQL * mysql);
-my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode);
-int STDCALL mysql_fetch(MYSQL_STMT *stmt);
-int STDCALL mysql_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind,
- unsigned int column,
- unsigned long offset);
-my_bool STDCALL mysql_send_long_data(MYSQL_STMT *stmt,
- unsigned int param_number,
- const char *data,
- unsigned long length);
-MYSQL_RES *STDCALL mysql_get_metadata(MYSQL_STMT *stmt);
-MYSQL_RES *STDCALL mysql_param_result(MYSQL_STMT *stmt);
-my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt);
-int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt);
-my_bool STDCALL mysql_more_results(MYSQL *mysql);
-int STDCALL mysql_next_result(MYSQL *mysql);
MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_seek(MYSQL_STMT *stmt,
MYSQL_ROW_OFFSET offset);
MYSQL_ROW_OFFSET STDCALL mysql_stmt_row_tell(MYSQL_STMT *stmt);
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);
+
+my_bool STDCALL mysql_commit(MYSQL * mysql);
+my_bool STDCALL mysql_rollback(MYSQL * mysql);
+my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode);
+my_bool STDCALL mysql_more_results(MYSQL *mysql);
+int STDCALL mysql_next_result(MYSQL *mysql);
void STDCALL mysql_close(MYSQL *sock);
diff --git a/include/mysql_com.h b/include/mysql_com.h
index cc2e1056a9e..7de4c782989 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -78,6 +78,7 @@ enum enum_server_command
#define PART_KEY_FLAG 16384 /* Intern; Part of some key */
#define GROUP_FLAG 32768 /* Intern: Group field */
#define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */
+#define BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */
#define REFRESH_GRANT 1 /* Refresh grant tables */
#define REFRESH_LOG 2 /* Start on new log file */
@@ -118,7 +119,7 @@ enum enum_server_command
#define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */
#define CLIENT_MULTI_STATEMENTS 65536 /* Enable/disable multi-stmt support */
#define CLIENT_MULTI_RESULTS 131072 /* Enable/disable multi-results */
-#define CLIENT_REMEMBER_OPTIONS ((ulong) (1L << 31))
+#define CLIENT_REMEMBER_OPTIONS (((ulong) 1) << 31)
#define SERVER_STATUS_IN_TRANS 1 /* Transaction has started */
#define SERVER_STATUS_AUTOCOMMIT 2 /* Server in auto_commit mode */
diff --git a/include/mysql_version.h.in b/include/mysql_version.h.in
index 095531d527d..c440c1298d4 100644
--- a/include/mysql_version.h.in
+++ b/include/mysql_version.h.in
@@ -23,4 +23,9 @@
/* mysqld compile time options */
#endif /* _CUSTOMCONFIG_ */
+
+#ifndef LICENSE
+#define LICENSE "GPL"
+#endif /* LICENSE */
+
#endif /* _mysql_version_h */
diff --git a/include/mysqld_error.h b/include/mysqld_error.h
index b4d7edf3e96..2f2b8d9b6fb 100644
--- a/include/mysqld_error.h
+++ b/include/mysqld_error.h
@@ -254,93 +254,98 @@
#define ER_NOT_SUPPORTED_YET 1235
#define ER_MASTER_FATAL_ERROR_READING_BINLOG 1236
#define ER_SLAVE_IGNORED_TABLE 1237
-#define ER_WRONG_FK_DEF 1238
-#define ER_KEY_REF_DO_NOT_MATCH_TABLE_REF 1239
-#define ER_OPERAND_COLUMNS 1240
-#define ER_SUBQUERY_NO_1_ROW 1241
-#define ER_UNKNOWN_STMT_HANDLER 1242
-#define ER_CORRUPT_HELP_DB 1243
-#define ER_CYCLIC_REFERENCE 1244
-#define ER_AUTO_CONVERT 1245
-#define ER_ILLEGAL_REFERENCE 1246
-#define ER_DERIVED_MUST_HAVE_ALIAS 1247
-#define ER_SELECT_REDUCED 1248
-#define ER_TABLENAME_NOT_ALLOWED_HERE 1249
-#define ER_NOT_SUPPORTED_AUTH_MODE 1250
-#define ER_SPATIAL_CANT_HAVE_NULL 1251
-#define ER_COLLATION_CHARSET_MISMATCH 1252
-#define ER_SLAVE_WAS_RUNNING 1253
-#define ER_SLAVE_WAS_NOT_RUNNING 1254
-#define ER_TOO_BIG_FOR_UNCOMPRESS 1255
-#define ER_ZLIB_Z_MEM_ERROR 1256
-#define ER_ZLIB_Z_BUF_ERROR 1257
-#define ER_ZLIB_Z_DATA_ERROR 1258
-#define ER_CUT_VALUE_GROUP_CONCAT 1259
-#define ER_WARN_TOO_FEW_RECORDS 1260
-#define ER_WARN_TOO_MANY_RECORDS 1261
-#define ER_WARN_NULL_TO_NOTNULL 1262
-#define ER_WARN_DATA_OUT_OF_RANGE 1263
-#define ER_WARN_DATA_TRUNCATED 1264
-#define ER_WARN_USING_OTHER_HANDLER 1265
-#define ER_CANT_AGGREGATE_2COLLATIONS 1266
-#define ER_DROP_USER 1267
-#define ER_REVOKE_GRANTS 1268
-#define ER_CANT_AGGREGATE_3COLLATIONS 1269
-#define ER_CANT_AGGREGATE_NCOLLATIONS 1270
-#define ER_VARIABLE_IS_NOT_STRUCT 1271
-#define ER_UNKNOWN_COLLATION 1272
-#define ER_SLAVE_IGNORED_SSL_PARAMS 1273
-#define ER_SERVER_IS_IN_SECURE_AUTH_MODE 1274
-#define ER_WARN_FIELD_RESOLVED 1275
-#define ER_BAD_SLAVE_UNTIL_COND 1276
-#define ER_MISSING_SKIP_SLAVE 1277
-#define ER_UNTIL_COND_IGNORED 1278
-#define ER_WRONG_NAME_FOR_INDEX 1279
-#define ER_WRONG_NAME_FOR_CATALOG 1280
-#define ER_WARN_QC_RESIZE 1281
-#define ER_BAD_FT_COLUMN 1282
-#define ER_UNKNOWN_KEY_CACHE 1283
-#define ER_WARN_HOSTNAME_WONT_WORK 1284
-#define ER_UNKNOWN_STORAGE_ENGINE 1285
-#define ER_WARN_DEPRECATED_SYNTAX 1286
-#define ER_NON_UPDATABLE_TABLE 1287
-#define ER_FEATURE_DISABLED 1288
-#define ER_SKIP_GRANT_TABLES 1289
-#define ER_SP_NO_RECURSIVE_CREATE 1290
-#define ER_SP_ALREADY_EXISTS 1291
-#define ER_SP_DOES_NOT_EXIST 1292
-#define ER_SP_DROP_FAILED 1293
-#define ER_SP_STORE_FAILED 1294
-#define ER_SP_LILABEL_MISMATCH 1295
-#define ER_SP_LABEL_REDEFINE 1296
-#define ER_SP_LABEL_MISMATCH 1297
-#define ER_SP_UNINIT_VAR 1298
-#define ER_SP_BADSELECT 1299
-#define ER_SP_BADRETURN 1300
-#define ER_SP_BADSTATEMENT 1301
-#define ER_UPDATE_LOG_DEPRECATED_IGNORED 1302
-#define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1303
-#define ER_QUERY_INTERRUPTED 1304
-#define ER_SP_WRONG_NO_OF_ARGS 1305
-#define ER_SP_COND_MISMATCH 1306
-#define ER_SP_NORETURN 1307
-#define ER_SP_NORETURNEND 1308
-#define ER_SP_BAD_CURSOR_QUERY 1309
-#define ER_SP_BAD_CURSOR_SELECT 1310
-#define ER_SP_CURSOR_MISMATCH 1311
-#define ER_SP_CURSOR_ALREADY_OPEN 1312
-#define ER_SP_CURSOR_NOT_OPEN 1313
-#define ER_SP_UNDECLARED_VAR 1314
-#define ER_SP_WRONG_NO_OF_FETCH_ARGS 1315
-#define ER_SP_FETCH_NO_DATA 1316
-#define ER_SP_DUP_PARAM 1317
-#define ER_SP_DUP_VAR 1318
-#define ER_SP_DUP_COND 1319
-#define ER_SP_DUP_CURS 1320
-#define ER_SP_CANT_ALTER 1321
-#define ER_SP_SUBSELECT_NYI 1322
-#define ER_SP_NO_USE 1323
-#define ER_SP_VARCOND_AFTER_CURSHNDLR 1324
-#define ER_SP_CURSOR_AFTER_HANDLER 1325
-#define ER_SP_CASE_NOT_FOUND 1326
-#define ER_ERROR_MESSAGES 327
+#define ER_INCORRECT_GLOBAL_LOCAL_VAR 1238
+#define ER_WRONG_FK_DEF 1239
+#define ER_KEY_REF_DO_NOT_MATCH_TABLE_REF 1240
+#define ER_OPERAND_COLUMNS 1241
+#define ER_SUBQUERY_NO_1_ROW 1242
+#define ER_UNKNOWN_STMT_HANDLER 1243
+#define ER_CORRUPT_HELP_DB 1244
+#define ER_CYCLIC_REFERENCE 1245
+#define ER_AUTO_CONVERT 1246
+#define ER_ILLEGAL_REFERENCE 1247
+#define ER_DERIVED_MUST_HAVE_ALIAS 1248
+#define ER_SELECT_REDUCED 1249
+#define ER_TABLENAME_NOT_ALLOWED_HERE 1250
+#define ER_NOT_SUPPORTED_AUTH_MODE 1251
+#define ER_SPATIAL_CANT_HAVE_NULL 1252
+#define ER_COLLATION_CHARSET_MISMATCH 1253
+#define ER_SLAVE_WAS_RUNNING 1254
+#define ER_SLAVE_WAS_NOT_RUNNING 1255
+#define ER_TOO_BIG_FOR_UNCOMPRESS 1256
+#define ER_ZLIB_Z_MEM_ERROR 1257
+#define ER_ZLIB_Z_BUF_ERROR 1258
+#define ER_ZLIB_Z_DATA_ERROR 1259
+#define ER_CUT_VALUE_GROUP_CONCAT 1260
+#define ER_WARN_TOO_FEW_RECORDS 1261
+#define ER_WARN_TOO_MANY_RECORDS 1262
+#define ER_WARN_NULL_TO_NOTNULL 1263
+#define ER_WARN_DATA_OUT_OF_RANGE 1264
+#define ER_WARN_DATA_TRUNCATED 1265
+#define ER_WARN_USING_OTHER_HANDLER 1266
+#define ER_CANT_AGGREGATE_2COLLATIONS 1267
+#define ER_DROP_USER 1268
+#define ER_REVOKE_GRANTS 1269
+#define ER_CANT_AGGREGATE_3COLLATIONS 1270
+#define ER_CANT_AGGREGATE_NCOLLATIONS 1271
+#define ER_VARIABLE_IS_NOT_STRUCT 1272
+#define ER_UNKNOWN_COLLATION 1273
+#define ER_SLAVE_IGNORED_SSL_PARAMS 1274
+#define ER_SERVER_IS_IN_SECURE_AUTH_MODE 1275
+#define ER_WARN_FIELD_RESOLVED 1276
+#define ER_BAD_SLAVE_UNTIL_COND 1277
+#define ER_MISSING_SKIP_SLAVE 1278
+#define ER_UNTIL_COND_IGNORED 1279
+#define ER_WRONG_NAME_FOR_INDEX 1280
+#define ER_WRONG_NAME_FOR_CATALOG 1281
+#define ER_WARN_QC_RESIZE 1282
+#define ER_BAD_FT_COLUMN 1283
+#define ER_UNKNOWN_KEY_CACHE 1284
+#define ER_WARN_HOSTNAME_WONT_WORK 1285
+#define ER_UNKNOWN_STORAGE_ENGINE 1286
+#define ER_WARN_DEPRECATED_SYNTAX 1287
+#define ER_NON_UPDATABLE_TABLE 1288
+#define ER_FEATURE_DISABLED 1289
+#define ER_OPTION_PREVENTS_STATEMENT 1290
+#define ER_DUPLICATED_VALUE_IN_TYPE 1291
+#define ER_TRUNCATED_WRONG_VALUE 1292
+#define ER_TOO_MUCH_AUTO_TIMESTAMP_COLS 1293
+#define ER_INVALID_ON_UPDATE 1294
+#define ER_SP_NO_RECURSIVE_CREATE 1294
+#define ER_SP_ALREADY_EXISTS 1295
+#define ER_SP_DOES_NOT_EXIST 1296
+#define ER_SP_DROP_FAILED 1297
+#define ER_SP_STORE_FAILED 1298
+#define ER_SP_LILABEL_MISMATCH 1299
+#define ER_SP_LABEL_REDEFINE 1300
+#define ER_SP_LABEL_MISMATCH 1301
+#define ER_SP_UNINIT_VAR 1302
+#define ER_SP_BADSELECT 1303
+#define ER_SP_BADRETURN 1304
+#define ER_SP_BADSTATEMENT 1305
+#define ER_UPDATE_LOG_DEPRECATED_IGNORED 1306
+#define ER_UPDATE_LOG_DEPRECATED_TRANSLATED 1307
+#define ER_QUERY_INTERRUPTED 1308
+#define ER_SP_WRONG_NO_OF_ARGS 1309
+#define ER_SP_COND_MISMATCH 1310
+#define ER_SP_NORETURN 1311
+#define ER_SP_NORETURNEND 1312
+#define ER_SP_BAD_CURSOR_QUERY 1313
+#define ER_SP_BAD_CURSOR_SELECT 1314
+#define ER_SP_CURSOR_MISMATCH 1315
+#define ER_SP_CURSOR_ALREADY_OPEN 1316
+#define ER_SP_CURSOR_NOT_OPEN 1317
+#define ER_SP_UNDECLARED_VAR 1318
+#define ER_SP_WRONG_NO_OF_FETCH_ARGS 1319
+#define ER_SP_FETCH_NO_DATA 1320
+#define ER_SP_DUP_PARAM 1321
+#define ER_SP_DUP_VAR 1322
+#define ER_SP_DUP_COND 1323
+#define ER_SP_DUP_CURS 1324
+#define ER_SP_CANT_ALTER 1325
+#define ER_SP_SUBSELECT_NYI 1326
+#define ER_SP_NO_USE 1327
+#define ER_SP_VARCOND_AFTER_CURSHNDLR 1328
+#define ER_SP_CURSOR_AFTER_HANDLER 1329
+#define ER_SP_CASE_NOT_FOUND 1330
+#define ER_ERROR_MESSAGES 331
diff --git a/include/sql_common.h b/include/sql_common.h
index fef573f7450..3f50008a922 100644
--- a/include/sql_common.h
+++ b/include/sql_common.h
@@ -25,6 +25,7 @@ extern "C" {
MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
my_bool default_value, uint server_capabilities);
void free_rows(MYSQL_DATA *cur);
+void flush_use_result(MYSQL *mysql);
my_bool mysql_autenticate(MYSQL *mysql, const char *passwd);
void free_old_query(MYSQL *mysql);
void end_server(MYSQL *mysql);
@@ -38,6 +39,7 @@ cli_advanced_command(MYSQL *mysql, enum enum_server_command command,
void set_stmt_errmsg(MYSQL_STMT * stmt, const char *err, int errcode,
const char *sqlstate);
+void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate);
#ifdef __cplusplus
}
#endif
diff --git a/innobase/Makefile.am b/innobase/Makefile.am
index cc4ce312d8d..8ff90d16a2c 100644
--- a/innobase/Makefile.am
+++ b/innobase/Makefile.am
@@ -22,8 +22,8 @@ TAR = gtar
noinst_HEADERS = ib_config.h
-SUBDIRS = os ut btr buf com data dict dyn eval fil fsp fut \
- ha ibuf include lock log mach mem mtr odbc page \
+SUBDIRS = os ut btr buf data dict dyn eval fil fsp fut \
+ ha ibuf include lock log mach mem mtr page \
pars que read rem row srv sync thr trx usr
# Don't update the files from bitkeeper
diff --git a/innobase/btr/btr0btr.c b/innobase/btr/btr0btr.c
index eb18fecb368..77bb4231404 100644
--- a/innobase/btr/btr0btr.c
+++ b/innobase/btr/btr0btr.c
@@ -5,7 +5,7 @@ The B-tree
Created 6/2/1994 Heikki Tuuri
*******************************************************/
-
+
#include "btr0btr.h"
#ifdef UNIV_NONINL
@@ -76,9 +76,6 @@ make them consecutive on disk if possible. From the other file segment
we allocate pages for the non-leaf levels of the tree.
*/
-/* If this many inserts occur sequentially, it affects page split */
-#define BTR_PAGE_SEQ_INSERT_LIMIT 5
-
/******************************************************************
Creates a new index page to the tree (not the root, and also not
used in page reorganization). */
@@ -299,7 +296,9 @@ btr_page_alloc_for_ibuf(
new_page = buf_page_get(dict_tree_get_space(tree), node_addr.page,
RW_X_LATCH, mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(new_page, SYNC_TREE_NODE_NEW);
+#endif /* UNIV_SYNC_DEBUG */
flst_remove(root + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST,
new_page + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST_NODE,
@@ -357,7 +356,9 @@ btr_page_alloc(
new_page = buf_page_get(dict_tree_get_space(tree), new_page_no,
RW_X_LATCH, mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(new_page, SYNC_TREE_NODE_NEW);
+#endif /* UNIV_SYNC_DEBUG */
return(new_page);
}
@@ -398,7 +399,7 @@ btr_get_size(
n += fseg_n_reserved_pages(seg_header, &dummy, &mtr);
} else {
- ut_a(0);
+ ut_error;
}
mtr_commit(&mtr);
@@ -664,8 +665,9 @@ btr_create(
ibuf_hdr_frame = fseg_create(space, 0,
IBUF_HEADER + IBUF_TREE_SEG_HEADER, mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(ibuf_hdr_frame, SYNC_TREE_NODE_NEW);
-
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(buf_frame_get_page_no(ibuf_hdr_frame)
== IBUF_HEADER_PAGE_NO);
/* Allocate then the next page to the segment: it will be the
@@ -690,7 +692,9 @@ btr_create(
page_no = buf_frame_get_page_no(frame);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(frame, SYNC_TREE_NODE_NEW);
+#endif /* UNIV_SYNC_DEBUG */
if (type & DICT_IBUF) {
/* It is an insert buffer tree: initialize the free list */
@@ -705,7 +709,9 @@ btr_create(
mtr);
/* The fseg create acquires a second latch on the page,
therefore we must declare it: */
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(frame, SYNC_TREE_NODE_NEW);
+#endif /* UNIV_SYNC_DEBUG */
}
/* Create a new index page on the the allocated segment page */
@@ -1080,18 +1086,18 @@ btr_page_get_split_rec_to_left(
page = btr_cur_get_page(cursor);
insert_point = btr_cur_get_rec(cursor);
- if ((page_header_get_ptr(page, PAGE_LAST_INSERT)
- == page_rec_get_next(insert_point))
- && (page_header_get_field(page, PAGE_DIRECTION) == PAGE_LEFT)
- && ((page_header_get_field(page, PAGE_N_DIRECTION)
- >= BTR_PAGE_SEQ_INSERT_LIMIT)
- || (page_header_get_field(page, PAGE_N_DIRECTION) + 1
- >= page_get_n_recs(page)))) {
+ if (page_header_get_ptr(page, PAGE_LAST_INSERT)
+ == page_rec_get_next(insert_point)) {
infimum = page_get_infimum_rec(page);
-
- if ((infimum != insert_point)
- && (page_rec_get_next(infimum) != insert_point)) {
+
+ /* If the convergence is in the middle of a page, include also
+ the record immediately before the new insert to the upper
+ page. Otherwise, we could repeatedly move from page to page
+ lots of records smaller than the convergence point. */
+
+ if (infimum != insert_point
+ && page_rec_get_next(infimum) != insert_point) {
*split_rec = insert_point;
} else {
@@ -1125,29 +1131,29 @@ btr_page_get_split_rec_to_right(
page = btr_cur_get_page(cursor);
insert_point = btr_cur_get_rec(cursor);
- if ((page_header_get_ptr(page, PAGE_LAST_INSERT) == insert_point)
- && (page_header_get_field(page, PAGE_DIRECTION) == PAGE_RIGHT)
- && ((page_header_get_field(page, PAGE_N_DIRECTION)
- >= BTR_PAGE_SEQ_INSERT_LIMIT)
- || (page_header_get_field(page, PAGE_N_DIRECTION) + 1
- >= page_get_n_recs(page)))) {
+ /* We use eager heuristics: if the new insert would be right after
+ the previous insert on the same page, we assume that there is a
+ pattern of sequential inserts here. */
+
+ if (page_header_get_ptr(page, PAGE_LAST_INSERT) == insert_point) {
supremum = page_get_supremum_rec(page);
- if ((page_rec_get_next(insert_point) != supremum)
- && (page_rec_get_next(page_rec_get_next(insert_point))
- != supremum)
- && (page_rec_get_next(page_rec_get_next(
- page_rec_get_next(insert_point)))
- != supremum)) {
-
- /* If there are >= 3 user records up from the insert
- point, split all but 2 off */
-
- *split_rec = page_rec_get_next(page_rec_get_next(
- page_rec_get_next(insert_point)));
+ if (page_rec_get_next(insert_point) != supremum
+ && page_rec_get_next(page_rec_get_next(insert_point))
+ != supremum) {
+
+ /* If there are >= 2 user records up from the insert
+ point, split all but 1 off. We want to keep one because
+ then sequential inserts can use the adaptive hash
+ index, as they can do the necessary checks of the right
+ search position just by looking at the records on this
+ page. */
+
+ *split_rec = page_rec_get_next(
+ page_rec_get_next(insert_point));
} else {
- /* Else split at inserted record */
+ /* Else split at the new record to insert */
*split_rec = NULL;
}
@@ -1520,7 +1526,9 @@ func_start:
ut_ad(mtr_memo_contains(mtr, dict_tree_get_lock(tree),
MTR_MEMO_X_LOCK));
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(dict_tree_get_lock(tree), RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
page = btr_cur_get_page(cursor);
diff --git a/innobase/btr/btr0cur.c b/innobase/btr/btr0cur.c
index b2bfdbec4e4..fdc8343e190 100644
--- a/innobase/btr/btr0cur.c
+++ b/innobase/btr/btr0cur.c
@@ -66,6 +66,16 @@ this many index pages */
#define BTR_BLOB_HDR_SIZE 8
/***********************************************************************
+Marks all extern fields in a record as owned by the record. This function
+should be called if the delete mark of a record is removed: a not delete
+marked record always owns all its extern fields. */
+static
+void
+btr_cur_unmark_extern_fields(
+/*=========================*/
+ rec_t* rec, /* in: record in a clustered index */
+ mtr_t* mtr); /* in: mtr */
+/***********************************************************************
Adds path information to the cursor for the current page, for which
the binary search has been performed. */
static
@@ -1323,66 +1333,6 @@ btr_cur_parse_update_in_place(
}
/*****************************************************************
-Updates a secondary index record when the update causes no size
-changes in its fields. The only case when this function is currently
-called is that in a char field characters change to others which
-are identified in the collation order. */
-
-ulint
-btr_cur_update_sec_rec_in_place(
-/*============================*/
- /* out: DB_SUCCESS or error number */
- btr_cur_t* cursor, /* in: cursor on the record to update;
- cursor stays valid and positioned on the
- same record */
- upd_t* update, /* in: update vector */
- que_thr_t* thr, /* in: query thread */
- mtr_t* mtr) /* in: mtr */
-{
- dict_index_t* index = cursor->index;
- dict_index_t* clust_index;
- ulint err;
- rec_t* rec;
- dulint roll_ptr = ut_dulint_zero;
- trx_t* trx = thr_get_trx(thr);
-
- /* Only secondary index records are updated using this function */
- ut_ad(0 == (index->type & DICT_CLUSTERED));
-
- rec = btr_cur_get_rec(cursor);
-
- if (btr_cur_print_record_ops && thr) {
- printf(
- "Trx with id %lu %lu going to update table %s index %s\n",
- (unsigned long) ut_dulint_get_high(thr_get_trx(thr)->id),
- (unsigned long) ut_dulint_get_low(thr_get_trx(thr)->id),
- index->table_name, index->name);
- rec_print(rec);
- }
-
- err = lock_sec_rec_modify_check_and_lock(0, rec, index, thr);
-
- if (err != DB_SUCCESS) {
-
- return(err);
- }
-
- /* Remove possible hash index pointer to this record */
- btr_search_update_hash_on_delete(cursor);
-
- row_upd_rec_in_place(rec, update);
-
- clust_index = dict_table_get_first_index(index->table);
-
- /* Note that roll_ptr is really just a dummy value since
- a secondary index record does not contain any sys columns */
-
- btr_cur_update_in_place_log(BTR_KEEP_SYS_FLAG, rec, clust_index,
- update, trx, roll_ptr, mtr);
- return(DB_SUCCESS);
-}
-
-/*****************************************************************
Updates a record when the update causes no size changes in its fields.
We assume here that the ordering fields of the record do not change. */
@@ -2709,7 +2659,7 @@ btr_estimate_number_of_different_key_vals(
ulint n_cols;
ulint matched_fields;
ulint matched_bytes;
- ulint* n_diff;
+ ib_longlong* n_diff;
ulint not_empty_flag = 0;
ulint total_external_size = 0;
ulint i;
@@ -2732,10 +2682,11 @@ btr_estimate_number_of_different_key_vals(
btr_cur_open_at_rnd_pos(index, BTR_SEARCH_LEAF, &cursor, &mtr);
- /* Count the number of different key values minus one
- for each prefix of the key on this index page: we subtract
- one because otherwise our algorithm would give a wrong
- estimate for an index where there is just one key value */
+ /* Count the number of different key values for each prefix of
+ the key on this index page. If the prefix does not determine
+ the index record uniquely in te B-tree, then we subtract one
+ because otherwise our algorithm would give a wrong estimate
+ for an index where there is just one key value. */
page = btr_cur_get_page(&cursor);
@@ -2757,6 +2708,9 @@ btr_estimate_number_of_different_key_vals(
&matched_bytes);
for (j = matched_fields + 1; j <= n_cols; j++) {
+ /* We add one if this index record has
+ a different prefix from the previous */
+
n_diff[j]++;
}
@@ -2766,6 +2720,18 @@ btr_estimate_number_of_different_key_vals(
rec = page_rec_get_next(rec);
}
+ if (n_cols == dict_index_get_n_unique_in_tree(index)) {
+ /* We add one because we know that the first record
+ on the page certainly had a different prefix than the
+ last record on the previous index page in the
+ alphabetical order. Before this fix, if there was
+ just one big record on each clustered index page, the
+ algorithm grossly underestimated the number of rows
+ in the table. */
+
+ n_diff[n_cols]++;
+ }
+
total_external_size +=
btr_rec_get_externally_stored_len(rec);
mtr_commit(&mtr);
@@ -2781,7 +2747,8 @@ btr_estimate_number_of_different_key_vals(
for (j = 0; j <= n_cols; j++) {
index->stat_n_diff_key_vals[j] =
- (n_diff[j] * index->stat_n_leaf_pages
+ (n_diff[j]
+ * (ib_longlong)index->stat_n_leaf_pages
+ BTR_KEY_VAL_ESTIMATE_N_PAGES - 1
+ total_external_size
+ not_empty_flag)
@@ -2992,7 +2959,7 @@ btr_cur_mark_dtuple_inherited_extern(
Marks all extern fields in a record as owned by the record. This function
should be called if the delete mark of a record is removed: a not delete
marked record always owns all its extern fields. */
-
+static
void
btr_cur_unmark_extern_fields(
/*=========================*/
@@ -3216,8 +3183,10 @@ btr_store_big_rec_extern_fields(
prev_page_no,
RW_X_LATCH, &mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(prev_page,
SYNC_EXTERN_STORAGE);
+#endif /* UNIV_SYNC_DEBUG */
mlog_write_ulint(prev_page + FIL_PAGE_DATA
+ BTR_BLOB_HDR_NEXT_PAGE_NO,
@@ -3252,9 +3221,9 @@ btr_store_big_rec_extern_fields(
rec_page = buf_page_get(space_id,
buf_frame_get_page_no(data),
RW_X_LATCH, &mtr);
-
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(rec_page, SYNC_NO_ORDER_CHECK);
-
+#endif /* UNIV_SYNC_DEBUG */
mlog_write_ulint(data + local_len + BTR_EXTERN_LEN, 0,
MLOG_4BYTES, &mtr);
mlog_write_ulint(data + local_len + BTR_EXTERN_LEN + 4,
@@ -3346,9 +3315,9 @@ btr_free_externally_stored_field(
rec_page = buf_page_get(buf_frame_get_space_id(data),
buf_frame_get_page_no(data), RW_X_LATCH, &mtr);
-
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(rec_page, SYNC_NO_ORDER_CHECK);
-
+#endif /* UNIV_SYNC_DEBUG */
space_id = mach_read_from_4(data + local_len
+ BTR_EXTERN_SPACE_ID);
@@ -3391,9 +3360,9 @@ btr_free_externally_stored_field(
}
page = buf_page_get(space_id, page_no, RW_X_LATCH, &mtr);
-
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_EXTERN_STORAGE);
-
+#endif /* UNIV_SYNC_DEBUG */
next_page_no = mach_read_from_4(page + FIL_PAGE_DATA
+ BTR_BLOB_HDR_NEXT_PAGE_NO);
@@ -3571,9 +3540,9 @@ btr_copy_externally_stored_field(
mtr_start(&mtr);
page = buf_page_get(space_id, page_no, RW_S_LATCH, &mtr);
-
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_EXTERN_STORAGE);
-
+#endif /* UNIV_SYNC_DEBUG */
blob_header = page + offset;
part_len = btr_blob_get_part_len(blob_header);
diff --git a/innobase/btr/btr0pcur.c b/innobase/btr/btr0pcur.c
index 39e70d91be8..cf8a612ef28 100644
--- a/innobase/btr/btr0pcur.c
+++ b/innobase/btr/btr0pcur.c
@@ -238,9 +238,9 @@ btr_pcur_restore_position(
cursor->block_when_stored, page,
cursor->modify_clock, mtr)) {
cursor->pos_state = BTR_PCUR_IS_POSITIONED;
-
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_TREE_NODE);
-
+#endif /* UNIV_SYNC_DEBUG */
if (cursor->rel_pos == BTR_PCUR_ON) {
cursor->latch_mode = latch_mode;
diff --git a/innobase/btr/btr0sea.c b/innobase/btr/btr0sea.c
index 207ebcfb641..2093d5ea757 100644
--- a/innobase/btr/btr0sea.c
+++ b/innobase/btr/btr0sea.c
@@ -22,7 +22,9 @@ Created 2/17/1996 Heikki Tuuri
ulint btr_search_this_is_zero = 0; /* A dummy variable to fool the
compiler */
+#ifdef UNIV_SEARCH_PERF_STAT
ulint btr_search_n_succ = 0;
+#endif /* UNIV_SEARCH_PERF_STAT */
ulint btr_search_n_hash_fail = 0;
byte btr_sea_pad1[64]; /* padding to prevent other memory update
@@ -93,8 +95,10 @@ btr_search_check_free_space_in_heap(void)
hash_table_t* table;
mem_heap_t* heap;
- ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_SHARED)
- && !rw_lock_own(&btr_search_latch, RW_LOCK_EX));
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_SHARED));
+ ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
table = btr_search_sys->hash_index;
@@ -194,8 +198,10 @@ btr_search_info_update_hash(
ulint n_unique;
int cmp;
- ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_SHARED)
- && !rw_lock_own(&btr_search_latch, RW_LOCK_EX));
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_SHARED));
+ ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
index = cursor->index;
@@ -317,10 +323,12 @@ btr_search_update_block_hash_info(
buf_block_t* block, /* in: buffer block */
btr_cur_t* cursor) /* in: cursor */
{
- ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_SHARED)
- && !rw_lock_own(&btr_search_latch, RW_LOCK_EX));
- ut_ad(rw_lock_own(&(block->lock), RW_LOCK_SHARED)
- || rw_lock_own(&(block->lock), RW_LOCK_EX));
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_SHARED));
+ ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_EX));
+ ut_ad(rw_lock_own(&((buf_block_t*) block)->lock, RW_LOCK_SHARED)
+ || rw_lock_own(&((buf_block_t*) block)->lock, RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(cursor);
info->last_hash_succ = FALSE;
@@ -398,9 +406,11 @@ btr_search_update_hash_ref(
dulint tree_id;
ut_ad(cursor->flag == BTR_CUR_HASH_FAIL);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&btr_search_latch, RW_LOCK_EX));
ut_ad(rw_lock_own(&(block->lock), RW_LOCK_SHARED)
|| rw_lock_own(&(block->lock), RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
if (block->is_hashed
&& (info->n_hash_potential > 0)
&& (block->curr_n_fields == info->n_fields)
@@ -419,7 +429,9 @@ btr_search_update_hash_ref(
fold = rec_fold(rec, block->curr_n_fields,
block->curr_n_bytes, tree_id);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&btr_search_latch, RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
ha_insert_for_fold(btr_search_sys->hash_index, fold, rec);
}
@@ -439,8 +451,10 @@ btr_search_info_update_slow(
ulint* params;
ulint* params2;
- ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_SHARED)
- && !rw_lock_own(&btr_search_latch, RW_LOCK_EX));
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_SHARED));
+ ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
block = buf_block_align(btr_cur_get_rec(cursor));
@@ -762,7 +776,9 @@ btr_search_guess_on_hash(
can_only_compare_to_cursor_rec = FALSE;
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_TREE_NODE_FROM_HASH);
+#endif /* UNIV_SYNC_DEBUG */
}
block = buf_block_align(page);
@@ -910,10 +926,12 @@ btr_search_drop_page_hash_index(
ulint n_recs;
ulint* folds;
ulint i;
-
- ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_SHARED)
- && !rw_lock_own(&btr_search_latch, RW_LOCK_EX));
-
+
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_SHARED));
+ ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
+
rw_lock_s_lock(&btr_search_latch);
block = buf_block_align(page);
@@ -927,9 +945,11 @@ btr_search_drop_page_hash_index(
table = btr_search_sys->hash_index;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&(block->lock), RW_LOCK_SHARED)
|| rw_lock_own(&(block->lock), RW_LOCK_EX)
|| (block->buf_fix_count == 0));
+#endif /* UNIV_SYNC_DEBUG */
n_fields = block->curr_n_fields;
n_bytes = block->curr_n_bytes;
@@ -1031,8 +1051,10 @@ btr_search_drop_page_hash_when_freed(
BUF_GET_IF_IN_POOL, IB__FILE__, __LINE__,
&mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_TREE_NODE_FROM_HASH);
-
+#endif /* UNIV_SYNC_DEBUG */
+
btr_search_drop_page_hash_index(page);
mtr_commit(&mtr);
@@ -1072,9 +1094,11 @@ btr_search_build_page_hash_index(
block = buf_block_align(page);
table = btr_search_sys->hash_index;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_EX));
ut_ad(rw_lock_own(&(block->lock), RW_LOCK_SHARED)
|| rw_lock_own(&(block->lock), RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
rw_lock_s_lock(&btr_search_latch);
@@ -1237,8 +1261,10 @@ btr_search_move_or_delete_hash_entries(
block = buf_block_align(page);
new_block = buf_block_align(new_page);
- ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX)
- && rw_lock_own(&(new_block->lock), RW_LOCK_EX));
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX));
+ ut_ad(rw_lock_own(&(new_block->lock), RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
rw_lock_s_lock(&btr_search_latch);
@@ -1298,7 +1324,9 @@ btr_search_update_hash_on_delete(
block = buf_block_align(rec);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
if (!block->is_hashed) {
@@ -1339,7 +1367,9 @@ btr_search_update_hash_node_on_insert(
block = buf_block_align(rec);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
if (!block->is_hashed) {
@@ -1400,7 +1430,9 @@ btr_search_update_hash_on_insert(
block = buf_block_align(rec);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
if (!block->is_hashed) {
@@ -1500,75 +1532,6 @@ function_exit:
}
/************************************************************************
-Prints info of the search system. */
-
-void
-btr_search_print_info(void)
-/*=======================*/
-{
- printf("SEARCH SYSTEM INFO\n");
-
- rw_lock_x_lock(&btr_search_latch);
-
-/* ha_print_info(btr_search_sys->hash_index); */
-
- rw_lock_x_unlock(&btr_search_latch);
-}
-
-/************************************************************************
-Prints info of searches on an index. */
-
-void
-btr_search_index_print_info(
-/*========================*/
- dict_index_t* index) /* in: index */
-{
- btr_search_t* info;
-
- printf("INDEX SEARCH INFO\n");
-
- rw_lock_x_lock(&btr_search_latch);
-
- info = btr_search_get_info(index);
-
- printf("Searches %lu, hash succ %lu, fail %lu, patt succ %lu\n",
- (ulong) info->n_searches, (ulong) info->n_hash_succ,
- (ulong) info->n_hash_fail, (ulong) info->n_patt_succ);
-
- printf("Total of page cur short succ for all indexes %lu\n",
- (ulong) page_cur_short_succ);
- rw_lock_x_unlock(&btr_search_latch);
-}
-
-/************************************************************************
-Prints info of searches on a table. */
-
-void
-btr_search_table_print_info(
-/*========================*/
- char* name) /* in: table name */
-{
- dict_table_t* table;
- dict_index_t* index;
-
- mutex_enter(&(dict_sys->mutex));
-
- table = dict_table_get_low(name);
-
- ut_a(table);
-
- mutex_exit(&(dict_sys->mutex));
-
- index = dict_table_get_first_index(table);
-
- while (index) {
- btr_search_index_print_info(index);
-
- index = dict_table_get_next_index(index);
- }
-}
-
-/************************************************************************
Validates the search system. */
ibool
diff --git a/innobase/btr/ts/isql.c b/innobase/btr/ts/isql.c
deleted file mode 100644
index db56aa65a66..00000000000
--- a/innobase/btr/ts/isql.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/************************************************************************
-Test for the client: interactive SQL
-
-(c) 1996-1997 Innobase Oy
-
-Created 2/16/1996 Heikki Tuuri
-*************************************************************************/
-
-#include "univ.i"
-#include "ib_odbc.h"
-#include "mem0mem.h"
-#include "sync0sync.h"
-#include "os0thread.h"
-#include "os0proc.h"
-#include "os0sync.h"
-#include "srv0srv.h"
-
-ulint n_exited = 0;
-
-char cli_srv_endpoint_name[100];
-char cli_user_name[100];
-
-ulint n_warehouses = ULINT_MAX;
-ulint n_customers_d = ULINT_MAX;
-bool is_tpc_d = FALSE;
-ulint n_rounds = ULINT_MAX;
-ulint n_users = ULINT_MAX;
-ulint startdate = 0;
-ulint enddate = 0;
-bool own_warehouse = FALSE;
-
-ulint mem_pool_size = ULINT_MAX;
-
-/*************************************************************************
-Reads a keywords and a values from an initfile. In case of an error, exits
-from the process. */
-static
-void
-cli_read_initfile(
-/*==============*/
- FILE* initfile) /* in: file pointer */
-{
- char str_buf[10000];
- ulint ulint_val;
-
- srv_read_init_val(initfile, FALSE, "SRV_ENDPOINT_NAME", str_buf,
- &ulint_val);
-
- ut_a(ut_strlen(str_buf) < COM_MAX_ADDR_LEN);
-
- ut_memcpy(cli_srv_endpoint_name, str_buf, COM_MAX_ADDR_LEN);
-
- srv_read_init_val(initfile, FALSE, "USER_NAME", str_buf,
- &ulint_val);
- ut_a(ut_strlen(str_buf) < COM_MAX_ADDR_LEN);
-
- ut_memcpy(cli_user_name, str_buf, COM_MAX_ADDR_LEN);
-
- srv_read_init_val(initfile, TRUE, "MEM_POOL_SIZE", str_buf,
- &mem_pool_size);
-
- srv_read_init_val(initfile, TRUE, "N_WAREHOUSES", str_buf,
- &n_warehouses);
-
- srv_read_init_val(initfile, TRUE, "N_CUSTOMERS_D", str_buf,
- &n_customers_d);
-
- srv_read_init_val(initfile, TRUE, "IS_TPC_D", str_buf,
- &is_tpc_d);
-
- srv_read_init_val(initfile, TRUE, "N_ROUNDS", str_buf,
- &n_rounds);
-
- srv_read_init_val(initfile, TRUE, "N_USERS", str_buf,
- &n_users);
-
- srv_read_init_val(initfile, TRUE, "STARTDATE", str_buf,
- &startdate);
-
- srv_read_init_val(initfile, TRUE, "ENDDATE", str_buf,
- &enddate);
-
- srv_read_init_val(initfile, TRUE, "OWN_WAREHOUSE", str_buf,
- &own_warehouse);
-}
-
-/*************************************************************************
-Reads configuration info for the client. */
-static
-void
-cli_boot(
-/*=====*/
- char* name) /* in: the initialization file name */
-{
- FILE* initfile;
-
- initfile = fopen(name, "r");
-
- if (initfile == NULL) {
- printf(
- "Error in client booting: could not open initfile whose name is %s!\n",
- name);
- os_process_exit(1);
- }
-
- cli_read_initfile(initfile);
-
- fclose(initfile);
-}
-
-/*********************************************************************
-Interactive SQL loop. */
-static
-void
-isql(
-/*=*/
- FILE* inputfile) /* in: input file containing SQL strings,
- or stdin */
-{
- HENV env;
- HDBC conn;
- RETCODE ret;
- HSTMT sql_query;
- ulint tm, oldtm;
- char buf[1000];
- char* str;
- ulint count;
- ulint n_begins;
- ulint len;
- ulint n;
- ulint i;
- ulint n_lines;
-
- ret = SQLAllocEnv(&env);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocConnect(env, &conn);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLConnect(conn, (UCHAR*)cli_srv_endpoint_name,
- (SWORD)ut_strlen(cli_srv_endpoint_name),
- cli_user_name,
- (SWORD)ut_strlen(cli_user_name),
- (UCHAR*)"password", 8);
- ut_a(ret == SQL_SUCCESS);
-
- printf("Connection established\n");
-
- printf("Interactive SQL performs queries by first making a stored\n");
- printf("procedure from them, and then calling the procedure.\n");
- printf("Put a semicolon after each statement and\n");
- printf("end your query with two <enter>s.\n\n");
- printf("You can also give a single input file\n");
- printf("as a command line argument to isql.\n\n");
- printf("In the file separate SQL queries and procedure bodies\n");
- printf("by a single empty line. Do not write the final END; into\n");
- printf("a procedure body.\n\n");
-
- count = 0;
-loop:
- count++;
- n = 0;
- n_lines = 0;
-
- sprintf(buf, "PROCEDURE P%s%lu () IS\nBEGIN ", cli_user_name,
- count);
- for (;;) {
- len = ut_strlen(buf + n) - 1;
- n += len;
-
- if (len == 0) {
- break;
- } else {
- sprintf(buf + n, "\n");
- n++;
- n_lines++;
- }
-
- str = fgets(buf + n, 1000, inputfile);
-
- if ((str == NULL) && (inputfile != stdin)) {
- /* Reached end-of-file: switch to input from
- keyboard */
-
- inputfile = stdin;
-
- break;
- }
-
- ut_a(str);
- }
-
- if (n_lines == 1) {
- /* Empty procedure */
-
- goto loop;
- }
-
- /* If the statement is actually the body of a procedure,
- erase the first BEGIN from the string: */
-
- n_begins = 0;
-
- for (i = 0; i < n - 5; i++) {
-
- if (ut_memcmp(buf + i, "BEGIN", 5) == 0) {
-
- n_begins++;
- }
- }
-
- if (n_begins > 1) {
-
- for (i = 0; i < n - 5; i++) {
-
- if (ut_memcmp(buf + i, "BEGIN", 5) == 0) {
-
- /* Erase the first BEGIN: */
- ut_memcpy(buf + i, " ", 5);
-
- break;
- }
- }
- }
-
- sprintf(buf + n, "END;\n");
-
- printf("SQL procedure to execute:\n%s\n", buf);
-
- ret = SQLAllocStmt(conn, &sql_query);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLPrepare(sql_query, (UCHAR*)buf, ut_strlen(buf));
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(sql_query);
-
- ut_a(ret == SQL_SUCCESS);
-
- sprintf(buf, "{P%s%lu ()}", cli_user_name, count);
-
- ret = SQLAllocStmt(conn, &sql_query);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLPrepare(sql_query, (UCHAR*)buf, ut_strlen(buf));
-
- ut_a(ret == SQL_SUCCESS);
-
- printf("Starting to execute the query\n");
-
- oldtm = ut_clock();
-
- ret = SQLExecute(sql_query);
-
- tm = ut_clock();
-
- printf("Wall time for query %lu milliseconds\n\n", tm - oldtm);
-
- ut_a(ret == SQL_SUCCESS);
-
- goto loop;
-}
-
-/********************************************************************
-Main test function. */
-
-void
-main(int argc, char* argv[])
-/*========================*/
-{
- ulint tm, oldtm;
- FILE* inputfile;
-
- if (argc > 2) {
- printf("Only one input file allowed\n");
-
- os_process_exit(1);
-
- } else if (argc == 2) {
- inputfile = fopen(argv[1], "r");
-
- if (inputfile == NULL) {
- printf(
- "Error: could not open the inputfile whose name is %s!\n",
- argv[1]);
- os_process_exit(1);
- }
- } else {
- inputfile = stdin;
- }
-
- cli_boot("cli_init");
-
- sync_init();
-
- mem_init(mem_pool_size);
-
- oldtm = ut_clock();
-
- isql(inputfile);
-
- tm = ut_clock();
-
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
-
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/btr/ts/makefile b/innobase/btr/ts/makefile
deleted file mode 100644
index 58364717472..00000000000
--- a/innobase/btr/ts/makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-include ..\..\makefile.i
-
-doall: tssrv tscli isql
-
-tssrv: ..\btr.lib tssrv.c
- $(CCOM) $(CFL) -I.. -I..\.. ..\btr.lib ..\..\eval.lib ..\..\ibuf.lib ..\..\trx.lib ..\..\pars.lib ..\..\que.lib ..\..\lock.lib ..\..\row.lib ..\..\read.lib ..\..\srv.lib ..\..\com.lib ..\..\usr.lib ..\..\thr.lib ..\..\fut.lib ..\..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\buf.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tssrv.c $(LFL)
-
-tscli: ..\btr.lib tscli.c
- $(CCOM) $(CFL) -I.. -I..\.. ..\btr.lib ..\..\ib_odbc.lib ..\..\eval.lib ..\..\ibuf.lib ..\..\trx.lib ..\..\pars.lib ..\..\que.lib ..\..\lock.lib ..\..\row.lib ..\..\read.lib ..\..\srv.lib ..\..\com.lib ..\..\usr.lib ..\..\thr.lib ..\..\fut.lib ..\..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\buf.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tscli.c $(LFL)
-
-isql: ..\btr.lib isql.c
- $(CCOM) $(CFL) -I.. -I..\.. ..\btr.lib ..\..\ib_odbc.lib ..\..\eval.lib ..\..\ibuf.lib ..\..\trx.lib ..\..\pars.lib ..\..\que.lib ..\..\lock.lib ..\..\row.lib ..\..\read.lib ..\..\srv.lib ..\..\com.lib ..\..\usr.lib ..\..\thr.lib ..\..\fut.lib ..\..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\buf.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib isql.c $(LFL)
-
-tsrecv: ..\btr.lib tsrecv.c
- $(CCOM) $(CFL) -I.. -I..\.. ..\btr.lib ..\..\ibuf.lib ..\..\trx.lib ..\..\pars.lib ..\..\que.lib ..\..\lock.lib ..\..\row.lib ..\..\read.lib ..\..\srv.lib ..\..\com.lib ..\..\usr.lib ..\..\thr.lib ..\..\fut.lib ..\..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\buf.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tsrecv.c $(LFL)
-
diff --git a/innobase/btr/ts/trash/TSIT.C b/innobase/btr/ts/trash/TSIT.C
deleted file mode 100644
index 775d4036c6d..00000000000
--- a/innobase/btr/ts/trash/TSIT.C
+++ /dev/null
@@ -1,483 +0,0 @@
-/************************************************************************
-The test module for the record manager of MVB.
-
-(c) 1994 Heikki Tuuri
-
-Created 1/25/1994 Heikki Tuuri
-*************************************************************************/
-
-
-#include "rm0phr.h"
-#include "rm0lgr.h"
-#include "ut0ut.h"
-#include "buf0mem.h"
-#include "rm0ipg.h"
-#include "../it0it.h"
-#include "../it0hi.h"
-#include "../it0ads.h"
-
-byte buf[100];
-byte buf2[100];
-lint lintbuf[2048];
-
-byte numbuf[6000];
-byte numlogrecbuf[100];
-phr_record_t* qs_table[100000];
-
-lint qs_comp = 0;
-
-extern
-void
-test1(void);
-
-#ifdef NOT_DEFINED
-
-void
-q_sort(lint low, lint up)
-{
- phr_record_t* temp, *pivot;
- lint i, j;
-
-
- pivot = qs_table[(low + up) / 2];
-
- i = low;
- j = up;
-
- while (i < j) {
- qs_comp++;
- if (cmp_phr_compare(qs_table[i], pivot)<= 0) {
- i++;
- } else {
- j--;
- temp = qs_table[i];
- qs_table[i] = qs_table[j];
- qs_table[j] = temp;
- }
- }
-
- if (j == up) {
- temp = qs_table[(low + up) / 2];
- qs_table[(low + up) / 2] = qs_table[up - 1];
- qs_table[up - 1] = temp;
- j--;
- }
-
-
- if (j - low <= 1) {
- /* do nothing */
- } else if (j - low == 2) {
- qs_comp++;
- if (cmp_phr_compare(qs_table[low],
- qs_table[low + 1])
- <= 0) {
- /* do nothing */
- } else {
- temp = qs_table[low];
- qs_table[low] = qs_table[low + 1];
- qs_table[low + 1] = temp;
- }
- } else {
- q_sort(low, j);
- }
-
- if (up - j <= 1) {
- /* do nothing */
- } else if (up - j == 2) {
- qs_comp++;
- if (cmp_phr_compare(qs_table[j],
- qs_table[j + 1])
- <= 0) {
- /* do nothing */
- } else {
- temp = qs_table[j];
- qs_table[j] = qs_table[j + 1];
- qs_table[j + 1] = temp;
- }
- } else {
- q_sort(j, up);
- }
-}
-
-#endif
-
-extern
-void
-test1(void)
-{
- phr_record_t* physrec;
- phr_record_t* rec1;
- phr_record_t* rec2;
- lgr_record_t* logrec;
- lgrf_field_t* logfield;
- lint len;
- byte* str;
- lint len2;
- lint tm;
- lint oldtm;
- lint i, j, k, l, m;
- bool b;
- it_cur_cursor_t cursor;
- ipg_cur_cursor_t* page_cursor;
- ipg_page_t* page;
-
- byte c4, c3, c2, c1, c0;
- lint rand, rnd1, rnd2;
- byte* nb;
- lgr_record_t* numlogrec;
- byte* pgbuf;
- mem_stream_t* stream;
- lint tree1, tree2, tree3;
- lint dummy1, dummy2;
-
- pgbuf = (byte*)lintbuf;
-
- stream = mem_stream_create(0);
-
- printf("-------------------------------------------\n");
- printf("TEST 1. Speed and basic tests.\n");
-
- logrec = lgr_create_logical_record(stream, 2);
-
- nb = numbuf;
-
- c4 = '0';
- c3 = '0';
- for (c2 = '0'; c2 <= '9'; c2++) {
- for (c1 = '0'; c1 <= '9'; c1++) {
- for (c0 = '0'; c0 <= '9'; c0++) {
- *nb = c4; nb++;
- *nb = c3; nb++;
- *nb = c2; nb++;
- *nb = c1; nb++;
- *nb = c0; nb++;
- *nb = '\0'; nb++;
- }
- }
- }
-
- numlogrec = lgr_create_logical_record(stream, 2);
-
-
- tree1 = it_create_index_tree();
-
- oldtm = ut_clock();
-
- rand = 99900;
- rnd1 = 67;
- for (j = 0; j < 1; j++) {
- for (i = 0 ; i < 100000; i++) {
-
- rand = (rand + 1) % 100000;
-
- logfield = lgr_get_nth_field(numlogrec, 0);
- lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
- lgrf_set_len(logfield, 6);
-
- logfield = lgr_get_nth_field(numlogrec, 1);
- lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
- lgrf_set_len(logfield, 6);
-/*
- it_insert(tree1, numlogrec);
-*/
-
-
-
- it_cur_search_tree_to_nth_level(tree1, 1, numlogrec,
- IPG_SE_L_GE, &cursor, &dummy1, &dummy2);
-
-/*
- it_cur_set_to_first(tree1, &cursor);
-*/
-
- it_cur_insert_record(&cursor, numlogrec);
-
- }
- }
- tm = ut_clock();
- printf("Time for inserting %ld recs = %ld \n", i* j, tm - oldtm);
-
-/* it_print_tree(tree1, 10);*/
- hi_print_info();
- ads_print_info();
-/*
- oldtm = ut_clock();
-
- rand = 11113;
- for (i = 0; i < 5000; i++) {
-
- rand = (rand + 57123) % 100000;
-
- logfield = lgr_get_nth_field(numlogrec, 0);
- lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
- lgrf_set_len(logfield, 6);
-
- logfield = lgr_get_nth_field(numlogrec, 1);
- lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
- lgrf_set_len(logfield, 6);
-
- it_cur_search_tree_to_nth_level(tree1, 1, numlogrec,
- IPG_SE_L_GE, &cursor, &dummy1, &dummy2);
-
- }
- tm = ut_clock();
- printf("Time for searching %ld recs = %ld \n", i, tm - oldtm);
-*/
-
- it_cur_set_to_first(tree1, &cursor);
-
- rec1 = ipg_cur_get_record(it_cur_get_page_cursor(&cursor));
-
- for (i = 0;; i++) {
- it_cur_move_to_next(&cursor);
- if (it_cur_end_of_level(&cursor)) {
- break;
- }
- rec2 = ipg_cur_get_record(it_cur_get_page_cursor(&cursor));
- ut_a(cmp_phr_compare(rec1, rec2) == -1);
- rec1 = rec2;
- }
-
- printf("tree1 checked for right sorted order!\n");
-
-#ifdef not_defined
-
- oldtm = ut_clock();
-
- for (j = 0; j < 1; j++) {
- rand = 11113;
- for (i = 0; i < 3000; i++) {
-
- rand = (rand + 57123) % 100000;
-
- logfield = lgr_get_nth_field(numlogrec, 0);
- lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
- lgrf_set_len(logfield, 6);
-
- logfield = lgr_get_nth_field(numlogrec, 1);
- lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
- lgrf_set_len(logfield, 6);
-
- physrec = hi_search(numlogrec);
-
- ut_a(physrec);
- }
-
- }
- ut_a(physrec);
- tm = ut_clock();
- printf("Time for hi_search %ld recs = %ld \n", i * j,
- tm - oldtm);
-
-
-
- oldtm = ut_clock();
-
- for (i = 0; i < 100000; i++) {
-/* j += lgr_fold(numlogrec, -1, -1);*/
-/* b += phr_lgr_equal(physrec, numlogrec, -1);*/
- k += ut_hash_lint(j, HI_TABLE_SIZE);
- }
-
-
-/* ut_a(b);*/
- tm = ut_clock();
- printf("Time for fold + equal %ld recs %s = %ld \n", i, physrec,
- tm - oldtm);
-
- printf("%ld %ld %ld\n", j, b, k);
-
- hi_print_info();
-
- tree2 = it_create_index_tree();
-
- rand = 90000;
- for (i = 0; i < 300; i++) {
-
- rand = (rand + 1) % 100000;
-
- logfield = lgr_get_nth_field(numlogrec, 0);
- lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
- lgrf_set_len(logfield, 6);
-
- logfield = lgr_get_nth_field(numlogrec, 1);
- lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
- lgrf_set_len(logfield, 6);
-
- it_cur_search_tree_to_nth_level(tree2, 1, numlogrec,
- IPG_SE_L_GE, &cursor);
-
- it_cur_insert_record(&cursor, numlogrec);
-
- }
-
- oldtm = ut_clock();
-
- rand = 10000;
- for (i = 0; i < 3000; i++) {
-
- rand = (rand + 1) % 100000;
-
- logfield = lgr_get_nth_field(numlogrec, 0);
- lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
- lgrf_set_len(logfield, 6);
-
- logfield = lgr_get_nth_field(numlogrec, 1);
- lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
- lgrf_set_len(logfield, 6);
-
- it_cur_search_tree_to_nth_level(tree2, 1, numlogrec,
- IPG_SE_L_GE, &cursor);
-
- it_cur_insert_record(&cursor, numlogrec);
-
- }
- tm = ut_clock();
- printf("Time for inserting sequentially %ld recs = %ld \n",
- i, tm - oldtm);
-
-
-/* it_print_tree(tree2, 10); */
-
-
- tree3 = it_create_index_tree();
-
- rand = 0;
- for (i = 0; i < 300; i++) {
-
- rand = (rand + 1) % 100000;
-
- logfield = lgr_get_nth_field(numlogrec, 0);
- lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
- lgrf_set_len(logfield, 6);
-
- logfield = lgr_get_nth_field(numlogrec, 1);
- lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
- lgrf_set_len(logfield, 6);
-
- it_cur_search_tree_to_nth_level(tree3, 1, numlogrec,
- IPG_SE_L_GE, &cursor);
-
- it_cur_insert_record(&cursor, numlogrec);
-
- }
-
- oldtm = ut_clock();
-
- rand = 100000;
- for (i = 0; i < 3000; i++) {
-
- rand = (rand - 1) % 100000;
-
- logfield = lgr_get_nth_field(numlogrec, 0);
- lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
- lgrf_set_len(logfield, 6);
-
- logfield = lgr_get_nth_field(numlogrec, 1);
- lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
- lgrf_set_len(logfield, 6);
-
- it_cur_search_tree_to_nth_level(tree3, 1, numlogrec,
- IPG_SE_L_GE, &cursor);
-
- it_cur_insert_record(&cursor, numlogrec);
-
- }
- tm = ut_clock();
- printf("Time for inserting sequentially downw. %ld recs = %ld \n",
- i, tm - oldtm);
-
-
-/* it_print_tree(tree3, 10); */
-
-#endif
-
-}
-
-#ifdef NOT_DEFINED
-
-/* Test of quicksort */
-void
-test2(void)
-{
- mem_stream_t* stream;
- byte* stbuf;
- lgrf_field_t* logfield;
- lint tm;
- lint oldtm;
- lint i, j, k, l, m;
- lint rand;
- lgr_record_t* numlogrec;
- phr_record_t* ph_rec;
-
- stream = mem_stream_create(1000);
-
- numlogrec = lgr_create_logical_record(stream, 2);
-
- oldtm = ut_clock();
-
- rand = 11113;
- for (i = 0; i < 50000; i++) {
- stbuf = mem_stream_alloc(stream, 30);
-
- rand = (rand + 57123) % 100000;
-
- logfield = lgr_get_nth_field(numlogrec, 0);
- lgrf_set_data(logfield, numbuf + 6 * (rand / 300));
- lgrf_set_len(logfield, 6);
-
- logfield = lgr_get_nth_field(numlogrec, 1);
- lgrf_set_data(logfield, numbuf + 6 * (rand % 300));
- lgrf_set_len(logfield, 6);
-
- ph_rec = phr_create_physical_record(stbuf, 30, numlogrec);
-
- qs_table[i] = ph_rec;
-
- }
- tm = ut_clock();
- printf("Time for inserting %ld recs to mem stream = %ld \n",
- i, tm - oldtm);
-
-
- oldtm = ut_clock();
-
- q_sort(0, 50000);
-
- tm = ut_clock();
- printf("Time for quicksort of %ld recs = %ld, comps: %ld \n",
- i, tm - oldtm, qs_comp);
-
-
-
- for (i = 1; i < 49999; i++) {
- ut_a(-1 ==
- cmp_phr_compare(qs_table[i], qs_table[i+1]
- ));
- }
- tm = ut_clock();
-
-
- oldtm = ut_clock();
- for (i = 1; i < 50000; i++) {
- k += cmp_phr_compare(qs_table[i & 0xF],
- qs_table[5]);
- }
- tm = ut_clock();
- printf("%ld\n", k);
-
- printf("Time for cmp of %ld ph_recs = %ld \n",
- i, tm - oldtm);
-
- mem_stream_free(stream);
-
-}
-#endif
-
-void
-main(void)
-{
- test1();
-/* test2(); */
-}
-
diff --git a/innobase/btr/ts/trash/tsbtrold5.c b/innobase/btr/ts/trash/tsbtrold5.c
deleted file mode 100644
index 370cf0b14bd..00000000000
--- a/innobase/btr/ts/trash/tsbtrold5.c
+++ /dev/null
@@ -1,798 +0,0 @@
-/************************************************************************
-The test for the index tree
-
-(c) 1994-1996 Innobase Oy
-
-Created 2/16/1996 Heikki Tuuri
-*************************************************************************/
-
-#include "sync0sync.h"
-#include "ut0mem.h"
-#include "mem0mem.h"
-#include "data0data.h"
-#include "data0type.h"
-#include "dict0dict.h"
-#include "buf0buf.h"
-#include "os0file.h"
-#include "fil0fil.h"
-#include "fsp0fsp.h"
-#include "rem0rec.h"
-#include "rem0cmp.h"
-#include "mtr0mtr.h"
-#include "log0log.h"
-#include "page0page.h"
-#include "page0cur.h"
-#include "..\btr0btr.h"
-#include "..\btr0cur.h"
-#include "..\btr0pcur.h"
-
-os_file_t files[1000];
-
-mutex_t ios_mutex;
-ulint ios;
-ulint n[10];
-
-mutex_t incs_mutex;
-ulint incs;
-
-byte bigbuf[1000000];
-
-#define N_SPACES 1
-#define N_FILES 2
-#define FILE_SIZE 1000 /* must be > 512 */
-#define POOL_SIZE 1000
-#define COUNTER_OFFSET 1500
-
-#define LOOP_SIZE 150
-#define N_THREADS 5
-
-
-ulint zero = 0;
-
-buf_block_t* bl_arr[POOL_SIZE];
-
-/************************************************************************
-Io-handler thread function. */
-
-ulint
-handler_thread(
-/*===========*/
- void* arg)
-{
- ulint segment;
- void* mess;
- ulint i;
- bool ret;
-
- segment = *((ulint*)arg);
-
- printf("Io handler thread %lu starts\n", segment);
-
- for (i = 0;; i++) {
- ret = fil_aio_wait(segment, &mess);
- ut_a(ret);
-
- buf_page_io_complete((buf_block_t*)mess);
-
- mutex_enter(&ios_mutex);
- ios++;
- mutex_exit(&ios_mutex);
-
- }
-
- return(0);
-}
-
-/*************************************************************************
-Creates the files for the file system test and inserts them to
-the file system. */
-
-void
-create_files(void)
-/*==============*/
-{
- bool ret;
- ulint i, k;
- char name[20];
- os_thread_t thr[5];
- os_thread_id_t id[5];
-
- printf("--------------------------------------------------------\n");
- printf("Create or open database files\n");
-
- strcpy(name, "j:\\tsfile00");
-
- for (k = 0; k < N_SPACES; k++) {
- for (i = 0; i < N_FILES; i++) {
-
- name[9] = (char)((ulint)'0' + k);
- name[10] = (char)((ulint)'0' + i);
-
- files[i] = os_file_create(name, OS_FILE_CREATE,
- OS_FILE_TABLESPACE, &ret);
-
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(
- name, OS_FILE_OPEN,
- OS_FILE_TABLESPACE, &ret);
-
- ut_a(ret);
- }
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create(name, k, OS_FILE_TABLESPACE);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, FILE_SIZE, k);
- }
- }
-
- ios = 0;
-
- mutex_create(&ios_mutex);
-
- for (i = 0; i < 5; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(handler_thread, n + i, id + i);
- }
-}
-
-/************************************************************************
-Inits space header of space 0. */
-
-void
-init_space(void)
-/*============*/
-{
- mtr_t mtr;
-
- printf("Init space header\n");
-
- mtr_start(&mtr);
-
- fsp_header_init(0, FILE_SIZE * N_FILES, &mtr);
-
- mtr_commit(&mtr);
-}
-
-/*********************************************************************
-Test for index page. */
-
-void
-test1(void)
-/*=======*/
-{
- dtuple_t* tuple;
- mem_heap_t* heap;
- ulint rnd = 0;
- dict_index_t* index;
- dict_table_t* table;
- dict_tree_t* tree;
- mtr_t mtr;
- byte buf[8];
- ulint i;
- ulint tm, oldtm;
- btr_pcur_t cursor;
-
- printf("-------------------------------------------------\n");
- printf("TEST 1. Basic test\n");
-
- heap = mem_heap_create(0);
-
- table = dict_mem_table_create("TS_TABLE1", 2);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
-
- dict_table_add_to_cache(table);
-
- index = dict_mem_index_create("TS_TABLE1", "IND1", 0, 2, 0);
-
- dict_mem_index_add_field(index, "COL1", 0);
- dict_mem_index_add_field(index, "COL2", 0);
-
- dict_index_add_to_cache(index);
-
- index = dict_index_get("TS_TABLE1", "IND1");
- ut_a(index);
-
- tree = dict_index_get_tree(index);
-
- tuple = dtuple_create(heap, 3);
-
- mtr_start(&mtr);
-
- btr_root_create(tree, 0, &mtr);
-
- mtr_commit(&mtr);
-
- mtr_start(&mtr);
-
- dtuple_gen_test_tuple3(tuple, 0, buf);
- btr_insert(tree, tuple, &mtr);
-
- mtr_commit(&mtr);
-
- rnd = 90000;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1000 * UNIV_DBC * UNIV_DBC; i++) {
-
- mtr_start(&mtr);
-
- if (i == 77000) {
- rnd = rnd % 200000;
- }
-
- rnd = (rnd + 15675751) % 200000;
-
- dtuple_gen_test_tuple3(tuple, rnd, buf);
-
- btr_insert(tree, tuple, &mtr);
-
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
-
- rnd = 90000;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1000 * UNIV_DBC * UNIV_DBC; i++) {
-
- mtr_start(&mtr);
-
- if (i == 50000) {
- rnd = rnd % 200000;
- }
-
- rnd = (rnd + 595659561) % 200000;
-
- dtuple_gen_test_tuple3(tuple, rnd, buf);
-
- btr_pcur_open(tree, tuple, PAGE_CUR_GE,
- BTR_SEARCH_LEAF, &cursor, &mtr);
-
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1000 * UNIV_DBC * UNIV_DBC; i++) {
-
- mtr_start(&mtr);
-
- rnd = (rnd + 35608971) % 200000 + 1;
-
- dtuple_gen_test_tuple3(tuple, rnd, buf);
-
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
-
-/* btr_print_tree(tree, 3); */
-
- mem_heap_free(heap);
-}
-
-
-#ifdef notdefined
-
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd + 534671) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
-/* page_print_list(page, 151); */
-
- ut_a(page_validate(page, index));
- ut_a(page_get_n_recs(page) == 512);
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd + 7771) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- page_cur_delete_rec(&cursor, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
- ut_a(page_get_n_recs(page) == 0);
-
- ut_a(page_validate(page, index));
- page = page_create(frame, &mtr);
-
- rnd = 311;
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd + 1) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
- ut_a(page_validate(page, index));
- ut_a(page_get_n_recs(page) == 512);
-
- rnd = 217;
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd + 1) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- page_cur_delete_rec(&cursor, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
- ut_a(page_validate(page, index));
- ut_a(page_get_n_recs(page) == 0);
- page = page_create(frame, &mtr);
-
- rnd = 291;
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd - 1) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
- ut_a(page_validate(page, index));
- ut_a(page_get_n_recs(page) == 512);
-
- rnd = 277;
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd - 1) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- page_cur_delete_rec(&cursor, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
- ut_a(page_validate(page, index));
- ut_a(page_get_n_recs(page) == 0);
-
- mtr_commit(&mtr);
- mem_heap_free(heap);
-}
-
-/*********************************************************************
-Test for index page. */
-
-void
-test2(void)
-/*=======*/
-{
- page_t* page;
- dtuple_t* tuple;
- mem_heap_t* heap;
- ulint i, j;
- ulint rnd = 0;
- rec_t* rec;
- page_cur_t cursor;
- dict_index_t* index;
- dict_table_t* table;
- buf_block_t* block;
- buf_frame_t* frame;
- ulint tm, oldtm;
- byte buf[8];
- mtr_t mtr;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2. Speed test\n");
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1000 * UNIV_DBC * UNIV_DBC; i++) {
- ut_memcpy(bigbuf, bigbuf + 800, 800);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu mem copys of 800 bytes %lu millisecs\n",
- i, tm - oldtm);
-
- oldtm = ut_clock();
-
- rnd = 0;
- for (i = 0; i < 1000 * UNIV_DBC * UNIV_DBC; i++) {
- ut_memcpy(bigbuf + rnd, bigbuf + rnd + 800, 800);
- rnd += 1600;
- if (rnd > 995000) {
- rnd = 0;
- }
- }
-
- tm = ut_clock();
- printf("Wall time for %lu mem copys of 800 bytes %lu millisecs\n",
- i, tm - oldtm);
-
- heap = mem_heap_create(0);
-
- table = dict_table_create("TS_TABLE2", 2);
-
- dict_table_add_col(table, "COL1", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
- dict_table_add_col(table, "COL2", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
-
- ut_a(0 == dict_table_publish(table));
-
- index = dict_index_create("TS_TABLE2", "IND2", 0, 2, 0);
-
- dict_index_add_field(index, "COL1", 0);
- dict_index_add_field(index, "COL2", 0);
-
- ut_a(0 == dict_index_publish(index));
-
- index = dict_index_get("TS_TABLE2", "IND2");
- ut_a(index);
-
- tuple = dtuple_create(heap, 2);
-
- oldtm = ut_clock();
-
- rnd = 677;
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
-
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
- ut_a(rec);
- }
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf("Wall time for insertion of %lu recs %lu milliseconds\n",
- i * j, tm - oldtm);
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, 5, &mtr);
- buf_page_s_lock(block, &mtr);
-
- page = buf_block_get_frame(block);
- ut_a(page_validate(page, index));
- mtr_commit(&mtr);
-
- oldtm = ut_clock();
-
- rnd = 677;
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- }
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf(
- "Wall time for %lu empty loops with page create %lu milliseconds\n",
- i * j, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
-
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- rnd = 100;
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 1) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
- ut_a(rec);
- }
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf(
- "Wall time for sequential insertion of %lu recs %lu milliseconds\n",
- i * j, tm - oldtm);
-
-
- oldtm = ut_clock();
-
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- rnd = 500;
- for (j = 0; j < 250; j++) {
- rnd = (rnd - 1) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
- ut_a(rec);
- }
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf(
- "Wall time for descend. seq. insertion of %lu recs %lu milliseconds\n",
- i * j, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- rnd = 677;
-
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
- ut_a(rec);
- }
-
- rnd = 677;
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- page_cur_delete_rec(&cursor, &mtr);
- }
- ut_a(page_get_n_recs(page) == 0);
-
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf("Wall time for insert and delete of %lu recs %lu milliseconds\n",
- i * j, tm - oldtm);
-
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- rnd = 677;
-
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
- ut_a(rec);
- }
- ut_a(page_validate(page, index));
- mtr_print(&mtr);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
- rnd = 677;
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
- }
- }
-
- tm = ut_clock();
- printf("Wall time for search of %lu recs %lu milliseconds\n",
- i * j, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
- rnd = 677;
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- }
- }
-
- tm = ut_clock();
- printf("Wall time for %lu empty loops %lu milliseconds\n",
- i * j, tm - oldtm);
- mtr_commit(&mtr);
-}
-
-#endif
-
-/********************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
-
- sync_init();
- mem_init();
- os_aio_init(160, 5);
- fil_init(25);
- buf_pool_init(POOL_SIZE, POOL_SIZE);
- dict_init();
- fsp_init();
- log_init();
-
- create_files();
-
- init_space();
-
- oldtm = ut_clock();
-
- ut_rnd_set_seed(19);
-
- test1();
-
-/* mem_print_info(); */
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/btr/ts/trash/tscli.c b/innobase/btr/ts/trash/tscli.c
deleted file mode 100644
index 622da894e02..00000000000
--- a/innobase/btr/ts/trash/tscli.c
+++ /dev/null
@@ -1,2263 +0,0 @@
-/************************************************************************
-Test for the client
-
-(c) 1996-1997 Innobase Oy
-
-Created 2/16/1996 Heikki Tuuri
-*************************************************************************/
-
-#include "ib_odbc.h"
-
-/*********************************************************************
-Test for TPC-C. */
-
-ulint
-test_c(
-/*===*/
- void* arg)
-{
- HSTMT* query;
- HSTMT* commit_query;
- HSTMT* new_order_query;
- HSTMT* payment_query;
- HSTMT* order_status_query;
- HSTMT* delivery_query;
- HSTMT* stock_level_query;
- HSTMT* print_query;
- ulint tm, oldtm;
- char* str;
- char* str1;
- char* str2;
- char* str3;
- char* str4;
- char* str5;
- char* str6;
- ulint i;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST. CREATE TABLES FOR TPC-C\n");
-
- /*------------------------------------------------------*/
-
- str1 =
-
-" PROCEDURE CREATE_TABLES () IS"
-" BEGIN"
-" CREATE TABLE WAREHOUSE (W_ID CHAR, W_NAME CHAR,"
-" W_STREET_1 CHAR, W_STREET_2 CHAR,"
-" W_CITY CHAR,"
-" W_STATE CHAR, W_ZIP CHAR,"
-" W_TAX INT,"
-" W_YTD_HIGH INT,"
-" W_YTD INT);"
-""
-" CREATE UNIQUE CLUSTERED INDEX W_IND ON WAREHOUSE (W_ID);"
-""
-" CREATE TABLE DISTRICT (D_ID CHAR, D_W_ID CHAR,"
-" D_NAME CHAR,"
-" D_STREET_1 CHAR, D_STREET_2 CHAR,"
-" D_CITY CHAR,"
-" D_STATE CHAR, D_ZIP CHAR,"
-" D_TAX INT,"
-" D_YTD_HIGH INT,"
-" D_YTD INT,"
-" D_NEXT_O_ID INT);"
-""
-" CREATE UNIQUE CLUSTERED INDEX D_IND ON DISTRICT (D_W_ID, D_ID);"
-""
-" CREATE TABLE CUSTOMER (C_ID CHAR, C_D_ID CHAR, C_W_ID CHAR,"
-" C_FIRST CHAR, C_MIDDLE CHAR,"
-" C_LAST CHAR,"
-" C_STREET_1 CHAR, C_STREET_2 CHAR,"
-" C_CITY CHAR,"
-" C_STATE CHAR, C_ZIP CHAR,"
-" C_PHONE CHAR,"
-" C_SINCE_TIME INT,"
-" C_SINCE INT,"
-" C_CREDIT CHAR,"
-" C_CREDIT_LIM_HIGH INT,"
-" C_CREDIT_LIM INT,"
-" C_DISCOUNT INT,"
-" C_BALANCE_HIGH INT,"
-" C_BALANCE INT,"
-" C_YTD_PAYMENT_HIGH INT,"
-" C_YTD_PAYMENT INT,"
-" C_PAYMENT_CNT INT,"
-" C_DELIVERY_CNT INT,"
-" C_DATA CHAR);"
-""
-" CREATE UNIQUE CLUSTERED INDEX C_IND ON CUSTOMER (C_W_ID, C_D_ID,"
-" C_ID);"
-""
-" CREATE INDEX C_LAST_IND ON CUSTOMER (C_W_ID, C_D_ID, C_LAST,"
-" C_FIRST);"
-""
-" CREATE TABLE HISTORY (H_C_ID CHAR, H_C_D_ID CHAR, H_C_W_ID CHAR,"
-" H_D_ID CHAR, H_W_ID CHAR,"
-" H_DATE INT,"
-" H_AMOUNT INT,"
-" H_DATA CHAR);"
-""
-" CREATE CLUSTERED INDEX H_IND ON HISTORY (H_W_ID);"
-""
-" CREATE TABLE NEW_ORDER (NO_O_ID INT,"
-" NO_D_ID CHAR,"
-" NO_W_ID CHAR);"
-""
-" CREATE UNIQUE CLUSTERED INDEX NO_IND ON NEW_ORDER (NO_W_ID, NO_D_ID,"
-" NO_O_ID);"
- ;
-
- str2 =
-
-" CREATE TABLE ORDERS (O_ID INT, O_D_ID CHAR, O_W_ID CHAR,"
-" O_C_ID CHAR,"
-" O_ENTRY_D INT,"
-" O_CARRIER_ID INT,"
-" O_OL_CNT INT,"
-" O_ALL_LOCAL CHAR);"
-""
-" CREATE UNIQUE CLUSTERED INDEX O_IND ON ORDERS (O_W_ID, O_D_ID,"
-" O_ID);"
-" CREATE INDEX O_C_IND ON ORDERS (O_W_ID, O_D_ID, O_C_ID);"
-""
-" CREATE TABLE ORDER_LINE (OL_O_ID INT, OL_D_ID CHAR, OL_W_ID CHAR,"
-" OL_NUMBER CHAR,"
-" OL_I_ID CHAR,"
-" OL_SUPPLY_W_ID CHAR,"
-" OL_DELIVERY_D INT,"
-" OL_QUANTITY INT,"
-" OL_AMOUNT INT,"
-" OL_DIST_INFO CHAR);"
-""
-" CREATE UNIQUE CLUSTERED INDEX OL_IND ON ORDER_LINE"
-" (OL_W_ID, OL_D_ID, OL_O_ID, OL_NUMBER);"
-""
-" CREATE TABLE ITEM (I_ID CHAR, I_IM_ID CHAR, I_NAME CHAR,"
-" I_PRICE INT,"
-" I_DATA CHAR);"
-""
-" CREATE UNIQUE CLUSTERED INDEX I_IND ON ITEM (I_ID);"
-""
-" CREATE TABLE STOCK (S_I_ID CHAR,"
-" S_W_ID CHAR,"
-" S_QUANTITY INT,"
-" S_DIST_01 CHAR,"
-" S_DIST_02 CHAR,"
-" S_DIST_03 CHAR,"
-" S_DIST_04 CHAR,"
-" S_DIST_05 CHAR,"
-" S_DIST_06 CHAR,"
-" S_DIST_07 CHAR,"
-" S_DIST_08 CHAR,"
-" S_DIST_09 CHAR,"
-" S_DIST_10 CHAR,"
-" S_YTD INT,"
-" S_ORDER_CNT INT,"
-" S_REMOTE_CNT INT,"
-" S_DATA CHAR);"
-""
-" CREATE UNIQUE CLUSTERED INDEX S_IND ON STOCK (S_W_ID, S_I_ID);"
-" END;"
- ;
-
- str = ut_str_catenate(str1, str2);
-
- query = pars_sql(str);
-
- mem_free(str);
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
-
- /*-----------------------------------------------------------*/
- printf("\n\nPopulate TPC-C tables\n\n");
-
- str1 =
-
-" PROCEDURE POPULATE_TABLES () IS"
-""
-" i INT;"
-" j INT;"
-" k INT;"
-" t INT;"
-" string CHAR;"
-" rnd1 INT;"
-" rnd2 INT;"
-" n_items INT;"
-" n_warehouses INT;"
-" n_districts INT;"
-" n_customers INT;"
-""
-" BEGIN"
-""
-" n_items := 200;"
-" n_warehouses := 1;"
-" n_districts := 10;"
-" n_customers := 200;"
-""
-" PRINTF('Starting to populate ITEMs');"
-""
-" FOR i IN 1 .. n_items LOOP"
-" rnd1 := RND(26, 50);"
-" string := RND_STR(rnd1);"
-""
-" IF (RND(0, 9) = 0) THEN"
-" rnd2 := RND(0, rnd1 - 8);"
-" REPLSTR(string, 'ORIGINAL', rnd2, 8);"
-" COMMIT WORK;"
-" END IF;"
-""
-" INSERT INTO ITEM VALUES (TO_BINARY(i, 3),"
-" TO_BINARY(RND(1, 10000), 3),"
-" RND_STR(RND(14, 24)),"
-" RND(100, 10000),"
-" string);"
-" END LOOP;"
-""
-" FOR i IN 1 .. n_warehouses LOOP"
-" PRINTF('Starting to populate warehouse number ', i);"
-" INSERT INTO WAREHOUSE VALUES (TO_BINARY(i, 2),"
-" RND_STR(RND(6, 10)),"
-" RND_STR(RND(10, 20)),"
-" RND_STR(RND(10, 20)),"
-" RND_STR(RND(10, 20)),"
-" RND_STR(2),"
-" CONCAT(SUBSTR(TO_CHAR(RND(0, 9999)),"
-" 6, 4),"
-" '11111'),"
-" RND(0, 2000),"
-" 0,"
-" 0);"
-" FOR j IN 1 .. n_items LOOP"
-""
-" rnd1 := RND(26, 50);"
-" string := RND_STR(rnd1);"
-""
-" IF (RND(0, 9) = 0) THEN"
-" rnd2 := RND(0, rnd1 - 8);"
-" REPLSTR(string, 'ORIGINAL', rnd2, 8);"
-" COMMIT WORK;"
-" END IF; "
-""
-" INSERT INTO STOCK VALUES (TO_BINARY(j, 3),"
-" TO_BINARY(i, 2),"
-" RND(10, 100),"
-" RND_STR(24),"
-" RND_STR(24),"
-" RND_STR(24),"
-" RND_STR(24),"
-" RND_STR(24),"
-" RND_STR(24),"
-" RND_STR(24),"
-" RND_STR(24),"
-" RND_STR(24),"
-" RND_STR(24),"
-" 0, 0, 0,"
-" string);"
-" END LOOP;"
- ;
-
- str2 =
-" FOR j IN 1 .. n_districts LOOP"
-""
-" COMMIT WORK;"
-" PRINTF('Starting to populate district number ', j);"
-" INSERT INTO DISTRICT VALUES (TO_BINARY(j + 47, 1),"
-" TO_BINARY(i, 2),"
-" RND_STR(RND(6, 10)),"
-" RND_STR(RND(10, 20)),"
-" RND_STR(RND(10, 20)),"
-" RND_STR(RND(10, 20)),"
-" RND_STR(2),"
-" CONCAT(SUBSTR("
-" TO_CHAR(RND(0, 9999)),"
-" 6, 4),"
-" '11111'),"
-" RND(0, 2000),"
-" 0,"
-" 0,"
-" 3001);"
-""
-" FOR k IN 1 .. n_customers LOOP"
-""
-" string := 'GC';"
-""
-" IF (RND(0, 9) = 7) THEN"
-" COMMIT WORK;"
-" string := 'BC';"
-" END IF;"
-" "
-" INSERT INTO CUSTOMER VALUES ("
-" TO_BINARY(k, 3),"
-" TO_BINARY(j + 47, 1),"
-" TO_BINARY(i, 2),"
-" RND_STR(RND(8, 16)),"
-" 'OE',"
-" CONCAT('NAME',"
-" TO_CHAR(k / 3)),"
-" RND_STR(RND(10, 20)),"
-" RND_STR(RND(10, 20)),"
-" RND_STR(RND(10, 20)),"
-" RND_STR(2),"
-" CONCAT(SUBSTR("
-" TO_CHAR(RND(0, 9999)),"
-" 6, 4),"
-" '11111'),"
-" RND_STR(16),"
-" SYSDATE(), 0,"
-" string,"
-" 0, 5000000,"
-" RND(0, 5000),"
-" 0, 0, 0, 0, 0, 0,"
-" RND_STR(RND(300, 500)));"
- ;
-
- str3 =
-" INSERT INTO HISTORY VALUES ("
-" TO_BINARY(k, 3),"
-" TO_BINARY(j + 47, 1),"
-" TO_BINARY(i, 2),"
-" TO_BINARY(j + 47, 1),"
-" TO_BINARY(i, 2),"
-" SYSDATE(),"
-" 1000,"
-" RND_STR(RND(12, 24)));"
-""
-" rnd1 := RND(5, 15);"
-""
-" INSERT INTO ORDERS VALUES ("
-" k,"
-" TO_BINARY(j + 47, 1),"
-" TO_BINARY(i, 2),"
-" TO_BINARY(k, 3),"
-" SYSDATE(),"
-" RND(1, 10),"
-" rnd1,"
-" '1');"
-""
-" FOR t IN 1 .. rnd1 LOOP"
-" INSERT INTO ORDER_LINE VALUES ("
-" k,"
-" TO_BINARY(j + 47, 1),"
-" TO_BINARY(i, 2),"
-" TO_BINARY(t, 1),"
-" TO_BINARY("
-" RND(0, n_items - 1),"
-" 3),"
-" TO_BINARY(i, 2),"
-" SYSDATE(),"
-" RND(0, 99),"
-" RND(0, 9999),"
-" RND_STR(24));"
-" END LOOP;"
-" END LOOP;"
-" "
-" FOR k IN (2 * n_customers) / 3 .. n_customers LOOP"
-" "
-" INSERT INTO NEW_ORDER VALUES ("
-" k,"
-" TO_BINARY(j + 47, 1),"
-" TO_BINARY(i, 2));"
-" END LOOP;"
-" END LOOP;"
-" END LOOP; "
-" "
-" COMMIT WORK;"
-" END;"
- ;
-
- str4 = ut_str_catenate(str1, str2);
- str = ut_str_catenate(str4, str3);
-
- query = pars_sql(str);
-
- mem_free(str);
- mem_free(str4);
-
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
-
- /*-----------------------------------------------------------*/
- str =
-
-" PROCEDURE PRINT_TABLES () IS"
-" BEGIN"
-""
-" /* PRINTF('Printing ITEM table:');"
-""
-" ROW_PRINTF"
-" SELECT *"
-" FROM ITEM;"
-""
-" PRINTF('Printing WAREHOUSE table:');"
-""
-" ROW_PRINTF"
-" SELECT *"
-" FROM WAREHOUSE;"
-""
-" PRINTF('Printing STOCK table:');"
-""
-" ROW_PRINTF"
-" SELECT *"
-" FROM STOCK;"
-""
-" PRINTF('Printing DISTRICT table:');"
-""
-" ROW_PRINTF"
-" SELECT *"
-" FROM DISTRICT;"
-""
-" PRINTF('Printing CUSTOMER table:');"
-""
-" ROW_PRINTF"
-" SELECT *"
-" FROM CUSTOMER;"
-""
-" PRINTF('Printing HISTORY table:');"
-""
-" ROW_PRINTF"
-" SELECT *"
-" FROM HISTORY;"
-""
-" PRINTF('Printing ORDERS table:');"
-""
-" ROW_PRINTF"
-" SELECT *"
-" FROM ORDERS;"
-""
-" PRINTF('Printing ORDER_LINE table:');"
-""
-" ROW_PRINTF"
-" SELECT *"
-" FROM ORDER_LINE"
-" WHERE OL_O_ID >= 3000; */"
-""
-" PRINTF('Printing NEW_ORDER table:');"
-""
-" ROW_PRINTF"
-" SELECT *"
-" FROM NEW_ORDER;"
-""
-" COMMIT WORK;"
-" END;"
- ;
-
- print_query = pars_sql(str);
-
- /*-----------------------------------------------------------*/
- commit_query = pars_sql(
-
-" PROCEDURE COMMIT_TEST () IS"
-" "
-" BEGIN"
-" COMMIT WORK;"
-" END;"
- );
-
-
- /*-----------------------------------------------------------*/
-
- str1 =
-
-" PROCEDURE NEW_ORDER () IS"
-""
-" i INT;"
-" n_items INT;"
-" n_warehouses INT;"
-" n_districts INT;"
-" n_customers INT;"
-" w_tax INT;"
-" c_w_id CHAR;"
-" c_d_id CHAR;"
-" c_id CHAR;"
-" c_discount INT;"
-" c_last CHAR;"
-" c_credit CHAR;"
-" d_tax INT;"
-" o_id INT;"
-" o_ol_cnt INT;"
-" ol_i_id CHAR;"
-" o_entry_d INT;"
-" o_all_local CHAR;"
-" i_price INT;"
-" i_name CHAR;"
-" i_data CHAR;"
-" s_quantity INT;"
-" s_data CHAR;"
-" s_dist_01 CHAR;"
-" s_dist_02 CHAR;"
-" s_dist_03 CHAR;"
-" s_dist_04 CHAR;"
-" s_dist_05 CHAR;"
-" s_dist_06 CHAR;"
-" s_dist_07 CHAR;"
-" s_dist_08 CHAR;"
-" s_dist_09 CHAR;"
-" s_dist_10 CHAR;"
-" bg CHAR;"
-" ol_quantity INT;"
-" ol_amount INT;"
-" ol_supply_w_id CHAR;"
-" ol_dist_info CHAR;"
-" total INT;"
-""
-" DECLARE CURSOR district_cursor IS"
-" SELECT D_NEXT_O_ID, D_TAX"
-" FROM DISTRICT"
-" WHERE D_ID = c_d_id AND D_W_ID = c_w_id"
-" FOR UPDATE;"
-""
-" DECLARE CURSOR stock_cursor IS"
-" SELECT S_QUANTITY, S_DATA,"
-" S_DIST_01, S_DIST_02, S_DIST_03, S_DIST_04,"
-" S_DIST_05, S_DIST_06, S_DIST_07, S_DIST_08,"
-" S_DIST_09, S_DIST_10"
-" FROM STOCK"
-" WHERE S_W_ID = ol_supply_w_id AND S_I_ID = ol_i_id"
-" FOR UPDATE;"
- ;
- str2 =
-
-" BEGIN"
-" "
-" n_items := 200;"
-" n_warehouses := 1;"
-" n_districts := 10;"
-" n_customers := 200;"
-" "
-" c_w_id := TO_BINARY(RND(1, n_warehouses), 2);"
-" c_d_id := TO_BINARY(RND(1, n_districts) + 47, 1);"
-" c_id := TO_BINARY(RND(1, n_customers), 3);"
-""
-" o_ol_cnt := RND(5, 15);"
-" o_all_local := '1';"
-" bg := 'GGGGGGGGGGGGGGG';"
-" total := 0;"
-" "
-" SELECT W_TAX INTO w_tax"
-" FROM WAREHOUSE"
-" WHERE W_ID = c_w_id;"
-""
-" OPEN district_cursor;"
-""
-" FETCH district_cursor INTO o_id, d_tax;"
-""
-" /* PRINTF('C-warehouse id ', BINARY_TO_NUMBER(c_w_id),"
-" ' C-district id ', c_d_id,"
-" ' order id ', o_id, ' linecount ', o_ol_cnt); */"
-""
-" UPDATE DISTRICT SET D_NEXT_O_ID = o_id + 1"
-" WHERE CURRENT OF district_cursor;"
-""
-" CLOSE district_cursor;"
-""
-" SELECT C_DISCOUNT, C_LAST, C_CREDIT INTO c_discount, c_last, c_credit"
-" FROM CUSTOMER"
-" WHERE C_W_ID = c_w_id AND C_D_ID = c_d_id AND C_ID = c_id;"
-""
- ;
- str3 =
-
-" FOR i IN 1 .. o_ol_cnt LOOP"
-""
-" ol_i_id := TO_BINARY(RND(1, n_items), 3);"
-""
-" ol_supply_w_id := c_w_id;"
-""
-" ol_quantity := RND(1, 10);"
-""
-" SELECT I_PRICE, I_NAME, I_DATA INTO i_price, i_name, i_data"
-" FROM ITEM"
-" WHERE I_ID = ol_i_id;"
-""
-" IF (SQL % NOTFOUND) THEN"
-" PRINTF('Rolling back');"
-" ROLLBACK WORK;"
-""
-" RETURN;"
-" END IF;"
-""
-" OPEN stock_cursor;"
-""
-" FETCH stock_cursor INTO s_quantity, s_data,"
-" s_dist_01, s_dist_02, s_dist_03,"
-" s_dist_04, s_dist_05, s_dist_06,"
-" s_dist_07, s_dist_08, s_dist_09,"
-" s_dist_10;"
-""
-" IF (s_quantity >= ol_quantity + 10) THEN"
-" s_quantity := s_quantity - ol_quantity;"
-" ELSE"
-" s_quantity := (s_quantity + 91) - ol_quantity;"
-" END IF;"
-""
-" UPDATE STOCK SET S_QUANTITY = s_quantity,"
-" S_YTD = S_YTD + ol_quantity,"
-" S_ORDER_CNT = S_ORDER_CNT + 1"
-" WHERE CURRENT OF stock_cursor;"
-""
-" IF (ol_supply_w_id <> c_w_id) THEN"
-""
-" o_all_local := '0';"
-" PRINTF('Remote order ',"
-" BINARY_TO_NUMBER(ol_supply_w_id), ' ',"
-" BINARY_TO_NUMBER(c_w_id));"
-""
-" UPDATE STOCK SET S_REMOTE_CNT = S_REMOTE_CNT + 1"
-" WHERE CURRENT OF stock_cursor;"
-" END IF;"
-""
-" CLOSE stock_cursor;"
-""
-" IF ((INSTR(i_data, 'ORIGINAL') > 0)"
-" OR (INSTR(s_data, 'ORIGINAL') > 0)) THEN"
-" REPLSTR(bg, 'B', i - 1, 1);"
-" END IF;"
-""
-" ol_amount := ol_quantity * i_price;"
-""
-" total := total + ol_amount;"
- ;
- str4 =
-" IF (c_d_id = '0') THEN"
-" ol_dist_info := s_dist_01;"
-" ELSIF (c_d_id = '1') THEN"
-" ol_dist_info := s_dist_02;"
-" ELSIF (c_d_id = '2') THEN"
-" ol_dist_info := s_dist_03;"
-" ELSIF (c_d_id = '3') THEN"
-" ol_dist_info := s_dist_04;"
-" ELSIF (c_d_id = '4') THEN"
-" ol_dist_info := s_dist_05;"
-" ELSIF (c_d_id = '5') THEN"
-" ol_dist_info := s_dist_06;"
-" ELSIF (c_d_id = '6') THEN"
-" ol_dist_info := s_dist_07;"
-" ELSIF (c_d_id = '7') THEN"
-" ol_dist_info := s_dist_08;"
-" ELSIF (c_d_id = '8') THEN"
-" ol_dist_info := s_dist_09;"
-" ELSIF (c_d_id = '9') THEN"
-" ol_dist_info := s_dist_10;"
-" END IF;"
-""
-" INSERT INTO ORDER_LINE VALUES (o_id, c_d_id, c_w_id,"
-" TO_BINARY(i, 1), ol_i_id,"
-" ol_supply_w_id, NULL, ol_quantity,"
-" ol_amount, ol_dist_info); "
-" END LOOP;"
-""
-" total := (((total * (10000 + w_tax + d_tax)) / 10000)"
-" * (10000 - c_discount)) / 10000;"
-""
-" o_entry_d := SYSDATE();"
-""
-" INSERT INTO ORDERS VALUES (o_id, c_d_id, c_w_id, c_id, o_entry_d,"
-" NULL, o_ol_cnt, o_all_local);"
-" INSERT INTO NEW_ORDER VALUES (o_id, c_d_id, c_w_id);"
-""
-" /* PRINTF('Inserted order lines:');"
-" ROW_PRINTF"
-" SELECT * FROM ORDER_LINE WHERE OL_O_ID = o_id AND"
-" OL_D_ID = c_d_id"
-" AND OL_W_ID = c_w_id; */"
-" /* COMMIT WORK; */"
-" END;"
- ;
-
- str5 = ut_str_catenate(str1, str2);
- str6 = ut_str_catenate(str3, str4);
-
- str = ut_str_catenate(str5, str6);
-
- new_order_query = pars_sql(str);
-
- mem_free(str);
- mem_free(str5);
- mem_free(str6);
-
- /*-----------------------------------------------------------*/
-
- str1 =
-
-" PROCEDURE PAYMENT () IS"
-""
-" i INT;"
-" n_items INT;"
-" n_warehouses INT;"
-" n_districts INT;"
-" n_customers INT;"
-" w_id CHAR;"
-" w_street_1 CHAR;"
-" w_street_2 CHAR;"
-" w_city CHAR;"
-" w_state CHAR;"
-" w_zip CHAR;"
-" w_name CHAR;"
-" d_id CHAR;"
-" d_street_1 CHAR;"
-" d_street_2 CHAR;"
-" d_city CHAR;"
-" d_state CHAR;"
-" d_zip CHAR;"
-" d_name CHAR;"
-" c_w_id CHAR;"
-" c_d_id CHAR;"
-" c_street_1 CHAR;"
-" c_street_2 CHAR;"
-" c_city CHAR;"
-" c_state CHAR;"
-" c_zip CHAR;"
-" c_id CHAR;"
-" c_last CHAR;"
-" c_first CHAR;"
-" c_middle CHAR;"
-" c_phone CHAR;"
-" c_credit CHAR;"
-" c_credit_lim INT;"
-" c_discount INT;"
-" c_balance INT;"
-" c_since INT;"
-" c_data CHAR;"
-" byname INT;"
-" namecnt INT;"
-" amount INT;"
-" h_data CHAR;"
-" h_date INT;"
-" c_more_data CHAR;"
-" more_len INT;"
-" data_len INT;"
-""
-" DECLARE CURSOR warehouse_cursor IS"
-" SELECT W_STREET_1, W_STREET_2, W_CITY, W_STATE, W_ZIP, W_NAME"
-" FROM WAREHOUSE"
-" WHERE W_ID = w_id"
-" FOR UPDATE;"
-""
-" DECLARE CURSOR district_cursor IS"
-" SELECT D_STREET_1, D_STREET_2, D_CITY, D_STATE, D_ZIP, D_NAME"
-" FROM DISTRICT"
-" WHERE D_W_ID = w_id AND D_ID = d_id"
-" FOR UPDATE;"
-""
-" DECLARE CURSOR customer_by_name_cursor IS"
-" SELECT C_ID"
-" FROM CUSTOMER"
-" WHERE C_W_ID = c_w_id AND C_D_ID = c_d_id"
-" AND C_LAST = c_last"
-" ORDER BY C_FIRST ASC;"
-""
-" DECLARE CURSOR customer_cursor IS"
-" SELECT C_FIRST, C_MIDDLE, C_LAST, C_STREET_1, C_STREET_2,"
-" C_CITY, C_STATE, C_ZIP, C_PHONE, C_CREDIT,"
-" C_CREDIT_LIM, C_DISCOUNT, C_BALANCE,"
-" C_SINCE"
-" FROM CUSTOMER"
-" WHERE C_W_ID = c_w_id AND C_D_ID = c_d_id"
-" AND C_ID = c_id"
-" FOR UPDATE;"
- ;
-
- str2 =
-
-" BEGIN"
-""
-" n_items := 200;"
-" n_warehouses := 1;"
-" n_districts := 10;"
-" n_customers := 200;"
-""
-" byname := RND(1, 100);"
-" amount := RND(1, 1000);"
-" h_date := SYSDATE();"
-" w_id := TO_BINARY(RND(1, n_warehouses), 2);"
-" d_id := TO_BINARY(47 + RND(1, n_districts), 1);"
-" c_w_id := TO_BINARY(RND(1, n_warehouses), 2);"
-" c_d_id := TO_BINARY(47 + RND(1, n_districts), 1);"
-""
-" OPEN warehouse_cursor;"
-""
-" FETCH warehouse_cursor INTO w_street_1, w_street_2, w_city, w_state,"
-" w_zip, w_name;"
-" UPDATE WAREHOUSE SET W_YTD = W_YTD + amount"
-" WHERE CURRENT OF warehouse_cursor;"
-""
-" CLOSE warehouse_cursor;"
-""
-" OPEN district_cursor;"
-""
-" FETCH district_cursor INTO d_street_1, d_street_2, d_city, d_state,"
-" d_zip, d_name;"
-" UPDATE DISTRICT SET D_YTD = D_YTD + amount"
-" WHERE CURRENT OF district_cursor;"
-""
-" CLOSE district_cursor;"
-""
-" IF (byname <= 60) THEN"
-" c_last := CONCAT('NAME', TO_CHAR(RND(1, n_customers) / 3));"
-""
-" SELECT COUNT(*) INTO namecnt"
-" FROM CUSTOMER"
-" WHERE C_W_ID = c_w_id AND C_D_ID = c_d_id"
-" AND C_LAST = c_last;"
-" /* PRINTF('Payment trx: Customer name ', c_last,"
-" ' namecount ', namecnt); */"
-" OPEN customer_by_name_cursor;"
-""
-" FOR i IN 1 .. (namecnt + 1) / 2 LOOP"
-" FETCH customer_by_name_cursor INTO c_id;"
-" END LOOP;"
-" /* ASSERT(NOT (customer_by_name_cursor % NOTFOUND)); */"
-" "
-" CLOSE customer_by_name_cursor;"
-" ELSE"
-" c_id := TO_BINARY(RND(1, n_customers), 3);"
-" END IF;"
-
- ;
- str3 =
-""
-" /* PRINTF('Payment for customer ', BINARY_TO_NUMBER(c_w_id), ' ',"
-" c_d_id, ' ', BINARY_TO_NUMBER(c_id)); */"
-" OPEN customer_cursor;"
-""
-" FETCH customer_cursor INTO c_first, c_middle, c_last, c_street_1,"
-" c_street_2, c_city, c_state, c_zip,"
-" c_phone, c_credit, c_credit_lim,"
-" c_discount, c_balance, c_since;"
-" c_balance := c_balance - amount;"
-""
-" h_data := CONCAT(w_name, ' ', d_name);"
-" "
-" IF (c_credit = 'BC') THEN"
-" /* PRINTF('Bad customer pays'); */"
-""
-" SELECT C_DATA INTO c_data"
-" FROM CUSTOMER"
-" WHERE C_W_ID = c_w_id AND C_D_ID = c_d_id"
-" AND C_ID = c_id;"
-" c_more_data := CONCAT("
-" ' ', TO_CHAR(BINARY_TO_NUMBER(c_id)),"
-" ' ', c_d_id,"
-" ' ', TO_CHAR(BINARY_TO_NUMBER(c_w_id)),"
-" ' ', d_id,"
-" ' ', TO_CHAR(BINARY_TO_NUMBER(w_id)),"
-" TO_CHAR(amount),"
-" TO_CHAR(h_date),"
-" ' ', h_data);"
-""
-" more_len := LENGTH(c_more_data);"
-" data_len := LENGTH(c_data);"
-" "
-" IF (more_len + data_len > 500) THEN"
-" data_len := 500 - more_len;"
-" END IF;"
-" "
-" c_data := CONCAT(c_more_data, SUBSTR(c_data, 0, data_len));"
-" "
-" UPDATE CUSTOMER SET C_BALANCE = c_balance,"
-" C_PAYMENT_CNT = C_PAYMENT_CNT + 1,"
-" C_YTD_PAYMENT = C_YTD_PAYMENT + amount,"
-" C_DATA = c_data"
-" WHERE CURRENT OF customer_cursor;"
-" ELSE"
-" UPDATE CUSTOMER SET C_BALANCE = c_balance,"
-" C_PAYMENT_CNT = C_PAYMENT_CNT + 1,"
-" C_YTD_PAYMENT = C_YTD_PAYMENT + amount"
-" WHERE CURRENT OF customer_cursor;"
-" END IF;"
-""
-" CLOSE customer_cursor;"
-" "
-" INSERT INTO HISTORY VALUES (c_d_id, c_w_id, c_id, d_id, w_id,"
-" h_date, amount, h_data);"
-" /* COMMIT WORK; */"
-""
-" END;"
-
- ;
-
- str4 = ut_str_catenate(str1, str2);
- str = ut_str_catenate(str4, str3);
-
- payment_query = pars_sql(str);
-
- mem_free(str);
- mem_free(str4);
-
- /*-----------------------------------------------------------*/
-
- str1 =
-
-" PROCEDURE ORDER_STATUS () IS"
-""
-" i INT;"
-" n_items INT;"
-" n_warehouses INT;"
-" n_districts INT;"
-" n_customers INT;"
-" d_id CHAR;"
-" namecnt INT;"
-" c_w_id CHAR;"
-" c_d_id CHAR;"
-" c_id CHAR;"
-" c_last CHAR;"
-" c_first CHAR;"
-" c_middle CHAR;"
-" c_balance INT;"
-" byname INT;"
-" o_id INT;"
-" o_carrier_id CHAR;"
-" o_entry_d INT;"
-" ol_i_id CHAR;"
-" ol_supply_w_id CHAR;"
-" ol_quantity INT;"
-" ol_amount INT;"
-" ol_delivery_d INT;"
-""
-" DECLARE CURSOR orders_cursor IS"
-" SELECT O_ID, O_CARRIER_ID, O_ENTRY_D"
-" FROM ORDERS"
-" WHERE O_W_ID = c_w_id AND O_D_ID = c_d_id"
-" AND O_C_ID = c_id"
-" ORDER BY O_ID DESC;"
-""
-" DECLARE CURSOR order_line_cursor IS"
-" SELECT OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT,"
-" OL_DELIVERY_D"
-" FROM ORDER_LINE"
-" WHERE OL_W_ID = c_w_id AND OL_D_ID = c_d_id"
-" AND OL_O_ID = o_id;"
-" DECLARE CURSOR customer_by_name_cursor IS"
-" SELECT C_ID"
-" FROM CUSTOMER"
-" WHERE C_W_ID = c_w_id AND C_D_ID = c_d_id"
-" AND C_LAST = c_last"
-" ORDER BY C_FIRST ASC;"
-" BEGIN"
-""
-" n_items := 200;"
-" n_warehouses := 1;"
-" n_districts := 10;"
-" n_customers := 200;"
-""
-" c_w_id := TO_BINARY(RND(1, n_warehouses), 2);"
-" byname := RND(1, 100);"
-""
- ;
-
- str2 =
-
-" IF (byname <= 60) THEN"
-" d_id := TO_BINARY(47 + RND(1, n_districts), 1); "
-""
-" c_d_id := d_id;"
-""
-" c_last := CONCAT('NAME', TO_CHAR(RND(1, n_customers) / 3));"
-""
-" SELECT COUNT(*) INTO namecnt"
-" FROM CUSTOMER"
-" WHERE C_W_ID = c_w_id AND C_D_ID = c_d_id"
-" AND C_LAST = c_last;"
-" OPEN customer_by_name_cursor;"
-""
-" /* PRINTF('Order status trx: Customer name ', c_last,"
-" ' namecount ', namecnt); */"
-" FOR i IN 1 .. (namecnt + 1) / 2 LOOP"
-" FETCH customer_by_name_cursor INTO c_id;"
-" END LOOP;"
-" /* ASSERT(NOT (customer_by_name_cursor % NOTFOUND)); */"
-""
-" CLOSE customer_by_name_cursor;"
-" ELSE"
-" c_d_id := TO_BINARY(47 + RND(1, n_districts), 1);"
-" c_id := TO_BINARY(RND(1, n_customers), 3);"
-" END IF;"
-""
-" SELECT C_BALANCE, C_FIRST, C_MIDDLE, C_LAST INTO c_balance, c_first,"
-" c_middle, c_last"
-" FROM CUSTOMER"
-" WHERE C_W_ID = c_w_id AND C_D_ID = c_d_id AND C_ID = c_id;"
-""
-" OPEN orders_cursor;"
-""
-" FETCH orders_cursor INTO o_id, o_carrier_id, o_entry_d;"
-""
-" IF (orders_cursor % NOTFOUND) THEN"
-" PRINTF('Order status trx: customer has no order');"
-" CLOSE orders_cursor;"
-""
-" /* COMMIT WORK; */"
-""
-" RETURN;"
-" END IF;"
-""
-" CLOSE orders_cursor;"
-""
-" OPEN order_line_cursor;"
-""
-" FOR i IN 0 .. 15 LOOP"
-" FETCH order_line_cursor INTO ol_i_id, ol_supply_w_id,"
-" ol_quantity, ol_amount,"
-" ol_delivery_d;"
-""
-" IF (order_line_cursor % NOTFOUND) THEN"
-" CLOSE order_line_cursor;"
-""
-" /* COMMIT WORK; */"
-""
-" RETURN;"
-" END IF;"
-" END LOOP;"
-" ASSERT(0 = 1);"
-" "
-" END;"
- ;
-
- str = ut_str_catenate(str1, str2);
-
- order_status_query = pars_sql(str);
-
- mem_free(str);
-
- /*-----------------------------------------------------------*/
-
- str1 =
-
-" PROCEDURE DELIVERY () IS"
-""
-" i INT;"
-" n_items INT;"
-" n_warehouses INT;"
-" n_districts INT;"
-" n_customers INT;"
-" d_id CHAR;"
-" w_id CHAR;"
-" c_id CHAR;"
-" o_id INT;"
-" o_carrier_id INT;"
-" ol_delivery_d INT;"
-" ol_total INT;"
-""
-" DECLARE CURSOR new_order_cursor IS"
-" SELECT NO_O_ID"
-" FROM NEW_ORDER"
-" WHERE NO_W_ID = w_id AND NO_D_ID = d_id"
-" ORDER BY NO_O_ID ASC;"
-""
-" DECLARE CURSOR orders_cursor IS"
-" SELECT O_C_ID"
-" FROM ORDERS"
-" WHERE O_W_ID = w_id AND O_D_ID = d_id"
-" AND O_ID = o_id"
-" FOR UPDATE;"
-" BEGIN"
-""
-" n_items := 200;"
-" n_warehouses := 1;"
-" n_districts := 10;"
-" n_customers := 200;"
-""
-" w_id := TO_BINARY(RND(1, n_warehouses), 2);"
-" o_carrier_id := RND(1, 10);"
-" ol_delivery_d := SYSDATE();"
-
- ;
-
- str2 =
-
-" FOR i IN 1 .. n_districts LOOP"
-""
-" d_id := TO_BINARY(47 + i, 1);"
-""
-" OPEN new_order_cursor;"
-""
-" FETCH new_order_cursor INTO o_id;"
-""
-" IF (new_order_cursor % NOTFOUND) THEN"
-" /* PRINTF('No order to deliver'); */"
-""
-" CLOSE new_order_cursor;"
-" ELSE"
-" CLOSE new_order_cursor;"
-" /* PRINTF('Order to deliver'); */"
-""
-" DELETE FROM NEW_ORDER"
-" WHERE NO_W_ID = w_id AND NO_D_ID = d_id"
-" AND NO_O_ID = o_id;"
-" OPEN orders_cursor;"
-""
-" FETCH orders_cursor INTO c_id;"
-""
-" UPDATE ORDERS SET O_CARRIER_ID = o_carrier_id"
-" WHERE CURRENT OF orders_cursor;"
-""
-" CLOSE orders_cursor;"
-""
-" UPDATE ORDER_LINE SET OL_DELIVERY_D = ol_delivery_d"
-" WHERE OL_W_ID = w_id AND OL_D_ID = d_id"
-" AND OL_O_ID = o_id;"
-""
-" SELECT SUM(OL_AMOUNT) INTO ol_total"
-" FROM ORDER_LINE"
-" WHERE OL_W_ID = w_id AND OL_D_ID = d_id"
-" AND OL_O_ID = o_id;"
-""
-" UPDATE CUSTOMER SET C_BALANCE = C_BALANCE - ol_total"
-" WHERE C_W_ID = w_id AND C_D_ID = d_id"
-" AND C_ID = c_id;"
-" END IF;"
-" END LOOP;"
-""
-" /* COMMIT WORK; */"
-" "
-" END;"
- ;
-
- str = ut_str_catenate(str1, str2);
-
- delivery_query = pars_sql(str);
-
- mem_free(str);
-
- /*-----------------------------------------------------------*/
-
- /* NOTE: COUNT(DISTINCT ...) not implemented yet */
-
- str =
-
-" PROCEDURE STOCK_LEVEL () IS"
-""
-" n_items INT;"
-" n_warehouses INT;"
-" n_districts INT;"
-" n_customers INT;"
-" d_id CHAR;"
-" w_id CHAR;"
-" o_id INT;"
-" stock_count INT;"
-" threshold INT;"
-""
-" BEGIN"
-""
-" n_items := 200;"
-" n_warehouses := 1;"
-" n_districts := 10;"
-" n_customers := 200;"
-""
-" w_id := TO_BINARY(RND(1, n_warehouses), 2);"
-" d_id := TO_BINARY(47 + 4, 1);"
-""
-" threshold := RND(10, 20);"
-""
-" SELECT D_NEXT_O_ID INTO o_id"
-" FROM DISTRICT"
-" WHERE D_W_ID = w_id AND D_ID = d_id;"
-""
-" SELECT COUNT(*) INTO stock_count"
-" FROM ORDER_LINE, STOCK"
-" WHERE OL_W_ID = w_id AND OL_D_ID = d_id"
-" AND OL_O_ID >= o_id - 20 AND OL_O_ID < o_id"
-" AND S_W_ID = w_id AND S_I_ID = OL_I_ID"
-" AND S_QUANTITY < threshold;"
-" /* PRINTF(stock_count, ' items under threshold ', threshold); */"
-" /* COMMIT WORK; */"
-""
-" END;"
- ;
-
- stock_level_query = pars_sql(str);
- /*-----------------------------------------------------------*/
-
- oldtm = ut_clock();
-
- for (i = 0; i < 10; i++) {
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(new_order_query,
- SESS_COMM_EXECUTE, 0);
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(payment_query,
- SESS_COMM_EXECUTE, 0);
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- if (i % 10 == 3) {
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(order_status_query,
- SESS_COMM_EXECUTE, 0);
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- if ((i % 10 == 6) || (i % 100 == 60)) {
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(delivery_query,
- SESS_COMM_EXECUTE, 0);
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- if (i % 10 == 9) {
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(stock_level_query,
- SESS_COMM_EXECUTE, 0);
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- if ((i > 0) && (i % 200 == 0)) {
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(commit_query,
- SESS_COMM_EXECUTE, 0);
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
- }
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
-
- return(0);
-}
-
-#ifdef notdefined
-
-/*********************************************************************
-General test. */
-
-ulint
-test1(
-/*==*/
- void* arg)
-{
- sess_t* sess;
- sess_t* sess2;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* query;
- que_thr_t* thr;
- trx_t* trx;
- trx_t* trx2;
- ulint tm, oldtm;
- ulint j;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1. GENERAL TEST\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
- sess2 = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user2", 6);
-
- trx = sess->trx;
- trx2 = sess2->trx;
-
- mutex_exit(&kernel_mutex);
-
- /*------------------------------------------------------*/
- query = pars_sql(
-" PROCEDURE CREATE_TABLE () IS"
-" BEGIN"
-" CREATE TABLE TS_TABLE1 (COL1 CHAR, COL2 CHAR, COL3 CHAR);"
-" CREATE TABLE TS_TABLE2 (COL21 INT, COL22 INT, COL23 CHAR);"
-" CREATE TABLE TS_TABLE3 (COL31 INT, COL32 INT, COL33 CHAR);"
-" CREATE TABLE TS_TABLE4 (COL41 INT, COL42 INT, COL43 CHAR);"
-" CREATE UNIQUE CLUSTERED INDEX IND1 ON TS_TABLE1 (COL1);"
-" CREATE UNIQUE CLUSTERED INDEX IND21 ON TS_TABLE2 (COL21);"
-" CREATE UNIQUE CLUSTERED INDEX IND31 ON TS_TABLE3 (COL31);"
-" CREATE CLUSTERED INDEX IND41 ON TS_TABLE4 (COL41);"
-" END;"
- );
-
- query->trx = trx;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- /*------------------------------------------------------*/
- /*------------------------------------------------------*/
-
- printf("Will start insert test\n");
-
- query = pars_sql(
-
-" PROCEDURE INSERT_SPEED_TEST () IS"
-" int1 INT;"
-" int2 INT;"
-" "
-" BEGIN"
-" int2 := 0;"
-" int1 := 0;"
-" WHILE int1 < 40 LOOP"
-" INSERT INTO TS_TABLE2 VALUES (int1, int1 - 100 * (int1 / 100),"
-" '123456789012345678901234567890');"
-" int1 := int1 + 1;"
-" "
-" END LOOP;"
-" "
-" END;"
- );
-
- query->trx = trx;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for insert test %lu milliseconds\n", tm - oldtm);
-
-
- /*------------------------------------------------------*/
- /*------------------------------------------------------*/
-
- query = pars_sql(
-
-" PROCEDURE COMMIT_SPEED_TEST () IS"
-" "
-" BEGIN"
-" COMMIT WORK;"
-" END;"
- );
-
- query->trx = trx;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE2"); */
- /*------------------------------------------------------*/
- /*------------------------------------------------------*/
- printf("Will start insert test2\n");
-
- query = pars_sql(
-
-" PROCEDURE INSERT_SPEED_TEST2 () IS"
-" int1 INT;"
-" int2 INT;"
-" "
-" BEGIN"
-" INSERT INTO TS_TABLE3 SELECT * FROM TS_TABLE2;"
-" "
-" "
-" END;"
- );
-
- query->trx = trx;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for insert test2 %lu milliseconds\n", tm - oldtm);
-
- /*------------------------------------------------------*/
-
- query = pars_sql(
-
-" PROCEDURE COMMIT_SPEED_TEST () IS"
-" "
-" BEGIN"
-" COMMIT WORK;"
-" END;"
- );
-
- query->trx = trx;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE2"); */
- /*------------------------------------------------------*/
- /*------------------------------------------------------*/
-/* os_thread_sleep(1000000); */
-
-/* btr_search_table_print_info("TS_TABLE3"); */
-
- query = pars_sql(
-
-" PROCEDURE JOIN_SPEED_TEST () IS"
-" int1 INT;"
-" "
-" BEGIN"
-" SELECT COUNT(*) INTO int1"
-" FROM TS_TABLE2, TS_TABLE3"
-" WHERE COL21 = COL31"
-" CONSISTENT READ;"
-" PRINTF(int1);"
-" END;"
- );
-
- query->trx = trx;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- for (j = 0; j < 20; j++) {
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE,
- 0));
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
-
- printf("Wall time for join test %lu milliseconds\n",
- tm - oldtm);
- }
-
-/* btr_search_table_print_info("TS_TABLE3"); */
-
- /*------------------------------------------------------*/
- printf("Will start update test\n");
-
- os_thread_sleep(2000000);
-
- query = pars_sql(
-
-" PROCEDURE UPDATE_SPEED_TEST () IS"
-" int1 INT;"
-" BEGIN"
-" UPDATE TS_TABLE2 SET COL22 = COL22 + 1;"
-" END;"
- );
-
- query->trx = trx;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for update test %lu milliseconds\n", tm - oldtm);
-
- /*------------------------------------------------------*/
- /*------------------------------------------------------*/
-
- query = pars_sql(
-
-" PROCEDURE COMMIT_SPEED_TEST () IS"
-" "
-" BEGIN"
-" COMMIT WORK;"
-" END;"
- );
-
- query->trx = trx;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE2"); */
- /*------------------------------------------------------*/
- /*------------------------------------------------------*/
- printf("Will start TPC-A\n");
- os_thread_sleep(2000000);
-
- query = pars_sql(
-" PROCEDURE TPC_A_SPEED_TEST () IS"
-" int1 INT;"
-" "
-" BEGIN"
-" int1 := 0;"
-" WHILE int1 < 1000 LOOP"
-" INSERT INTO TS_TABLE4 VALUES (int1, int1,"
-" '123456789012345678901234567890');"
-" UPDATE TS_TABLE2 SET COL22 = COL22 + 1"
-" WHERE COL21 = int1;"
-" UPDATE TS_TABLE2 SET COL22 = COL22 + 1"
-" WHERE COL21 = int1 + 1;"
-" UPDATE TS_TABLE2 SET COL22 = COL22 + 1"
-" WHERE COL21 = int1 + 2;"
-" int1 := int1 + 1;"
-" END LOOP;"
-" "
-" END;"
- );
-
-/*" SELECT COUNT(*) INTO int1 FROM TS_TABLE2 WHERE COL22 = COL21 + 4;"
-" PRINTF(int1);"
-" SELECT COUNT(*) INTO int1 FROM TS_TABLE4;"
-" PRINTF(int1);"
-*/
- query->trx = trx;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for TPC-A test %lu milliseconds\n", tm - oldtm);
-
- /*------------------------------------------------------*/
-
- query = pars_sql(
-
-" PROCEDURE COMMIT_SPEED_TEST () IS"
-" "
-" BEGIN"
-" COMMIT WORK;"
-" END;"
- );
-
- query->trx = trx;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- /*------------------------------------------------------*/
- printf("Will start insert test\n");
-
- os_thread_sleep(2000000);
-
- query = pars_sql(
-
-" PROCEDURE INSERT_SPEED_TEST () IS"
-" int1 INT;"
-" int2 INT;"
-" "
-" BEGIN"
-" int2 := 0;"
-" int1 := 0;"
-" WHILE int1 < 1000 LOOP"
-" INSERT INTO TS_TABLE2 VALUES (int1, int1,"
-" '123456789012345678901234567890');"
-" int1 := int1 + 1;"
-" "
-" END LOOP;"
-" SELECT COUNT(*) INTO int2"
-" FROM TS_TABLE2;"
-" ASSERT(int1 = int2);"
-" "
-" COMMIT WORK;"
-" "
-" END;"
- );
-
- query->trx = trx;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for insert test %lu milliseconds\n", tm - oldtm);
-
- /*------------------------------------------------------*/
- /*------------------------------------------------------*/
-
- query = pars_sql(
-
-" PROCEDURE DELETE_SPEED_TEST () IS"
-" int1 INT;"
-" int2 INT;"
-" "
-" BEGIN"
-" SELECT COUNT(*), SUM(COL22) INTO int1, int2"
-" FROM TS_TABLE2"
-" CONSISTENT READ;"
-" ASSERT(int1 = 1000);"
-" ASSERT(int2 = 999 * 500);"
-" DELETE FROM TS_TABLE2;"
-" "
-" SELECT COUNT(*), SUM(COL22) INTO int1, int2"
-" FROM TS_TABLE2"
-" CONSISTENT READ;"
-" ASSERT(int1 = 0);"
-" ASSERT(int2 = 0);"
-" "
-" END;"
- );
-
- query->trx = trx;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for delete test %lu milliseconds\n", tm - oldtm);
- /*------------------------------------------------------*/
- /*------------------------------------------------------*/
- os_thread_sleep(2000000);
-
- query = pars_sql(
-
-" PROCEDURE CONSISTENT_READ_TEST () IS"
-" int1 INT;"
-" int2 INT;"
-" "
-" BEGIN"
-" SELECT COUNT(*), SUM(COL22) INTO int1, int2"
-" FROM TS_TABLE2"
-" CONSISTENT READ;"
-" ASSERT(int2 = 999 * 500);"
-" ASSERT(int1 = 1000);"
-" "
-" "
-" END;"
- );
-
- query->trx = trx2;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for consistent read test %lu milliseconds\n",
- tm - oldtm);
- /*------------------------------------------------------*/
-
- query = pars_sql(
-
-" PROCEDURE ROLLBACK_SPEED_TEST () IS"
-" "
-" BEGIN"
-" ROLLBACK WORK;"
-" END;"
- );
-
- query->trx = trx;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback %lu milliseconds\n", tm - oldtm);
-
- /*------------------------------------------------------*/
-
- query = pars_sql(
-
-" PROCEDURE UPDATE_SPEED_TEST () IS"
-" int1 INT;"
-" int2 INT;"
-" "
-" BEGIN"
-" UPDATE TS_TABLE2 SET COL21 = COL21 + 1000, COL22 = COL22 + 1"
-" WHERE COL21 < 1000;"
-" UPDATE TS_TABLE2 SET COL21 = COL21, COL22 = COL22;"
-" UPDATE TS_TABLE2 SET COL21 = COL21, COL22 = COL22;"
-" UPDATE TS_TABLE2 SET COL21 = COL21, COL22 = COL22;"
-" UPDATE TS_TABLE2 SET COL21 = COL21, COL22 = COL22;"
-" UPDATE TS_TABLE2 SET COL21 = COL21, COL22 = COL22;"
-" UPDATE TS_TABLE2 SET COL21 = COL21, COL22 = COL22;"
-" UPDATE TS_TABLE2 SET COL21 = COL21, COL22 = COL22;"
-" UPDATE TS_TABLE2 SET COL21 = COL21, COL22 = COL22;"
-" "
-" SELECT SUM(COL21), SUM(COL22) INTO int1, int2"
-" FROM TS_TABLE2"
-" CONSISTENT READ;"
-" ASSERT(int2 = 1000 + 999 * 500);"
-" ASSERT(int1 = 1000000 + 999 * 500);"
-" UPDATE TS_TABLE2 SET COL21 = COL21 + 1000, COL22 = COL22 + 1"
-" WHERE COL21 < 2000;"
-" UPDATE TS_TABLE2 SET COL21 = COL21 + 1000, COL22 = COL22 + 1"
-" WHERE COL21 < 3000;"
-" COMMIT WORK;"
-" END;"
- );
-
- query->trx = trx;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for update test %lu milliseconds\n", tm - oldtm);
- /*------------------------------------------------------*/
- /*------------------------------------------------------*/
- os_thread_sleep(2000000);
-
- query = pars_sql(
-
-" PROCEDURE CONSISTENT_READ_TEST () IS"
-" int1 INT;"
-" int2 INT;"
-" "
-" BEGIN"
-" SELECT COUNT(*), SUM(COL22) INTO int1, int2"
-" FROM TS_TABLE2"
-" CONSISTENT READ;"
-" ASSERT(int1 = 1000);"
-" ASSERT(int2 = 999 * 500);"
-" "
-" "
-" END;"
- );
-
- query->trx = trx2;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for consistent read test %lu milliseconds\n",
- tm - oldtm);
- /*------------------------------------------------------*/
- /*------------------------------------------------------*/
-
- query = pars_sql(
-
-" PROCEDURE COMMIT_SPEED_TEST () IS"
-" "
-" BEGIN"
-" COMMIT WORK;"
-" END;"
- );
-
- query->trx = trx;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE2"); */
- /*------------------------------------------------------*/
- /*------------------------------------------------------*/
- os_thread_sleep(2000000);
-
- query = pars_sql(
-
-" PROCEDURE CONSISTENT_READ_TEST () IS"
-" int1 INT;"
-" int2 INT;"
-" "
-" BEGIN"
-" SELECT COUNT(*), SUM(COL22) INTO int1, int2"
-" FROM TS_TABLE2"
-" CONSISTENT READ;"
-" ASSERT(int1 = 1000);"
-" ASSERT(int2 = 999 * 500);"
-" "
-" "
-" END;"
- );
-
- query->trx = trx2;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for consistent read test %lu milliseconds\n",
- tm - oldtm);
- /*------------------------------------------------------*/
- printf("Will start insert test2\n");
- os_thread_sleep(2000000);
-
- query = pars_sql(
-
-" PROCEDURE INSERT_SPEED_TEST2 () IS"
-" int1 INT;"
-" int2 INT;"
-" "
-" BEGIN"
-" INSERT INTO TS_TABLE3 SELECT * FROM TS_TABLE2;"
-" "
-" SELECT COUNT(*) INTO int1"
-" FROM TS_TABLE2;"
-" SELECT COUNT(*) INTO int2"
-" FROM TS_TABLE3;"
-" ASSERT(int1 = int2);"
-" "
-" COMMIT WORK;"
-" "
-" END;"
- );
-
- query->trx = trx;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for insert test2 %lu milliseconds\n", tm - oldtm);
-
-/* sync_print(); */
-
- /*------------------------------------------------------*/
-
- query = pars_sql(
-
-" PROCEDURE COMMIT_SPEED_TEST () IS"
-" "
-" BEGIN"
-" COMMIT WORK;"
-" END;"
- );
-
- query->trx = trx;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- /*------------------------------------------------------*/
-
- query = pars_sql(
-
-" PROCEDURE JOIN_SPEED_TEST () IS"
-" int1 INT;"
-" "
-" BEGIN"
-" SELECT COUNT(*) INTO int1"
-" FROM TS_TABLE2, TS_TABLE3"
-" WHERE COL21 = COL31;"
-" ASSERT(int1 = 1000);"
-" "
-" COMMIT WORK;"
-" "
-" END;"
- );
-
- query->trx = trx;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for join test %lu milliseconds\n", tm - oldtm);
-
- /*------------------------------------------------------*/
-
- dict_table_print_by_name("TS_TABLE1");
- dict_table_print_by_name("TS_TABLE2");
-
-/*
- dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS");
- dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS");
-*/
- query = pars_sql(
-
-" PROCEDURE INSERT_TEST () IS"
-" var1 CHAR;"
-" var2 CHAR;"
-" int1 INT;"
-" int2 INT;"
-" sum1 INT;"
-" finished INT;"
-" rnd_var1 INT;"
-" rnd_var2 INT;"
-" "
-" DECLARE CURSOR cursor2"
-" IS SELECT COL21, COL22"
-" FROM TS_TABLE2"
-" WHERE COL21 > 5;"
-" "
-" BEGIN"
-" int1 := 0;"
-" WHILE int1 < 10 LOOP"
-" rnd_var1 := int1;"
-" PRINTF('Round '); PRINTF(int1);"
-" INSERT INTO TS_TABLE2 VALUES (int1, rnd_var1,"
-" '123456789012345678901234567890');"
-" SELECT COL22 INTO rnd_var2 FROM TS_TABLE2"
-" WHERE COL21 = int1;"
-" ASSERT(rnd_var1 = rnd_var2);"
-" int1 := int1 + 1;"
-" END LOOP;"
-" "
-" PRINTF('First explicit cursor loop:');"
-" OPEN cursor2;"
-" finished := 0;"
-" "
-" WHILE finished = 0 LOOP"
-" FETCH cursor2 INTO int1, int2;"
-" IF cursor2 % NOTFOUND THEN"
-" finished := 1;"
-" PRINTF('Loop now finished');"
-" ELSE"
-" PRINTF('Row fetched, values:');"
-" PRINTF(int1); PRINTF(int2);"
-" ASSERT(int1 = int2);"
-" UPDATE TS_TABLE2 SET COL22 = COL22 + 100"
-" WHERE CURRENT OF cursor2;"
-" END IF;"
-" END LOOP;"
-" CLOSE cursor2;"
-" "
-" PRINTF('Second explicit cursor loop:');"
-" OPEN cursor2;"
-" finished := 0;"
-" "
-" WHILE finished = 0 LOOP"
-" FETCH cursor2 INTO int1, int2;"
-" IF cursor2 % NOTFOUND THEN"
-" finished := 1;"
-" ELSE"
-" PRINTF('Row fetched, values:');"
-" PRINTF(int1); PRINTF(int2);"
-" ASSERT(int1 + 100 = int2);"
-" UPDATE TS_TABLE2 SET COL22 = int2 + 100"
-" WHERE CURRENT OF cursor2;"
-" END IF;"
-" END LOOP;"
-" CLOSE cursor2;"
-" "
-" SELECT COUNT(*), SUM(COL22) INTO int1, sum1"
-" FROM TS_TABLE2;"
-" PRINTF('Now table 2 has this many rows: '); PRINTF(int1);"
-" PRINTF('and the sum of COL22: '); PRINTF(sum1);"
-" "
-" INSERT INTO TS_TABLE3"
-" SELECT COL21, COL22 + 10, COL23 FROM TS_TABLE2;"
-" "
-" SELECT COUNT(*), SUM(COL32) INTO int1, sum1"
-" FROM TS_TABLE2, TS_TABLE3"
-" WHERE COL21 + 2 = COL31;"
-" PRINTF('Join table has this many rows: '); PRINTF(int1);"
-" PRINTF('and the sum of COL32: '); PRINTF(sum1);"
-" "
-" ROLLBACK WORK;"
-" "
-" SELECT COUNT(*), SUM(COL21) INTO int1, sum1 FROM TS_TABLE2;"
-" PRINTF('Now table 2 has this many rows: '); PRINTF(int1);"
-" PRINTF('and the sum of COL21: '); PRINTF(sum1);"
-" "
-" "
-" END;"
- );
-
- query->trx = trx;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- dict_table_print_by_name("TS_TABLE1");
- dict_table_print_by_name("TS_TABLE2");
-
- query = pars_sql(
-
-" PROCEDURE DELETE_TEST () IS"
-" int1 INT;"
-" sum1 INT;"
-" finished INT;"
-" "
-" DECLARE CURSOR cursor2"
-" IS SELECT"
-" FROM TS_TABLE2"
-" WHERE COL21 < 10;"
-" "
-" BEGIN"
-" int1 := 0;"
-" WHILE int1 < 10 LOOP"
-" PRINTF('Round '); PRINTF(int1);"
-" INSERT INTO TS_TABLE2 VALUES (int1, int1, TO_CHAR(int1));"
-" int1 := int1 + 1;"
-" END LOOP;"
-" COMMIT WORK;"
-" PRINTF('Delete all the rows:');"
-" OPEN cursor2;"
-" finished := 0;"
-" "
-" WHILE finished = 0 LOOP"
-" FETCH cursor2 INTO;"
-" IF cursor2 % NOTFOUND THEN"
-" finished := 1;"
-" PRINTF('Loop now finished: all rows deleted');"
-" ELSE"
-" DELETE FROM TS_TABLE2"
-" WHERE CURRENT OF cursor2;"
-" END IF;"
-" END LOOP;"
-" CLOSE cursor2;"
-" "
-" SELECT COUNT(*), SUM(COL22) INTO int1, sum1"
-" FROM TS_TABLE2;"
-" PRINTF('Now table 2 has this many rows, and their sum is: ');"
-" PRINTF(int1); PRINTF(sum1);"
-" ASSERT((int1 = 0) AND (sum1 = 0));"
-" "
-" ROLLBACK WORK;"
-" "
-" SELECT COUNT(*), SUM(COL22) INTO int1, sum1"
-" FROM TS_TABLE2;"
-" "
-" PRINTF(int1); PRINTF(sum1);"
-" ASSERT((int1 = 10) AND (sum1 = 45));"
-" COMMIT WORK;"
-" DELETE FROM TS_TABLE2 WHERE COL22 = 5;"
-" SELECT COUNT(*), SUM(COL22) INTO int1, sum1"
-" FROM TS_TABLE2;"
-" PRINTF(int1); PRINTF(sum1);"
-" ASSERT((int1 = 9) AND (sum1 = 40));"
-" DELETE FROM TS_TABLE2 WHERE COL23 = TO_CHAR(6);"
-" SELECT COUNT(*), SUM(COL22) INTO int1, sum1"
-" FROM TS_TABLE2;"
-" PRINTF(int1);"
-" PRINTF(sum1);"
-" ASSERT((int1 = 8) AND (sum1 = 34));"
-" DELETE FROM TS_TABLE2 WHERE COL23 = TO_CHAR(6);"
-" SELECT COUNT(*), SUM(COL22) INTO int1, sum1"
-" FROM TS_TABLE2;"
-" PRINTF(int1);"
-" PRINTF(sum1);"
-" ASSERT((int1 = 8) AND (sum1 = 34));"
-" COMMIT WORK;"
-" END;"
- );
-
- query->trx = trx;
-
- thr = UT_LIST_GET_FIRST(query->thrs);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(query, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- return(0);
-}
-
-#endif
-
-/********************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
-
- oldtm = ut_clock();
-
- test_c(NULL);
-
- tm = ut_clock();
-
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
-
diff --git a/innobase/btr/ts/tsbtr97.c b/innobase/btr/ts/tsbtr97.c
deleted file mode 100644
index 633fb7f22ae..00000000000
--- a/innobase/btr/ts/tsbtr97.c
+++ /dev/null
@@ -1,5080 +0,0 @@
-/************************************************************************
-Test for the B-tree
-
-(c) 1996-1997 Innobase Oy
-
-Created 2/16/1996 Heikki Tuuri
-*************************************************************************/
-
-#include "os0proc.h"
-#include "sync0sync.h"
-#include "ut0mem.h"
-#include "mem0mem.h"
-#include "mem0pool.h"
-#include "data0data.h"
-#include "data0type.h"
-#include "dict0dict.h"
-#include "buf0buf.h"
-#include "buf0flu.h"
-#include "os0file.h"
-#include "os0thread.h"
-#include "fil0fil.h"
-#include "fsp0fsp.h"
-#include "rem0rec.h"
-#include "rem0cmp.h"
-#include "mtr0mtr.h"
-#include "log0log.h"
-#include "log0recv.h"
-#include "page0page.h"
-#include "page0cur.h"
-#include "trx0trx.h"
-#include "dict0boot.h"
-#include "trx0sys.h"
-#include "dict0crea.h"
-#include "btr0btr.h"
-#include "btr0pcur.h"
-#include "btr0cur.h"
-#include "btr0sea.h"
-#include "rem0rec.h"
-#include "srv0srv.h"
-#include "que0que.h"
-#include "com0com.h"
-#include "usr0sess.h"
-#include "lock0lock.h"
-#include "trx0roll.h"
-#include "trx0purge.h"
-#include "row0ins.h"
-#include "row0upd.h"
-#include "row0row.h"
-#include "row0del.h"
-#include "lock0lock.h"
-#include "ibuf0ibuf.h"
-
-os_file_t files[1000];
-
-mutex_t ios_mutex;
-ulint ios;
-ulint n[10];
-
-mutex_t incs_mutex;
-ulint incs;
-
-byte bigbuf[1000000];
-
-#define N_SPACES 2
-#define N_FILES 1
-#define FILE_SIZE 512 /* must be > 512 */
-#define POOL_SIZE 500
-#define COUNTER_OFFSET 1500
-
-#define N_LOG_GROUPS 2
-#define N_LOG_FILES 3
-#define LOG_FILE_SIZE 500
-
-#define LOOP_SIZE 150
-#define N_THREADS 5
-
-#define COUNT 1
-
-ulint zero = 0;
-
-buf_block_t* bl_arr[POOL_SIZE];
-
-ulint dummy = 0;
-
-byte rnd_buf[256 * 256];
-
-/************************************************************************
-Io-handler thread function. */
-
-ulint
-handler_thread(
-/*===========*/
- void* arg)
-{
- ulint segment;
- ulint i;
-
- segment = *((ulint*)arg);
-
- printf("Io handler thread %lu starts\n", segment);
-
- for (i = 0;; i++) {
- fil_aio_wait(segment);
-
- mutex_enter(&ios_mutex);
- ios++;
- mutex_exit(&ios_mutex);
-
- }
-
- return(0);
-}
-
-/*************************************************************************
-Creates or opens the log files. */
-
-void
-create_log_files(void)
-/*==================*/
-{
- bool ret;
- ulint i, k;
- char name[20];
-
- printf("--------------------------------------------------------\n");
- printf("Create or open log files\n");
-
- strcpy(name, "logfile00");
-
- for (k = 0; k < N_LOG_GROUPS; k++) {
- for (i = 0; i < N_LOG_FILES; i++) {
-
- name[6] = (char)((ulint)'0' + k);
- name[7] = (char)((ulint)'0' + i);
-
- files[i] = os_file_create(name, OS_FILE_CREATE, OS_FILE_AIO,
- &ret);
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(
- name, OS_FILE_OPEN, OS_FILE_AIO, &ret);
- ut_a(ret);
- } else {
- ut_a(os_file_set_size(files[i],
- 8192 * LOG_FILE_SIZE, 0));
- }
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create(name, k + 100, FIL_LOG);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, LOG_FILE_SIZE, k + 100);
- }
-
- fil_space_create(name, k + 200, FIL_LOG);
-
- log_group_init(k, N_LOG_FILES, LOG_FILE_SIZE * UNIV_PAGE_SIZE,
- k + 100, k + 200);
- }
-}
-
-/*************************************************************************
-Creates the files for the file system test and inserts them to the file
-system. */
-
-void
-create_files(void)
-/*==============*/
-{
- bool ret;
- ulint i, k, j, c;
- char name[20];
- os_thread_t thr[10];
- os_thread_id_t id[10];
-
- printf("--------------------------------------------------------\n");
- printf("Create or open database files\n");
-
- strcpy(name, "tsfile00");
-
- for (k = 0; k < 2 * N_SPACES; k += 2) {
- for (i = 0; i < N_FILES; i++) {
-
- name[6] = (char)((ulint)'0' + k);
- name[7] = (char)((ulint)'0' + i);
-
- files[i] = os_file_create(name, OS_FILE_CREATE,
- OS_FILE_NORMAL, &ret);
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(
- name, OS_FILE_OPEN, OS_FILE_NORMAL, &ret);
- ut_a(ret);
- } else {
- ut_a(os_file_set_size(files[i],
- UNIV_PAGE_SIZE * FILE_SIZE, 0));
- /* Initialize the file contents to a random value */
-
- for (j = 0; j < FILE_SIZE; j++) {
- for (c = 0; c < UNIV_PAGE_SIZE; c++) {
- rnd_buf[c] = 0xFF;
- /*(byte)
- (ut_rnd_gen_ulint() % 256); */
- }
-
- os_file_write(files[i], rnd_buf,
- UNIV_PAGE_SIZE * j, 0,
- UNIV_PAGE_SIZE);
- }
- }
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create(name, k, FIL_TABLESPACE);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, FILE_SIZE, k);
- }
- }
-
- ios = 0;
-
- mutex_create(&ios_mutex);
- mutex_set_level(&ios_mutex, SYNC_NO_ORDER_CHECK);
-
- for (i = 0; i < 9; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(handler_thread, n + i, id + i);
- }
-}
-
-/************************************************************************
-Inits space headers of spaces 0 and 2. */
-
-void
-init_spaces(void)
-/*=============*/
-{
- mtr_t mtr;
-
- mtr_start(&mtr);
-
- fsp_header_init(0, FILE_SIZE * N_FILES, &mtr);
- fsp_header_init(2, FILE_SIZE * N_FILES, &mtr);
-
- mtr_commit(&mtr);
-}
-
-/*********************************************************************
-Test for table creation. */
-
-ulint
-test1(
-/*==*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- dict_index_t* index;
- dict_table_t* table;
- que_fork_t* fork;
- que_thr_t* thr;
- trx_t* trx;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1. CREATE TABLE WITH 3 COLUMNS AND WITH 3 INDEXES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- table = dict_mem_table_create("TS_TABLE1", 0, 3);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- /*------------------------------------*/
- /* CREATE TABLE */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = tab_create_graph_create(fork, thr, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS");
- /*-------------------------------------*/
- /* CREATE CLUSTERED INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND1", 0,
- /*DICT_UNIQUE |*/ DICT_CLUSTERED, 1);
- dict_mem_index_add_field(index, "COL1", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- /*-------------------------------------*/
- /* CREATE SECONDARY INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND2", 0, 0, 1);
-
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- /*-------------------------------------*/
- /* CREATE ANOTHER SECONDARY INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND3", 0, 0, 1);
-
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-#ifdef notdefined
- /*-------------------------------------*/
- /* CREATE YET ANOTHER SECONDARY INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND4", 0, 0, 1);
-
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-#endif
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- return(0);
-}
-
-/*********************************************************************
-Another test for table creation. */
-
-ulint
-test1_5(
-/*====*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- dict_index_t* index;
- dict_table_t* table;
- que_fork_t* fork;
- que_thr_t* thr;
- trx_t* trx;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1.5. CREATE TABLE WITH 3 COLUMNS AND WITH 1 INDEX\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- table = dict_mem_table_create("TS_TABLE2", 0, 3);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- /*------------------------------------*/
- /* CREATE TABLE */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = tab_create_graph_create(fork, thr, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS"); */
- /*-------------------------------------*/
- /* CREATE CLUSTERED INDEX */
-
- index = dict_mem_index_create("TS_TABLE2", "IND1", 0,
- DICT_CLUSTERED | DICT_UNIQUE, 1);
-
- dict_mem_index_add_field(index, "COL1", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- return(0);
-}
-
-/*********************************************************************
-Another test for table creation. */
-
-ulint
-test1_6(
-/*====*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- dict_index_t* index;
- dict_table_t* table;
- que_fork_t* fork;
- que_thr_t* thr;
- trx_t* trx;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1.6. CREATE TABLE WITH 3 COLUMNS AND WITH 1 INDEX\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- table = dict_mem_table_create("TS_TABLE3", 0, 3);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- /*------------------------------------*/
- /* CREATE TABLE */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = tab_create_graph_create(fork, thr, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS"); */
- /*-------------------------------------*/
- /* CREATE CLUSTERED INDEX */
-
- index = dict_mem_index_create("TS_TABLE3", "IND1", 0, DICT_CLUSTERED,
- 2);
- dict_mem_index_add_field(index, "COL1", 0);
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- return(0);
-}
-
-/*********************************************************************
-Another test for table creation. */
-
-ulint
-test1_7(
-/*====*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- dict_index_t* index;
- dict_table_t* table;
- que_fork_t* fork;
- que_thr_t* thr;
- trx_t* trx;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1.7. CREATE TABLE WITH 12 COLUMNS AND WITH 1 INDEX\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- table = dict_mem_table_create("TS_TABLE4", 0, 12);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL4", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL5", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL6", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL7", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL8", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL9", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL10", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL11", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL12", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- /*------------------------------------*/
- /* CREATE TABLE */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = tab_create_graph_create(fork, thr, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS"); */
- /*-------------------------------------*/
- /* CREATE CLUSTERED INDEX */
-
- index = dict_mem_index_create("TS_TABLE4", "IND1", 0,
- DICT_CLUSTERED | DICT_UNIQUE, 1);
-
- dict_mem_index_add_field(index, "COL1", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- return(0);
-}
-
-/*********************************************************************
-Test for inserts. */
-
-ulint
-test2(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
- dict_index_t* index;
-/* ulint size; */
- dtuple_t* entry;
- btr_pcur_t pcur;
- mtr_t mtr;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2. MASSIVE INSERT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- btr_search_print_info();
-
- /*-------------------------------------*/
- /* MASSIVE RANDOM INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- rnd = (rnd + 7857641) % 200000;
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_RND30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- if (i % 100 == 0) {
- printf(
- "********************************Inserted %lu rows\n", i);
- ibuf_print();
- }
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-/*
- for (i = 0; i < 10; i++) {
- size = ibuf_contract(TRUE);
-
- printf("%lu bytes will be contracted\n", size);
-
- os_thread_sleep(1000000);
- }
-*/
-/* index = dict_table_get_next_index(dict_table_get_first_index(table));
- tree = dict_index_get_tree(index);
- btr_validate_tree(tree);
-
- index = dict_table_get_next_index(index);
- tree = dict_index_get_tree(index);
- btr_validate_tree(tree);
-*/
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- btr_search_print_info();
-
- /* Check inserted entries */
-
- rnd = 0;
-
- entry = dtuple_create(heap, 1);
-
- for (i = 0; i < 1 /* *((ulint*)arg) */; i++) {
-
- rnd = (rnd + 7857641) % 200000;
- dtuple_gen_search_tuple3(entry, rnd, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur,
- &mtr);
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
- }
-
-/* btr_validate_tree(tree); */
-
-/* btr_print_tree(tree, 5); */
-
-#ifdef notdefined
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(1000000);
-
- btr_validate_tree(tree);
-
-/* btr_search_print_info();
- dict_table_print_by_name("TS_TABLE1"); */
- /*-------------------------------------*/
-
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-#endif
- /*-------------------------------------*/
- count++;
-
- if (count < 1) {
- goto loop;
- }
-
- mem_heap_free(heap);
- return(0);
-}
-
-/*********************************************************************
-Another test for inserts. */
-
-ulint
-test2_1(
-/*====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- byte buf[100];
- ins_node_t* node;
- ulint count = 0;
- ulint rnd;
- dtuple_t* row;
-/* buf_frame_t* frame_table[2000];
- dict_tree_t* tree;
- dict_index_t* index;
- dtuple_t* entry;
- btr_pcur_t pcur;
- mtr_t mtr; */
-
- printf("-------------------------------------------------\n");
- printf("TEST 2.1. MASSIVE ASCENDING INSERT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- rnd = 0;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- if (i % 5000 == 0) {
-
- /* fsp_print(0); */
- /* ibuf_print(); */
- /* buf_print(); */
-
- /* buf_print_io(); */
-
- tm = ut_clock();
- /*
- printf("Wall time for %lu inserts %lu milliseconds\n",
- i, tm - oldtm); */
- }
-
- rnd = rnd + 1;
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
-#ifdef notdefined
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- ibuf_print();
-
- index = dict_table_get_first_index(table);
-
- btr_search_index_print_info(index);
-
- btr_validate_tree(dict_index_get_tree(index));
-
- index = dict_table_get_next_index(index);
-
- btr_search_index_print_info(index);
-
- btr_validate_tree(dict_index_get_tree(index));
-
- index = dict_table_get_next_index(index);
-
- btr_search_index_print_info(index);
-
- btr_validate_tree(dict_index_get_tree(index));
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- /* Check inserted entries */
-
- btr_search_print_info();
-
- entry = dtuple_create(heap, 1);
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- for (i = 0; i < *((ulint*)arg); i++) {
- ut_a(btr_pcur_move_to_next(&pcur, &mtr));
-
- dtuple_gen_search_tuple3(entry, i, buf);
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
- }
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
-/* btr_validate_tree(tree); */
-
- for (i = 0; i < POOL_SIZE - 1; i++) {
- frame_table[i] = buf_frame_alloc(FALSE);
- }
-
- for (i = 0; i < POOL_SIZE - 1; i++) {
- buf_frame_free(frame_table[i]);
- }
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(1000000);
-#endif
-#ifdef notdefined
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
-
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- btr_search_print_info();
-
-#endif
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
- /*-------------------------------------*/
-
- count++;
-/* btr_validate_tree(tree); */
-
- if (count < 1) {
- goto loop;
- }
-
- mem_heap_free(heap);
-
- return(0);
-}
-
-/*********************************************************************
-Another test for inserts. */
-
-ulint
-test2_2(
-/*====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- dict_index_t* index;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
- btr_pcur_t pcur;
- mtr_t mtr;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2.2. MASSIVE DESCENDING INSERT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = *((ulint*)arg) + 1;
-
- oldtm = ut_clock();
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- rnd = (rnd - 1) % 200000;
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_RND3500, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- if (i % 1000 == 0) {
-/* printf(
- "********************************Inserted %lu rows\n", i);
- ibuf_print(); */
- }
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- /* Check inserted entries */
-
- entry = dtuple_create(heap, 1);
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- for (i = 0; i < *((ulint*)arg); i++) {
- ut_a(btr_pcur_move_to_next(&pcur, &mtr));
-
- dtuple_gen_search_tuple3(entry, i + 1, buf);
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
- }
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- btr_validate_tree(tree);
-/* dict_table_print_by_name("TS_TABLE1"); */
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(1000000);
-
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
-
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- /*-------------------------------------*/
-#ifdef notdefined
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-#endif
- /*-------------------------------------*/
- count++;
-
- if (count < 1) {
- goto loop;
- }
-
- btr_validate_tree(tree);
- mem_heap_free(heap);
- return(0);
-}
-
-/*********************************************************************
-Multithreaded test for random inserts. */
-
-ulint
-test2mt(
-/*====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- dict_index_t* index;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2MT. MULTITHREADED RANDOM INSERT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
- rnd = 78675;
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- if (i % 100 == 0) {
- printf("*******Inserted %lu rows\n", i);
-/* buf_print(); */
- ibuf_print();
- }
-
- rnd = (rnd + 7857641) % 500;
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_RND30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(3000000);
- /*-------------------------------------*/
-#ifdef notdefined
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-#endif
- /*-------------------------------------*/
- count++;
-
- if (count < COUNT) {
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for multithreaded sequential inserts. */
-
-ulint
-test2_1mt(
-/*======*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- dict_index_t* index;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2.1MT. MULTITHREADED ASCENDING INSERT\n");
-
- rnd = 8757677;
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- rnd += 98667501;
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- rnd = (rnd + 1) % 500;
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(3000000);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- /*-------------------------------------*/
-#ifdef notdefined
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-#endif
- /*-------------------------------------*/
- count++;
-
- if (count < COUNT) {
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for multithreaded sequential inserts. */
-
-ulint
-test2_2mt(
-/*======*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2.2MT. MULTITHREADED DESCENDING INSERT\n");
-
- rnd = 87677;
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- rnd += 78667;
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- rnd = (rnd - 1) % 500;
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_RND30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(3000000);
- /*-------------------------------------*/
-#ifdef notdefined
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-#endif
- /*-------------------------------------*/
- count++;
-
- mem_print_info();
-
- if (count < COUNT) {
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for updates. */
-
-ulint
-test3(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- byte* ptr;
- ulint len;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 3. UPDATES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- thr->child = ins_node_create(fork, thr, row, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 3; i++) {
- dtuple_gen_test_tuple3(row, i, DTUPLE_TEST_RND30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- dict_table_print_by_name("TS_TABLE1");
- /*-------------------------------------*/
- /* UPDATE ROWS */
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- update = upd_create(1, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- dtuple_gen_test_tuple3(row, 1, DTUPLE_TEST_RND30, buf);
-
- entry = dtuple_create(heap, 1);
- dfield_copy(dtuple_get_nth_field(entry, 0),
- dtuple_get_nth_field(row, 0));
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- ut_a(DB_SUCCESS == lock_clust_rec_read_check_and_lock(0,
- btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr));
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 2, table);
- dfield_set_data(&(ufield->new_val), "updated field", 14);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- mtr_start(&mtr);
-
- ut_a(btr_pcur_restore_position(BTR_SEARCH_LEAF, &pcur, &mtr));
-
- ptr = rec_get_nth_field(btr_pcur_get_rec(&pcur), 5, &len);
-
- ut_a(ut_memcmp(ptr, "updated field", 14) == 0);
-
- btr_pcur_commit(&pcur);
-
- dict_table_print_by_name("TS_TABLE1");
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 0, table);
- dfield_set_data(&(ufield->new_val), "31415926", 9);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- dict_table_print_by_name("TS_TABLE1");
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-#ifdef notdefined
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- /*-------------------------------------*/
-#endif
- dict_table_print_by_name("TS_TABLE1");
- count++;
-
- if (count < 1) {
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Init for update test. */
-
-ulint
-test4_1(void)
-/*=========*/
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
-
- printf("-------------------------------------------------\n");
- printf("TEST 4.1. UPDATE INIT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- thr->child = ins_node_create(fork, thr, row, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 200; i++) {
-
- dtuple_gen_test_tuple3(row, i, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- dict_table_print_by_name("TS_TABLE1");
-
- return(0);
-}
-
-/*************************************************************************
-Checks that the multithreaded update test has rolled back its updates. */
-
-void
-test4_2(void)
-/*=========*/
-{
- dtuple_t* entry;
- mem_heap_t* heap;
- mem_heap_t* heap2;
- mtr_t mtr;
- byte buf[32];
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- que_fork_t* fork;
- dict_table_t* table;
- dict_index_t* index;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- dtuple_t* row;
- btr_pcur_t pcur;
- rec_t* rec;
-
- printf("-------------------------------------------------\n");
- printf("TEST 4.2. CHECK UPDATE RESULT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*------------------------------------------*/
-
- table = dict_table_get("TS_TABLE1", trx);
-
- index = dict_table_get_first_index(table);
-
- entry = dtuple_create(heap, 1);
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- for (i = 0; i < 200; i++) {
- ut_a(btr_pcur_move_to_next(&pcur, &mtr));
-
- dtuple_gen_search_tuple3(entry, i, buf);
-
- rec = btr_pcur_get_rec(&pcur);
-
- ut_a(0 == cmp_dtuple_rec(entry, rec));
-
- heap2 = mem_heap_create(200);
-
- row = row_build(ROW_COPY_DATA, index, rec, heap2);
-
- ut_a(30 == dfield_get_len(dtuple_get_nth_field(row, 2)));
- ut_a(0 == ut_memcmp(
- dfield_get_data(dtuple_get_nth_field(row, 2)),
- "12345678901234567890123456789", 30));
-
- mem_heap_free(heap2);
- }
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-}
-
-/*********************************************************************
-Test for massive updates. */
-
-ulint
-test4mt(
-/*====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* entry;
- byte buf[100];
- byte buf2[4000];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 4. MULTITHREADED UPDATES\n");
-
- thr_no = *((ulint*)arg);
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- /*-------------------------------------*/
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- update = upd_create(1, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 87607651;
-
- entry = dtuple_create(heap, 1);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- for (i = 0; i < 999; i++) {
-
- rnd += 874681;
- tuple_no = (rnd % 40) * 5 + thr_no;
-
- dtuple_gen_search_tuple3(entry, tuple_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
-/* printf("%lu: thread %lu to update row %lu\n", i, thr_no, tuple_no); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 2, table);
- dfield_set_data(&(ufield->new_val), buf2, rnd % 200);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- } /* for (i = ... */
-
- tm = ut_clock();
- printf("Wall time for %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- lock_validate();
-
-/* lock_print_info(); */
-
-/* mem_print_info(); */
-
- mem_pool_print_info(mem_comm_pool);
-
- if ((count == 1) && (thr_no != 4)) {
-
- return(0);
- }
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(7000000);
-
- btr_validate_tree(tree);
-
- ut_a(trx->conc_state != TRX_ACTIVE);
- ut_a(UT_LIST_GET_LEN(trx->trx_locks) == 0);
-
- count++;
-
- if (count < 2) {
-
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for join. */
-
-ulint
-test6(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- byte buf[100];
- ulint count = 0;
- dtuple_t* entry;
- dict_index_t* index;
- dict_tree_t* tree;
- btr_pcur_t pcur;
- btr_pcur_t pcur2;
- mtr_t mtr;
- mtr_t mtr2;
- ulint rnd;
- ulint latch_mode;
-
- printf("-------------------------------------------------\n");
- printf("TEST 6. MASSIVE EQUIJOIN\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- /*--------------*/
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
- /*--------------*/
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /* Check inserted entries */
-
- entry = dtuple_create(heap, 1);
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- table = dict_table_get("TS_TABLE1", trx);
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- oldtm = ut_clock();
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IS, thr));
-
- rnd = 98651;
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- ut_a(btr_pcur_move_to_next(&pcur, &mtr));
-
- btr_pcur_store_position(&pcur, &mtr);
-
- ut_a(DB_SUCCESS == lock_clust_rec_cons_read_check(
- btr_pcur_get_rec(&pcur),
- index));
-
- btr_pcur_commit_specify_mtr(&pcur, &mtr);
-
- if (i % 1211 == 0) {
- dummy++;
- }
-
- rnd = 55321;
-
- dtuple_gen_search_tuple3(entry, rnd % *((ulint*)arg), buf);
-
-/* if (i == 0) { */
- latch_mode = BTR_SEARCH_LEAF;
-/* } else {
- latch_mode = BTR_SEARCH_LEAF | BTR_GUESS_LATCH;
- } */
-
- mtr_start(&mtr2);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, latch_mode,
- &pcur2, &mtr2);
-
- ut_a(DB_SUCCESS == lock_clust_rec_cons_read_check(
- btr_pcur_get_rec(&pcur2),
- index));
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur2)));
-
- mtr_commit(&mtr2);
-
- mtr_start(&mtr);
-
- btr_pcur_restore_position(BTR_SEARCH_LEAF, &pcur, &mtr);
- }
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- tm = ut_clock();
- printf("Wall time for join of %lu rows %lu milliseconds\n",
- i, tm - oldtm);
- btr_search_index_print_info(index);
- /*-------------------------------------*/
- /* COMMIT */
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
-/* printf("Wall time for commit %lu milliseconds\n", tm - oldtm); */
-
- /*-------------------------------------*/
- count++;
-/* btr_validate_tree(tree); */
-
- if (count < 3) {
- goto loop;
- }
-
- mem_heap_free(heap);
- return(0);
-}
-
-/*********************************************************************
-Test for lock wait. Requires Test 4.1 first. */
-
-ulint
-test7(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- trx_t* trx2;
- ulint rnd;
- dtuple_t* entry;
- dtuple_t* row;
- byte buf[100];
- byte buf2[4000];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 7. LOCK WAIT\n");
-
- thr_no = *((ulint*)arg);
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx2 = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- /*-------------------------------------*/
- /* UPDATE by trx */
- ut_a(trx_start(trx, ULINT_UNDEFINED));
- ut_a(trx_start(trx2, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- update = upd_create(1, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 87607651;
-
- entry = dtuple_create(heap, 2);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- rnd += 874681;
- tuple_no = 3;
-
- dtuple_gen_search_tuple3(entry, tuple_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 2, table);
- dfield_set_data(&(ufield->new_val), buf2, rnd % 1500);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- tm = ut_clock();
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- lock_validate();
-
- lock_print_info();
-
- /*-------------------------------------*/
- /* INSERT by trx2 */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx2;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx2);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- thr->child = ins_node_create(fork, thr, row, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx2->sess);
-
- trx2->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- dtuple_gen_test_tuple3(row, 2, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- /* Insert should be left to wait until trx releases the row lock */
-
- que_run_threads(thr);
-
- tm = ut_clock();
-
- lock_validate();
-
- lock_print_info();
-
- /*-------------------------------------*/
- /* COMMIT of trx */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
-
- /*-------------------------------------*/
- os_thread_sleep(1000000);
-
- printf(
- "trx2 can now continue to do the insert, after trx committed.\n");
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- lock_validate();
-
- lock_print_info();
-
- dict_table_print_by_name("TS_TABLE1");
-
- return(0);
-}
-
-/*********************************************************************
-Inserts for TPC-A. */
-
-ulint
-test8A(
-/*===*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- dict_index_t* index;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
- btr_pcur_t pcur;
- mtr_t mtr;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 8A. 1000 INSERTS FOR TPC-A\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- btr_search_print_info();
-
- /*-------------------------------------*/
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE2", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1000; i++) {
- dtuple_gen_test_tuple_TPC_A(row, rnd, buf);
-
- rnd = rnd + 1;
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
- btr_validate_tree(tree);
-
- /* Check inserted entries */
- rnd = 0;
-
- entry = dtuple_create(heap, 1);
-
- for (i = 0; i < 1000; i++) {
- dtuple_gen_search_tuple_TPC_A(entry, rnd, buf);
-
- rnd = rnd + 1;
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur,
- &mtr);
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
- }
-
- btr_validate_tree(tree);
-
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- /*-------------------------------------*/
- count++;
-
- if (count < 1) {
- goto loop;
- }
-
-/* dict_table_print_by_name("TS_TABLE2"); */
-
- mem_heap_free(heap);
- return(0);
-}
-
-/*********************************************************************
-Test for TPC-A transaction. */
-
-ulint
-test8(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork1;
- que_fork_t* fork2;
- que_fork_t* cfork;
- dict_table_t* table;
- dict_table_t* table2;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ins_node_t* inode;
- ulint rnd = 0;
-
- arg = arg;
-
- printf("-------------------------------------------------\n");
- printf("TEST 8. TPC-A %lu \n", *((ulint*)arg));
-
- oldtm = ut_clock();
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
- /*-----------------------------------*/
-
- fork1 = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork1->trx = trx;
-
- thr = que_thr_create(fork1, fork1, heap);
-
- table = dict_table_get("TS_TABLE3", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- inode = ins_node_create(fork1, thr, row, table, heap);
-
- thr->child = inode;
-
- row_ins_init_sys_fields_at_sql_compile(inode->row, inode->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(inode->row, inode->table, trx);
-
- inode->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork1, trx->sess);
-
- trx->graph = fork1;
-
- mutex_exit(&kernel_mutex);
-
- fork2 = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork2->trx = trx;
-
- thr = que_thr_create(fork2, fork2, heap);
-
- table2 = dict_table_get("TS_TABLE2", trx);
-
- update = upd_create(1, heap);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 1, table2);
-
- entry = dtuple_create(heap, 1);
- dfield_copy(dtuple_get_nth_field(entry, 0),
- dtuple_get_nth_field(row, 0));
-
- node = upd_node_create(fork2, thr, table2, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = UPD_NODE_NO_ORD_CHANGE | UPD_NODE_NO_SIZE_CHANGE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork2, trx->sess);
-
- trx->graph = fork2;
-
- mutex_exit(&kernel_mutex);
-
- cfork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- cfork->trx = trx;
-
- thr = que_thr_create(cfork, cfork, heap);
-
- thr->child = commit_node_create(cfork, thr, heap);
-
- oldtm = ut_clock();
-
-loop:
-/* printf("Round %lu\n", count); */
-
- /*-------------------------------------*/
- /* INSERT */
-
-/* printf("Trx %lu %lu starts, thr %lu\n",
- ut_dulint_get_low(trx->id),
- (ulint)trx,
- *((ulint*)arg)); */
-
- dtuple_gen_test_tuple3(row, count, DTUPLE_TEST_FIXED30, buf);
-
- ins_node_reset(inode);
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(fork1, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- /*-------------------------------------*/
- /* 3 UPDATES */
-
- ut_a(DB_SUCCESS == lock_table(0, table2, LOCK_IX, thr));
-
- for (i = 0; i < 3; i++) {
-
- rnd += 876751;
-
- if (count % 1231 == 0) {
- dummy++;
- }
-
- dtuple_gen_search_tuple_TPC_A(entry, rnd % 1000, buf);
-
- index = dict_table_get_first_index(table2);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_MODIFY_LEAF, &pcur, &mtr);
-
-/* ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur))); */
-
-/* btr_pcur_store_position(&pcur, &mtr); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- ufield = upd_get_nth_field(update, 0);
-
- dfield_set_data(&(ufield->new_val), "1234", 5);
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(fork2, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- } /* for (i = ... */
-
- /*-------------------------------------*/
- /* COMMIT */
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(cfork, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- count++;
-
- if (count < *((ulint*)arg)) {
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- goto loop;
- }
-
-/* printf("Trx %lu %lu committed\n", ut_dulint_get_low(trx->id),
- (ulint)trx); */
- tm = ut_clock();
- printf("Wall time for TPC-A %lu trxs %lu milliseconds\n",
- count, tm - oldtm);
-
- btr_search_index_print_info(index);
- btr_search_index_print_info(dict_table_get_first_index(table));
-
-/* mem_print_info(); */
- /*-------------------------------------*/
-
-
-/* dict_table_print_by_name("TS_TABLE2");
- dict_table_print_by_name("TS_TABLE3"); */
-
- return(0);
-}
-
-/*********************************************************************
-Inserts for TPC-C. */
-
-ulint
-test9A(
-/*===*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
-/* dtuple_t* entry;
- btr_pcur_t pcur;
- mtr_t mtr;
- dict_index_t* index;
- dict_tree_t* tree;
-*/
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 9A. INSERTS FOR TPC-C\n");
-
-#define TPC_C_TABLE_SIZE 15000
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- btr_search_print_info();
-
- /*-------------------------------------*/
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE4", trx);
-
- row = dtuple_create(heap, 12 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < TPC_C_TABLE_SIZE; i++) {
-
- dtuple_gen_test_tuple_TPC_C(row, rnd, buf);
-
- rnd = rnd + 1;
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
-#ifdef notdefined
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
- btr_validate_tree(tree);
-
- /* Check inserted entries */
- rnd = 0;
-
- entry = dtuple_create(heap, 1);
-
- for (i = 0; i < TPC_C_TABLE_SIZE; i++) {
-
- dtuple_gen_search_tuple_TPC_C(entry, rnd, buf);
-
- rnd = rnd + 1;
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur,
- &mtr);
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
- }
-
- btr_validate_tree(tree);
-#endif
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- /*-------------------------------------*/
- count++;
-
- if (count < 1) {
- goto loop;
- }
-
-/* dict_table_print_by_name("TS_TABLE4"); */
-
-/* mem_heap_free(heap); */
- return(0);
-}
-
-/*********************************************************************
-Test for TPC-C transaction. Test 9A must be run first to populate table. */
-
-ulint
-test9(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork1;
- que_fork_t* fork2;
- que_fork_t* cfork;
- dict_table_t* table;
- dict_table_t* table2;
- que_thr_t* thr;
- trx_t* trx;
- ulint j;
- ulint i;
- byte* ptr;
- ulint len;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ins_node_t* inode;
- ulint rnd = 0;
- byte buf2[240];
- rec_t* rec;
-
- arg = arg;
-
- printf("-------------------------------------------------\n");
- printf("TEST 9. TPC-C %lu \n", *((ulint*)arg));
-
- oldtm = ut_clock();
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
- /*-----------------------------------*/
-
- fork1 = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork1->trx = trx;
-
- thr = que_thr_create(fork1, fork1, heap);
-
- table = dict_table_get("TS_TABLE3", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- inode = ins_node_create(fork1, thr, row, table, heap);
-
- thr->child = inode;
-
- row_ins_init_sys_fields_at_sql_compile(inode->row, inode->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(inode->row, inode->table, trx);
-
- inode->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork1, trx->sess);
-
- trx->graph = fork1;
-
- mutex_exit(&kernel_mutex);
-
- fork2 = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork2->trx = trx;
-
- thr = que_thr_create(fork2, fork2, heap);
-
- table2 = dict_table_get("TS_TABLE4", trx);
-
- update = upd_create(3, heap);
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 1, table2);
- ufield = upd_get_nth_field(update, 1);
-
- upd_field_set_col_no(ufield, 1, table2);
- ufield = upd_get_nth_field(update, 2);
-
- upd_field_set_col_no(ufield, 1, table2);
-
- entry = dtuple_create(heap, 1);
- dfield_copy(dtuple_get_nth_field(entry, 0),
- dtuple_get_nth_field(row, 0));
-
- node = upd_node_create(fork2, thr, table2, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = UPD_NODE_NO_ORD_CHANGE | UPD_NODE_NO_SIZE_CHANGE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork2, trx->sess);
-
- trx->graph = fork2;
-
- mutex_exit(&kernel_mutex);
-
- cfork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- cfork->trx = trx;
-
- thr = que_thr_create(cfork, cfork, heap);
-
- thr->child = commit_node_create(cfork, thr, heap);
-
- oldtm = ut_clock();
-loop:
- ut_a(DB_SUCCESS == lock_table(0, table2, LOCK_IS, thr));
- ut_a(DB_SUCCESS == lock_table(0, table2, LOCK_IX, thr));
-
-/* printf("Round %lu\n", count); */
-
-for (j = 0; j < 13; j++) {
-
- /*-------------------------------------*/
- /* SELECT FROM 'ITEM' */
-
- rnd += 876751;
-
- dtuple_gen_search_tuple_TPC_C(entry, rnd % TPC_C_TABLE_SIZE, buf);
-
- index = dict_table_get_first_index(table2);
- tree = dict_index_get_tree(index);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_S, thr);
- ut_a(err == DB_SUCCESS);
-
- rec = btr_pcur_get_rec(&pcur);
-
- for (i = 0; i < 5; i++) {
- ptr = rec_get_nth_field(rec, i + 2, &len);
-
- ut_memcpy(buf2 + i * 24, ptr, len);
- }
-
- mtr_commit(&mtr);
-
- /*-------------------------------------*/
- /* UPDATE 'STOCK' */
-
- rnd += 876751;
-
- if (count % 1231 == 0) {
- dummy++;
- }
-
- dtuple_gen_search_tuple_TPC_C(entry, rnd % TPC_C_TABLE_SIZE, buf);
-
- index = dict_table_get_first_index(table2);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_MODIFY_LEAF, &pcur, &mtr);
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
-
-/* btr_pcur_store_position(&pcur, &mtr); */
-
- rec = btr_pcur_get_rec(&pcur);
-
- for (i = 0; i < 10; i++) {
- ptr = rec_get_nth_field(rec, i + 2, &len);
-
- ut_memcpy(buf2 + i * 24, ptr, len);
- }
-
-/* btr_pcur_commit(&pcur); */
-
-/* err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr); */
- ut_a(DB_SUCCESS == lock_clust_rec_cons_read_check(
- btr_pcur_get_rec(&pcur),
- index));
-/* ut_a(err == DB_SUCCESS); */
-
- ufield = upd_get_nth_field(update, 0);
-
- dfield_set_data(&(ufield->new_val), "1234", 5);
-
- ufield = upd_get_nth_field(update, 1);
-
- dfield_set_data(&(ufield->new_val), "1234", 5);
-
- ufield = upd_get_nth_field(update, 2);
-
- dfield_set_data(&(ufield->new_val), "1234", 5);
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(fork2, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- btr_pcur_close(&pcur);
- /*-------------------------------------*/
- /* INSERT INTO 'ORDERLINE' */
-
-/* printf("Trx %lu %lu starts, thr %lu\n",
- ut_dulint_get_low(trx->id),
- (ulint)trx,
- *((ulint*)arg)); */
-
- dtuple_gen_test_tuple3(row, count * 13 + j, DTUPLE_TEST_FIXED30, buf);
-
- ins_node_reset(inode);
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(fork1, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-}
- /*-------------------------------------*/
- /* COMMIT */
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(cfork, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* printf("Trx %lu %lu committed\n", ut_dulint_get_low(trx->id),
- (ulint)trx); */
- count++;
-
- if (count < *((ulint*)arg)) {
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- goto loop;
- }
-
- tm = ut_clock();
- printf("Wall time for TPC-C %lu trxs %lu milliseconds\n",
- count, tm - oldtm);
-
- btr_search_index_print_info(index);
- btr_search_index_print_info(dict_table_get_first_index(table));
-
-/* mem_print_info(); */
- /*-------------------------------------*/
-/* dict_table_print_by_name("TS_TABLE2");
- dict_table_print_by_name("TS_TABLE3"); */
-
- return(0);
-}
-
-/*********************************************************************
-Init for purge test. */
-
-ulint
-test10_1(
-/*=====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint thr_no;
-
- thr_no = *((ulint*)arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.1. PURGE INIT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- thr->child = ins_node_create(fork, thr, row, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 200; i++) {
-
- dtuple_gen_test_tuple3(row, i * 100 + thr_no,
- DTUPLE_TEST_FIXED30, buf);
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- return(0);
-}
-
-/*********************************************************************
-Test for purge. */
-
-ulint
-test10_2(
-/*=====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* entry;
- byte buf[100];
- byte buf2[1000];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.2. PURGE TEST UPDATES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- /*-------------------------------------*/
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- update = upd_create(2, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 87607651;
-
- entry = dtuple_create(heap, 1);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- for (i = 0; i < 200; i++) {
-
- tuple_no = i;
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + thr_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
-/* printf("Thread %lu to update row %lu\n", thr_no, tuple_no); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 0, table);
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + 10 + thr_no, buf);
-
- dfield_set_data(&(ufield->new_val), dfield_get_data(
- dtuple_get_nth_field(entry, 0)),
- dfield_get_len(
- dtuple_get_nth_field(entry, 0)));
- ufield = upd_get_nth_field(update, 1);
-
- upd_field_set_col_no(ufield, 1, table);
-
- rnd += 98326761;
-
- dfield_set_data(&(ufield->new_val), buf2, rnd % 200);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- fsp_validate(0);
-
- } /* for (i = ... */
-
- tm = ut_clock();
- printf("Wall time for %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
-/* lock_print_info(); */
-
-/* mem_print_info(); */
-
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- count++;
-
- if (count < 1) {
-
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for purge. */
-
-ulint
-test10_2_r(
-/*=======*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* entry;
- byte buf[100];
- byte buf2[1000];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.2. PURGE TEST UPDATES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- /*-------------------------------------*/
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- update = upd_create(2, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 87607651;
-
- entry = dtuple_create(heap, 1);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- for (i = 0; i < 200; i++) {
-
- tuple_no = i;
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + thr_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
-/* printf("Thread %lu to update row %lu\n", thr_no, tuple_no); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 0, table);
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + 10 + thr_no, buf);
-
- dfield_set_data(&(ufield->new_val), dfield_get_data(
- dtuple_get_nth_field(entry, 0)),
- dfield_get_len(
- dtuple_get_nth_field(entry, 0)));
- ufield = upd_get_nth_field(update, 1);
-
- upd_field_set_col_no(ufield, 1, table);
-
- rnd += 98326761;
-
- dfield_set_data(&(ufield->new_val), buf2, rnd % 2000);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- fsp_validate(0);
-
- } /* for (i = ... */
-
- tm = ut_clock();
- printf("Wall time for %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
-/* lock_print_info(); */
-
- mem_pool_print_info(mem_comm_pool);
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(2000000);
-
- count++;
-
- if (count < 1) {
-
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for purge. */
-
-ulint
-test10_3(
-/*=====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* entry;
- byte buf[100];
- btr_pcur_t pcur;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- del_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.3. PURGE TEST DELETES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- /*-------------------------------------*/
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- node = del_node_create(fork, thr, table, &pcur, heap);
- thr->child = node;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- entry = dtuple_create(heap, 1);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- for (i = 0; i < 200; i++) {
-
- rnd = i;
- tuple_no = rnd;
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + 10 + thr_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
-/* printf("Thread %lu to update row %lu\n", thr_no, tuple_no); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- } /* for (i = ... */
-
- tm = ut_clock();
- printf("Wall time for %lu delete markings %lu milliseconds\n",
- i, tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
-/* lock_print_info(); */
-
-/* mem_print_info(); */
-
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- return(0);
-}
-
-/*********************************************************************
-Test for purge. */
-
-ulint
-test10_5(
-/*=====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* entry;
- byte buf[100];
- btr_pcur_t pcur;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- del_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.5. PURGE TEST UNCOMMITTED DELETES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- /*-------------------------------------*/
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- node = del_node_create(fork, thr, table, &pcur, heap);
- thr->child = node;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- entry = dtuple_create(heap, 1);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- for (i = 0; i < 50; i++) {
-
- rnd = i;
- tuple_no = rnd % 100;
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + 10 + thr_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
-/* printf("Thread %lu to update row %lu\n", thr_no, tuple_no); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- } /* for (i = ... */
-
- tm = ut_clock();
- printf("Wall time for %lu delete markings %lu milliseconds\n",
- i, tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
-/* lock_print_info(); */
-
-/* mem_print_info(); */
-
- return(0);
-}
-
-/*********************************************************************
-Multithreaded test for purge. */
-
-ulint
-test10mt(
-/*=====*/
- void* arg)
-{
- ulint i;
- ulint thr_no;
-
- thr_no = *((ulint*)arg);
-
- printf("Thread %lu starts purge test\n", thr_no);
-
- for (i = 0; i < 2; i++) {
- test10_1(arg);
-
- sync_print();
-
- fsp_validate(0);
-
- test10_2_r(arg);
- sync_print();
-
- test10_2(arg);
- sync_print();
-
- lock_validate();
-
- test10_3(arg);
- sync_print();
- }
-
- printf("Thread %lu ends purge test\n", thr_no);
-
- return(0);
-}
-
-/*********************************************************************
-Purge test. */
-
-ulint
-test10_4(
-/*=====*/
- void* arg)
-{
- ulint i;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.4. PURGE TEST\n");
-
- for (i = 0; i < 30; i++) {
- trx_purge();
-
- printf("%lu pages purged\n", purge_sys->n_pages_handled);
-
- os_thread_sleep(5000000);
- }
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- return(0);
-}
-
-/*********************************************************************
-This thread is used to test insert buffer merge. */
-
-ulint
-test_ibuf_merge(
-/*============*/
- void* arg)
-{
- ulint sum_sizes;
- ulint volume;
-
- ut_ad(arg);
-
- printf("Starting ibuf merge\n");
-
- sum_sizes = 0;
- volume = 1;
-
- while (volume) {
- volume = ibuf_contract(FALSE);
-
- sum_sizes += volume;
- }
-
- printf("Ibuf merged %lu bytes\n", sum_sizes);
-
- os_thread_sleep(5000000);
-
- return(0);
-}
-
-/*********************************************************************
-This thread is used to measure contention of latches. */
-
-ulint
-test_measure_cont(
-/*==============*/
- void* arg)
-{
- ulint i, j;
- ulint count;
-
- ut_ad(arg);
-
- printf("Starting contention measurement\n");
-
- for (i = 0; i < 1000; i++) {
- count = 0;
-
- for (j = 0; j < 100; j++) {
-
- os_thread_sleep(10000);
-
- if ((&(buf_pool->mutex))->lock_word) {
-
- count++;
- }
- }
-
- printf("Mutex reserved %lu of %lu peeks\n", count, j);
- }
-
- return(0);
-}
-
-/********************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
- os_thread_id_t id[10];
- ulint n1000[10];
- ulint i;
- ulint n5000 = 500;
- ulint n2;
- char buf[100];
-
-/* buf_debug_prints = TRUE; */
- log_do_write = TRUE;
- btr_search_use_hash = TRUE;
- log_debug_writes = TRUE;
-
- srv_boot("initfile");
- os_aio_init(576, 9, 100);
- fil_init(25);
- buf_pool_init(POOL_SIZE, POOL_SIZE);
- fsp_init();
- log_init();
- lock_sys_create(1024);
-
- create_files();
- create_log_files();
-
- init_spaces();
-
- sess_sys_init_at_db_start();
-
- trx_sys_create();
-
- dict_create();
-
- log_make_checkpoint_at(ut_dulint_max);
-/* log_debug_writes = TRUE; */
-
-/* os_thread_sleep(500000); */
-
- oldtm = ut_clock();
-
- ut_rnd_set_seed(19);
-
- test1(NULL);
-/* test1_5(NULL);
- test1_6(NULL);
- test1_7(NULL); */
-
-/* for (i = 0; i < 2; i++) {
-
- n1000[i] = i;
- id[i] = id[i];
-
- os_thread_create(test10mt, n1000 + i, id + i);
- }
-*/
- i = 4;
-
- n1000[i] = i;
- id[i] = id[i];
-
-/* os_thread_create(test10_4, n1000 + i, id + i); */
-
- i = 5;
-
-/* test10mt(&i);
-
- i = 6;
-
- test10mt(&i);
-
- trx_purge();
- printf("%lu pages purged\n", purge_sys->n_pages_handled);
-
- dict_table_print_by_name("TS_TABLE1"); */
-
-/* os_thread_create(test_measure_cont, &n3, id + 0); */
-
-/* mem_print_info(); */
-
- log_make_checkpoint_at(ut_dulint_max);
-
- n2 = 100;
-
-/* test2_1(&n2);
-
- log_flush_up_to(ut_dulint_max, LOG_WAIT_ALL_GROUPS); */
-
-/* sync_print();
-
- test9A(&n2);
-
- sync_print();
-
- log_print();
-
- test9(&n2);
-
- log_print();
-
- sync_print(); */
-/* test6(&n2); */
-
-/* test2_2(&n2); */
-
-/* test3(&n2); */
-
-/* mem_print_info(); */
-
- log_archive_stop();
- log_archive_start();
-
- ut_a(DB_SUCCESS == log_switch_backup_state_on());
-
- printf("Type: kukkuu<enter>\n");
- scanf("%s", buf);
-
- ut_a(DB_SUCCESS == log_switch_backup_state_off());
-
- for (i = 0; i < 2; i++) {
-
- n1000[i] = 500 + 10 * i;
- id[i] = id[i];
-/*
- os_thread_create(test2mt, n1000 + i, id + i);
- os_thread_create(test2_1mt, n1000 + i, id + i);
- os_thread_create(test2_2mt, n1000 + i, id + i);
-*/ }
-
- n2 = 5000;
-
-/* fsp_print(0); */
-
- test2_1(&n2);
-
- for (i = 0; i < 20; i++) {
- log_archive_stop();
- log_archive_start();
- }
-
-/* test2(&n2);
- test2(&n2); */
-
-/* buf_print();
- ibuf_print();
- rw_lock_list_print_info();
- mutex_list_print_info(); */
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
-/* mem_print_info(); */
-/*
- n2 = 100;
-
- test4_1();
- test4_2();
-
- for (i = 0; i < 2; i++) {
- n1000[i] = i;
- id[i] = id[i];
- os_thread_create(test4mt, n1000 + i, id + i);
- }
-
- n2 = 4;
- test4mt(&n2);
-
- log_archive_stop();
- log_archive_start();
-
- test4mt(&n2);
-*/
-/* test4_2(); */
-/*
- lock_print_info();
-*/
-/* test7(&n2); */
-
-/* os_thread_sleep(25000000); */
-
-/* ut_a(DB_SUCCESS == log_switch_backup_state_off()); */
-
-/* recv_compare_spaces(0, 1, 100); */
-
- log_flush_up_to(ut_dulint_max, LOG_WAIT_ALL_GROUPS);
-
- printf("Type: kukkuu<enter>\n");
- scanf("%s", buf);
-
- buf_flush_batch(BUF_FLUSH_LIST, ULINT_MAX, ut_dulint_max);
- buf_flush_wait_batch_end(BUF_FLUSH_LIST);
-
-/* log_make_checkpoint_at(ut_dulint_max); */
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
-/* buf_print(); */
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/btr/ts/tsbtrfull.c b/innobase/btr/ts/tsbtrfull.c
deleted file mode 100644
index fc8bbb7bffc..00000000000
--- a/innobase/btr/ts/tsbtrfull.c
+++ /dev/null
@@ -1,4925 +0,0 @@
-/************************************************************************
-Test for the B-tree
-
-(c) 1994-1997 Innobase Oy
-
-Created 2/16/1996 Heikki Tuuri
-*************************************************************************/
-
-#include "os0proc.h"
-#include "sync0sync.h"
-#include "ut0mem.h"
-#include "mem0mem.h"
-#include "mem0pool.h"
-#include "data0data.h"
-#include "data0type.h"
-#include "dict0dict.h"
-#include "buf0buf.h"
-#include "os0file.h"
-#include "os0thread.h"
-#include "fil0fil.h"
-#include "fsp0fsp.h"
-#include "rem0rec.h"
-#include "rem0cmp.h"
-#include "mtr0mtr.h"
-#include "log0log.h"
-#include "page0page.h"
-#include "page0cur.h"
-#include "trx0trx.h"
-#include "dict0boot.h"
-#include "trx0sys.h"
-#include "dict0crea.h"
-#include "btr0btr.h"
-#include "btr0pcur.h"
-#include "btr0cur.h"
-#include "btr0sea.h"
-#include "rem0rec.h"
-#include "srv0srv.h"
-#include "que0que.h"
-#include "com0com.h"
-#include "usr0sess.h"
-#include "lock0lock.h"
-#include "trx0roll.h"
-#include "trx0purge.h"
-#include "row0ins.h"
-#include "row0upd.h"
-#include "row0row.h"
-#include "row0del.h"
-#include "lock0lock.h"
-#include "ibuf0ibuf.h"
-
-os_file_t files[1000];
-
-mutex_t ios_mutex;
-ulint ios;
-ulint n[10];
-
-mutex_t incs_mutex;
-ulint incs;
-
-byte bigbuf[1000000];
-
-#define N_SPACES 2 /* must be >= 2 */
-#define N_FILES 1
-#define FILE_SIZE 8096 /* must be > 512 */
-#define POOL_SIZE 1524
-#define IBUF_SIZE 200
-#define COUNTER_OFFSET 1500
-
-#define LOOP_SIZE 150
-#define N_THREADS 5
-
-#define COUNT 1
-
-ulint zero = 0;
-
-buf_block_t* bl_arr[POOL_SIZE];
-
-ulint dummy = 0;
-
-/************************************************************************
-Io-handler thread function. */
-
-ulint
-handler_thread(
-/*===========*/
- void* arg)
-{
- ulint segment;
- void* mess;
- ulint i;
- bool ret;
-
- segment = *((ulint*)arg);
-
- printf("Io handler thread %lu starts\n", segment);
-
- for (i = 0;; i++) {
- fil_aio_wait(segment);
-
- mutex_enter(&ios_mutex);
- ios++;
- mutex_exit(&ios_mutex);
-
- }
-
- return(0);
-}
-
-/*************************************************************************
-Creates the files for the file system test and inserts them to the file
-system. */
-
-void
-create_files(void)
-/*==============*/
-{
- bool ret;
- ulint i, k;
- char name[20];
- os_thread_t thr[10];
- os_thread_id_t id[10];
-
- printf("--------------------------------------------------------\n");
- printf("Create or open database files\n");
-
- strcpy(name, "tsfile00");
-
- for (k = 0; k < N_SPACES; k++) {
- for (i = 0; i < N_FILES; i++) {
-
- name[6] = (char)((ulint)'0' + k);
- name[7] = (char)((ulint)'0' + i);
-
- files[i] = os_file_create(name, OS_FILE_CREATE,
- OS_FILE_TABLESPACE, &ret);
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(
- name, OS_FILE_OPEN,
- OS_FILE_TABLESPACE, &ret);
- ut_a(ret);
- } else {
- if (k == 1) {
- ut_a(os_file_set_size(files[i],
- 8192 * IBUF_SIZE, 0));
- } else {
- ut_a(os_file_set_size(files[i],
- 8192 * FILE_SIZE, 0));
- }
- }
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create(name, k, OS_FILE_TABLESPACE);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, FILE_SIZE, k);
- }
- }
-
- ios = 0;
-
- mutex_create(&ios_mutex);
- mutex_set_level(&ios_mutex, SYNC_NO_ORDER_CHECK);
-
- for (i = 0; i < 9; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(handler_thread, n + i, id + i);
- }
-}
-
-/************************************************************************
-Inits space headers of spaces 0 and 1. */
-
-void
-init_spaces(void)
-/*=============*/
-{
- mtr_t mtr;
-
- mtr_start(&mtr);
-
- fsp_header_init(0, FILE_SIZE * N_FILES, &mtr);
- fsp_header_init(1, IBUF_SIZE, &mtr);
-
- mtr_commit(&mtr);
-}
-
-/*********************************************************************
-Test for table creation. */
-
-ulint
-test1(
-/*==*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- dict_index_t* index;
- dict_table_t* table;
- que_fork_t* fork;
- que_thr_t* thr;
- trx_t* trx;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1. CREATE TABLE WITH 3 COLUMNS AND WITH 3 INDEXES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- table = dict_mem_table_create("TS_TABLE1", 0, 3);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- /*------------------------------------*/
- /* CREATE TABLE */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = tab_create_graph_create(fork, thr, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS"); */
- /*-------------------------------------*/
- /* CREATE CLUSTERED INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND1", 0,
- DICT_UNIQUE | DICT_CLUSTERED, 1);
- dict_mem_index_add_field(index, "COL1", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- /*-------------------------------------*/
- /* CREATE SECONDARY INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND2", 0, 0, 1);
-
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- /*-------------------------------------*/
- /* CREATE ANOTHER SECONDARY INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND3", 0, 0, 1);
-
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-#ifdef notdefined
- /*-------------------------------------*/
- /* CREATE YET ANOTHER SECONDARY INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND4", 0, 0, 1);
-
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-#endif
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- return(0);
-}
-
-/*********************************************************************
-Another test for table creation. */
-
-ulint
-test1_5(
-/*====*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- dict_index_t* index;
- dict_table_t* table;
- que_fork_t* fork;
- que_thr_t* thr;
- trx_t* trx;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1.5. CREATE TABLE WITH 3 COLUMNS AND WITH 1 INDEX\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- table = dict_mem_table_create("TS_TABLE2", 0, 3);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- /*------------------------------------*/
- /* CREATE TABLE */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = tab_create_graph_create(fork, thr, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS"); */
- /*-------------------------------------*/
- /* CREATE CLUSTERED INDEX */
-
- index = dict_mem_index_create("TS_TABLE2", "IND1", 0,
- DICT_CLUSTERED | DICT_UNIQUE, 1);
-
- dict_mem_index_add_field(index, "COL1", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- return(0);
-}
-
-/*********************************************************************
-Another test for table creation. */
-
-ulint
-test1_6(
-/*====*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- dict_index_t* index;
- dict_table_t* table;
- que_fork_t* fork;
- que_thr_t* thr;
- trx_t* trx;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1.6. CREATE TABLE WITH 3 COLUMNS AND WITH 1 INDEX\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- table = dict_mem_table_create("TS_TABLE3", 0, 3);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- /*------------------------------------*/
- /* CREATE TABLE */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = tab_create_graph_create(fork, thr, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS"); */
- /*-------------------------------------*/
- /* CREATE CLUSTERED INDEX */
-
- index = dict_mem_index_create("TS_TABLE3", "IND1", 0, DICT_CLUSTERED,
- 2);
- dict_mem_index_add_field(index, "COL1", 0);
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- return(0);
-}
-
-/*********************************************************************
-Another test for table creation. */
-
-ulint
-test1_7(
-/*====*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- dict_index_t* index;
- dict_table_t* table;
- que_fork_t* fork;
- que_thr_t* thr;
- trx_t* trx;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1.7. CREATE TABLE WITH 12 COLUMNS AND WITH 1 INDEX\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- table = dict_mem_table_create("TS_TABLE4", 0, 12);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL4", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL5", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL6", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL7", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL8", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL9", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL10", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL11", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL12", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- /*------------------------------------*/
- /* CREATE TABLE */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = tab_create_graph_create(fork, thr, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS"); */
- /*-------------------------------------*/
- /* CREATE CLUSTERED INDEX */
-
- index = dict_mem_index_create("TS_TABLE4", "IND1", 0,
- DICT_CLUSTERED | DICT_UNIQUE, 1);
-
- dict_mem_index_add_field(index, "COL1", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- return(0);
-}
-
-/*********************************************************************
-Test for inserts. */
-
-ulint
-test2(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
- dict_index_t* index;
-/* ulint size; */
- dtuple_t* entry;
- btr_pcur_t pcur;
- mtr_t mtr;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2. MASSIVE INSERT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- btr_search_print_info();
-
- /*-------------------------------------*/
- /* MASSIVE RANDOM INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- rnd = (rnd + 7857641) % 200000;
-
- dtuple_gen_test_tuple3(row, rnd,
- DTUPLE_TEST_RND30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- if (i % 1000 == 0) {
- printf(
- "********************************Inserted %lu rows\n", i);
- ibuf_print();
- }
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-/*
- for (i = 0; i < 10; i++) {
- size = ibuf_contract(TRUE);
-
- printf("%lu bytes will be contracted\n", size);
-
- os_thread_sleep(1000000);
- }
-*/
- index = dict_table_get_next_index(dict_table_get_first_index(table));
- tree = dict_index_get_tree(index);
- btr_validate_tree(tree);
-
- index = dict_table_get_next_index(index);
- tree = dict_index_get_tree(index);
- btr_validate_tree(tree);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- btr_search_print_info();
-
- /* Check inserted entries */
- rnd = 0;
-
- entry = dtuple_create(heap, 1);
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- rnd = (rnd + 7857641) % 200000;
- dtuple_gen_search_tuple3(entry, rnd, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur,
- &mtr);
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
- }
-
- btr_validate_tree(tree);
-
-/* btr_print_tree(tree, 5); */
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(1000000);
-
- btr_validate_tree(tree);
-
-/* btr_search_print_info();
- dict_table_print_by_name("TS_TABLE1"); */
- /*-------------------------------------*/
-#ifdef notdefined
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-#endif
- /*-------------------------------------*/
- count++;
-
- if (count < 1) {
- goto loop;
- }
-
- mem_heap_free(heap);
- return(0);
-}
-
-/*********************************************************************
-Another test for inserts. */
-
-ulint
-test2_1(
-/*====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- byte buf[100];
- ins_node_t* node;
- ulint count = 0;
- ulint rnd;
- dtuple_t* row;
-/* dict_tree_t* tree;
- dict_index_t* index;
- dtuple_t* entry;
- btr_pcur_t pcur;
- mtr_t mtr; */
-
- printf("-------------------------------------------------\n");
- printf("TEST 2.1. MASSIVE ASCENDING INSERT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- if (i % 5000 == 0) {
- /* ibuf_print(); */
- /* buf_print(); */
-
- /* buf_print_io(); */
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
- }
-
- rnd = rnd + 1;
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
-#ifdef notdefined
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- ibuf_print();
-
- index = dict_table_get_first_index(table);
-
- btr_search_index_print_info(index);
-
- btr_validate_tree(dict_index_get_tree(index));
-
- index = dict_table_get_next_index(index);
-
- btr_search_index_print_info(index);
-
- btr_validate_tree(dict_index_get_tree(index));
-
- index = dict_table_get_next_index(index);
-
- btr_search_index_print_info(index);
-
- btr_validate_tree(dict_index_get_tree(index));
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- /* Check inserted entries */
-
- btr_search_print_info();
-
- entry = dtuple_create(heap, 1);
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- for (i = 0; i < *((ulint*)arg); i++) {
- ut_a(btr_pcur_move_to_next(&pcur, &mtr));
-
- dtuple_gen_search_tuple3(entry, i, buf);
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
- }
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-#endif
-#ifdef notdefined
- /*-------------------------------------*/
- /* ROLLBACK */
-
-/* btr_validate_tree(tree); */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(1000000);
-
-
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
-
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- btr_search_print_info();
-
-#endif
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
- /*-------------------------------------*/
-
- count++;
-/* btr_validate_tree(tree); */
-
- if (count < 1) {
- goto loop;
- }
-
- mem_heap_free(heap);
-
- return(0);
-}
-
-/*********************************************************************
-Another test for inserts. */
-
-ulint
-test2_2(
-/*====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- dict_index_t* index;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
- btr_pcur_t pcur;
- mtr_t mtr;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2.2. MASSIVE DESCENDING INSERT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = *((ulint*)arg) + 1;
-
- oldtm = ut_clock();
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- rnd = (rnd - 1) % 200000;
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- if (i % 1000 == 0) {
-/* printf(
- "********************************Inserted %lu rows\n", i);
- ibuf_print(); */
- }
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- /* Check inserted entries */
-
- entry = dtuple_create(heap, 1);
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- for (i = 0; i < *((ulint*)arg); i++) {
- ut_a(btr_pcur_move_to_next(&pcur, &mtr));
-
- dtuple_gen_search_tuple3(entry, i + 1, buf);
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
- }
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- btr_validate_tree(tree);
-/* dict_table_print_by_name("TS_TABLE1"); */
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(1000000);
-
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
-
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- /*-------------------------------------*/
-#ifdef notdefined
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-#endif
- /*-------------------------------------*/
- count++;
-
- if (count < 1) {
- goto loop;
- }
-
- btr_validate_tree(tree);
- mem_heap_free(heap);
- return(0);
-}
-
-/*********************************************************************
-Multithreaded test for random inserts. */
-
-ulint
-test2mt(
-/*====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- dict_index_t* index;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2MT. MULTITHREADED RANDOM INSERT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
- rnd = 78675;
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- if (i % 100 == 0) {
-/* buf_print(); */
-/* ibuf_print(); */
- }
-
- rnd = (rnd + 7857641) % 500;
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(3000000);
- /*-------------------------------------*/
-#ifdef notdefined
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-#endif
- /*-------------------------------------*/
- count++;
-
- if (count < COUNT) {
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for multithreaded sequential inserts. */
-
-ulint
-test2_1mt(
-/*======*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- dict_index_t* index;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2.1MT. MULTITHREADED ASCENDING INSERT\n");
-
- rnd = 8757677;
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- rnd += 98667501;
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- rnd = (rnd + 1) % 500;
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(3000000);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- /*-------------------------------------*/
-#ifdef notdefined
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-#endif
- /*-------------------------------------*/
- count++;
-
- if (count < COUNT) {
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for multithreaded sequential inserts. */
-
-ulint
-test2_2mt(
-/*======*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2.2MT. MULTITHREADED DESCENDING INSERT\n");
-
- rnd = 87677;
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- rnd += 78667;
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- rnd = (rnd - 1) % 500;
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_RND30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(3000000);
- /*-------------------------------------*/
-#ifdef notdefined
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-#endif
- /*-------------------------------------*/
- count++;
-
- mem_print_info();
-
- if (count < COUNT) {
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for updates. */
-
-ulint
-test3(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- byte* ptr;
- ulint len;
- ulint err;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 3. UPDATES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- thr->child = ins_node_create(fork, thr, row, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 3; i++) {
- dtuple_gen_test_tuple3(row, i, DTUPLE_TEST_RND30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- dict_table_print_by_name("TS_TABLE1");
- /*-------------------------------------*/
- /* UPDATE ROWS */
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- update = upd_create(1, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- dtuple_gen_test_tuple3(row, 1, DTUPLE_TEST_RND30, buf);
-
- entry = dtuple_create(heap, 2);
- dfield_copy(dtuple_get_nth_field(entry, 0),
- dtuple_get_nth_field(row, 0));
- dfield_copy(dtuple_get_nth_field(entry, 1),
- dtuple_get_nth_field(row, 1));
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 2, table);
- dfield_set_data(&(ufield->new_val), "updated field", 14);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- mtr_start(&mtr);
-
- ut_a(btr_pcur_restore_position(BTR_SEARCH_LEAF, &pcur, &mtr));
-
- ptr = rec_get_nth_field(btr_pcur_get_rec(&pcur), 5, &len);
-
- ut_a(ut_memcmp(ptr, "updated field", 14) == 0);
-
- btr_pcur_commit(&pcur);
-
- dict_table_print_by_name("TS_TABLE1");
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 0, table);
- dfield_set_data(&(ufield->new_val), "31415926", 9);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- dict_table_print_by_name("TS_TABLE1");
- /*-------------------------------------*/
- /* ROLLBACK */
-#ifdef notdefined
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu updates %lu milliseconds\n",
- i, tm - oldtm);
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- /*-------------------------------------*/
-#endif
- dict_table_print_by_name("TS_TABLE1");
- count++;
-
- if (count < 1) {
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Init for update test. */
-
-ulint
-test4_1(void)
-/*=========*/
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
-
- printf("-------------------------------------------------\n");
- printf("TEST 4.1. UPDATE INIT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- thr->child = ins_node_create(fork, thr, row, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 200; i++) {
-
- dtuple_gen_test_tuple3(row, i, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- dict_table_print_by_name("TS_TABLE1");
-
- return(0);
-}
-
-/*************************************************************************
-Checks that the multithreaded update test has rolled back its updates. */
-
-void
-test4_2(void)
-/*=========*/
-{
- dtuple_t* entry;
- mem_heap_t* heap;
- mem_heap_t* heap2;
- mtr_t mtr;
- byte buf[32];
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- que_fork_t* fork;
- dict_table_t* table;
- dict_index_t* index;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- dtuple_t* row;
- btr_pcur_t pcur;
- rec_t* rec;
-
- printf("-------------------------------------------------\n");
- printf("TEST 4.2. CHECK UPDATE RESULT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*------------------------------------------*/
-
- table = dict_table_get("TS_TABLE1", trx);
-
- index = dict_table_get_first_index(table);
-
- entry = dtuple_create(heap, 1);
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- for (i = 0; i < 200; i++) {
- ut_a(btr_pcur_move_to_next(&pcur, &mtr));
-
- dtuple_gen_search_tuple3(entry, i, buf);
-
- rec = btr_pcur_get_rec(&pcur);
-
- ut_a(0 == cmp_dtuple_rec(entry, rec));
-
- heap2 = mem_heap_create(200);
-
- row = row_build(ROW_COPY_DATA, index, rec, heap2);
-
- ut_a(30 == dfield_get_len(dtuple_get_nth_field(row, 2)));
- ut_a(0 == ut_memcmp(
- dfield_get_data(dtuple_get_nth_field(row, 2)),
- "12345678901234567890123456789", 30));
-
- mem_heap_free(heap2);
- }
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-}
-
-/*********************************************************************
-Test for massive updates. */
-
-ulint
-test4mt(
-/*====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* entry;
- byte buf[100];
- byte buf2[4000];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 4. MULTITHREADED UPDATES\n");
-
- thr_no = *((ulint*)arg);
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- /*-------------------------------------*/
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- update = upd_create(1, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 87607651;
-
- entry = dtuple_create(heap, 1);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- for (i = 0; i < 300; i++) {
-
- rnd += 874681;
- tuple_no = (rnd % 40) * 5 + thr_no;
-
- dtuple_gen_search_tuple3(entry, tuple_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
-/* printf("Thread %lu to update row %lu\n", thr_no, tuple_no); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 2, table);
- dfield_set_data(&(ufield->new_val), buf2, rnd % 3000);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- } /* for (i = ... */
-
- tm = ut_clock();
- printf("Wall time for %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- lock_validate();
-
-/* lock_print_info(); */
-
-/* mem_print_info(); */
-
- mem_pool_print_info(mem_comm_pool);
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(2000000);
-
- btr_validate_tree(tree);
-
- ut_a(trx->conc_state != TRX_ACTIVE);
- ut_a(UT_LIST_GET_LEN(trx->trx_locks) == 0);
-
- count++;
-
- if (count < 2) {
-
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for join. */
-
-ulint
-test6(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- byte buf[100];
- ulint count = 0;
- dtuple_t* entry;
- dict_index_t* index;
- dict_tree_t* tree;
- btr_pcur_t pcur;
- btr_pcur_t pcur2;
- mtr_t mtr;
- mtr_t mtr2;
- ulint rnd;
- ulint latch_mode;
-
- printf("-------------------------------------------------\n");
- printf("TEST 6. MASSIVE EQUIJOIN\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- /*--------------*/
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
- /*--------------*/
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /* Check inserted entries */
-
- entry = dtuple_create(heap, 1);
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- table = dict_table_get("TS_TABLE1", trx);
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- oldtm = ut_clock();
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IS, thr));
-
- rnd = 98651;
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- ut_a(btr_pcur_move_to_next(&pcur, &mtr));
-
- btr_pcur_store_position(&pcur, &mtr);
-
- ut_a(DB_SUCCESS == lock_clust_rec_cons_read_check(
- btr_pcur_get_rec(&pcur),
- index));
-
- btr_pcur_commit_specify_mtr(&pcur, &mtr);
-
- if (i % 1211 == 0) {
- dummy++;
- }
-
- rnd = 55321;
-
- dtuple_gen_search_tuple3(entry, rnd % *((ulint*)arg), buf);
-
-/* if (i == 0) { */
- latch_mode = BTR_SEARCH_LEAF;
-/* } else {
- latch_mode = BTR_SEARCH_LEAF | BTR_GUESS_LATCH;
- } */
-
- mtr_start(&mtr2);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, latch_mode,
- &pcur2, &mtr2);
-
- ut_a(DB_SUCCESS == lock_clust_rec_cons_read_check(
- btr_pcur_get_rec(&pcur2),
- index));
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur2)));
-
- mtr_commit(&mtr2);
-
- mtr_start(&mtr);
-
- btr_pcur_restore_position(BTR_SEARCH_LEAF, &pcur, &mtr);
- }
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- tm = ut_clock();
- printf("Wall time for join of %lu rows %lu milliseconds\n",
- i, tm - oldtm);
- btr_search_index_print_info(index);
- /*-------------------------------------*/
- /* COMMIT */
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
-/* printf("Wall time for commit %lu milliseconds\n", tm - oldtm); */
-
- /*-------------------------------------*/
- count++;
-/* btr_validate_tree(tree); */
-
- if (count < 3) {
- goto loop;
- }
-
- mem_heap_free(heap);
- return(0);
-}
-
-/*********************************************************************
-Test for lock wait. Requires Test 4.1 first. */
-
-ulint
-test7(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- trx_t* trx2;
- ulint rnd;
- dtuple_t* entry;
- dtuple_t* row;
- byte buf[100];
- byte buf2[4000];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 7. LOCK WAIT\n");
-
- thr_no = *((ulint*)arg);
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx2 = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- /*-------------------------------------*/
- /* UPDATE by trx */
- ut_a(trx_start(trx, ULINT_UNDEFINED));
- ut_a(trx_start(trx2, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- update = upd_create(1, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 87607651;
-
- entry = dtuple_create(heap, 2);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- rnd += 874681;
- tuple_no = 3;
-
- dtuple_gen_search_tuple3(entry, tuple_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 2, table);
- dfield_set_data(&(ufield->new_val), buf2, rnd % 1500);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- tm = ut_clock();
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- lock_validate();
-
- lock_print_info();
-
- /*-------------------------------------*/
- /* INSERT by trx2 */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx2;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx2);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- thr->child = ins_node_create(fork, thr, row, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx2->sess);
-
- trx2->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- dtuple_gen_test_tuple3(row, 2, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- /* Insert should be left to wait until trx releases the row lock */
-
- que_run_threads(thr);
-
- tm = ut_clock();
-
- lock_validate();
-
- lock_print_info();
-
- /*-------------------------------------*/
- /* COMMIT of trx */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
-
- /*-------------------------------------*/
- os_thread_sleep(1000000);
-
- printf(
- "trx2 can now continue to do the insert, after trx committed.\n");
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- lock_validate();
-
- lock_print_info();
-
- dict_table_print_by_name("TS_TABLE1");
-
- return(0);
-}
-
-/*********************************************************************
-Inserts for TPC-A. */
-
-ulint
-test8A(
-/*===*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- dict_index_t* index;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
- btr_pcur_t pcur;
- mtr_t mtr;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 8A. 1000 INSERTS FOR TPC-A\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- btr_search_print_info();
-
- /*-------------------------------------*/
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE2", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1000; i++) {
- dtuple_gen_test_tuple_TPC_A(row, rnd, buf);
-
- rnd = rnd + 1;
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
- btr_validate_tree(tree);
-
- /* Check inserted entries */
- rnd = 0;
-
- entry = dtuple_create(heap, 1);
-
- for (i = 0; i < 1000; i++) {
- dtuple_gen_search_tuple_TPC_A(entry, rnd, buf);
-
- rnd = rnd + 1;
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur,
- &mtr);
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
- }
-
- btr_validate_tree(tree);
-
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- /*-------------------------------------*/
- count++;
-
- if (count < 1) {
- goto loop;
- }
-
-/* dict_table_print_by_name("TS_TABLE2"); */
-
- mem_heap_free(heap);
- return(0);
-}
-
-/*********************************************************************
-Test for TPC-A transaction. */
-
-ulint
-test8(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork1;
- que_fork_t* fork2;
- que_fork_t* cfork;
- dict_table_t* table;
- dict_table_t* table2;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ins_node_t* inode;
- ulint rnd = 0;
-
- arg = arg;
-
- printf("-------------------------------------------------\n");
- printf("TEST 8. TPC-A %lu \n", *((ulint*)arg));
-
- oldtm = ut_clock();
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
- /*-----------------------------------*/
-
- fork1 = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork1->trx = trx;
-
- thr = que_thr_create(fork1, fork1, heap);
-
- table = dict_table_get("TS_TABLE3", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- inode = ins_node_create(fork1, thr, row, table, heap);
-
- thr->child = inode;
-
- row_ins_init_sys_fields_at_sql_compile(inode->row, inode->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(inode->row, inode->table, trx);
-
- inode->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork1, trx->sess);
-
- trx->graph = fork1;
-
- mutex_exit(&kernel_mutex);
-
- fork2 = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork2->trx = trx;
-
- thr = que_thr_create(fork2, fork2, heap);
-
- table2 = dict_table_get("TS_TABLE2", trx);
-
- update = upd_create(1, heap);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 1, table2);
-
- entry = dtuple_create(heap, 1);
- dfield_copy(dtuple_get_nth_field(entry, 0),
- dtuple_get_nth_field(row, 0));
-
- node = upd_node_create(fork2, thr, table2, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = UPD_NODE_NO_ORD_CHANGE | UPD_NODE_NO_SIZE_CHANGE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork2, trx->sess);
-
- trx->graph = fork2;
-
- mutex_exit(&kernel_mutex);
-
- cfork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- cfork->trx = trx;
-
- thr = que_thr_create(cfork, cfork, heap);
-
- thr->child = commit_node_create(cfork, thr, heap);
-
- oldtm = ut_clock();
-
-loop:
-/* printf("Round %lu\n", count); */
-
- /*-------------------------------------*/
- /* INSERT */
-
-/* printf("Trx %lu %lu starts, thr %lu\n",
- ut_dulint_get_low(trx->id),
- (ulint)trx,
- *((ulint*)arg)); */
-
- dtuple_gen_test_tuple3(row, count, DTUPLE_TEST_FIXED30, buf);
-
- ins_node_reset(inode);
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(fork1, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- /*-------------------------------------*/
- /* 3 UPDATES */
-
- ut_a(DB_SUCCESS == lock_table(0, table2, LOCK_IX, thr));
-
- for (i = 0; i < 3; i++) {
-
- rnd += 876751;
-
- if (count % 1231 == 0) {
- dummy++;
- }
-
- dtuple_gen_search_tuple_TPC_A(entry, rnd % 1000, buf);
-
- index = dict_table_get_first_index(table2);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_MODIFY_LEAF, &pcur, &mtr);
-
-/* ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur))); */
-
-/* btr_pcur_store_position(&pcur, &mtr); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- ufield = upd_get_nth_field(update, 0);
-
- dfield_set_data(&(ufield->new_val), "1234", 5);
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(fork2, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- } /* for (i = ... */
-
- /*-------------------------------------*/
- /* COMMIT */
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(cfork, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- count++;
-
- if (count < *((ulint*)arg)) {
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- goto loop;
- }
-
-/* printf("Trx %lu %lu committed\n", ut_dulint_get_low(trx->id),
- (ulint)trx); */
- tm = ut_clock();
- printf("Wall time for TPC-A %lu trxs %lu milliseconds\n",
- count, tm - oldtm);
-
- btr_search_index_print_info(index);
- btr_search_index_print_info(dict_table_get_first_index(table));
-
-/* mem_print_info(); */
- /*-------------------------------------*/
-
-
-/* dict_table_print_by_name("TS_TABLE2");
- dict_table_print_by_name("TS_TABLE3"); */
-
- return(0);
-}
-
-/*********************************************************************
-Inserts for TPC-C. */
-
-ulint
-test9A(
-/*===*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
-/* dtuple_t* entry;
- btr_pcur_t pcur;
- mtr_t mtr;
- dict_index_t* index;
- dict_tree_t* tree;
-*/
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 9A. INSERTS FOR TPC-C\n");
-
-#define TPC_C_TABLE_SIZE 15000
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- btr_search_print_info();
-
- /*-------------------------------------*/
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE4", trx);
-
- row = dtuple_create(heap, 12 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < TPC_C_TABLE_SIZE; i++) {
-
- dtuple_gen_test_tuple_TPC_C(row, rnd, buf);
-
- rnd = rnd + 1;
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
-#ifdef notdefined
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
- btr_validate_tree(tree);
-
- /* Check inserted entries */
- rnd = 0;
-
- entry = dtuple_create(heap, 1);
-
- for (i = 0; i < TPC_C_TABLE_SIZE; i++) {
-
- dtuple_gen_search_tuple_TPC_C(entry, rnd, buf);
-
- rnd = rnd + 1;
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur,
- &mtr);
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
- }
-
- btr_validate_tree(tree);
-#endif
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- /*-------------------------------------*/
- count++;
-
- if (count < 1) {
- goto loop;
- }
-
-/* dict_table_print_by_name("TS_TABLE4"); */
-
-/* mem_heap_free(heap); */
- return(0);
-}
-
-/*********************************************************************
-Test for TPC-C transaction. Test 9A must be run first to populate table. */
-
-ulint
-test9(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork1;
- que_fork_t* fork2;
- que_fork_t* cfork;
- dict_table_t* table;
- dict_table_t* table2;
- que_thr_t* thr;
- trx_t* trx;
- ulint j;
- ulint i;
- byte* ptr;
- ulint len;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ins_node_t* inode;
- ulint rnd = 0;
- byte buf2[240];
- rec_t* rec;
-
- arg = arg;
-
- printf("-------------------------------------------------\n");
- printf("TEST 9. TPC-C %lu \n", *((ulint*)arg));
-
- oldtm = ut_clock();
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
- /*-----------------------------------*/
-
- fork1 = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork1->trx = trx;
-
- thr = que_thr_create(fork1, fork1, heap);
-
- table = dict_table_get("TS_TABLE3", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- inode = ins_node_create(fork1, thr, row, table, heap);
-
- thr->child = inode;
-
- row_ins_init_sys_fields_at_sql_compile(inode->row, inode->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(inode->row, inode->table, trx);
-
- inode->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork1, trx->sess);
-
- trx->graph = fork1;
-
- mutex_exit(&kernel_mutex);
-
- fork2 = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork2->trx = trx;
-
- thr = que_thr_create(fork2, fork2, heap);
-
- table2 = dict_table_get("TS_TABLE4", trx);
-
- update = upd_create(3, heap);
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 1, table2);
- ufield = upd_get_nth_field(update, 1);
-
- upd_field_set_col_no(ufield, 1, table2);
- ufield = upd_get_nth_field(update, 2);
-
- upd_field_set_col_no(ufield, 1, table2);
-
- entry = dtuple_create(heap, 1);
- dfield_copy(dtuple_get_nth_field(entry, 0),
- dtuple_get_nth_field(row, 0));
-
- node = upd_node_create(fork2, thr, table2, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = UPD_NODE_NO_ORD_CHANGE | UPD_NODE_NO_SIZE_CHANGE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork2, trx->sess);
-
- trx->graph = fork2;
-
- mutex_exit(&kernel_mutex);
-
- cfork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- cfork->trx = trx;
-
- thr = que_thr_create(cfork, cfork, heap);
-
- thr->child = commit_node_create(cfork, thr, heap);
-
- oldtm = ut_clock();
-loop:
- ut_a(DB_SUCCESS == lock_table(0, table2, LOCK_IS, thr));
- ut_a(DB_SUCCESS == lock_table(0, table2, LOCK_IX, thr));
-
-/* printf("Round %lu\n", count); */
-
-for (j = 0; j < 13; j++) {
-
- /*-------------------------------------*/
- /* SELECT FROM 'ITEM' */
-
- rnd += 876751;
-
- dtuple_gen_search_tuple_TPC_C(entry, rnd % TPC_C_TABLE_SIZE, buf);
-
- index = dict_table_get_first_index(table2);
- tree = dict_index_get_tree(index);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_S, thr);
- ut_a(err == DB_SUCCESS);
-
- rec = btr_pcur_get_rec(&pcur);
-
- for (i = 0; i < 5; i++) {
- ptr = rec_get_nth_field(rec, i + 2, &len);
-
- ut_memcpy(buf2 + i * 24, ptr, len);
- }
-
- mtr_commit(&mtr);
-
- /*-------------------------------------*/
- /* UPDATE 'STOCK' */
-
- rnd += 876751;
-
- if (count % 1231 == 0) {
- dummy++;
- }
-
- dtuple_gen_search_tuple_TPC_C(entry, rnd % TPC_C_TABLE_SIZE, buf);
-
- index = dict_table_get_first_index(table2);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_MODIFY_LEAF, &pcur, &mtr);
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
-
-/* btr_pcur_store_position(&pcur, &mtr); */
-
- rec = btr_pcur_get_rec(&pcur);
-
- for (i = 0; i < 10; i++) {
- ptr = rec_get_nth_field(rec, i + 2, &len);
-
- ut_memcpy(buf2 + i * 24, ptr, len);
- }
-
-/* btr_pcur_commit(&pcur); */
-
-/* err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr); */
- ut_a(DB_SUCCESS == lock_clust_rec_cons_read_check(
- btr_pcur_get_rec(&pcur),
- index));
-/* ut_a(err == DB_SUCCESS); */
-
- ufield = upd_get_nth_field(update, 0);
-
- dfield_set_data(&(ufield->new_val), "1234", 5);
-
- ufield = upd_get_nth_field(update, 1);
-
- dfield_set_data(&(ufield->new_val), "1234", 5);
-
- ufield = upd_get_nth_field(update, 2);
-
- dfield_set_data(&(ufield->new_val), "1234", 5);
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(fork2, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- btr_pcur_close(&pcur);
- /*-------------------------------------*/
- /* INSERT INTO 'ORDERLINE' */
-
-/* printf("Trx %lu %lu starts, thr %lu\n",
- ut_dulint_get_low(trx->id),
- (ulint)trx,
- *((ulint*)arg)); */
-
- dtuple_gen_test_tuple3(row, count * 13 + j, DTUPLE_TEST_FIXED30, buf);
-
- ins_node_reset(inode);
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(fork1, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-}
- /*-------------------------------------*/
- /* COMMIT */
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(cfork, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* printf("Trx %lu %lu committed\n", ut_dulint_get_low(trx->id),
- (ulint)trx); */
- count++;
-
- if (count < *((ulint*)arg)) {
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- goto loop;
- }
-
- tm = ut_clock();
- printf("Wall time for TPC-C %lu trxs %lu milliseconds\n",
- count, tm - oldtm);
-
- btr_search_index_print_info(index);
- btr_search_index_print_info(dict_table_get_first_index(table));
-
-/* mem_print_info(); */
- /*-------------------------------------*/
-/* dict_table_print_by_name("TS_TABLE2");
- dict_table_print_by_name("TS_TABLE3"); */
-
- return(0);
-}
-
-/*********************************************************************
-Init for purge test. */
-
-ulint
-test10_1(
-/*=====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint thr_no;
-
- thr_no = *((ulint*)arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.1. PURGE INIT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- thr->child = ins_node_create(fork, thr, row, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 200; i++) {
-
- dtuple_gen_test_tuple3(row, i * 100 + thr_no,
- DTUPLE_TEST_FIXED30, buf);
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- return(0);
-}
-
-/*********************************************************************
-Test for purge. */
-
-ulint
-test10_2(
-/*=====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* entry;
- byte buf[100];
- byte buf2[1000];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.2. PURGE TEST UPDATES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- /*-------------------------------------*/
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- update = upd_create(2, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 87607651;
-
- entry = dtuple_create(heap, 1);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- for (i = 0; i < 200; i++) {
-
- tuple_no = i;
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + thr_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
-/* printf("Thread %lu to update row %lu\n", thr_no, tuple_no); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 0, table);
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + 10 + thr_no, buf);
-
- dfield_set_data(&(ufield->new_val), dfield_get_data(
- dtuple_get_nth_field(entry, 0)),
- dfield_get_len(
- dtuple_get_nth_field(entry, 0)));
- ufield = upd_get_nth_field(update, 1);
-
- upd_field_set_col_no(ufield, 1, table);
-
- rnd += 98326761;
-
- dfield_set_data(&(ufield->new_val), buf2, rnd % 200);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- fsp_validate(0);
-
- } /* for (i = ... */
-
- tm = ut_clock();
- printf("Wall time for %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
-/* lock_print_info(); */
-
-/* mem_print_info(); */
-
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- count++;
-
- if (count < 1) {
-
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for purge. */
-
-ulint
-test10_2_r(
-/*=======*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* entry;
- byte buf[100];
- byte buf2[1000];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.2. PURGE TEST UPDATES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- /*-------------------------------------*/
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- update = upd_create(2, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 87607651;
-
- entry = dtuple_create(heap, 1);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- for (i = 0; i < 200; i++) {
-
- tuple_no = i;
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + thr_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
-/* printf("Thread %lu to update row %lu\n", thr_no, tuple_no); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 0, table);
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + 10 + thr_no, buf);
-
- dfield_set_data(&(ufield->new_val), dfield_get_data(
- dtuple_get_nth_field(entry, 0)),
- dfield_get_len(
- dtuple_get_nth_field(entry, 0)));
- ufield = upd_get_nth_field(update, 1);
-
- upd_field_set_col_no(ufield, 1, table);
-
- rnd += 98326761;
-
- dfield_set_data(&(ufield->new_val), buf2, rnd % 2000);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- fsp_validate(0);
-
- } /* for (i = ... */
-
- tm = ut_clock();
- printf("Wall time for %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
-/* lock_print_info(); */
-
- mem_pool_print_info(mem_comm_pool);
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(2000000);
-
- count++;
-
- if (count < 1) {
-
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for purge. */
-
-ulint
-test10_3(
-/*=====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* entry;
- byte buf[100];
- btr_pcur_t pcur;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- del_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.3. PURGE TEST DELETES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- /*-------------------------------------*/
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- node = del_node_create(fork, thr, table, &pcur, heap);
- thr->child = node;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- entry = dtuple_create(heap, 1);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- for (i = 0; i < 200; i++) {
-
- rnd = i;
- tuple_no = rnd;
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + 10 + thr_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
-/* printf("Thread %lu to update row %lu\n", thr_no, tuple_no); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- } /* for (i = ... */
-
- tm = ut_clock();
- printf("Wall time for %lu delete markings %lu milliseconds\n",
- i, tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
-/* lock_print_info(); */
-
-/* mem_print_info(); */
-
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- return(0);
-}
-
-/*********************************************************************
-Test for purge. */
-
-ulint
-test10_5(
-/*=====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* entry;
- byte buf[100];
- btr_pcur_t pcur;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- del_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.5. PURGE TEST UNCOMMITTED DELETES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- /*-------------------------------------*/
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- node = del_node_create(fork, thr, table, &pcur, heap);
- thr->child = node;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- entry = dtuple_create(heap, 1);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- for (i = 0; i < 50; i++) {
-
- rnd = i;
- tuple_no = rnd % 100;
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + 10 + thr_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
-/* printf("Thread %lu to update row %lu\n", thr_no, tuple_no); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- } /* for (i = ... */
-
- tm = ut_clock();
- printf("Wall time for %lu delete markings %lu milliseconds\n",
- i, tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
-/* lock_print_info(); */
-
-/* mem_print_info(); */
-
- return(0);
-}
-
-/*********************************************************************
-Multithreaded test for purge. */
-
-ulint
-test10mt(
-/*=====*/
- void* arg)
-{
- ulint i;
- ulint thr_no;
-
- thr_no = *((ulint*)arg);
-
- printf("Thread %lu starts purge test\n", thr_no);
-
- for (i = 0; i < 2; i++) {
- test10_1(arg);
-
- sync_print();
-
- fsp_validate(0);
-
- test10_2_r(arg);
- sync_print();
-
- test10_2(arg);
- sync_print();
-
- lock_validate();
-
- test10_3(arg);
- sync_print();
- }
-
- printf("Thread %lu ends purge test\n", thr_no);
-
- return(0);
-}
-
-/*********************************************************************
-Purge test. */
-
-ulint
-test10_4(
-/*=====*/
- void* arg)
-{
- ulint i;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.4. PURGE TEST\n");
-
- for (i = 0; i < 30; i++) {
- trx_purge();
-
- printf("%lu pages purged\n", purge_sys->n_pages_handled);
-
- os_thread_sleep(5000000);
- }
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- return(0);
-}
-
-/*********************************************************************
-This thread is used to test insert buffer merge. */
-
-ulint
-test_ibuf_merge(
-/*============*/
- void* arg)
-{
- ulint sum_sizes;
- ulint volume;
-
- ut_ad(arg);
-
- printf("Starting ibuf merge\n");
-
- sum_sizes = 0;
- volume = 1;
-
- while (volume) {
- volume = ibuf_contract(FALSE);
-
- sum_sizes += volume;
- }
-
- printf("Ibuf merged %lu bytes\n", sum_sizes);
-
- os_thread_sleep(5000000);
-
- return(0);
-}
-
-/*********************************************************************
-This thread is used to measure contention of latches. */
-
-ulint
-test_measure_cont(
-/*==============*/
- void* arg)
-{
- ulint i, j;
- ulint count;
-
- ut_ad(arg);
-
- printf("Starting contention measurement\n");
-
- for (i = 0; i < 1000; i++) {
- count = 0;
-
- for (j = 0; j < 100; j++) {
-
- os_thread_sleep(10000);
-
- if ((&(buf_pool->mutex))->lock_word) {
-
- count++;
- }
- }
-
- printf("Mutex reserved %lu of %lu peeks\n", count, j);
- }
-
- return(0);
-}
-
-/********************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
- os_thread_id_t id[10];
- ulint n1000[10];
- ulint i;
- ulint n5000 = 500;
- ulint n2;
-
-/* buf_debug_prints = TRUE; */
- log_do_write = FALSE;
- btr_search_use_hash = FALSE;
-
- srv_boot("initfile");
- os_aio_init(576, 9, 100);
- fil_init(25);
- buf_pool_init(POOL_SIZE, POOL_SIZE);
- fsp_init();
- log_init();
- lock_sys_create(1024);
-
- create_files();
-
- init_spaces();
-
- sess_sys_init_at_db_start();
-
- trx_sys_create();
-
- dict_create();
-
-/* os_thread_sleep(500000); */
-
- oldtm = ut_clock();
-
- ut_rnd_set_seed(19);
-
- test1(NULL);
- test1_5(NULL);
- test1_6(NULL);
- test1_7(NULL);
-
-/* for (i = 0; i < 2; i++) {
-
- n1000[i] = i;
- id[i] = id[i];
-
- os_thread_create(test10mt, n1000 + i, id + i);
- }
-*/
- i = 4;
-
- n1000[i] = i;
- id[i] = id[i];
-
-/* os_thread_create(test10_4, n1000 + i, id + i); */
-
- i = 5;
-
-/* test10mt(&i);
-
- i = 6;
-
- test10mt(&i);
-
- trx_purge();
- printf("%lu pages purged\n", purge_sys->n_pages_handled);
-
- dict_table_print_by_name("TS_TABLE1"); */
-
-/* os_thread_create(test_measure_cont, &n3, id + 0); */
-
-/* mem_print_info(); */
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- n2 = 2000;
-
-/* test2_1(&n2); */
-
- sync_print();
-
- test9A(&n2);
-
- sync_print();
-
- log_print();
-
- test9(&n2);
-
- log_print();
-
- sync_print();
-/* test6(&n2); */
-
-/* test2(&n2); */
-
-/* test2_2(&n2); */
-
-/* mem_print_info(); */
-
- for (i = 0; i < 2; i++) {
-
- n1000[i] = 1000 + 10 * i;
- id[i] = id[i];
-
-/* os_thread_create(test2mt, n1000 + i, id + i);
- os_thread_create(test2_1mt, n1000 + i, id + i);
- os_thread_create(test2_2mt, n1000 + i, id + i); */
- }
-
- n2 = 2000;
-
-/* test2mt(&n2); */
-
-/* buf_print();
- ibuf_print();
- rw_lock_list_print_info();
- mutex_list_print_info();
-
- dict_table_print_by_name("TS_TABLE1"); */
-
-/* mem_print_info(); */
-
- n2 = 1000;
-
-/* test4_1();
- test4_2();
-
- for (i = 0; i < 2; i++) {
- n1000[i] = i;
- id[i] = id[i];
- os_thread_create(test4mt, n1000 + i, id + i);
- }
-
- n2 = 4;
- test4mt(&n2);
- test4mt(&n2);
- test4_2();
- lock_print_info(); */
-
-/* test7(&n2); */
-
-/* os_thread_sleep(25000000); */
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/btr/ts/tsbtrins.c b/innobase/btr/ts/tsbtrins.c
deleted file mode 100644
index 85eedd292b1..00000000000
--- a/innobase/btr/ts/tsbtrins.c
+++ /dev/null
@@ -1,802 +0,0 @@
-/************************************************************************
-Test for the B-tree
-
-(c) 1994-1997 Innobase Oy
-
-Created 2/16/1996 Heikki Tuuri
-*************************************************************************/
-
-#include "os0proc.h"
-#include "sync0sync.h"
-#include "ut0mem.h"
-#include "mem0mem.h"
-#include "mem0pool.h"
-#include "data0data.h"
-#include "data0type.h"
-#include "dict0dict.h"
-#include "buf0buf.h"
-#include "os0file.h"
-#include "os0thread.h"
-#include "fil0fil.h"
-#include "fsp0fsp.h"
-#include "rem0rec.h"
-#include "rem0cmp.h"
-#include "mtr0mtr.h"
-#include "log0log.h"
-#include "page0page.h"
-#include "page0cur.h"
-#include "trx0trx.h"
-#include "dict0boot.h"
-#include "trx0sys.h"
-#include "dict0crea.h"
-#include "btr0btr.h"
-#include "btr0pcur.h"
-#include "btr0cur.h"
-#include "btr0sea.h"
-#include "rem0rec.h"
-#include "srv0srv.h"
-#include "que0que.h"
-#include "com0com.h"
-#include "usr0sess.h"
-#include "lock0lock.h"
-#include "trx0roll.h"
-#include "trx0purge.h"
-#include "row0ins.h"
-#include "row0upd.h"
-#include "row0row.h"
-#include "row0del.h"
-#include "lock0lock.h"
-#include "ibuf0ibuf.h"
-
-os_file_t files[1000];
-
-mutex_t ios_mutex;
-ulint ios;
-ulint n[10];
-
-mutex_t incs_mutex;
-ulint incs;
-
-#define N_SPACES 2 /* must be >= 2 */
-#define N_FILES 1
-#define FILE_SIZE 8096 /* must be > 512 */
-#define POOL_SIZE 1024
-#define IBUF_SIZE 200
-#define COUNTER_OFFSET 1500
-
-#define LOOP_SIZE 150
-#define N_THREADS 5
-
-#define COUNT 1
-
-ulint zero = 0;
-
-buf_block_t* bl_arr[POOL_SIZE];
-
-ulint dummy = 0;
-
-byte test_buf[8000];
-
-/************************************************************************
-Io-handler thread function. */
-
-ulint
-handler_thread(
-/*===========*/
- void* arg)
-{
- ulint segment;
- void* mess;
- ulint i;
- bool ret;
-
- segment = *((ulint*)arg);
-
- printf("Io handler thread %lu starts\n", segment);
-
- for (i = 0;; i++) {
- ret = fil_aio_wait(segment, &mess);
- ut_a(ret);
-
- buf_page_io_complete((buf_block_t*)mess);
-
- mutex_enter(&ios_mutex);
- ios++;
- mutex_exit(&ios_mutex);
-
- }
-
- return(0);
-}
-
-/*************************************************************************
-Creates the files for the file system test and inserts them to the file
-system. */
-
-void
-create_files(void)
-/*==============*/
-{
- bool ret;
- ulint i, k;
- char name[20];
- os_thread_t thr[10];
- os_thread_id_t id[10];
-
- printf("--------------------------------------------------------\n");
- printf("Create or open database files\n");
-
- strcpy(name, "tsfile00");
-
- for (k = 0; k < N_SPACES; k++) {
- for (i = 0; i < N_FILES; i++) {
-
- name[6] = (char)((ulint)'0' + k);
- name[7] = (char)((ulint)'0' + i);
-
- files[i] = os_file_create(name, OS_FILE_CREATE,
- OS_FILE_TABLESPACE, &ret);
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(
- name, OS_FILE_OPEN,
- OS_FILE_TABLESPACE, &ret);
- ut_a(ret);
- } else {
- if (k == 1) {
- ut_a(os_file_set_size(files[i],
- 8192 * IBUF_SIZE, 0));
- } else {
- ut_a(os_file_set_size(files[i],
- 8192 * FILE_SIZE, 0));
- }
- }
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create(name, k, OS_FILE_TABLESPACE);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, FILE_SIZE, k);
- }
- }
-
- ios = 0;
-
- mutex_create(&ios_mutex);
- mutex_set_level(&ios_mutex, SYNC_NO_ORDER_CHECK);
-
- for (i = 0; i < 9; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(handler_thread, n + i, id + i);
- }
-}
-
-/************************************************************************
-Inits space headers of spaces 0 and 1. */
-
-void
-init_spaces(void)
-/*=============*/
-{
- mtr_t mtr;
-
- mtr_start(&mtr);
-
- fsp_header_init(0, FILE_SIZE * N_FILES, &mtr);
- fsp_header_init(1, IBUF_SIZE, &mtr);
-
- mtr_commit(&mtr);
-}
-
-/*********************************************************************
-Test for table creation. */
-
-ulint
-test1(
-/*==*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- dict_index_t* index;
- dict_table_t* table;
- que_fork_t* fork;
- que_thr_t* thr;
- trx_t* trx;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1. CREATE TABLE WITH 3 COLUMNS AND WITH 3 INDEXES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- table = dict_mem_table_create("TS_TABLE1", 0, 3);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- /*------------------------------------*/
- /* CREATE TABLE */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = tab_create_graph_create(fork, thr, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS"); */
- /*-------------------------------------*/
- /* CREATE CLUSTERED INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND1", 0,
- DICT_UNIQUE | DICT_CLUSTERED, 1);
- dict_mem_index_add_field(index, "COL1", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- /*-------------------------------------*/
- /* CREATE SECONDARY INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND2", 0, 0, 1);
-
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- /*-------------------------------------*/
- /* CREATE ANOTHER SECONDARY INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND3", 0, 0, 1);
-
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-#ifdef notdefined
- /*-------------------------------------*/
- /* CREATE YET ANOTHER SECONDARY INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND4", 0, 0, 1);
-
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-#endif
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- return(0);
-}
-
-/*********************************************************************
-Another test for inserts. */
-
-ulint
-test2_1(
-/*====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- byte buf[100];
- ins_node_t* node;
- ulint count = 0;
- ulint rnd;
- dtuple_t* row;
- dict_index_t* index;
-/* dict_tree_t* tree;
- dtuple_t* entry;
- btr_pcur_t pcur;
- mtr_t mtr; */
-
- printf("-------------------------------------------------\n");
- printf("TEST 2.1. MASSIVE ASCENDING INSERT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- log_print();
-
- oldtm = ut_clock();
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- if (i % 5000 == 0) {
- /* ibuf_print(); */
- /* buf_print(); */
-
- /* buf_print_io(); */
- /*
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n",
- i, tm - oldtm); */
- }
-
- rnd = rnd + 1;
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- log_print();
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
-/* ibuf_print(); */
-
- index = index;
-
- index = dict_table_get_first_index(table);
-
- if (zero) {
- btr_search_index_print_info(index);
- }
-
- btr_validate_tree(dict_index_get_tree(index));
-
-#ifdef notdefined
- index = dict_table_get_next_index(index);
-
- if (zero) {
- btr_search_index_print_info(index);
- }
-
- btr_validate_tree(dict_index_get_tree(index));
-
- index = dict_table_get_next_index(index);
-
-/* btr_search_index_print_info(index); */
-
- btr_validate_tree(dict_index_get_tree(index));
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- /* Check inserted entries */
-
- btr_search_print_info();
-
- entry = dtuple_create(heap, 1);
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- for (i = 0; i < *((ulint*)arg); i++) {
- ut_a(btr_pcur_move_to_next(&pcur, &mtr));
-
- dtuple_gen_search_tuple3(entry, i, buf);
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
- }
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-#endif
- /*-------------------------------------*/
- /* ROLLBACK */
-
-#ifdef notdefined
-/* btr_validate_tree(tree); */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(1000000);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
-
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- btr_search_print_info();
-#endif
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
- /*-------------------------------------*/
-
- count++;
-/* btr_validate_tree(tree); */
-
- if (count < 1) {
- goto loop;
- }
-
- mem_heap_free(heap);
-
- return(0);
-}
-
-/********************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
- os_thread_id_t id[10];
- ulint n1000[10];
- ulint i;
- ulint n5000 = 500;
- ulint n2;
-
-/* buf_debug_prints = TRUE; */
- log_do_write = TRUE;
-
- srv_boot("initfile");
- os_aio_init(576, 9, 100);
- fil_init(25);
- buf_pool_init(POOL_SIZE, POOL_SIZE);
- fsp_init();
- log_init();
- lock_sys_create(1024);
-
- create_files();
-
- init_spaces();
-
- sess_sys_init_at_db_start();
-
- trx_sys_create();
-
- dict_create();
-
-/* os_thread_sleep(500000); */
-
- oldtm = ut_clock();
-
- ut_rnd_set_seed(19);
-
- test1(NULL);
-
-/* for (i = 0; i < 2; i++) {
-
- n1000[i] = i;
- id[i] = id[i];
-
- os_thread_create(test10mt, n1000 + i, id + i);
- }
-*/
- i = 4;
-
- n1000[i] = i;
- id[i] = id[i];
-
-/* os_thread_create(test10_4, n1000 + i, id + i); */
-
- i = 5;
-
-/* test10mt(&i);
-
- i = 6;
-
- test10mt(&i);
-
- trx_purge();
- printf("%lu pages purged\n", purge_sys->n_pages_handled);
-
- dict_table_print_by_name("TS_TABLE1"); */
-
-/* os_thread_create(test_measure_cont, &n3, id + 0); */
-
-/* mem_print_info(); */
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- log_flush_up_to(ut_dulint_zero);
-
- os_thread_sleep(500000);
-
- n2 = 10000;
-
- test2_1(&n2);
-
-/* test9A(&n2);
- test9(&n2); */
-
-/* test6(&n2); */
-
-/* test2(&n2); */
-
-/* test2_2(&n2); */
-
-/* mem_print_info(); */
-
- for (i = 0; i < 2; i++) {
-
- n1000[i] = 1000 + 10 * i;
- id[i] = id[i];
-
-/* os_thread_create(test2mt, n1000 + i, id + i);
- os_thread_create(test2_1mt, n1000 + i, id + i);
- os_thread_create(test2_2mt, n1000 + i, id + i); */
- }
-
- n2 = 2000;
-
-/* test2mt(&n2); */
-
-/* buf_print();
- ibuf_print();
- rw_lock_list_print_info();
- mutex_list_print_info();
-
- dict_table_print_by_name("TS_TABLE1"); */
-
-/* mem_print_info(); */
-
- n2 = 1000;
-
-/* test4_1();
- test4_2();
-
- for (i = 0; i < 2; i++) {
- n1000[i] = i;
- id[i] = id[i];
- os_thread_create(test4mt, n1000 + i, id + i);
- }
-
- n2 = 4;
- test4mt(&n2);
- test4mt(&n2);
- test4_2();
- lock_print_info(); */
-
-/* test7(&n2); */
-
-/* os_thread_sleep(25000000); */
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/btr/ts/tscli.c b/innobase/btr/ts/tscli.c
deleted file mode 100644
index 6c42a83cdbe..00000000000
--- a/innobase/btr/ts/tscli.c
+++ /dev/null
@@ -1,3380 +0,0 @@
-/************************************************************************
-Tests for the client, TPC-C, and TPC-D Query 5
-
-(c) 1996-1998 Innobase Oy
-
-Created 2/16/1996 Heikki Tuuri
-*************************************************************************/
-
-#include "univ.i"
-#include "ib_odbc.h"
-#include "mem0mem.h"
-#include "sync0sync.h"
-#include "os0thread.h"
-#include "os0proc.h"
-#include "os0sync.h"
-#include "srv0srv.h"
-
-ulint n_exited = 0;
-
-/* Disk wait simulation array */
-typedef struct srv_sim_disk_struct srv_sim_disk_t;
-struct srv_sim_disk_struct{
- os_event_t event; /* OS event to wait */
- bool event_set;/* TRUE if the event is in the set state */
- bool empty; /* TRUE if this cell not reserved */
-};
-
-#define SRV_N_SIM_DISK_ARRAY 150
-
-srv_sim_disk_t srv_sim_disk[SRV_N_SIM_DISK_ARRAY];
-
-/* Random counter used in disk wait simulation */
-ulint srv_disk_rnd = 982364761;
-ulint srv_disk_n_active_threads = 0;
-
-char cli_srv_endpoint_name[100];
-char cli_user_name[100];
-
-ulint n_warehouses = ULINT_MAX;
-ulint n_customers_d = ULINT_MAX;
-bool is_tpc_d = FALSE;
-ulint n_rounds = ULINT_MAX;
-ulint n_users = ULINT_MAX;
-ulint startdate = 0;
-ulint enddate = 0;
-bool own_warehouse = FALSE;
-
-ulint mem_pool_size = ULINT_MAX;
-
-/*********************************************************************
-Test for TPC-C. */
-
-ulint
-test_init(
-/*======*/
- void* arg)
-{
- HENV env;
- HDBC conn;
- RETCODE ret;
- HSTMT stat;
- HSTMT create_query;
- HSTMT populate_query;
- char* str;
- char* str1;
- char* str2;
- char* str3;
- char* str4;
- char* str5;
- char* str6;
- char* create_str;
- char* populate_str;
- char* commit_str;
- char* new_order_str;
- char* payment_str;
- char* order_status_str;
- char* delivery_str;
- char* stock_level_str;
- char* consistency_str;
- char* query_5_str;
- char* print_str;
- char* lock_wait_str;
- char* join_test_str;
- char* test_errors_str;
- char* test_group_commit_str;
- char* test_single_row_select_str;
- char* rollback_str;
- char* ibuf_test_str;
- SDWORD n_warehouses_buf;
- SDWORD n_warehouses_len;
- SDWORD n_customers_d_buf;
- SDWORD n_customers_d_len;
-
- UT_NOT_USED(arg);
-
- /*------------------------------------------------------*/
-
- str1 =
-
-" PROCEDURE CREATE_TABLES () IS"
-" BEGIN"
-" CREATE TABLE WAREHOUSE (W_ID CHAR, W_NAME CHAR,"
-" W_STREET_1 CHAR, W_STREET_2 CHAR,"
-" W_CITY CHAR,"
-" W_STATE CHAR, W_ZIP CHAR,"
-" W_TAX INT,"
-" W_YTD_HIGH INT,"
-" W_YTD INT);"
-""
-" CREATE UNIQUE CLUSTERED INDEX W_IND ON WAREHOUSE (W_ID);"
-""
-" CREATE TABLE DISTRICT (D_ID CHAR, D_W_ID CHAR,"
-" D_NAME CHAR,"
-" D_STREET_1 CHAR, D_STREET_2 CHAR,"
-" D_CITY CHAR,"
-" D_STATE CHAR, D_ZIP CHAR,"
-" D_TAX INT,"
-" D_YTD_HIGH INT,"
-" D_YTD INT,"
-" D_NEXT_O_ID INT);"
-""
-" CREATE UNIQUE CLUSTERED INDEX D_IND ON DISTRICT (D_W_ID, D_ID);"
-""
-" CREATE TABLE CUSTOMER (C_ID CHAR, C_D_ID CHAR, C_W_ID CHAR,"
-" C_FIRST CHAR, C_MIDDLE CHAR,"
-" C_LAST CHAR,"
-" C_STREET_1 CHAR, C_STREET_2 CHAR,"
-" C_CITY CHAR,"
-" C_STATE CHAR, C_ZIP CHAR,"
-" C_PHONE CHAR,"
-" C_SINCE_TIME INT,"
-" C_SINCE INT,"
-" C_CREDIT CHAR,"
-" C_CREDIT_LIM_HIGH INT,"
-" C_CREDIT_LIM INT,"
-" C_DISCOUNT INT,"
-" C_BALANCE_HIGH INT,"
-" C_BALANCE INT,"
-" C_YTD_PAYMENT_HIGH INT,"
-" C_YTD_PAYMENT INT,"
-" C_PAYMENT_CNT INT,"
-" C_DELIVERY_CNT INT,"
-" C_DATA CHAR) /*DOES_NOT_FIT_IN_MEMORY*/;"
-""
-" CREATE UNIQUE CLUSTERED INDEX C_IND ON CUSTOMER (C_W_ID, C_D_ID,"
-" C_ID);"
-""
-" CREATE INDEX C_LAST_IND ON CUSTOMER (C_W_ID, C_D_ID, C_LAST,"
-" C_FIRST);"
-""
-" CREATE TABLE HISTORY (H_C_ID CHAR, H_C_D_ID CHAR, H_C_W_ID CHAR,"
-" H_D_ID CHAR, H_W_ID CHAR,"
-" H_DATE INT,"
-" H_AMOUNT INT,"
-" H_DATA CHAR);"
-""
-" CREATE CLUSTERED INDEX H_IND ON HISTORY (H_W_ID);"
-""
-" CREATE TABLE NEW_ORDER (NO_O_ID INT,"
-" NO_D_ID CHAR,"
-" NO_W_ID CHAR);"
-""
-" CREATE UNIQUE CLUSTERED INDEX NO_IND ON NEW_ORDER (NO_W_ID, NO_D_ID,"
-" NO_O_ID);"
- ;
-
- str2 =
-
-" CREATE TABLE ORDERS (O_ID INT, O_D_ID CHAR, O_W_ID CHAR,"
-" O_C_ID CHAR,"
-" O_ENTRY_D INT,"
-" O_CARRIER_ID INT,"
-" O_OL_CNT INT,"
-" O_ALL_LOCAL CHAR);"
-""
-" CREATE UNIQUE CLUSTERED INDEX O_IND ON ORDERS (O_W_ID, O_D_ID,"
-" O_ID);"
-" CREATE INDEX O_C_IND ON ORDERS (O_W_ID, O_D_ID, O_C_ID);"
-""
-" CREATE TABLE ORDER_LINE (OL_O_ID INT, OL_D_ID CHAR, OL_W_ID CHAR,"
-" OL_NUMBER CHAR,"
-" OL_I_ID CHAR,"
-" OL_SUPPLY_W_ID CHAR,"
-" OL_DELIVERY_D INT,"
-" OL_QUANTITY INT,"
-" OL_AMOUNT INT,"
-" OL_DIST_INFO CHAR);"
-""
-" CREATE UNIQUE CLUSTERED INDEX OL_IND ON ORDER_LINE"
-" (OL_W_ID, OL_D_ID, OL_O_ID, OL_NUMBER);"
-""
-" CREATE TABLE ITEM (I_ID CHAR, I_IM_ID CHAR, I_NAME CHAR,"
-" I_PRICE INT,"
-" I_DATA CHAR);"
-""
-" CREATE UNIQUE CLUSTERED INDEX I_IND ON ITEM (I_ID);"
-""
-" CREATE TABLE STOCK (S_I_ID CHAR,"
-" S_W_ID CHAR,"
-" S_QUANTITY INT,"
-" S_DIST_01 CHAR,"
-" S_DIST_02 CHAR,"
-" S_DIST_03 CHAR,"
-" S_DIST_04 CHAR,"
-" S_DIST_05 CHAR,"
-" S_DIST_06 CHAR,"
-" S_DIST_07 CHAR,"
-" S_DIST_08 CHAR,"
-" S_DIST_09 CHAR,"
-" S_DIST_10 CHAR,"
-" S_YTD INT,"
-" S_ORDER_CNT INT,"
-" S_REMOTE_CNT INT,"
-" S_DATA CHAR) /*DOES_NOT_FIT_IN_MEMORY*/;"
-""
-" CREATE UNIQUE CLUSTERED INDEX S_IND ON STOCK (S_W_ID, S_I_ID);"
-""
-""
-" CREATE TABLE REGION (R_REGIONKEY INT, R_NAME CHAR, R_COMMENT CHAR);"
-""
-" CREATE UNIQUE CLUSTERED INDEX R_IND ON REGION (R_REGIONKEY);"
-""
-" CREATE TABLE NATION (N_NATIONKEY INT, N_NAME CHAR, N_REGIONKEY INT,"
-" N_COMMENT CHAR);"
-" CREATE UNIQUE CLUSTERED INDEX N_IND ON NATION (N_NATIONKEY);"
-""
-" CREATE TABLE NATION_2 (N2_NATIONKEY INT, N2_NAME CHAR,"
-" N2_REGIONKEY INT, N2_COMMENT CHAR);"
-" CREATE UNIQUE CLUSTERED INDEX N2_IND ON NATION_2 (N2_NAME);"
-""
-" CREATE TABLE SUPPLIER (S_SUPPKEY INT, S_NAME CHAR, S_ADDRESS CHAR,"
-" S_NATIONKEY INT, S_PHONE CHAR,"
-" S_ACCTBAL INT, S_COMMENT CHAR);"
-" CREATE UNIQUE CLUSTERED INDEX SU_IND ON SUPPLIER (S_SUPPKEY);"
-""
-" CREATE TABLE CUSTOMER_D (C_CUSTKEY INT, C_NAME CHAR, C_ADDRESS CHAR,"
-" C_NATIONKEY INT, C_PHONE CHAR,"
-" C_ACCTBAL INT, C_MKTSEGMENT CHAR,"
-" C_COMMENT CHAR);"
-" CREATE UNIQUE CLUSTERED INDEX CU_IND ON CUSTOMER_D (C_CUSTKEY);"
-""
-" CREATE TABLE ORDERS_D (O_ORDERKEY INT, O_CUSTKEY INT,"
-" O_ORDERSTATUS CHAR, O_TOTALPRICE INT,"
-" O_ORDERDATE INT,"
-" O_ORDERPRIORITY CHAR,"
-" O_CLERK CHAR, O_SHIPPRIORITY INT,"
-" O_COMMENT CHAR);"
-""
-" CREATE UNIQUE CLUSTERED INDEX OR_IND ON ORDERS_D (O_ORDERKEY);"
-""
-" CREATE INDEX OR_D_IND ON ORDERS_D (O_ORDERDATE, O_ORDERKEY,"
-" O_CUSTKEY);"
-""
-" CREATE TABLE LINEITEM (L_ORDERKEY INT, L_PARTKEY INT, L_SUPPKEY INT,"
-" L_LINENUMBER INT, L_QUANTITY INT,"
-" L_EXTENDEDPRICE INT,"
-" L_DISCOUNT INT, L_TAX INT,"
-" L_RETURNFLAG CHAR,"
-" L_LINESTATUS CHAR,"
-" L_SHIPDATE INT, L_COMMITDATE INT,"
-" L_RECEIPTDATE INT,"
-" L_SHIPINSTRUCT CHAR,"
-" L_SHIPMODE CHAR, L_COMMENT CHAR);"
-""
-" CREATE UNIQUE CLUSTERED INDEX L_IND ON LINEITEM (L_ORDERKEY,"
-" L_LINENUMBER);"
-""
-" CREATE TABLE ACCOUNTA (A_NUM INT, A_BAL INT);"
-""
-" CREATE UNIQUE CLUSTERED INDEX ACCOUNTA_IND ON ACCOUNTA (A_NUM);"
-""
-" CREATE TABLE TELLERA (T_NUM INT, T_BAL INT);"
-""
-" CREATE UNIQUE CLUSTERED INDEX TELLERA_IND ON TELLERA (T_NUM);"
-""
-" CREATE TABLE BRANCHA (B_NUM INT, B_BAL INT);"
-""
-" CREATE UNIQUE CLUSTERED INDEX BRANCHA_IND ON BRANCHA (B_NUM);"
-""
-" CREATE TABLE HISTORYA (H_NUM INT, H_TEXT CHAR);"
-""
-" CREATE CLUSTERED INDEX HISTORYA_IND ON HISTORYA (H_NUM);"
-""
-" CREATE TABLE JTEST1 (JT1_A INT, JT1_B INT);"
-""
-" CREATE UNIQUE CLUSTERED INDEX JT_IND1 ON JTEST1 (JT1_A);"
-""
-" CREATE TABLE JTEST2 (JT2_A INT, JT2_B INT);"
-""
-" CREATE UNIQUE CLUSTERED INDEX JT_IND2 ON JTEST2 (JT2_A);"
-""
-" CREATE TABLE IBUF_TEST (IB_A INT, IB_B CHAR) DOES_NOT_FIT_IN_MEMORY;"
-""
-" CREATE UNIQUE CLUSTERED INDEX IBUF_IND ON IBUF_TEST (IB_A);"
-" END;"
- ;
-
- create_str = ut_str_catenate(str1, str2);
- /*-----------------------------------------------------------*/
-
- str1 =
-
-" PROCEDURE POPULATE_TABLES (n_warehouses IN INT, n_customers_d"
-" IN INT) IS"
-""
-" i INT;"
-" j INT;"
-" k INT;"
-" t INT;"
-" string CHAR;"
-" rnd1 INT;"
-" rnd2 INT;"
-" rnd INT;"
-" n_items INT;"
-" n_districts INT;"
-" n_customers INT;"
-""
-" BEGIN"
-""
-"/**********************************************************/"
-" PRINTF('Starting Mikko-test');"
-""
-" FOR i IN 1 .. 5 LOOP"
-" INSERT INTO IBUF_TEST VALUES (i, 'Mikko');"
-" END LOOP;"
-""
-" /* PRINTF('Printing rows from Mikko-test:');"
-""
-" ROW_PRINTF SELECT * FROM IBUF_TEST; */"
-""
-" SELECT SUM(IB_A) INTO t FROM IBUF_TEST;"
-""
-" PRINTF('Sum of 1 to ', i, ' is ', t);"
-" ASSERT(t = (i * (i + 1)) / 2);"
-""
-" ROLLBACK WORK;"
-""
-" PRINTF('Printing rows from Mikko-test after rollback:');"
-""
-" ROW_PRINTF SELECT * FROM IBUF_TEST;"
-""
-"/**********************************************************/"
-" FOR i IN 0 .. 100 LOOP"
-" INSERT INTO ACCOUNTA VALUES (i, i);"
-" INSERT INTO TELLERA VALUES (i, i);"
-" INSERT INTO BRANCHA VALUES (i, i);"
-" INSERT INTO HISTORYA VALUES (i, '12345678901234567890');"
-" END LOOP;"
-""
-" COMMIT WORK;"
-"/**********************************************************/"
-"/* PRINTF('Populating ibuf test tables');"
-" FOR i IN 1 .. 1000 LOOP"
-" INSERT INTO IBUF_TEST VALUES (i, RND_STR(RND(1, 2000)));"
-" END LOOP;"
-" PRINTF('Ibuf test tables populated');"
-" COMMIT WORK; */"
-""
-" n_items := 200;"
-" n_districts := 10;"
-" n_customers := 20;"
-""
-" PRINTF('Starting to populate ITEMs');"
-""
-" FOR i IN 1 .. n_items LOOP"
-" rnd1 := RND(26, 50);"
-" string := RND_STR(rnd1);"
-""
-" IF (RND(0, 99) < 10) THEN"
-" rnd2 := RND(0, rnd1 - 8);"
-" REPLSTR(string, 'ORIGINAL', rnd2, 8);"
-" END IF;"
-""
-" INSERT INTO ITEM VALUES (TO_BINARY(i, 3),"
-" TO_BINARY(RND(1, 10000), 3),"
-" RND_STR(RND(14, 24)),"
-" RND(100, 10000),"
-" string);"
-" END LOOP;"
-" COMMIT WORK;"
-""
-" FOR i IN 1 .. n_warehouses LOOP"
-" COMMIT WORK;"
-" PRINTF('Starting to populate warehouse number ', i);"
-" INSERT INTO WAREHOUSE VALUES (TO_BINARY(i, 2),"
-" RND_STR(RND(6, 10)),"
-" RND_STR(RND(10, 20)),"
-" RND_STR(RND(10, 20)),"
-" RND_STR(RND(10, 20)),"
-" RND_STR(2),"
-" CONCAT(SUBSTR(TO_CHAR(RND(0, 9999)),"
-" 6, 4),"
-" '11111'),"
-" RND(0, 2000),"
-" 0,"
-" 0);"
-" FOR j IN 1 .. n_items LOOP"
-""
-" rnd1 := RND(26, 50);"
-" string := RND_STR(rnd1);"
-""
-" IF (RND(0, 99) < 10) THEN"
-" rnd2 := RND(0, rnd1 - 8);"
-" REPLSTR(string, 'ORIGINAL', rnd2, 8);"
-" END IF; "
-""
-" INSERT INTO STOCK VALUES (TO_BINARY(j, 3),"
-" TO_BINARY(i, 2),"
-" 91,"
-" RND_STR(24),"
-" RND_STR(24),"
-" RND_STR(24),"
-" RND_STR(24),"
-" RND_STR(24),"
-" RND_STR(24),"
-" RND_STR(24),"
-" RND_STR(24),"
-" RND_STR(24),"
-" RND_STR(24),"
-" 0, 0, 0,"
-" string);"
-" END LOOP;"
- ;
-
- str2 =
-" FOR j IN 1 .. n_districts LOOP"
-""
-" /* PRINTF('Starting to populate district number ', j); */"
-" INSERT INTO DISTRICT VALUES (TO_BINARY(j + 47, 1),"
-" TO_BINARY(i, 2),"
-" RND_STR(RND(6, 10)),"
-" RND_STR(RND(10, 20)),"
-" RND_STR(RND(10, 20)),"
-" RND_STR(RND(10, 20)),"
-" RND_STR(2),"
-" CONCAT(SUBSTR("
-" TO_CHAR(RND(0, 9999)),"
-" 6, 4),"
-" '11111'),"
-" RND(0, 2000),"
-" 0,"
-" 0,"
-" 3001);"
-""
-" FOR k IN 1 .. n_customers LOOP"
-""
-" string := 'GC';"
-""
-" IF (RND(0, 99) < 10) THEN"
-" string := 'BC';"
-" END IF;"
-" "
-" INSERT INTO CUSTOMER VALUES ("
-" TO_BINARY(k, 3),"
-" TO_BINARY(j + 47, 1),"
-" TO_BINARY(i, 2),"
-" RND_STR(RND(8, 16)),"
-" 'OE',"
-" CONCAT('NAME',"
-" TO_CHAR(k / 3)),"
-" RND_STR(RND(10, 20)),"
-" RND_STR(RND(10, 20)),"
-" RND_STR(RND(10, 20)),"
-" RND_STR(2),"
-" CONCAT(SUBSTR("
-" TO_CHAR(RND(0, 9999)),"
-" 6, 4),"
-" '11111'),"
-" RND_STR(16),"
-" SYSDATE(), 0,"
-" string,"
-" 0, 5000000,"
-" RND(0, 5000),"
-" 0, 0, 0, 0, 0, 0,"
-" RND_STR(RND(300, 500)));"
- ;
-
- str3 =
-" INSERT INTO HISTORY VALUES ("
-" TO_BINARY(k, 3),"
-" TO_BINARY(j + 47, 1),"
-" TO_BINARY(i, 2),"
-" TO_BINARY(j + 47, 1),"
-" TO_BINARY(i, 2),"
-" SYSDATE(),"
-" 1000,"
-" RND_STR(RND(12, 24)));"
-""
-" rnd1 := RND(5, 15);"
-""
-" INSERT INTO ORDERS VALUES ("
-" k,"
-" TO_BINARY(j + 47, 1),"
-" TO_BINARY(i, 2),"
-" TO_BINARY(k, 3),"
-" SYSDATE(),"
-" RND(1, 10),"
-" rnd1,"
-" '1');"
-""
-" FOR t IN 1 .. rnd1 LOOP"
-" INSERT INTO ORDER_LINE VALUES ("
-" k,"
-" TO_BINARY(j + 47, 1),"
-" TO_BINARY(i, 2),"
-" TO_BINARY(t, 1),"
-" TO_BINARY("
-" RND(1, n_items),"
-" 3),"
-" TO_BINARY(i, 2),"
-" NULL,"
-" 91,"
-" RND(0, 9999),"
-" RND_STR(24));"
-" END LOOP;"
-" END LOOP;"
-" "
-" FOR k IN 1 /* + (2 * n_customers) / 3 */"
-" .. n_customers LOOP"
-" "
-" INSERT INTO NEW_ORDER VALUES ("
-" k,"
-" TO_BINARY(j + 47, 1),"
-" TO_BINARY(i, 2));"
-" END LOOP;"
-" END LOOP;"
-" END LOOP;"
-""
-" COMMIT WORK;"
-""
-" PRINTF('Populating TPC-D tables');"
-""
-" FOR i IN 0 .. 4 LOOP"
-" /* We set the last columns to a long character string, to"
-" reduce latch contention on region and nation database pages."
-" A similar effect could be achieved by setting the page"
-" fillfactor in these tables low. */"
-""
-" INSERT INTO REGION VALUES (i, CONCAT('Region', TO_CHAR(i),"
-" ' '),"
-" RND_STR(1500 + RND(1, 152)));"
-" FOR j IN i * 5 .. i * 5 + 4 LOOP"
-" INSERT INTO NATION VALUES (j,"
-" CONCAT('Nation', TO_CHAR(j),"
-" ' '),"
-" i, RND_STR(1500 + RND(1, 152)));"
-" INSERT INTO NATION_2 VALUES (j,"
-" CONCAT('Nation', TO_CHAR(j),"
-" ' '),"
-" i, RND_STR(1500 + RND(1, 152)));"
-" END LOOP;"
-" END LOOP;"
-""
-" COMMIT WORK;"
-""
-" FOR i IN 0 .. n_customers_d / 15 LOOP"
-" INSERT INTO SUPPLIER VALUES (i,"
-" CONCAT('Supplier', TO_CHAR(i)),"
-" RND_STR(RND(20, 30)),"
-" RND(0, 24),"
-" RND_STR(15),"
-" RND(1, 1000),"
-" RND_STR(RND(40, 80)));"
-" END LOOP;"
-""
-" COMMIT WORK;"
-""
-" FOR i IN 0 .. n_customers_d - 1 LOOP"
-" IF ((i / 100) * 100 = i) THEN"
-" COMMIT WORK;"
-" PRINTF('Populating customer ', i);"
-" END IF;"
-""
-" INSERT INTO CUSTOMER_D VALUES (i,"
-" CONCAT('Customer', TO_CHAR(i)),"
-" RND_STR(RND(20, 30)),"
-" RND(0, 24),"
-" RND_STR(15),"
-" RND(1, 1000),"
-" RND_STR(10),"
-" RND_STR(RND(50, 100)));"
-""
-" FOR j IN i * 10 .. i * 10 + 9 LOOP"
-""
-" rnd := (j * 2400) / (10 * n_customers_d);"
-""
-" INSERT INTO ORDERS_D VALUES (j,"
-" 3 * RND(0, (n_customers_d / 3) - 1)"
-" + RND(1, 2),"
-" 'F', 1000,"
-" rnd,"
-" RND_STR(10),"
-" CONCAT('Clerk', TO_CHAR(RND(0, 1000))),"
-" 0, RND_STR(RND(3, 7)));"
-""
-" FOR k IN 0 .. RND(0, 6) LOOP"
-" INSERT INTO LINEITEM VALUES (j,"
-" RND(1, 1000),"
-" RND(0, n_customers_d / 15),"
-" k,"
-" RND(1, 50),"
-" 100,"
-" 5,"
-" RND(0, 8),"
-" 'N',"
-" 'F',"
-" rnd + RND(1, 100),"
-" rnd + RND(1, 100),"
-" rnd + RND(1, 100),"
-" RND_STR(1),"
-" RND_STR(1),"
-" RND_STR(RND(1, 3)));"
-" END LOOP;"
-" END LOOP;"
-""
-" END LOOP;"
-""
-" COMMIT WORK;"
-" PRINTF('TPC-D tables populated');"
-""
-" PRINTF('Populating join test tables');"
-" FOR i IN 1 .. 1 LOOP"
-" INSERT INTO JTEST1 VALUES (i, i);"
-" INSERT INTO JTEST2 VALUES (i, i);"
-" END LOOP;"
-" PRINTF('Join test tables populated');"
-""
-" COMMIT WORK;"
-" END;"
- ;
-
- str4 = ut_str_catenate(str1, str2);
- populate_str = ut_str_catenate(str4, str3);
-
- /*-----------------------------------------------------------*/
- str =
-
-" PROCEDURE PRINT_TABLES () IS"
-" i INT;"
-" BEGIN"
-""
-" /* PRINTF('Printing ITEM table:');"
-""
-" ROW_PRINTF"
-" SELECT *"
-" FROM ITEM;"
-""
-" PRINTF('Printing WAREHOUSE table:');"
-""
-" ROW_PRINTF"
-" SELECT *"
-" FROM WAREHOUSE;"
-""
-" PRINTF('Printing STOCK table:');"
-""
-" ROW_PRINTF"
-" SELECT *"
-" FROM STOCK;"
-""
-" PRINTF('Printing DISTRICT table:');"
-""
-" ROW_PRINTF"
-" SELECT *"
-" FROM DISTRICT;"
-""
-" PRINTF('Printing CUSTOMER table:');"
-""
-" ROW_PRINTF"
-" SELECT *"
-" FROM CUSTOMER;"
-""
-" PRINTF('Printing HISTORY table:');"
-""
-" ROW_PRINTF"
-" SELECT *"
-" FROM HISTORY;"
-""
-" PRINTF('Printing ORDERS table:');"
-""
-" ROW_PRINTF"
-" SELECT *"
-" FROM ORDERS;"
-""
-" PRINTF('Printing ORDER_LINE table:');"
-""
-" ROW_PRINTF"
-" SELECT *"
-" FROM ORDER_LINE"
-" WHERE OL_O_ID >= 3000; */"
-""
-" PRINTF('Printing NEW_ORDER table:');"
-""
-" ROW_PRINTF"
-" SELECT *"
-" FROM NEW_ORDER;"
-""
-" COMMIT WORK;"
-" END;"
- ;
-
- print_str = str;
- /*-----------------------------------------------------------*/
- commit_str =
-
-" PROCEDURE COMMIT_TEST () IS"
-" "
-" BEGIN"
-" COMMIT WORK;"
-" END;"
- ;
-
- /*-----------------------------------------------------------*/
-
- str1 =
-
-" PROCEDURE NEW_ORDER (c_w_id IN CHAR,"
-" c_d_id IN CHAR,"
-" c_id IN CHAR,"
-" ol_supply_w_ids IN CHAR,"
-" ol_i_ids IN CHAR,"
-" ol_quantities IN CHAR,"
-" c_last OUT CHAR,"
-" c_credit OUT CHAR,"
-" c_discount OUT INT,"
-" w_tax OUT INT,"
-" d_tax OUT INT,"
-" o_ol_count OUT INT,"
-" o_id OUT INT,"
-" o_entry_d OUT INT,"
-" total OUT INT,"
-" i_names OUT CHAR,"
-" s_quantities OUT CHAR,"
-" bg OUT CHAR,"
-" i_prices OUT CHAR,"
-" ol_amounts OUT CHAR) IS"
-""
-" i INT;"
-" j INT;"
-" o_all_local CHAR;"
-" i_price INT;"
-" i_name CHAR;"
-" i_data CHAR;"
-" s_quantity INT;"
-" s_data CHAR;"
-" s_dist_01 CHAR;"
-" s_dist_02 CHAR;"
-" s_dist_03 CHAR;"
-" s_dist_04 CHAR;"
-" s_dist_05 CHAR;"
-" s_dist_06 CHAR;"
-" s_dist_07 CHAR;"
-" s_dist_08 CHAR;"
-" s_dist_09 CHAR;"
-" s_dist_10 CHAR;"
-" ol_i_id CHAR;"
-" ol_quantity INT;"
-" ol_amount INT;"
-" ol_supply_w_id CHAR;"
-" ol_dist_info CHAR;"
-""
-" DECLARE CURSOR district_cursor IS"
-" SELECT D_NEXT_O_ID, D_TAX"
-" FROM DISTRICT"
-" WHERE D_ID = c_d_id AND D_W_ID = c_w_id"
-" FOR UPDATE;"
-""
-" DECLARE CURSOR stock_cursor IS"
-" SELECT S_QUANTITY, S_DATA,"
-" S_DIST_01, S_DIST_02, S_DIST_03, S_DIST_04,"
-" S_DIST_05, S_DIST_06, S_DIST_07, S_DIST_08,"
-" S_DIST_09, S_DIST_10"
-" FROM STOCK"
-" WHERE S_W_ID = ol_supply_w_id AND S_I_ID = ol_i_id"
-" FOR UPDATE;"
- ;
- str2 =
-
-" BEGIN"
-" FOR j IN 1 .. 1 LOOP"
-""
-" /* PRINTF('Warehouse ', BINARY_TO_NUMBER(c_w_id)); */"
-" o_all_local := '1';"
-" i_names := '12345678901234567890123456789012345678901234567890"
- "12345678901234567890123456789012345678901234567890"
- "12345678901234567890123456789012345678901234567890"
- "12345678901234567890123456789012345678901234567890"
- "12345678901234567890123456789012345678901234567890"
- "12345678901234567890123456789012345678901234567890"
- "12345678901234567890123456789012345678901234567890"
- "1234567890';"
-" s_quantities := '12345678901234567890123456789012345678901234567890"
- "1234567890';"
-" i_prices := '12345678901234567890123456789012345678901234567890"
- "1234567890';"
-" ol_amounts := '12345678901234567890123456789012345678901234567890"
- "1234567890';"
-" bg := 'GGGGGGGGGGGGGGG';"
-" total := 0;"
-""
-" SELECT C_DISCOUNT, C_LAST, C_CREDIT INTO c_discount, c_last, c_credit"
-" FROM CUSTOMER"
-" WHERE C_W_ID = c_w_id AND C_D_ID = c_d_id AND C_ID = c_id;"
-""
-" OPEN district_cursor;"
-""
-" FETCH district_cursor INTO o_id, d_tax;"
-""
-" UPDATE DISTRICT SET D_NEXT_O_ID = o_id + 1"
-" WHERE CURRENT OF district_cursor;"
-""
-" CLOSE district_cursor;"
-""
-""
- ;
- str3 =
-
-" o_ol_count := LENGTH(ol_quantities);"
-""
-" /* PRINTF('C-WAREHOUSE id ', BINARY_TO_NUMBER(c_w_id),"
-" ' C-district id ', c_d_id,"
-" ' order id ', o_id, ' linecount ', o_ol_count); */"
-""
-" FOR i IN 0 .. (o_ol_count - 1) LOOP"
-""
-" ol_i_id := SUBSTR(ol_i_ids, 3 * i, 3);"
-" ol_supply_w_id := SUBSTR(ol_supply_w_ids, 2 * i, 2);"
-" ol_quantity := BINARY_TO_NUMBER(SUBSTR(ol_quantities, i, 1));"
-""
-" /* PRINTF('ol_i_id ', BINARY_TO_NUMBER(ol_i_id),"
-" ' ol_supply_w_id ', BINARY_TO_NUMBER(ol_supply_w_id),"
-" ' ol_quantity ', ol_quantity); */"
-""
-" SELECT I_PRICE, I_NAME, I_DATA INTO i_price, i_name, i_data"
-" FROM ITEM"
-" WHERE I_ID = ol_i_id"
-" CONSISTENT READ;"
-""
-" IF (SQL % NOTFOUND) THEN"
-" /* PRINTF('Rolling back; item not found: ',"
-" BINARY_TO_NUMBER(ol_i_id)); */"
-" ROLLBACK WORK;"
-" o_ol_count := 0;"
-""
-" RETURN;"
-" END IF;"
-""
-" OPEN stock_cursor;"
-""
-" FETCH stock_cursor INTO s_quantity, s_data,"
-" s_dist_01, s_dist_02, s_dist_03,"
-" s_dist_04, s_dist_05, s_dist_06,"
-" s_dist_07, s_dist_08, s_dist_09,"
-" s_dist_10;"
-""
-" /* PRINTF('Stock quantity ', s_quantity); */"
-""
-" IF (s_quantity >= ol_quantity + 10) THEN"
-" s_quantity := s_quantity - ol_quantity;"
-" ELSE"
-" s_quantity := (s_quantity + 91) - ol_quantity;"
-" END IF;"
-""
-" UPDATE STOCK SET S_QUANTITY = s_quantity,"
-" S_YTD = S_YTD + ol_quantity,"
-" S_ORDER_CNT = S_ORDER_CNT + 1"
- " WHERE CURRENT OF stock_cursor;"
-""
-" IF (ol_supply_w_id <> c_w_id) THEN"
-""
-" o_all_local := '0';"
-" PRINTF('Remote order ',"
-" BINARY_TO_NUMBER(ol_supply_w_id), ' ',"
-" BINARY_TO_NUMBER(c_w_id));"
-""
-" UPDATE STOCK SET S_REMOTE_CNT = S_REMOTE_CNT + 1"
-" WHERE CURRENT OF stock_cursor;"
-" END IF;"
-""
-" CLOSE stock_cursor;"
-""
-" IF ((INSTR(i_data, 'ORIGINAL') > 0)"
-" OR (INSTR(s_data, 'ORIGINAL') > 0)) THEN"
-" REPLSTR(bg, 'B', i, 1);"
-" END IF;"
-""
-" ol_amount := ol_quantity * i_price;"
-""
-" total := total + ol_amount;"
- ;
- str4 =
-" IF (c_d_id = '0') THEN"
-" ol_dist_info := s_dist_01;"
-" ELSIF (c_d_id = '1') THEN"
-" ol_dist_info := s_dist_02;"
-" ELSIF (c_d_id = '2') THEN"
-" ol_dist_info := s_dist_03;"
-" ELSIF (c_d_id = '3') THEN"
-" ol_dist_info := s_dist_04;"
-" ELSIF (c_d_id = '4') THEN"
-" ol_dist_info := s_dist_05;"
-" ELSIF (c_d_id = '5') THEN"
-" ol_dist_info := s_dist_06;"
-" ELSIF (c_d_id = '6') THEN"
-" ol_dist_info := s_dist_07;"
-" ELSIF (c_d_id = '7') THEN"
-" ol_dist_info := s_dist_08;"
-" ELSIF (c_d_id = '8') THEN"
-" ol_dist_info := s_dist_09;"
-" ELSIF (c_d_id = '9') THEN"
-" ol_dist_info := s_dist_10;"
-" END IF;"
-""
-" INSERT INTO ORDER_LINE VALUES (o_id, c_d_id, c_w_id,"
-" TO_BINARY(i + 1, 1), ol_i_id,"
-" ol_supply_w_id, NULL, ol_quantity,"
-" ol_amount, ol_dist_info);"
-""
-" REPLSTR(i_names, i_name, i * 24, LENGTH(i_name));"
-" REPLSTR(s_quantities, TO_BINARY(s_quantity, 4), i * 4, 4);"
-" REPLSTR(i_prices, TO_BINARY(i_price, 4), i * 4, 4);"
-" REPLSTR(ol_amounts, TO_BINARY(ol_amount, 4), i * 4, 4);"
-""
-" /* PRINTF('i_name ', i_name, ' s_quantity ', s_quantity,"
-" ' i_price ', i_price, ' ol_amount ', ol_amount); */"
-" END LOOP;"
-""
-" SELECT W_TAX INTO w_tax"
-" FROM WAREHOUSE"
-" WHERE W_ID = c_w_id;"
-""
-" total := (((total * (10000 + w_tax + d_tax)) / 10000)"
-" * (10000 - c_discount)) / 10000;"
-""
-" o_entry_d := SYSDATE();"
-""
-" INSERT INTO ORDERS VALUES (o_id, c_d_id, c_w_id, c_id, o_entry_d,"
-" NULL, o_ol_count, o_all_local);"
-" INSERT INTO NEW_ORDER VALUES (o_id, c_d_id, c_w_id);"
-""
-" /* PRINTF('Inserted order lines:');"
-" ROW_PRINTF"
-" SELECT * FROM ORDER_LINE WHERE OL_O_ID = o_id AND"
-" OL_D_ID = c_d_id"
-" AND OL_W_ID = c_w_id; */"
-" COMMIT WORK;"
-" END LOOP;"
-" END;"
- ;
-
- str5 = ut_str_catenate(str1, str2);
- str6 = ut_str_catenate(str3, str4);
-
- new_order_str = ut_str_catenate(str5, str6);
-
- /*-----------------------------------------------------------*/
-
- str1 =
-
-" PROCEDURE PAYMENT (c_w_id IN CHAR) IS"
-""
-" i INT;"
-" n_items INT;"
-" n_warehouses INT;"
-" n_districts INT;"
-" n_customers INT;"
-" w_id CHAR;"
-" w_street_1 CHAR;"
-" w_street_2 CHAR;"
-" w_city CHAR;"
-" w_state CHAR;"
-" w_zip CHAR;"
-" w_name CHAR;"
-" d_id CHAR;"
-" d_street_1 CHAR;"
-" d_street_2 CHAR;"
-" d_city CHAR;"
-" d_state CHAR;"
-" d_zip CHAR;"
-" d_name CHAR;"
-" c_d_id CHAR;"
-" c_street_1 CHAR;"
-" c_street_2 CHAR;"
-" c_city CHAR;"
-" c_state CHAR;"
-" c_zip CHAR;"
-" c_id CHAR;"
-" c_last CHAR;"
-" c_first CHAR;"
-" c_middle CHAR;"
-" c_phone CHAR;"
-" c_credit CHAR;"
-" c_credit_lim INT;"
-" c_discount INT;"
-" c_balance INT;"
-" c_since INT;"
-" c_data CHAR;"
-" byname INT;"
-" namecnt INT;"
-" amount INT;"
-" h_data CHAR;"
-" h_date INT;"
-" c_more_data CHAR;"
-" more_len INT;"
-" data_len INT;"
-""
-" DECLARE CURSOR warehouse_cursor IS"
-" SELECT W_STREET_1, W_STREET_2, W_CITY, W_STATE, W_ZIP, W_NAME"
-" FROM WAREHOUSE"
-" WHERE W_ID = w_id"
-" FOR UPDATE;"
-""
-" DECLARE CURSOR district_cursor IS"
-" SELECT D_STREET_1, D_STREET_2, D_CITY, D_STATE, D_ZIP, D_NAME"
-" FROM DISTRICT"
-" WHERE D_W_ID = w_id AND D_ID = d_id"
-" FOR UPDATE;"
-""
-" DECLARE CURSOR customer_by_name_cursor IS"
-" SELECT C_ID"
-" FROM CUSTOMER"
-" WHERE C_W_ID = c_w_id AND C_D_ID = c_d_id"
-" AND C_LAST = c_last"
-" ORDER BY C_FIRST ASC;"
-""
-" DECLARE CURSOR customer_cursor IS"
-" SELECT C_FIRST, C_MIDDLE, C_LAST, C_STREET_1, C_STREET_2,"
-" C_CITY, C_STATE, C_ZIP, C_PHONE, C_CREDIT,"
-" C_CREDIT_LIM, C_DISCOUNT, C_BALANCE,"
-" C_SINCE"
-" FROM CUSTOMER"
-" WHERE C_W_ID = c_w_id AND C_D_ID = c_d_id"
-" AND C_ID = c_id"
-" FOR UPDATE;"
- ;
-
- str2 =
-
-" BEGIN"
-""
-" n_items := 200;"
-" n_warehouses := 1;"
-" n_districts := 10;"
-" n_customers := 20;"
-""
-" byname := RND(1, 100);"
-" amount := RND(1, 1000);"
-" h_date := SYSDATE();"
-" w_id := c_w_id;"
-" d_id := TO_BINARY(47 + RND(1, n_districts), 1);"
-" c_d_id := TO_BINARY(47 + RND(1, n_districts), 1);"
-""
-" IF (byname <= 60) THEN"
-" c_last := CONCAT('NAME', TO_CHAR(RND(1, n_customers) / 3));"
-""
-" SELECT COUNT(*) INTO namecnt"
-" FROM CUSTOMER"
-" WHERE C_W_ID = c_w_id AND C_D_ID = c_d_id"
-" AND C_LAST = c_last;"
-" /* PRINTF('Payment trx: Customer name ', c_last,"
-" ' namecount ', namecnt); */"
-" OPEN customer_by_name_cursor;"
-""
-" FOR i IN 1 .. (namecnt + 1) / 2 LOOP"
-" FETCH customer_by_name_cursor INTO c_id;"
-" END LOOP;"
-" /* ASSERT(NOT (customer_by_name_cursor % NOTFOUND)); */"
-" "
-" CLOSE customer_by_name_cursor;"
-" ELSE"
-" c_id := TO_BINARY(RND(1, n_customers), 3);"
-" END IF;"
-
- ;
- str3 =
-""
-" /* PRINTF('Payment for customer ', BINARY_TO_NUMBER(c_w_id), ' ',"
-" c_d_id, ' ', BINARY_TO_NUMBER(c_id)); */"
-" OPEN customer_cursor;"
-""
-" FETCH customer_cursor INTO c_first, c_middle, c_last, c_street_1,"
-" c_street_2, c_city, c_state, c_zip,"
-" c_phone, c_credit, c_credit_lim,"
-" c_discount, c_balance, c_since;"
-" c_balance := c_balance - amount;"
-""
-" OPEN district_cursor;"
-""
-" FETCH district_cursor INTO d_street_1, d_street_2, d_city, d_state,"
-" d_zip, d_name;"
-" UPDATE DISTRICT SET D_YTD = D_YTD + amount"
-" WHERE CURRENT OF district_cursor;"
-""
-" CLOSE district_cursor;"
-""
-" OPEN warehouse_cursor;"
-""
-" FETCH warehouse_cursor INTO w_street_1, w_street_2, w_city, w_state,"
-" w_zip, w_name;"
-" UPDATE WAREHOUSE SET W_YTD = W_YTD + amount"
-" WHERE CURRENT OF warehouse_cursor;"
-""
-" CLOSE warehouse_cursor;"
-""
-" h_data := CONCAT(w_name, ' ', d_name);"
-" "
-" IF (c_credit = 'BC') THEN"
-" /* PRINTF('Bad customer pays'); */"
-""
-" SELECT C_DATA INTO c_data"
-" FROM CUSTOMER"
-" WHERE C_W_ID = c_w_id AND C_D_ID = c_d_id"
-" AND C_ID = c_id;"
-" c_more_data := CONCAT("
-" ' ', TO_CHAR(BINARY_TO_NUMBER(c_id)),"
-" ' ', c_d_id,"
-" ' ', TO_CHAR(BINARY_TO_NUMBER(c_w_id)),"
-" ' ', d_id,"
-" ' ', TO_CHAR(BINARY_TO_NUMBER(w_id)),"
-" TO_CHAR(amount),"
-" TO_CHAR(h_date),"
-" ' ', h_data);"
-""
-" more_len := LENGTH(c_more_data);"
-" data_len := LENGTH(c_data);"
-" "
-" IF (more_len + data_len > 500) THEN"
-" data_len := 500 - more_len;"
-" END IF;"
-" "
-" c_data := CONCAT(c_more_data, SUBSTR(c_data, 0, data_len));"
-" "
-" UPDATE CUSTOMER SET C_BALANCE = c_balance,"
-" C_PAYMENT_CNT = C_PAYMENT_CNT + 1,"
-" C_YTD_PAYMENT = C_YTD_PAYMENT + amount,"
-" C_DATA = c_data"
-" WHERE CURRENT OF customer_cursor;"
-" ELSE"
-" UPDATE CUSTOMER SET C_BALANCE = c_balance,"
-" C_PAYMENT_CNT = C_PAYMENT_CNT + 1,"
-" C_YTD_PAYMENT = C_YTD_PAYMENT + amount"
-" WHERE CURRENT OF customer_cursor;"
-" END IF;"
-""
-" CLOSE customer_cursor;"
-" "
-" INSERT INTO HISTORY VALUES (c_d_id, c_w_id, c_id, d_id, w_id,"
-" h_date, amount, h_data);"
-" COMMIT WORK;"
-""
-" END;"
-
- ;
-
- str4 = ut_str_catenate(str1, str2);
- payment_str = ut_str_catenate(str4, str3);
-
- /*-----------------------------------------------------------*/
-
- str1 =
-
-" PROCEDURE ORDER_STATUS (c_w_id IN CHAR) IS"
-""
-" i INT;"
-" n_items INT;"
-" n_warehouses INT;"
-" n_districts INT;"
-" n_customers INT;"
-" d_id CHAR;"
-" namecnt INT;"
-" c_d_id CHAR;"
-" c_id CHAR;"
-" c_last CHAR;"
-" c_first CHAR;"
-" c_middle CHAR;"
-" c_balance INT;"
-" byname INT;"
-" o_id INT;"
-" o_carrier_id CHAR;"
-" o_entry_d INT;"
-" ol_i_id CHAR;"
-" ol_supply_w_id CHAR;"
-" ol_quantity INT;"
-" ol_amount INT;"
-" ol_delivery_d INT;"
-""
-" DECLARE CURSOR orders_cursor IS"
-" SELECT O_ID, O_CARRIER_ID, O_ENTRY_D"
-" FROM ORDERS"
-" WHERE O_W_ID = c_w_id AND O_D_ID = c_d_id"
-" AND O_C_ID = c_id"
-" ORDER BY O_ID DESC;"
-""
-" DECLARE CURSOR order_line_cursor IS"
-" SELECT OL_I_ID, OL_SUPPLY_W_ID, OL_QUANTITY, OL_AMOUNT,"
-" OL_DELIVERY_D"
-" FROM ORDER_LINE"
-" WHERE OL_W_ID = c_w_id AND OL_D_ID = c_d_id"
-" AND OL_O_ID = o_id;"
-" DECLARE CURSOR customer_by_name_cursor IS"
-" SELECT C_ID"
-" FROM CUSTOMER"
-" WHERE C_W_ID = c_w_id AND C_D_ID = c_d_id"
-" AND C_LAST = c_last"
-" ORDER BY C_FIRST ASC;"
-" BEGIN"
-""
-" n_items := 200;"
-" n_warehouses := 1;"
-" n_districts := 10;"
-" n_customers := 20;"
-""
-" byname := RND(1, 100);"
-""
- ;
-
- str2 =
-
-" IF (byname <= 60) THEN"
-" d_id := TO_BINARY(47 + RND(1, n_districts), 1); "
-""
-" c_d_id := d_id;"
-""
-" c_last := CONCAT('NAME', TO_CHAR(RND(1, n_customers) / 3));"
-""
-" SELECT COUNT(*) INTO namecnt"
-" FROM CUSTOMER"
-" WHERE C_W_ID = c_w_id AND C_D_ID = c_d_id"
-" AND C_LAST = c_last;"
-" OPEN customer_by_name_cursor;"
-""
-" /* PRINTF('Order status trx: Customer name ', c_last,"
-" ' namecount ', namecnt); */"
-" FOR i IN 1 .. (namecnt + 1) / 2 LOOP"
-" FETCH customer_by_name_cursor INTO c_id;"
-" END LOOP;"
-" /* ASSERT(NOT (customer_by_name_cursor % NOTFOUND)); */"
-""
-" CLOSE customer_by_name_cursor;"
-" ELSE"
-" c_d_id := TO_BINARY(47 + RND(1, n_districts), 1);"
-" c_id := TO_BINARY(RND(1, n_customers), 3);"
-" END IF;"
-""
-" SELECT C_BALANCE, C_FIRST, C_MIDDLE, C_LAST INTO c_balance, c_first,"
-" c_middle, c_last"
-" FROM CUSTOMER"
-" WHERE C_W_ID = c_w_id AND C_D_ID = c_d_id AND C_ID = c_id;"
-""
-" OPEN orders_cursor;"
-""
-" FETCH orders_cursor INTO o_id, o_carrier_id, o_entry_d;"
-""
-" IF (orders_cursor % NOTFOUND) THEN"
-" PRINTF('Order status trx: customer has no order');"
-" CLOSE orders_cursor;"
-""
-" COMMIT WORK;"
-""
-" RETURN;"
-" END IF;"
-""
-" CLOSE orders_cursor;"
-""
-" OPEN order_line_cursor;"
-""
-" FOR i IN 0 .. 15 LOOP"
-" FETCH order_line_cursor INTO ol_i_id, ol_supply_w_id,"
-" ol_quantity, ol_amount,"
-" ol_delivery_d;"
-""
-" IF (order_line_cursor % NOTFOUND) THEN"
-" CLOSE order_line_cursor;"
-""
-" COMMIT WORK;"
-""
-" RETURN;"
-" END IF;"
-" END LOOP;"
-" ASSERT(0 = 1);"
-" "
-" END;"
- ;
-
- order_status_str = ut_str_catenate(str1, str2);
- /*-----------------------------------------------------------*/
-
- str1 =
-
-" PROCEDURE DELIVERY (w_id IN CHAR) IS"
-""
-" i INT;"
-" n_items INT;"
-" n_warehouses INT;"
-" n_districts INT;"
-" n_customers INT;"
-" d_id CHAR;"
-" c_id CHAR;"
-" o_id INT;"
-" o_carrier_id INT;"
-" ol_delivery_d INT;"
-" ol_total INT;"
-""
-" DECLARE CURSOR new_order_cursor IS"
-" SELECT NO_O_ID"
-" FROM NEW_ORDER"
-" WHERE NO_W_ID = w_id AND NO_D_ID = d_id"
-" ORDER BY NO_O_ID ASC;"
-""
-" DECLARE CURSOR orders_cursor IS"
-" SELECT O_C_ID"
-" FROM ORDERS"
-" WHERE O_W_ID = w_id AND O_D_ID = d_id"
-" AND O_ID = o_id"
-" FOR UPDATE;"
-" BEGIN"
-""
-" n_items := 200;"
-" n_warehouses := 1;"
-" n_districts := 10;"
-" n_customers := 20;"
-""
-" o_carrier_id := RND(1, 10);"
-" ol_delivery_d := SYSDATE();"
-
- ;
-
- str2 =
-
-" FOR i IN 1 .. n_districts LOOP"
-""
-" d_id := TO_BINARY(47 + i, 1);"
-""
-" OPEN new_order_cursor;"
-""
-" FETCH new_order_cursor INTO o_id;"
-""
-" IF (new_order_cursor % NOTFOUND) THEN"
-" /* PRINTF('No order to deliver'); */"
-""
-" CLOSE new_order_cursor;"
-" ELSE"
-" CLOSE new_order_cursor;"
-""
-" DELETE FROM NEW_ORDER"
-" WHERE NO_W_ID = w_id AND NO_D_ID = d_id"
-" AND NO_O_ID = o_id;"
-" OPEN orders_cursor;"
-""
-" FETCH orders_cursor INTO c_id;"
-""
-" UPDATE ORDERS SET O_CARRIER_ID = o_carrier_id"
-" WHERE CURRENT OF orders_cursor;"
-""
-" CLOSE orders_cursor;"
-""
-" UPDATE ORDER_LINE SET OL_DELIVERY_D = ol_delivery_d"
-" WHERE OL_W_ID = w_id AND OL_D_ID = d_id"
-" AND OL_O_ID = o_id;"
-""
-" SELECT SUM(OL_AMOUNT) INTO ol_total"
-" FROM ORDER_LINE"
-" WHERE OL_W_ID = w_id AND OL_D_ID = d_id"
-" AND OL_O_ID = o_id;"
-""
-" UPDATE CUSTOMER SET C_BALANCE = C_BALANCE - ol_total"
-" WHERE C_W_ID = w_id AND C_D_ID = d_id"
-" AND C_ID = c_id;"
-" END IF;"
-" END LOOP;"
-" COMMIT WORK;"
-""
-" "
-" END;"
- ;
-
- delivery_str = ut_str_catenate(str1, str2);
-
- /*-----------------------------------------------------------*/
-
- str =
-
-" PROCEDURE STOCK_LEVEL (w_id IN CHAR) IS"
-""
-" n_items INT;"
-" n_warehouses INT;"
-" n_districts INT;"
-" n_customers INT;"
-" d_id CHAR;"
-" o_id INT;"
-" stock_count INT;"
-" threshold INT;"
-""
-" BEGIN"
-""
-" n_items := 200;"
-" n_warehouses := 1;"
-" n_districts := 10;"
-" n_customers := 20;"
-""
-" d_id := TO_BINARY(47 + 4, 1);"
-""
-" threshold := RND(10, 20);"
-""
-" SELECT D_NEXT_O_ID INTO o_id"
-" FROM DISTRICT"
-" WHERE D_W_ID = w_id AND D_ID = d_id;"
-""
-" /* NOTE: COUNT(DISTINCT ...) not implemented yet: if we used a hash"
-" table, the DISTINCT operation should take at most 15 % more time */"
-""
-" SELECT COUNT(*) INTO stock_count"
-" FROM ORDER_LINE, STOCK"
-" WHERE OL_W_ID = w_id AND OL_D_ID = d_id"
-" AND OL_O_ID >= o_id - 10 AND OL_O_ID < o_id"
-" AND S_W_ID = w_id AND S_I_ID = OL_I_ID"
-" AND S_QUANTITY < threshold"
-" CONSISTENT READ;"
-" /* PRINTF(stock_count, ' items under threshold ', threshold); */"
-" COMMIT WORK;"
-""
-" END;"
- ;
-
- stock_level_str = str;
-
- /*-----------------------------------------------------------*/
-
- str =
-
-" PROCEDURE TPC_CONSISTENCY () IS"
-""
-" n_items INT;"
-" n_warehouses INT;"
-" n_districts INT;"
-" n_customers INT;"
-" n_orders INT;"
-" n_new_orders INT;"
-" n_order_lines INT;"
-" n_history INT;"
-" sum_order_quant INT;"
-" sum_stock_quant INT;"
-" n_delivered INT;"
-" n INT;"
-" n_new_order_lines INT;"
-" n_customers_d INT;"
-" n_regions INT;"
-" n_nations INT;"
-" n_suppliers INT;"
-" n_orders_d INT;"
-" n_lineitems INT;"
-""
-" BEGIN"
-""
-" PRINTF('TPC-C consistency check begins');"
-""
-" SELECT COUNT(*) INTO n_warehouses"
-" FROM WAREHOUSE;"
-" SELECT COUNT(*) INTO n_items"
-" FROM ITEM;"
-" SELECT COUNT(*) INTO n_customers"
-" FROM CUSTOMER;"
-" SELECT COUNT(*) INTO n_districts"
-" FROM DISTRICT;"
-" SELECT COUNT(*) INTO n_orders"
-" FROM ORDERS;"
-" SELECT COUNT(*) INTO n_new_orders"
-" FROM NEW_ORDER;"
-" SELECT COUNT(*) INTO n_order_lines"
-" FROM ORDER_LINE;"
-" SELECT COUNT(*) INTO n_history"
-" FROM HISTORY;"
-""
-" PRINTF('N warehouses ', n_warehouses);"
-""
-" PRINTF('N items ', n_items, ' : ', n_items / n_warehouses,"
-" ' per warehouse');"
-" PRINTF('N districts ', n_districts, ' : ', n_districts / n_warehouses,"
-" ' per warehouse');"
-" PRINTF('N customers ', n_customers, ' : ', n_customers / n_districts,"
-" ' per district');"
-" PRINTF('N orders ', n_orders, ' : ', n_orders / n_customers,"
-" ' per customer');"
-" PRINTF('N new orders ', n_new_orders, ' : ',"
-" n_new_orders / n_customers, ' per customer');"
-" PRINTF('N order lines ', n_order_lines, ' : ',"
-" n_order_lines / n_orders, ' per order');"
-" PRINTF('N history ', n_history, ' : ',"
-" n_history / n_customers, ' per customer');"
-" SELECT COUNT(*) INTO n_delivered"
-" FROM ORDER_LINE"
-" WHERE OL_DELIVERY_D < NULL;"
-""
-" PRINTF('N delivered order lines ', n_delivered);"
-""
-" SELECT COUNT(*) INTO n_new_order_lines"
-" FROM NEW_ORDER, ORDER_LINE"
-" WHERE NO_O_ID = OL_O_ID AND NO_D_ID = OL_D_ID"
-" AND NO_W_ID = OL_W_ID;"
-" PRINTF('N new order lines ', n_new_order_lines);"
-""
-" SELECT COUNT(*) INTO n"
-" FROM NEW_ORDER, ORDER_LINE"
-" WHERE NO_O_ID = OL_O_ID AND NO_D_ID = OL_D_ID"
-" AND NO_W_ID = OL_W_ID AND OL_DELIVERY_D < NULL;"
-" PRINTF('Assertion 1');"
-" ASSERT(n = 0);"
-""
-" SELECT COUNT(*) INTO n"
-" FROM NEW_ORDER, ORDER_LINE"
-" WHERE NO_O_ID = OL_O_ID AND NO_D_ID = OL_D_ID"
-" AND NO_W_ID = OL_W_ID AND OL_DELIVERY_D = NULL;"
-""
-" PRINTF('Assertion 2');"
-" ASSERT(n = n_new_order_lines);"
-" PRINTF('Assertion 2B');"
-" ASSERT(n_delivered + n_new_order_lines = n_order_lines);"
-""
-" PRINTF('Assertion 3');"
-" /* ASSERT(n_orders <= n_history); */"
-" PRINTF('Assertion 4');"
-" ASSERT(n_order_lines <= 15 * n_orders);"
-" PRINTF('Assertion 5');"
-" ASSERT(n_order_lines >= 5 * n_orders);"
-" PRINTF('Assertion 6');"
-" ASSERT(n_new_orders <= n_orders);"
-""
-" SELECT SUM(OL_QUANTITY) INTO sum_order_quant"
-" FROM ORDER_LINE;"
-" SELECT SUM(S_QUANTITY) INTO sum_stock_quant"
-" FROM STOCK;"
-" PRINTF('Sum order quant ', sum_order_quant, ' sum stock quant ',"
-" sum_stock_quant);"
-""
-" PRINTF('Assertion 7');"
-" ASSERT(((sum_stock_quant + sum_order_quant) / 91) * 91"
-" = sum_stock_quant + sum_order_quant);"
-" COMMIT WORK;"
-" PRINTF('TPC-C consistency check passed');"
-""
-" PRINTF('TPC-D consistency check begins');"
-""
-" SELECT COUNT(*) INTO n_customers_d"
-" FROM CUSTOMER_D"
-" CONSISTENT READ;"
-" SELECT COUNT(*) INTO n_nations"
-" FROM NATION"
-" CONSISTENT READ;"
-" SELECT COUNT(*) INTO n_regions"
-" FROM REGION"
-" CONSISTENT READ;"
-" SELECT COUNT(*) INTO n_suppliers"
-" FROM SUPPLIER"
-" CONSISTENT READ;"
-" SELECT COUNT(*) INTO n_orders_d"
-" FROM ORDERS_D"
-" CONSISTENT READ;"
-" SELECT COUNT(*) INTO n_lineitems"
-" FROM LINEITEM"
-" CONSISTENT READ;"
-""
-" PRINTF('N customers TPC-D ', n_customers_d);"
-""
-" PRINTF('N nations ', n_nations);"
-" PRINTF('N regions ', n_regions);"
-""
-" PRINTF('N suppliers ', n_suppliers);"
-" PRINTF('N orders TPC-D ', n_orders_d);"
-""
-" PRINTF('N lineitems ', n_lineitems, ' : ',"
-" n_lineitems / n_orders_d, ' per order');"
-" SELECT COUNT(*) INTO n"
-" FROM NATION, NATION_2"
-" WHERE N_NAME = N2_NAME"
-" CONSISTENT READ;"
-""
-" PRINTF('Assertion D1');"
-" ASSERT(n = n_nations);"
-""
-" SELECT COUNT(*) INTO n"
-" FROM NATION, REGION"
-" WHERE N_REGIONKEY = R_REGIONKEY"
-" CONSISTENT READ;"
-""
-" PRINTF('Assertion D2');"
-" ASSERT(n = n_nations);"
-""
-" SELECT COUNT(*) INTO n"
-" FROM ORDERS_D, CUSTOMER_D"
-" WHERE O_CUSTKEY = C_CUSTKEY"
-" CONSISTENT READ;"
-""
-" PRINTF('Assertion D3');"
-" ASSERT(n = n_orders_d);"
-""
-" SELECT COUNT(*) INTO n"
-" FROM LINEITEM, SUPPLIER"
-" WHERE L_SUPPKEY = S_SUPPKEY"
-" CONSISTENT READ;"
-""
-" PRINTF('Assertion D4');"
-" ASSERT(n = n_lineitems);"
-""
-" SELECT COUNT(*) INTO n"
-" FROM ORDERS_D"
-" WHERE O_ORDERDATE >= 0"
-" AND O_ORDERDATE <= 2500"
-" CONSISTENT READ;"
-""
-" PRINTF('Assertion D5');"
-" ASSERT(n = n_orders_d);"
-""
-" COMMIT WORK;"
-" PRINTF('TPC-D consistency check passed');"
-""
-" END;"
- ;
-
- consistency_str = str;
-
- /*-----------------------------------------------------------*/
- str =
-
-" PROCEDURE TPC_D_QUERY_5 (startday IN INT, endday IN INT) IS"
-""
-" revenue INT;"
-" r_name CHAR;"
-""
-" BEGIN"
-""
-" r_name := CONCAT('Region', TO_CHAR(3), ' ');"
-""
-" /* The last join to NATION_2 corresponds to calculating"
-" GROUP BY N_NAME in the original TPC-D query. It should take"
-" approximately the same amount of CPU time as GROUP BY. */"
-""
-" SELECT SUM((L_EXTENDEDPRICE * (100 - L_DISCOUNT)) / 100)"
-" INTO revenue"
-" FROM REGION, ORDERS_D, CUSTOMER_D, NATION,"
-" LINEITEM, SUPPLIER, NATION_2"
-" WHERE R_NAME = r_name"
-" AND O_ORDERDATE >= startday"
-" AND O_ORDERDATE < endday"
-" AND O_CUSTKEY = C_CUSTKEY"
-" AND C_NATIONKEY = N_NATIONKEY"
-" AND N_REGIONKEY = R_REGIONKEY"
-" AND O_ORDERKEY = L_ORDERKEY"
-" AND L_SUPPKEY = S_SUPPKEY"
-" AND S_NATIONKEY = C_NATIONKEY"
-" AND N_NAME = N2_NAME"
-" CONSISTENT READ;"
-""
-" PRINTF('Startdate ', startday, '; enddate ', endday,"
-" ': revenue ', revenue);"
-" COMMIT WORK;"
-""
-" END;"
- ;
-
- query_5_str = str;
- /*-----------------------------------------------------------*/
- str =
-
-" PROCEDURE ROLLBACK_QUERY () IS"
-""
-" BEGIN"
-""
-" ROLLBACK WORK;"
-""
-" END;"
- ;
-
- rollback_str = str;
- /*-----------------------------------------------------------*/
- str =
-
-" PROCEDURE TEST_LOCK_WAIT () IS"
-""
-" w_id CHAR;"
-" BEGIN"
-""
-" w_id := TO_BINARY(1, 2);"
-" UPDATE WAREHOUSE SET W_YTD = W_YTD + 1 WHERE W_ID = w_id;"
-""
-" END;"
- ;
-
- lock_wait_str = str;
- /*-----------------------------------------------------------*/
- str =
-
-" PROCEDURE TEST_IBUF () IS"
-""
-" i INT;"
-" rnd INT;"
-" j INT;"
-" found INT;"
-""
-" DECLARE CURSOR desc_cursor IS"
-" SELECT IB_A"
-" FROM IBUF_TEST"
-" WHERE IB_A >= rnd AND IB_A < rnd + 50"
-" ORDER BY IB_A DESC;"
-""
-" BEGIN"
-""
-" PRINTF('Ibuf QUERY starts!!!!!!');"
-" rnd := RND(1, 1000);"
-""
-" FOR i IN 1 .. 50 LOOP"
-" INSERT INTO IBUF_TEST VALUES (rnd + i,"
-" RND_STR(RND(1, 2000)));"
-" END LOOP;"
-" IF (RND(1, 100) < 30) THEN"
-" PRINTF('Ibuf rolling back ---!!!');"
-" ROLLBACK WORK;"
-" END IF;"
-""
-""
-" IF (RND(1, 100) < 101) THEN"
-" rnd := RND(1, 1000);"
-" DELETE FROM IBUF_TEST WHERE IB_A >= rnd "
-" AND IB_A <= rnd + 50;"
-" END IF;"
-""
-" rnd := RND(1, 1000);"
-" SELECT COUNT(*) INTO j"
-" FROM IBUF_TEST"
-" WHERE IB_A >= rnd AND IB_A < rnd + 50;"
-""
-" PRINTF('Count: ', j);"
-""
-" rnd := RND(1, 1000);"
-" UPDATE IBUF_TEST"
-" SET IB_B = RND_STR(RND(1, 2000))"
-" WHERE IB_A >= rnd AND IB_A < rnd + 50;"
-""
-" OPEN desc_cursor;"
-""
-" rnd := RND(1, 1000);"
-" found := 1;"
-" WHILE (found > 0) LOOP"
-""
-" FETCH desc_cursor INTO j;"
-""
-" IF (desc_cursor % NOTFOUND) THEN"
-" found := 0;"
-" END IF;"
-" END LOOP;"
-""
-" CLOSE desc_cursor;"
-""
-" IF (RND(1, 100) < 30) THEN"
-" PRINTF('Ibuf rolling back!!!');"
-" ROLLBACK WORK;"
-" ELSE"
-" COMMIT WORK;"
-" END IF;"
-""
-" PRINTF('Ibuf QUERY ends!!!!!!');"
-" END;"
- ;
-
- ibuf_test_str = str;
- /*-----------------------------------------------------------*/
- str =
-
-" PROCEDURE TEST_GROUP_COMMIT (w_id IN CHAR) IS"
-""
-" i INT;"
-""
-" BEGIN"
-""
-" FOR i IN 1 .. 200 LOOP"
-" UPDATE WAREHOUSE SET W_YTD = W_YTD + 1 WHERE W_ID = w_id;"
-" COMMIT WORK;"
-" END LOOP;"
-" END;"
- ;
-
- test_group_commit_str = str;
- /*-----------------------------------------------------------*/
- str =
-
-" PROCEDURE TEST_SINGLE_ROW_SELECT ("
-" i_id IN CHAR,"
-" i_name OUT CHAR) IS"
-" BEGIN"
-" SELECT I_NAME INTO i_name"
-" FROM ITEM"
-" WHERE I_ID = i_id"
-" CONSISTENT READ;"
-" END;"
- ;
-
- test_single_row_select_str = str;
- /*-----------------------------------------------------------*/
- str =
-
-" PROCEDURE JOIN_TEST () IS"
-""
-" n_rows INT;"
-" i INT;"
-""
-" BEGIN"
-""
-" FOR i IN 0 .. 0 LOOP"
-" SELECT COUNT(*) INTO n_rows"
-" FROM JTEST1, JTEST2"
-" WHERE JT2_A = JT1_B"
-" CONSISTENT READ;"
-" PRINTF(n_rows);"
-""
-" COMMIT WORK;"
-" END LOOP;"
-""
-" END;"
- ;
-
- join_test_str = str;
-
- /*-----------------------------------------------------------*/
- str =
-
-" PROCEDURE TEST_ERRORS (switch IN CHAR) IS"
-""
-" count INT;"
-" val INT;"
-""
-" BEGIN"
-""
-" IF (switch = '01') THEN"
-" /* Test duplicate key error: run this first */"
-" ROW_PRINTF SELECT * FROM JTEST1;"
-" PRINTF('To insert first');"
-" INSERT INTO JTEST1 VALUES (1, 1);"
-" PRINTF('To insert second');"
-" INSERT INTO JTEST1 VALUES (2, 2);"
-" END IF;"
-""
-" IF (switch = '02') THEN"
-" /* Test duplicate key error: run this second */"
-" ROW_PRINTF SELECT * FROM JTEST1;"
-" PRINTF('To insert third');"
-" INSERT INTO JTEST1 VALUES (3, 3);"
-" ROW_PRINTF SELECT * FROM JTEST1;"
-" PRINTF('To insert fourth');"
-" INSERT INTO JTEST1 VALUES (1, 1);"
-" END IF;"
-""
-" IF (switch = '03') THEN"
-" /* Test duplicate key error: run this third */"
-" ROW_PRINTF SELECT * FROM JTEST1;"
-" PRINTF('Testing assert');"
-" SELECT COUNT(*) INTO count FROM JTEST1;"
-" ASSERT(count = 2);"
-" END IF;"
-""
-" IF (switch = '04') THEN"
-" /* Test duplicate key error: run this fourth */"
-" ROW_PRINTF SELECT * FROM JTEST1;"
-" PRINTF('Testing update');"
-" UPDATE JTEST1 SET JT1_A = 3 WHERE JT1_A = 2;"
-" PRINTF('Testing update');"
-" UPDATE JTEST1 SET JT1_A = 1 WHERE JT1_A = 3;"
-" END IF;"
-""
-" IF (switch = '05') THEN"
-" /* Test deadlock error: run this fifth in thread 1 */"
-" COMMIT WORK;"
-" PRINTF('Testing update in thread 1');"
-" UPDATE JTEST1 SET JT1_B = 3 WHERE JT1_A = 1;"
-" END IF;"
-""
-" IF (switch = '06') THEN"
-" /* Test deadlock error: run this sixth in thread 2 */"
-" PRINTF('Testing update in thread 2');"
-" UPDATE JTEST1 SET JT1_B = 10 WHERE JT1_A = 2;"
-" PRINTF('Testing update in thread 2');"
-" UPDATE JTEST1 SET JT1_B = 11 WHERE JT1_A = 1;"
-" PRINTF('Update in thread 2 completed');"
-" SELECT JT1_B INTO val FROM JTEST1 WHERE JT1_A = 1;"
-" ASSERT(val = 11);"
-" SELECT JT1_B INTO val FROM JTEST1 WHERE JT1_A = 2;"
-" ASSERT(val = 10);"
-" COMMIT WORK;"
-" END IF;"
-""
-" IF (switch = '07') THEN"
-" /* Test deadlock error: run this seventh in thread 1 */"
-" PRINTF('Testing update in thread 1: deadlock');"
-" UPDATE JTEST1 SET JT1_B = 4 WHERE JT1_A = 2;"
-" END IF;"
-""
-" IF (switch = '08') THEN"
-" /* Test deadlock error: run this eighth in thread 1 */"
-" PRINTF('Testing update in thread 1: commit');"
-" SELECT JT1_B INTO val FROM JTEST1 WHERE JT1_A = 1;"
-" ASSERT(val = 3);"
-" COMMIT WORK;"
-" END IF;"
-""
-" END;"
- ;
-
- test_errors_str = str;
- /*-----------------------------------------------------------*/
- ret = SQLAllocEnv(&env);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocConnect(env, &conn);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn, &stat);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn, &create_query);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn, &populate_query);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLConnect(conn, (UCHAR*)cli_srv_endpoint_name,
- (SWORD)ut_strlen(cli_srv_endpoint_name),
- (UCHAR*)"use21", 5, (UCHAR*)"password", 8);
- ut_a(ret == SQL_SUCCESS);
-
- printf("Connection established\n");
-
- /*-----------------------------------------------------------*/
- ret = SQLPrepare(stat, (UCHAR*)create_str, ut_strlen(create_str));
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(stat);
-
- ut_a(ret == SQL_SUCCESS);
-
- str = "{CREATE_TABLES()}";
-
- ret = SQLPrepare(create_query, (UCHAR*)str, ut_strlen(str));
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(create_query);
-
- ut_a(ret == SQL_SUCCESS);
-
- /*-----------------------------------------------------------*/
- ret = SQLPrepare(stat, (UCHAR*)populate_str, ut_strlen(populate_str));
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(stat);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLPrepare(stat, (UCHAR*)lock_wait_str,
- ut_strlen(lock_wait_str));
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(stat);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLPrepare(stat, (UCHAR*)commit_str,
- ut_strlen(commit_str));
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(stat);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLPrepare(stat, (UCHAR*)print_str,
- ut_strlen(print_str));
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(stat);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLPrepare(stat, (UCHAR*)new_order_str,
- ut_strlen(new_order_str));
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(stat);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLPrepare(stat, (UCHAR*)payment_str,
- ut_strlen(payment_str));
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(stat);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLPrepare(stat, (UCHAR*)order_status_str,
- ut_strlen(order_status_str));
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(stat);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLPrepare(stat, (UCHAR*)delivery_str,
- ut_strlen(delivery_str));
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(stat);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLPrepare(stat, (UCHAR*)stock_level_str,
- ut_strlen(stock_level_str));
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(stat);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLPrepare(stat, (UCHAR*)query_5_str,
- ut_strlen(query_5_str));
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(stat);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLPrepare(stat, (UCHAR*)consistency_str,
- ut_strlen(consistency_str));
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(stat);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLPrepare(stat, (UCHAR*)rollback_str, ut_strlen(rollback_str));
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(stat);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLPrepare(stat, (UCHAR*)join_test_str,
- ut_strlen(join_test_str));
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(stat);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLPrepare(stat, (UCHAR*)test_errors_str,
- ut_strlen(test_errors_str));
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(stat);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLPrepare(stat, (UCHAR*)test_single_row_select_str,
- ut_strlen(test_single_row_select_str));
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(stat);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLPrepare(stat, (UCHAR*)test_group_commit_str,
- ut_strlen(test_group_commit_str));
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(stat);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLPrepare(stat, (UCHAR*)ibuf_test_str,
- ut_strlen(ibuf_test_str));
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(stat);
-
- ut_a(ret == SQL_SUCCESS);
-
- str = "{POPULATE_TABLES(?, ?)}";
-
- ret = SQLPrepare(populate_query, (UCHAR*)str, ut_strlen(str));
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(populate_query, 1, SQL_PARAM_INPUT,
- SQL_C_LONG, SQL_INTEGER, 0, 0,
- (byte*)&n_warehouses_buf,
- 4, &n_warehouses_len);
- ut_a(ret == SQL_SUCCESS);
-
- n_warehouses_buf = n_warehouses;
- n_warehouses_len = 4;
-
- ret = SQLBindParameter(populate_query, 2, SQL_PARAM_INPUT,
- SQL_C_LONG, SQL_INTEGER, 0, 0,
- (byte*)&n_customers_d_buf,
- 4, &n_customers_d_len);
- ut_a(ret == SQL_SUCCESS);
-
- n_customers_d_buf = n_customers_d;
- n_customers_d_len = 4;
-
- ret = SQLExecute(populate_query);
-
- ut_a(ret == SQL_SUCCESS);
-
- /*-----------------------------------------------------------*/
- printf("TPC-C test database initialized\n");
-
- return(0);
-}
-
-/*********************************************************************
-Iterates an SQL query until it returns SQL_SUCCESS. If it returns other
-value, rolls back the trx, prints an error message, and tries again. */
-
-void
-execute_until_success(
-/*==================*/
- HSTMT query, /* in: query */
- HSTMT rollback_query) /* in: trx rollback query to run if error */
-{
- RETCODE ret;
- UCHAR sql_state[6];
- SDWORD native_error;
- UCHAR error_msg[512];
- SWORD error_msg_max = 512;
- SWORD error_msg_len;
-
- for (;;) {
- ret = SQLExecute(query);
-
- if (ret != SQL_SUCCESS) {
- ut_a(ret == SQL_ERROR);
-
- ret = SQLError(SQL_NULL_HENV, SQL_NULL_HDBC, query,
- sql_state, &native_error, error_msg,
- error_msg_max, &error_msg_len);
-
- ut_a(ret == SQL_SUCCESS);
-
- printf("%s\n", error_msg);
-
- /* Roll back to release trx locks, and try again */
-
- ret = SQLExecute(rollback_query);
- ut_a(ret == SQL_SUCCESS);
-
- os_thread_sleep(ut_rnd_gen_ulint() / 1000);
- } else {
-
- return;
- }
- }
-}
-
-/*********************************************************************
-Test for TPC-C. */
-
-ulint
-test_client(
-/*=========*/
- void* arg) /* in: user name as a null-terminated string */
-{
- ulint n_customers = 20;
- ulint n_items = 200;
- ulint n_lines;
- bool put_invalid_item;
- HENV env;
- HDBC conn;
- RETCODE ret;
- HSTMT commit_query;
- HSTMT new_order_query;
- HSTMT payment_query;
- HSTMT order_status_query;
- HSTMT delivery_query;
- HSTMT stock_level_query;
- HSTMT print_query;
- HSTMT lock_wait_query;
- HSTMT join_test_query;
- HSTMT test_group_commit_query;
- HSTMT rollback_query;
- HSTMT ibuf_query;
- ulint tm, oldtm;
- char* str;
- byte c_w_id_buf[2];
- byte c_d_id_buf[1];
- byte c_id_buf[3];
- byte ol_supply_w_ids_buf[30];
- byte ol_i_ids_buf[45];
- byte ol_quantities_buf[15];
- byte c_last_buf[51];
- byte c_credit_buf[3];
- ulint c_discount_buf;
- ulint w_tax_buf;
- ulint d_tax_buf;
- ulint o_ol_count_buf;
- ulint o_id_buf;
- ulint o_entry_d_buf;
- ulint total_buf;
- byte i_names_buf[361];
- byte s_quantities_buf[60];
- byte bg_buf[16];
- byte i_prices_buf[60];
- byte ol_amounts_buf[60];
- SDWORD c_w_id_len;
- SDWORD c_d_id_len;
- SDWORD c_id_len;
- SDWORD ol_supply_w_ids_len;
- SDWORD ol_i_ids_len;
- SDWORD ol_quantities_len;
- SDWORD c_last_len;
- SDWORD c_credit_len;
- SDWORD c_discount_len;
- SDWORD w_tax_len;
- SDWORD d_tax_len;
- SDWORD o_ol_count_len;
- SDWORD o_id_len;
- SDWORD o_entry_d_len;
- SDWORD total_len;
- SDWORD i_names_len;
- SDWORD s_quantities_len;
- SDWORD bg_len;
- SDWORD i_prices_len;
- SDWORD ol_amounts_len;
- ulint i;
- ulint k;
- ulint t;
-
- printf("Client thread %s\n", (UCHAR*)arg);
-
- ret = SQLAllocEnv(&env);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocConnect(env, &conn);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn, &new_order_query);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn, &payment_query);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn, &order_status_query);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn, &delivery_query);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn, &stock_level_query);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn, &print_query);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn, &commit_query);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn, &lock_wait_query);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn, &join_test_query);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn, &test_group_commit_query);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn, &rollback_query);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn, &ibuf_query);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLConnect(conn, (UCHAR*)cli_srv_endpoint_name,
- (SWORD)ut_strlen(cli_srv_endpoint_name),
- (UCHAR*)arg, (SWORD)ut_strlen((char*)arg),
- (UCHAR*)"password", 8);
- ut_a(ret == SQL_SUCCESS);
-
- printf("Connection established\n");
-
- /*-----------------------------------------------------------*/
- str =
- "{NEW_ORDER(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,"
- " ?, ?, ?, ?)}";
-
- ret = SQLPrepare(new_order_query, (UCHAR*)str, ut_strlen(str));
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(new_order_query, 1, SQL_PARAM_INPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0, c_w_id_buf,
- 2, &c_w_id_len);
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(new_order_query, 2, SQL_PARAM_INPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0, c_d_id_buf,
- 1, &c_d_id_len);
- ut_a(ret == SQL_SUCCESS);
-
- c_d_id_len = 1;
-
- ret = SQLBindParameter(new_order_query, 3, SQL_PARAM_INPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0, c_id_buf,
- 3, &c_id_len);
- ut_a(ret == SQL_SUCCESS);
-
- c_id_len = 3;
-
- ret = SQLBindParameter(new_order_query, 4, SQL_PARAM_INPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0, ol_supply_w_ids_buf,
- 30, &ol_supply_w_ids_len);
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(new_order_query, 5, SQL_PARAM_INPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0, ol_i_ids_buf,
- 45, &ol_i_ids_len);
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(new_order_query, 6, SQL_PARAM_INPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0, ol_quantities_buf,
- 15, &ol_quantities_len);
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(new_order_query, 7, SQL_PARAM_OUTPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0, c_last_buf,
- 50, &c_last_len);
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(new_order_query, 8, SQL_PARAM_OUTPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0,
- (byte*)&c_credit_buf,
- 2, &c_credit_len);
- ut_a(ret == SQL_SUCCESS);
- c_credit_buf[2] = '\0';
-
- ret = SQLBindParameter(new_order_query, 9, SQL_PARAM_OUTPUT,
- SQL_C_LONG, SQL_INTEGER, 0, 0,
- (byte*)&c_discount_buf,
- 4, &c_discount_len);
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(new_order_query, 10, SQL_PARAM_OUTPUT,
- SQL_C_LONG, SQL_INTEGER, 0, 0,
- (byte*)&w_tax_buf,
- 4, &w_tax_len);
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(new_order_query, 11, SQL_PARAM_OUTPUT,
- SQL_C_LONG, SQL_INTEGER, 0, 0,
- (byte*)&d_tax_buf,
- 4, &d_tax_len);
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(new_order_query, 12, SQL_PARAM_OUTPUT,
- SQL_C_LONG, SQL_INTEGER, 0, 0,
- (byte*)&o_ol_count_buf,
- 4, &o_ol_count_len);
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(new_order_query, 13, SQL_PARAM_OUTPUT,
- SQL_C_LONG, SQL_INTEGER, 0, 0,
- (byte*)&o_id_buf,
- 4, &o_id_len);
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(new_order_query, 14, SQL_PARAM_OUTPUT,
- SQL_C_LONG, SQL_INTEGER, 0, 0,
- (byte*)&o_entry_d_buf,
- 4, &o_entry_d_len);
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(new_order_query, 15, SQL_PARAM_OUTPUT,
- SQL_C_LONG, SQL_INTEGER, 0, 0,
- (byte*)&total_buf,
- 4, &total_len);
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(new_order_query, 16, SQL_PARAM_OUTPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0, i_names_buf,
- 360, &i_names_len);
- ut_a(ret == SQL_SUCCESS);
- i_names_buf[360] = '\0';
-
- ret = SQLBindParameter(new_order_query, 17, SQL_PARAM_OUTPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0, s_quantities_buf,
- 60, &s_quantities_len);
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(new_order_query, 18, SQL_PARAM_OUTPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0, bg_buf,
- 15, &bg_len);
- ut_a(ret == SQL_SUCCESS);
- bg_buf[15] = '\0';
-
- ret = SQLBindParameter(new_order_query, 19, SQL_PARAM_OUTPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0, i_prices_buf,
- 60, &i_prices_len);
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(new_order_query, 20, SQL_PARAM_OUTPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0, ol_amounts_buf,
- 60, &ol_amounts_len);
- ut_a(ret == SQL_SUCCESS);
-
- c_w_id_len = 2;
- c_w_id_buf[1] = (byte)(2 * atoi((char*)arg + 4));
- c_w_id_buf[0] = (byte)(2 * (atoi((char*)arg + 4) / 256));
-
- k = atoi((char*)arg + 4);
-
- printf("Client thread %lu starts\n", k);
-
- /*-----------------------------------------------------------*/
- str = "{PAYMENT(?)}";
-
- ret = SQLPrepare(payment_query, (UCHAR*)str, ut_strlen(str));
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(payment_query, 1, SQL_PARAM_INPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0, c_w_id_buf,
- 2, &c_w_id_len);
- ut_a(ret == SQL_SUCCESS);
-
- /*-----------------------------------------------------------*/
- str = "{ORDER_STATUS(?)}";
-
- ret = SQLPrepare(order_status_query, (UCHAR*)str, ut_strlen(str));
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(order_status_query, 1, SQL_PARAM_INPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0, c_w_id_buf,
- 2, &c_w_id_len);
- ut_a(ret == SQL_SUCCESS);
-
- /*-----------------------------------------------------------*/
- str = "{DELIVERY(?)}";
-
- ret = SQLPrepare(delivery_query, (UCHAR*)str, ut_strlen(str));
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(delivery_query, 1, SQL_PARAM_INPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0, c_w_id_buf,
- 2, &c_w_id_len);
- ut_a(ret == SQL_SUCCESS);
-
- /*-----------------------------------------------------------*/
- str = "{STOCK_LEVEL(?)}";
-
- ret = SQLPrepare(stock_level_query, (UCHAR*)str, ut_strlen(str));
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(stock_level_query, 1, SQL_PARAM_INPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0, c_w_id_buf,
- 2, &c_w_id_len);
- ut_a(ret == SQL_SUCCESS);
-
- /*-----------------------------------------------------------*/
- str = "{ROLLBACK_QUERY()}";
-
- ret = SQLPrepare(rollback_query, (UCHAR*)str, ut_strlen(str));
-
- ut_a(ret == SQL_SUCCESS);
- /*-----------------------------------------------------------*/
-
- oldtm = ut_clock();
-
- for (i = k; i < k + n_rounds / n_users; i++) {
-
- /* execute_until_success(ibuf_query, rollback_query); */
-
- if (i % 100 == 0) {
- printf("User %s round %lu\n", (char*)arg, i);
- }
-
- if (!own_warehouse) {
- c_w_id_buf[1] = (byte)ut_rnd_interval(1, n_warehouses);
- c_w_id_buf[0] = (byte)(ut_rnd_interval(1, n_warehouses)
- / 256);
- }
-
- mach_write_to_1(c_d_id_buf, (ut_rnd_interval(1, 10) + 47));
- mach_write_to_3(c_id_buf, ut_rnd_interval(1, n_customers));
-
- n_lines = ut_rnd_interval(5, 15);
-
- if ((15 * k + i) % 100 == 0) {
- put_invalid_item = TRUE;
-
- /* printf("Will put invalid item\n"); */
- } else {
- put_invalid_item = FALSE;
- }
-
- for (t = 0; t < n_lines; t++) {
- mach_write_to_3(ol_i_ids_buf + 3 * t,
- ut_rnd_interval(1, n_items));
-
- if (put_invalid_item && (t + 1 == n_lines)) {
- mach_write_to_3(ol_i_ids_buf + 3 * t,
- n_items + 1);
- }
-
- mach_write_to_1(ol_quantities_buf + t,
- ut_rnd_interval(10, 20));
- ut_memcpy(ol_supply_w_ids_buf + 2 * t, c_w_id_buf, 2);
- }
-
- ol_i_ids_len = 3 * n_lines;
- ol_quantities_len = n_lines;
- ol_supply_w_ids_len = 2 * n_lines;
-
- execute_until_success(new_order_query, rollback_query);
-
- if (put_invalid_item) {
-
- goto skip_prints;
- }
-/*
- c_last_buf[c_last_len] = '\0';
-
- printf(
- "C_LAST %s, c_credit %s, c_discount, %lu, w_tax %lu, d_tax %lu\n",
- c_last_buf, c_credit_buf, w_tax_buf, d_tax_buf);
-
- printf("o_ol_count %lu, o_id %lu, o_entry_d %lu, total %lu\n",
- o_ol_count_buf, o_id_buf, o_entry_d_buf,
- total_buf);
-
- ut_a(c_credit_len == 2);
- ut_a(c_discount_len == 4);
- ut_a(i_names_len == 360);
-
- printf("i_names %s, bg %s\n", i_names_buf, bg_buf);
-
- for (t = 0; t < n_lines; t++) {
- printf("s_quantity %lu, i_price %lu, ol_amount %lu\n",
- mach_read_from_4(s_quantities_buf + 4 * t),
- mach_read_from_4(i_prices_buf + 4 * t),
- mach_read_from_4(ol_amounts_buf + 4 * t));
- }
-*/
- skip_prints:
- ;
-
- execute_until_success(payment_query, rollback_query);
-
- if (i % 10 == 3) {
- execute_until_success(order_status_query,
- rollback_query);
- }
-
- if ((i % 10 == 6) || (i % 100 == 60)) {
- execute_until_success(delivery_query, rollback_query);
- }
-
- if (i % 10 == 9) {
- execute_until_success(stock_level_query,
- rollback_query);
- }
- }
-
- tm = ut_clock();
-
- printf("Wall time for %lu loops %lu milliseconds\n",
- (i - k), tm - oldtm);
-
-/* execute_until_success(print_query, rollback_query); */
-
- n_exited++;
-
- printf("Client thread %lu exits as the %luth\n", k, n_exited);
-
- return(0);
-}
-
-/*********************************************************************
-Test for single row select. */
-
-ulint
-test_single_row_select(
-/*===================*/
- void* arg) /* in: user name as a null-terminated string */
-{
- ulint n_items = 200;
- HENV env;
- HDBC conn;
- RETCODE ret;
- HSTMT single_row_select_query;
- ulint tm, oldtm;
- char* str;
- byte i_id_buf[3];
- byte i_name_buf[25];
- SDWORD i_id_len;
- SDWORD i_name_len;
- ulint i;
-
- ret = SQLAllocEnv(&env);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocConnect(env, &conn);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn, &single_row_select_query);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLConnect(conn, (UCHAR*)cli_srv_endpoint_name,
- (SWORD)ut_strlen(cli_srv_endpoint_name),
- (UCHAR*)arg,
- (SWORD)ut_strlen((char*)arg),
- (UCHAR*)"password", 8);
- ut_a(ret == SQL_SUCCESS);
-
- printf("Connection established\n");
-
- /*-----------------------------------------------------------*/
- str =
- "{TEST_SINGLE_ROW_SELECT(?, ?)}";
-
- ret = SQLPrepare(single_row_select_query, (UCHAR*)str,
- ut_strlen(str));
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(single_row_select_query, 1, SQL_PARAM_INPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0, i_id_buf,
- 3, &i_id_len);
- ut_a(ret == SQL_SUCCESS);
- i_id_len = 3;
-
- ret = SQLBindParameter(single_row_select_query, 2, SQL_PARAM_OUTPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0, i_name_buf,
- 24, &i_name_len);
- ut_a(ret == SQL_SUCCESS);
- i_name_buf[24] = '\0';
-
- oldtm = ut_clock();
-
- for (i = 0; i < 10000; i++) {
-
- mach_write_to_3(i_id_buf, ut_rnd_interval(1, n_items));
-
- ret = SQLExecute(single_row_select_query);
-
- ut_a(ret == SQL_SUCCESS);
- }
-
- tm = ut_clock();
-
- printf("Wall time for %lu single row selects %lu milliseconds\n",
- i, tm - oldtm);
- return(0);
-}
-
-/*********************************************************************
-TPC-D query 5. */
-
-ulint
-test_tpc_d_client(
-/*==============*/
- void* arg) /* in: pointer to an array of startdate and enddate */
-{
- char buf[20];
- HENV env;
- HDBC conn1;
- RETCODE ret;
- HSTMT query5;
- HSTMT join_test;
- char* str;
- SDWORD len1;
- SDWORD len2;
- ulint i;
- ulint tm, oldtm;
-
- UT_NOT_USED(arg);
-
- ret = SQLAllocEnv(&env);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocConnect(env, &conn1);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn1, &query5);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn1, &join_test);
-
- ut_a(ret == SQL_SUCCESS);
-
- sprintf(buf, "Use2%5lu", *((ulint*)arg));
-
- ret = SQLConnect(conn1, (UCHAR*)cli_srv_endpoint_name,
- (SWORD)ut_strlen(cli_srv_endpoint_name),
- (UCHAR*)buf,
- (SWORD)9, (UCHAR*)"password", 8);
- ut_a(ret == SQL_SUCCESS);
-
- printf("Connection established\n");
-
- /*-----------------------------------------------------------*/
- str = "{TPC_D_QUERY_5(?, ?)}";
-
- ret = SQLPrepare(query5, (UCHAR*)str, ut_strlen(str));
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(query5, 1, SQL_PARAM_INPUT,
- SQL_C_LONG, SQL_INTEGER, 0, 0,
- (byte*)arg,
- 4, &len1);
- ut_a(ret == SQL_SUCCESS);
-
- len1 = 4;
-
- ret = SQLBindParameter(query5, 2, SQL_PARAM_INPUT,
- SQL_C_LONG, SQL_INTEGER, 0, 0,
- (byte*)arg + sizeof(ulint),
- 4, &len2);
- ut_a(ret == SQL_SUCCESS);
-
- len2 = 4;
-
- str = "{JOIN_TEST()}";
-
- ret = SQLPrepare(join_test, (UCHAR*)str, ut_strlen(str));
-
- ut_a(ret == SQL_SUCCESS);
-
- for (i = 0; i < n_rounds; i++) {
-
- oldtm = ut_clock();
-
- ret = SQLExecute(query5);
-
- /* ret = SQLExecute(join_test); */
-
- ut_a(ret == SQL_SUCCESS);
-
- tm = ut_clock();
-
- printf("Wall time %lu milliseconds\n", tm - oldtm);
- }
-
- printf("%s exits\n", buf);
-
- return(0);
-}
-
-/*********************************************************************
-Checks consistency of the TPC databases. */
-
-ulint
-check_tpc_consistency(
-/*==================*/
- void* arg) /* in: user name */
-{
- HENV env;
- HDBC conn1;
- RETCODE ret;
- HSTMT consistency_query1;
- char* str;
-
- UT_NOT_USED(arg);
-
- ret = SQLAllocEnv(&env);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocConnect(env, &conn1);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn1, &consistency_query1);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLConnect(conn1, (UCHAR*)cli_srv_endpoint_name,
- (SWORD)ut_strlen(cli_srv_endpoint_name),
- (UCHAR*)arg,
- (SWORD)ut_strlen((char*)arg), (UCHAR*)"password", 8);
- ut_a(ret == SQL_SUCCESS);
-
- printf("Connection established\n");
-
- /*-----------------------------------------------------------*/
- str = "{TPC_CONSISTENCY()}";
-
- ret = SQLPrepare(consistency_query1, (UCHAR*)str, ut_strlen(str));
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLExecute(consistency_query1);
-
- ut_a(ret == SQL_SUCCESS);
-
- printf("Consistency checked\n");
-
- return(0);
-}
-
-/*********************************************************************
-Test for errors. */
-
-ulint
-test_client_errors2(
-/*================*/
- void* arg) /* in: ignored */
-{
- HENV env;
- HDBC conn1;
- RETCODE ret;
- HSTMT error_test_query1;
- char* str;
- byte buf1[2];
- SDWORD len1;
- UCHAR sql_state[6];
- SDWORD native_error;
- UCHAR error_msg[512];
- SWORD error_msg_max = 512;
- SWORD error_msg_len;
-
- UT_NOT_USED(arg);
-
- ret = SQLAllocEnv(&env);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocConnect(env, &conn1);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn1, &error_test_query1);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLConnect(conn1, (UCHAR*)cli_srv_endpoint_name,
- (SWORD)ut_strlen(cli_srv_endpoint_name),
- (UCHAR*)"conn2",
- (SWORD)5, (UCHAR*)"password", 8);
- ut_a(ret == SQL_SUCCESS);
-
- printf("Connection established\n");
-
- /*-----------------------------------------------------------*/
- str = "{TEST_ERRORS(?)}";
-
- ret = SQLPrepare(error_test_query1, (UCHAR*)str, ut_strlen(str));
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(error_test_query1, 1, SQL_PARAM_INPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0, buf1,
- 2, &len1);
- ut_a(ret == SQL_SUCCESS);
-
- /*-----------------------------------------------------------*/
-
- printf("Thread 2 to do update\n");
-
- ut_memcpy(buf1, "06", 2);
- len1 = 2;
- ret = SQLExecute(error_test_query1);
- ut_a(ret == SQL_SUCCESS);
-
- printf("Thread 2 has done update\n");
-
- ret = SQLError(SQL_NULL_HENV, SQL_NULL_HDBC, error_test_query1,
- sql_state, &native_error, error_msg, error_msg_max,
- &error_msg_len);
-
- ut_a(ret == SQL_NO_DATA_FOUND);
-
- return(0);
-}
-
-/*********************************************************************
-Test for errors. */
-
-ulint
-test_client_errors(
-/*===============*/
- void* arg) /* in: ignored */
-{
- HENV env;
- HDBC conn1;
- RETCODE ret;
- HSTMT error_test_query1;
- char* str;
- byte buf1[2];
- SDWORD len1;
- UCHAR sql_state[6];
- SDWORD native_error;
- UCHAR error_msg[512];
- SWORD error_msg_max = 512;
- SWORD error_msg_len;
- os_thread_id_t thread_id;
-
- UT_NOT_USED(arg);
-
- ret = SQLAllocEnv(&env);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocConnect(env, &conn1);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLAllocStmt(conn1, &error_test_query1);
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLConnect(conn1, (UCHAR*)"innobase", 8, (UCHAR*)"conn1",
- (SWORD)5, (UCHAR*)"password", 8);
- ut_a(ret == SQL_SUCCESS);
-
- printf("Connection established\n");
-
- /*-----------------------------------------------------------*/
- str = "{TEST_ERRORS(?)}";
-
- ret = SQLPrepare(error_test_query1, (UCHAR*)str, ut_strlen(str));
-
- ut_a(ret == SQL_SUCCESS);
-
- ret = SQLBindParameter(error_test_query1, 1, SQL_PARAM_INPUT,
- SQL_C_CHAR, SQL_CHAR, 0, 0, buf1,
- 2, &len1);
- ut_a(ret == SQL_SUCCESS);
-
- /*-----------------------------------------------------------*/
-
- ut_memcpy(buf1, "01", 2);
- len1 = 2;
- ret = SQLExecute(error_test_query1);
- ut_a(ret == SQL_SUCCESS);
-
- ut_memcpy(buf1, "02", 2);
- len1 = 2;
- ret = SQLExecute(error_test_query1);
- ut_a(ret == SQL_ERROR);
-
- ret = SQLError(SQL_NULL_HENV, SQL_NULL_HDBC, error_test_query1,
- sql_state, &native_error, error_msg, error_msg_max,
- &error_msg_len);
-
- ut_a(ret == SQL_SUCCESS);
-
- printf("%s\n", error_msg);
-
- ret = SQLError(SQL_NULL_HENV, SQL_NULL_HDBC, error_test_query1,
- sql_state, &native_error, error_msg, error_msg_max,
- &error_msg_len);
-
- ut_a(ret == SQL_NO_DATA_FOUND);
-
- ut_memcpy(buf1, "03", 2);
- len1 = 2;
- ret = SQLExecute(error_test_query1);
- ut_a(ret == SQL_SUCCESS);
-
- ut_memcpy(buf1, "01", 2);
- len1 = 2;
- ret = SQLExecute(error_test_query1);
- ut_a(ret == SQL_ERROR);
-
- ret = SQLError(SQL_NULL_HENV, SQL_NULL_HDBC, error_test_query1,
- sql_state, &native_error, error_msg, error_msg_max,
- &error_msg_len);
-
- ut_a(ret == SQL_SUCCESS);
-
- printf("%s\n", error_msg);
-
- ut_memcpy(buf1, "03", 2);
- len1 = 2;
- ret = SQLExecute(error_test_query1);
- ut_a(ret == SQL_SUCCESS);
-
- ut_memcpy(buf1, "04", 2);
- len1 = 2;
- ret = SQLExecute(error_test_query1);
- ut_a(ret == SQL_ERROR);
-
- ret = SQLError(SQL_NULL_HENV, SQL_NULL_HDBC, error_test_query1,
- sql_state, &native_error, error_msg, error_msg_max,
- &error_msg_len);
-
- ut_a(ret == SQL_SUCCESS);
-
- printf("%s\n", error_msg);
-
- ut_memcpy(buf1, "03", 2);
- len1 = 2;
- ret = SQLExecute(error_test_query1);
- ut_a(ret == SQL_SUCCESS);
-
- ut_memcpy(buf1, "05", 2);
- len1 = 2;
- ret = SQLExecute(error_test_query1);
- ut_a(ret == SQL_SUCCESS);
-
- os_thread_create(&test_client_errors2, "user000", &thread_id);
-
- os_thread_sleep(5000000);
-
- ut_memcpy(buf1, "07", 2);
- len1 = 2;
- ret = SQLExecute(error_test_query1);
- ut_a(ret == SQL_ERROR);
-
- ret = SQLError(SQL_NULL_HENV, SQL_NULL_HDBC, error_test_query1,
- sql_state, &native_error, error_msg, error_msg_max,
- &error_msg_len);
-
- ut_a(ret == SQL_SUCCESS);
-
- printf("%s\n", error_msg);
-
- printf("Thread 1 to commit\n");
-
- ut_memcpy(buf1, "08", 2);
- len1 = 2;
- ret = SQLExecute(error_test_query1);
- ut_a(ret == SQL_SUCCESS);
-
- return(0);
-}
-
-/*************************************************************************
-Simulates disk waits: if there are at least two threads active,
-puts the current thread to wait for an event. If there is just the current
-thread active and another thread doing a simulated disk wait, puts the
-current thread to wait and releases another thread from wait, otherwise does
-nothing */
-
-void
-srv_simulate_disk_wait(void)
-/*========================*/
-{
- os_event_t event;
- ulint wait_i;
- ulint count;
- bool found;
- ulint rnd;
- ulint i;
- ulint j;
-
- mutex_enter(&kernel_mutex);
-
- srv_disk_rnd += 98687241;
-
- count = 0;
- found = FALSE;
-
- for (i = 0; i < SRV_N_SIM_DISK_ARRAY; i++) {
-
- if (!srv_sim_disk[i].empty) {
-
- count++;
- }
-
- if (!found && srv_sim_disk[i].empty) {
-
- srv_sim_disk[i].empty = FALSE;
- event = srv_sim_disk[i].event;
-
- os_event_reset(event);
- srv_sim_disk[i].event_set = FALSE;
-
- wait_i = i;
-
- found = TRUE;
- }
- }
-
- ut_a(found);
-
- if (srv_disk_n_active_threads == count + 1) {
- /* We have to release a thread from the disk wait array */;
-
- rnd = srv_disk_rnd;
-
- for (i = rnd; i < SRV_N_SIM_DISK_ARRAY + rnd; i++) {
-
- j = i % SRV_N_SIM_DISK_ARRAY;
-
- if (!srv_sim_disk[j].empty
- && !srv_sim_disk[j].event_set) {
-
- srv_sim_disk[j].event_set = TRUE;
- os_event_set(srv_sim_disk[j].event);
-
- break;
- }
- }
- }
-
- mutex_exit(&kernel_mutex);
-
- os_event_wait(event);
-
- mutex_enter(&kernel_mutex);
-
- srv_sim_disk[wait_i].empty = TRUE;
-
- mutex_exit(&kernel_mutex);
-}
-
-/*************************************************************************
-Releases a thread from the simulated disk wait array if there is any to
-release. */
-
-void
-srv_simulate_disk_wait_release(void)
-/*================================*/
-{
- ulint rnd;
- ulint i;
- ulint j;
-
- mutex_enter(&kernel_mutex);
-
- srv_disk_rnd += 98687241;
- rnd = srv_disk_rnd;
-
- for (i = rnd; i < SRV_N_SIM_DISK_ARRAY + rnd; i++) {
-
- j = i % SRV_N_SIM_DISK_ARRAY;
-
- if (!srv_sim_disk[j].empty
- && !srv_sim_disk[j].event_set) {
-
- srv_sim_disk[j].event_set = TRUE;
- os_event_set(srv_sim_disk[j].event);
-
- break;
- }
- }
-
- mutex_exit(&kernel_mutex);
-}
-
-/*********************************************************************
-Test for many threads and disk waits. */
-
-ulint
-test_disk_waits(
-/*============*/
- void* arg) /* in: ignored */
-{
- ulint i;
- ulint tm, oldtm;
-
- UT_NOT_USED(arg);
-
- n_exited++;
-
- printf("Client thread starts as the %luth\n", n_exited);
-
- oldtm = ut_clock();
-
- mutex_enter(&kernel_mutex);
- srv_disk_n_active_threads++;
- mutex_exit(&kernel_mutex);
-
- for (i = 0; i < 133; i++) {
- ut_delay(500);
-
-/* os_thread_yield(); */
-
-/* os_thread_sleep(10000); */
-
- srv_simulate_disk_wait();
- }
-
- mutex_enter(&kernel_mutex);
- srv_disk_n_active_threads--;
- mutex_exit(&kernel_mutex);
-
- srv_simulate_disk_wait_release();
-
- tm = ut_clock();
-
- printf("Wall time for %lu loops %lu milliseconds\n", i, tm - oldtm);
-
- n_exited++;
-
- printf("Client thread exits as the %luth\n", n_exited);
-
- return(0);
-}
-
-/*************************************************************************
-Reads a keywords and a values from an initfile. In case of an error, exits
-from the process. */
-
-void
-cli_read_initfile(
-/*==============*/
- FILE* initfile) /* in: file pointer */
-{
- char str_buf[10000];
- ulint ulint_val;
-
- srv_read_init_val(initfile, FALSE, "SRV_ENDPOINT_NAME", str_buf,
- &ulint_val);
- ut_a(ut_strlen(str_buf) < COM_MAX_ADDR_LEN);
-
- ut_memcpy(cli_srv_endpoint_name, str_buf, COM_MAX_ADDR_LEN);
-
- srv_read_init_val(initfile, FALSE, "USER_NAME", str_buf,
- &ulint_val);
- ut_a(ut_strlen(str_buf) < COM_MAX_ADDR_LEN);
-
- ut_memcpy(cli_user_name, str_buf, COM_MAX_ADDR_LEN);
-
- srv_read_init_val(initfile, TRUE, "MEM_POOL_SIZE", str_buf,
- &mem_pool_size);
-
- srv_read_init_val(initfile, TRUE, "N_WAREHOUSES", str_buf,
- &n_warehouses);
-
- srv_read_init_val(initfile, TRUE, "N_CUSTOMERS_D", str_buf,
- &n_customers_d);
-
- srv_read_init_val(initfile, TRUE, "IS_TPC_D", str_buf,
- &is_tpc_d);
-
- srv_read_init_val(initfile, TRUE, "N_ROUNDS", str_buf,
- &n_rounds);
-
- srv_read_init_val(initfile, TRUE, "N_USERS", str_buf,
- &n_users);
-
- srv_read_init_val(initfile, TRUE, "STARTDATE", str_buf,
- &startdate);
-
- srv_read_init_val(initfile, TRUE, "ENDDATE", str_buf,
- &enddate);
-
- srv_read_init_val(initfile, TRUE, "OWN_WAREHOUSE", str_buf,
- &own_warehouse);
-}
-
-/*************************************************************************
-*/
-void
-cli_boot(
-/*=====*/
- char* name) /* in: the initialization file name */
-{
- FILE* initfile;
-
- initfile = fopen(name, "r");
-
- if (initfile == NULL) {
- printf(
- "Error in client booting: could not open initfile whose name is %s!\n",
- name);
- os_process_exit(1);
- }
-
- cli_read_initfile(initfile);
-
- fclose(initfile);
-}
-
-/********************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- os_thread_t thread_handles[1000];
- os_thread_id_t thread_ids[1000];
- char user_names[1000];
- ulint tm, oldtm;
- ulint i;
- ulint dates[1000];
-
- cli_boot("cli_init");
-
- for (i = 1; i <= n_users; i++) {
- dates[2 * i] = startdate
- + ((enddate - startdate) / n_users) * (i - 1);
- dates[2 * i + 1] = startdate
- + ((enddate - startdate) / n_users) * i;
- }
-
- sync_init();
-
- mem_init(mem_pool_size);
-
- test_init(NULL);
-
- check_tpc_consistency("con21");
-
-/* test_client_errors(NULL); */
-
- os_thread_sleep(4000000);
-
- printf("Sleep ends\n");
-
- oldtm = ut_clock();
-
- for (i = 2; i <= n_users; i++) {
- if (is_tpc_d) {
- thread_handles[i] = os_thread_create(&test_tpc_d_client,
- dates + 2 * i, thread_ids + i);
- } else {
- sprintf(user_names + i * 8, "use2%3lu", i);
-
- thread_handles[i] = os_thread_create(&test_client,
- user_names + i * 8, thread_ids + i);
- }
-
- ut_a(thread_handles[i]);
- }
-
- if (is_tpc_d) {
- test_tpc_d_client(dates + 2 * 1);
- } else {
- test_client("use2 1");
- }
-
- for (i = 2; i <= n_users; i++) {
- os_thread_wait(thread_handles[i]);
-
- printf("Wait for thread %lu ends\n", i);
- }
-
- tm = ut_clock();
-
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
-
- os_thread_sleep(4000000);
-
- printf("Sleep ends\n");
-
- test_single_row_select("con99");
-
- check_tpc_consistency("con22");
-
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/btr/ts/tsrecv.c b/innobase/btr/ts/tsrecv.c
deleted file mode 100644
index 0f30fcd94f1..00000000000
--- a/innobase/btr/ts/tsrecv.c
+++ /dev/null
@@ -1,4909 +0,0 @@
-/************************************************************************
-Test for the B-tree
-
-(c) 1994-1997 Innobase Oy
-
-Created 2/16/1996 Heikki Tuuri
-*************************************************************************/
-
-#include "os0proc.h"
-#include "sync0sync.h"
-#include "ut0mem.h"
-#include "mem0mem.h"
-#include "mem0pool.h"
-#include "data0data.h"
-#include "data0type.h"
-#include "dict0dict.h"
-#include "buf0buf.h"
-#include "os0file.h"
-#include "os0thread.h"
-#include "fil0fil.h"
-#include "fsp0fsp.h"
-#include "rem0rec.h"
-#include "rem0cmp.h"
-#include "mtr0mtr.h"
-#include "log0log.h"
-#include "log0recv.h"
-#include "page0page.h"
-#include "page0cur.h"
-#include "trx0trx.h"
-#include "dict0boot.h"
-#include "trx0sys.h"
-#include "dict0crea.h"
-#include "btr0btr.h"
-#include "btr0pcur.h"
-#include "btr0cur.h"
-#include "btr0sea.h"
-#include "rem0rec.h"
-#include "srv0srv.h"
-#include "que0que.h"
-#include "com0com.h"
-#include "usr0sess.h"
-#include "lock0lock.h"
-#include "trx0roll.h"
-#include "trx0purge.h"
-#include "row0ins.h"
-#include "row0upd.h"
-#include "row0row.h"
-#include "row0del.h"
-#include "lock0lock.h"
-#include "ibuf0ibuf.h"
-
-os_file_t files[1000];
-
-mutex_t ios_mutex;
-ulint ios;
-ulint n[10];
-
-mutex_t incs_mutex;
-ulint incs;
-
-byte bigbuf[1000000];
-
-#define N_SPACES 3 /* must be >= 2 */
-#define N_FILES 1
-#define FILE_SIZE 512 /* must be > 512 */
-#define POOL_SIZE 1000
-#define IBUF_SIZE 200
-#define COUNTER_OFFSET 1500
-
-#define N_LOG_GROUPS 2
-#define N_LOG_FILES 3
-#define LOG_FILE_SIZE 500
-
-#define LOOP_SIZE 150
-#define N_THREADS 5
-
-#define COUNT 1
-
-ulint zero = 0;
-
-buf_block_t* bl_arr[POOL_SIZE];
-
-ulint dummy = 0;
-
-/************************************************************************
-Io-handler thread function. */
-
-ulint
-handler_thread(
-/*===========*/
- void* arg)
-{
- ulint segment;
- ulint i;
-
- segment = *((ulint*)arg);
-
- printf("Io handler thread %lu starts\n", segment);
-
- for (i = 0;; i++) {
- fil_aio_wait(segment);
-
- mutex_enter(&ios_mutex);
- ios++;
- mutex_exit(&ios_mutex);
-
- }
-
- return(0);
-}
-
-/*************************************************************************
-Creates or opens the log files. */
-
-void
-create_log_files(void)
-/*==================*/
-{
- bool ret;
- ulint i, k;
- char name[20];
-
- printf("--------------------------------------------------------\n");
- printf("Create or open log files\n");
-
- strcpy(name, "logfile00");
-
- for (k = 0; k < N_LOG_GROUPS; k++) {
- for (i = 0; i < N_LOG_FILES; i++) {
-
- name[6] = (char)((ulint)'0' + k);
- name[7] = (char)((ulint)'0' + i);
-
- files[i] = os_file_create(name, OS_FILE_CREATE, OS_FILE_AIO,
- &ret);
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(
- name, OS_FILE_OPEN, OS_FILE_AIO, &ret);
- ut_a(ret);
- } else {
- ut_a(os_file_set_size(files[i],
- 8192 * LOG_FILE_SIZE, 0));
- }
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create(name, k + 100, FIL_LOG);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, LOG_FILE_SIZE, k + 100);
- }
-
- fil_space_create(name, k + 200, FIL_LOG);
-
- log_group_init(k, N_LOG_FILES, LOG_FILE_SIZE * UNIV_PAGE_SIZE,
- k + 100, k + 200);
- }
-}
-
-/*************************************************************************
-Creates the files for the file system test and inserts them to the file
-system. */
-
-void
-create_files(void)
-/*==============*/
-{
- bool ret;
- ulint i, k;
- char name[20];
- os_thread_t thr[10];
- os_thread_id_t id[10];
-
- printf("--------------------------------------------------------\n");
- printf("Create or open database files\n");
-
- strcpy(name, "tsfile00");
-
- for (k = 0; k < 2 * N_SPACES; k += 2) {
- for (i = 0; i < N_FILES; i++) {
-
- name[6] = (char)((ulint)'0' + k);
- name[7] = (char)((ulint)'0' + i);
-
- files[i] = os_file_create(name, OS_FILE_CREATE,
- OS_FILE_AIO, &ret);
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(
- name, OS_FILE_OPEN, OS_FILE_AIO, &ret);
- ut_a(ret);
- } else {
- if (k == 1) {
- ut_a(os_file_set_size(files[i],
- 8192 * IBUF_SIZE, 0));
- } else {
- ut_a(os_file_set_size(files[i],
- 8192 * FILE_SIZE, 0));
- }
- }
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create(name, k, FIL_TABLESPACE);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, FILE_SIZE, k);
- }
- }
-
- ios = 0;
-
- mutex_create(&ios_mutex);
- mutex_set_level(&ios_mutex, SYNC_NO_ORDER_CHECK);
-
- for (i = 0; i < 9; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(handler_thread, n + i, id + i);
- }
-}
-
-/*********************************************************************
-Test for table creation. */
-
-ulint
-test1(
-/*==*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- dict_index_t* index;
- dict_table_t* table;
- que_fork_t* fork;
- que_thr_t* thr;
- trx_t* trx;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1. CREATE TABLE WITH 3 COLUMNS AND WITH 3 INDEXES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- table = dict_mem_table_create("TS_TABLE1", 0, 3);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- /*------------------------------------*/
- /* CREATE TABLE */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = tab_create_graph_create(fork, thr, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS"); */
- /*-------------------------------------*/
- /* CREATE CLUSTERED INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND1", 0,
- DICT_UNIQUE | DICT_CLUSTERED, 1);
- dict_mem_index_add_field(index, "COL1", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- /*-------------------------------------*/
- /* CREATE SECONDARY INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND2", 0, 0, 1);
-
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- /*-------------------------------------*/
- /* CREATE ANOTHER SECONDARY INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND3", 0, 0, 1);
-
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-#ifdef notdefined
- /*-------------------------------------*/
- /* CREATE YET ANOTHER SECONDARY INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND4", 0, 0, 1);
-
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-#endif
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- return(0);
-}
-
-/*********************************************************************
-Another test for table creation. */
-
-ulint
-test1_5(
-/*====*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- dict_index_t* index;
- dict_table_t* table;
- que_fork_t* fork;
- que_thr_t* thr;
- trx_t* trx;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1.5. CREATE TABLE WITH 3 COLUMNS AND WITH 1 INDEX\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- table = dict_mem_table_create("TS_TABLE2", 0, 3);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- /*------------------------------------*/
- /* CREATE TABLE */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = tab_create_graph_create(fork, thr, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS"); */
- /*-------------------------------------*/
- /* CREATE CLUSTERED INDEX */
-
- index = dict_mem_index_create("TS_TABLE2", "IND1", 0,
- DICT_CLUSTERED | DICT_UNIQUE, 1);
-
- dict_mem_index_add_field(index, "COL1", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- return(0);
-}
-
-/*********************************************************************
-Another test for table creation. */
-
-ulint
-test1_6(
-/*====*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- dict_index_t* index;
- dict_table_t* table;
- que_fork_t* fork;
- que_thr_t* thr;
- trx_t* trx;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1.6. CREATE TABLE WITH 3 COLUMNS AND WITH 1 INDEX\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- table = dict_mem_table_create("TS_TABLE3", 0, 3);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- /*------------------------------------*/
- /* CREATE TABLE */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = tab_create_graph_create(fork, thr, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS"); */
- /*-------------------------------------*/
- /* CREATE CLUSTERED INDEX */
-
- index = dict_mem_index_create("TS_TABLE3", "IND1", 0, DICT_CLUSTERED,
- 2);
- dict_mem_index_add_field(index, "COL1", 0);
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- return(0);
-}
-
-/*********************************************************************
-Another test for table creation. */
-
-ulint
-test1_7(
-/*====*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- dict_index_t* index;
- dict_table_t* table;
- que_fork_t* fork;
- que_thr_t* thr;
- trx_t* trx;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1.7. CREATE TABLE WITH 12 COLUMNS AND WITH 1 INDEX\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- table = dict_mem_table_create("TS_TABLE4", 0, 12);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL4", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL5", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL6", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL7", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL8", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL9", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL10", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL11", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL12", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- /*------------------------------------*/
- /* CREATE TABLE */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = tab_create_graph_create(fork, thr, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS"); */
- /*-------------------------------------*/
- /* CREATE CLUSTERED INDEX */
-
- index = dict_mem_index_create("TS_TABLE4", "IND1", 0,
- DICT_CLUSTERED | DICT_UNIQUE, 1);
-
- dict_mem_index_add_field(index, "COL1", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- return(0);
-}
-
-/*********************************************************************
-Test for inserts. */
-
-ulint
-test2(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
- dict_index_t* index;
-/* ulint size; */
- dtuple_t* entry;
- btr_pcur_t pcur;
- mtr_t mtr;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2. MASSIVE INSERT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- btr_search_print_info();
-
- /*-------------------------------------*/
- /* MASSIVE RANDOM INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- rnd = (rnd + 7857641) % 200000;
-
- dtuple_gen_test_tuple3(row, rnd,
- DTUPLE_TEST_RND30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- if (i % 1000 == 0) {
- printf(
- "********************************Inserted %lu rows\n", i);
- ibuf_print();
- }
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-/*
- for (i = 0; i < 10; i++) {
- size = ibuf_contract(TRUE);
-
- printf("%lu bytes will be contracted\n", size);
-
- os_thread_sleep(1000000);
- }
-*/
- index = dict_table_get_next_index(dict_table_get_first_index(table));
- tree = dict_index_get_tree(index);
- btr_validate_tree(tree);
-
- index = dict_table_get_next_index(index);
- tree = dict_index_get_tree(index);
- btr_validate_tree(tree);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- btr_search_print_info();
-
- /* Check inserted entries */
- rnd = 0;
-
- entry = dtuple_create(heap, 1);
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- rnd = (rnd + 7857641) % 200000;
- dtuple_gen_search_tuple3(entry, rnd, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur,
- &mtr);
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
- }
-
- btr_validate_tree(tree);
-
-/* btr_print_tree(tree, 5); */
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(1000000);
-
- btr_validate_tree(tree);
-
-/* btr_search_print_info();
- dict_table_print_by_name("TS_TABLE1"); */
- /*-------------------------------------*/
-#ifdef notdefined
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-#endif
- /*-------------------------------------*/
- count++;
-
- if (count < 1) {
- goto loop;
- }
-
- mem_heap_free(heap);
- return(0);
-}
-
-/*********************************************************************
-Another test for inserts. */
-
-ulint
-test2_1(
-/*====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- byte buf[100];
- ins_node_t* node;
- ulint count = 0;
- ulint rnd;
- dtuple_t* row;
-/* dict_tree_t* tree;
- dict_index_t* index;
- dtuple_t* entry;
- btr_pcur_t pcur;
- mtr_t mtr; */
-
- printf("-------------------------------------------------\n");
- printf("TEST 2.1. MASSIVE ASCENDING INSERT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- rnd = 0;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_RND3500, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- if (i % 5000 == 0) {
- /* ibuf_print(); */
- /* buf_print(); */
-
- /* buf_print_io(); */
-
- tm = ut_clock();
- /*
- printf("Wall time for %lu inserts %lu milliseconds\n",
- i, tm - oldtm); */
- }
-
- rnd = rnd + 1;
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
-#ifdef notdefined
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- ibuf_print();
-
- index = dict_table_get_first_index(table);
-
- btr_search_index_print_info(index);
-
- btr_validate_tree(dict_index_get_tree(index));
-
- index = dict_table_get_next_index(index);
-
- btr_search_index_print_info(index);
-
- btr_validate_tree(dict_index_get_tree(index));
-
- index = dict_table_get_next_index(index);
-
- btr_search_index_print_info(index);
-
- btr_validate_tree(dict_index_get_tree(index));
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- /* Check inserted entries */
-
- btr_search_print_info();
-
- entry = dtuple_create(heap, 1);
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- for (i = 0; i < *((ulint*)arg); i++) {
- ut_a(btr_pcur_move_to_next(&pcur, &mtr));
-
- dtuple_gen_search_tuple3(entry, i, buf);
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
- }
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-#endif
-#ifdef notdefined
- /*-------------------------------------*/
- /* ROLLBACK */
-
-/* btr_validate_tree(tree); */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(1000000);
-
-
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
-
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- btr_search_print_info();
-
-#endif
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
- /*-------------------------------------*/
-
- count++;
-/* btr_validate_tree(tree); */
-
- if (count < 5) {
- goto loop;
- }
-
- mem_heap_free(heap);
-
- return(0);
-}
-
-/*********************************************************************
-Another test for inserts. */
-
-ulint
-test2_2(
-/*====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- dict_index_t* index;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
- btr_pcur_t pcur;
- mtr_t mtr;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2.2. MASSIVE DESCENDING INSERT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = *((ulint*)arg) + 1;
-
- oldtm = ut_clock();
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- rnd = (rnd - 1) % 200000;
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- if (i % 1000 == 0) {
-/* printf(
- "********************************Inserted %lu rows\n", i);
- ibuf_print(); */
- }
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- /* Check inserted entries */
-
- entry = dtuple_create(heap, 1);
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- for (i = 0; i < *((ulint*)arg); i++) {
- ut_a(btr_pcur_move_to_next(&pcur, &mtr));
-
- dtuple_gen_search_tuple3(entry, i + 1, buf);
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
- }
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- btr_validate_tree(tree);
-/* dict_table_print_by_name("TS_TABLE1"); */
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(1000000);
-
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
-
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- /*-------------------------------------*/
-#ifdef notdefined
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-#endif
- /*-------------------------------------*/
- count++;
-
- if (count < 1) {
- goto loop;
- }
-
- btr_validate_tree(tree);
- mem_heap_free(heap);
- return(0);
-}
-
-/*********************************************************************
-Multithreaded test for random inserts. */
-
-ulint
-test2mt(
-/*====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- dict_index_t* index;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2MT. MULTITHREADED RANDOM INSERT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
- rnd = 78675;
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- if (i % 100 == 0) {
-/* buf_print(); */
-/* ibuf_print(); */
- }
-
- rnd = (rnd + 7857641) % 500;
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(3000000);
- /*-------------------------------------*/
-#ifdef notdefined
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-#endif
- /*-------------------------------------*/
- count++;
-
- if (count < COUNT) {
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for multithreaded sequential inserts. */
-
-ulint
-test2_1mt(
-/*======*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- dict_index_t* index;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2.1MT. MULTITHREADED ASCENDING INSERT\n");
-
- rnd = 8757677;
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- rnd += 98667501;
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- rnd = (rnd + 1) % 500;
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(3000000);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- /*-------------------------------------*/
-#ifdef notdefined
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-#endif
- /*-------------------------------------*/
- count++;
-
- if (count < COUNT) {
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for multithreaded sequential inserts. */
-
-ulint
-test2_2mt(
-/*======*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2.2MT. MULTITHREADED DESCENDING INSERT\n");
-
- rnd = 87677;
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- rnd += 78667;
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- rnd = (rnd - 1) % 500;
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_RND30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(3000000);
- /*-------------------------------------*/
-#ifdef notdefined
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-#endif
- /*-------------------------------------*/
- count++;
-
- mem_print_info();
-
- if (count < COUNT) {
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for updates. */
-
-ulint
-test3(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- byte* ptr;
- ulint len;
- ulint err;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 3. UPDATES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- thr->child = ins_node_create(fork, thr, row, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 3; i++) {
- dtuple_gen_test_tuple3(row, i, DTUPLE_TEST_RND30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- dict_table_print_by_name("TS_TABLE1");
- /*-------------------------------------*/
- /* UPDATE ROWS */
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- update = upd_create(1, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- dtuple_gen_test_tuple3(row, 1, DTUPLE_TEST_RND30, buf);
-
- entry = dtuple_create(heap, 2);
- dfield_copy(dtuple_get_nth_field(entry, 0),
- dtuple_get_nth_field(row, 0));
- dfield_copy(dtuple_get_nth_field(entry, 1),
- dtuple_get_nth_field(row, 1));
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 2, table);
- dfield_set_data(&(ufield->new_val), "updated field", 14);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- mtr_start(&mtr);
-
- ut_a(btr_pcur_restore_position(BTR_SEARCH_LEAF, &pcur, &mtr));
-
- ptr = rec_get_nth_field(btr_pcur_get_rec(&pcur), 5, &len);
-
- ut_a(ut_memcmp(ptr, "updated field", 14) == 0);
-
- btr_pcur_commit(&pcur);
-
- dict_table_print_by_name("TS_TABLE1");
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 0, table);
- dfield_set_data(&(ufield->new_val), "31415926", 9);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- dict_table_print_by_name("TS_TABLE1");
- /*-------------------------------------*/
- /* ROLLBACK */
-#ifdef notdefined
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu updates %lu milliseconds\n",
- i, tm - oldtm);
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- /*-------------------------------------*/
-#endif
- dict_table_print_by_name("TS_TABLE1");
- count++;
-
- if (count < 1) {
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Init for update test. */
-
-ulint
-test4_1(void)
-/*=========*/
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
-
- printf("-------------------------------------------------\n");
- printf("TEST 4.1. UPDATE INIT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- thr->child = ins_node_create(fork, thr, row, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 200; i++) {
-
- dtuple_gen_test_tuple3(row, i, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- dict_table_print_by_name("TS_TABLE1");
-
- return(0);
-}
-
-/*************************************************************************
-Checks that the multithreaded update test has rolled back its updates. */
-
-void
-test4_2(void)
-/*=========*/
-{
- dtuple_t* entry;
- mem_heap_t* heap;
- mem_heap_t* heap2;
- mtr_t mtr;
- byte buf[32];
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- que_fork_t* fork;
- dict_table_t* table;
- dict_index_t* index;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- dtuple_t* row;
- btr_pcur_t pcur;
- rec_t* rec;
-
- printf("-------------------------------------------------\n");
- printf("TEST 4.2. CHECK UPDATE RESULT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*------------------------------------------*/
-
- table = dict_table_get("TS_TABLE1", trx);
-
- index = dict_table_get_first_index(table);
-
- entry = dtuple_create(heap, 1);
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- for (i = 0; i < 200; i++) {
- ut_a(btr_pcur_move_to_next(&pcur, &mtr));
-
- dtuple_gen_search_tuple3(entry, i, buf);
-
- rec = btr_pcur_get_rec(&pcur);
-
- ut_a(0 == cmp_dtuple_rec(entry, rec));
-
- heap2 = mem_heap_create(200);
-
- row = row_build(ROW_COPY_DATA, index, rec, heap2);
-
- ut_a(30 == dfield_get_len(dtuple_get_nth_field(row, 2)));
- ut_a(0 == ut_memcmp(
- dfield_get_data(dtuple_get_nth_field(row, 2)),
- "12345678901234567890123456789", 30));
-
- mem_heap_free(heap2);
- }
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-}
-
-/*********************************************************************
-Test for massive updates. */
-
-ulint
-test4mt(
-/*====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* entry;
- byte buf[100];
- byte buf2[4000];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 4. MULTITHREADED UPDATES\n");
-
- thr_no = *((ulint*)arg);
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- /*-------------------------------------*/
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- update = upd_create(1, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 87607651;
-
- entry = dtuple_create(heap, 1);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- for (i = 0; i < 300; i++) {
-
- rnd += 874681;
- tuple_no = (rnd % 40) * 5 + thr_no;
-
- dtuple_gen_search_tuple3(entry, tuple_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
-/* printf("Thread %lu to update row %lu\n", thr_no, tuple_no); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 2, table);
- dfield_set_data(&(ufield->new_val), buf2, rnd % 3000);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- } /* for (i = ... */
-
- tm = ut_clock();
- printf("Wall time for %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- lock_validate();
-
-/* lock_print_info(); */
-
-/* mem_print_info(); */
-
- mem_pool_print_info(mem_comm_pool);
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(2000000);
-
- btr_validate_tree(tree);
-
- ut_a(trx->conc_state != TRX_ACTIVE);
- ut_a(UT_LIST_GET_LEN(trx->trx_locks) == 0);
-
- count++;
-
- if (count < 2) {
-
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for join. */
-
-ulint
-test6(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- byte buf[100];
- ulint count = 0;
- dtuple_t* entry;
- dict_index_t* index;
- dict_tree_t* tree;
- btr_pcur_t pcur;
- btr_pcur_t pcur2;
- mtr_t mtr;
- mtr_t mtr2;
- ulint rnd;
- ulint latch_mode;
-
- printf("-------------------------------------------------\n");
- printf("TEST 6. MASSIVE EQUIJOIN\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- /*--------------*/
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
- /*--------------*/
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /* Check inserted entries */
-
- entry = dtuple_create(heap, 1);
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- table = dict_table_get("TS_TABLE1", trx);
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- oldtm = ut_clock();
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IS, thr));
-
- rnd = 98651;
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- ut_a(btr_pcur_move_to_next(&pcur, &mtr));
-
- btr_pcur_store_position(&pcur, &mtr);
-
- ut_a(DB_SUCCESS == lock_clust_rec_cons_read_check(
- btr_pcur_get_rec(&pcur),
- index));
-
- btr_pcur_commit_specify_mtr(&pcur, &mtr);
-
- if (i % 1211 == 0) {
- dummy++;
- }
-
- rnd = 55321;
-
- dtuple_gen_search_tuple3(entry, rnd % *((ulint*)arg), buf);
-
-/* if (i == 0) { */
- latch_mode = BTR_SEARCH_LEAF;
-/* } else {
- latch_mode = BTR_SEARCH_LEAF | BTR_GUESS_LATCH;
- } */
-
- mtr_start(&mtr2);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, latch_mode,
- &pcur2, &mtr2);
-
- ut_a(DB_SUCCESS == lock_clust_rec_cons_read_check(
- btr_pcur_get_rec(&pcur2),
- index));
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur2)));
-
- mtr_commit(&mtr2);
-
- mtr_start(&mtr);
-
- btr_pcur_restore_position(BTR_SEARCH_LEAF, &pcur, &mtr);
- }
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- tm = ut_clock();
- printf("Wall time for join of %lu rows %lu milliseconds\n",
- i, tm - oldtm);
- btr_search_index_print_info(index);
- /*-------------------------------------*/
- /* COMMIT */
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
-/* printf("Wall time for commit %lu milliseconds\n", tm - oldtm); */
-
- /*-------------------------------------*/
- count++;
-/* btr_validate_tree(tree); */
-
- if (count < 3) {
- goto loop;
- }
-
- mem_heap_free(heap);
- return(0);
-}
-
-/*********************************************************************
-Test for lock wait. Requires Test 4.1 first. */
-
-ulint
-test7(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- trx_t* trx2;
- ulint rnd;
- dtuple_t* entry;
- dtuple_t* row;
- byte buf[100];
- byte buf2[4000];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 7. LOCK WAIT\n");
-
- thr_no = *((ulint*)arg);
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx2 = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- /*-------------------------------------*/
- /* UPDATE by trx */
- ut_a(trx_start(trx, ULINT_UNDEFINED));
- ut_a(trx_start(trx2, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- update = upd_create(1, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 87607651;
-
- entry = dtuple_create(heap, 2);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- rnd += 874681;
- tuple_no = 3;
-
- dtuple_gen_search_tuple3(entry, tuple_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 2, table);
- dfield_set_data(&(ufield->new_val), buf2, rnd % 1500);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- tm = ut_clock();
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- lock_validate();
-
- lock_print_info();
-
- /*-------------------------------------*/
- /* INSERT by trx2 */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx2;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx2);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- thr->child = ins_node_create(fork, thr, row, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx2->sess);
-
- trx2->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- dtuple_gen_test_tuple3(row, 2, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- /* Insert should be left to wait until trx releases the row lock */
-
- que_run_threads(thr);
-
- tm = ut_clock();
-
- lock_validate();
-
- lock_print_info();
-
- /*-------------------------------------*/
- /* COMMIT of trx */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
-
- /*-------------------------------------*/
- os_thread_sleep(1000000);
-
- printf(
- "trx2 can now continue to do the insert, after trx committed.\n");
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- lock_validate();
-
- lock_print_info();
-
- dict_table_print_by_name("TS_TABLE1");
-
- return(0);
-}
-
-/*********************************************************************
-Inserts for TPC-A. */
-
-ulint
-test8A(
-/*===*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- dict_index_t* index;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
- btr_pcur_t pcur;
- mtr_t mtr;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 8A. 1000 INSERTS FOR TPC-A\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- btr_search_print_info();
-
- /*-------------------------------------*/
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE2", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1000; i++) {
- dtuple_gen_test_tuple_TPC_A(row, rnd, buf);
-
- rnd = rnd + 1;
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
- btr_validate_tree(tree);
-
- /* Check inserted entries */
- rnd = 0;
-
- entry = dtuple_create(heap, 1);
-
- for (i = 0; i < 1000; i++) {
- dtuple_gen_search_tuple_TPC_A(entry, rnd, buf);
-
- rnd = rnd + 1;
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur,
- &mtr);
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
- }
-
- btr_validate_tree(tree);
-
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- /*-------------------------------------*/
- count++;
-
- if (count < 1) {
- goto loop;
- }
-
-/* dict_table_print_by_name("TS_TABLE2"); */
-
- mem_heap_free(heap);
- return(0);
-}
-
-/*********************************************************************
-Test for TPC-A transaction. */
-
-ulint
-test8(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork1;
- que_fork_t* fork2;
- que_fork_t* cfork;
- dict_table_t* table;
- dict_table_t* table2;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ins_node_t* inode;
- ulint rnd = 0;
-
- arg = arg;
-
- printf("-------------------------------------------------\n");
- printf("TEST 8. TPC-A %lu \n", *((ulint*)arg));
-
- oldtm = ut_clock();
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
- /*-----------------------------------*/
-
- fork1 = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork1->trx = trx;
-
- thr = que_thr_create(fork1, fork1, heap);
-
- table = dict_table_get("TS_TABLE3", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- inode = ins_node_create(fork1, thr, row, table, heap);
-
- thr->child = inode;
-
- row_ins_init_sys_fields_at_sql_compile(inode->row, inode->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(inode->row, inode->table, trx);
-
- inode->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork1, trx->sess);
-
- trx->graph = fork1;
-
- mutex_exit(&kernel_mutex);
-
- fork2 = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork2->trx = trx;
-
- thr = que_thr_create(fork2, fork2, heap);
-
- table2 = dict_table_get("TS_TABLE2", trx);
-
- update = upd_create(1, heap);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 1, table2);
-
- entry = dtuple_create(heap, 1);
- dfield_copy(dtuple_get_nth_field(entry, 0),
- dtuple_get_nth_field(row, 0));
-
- node = upd_node_create(fork2, thr, table2, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = UPD_NODE_NO_ORD_CHANGE | UPD_NODE_NO_SIZE_CHANGE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork2, trx->sess);
-
- trx->graph = fork2;
-
- mutex_exit(&kernel_mutex);
-
- cfork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- cfork->trx = trx;
-
- thr = que_thr_create(cfork, cfork, heap);
-
- thr->child = commit_node_create(cfork, thr, heap);
-
- oldtm = ut_clock();
-
-loop:
-/* printf("Round %lu\n", count); */
-
- /*-------------------------------------*/
- /* INSERT */
-
-/* printf("Trx %lu %lu starts, thr %lu\n",
- ut_dulint_get_low(trx->id),
- (ulint)trx,
- *((ulint*)arg)); */
-
- dtuple_gen_test_tuple3(row, count, DTUPLE_TEST_FIXED30, buf);
-
- ins_node_reset(inode);
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(fork1, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- /*-------------------------------------*/
- /* 3 UPDATES */
-
- ut_a(DB_SUCCESS == lock_table(0, table2, LOCK_IX, thr));
-
- for (i = 0; i < 3; i++) {
-
- rnd += 876751;
-
- if (count % 1231 == 0) {
- dummy++;
- }
-
- dtuple_gen_search_tuple_TPC_A(entry, rnd % 1000, buf);
-
- index = dict_table_get_first_index(table2);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_MODIFY_LEAF, &pcur, &mtr);
-
-/* ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur))); */
-
-/* btr_pcur_store_position(&pcur, &mtr); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- ufield = upd_get_nth_field(update, 0);
-
- dfield_set_data(&(ufield->new_val), "1234", 5);
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(fork2, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- } /* for (i = ... */
-
- /*-------------------------------------*/
- /* COMMIT */
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(cfork, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- count++;
-
- if (count < *((ulint*)arg)) {
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- goto loop;
- }
-
-/* printf("Trx %lu %lu committed\n", ut_dulint_get_low(trx->id),
- (ulint)trx); */
- tm = ut_clock();
- printf("Wall time for TPC-A %lu trxs %lu milliseconds\n",
- count, tm - oldtm);
-
- btr_search_index_print_info(index);
- btr_search_index_print_info(dict_table_get_first_index(table));
-
-/* mem_print_info(); */
- /*-------------------------------------*/
-
-
-/* dict_table_print_by_name("TS_TABLE2");
- dict_table_print_by_name("TS_TABLE3"); */
-
- return(0);
-}
-
-/*********************************************************************
-Inserts for TPC-C. */
-
-ulint
-test9A(
-/*===*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
-/* dtuple_t* entry;
- btr_pcur_t pcur;
- mtr_t mtr;
- dict_index_t* index;
- dict_tree_t* tree;
-*/
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 9A. INSERTS FOR TPC-C\n");
-
-#define TPC_C_TABLE_SIZE 15000
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- btr_search_print_info();
-
- /*-------------------------------------*/
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE4", trx);
-
- row = dtuple_create(heap, 12 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < TPC_C_TABLE_SIZE; i++) {
-
- dtuple_gen_test_tuple_TPC_C(row, rnd, buf);
-
- rnd = rnd + 1;
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
-#ifdef notdefined
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
- btr_validate_tree(tree);
-
- /* Check inserted entries */
- rnd = 0;
-
- entry = dtuple_create(heap, 1);
-
- for (i = 0; i < TPC_C_TABLE_SIZE; i++) {
-
- dtuple_gen_search_tuple_TPC_C(entry, rnd, buf);
-
- rnd = rnd + 1;
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur,
- &mtr);
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
- }
-
- btr_validate_tree(tree);
-#endif
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- /*-------------------------------------*/
- count++;
-
- if (count < 1) {
- goto loop;
- }
-
-/* dict_table_print_by_name("TS_TABLE4"); */
-
-/* mem_heap_free(heap); */
- return(0);
-}
-
-/*********************************************************************
-Test for TPC-C transaction. Test 9A must be run first to populate table. */
-
-ulint
-test9(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork1;
- que_fork_t* fork2;
- que_fork_t* cfork;
- dict_table_t* table;
- dict_table_t* table2;
- que_thr_t* thr;
- trx_t* trx;
- ulint j;
- ulint i;
- byte* ptr;
- ulint len;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ins_node_t* inode;
- ulint rnd = 0;
- byte buf2[240];
- rec_t* rec;
-
- arg = arg;
-
- printf("-------------------------------------------------\n");
- printf("TEST 9. TPC-C %lu \n", *((ulint*)arg));
-
- oldtm = ut_clock();
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
- /*-----------------------------------*/
-
- fork1 = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork1->trx = trx;
-
- thr = que_thr_create(fork1, fork1, heap);
-
- table = dict_table_get("TS_TABLE3", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- inode = ins_node_create(fork1, thr, row, table, heap);
-
- thr->child = inode;
-
- row_ins_init_sys_fields_at_sql_compile(inode->row, inode->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(inode->row, inode->table, trx);
-
- inode->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork1, trx->sess);
-
- trx->graph = fork1;
-
- mutex_exit(&kernel_mutex);
-
- fork2 = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork2->trx = trx;
-
- thr = que_thr_create(fork2, fork2, heap);
-
- table2 = dict_table_get("TS_TABLE4", trx);
-
- update = upd_create(3, heap);
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 1, table2);
- ufield = upd_get_nth_field(update, 1);
-
- upd_field_set_col_no(ufield, 1, table2);
- ufield = upd_get_nth_field(update, 2);
-
- upd_field_set_col_no(ufield, 1, table2);
-
- entry = dtuple_create(heap, 1);
- dfield_copy(dtuple_get_nth_field(entry, 0),
- dtuple_get_nth_field(row, 0));
-
- node = upd_node_create(fork2, thr, table2, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = UPD_NODE_NO_ORD_CHANGE | UPD_NODE_NO_SIZE_CHANGE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork2, trx->sess);
-
- trx->graph = fork2;
-
- mutex_exit(&kernel_mutex);
-
- cfork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- cfork->trx = trx;
-
- thr = que_thr_create(cfork, cfork, heap);
-
- thr->child = commit_node_create(cfork, thr, heap);
-
- oldtm = ut_clock();
-loop:
- ut_a(DB_SUCCESS == lock_table(0, table2, LOCK_IS, thr));
- ut_a(DB_SUCCESS == lock_table(0, table2, LOCK_IX, thr));
-
-/* printf("Round %lu\n", count); */
-
-for (j = 0; j < 13; j++) {
-
- /*-------------------------------------*/
- /* SELECT FROM 'ITEM' */
-
- rnd += 876751;
-
- dtuple_gen_search_tuple_TPC_C(entry, rnd % TPC_C_TABLE_SIZE, buf);
-
- index = dict_table_get_first_index(table2);
- tree = dict_index_get_tree(index);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_S, thr);
- ut_a(err == DB_SUCCESS);
-
- rec = btr_pcur_get_rec(&pcur);
-
- for (i = 0; i < 5; i++) {
- ptr = rec_get_nth_field(rec, i + 2, &len);
-
- ut_memcpy(buf2 + i * 24, ptr, len);
- }
-
- mtr_commit(&mtr);
-
- /*-------------------------------------*/
- /* UPDATE 'STOCK' */
-
- rnd += 876751;
-
- if (count % 1231 == 0) {
- dummy++;
- }
-
- dtuple_gen_search_tuple_TPC_C(entry, rnd % TPC_C_TABLE_SIZE, buf);
-
- index = dict_table_get_first_index(table2);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_MODIFY_LEAF, &pcur, &mtr);
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
-
-/* btr_pcur_store_position(&pcur, &mtr); */
-
- rec = btr_pcur_get_rec(&pcur);
-
- for (i = 0; i < 10; i++) {
- ptr = rec_get_nth_field(rec, i + 2, &len);
-
- ut_memcpy(buf2 + i * 24, ptr, len);
- }
-
-/* btr_pcur_commit(&pcur); */
-
-/* err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr); */
- ut_a(DB_SUCCESS == lock_clust_rec_cons_read_check(
- btr_pcur_get_rec(&pcur),
- index));
-/* ut_a(err == DB_SUCCESS); */
-
- ufield = upd_get_nth_field(update, 0);
-
- dfield_set_data(&(ufield->new_val), "1234", 5);
-
- ufield = upd_get_nth_field(update, 1);
-
- dfield_set_data(&(ufield->new_val), "1234", 5);
-
- ufield = upd_get_nth_field(update, 2);
-
- dfield_set_data(&(ufield->new_val), "1234", 5);
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(fork2, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- btr_pcur_close(&pcur);
- /*-------------------------------------*/
- /* INSERT INTO 'ORDERLINE' */
-
-/* printf("Trx %lu %lu starts, thr %lu\n",
- ut_dulint_get_low(trx->id),
- (ulint)trx,
- *((ulint*)arg)); */
-
- dtuple_gen_test_tuple3(row, count * 13 + j, DTUPLE_TEST_FIXED30, buf);
-
- ins_node_reset(inode);
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(fork1, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-}
- /*-------------------------------------*/
- /* COMMIT */
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(cfork, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* printf("Trx %lu %lu committed\n", ut_dulint_get_low(trx->id),
- (ulint)trx); */
- count++;
-
- if (count < *((ulint*)arg)) {
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- goto loop;
- }
-
- tm = ut_clock();
- printf("Wall time for TPC-C %lu trxs %lu milliseconds\n",
- count, tm - oldtm);
-
- btr_search_index_print_info(index);
- btr_search_index_print_info(dict_table_get_first_index(table));
-
-/* mem_print_info(); */
- /*-------------------------------------*/
-/* dict_table_print_by_name("TS_TABLE2");
- dict_table_print_by_name("TS_TABLE3"); */
-
- return(0);
-}
-
-/*********************************************************************
-Init for purge test. */
-
-ulint
-test10_1(
-/*=====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint thr_no;
-
- thr_no = *((ulint*)arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.1. PURGE INIT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- thr->child = ins_node_create(fork, thr, row, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 200; i++) {
-
- dtuple_gen_test_tuple3(row, i * 100 + thr_no,
- DTUPLE_TEST_FIXED30, buf);
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- return(0);
-}
-
-/*********************************************************************
-Test for purge. */
-
-ulint
-test10_2(
-/*=====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* entry;
- byte buf[100];
- byte buf2[1000];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.2. PURGE TEST UPDATES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- /*-------------------------------------*/
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- update = upd_create(2, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 87607651;
-
- entry = dtuple_create(heap, 1);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- for (i = 0; i < 200; i++) {
-
- tuple_no = i;
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + thr_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
-/* printf("Thread %lu to update row %lu\n", thr_no, tuple_no); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 0, table);
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + 10 + thr_no, buf);
-
- dfield_set_data(&(ufield->new_val), dfield_get_data(
- dtuple_get_nth_field(entry, 0)),
- dfield_get_len(
- dtuple_get_nth_field(entry, 0)));
- ufield = upd_get_nth_field(update, 1);
-
- upd_field_set_col_no(ufield, 1, table);
-
- rnd += 98326761;
-
- dfield_set_data(&(ufield->new_val), buf2, rnd % 200);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- fsp_validate(0);
-
- } /* for (i = ... */
-
- tm = ut_clock();
- printf("Wall time for %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
-/* lock_print_info(); */
-
-/* mem_print_info(); */
-
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- count++;
-
- if (count < 1) {
-
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for purge. */
-
-ulint
-test10_2_r(
-/*=======*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* entry;
- byte buf[100];
- byte buf2[1000];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.2. PURGE TEST UPDATES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- /*-------------------------------------*/
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- update = upd_create(2, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 87607651;
-
- entry = dtuple_create(heap, 1);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- for (i = 0; i < 200; i++) {
-
- tuple_no = i;
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + thr_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
-/* printf("Thread %lu to update row %lu\n", thr_no, tuple_no); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 0, table);
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + 10 + thr_no, buf);
-
- dfield_set_data(&(ufield->new_val), dfield_get_data(
- dtuple_get_nth_field(entry, 0)),
- dfield_get_len(
- dtuple_get_nth_field(entry, 0)));
- ufield = upd_get_nth_field(update, 1);
-
- upd_field_set_col_no(ufield, 1, table);
-
- rnd += 98326761;
-
- dfield_set_data(&(ufield->new_val), buf2, rnd % 2000);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- fsp_validate(0);
-
- } /* for (i = ... */
-
- tm = ut_clock();
- printf("Wall time for %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
-/* lock_print_info(); */
-
- mem_pool_print_info(mem_comm_pool);
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(2000000);
-
- count++;
-
- if (count < 1) {
-
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for purge. */
-
-ulint
-test10_3(
-/*=====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* entry;
- byte buf[100];
- btr_pcur_t pcur;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- del_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.3. PURGE TEST DELETES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- /*-------------------------------------*/
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- node = del_node_create(fork, thr, table, &pcur, heap);
- thr->child = node;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- entry = dtuple_create(heap, 1);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- for (i = 0; i < 200; i++) {
-
- rnd = i;
- tuple_no = rnd;
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + 10 + thr_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
-/* printf("Thread %lu to update row %lu\n", thr_no, tuple_no); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- } /* for (i = ... */
-
- tm = ut_clock();
- printf("Wall time for %lu delete markings %lu milliseconds\n",
- i, tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
-/* lock_print_info(); */
-
-/* mem_print_info(); */
-
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- return(0);
-}
-
-/*********************************************************************
-Test for purge. */
-
-ulint
-test10_5(
-/*=====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* entry;
- byte buf[100];
- btr_pcur_t pcur;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- del_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.5. PURGE TEST UNCOMMITTED DELETES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- /*-------------------------------------*/
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- node = del_node_create(fork, thr, table, &pcur, heap);
- thr->child = node;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- entry = dtuple_create(heap, 1);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- for (i = 0; i < 50; i++) {
-
- rnd = i;
- tuple_no = rnd % 100;
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + 10 + thr_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
-/* printf("Thread %lu to update row %lu\n", thr_no, tuple_no); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- } /* for (i = ... */
-
- tm = ut_clock();
- printf("Wall time for %lu delete markings %lu milliseconds\n",
- i, tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
-/* lock_print_info(); */
-
-/* mem_print_info(); */
-
- return(0);
-}
-
-/*********************************************************************
-Multithreaded test for purge. */
-
-ulint
-test10mt(
-/*=====*/
- void* arg)
-{
- ulint i;
- ulint thr_no;
-
- thr_no = *((ulint*)arg);
-
- printf("Thread %lu starts purge test\n", thr_no);
-
- for (i = 0; i < 2; i++) {
- test10_1(arg);
-
- sync_print();
-
- fsp_validate(0);
-
- test10_2_r(arg);
- sync_print();
-
- test10_2(arg);
- sync_print();
-
- lock_validate();
-
- test10_3(arg);
- sync_print();
- }
-
- printf("Thread %lu ends purge test\n", thr_no);
-
- return(0);
-}
-
-/*********************************************************************
-Purge test. */
-
-ulint
-test10_4(
-/*=====*/
- void* arg)
-{
- ulint i;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.4. PURGE TEST\n");
-
- for (i = 0; i < 30; i++) {
- trx_purge();
-
- printf("%lu pages purged\n", purge_sys->n_pages_handled);
-
- os_thread_sleep(5000000);
- }
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- return(0);
-}
-
-/*********************************************************************
-This thread is used to test insert buffer merge. */
-
-ulint
-test_ibuf_merge(
-/*============*/
- void* arg)
-{
- ulint sum_sizes;
- ulint volume;
-
- ut_ad(arg);
-
- printf("Starting ibuf merge\n");
-
- sum_sizes = 0;
- volume = 1;
-
- while (volume) {
- volume = ibuf_contract(FALSE);
-
- sum_sizes += volume;
- }
-
- printf("Ibuf merged %lu bytes\n", sum_sizes);
-
- os_thread_sleep(5000000);
-
- return(0);
-}
-
-/*********************************************************************
-This thread is used to measure contention of latches. */
-
-ulint
-test_measure_cont(
-/*==============*/
- void* arg)
-{
- ulint i, j;
- ulint count;
-
- ut_ad(arg);
-
- printf("Starting contention measurement\n");
-
- for (i = 0; i < 1000; i++) {
- count = 0;
-
- for (j = 0; j < 100; j++) {
-
- os_thread_sleep(10000);
-
- if ((&(buf_pool->mutex))->lock_word) {
-
- count++;
- }
- }
-
- printf("Mutex reserved %lu of %lu peeks\n", count, j);
- }
-
- return(0);
-}
-
-/********************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
- ulint n5000 = 500;
- ulint err;
-
- oldtm = ut_clock();
-
-/* buf_debug_prints = TRUE; */
- log_do_write = TRUE;
- log_debug_writes = FALSE;
-/* btr_search_use_hash = FALSE; */
-
- srv_boot("initfile");
- os_aio_init(576, 9, 100);
- fil_init(25);
- buf_pool_init(POOL_SIZE, POOL_SIZE);
- fsp_init();
- log_init();
- lock_sys_create(1024);
-
- create_files();
- create_log_files();
-
- sess_sys_init_at_db_start();
-
- mem_validate();
-
- /* Tests crash recovery: */
-/*
- err = recv_recovery_from_checkpoint_start(LOG_CHECKPOINT,
- ut_dulint_max);
- ut_a(err == DB_SUCCESS);
-
- recv_compare_spaces_low(0, 4, 100);
-
- trx_sys_init_at_db_start();
-
- dict_boot();
-
- recv_recovery_from_checkpoint_finish();
-*/
- /* Tests archive recovery: */
-
- err = recv_recovery_from_archive_start(ut_dulint_max,
- "ib_arch_log_0_0000000000");
- ut_a(err == DB_SUCCESS);
-
- recv_compare_spaces_low(0, 4, 500);
-
- trx_sys_init_at_db_start();
-
- dict_boot();
-
- recv_recovery_from_archive_finish();
-
-/* test4_2(); */
-
- log_make_checkpoint_at(ut_dulint_max);
-
-/* dict_table_print_by_name("SYS_TABLES");
-
- dict_table_print_by_name("SYS_COLUMNS");
-
- dict_table_print_by_name("SYS_INDEXES"); */
-
- dict_table_print_by_name("TS_TABLE1");
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/btr/ts/tsrecv97.c b/innobase/btr/ts/tsrecv97.c
deleted file mode 100644
index 0f30fcd94f1..00000000000
--- a/innobase/btr/ts/tsrecv97.c
+++ /dev/null
@@ -1,4909 +0,0 @@
-/************************************************************************
-Test for the B-tree
-
-(c) 1994-1997 Innobase Oy
-
-Created 2/16/1996 Heikki Tuuri
-*************************************************************************/
-
-#include "os0proc.h"
-#include "sync0sync.h"
-#include "ut0mem.h"
-#include "mem0mem.h"
-#include "mem0pool.h"
-#include "data0data.h"
-#include "data0type.h"
-#include "dict0dict.h"
-#include "buf0buf.h"
-#include "os0file.h"
-#include "os0thread.h"
-#include "fil0fil.h"
-#include "fsp0fsp.h"
-#include "rem0rec.h"
-#include "rem0cmp.h"
-#include "mtr0mtr.h"
-#include "log0log.h"
-#include "log0recv.h"
-#include "page0page.h"
-#include "page0cur.h"
-#include "trx0trx.h"
-#include "dict0boot.h"
-#include "trx0sys.h"
-#include "dict0crea.h"
-#include "btr0btr.h"
-#include "btr0pcur.h"
-#include "btr0cur.h"
-#include "btr0sea.h"
-#include "rem0rec.h"
-#include "srv0srv.h"
-#include "que0que.h"
-#include "com0com.h"
-#include "usr0sess.h"
-#include "lock0lock.h"
-#include "trx0roll.h"
-#include "trx0purge.h"
-#include "row0ins.h"
-#include "row0upd.h"
-#include "row0row.h"
-#include "row0del.h"
-#include "lock0lock.h"
-#include "ibuf0ibuf.h"
-
-os_file_t files[1000];
-
-mutex_t ios_mutex;
-ulint ios;
-ulint n[10];
-
-mutex_t incs_mutex;
-ulint incs;
-
-byte bigbuf[1000000];
-
-#define N_SPACES 3 /* must be >= 2 */
-#define N_FILES 1
-#define FILE_SIZE 512 /* must be > 512 */
-#define POOL_SIZE 1000
-#define IBUF_SIZE 200
-#define COUNTER_OFFSET 1500
-
-#define N_LOG_GROUPS 2
-#define N_LOG_FILES 3
-#define LOG_FILE_SIZE 500
-
-#define LOOP_SIZE 150
-#define N_THREADS 5
-
-#define COUNT 1
-
-ulint zero = 0;
-
-buf_block_t* bl_arr[POOL_SIZE];
-
-ulint dummy = 0;
-
-/************************************************************************
-Io-handler thread function. */
-
-ulint
-handler_thread(
-/*===========*/
- void* arg)
-{
- ulint segment;
- ulint i;
-
- segment = *((ulint*)arg);
-
- printf("Io handler thread %lu starts\n", segment);
-
- for (i = 0;; i++) {
- fil_aio_wait(segment);
-
- mutex_enter(&ios_mutex);
- ios++;
- mutex_exit(&ios_mutex);
-
- }
-
- return(0);
-}
-
-/*************************************************************************
-Creates or opens the log files. */
-
-void
-create_log_files(void)
-/*==================*/
-{
- bool ret;
- ulint i, k;
- char name[20];
-
- printf("--------------------------------------------------------\n");
- printf("Create or open log files\n");
-
- strcpy(name, "logfile00");
-
- for (k = 0; k < N_LOG_GROUPS; k++) {
- for (i = 0; i < N_LOG_FILES; i++) {
-
- name[6] = (char)((ulint)'0' + k);
- name[7] = (char)((ulint)'0' + i);
-
- files[i] = os_file_create(name, OS_FILE_CREATE, OS_FILE_AIO,
- &ret);
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(
- name, OS_FILE_OPEN, OS_FILE_AIO, &ret);
- ut_a(ret);
- } else {
- ut_a(os_file_set_size(files[i],
- 8192 * LOG_FILE_SIZE, 0));
- }
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create(name, k + 100, FIL_LOG);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, LOG_FILE_SIZE, k + 100);
- }
-
- fil_space_create(name, k + 200, FIL_LOG);
-
- log_group_init(k, N_LOG_FILES, LOG_FILE_SIZE * UNIV_PAGE_SIZE,
- k + 100, k + 200);
- }
-}
-
-/*************************************************************************
-Creates the files for the file system test and inserts them to the file
-system. */
-
-void
-create_files(void)
-/*==============*/
-{
- bool ret;
- ulint i, k;
- char name[20];
- os_thread_t thr[10];
- os_thread_id_t id[10];
-
- printf("--------------------------------------------------------\n");
- printf("Create or open database files\n");
-
- strcpy(name, "tsfile00");
-
- for (k = 0; k < 2 * N_SPACES; k += 2) {
- for (i = 0; i < N_FILES; i++) {
-
- name[6] = (char)((ulint)'0' + k);
- name[7] = (char)((ulint)'0' + i);
-
- files[i] = os_file_create(name, OS_FILE_CREATE,
- OS_FILE_AIO, &ret);
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(
- name, OS_FILE_OPEN, OS_FILE_AIO, &ret);
- ut_a(ret);
- } else {
- if (k == 1) {
- ut_a(os_file_set_size(files[i],
- 8192 * IBUF_SIZE, 0));
- } else {
- ut_a(os_file_set_size(files[i],
- 8192 * FILE_SIZE, 0));
- }
- }
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create(name, k, FIL_TABLESPACE);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, FILE_SIZE, k);
- }
- }
-
- ios = 0;
-
- mutex_create(&ios_mutex);
- mutex_set_level(&ios_mutex, SYNC_NO_ORDER_CHECK);
-
- for (i = 0; i < 9; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(handler_thread, n + i, id + i);
- }
-}
-
-/*********************************************************************
-Test for table creation. */
-
-ulint
-test1(
-/*==*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- dict_index_t* index;
- dict_table_t* table;
- que_fork_t* fork;
- que_thr_t* thr;
- trx_t* trx;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1. CREATE TABLE WITH 3 COLUMNS AND WITH 3 INDEXES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- table = dict_mem_table_create("TS_TABLE1", 0, 3);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- /*------------------------------------*/
- /* CREATE TABLE */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = tab_create_graph_create(fork, thr, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS"); */
- /*-------------------------------------*/
- /* CREATE CLUSTERED INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND1", 0,
- DICT_UNIQUE | DICT_CLUSTERED, 1);
- dict_mem_index_add_field(index, "COL1", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- /*-------------------------------------*/
- /* CREATE SECONDARY INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND2", 0, 0, 1);
-
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- /*-------------------------------------*/
- /* CREATE ANOTHER SECONDARY INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND3", 0, 0, 1);
-
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-#ifdef notdefined
- /*-------------------------------------*/
- /* CREATE YET ANOTHER SECONDARY INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND4", 0, 0, 1);
-
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-#endif
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- return(0);
-}
-
-/*********************************************************************
-Another test for table creation. */
-
-ulint
-test1_5(
-/*====*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- dict_index_t* index;
- dict_table_t* table;
- que_fork_t* fork;
- que_thr_t* thr;
- trx_t* trx;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1.5. CREATE TABLE WITH 3 COLUMNS AND WITH 1 INDEX\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- table = dict_mem_table_create("TS_TABLE2", 0, 3);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- /*------------------------------------*/
- /* CREATE TABLE */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = tab_create_graph_create(fork, thr, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS"); */
- /*-------------------------------------*/
- /* CREATE CLUSTERED INDEX */
-
- index = dict_mem_index_create("TS_TABLE2", "IND1", 0,
- DICT_CLUSTERED | DICT_UNIQUE, 1);
-
- dict_mem_index_add_field(index, "COL1", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- return(0);
-}
-
-/*********************************************************************
-Another test for table creation. */
-
-ulint
-test1_6(
-/*====*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- dict_index_t* index;
- dict_table_t* table;
- que_fork_t* fork;
- que_thr_t* thr;
- trx_t* trx;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1.6. CREATE TABLE WITH 3 COLUMNS AND WITH 1 INDEX\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- table = dict_mem_table_create("TS_TABLE3", 0, 3);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- /*------------------------------------*/
- /* CREATE TABLE */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = tab_create_graph_create(fork, thr, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS"); */
- /*-------------------------------------*/
- /* CREATE CLUSTERED INDEX */
-
- index = dict_mem_index_create("TS_TABLE3", "IND1", 0, DICT_CLUSTERED,
- 2);
- dict_mem_index_add_field(index, "COL1", 0);
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- return(0);
-}
-
-/*********************************************************************
-Another test for table creation. */
-
-ulint
-test1_7(
-/*====*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- dict_index_t* index;
- dict_table_t* table;
- que_fork_t* fork;
- que_thr_t* thr;
- trx_t* trx;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1.7. CREATE TABLE WITH 12 COLUMNS AND WITH 1 INDEX\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- table = dict_mem_table_create("TS_TABLE4", 0, 12);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL4", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL5", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL6", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL7", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL8", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL9", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL10", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL11", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- dict_mem_table_add_col(table, "COL12", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- /*------------------------------------*/
- /* CREATE TABLE */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = tab_create_graph_create(fork, thr, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS"); */
- /*-------------------------------------*/
- /* CREATE CLUSTERED INDEX */
-
- index = dict_mem_index_create("TS_TABLE4", "IND1", 0,
- DICT_CLUSTERED | DICT_UNIQUE, 1);
-
- dict_mem_index_add_field(index, "COL1", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- return(0);
-}
-
-/*********************************************************************
-Test for inserts. */
-
-ulint
-test2(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
- dict_index_t* index;
-/* ulint size; */
- dtuple_t* entry;
- btr_pcur_t pcur;
- mtr_t mtr;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2. MASSIVE INSERT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- btr_search_print_info();
-
- /*-------------------------------------*/
- /* MASSIVE RANDOM INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- rnd = (rnd + 7857641) % 200000;
-
- dtuple_gen_test_tuple3(row, rnd,
- DTUPLE_TEST_RND30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- if (i % 1000 == 0) {
- printf(
- "********************************Inserted %lu rows\n", i);
- ibuf_print();
- }
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-/*
- for (i = 0; i < 10; i++) {
- size = ibuf_contract(TRUE);
-
- printf("%lu bytes will be contracted\n", size);
-
- os_thread_sleep(1000000);
- }
-*/
- index = dict_table_get_next_index(dict_table_get_first_index(table));
- tree = dict_index_get_tree(index);
- btr_validate_tree(tree);
-
- index = dict_table_get_next_index(index);
- tree = dict_index_get_tree(index);
- btr_validate_tree(tree);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- btr_search_print_info();
-
- /* Check inserted entries */
- rnd = 0;
-
- entry = dtuple_create(heap, 1);
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- rnd = (rnd + 7857641) % 200000;
- dtuple_gen_search_tuple3(entry, rnd, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur,
- &mtr);
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
- }
-
- btr_validate_tree(tree);
-
-/* btr_print_tree(tree, 5); */
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(1000000);
-
- btr_validate_tree(tree);
-
-/* btr_search_print_info();
- dict_table_print_by_name("TS_TABLE1"); */
- /*-------------------------------------*/
-#ifdef notdefined
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-#endif
- /*-------------------------------------*/
- count++;
-
- if (count < 1) {
- goto loop;
- }
-
- mem_heap_free(heap);
- return(0);
-}
-
-/*********************************************************************
-Another test for inserts. */
-
-ulint
-test2_1(
-/*====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- byte buf[100];
- ins_node_t* node;
- ulint count = 0;
- ulint rnd;
- dtuple_t* row;
-/* dict_tree_t* tree;
- dict_index_t* index;
- dtuple_t* entry;
- btr_pcur_t pcur;
- mtr_t mtr; */
-
- printf("-------------------------------------------------\n");
- printf("TEST 2.1. MASSIVE ASCENDING INSERT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- rnd = 0;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_RND3500, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- if (i % 5000 == 0) {
- /* ibuf_print(); */
- /* buf_print(); */
-
- /* buf_print_io(); */
-
- tm = ut_clock();
- /*
- printf("Wall time for %lu inserts %lu milliseconds\n",
- i, tm - oldtm); */
- }
-
- rnd = rnd + 1;
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
-#ifdef notdefined
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- ibuf_print();
-
- index = dict_table_get_first_index(table);
-
- btr_search_index_print_info(index);
-
- btr_validate_tree(dict_index_get_tree(index));
-
- index = dict_table_get_next_index(index);
-
- btr_search_index_print_info(index);
-
- btr_validate_tree(dict_index_get_tree(index));
-
- index = dict_table_get_next_index(index);
-
- btr_search_index_print_info(index);
-
- btr_validate_tree(dict_index_get_tree(index));
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- /* Check inserted entries */
-
- btr_search_print_info();
-
- entry = dtuple_create(heap, 1);
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- for (i = 0; i < *((ulint*)arg); i++) {
- ut_a(btr_pcur_move_to_next(&pcur, &mtr));
-
- dtuple_gen_search_tuple3(entry, i, buf);
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
- }
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-#endif
-#ifdef notdefined
- /*-------------------------------------*/
- /* ROLLBACK */
-
-/* btr_validate_tree(tree); */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(1000000);
-
-
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
-
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- btr_search_print_info();
-
-#endif
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
- /*-------------------------------------*/
-
- count++;
-/* btr_validate_tree(tree); */
-
- if (count < 5) {
- goto loop;
- }
-
- mem_heap_free(heap);
-
- return(0);
-}
-
-/*********************************************************************
-Another test for inserts. */
-
-ulint
-test2_2(
-/*====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- dict_index_t* index;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
- btr_pcur_t pcur;
- mtr_t mtr;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2.2. MASSIVE DESCENDING INSERT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = *((ulint*)arg) + 1;
-
- oldtm = ut_clock();
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- rnd = (rnd - 1) % 200000;
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- if (i % 1000 == 0) {
-/* printf(
- "********************************Inserted %lu rows\n", i);
- ibuf_print(); */
- }
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- /* Check inserted entries */
-
- entry = dtuple_create(heap, 1);
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- for (i = 0; i < *((ulint*)arg); i++) {
- ut_a(btr_pcur_move_to_next(&pcur, &mtr));
-
- dtuple_gen_search_tuple3(entry, i + 1, buf);
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
- }
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- btr_validate_tree(tree);
-/* dict_table_print_by_name("TS_TABLE1"); */
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(1000000);
-
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
-
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- /*-------------------------------------*/
-#ifdef notdefined
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-#endif
- /*-------------------------------------*/
- count++;
-
- if (count < 1) {
- goto loop;
- }
-
- btr_validate_tree(tree);
- mem_heap_free(heap);
- return(0);
-}
-
-/*********************************************************************
-Multithreaded test for random inserts. */
-
-ulint
-test2mt(
-/*====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- dict_index_t* index;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2MT. MULTITHREADED RANDOM INSERT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
- rnd = 78675;
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- if (i % 100 == 0) {
-/* buf_print(); */
-/* ibuf_print(); */
- }
-
- rnd = (rnd + 7857641) % 500;
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(3000000);
- /*-------------------------------------*/
-#ifdef notdefined
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-#endif
- /*-------------------------------------*/
- count++;
-
- if (count < COUNT) {
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for multithreaded sequential inserts. */
-
-ulint
-test2_1mt(
-/*======*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- dict_index_t* index;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2.1MT. MULTITHREADED ASCENDING INSERT\n");
-
- rnd = 8757677;
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- rnd += 98667501;
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- rnd = (rnd + 1) % 500;
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(3000000);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- /*-------------------------------------*/
-#ifdef notdefined
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-#endif
- /*-------------------------------------*/
- count++;
-
- if (count < COUNT) {
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for multithreaded sequential inserts. */
-
-ulint
-test2_2mt(
-/*======*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2.2MT. MULTITHREADED DESCENDING INSERT\n");
-
- rnd = 87677;
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- rnd += 78667;
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- rnd = (rnd - 1) % 500;
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_RND30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(3000000);
- /*-------------------------------------*/
-#ifdef notdefined
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-#endif
- /*-------------------------------------*/
- count++;
-
- mem_print_info();
-
- if (count < COUNT) {
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for updates. */
-
-ulint
-test3(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- byte* ptr;
- ulint len;
- ulint err;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 3. UPDATES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- thr->child = ins_node_create(fork, thr, row, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 3; i++) {
- dtuple_gen_test_tuple3(row, i, DTUPLE_TEST_RND30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- dict_table_print_by_name("TS_TABLE1");
- /*-------------------------------------*/
- /* UPDATE ROWS */
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- update = upd_create(1, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- dtuple_gen_test_tuple3(row, 1, DTUPLE_TEST_RND30, buf);
-
- entry = dtuple_create(heap, 2);
- dfield_copy(dtuple_get_nth_field(entry, 0),
- dtuple_get_nth_field(row, 0));
- dfield_copy(dtuple_get_nth_field(entry, 1),
- dtuple_get_nth_field(row, 1));
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 2, table);
- dfield_set_data(&(ufield->new_val), "updated field", 14);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- mtr_start(&mtr);
-
- ut_a(btr_pcur_restore_position(BTR_SEARCH_LEAF, &pcur, &mtr));
-
- ptr = rec_get_nth_field(btr_pcur_get_rec(&pcur), 5, &len);
-
- ut_a(ut_memcmp(ptr, "updated field", 14) == 0);
-
- btr_pcur_commit(&pcur);
-
- dict_table_print_by_name("TS_TABLE1");
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 0, table);
- dfield_set_data(&(ufield->new_val), "31415926", 9);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- dict_table_print_by_name("TS_TABLE1");
- /*-------------------------------------*/
- /* ROLLBACK */
-#ifdef notdefined
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu updates %lu milliseconds\n",
- i, tm - oldtm);
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- /*-------------------------------------*/
-#endif
- dict_table_print_by_name("TS_TABLE1");
- count++;
-
- if (count < 1) {
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Init for update test. */
-
-ulint
-test4_1(void)
-/*=========*/
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
-
- printf("-------------------------------------------------\n");
- printf("TEST 4.1. UPDATE INIT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- thr->child = ins_node_create(fork, thr, row, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 200; i++) {
-
- dtuple_gen_test_tuple3(row, i, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- dict_table_print_by_name("TS_TABLE1");
-
- return(0);
-}
-
-/*************************************************************************
-Checks that the multithreaded update test has rolled back its updates. */
-
-void
-test4_2(void)
-/*=========*/
-{
- dtuple_t* entry;
- mem_heap_t* heap;
- mem_heap_t* heap2;
- mtr_t mtr;
- byte buf[32];
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- que_fork_t* fork;
- dict_table_t* table;
- dict_index_t* index;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- dtuple_t* row;
- btr_pcur_t pcur;
- rec_t* rec;
-
- printf("-------------------------------------------------\n");
- printf("TEST 4.2. CHECK UPDATE RESULT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*------------------------------------------*/
-
- table = dict_table_get("TS_TABLE1", trx);
-
- index = dict_table_get_first_index(table);
-
- entry = dtuple_create(heap, 1);
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
- ut_a(btr_pcur_is_before_first_in_tree(&pcur, &mtr));
-
- for (i = 0; i < 200; i++) {
- ut_a(btr_pcur_move_to_next(&pcur, &mtr));
-
- dtuple_gen_search_tuple3(entry, i, buf);
-
- rec = btr_pcur_get_rec(&pcur);
-
- ut_a(0 == cmp_dtuple_rec(entry, rec));
-
- heap2 = mem_heap_create(200);
-
- row = row_build(ROW_COPY_DATA, index, rec, heap2);
-
- ut_a(30 == dfield_get_len(dtuple_get_nth_field(row, 2)));
- ut_a(0 == ut_memcmp(
- dfield_get_data(dtuple_get_nth_field(row, 2)),
- "12345678901234567890123456789", 30));
-
- mem_heap_free(heap2);
- }
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-}
-
-/*********************************************************************
-Test for massive updates. */
-
-ulint
-test4mt(
-/*====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* entry;
- byte buf[100];
- byte buf2[4000];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 4. MULTITHREADED UPDATES\n");
-
- thr_no = *((ulint*)arg);
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- /*-------------------------------------*/
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- update = upd_create(1, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 87607651;
-
- entry = dtuple_create(heap, 1);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- for (i = 0; i < 300; i++) {
-
- rnd += 874681;
- tuple_no = (rnd % 40) * 5 + thr_no;
-
- dtuple_gen_search_tuple3(entry, tuple_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
-/* printf("Thread %lu to update row %lu\n", thr_no, tuple_no); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 2, table);
- dfield_set_data(&(ufield->new_val), buf2, rnd % 3000);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- } /* for (i = ... */
-
- tm = ut_clock();
- printf("Wall time for %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- lock_validate();
-
-/* lock_print_info(); */
-
-/* mem_print_info(); */
-
- mem_pool_print_info(mem_comm_pool);
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(2000000);
-
- btr_validate_tree(tree);
-
- ut_a(trx->conc_state != TRX_ACTIVE);
- ut_a(UT_LIST_GET_LEN(trx->trx_locks) == 0);
-
- count++;
-
- if (count < 2) {
-
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for join. */
-
-ulint
-test6(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- byte buf[100];
- ulint count = 0;
- dtuple_t* entry;
- dict_index_t* index;
- dict_tree_t* tree;
- btr_pcur_t pcur;
- btr_pcur_t pcur2;
- mtr_t mtr;
- mtr_t mtr2;
- ulint rnd;
- ulint latch_mode;
-
- printf("-------------------------------------------------\n");
- printf("TEST 6. MASSIVE EQUIJOIN\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- /*--------------*/
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
- /*--------------*/
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /* Check inserted entries */
-
- entry = dtuple_create(heap, 1);
- dtuple_gen_search_tuple3(entry, 0, buf);
-
- mtr_start(&mtr);
-
- table = dict_table_get("TS_TABLE1", trx);
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- oldtm = ut_clock();
-
- btr_pcur_open(index, entry, PAGE_CUR_L, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IS, thr));
-
- rnd = 98651;
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- ut_a(btr_pcur_move_to_next(&pcur, &mtr));
-
- btr_pcur_store_position(&pcur, &mtr);
-
- ut_a(DB_SUCCESS == lock_clust_rec_cons_read_check(
- btr_pcur_get_rec(&pcur),
- index));
-
- btr_pcur_commit_specify_mtr(&pcur, &mtr);
-
- if (i % 1211 == 0) {
- dummy++;
- }
-
- rnd = 55321;
-
- dtuple_gen_search_tuple3(entry, rnd % *((ulint*)arg), buf);
-
-/* if (i == 0) { */
- latch_mode = BTR_SEARCH_LEAF;
-/* } else {
- latch_mode = BTR_SEARCH_LEAF | BTR_GUESS_LATCH;
- } */
-
- mtr_start(&mtr2);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, latch_mode,
- &pcur2, &mtr2);
-
- ut_a(DB_SUCCESS == lock_clust_rec_cons_read_check(
- btr_pcur_get_rec(&pcur2),
- index));
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur2)));
-
- mtr_commit(&mtr2);
-
- mtr_start(&mtr);
-
- btr_pcur_restore_position(BTR_SEARCH_LEAF, &pcur, &mtr);
- }
-
- ut_a(!btr_pcur_move_to_next(&pcur, &mtr));
- ut_a(btr_pcur_is_after_last_in_tree(&pcur, &mtr));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
-
- tm = ut_clock();
- printf("Wall time for join of %lu rows %lu milliseconds\n",
- i, tm - oldtm);
- btr_search_index_print_info(index);
- /*-------------------------------------*/
- /* COMMIT */
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
-/* printf("Wall time for commit %lu milliseconds\n", tm - oldtm); */
-
- /*-------------------------------------*/
- count++;
-/* btr_validate_tree(tree); */
-
- if (count < 3) {
- goto loop;
- }
-
- mem_heap_free(heap);
- return(0);
-}
-
-/*********************************************************************
-Test for lock wait. Requires Test 4.1 first. */
-
-ulint
-test7(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- trx_t* trx2;
- ulint rnd;
- dtuple_t* entry;
- dtuple_t* row;
- byte buf[100];
- byte buf2[4000];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 7. LOCK WAIT\n");
-
- thr_no = *((ulint*)arg);
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx2 = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- /*-------------------------------------*/
- /* UPDATE by trx */
- ut_a(trx_start(trx, ULINT_UNDEFINED));
- ut_a(trx_start(trx2, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- update = upd_create(1, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 87607651;
-
- entry = dtuple_create(heap, 2);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- rnd += 874681;
- tuple_no = 3;
-
- dtuple_gen_search_tuple3(entry, tuple_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 2, table);
- dfield_set_data(&(ufield->new_val), buf2, rnd % 1500);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- tm = ut_clock();
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- lock_validate();
-
- lock_print_info();
-
- /*-------------------------------------*/
- /* INSERT by trx2 */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx2;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx2);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- thr->child = ins_node_create(fork, thr, row, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx2->sess);
-
- trx2->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- dtuple_gen_test_tuple3(row, 2, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- /* Insert should be left to wait until trx releases the row lock */
-
- que_run_threads(thr);
-
- tm = ut_clock();
-
- lock_validate();
-
- lock_print_info();
-
- /*-------------------------------------*/
- /* COMMIT of trx */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
-
- /*-------------------------------------*/
- os_thread_sleep(1000000);
-
- printf(
- "trx2 can now continue to do the insert, after trx committed.\n");
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
- lock_validate();
-
- lock_print_info();
-
- dict_table_print_by_name("TS_TABLE1");
-
- return(0);
-}
-
-/*********************************************************************
-Inserts for TPC-A. */
-
-ulint
-test8A(
-/*===*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- dict_index_t* index;
- dict_tree_t* tree;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
- btr_pcur_t pcur;
- mtr_t mtr;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 8A. 1000 INSERTS FOR TPC-A\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- btr_search_print_info();
-
- /*-------------------------------------*/
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE2", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1000; i++) {
- dtuple_gen_test_tuple_TPC_A(row, rnd, buf);
-
- rnd = rnd + 1;
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
- btr_validate_tree(tree);
-
- /* Check inserted entries */
- rnd = 0;
-
- entry = dtuple_create(heap, 1);
-
- for (i = 0; i < 1000; i++) {
- dtuple_gen_search_tuple_TPC_A(entry, rnd, buf);
-
- rnd = rnd + 1;
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur,
- &mtr);
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
- }
-
- btr_validate_tree(tree);
-
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- /*-------------------------------------*/
- count++;
-
- if (count < 1) {
- goto loop;
- }
-
-/* dict_table_print_by_name("TS_TABLE2"); */
-
- mem_heap_free(heap);
- return(0);
-}
-
-/*********************************************************************
-Test for TPC-A transaction. */
-
-ulint
-test8(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork1;
- que_fork_t* fork2;
- que_fork_t* cfork;
- dict_table_t* table;
- dict_table_t* table2;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ins_node_t* inode;
- ulint rnd = 0;
-
- arg = arg;
-
- printf("-------------------------------------------------\n");
- printf("TEST 8. TPC-A %lu \n", *((ulint*)arg));
-
- oldtm = ut_clock();
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
- /*-----------------------------------*/
-
- fork1 = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork1->trx = trx;
-
- thr = que_thr_create(fork1, fork1, heap);
-
- table = dict_table_get("TS_TABLE3", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- inode = ins_node_create(fork1, thr, row, table, heap);
-
- thr->child = inode;
-
- row_ins_init_sys_fields_at_sql_compile(inode->row, inode->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(inode->row, inode->table, trx);
-
- inode->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork1, trx->sess);
-
- trx->graph = fork1;
-
- mutex_exit(&kernel_mutex);
-
- fork2 = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork2->trx = trx;
-
- thr = que_thr_create(fork2, fork2, heap);
-
- table2 = dict_table_get("TS_TABLE2", trx);
-
- update = upd_create(1, heap);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 1, table2);
-
- entry = dtuple_create(heap, 1);
- dfield_copy(dtuple_get_nth_field(entry, 0),
- dtuple_get_nth_field(row, 0));
-
- node = upd_node_create(fork2, thr, table2, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = UPD_NODE_NO_ORD_CHANGE | UPD_NODE_NO_SIZE_CHANGE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork2, trx->sess);
-
- trx->graph = fork2;
-
- mutex_exit(&kernel_mutex);
-
- cfork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- cfork->trx = trx;
-
- thr = que_thr_create(cfork, cfork, heap);
-
- thr->child = commit_node_create(cfork, thr, heap);
-
- oldtm = ut_clock();
-
-loop:
-/* printf("Round %lu\n", count); */
-
- /*-------------------------------------*/
- /* INSERT */
-
-/* printf("Trx %lu %lu starts, thr %lu\n",
- ut_dulint_get_low(trx->id),
- (ulint)trx,
- *((ulint*)arg)); */
-
- dtuple_gen_test_tuple3(row, count, DTUPLE_TEST_FIXED30, buf);
-
- ins_node_reset(inode);
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(fork1, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- /*-------------------------------------*/
- /* 3 UPDATES */
-
- ut_a(DB_SUCCESS == lock_table(0, table2, LOCK_IX, thr));
-
- for (i = 0; i < 3; i++) {
-
- rnd += 876751;
-
- if (count % 1231 == 0) {
- dummy++;
- }
-
- dtuple_gen_search_tuple_TPC_A(entry, rnd % 1000, buf);
-
- index = dict_table_get_first_index(table2);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_MODIFY_LEAF, &pcur, &mtr);
-
-/* ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur))); */
-
-/* btr_pcur_store_position(&pcur, &mtr); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- ufield = upd_get_nth_field(update, 0);
-
- dfield_set_data(&(ufield->new_val), "1234", 5);
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(fork2, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- } /* for (i = ... */
-
- /*-------------------------------------*/
- /* COMMIT */
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(cfork, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- count++;
-
- if (count < *((ulint*)arg)) {
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- goto loop;
- }
-
-/* printf("Trx %lu %lu committed\n", ut_dulint_get_low(trx->id),
- (ulint)trx); */
- tm = ut_clock();
- printf("Wall time for TPC-A %lu trxs %lu milliseconds\n",
- count, tm - oldtm);
-
- btr_search_index_print_info(index);
- btr_search_index_print_info(dict_table_get_first_index(table));
-
-/* mem_print_info(); */
- /*-------------------------------------*/
-
-
-/* dict_table_print_by_name("TS_TABLE2");
- dict_table_print_by_name("TS_TABLE3"); */
-
- return(0);
-}
-
-/*********************************************************************
-Inserts for TPC-C. */
-
-ulint
-test9A(
-/*===*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
-/* dtuple_t* entry;
- btr_pcur_t pcur;
- mtr_t mtr;
- dict_index_t* index;
- dict_tree_t* tree;
-*/
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 9A. INSERTS FOR TPC-C\n");
-
-#define TPC_C_TABLE_SIZE 15000
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- btr_search_print_info();
-
- /*-------------------------------------*/
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE4", trx);
-
- row = dtuple_create(heap, 12 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < TPC_C_TABLE_SIZE; i++) {
-
- dtuple_gen_test_tuple_TPC_C(row, rnd, buf);
-
- rnd = rnd + 1;
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
-#ifdef notdefined
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
- btr_validate_tree(tree);
-
- /* Check inserted entries */
- rnd = 0;
-
- entry = dtuple_create(heap, 1);
-
- for (i = 0; i < TPC_C_TABLE_SIZE; i++) {
-
- dtuple_gen_search_tuple_TPC_C(entry, rnd, buf);
-
- rnd = rnd + 1;
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur,
- &mtr);
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
-
- btr_pcur_close(&pcur);
- mtr_commit(&mtr);
- }
-
- btr_validate_tree(tree);
-#endif
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- /*-------------------------------------*/
- count++;
-
- if (count < 1) {
- goto loop;
- }
-
-/* dict_table_print_by_name("TS_TABLE4"); */
-
-/* mem_heap_free(heap); */
- return(0);
-}
-
-/*********************************************************************
-Test for TPC-C transaction. Test 9A must be run first to populate table. */
-
-ulint
-test9(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork1;
- que_fork_t* fork2;
- que_fork_t* cfork;
- dict_table_t* table;
- dict_table_t* table2;
- que_thr_t* thr;
- trx_t* trx;
- ulint j;
- ulint i;
- byte* ptr;
- ulint len;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ins_node_t* inode;
- ulint rnd = 0;
- byte buf2[240];
- rec_t* rec;
-
- arg = arg;
-
- printf("-------------------------------------------------\n");
- printf("TEST 9. TPC-C %lu \n", *((ulint*)arg));
-
- oldtm = ut_clock();
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
- /*-----------------------------------*/
-
- fork1 = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork1->trx = trx;
-
- thr = que_thr_create(fork1, fork1, heap);
-
- table = dict_table_get("TS_TABLE3", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- inode = ins_node_create(fork1, thr, row, table, heap);
-
- thr->child = inode;
-
- row_ins_init_sys_fields_at_sql_compile(inode->row, inode->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(inode->row, inode->table, trx);
-
- inode->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork1, trx->sess);
-
- trx->graph = fork1;
-
- mutex_exit(&kernel_mutex);
-
- fork2 = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork2->trx = trx;
-
- thr = que_thr_create(fork2, fork2, heap);
-
- table2 = dict_table_get("TS_TABLE4", trx);
-
- update = upd_create(3, heap);
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 1, table2);
- ufield = upd_get_nth_field(update, 1);
-
- upd_field_set_col_no(ufield, 1, table2);
- ufield = upd_get_nth_field(update, 2);
-
- upd_field_set_col_no(ufield, 1, table2);
-
- entry = dtuple_create(heap, 1);
- dfield_copy(dtuple_get_nth_field(entry, 0),
- dtuple_get_nth_field(row, 0));
-
- node = upd_node_create(fork2, thr, table2, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = UPD_NODE_NO_ORD_CHANGE | UPD_NODE_NO_SIZE_CHANGE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork2, trx->sess);
-
- trx->graph = fork2;
-
- mutex_exit(&kernel_mutex);
-
- cfork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- cfork->trx = trx;
-
- thr = que_thr_create(cfork, cfork, heap);
-
- thr->child = commit_node_create(cfork, thr, heap);
-
- oldtm = ut_clock();
-loop:
- ut_a(DB_SUCCESS == lock_table(0, table2, LOCK_IS, thr));
- ut_a(DB_SUCCESS == lock_table(0, table2, LOCK_IX, thr));
-
-/* printf("Round %lu\n", count); */
-
-for (j = 0; j < 13; j++) {
-
- /*-------------------------------------*/
- /* SELECT FROM 'ITEM' */
-
- rnd += 876751;
-
- dtuple_gen_search_tuple_TPC_C(entry, rnd % TPC_C_TABLE_SIZE, buf);
-
- index = dict_table_get_first_index(table2);
- tree = dict_index_get_tree(index);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_S, thr);
- ut_a(err == DB_SUCCESS);
-
- rec = btr_pcur_get_rec(&pcur);
-
- for (i = 0; i < 5; i++) {
- ptr = rec_get_nth_field(rec, i + 2, &len);
-
- ut_memcpy(buf2 + i * 24, ptr, len);
- }
-
- mtr_commit(&mtr);
-
- /*-------------------------------------*/
- /* UPDATE 'STOCK' */
-
- rnd += 876751;
-
- if (count % 1231 == 0) {
- dummy++;
- }
-
- dtuple_gen_search_tuple_TPC_C(entry, rnd % TPC_C_TABLE_SIZE, buf);
-
- index = dict_table_get_first_index(table2);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_MODIFY_LEAF, &pcur, &mtr);
-
- ut_a(0 == cmp_dtuple_rec(entry, btr_pcur_get_rec(&pcur)));
-
-/* btr_pcur_store_position(&pcur, &mtr); */
-
- rec = btr_pcur_get_rec(&pcur);
-
- for (i = 0; i < 10; i++) {
- ptr = rec_get_nth_field(rec, i + 2, &len);
-
- ut_memcpy(buf2 + i * 24, ptr, len);
- }
-
-/* btr_pcur_commit(&pcur); */
-
-/* err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr); */
- ut_a(DB_SUCCESS == lock_clust_rec_cons_read_check(
- btr_pcur_get_rec(&pcur),
- index));
-/* ut_a(err == DB_SUCCESS); */
-
- ufield = upd_get_nth_field(update, 0);
-
- dfield_set_data(&(ufield->new_val), "1234", 5);
-
- ufield = upd_get_nth_field(update, 1);
-
- dfield_set_data(&(ufield->new_val), "1234", 5);
-
- ufield = upd_get_nth_field(update, 2);
-
- dfield_set_data(&(ufield->new_val), "1234", 5);
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(fork2, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- btr_pcur_close(&pcur);
- /*-------------------------------------*/
- /* INSERT INTO 'ORDERLINE' */
-
-/* printf("Trx %lu %lu starts, thr %lu\n",
- ut_dulint_get_low(trx->id),
- (ulint)trx,
- *((ulint*)arg)); */
-
- dtuple_gen_test_tuple3(row, count * 13 + j, DTUPLE_TEST_FIXED30, buf);
-
- ins_node_reset(inode);
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(fork1, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-}
- /*-------------------------------------*/
- /* COMMIT */
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(cfork, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* printf("Trx %lu %lu committed\n", ut_dulint_get_low(trx->id),
- (ulint)trx); */
- count++;
-
- if (count < *((ulint*)arg)) {
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- goto loop;
- }
-
- tm = ut_clock();
- printf("Wall time for TPC-C %lu trxs %lu milliseconds\n",
- count, tm - oldtm);
-
- btr_search_index_print_info(index);
- btr_search_index_print_info(dict_table_get_first_index(table));
-
-/* mem_print_info(); */
- /*-------------------------------------*/
-/* dict_table_print_by_name("TS_TABLE2");
- dict_table_print_by_name("TS_TABLE3"); */
-
- return(0);
-}
-
-/*********************************************************************
-Init for purge test. */
-
-ulint
-test10_1(
-/*=====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint thr_no;
-
- thr_no = *((ulint*)arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.1. PURGE INIT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- thr->child = ins_node_create(fork, thr, row, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 200; i++) {
-
- dtuple_gen_test_tuple3(row, i * 100 + thr_no,
- DTUPLE_TEST_FIXED30, buf);
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- return(0);
-}
-
-/*********************************************************************
-Test for purge. */
-
-ulint
-test10_2(
-/*=====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* entry;
- byte buf[100];
- byte buf2[1000];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.2. PURGE TEST UPDATES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- /*-------------------------------------*/
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- update = upd_create(2, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 87607651;
-
- entry = dtuple_create(heap, 1);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- for (i = 0; i < 200; i++) {
-
- tuple_no = i;
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + thr_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
-/* printf("Thread %lu to update row %lu\n", thr_no, tuple_no); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 0, table);
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + 10 + thr_no, buf);
-
- dfield_set_data(&(ufield->new_val), dfield_get_data(
- dtuple_get_nth_field(entry, 0)),
- dfield_get_len(
- dtuple_get_nth_field(entry, 0)));
- ufield = upd_get_nth_field(update, 1);
-
- upd_field_set_col_no(ufield, 1, table);
-
- rnd += 98326761;
-
- dfield_set_data(&(ufield->new_val), buf2, rnd % 200);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- fsp_validate(0);
-
- } /* for (i = ... */
-
- tm = ut_clock();
- printf("Wall time for %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
-/* lock_print_info(); */
-
-/* mem_print_info(); */
-
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- count++;
-
- if (count < 1) {
-
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for purge. */
-
-ulint
-test10_2_r(
-/*=======*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* entry;
- byte buf[100];
- byte buf2[1000];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.2. PURGE TEST UPDATES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- /*-------------------------------------*/
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- update = upd_create(2, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 87607651;
-
- entry = dtuple_create(heap, 1);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- for (i = 0; i < 200; i++) {
-
- tuple_no = i;
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + thr_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
-/* printf("Thread %lu to update row %lu\n", thr_no, tuple_no); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- upd_field_set_col_no(ufield, 0, table);
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + 10 + thr_no, buf);
-
- dfield_set_data(&(ufield->new_val), dfield_get_data(
- dtuple_get_nth_field(entry, 0)),
- dfield_get_len(
- dtuple_get_nth_field(entry, 0)));
- ufield = upd_get_nth_field(update, 1);
-
- upd_field_set_col_no(ufield, 1, table);
-
- rnd += 98326761;
-
- dfield_set_data(&(ufield->new_val), buf2, rnd % 2000);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- fsp_validate(0);
-
- } /* for (i = ... */
-
- tm = ut_clock();
- printf("Wall time for %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
-/* lock_print_info(); */
-
- mem_pool_print_info(mem_comm_pool);
-
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-
- os_thread_sleep(2000000);
-
- count++;
-
- if (count < 1) {
-
- goto loop;
- }
-
- return(0);
-}
-
-/*********************************************************************
-Test for purge. */
-
-ulint
-test10_3(
-/*=====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* entry;
- byte buf[100];
- btr_pcur_t pcur;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- del_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.3. PURGE TEST DELETES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- /*-------------------------------------*/
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- node = del_node_create(fork, thr, table, &pcur, heap);
- thr->child = node;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- entry = dtuple_create(heap, 1);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- for (i = 0; i < 200; i++) {
-
- rnd = i;
- tuple_no = rnd;
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + 10 + thr_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
-/* printf("Thread %lu to update row %lu\n", thr_no, tuple_no); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- } /* for (i = ... */
-
- tm = ut_clock();
- printf("Wall time for %lu delete markings %lu milliseconds\n",
- i, tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
-/* lock_print_info(); */
-
-/* mem_print_info(); */
-
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- return(0);
-}
-
-/*********************************************************************
-Test for purge. */
-
-ulint
-test10_5(
-/*=====*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* entry;
- byte buf[100];
- btr_pcur_t pcur;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- del_node_t* node;
- ulint err;
- ulint thr_no;
- ulint tuple_no;
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.5. PURGE TEST UNCOMMITTED DELETES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- /*-------------------------------------*/
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- node = del_node_create(fork, thr, table, &pcur, heap);
- thr->child = node;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- entry = dtuple_create(heap, 1);
-
- oldtm = ut_clock();
-
- thr_no = *((ulint*)arg);
-
- ut_a(DB_SUCCESS == lock_table(0, table, LOCK_IX, thr));
-
- for (i = 0; i < 50; i++) {
-
- rnd = i;
- tuple_no = rnd % 100;
-
- dtuple_gen_search_tuple3(entry, tuple_no * 100 + 10 + thr_no, buf);
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(index, entry, PAGE_CUR_LE, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
-/* printf("Thread %lu to update row %lu\n", thr_no, tuple_no); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- } /* for (i = ... */
-
- tm = ut_clock();
- printf("Wall time for %lu delete markings %lu milliseconds\n",
- i, tm - oldtm);
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- printf("Validating tree\n");
- btr_validate_tree(tree);
- printf("Validated\n");
-
-/* lock_print_info(); */
-
-/* mem_print_info(); */
-
- return(0);
-}
-
-/*********************************************************************
-Multithreaded test for purge. */
-
-ulint
-test10mt(
-/*=====*/
- void* arg)
-{
- ulint i;
- ulint thr_no;
-
- thr_no = *((ulint*)arg);
-
- printf("Thread %lu starts purge test\n", thr_no);
-
- for (i = 0; i < 2; i++) {
- test10_1(arg);
-
- sync_print();
-
- fsp_validate(0);
-
- test10_2_r(arg);
- sync_print();
-
- test10_2(arg);
- sync_print();
-
- lock_validate();
-
- test10_3(arg);
- sync_print();
- }
-
- printf("Thread %lu ends purge test\n", thr_no);
-
- return(0);
-}
-
-/*********************************************************************
-Purge test. */
-
-ulint
-test10_4(
-/*=====*/
- void* arg)
-{
- ulint i;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 10.4. PURGE TEST\n");
-
- for (i = 0; i < 30; i++) {
- trx_purge();
-
- printf("%lu pages purged\n", purge_sys->n_pages_handled);
-
- os_thread_sleep(5000000);
- }
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- return(0);
-}
-
-/*********************************************************************
-This thread is used to test insert buffer merge. */
-
-ulint
-test_ibuf_merge(
-/*============*/
- void* arg)
-{
- ulint sum_sizes;
- ulint volume;
-
- ut_ad(arg);
-
- printf("Starting ibuf merge\n");
-
- sum_sizes = 0;
- volume = 1;
-
- while (volume) {
- volume = ibuf_contract(FALSE);
-
- sum_sizes += volume;
- }
-
- printf("Ibuf merged %lu bytes\n", sum_sizes);
-
- os_thread_sleep(5000000);
-
- return(0);
-}
-
-/*********************************************************************
-This thread is used to measure contention of latches. */
-
-ulint
-test_measure_cont(
-/*==============*/
- void* arg)
-{
- ulint i, j;
- ulint count;
-
- ut_ad(arg);
-
- printf("Starting contention measurement\n");
-
- for (i = 0; i < 1000; i++) {
- count = 0;
-
- for (j = 0; j < 100; j++) {
-
- os_thread_sleep(10000);
-
- if ((&(buf_pool->mutex))->lock_word) {
-
- count++;
- }
- }
-
- printf("Mutex reserved %lu of %lu peeks\n", count, j);
- }
-
- return(0);
-}
-
-/********************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
- ulint n5000 = 500;
- ulint err;
-
- oldtm = ut_clock();
-
-/* buf_debug_prints = TRUE; */
- log_do_write = TRUE;
- log_debug_writes = FALSE;
-/* btr_search_use_hash = FALSE; */
-
- srv_boot("initfile");
- os_aio_init(576, 9, 100);
- fil_init(25);
- buf_pool_init(POOL_SIZE, POOL_SIZE);
- fsp_init();
- log_init();
- lock_sys_create(1024);
-
- create_files();
- create_log_files();
-
- sess_sys_init_at_db_start();
-
- mem_validate();
-
- /* Tests crash recovery: */
-/*
- err = recv_recovery_from_checkpoint_start(LOG_CHECKPOINT,
- ut_dulint_max);
- ut_a(err == DB_SUCCESS);
-
- recv_compare_spaces_low(0, 4, 100);
-
- trx_sys_init_at_db_start();
-
- dict_boot();
-
- recv_recovery_from_checkpoint_finish();
-*/
- /* Tests archive recovery: */
-
- err = recv_recovery_from_archive_start(ut_dulint_max,
- "ib_arch_log_0_0000000000");
- ut_a(err == DB_SUCCESS);
-
- recv_compare_spaces_low(0, 4, 500);
-
- trx_sys_init_at_db_start();
-
- dict_boot();
-
- recv_recovery_from_archive_finish();
-
-/* test4_2(); */
-
- log_make_checkpoint_at(ut_dulint_max);
-
-/* dict_table_print_by_name("SYS_TABLES");
-
- dict_table_print_by_name("SYS_COLUMNS");
-
- dict_table_print_by_name("SYS_INDEXES"); */
-
- dict_table_print_by_name("TS_TABLE1");
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/btr/ts/tss.c b/innobase/btr/ts/tss.c
deleted file mode 100644
index 4af3fda4415..00000000000
--- a/innobase/btr/ts/tss.c
+++ /dev/null
@@ -1,397 +0,0 @@
-/************************************************************************
-Test for the server
-
-(c) 1996-1997 Innobase Oy
-
-Created 2/16/1996 Heikki Tuuri
-*************************************************************************/
-
-#include "os0proc.h"
-#include "sync0sync.h"
-#include "ut0mem.h"
-#include "mem0mem.h"
-#include "mem0pool.h"
-#include "data0data.h"
-#include "data0type.h"
-#include "dict0dict.h"
-#include "buf0buf.h"
-#include "buf0flu.h"
-#include "os0file.h"
-#include "os0thread.h"
-#include "fil0fil.h"
-#include "fsp0fsp.h"
-#include "rem0rec.h"
-#include "rem0cmp.h"
-#include "mtr0mtr.h"
-#include "log0log.h"
-#include "log0recv.h"
-#include "page0page.h"
-#include "page0cur.h"
-#include "trx0trx.h"
-#include "dict0boot.h"
-#include "trx0sys.h"
-#include "dict0crea.h"
-#include "btr0btr.h"
-#include "btr0pcur.h"
-#include "btr0cur.h"
-#include "btr0sea.h"
-#include "rem0rec.h"
-#include "srv0srv.h"
-#include "que0que.h"
-#include "com0com.h"
-#include "usr0sess.h"
-#include "lock0lock.h"
-#include "trx0roll.h"
-#include "trx0purge.h"
-#include "row0ins.h"
-#include "row0sel.h"
-#include "row0upd.h"
-#include "row0row.h"
-#include "lock0lock.h"
-#include "ibuf0ibuf.h"
-#include "pars0pars.h"
-#include "btr0sea.h"
-
-bool measure_cont = FALSE;
-
-os_file_t files[1000];
-
-mutex_t ios_mutex;
-ulint ios;
-ulint n[10];
-
-mutex_t incs_mutex;
-ulint incs;
-
-byte rnd_buf[67000];
-
-
-/************************************************************************
-Io-handler thread function. */
-
-ulint
-handler_thread(
-/*===========*/
- void* arg)
-{
- ulint segment;
- ulint i;
-
- segment = *((ulint*)arg);
-
- printf("Io handler thread %lu starts\n", segment);
-
- for (i = 0;; i++) {
- fil_aio_wait(segment);
-
- mutex_enter(&ios_mutex);
- ios++;
- mutex_exit(&ios_mutex);
- }
-
- return(0);
-}
-
-/*************************************************************************
-Creates or opens the log files. */
-
-void
-create_log_files(void)
-/*==================*/
-{
- bool ret;
- ulint i, k;
- char name[20];
-
- printf("--------------------------------------------------------\n");
- printf("Create or open log files\n");
-
- strcpy(name, "logfile00");
-
- for (k = 0; k < srv_n_log_groups; k++) {
-
- for (i = 0; i < srv_n_log_files; i++) {
-
- name[6] = (char)((ulint)'0' + k);
- name[7] = (char)((ulint)'0' + i);
-
- files[i] = os_file_create(name, OS_FILE_CREATE, OS_FILE_AIO,
- &ret);
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(
- name, OS_FILE_OPEN, OS_FILE_AIO, &ret);
- ut_a(ret);
- } else {
- ut_a(os_file_set_size(files[i],
- 8192 * srv_log_file_size, 0));
- }
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create(name, k + 100, FIL_LOG);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, srv_log_file_size, k + 100);
- }
-
- fil_space_create(name, k + 200, FIL_LOG);
-
- log_group_init(k, srv_n_log_files,
- srv_log_file_size * UNIV_PAGE_SIZE,
- k + 100, k + 200);
- }
-}
-
-/*************************************************************************
-Creates the files for the file system test and inserts them to the file
-system. */
-
-void
-create_files(void)
-/*==============*/
-{
- bool ret;
- ulint i, k;
- char name[20];
- os_thread_t thr[10];
- os_thread_id_t id[10];
-
- printf("--------------------------------------------------------\n");
- printf("Create or open database files\n");
-
- strcpy(name, "tsfile00");
-
- for (k = 0; k < 2 * srv_n_spaces; k += 2) {
- for (i = 0; i < srv_n_files; i++) {
-
- name[6] = (char)((ulint)'0' + k);
- name[7] = (char)((ulint)'0' + i);
-
- files[i] = os_file_create(name, OS_FILE_CREATE,
- OS_FILE_NORMAL, &ret);
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(
- name, OS_FILE_OPEN, OS_FILE_NORMAL, &ret);
- ut_a(ret);
- } else {
- ut_a(os_file_set_size(files[i],
- UNIV_PAGE_SIZE * srv_file_size, 0));
- /* Initialize the file contents to a random value */
- /*
- for (j = 0; j < srv_file_size; j++) {
-
- for (c = 0; c < UNIV_PAGE_SIZE; c++) {
-
- rnd_buf[c] = 0xFF;
- }
-
- os_file_write(files[i], rnd_buf,
- UNIV_PAGE_SIZE * j, 0,
- UNIV_PAGE_SIZE);
- }
- */
- }
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create(name, k, FIL_TABLESPACE);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, srv_file_size, k);
- }
- }
-
- ios = 0;
-
- mutex_create(&ios_mutex);
- mutex_set_level(&ios_mutex, SYNC_NO_ORDER_CHECK);
-
- /* Create i/o-handler threads: */
-
- for (i = 0; i < 9; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(handler_thread, n + i, id + i);
- }
-}
-
-/************************************************************************
-Inits space header of space. */
-
-void
-init_spaces(void)
-/*=============*/
-{
- mtr_t mtr;
-
- mtr_start(&mtr);
-
- fsp_header_init(0, srv_file_size * srv_n_files, &mtr);
-
- mtr_commit(&mtr);
-}
-
-/*********************************************************************
-This thread is used to measure contention of latches. */
-
-ulint
-test_measure_cont(
-/*==============*/
- void* arg)
-{
- ulint i, j, k;
- ulint count[8];
- ulint lcount[8];
- ulint lscount;
- ulint lkcount;
- ulint pcount, kcount, scount;
-
- UT_NOT_USED(arg);
-
- printf("Starting contention measurement\n");
-
- for (i = 0; i < 1000; i++) {
-
- for (k = 0; k < 8; k++) {
- count[k] = 0;
- lcount[k] = 0;
- }
-
- pcount = 0;
- kcount = 0;
- scount = 0;
- lscount = 0;
- lkcount = 0;
-
- for (j = 0; j < 100; j++) {
-
- if (srv_measure_by_spin) {
- ut_delay(ut_rnd_interval(0, 20000));
- } else {
- os_thread_sleep(20000);
- }
-
- if (kernel_mutex.lock_word) {
- kcount++;
- }
-
- if (lock_kernel_reserved) {
- lkcount++;
- }
-
- if (buf_pool->mutex.lock_word) {
- pcount++;
- }
-
- if (btr_search_mutex.lock_word) {
- scount++;
- }
-
- for (k = 0; k < 8; k++) {
-
- if (btr_search_sys->
- hash_index->mutexes[k].lock_word) {
-
- count[k]++;
- }
- }
-
- for (k = 0; k < 2; k++) {
-
- if (lock_sys->rec_hash->mutexes[k].lock_word) {
-
- lcount[k]++;
- }
- }
-
- if (kernel_mutex.lock_word
- || lock_sys->rec_hash->mutexes[0].lock_word
- || lock_sys->rec_hash->mutexes[1].lock_word) {
-
- lscount++;
- }
- }
-
- printf(
-"Mutex res. p %lu, k %lu %lu, %lu %lu %lu s %lu, %lu %lu %lu %lu %lu %lu %lu %lu of %lu\n",
- pcount, kcount, lkcount, lcount[0], lcount[1], lscount, scount,
- count[0], count[1], count[2], count[3],
- count[4], count[5], count[6], count[7], j);
-
- sync_print_wait_info();
-
- printf("N log i/os %lu, n non sea %lu, n sea succ %lu\n",
- log_sys->n_log_ios, btr_cur_n_non_sea,
- btr_search_n_succ);
- }
-
- return(0);
-}
-
-/********************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- os_thread_id_t thread_id;
-
- log_do_write = TRUE;
-/* yydebug = TRUE; */
-
- srv_boot("srv_init");
-
- os_aio_init(576, 9, 100);
-
- fil_init(25);
-
- buf_pool_init(srv_pool_size, srv_pool_size);
-
- fsp_init();
- log_init();
-
- lock_sys_create(srv_lock_table_size);
-
- create_files();
- create_log_files();
-
- init_spaces();
-
- sess_sys_init_at_db_start();
-
- trx_sys_create();
-
- dict_create();
-
- log_make_checkpoint_at(ut_dulint_max);
-
- if (srv_measure_contention) {
- os_thread_create(&test_measure_cont, NULL, &thread_id);
- }
-
- if (!srv_log_archive_on) {
-
- ut_a(DB_SUCCESS == log_archive_noarchivelog());
- }
-
- srv_master_thread();
-
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-
- os_process_exit(0);
-}
diff --git a/innobase/btr/ts/tssrv.c b/innobase/btr/ts/tssrv.c
deleted file mode 100644
index 78d247968d5..00000000000
--- a/innobase/btr/ts/tssrv.c
+++ /dev/null
@@ -1,535 +0,0 @@
-/************************************************************************
-Test for the server
-
-(c) 1996-1997 Innobase Oy
-
-Created 2/16/1996 Heikki Tuuri
-*************************************************************************/
-
-#include "os0proc.h"
-#include "sync0sync.h"
-#include "ut0mem.h"
-#include "mem0mem.h"
-#include "mem0pool.h"
-#include "data0data.h"
-#include "data0type.h"
-#include "dict0dict.h"
-#include "buf0buf.h"
-#include "buf0flu.h"
-#include "os0file.h"
-#include "os0thread.h"
-#include "fil0fil.h"
-#include "fsp0fsp.h"
-#include "rem0rec.h"
-#include "rem0cmp.h"
-#include "mtr0mtr.h"
-#include "log0log.h"
-#include "log0recv.h"
-#include "page0page.h"
-#include "page0cur.h"
-#include "trx0trx.h"
-#include "dict0boot.h"
-#include "trx0sys.h"
-#include "dict0crea.h"
-#include "btr0btr.h"
-#include "btr0pcur.h"
-#include "btr0cur.h"
-#include "btr0sea.h"
-#include "rem0rec.h"
-#include "srv0srv.h"
-#include "que0que.h"
-#include "com0com.h"
-#include "usr0sess.h"
-#include "lock0lock.h"
-#include "trx0roll.h"
-#include "trx0purge.h"
-#include "row0ins.h"
-#include "row0sel.h"
-#include "row0upd.h"
-#include "row0row.h"
-#include "lock0lock.h"
-#include "ibuf0ibuf.h"
-#include "pars0pars.h"
-#include "btr0sea.h"
-
-bool measure_cont = FALSE;
-
-os_file_t files[1000];
-
-mutex_t ios_mutex;
-ulint ios;
-ulint n[10];
-
-mutex_t incs_mutex;
-ulint incs;
-
-byte rnd_buf[67000];
-
-ulint glob_var1 = 0;
-ulint glob_var2 = 0;
-
-mutex_t mutex2;
-
-mutex_t test_mutex1;
-mutex_t test_mutex2;
-
-mutex_t* volatile mutexes;
-
-bool always_false = FALSE;
-
-ulint* test_array;
-
-/************************************************************************
-Io-handler thread function. */
-
-ulint
-handler_thread(
-/*===========*/
- void* arg)
-{
- ulint segment;
- ulint i;
-
- segment = *((ulint*)arg);
-
- printf("Io handler thread %lu starts\n", segment);
-
- for (i = 0;; i++) {
- fil_aio_wait(segment);
-
- mutex_enter(&ios_mutex);
- ios++;
- mutex_exit(&ios_mutex);
- }
-
- return(0);
-}
-
-/*************************************************************************
-Creates or opens the log files. */
-
-void
-create_log_files(void)
-/*==================*/
-{
- bool ret;
- ulint i, k;
- char name[20];
-
- printf("--------------------------------------------------------\n");
- printf("Create or open log files\n");
-
- strcpy(name, "logfile00");
-
- for (k = 0; k < srv_n_log_groups; k++) {
-
- for (i = 0; i < srv_n_log_files; i++) {
-
- name[6] = (char)((ulint)'0' + k);
- name[7] = (char)((ulint)'0' + i);
-
- files[i] = os_file_create(name, OS_FILE_CREATE, OS_FILE_AIO,
- &ret);
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(
- name, OS_FILE_OPEN, OS_FILE_AIO, &ret);
- ut_a(ret);
- } else {
- ut_a(os_file_set_size(files[i],
- 8192 * srv_log_file_size, 0));
- }
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create(name, k + 100, FIL_LOG);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, srv_log_file_size, k + 100);
- }
-
- fil_space_create(name, k + 200, FIL_LOG);
-
- log_group_init(k, srv_n_log_files,
- srv_log_file_size * UNIV_PAGE_SIZE,
- k + 100, k + 200);
- }
-}
-
-/*************************************************************************
-Creates the files for the file system test and inserts them to the file
-system. */
-
-void
-create_files(void)
-/*==============*/
-{
- bool ret;
- ulint i, k;
- char name[20];
- os_thread_t thr[10];
- os_thread_id_t id[10];
-
- printf("--------------------------------------------------------\n");
- printf("Create or open database files\n");
-
- strcpy(name, "tsfile00");
-
- for (k = 0; k < 2 * srv_n_spaces; k += 2) {
- for (i = 0; i < srv_n_files; i++) {
-
- name[6] = (char)((ulint)'0' + k);
- name[7] = (char)((ulint)'0' + i);
-
- files[i] = os_file_create(name, OS_FILE_CREATE,
- OS_FILE_NORMAL, &ret);
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(
- name, OS_FILE_OPEN, OS_FILE_NORMAL, &ret);
- ut_a(ret);
- } else {
- ut_a(os_file_set_size(files[i],
- UNIV_PAGE_SIZE * srv_file_size, 0));
- /* Initialize the file contents to a random value */
- /*
- for (j = 0; j < srv_file_size; j++) {
-
- for (c = 0; c < UNIV_PAGE_SIZE; c++) {
-
- rnd_buf[c] = 0xFF;
- }
-
- os_file_write(files[i], rnd_buf,
- UNIV_PAGE_SIZE * j, 0,
- UNIV_PAGE_SIZE);
- }
- */
- }
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create(name, k, FIL_TABLESPACE);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, srv_file_size, k);
- }
- }
-
- ios = 0;
-
- mutex_create(&ios_mutex);
- mutex_set_level(&ios_mutex, SYNC_NO_ORDER_CHECK);
-
- /* Create i/o-handler threads: */
-
- for (i = 0; i < 9; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(handler_thread, n + i, id + i);
- }
-}
-
-/************************************************************************
-Inits space header of space. */
-
-void
-init_spaces(void)
-/*=============*/
-{
- mtr_t mtr;
-
- mtr_start(&mtr);
-
- fsp_header_init(0, srv_file_size * srv_n_files, &mtr);
-
- mtr_commit(&mtr);
-}
-
-/*********************************************************************
-This thread is used to measure contention of latches. */
-
-ulint
-test_measure_cont(
-/*==============*/
- void* arg)
-{
- ulint i, j;
- ulint pcount, kcount, s_scount, s_xcount, s_mcount, lcount;
- ulint t1count;
- ulint t2count;
-
- UT_NOT_USED(arg);
-
- printf("Starting contention measurement\n");
-
- for (i = 0; i < 1000; i++) {
-
- pcount = 0;
- kcount = 0;
- s_scount = 0;
- s_xcount = 0;
- s_mcount = 0;
- lcount = 0;
- t1count = 0;
- t2count = 0;
-
- for (j = 0; j < 100; j++) {
-
- if (srv_measure_by_spin) {
- ut_delay(ut_rnd_interval(0, 20000));
- } else {
- os_thread_sleep(20000);
- }
-
- if (kernel_mutex.lock_word) {
- kcount++;
- }
-
- if (buf_pool->mutex.lock_word) {
- pcount++;
- }
-
- if (log_sys->mutex.lock_word) {
- lcount++;
- }
-
- if (btr_search_latch.reader_count) {
- s_scount++;
- }
-
- if (btr_search_latch.writer != RW_LOCK_NOT_LOCKED) {
- s_xcount++;
- }
-
- if (btr_search_latch.mutex.lock_word) {
- s_mcount++;
- }
-
- if (test_mutex1.lock_word) {
- t1count++;
- }
-
- if (test_mutex2.lock_word) {
- t2count++;
- }
- }
-
- printf(
- "Mutex res. l %lu, p %lu, k %lu s x %lu s s %lu s mut %lu of %lu\n",
- lcount, pcount, kcount, s_xcount, s_scount, s_mcount, j);
-
- sync_print_wait_info();
-
- printf(
- "log i/o %lu n non sea %lu n succ %lu n h fail %lu\n",
- log_sys->n_log_ios, btr_cur_n_non_sea,
- btr_search_n_succ, btr_search_n_hash_fail);
- }
-
- return(0);
-}
-
-/*********************************************************************
-This thread is used to test contention of latches. */
-
-ulint
-test_sync(
-/*======*/
- void* arg)
-{
- ulint tm, oldtm;
- ulint i, j;
- ulint sum;
- ulint rnd = ut_rnd_gen_ulint();
- ulint mut_ind;
- byte* ptr;
-
- UT_NOT_USED(arg);
-
- printf("Starting mutex reservation test\n");
-
- oldtm = ut_clock();
-
- sum = 0;
- rnd = 87354941;
-
- for (i = 0; i < srv_test_n_loops; i++) {
-
- for (j = 0; j < srv_test_n_free_rnds; j++) {
- rnd += 423087123;
-
- sum += test_array[rnd % (256 * srv_test_array_size)];
- }
-
- rnd += 43605677;
-
- mut_ind = rnd % srv_test_n_mutexes;
-
- mutex_enter(mutexes + mut_ind);
-
- for (j = 0; j < srv_test_n_reserved_rnds; j++) {
- rnd += 423087121;
-
- sum += test_array[rnd % (256 * srv_test_array_size)];
- }
-
- mutex_exit(mutexes + mut_ind);
-
- if (srv_test_cache_evict) {
- ptr = (byte*)(mutexes + mut_ind);
-
- for (j = 0; j < 4; j++) {
- ptr += 256 * 1024;
- sum += *((ulint*)ptr);
- }
- }
- }
-
- if (always_false) {
- printf("%lu", sum);
- }
-
- tm = ut_clock();
-
- printf("Wall time for res. test %lu milliseconds\n", tm - oldtm);
-
- return(0);
-}
-
-/********************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- os_thread_id_t thread_ids[1000];
- ulint tm, oldtm;
- ulint rnd;
- ulint i, sum;
- byte* ptr;
-/* mutex_t mutex; */
-
- log_do_write = TRUE;
-/* yydebug = TRUE; */
-
- srv_boot("srv_init");
-
- os_aio_init(576, 9, 100);
-
- fil_init(25);
-
- buf_pool_init(srv_pool_size, srv_pool_size);
-
- fsp_init();
- log_init();
-
- lock_sys_create(srv_lock_table_size);
-
- create_files();
- create_log_files();
-
- init_spaces();
-
- sess_sys_init_at_db_start();
-
- trx_sys_create();
-
- dict_create();
-
- log_make_checkpoint_at(ut_dulint_max);
-
- printf("Hotspot semaphore addresses k %lx, p %lx, l %lx, s %lx\n",
- &kernel_mutex, &(buf_pool->mutex),
- &(log_sys->mutex), &btr_search_latch);
-
- if (srv_measure_contention) {
- os_thread_create(&test_measure_cont, NULL, thread_ids + 999);
- }
-
- if (!srv_log_archive_on) {
-
- ut_a(DB_SUCCESS == log_archive_noarchivelog());
- }
-
-/*
- mutex_create(&mutex);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 2000000; i++) {
-
- mutex_enter(&mutex);
-
- mutex_exit(&mutex);
- }
-
- tm = ut_clock();
-
- printf("Wall clock time for %lu mutex enter %lu milliseconds\n",
- i, tm - oldtm);
-*/
- if (srv_test_sync) {
- if (srv_test_nocache) {
- mutexes = os_mem_alloc_nocache(srv_test_n_mutexes
- * sizeof(mutex_t));
- } else {
- mutexes = mem_alloc(srv_test_n_mutexes
- * sizeof(mutex_t));
- }
-
- sum = 0;
-
- rnd = 492314896;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 4000000; i++) {
-
- rnd += 85967944;
-
- ptr = ((byte*)(mutexes)) + (rnd % (srv_test_n_mutexes
- * sizeof(mutex_t)));
- sum += *((ulint*)ptr);
- }
-
- tm = ut_clock();
-
- printf(
- "Wall clock time for %lu random access %lu milliseconds\n",
- i, tm - oldtm);
- if (always_false) {
- printf("%lu", sum);
- }
-
- test_array = mem_alloc(4 * 256 * srv_test_array_size);
-
- for (i = 0; i < srv_test_n_mutexes; i++) {
-
- mutex_create(mutexes + i);
- }
-
- for (i = 0; i < srv_test_n_threads; i++) {
- os_thread_create(&test_sync, NULL, thread_ids + i);
- }
- }
-
- srv_master_thread(NULL);
-
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-
- os_process_exit(0);
-}
diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c
index cbf12c9e55d..844880238fa 100644
--- a/innobase/buf/buf0buf.c
+++ b/innobase/buf/buf0buf.c
@@ -476,11 +476,11 @@ buf_block_init(
rw_lock_create(&(block->lock));
ut_ad(rw_lock_validate(&(block->lock)));
-
+
#ifdef UNIV_SYNC_DEBUG
rw_lock_create(&(block->debug_latch));
rw_lock_set_level(&(block->debug_latch), SYNC_NO_ORDER_CHECK);
-#endif
+#endif /* UNIV_SYNC_DEBUG */
}
/************************************************************************
@@ -1106,13 +1106,13 @@ loop:
buf_read_page(space, offset);
- #ifdef UNIV_DEBUG
+#ifdef UNIV_DEBUG
buf_dbg_counter++;
if (buf_dbg_counter % 37 == 0) {
ut_ad(buf_validate());
}
- #endif
+#endif
goto loop;
}
@@ -1325,9 +1325,9 @@ buf_page_optimistic_get_func(
}
if (!UT_DULINT_EQ(modify_clock, block->modify_clock)) {
-
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(block->frame, SYNC_NO_ORDER_CHECK);
-
+#endif /* UNIV_SYNC_DEBUG */
if (rw_latch == RW_S_LATCH) {
rw_lock_s_unlock(&(block->lock));
} else {
@@ -1527,7 +1527,9 @@ buf_page_init(
in units of a page */
buf_block_t* block) /* in: block to init */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(block->state != BUF_BLOCK_FILE_PAGE);
/* Set the state of the block */
@@ -1813,21 +1815,6 @@ buf_page_io_complete(
"InnoDB: Error: page n:o stored in the page read in is %lu, should be %lu!\n",
(ulong) read_page_no, (ulong) block->offset);
}
-#ifdef notdefined
- if (block->offset != 0 && read_page_no == 0) {
- /* Check that the page is really uninited */
-
- for (i = 0; i < UNIV_PAGE_SIZE; i++) {
-
- if (*((block->frame) + i) != '\0') {
- fprintf(stderr,
-"InnoDB: Error: page n:o in the page read in is 0, but page %lu is inited!\n",
- block->offset);
- break;
- }
- }
- }
-#endif
/* From version 3.23.38 up we store the page checksum
to the 4 first bytes of the page end lsn field */
diff --git a/innobase/buf/buf0flu.c b/innobase/buf/buf0flu.c
index cdea764971e..c568d5925fa 100644
--- a/innobase/buf/buf0flu.c
+++ b/innobase/buf/buf0flu.c
@@ -48,7 +48,9 @@ buf_flush_insert_into_flush_list(
/*=============================*/
buf_block_t* block) /* in: block which is modified */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
@@ -76,7 +78,9 @@ buf_flush_insert_sorted_into_flush_list(
buf_block_t* prev_b;
buf_block_t* b;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
prev_b = NULL;
b = UT_LIST_GET_FIRST(buf_pool->flush_list);
@@ -108,7 +112,9 @@ buf_flush_ready_for_replace(
buf_block_t* block) /* in: buffer control block, must be in state
BUF_BLOCK_FILE_PAGE and in the LRU list */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
if ((ut_dulint_cmp(block->oldest_modification, ut_dulint_zero) > 0)
@@ -132,7 +138,9 @@ buf_flush_ready_for_flush(
BUF_BLOCK_FILE_PAGE */
ulint flush_type)/* in: BUF_FLUSH_LRU or BUF_FLUSH_LIST */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
if ((ut_dulint_cmp(block->oldest_modification, ut_dulint_zero) > 0)
@@ -163,8 +171,9 @@ buf_flush_write_complete(
buf_block_t* block) /* in: pointer to the block in question */
{
ut_ad(block);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
-
+#endif /* UNIV_SYNC_DEBUG */
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
block->oldest_modification = ut_dulint_zero;
@@ -248,7 +257,7 @@ buf_flush_buffered_writes(void)
"InnoDB: files.\n",
(ulong) block->offset, (ulong) block->space);
- ut_a(0);
+ ut_error;
}
}
diff --git a/innobase/buf/buf0lru.c b/innobase/buf/buf0lru.c
index 23f399503c8..c5faec17890 100644
--- a/innobase/buf/buf0lru.c
+++ b/innobase/buf/buf0lru.c
@@ -299,7 +299,7 @@ buf_LRU_get_free_block(void)
buf_block_t* block = NULL;
ibool freed;
ulint n_iterations = 1;
- ibool mon_value_was = 0; /* remove bug */
+ ibool mon_value_was = FALSE;
ibool started_monitor = FALSE;
loop:
mutex_enter(&(buf_pool->mutex));
@@ -310,20 +310,26 @@ loop:
fprintf(stderr,
" InnoDB: ERROR: over 9 / 10 of the buffer pool is occupied by\n"
-"InnoDB: lock heaps or the adaptive hash index!\n"
+"InnoDB: lock heaps or the adaptive hash index! Check that your\n"
+"InnoDB: transactions do not set too many row locks.\n"
+"InnoDB: Your buffer pool size is %lu MB. Maybe you should make\n"
+"InnoDB: the buffer pool bigger?\n"
"InnoDB: We intentionally generate a seg fault to print a stack trace\n"
-"InnoDB: on Linux!\n");
+"InnoDB: on Linux!\n",
+ (ulong)(buf_pool->curr_size / (1024 * 1024 / UNIV_PAGE_SIZE)));
- ut_a(0);
+ ut_error;
} else if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free)
+ UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 5) {
+ if (!srv_print_innodb_monitor) {
- /* Over 80 % of the buffer pool is occupied by lock heaps
- or the adaptive hash index. This may be a memory leak! */
+ /* Over 80 % of the buffer pool is occupied by lock
+ heaps or the adaptive hash index. This may be a memory
+ leak! */
- ut_print_timestamp(stderr);
- fprintf(stderr,
+ ut_print_timestamp(stderr);
+ fprintf(stderr,
" InnoDB: WARNING: over 4 / 5 of the buffer pool is occupied by\n"
"InnoDB: lock heaps or the adaptive hash index! Check that your\n"
"InnoDB: transactions do not set too many row locks.\n"
@@ -333,8 +339,9 @@ loop:
"InnoDB: lock heap and hash index sizes.\n",
(ulong) (buf_pool->curr_size / (1024 * 1024 / UNIV_PAGE_SIZE)));
- srv_print_innodb_monitor = TRUE;
-
+ srv_print_innodb_monitor = TRUE;
+ os_event_set(srv_lock_timeout_thread_event);
+ }
} else if (!recv_recovery_on && UT_LIST_GET_LEN(buf_pool->free)
+ UT_LIST_GET_LEN(buf_pool->LRU) < buf_pool->max_size / 4) {
@@ -423,6 +430,7 @@ loop:
mon_value_was = srv_print_innodb_monitor;
started_monitor = TRUE;
srv_print_innodb_monitor = TRUE;
+ os_event_set(srv_lock_timeout_thread_event);
}
/* No free block was found: try to flush the LRU list */
@@ -467,7 +475,9 @@ buf_LRU_old_adjust_len(void)
ulint new_len;
ut_a(buf_pool->LRU_old);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(3 * (BUF_LRU_OLD_MIN_LEN / 8) > BUF_LRU_OLD_TOLERANCE + 5);
for (;;) {
@@ -540,7 +550,9 @@ buf_LRU_remove_block(
{
ut_ad(buf_pool);
ut_ad(block);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
ut_a(block->in_LRU_list);
@@ -604,7 +616,9 @@ buf_LRU_add_block_to_end_low(
ut_ad(buf_pool);
ut_ad(block);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
@@ -667,7 +681,9 @@ buf_LRU_add_block_low(
ut_ad(buf_pool);
ut_ad(block);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
ut_a(!block->in_LRU_list);
@@ -768,7 +784,9 @@ buf_LRU_block_free_non_file_page(
/*=============================*/
buf_block_t* block) /* in: block, must not contain a file page */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(block);
ut_a((block->state == BUF_BLOCK_MEMORY)
@@ -805,7 +823,9 @@ buf_LRU_block_remove_hashed_page(
be in a state where it can be freed; there
may or may not be a hash index to the page */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(block);
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
@@ -859,7 +879,9 @@ buf_LRU_block_free_hashed_page(
buf_block_t* block) /* in: block, must contain a file page and
be in a state where it can be freed */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(block->state == BUF_BLOCK_REMOVE_HASH);
block->state = BUF_BLOCK_MEMORY;
diff --git a/innobase/buf/ts/makefile b/innobase/buf/ts/makefile
deleted file mode 100644
index 5886d06d7fa..00000000000
--- a/innobase/buf/ts/makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-include ..\..\makefile.i
-
-doall: tsbuf
-
-tsbuf: ..\buf.lib tsbuf.c
- $(CCOM) $(CFL) -I.. -I..\.. ..\buf.lib ..\..\btr.lib ..\..\trx.lib ..\..\pars.lib ..\..\que.lib ..\..\lock.lib ..\..\row.lib ..\..\read.lib ..\..\srv.lib ..\..\com.lib ..\..\usr.lib ..\..\thr.lib ..\..\fut.lib ..\..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tsbuf.c $(LFL)
-
-tsos: ..\buf.lib tsos.c
- $(CCOM) $(CFL) -I.. -I..\.. ..\buf.lib ..\..\mach.lib ..\..\fil.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tsos.c $(LFL)
-
-
-
-
-
-
-
-
diff --git a/innobase/buf/ts/tsbuf.c b/innobase/buf/ts/tsbuf.c
deleted file mode 100644
index fd6ae69653f..00000000000
--- a/innobase/buf/ts/tsbuf.c
+++ /dev/null
@@ -1,885 +0,0 @@
-/************************************************************************
-The test module for the file system and buffer manager
-
-(c) 1995 Innobase Oy
-
-Created 11/16/1995 Heikki Tuuri
-*************************************************************************/
-
-#include "string.h"
-
-#include "os0thread.h"
-#include "os0file.h"
-#include "ut0ut.h"
-#include "ut0byte.h"
-#include "sync0sync.h"
-#include "mem0mem.h"
-#include "fil0fil.h"
-#include "mtr0mtr.h"
-#include "mtr0log.h"
-#include "log0log.h"
-#include "mach0data.h"
-#include "..\buf0buf.h"
-#include "..\buf0flu.h"
-#include "..\buf0lru.h"
-
-os_file_t files[1000];
-
-mutex_t ios_mutex;
-ulint ios;
-ulint n[10];
-
-mutex_t incs_mutex;
-ulint incs;
-
-#define N_SPACES 1
-#define N_FILES 1
-#define FILE_SIZE 4000
-#define POOL_SIZE 1000
-#define COUNTER_OFFSET 1500
-
-#define LOOP_SIZE 150
-#define N_THREADS 5
-
-
-ulint zero = 0;
-
-buf_frame_t* bl_arr[POOL_SIZE];
-
-/************************************************************************
-Io-handler thread function. */
-
-ulint
-handler_thread(
-/*===========*/
- void* arg)
-{
- ulint segment;
- void* mess;
- ulint i;
- bool ret;
-
- segment = *((ulint*)arg);
-
- printf("Io handler thread %lu starts\n", segment);
-
- for (i = 0;; i++) {
- ret = fil_aio_wait(segment, &mess);
- ut_a(ret);
-
- buf_page_io_complete((buf_block_t*)mess);
-
- mutex_enter(&ios_mutex);
- ios++;
- mutex_exit(&ios_mutex);
-
- }
-
- return(0);
-}
-
-/*************************************************************************
-This thread reports the status of sync system. */
-
-ulint
-info_thread(
-/*========*/
- void* arg)
-{
- ulint segment;
-
- segment = *((ulint*)arg);
-
- for (;;) {
- sync_print();
- os_aio_print();
- printf("Debug stop threads == %lu\n", ut_dbg_stop_threads);
- os_thread_sleep(30000000);
- }
-
- return(0);
-}
-
-/*************************************************************************
-Creates the files for the file system test and inserts them to
-the file system. */
-
-void
-create_files(void)
-/*==============*/
-{
- bool ret;
- ulint i, k;
- char name[20];
- os_thread_t thr[5];
- os_thread_id_t id[5];
- ulint err;
-
- printf("--------------------------------------------------------\n");
- printf("Create or open database files\n");
-
- strcpy(name, "tsfile00");
-
- for (k = 0; k < N_SPACES; k++) {
- for (i = 0; i < N_FILES; i++) {
-
- name[9] = (char)((ulint)'0' + k);
- name[10] = (char)((ulint)'0' + i);
-
- files[i] = os_file_create(name, OS_FILE_CREATE,
- OS_FILE_TABLESPACE, &ret);
-
- if (ret == FALSE) {
- err = os_file_get_last_error();
- if (err != OS_FILE_ALREADY_EXISTS) {
- printf("OS error %lu in file creation\n", err);
- ut_error;
- }
-
- files[i] = os_file_create(
- name, OS_FILE_OPEN,
- OS_FILE_TABLESPACE, &ret);
-
- ut_a(ret);
- }
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create(name, k, OS_FILE_TABLESPACE);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, FILE_SIZE, k);
- }
- }
-
- ios = 0;
-
- mutex_create(&ios_mutex);
-
- for (i = 0; i < 5; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(handler_thread, n + i, id + i);
- }
-/*
- n[9] = 9;
- os_thread_create(info_thread, n + 9, id);
-*/
-}
-
-/************************************************************************
-Creates the test database files. */
-
-void
-create_db(void)
-/*===========*/
-{
- ulint i;
- byte* frame;
- ulint j;
- ulint tm, oldtm;
- mtr_t mtr;
-
- printf("--------------------------------------------------------\n");
- printf("Write database pages\n");
-
- oldtm = ut_clock();
-
- for (i = 0; i < N_SPACES; i++) {
- for (j = 0; j < FILE_SIZE * N_FILES; j++) {
- mtr_start(&mtr);
- mtr_set_log_mode(&mtr, MTR_LOG_NONE);
-
- frame = buf_page_create(i, j, &mtr);
- buf_page_get(i, j, RW_X_LATCH, &mtr);
-
- if (j > FILE_SIZE * N_FILES - 64 * 2 - 1) {
- mlog_write_ulint(frame + FIL_PAGE_PREV, j - 5,
- MLOG_4BYTES, &mtr);
- mlog_write_ulint(frame + FIL_PAGE_NEXT, j - 7,
- MLOG_4BYTES, &mtr);
- } else {
- mlog_write_ulint(frame + FIL_PAGE_PREV, j - 1,
- MLOG_4BYTES, &mtr);
- mlog_write_ulint(frame + FIL_PAGE_NEXT, j + 1,
- MLOG_4BYTES, &mtr);
- }
-
- mlog_write_ulint(frame + FIL_PAGE_OFFSET, j,
- MLOG_4BYTES, &mtr);
- mlog_write_ulint(frame + FIL_PAGE_SPACE, i,
- MLOG_4BYTES, &mtr);
- mlog_write_ulint(frame + COUNTER_OFFSET, 0,
- MLOG_4BYTES, &mtr);
-
- mtr_commit(&mtr);
- }
- }
-
- tm = ut_clock();
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
-
- printf("--------------------------------------------------------\n");
- printf("TEST 1 A. Test of page creation when page resides in buffer\n");
- for (i = 0; i < N_SPACES; i++) {
- for (j = FILE_SIZE * N_FILES - 200;
- j < FILE_SIZE * N_FILES; j++) {
- mtr_start(&mtr);
- mtr_set_log_mode(&mtr, MTR_LOG_NONE);
-
- frame = buf_page_create(i, j, &mtr);
- buf_page_get(i, j, RW_X_LATCH, &mtr);
-
- mlog_write_ulint(frame + FIL_PAGE_PREV,
- j - 1, MLOG_4BYTES, &mtr);
-
- mlog_write_ulint(frame + FIL_PAGE_NEXT,
- j + 1, MLOG_4BYTES, &mtr);
-
- mlog_write_ulint(frame + FIL_PAGE_OFFSET, j,
- MLOG_4BYTES, &mtr);
- mlog_write_ulint(frame + FIL_PAGE_SPACE, i,
- MLOG_4BYTES, &mtr);
- mtr_commit(&mtr);
- }
- }
-
- printf("--------------------------------------------------------\n");
- printf("TEST 1 B. Flush pages\n");
-
- buf_flush_batch(BUF_FLUSH_LIST, POOL_SIZE / 2);
- buf_validate();
-
- printf("--------------------------------------------------------\n");
- printf("TEST 1 C. Allocate POOL_SIZE blocks to flush pages\n");
-
- buf_validate();
- /* Flush the pool of dirty pages */
- for (i = 0; i < POOL_SIZE; i++) {
-
- bl_arr[i] = buf_frame_alloc();
- }
- buf_validate();
- buf_LRU_print();
-
- for (i = 0; i < POOL_SIZE; i++) {
-
- buf_frame_free(bl_arr[i]);
- }
-
- buf_validate();
- ut_a(buf_all_freed());
-
- mtr_start(&mtr);
- frame = buf_page_get(0, 313, RW_S_LATCH, &mtr);
-#ifdef UNIV_ASYNC_IO
- ut_a(buf_page_io_query(buf_block_align(frame)) == TRUE);
-#endif
- mtr_commit(&mtr);
-}
-
-/************************************************************************
-Reads the test database files. */
-
-void
-test1(void)
-/*=======*/
-{
- ulint i, j, k, c;
- byte* frame;
- ulint tm, oldtm;
- mtr_t mtr;
-
- printf("--------------------------------------------------------\n");
- printf("TEST 1 D. Read linearly database files\n");
-
- oldtm = ut_clock();
-
- for (k = 0; k < 1; k++) {
- for (i = 0; i < N_SPACES; i++) {
- for (j = 0; j < N_FILES * FILE_SIZE; j++) {
- mtr_start(&mtr);
-
- frame = buf_page_get(i, j, RW_S_LATCH, &mtr);
-
- ut_a(mtr_read_ulint(frame + FIL_PAGE_OFFSET,
- MLOG_4BYTES, &mtr)
- == j);
- ut_a(mtr_read_ulint(frame + FIL_PAGE_SPACE,
- MLOG_4BYTES, &mtr)
- == i);
-
- mtr_commit(&mtr);
- }
- }
- }
-
- tm = ut_clock();
- printf("Wall clock time for %lu pages %lu milliseconds\n",
- k * i * j, tm - oldtm);
- buf_validate();
-
- printf("--------------------------------------------------------\n");
- printf("TEST 1 E. Read linearly downward database files\n");
-
- oldtm = ut_clock();
-
- c = 0;
-
- for (k = 0; k < 1; k++) {
- for (i = 0; i < N_SPACES; i++) {
- for (j = ut_min(1000, FILE_SIZE - 1); j > 0; j--) {
- mtr_start(&mtr);
-
- frame = buf_page_get(i, j, RW_S_LATCH, &mtr);
- c++;
-
- ut_a(mtr_read_ulint(frame + FIL_PAGE_OFFSET,
- MLOG_4BYTES, &mtr)
- == j);
- ut_a(mtr_read_ulint(frame + FIL_PAGE_SPACE,
- MLOG_4BYTES, &mtr)
- == i);
-
-
- ut_a(buf_page_io_query(buf_block_align(frame))
- == FALSE);
-
- mtr_commit(&mtr);
- }
- }
- }
-
- tm = ut_clock();
- printf("Wall clock time for %lu pages %lu milliseconds\n",
- c, tm - oldtm);
- buf_validate();
-}
-
-/************************************************************************
-Reads the test database files. */
-
-void
-test2(void)
-/*=======*/
-{
- ulint i, j, k;
- byte* frame;
- ulint tm, oldtm;
- mtr_t mtr;
-
- printf("--------------------------------------------------------\n");
- printf("TEST 2. Read randomly database files\n");
-
- oldtm = ut_clock();
-
- for (k = 0; k < 100; k++) {
- i = ut_rnd_gen_ulint() % N_SPACES;
- j = ut_rnd_gen_ulint() % (N_FILES * FILE_SIZE);
-
- mtr_start(&mtr);
-
- frame = buf_page_get(i, j, RW_S_LATCH, &mtr);
-
- ut_a(mtr_read_ulint(frame + FIL_PAGE_OFFSET,
- MLOG_4BYTES, &mtr)
- == j);
- ut_a(mtr_read_ulint(frame + FIL_PAGE_SPACE,
- MLOG_4BYTES, &mtr)
- == i);
-
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf("Wall clock time for random %lu read %lu milliseconds\n",
- k, tm - oldtm);
-}
-
-/************************************************************************
-Reads the test database files. */
-
-void
-test3(void)
-/*=======*/
-{
- ulint i, j, k;
- byte* frame;
- ulint tm, oldtm;
- ulint rnd;
- mtr_t mtr;
-
- if (FILE_SIZE < POOL_SIZE + 3050 + ut_dbg_zero) {
- return;
- }
-
- printf("Flush the pool of high-offset pages\n");
-
- /* Flush the pool of high-offset pages */
- for (i = 0; i < POOL_SIZE; i++) {
-
- mtr_start(&mtr);
-
- frame = buf_page_get(0, i, RW_S_LATCH, &mtr);
-
- mtr_commit(&mtr);
- }
- buf_validate();
-
- printf("--------------------------------------------------------\n");
- printf("TEST 3. Read randomly database pages, no read-ahead\n");
-
- oldtm = ut_clock();
-
- rnd = 123;
-
- for (k = 0; k < 400; k++) {
- rnd += 23477;
-
- i = 0;
- j = POOL_SIZE + 10 + rnd % 3000;
-
- mtr_start(&mtr);
-
- frame = buf_page_get(i, j, RW_S_LATCH, &mtr);
-
- ut_a(mtr_read_ulint(frame + FIL_PAGE_OFFSET,
- MLOG_4BYTES, &mtr)
- == j);
- ut_a(mtr_read_ulint(frame + FIL_PAGE_SPACE,
- MLOG_4BYTES, &mtr)
- == i);
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf(
- "Wall clock time for %lu random no read-ahead %lu milliseconds\n",
- k, tm - oldtm);
-
- buf_validate();
- printf("Flush the pool of high-offset pages\n");
- /* Flush the pool of high-offset pages */
- for (i = 0; i < POOL_SIZE; i++) {
-
- mtr_start(&mtr);
-
- frame = buf_page_get(0, i, RW_S_LATCH, &mtr);
-
- mtr_commit(&mtr);
- }
-
- buf_validate();
- printf("--------------------------------------------------------\n");
- printf("TEST 3 B. Read randomly database pages, random read-ahead\n");
-
- oldtm = ut_clock();
-
- rnd = 123;
- for (k = 0; k < 400; k++) {
- rnd += 23477;
-
- i = 0;
- j = POOL_SIZE + 10 + rnd % 400;
-
- mtr_start(&mtr);
-
- frame = buf_page_get(i, j, RW_S_LATCH, &mtr);
-
- ut_a(mtr_read_ulint(frame + FIL_PAGE_OFFSET,
- MLOG_4BYTES, &mtr)
- == j);
- ut_a(mtr_read_ulint(frame + FIL_PAGE_SPACE,
- MLOG_4BYTES, &mtr)
- == i);
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf(
- "Wall clock time for %lu random read-ahead %lu milliseconds\n",
- k, tm - oldtm);
-}
-
-/************************************************************************
-Tests speed of CPU algorithms. */
-
-void
-test4(void)
-/*=======*/
-{
- ulint i, j;
- ulint tm, oldtm;
- mtr_t mtr;
- buf_frame_t* frame;
-
- os_thread_sleep(2000000);
-
- printf("--------------------------------------------------------\n");
- printf("TEST 4. Speed of CPU algorithms\n");
-
- oldtm = ut_clock();
-
- for (j = 0; j < 1000; j++) {
-
- mtr_start(&mtr);
- for (i = 0; i < 20; i++) {
-
- frame = buf_page_get(0, i, RW_S_LATCH, &mtr);
- }
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf("Wall clock time for %lu page get-release %lu milliseconds\n",
- i * j, tm - oldtm);
-
- buf_validate();
-
- oldtm = ut_clock();
-
- for (i = 0; i < 10000; i++) {
- frame = buf_frame_alloc();
- buf_frame_free(frame);
- }
-
- tm = ut_clock();
- printf("Wall clock time for %lu block alloc-free %lu milliseconds\n",
- i, tm - oldtm);
-
- ha_print_info(buf_pool->page_hash);
- buf_print();
-}
-
-/************************************************************************
-Tests various points of code. */
-
-void
-test5(void)
-/*=======*/
-{
- buf_frame_t* frame;
- fil_addr_t addr;
- ulint space;
- mtr_t mtr;
-
- printf("--------------------------------------------------------\n");
- printf("TEST 5. Various tests \n");
-
- mtr_start(&mtr);
-
- frame = buf_page_get(0, 313, RW_S_LATCH, &mtr);
-
- ut_a(buf_frame_get_space_id(frame) == 0);
- ut_a(buf_frame_get_page_no(frame) == 313);
-
- ut_a(buf_frame_align(frame + UNIV_PAGE_SIZE - 1) == frame);
- ut_a(buf_frame_align(frame) == frame);
-
- ut_a(buf_block_align(frame + UNIV_PAGE_SIZE - 1) ==
- buf_block_align(frame));
-
- buf_ptr_get_fsp_addr(frame + UNIV_PAGE_SIZE - 1, &space, &addr);
-
- ut_a(addr.page == 313)
- ut_a(addr.boffset == UNIV_PAGE_SIZE - 1);
- ut_a(space == 0);
-
- mtr_commit(&mtr);
-}
-
-/************************************************************************
-Random test thread function. */
-
-ulint
-random_thread(
-/*===========*/
- void* arg)
-{
- ulint n;
- ulint i, j, r, t, p, sp, count;
- ulint s;
- buf_frame_t* arr[POOL_SIZE / N_THREADS];
- buf_frame_t* frame;
- mtr_t mtr;
- mtr_t mtr2;
-
- n = *((ulint*)arg);
-
- printf("Random test thread %lu starts\n", os_thread_get_curr_id());
-
- for (i = 0; i < 30; i++) {
- t = ut_rnd_gen_ulint() % 10;
- r = ut_rnd_gen_ulint() % 100;
- s = ut_rnd_gen_ulint() % (POOL_SIZE / N_THREADS);
- p = ut_rnd_gen_ulint();
- sp = ut_rnd_gen_ulint() % N_SPACES;
-
- if (i % 100 == 0) {
- printf("Thr %lu tst %lu starts\n", os_thread_get_curr_id(), t);
- }
- ut_a(buf_validate());
-
- mtr_start(&mtr);
- if (t == 6) {
- /* Allocate free blocks */
- for (j = 0; j < s; j++) {
- arr[j] = buf_frame_alloc();
- ut_a(arr[j]);
- }
- for (j = 0; j < s; j++) {
- buf_frame_free(arr[j]);
- }
- } else if (t == 9) {
-/* buf_flush_batch(BUF_FLUSH_LIST, 30); */
-
- } else if (t == 7) {
- /* x-lock many blocks */
- for (j = 0; j < s; j++) {
- arr[j] = buf_page_get(sp, (p + j)
- % (N_FILES * FILE_SIZE),
- RW_X_LATCH,
- &mtr);
- ut_a(arr[j]);
- if (j > 0) {
- ut_a(arr[j] != arr[j - 1]);
- }
- }
- ut_a(buf_validate());
- } else if (t == 8) {
- /* s-lock many blocks */
- for (j = 0; j < s; j++) {
- arr[j] = buf_page_get(sp, (p + j)
- % (N_FILES * FILE_SIZE),
- RW_S_LATCH,
- &mtr);
- ut_a(arr[j]);
- if (j > 0) {
- ut_a(arr[j] != arr[j - 1]);
- }
- }
- } else if (t <= 2) {
- for (j = 0; j < r; j++) {
- /* Read pages */
- mtr_start(&mtr2);
- frame = buf_page_get(sp,
- p % (N_FILES * FILE_SIZE),
- RW_S_LATCH, &mtr2);
-
- ut_a(mtr_read_ulint(frame + FIL_PAGE_OFFSET,
- MLOG_4BYTES, &mtr2)
- == p % (N_FILES * FILE_SIZE));
- ut_a(mtr_read_ulint(frame + FIL_PAGE_SPACE,
- MLOG_4BYTES, &mtr2)
- == sp);
- mtr_commit(&mtr2);
- if (t == 0) {
- p++; /* upward */
- } else if (t == 1) {
- p--; /* downward */
- } else if (t == 2) {
- p = ut_rnd_gen_ulint(); /* randomly */
- }
- }
- } else if (t <= 5) {
- for (j = 0; j < r; j++) {
- /* Write pages */
- mtr_start(&mtr2);
- frame = buf_page_get(sp, p % (N_FILES * FILE_SIZE),
- RW_X_LATCH, &mtr2);
- count = 1 + mtr_read_ulint(frame + COUNTER_OFFSET,
- MLOG_4BYTES, &mtr2);
- mutex_enter(&incs_mutex);
- incs++;
- mutex_exit(&incs_mutex);
- mlog_write_ulint(frame + COUNTER_OFFSET, count,
- MLOG_4BYTES, &mtr2);
- mtr_commit(&mtr2);
- if (t == 3) {
- p++; /* upward */
- } else if (t == 4) {
- p--; /* downward */
- } else if (t == 5) {
- p = ut_rnd_gen_ulint(); /* randomly */
- }
- }
- } /* if t = */
-
- mtr_commit(&mtr);
-/* printf("Thr %lu tst %lu ends ", os_thread_get_curr_id(), t); */
- ut_a(buf_validate());
- } /* for i */
- printf("\nRandom test thread %lu exits\n", os_thread_get_curr_id());
- return(0);
-}
-
-/************************************************************************
-Random test thread function which reports the rw-lock list. */
-
-ulint
-rw_list_thread(
-/*===========*/
- void* arg)
-{
- ulint n;
- ulint i;
-
- n = *((ulint*)arg);
-
- printf("\nRw list test thread %lu starts\n", os_thread_get_curr_id());
-
- for (i = 0; i < 10; i++) {
- os_thread_sleep(3000000);
- rw_lock_list_print_info();
- buf_validate();
- }
-
- return(0);
-}
-
-/*************************************************************************
-Performs random operations on the buffer with several threads. */
-
-void
-test6(void)
-/*=======*/
-{
- ulint i, j;
- os_thread_t thr[N_THREADS + 1];
- os_thread_id_t id[N_THREADS + 1];
- ulint n[N_THREADS + 1];
- ulint count = 0;
- buf_frame_t* frame;
- mtr_t mtr;
-
- printf("--------------------------------------------------------\n");
- printf("TEST 6. Random multi-thread test on the buffer \n");
-
- incs = 0;
- mutex_create(&incs_mutex);
-
- for (i = 0; i < N_THREADS; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(random_thread, n + i, id + i);
- }
-/*
- n[N_THREADS] = N_THREADS;
-
- thr[N_THREADS] = os_thread_create(rw_list_thread, n + N_THREADS,
- id + N_THREADS);
-*/
- for (i = 0; i < N_THREADS; i++) {
- os_thread_wait(thr[i]);
- }
-
-/* os_thread_wait(thr[N_THREADS]); */
-
- for (i = 0; i < N_SPACES; i++) {
- for (j = 0; j < N_FILES * FILE_SIZE; j++) {
- mtr_start(&mtr);
-
- frame = buf_page_get(i, j, RW_S_LATCH, &mtr);
-
- ut_a(mtr_read_ulint(frame + FIL_PAGE_OFFSET,
- MLOG_4BYTES, &mtr)
- == j);
- ut_a(mtr_read_ulint(frame + FIL_PAGE_SPACE,
- MLOG_4BYTES, &mtr)
- == i);
-
- count += mtr_read_ulint(frame + COUNTER_OFFSET,
- MLOG_4BYTES, &mtr);
-
- mtr_commit(&mtr);
- }
- }
-
- printf("Count %lu incs %lu\n", count, incs);
- ut_a(count == incs);
-}
-
-/************************************************************************
-Frees the spaces in the file system. */
-
-void
-free_system(void)
-/*=============*/
-{
- ulint i;
-
- for (i = 0; i < N_SPACES; i++) {
- fil_space_free(i);
- }
-}
-
-/************************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
-
-/* buf_debug_prints = TRUE; */
-
- oldtm = ut_clock();
-
- os_aio_init(160, 5);
- sync_init();
- mem_init(1500000);
- fil_init(26); /* Allow 25 open files at a time */
- buf_pool_init(POOL_SIZE, POOL_SIZE);
- log_init();
-
- buf_validate();
-
- ut_a(fil_validate());
-
- create_files();
-
- create_db();
-
- buf_validate();
-
- test1();
- buf_validate();
-
- test2();
- buf_validate();
-
- test3();
- buf_validate();
-
- test4();
-
- test5();
-
- buf_validate();
-
- test6();
-
- buf_validate();
-
- buf_print();
-
- buf_flush_batch(BUF_FLUSH_LIST, POOL_SIZE + 1);
- buf_print();
- buf_validate();
-
- os_thread_sleep(1000000);
-
- buf_print();
- buf_all_freed();
-
- free_system();
-
- tm = ut_clock();
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/buf/ts/tsos.c b/innobase/buf/ts/tsos.c
deleted file mode 100644
index c1cc3f27172..00000000000
--- a/innobase/buf/ts/tsos.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/************************************************************************
-The test module for the operating system interface
-
-(c) 1995 Innobase Oy
-
-Created 9/27/1995 Heikki Tuuri
-*************************************************************************/
-
-
-#include "../os0thread.h"
-#include "../os0shm.h"
-#include "../os0proc.h"
-#include "../os0sync.h"
-#include "../os0file.h"
-#include "ut0ut.h"
-#include "sync0sync.h"
-#include "mem0mem.h"
-
-ulint last_thr = 1;
-
-byte global_buf[1000000];
-
-os_file_t file;
-os_file_t file2;
-
-os_event_t gl_ready;
-
-mutex_t ios_mutex;
-ulint ios;
-
-/************************************************************************
-Io-handler thread function. */
-
-ulint
-handler_thread(
-/*===========*/
- void* arg)
-{
- ulint segment;
- void* mess;
- ulint i;
- bool ret;
-
- segment = *((ulint*)arg);
-
- printf("Thread %lu starts\n", segment);
-
- for (i = 0;; i++) {
- ret = os_aio_wait(segment, &mess);
-
- mutex_enter(&ios_mutex);
- ios++;
- mutex_exit(&ios_mutex);
-
- ut_a(ret);
-/* printf("Message for thread %lu %lu\n", segment,
- (ulint)mess); */
- if ((ulint)mess == 3333) {
- os_event_set(gl_ready);
- }
- }
-
- return(0);
-}
-
-/************************************************************************
-Test of io-handler threads */
-
-void
-test4(void)
-/*=======*/
-{
- ulint i;
- bool ret;
- void* buf;
- ulint rnd;
- ulint tm, oldtm;
-
- os_thread_t thr[5];
- os_thread_id_t id[5];
- ulint n[5];
-
- printf("-------------------------------------------\n");
- printf("OS-TEST 4. Test of asynchronous file io\n");
-
- /* Align the buffer for file io */
-
- buf = (void*)(((ulint)global_buf + 6300) & (~0xFFF));
-
- gl_ready = os_event_create(NULL);
- ios = 0;
-
- sync_init();
- mem_init();
-
- mutex_create(&ios_mutex);
-
- for (i = 0; i < 5; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(handler_thread, n + i, id + i);
- }
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 4096; i++) {
- ret = os_aio_read(file, (byte*)buf + 8192 * (rnd % 100),
- 8192 * (rnd % 4096), 0,
- 8192, (void*)i);
- ut_a(ret);
- rnd += 1;
- }
-
- ret = os_aio_read(file, buf, 8192 * (rnd % 1024), 0, 8192,
- (void*)3333);
- ut_a(ret);
-
- ut_a(!os_aio_all_slots_free());
-
- tm = ut_clock();
-
- printf("All ios queued! N ios: %lu\n", ios);
-
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
-
- os_event_wait(gl_ready);
-
- tm = ut_clock();
- printf("N ios: %lu\n", ios);
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
-
- os_thread_sleep(2000000);
-
- printf("N ios: %lu\n", ios);
-
- ut_a(os_aio_all_slots_free());
-}
-
-/*************************************************************************
-Initializes the asyncronous io system for tests. */
-
-void
-init_aio(void)
-/*==========*/
-{
- bool ret;
- void* buf;
-
- buf = (void*)(((ulint)global_buf + 6300) & (~0xFFF));
-
- os_aio_init(160, 5);
- file = os_file_create("j:\\tsfile4", OS_FILE_CREATE, OS_FILE_TABLESPACE,
- &ret);
-
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() == OS_FILE_ALREADY_EXISTS);
-
- file = os_file_create("j:\\tsfile4", OS_FILE_OPEN,
- OS_FILE_TABLESPACE, &ret);
-
- ut_a(ret);
- }
-}
-
-/************************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
-
- oldtm = ut_clock();
-
- init_aio();
-
- test4();
-
- tm = ut_clock();
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/com/Makefile.am b/innobase/com/Makefile.am
deleted file mode 100644
index a3d2f8a76c6..00000000000
--- a/innobase/com/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libcom.a
-
-libcom_a_SOURCES = com0com.c com0shm.c
-
-EXTRA_PROGRAMS =
diff --git a/innobase/com/com0com.c b/innobase/com/com0com.c
deleted file mode 100644
index 94585d9f269..00000000000
--- a/innobase/com/com0com.c
+++ /dev/null
@@ -1,345 +0,0 @@
-/******************************************************
-The communication primitives
-
-(c) 1995 Innobase Oy
-
-Created 9/23/1995 Heikki Tuuri
-*******************************************************/
-
-#include "com0com.h"
-#ifdef UNIV_NONINL
-#include "com0com.ic"
-#endif
-
-#include "mem0mem.h"
-#include "com0shm.h"
-
-/*
- IMPLEMENTATION OF COMMUNICATION PRIMITIVES
- ==========================================
-
-The primitives provide a uniform function interface for
-use in communication. The primitives have been modeled
-after the Windows Sockets interface. Below this uniform
-API, the precise methods of communication, for example,
-shared memory or Berkeley sockets, can be implemented
-as subroutines.
-*/
-
-struct com_endpoint_struct{
- ulint type; /* endpoint type */
- void* par; /* type-specific data structures */
- ibool bound; /* TRUE if the endpoint has been
- bound to an address */
-};
-
-/*************************************************************************
-Accessor functions for an endpoint */
-UNIV_INLINE
-ulint
-com_endpoint_get_type(
-/*==================*/
- com_endpoint_t* ep)
-{
- ut_ad(ep);
- return(ep->type);
-}
-
-UNIV_INLINE
-void
-com_endpoint_set_type(
-/*==================*/
- com_endpoint_t* ep,
- ulint type)
-{
- ut_ad(ep);
- ut_ad(type == COM_SHM);
-
- ep->type = type;
-}
-
-UNIV_INLINE
-void*
-com_endpoint_get_par(
-/*=================*/
- com_endpoint_t* ep)
-{
- ut_ad(ep);
- return(ep->par);
-}
-
-UNIV_INLINE
-void
-com_endpoint_set_par(
-/*=================*/
- com_endpoint_t* ep,
- void* par)
-{
- ut_ad(ep);
- ut_ad(par);
-
- ep->par = par;
-}
-
-UNIV_INLINE
-ibool
-com_endpoint_get_bound(
-/*===================*/
- com_endpoint_t* ep)
-{
- ut_ad(ep);
- return(ep->bound);
-}
-
-UNIV_INLINE
-void
-com_endpoint_set_bound(
-/*===================*/
- com_endpoint_t* ep,
- ibool bound)
-{
- ut_ad(ep);
-
- ep->bound = bound;
-}
-
-
-/*************************************************************************
-Creates a communications endpoint. */
-
-com_endpoint_t*
-com_endpoint_create(
-/*================*/
- /* out, own: communications endpoint, NULL if
- did not succeed */
- ulint type) /* in: communication type of endpoint:
- only COM_SHM supported */
-{
- com_endpoint_t* ep;
- void* par;
-
- ep = mem_alloc(sizeof(com_endpoint_t));
-
- com_endpoint_set_type(ep, type);
- com_endpoint_set_bound(ep, FALSE);
-
- if (type == COM_SHM) {
- par = com_shm_endpoint_create();
- com_endpoint_set_par(ep, par);
- } else {
- par = NULL;
- ut_error;
- }
-
- if (par != NULL) {
- return(ep);
- } else {
- mem_free(ep);
- return(NULL);
- }
-}
-
-/*************************************************************************
-Frees a communications endpoint. */
-
-ulint
-com_endpoint_free(
-/*==============*/
- /* out: O if succeed, else error number */
- com_endpoint_t* ep) /* in, own: communications endpoint */
-{
- ulint type;
- ulint ret;
- void* par;
-
- type = com_endpoint_get_type(ep);
- par = com_endpoint_get_par(ep);
-
- if (type == COM_SHM) {
- ret = com_shm_endpoint_free((com_shm_endpoint_t*)par);
- } else {
- ret = 0;
- ut_error;
- }
-
- if (ret) {
- return(ret);
- } else {
- mem_free(ep);
- return(0);
- }
-}
-
-/*************************************************************************
-Sets an option, like the maximum datagram size for an endpoint.
-The options may vary depending on the endpoint type. */
-
-ulint
-com_endpoint_set_option(
-/*====================*/
- /* out: 0 if succeed, else error number */
- com_endpoint_t* ep, /* in: endpoint */
- ulint optno, /* in: option number, only
- COM_OPT_MAX_DGRAM_SIZE currently supported */
- byte* optval, /* in: pointer to a buffer containing the
- option value to set */
- ulint optlen) /* in: option value buffer length */
-{
- ulint type;
- ulint ret;
- void* par;
-
- type = com_endpoint_get_type(ep);
- par = com_endpoint_get_par(ep);
-
- if (type == COM_SHM) {
- ret = com_shm_endpoint_set_option((com_shm_endpoint_t*)par,
- optno, optval, optlen);
- } else {
- ret = 0;
- ut_error;
- }
-
- return(ret);
-}
-
-/*************************************************************************
-Binds a communications endpoint to the specified address. */
-
-ulint
-com_bind(
-/*=====*/
- /* out: 0 if succeed, else error number */
- com_endpoint_t* ep, /* in: communications endpoint */
- char* name, /* in: address name */
- ulint len) /* in: name length */
-{
- ulint type;
- ulint ret;
- void* par;
-
- ut_ad(len <= COM_MAX_ADDR_LEN);
-
- if (com_endpoint_get_bound(ep)) {
- return(COM_ERR_ALREADY_BOUND);
- }
-
- type = com_endpoint_get_type(ep);
- par = com_endpoint_get_par(ep);
-
- if (type == COM_SHM) {
- ret = com_shm_bind((com_shm_endpoint_t*)par, name, len);
- } else {
- ret = 0;
- ut_error;
- }
-
- if (ret == 0) {
- com_endpoint_set_bound(ep, TRUE);
- }
-
- return(ret);
-}
-
-/*************************************************************************
-Waits for a datagram to arrive at an endpoint. */
-
-ulint
-com_recvfrom(
-/*=========*/
- /* out: 0 if succeed, else error number */
- com_endpoint_t* ep, /* in: communications endpoint */
- byte* buf, /* out: datagram buffer; the buffer is
- supplied by the caller */
- ulint buf_len,/* in: datagram buffer length */
- ulint* len, /* out: datagram length */
- char* from, /* out: address name buffer; the buffer is
- supplied by the caller */
- ulint from_len,/* in: address name buffer length */
- ulint* addr_len)/* out: address name length */
-{
- ulint type;
- ulint ret;
- void* par;
-
- if (!com_endpoint_get_bound(ep)) {
-
- return(COM_ERR_NOT_BOUND);
- }
-
- type = com_endpoint_get_type(ep);
- par = com_endpoint_get_par(ep);
-
- if (type == COM_SHM) {
- ret = com_shm_recvfrom((com_shm_endpoint_t*)par,
- buf, buf_len, len, from, from_len,
- addr_len);
- } else {
- ret = 0;
-
- ut_error;
- }
-
- return(ret);
-}
-
-/*************************************************************************
-Sends a datagram to the specified destination. */
-
-ulint
-com_sendto(
-/*=======*/
- /* out: 0 if succeed, else error number */
- com_endpoint_t* ep, /* in: communications endpoint */
- byte* buf, /* in: datagram buffer */
- ulint len, /* in: datagram length */
- char* to, /* in: address name buffer */
- ulint tolen) /* in: address name length */
-{
- ulint type;
- ulint ret;
- void* par;
-
- if (!com_endpoint_get_bound(ep)) {
- return(COM_ERR_NOT_BOUND);
- }
-
- type = com_endpoint_get_type(ep);
- par = com_endpoint_get_par(ep);
-
- if (type == COM_SHM) {
- ret = com_shm_sendto((com_shm_endpoint_t*)par, buf, len,
- to, tolen);
- } else {
- ret = 0;
- ut_error;
- }
-
- return(ret);
-}
-
-/*************************************************************************
-Gets the maximum datagram size for an endpoint. */
-
-ulint
-com_endpoint_get_max_size(
-/*======================*/
- /* out: maximum size */
- com_endpoint_t* ep) /* in: endpoint */
-{
- ulint type;
- ulint ret;
- void* par;
-
- type = com_endpoint_get_type(ep);
- par = com_endpoint_get_par(ep);
-
- if (type == COM_SHM) {
- ret = com_shm_endpoint_get_size((com_shm_endpoint_t*)par);
- } else {
- ret = 0;
- ut_error;
- }
-
- return(ret);
-}
diff --git a/innobase/com/com0shm.c b/innobase/com/com0shm.c
deleted file mode 100644
index 834ba3a5220..00000000000
--- a/innobase/com/com0shm.c
+++ /dev/null
@@ -1,1163 +0,0 @@
-/******************************************************
-The communication through shared memory
-
-(c) 1995 Innobase Oy
-
-Created 9/25/1995 Heikki Tuuri
-*******************************************************/
-
-#include "com0shm.h"
-#ifdef UNIV_NONINL
-#include "com0shm.ic"
-#endif
-
-#include "mem0mem.h"
-#include "ut0mem.h"
-#include "com0com.h"
-#include "os0shm.h"
-#include "sync0sync.h"
-#include "sync0ipm.h"
-#include "hash0hash.h"
-
-/*
- IMPLEMENTATION OF COMMUNICATION PRIMITIVES
- ==========================================
-
-When bind is called for an endpoint, a shared memory area of
-a size specified by com_shm_set_option is created with the
-name of the address given concatenated to "_IBSHM".
-Also a mutex is created for controlling the access to the
-shared memory area. The name of the mutex is address + "_IBSHM_MTX".
-An event with name address + "_IBSHM_EV_NE" is created. This event
-is in signaled state when the shared memory area is not empty, i.e.,
-there is a datagram to read. An event address + "_IBSHM_EV_EM"
-is signaled, when the area is empty, i.e., a datagram can be
-written to it.
-
-The shared memory area consists of an info struct
-at the beginning, containing fields telling:
-if the area is valid, i.e., is anybody going to
-read it, whether it currently contains a datagram, the
-length of the address from which the datagram was received,
-the length of the datagram, and the maximum allowed length of
-a datagram.
-After the info struct, there is a string of bytes
-containing the sender address and the data
-of the datagram.
-*/
-
-/* The following is set TRUE when the first endpoint is created. */
-
-ibool com_shm_initialized = FALSE;
-
-/* When a datagram is sent, the shared memory area
-corresponding to the destination address is mapped
-to the address space of this (sender) process.
-We preserve it and keep the relevant info in the
-following list. We can save a lot of CPU time
-if the destination can be found on the list. The list is
-protected by the mutex below. */
-
-mutex_t com_shm_destination_mutex;
-hash_table_t* com_shm_destination_cache;
-UT_LIST_BASE_NODE_T(com_shm_endpoint_t)
- com_shm_destination_list;
-
-/* The number of successfully bound endpoints in this process. When this
-number drops to 0, the destination cache is freed. This variable is protected
-by com_shm_destination_mutex above. */
-
-ulint com_shm_bind_count = 0;
-
-/* The performance of communication in NT depends on how
-many times a system call is made (excluding os_thread_yield,
-as that is the fastest way to switch thread).
-The following variable counts such events. */
-
-ulint com_shm_system_call_count = 0;
-
-/* The info struct at the beginning of a shared memory area */
-
-typedef struct com_shm_info_struct com_shm_info_t;
-
-/* An area of shared memory consists of an info struct followed
-by a string of bytes. */
-
-typedef com_shm_info_t com_shm_t;
-
-struct com_shm_endpoint_struct{
- ibool owns_shm; /* This is true if the shared memory
- area is owned by this endpoint structure
- (it may also be opened for this endpoint,
- not created, in which case does not own it) */
- char* addr; /* pointer to address the endpoint is bound
- to, NULL if not bound */
- ulint addr_len; /* address length */
- ulint size; /* maximum allowed datagram size, initialized
- to 0 at creation */
- os_shm_t shm; /* operating system handle of the shared
- memory area */
- com_shm_t* map; /* pointer to the start address of the shared
- memory area */
- os_event_t not_empty; /* this is in the signaled state if
- the area currently may contain a datagram;
- NOTE: automatic event */
- os_event_t empty; /* this is in the signaled state if the area
- currently may be empty; NOTE: automatic
- event */
- ip_mutex_hdl_t* ip_mutex; /* handle to the interprocess mutex
- protecting the shared memory */
- UT_LIST_NODE_T(com_shm_endpoint_t) list; /* If the endpoint struct
- is inserted into a list, this contains
- pointers to next and prev */
- com_shm_endpoint_t* addr_hash;
- /* hash table link */
-};
-
-struct com_shm_info_struct{
- ulint valid; /* This is COM_SHM_VALID if the creator
- of the shared memory area has it still
- mapped to its address space. Otherwise,
- we may conclude that the datagram cannot
- be delivered. */
- ibool not_empty; /* TRUE if the area currently contains
- a datagram */
- ulint empty_waiters; /* Count of (writer) threads which are
- waiting for the empty-event */
- ulint max_len;/* maximum allowed length for a datagram */
- ulint addr_len;/* address length for the sender address */
- ulint data_len;/* datagram length */
- ip_mutex_t ip_mutex;/* fast interprocess mutex protecting
- the shared memory area */
-};
-
-#define COM_SHM_VALID 76640
-
-/*************************************************************************
-Accessor functions for a shared memory endpoint */
-
-UNIV_INLINE
-ibool
-com_shm_endpoint_get_owns_shm(
-/*==========================*/
- com_shm_endpoint_t* ep)
-{
- ut_ad(ep);
- return(ep->owns_shm);
-}
-
-UNIV_INLINE
-void
-com_shm_endpoint_set_owns_shm(
-/*==========================*/
- com_shm_endpoint_t* ep,
- ibool flag)
-{
- ut_ad(ep);
-
- ep->owns_shm = flag;
-}
-
-UNIV_INLINE
-char*
-com_shm_endpoint_get_addr(
-/*======================*/
- com_shm_endpoint_t* ep)
-{
- ut_ad(ep);
- return(ep->addr);
-}
-
-UNIV_INLINE
-void
-com_shm_endpoint_set_addr(
-/*======================*/
- com_shm_endpoint_t* ep,
- char* addr)
-{
- ut_ad(ep);
-
- ep->addr = addr;
-}
-
-UNIV_INLINE
-ulint
-com_shm_endpoint_get_addr_len(
-/*==========================*/
- com_shm_endpoint_t* ep)
-{
- return(ep->addr_len);
-}
-
-UNIV_INLINE
-void
-com_shm_endpoint_set_addr_len(
-/*==========================*/
- com_shm_endpoint_t* ep,
- ulint len)
-{
- ut_ad(ep);
- ut_ad(len > 0);
-
- ep->addr_len = len;
-}
-
-ulint
-com_shm_endpoint_get_size(
-/*======================*/
- com_shm_endpoint_t* ep)
-{
- return(ep->size);
-}
-
-UNIV_INLINE
-void
-com_shm_endpoint_set_size(
-/*======================*/
- com_shm_endpoint_t* ep,
- ulint size)
-{
- ut_ad(ep);
-
- ep->size = size;
-}
-
-UNIV_INLINE
-os_shm_t
-com_shm_endpoint_get_shm(
-/*=====================*/
- com_shm_endpoint_t* ep)
-{
- return(ep->shm);
-}
-
-UNIV_INLINE
-void
-com_shm_endpoint_set_shm(
-/*=====================*/
- com_shm_endpoint_t* ep,
- os_shm_t shm)
-{
- ut_ad(ep);
- ut_ad(shm);
-
- ep->shm = shm;
-}
-
-UNIV_INLINE
-com_shm_t*
-com_shm_endpoint_get_map(
-/*=====================*/
- com_shm_endpoint_t* ep)
-{
- return(ep->map);
-}
-
-UNIV_INLINE
-void
-com_shm_endpoint_set_map(
-/*=====================*/
- com_shm_endpoint_t* ep,
- com_shm_t* map)
-{
- ut_ad(ep);
- ut_ad(map);
-
- ep->map = map;
-}
-
-UNIV_INLINE
-os_event_t
-com_shm_endpoint_get_empty(
-/*=======================*/
- com_shm_endpoint_t* ep)
-{
- return(ep->empty);
-}
-
-UNIV_INLINE
-void
-com_shm_endpoint_set_empty(
-/*=======================*/
- com_shm_endpoint_t* ep,
- os_event_t event)
-{
- ut_ad(ep);
- ut_ad(event);
-
- ep->empty = event;
-}
-
-UNIV_INLINE
-os_event_t
-com_shm_endpoint_get_not_empty(
-/*===========================*/
- com_shm_endpoint_t* ep)
-{
- return(ep->not_empty);
-}
-
-UNIV_INLINE
-void
-com_shm_endpoint_set_not_empty(
-/*===========================*/
- com_shm_endpoint_t* ep,
- os_event_t event)
-{
- ut_ad(ep);
- ut_ad(event);
-
- ep->not_empty = event;
-}
-
-/************************************************************************
-Accessor functions for the shared memory area info struct. */
-UNIV_INLINE
-ulint
-com_shm_get_valid(
-/*==============*/
- com_shm_info_t* info)
-{
- return(info->valid);
-}
-
-UNIV_INLINE
-void
-com_shm_set_valid(
-/*==============*/
- com_shm_info_t* info,
- ulint flag)
-{
- ut_ad(info);
-
- info->valid = flag;
-}
-
-UNIV_INLINE
-ibool
-com_shm_get_not_empty(
-/*==================*/
- com_shm_info_t* info)
-{
- return(info->not_empty);
-}
-
-UNIV_INLINE
-void
-com_shm_set_not_empty(
-/*==================*/
- com_shm_info_t* info,
- ibool flag)
-{
- ut_ad(info);
-
- info->not_empty = flag;
-}
-
-UNIV_INLINE
-ulint
-com_shm_get_empty_waiters(
-/*======================*/
- com_shm_info_t* info)
-{
- ut_ad(info->empty_waiters < 1000);
-
- return(info->empty_waiters);
-}
-
-UNIV_INLINE
-void
-com_shm_set_empty_waiters(
-/*======================*/
- com_shm_info_t* info,
- ulint count)
-{
- ut_ad(info);
- ut_ad(count < 1000);
-
- info->empty_waiters = count;
-}
-
-UNIV_INLINE
-ulint
-com_shm_get_max_len(
-/*================*/
- com_shm_info_t* info)
-{
- return(info->max_len);
-}
-
-UNIV_INLINE
-void
-com_shm_set_max_len(
-/*================*/
- com_shm_info_t* info,
- ulint len)
-{
- ut_ad(info);
- ut_ad(len > 0);
-
- info->max_len = len;
-}
-
-UNIV_INLINE
-ulint
-com_shm_get_addr_len(
-/*=================*/
- com_shm_info_t* info)
-{
- return(info->addr_len);
-}
-
-UNIV_INLINE
-void
-com_shm_set_addr_len(
-/*=================*/
- com_shm_info_t* info,
- ulint len)
-{
- ut_ad(info);
- ut_ad(len > 0);
-
- info->addr_len = len;
-}
-
-UNIV_INLINE
-ulint
-com_shm_get_data_len(
-/*=================*/
- com_shm_info_t* info)
-{
- return(info->data_len);
-}
-
-UNIV_INLINE
-void
-com_shm_set_data_len(
-/*=================*/
- com_shm_info_t* info,
- ulint len)
-{
- ut_ad(info);
- ut_ad(len > 0);
-
- info->data_len = len;
-}
-
-UNIV_INLINE
-ip_mutex_t*
-com_shm_get_ip_mutex(
-/*=================*/
- com_shm_info_t* info)
-{
- return(&(info->ip_mutex));
-}
-
-/*************************************************************************
-Accessor functions for the address and datagram fields inside a
-shared memory area. */
-
-UNIV_INLINE
-char*
-com_shm_get_addr(
-/*=============*/
- com_shm_t* area)
-{
- return((char*)area + sizeof(com_shm_info_t));
-}
-
-UNIV_INLINE
-byte*
-com_shm_get_data(
-/*=============*/
- com_shm_t* area)
-{
- return((byte*)com_shm_get_addr(area) + com_shm_get_addr_len(area));
-}
-
-/*************************************************************************
-Initializes the shared memory communication system for this
-process. */
-UNIV_INLINE
-void
-com_shm_init(void)
-/*==============*/
-{
- mutex_create(&com_shm_destination_mutex);
-
- mutex_set_level(&com_shm_destination_mutex, SYNC_ANY_LATCH);
-
- com_shm_destination_cache = hash_create(1000);
-
- UT_LIST_INIT(com_shm_destination_list);
-
- com_shm_initialized = TRUE;
-}
-
-/*************************************************************************
-Reserves the ip mutex of the shared memory area of an endpoint. */
-UNIV_INLINE
-void
-com_shm_enter(
-/*==========*/
- com_shm_endpoint_t* ep)
-{
- ulint ret;
-
- ret = ip_mutex_enter(ep->ip_mutex, 10000000);
-
- if (ret != 0) {
- mutex_list_print_info();
-
- ut_error;
- }
-}
-
-/*************************************************************************
-Releases the ip mutex of the shared memory area of an endpoint. */
-UNIV_INLINE
-void
-com_shm_exit(
-/*=========*/
- com_shm_endpoint_t* ep)
-{
- ip_mutex_exit(ep->ip_mutex);
-}
-
-/*************************************************************************
-Looks for the given address in the cached destination addresses. */
-UNIV_INLINE
-com_shm_endpoint_t*
-com_shm_destination_cache_search(
-/*=============================*/
- /* out: cached endpoint structure if found, else NULL */
- char* addr, /* in: destination address */
- ulint len) /* in: address length */
-{
- com_shm_endpoint_t* ep;
- ulint fold;
-
- fold = ut_fold_binary((byte*)addr, len);
-/*
- printf("Searching dest. cache %s %lu fold %lu\n", addr, len, fold);
-*/
- mutex_enter(&com_shm_destination_mutex);
-
- HASH_SEARCH(addr_hash, com_shm_destination_cache, fold, ep,
- ((ep->addr_len == len)
- && (0 == ut_memcmp(addr, ep->addr, len))));
-
- mutex_exit(&com_shm_destination_mutex);
-
- return(ep);
-}
-
-/*************************************************************************
-Inserts the given endpoint structure in the cached destination addresses. */
-static
-void
-com_shm_destination_cache_insert(
-/*=============================*/
- com_shm_endpoint_t* ep) /* in: endpoint struct to insert */
-{
- ulint fold;
-
- fold = ut_fold_binary((byte*)(ep->addr), ep->addr_len);
-
- mutex_enter(&com_shm_destination_mutex);
-
- /* Add to hash table */
- HASH_INSERT(com_shm_endpoint_t,
- addr_hash, com_shm_destination_cache, fold, ep);
-
- UT_LIST_ADD_LAST(list, com_shm_destination_list, ep);
-
-/* printf("Inserting to dest. cache %s %lu fold %lu\n", ep->addr,
- ep->addr_len, fold);
-*/
- mutex_exit(&com_shm_destination_mutex);
-}
-
-/*************************************************************************
-Frees the endpoint structs in the destination cache if the bind count is zero.
-If it is not, some send operation may just be using a cached endpoint and it
-cannot be freed. */
-static
-void
-com_shm_destination_cache_no_binds(void)
-/*====================================*/
-{
- com_shm_endpoint_t* ep;
- ulint fold;
-
- mutex_enter(&com_shm_destination_mutex);
-
- if (com_shm_bind_count != 0) {
- mutex_exit(&com_shm_destination_mutex);
-
- return;
- }
-
- while (UT_LIST_GET_LEN(com_shm_destination_list) != 0) {
-
- ep = UT_LIST_GET_FIRST(com_shm_destination_list);
-
- UT_LIST_REMOVE(list, com_shm_destination_list, ep);
-
- fold = ut_fold_binary((byte*)ep->addr, ep->addr_len);
-/*
- printf("Deleting from dest. cache %s %lu fold %lu\n",
- ep->addr,
- ep->addr_len, fold);
-*/
- HASH_DELETE(com_shm_endpoint_t, addr_hash,
- com_shm_destination_cache, fold, ep);
-
- com_shm_endpoint_free(ep);
- }
-
- mutex_exit(&com_shm_destination_mutex);
-}
-
-/***********************************************************************
-Unbinds an endpoint at the time of freeing. */
-static
-void
-com_shm_unbind(
-/*===========*/
- com_shm_endpoint_t* ep) /* in: endpoint */
-{
- com_shm_t* map;
-
- map = com_shm_endpoint_get_map(ep);
-
- /* Mark the shared memory area invalid */
-
- com_shm_set_valid(map, 0);
-
- /* Decrement the count of bindings */
-
- mutex_enter(&com_shm_destination_mutex);
-
- com_shm_bind_count--;
-
- mutex_exit(&com_shm_destination_mutex);
-
- /* If there are no binds left, free the cached endpoints */
-
- com_shm_destination_cache_no_binds();
-}
-
-/*************************************************************************
-Creates a communications endpoint. */
-
-com_shm_endpoint_t*
-com_shm_endpoint_create(void)
-/*=========================*/
- /* out, own: communications endpoint, NULL if
- did not succeed */
-{
- com_shm_endpoint_t* ep;
-
- if (!com_shm_initialized) {
-
- com_shm_init();
- }
-
- ep = mem_alloc(sizeof(com_shm_endpoint_t));
-
- com_shm_endpoint_set_owns_shm(ep, FALSE);
- com_shm_endpoint_set_addr(ep, NULL);
- com_shm_endpoint_set_size(ep, 0);
-
- return(ep);
-}
-
-/*************************************************************************
-Frees a communications endpoint. */
-
-ulint
-com_shm_endpoint_free(
-/*==================*/
- /* out: O if succeed, else error number */
- com_shm_endpoint_t* ep) /* in, own: communications endpoint */
-{
- com_shm_t* map;
-
- ut_ad(ep);
-
- if (com_shm_endpoint_get_addr(ep) != NULL) {
-
- map = com_shm_endpoint_get_map(ep);
-
- if (com_shm_endpoint_get_owns_shm(ep)) {
-
- com_shm_unbind(ep);
- }
-
- /* We do not destroy the data structures in the shared memory
- area, because we cannot be sure that there is currently no
- process accessing it. Therefore we just close the ip_mutex
- residing in the area. */
-
- ip_mutex_close(ep->ip_mutex);
-
- os_event_free(com_shm_endpoint_get_not_empty(ep));
- os_event_free(com_shm_endpoint_get_empty(ep));
-
- os_shm_unmap(map);
- os_shm_free(com_shm_endpoint_get_shm(ep));
-
- mem_free(com_shm_endpoint_get_addr(ep));
- }
-
- mem_free(ep);
-
- return(0);
-}
-
-/*************************************************************************
-Sets an option, like the maximum datagram size for an endpoint.
-The options may vary depending on the endpoint type. */
-
-ulint
-com_shm_endpoint_set_option(
-/*========================*/
- /* out: 0 if succeed, else error number */
- com_shm_endpoint_t* ep, /* in: endpoint */
- ulint optno, /* in: option number, only
- COM_OPT_MAX_DGRAM_SIZE currently supported */
- byte* optval, /* in: pointer to a buffer containing the
- option value to set */
- ulint optlen) /* in: option value buffer length */
-{
- ulint size;
-
- UT_NOT_USED(optlen);
-
- ut_ad(ep);
- ut_a(optno == COM_OPT_MAX_DGRAM_SIZE);
- ut_ad(NULL == com_shm_endpoint_get_addr(ep));
-
- size = *((ulint*)optval);
-
- ut_ad(size > 0);
-
- com_shm_endpoint_set_size(ep, size);
-
- return(0);
-}
-
-/*************************************************************************
-This function is used either to create a new shared memory area or open an
-existing one, but this does not do the operations necessary with the ip mutex.
-They are performed in com_shm_bind or com_shm_open which call this function. */
-static
-ulint
-com_shm_create_or_open(
-/*===================*/
- /* out: 0 if succeed, else error number */
- com_shm_endpoint_t* ep, /* in: communications endpoint */
- char* name, /* in: address name */
- ulint len) /* in: address name length */
-{
- os_shm_t shm;
- com_shm_t* map;
- os_event_t event_ne;
- os_event_t event_em;
- char* buf;
-
- ut_ad(ep);
- ut_ad(name);
- ut_ad(len > 0);
-
- buf = mem_alloc(COM_MAX_ADDR_LEN + 20);
-
- ut_memcpy(buf, name, len);
-
- ut_strcpy(buf + len, (char*)"_IBSHM");
-
- shm = os_shm_create(sizeof(com_shm_info_t) + COM_MAX_ADDR_LEN +
- com_shm_endpoint_get_size(ep), buf);
- if (shm == NULL) {
-
- return(COM_ERR_NOT_SPECIFIED);
- }
-
- map = os_shm_map(shm);
-
- if (map == NULL) {
- os_shm_free(shm);
-
- return(COM_ERR_NOT_SPECIFIED);
- }
-
- ut_strcpy(buf + len, (char*)"_IBSHM_EV_NE"),
-
- event_ne = os_event_create(buf);
-
- ut_ad(event_ne);
-
- ut_strcpy(buf + len, (char*)"_IBSHM_EV_EM"),
-
- event_em = os_event_create(buf);
-
- ut_ad(event_em);
-
- ut_a(0); /* event_ne and event_em should be auto events! */
-
- com_shm_endpoint_set_shm(ep, shm);
- com_shm_endpoint_set_map(ep, map);
-
- com_shm_endpoint_set_not_empty(ep, event_ne);
- com_shm_endpoint_set_empty(ep, event_em);
-
- com_shm_endpoint_set_addr(ep, buf);
- com_shm_endpoint_set_addr_len(ep, len);
-
- return(0);
-}
-
-/*************************************************************************
-Opens a shared memory area for communication. */
-static
-ulint
-com_shm_open(
-/*=========*/
- /* out: 0 if succeed, else error number */
- com_shm_endpoint_t* ep, /* in: communications endpoint */
- char* name, /* in: address name */
- ulint len) /* in: address name length */
-{
- ip_mutex_hdl_t* ip_hdl;
- com_shm_t* map;
- ulint ret;
- char buf[COM_MAX_ADDR_LEN + 20];
-
- ret = com_shm_create_or_open(ep, name, len);
-
- if (ret != 0) {
-
- return(ret);
- }
-
- map = com_shm_endpoint_get_map(ep);
-
- /* Open the interprocess mutex to protect the shared memory area */
-
- ut_memcpy(buf, name, len);
- ut_strcpy(buf + len, (char*)"_IBSHM_MTX");
-
- ret = ip_mutex_open(com_shm_get_ip_mutex(map), buf, &ip_hdl);
-
- if (ret != 0) {
-
- return(COM_ERR_NOT_SPECIFIED);
- }
-
- ep->ip_mutex = ip_hdl;
-
- return(0);
-}
-
-/*************************************************************************
-Creates a shared memory area for communication. */
-
-ulint
-com_shm_bind(
-/*=========*/
- /* out: 0 if succeed, else error number */
- com_shm_endpoint_t* ep, /* in: communications endpoint */
- char* name, /* in: address name */
- ulint len) /* in: address name length */
-{
- com_shm_t* map;
- ulint ret;
- char buf[COM_MAX_ADDR_LEN + 20];
- ip_mutex_hdl_t* ip_hdl;
-
- if (com_shm_endpoint_get_size(ep) == 0) {
-
- return(COM_ERR_MAX_DATAGRAM_SIZE_NOT_SET);
- }
-
- ret = com_shm_create_or_open(ep, name, len);
-
- if (ret != 0) {
-
- return(ret);
- }
-
- map = com_shm_endpoint_get_map(ep);
-
- /* Create the interprocess mutex to protect the shared memory area */
-
- ut_memcpy(buf, name, len);
- ut_strcpy(buf + len, (char*)"_IBSHM_MTX");
-
- ret = ip_mutex_create(com_shm_get_ip_mutex(map), buf, &ip_hdl);
-
- if (ret != 0) {
-
- return(COM_ERR_NOT_SPECIFIED);
- }
-
- /* This endpoint structure owns the shared memory area */
-
- com_shm_endpoint_set_owns_shm(ep, TRUE);
- ep->ip_mutex = ip_hdl;
-
- mutex_enter(&com_shm_destination_mutex);
-
- /* Increment the count of successful bindings */
-
- com_shm_bind_count++;
-
- mutex_exit(&com_shm_destination_mutex);
-
- com_shm_set_not_empty(map, FALSE);
- com_shm_set_empty_waiters(map, 0);
- com_shm_set_max_len(map, com_shm_endpoint_get_size(ep));
-
- com_shm_set_valid(map, COM_SHM_VALID);
-
- os_event_set(com_shm_endpoint_get_empty(ep));
-
- return(0);
-}
-
-/*************************************************************************
-Waits for a datagram to arrive at an endpoint. */
-
-ulint
-com_shm_recvfrom(
-/*=============*/
- /* out: 0 if succeed, else error number */
- com_shm_endpoint_t* ep, /* in: communications endpoint */
- byte* buf, /* out: datagram buffer; the buffer is
- supplied by the caller */
- ulint buf_len,/* in: datagram buffer length */
- ulint* len, /* out: datagram length */
- char* from, /* out: address name buffer; the buffer is
- supplied by the caller */
- ulint from_len,/* in: address name buffer length */
- ulint* addr_len)/* out: address name length */
-{
- com_shm_t* map;
- ulint loop_count;
-
- map = com_shm_endpoint_get_map(ep);
-
- loop_count = 0;
-loop:
- com_shm_system_call_count++;
-
- /* NOTE: automatic event */
-
- os_event_wait(com_shm_endpoint_get_not_empty(ep));
-
- loop_count++;
-
- if (loop_count > 1) {
- printf("!!!!!!!!COM_SHM loop count %lu\n", (ulong) loop_count);
- }
-
- ut_ad(loop_count < 2);
-
-#ifdef notdefined
- if (!com_shm_get_not_empty(map)) {
-
- /* There was no datagram, give up the time slice
- for some writer thread to insert a datagram */
-
- com_shm_exit(ep);
-
- os_thread_yield();
-
- com_shm_enter(ep);
- }
-#endif
- com_shm_enter(ep);
-
- if (!com_shm_get_not_empty(map)) {
- /* There was no datagram, wait for the event */
-
- com_shm_exit(ep);
-
- goto loop;
- }
-
- if (com_shm_get_data_len(map) > buf_len) {
-
- com_shm_exit(ep);
-
- return(COM_ERR_DATA_BUFFER_TOO_SMALL);
- }
-
- if (com_shm_get_addr_len(map) > from_len) {
-
- com_shm_exit(ep);
-
- return(COM_ERR_ADDR_BUFFER_TOO_SMALL);
- }
-
- *len = com_shm_get_data_len(map);
- *addr_len = com_shm_get_addr_len(map);
-
- ut_memcpy(buf, com_shm_get_data(map), *len);
- ut_memcpy(from, com_shm_get_addr(map), *addr_len);
-
- com_shm_set_not_empty(map, FALSE);
-
- /* If there may be writers queuing to insert the datagram, signal the
- empty-event */
-
- if (com_shm_get_empty_waiters(map) != 0) {
-
- com_shm_system_call_count++;
-
- os_event_set(com_shm_endpoint_get_empty(ep));
- }
-
- com_shm_exit(ep);
-
- return(0);
-}
-
-/*************************************************************************
-Sends a datagram to the specified destination. */
-
-ulint
-com_shm_sendto(
-/*===========*/
- /* out: 0 if succeed, else error number */
- com_shm_endpoint_t* ep, /* in: communications endpoint */
- byte* buf, /* in: datagram buffer */
- ulint len, /* in: datagram length */
- char* to, /* in: address name buffer */
- ulint tolen) /* in: address name length */
-{
- com_shm_endpoint_t* ep2;
- com_shm_t* map;
- ulint sender_len;
- ulint ret;
- ulint loop_count;
-
- /* Try first to find from the cached destination addresses */
-
- ep2 = com_shm_destination_cache_search(to, tolen);
-
- if (ep2 == NULL) {
- /* Did not find it in the cache */
- ep2 = com_shm_endpoint_create();
-
- ret = com_shm_open(ep2, to, tolen);
-
- if (ret != 0) {
- com_shm_endpoint_free(ep2);
-
- return(ret);
- }
-
- /* Insert into the cached destination addresses */
-
- com_shm_destination_cache_insert(ep2);
- }
-
- map = com_shm_endpoint_get_map(ep2);
-
- if (com_shm_get_valid(map) != COM_SHM_VALID) {
-
- com_shm_exit(ep2);
-
- return(COM_ERR_DGRAM_NOT_DELIVERED);
- }
-
- if (com_shm_get_max_len(map) < len) {
-
- com_shm_exit(ep2);
-
- return(COM_ERR_DATA_TOO_LONG);
- }
-
- /* Optimistically, we first go to see if the datagram area is empty,
- without waiting for the empty-event */
-
- loop_count = 0;
-loop:
- loop_count++;
-
- if (loop_count > 5) {
- printf("!!!!!!COM_SHM Notempty loop count %lu\n",
- (ulong) loop_count);
- }
-
- ut_ad(loop_count < 100);
-
- com_shm_enter(ep2);
-
- if (com_shm_get_not_empty(map)) {
-
- /* Not empty, we cannot insert a datagram */
-
- com_shm_set_empty_waiters(map,
- 1 + com_shm_get_empty_waiters(map));
- com_shm_exit(ep2);
-
- com_shm_system_call_count++;
-
- /* Wait for the area to become empty */
- /* NOTE: automatic event */
-
- ret = os_event_wait_time(com_shm_endpoint_get_empty(ep2),
- 10000000);
- ut_a(ret == 0);
-
- com_shm_enter(ep2);
-
- com_shm_set_empty_waiters(map,
- com_shm_get_empty_waiters(map) - 1);
- com_shm_exit(ep2);
-
- goto loop;
- }
-
- sender_len = com_shm_endpoint_get_addr_len(ep);
-
- com_shm_set_data_len(map, len);
- com_shm_set_addr_len(map, sender_len);
-
- ut_memcpy(com_shm_get_data(map), buf, len);
- ut_memcpy(com_shm_get_addr(map), com_shm_endpoint_get_addr(ep),
- sender_len);
- com_shm_set_not_empty(map, TRUE);
-#ifdef notdefined
- com_shm_exit(ep2);
-
- /* Now we give up our time slice voluntarily to give some reader
- thread chance to fetch the datagram */
-
- os_thread_yield();
-
- com_shm_enter(ep2);
-
- if (com_shm_get_not_empty(map)) {
-#endif
- com_shm_system_call_count++;
-
- com_shm_exit(ep2);
-
- /* Signal the event */
-
- os_event_set(com_shm_endpoint_get_not_empty(ep2));
-
- return(0);
-
-#ifdef notdefined
- }
-
- com_shm_exit(ep2);
-
- return(0);
-#endif
-}
diff --git a/innobase/com/makefilewin b/innobase/com/makefilewin
deleted file mode 100644
index 0d2d6d45952..00000000000
--- a/innobase/com/makefilewin
+++ /dev/null
@@ -1,12 +0,0 @@
-include ..\include\makefile.i
-
-com.lib: com0com.obj com0shm.obj
- lib -out:..\libs\com.lib com0com.obj com0shm.obj
-
-com0com.obj: com0com.c
- $(CCOM) $(CFL) -c com0com.c
-
-com0shm.obj: com0shm.c
- $(CCOM) $(CFL) -c com0shm.c
-
-
diff --git a/innobase/com/ts/makefile b/innobase/com/ts/makefile
deleted file mode 100644
index 01c14737c78..00000000000
--- a/innobase/com/ts/makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-include ..\..\makefile.i
-
-doall: tscom tscli
-
-tscom: ..\com.lib tscom.c makefile
- $(CCOM) $(CFL) -I.. -I..\.. ..\com.lib ..\..\ut.lib ..\..\mem.lib ..\..\sync.lib ..\..\os.lib tscom.c $(LFL)
-
-tscli: ..\com.lib tscli.c makefile
- $(CCOM) $(CFL) -I.. -I..\.. ..\com.lib ..\..\ut.lib ..\..\mem.lib ..\..\sync.lib ..\..\os.lib tscli.c $(LFL)
-
-
-
-
-
-
-
diff --git a/innobase/com/ts/tscli.c b/innobase/com/ts/tscli.c
deleted file mode 100644
index 27a787a0e5c..00000000000
--- a/innobase/com/ts/tscli.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/************************************************************************
-The test module for communication
-
-(c) 1995 Innobase Oy
-
-Created 9/26/1995 Heikki Tuuri
-*************************************************************************/
-
-#include "../com0com.h"
-#include "../com0shm.h"
-#include "ut0ut.h"
-#include "mem0mem.h"
-#include "os0thread.h"
-#include "sync0ipm.h"
-#include "sync0sync.h"
-
-byte buf[10000];
-char addr[150];
-
-void
-test1(void)
-/*=======*/
-{
- com_endpoint_t* ep;
- ulint ret;
- ulint size;
- ulint len;
- ulint addr_len;
- ulint i;
-
- ep = com_endpoint_create(COM_SHM);
-
- ut_a(ep);
-
- size = 8192;
-
- ret = com_endpoint_set_option(ep, COM_OPT_MAX_DGRAM_SIZE,
- (byte*)&size, 0);
-
- ut_a(ret == 0);
-
- ret = com_bind(ep, "CLI", 3);
-
- ut_a(ret == 0);
-
- printf("Client endpoint created!\n");
-
- for (i = 0; i < 10000; i++) {
-
- ret = com_sendto(ep, (byte*)"Hello from client!\n", 18, "SRV", 3);
-
- ut_a(ret == 0);
-
- ret = com_recvfrom(ep, buf, 10000, &len, addr, 150, &addr_len);
-
- ut_a(ret == 0);
-
- buf[len] = '\0';
- addr[addr_len] = '\0';
-/*
- printf(
- "Message of len %lu\n%s \nreceived from address %s of len %lu\n",
- len, buf, addr, addr_len);
-*/
- }
-
- ret = com_endpoint_free(ep);
-
- ut_ad(ret == 0);
-
-
- printf("Count of extra system calls in com_shm %lu\n",
- com_shm_system_call_count);
- printf("Count of extra system calls in ip_mutex %lu\n",
- ip_mutex_system_call_count);
-}
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
-
- sync_init();
- mem_init();
-
- oldtm = ut_clock();
-
- test1();
-
- ut_ad(mem_all_freed());
-
- tm = ut_clock();
- printf("Wall clock time for test %ld milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/com/ts/tscom.c b/innobase/com/ts/tscom.c
deleted file mode 100644
index a02db40efa7..00000000000
--- a/innobase/com/ts/tscom.c
+++ /dev/null
@@ -1,94 +0,0 @@
-/************************************************************************
-The test module for communication
-
-(c) 1995 Innobase Oy
-
-Created 9/26/1995 Heikki Tuuri
-*************************************************************************/
-
-#include "../com0com.h"
-#include "../com0shm.h"
-#include "ut0ut.h"
-#include "mem0mem.h"
-#include "os0thread.h"
-#include "sync0ipm.h"
-#include "sync0sync.h"
-
-byte buf[10000];
-char addr[150];
-
-void
-test1(void)
-/*=======*/
-{
- com_endpoint_t* ep;
- ulint ret;
- ulint size;
- ulint len;
- ulint addr_len;
- ulint i;
-
- ep = com_endpoint_create(COM_SHM);
-
- ut_a(ep);
-
- size = 8192;
-
- ret = com_endpoint_set_option(ep, COM_OPT_MAX_DGRAM_SIZE,
- (byte*)&size, 0);
-
- ut_a(ret == 0);
-
- ret = com_bind(ep, "SRV", 3);
-
- ut_a(ret == 0);
-
- printf("Server endpoint created!\n");
-
- for (i = 0; i < 50000; i++) {
-
- ret = com_recvfrom(ep, buf, 10000, &len, addr, 150, &addr_len);
-
- ut_a(ret == 0);
-
- buf[len] = '\0';
- addr[addr_len] = '\0';
-/*
- printf(
- "Message of len %lu\n%s \nreceived from address %s of len %lu\n",
- len, buf, addr, addr_len);
-*/
- ret = com_sendto(ep, (byte*)"Hello from server!\n", 18, "CLI", 3);
-
- ut_a(ret == 0);
- }
-
- ret = com_endpoint_free(ep);
-
- ut_ad(ret == 0);
-
- printf("Count of extra system calls in com_shm %lu\n",
- com_shm_system_call_count);
- printf("Count of extra system calls in ip_mutex %lu\n",
- ip_mutex_system_call_count);
-}
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
-
- sync_init();
- mem_init();
-
- oldtm = ut_clock();
-
- test1();
-
- ut_ad(mem_all_freed());
-
- tm = ut_clock();
- printf("Wall clock time for test %ld milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/configure.in b/innobase/configure.in
index 9d57a0f2d91..652291f1f38 100644
--- a/innobase/configure.in
+++ b/innobase/configure.in
@@ -34,6 +34,7 @@ CXXFLAGS="$CXXFLAGS "
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_INSTALL
+AC_PROG_LIBTOOL
AC_CHECK_HEADERS(aio.h sched.h)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
@@ -112,12 +113,12 @@ case "$target" in
esac
AC_OUTPUT(Makefile os/Makefile ut/Makefile btr/Makefile dnl
- buf/Makefile com/Makefile data/Makefile dnl
+ buf/Makefile data/Makefile dnl
dict/Makefile dyn/Makefile dnl
eval/Makefile fil/Makefile fsp/Makefile fut/Makefile dnl
ha/Makefile ibuf/Makefile include/Makefile dnl
lock/Makefile log/Makefile dnl
- mach/Makefile mem/Makefile mtr/Makefile odbc/Makefile dnl
+ mach/Makefile mem/Makefile mtr/Makefile dnl
page/Makefile pars/Makefile que/Makefile dnl
read/Makefile rem/Makefile row/Makefile dnl
srv/Makefile sync/Makefile thr/Makefile trx/Makefile dnl
diff --git a/innobase/cry/makefilewin b/innobase/cry/makefilewin
deleted file mode 100644
index 9e791b8d073..00000000000
--- a/innobase/cry/makefilewin
+++ /dev/null
@@ -1,12 +0,0 @@
-include ..\include\makefile.i
-
-doall: cr.exe dcr.exe wro.exe
-
-cr.exe: cry0cry.c
- $(CCOM) $(CFLW) -o cr.exe -I.. cry0cry.c ..\ut.lib ..\os.lib
-
-dcr.exe: cry0dcr.c
- $(CCOM) $(CFLW) -o dcr.exe -I.. cry0dcr.c ..\ut.lib ..\os.lib
-
-wro.exe: cry0wro.c
- $(CCOM) $(CFLW) -o wro.exe -I.. cry0wro.c ..\ut.lib ..\os.lib
diff --git a/innobase/data/data0data.c b/innobase/data/data0data.c
index 78cee31a29d..0ed0efeb160 100644
--- a/innobase/data/data0data.c
+++ b/innobase/data/data0data.c
@@ -114,8 +114,8 @@ dtuple_datas_are_ordering_equal(
ulint i;
ut_ad(tuple1 && tuple2);
- ut_ad(tuple1->magic_n = DATA_TUPLE_MAGIC_N);
- ut_ad(tuple2->magic_n = DATA_TUPLE_MAGIC_N);
+ ut_ad(tuple1->magic_n == DATA_TUPLE_MAGIC_N);
+ ut_ad(tuple2->magic_n == DATA_TUPLE_MAGIC_N);
ut_ad(dtuple_check_typed(tuple1));
ut_ad(dtuple_check_typed(tuple2));
@@ -263,7 +263,7 @@ dfield_check_typed(
(ulong) dfield_get_type(field)->mtype,
(ulong) dfield_get_len(field));
- ut_a(0);
+ ut_error;
}
return(TRUE);
@@ -308,7 +308,7 @@ dtuple_validate(
ulint i;
ulint j;
- ut_a(tuple->magic_n = DATA_TUPLE_MAGIC_N);
+ ut_ad(tuple->magic_n == DATA_TUPLE_MAGIC_N);
n_fields = dtuple_get_n_fields(tuple);
@@ -727,416 +727,3 @@ dtuple_big_rec_free(
{
mem_heap_free(vector->heap);
}
-
-#ifdef notdefined
-
-/******************************************************************
-Generates random numbers, where 10/16 is uniformly
-distributed between 0 and n1, 5/16 between 0 and n2,
-and 1/16 between 0 and n3. */
-static
-ulint
-dtuple_gen_rnd_ulint(
-/*=================*/
- /* out: random ulint */
- ulint n1,
- ulint n2,
- ulint n3)
-{
- ulint m;
- ulint n;
-
- m = ut_rnd_gen_ulint() % 16;
-
- if (m < 10) {
- n = n1;
- } else if (m < 15) {
- n = n2;
- } else {
- n = n3;
- }
-
- m = ut_rnd_gen_ulint();
-
- return(m % n);
-}
-
-/***************************************************************
-Generates a random tuple. */
-
-dtuple_t*
-dtuple_gen_rnd_tuple(
-/*=================*/
- /* out: pointer to the tuple */
- mem_heap_t* heap) /* in: memory heap where generated */
-{
- ulint n_fields;
- dfield_t* field;
- ulint len;
- dtuple_t* tuple;
- ulint i;
- ulint j;
- byte* ptr;
-
- n_fields = dtuple_gen_rnd_ulint(5, 30, 300) + 1;
-
- tuple = dtuple_create(heap, n_fields);
-
- for (i = 0; i < n_fields; i++) {
-
- if (n_fields < 7) {
- len = dtuple_gen_rnd_ulint(5, 30, 400);
- } else {
- len = dtuple_gen_rnd_ulint(7, 5, 17);
- }
-
- field = dtuple_get_nth_field(tuple, i);
-
- if (len == 0) {
- dfield_set_data(field, NULL, UNIV_SQL_NULL);
- } else {
- ptr = mem_heap_alloc(heap, len);
- dfield_set_data(field, ptr, len - 1);
-
- for (j = 0; j < len; j++) {
- *ptr = (byte)(65 +
- dtuple_gen_rnd_ulint(22, 22, 22));
- ptr++;
- }
- }
-
- dtype_set(dfield_get_type(field), DATA_VARCHAR,
- DATA_ENGLISH, 500, 0);
- }
-
- ut_a(dtuple_validate(tuple));
-
- return(tuple);
-}
-
-/*******************************************************************
-Generates a test tuple for sort and comparison tests. */
-
-void
-dtuple_gen_test_tuple(
-/*==================*/
- dtuple_t* tuple, /* in/out: a tuple with 3 fields */
- ulint i) /* in: a number < 512 */
-{
- ulint j;
- dfield_t* field;
- void* data = NULL;
- ulint len = 0;
-
- for (j = 0; j < 3; j++) {
- switch (i % 8) {
- case 0:
- data = ""; len = 0; break;
- case 1:
- data = "A"; len = 1; break;
- case 2:
- data = "AA"; len = 2; break;
- case 3:
- data = "AB"; len = 2; break;
- case 4:
- data = "B"; len = 1; break;
- case 5:
- data = "BA"; len = 2; break;
- case 6:
- data = "BB"; len = 2; break;
- case 7:
- len = UNIV_SQL_NULL; break;
- }
-
- field = dtuple_get_nth_field(tuple, 2 - j);
-
- dfield_set_data(field, data, len);
- dtype_set(dfield_get_type(field), DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
-
- i = i / 8;
- }
-
- ut_ad(dtuple_validate(tuple));
-}
-
-/*******************************************************************
-Generates a test tuple for B-tree speed tests. */
-
-void
-dtuple_gen_test_tuple3(
-/*===================*/
- dtuple_t* tuple, /* in/out: a tuple with >= 3 fields */
- ulint i, /* in: a number < 1000000 */
- ulint type, /* in: DTUPLE_TEST_FIXED30, ... */
- byte* buf) /* in: a buffer of size >= 16 bytes */
-{
- dfield_t* field;
- ulint third_size;
-
- ut_ad(tuple && buf);
- ut_ad(i < 1000000);
-
- field = dtuple_get_nth_field(tuple, 0);
-
- ut_strcpy((char*)buf, "0000000");
-
- buf[1] = (byte)('0' + (i / 100000) % 10);
- buf[2] = (byte)('0' + (i / 10000) % 10);
- buf[3] = (byte)('0' + (i / 1000) % 10);
- buf[4] = (byte)('0' + (i / 100) % 10);
- buf[5] = (byte)('0' + (i / 10) % 10);
- buf[6] = (byte)('0' + (i % 10));
-
- dfield_set_data(field, buf, 8);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- field = dtuple_get_nth_field(tuple, 1);
-
- i = i % 1000; /* ut_rnd_gen_ulint() % 1000000; */
-
- ut_strcpy((char*)buf + 8, "0000000");
-
- buf[9] = (byte)('0' + (i / 100000) % 10);
- buf[10] = (byte)('0' + (i / 10000) % 10);
- buf[11] = (byte)('0' + (i / 1000) % 10);
- buf[12] = (byte)('0' + (i / 100) % 10);
- buf[13] = (byte)('0' + (i / 10) % 10);
- buf[14] = (byte)('0' + (i % 10));
-
- dfield_set_data(field, buf + 8, 8);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- field = dtuple_get_nth_field(tuple, 2);
-
- data_rnd += 8757651;
-
- if (type == DTUPLE_TEST_FIXED30) {
- third_size = 30;
- } else if (type == DTUPLE_TEST_RND30) {
- third_size = data_rnd % 30;
- } else if (type == DTUPLE_TEST_RND3500) {
- third_size = data_rnd % 3500;
- } else if (type == DTUPLE_TEST_FIXED2000) {
- third_size = 2000;
- } else if (type == DTUPLE_TEST_FIXED3) {
- third_size = 3;
- } else {
- ut_error;
- }
-
- if (type == DTUPLE_TEST_FIXED30) {
- dfield_set_data(field,
- "12345678901234567890123456789", third_size);
- } else {
- dfield_set_data(field, data_buf, third_size);
- }
-
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- ut_ad(dtuple_validate(tuple));
-}
-
-/*******************************************************************
-Generates a test tuple for B-tree speed tests. */
-
-void
-dtuple_gen_search_tuple3(
-/*=====================*/
- dtuple_t* tuple, /* in/out: a tuple with 1 or 2 fields */
- ulint i, /* in: a number < 1000000 */
- byte* buf) /* in: a buffer of size >= 16 bytes */
-{
- dfield_t* field;
-
- ut_ad(tuple && buf);
- ut_ad(i < 1000000);
-
- field = dtuple_get_nth_field(tuple, 0);
-
- ut_strcpy((char*)buf, "0000000");
-
- buf[1] = (byte)('0' + (i / 100000) % 10);
- buf[2] = (byte)('0' + (i / 10000) % 10);
- buf[3] = (byte)('0' + (i / 1000) % 10);
- buf[4] = (byte)('0' + (i / 100) % 10);
- buf[5] = (byte)('0' + (i / 10) % 10);
- buf[6] = (byte)('0' + (i % 10));
-
- dfield_set_data(field, buf, 8);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- if (dtuple_get_n_fields(tuple) == 1) {
-
- return;
- }
-
- field = dtuple_get_nth_field(tuple, 1);
-
- i = (i * 1000) % 1000000;
-
- ut_strcpy((char*)buf + 8, "0000000");
-
- buf[9] = (byte)('0' + (i / 100000) % 10);
- buf[10] = (byte)('0' + (i / 10000) % 10);
- buf[11] = (byte)('0' + (i / 1000) % 10);
- buf[12] = (byte)('0' + (i / 100) % 10);
- buf[13] = (byte)('0' + (i / 10) % 10);
- buf[14] = (byte)('0' + (i % 10));
-
- dfield_set_data(field, buf + 8, 8);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- ut_ad(dtuple_validate(tuple));
-}
-
-/*******************************************************************
-Generates a test tuple for TPC-A speed test. */
-
-void
-dtuple_gen_test_tuple_TPC_A(
-/*========================*/
- dtuple_t* tuple, /* in/out: a tuple with >= 3 fields */
- ulint i, /* in: a number < 10000 */
- byte* buf) /* in: a buffer of size >= 16 bytes */
-{
- dfield_t* field;
- ulint third_size;
-
- ut_ad(tuple && buf);
- ut_ad(i < 10000);
-
- field = dtuple_get_nth_field(tuple, 0);
-
- ut_strcpy((char*)buf, "0000");
-
- buf[0] = (byte)('0' + (i / 1000) % 10);
- buf[1] = (byte)('0' + (i / 100) % 10);
- buf[2] = (byte)('0' + (i / 10) % 10);
- buf[3] = (byte)('0' + (i % 10));
-
- dfield_set_data(field, buf, 5);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- field = dtuple_get_nth_field(tuple, 1);
-
- dfield_set_data(field, buf + 8, 5);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- field = dtuple_get_nth_field(tuple, 2);
-
- third_size = 90;
-
- dfield_set_data(field, data_buf, third_size);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- ut_ad(dtuple_validate(tuple));
-}
-
-/*******************************************************************
-Generates a test tuple for B-tree speed tests. */
-
-void
-dtuple_gen_search_tuple_TPC_A(
-/*==========================*/
- dtuple_t* tuple, /* in/out: a tuple with 1 field */
- ulint i, /* in: a number < 10000 */
- byte* buf) /* in: a buffer of size >= 16 bytes */
-{
- dfield_t* field;
-
- ut_ad(tuple && buf);
- ut_ad(i < 10000);
-
- field = dtuple_get_nth_field(tuple, 0);
-
- ut_strcpy((char*)buf, "0000");
-
- buf[0] = (byte)('0' + (i / 1000) % 10);
- buf[1] = (byte)('0' + (i / 100) % 10);
- buf[2] = (byte)('0' + (i / 10) % 10);
- buf[3] = (byte)('0' + (i % 10));
-
- dfield_set_data(field, buf, 5);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- ut_ad(dtuple_validate(tuple));
-}
-
-/*******************************************************************
-Generates a test tuple for TPC-C speed test. */
-
-void
-dtuple_gen_test_tuple_TPC_C(
-/*========================*/
- dtuple_t* tuple, /* in/out: a tuple with >= 12 fields */
- ulint i, /* in: a number < 100000 */
- byte* buf) /* in: a buffer of size >= 16 bytes */
-{
- dfield_t* field;
- ulint size;
- ulint j;
-
- ut_ad(tuple && buf);
- ut_ad(i < 100000);
-
- field = dtuple_get_nth_field(tuple, 0);
-
- buf[0] = (byte)('0' + (i / 10000) % 10);
- buf[1] = (byte)('0' + (i / 1000) % 10);
- buf[2] = (byte)('0' + (i / 100) % 10);
- buf[3] = (byte)('0' + (i / 10) % 10);
- buf[4] = (byte)('0' + (i % 10));
-
- dfield_set_data(field, buf, 5);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- field = dtuple_get_nth_field(tuple, 1);
-
- dfield_set_data(field, buf, 5);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- for (j = 0; j < 10; j++) {
-
- field = dtuple_get_nth_field(tuple, 2 + j);
-
- size = 24;
-
- dfield_set_data(field, data_buf, size);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH,
- 100, 0);
- }
-
- ut_ad(dtuple_validate(tuple));
-}
-
-/*******************************************************************
-Generates a test tuple for B-tree speed tests. */
-
-void
-dtuple_gen_search_tuple_TPC_C(
-/*==========================*/
- dtuple_t* tuple, /* in/out: a tuple with 1 field */
- ulint i, /* in: a number < 100000 */
- byte* buf) /* in: a buffer of size >= 16 bytes */
-{
- dfield_t* field;
-
- ut_ad(tuple && buf);
- ut_ad(i < 100000);
-
- field = dtuple_get_nth_field(tuple, 0);
-
- buf[0] = (byte)('0' + (i / 10000) % 10);
- buf[1] = (byte)('0' + (i / 1000) % 10);
- buf[2] = (byte)('0' + (i / 100) % 10);
- buf[3] = (byte)('0' + (i / 10) % 10);
- buf[4] = (byte)('0' + (i % 10));
-
- dfield_set_data(field, buf, 5);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 100, 0);
-
- ut_ad(dtuple_validate(tuple));
-}
-
-#endif /* notdefined */
diff --git a/innobase/data/data0type.c b/innobase/data/data0type.c
index f505cdfb0a2..71ce5ff3d58 100644
--- a/innobase/data/data0type.c
+++ b/innobase/data/data0type.c
@@ -12,10 +12,99 @@ Created 1/16/1996 Heikki Tuuri
#include "data0type.ic"
#endif
-dtype_t dtype_binary_val = {DATA_BINARY, 0, 0, 0, 0};
+/* At the database startup we store the default-charset collation number of
+this MySQL installation to this global variable. If we have < 4.1.2 format
+column definitions, or records in the insert buffer, we use this
+charset-collation code for them. */
+
+ulint data_mysql_default_charset_coll = 99999999;
+ulint data_mysql_latin1_swedish_charset_coll = 99999999;
+
+dtype_t dtype_binary_val = {DATA_BINARY, 0, 0, 0};
dtype_t* dtype_binary = &dtype_binary_val;
/*************************************************************************
+Checks if a data main type is a string type. Also a BLOB is considered a
+string type. */
+
+ibool
+dtype_is_string_type(
+/*=================*/
+ /* out: TRUE if string type */
+ ulint mtype) /* in: InnoDB main data type code: DATA_CHAR, ... */
+{
+ if (mtype <= DATA_BLOB
+ || mtype == DATA_MYSQL
+ || mtype == DATA_VARMYSQL) {
+
+ return(TRUE);
+ }
+
+ return(FALSE);
+}
+
+/*************************************************************************
+Checks if a type is a binary string type. Note that for tables created with
+< 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column. For
+those DATA_BLOB columns this function currently returns FALSE. */
+
+ibool
+dtype_is_binary_string_type(
+/*========================*/
+ /* out: TRUE if binary string type */
+ ulint mtype, /* in: main data type */
+ ulint prtype) /* in: precise type */
+{
+ if ((mtype == DATA_FIXBINARY)
+ || (mtype == DATA_BINARY)
+ || (mtype == DATA_BLOB && (prtype & DATA_BINARY_TYPE))) {
+
+ return(TRUE);
+ }
+
+ return(FALSE);
+}
+
+/*************************************************************************
+Checks if a type is a non-binary string type. That is, dtype_is_string_type is
+TRUE and dtype_is_binary_string_type is FALSE. Note that for tables created
+with < 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column.
+For those DATA_BLOB columns this function currently returns TRUE. */
+
+ibool
+dtype_is_non_binary_string_type(
+/*============================*/
+ /* out: TRUE if non-binary string type */
+ ulint mtype, /* in: main data type */
+ ulint prtype) /* in: precise type */
+{
+ if (dtype_is_string_type(mtype) == TRUE
+ && dtype_is_binary_string_type(mtype, prtype) == FALSE) {
+
+ return(TRUE);
+ }
+
+ return(FALSE);
+}
+
+/*************************************************************************
+Forms a precise type from the < 4.1.2 format precise type plus the
+charset-collation code. */
+
+ulint
+dtype_form_prtype(
+/*==============*/
+ ulint old_prtype, /* in: the MySQL type code and the flags
+ DATA_BINARY_TYPE etc. */
+ ulint charset_coll) /* in: MySQL charset-collation code */
+{
+ ut_a(old_prtype < 256 * 256);
+ ut_a(charset_coll < 256);
+
+ return(old_prtype + (charset_coll << 16));
+}
+
+/*************************************************************************
Validates a data type structure. */
ibool
diff --git a/innobase/dict/dict0boot.c b/innobase/dict/dict0boot.c
index 76c94d1a918..46cf6c7788d 100644
--- a/innobase/dict/dict0boot.c
+++ b/innobase/dict/dict0boot.c
@@ -39,8 +39,9 @@ dict_hdr_get(
header = DICT_HDR + buf_page_get(DICT_HDR_SPACE, DICT_HDR_PAGE_NO,
RW_X_LATCH, mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(header, SYNC_DICT_HEADER);
-
+#endif /* UNIV_SYNC_DEBUG */
return(header);
}
@@ -64,7 +65,7 @@ dict_hdr_get_new_id(
dict_hdr = dict_hdr_get(&mtr);
- id = mtr_read_dulint(dict_hdr + type, MLOG_8BYTES, &mtr);
+ id = mtr_read_dulint(dict_hdr + type, &mtr);
/* Add some dummy code here because otherwise pgcc seems to
compile wrong */
@@ -75,7 +76,7 @@ dict_hdr_get_new_id(
id = ut_dulint_add(id, 1);
- mlog_write_dulint(dict_hdr + type, id, MLOG_8BYTES, &mtr);
+ mlog_write_dulint(dict_hdr + type, id, &mtr);
mtr_commit(&mtr);
@@ -94,7 +95,9 @@ dict_hdr_flush_row_id(void)
dulint id;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
id = dict_sys->row_id;
@@ -102,7 +105,7 @@ dict_hdr_flush_row_id(void)
dict_hdr = dict_hdr_get(&mtr);
- mlog_write_dulint(dict_hdr + DICT_HDR_ROW_ID, id, MLOG_8BYTES, &mtr);
+ mlog_write_dulint(dict_hdr + DICT_HDR_ROW_ID, id, &mtr);
mtr_commit(&mtr);
}
@@ -138,20 +141,16 @@ dict_hdr_create(
/* Start counting row, table, index, and tree ids from
DICT_HDR_FIRST_ID */
mlog_write_dulint(dict_header + DICT_HDR_ROW_ID,
- ut_dulint_create(0, DICT_HDR_FIRST_ID),
- MLOG_8BYTES, mtr);
+ ut_dulint_create(0, DICT_HDR_FIRST_ID), mtr);
mlog_write_dulint(dict_header + DICT_HDR_TABLE_ID,
- ut_dulint_create(0, DICT_HDR_FIRST_ID),
- MLOG_8BYTES, mtr);
+ ut_dulint_create(0, DICT_HDR_FIRST_ID), mtr);
mlog_write_dulint(dict_header + DICT_HDR_INDEX_ID,
- ut_dulint_create(0, DICT_HDR_FIRST_ID),
- MLOG_8BYTES, mtr);
+ ut_dulint_create(0, DICT_HDR_FIRST_ID), mtr);
mlog_write_dulint(dict_header + DICT_HDR_MIX_ID,
- ut_dulint_create(0, DICT_HDR_FIRST_ID),
- MLOG_8BYTES, mtr);
+ ut_dulint_create(0, DICT_HDR_FIRST_ID), mtr);
/* Create the B-tree roots for the clustered indexes of the basic
system tables */
@@ -247,7 +246,7 @@ dict_boot(void)
dict_sys->row_id = ut_dulint_add(
ut_dulint_align_up(
mtr_read_dulint(dict_hdr + DICT_HDR_ROW_ID,
- MLOG_8BYTES, &mtr),
+ &mtr),
DICT_HDR_ROW_ID_WRITE_MARGIN),
DICT_HDR_ROW_ID_WRITE_MARGIN);
diff --git a/innobase/dict/dict0crea.c b/innobase/dict/dict0crea.c
index 038e4803441..6a951317d47 100644
--- a/innobase/dict/dict0crea.c
+++ b/innobase/dict/dict0crea.c
@@ -25,6 +25,11 @@ Created 1/8/1996 Heikki Tuuri
#include "trx0roll.h"
#include "usr0sess.h"
+/* Maximum lengths of identifiers in MySQL, in bytes */
+#define MAX_TABLE_NAME_LEN 64
+#define MAX_COLUMN_NAME_LEN 64
+#define MAX_IDENTIFIER_LEN 255
+
/*********************************************************************
Based on a table object, this function builds the entry to be inserted
in the SYS_TABLES system table. */
@@ -153,7 +158,7 @@ dict_create_sys_tables_tuple(
if (table->type == DICT_TABLE_CLUSTER_MEMBER) {
dfield_set_data(dfield, table->cluster_name,
ut_strlen(table->cluster_name));
- ut_a(0); /* Oracle-style clusters are not supported yet */
+ ut_error; /* Oracle-style clusters are not supported yet */
} else {
dfield_set_data(dfield, NULL, UNIV_SQL_NULL);
}
@@ -267,9 +272,10 @@ dict_build_table_def_step(
ulint error;
mtr_t mtr;
- UT_NOT_USED(thr);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
-
+#endif /* UNIV_SYNC_DEBUG */
+
table = node->table;
table->id = dict_hdr_get_new_id(DICT_HDR_TABLE_ID);
@@ -344,33 +350,6 @@ dict_build_col_def_step(
return(DB_SUCCESS);
}
-#ifdef notdefined
-/*************************************************************************
-Creates the single index for a cluster: it contains all the columns of
-the cluster definition in the order they were defined. */
-static
-void
-dict_create_index_for_cluster_step(
-/*===============================*/
- tab_node_t* node) /* in: table create node */
-{
- dict_index_t* index;
- ulint i;
- dict_col_t* col;
-
- index = dict_mem_index_create(table->name, "IND_DEFAULT_CLUSTERED",
- table->space, DICT_CLUSTERED,
- table->n_cols);
-
- for (i = 0; i < table->n_cols; i++) {
- col = dict_table_get_nth_col(table, i);
- dict_mem_index_add_field(index, col->name, 0, 0);
- }
-
- (node->cluster)->index = index;
-}
-#endif
-
/*********************************************************************
Based on an index object, this function builds the entry to be inserted
in the SYS_INDEXES system table. */
@@ -391,7 +370,9 @@ dict_create_sys_indexes_tuple(
byte* ptr;
UT_NOT_USED(trx);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(index && heap);
sys_indexes = dict_sys->sys_indexes;
@@ -584,8 +565,9 @@ dict_build_index_def_step(
dict_index_t* index;
dtuple_t* row;
- UT_NOT_USED(thr);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
index = node->index;
@@ -657,8 +639,10 @@ dict_create_index_tree_step(
dtuple_t* search_tuple;
btr_pcur_t pcur;
mtr_t mtr;
-
+
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
UT_NOT_USED(thr);
index = node->index;
@@ -723,7 +707,9 @@ dict_drop_index_tree(
byte* ptr;
ulint len;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ptr = rec_get_nth_field(rec, DICT_SYS_INDEXES_PAGE_NO_FIELD, &len);
@@ -766,26 +752,6 @@ dict_drop_index_tree(
page_rec_write_index_page_no(rec, DICT_SYS_INDEXES_PAGE_NO_FIELD,
FIL_NULL, mtr);
}
-
-#ifdef notdefined
-/*************************************************************************
-Creates the default clustered index for a table: the records are ordered
-by row id. */
-
-void
-dict_create_default_index(
-/*======================*/
- dict_table_t* table, /* in: table */
- trx_t* trx) /* in: transaction handle */
-{
- dict_index_t* index;
-
- index = dict_mem_index_create(table->name, "IND_DEFAULT_CLUSTERED",
- table->space, DICT_CLUSTERED, 0);
-
- dict_create_index(index, trx);
-}
-#endif
/*************************************************************************
Creates a table create graph. */
@@ -873,8 +839,10 @@ dict_create_table_step(
trx_t* trx;
ut_ad(thr);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
-
+#endif /* UNIV_SYNC_DEBUG */
+
trx = thr_get_trx(thr);
node = thr->run_node;
@@ -981,7 +949,9 @@ dict_create_index_step(
trx_t* trx;
ut_ad(thr);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
trx = thr_get_trx(thr);
@@ -1170,7 +1140,7 @@ dict_create_or_check_foreign_constraint_tables(void)
graph->fork_type = QUE_FORK_MYSQL_INTERFACE;
- ut_a(thr = que_fork_start_command(graph, SESS_COMM_EXECUTE, 0));
+ ut_a(thr = que_fork_start_command(graph));
que_run_threads(thr);
@@ -1210,26 +1180,42 @@ dict_create_or_check_foreign_constraint_tables(void)
}
/************************************************************************
-Adds foreign key definitions to data dictionary tables in the database. */
+Adds foreign key definitions to data dictionary tables in the database. We
+look at table->foreign_list, and also generate names to constraints that were
+not named by the user. A generated constraint has a name of the format
+databasename/tablename_ibfk_<number>, where the numbers start from 1, and are
+given locally for this table, that is, the number is not global, as in the
+old format constraints < 4.0.18 it used to be. */
ulint
dict_create_add_foreigns_to_dictionary(
/*===================================*/
/* out: error code or DB_SUCCESS */
+ ulint start_id,/* in: if we are actually doing ALTER TABLE
+ ADD CONSTRAINT, we want to generate constraint
+ numbers which are bigger than in the table so
+ far; we number the constraints from
+ start_id + 1 up; start_id should be set to 0 if
+ we are creating a new table, or if the table
+ so far has no constraints for which the name
+ was generated here */
dict_table_t* table, /* in: table */
trx_t* trx) /* in: transaction */
{
dict_foreign_t* foreign;
que_thr_t* thr;
que_t* graph;
- dulint id;
+ ulint number = start_id + 1;
ulint len;
+ ulint namelen;
ulint error;
+ char* ebuf = dict_foreign_err_buf;
ulint i;
- char buf2[50];
char buf[10000];
- ut_ad(mutex_own(&(dict_sys->mutex)));
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (NULL == dict_table_get_low((char *) "SYS_FOREIGN")) {
fprintf(stderr,
@@ -1254,34 +1240,43 @@ loop:
"PROCEDURE ADD_FOREIGN_DEFS_PROC () IS\n"
"BEGIN\n");
- /* We allocate the new id from the sequence of table id's */
- id = dict_hdr_get_new_id(DICT_HDR_TABLE_ID);
+ namelen = strlen(table->name);
+ ut_a(namelen < MAX_TABLE_NAME_LEN);
+
+ if (foreign->id == NULL) {
+ /* Generate a new constraint id */
+ foreign->id = mem_heap_alloc(foreign->heap, namelen + 20);
+ /* no overflow if number < 1e13 */
+ sprintf(foreign->id, "%s_ibfk_%lu", table->name, (ulong) number);
+ number++;
+ }
+
+ ut_a(strlen(foreign->id) < MAX_IDENTIFIER_LEN);
+ ut_a(len < (sizeof buf)
+ - 46 - 2 * MAX_TABLE_NAME_LEN - MAX_IDENTIFIER_LEN - 20);
- sprintf(buf2, "%lu_%lu", (ulong) ut_dulint_get_high(id),
- (ulong) ut_dulint_get_low(id));
- foreign->id = mem_heap_alloc(foreign->heap, ut_strlen(buf2) + 1);
- ut_memcpy(foreign->id, buf2, ut_strlen(buf2) + 1);
-
len += sprintf(buf + len,
- "INSERT INTO SYS_FOREIGN VALUES('%lu_%lu', '%s', '%s', %lu);\n",
- (ulong) ut_dulint_get_high(id),
- (ulong) ut_dulint_get_low(id),
+ "INSERT INTO SYS_FOREIGN VALUES('%s', '%s', '%s', %lu);\n",
+ foreign->id,
table->name,
foreign->referenced_table_name,
(ulong) (foreign->n_fields
+ (foreign->type << 24)));
for (i = 0; i < foreign->n_fields; i++) {
+ ut_a(len < (sizeof buf)
+ - 51 - 2 * MAX_COLUMN_NAME_LEN
+ - MAX_IDENTIFIER_LEN - 20);
len += sprintf(buf + len,
- "INSERT INTO SYS_FOREIGN_COLS VALUES('%lu_%lu', %lu, '%s', '%s');\n",
- (ulong) ut_dulint_get_high(id),
- (ulong) ut_dulint_get_low(id),
+ "INSERT INTO SYS_FOREIGN_COLS VALUES('%s', %lu, '%s', '%s');\n",
+ foreign->id,
(ulong) i,
foreign->foreign_col_names[i],
foreign->referenced_col_names[i]);
}
+ ut_a(len < (sizeof buf) - 19);
len += sprintf(buf + len,"COMMIT WORK;\nEND;\n");
graph = pars_sql(buf);
@@ -1293,7 +1288,7 @@ loop:
graph->fork_type = QUE_FORK_MYSQL_INTERFACE;
- ut_a(thr = que_fork_start_command(graph, SESS_COMM_EXECUTE, 0));
+ ut_a(thr = que_fork_start_command(graph));
que_run_threads(thr);
@@ -1301,30 +1296,33 @@ loop:
que_graph_free(graph);
+ if (error == DB_DUPLICATE_KEY) {
+ mutex_enter(&dict_foreign_err_mutex);
+ ut_sprintf_timestamp(ebuf);
+ ut_a(strlen(ebuf) < DICT_FOREIGN_ERR_BUF_LEN
+ - MAX_TABLE_NAME_LEN - MAX_IDENTIFIER_LEN - 201);
+ sprintf(ebuf + strlen(ebuf),
+" Error in foreign key constraint creation for table %s.\n"
+"A foreign key constraint of name %s\n"
+"already exists (note that internally InnoDB adds 'databasename/'\n"
+"in front of the user-defined constraint name).\n", table->name, foreign->id);
+
+ mutex_exit(&dict_foreign_err_mutex);
+
+ return(error);
+ }
+
if (error != DB_SUCCESS) {
fprintf(stderr,
"InnoDB: Foreign key constraint creation failed:\n"
"InnoDB: internal error number %lu\n", (ulong) error);
- if (error == DB_DUPLICATE_KEY) {
- fprintf(stderr,
- "InnoDB: Duplicate key error in system table %s index %s\n",
- ((dict_index_t*)trx->error_info)->table_name,
- ((dict_index_t*)trx->error_info)->name);
-
- fprintf(stderr, "%s\n", buf);
-
- fprintf(stderr,
- "InnoDB: Maybe the internal data dictionary of InnoDB is\n"
- "InnoDB: out-of-sync from the .frm files of your tables.\n"
- "InnoDB: See section 15.1 Troubleshooting data dictionary operations\n"
- "InnoDB: at http://www.innodb.com/ibman.html\n");
- }
-
mutex_enter(&dict_foreign_err_mutex);
- ut_sprintf_timestamp(buf);
- sprintf(buf + strlen(buf),
-" Internal error in foreign key constraint creation for table %.500s.\n"
+ ut_sprintf_timestamp(ebuf);
+ ut_a(strlen(ebuf) < DICT_FOREIGN_ERR_BUF_LEN
+ - MAX_TABLE_NAME_LEN - 124);
+ sprintf(ebuf + strlen(ebuf),
+" Internal error in foreign key constraint creation for table %s.\n"
"See the MySQL .err log in the datadir for more information.\n", table->name);
mutex_exit(&dict_foreign_err_mutex);
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c
index da5ffaecf41..cf4b0482aa2 100644
--- a/innobase/dict/dict0dict.c
+++ b/innobase/dict/dict0dict.c
@@ -52,7 +52,7 @@ rw_lock_t dict_operation_lock; /* table create, drop, etc. reserve
hash table fixed size in bytes */
#define DICT_POOL_PER_VARYING 4 /* buffer pool max size per data
dictionary varying size in bytes */
-
+
/**************************************************************************
Adds a column to the data dictionary hash table. */
static
@@ -209,7 +209,7 @@ dict_tables_have_same_db(
}
}
- ut_a(0);
+ ut_error;
return(FALSE);
}
@@ -232,10 +232,33 @@ dict_remove_db_name(
}
}
- ut_a(0);
+ ut_error;
return(NULL);
}
+
+/************************************************************************
+Get the database name length in a table name. */
+
+ulint
+dict_get_db_name_len(
+/*=================*/
+ /* out: database name length */
+ char* name) /* in: table name in the form dbname '/' tablename */
+{
+ ulint i;
+
+ for (i = 0; i < 100000 ; i++) {
+ if (name[i] == '/') {
+
+ return(i);
+ }
+ }
+
+ ut_error;
+
+ return(0);
+}
/************************************************************************
Reserves the dictionary system mutex for MySQL. */
@@ -593,7 +616,9 @@ dict_table_get_on_id(
if we are doing a rollback to handle an error in TABLE
CREATE, for example, we already have the mutex! */
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
return(dict_table_get_on_id_low(table_id, trx));
}
@@ -608,7 +633,7 @@ dict_table_get_on_id(
}
/************************************************************************
-Looks for column n postion in the clustered index. */
+Looks for column n position in the clustered index. */
ulint
dict_table_get_nth_col_pos(
@@ -622,6 +647,44 @@ dict_table_get_nth_col_pos(
n));
}
+/************************************************************************
+Checks if a column is in the ordering columns of the clustered index of a
+table. Column prefixes are treated like whole columns. */
+
+ibool
+dict_table_col_in_clustered_key(
+/*============================*/
+ /* out: TRUE if the column, or its prefix, is
+ in the clustered key */
+ dict_table_t* table, /* in: table */
+ ulint n) /* in: column number */
+{
+ dict_index_t* index;
+ dict_field_t* field;
+ dict_col_t* col;
+ ulint pos;
+ ulint n_fields;
+
+ ut_ad(table);
+
+ col = dict_table_get_nth_col(table, n);
+
+ index = dict_table_get_first_index(table);
+
+ n_fields = dict_index_get_n_unique(index);
+
+ for (pos = 0; pos < n_fields; pos++) {
+ field = dict_index_get_nth_field(index, pos);
+
+ if (col == field->col) {
+
+ return(TRUE);
+ }
+ }
+
+ return(FALSE);
+}
+
/**************************************************************************
Inits the data dictionary module. */
@@ -739,7 +802,9 @@ dict_table_add_to_cache(
ulint i;
ut_ad(table);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(table->n_def == table->n_cols - DATA_N_SYS_COLS);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
ut_ad(table->cached == FALSE);
@@ -870,12 +935,15 @@ dict_table_rename_in_cache(
ulint fold;
ulint old_size;
char* name_buf;
+ char* old_name;
ibool success;
ulint i;
ut_ad(table);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
-
+#endif /* UNIV_SYNC_DEBUG */
+
old_size = mem_heap_get_size(table->heap);
fold = ut_fold_string(new_name);
@@ -916,6 +984,9 @@ dict_table_rename_in_cache(
/* Remove table from the hash tables of tables */
HASH_DELETE(dict_table_t, name_hash, dict_sys->table_hash,
ut_fold_string(table->name), table);
+ old_name = mem_heap_alloc(table->heap, ut_strlen(table->name) + 1);
+
+ ut_strcpy(old_name, table->name);
name_buf = mem_heap_alloc(table->heap, ut_strlen(new_name) + 1);
@@ -972,7 +1043,9 @@ dict_table_rename_in_cache(
return(TRUE);
}
- /* Update the table name fields in foreign constraints */
+ /* Update the table name fields in foreign constraints, and update also
+ the constraint id of new format >= 4.0.18 constraints. Note that at
+ this point we have already changed table->name to the new name. */
foreign = UT_LIST_GET_FIRST(table->foreign_list);
@@ -981,14 +1054,68 @@ dict_table_rename_in_cache(
ut_strlen(table->name)) {
/* Allocate a longer name buffer;
TODO: store buf len to save memory */
+
foreign->foreign_table_name = mem_heap_alloc(
foreign->heap,
ut_strlen(table->name) + 1);
}
- ut_memcpy(foreign->foreign_table_name, table->name,
- ut_strlen(table->name) + 1);
- foreign->foreign_table_name[ut_strlen(table->name)] = '\0';
+ sprintf(foreign->foreign_table_name, "%s", table->name);
+
+ if (ut_str_contains(foreign->id, '/')) {
+ ulint db_len;
+ char old_id[2000];
+
+ /* This is a >= 4.0.18 format id */
+
+ ut_a(ut_strlen(foreign->id) < 1999);
+
+ ut_strcpy(old_id, foreign->id);
+
+ if (ut_strlen(foreign->id) > ut_strlen(old_name)
+ + ut_strlen("_ibfk_")
+ && 0 == ut_memcmp(foreign->id, old_name,
+ ut_strlen(old_name))
+ && 0 == ut_memcmp(
+ foreign->id + ut_strlen(old_name),
+ (char*)"_ibfk_", ut_strlen("_ibfk_"))) {
+
+ /* This is a generated >= 4.0.18 format id */
+
+ if (ut_strlen(table->name)
+ > ut_strlen(old_name)) {
+ foreign->id = mem_heap_alloc(
+ foreign->heap,
+ ut_strlen(table->name)
+ + ut_strlen(old_id) + 1);
+ }
+
+ /* Replace the prefix 'databasename/tablename'
+ with the new names */
+ sprintf(foreign->id, "%s%s", table->name,
+ old_id + ut_strlen(old_name));
+ } else {
+ /* This is a >= 4.0.18 format id where the user
+ gave the id name */
+ db_len = dict_get_db_name_len(table->name) + 1;
+
+ if (dict_get_db_name_len(table->name)
+ > dict_get_db_name_len(foreign->id)) {
+
+ foreign->id = mem_heap_alloc(
+ foreign->heap,
+ db_len + ut_strlen(old_id) + 1);
+ }
+
+ /* Replace the database prefix in id with the
+ one from table->name */
+
+ ut_memcpy(foreign->id, table->name, db_len);
+
+ sprintf(foreign->id + db_len, "%s",
+ dict_remove_db_name(old_id));
+ }
+ }
foreign = UT_LIST_GET_NEXT(foreign_list, foreign);
}
@@ -1000,14 +1127,13 @@ dict_table_rename_in_cache(
ut_strlen(table->name)) {
/* Allocate a longer name buffer;
TODO: store buf len to save memory */
+
foreign->referenced_table_name = mem_heap_alloc(
foreign->heap,
ut_strlen(table->name) + 1);
}
- ut_memcpy(foreign->referenced_table_name, table->name,
- ut_strlen(table->name) + 1);
- foreign->referenced_table_name[ut_strlen(table->name)] = '\0';
+ sprintf(foreign->referenced_table_name, "%s", table->name);
foreign = UT_LIST_GET_NEXT(referenced_list, foreign);
}
@@ -1054,7 +1180,9 @@ dict_table_remove_from_cache(
ulint i;
ut_ad(table);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
/* printf("Removing table %s from dictionary cache\n", table->name); */
@@ -1123,9 +1251,11 @@ dict_table_LRU_trim(void)
dict_table_t* table;
dict_table_t* prev_table;
- ut_a(0);
+ ut_error;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
table = UT_LIST_GET_LAST(dict_sys->table_LRU);
@@ -1154,7 +1284,9 @@ dict_col_add_to_cache(
ulint fold;
ut_ad(table && col);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
fold = ut_fold_ulint_pair(ut_fold_string(table->name),
@@ -1185,7 +1317,9 @@ dict_col_remove_from_cache(
ulint fold;
ut_ad(table && col);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
fold = ut_fold_ulint_pair(ut_fold_string(table->name),
@@ -1208,7 +1342,9 @@ dict_col_reposition_in_cache(
ulint fold;
ut_ad(table && col);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
fold = ut_fold_ulint_pair(ut_fold_string(table->name),
@@ -1242,7 +1378,9 @@ dict_index_add_to_cache(
ulint i;
ut_ad(index);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(index->n_def == index->n_fields);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
@@ -1368,7 +1506,9 @@ dict_index_remove_from_cache(
ut_ad(table && index);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(UT_LIST_GET_LEN((index->tree)->tree_indexes) == 1);
dict_tree_free(index->tree);
@@ -1412,7 +1552,9 @@ dict_index_find_cols(
ut_ad(table && index);
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
for (i = 0; i < index->n_fields; i++) {
field = dict_index_get_nth_field(index, i);
@@ -1553,7 +1695,9 @@ dict_index_build_internal_clust(
ut_ad(table && index);
ut_ad(index->type & DICT_CLUSTERED);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
/* Create a new index object with certainly enough fields */
@@ -1722,7 +1866,9 @@ dict_index_build_internal_non_clust(
ut_ad(table && index);
ut_ad(0 == (index->type & DICT_CLUSTERED));
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);
/* The clustered index should be the first in the list of indexes */
@@ -1805,6 +1951,24 @@ dict_index_build_internal_non_clust(
/*====================== FOREIGN KEY PROCESSING ========================*/
/*************************************************************************
+Checks if a table is referenced by foreign keys. */
+
+ibool
+dict_table_referenced_by_foreign_key(
+/*=================================*/
+ /* out: TRUE if table is referenced by a
+ foreign key */
+ dict_table_t* table) /* in: InnoDB table */
+{
+ if (UT_LIST_GET_LEN(table->referenced_list) > 0) {
+
+ return(TRUE);
+ }
+
+ return(FALSE);
+}
+
+/*************************************************************************
Frees a foreign key struct. */
static
void
@@ -1823,7 +1987,9 @@ dict_foreign_remove_from_cache(
/*===========================*/
dict_foreign_t* foreign) /* in, own: foreign constraint */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(foreign);
if (foreign->referenced_table) {
@@ -1852,7 +2018,9 @@ dict_foreign_find(
{
dict_foreign_t* foreign;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
foreign = UT_LIST_GET_FIRST(table->foreign_list);
@@ -1961,7 +2129,9 @@ dict_foreign_add_to_cache(
ibool added_to_referenced_list = FALSE;
char* buf = dict_foreign_err_buf;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
for_table = dict_table_check_if_in_cache_low(
foreign->foreign_table_name);
@@ -2083,7 +2253,7 @@ static
char*
dict_scan_to(
/*=========*/
-
+ /* out: scanned up to this */
char* ptr, /* in: scan from */
const char *string) /* in: look for this */
{
@@ -2150,6 +2320,68 @@ dict_accept(
}
/*************************************************************************
+Scans an id. For the lexical definition of an 'id', see the code below.
+Strips backquotes or double quotes from around the id. */
+static
+char*
+dict_scan_id(
+/*=========*/
+ /* out: scanned to */
+ char* ptr, /* in: scanned to */
+ char** start, /* out: start of the id; NULL if no id was
+ scannable */
+ ulint* len, /* out: length of the id */
+ ibool accept_also_dot)/* in: TRUE if also a dot can appear in a
+ non-quoted id; in a quoted id it can appear
+ always */
+{
+ char quote = '\0';
+
+ *start = NULL;
+
+ while (isspace(*ptr)) {
+ ptr++;
+ }
+
+ if (*ptr == '\0') {
+
+ return(ptr);
+ }
+
+ if (*ptr == '`' || *ptr == '"') {
+ quote = *ptr++;
+ }
+
+ *start = ptr;
+
+ if (quote) {
+ while (*ptr != quote && *ptr != '\0') {
+ ptr++;
+ }
+ } else {
+ while (!isspace(*ptr) && *ptr != '(' && *ptr != ')'
+ && (accept_also_dot || *ptr != '.')
+ && *ptr != ',' && *ptr != '\0') {
+
+ ptr++;
+ }
+ }
+
+ *len = (ulint) (ptr - *start);
+
+ if (quote) {
+ if (*ptr == quote) {
+ ptr++;
+ } else {
+ /* Syntax error */
+ *start = NULL;
+ }
+ }
+
+ return(ptr);
+}
+
+/*************************************************************************
Tries to scan a column name. */
static
char*
@@ -2165,46 +2397,29 @@ dict_scan_col(
ulint* column_name_len)/* out: column name length */
{
dict_col_t* col;
- char* old_ptr;
ulint i;
*success = FALSE;
- while (isspace(*ptr)) {
- ptr++;
- }
-
- if (*ptr == '\0') {
-
- return(ptr);
- }
-
- if (*ptr == '`') {
- ptr++;
- }
+ ptr = dict_scan_id(ptr, column_name, column_name_len, TRUE);
- old_ptr = ptr;
-
- while (!isspace(*ptr) && *ptr != ',' && *ptr != ')' && *ptr != '`'
- && *ptr != '\0') {
+ if (column_name == NULL) {
- ptr++;
+ return(ptr); /* Syntax error */
}
- *column_name_len = (ulint)(ptr - old_ptr);
-
if (table == NULL) {
*success = TRUE;
*column = NULL;
- *column_name = old_ptr;
} else {
for (i = 0; i < dict_table_get_n_cols(table); i++) {
col = dict_table_get_nth_col(table, i);
- if (ut_strlen(col->name) == (ulint)(ptr - old_ptr)
- && 0 == ut_cmp_in_lower_case(col->name, old_ptr,
- (ulint)(ptr - old_ptr))) {
+ if (ut_strlen(col->name) == *column_name_len
+ && 0 == ut_cmp_in_lower_case(col->name,
+ *column_name,
+ *column_name_len)) {
/* Found */
*success = TRUE;
@@ -2216,10 +2431,6 @@ dict_scan_col(
}
}
- if (*ptr == '`') {
- ptr++;
- }
-
return(ptr);
}
@@ -2238,144 +2449,112 @@ dict_scan_table_name(
the referenced table name; must be at least
2500 bytes */
{
- char* dot_ptr = NULL;
- char* old_ptr;
+ char* database_name = NULL;
+ ulint database_name_len = 999999999; /* init to a dummy value to
+ suppress a compiler warning */
+ char* table_name = NULL;
+ ulint table_name_len;
+ char* scanned_id;
+ ulint scanned_id_len;
ulint i;
*success = FALSE;
*table = NULL;
+
+ ptr = dict_scan_id(ptr, &scanned_id, &scanned_id_len, FALSE);
- while (isspace(*ptr)) {
- ptr++;
+ if (scanned_id == NULL) {
+
+ return(ptr); /* Syntax error */
}
- if (*ptr == '\0') {
+ if (*ptr == '.') {
+ /* We scanned the database name; scan also the table name */
- return(ptr);
- }
-
- if (*ptr == '`') {
ptr++;
- }
- old_ptr = ptr;
-
- while (!isspace(*ptr) && *ptr != '(' && *ptr != '`' && *ptr != '\0') {
- if (*ptr == '.') {
- dot_ptr = ptr;
- }
+ database_name = scanned_id;
+ database_name_len = scanned_id_len;
- ptr++;
- }
+ ptr = dict_scan_id(ptr, &table_name, &table_name_len, FALSE);
- if (ptr - old_ptr > 2000) {
- return(old_ptr);
- }
-
- if (dot_ptr == NULL) {
- /* Copy the database name from 'name' to the start */
- for (i = 0;; i++) {
- second_table_name[i] = name[i];
- if (name[i] == '/') {
- i++;
- break;
- }
- }
-#ifdef __WIN__
- ut_cpy_in_lower_case(second_table_name + i, old_ptr,
- ptr - old_ptr);
-#else
- if (srv_lower_case_table_names) {
- ut_cpy_in_lower_case(second_table_name + i, old_ptr,
- ptr - old_ptr);
- } else {
- ut_memcpy(second_table_name + i, old_ptr,
- ptr - old_ptr);
+ if (table_name == NULL) {
+
+ return(ptr); /* Syntax error */
}
-#endif
- second_table_name[i + (ptr - old_ptr)] = '\0';
} else {
-#ifdef __WIN__
- ut_cpy_in_lower_case(second_table_name, old_ptr,
- ptr - old_ptr);
-#else
- if (srv_lower_case_table_names) {
- ut_cpy_in_lower_case(second_table_name, old_ptr,
- ptr - old_ptr);
- } else {
- ut_memcpy(second_table_name, old_ptr, ptr - old_ptr);
+ /* To be able to read table dumps made with InnoDB-4.0.17 or
+ earlier, we must allow the dot separator between the database
+ name and the table name also to appear within a quoted
+ identifier! InnoDB used to print a constraint as:
+ ... REFERENCES `databasename.tablename` ...
+ starting from 4.0.18 it is
+ ... REFERENCES `databasename`.`tablename` ... */
+
+ for (i = 0; i < scanned_id_len; i++) {
+ if (scanned_id[i] == '.') {
+ database_name = scanned_id;
+ database_name_len = i;
+
+ scanned_id = scanned_id + i + 1;
+ scanned_id_len -= i + 1;
+ }
}
-#endif
- second_table_name[dot_ptr - old_ptr] = '/';
- second_table_name[ptr - old_ptr] = '\0';
- }
- *success = TRUE;
-
- *table = dict_table_get_low(second_table_name);
-
- if (*ptr == '`') {
- ptr++;
+ table_name = scanned_id;
+ table_name_len = scanned_id_len;
}
- return(ptr);
-}
+ if (database_name == NULL) {
+ /* Use the database name of the foreign key table */
-/*************************************************************************
-Scans an id. For the lexical definition of an 'id', see the code below.
-Strips backquotes from around the id. */
-static
-char*
-dict_scan_id(
-/*=========*/
- /* out: scanned to */
- char* ptr, /* in: scanned to */
- char** start, /* out: start of the id; NULL if no id was
- scannable */
- ulint* len) /* out: length of the id */
-{
- ibool scanned_backquote = FALSE;
-
- *start = NULL;
-
- while (isspace(*ptr)) {
- ptr++;
+ database_name = name;
+
+ database_name_len = dict_get_db_name_len(name);
}
- if (*ptr == '\0') {
-
- return(ptr);
- }
+ if (table_name_len + database_name_len > 2000) {
- if (*ptr == '`') {
- scanned_backquote = TRUE;
- ptr++;
+ return(ptr); /* Too long name */
}
- *start = ptr;
-
- while (!isspace(*ptr) && *ptr != ',' && *ptr != '(' && *ptr != ')'
- && *ptr != '\0' && *ptr != '`') {
-
- ptr++;
+#ifdef __WIN__
+ ut_cpy_in_lower_case(second_table_name, database_name,
+ database_name_len);
+#else
+ if (srv_lower_case_table_names) {
+ ut_cpy_in_lower_case(second_table_name, database_name,
+ database_name_len);
+ } else {
+ ut_memcpy(second_table_name, database_name,
+ database_name_len);
}
+#endif
+ second_table_name[database_name_len] = '/';
- *len = (ulint) (ptr - *start);
-
- if (scanned_backquote) {
- if (*ptr == '`') {
- ptr++;
- } else {
- /* Syntax error */
- *start = NULL;
- }
+#ifdef __WIN__
+ ut_cpy_in_lower_case(second_table_name + database_name_len + 1,
+ table_name, table_name_len);
+#else
+ if (srv_lower_case_table_names) {
+ ut_cpy_in_lower_case(second_table_name + database_name_len + 1,
+ table_name, table_name_len);
+ } else {
+ ut_memcpy(second_table_name + database_name_len + 1,
+ table_name, table_name_len);
}
+#endif
+ second_table_name[database_name_len + 1 + table_name_len] = '\0';
+
+ *success = TRUE;
+
+ *table = dict_table_get_low(second_table_name);
return(ptr);
}
/*************************************************************************
-Skips one id. */
+Skips one id. The id is allowed to contain also '.'. */
static
char*
dict_skip_word(
@@ -2390,7 +2569,7 @@ dict_skip_word(
*success = FALSE;
- ptr = dict_scan_id(ptr, &start, &len);
+ ptr = dict_scan_id(ptr, &start, &len, TRUE);
if (start) {
*success = TRUE;
@@ -2506,6 +2685,52 @@ scan_more:
}
/*************************************************************************
+Finds the highest <number> for foreign key constraints of the table. Looks
+only at the >= 4.0.18-format id's, which are of the form
+databasename/tablename_ibfk_<number>. */
+static
+ulint
+dict_table_get_highest_foreign_id(
+/*==============================*/
+ /* out: highest number, 0 if table has no new
+ format foreign key constraints */
+ dict_table_t* table) /* in: table in the dictionary memory cache */
+{
+ dict_foreign_t* foreign;
+ char* endp;
+ ulint biggest_id = 0;
+ ulint id;
+
+ ut_a(table);
+
+ foreign = UT_LIST_GET_FIRST(table->foreign_list);
+
+ while (foreign) {
+ if (ut_strlen(foreign->id) > ut_strlen("_ibfk_")
+ + ut_strlen(table->name)
+ && 0 == ut_memcmp(foreign->id, table->name,
+ ut_strlen(table->name))
+ && 0 == ut_memcmp(foreign->id + ut_strlen(table->name),
+ (char*)"_ibfk_", ut_strlen("_ibfk_"))) {
+ /* It is of the >= 4.0.18 format */
+
+ id = strtoul(foreign->id + ut_strlen(table->name)
+ + ut_strlen("_ibfk_"),
+ &endp, 10);
+ ut_a(id != biggest_id);
+
+ if (id > biggest_id) {
+ biggest_id = id;
+ }
+ }
+
+ foreign = UT_LIST_GET_NEXT(foreign_list, foreign);
+ }
+
+ return(biggest_id);
+}
+
+/*************************************************************************
Reports a simple foreign key create clause syntax error. */
static
void
@@ -2547,19 +2772,26 @@ dict_create_foreign_constraints_low(
FOREIGN KEY (a, b) REFERENCES table2(c, d),
table2 can be written also with the database
name before it: test.table2; the default
- database id the database of parameter name */
+ database is the database of parameter name */
char* name) /* in: table full name in the normalized form
database_name/table_name */
{
dict_table_t* table;
dict_table_t* referenced_table;
+ dict_table_t* table_to_alter;
+ ulint highest_id_so_far = 0;
dict_index_t* index;
dict_foreign_t* foreign;
char* ptr = sql_string;
char* start_of_latest_foreign = sql_string;
char* buf = dict_foreign_err_buf;
+ char* constraint_name; /* this is NOT a null-
+ terminated string */
+ ulint constraint_name_len;
ibool success;
ulint error;
+ char* ptr1;
+ char* ptr2;
ulint i;
ulint j;
ibool is_on_delete;
@@ -2570,7 +2802,9 @@ dict_create_foreign_constraints_low(
ulint column_name_lens[500];
char referenced_table_name[2500];
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
table = dict_table_get_low(name);
@@ -2586,16 +2820,89 @@ dict_create_foreign_constraints_low(
return(DB_ERROR);
}
+
+ /* First check if we are actually doing an ALTER TABLE, and in that
+ case look for the table being altered */
+
+ ptr = dict_accept(ptr, (char*) "ALTER", &success);
+
+ if (!success) {
+
+ goto loop;
+ }
+
+ ptr = dict_accept(ptr, (char*) "TABLE", &success);
+
+ if (!success) {
+
+ goto loop;
+ }
+
+ /* We are doing an ALTER TABLE: scan the table name we are altering;
+ in the call below we use the buffer 'referenced_table_name' as a dummy
+ buffer */
+
+ ptr = dict_scan_table_name(ptr, &table_to_alter, name,
+ &success, referenced_table_name);
+ if (!success) {
+ fprintf(stderr,
+"InnoDB: Error: could not find the table being ALTERED in:\n%s\n", sql_string);
+
+ return(DB_ERROR);
+ }
+
+ /* Starting from 4.0.18 and 4.1.2, we generate foreign key id's in the
+ format databasename/tablename_ibfk_<number>, where <number> is local
+ to the table; look for the highest <number> for table_to_alter, so
+ that we can assign to new constraints higher numbers. */
+
+ /* If we are altering a temporary table, the table name after ALTER
+ TABLE does not correspond to the internal table name, and
+ table_to_alter is NULL. TODO: should we fix this somehow? */
+
+ if (table_to_alter == NULL) {
+ highest_id_so_far = 0;
+ } else {
+ highest_id_so_far = dict_table_get_highest_foreign_id(
+ table_to_alter);
+ }
+
+ /* Scan for foreign key declarations in a loop */
loop:
- ptr = dict_scan_to(ptr, (char *) "FOREIGN");
+ /* Scan either to "CONSTRAINT" or "FOREIGN", whichever is closer */
- if (*ptr == '\0') {
+ ptr1 = dict_scan_to(ptr, (char *) "CONSTRAINT");
+ ptr2 = dict_scan_to(ptr, (char *) "FOREIGN");
+
+ constraint_name = NULL;
+
+ if (ptr1 < ptr2) {
+ /* The user has specified a constraint name. Pick it so
+ that we can store 'databasename/constraintname' as the id of
+ the id of the constraint to system tables. */
+ ptr = ptr1;
+
+ ptr = dict_accept(ptr, (char *) "CONSTRAINT", &success);
+ ut_a(success);
+
+ if (!isspace(*ptr)) {
+ goto loop;
+ }
+
+ ptr = dict_scan_id(ptr, &constraint_name, &constraint_name_len,
+ FALSE);
+ } else {
+ ptr = ptr2;
+ }
+
+ if (*ptr == '\0') {
+ /**********************************************************/
/* The following call adds the foreign key constraints
to the data dictionary system tables on disk */
- error = dict_create_add_foreigns_to_dictionary(table, trx);
-
+ error = dict_create_add_foreigns_to_dictionary(
+ highest_id_so_far, table, trx);
return(error);
}
@@ -2703,6 +3010,28 @@ col_loop1:
foreign = dict_mem_foreign_create();
+ if (constraint_name) {
+ ulint db_len;
+
+ /* Catenate 'databasename/' to the constraint name specified
+ by the user: we conceive the constraint as belonging to the
+ same MySQL 'database' as the table itself. We store the name
+ to foreign->id. */
+
+ db_len = dict_get_db_name_len(table->name);
+
+ foreign->id = mem_heap_alloc(foreign->heap,
+ db_len + 1 + constraint_name_len + 1);
+
+ ut_memcpy(foreign->id, table->name, db_len);
+
+ foreign->id[db_len] = '/';
+
+ ut_memcpy(foreign->id + db_len + 1, constraint_name,
+ constraint_name_len);
+ foreign->id[db_len + 1 + constraint_name_len] = '\0';
+ }
+
foreign->foreign_table = table;
foreign->foreign_table_name = table->name;
foreign->foreign_index = index;
@@ -3004,7 +3333,7 @@ dict_create_foreign_constraints(
FOREIGN KEY (a, b) REFERENCES table2(c, d),
table2 can be written also with the database
name before it: test.table2; the default
- database id the database of parameter name */
+ database is the database of parameter name */
char* name) /* in: table full name in the normalized form
database_name/table_name */
{
@@ -3055,7 +3384,9 @@ dict_foreign_parse_drop_constraints(
str = dict_strip_comments(*(trx->mysql_query_str));
ptr = str;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
loop:
ptr = dict_scan_to(ptr, (char *) "DROP");
@@ -3088,7 +3419,7 @@ loop:
goto syntax_error;
}
- ptr = dict_scan_id(ptr, &start, &len);
+ ptr = dict_scan_id(ptr, &start, &len, TRUE);
if (start == NULL) {
@@ -3106,8 +3437,10 @@ loop:
foreign = UT_LIST_GET_FIRST(table->foreign_list);
while (foreign != NULL) {
- if (0 == ut_strcmp(foreign->id, id)) {
-
+ if (0 == ut_strcmp(foreign->id, id)
+ || (ut_str_contains(foreign->id, '/')
+ && 0 == ut_strcmp(id,
+ dict_remove_db_name(foreign->id)))) {
/* Found */
break;
}
@@ -3120,8 +3453,8 @@ loop:
ut_sprintf_timestamp(buf);
sprintf(buf + strlen(buf),
" Error in dropping of a foreign key constraint of table %.500s,\n"
-"just before:\n%s\n in SQL command\n%s\nCannot find a constraint with the\n"
-"given id %s.\n", table->name, ptr, str, id);
+"in SQL command\n%s\nCannot find a constraint with the\n"
+"given id %s.\n", table->name, str, id);
ut_a(strlen(buf) < DICT_FOREIGN_ERR_BUF_LEN);
mutex_exit(&dict_foreign_err_mutex);
@@ -3193,7 +3526,9 @@ dict_procedure_reserve_parsed_copy(
que_t* graph;
proc_node_t* proc_node;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
mutex_enter(&(dict_sys->mutex));
@@ -3241,7 +3576,9 @@ dict_procedure_release_parsed_copy(
{
proc_node_t* proc_node;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
mutex_enter(&(dict_sys->mutex));
@@ -3318,9 +3655,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);
@@ -3337,7 +3674,7 @@ dict_tree_free(
dict_tree_t* tree) /* in, own: index tree */
{
ut_a(tree);
- ut_a(tree->magic_n == DICT_TREE_MAGIC_N);
+ ut_ad(tree->magic_n == DICT_TREE_MAGIC_N);
rw_lock_free(&(tree->lock));
mem_free(tree);
@@ -3731,7 +4068,9 @@ dict_foreign_print_low(
{
ulint i;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
printf(" FOREIGN KEY CONSTRAINT %s: %s (", foreign->id,
foreign->foreign_table_name);
@@ -3796,7 +4135,9 @@ dict_table_print_low(
dict_foreign_t* foreign;
ulint i;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
dict_update_statistics_low(table, TRUE);
@@ -3850,7 +4191,9 @@ dict_col_print_low(
{
dtype_t* type;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
type = dict_col_get_type(col);
printf("%s: ", col->name);
@@ -3870,7 +4213,9 @@ dict_index_print_low(
ib_longlong n_vals;
ulint i;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
tree = index->tree;
@@ -3916,7 +4261,9 @@ dict_field_print_low(
/*=================*/
dict_field_t* field) /* in: field */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
printf(" %s", field->name);
@@ -3937,10 +4284,20 @@ dict_print_info_on_foreign_key_in_create_format(
char* buf) /* in: buffer of at least 5000 bytes */
{
char* buf2 = buf;
+ char* stripped_id;
+ ulint cpy_len;
ulint i;
+ if (ut_str_contains(foreign->id, '/')) {
+ /* Strip the preceding database name from the constraint id */
+ stripped_id = foreign->id + 1
+ + dict_get_db_name_len(foreign->id);
+ } else {
+ stripped_id = foreign->id;
+ }
+
buf2 += sprintf(buf2, ",\n CONSTRAINT `%s` FOREIGN KEY (",
- foreign->id);
+ stripped_id);
for (i = 0; i < foreign->n_fields; i++) {
if ((ulint)(buf2 - buf) >= 4000) {
@@ -3956,24 +4313,31 @@ dict_print_info_on_foreign_key_in_create_format(
if (dict_tables_have_same_db(foreign->foreign_table_name,
foreign->referenced_table_name)) {
- /* Do not print the database name of the referenced
- table */
+ /* Do not print the database name of the referenced table */
buf2 += sprintf(buf2, ") REFERENCES `%.500s` (",
dict_remove_db_name(
foreign->referenced_table_name));
} else {
- buf2 += sprintf(buf2, ") REFERENCES `%.500s` (",
- foreign->referenced_table_name);
- /* Change the '/' in the table name to '.' */
-
- for (i = ut_strlen(buf); i > 0; i--) {
- if (buf[i] == '/') {
+ buf2 += sprintf(buf2, ") REFERENCES `");
+
+ /* Look for the '/' in the table name */
- buf[i] = '.';
+ i = 0;
+ while (foreign->referenced_table_name[i] != '/') {
+ i++;
+ }
+
+ cpy_len = i;
- break;
- }
+ if (cpy_len > 500) {
+ cpy_len = 500;
}
+
+ memcpy(buf2, foreign->referenced_table_name, cpy_len);
+ buf2 += cpy_len;
+
+ buf2 += sprintf(buf2, "`.`%.500s` (",
+ foreign->referenced_table_name + i + 1);
}
for (i = 0; i < foreign->n_fields; i++) {
diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c
index e9076db08f3..c6a8ebc4b55 100644
--- a/innobase/dict/dict0load.c
+++ b/innobase/dict/dict0load.c
@@ -43,7 +43,9 @@ dict_get_first_table_name_in_db(
char* table_name;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
heap = mem_heap_create(1000);
@@ -307,7 +309,9 @@ dict_load_columns(
ulint i;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
mtr_start(&mtr);
@@ -360,6 +364,15 @@ dict_load_columns(
field = rec_get_nth_field(rec, 6, &len);
prtype = mach_read_from_4(field);
+ if (dtype_is_non_binary_string_type(mtype, prtype)
+ && dtype_get_charset_coll(prtype) == 0) {
+ /* This is a non-binary string type, and the table
+ was created with < 4.1.2. Use the default charset. */
+
+ prtype = dtype_form_prtype(prtype,
+ data_mysql_default_charset_coll);
+ }
+
field = rec_get_nth_field(rec, 7, &len);
col_len = mach_read_from_4(field);
@@ -405,7 +418,9 @@ dict_load_fields(
ulint i;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
UT_NOT_USED(table);
@@ -517,7 +532,9 @@ dict_load_indexes(
dulint id;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if ((ut_dulint_get_high(table->id) == 0)
&& (ut_dulint_get_low(table->id) < DICT_HDR_FIRST_ID)) {
@@ -691,7 +708,9 @@ dict_load_table(
ulint err;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
heap = mem_heap_create(1000);
@@ -782,7 +801,7 @@ dict_load_table(
table->type = mach_read_from_4(field);
if (table->type == DICT_TABLE_CLUSTER_MEMBER) {
- ut_a(0);
+ ut_error;
field = rec_get_nth_field(rec, 6, &len);
table->mix_id = mach_read_from_8(field);
@@ -863,7 +882,9 @@ dict_load_table_on_id(
char* name;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
/* NOTE that the operation of this function is protected by
the dictionary mutex, and therefore no deadlocks can occur
@@ -948,7 +969,9 @@ dict_load_sys_table(
{
mem_heap_t* heap;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
heap = mem_heap_create(1000);
@@ -979,7 +1002,9 @@ dict_load_foreign_cols(
ulint i;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
foreign->foreign_col_names = mem_heap_alloc(foreign->heap,
foreign->n_fields * sizeof(void*));
@@ -1060,7 +1085,9 @@ dict_load_foreign(
ulint err;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
heap2 = mem_heap_create(1000);
@@ -1192,7 +1219,9 @@ dict_load_foreigns(
ulint err;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
sys_foreign = dict_table_get_low((char *) "SYS_FOREIGN");
diff --git a/innobase/dict/dict0mem.c b/innobase/dict/dict0mem.c
index aed44eb246c..c49738a0960 100644
--- a/innobase/dict/dict0mem.c
+++ b/innobase/dict/dict0mem.c
@@ -92,9 +92,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);
}
@@ -219,7 +219,9 @@ 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/dict/ts/makefile b/innobase/dict/ts/makefile
deleted file mode 100644
index d1a24e90a89..00000000000
--- a/innobase/dict/ts/makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-include ..\..\makefile.i
-
-tsdict: ..\dict.lib tsdict.c
- $(CCOM) $(CFL) -I.. -I..\.. ..\dict.lib ..\..\data.lib ..\..\buf.lib ..\..\mach.lib ..\..\fil.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tsdict.c $(LFL)
-
-
-
-
-
-
-
-
-
diff --git a/innobase/dict/ts/tsdict.c b/innobase/dict/ts/tsdict.c
deleted file mode 100644
index fa41a6b9112..00000000000
--- a/innobase/dict/ts/tsdict.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/************************************************************************
-The test module for the data dictionary
-
-(c) 1996 Innobase Oy
-
-Created 1/13/1996 Heikki Tuuri
-*************************************************************************/
-
-#include "sync0sync.h"
-#include "mem0mem.h"
-#include "buf0buf.h"
-#include "data0type.h"
-#include "..\dict0dict.h"
-
-/************************************************************************
-Basic test of data dictionary. */
-
-void
-test1(void)
-/*=======*/
-{
- dict_table_t* table;
- dict_index_t* index;
-
- table = dict_table_create("TS_TABLE1", 3);
-
- dict_table_add_col(table, "COL1", DATA_INT, 3, 4, 5);
- dict_table_add_col(table, "COL2", DATA_INT, 3, 4, 5);
- dict_table_add_col(table, "COL3", DATA_INT, 3, 4, 5);
-
- ut_a(0 == dict_table_publish(table));
-
- index = dict_index_create("TS_TABLE1", "IND1",
- DICT_UNIQUE | DICT_CLUSTERED | DICT_MIX, 2, 1);
-
- dict_index_add_field(index, "COL2", DICT_DESCEND);
- dict_index_add_field(index, "COL1", 0);
-
- ut_a(0 == dict_index_publish(index));
-
- dict_table_print(table);
-
- dict_table_free(table);
-
- ut_a(dict_all_freed());
-
- dict_free_all();
-
- ut_a(dict_all_freed());
-}
-
-/************************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
-
- oldtm = ut_clock();
-
- sync_init();
- mem_init();
- buf_pool_init(100, 100);
- dict_init();
-
- test1();
-
- tm = ut_clock();
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/dyn/ts/makefile b/innobase/dyn/ts/makefile
deleted file mode 100644
index b4b5ad5eadf..00000000000
--- a/innobase/dyn/ts/makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-
-include ..\..\makefile.i
-
-tsdyn: ..\dyn.lib tsdyn.c makefile
- $(CCOM) $(CFL) -I.. -I..\.. ..\dyn.lib ..\..\mem.lib ..\..\ut.lib ..\..\mach.lib ..\..\sync.lib ..\..\os.lib tsdyn.c $(LFL)
-
-
-
-
-
-
-
diff --git a/innobase/dyn/ts/tsdyn.c b/innobase/dyn/ts/tsdyn.c
deleted file mode 100644
index 4c21583d9d8..00000000000
--- a/innobase/dyn/ts/tsdyn.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/************************************************************************
-The test module for dynamic array
-
-(c) 1996 Innobase Oy
-
-Created 2/5/1996 Heikki Tuuri
-*************************************************************************/
-
-#include "../dyn0dyn.h"
-#include "sync0sync.h"
-#include "mem0mem.h"
-
-/****************************************************************
-Basic test. */
-
-void
-test1(void)
-/*=======*/
-{
- dyn_array_t dyn;
- ulint i;
- ulint* ulint_ptr;
-
- printf("-------------------------------------------\n");
- printf("TEST 1. Basic test\n");
-
- dyn_array_create(&dyn);
-
- for (i = 0; i < 1000; i++) {
- ulint_ptr = dyn_array_push(&dyn, sizeof(ulint));
- *ulint_ptr = i;
- }
-
- ut_a(dyn_array_get_n_elements(&dyn) == 1000);
-
- for (i = 0; i < 1000; i++) {
- ulint_ptr = dyn_array_get_nth_element(&dyn, i, sizeof(ulint));
- ut_a(*ulint_ptr == i);
- }
-
- dyn_array_free(&dyn);
-}
-
-void
-main(void)
-{
- sync_init();
- mem_init();
-
- test1();
-
- ut_ad(sync_all_freed());
-
- ut_ad(mem_all_freed());
-
- printf("TEST SUCCESSFULLY COMPLETED!\n");
-}
diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c
index ee63df08744..768dda4eedc 100644
--- a/innobase/fil/fil0fil.c
+++ b/innobase/fil/fil0fil.c
@@ -534,7 +534,9 @@ fil_node_close_file(
ibool ret;
ut_ad(node && system);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(system->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(node->open);
ut_a(node->n_pending == 0);
ut_a(node->n_pending_flushes == 0);
@@ -742,7 +744,9 @@ fil_node_free(
fil_space_t* space) /* in: space where the file node is chained */
{
ut_ad(node && system && space);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(system->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(node->magic_n == FIL_NODE_MAGIC_N);
ut_a(node->n_pending == 0);
@@ -3383,7 +3387,9 @@ fil_node_prepare_for_io(
fil_space_t* space) /* in: space */
{
ut_ad(node && system && space);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(system->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (system->n_open > system->max_n_open + 5) {
ut_print_timestamp(stderr);
@@ -3427,7 +3433,9 @@ fil_node_complete_io(
{
ut_ad(node);
ut_ad(system);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(system->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(node->n_pending > 0);
@@ -3561,7 +3569,7 @@ fil_io(
space->name, (ulong) byte_offset, (ulong) len,
(ulong) type);
- ut_a(0);
+ ut_error;
}
if (node->size > block_offset) {
@@ -3726,7 +3734,7 @@ fil_aio_wait(
ret = os_aio_posix_handle(segment, &fil_node, &message);
#else
ret = 0; /* Eliminate compiler warning */
- ut_a(0);
+ ut_error;
#endif
} else {
srv_io_thread_op_info[segment] =(char *)"handle simulated aio";
diff --git a/innobase/fil/ts/makefile b/innobase/fil/ts/makefile
deleted file mode 100644
index 41911104bc6..00000000000
--- a/innobase/fil/ts/makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-include ..\..\makefile.i
-
-tsfil: ..\fil.lib tsfil.c
- $(CCOM) $(CFL) -I.. -I..\.. ..\fil.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tsfil.c $(LFL)
-
-
-
-
-
-
-
-
diff --git a/innobase/fil/ts/tsfil.c b/innobase/fil/ts/tsfil.c
deleted file mode 100644
index 61fdefe28af..00000000000
--- a/innobase/fil/ts/tsfil.c
+++ /dev/null
@@ -1,329 +0,0 @@
-/************************************************************************
-The test module for the file system
-
-(c) 1995 Innobase Oy
-
-Created 10/29/1995 Heikki Tuuri
-*************************************************************************/
-
-#include "os0thread.h"
-#include "os0file.h"
-#include "ut0ut.h"
-#include "sync0sync.h"
-#include "mem0mem.h"
-#include "..\fil0fil.h"
-
-ulint last_thr = 1;
-
-byte global_buf[10000000];
-byte global_buf2[20000];
-
-os_file_t files[1000];
-
-os_event_t gl_ready;
-
-mutex_t ios_mutex;
-ulint ios;
-
-/*********************************************************************
-Test for synchronous file io. */
-
-void
-test1(void)
-/*=======*/
-{
- ulint i, j;
- void* mess;
- bool ret;
- void* buf;
- ulint rnd, rnd3;
- ulint tm, oldtm;
-
- printf("-------------------------------------------\n");
- printf("FIL-TEST 1. Test of synchronous file io\n");
-
- /* Align the buffer for file io */
-
- buf = (void*)(((ulint)global_buf + 6300) & (~0xFFF));
-
- rnd = ut_time();
- rnd3 = ut_time();
-
- rnd = rnd * 3416133;
- rnd3 = rnd3 * 6576681;
-
- oldtm = ut_clock();
-
- for (j = 0; j < 300; j++) {
- for (i = 0; i < (rnd3 % 15); i++) {
- fil_read((rnd % 1000) / 100, rnd % 100, 0, 8192, buf, NULL);
-
- ut_a(fil_validate());
-
- ret = fil_aio_wait(0, &mess);
- ut_a(ret);
-
- ut_a(fil_validate());
-
- ut_a(*((ulint*)buf) == rnd % 1000);
-
- rnd += 1;
- }
- rnd = rnd + 3416133;
- rnd3 = rnd3 + 6576681;
- }
-
- tm = ut_clock();
- printf("Wall clock time for synchr. io %lu milliseconds\n",
- tm - oldtm);
-
-}
-
-/************************************************************************
-Io-handler thread function. */
-
-ulint
-handler_thread(
-/*===========*/
- void* arg)
-{
- ulint segment;
- void* mess;
- void* buf;
- ulint i;
- bool ret;
-
- segment = *((ulint*)arg);
-
- buf = (void*)(((ulint)global_buf + 6300) & (~0xFFF));
-
- printf("Thread %lu starts\n", segment);
-
- for (i = 0;; i++) {
- ret = fil_aio_wait(segment, &mess);
- ut_a(ret);
-
- if ((ulint)mess == 3333) {
- os_event_set(gl_ready);
- } else {
- ut_a((ulint)mess ==
- *((ulint*)((byte*)buf + 8192 * (ulint)mess)));
- }
-
- mutex_enter(&ios_mutex);
- ios++;
- mutex_exit(&ios_mutex);
-
- ut_a(ret);
-/* printf("Message for thread %lu %lu\n", segment,
- (ulint)mess); */
- }
-
- return(0);
-}
-
-/************************************************************************
-Test of io-handler threads */
-
-void
-test2(void)
-/*=======*/
-{
- ulint i;
- ulint j;
- void* buf;
- ulint rnd, rnd3;
- ulint tm, oldtm;
- os_thread_t thr[5];
- os_thread_id_t id[5];
- ulint n[5];
-
- /* Align the buffer for file io */
-
- buf = (void*)(((ulint)global_buf + 6300) & (~0xFFF));
-
- gl_ready = os_event_create(NULL);
- ios = 0;
-
- mutex_create(&ios_mutex);
-
- for (i = 0; i < 5; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(handler_thread, n + i, id + i);
- }
-
- printf("-------------------------------------------\n");
- printf("FIL-TEST 2. Test of asynchronous file io\n");
-
- rnd = ut_time();
- rnd3 = ut_time();
-
- rnd = rnd * 3416133;
- rnd3 = rnd3 * 6576681;
-
- oldtm = ut_clock();
-
- for (j = 0; j < 300; j++) {
- for (i = 0; i < (rnd3 % 15); i++) {
- fil_read((rnd % 1000) / 100, rnd % 100, 0, 8192,
- (void*)((byte*)buf + 8192 * (rnd % 1000)),
- (void*)(rnd % 1000));
-
- rnd += 1;
- }
- ut_a(fil_validate());
- rnd = rnd + 3416133;
- rnd3 = rnd3 + 6576681;
- }
-
- ut_a(!os_aio_all_slots_free());
-
- tm = ut_clock();
- printf("Wall clock time for asynchr. io %lu milliseconds\n",
- tm - oldtm);
-
- fil_read(5, 25, 0, 8192,
- (void*)((byte*)buf + 8192 * 1000),
- (void*)3333);
-
- tm = ut_clock();
-
- ut_a(fil_validate());
-
- printf("All ios queued! N ios: %lu\n", ios);
-
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
-
- os_event_wait(gl_ready);
-
- tm = ut_clock();
- printf("N ios: %lu\n", ios);
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
-
- os_thread_sleep(2000000);
-
- printf("N ios: %lu\n", ios);
-
- ut_a(fil_validate());
- ut_a(os_aio_all_slots_free());
-}
-
-/*************************************************************************
-Creates the files for the file system test and inserts them to
-the file system. */
-
-void
-create_files(void)
-/*==============*/
-{
- bool ret;
- ulint i, j, k, n;
- void* buf;
- void* mess;
- char name[10];
-
- buf = (void*)(((ulint)global_buf2 + 6300) & (~0xFFF));
-
- name[0] = 't';
- name[1] = 's';
- name[2] = 'f';
- name[3] = 'i';
- name[4] = 'l';
- name[5] = 'e';
- name[8] = '\0';
-
- for (k = 0; k < 10; k++) {
- for (i = 0; i < 20; i++) {
-
- name[6] = (char)(k + (ulint)'a');
- name[7] = (char)(i + (ulint)'a');
-
- files[i] = os_file_create(name, OS_FILE_CREATE,
- OS_FILE_TABLESPACE, &ret);
-
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(name, OS_FILE_OPEN,
- OS_FILE_TABLESPACE, &ret);
-
- ut_a(ret);
- } else {
-
- for (j = 0; j < 5; j++) {
- for (n = 0; n < 8192 / sizeof(ulint); n++) {
- *((ulint*)buf + n) =
- k * 100 + i * 5 + j;
- }
-
- ret = os_aio_write(files[i], buf, 8192 * j,
- 0, 8192, NULL);
- ut_a(ret);
-
- ret = os_aio_wait(0, &mess);
-
- ut_a(ret);
- ut_a(mess == NULL);
- }
- }
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create("noname", k, OS_FILE_TABLESPACE);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, 5, k);
- }
- }
-}
-
-/************************************************************************
-Frees the spaces in the file system. */
-
-void
-free_system(void)
-/*=============*/
-{
- ulint i;
-
- for (i = 0; i < 10; i++) {
- fil_space_free(i);
- }
-}
-
-/************************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
-
- oldtm = ut_clock();
-
- os_aio_init(160, 5);
- sync_init();
- mem_init();
- fil_init(2); /* Allow only 2 open files at a time */
-
- ut_a(fil_validate());
-
- create_files();
-
- test1();
-
- test2();
-
- free_system();
-
- tm = ut_clock();
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/fsp/fsp0fsp.c b/innobase/fsp/fsp0fsp.c
index 9d76387c6cb..77535e4c524 100644
--- a/innobase/fsp/fsp0fsp.c
+++ b/innobase/fsp/fsp0fsp.c
@@ -327,9 +327,9 @@ fsp_get_space_header(
ut_ad(mtr);
header = FSP_HEADER_OFFSET + buf_page_get(id, 0, RW_X_LATCH, mtr);
-
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(header, SYNC_FSP_PAGE);
-
+#endif /* UNIV_SYNC_DEBUG */
return(header);
}
@@ -684,7 +684,9 @@ xdes_get_descriptor_with_space_hdr(
} else {
descr_page = buf_page_get(space, descr_page_no, RW_X_LATCH,
mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(descr_page, SYNC_FSP_PAGE);
+#endif /* UNIV_SYNC_DEBUG */
}
return(descr_page + XDES_ARR_OFFSET
@@ -714,8 +716,9 @@ xdes_get_descriptor(
sp_header = FSP_HEADER_OFFSET
+ buf_page_get(space, 0, RW_X_LATCH, mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(sp_header, SYNC_FSP_PAGE);
-
+#endif /* UNIV_SYNC_DEBUG */
return(xdes_get_descriptor_with_space_hdr(sp_header, space, offset,
mtr));
}
@@ -790,19 +793,12 @@ fsp_init_file_page_low(
byte* ptr) /* in: pointer to a page */
{
page_t* page;
-#ifdef UNIV_BASIC_LOG_DEBUG
- ulint i;
-#endif
page = buf_frame_align(ptr);
buf_block_align(page)->check_index_page_at_flush = FALSE;
-
-#ifdef UNIV_BASIC_LOG_DEBUG
-/* printf("In log debug version: Erase the contents of the file page\n");
-*/
- for (i = 0; i < UNIV_PAGE_SIZE; i++) {
- page[i] = (byte)0xFF;
- }
+
+#ifdef UNIV_BASIC_LOG_DEBUG
+ memset(page, 0xff, UNIV_PAGE_SIZE);
#endif
mach_write_to_8(page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM,
ut_dulint_zero);
@@ -812,6 +808,7 @@ fsp_init_file_page_low(
/***************************************************************
Inits a file page whose prior contents should be ignored. */
+static
void
fsp_init_file_page(
/*===============*/
@@ -885,9 +882,10 @@ fsp_header_init(
mtr_x_lock(fil_space_get_latch(space), mtr);
page = buf_page_create(space, 0, mtr);
-
buf_page_get(space, 0, RW_X_LATCH, mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_FSP_PAGE);
+#endif /* UNIV_SYNC_DEBUG */
/* The prior contents of the file page should be ignored */
@@ -908,8 +906,7 @@ fsp_header_init(
flst_init(header + FSP_SEG_INODES_FULL, mtr);
flst_init(header + FSP_SEG_INODES_FREE, mtr);
- mlog_write_dulint(header + FSP_SEG_ID, ut_dulint_create(0, 1),
- MLOG_8BYTES, mtr);
+ mlog_write_dulint(header + FSP_SEG_ID, ut_dulint_create(0, 1), mtr);
if (space == 0) {
fsp_fill_free_list(FALSE, space, header, mtr);
btr_create(DICT_CLUSTERED | DICT_UNIVERSAL | DICT_IBUF, space,
@@ -1250,8 +1247,10 @@ fsp_fill_free_list(
if (i > 0) {
descr_page = buf_page_create(space, i, mtr);
buf_page_get(space, i, RW_X_LATCH, mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(descr_page,
SYNC_FSP_PAGE);
+#endif /* UNIV_SYNC_DEBUG */
fsp_init_file_page(descr_page, mtr);
}
@@ -1264,11 +1263,11 @@ fsp_fill_free_list(
ibuf_page = buf_page_create(space,
i + FSP_IBUF_BITMAP_OFFSET, &ibuf_mtr);
-
buf_page_get(space, i + FSP_IBUF_BITMAP_OFFSET,
RW_X_LATCH, &ibuf_mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(ibuf_page, SYNC_FSP_PAGE);
-
+#endif /* UNIV_SYNC_DEBUG */
fsp_init_file_page(ibuf_page, &ibuf_mtr);
ibuf_bitmap_page_init(ibuf_page, &ibuf_mtr);
@@ -1429,7 +1428,7 @@ fsp_alloc_free_page(
ut_print_buf(((byte*)descr) - 500, 1000);
- ut_a(0);
+ ut_error;
}
page_no = xdes_get_offset(descr) + free;
@@ -1484,8 +1483,9 @@ fsp_alloc_free_page(
buf_page_create(space, page_no, mtr);
page = buf_page_get(space, page_no, RW_X_LATCH, mtr);
-
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_FSP_PAGE);
+#endif /* UNIV_SYNC_DEBUG */
/* Prior contents of the page should be ignored */
fsp_init_file_page(page, mtr);
@@ -1535,7 +1535,7 @@ fsp_free_page(
return;
}
- ut_a(0);
+ ut_error;
}
if (xdes_get_bit(descr, XDES_FREE_BIT, page % FSP_EXTENT_SIZE, mtr)
@@ -1605,7 +1605,7 @@ fsp_free_extent(
ut_print_buf(((byte*)descr) - 500, 1000);
- ut_a(0);
+ ut_error;
}
xdes_init(descr, mtr);
@@ -1720,15 +1720,15 @@ fsp_alloc_seg_inode_page(
buf_block_align(page)->check_index_page_at_flush = FALSE;
fil_page_set_type(page, FIL_PAGE_INODE);
-
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_FSP_PAGE);
+#endif /* UNIV_SYNC_DEBUG */
for (i = 0; i < FSP_SEG_INODES_PER_PAGE; i++) {
inode = fsp_seg_inode_page_get_nth_inode(page, i, mtr);
- mlog_write_dulint(inode + FSEG_ID, ut_dulint_zero,
- MLOG_8BYTES, mtr);
+ mlog_write_dulint(inode + FSEG_ID, ut_dulint_zero, mtr);
}
flst_add_last(space_header + FSP_SEG_INODES_FREE,
@@ -1768,7 +1768,9 @@ fsp_alloc_seg_inode(
page = buf_page_get(buf_frame_get_space_id(space_header), page_no,
RW_X_LATCH, mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_FSP_PAGE);
+#endif /* UNIV_SYNC_DEBUG */
n = fsp_seg_inode_page_find_free(page, 0, mtr);
@@ -1821,7 +1823,7 @@ fsp_free_seg_inode(
page + FSEG_INODE_PAGE_NODE, mtr);
}
- mlog_write_dulint(inode + FSEG_ID, ut_dulint_zero, MLOG_8BYTES, mtr);
+ mlog_write_dulint(inode + FSEG_ID, ut_dulint_zero, mtr);
mlog_write_ulint(inode + FSEG_MAGIC_N, 0, MLOG_4BYTES, mtr);
if (ULINT_UNDEFINED == fsp_seg_inode_page_find_used(page, mtr)) {
@@ -2020,9 +2022,11 @@ fseg_create_general(
mtr);
}
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex)
|| mtr_memo_contains(mtr, fil_space_get_latch(space),
MTR_MEMO_X_LOCK));
+#endif /* UNIV_SYNC_DEBUG */
latch = fil_space_get_latch(space);
mtr_x_lock(latch, mtr);
@@ -2056,12 +2060,12 @@ fseg_create_general(
/* Read the next segment id from space header and increment the
value in space header */
- seg_id = mtr_read_dulint(space_header + FSP_SEG_ID, MLOG_8BYTES, mtr);
+ seg_id = mtr_read_dulint(space_header + FSP_SEG_ID, mtr);
mlog_write_dulint(space_header + FSP_SEG_ID, ut_dulint_add(seg_id, 1),
- MLOG_8BYTES, mtr);
+ mtr);
- mlog_write_dulint(inode + FSEG_ID, seg_id, MLOG_8BYTES, mtr);
+ mlog_write_dulint(inode + FSEG_ID, seg_id, mtr);
mlog_write_ulint(inode + FSEG_NOT_FULL_N_USED, 0, MLOG_4BYTES, mtr);
flst_init(inode + FSEG_FREE, mtr);
@@ -2176,9 +2180,11 @@ fseg_n_reserved_pages(
space = buf_frame_get_space_id(header);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex)
|| mtr_memo_contains(mtr, fil_space_get_latch(space),
MTR_MEMO_X_LOCK));
+#endif /* UNIV_SYNC_DEBUG */
mtr_x_lock(fil_space_get_latch(space), mtr);
inode = fseg_inode_get(header, mtr);
@@ -2241,8 +2247,8 @@ fseg_fill_free_list(
xdes_set_state(descr, XDES_FSEG, mtr);
- seg_id = mtr_read_dulint(inode + FSEG_ID, MLOG_8BYTES, mtr);
- mlog_write_dulint(descr + XDES_ID, seg_id, MLOG_8BYTES, mtr);
+ seg_id = mtr_read_dulint(inode + FSEG_ID, mtr);
+ mlog_write_dulint(descr + XDES_ID, seg_id, mtr);
flst_add_last(inode + FSEG_FREE, descr + XDES_FLST_NODE, mtr);
hint += FSP_EXTENT_SIZE;
@@ -2283,10 +2289,10 @@ fseg_alloc_free_extent(
return(NULL);
}
- seg_id = mtr_read_dulint(inode + FSEG_ID, MLOG_8BYTES, mtr);
+ seg_id = mtr_read_dulint(inode + FSEG_ID, mtr);
xdes_set_state(descr, XDES_FSEG, mtr);
- mlog_write_dulint(descr + XDES_ID, seg_id, MLOG_8BYTES, mtr);
+ mlog_write_dulint(descr + XDES_ID, seg_id, mtr);
flst_add_last(inode + FSEG_FREE, descr + XDES_FLST_NODE, mtr);
/* Try to fill the segment free list */
@@ -2336,7 +2342,7 @@ fseg_alloc_free_page_low(
ut_ad((direction >= FSP_UP) && (direction <= FSP_NO_DIR));
ut_ad(mach_read_from_4(seg_inode + FSEG_MAGIC_N) ==
FSEG_MAGIC_N_VALUE);
- seg_id = mtr_read_dulint(seg_inode + FSEG_ID, MLOG_8BYTES, mtr);
+ seg_id = mtr_read_dulint(seg_inode + FSEG_ID, mtr);
ut_ad(ut_dulint_cmp(seg_id, ut_dulint_zero) > 0);
@@ -2357,8 +2363,7 @@ fseg_alloc_free_page_low(
/*-------------------------------------------------------------*/
if ((xdes_get_state(descr, mtr) == XDES_FSEG)
&& (0 == ut_dulint_cmp(mtr_read_dulint(descr + XDES_ID,
- MLOG_8BYTES, mtr),
- seg_id))
+ mtr), seg_id))
&& (xdes_get_bit(descr, XDES_FREE_BIT,
hint % FSP_EXTENT_SIZE, mtr) == TRUE)) {
@@ -2380,8 +2385,7 @@ fseg_alloc_free_page_low(
ut_a(ret_descr == descr);
xdes_set_state(ret_descr, XDES_FSEG, mtr);
- mlog_write_dulint(ret_descr + XDES_ID, seg_id, MLOG_8BYTES,
- mtr);
+ mlog_write_dulint(ret_descr + XDES_ID, seg_id, mtr);
flst_add_last(seg_inode + FSEG_FREE,
ret_descr + XDES_FLST_NODE, mtr);
@@ -2410,8 +2414,7 @@ fseg_alloc_free_page_low(
/*-------------------------------------------------------------*/
} else if ((xdes_get_state(descr, mtr) == XDES_FSEG)
&& (0 == ut_dulint_cmp(mtr_read_dulint(descr + XDES_ID,
- MLOG_8BYTES, mtr),
- seg_id))
+ mtr), seg_id))
&& (!xdes_is_full(descr, mtr))) {
/* 4. We can take the page from the same extent as the
@@ -2512,7 +2515,9 @@ fseg_alloc_free_page_low(
ut_a(page == buf_page_get(space, ret_page, RW_X_LATCH, mtr));
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_FSP_PAGE);
+#endif /* UNIV_SYNC_DEBUG */
/* The prior contents of the page should be ignored */
fsp_init_file_page(page, mtr);
@@ -2566,9 +2571,11 @@ fseg_alloc_free_page_general(
space = buf_frame_get_space_id(seg_header);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex)
|| mtr_memo_contains(mtr, fil_space_get_latch(space),
MTR_MEMO_X_LOCK));
+#endif /* UNIV_SYNC_DEBUG */
latch = fil_space_get_latch(space);
mtr_x_lock(latch, mtr);
@@ -2714,9 +2721,11 @@ fsp_reserve_free_extents(
ulint n_pages_added;
ut_ad(mtr);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex)
|| mtr_memo_contains(mtr, fil_space_get_latch(space),
MTR_MEMO_X_LOCK));
+#endif /* UNIV_SYNC_DEBUG */
*n_reserved = n_ext;
latch = fil_space_get_latch(space);
@@ -2814,8 +2823,9 @@ fsp_get_available_space_in_free_extents(
rw_lock_t* latch;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex));
-
+#endif /* UNIV_SYNC_DEBUG */
mtr_start(&mtr);
latch = fil_space_get_latch(space);
@@ -2969,7 +2979,7 @@ fseg_free_page_low(
fprintf(stderr,
"InnoDB: If the InnoDB recovery crashes here, see section 6.1\n"
"InnoDB: of http://www.innodb.com/ibman.html about forcing recovery.\n");
- ut_a(0);
+ ut_error;
}
state = xdes_get_state(descr, mtr);
@@ -2994,8 +3004,8 @@ fseg_free_page_low(
/* If we get here, the page is in some extent of the segment */
- descr_id = mtr_read_dulint(descr + XDES_ID, MLOG_8BYTES, mtr);
- seg_id = mtr_read_dulint(seg_inode + FSEG_ID, MLOG_8BYTES, mtr);
+ descr_id = mtr_read_dulint(descr + XDES_ID, mtr);
+ seg_id = mtr_read_dulint(seg_inode + FSEG_ID, mtr);
/*
fprintf(stderr,
"InnoDB: InnoDB is freeing space %lu page %lu,\n"
@@ -3028,7 +3038,7 @@ fseg_free_page_low(
fprintf(stderr,
"InnoDB: If the InnoDB recovery crashes here, see section 6.1\n"
"InnoDB: of http://www.innodb.com/ibman.html about forcing recovery.\n");
- ut_a(0);
+ ut_error;
}
not_full_n_used = mtr_read_ulint(seg_inode + FSEG_NOT_FULL_N_USED,
@@ -3072,9 +3082,11 @@ fseg_free_page(
{
fseg_inode_t* seg_inode;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex)
|| mtr_memo_contains(mtr, fil_space_get_latch(space),
MTR_MEMO_X_LOCK));
+#endif /* UNIV_SYNC_DEBUG */
mtr_x_lock(fil_space_get_latch(space), mtr);
seg_inode = fseg_inode_get(seg_header, mtr);
@@ -3109,8 +3121,8 @@ fseg_free_extent(
ut_a(xdes_get_state(descr, mtr) == XDES_FSEG);
ut_a(0 == ut_dulint_cmp(
- mtr_read_dulint(descr + XDES_ID, MLOG_8BYTES, mtr),
- mtr_read_dulint(seg_inode + FSEG_ID, MLOG_8BYTES, mtr)));
+ mtr_read_dulint(descr + XDES_ID, mtr),
+ mtr_read_dulint(seg_inode + FSEG_ID, mtr)));
first_page_in_extent = page - (page % FSP_EXTENT_SIZE);
@@ -3181,9 +3193,11 @@ fseg_free_step(
space = buf_frame_get_space_id(header);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex)
|| mtr_memo_contains(mtr, fil_space_get_latch(space),
MTR_MEMO_X_LOCK));
+#endif /* UNIV_SYNC_DEBUG */
mtr_x_lock(fil_space_get_latch(space), mtr);
descr = xdes_get_descriptor(space, buf_frame_get_page_no(header), mtr);
@@ -3254,9 +3268,11 @@ fseg_free_step_not_header(
space = buf_frame_get_space_id(header);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex)
|| mtr_memo_contains(mtr, fil_space_get_latch(space),
MTR_MEMO_X_LOCK));
+#endif /* UNIV_SYNC_DEBUG */
mtr_x_lock(fil_space_get_latch(space), mtr);
inode = fseg_inode_get(header, mtr);
@@ -3398,7 +3414,7 @@ fseg_validate_low(
space = buf_frame_get_space_id(inode);
- seg_id = mtr_read_dulint(inode + FSEG_ID, MLOG_8BYTES, mtr2);
+ seg_id = mtr_read_dulint(inode + FSEG_ID, mtr2);
n_used = mtr_read_ulint(inode + FSEG_NOT_FULL_N_USED,
MLOG_4BYTES, mtr2);
flst_validate(inode + FSEG_FREE, mtr2);
@@ -3417,8 +3433,7 @@ fseg_validate_low(
ut_a(xdes_get_n_used(descr, &mtr) == 0);
ut_a(xdes_get_state(descr, &mtr) == XDES_FSEG);
ut_a(0 == ut_dulint_cmp(
- mtr_read_dulint(descr + XDES_ID, MLOG_8BYTES,
- &mtr), seg_id));
+ mtr_read_dulint(descr + XDES_ID, &mtr), seg_id));
node_addr = flst_get_next_addr(descr + XDES_FLST_NODE, &mtr);
mtr_commit(&mtr);
@@ -3438,8 +3453,7 @@ fseg_validate_low(
ut_a(xdes_get_n_used(descr, &mtr) < FSP_EXTENT_SIZE);
ut_a(xdes_get_state(descr, &mtr) == XDES_FSEG);
ut_a(0 == ut_dulint_cmp(
- mtr_read_dulint(descr + XDES_ID, MLOG_8BYTES,
- &mtr), seg_id));
+ mtr_read_dulint(descr + XDES_ID, &mtr), seg_id));
n_used2 += xdes_get_n_used(descr, &mtr);
@@ -3460,8 +3474,7 @@ fseg_validate_low(
ut_a(xdes_get_n_used(descr, &mtr) == FSP_EXTENT_SIZE);
ut_a(xdes_get_state(descr, &mtr) == XDES_FSEG);
ut_a(0 == ut_dulint_cmp(
- mtr_read_dulint(descr + XDES_ID, MLOG_8BYTES,
- &mtr), seg_id));
+ mtr_read_dulint(descr + XDES_ID, &mtr), seg_id));
node_addr = flst_get_next_addr(descr + XDES_FLST_NODE, &mtr);
mtr_commit(&mtr);
@@ -3526,7 +3539,7 @@ fseg_print_low(
reserved = fseg_n_reserved_pages_low(inode, &used, mtr);
- d_var = mtr_read_dulint(inode + FSEG_ID, MLOG_8BYTES, mtr);
+ d_var = mtr_read_dulint(inode + FSEG_ID, mtr);
seg_id_low = ut_dulint_get_low(d_var);
seg_id_high = ut_dulint_get_high(d_var);
@@ -3844,7 +3857,7 @@ fsp_print(
n_free_frag = flst_get_len(header + FSP_FREE_FRAG, &mtr);
n_full_frag = flst_get_len(header + FSP_FULL_FRAG, &mtr);
- d_var = mtr_read_dulint(header + FSP_SEG_ID, MLOG_8BYTES, &mtr);
+ d_var = mtr_read_dulint(header + FSP_SEG_ID, &mtr);
seg_id_low = ut_dulint_get_low(d_var);
seg_id_high = ut_dulint_get_high(d_var);
diff --git a/innobase/fsp/trash/FSP0FSP.C b/innobase/fsp/trash/FSP0FSP.C
deleted file mode 100644
index b0add437bff..00000000000
--- a/innobase/fsp/trash/FSP0FSP.C
+++ /dev/null
@@ -1,3100 +0,0 @@
-/**********************************************************************
-File-space management
-
-(c) 1995 Innobase Oy
-
-Created 11/29/1995 Heikki Tuuri
-***********************************************************************/
-
-#include "fsp0fsp.h"
-
-#include "buf0buf.h"
-#include "fil0fil.h"
-#include "sync0sync.h"
-#include "mtr0log.h"
-#include "fut0fut.h"
-#include "ut0byte.h"
-
-/* The data structures in files are defined just as byte strings in C */
-typedef byte fsp_header_t;
-typedef byte xdes_t;
-typedef byte fseg_page_header_t;
-
-/* Rw-latch protecting the whole file space system */
-rw_lock_t fsp_latch;
-
-
-/* SPACE HEADER
- ============
-
-File space header data structure: this data structure
-is contained in the first page of a space. The space for this header
-is reserved in every extent descriptor page, but used only in the first. */
-#define FSP_HEADER_OFFSET FIL_PAGE_DATA /* Offset of the space header
- within a file page */
-/*-------------------------------------*/
-#define FSP_SIZE 0 /* Current
- size of the space in pages */
-#define FSP_FREE_LIMIT 4 /* Minimum page number for which
- the free list has not been initialized:
- the pages >= this limit are, by
- definition, free */
-#define FSP_LOWEST_NO_WRITE 8 /* The lowest page offset for which
- the page has not been written to disk
- (if it has been written, we know
- that the OS has really reserved
- the physical space for the page) */
-#define FSP_FRAG_N_USED 12 /* number of used pages in
- the FSP_FREE_FRAG list */
-#define FSP_FREE 16 /* list of free extents */
-#define FSP_FREE_FRAG (16 + FLST_BASE_NODE_SIZE)
- /* list of partially free extents not
- belonging to any segment */
-#define FSP_FULL_FRAG (16 + 2 * FLST_BASE_NODE_SIZE)
- /* list of full extents not belonging
- to any segment */
-#define FSP_SEG_ID (16 + 3 * FLST_BASE_NODE_SIZE)
- /* 8 bytes which give the first
-#define FSP_SEG_HDRS_FULL (24 + 3 * FLST_BASE_NODE_SIZE)
- /* list of pages containing segment
- headers, where all the segment header
- slots are reserved */
-#define FSP_SEG_HDRS_FREE (24 + 4 * FLST_BASE_NODE_SIZE)
- /* list of pages containing segment
- headers, where not all the segment
- header slots are reserved */
-/*-------------------------------------*/
-/* File space header size */
-#define FSP_HEADER_SIZE (24 + 4 * FLST_BASE_NODE_SIZE)
-
-#define FSP_FREE_ADD 4 /* this many free extents are added
- to the free list from above
- FSP_FREE_LIMIT at a time */
-
-
-/* SEGMENT HEADER
- ==============
-
-Segment header which is created for each segment in a tablespace, on a
-page of its own. NOTE: in purge we assume that a segment having only one
-currently used page can be freed in a few steps, so that the freeing cannot
-fill the file buffer with bufferfixed file pages. */
-
-#define FSEG_HDR_PAGE_NODE FSEG_PAGE_DATA
- /* the list node for linking
- segment header pages */
-
-#define FSEG_ARR_OFFSET (FSEG_PAGE_DATA + FLST_NODE_SIZE)
-/*-------------------------------------*/
-#define FSEG_ID 0 /* 8 bytes of segment id: if this is
- ut_dulint_zero, it means that the
- header is unused */
-#define FSEG_NOT_FULL_N_USED 8
- /* number of used segment pages in
- the FSEG_NOT_FULL list */
-#define FSEG_FREE 12
- /* list of free extents of this
- segment */
-#define FSEG_NOT_FULL (12 + FLST_BASE_NODE_SIZE)
- /* list of partially free extents */
-#define FSEG_FULL (12 + 2 * FLST_BASE_NODE_SIZE)
- /* list of full extents */
-#define FSEG_MAGIC_N (12 + 3 * FLST_BASE_NODE_SIZE)
- /* magic number used in debugging */
-#define FSEG_FRAG_ARR (16 + 3 * FLST_BASE_NODE_SIZE)
- /* array of individual pages
- belonging to this segment in fsp
- fragment extent lists */
-#define FSEG_FRAG_ARR_N_SLOTS (FSP_EXTENT_SIZE / 2)
- /* number of slots in the array for
- the fragment pages */
-#define FSEG_FRAG_SLOT_SIZE 4 /* a fragment page slot contains its
- page number within space, FIL_NULL
- means that the slot is not in use */
-/*-------------------------------------*/
-#define FSEG_HEADER_SIZE (16 + 3 * FLST_BASE_NODE_SIZE +\
- FSEG_FRAG_ARR_N_SLOTS * FSEG_FRAG_SLOT_SIZE)
-
-#define FSP_SEG_HDRS_PER_PAGE ((UNIV_PAGE_SIZE - FSEG_ARR_OFFSET - 10)\
- / FSEG_HEADER_SIZE)
- /* Number of segment headers which fit on a
- single page */
-
-#define FSEG_MAGIC_N_VALUE 97937874
-
-#define FSEG_FILLFACTOR 8 /* If this value is x, then if
- the number of unused but reserved
- pages in a segment is less than
- reserved pages * 1/x, and there are
- at least FSEG_FRAG_LIMIT used pages,
- then we allow a new empty extent to
- be added to the segment in
- fseg_alloc_free_page. Otherwise, we
- use unused pages of the segment. */
-
-#define FSEG_FRAG_LIMIT FSEG_FRAG_N_ARR_SLOTS
- /* If the segment has >= this many
- used pages, it may be expanded by
- allocating extents to the segment;
- until that only individual fragment
- pages are allocated from the space */
-
-#define FSEG_FREE_LIST_LIMIT 40 /* If the reserved size of a segment
- is at least this many extents, we
- allow extents to be put to the free
- list of the extent: at most
- FSEG_FREE_LIST_MAX_LEN many */
-#define FSEG_FREE_LIST_MAX_LEN 4
-
-
-/* EXTENT DESCRIPTOR
- =================
-
-File extent descriptor data structure: contains bits to tell
-which pages in the extent are free and which contain old tuple
-version to clean. */
-
-/*-------------------------------------*/
-#define XDES_ID 0 /* The identifier of the segment
- to which this extent belongs */
-#define XDES_FLST_NODE 8 /* The list node data structure
- for the descriptors */
-#define XDES_STATE (FLST_NODE_SIZE + 8)
- /* contains state information
- of the extent */
-#define XDES_BITMAP (FLST_NODE_SIZE + 12)
- /* Descriptor bitmap of the pages
- in the extent*/
-/*-------------------------------------*/
-
-#define XDES_BITS_PER_PAGE 2 /* How many bits are there per page */
-#define XDES_FREE_BIT 0 /* Index of the bit which tells if
- the page is free */
-#define XDES_CLEAN_BIT 1 /* Index of the bit which tells if
- there are old versions of tuples
- on the page */
-/* States of a descriptor */
-#define XDES_FREE 1 /* extent is in free list of space */
-#define XDES_FREE_FRAG 2 /* extent is in free fragment list of
- space */
-#define XDES_FULL_FRAG 3 /* extent is in full fragment list of
- space */
-#define XDES_FSEG 4 /* extent belongs to a segment*/
-
-/* Number of pages described in a single descriptor page:
-currently each page description takes less than
-1 byte. */
-#define XDES_DESCRIBED_PER_PAGE UNIV_PAGE_SIZE
-
-/* File extent data structure size in bytes. The "+ 7 ) / 8"
-part in the definition rounds the number of bytes upward. */
-#define XDES_SIZE (XDES_BITMAP +\
- (FSP_EXTENT_SIZE * XDES_BITS_PER_PAGE + 7) / 8)
-
-/* Offset of the descriptor array on a descriptor page */
-#define XDES_ARR_OFFSET (FSP_HEADER_OFFSET + FSP_HEADER_SIZE)
-
-/**************************************************************************
-Returns an extent to the free list of a space. */
-static
-void
-fsp_free_extent(
-/*============*/
- ulint space, /* in: space id */
- ulint page, /* in: page offset in the extent */
- mtr_t* mtr); /* in: mtr */
-/**************************************************************************
-Frees an extent of a segment to the space free list. */
-static
-void
-fseg_free_extent(
-/*=============*/
- fseg_header_t* seg_header, /* in: segment header */
- ulint space, /* in: space id */
- ulint page, /* in: page offset in the extent */
- mtr_t* mtr); /* in: mtr handle */
-/**************************************************************************
-Calculates the number of pages reserved by a segment, and how
-many pages are currently used. */
-static
-ulint
-fseg_n_reserved_pages_low(
-/*======================*/
- /* out: number of reserved pages */
- fseg_header_t* header, /* in: segment header */
- ulint* used, /* out: number of pages used (<= reserved) */
- mtr_t* mtr); /* in: mtr handle */
-/************************************************************************
-Marks a page used. The page must reside within the extents of the given
-segment. */
-static
-void
-fseg_mark_page_used(
-/*================*/
- fseg_header_t* seg_header,/* in: segment header */
- ulint space, /* in: space id */
- ulint page, /* in: page offset */
- mtr_t* mtr); /* in: mtr */
-/**************************************************************************
-Frees a single page of a segment. */
-static
-void
-fseg_free_page_low(
-/*===============*/
- fseg_header_t* seg_header, /* in: segment header */
- ulint space, /* in: space id */
- ulint page, /* in: page offset */
- mtr_t* mtr); /* in: mtr handle */
-/**************************************************************************
-Returns the first extent descriptor for a segment. We think of the extent
-lists of the segment catenated in the order FSEG_FULL -> FSEG_NOT_FULL
--> FSEG_FREE. */
-static
-xdes_t*
-fseg_get_first_extent(
-/*==================*/
- /* out: the first extent descriptor, or NULL if
- none */
- fseg_header_t* header, /* in: segment header */
- mtr_t* mtr); /* in: mtr */
-/**************************************************************************
-Puts new extents to the free list if
-there are free extents above the free limit. If an extent happens
-to contain an extent descriptor page, the extent is put to
-the FSP_FREE_FRAG list with the page marked as used. */
-static
-void
-fsp_fill_free_list(
-/*===============*/
- ulint space, /* in: space */
- fsp_header_t* header, /* in: space header */
- mtr_t* mtr); /* in: mtr */
-
-/**************************************************************************
-Gets a descriptor bit of a page. */
-UNIV_INLINE
-bool
-xdes_get_bit(
-/*=========*/
- /* out: TRUE if free */
- xdes_t* descr, /* in: descriptor */
- ulint bit, /* in: XDES_FREE_BIT or XDES_CLEAN_BIT */
- ulint offset, /* in: page offset within extent:
- 0 ... FSP_EXTENT_SIZE - 1 */
- mtr_t* mtr) /* in: mtr */
-{
- ulint index;
- ulint byte_index;
- ulint bit_index;
-
- ut_ad(mtr_memo_contains(mtr, buf_block_align(descr),
- MTR_MEMO_PAGE_X_LOCK));
- ut_ad((bit == XDES_FREE_BIT) || (bit == XDES_CLEAN_BIT));
- ut_ad(offset < FSP_EXTENT_SIZE);
-
- index = bit + XDES_BITS_PER_PAGE * offset;
-
- byte_index = index / 8;
- bit_index = index % 8;
-
- return(ut_bit_get_nth(
- mtr_read_ulint(descr + XDES_BITMAP + byte_index,
- MLOG_1BYTE, mtr),
- bit_index));
-}
-
-/**************************************************************************
-Sets a descriptor bit of a page. */
-UNIV_INLINE
-void
-xdes_set_bit(
-/*=========*/
- xdes_t* descr, /* in: descriptor */
- ulint bit, /* in: XDES_FREE_BIT or XDES_CLEAN_BIT */
- ulint offset, /* in: page offset within extent:
- 0 ... FSP_EXTENT_SIZE - 1 */
- bool val, /* in: bit value */
- mtr_t* mtr) /* in: mtr */
-{
- ulint index;
- ulint byte_index;
- ulint bit_index;
- ulint descr_byte;
-
- ut_ad(mtr_memo_contains(mtr, buf_block_align(descr),
- MTR_MEMO_PAGE_X_LOCK));
- ut_ad((bit == XDES_FREE_BIT) || (bit == XDES_CLEAN_BIT));
- ut_ad(offset < FSP_EXTENT_SIZE);
-
- index = bit + XDES_BITS_PER_PAGE * offset;
-
- byte_index = index / 8;
- bit_index = index % 8;
-
- descr_byte = mtr_read_ulint(descr + XDES_BITMAP + byte_index,
- MLOG_1BYTE, mtr);
-
- descr_byte = ut_bit_set_nth(descr_byte, bit_index, val);
-
- mlog_write_ulint(descr + XDES_BITMAP + byte_index,
- descr_byte, MLOG_1BYTE, mtr);
-}
-
-/**************************************************************************
-Looks for a descriptor bit having the desired value. Starts from hint
-and scans upward; at the end of the extent the search is wrapped to
-the start of the extent. */
-UNIV_INLINE
-ulint
-xdes_find_bit(
-/*==========*/
- /* out: bit index of the bit,
- ULINT_UNDEFINED if not found */
- xdes_t* descr, /* in: descriptor */
- ulint bit, /* in: XDES_FREE_BIT or XDES_CLEAN_BIT */
- bool val, /* in: desired bit value */
- ulint hint, /* in: hint of which bit position would be
- desirable */
- mtr_t* mtr) /* in: mtr */
-{
- ulint i;
-
- ut_ad(descr && mtr);
- ut_ad(val <= TRUE);
- ut_ad(hint < FSP_EXTENT_SIZE);
- ut_ad(mtr_memo_contains(mtr, buf_block_align(descr),
- MTR_MEMO_PAGE_X_LOCK));
-
- for (i = hint; i < FSP_EXTENT_SIZE; i++) {
- if (val == xdes_get_bit(descr, bit, i, mtr)) {
- return(i);
- }
- }
-
- for (i = 0; i < hint; i++) {
- if (val == xdes_get_bit(descr, bit, i, mtr)) {
- return(i);
- }
- }
-
- return(ULINT_UNDEFINED);
-}
-
-/**************************************************************************
-Looks for a descriptor bit having the desired value. Scans the extent in
-a direction opposite to xdes_find_bit. */
-UNIV_INLINE
-ulint
-xdes_find_bit_downward(
-/*===================*/
- /* out: bit index of the bit,
- ULINT_UNDEFINED if not found */
- xdes_t* descr, /* in: descriptor */
- ulint bit, /* in: XDES_FREE_BIT or XDES_CLEAN_BIT */
- bool val, /* in: desired bit value */
- ulint hint, /* in: hint of which bit position would be
- desirable */
- mtr_t* mtr) /* in: mtr */
-{
- ulint i;
-
- ut_ad(descr && mtr);
- ut_ad(val <= TRUE);
- ut_ad(hint < FSP_EXTENT_SIZE);
- ut_ad(mtr_memo_contains(mtr, buf_block_align(descr),
- MTR_MEMO_PAGE_X_LOCK));
-
- for (i = hint + 1; i > 0; i--) {
- if (val == xdes_get_bit(descr, bit, i - 1, mtr)) {
- return(i - 1);
- }
- }
-
- for (i = FSP_EXTENT_SIZE - 1; i > hint; i--) {
- if (val == xdes_get_bit(descr, bit, i, mtr)) {
- return(i);
- }
- }
-
- return(ULINT_UNDEFINED);
-}
-
-/**************************************************************************
-Returns the number of used pages in a descriptor. */
-UNIV_INLINE
-ulint
-xdes_get_n_used(
-/*============*/
- /* out: number of pages used */
- xdes_t* descr, /* in: descriptor */
- mtr_t* mtr) /* in: mtr */
-{
- ulint i;
- ulint count = 0;
-
- ut_ad(descr && mtr);
- ut_ad(mtr_memo_contains(mtr, buf_block_align(descr),
- MTR_MEMO_PAGE_X_LOCK));
-
- for (i = 0; i < FSP_EXTENT_SIZE; i++) {
- if (FALSE == xdes_get_bit(descr, XDES_FREE_BIT, i, mtr)) {
- count++;
- }
- }
-
- return(count);
-}
-
-/**************************************************************************
-Returns true if extent contains no used pages. */
-UNIV_INLINE
-bool
-xdes_is_free(
-/*=========*/
- /* out: TRUE if totally free */
- xdes_t* descr, /* in: descriptor */
- mtr_t* mtr) /* in: mtr */
-{
- if (0 == xdes_get_n_used(descr, mtr)) {
- return(TRUE);
- } else {
- return(FALSE);
- }
-}
-
-/**************************************************************************
-Returns true if extent contains no free pages. */
-UNIV_INLINE
-bool
-xdes_is_full(
-/*=========*/
- /* out: TRUE if full */
- xdes_t* descr, /* in: descriptor */
- mtr_t* mtr) /* in: mtr */
-{
- if (FSP_EXTENT_SIZE == xdes_get_n_used(descr, mtr)) {
- return(TRUE);
- } else {
- return(FALSE);
- }
-}
-
-/**************************************************************************
-Sets the state of an xdes. */
-UNIV_INLINE
-void
-xdes_set_state(
-/*===========*/
- xdes_t* descr, /* in: descriptor */
- ulint state, /* in: state to set */
- mtr_t* mtr) /* in: mtr handle */
-{
- ut_ad(descr && mtr);
- ut_ad(state >= XDES_FREE);
- ut_ad(state <= XDES_FSEG);
- ut_ad(mtr_memo_contains(mtr, buf_block_align(descr),
- MTR_MEMO_PAGE_X_LOCK));
-
- mlog_write_ulint(descr + XDES_STATE, state, MLOG_4BYTES, mtr);
-}
-
-/**************************************************************************
-Gets the state of an xdes. */
-UNIV_INLINE
-ulint
-xdes_get_state(
-/*===========*/
- /* out: state */
- xdes_t* descr, /* in: descriptor */
- mtr_t* mtr) /* in: mtr handle */
-{
- ut_ad(descr && mtr);
- ut_ad(mtr_memo_contains(mtr, buf_block_align(descr),
- MTR_MEMO_PAGE_X_LOCK));
-
- return(mtr_read_ulint(descr + XDES_STATE, MLOG_4BYTES, mtr));
-}
-
-/**************************************************************************
-Inits an extent descriptor to free and clean state. */
-UNIV_INLINE
-void
-xdes_init(
-/*======*/
- xdes_t* descr, /* in: descriptor */
- mtr_t* mtr) /* in: mtr */
-{
- ulint i;
-
- ut_ad(descr && mtr);
- ut_ad(mtr_memo_contains(mtr, buf_block_align(descr),
- MTR_MEMO_PAGE_X_LOCK));
-
- for (i = 0; i < FSP_EXTENT_SIZE; i++) {
- xdes_set_bit(descr, XDES_FREE_BIT, i, TRUE, mtr);
- xdes_set_bit(descr, XDES_CLEAN_BIT, i, TRUE, mtr);
- }
-
- xdes_set_state(descr, XDES_FREE, mtr);
-}
-
-/************************************************************************
-Calculates the page where the descriptor of a page resides. */
-UNIV_INLINE
-ulint
-xdes_calc_descriptor_page(
-/*======================*/
- /* out: descriptor page offset */
- ulint offset) /* in: page offset */
-{
- ut_ad(UNIV_PAGE_SIZE > XDES_ARR_OFFSET
- + (XDES_DESCRIBED_PER_PAGE / FSP_EXTENT_SIZE) * XDES_SIZE);
-
- return(ut_2pow_round(offset, XDES_DESCRIBED_PER_PAGE));
-}
-
-/************************************************************************
-Calculates the descriptor index within a descriptor page. */
-UNIV_INLINE
-ulint
-xdes_calc_descriptor_index(
-/*=======================*/
- /* out: descriptor index */
- ulint offset) /* in: page offset */
-{
- return(ut_2pow_remainder(offset, XDES_DESCRIBED_PER_PAGE) /
- FSP_EXTENT_SIZE);
-}
-
-/************************************************************************
-Gets pointer to a the extent descriptor of a page. The page where the
-extent descriptor resides is x-locked. If the page offset is equal to the free
-limit of the space, adds new extents from above the free limit
-to the space free list, if not free limit == space size. This adding
-is necessary to make the descriptor defined, as they are uninitialized
-above the free limit. */
-UNIV_INLINE
-xdes_t*
-xdes_get_descriptor_with_space_hdr(
-/*===============================*/
- /* out: pointer to the extent descriptor,
- NULL if the page does not exist in the
- space or if offset > free limit */
- fsp_header_t* sp_header,/* in: space header, x-latched */
- ulint space, /* in: space id */
- ulint offset, /* in: page offset;
- if equal to the free limit,
- we try to add new extents to
- the space free list */
- mtr_t* mtr) /* in: mtr handle */
-{
- ulint limit;
- ulint size;
- buf_block_t* buf_page;
- ulint descr_page_no;
- page_t* descr_page;
-
- ut_ad(mtr);
- ut_ad(mtr_memo_contains(mtr, &fsp_latch, MTR_MEMO_X_LOCK));
-
- /* Read free limit and space size */
- limit = mtr_read_ulint(sp_header + FSP_FREE_LIMIT, MLOG_4BYTES, mtr);
- size = mtr_read_ulint(sp_header + FSP_SIZE, MLOG_4BYTES, mtr);
-
- /* If offset is >= size or > limit, return NULL */
- if ((offset >= size) || (offset > limit)) {
- return(NULL);
- }
-
- /* If offset is == limit, fill free list of the space. */
- if (offset == limit) {
- fsp_fill_free_list(space, sp_header, mtr);
- }
-
- descr_page_no = xdes_calc_descriptor_page(offset);
-
- if (descr_page_no == 0) {
- /* It is on the space header page */
-
- descr_page = buf_frame_align(sp_header);
- } else {
-
- buf_page = buf_page_get(space, descr_page_no, mtr);
- buf_page_x_lock(buf_page, mtr);
- descr_page = buf_block_get_frame(buf_page);
- }
-
- return(descr_page + XDES_ARR_OFFSET
- + XDES_SIZE * xdes_calc_descriptor_index(offset));
-}
-
-/************************************************************************
-Gets pointer to a the extent descriptor of a page. The page where the
-extent descriptor resides is x-locked. If the page offset is equal to the free
-limit of the space, adds new extents from above the free limit
-to the space free list, if not free limit == space size. This adding
-is necessary to make the descriptor defined, as they are uninitialized
-above the free limit. */
-static
-xdes_t*
-xdes_get_descriptor(
-/*================*/
- /* out: pointer to the extent descriptor,
- NULL if the page does not exist in the
- space or if offset > free limit */
- ulint space, /* in: space id */
- ulint offset, /* in: page offset;
- if equal to the free limit,
- we try to add new extents to
- the space free list */
- mtr_t* mtr) /* in: mtr handle */
-{
- fsp_header_t* sp_header;
- buf_block_t* block;
-
- block = buf_page_get(space, 0, mtr); /* get space header */
- sp_header = FSP_HEADER_OFFSET + buf_block_get_frame(block);
- buf_page_x_lock(block, mtr);
-
- return(xdes_get_descriptor_with_space_hdr(sp_header, space, offset,
- mtr));
-}
-
-/************************************************************************
-Gets pointer to a the extent descriptor if the file address
-of the descriptor list node is known. The page where the
-extent descriptor resides is x-locked. */
-UNIV_INLINE
-xdes_t*
-xdes_lst_get_descriptor(
-/*====================*/
- /* out: pointer to the extent descriptor */
- ulint space, /* in: space id */
- fil_addr_t lst_node,/* in: file address of the list node
- contained in the descriptor */
- mtr_t* mtr) /* in: mtr handle */
-{
- xdes_t* descr;
-
- ut_ad(mtr);
- ut_ad(mtr_memo_contains(mtr, &fsp_latch, MTR_MEMO_X_LOCK));
-
- descr = fut_get_ptr_x_lock(space, lst_node, mtr) - XDES_FLST_NODE;
-
- return(descr);
-}
-
-/************************************************************************
-Gets pointer to the next descriptor in a descriptor list and x-locks
-its page. */
-UNIV_INLINE
-xdes_t*
-xdes_lst_get_next(
-/*==============*/
- xdes_t* descr, /* in: pointer to a descriptor */
- mtr_t* mtr) /* in: mtr handle */
-{
- ulint space;
-
- ut_ad(mtr && descr);
-
- space = buf_page_get_space(buf_block_align(descr));
-
- return(xdes_lst_get_descriptor(space,
- flst_get_next_addr(descr + XDES_FLST_NODE, mtr), mtr));
-}
-
-/************************************************************************
-Returns page offset of the first page in extent described by a descriptor.
-*/
-UNIV_INLINE
-ulint
-xdes_get_offset(
-/*============*/
- /* out: offset of the first page in extent */
- xdes_t* descr) /* in: extent descriptor */
-{
- buf_block_t* buf_page;
-
- ut_ad(descr);
-
- buf_page = buf_block_align(descr);
-
- return(buf_page_get_offset(buf_page)
- + ((descr - buf_frame_align(descr) - XDES_ARR_OFFSET)
- / XDES_SIZE)
- * FSP_EXTENT_SIZE);
-}
-
-/**************************************************************************
-Gets a pointer to the space header and x-locks its page. */
-UNIV_INLINE
-fsp_header_t*
-fsp_get_space_header(
-/*=================*/
- /* out: pointer to the space header, page x-locked */
- ulint id, /* in: space id */
- mtr_t* mtr) /* in: mtr */
-{
- buf_block_t* block;
-
- ut_ad(mtr);
-
- block = buf_page_get(id, 0, mtr);
-
- buf_page_x_lock(block, mtr);
-
- return(FSP_HEADER_OFFSET + buf_block_get_frame(block));
-}
-
-/**************************************************************************
-Initializes the file space system mutex. */
-
-void
-fsp_init(void)
-/*==========*/
-{
- rw_lock_create(&fsp_latch);
-}
-
-/**************************************************************************
-Initializes the space header of a new created space. */
-
-void
-fsp_header_init(
-/*============*/
- ulint space, /* in: space id */
- ulint size, /* in: current size in blocks */
- mtr_t* mtr) /* in: mini-transaction handle */
-{
- fsp_header_t* header;
-
- ut_ad(mtr);
-
- mtr_x_lock(&fsp_latch, mtr);
-
- header = fsp_get_space_header(space, mtr);
-
- mlog_write_ulint(header + FSP_SIZE, size, MLOG_4BYTES, mtr);
- mlog_write_ulint(header + FSP_FREE_LIMIT, 0, MLOG_4BYTES, mtr);
- mlog_write_ulint(header + FSP_LOWEST_NO_WRITE, 0, MLOG_4BYTES, mtr);
- mlog_write_ulint(header + FSP_FRAG_N_USED, 0, MLOG_4BYTES, mtr);
-
- flst_init(header + FSP_FREE, mtr);
- flst_init(header + FSP_FREE_FRAG, mtr);
- flst_init(header + FSP_FULL_FRAG, mtr);
- flst_init(header + FSP_SEG_HDRS_FULL, mtr);
- flst_init(header + FSP_SEG_HDRS_FREE, mtr);
-
- mlog_write_dulint(header + FSP_SEG_ID, ut_dulint_create(0, 1),
- MLOG_8BYTES, mtr);
-}
-
-/**************************************************************************
-Increases the space size field of a space. */
-
-void
-fsp_header_inc_size(
-/*================*/
- ulint space, /* in: space id */
- ulint size_inc,/* in: size increment in pages */
- mtr_t* mtr) /* in: mini-transaction handle */
-{
- fsp_header_t* header;
- ulint size;
-
- ut_ad(mtr);
-
- mtr_x_lock(&fsp_latch, mtr);
-
- header = fsp_get_space_header(space, mtr);
-
- size = mtr_read_ulint(header + FSP_SIZE, MLOG_4BYTES, mtr);
- mlog_write_ulint(header + FSP_SIZE, size + size_inc, MLOG_4BYTES, mtr);
-}
-
-/**************************************************************************
-Puts new extents to the free list if there are free extents above the free
-limit. If an extent happens to contain an extent descriptor page, the extent
-is put to the FSP_FREE_FRAG list with the page marked as used. */
-static
-void
-fsp_fill_free_list(
-/*===============*/
- ulint space, /* in: space */
- fsp_header_t* header, /* in: space header */
- mtr_t* mtr) /* in: mtr */
-{
- ulint limit;
- ulint size;
- ulint i;
- xdes_t* descr;
- ulint count = 0;
- ulint frag_n_used;
-
- ut_ad(header && mtr);
-
- /* Check if we can fill free list from above the free list limit */
- size = mtr_read_ulint(header + FSP_SIZE, MLOG_4BYTES, mtr);
- limit = mtr_read_ulint(header + FSP_FREE_LIMIT, MLOG_4BYTES, mtr);
-
- i = limit;
- while ((i + FSP_EXTENT_SIZE <= size) && (count < FSP_FREE_ADD)) {
- mlog_write_ulint(header + FSP_FREE_LIMIT,
- i + FSP_EXTENT_SIZE, MLOG_4BYTES, mtr);
-
- descr = xdes_get_descriptor_with_space_hdr(header, space, i,
- mtr);
- xdes_init(descr, mtr);
-
- ut_ad(XDES_DESCRIBED_PER_PAGE % FSP_EXTENT_SIZE == 0);
-
- if (0 == i % XDES_DESCRIBED_PER_PAGE) {
- /* The first page in the extent is a descriptor page:
- mark it used */
- xdes_set_bit(descr, XDES_FREE_BIT, 0, FALSE, mtr);
- xdes_set_state(descr, XDES_FREE_FRAG, mtr);
- flst_add_last(header + FSP_FREE_FRAG,
- descr + XDES_FLST_NODE, mtr);
- frag_n_used = mtr_read_ulint(header + FSP_FRAG_N_USED,
- MLOG_4BYTES, mtr);
- mlog_write_ulint(header + FSP_FRAG_N_USED,
- frag_n_used + 1,
- MLOG_4BYTES, mtr);
- } else {
- flst_add_last(header + FSP_FREE,
- descr + XDES_FLST_NODE, mtr);
- count++;
- }
- i += FSP_EXTENT_SIZE;
- }
-}
-
-/**************************************************************************
-Allocates a new free extent. */
-static
-xdes_t*
-fsp_alloc_free_extent(
-/*==================*/
- /* out: extent descriptor, NULL if cannot
- be allocated */
- ulint space, /* in: space id */
- ulint hint, /* in: hint of which extent would be
- desirable: any page offset in the extent
- goes; the hint must not be > FSP_FREE_LIMIT */
- mtr_t* mtr) /* in: mtr */
-{
- fsp_header_t* header;
- fil_addr_t first;
- xdes_t* descr;
-
- ut_ad(mtr);
-
- header = fsp_get_space_header(space, mtr);
-
- descr = xdes_get_descriptor_with_space_hdr(header, space, hint, mtr);
-
- if (descr && (xdes_get_state(descr, mtr) == XDES_FREE)) {
- /* Ok, we can take this extent */
- } else {
- /* Take the first extent in the free list */
- first = flst_get_first(header + FSP_FREE, mtr);
-
- if (fil_addr_is_null(first)) {
- fsp_fill_free_list(space, header, mtr);
- first = flst_get_first(header + FSP_FREE, mtr);
- }
-
- if (fil_addr_is_null(first)) {
- return(NULL); /* No free extents left */
- }
-
- descr = xdes_lst_get_descriptor(space, first, mtr);
- }
-
- flst_remove(header + FSP_FREE, descr + XDES_FLST_NODE, mtr);
-
- return(descr);
-}
-
-/**************************************************************************
-Allocates a single free page from a space. The page is marked as used. */
-static
-ulint
-fsp_alloc_free_page(
-/*================*/
- /* out: the page offset, FIL_NULL
- if no page could be allocated */
- ulint space, /* in: space id */
- ulint hint, /* in: hint of which page would be desirable */
- mtr_t* mtr) /* in: mtr handle */
-{
- fsp_header_t* header;
- fil_addr_t first;
- xdes_t* descr;
- ulint free;
- ulint frag_n_used;
-
- ut_ad(mtr);
-
- header = fsp_get_space_header(space, mtr);
-
- /* Get the hinted descriptor */
- descr = xdes_get_descriptor_with_space_hdr(header, space, hint, mtr);
-
- if (descr && (xdes_get_state(descr, mtr) == XDES_FREE_FRAG)) {
- /* Ok, we can take this extent */
- } else {
- /* Else take the first extent in free_frag list */
- first = flst_get_first(header + FSP_FREE_FRAG, mtr);
-
- if (fil_addr_is_null(first)) {
- /* There are no partially full fragments: allocate
- a free extent and add it to the FREE_FRAG
- list. NOTE that the allocation may have as a
- side-effect that an extent containing a descriptor
- page is added to the FREE_FRAG list. But we will
- allocate our page from the allocated free extent. */
-
- descr = fsp_alloc_free_extent(space, hint, mtr);
-
- if (descr == NULL) {
- /* No free space left */
- return(FIL_NULL);
- }
-
- xdes_set_state(descr, XDES_FREE_FRAG, mtr);
- flst_add_last(header + FSP_FREE_FRAG,
- descr + XDES_FLST_NODE, mtr);
- } else {
- descr = xdes_lst_get_descriptor(space, first, mtr);
- }
-
- /* Reset the hint */
- hint = 0;
- }
-
- /* Now we have in descr an extent with at least one free page.
- Look for a free page in the extent. */
- free = xdes_find_bit(descr, XDES_FREE_BIT, TRUE,
- hint % FSP_EXTENT_SIZE, mtr);
- ut_a(free != ULINT_UNDEFINED);
-
- xdes_set_bit(descr, XDES_FREE_BIT, free, FALSE, mtr);
-
- /* Update the FRAG_N_USED field */
- frag_n_used = mtr_read_ulint(header + FSP_FRAG_N_USED,
- MLOG_4BYTES, mtr);
- frag_n_used++;
- mlog_write_ulint(header + FSP_FRAG_N_USED, frag_n_used,
- MLOG_4BYTES, mtr);
-
- if (xdes_is_full(descr, mtr)) {
- /* The fragment is full: move it to another list */
- flst_remove(header + FSP_FREE_FRAG,
- descr + XDES_FLST_NODE, mtr);
- xdes_set_state(descr, XDES_FULL_FRAG, mtr);
- flst_add_last(header + FSP_FULL_FRAG,
- descr + XDES_FLST_NODE, mtr);
- mlog_write_ulint(header + FSP_FRAG_N_USED,
- frag_n_used - FSP_EXTENT_SIZE,
- MLOG_4BYTES, mtr);
- }
- return(xdes_get_offset(descr) + free);
-}
-
-/**************************************************************************
-Frees a single page of a space. The page is marked as free and clean. */
-static
-void
-fsp_free_page(
-/*==========*/
- ulint space, /* in: space id */
- ulint page, /* in: page offset */
- mtr_t* mtr) /* in: mtr handle */
-{
- fsp_header_t* header;
- xdes_t* descr;
- ulint state;
- ulint frag_n_used;
-
- ut_ad(mtr);
-
- header = fsp_get_space_header(space, mtr);
-
- descr = xdes_get_descriptor_with_space_hdr(header, space, page, mtr);
-
- state = xdes_get_state(descr, mtr);
-
- ut_a((state == XDES_FREE_FRAG) || (state == XDES_FULL_FRAG));
-
- ut_a(xdes_get_bit(descr, XDES_FREE_BIT, page % FSP_EXTENT_SIZE, mtr)
- == FALSE);
-
- xdes_set_bit(descr, XDES_FREE_BIT, page % FSP_EXTENT_SIZE, TRUE, mtr);
- xdes_set_bit(descr, XDES_CLEAN_BIT, page % FSP_EXTENT_SIZE, TRUE, mtr);
-
- frag_n_used = mtr_read_ulint(header + FSP_FRAG_N_USED,
- MLOG_4BYTES, mtr);
-
- if (state == XDES_FULL_FRAG) {
- /* The fragment was full: move it to another list */
- flst_remove(header + FSP_FULL_FRAG,
- descr + XDES_FLST_NODE, mtr);
- xdes_set_state(descr, XDES_FREE_FRAG, mtr);
- flst_add_last(header + FSP_FREE_FRAG,
- descr + XDES_FLST_NODE, mtr);
- mlog_write_ulint(header + FSP_FRAG_N_USED,
- frag_n_used + FSP_EXTENT_SIZE - 1,
- MLOG_4BYTES, mtr);
- } else {
- ut_a(frag_n_used > 0);
- mlog_write_ulint(header + FSP_FRAG_N_USED, frag_n_used - 1,
- MLOG_4BYTES, mtr);
- }
-
- if (xdes_is_free(descr, mtr)) {
- /* The extent has become free: move it to another list */
- flst_remove(header + FSP_FREE_FRAG,
- descr + XDES_FLST_NODE, mtr);
- fsp_free_extent(space, page, mtr);
- }
-}
-
-/**************************************************************************
-Returns an extent to the free list of a space. */
-static
-void
-fsp_free_extent(
-/*============*/
- ulint space, /* in: space id */
- ulint page, /* in: page offset in the extent */
- mtr_t* mtr) /* in: mtr */
-{
- fsp_header_t* header;
- xdes_t* descr;
-
- ut_ad(mtr);
-
- header = fsp_get_space_header(space, mtr);
-
- descr = xdes_get_descriptor_with_space_hdr(header, space, page, mtr);
-
- ut_a(xdes_get_state(descr, mtr) != XDES_FREE);
-
- xdes_init(descr, mtr);
-
- flst_add_last(header + FSP_FREE, descr + XDES_FLST_NODE, mtr);
-}
-
-/**************************************************************************
-Looks for an unused segment header on a segment header page. */
-UNIV_INLINE
-fseg_header_t*
-fsp_seg_hdr_page_get_nth_hdr(
-/*=========================*/
- /* out: segment header */
- page_t* page, /* in: segment header page */
- ulint i, /* in: search forward starting from this index */
- mtr_t* mtr) /* in: mini-transaction handle */
-{
- ut_ad(i < FSP_SEG_HDRS_PER_PAGE);
- ut_ad(mtr_memo_contains(mtr, page, MTR_MEMO_PAGE_X_LOCK));
-
- return(page + FSEG_ARR_OFFSET + FSEG_HEADER_SIZE * i);
-}
-
-/**************************************************************************
-Looks for a used segment header on a segment header page. */
-static
-ulint
-fsp_seg_hdr_page_find_used(
-/*=======================*/
- /* out: segment header index, or ULINT_UNDEFINED
- if not found */
- page_t* page, /* in: segment header page */
- mtr_t* mtr) /* in: mini-transaction handle */
-{
- ulint i;
- fseg_header_t* header;
-
- for (i = 0; i < FSP_SEG_HDRS_PER_PAGE; i++) {
-
- header = fsp_seg_hdr_page_get_nth_hdr(page, i, mtr);
-
- if (ut_dulint_cmp(mach_read_from_8(header + FSEG_ID),
- ut_dulint_zero) != 0) {
- /* This is used */
-
- return(i);
- }
- }
-
- return(ULINT_UNDEFINED);
-}
-
-/**************************************************************************
-Looks for an unused segment header on a segment header page. */
-static
-ulint
-fsp_seg_hdr_page_find_free(
-/*=======================*/
- /* out: segment header index, or ULINT_UNDEFINED
- if not found */
- page_t* page, /* in: segment header page */
- ulint j, /* in: search forward starting from this index */
- mtr_t* mtr) /* in: mini-transaction handle */
-{
- ulint i;
- fseg_header_t* header;
-
- for (i = j; i < FSP_SEG_HDRS_PER_PAGE; i++) {
-
- header = fsp_seg_hdr_page_get_nth_hdr(page, i, mtr);
-
- if (ut_dulint_cmp(mach_read_from_8(header + FSEG_ID),
- ut_dulint_zero) == 0) {
- /* This is unused */
-
- return(i);
- }
- }
-
- return(ULINT_UNDEFINED);
-}
-
-/**************************************************************************
-Allocates a new file segment header page. */
-static
-bool
-fsp_alloc_seg_hdr_page(
-/*===================*/
- /* out: TRUE if could be allocated */
- fsp_header_t* space_header, /* in: space header */
- mtr_t* mtr) /* in: mini-transaction handle */
-{
- buf_block_t* block;
- ulint page_no;
- page_t* page;
- fseg_header_t* header;
- ulint i;
-
- page_no = fsp_alloc_free_page(buf_frame_get_space(space_header),
- 0, mtr);
- if (page_no == FIL_NULL) {
-
- return(FALSE);
- }
-
- block = buf_page_get(buf_frame_get_space(space_header), page_no, mtr);
-
- buf_page_x_lock(block, mtr);
-
- page = buf_block_get_frame(block);
-
- for (i = 0; i < FSP_SEG_HDRS_PER_PAGE; i++) {
-
- header = fsp_seg_hdr_page_get_nth_hdr(page, i, mtr);
-
- mlog_write_dulint(header + FSEG_ID, ut_dulint_zero,
- MLOG_8BYTES, mtr);
- }
-
- flst_add_last(space_header + FSP_SEG_HDRS_FREE,
- page + FSEG_HDR_PAGE_NODE, mtr);
- return(TRUE);
-}
-
-/**************************************************************************
-Allocates a new file segment header. */
-static
-fseg_header_t*
-fsp_alloc_seg_header(
-/*=================*/
- /* out: segment header, or NULL if
- not enough space */
- fsp_header_t* space_header, /* in: space header */
- mtr_t* mtr) /* in: mini-transaction handle */
-{
- buf_block_t* block;
- ulint page_no;
- page_t* page;
- fseg_header_t* header;
- ulint n;
- bool success;
-
- if (flst_get_len(space_header + FSP_SEG_HDRS_FREE, mtr) == 0) {
- /* Allocate a new segment header page */
-
- success = fsp_alloc_seg_hdr_page(space_header, mtr);
-
- if (!success) {
-
- return(NULL);
- }
- }
-
- page_no = flst_get_first(space_header + FSP_SEG_HDRS_FREE, mtr).page;
-
- block = buf_page_get(buf_frame_get_space(space_header), page_no, mtr);
-
- buf_page_x_lock(block, mtr);
-
- page = buf_block_get_frame(block);
-
- n = fsp_seg_hdr_page_find_free(page, 0, mtr);
-
- ut_a(n != ULINT_UNDEFINED);
-
- header = fsp_seg_hdr_page_get_nth_hdr(page, n, mtr);
-
- if (ULINT_UNDEFINED == fsp_seg_hdr_page_find_free(page, n + 1, mtr)) {
-
- /* There are no other unused headers left on the page: move it
- to another list */
-
- flst_remove(space_header + FSP_SEG_HDRS_FREE,
- page + FSEG_HDR_PAGE_NODE, mtr);
-
- flst_add_last(space_header + FSP_SEG_HDRS_FULL,
- page + FSEG_HDR_PAGE_NODE, mtr);
- }
-
- return(header);
-}
-
-/**************************************************************************
-Frees a file segment header. */
-static
-void
-fsp_free_seg_header(
-/*================*/
- ulint space, /* in: space id */
- fseg_header_t* header, /* in: segment header */
- mtr_t* mtr) /* in: mini-transaction handle */
-{
- page_t* page;
- fsp_header_t* space_header;
-
- page = buf_frame_align(header);
-
- space_header = fsp_get_space_header(space, mtr);
-
- ut_ad(mach_read_from_4(header + FSEG_MAGIC_N) == FSEG_MAGIC_N_VALUE);
-
- if (ULINT_UNDEFINED == fsp_seg_hdr_page_find_free(page, mtr)) {
-
- /* Move the page to another list */
-
- flst_remove(space_header + FSP_SEG_HDRS_FULL,
- page + FSEG_HDR_PAGE_NODE, mtr);
-
- flst_add_last(space_header + FSP_SEG_HDRS_FREE,
- page + FSEG_HDR_PAGE_NODE, mtr);
- }
-
- mlog_write_dulint(header + FSEG_ID, ut_dulint_zero, MLOG_8BYTES, mtr);
- mlog_write_ulint(header + FSEG_MAGIC_N, 0, MLOG_4BYTES, mtr);
-
- if (ULINT_UNDEFINED == fsp_seg_hdr_page_find_used(page, mtr)) {
-
- /* There are no other used headers left on the page: free it */
-
- flst_remove(space_header + FSP_SEG_HDRS_FREE,
- page + FSEG_HDR_PAGE_NODE, mtr);
-
- fsp_free_page(space, page_no, mtr);
- }
-}
-
-/**************************************************************************
-Gets the page number from the nth fragment page slot. */
-UNIV_INLINE
-ulint
-fseg_get_nth_frag_page_no(
-/*======================*/
- /* out: page number, FIL_NULL if not in use */
- fseg_header_t* header, /* in: segment header */
- ulint n, /* in: slot index */
- mtr_t* mtr) /* in: mtr handle */
-{
- ut_ad(header && mtr);
- ut_ad(n < FSEG_FRAG_ARR_N_SLOTS);
- ut_ad(mtr_memo_contains(mtr, buf_block_align(header),
- MTR_MEMO_PAGE_X_LOCK));
-
- return(mach_read_from_4(header + FSEG_FRAG_ARR
- + n * FSEG_FRAG_SLOT_SIZE));
-}
-
-/**************************************************************************
-Sets the page number in the nth fragment page slot. */
-UNIV_INLINE
-void
-fseg_set_nth_frag_page_no(
-/*======================*/
- fseg_header_t* header, /* in: segment header */
- ulint n, /* in: slot index */
- ulint page_no,/* in: page number to set */
- mtr_t* mtr) /* in: mtr handle */
-{
- ut_ad(header && mtr);
- ut_ad(n < FSEG_FRAG_ARR_N_SLOTS);
- ut_ad(mtr_memo_contains(mtr, buf_block_align(header),
- MTR_MEMO_PAGE_X_LOCK));
-
- mlog_write_ulint(header + FSEG_FRAG_ARR + n * FSEG_FRAG_SLOT_SIZE,
- page_no, MLOG_4BYTES, mtr);
-}
-
-/**************************************************************************
-Finds a fragment page slot which is free. */
-static
-ulint
-fseg_find_free_frag_page_slot(
-/*==========================*/
- /* out: slot index; ULINT_UNDEFINED if none
- found */
- fseg_header_t* header, /* in: segment header */
- mtr_t* mtr) /* in: mtr handle */
-{
- ulint i;
- ulint page_no;
-
- ut_ad(header && mtr);
-
- for (i = 0; i < FSEG_FRAG_ARR_N_SLOTS; i++) {
- page_no = fseg_get_nth_frag_page_no(header, i, mtr);
-
- if (page_no == FIL_NULL) {
-
- return(i);
- }
- }
- return(ULINT_UNDEFINED);
-}
-
-/**************************************************************************
-Finds a fragment page slot which is used and last in the array. */
-static
-ulint
-fseg_find_last_used_frag_page_slot(
-/*===============================*/
- /* out: slot index; ULINT_UNDEFINED if none
- found */
- fseg_header_t* header, /* in: segment header */
- mtr_t* mtr) /* in: mtr handle */
-{
- ulint i;
- ulint page_no;
-
- ut_ad(header && mtr);
-
- for (i = 0; i < FSEG_FRAG_ARR_N_SLOTS; i++) {
- page_no = fseg_get_nth_frag_page_no(header,
- FSEG_ARR_N_SLOTS - i - 1, mtr);
-
- if (page_no != FIL_NULL) {
-
- return(i);
- }
- }
- return(ULINT_UNDEFINED);
-}
-
-/**************************************************************************
-Calculates reserved fragment page slots. */
-static
-ulint
-fseg_get_n_frag_pages(
-/*==================*/
- /* out: number of fragment pages */
- fseg_header_t* header, /* in: segment header */
- mtr_t* mtr) /* in: mtr handle */
-{
- ulint i;
- ulint count = 0;
-
- ut_ad(header && mtr);
-
- for (i = 0; i < FSEG_FRAG_ARR_N_SLOTS; i++) {
- if (FIL_NULL != fseg_get_nth_frag_page_no(header, i, mtr)) {
- count++;
- }
- }
- return(count);
-}
-
-/**************************************************************************
-Creates a new segment. */
-
-ulint
-fseg_create(
-/*========*/
- /* out: the page number where the segment header is
- placed, FIL_NULL if could not create segment because
- lack of space */
- ulint space, /* in: space id */
- ulint* offset, /* out: byte offset of the segment header on its
- page */
- mtr_t* mtr) /* in: mtr */
-{
- buf_block_t* block;
- buf_frame_t* frame;
- fsp_header_t* space_header;
- fseg_header_t* header;
- dulint seg_id;
- ulint i;
-
- ut_ad(mtr);
-
- mtr_x_lock(&fsp_latch, mtr);
-
- space_header = fsp_get_space_header(space, mtr);
-
- header = fsp_alloc_seg_header(space_header, mtr);
-
- if (header == NULL) {
-
- return(FIL_NULL);
- }
-
- /* Read the next segment id from space header and increment the
- value in space header */
-
- seg_id = mtr_read_dulint(space_header + FSP_SEG_ID, MLOG_8BYTES, mtr);
-
- mlog_write_dulint(space_header + FSP_SEG_ID, ut_dulint_add(seg_id, 1),
- MLOG_8BYTES, mtr);
-
- mlog_write_dulint(header + FSEG_ID, seg_id, MLOG_8BYTES, mtr);
- mlog_write_ulint(header + FSEG_NOT_FULL_N_USED, 0, MLOG_4BYTES, mtr);
-
- flst_init(header + FSEG_FREE, mtr);
- flst_init(header + FSEG_NOT_FULL, mtr);
- flst_init(header + FSEG_FULL, mtr);
-
- mlog_write_ulint(header + FSEG_MAGIC_N, FSEG_MAGIC_N_VALUE,
- MLOG_4BYTES, mtr);
- for (i = 0; i < FSEG_FRAG_ARR_N_SLOTS; i++) {
- fseg_set_nth_frag_page_no(header, i, FIL_NULL, mtr);
- }
-
- *offset = header - buf_frame_align(header);
- return(buf_frame_get_page(buf_frame_align(header)));
-}
-
-/**************************************************************************
-Calculates the number of pages reserved by a segment, and how
-many pages are currently used. */
-
-ulint
-fseg_n_reserved_pages(
-/*==================*/
- /* out: number of reserved pages */
- fseg_header_t* header, /* in: segment header */
- ulint* used, /* out: number of pages used (<= reserved) */
- mtr_t* mtr) /* in: mtr handle */
-{
- ulint ret;
-
- mtr_x_lock(&fsp_latch, mtr);
-
- ret = fseg_n_reserved_pages_low(header, used, mtr);
-
- return(ret);
-}
-
-/**************************************************************************
-Calculates the number of pages reserved by a segment, and how
-many pages are currently used. */
-static
-ulint
-fseg_n_reserved_pages_low(
-/*======================*/
- /* out: number of reserved pages */
- fseg_header_t* header, /* in: segment header */
- ulint* used, /* out: number of pages used (<= reserved) */
- mtr_t* mtr) /* in: mtr handle */
-{
- ulint ret;
-
- ut_ad(header && used && mtr);
- ut_ad(mtr_memo_contains(mtr, buf_block_align(header),
- MTR_MEMO_BUF_FIX));
-
- buf_page_x_lock(buf_block_align(header), mtr);
-
- *used = mtr_read_ulint(header + FSEG_NOT_FULL_N_USED, MLOG_4BYTES, mtr)
- + FSP_EXTENT_SIZE * flst_get_len(header + FSEG_FULL, mtr)
- + fseg_get_n_frag_pages(header, mtr);
-
- ret = fseg_get_n_frag_pages(header, mtr)
- + FSP_EXTENT_SIZE * flst_get_len(header + FSEG_FREE, mtr)
- + FSP_EXTENT_SIZE * flst_get_len(header + FSEG_NOT_FULL, mtr)
- + FSP_EXTENT_SIZE * flst_get_len(header + FSEG_FULL, mtr);
-
- return(ret);
-}
-
-/*************************************************************************
-Tries to fill the free list of a segment with consecutive free extents.
-This happens if the segment is big enough to allowextents in the free list,
-the free list is empty, and the extents can be allocated consecutively from
-the hint onward. */
-static
-void
-fseg_fill_free_list(
-/*================*/
- fseg_header_t* header, /* in: segment header */
- ulint space, /* in: space id */
- ulint hint, /* in: hint which extent would be good as
- the first extent */
- mtr_t* mtr) /* in: mtr */
-{
- xdes_t* descr;
- ulint i;
- dulint seg_id;
- ulint reserved;
- ulint used;
-
- ut_ad(header && mtr);
-
- buf_page_x_lock(buf_block_align(header), mtr);
-
- reserved = fseg_n_reserved_pages_low(header, &used, mtr);
-
- if (reserved < FSEG_FREE_LIST_LIMIT * FSP_EXTENT_SIZE) {
- /* The segment is too small to allow extents in free list */
-
- return;
- }
-
- if (flst_get_len(header + FSEG_FREE, mtr) > 0) {
- /* Free list is not empty */
-
- return;
- }
-
- for (i = 0; i < FSEG_FREE_LIST_MAX_LEN; i++) {
- descr = xdes_get_descriptor(space, hint, mtr);
-
- if ((descr == NULL) ||
- (XDES_FREE != xdes_get_state(descr, mtr))) {
- /* We cannot allocate the desired extent: stop */
-
- return;
- }
-
- descr = fsp_alloc_free_extent(space, hint, mtr);
-
- xdes_set_state(descr, XDES_FSEG, mtr);
-
- seg_id = mtr_read_dulint(header + FSEG_ID, MLOG_8BYTES, mtr);
- mlog_write_dulint(descr + XDES_ID, seg_id, MLOG_8BYTES, mtr);
-
- flst_add_last(header + FSEG_FREE, descr + XDES_FLST_NODE, mtr);
- hint += FSP_EXTENT_SIZE;
- }
-}
-
-/*************************************************************************
-Allocates a free extent for the segment: looks first in the
-free list of the segment, then tries to allocate from the space free
-list. NOTE that the extent returned is still placed in the segment free
-list, not taken off it! */
-static
-xdes_t*
-fseg_alloc_free_extent(
-/*===================*/
- /* out: allocated extent, still placed in the
- segment free list, NULL if could
- not be allocated */
- fseg_header_t* header, /* in: segment header */
- ulint space, /* in: space id */
- mtr_t* mtr) /* in: mtr */
-{
- xdes_t* descr;
- dulint seg_id;
- fil_addr_t first;
-
- buf_page_x_lock(buf_block_align(header), mtr);
-
- if (flst_get_len(header + FSEG_FREE, mtr) > 0) {
- /* Segment free list is not empty, allocate from it */
-
- first = flst_get_first(header + FSEG_FREE, mtr);
-
- descr = xdes_lst_get_descriptor(space, first, mtr);
- } else {
- /* Segment free list was empty, allocate from space */
- descr = fsp_alloc_free_extent(space, 0, mtr);
-
- if (descr == NULL) {
- return(NULL);
- }
-
- seg_id = mtr_read_dulint(header + FSEG_ID, MLOG_8BYTES, mtr);
-
- xdes_set_state(descr, XDES_FSEG, mtr);
- mlog_write_dulint(descr + XDES_ID, seg_id, MLOG_8BYTES, mtr);
- flst_add_last(header + FSEG_FREE,
- descr + XDES_FLST_NODE, mtr);
-
- /* Try to fill the segment free list */
- fseg_fill_free_list(header, space,
- xdes_get_offset(descr) + FSP_EXTENT_SIZE, mtr);
- }
-
- return(descr);
-}
-
-/**************************************************************************
-Allocates a single free page from a segment. This function implements
-the intelligent allocation strategy which tries to minimize file space
-fragmentation. */
-
-ulint
-fseg_alloc_free_page(
-/*=================*/
- /* out: the allocated page offset
- FIL_NULL if no page could be allocated */
- fseg_header_t* seg_header, /* in: segment header */
- ulint hint, /* in: hint of which page would be desirable */
- byte direction, /* in: if the new page is needed because
- of an index page split, and records are
- inserted there in order, into which
- direction they go alphabetically: FSP_DOWN,
- FSP_UP, FSP_NO_DIR */
- mtr_t* mtr) /* in: mtr handle */
-{
- buf_block_t* block;
- dulint seg_id;
- fseg_page_header_t* page_header;
- ulint space;
- ulint used;
- ulint reserved;
- fil_addr_t first;
- xdes_t* descr; /* extent of the hinted page */
- ulint ret_page; /* the allocated page offset, FIL_NULL
- if could not be allocated */
- buf_block_t* ret_buf_page;
- buf_frame_t* ret_frame;
- xdes_t* ret_descr; /* the extent of the allocated page */
- ulint n;
- bool frag_page_allocated = FALSE;
-
- ut_ad(seg_header && mtr);
- ut_ad((direction >= FSP_UP) && (direction <= FSP_NO_DIR));
-
- mtr_x_lock(&fsp_latch, mtr);
-
- block = buf_block_align(seg_header);
- buf_page_x_lock(block, mtr);
-
- space = buf_page_get_space(block);
-
- seg_id = mtr_read_dulint(seg_header + FSEG_ID, MLOG_8BYTES, mtr);
-
- ut_ad(ut_dulint_cmp(seg_id, ut_dulint_zero) > 0);
-
- reserved = fseg_n_reserved_pages_low(seg_header, &used, mtr);
-
- descr = xdes_get_descriptor(space, hint, mtr);
-
- if (descr == NULL) {
- /* Hint outside space or too high above free limit:
- reset hint */
- hint = 0;
- descr = xdes_get_descriptor(space, hint, mtr);
- }
-
- /* In the big if-else below we look for ret_page and ret_descr */
- /*-------------------------------------------------------------*/
- if ((xdes_get_state(descr, mtr) == XDES_FSEG)
- && (0 == ut_dulint_cmp(mtr_read_dulint(descr + XDES_ID,
- MLOG_8BYTES, mtr),
- seg_id))
- && (xdes_get_bit(descr, XDES_FREE_BIT,
- hint % FSP_EXTENT_SIZE, mtr) == TRUE)) {
-
- /* 1. We can take the hinted page
- =================================*/
- ret_descr = descr;
- ret_page = hint;
- /*-------------------------------------------------------------*/
- } else if ((xdes_get_state(descr, mtr) == XDES_FREE)
- && ((reserved - used) < reserved / FSEG_FILLFACTOR)
- && (used >= FSEG_FRAG_LIMIT)) {
-
- /* 2. We allocate the free extent from space and can take
- =========================================================
- the hinted page
- ===============*/
- ret_descr = fsp_alloc_free_extent(space, hint, mtr);
-
- ut_a(ret_descr == descr);
-
- xdes_set_state(ret_descr, XDES_FSEG, mtr);
- mlog_write_dulint(ret_descr + XDES_ID, seg_id, MLOG_8BYTES,
- mtr);
- flst_add_last(seg_header + FSEG_FREE,
- ret_descr + XDES_FLST_NODE, mtr);
-
- /* Try to fill the segment free list */
- fseg_fill_free_list(seg_header, space,
- hint + FSP_EXTENT_SIZE, mtr);
- ret_page = hint;
- /*-------------------------------------------------------------*/
- } else if ((direction != FSP_NO_DIR)
- && ((reserved - used) < reserved / FSEG_FILLFACTOR)
- && (used >= FSEG_FRAG_LIMIT)
- && (NULL != (ret_descr =
- fseg_alloc_free_extent(seg_header, space, mtr)))) {
-
- /* 3. We take any free extent (which was already assigned above
- ===============================================================
- in the if-condition to ret_descr) and take the lowest or
- ========================================================
- highest page in it, depending on the direction
- ==============================================*/
- ret_page = xdes_get_offset(ret_descr);
- if (direction == FSP_DOWN) {
- ret_page += FSP_EXTENT_SIZE - 1;
- }
- /*-------------------------------------------------------------*/
- } else if ((xdes_get_state(descr, mtr) == XDES_FSEG)
- && (0 == ut_dulint_cmp(mtr_read_dulint(descr + XDES_ID,
- MLOG_8BYTES, mtr),
- seg_id))
- && (!xdes_is_full(descr, mtr))) {
-
- /* 4. We can take the page from the same extent as the
- ======================================================
- hinted page (and the extent already belongs to the
- ==================================================
- segment)
- ========*/
- ret_descr = descr;
- ret_page = xdes_get_offset(ret_descr) +
- xdes_find_bit(ret_descr, XDES_FREE_BIT, TRUE,
- hint % FSP_EXTENT_SIZE, mtr);
- /*-------------------------------------------------------------*/
- } else if (reserved - used > 0) {
- /* 5. We take any unused page from the segment
- ==============================================*/
- if (flst_get_len(seg_header + FSEG_NOT_FULL, mtr) > 0) {
- first = flst_get_first(seg_header + FSEG_NOT_FULL,
- mtr);
- } else if (flst_get_len(seg_header + FSEG_FREE, mtr) > 0) {
- first = flst_get_first(seg_header + FSEG_FREE, mtr);
- } else {
- ut_error;
- }
-
- ret_descr = xdes_lst_get_descriptor(space, first, mtr);
- ret_page = xdes_get_offset(ret_descr) +
- xdes_find_bit(ret_descr, XDES_FREE_BIT, TRUE,
- 0, mtr);
- /*-------------------------------------------------------------*/
- } else if (used < FSEG_FRAG_LIMIT) {
- /* 6. We allocate an individual page from the space
- ===================================================*/
- ret_page = fsp_alloc_free_page(space, hint, mtr);
- ret_descr = NULL;
-
- frag_page_allocated = TRUE;
-
- if (ret_page != FIL_NULL) {
- /* Put the page in the fragment page array of the
- segment */
- n = fseg_find_free_frag_page_slot(seg_header, mtr);
- ut_a(n != FIL_NULL);
-
- fseg_set_nth_frag_page_no(seg_header, n, ret_page,
- mtr);
- }
- /*-------------------------------------------------------------*/
- } else {
- /* 7. We allocate a new extent and take its first page
- ======================================================*/
- ret_descr = fseg_alloc_free_extent(seg_header, space, mtr);
-
- if (ret_descr == NULL) {
- ret_page = FIL_NULL;
- } else {
- ret_page = xdes_get_offset(ret_descr);
- }
- }
-
- if (ret_page == FIL_NULL) {
- /* Page could not be allocated */
-
- return(FIL_NULL);
- }
-
- /* Initialize the allocated page to buffer pool, so that it can be
- obtained immediately with buf_page_get without need for disk read */
-
- ret_buf_page = buf_page_create(space, ret_page, mtr);
-
- if (!frag_page_allocated) {
- /* At this point we know the extent and the page offset.
- The extent is still in the appropriate list (FSEG_NOT_FULL or
- FSEG_FREE), and the page is not yet marked as used. */
-
- ut_ad(xdes_get_descriptor(space, ret_page, mtr) == ret_descr);
- ut_ad(xdes_get_bit(ret_descr, XDES_FREE_BIT,
- ret_page % FSP_EXTENT_SIZE, mtr) == TRUE);
-
- fseg_mark_page_used(seg_header, space, ret_page, mtr);
- }
-
- return(ret_page);
-}
-
-/************************************************************************
-Marks a page used. The page must reside within the extents of the given
-segment. */
-static
-void
-fseg_mark_page_used(
-/*================*/
- fseg_header_t* seg_header,/* in: segment header */
- ulint space, /* in: space id */
- ulint page, /* in: page offset */
- mtr_t* mtr) /* in: mtr */
-{
- xdes_t* descr;
- ulint not_full_n_used;
-
- ut_ad(seg_header && mtr);
-
- descr = xdes_get_descriptor(space, page, mtr);
-
- ut_ad(mtr_read_ulint(seg_header + FSEG_ID, MLOG_4BYTES, mtr) ==
- mtr_read_ulint(descr + XDES_ID, MLOG_4BYTES, mtr));
-
- if (xdes_is_free(descr, mtr)) {
- /* We move the extent from the free list to the
- NOT_FULL list */
- flst_remove(seg_header + FSEG_FREE,
- descr + XDES_FLST_NODE, mtr);
- flst_add_last(seg_header + FSEG_NOT_FULL,
- descr + XDES_FLST_NODE, mtr);
- }
-
- ut_ad(xdes_get_bit(descr, XDES_FREE_BIT, page % FSP_EXTENT_SIZE, mtr)
- == TRUE);
-
- /* We mark the page as used */
- xdes_set_bit(descr, XDES_FREE_BIT, page % FSP_EXTENT_SIZE, FALSE, mtr);
-
- not_full_n_used = mtr_read_ulint(seg_header + FSEG_NOT_FULL_N_USED,
- MLOG_4BYTES, mtr);
-
- not_full_n_used++;
- mlog_write_ulint(seg_header + FSEG_NOT_FULL_N_USED,
- not_full_n_used, MLOG_4BYTES, mtr);
-
- if (xdes_is_full(descr, mtr)) {
- /* We move the extent from the NOT_FULL list to the
- FULL list */
- flst_remove(seg_header + FSEG_NOT_FULL,
- descr + XDES_FLST_NODE, mtr);
- flst_add_last(seg_header + FSEG_FULL,
- descr + XDES_FLST_NODE, mtr);
-
- mlog_write_ulint(seg_header + FSEG_NOT_FULL_N_USED,
- not_full_n_used - FSP_EXTENT_SIZE,
- MLOG_4BYTES, mtr);
- }
-}
-
-/**************************************************************************
-Frees a single page of a segment. */
-
-void
-fseg_free_page(
-/*===========*/
- fseg_header_t* seg_header, /* in: segment header */
- ulint space, /* in: space id */
- ulint page, /* in: page offset */
- mtr_t* mtr) /* in: mtr handle */
-{
- mtr_x_lock(&fsp_latch, mtr);
-
- fseg_free_page_low(seg_header, space, page, mtr);
-}
-
-/**************************************************************************
-Frees a single page of a segment. */
-static
-void
-fseg_free_page_low(
-/*===============*/
- fseg_header_t* seg_header, /* in: segment header */
- ulint space, /* in: space id */
- ulint page, /* in: page offset */
- mtr_t* mtr) /* in: mtr handle */
-{
- buf_block_t* block;
- xdes_t* descr;
- ulint used;
- ulint not_full_n_used;
- ulint state;
- buf_block_t* buf_page;
- buf_frame_t* buf_frame;
- ulint i;
-
- ut_ad(seg_header && mtr);
-
- block = buf_block_align(seg_header);
- buf_page_x_lock(block, mtr);
-
- descr = xdes_get_descriptor(space, page, mtr);
-
- ut_a(descr);
- ut_a(xdes_get_bit(descr, XDES_FREE_BIT, page % FSP_EXTENT_SIZE, mtr)
- == FALSE);
-
- state = xdes_get_state(descr, mtr);
-
- if (state != XDES_FSEG) {
- /* The page is in the fragment pages of the segment */
-
- for (i = 0;; i++) {
- if (fseg_get_nth_frag_page_no(seg_header, i, mtr)
- == page) {
-
- fseg_set_nth_frag_page_no(seg_header, i,
- FIL_NULL, mtr);
- break;
- }
- }
-
- fsp_free_page(space, page, mtr);
-
- return;
- }
-
- /* If we get here, the page is in some extent of the segment */
- ut_a(0 == ut_dulint_cmp(
- mtr_read_dulint(descr + XDES_ID, MLOG_8BYTES, mtr),
- mtr_read_dulint(seg_header + FSEG_ID, MLOG_8BYTES, mtr)));
-
- not_full_n_used = mtr_read_ulint(seg_header + FSEG_NOT_FULL_N_USED,
- MLOG_4BYTES, mtr);
- if (xdes_is_full(descr, mtr)) {
- /* The fragment is full: move it to another list */
- flst_remove(seg_header + FSEG_FULL,
- descr + XDES_FLST_NODE, mtr);
- flst_add_last(seg_header + FSEG_NOT_FULL,
- descr + XDES_FLST_NODE, mtr);
- mlog_write_ulint(seg_header + FSEG_NOT_FULL_N_USED,
- not_full_n_used + FSP_EXTENT_SIZE - 1,
- MLOG_4BYTES, mtr);
- } else {
- ut_a(not_full_n_used > 0);
- mlog_write_ulint(seg_header + FSEG_NOT_FULL_N_USED,
- not_full_n_used - 1,
- MLOG_4BYTES, mtr);
- }
-
- xdes_set_bit(descr, XDES_FREE_BIT, page % FSP_EXTENT_SIZE, TRUE, mtr);
- xdes_set_bit(descr, XDES_CLEAN_BIT, page % FSP_EXTENT_SIZE, TRUE, mtr);
-
- if (xdes_is_free(descr, mtr)) {
- /* The extent has become free: free it to space */
- flst_remove(seg_header + FSEG_NOT_FULL,
- descr + XDES_FLST_NODE, mtr);
- fsp_free_extent(space, page, mtr);
- }
-}
-
-/**************************************************************************
-Frees an extent of a segment to the space free list. */
-static
-void
-fseg_free_extent(
-/*=============*/
- fseg_header_t* seg_header, /* in: segment header */
- ulint space, /* in: space id */
- ulint page, /* in: page offset in the extent */
- mtr_t* mtr) /* in: mtr handle */
-{
- buf_block_t* block;
- xdes_t* descr;
- ulint not_full_n_used;
- ulint descr_n_used;
-
- ut_ad(seg_header && mtr);
-
- block = buf_block_align(seg_header);
- buf_page_x_lock(block, mtr);
-
- descr = xdes_get_descriptor(space, page, mtr);
-
- ut_a(xdes_get_state(descr, mtr) == XDES_FSEG);
- ut_a(0 == ut_dulint_cmp(
- mtr_read_dulint(descr + XDES_ID, MLOG_8BYTES, mtr),
- mtr_read_dulint(seg_header + FSEG_ID, MLOG_8BYTES, mtr)));
-
- if (xdes_is_full(descr, mtr)) {
- flst_remove(seg_header + FSEG_FULL,
- descr + XDES_FLST_NODE, mtr);
- } else if (xdes_is_free(descr, mtr)) {
- flst_remove(seg_header + FSEG_FREE,
- descr + XDES_FLST_NODE, mtr);
- } else {
- flst_remove(seg_header + FSEG_NOT_FULL,
- descr + XDES_FLST_NODE, mtr);
-
- not_full_n_used = mtr_read_ulint(
- seg_header + FSEG_NOT_FULL_N_USED,
- MLOG_4BYTES, mtr);
-
- descr_n_used = xdes_get_n_used(descr, mtr);
- ut_a(not_full_n_used >= descr_n_used);
- mlog_write_ulint(seg_header + FSEG_NOT_FULL_N_USED,
- not_full_n_used - descr_n_used,
- MLOG_4BYTES, mtr);
- }
- fsp_free_extent(space, page, mtr);
-}
-
-/**************************************************************************
-Frees part of a segment. This function can be used to free a segment
-by repeatedly calling this function in different mini-transactions.
-Doing the freeing in a single mini-transaction might result in too big
-a mini-transaction. */
-
-bool
-fseg_free_step(
-/*===========*/
- /* out: TRUE if freeing completed */
- ulint space, /* in: segment space id */
- ulint page_no,/* in: segment header page number */
- ulint offset, /* in: segment header byte offset on page */
- mtr_t* mtr) /* in: mtr */
-{
- buf_block_t* block;
- ulint n;
- ulint page;
- xdes_t* descr;
- fseg_header_t* header;
- fil_addr_t header_addr;
-
- header_addr.page = page_no;
- header_addr.boffset = offset;
-
- mtr_x_lock(&fsp_latch, mtr);
-
- header = fut_get_ptr_x_lock(space, header_addr, mtr);
-
- descr = fseg_get_first_extent(header, mtr);
-
- if (descr != NULL) {
- /* Free the extent held by the segment */
- page = xdes_get_offset(descr);
-
- fseg_free_extent(header, space, page, mtr);
-
- return(FALSE);
- }
-
- /* Free a frag page */
-
- n = fseg_get_last_used_frag_page_slot(header, mtr);
-
- if (n == ULINT_UNDEFINED) {
- /* Freeing completed: free the segment header */
- fsp_free_seg_header(space, header, mtr);
-
- return(TRUE);
- }
-
- fseg_free_page_low(header, space,
- fseg_get_nth_frag_page_no(header, n, mtr), mtr);
-
- return(FALSE);
-}
-
-/***********************************************************************
-Frees a segment. The freeing is performed in several mini-transactions,
-so that there is no danger of bufferfixing too many buffer pages. */
-
-void
-fseg_free(
-/*======*/
- ulint space, /* in: space id */
- ulint page_no,/* in: page number where the segment header is
- placed */
- ulint offset) /* in: byte offset of the segment header on that
- page */
-{
- mtr_t mtr;
- buf_block_t* block;
- bool finished;
-
- for (;;) {
- mtr_start(&mtr);
-
- block = buf_page_get(space, page_no, &mtr);
-
- finished = fseg_free_step(space, page_no, offset, &mtr);
-
- mtr_commit(&mtr);
-
- if (finished) {
- break;
- }
- }
-}
-
-/**************************************************************************
-Returns the first extent descriptor for a segment. We think of the extent
-lists of the segment catenated in the order FSEG_FULL -> FSEG_NOT_FULL
--> FSEG_FREE. */
-static
-xdes_t*
-fseg_get_first_extent(
-/*==================*/
- /* out: the first extent descriptor, or NULL if
- none */
- fseg_header_t* header, /* in: segment header */
- mtr_t* mtr) /* in: mtr */
-{
- buf_block_t* block;
- fil_addr_t first;
- ulint space;
- xdes_t* descr;
-
- ut_ad(header && mtr);
-
- block = buf_block_align(header);
- buf_page_x_lock(block, mtr);
-
- space = buf_page_get_space(block);
-
- first = fil_addr_null;
-
- if (flst_get_len(header + FSEG_FULL, mtr) > 0) {
- first = flst_get_first(header + FSEG_FULL, mtr);
- } else if (flst_get_len(header + FSEG_NOT_FULL, mtr) > 0) {
- first = flst_get_first(header + FSEG_NOT_FULL, mtr);
- } else if (flst_get_len(header + FSEG_FREE, mtr) > 0) {
- first = flst_get_first(header + FSEG_FREE, mtr);
- }
-
- if (first.page == FIL_NULL) {
- return(NULL);
- } else {
- descr = xdes_lst_get_descriptor(space, first, mtr);
- return(descr);
- }
-}
-
-#ifdef notdefined
-
-/**************************************************************************
-Returns the last non-free extent descriptor for a segment. We think of
-the extent lists of the segment catenated in the order FSEG_FULL ->
-FSEG_NOT_FULL -> FSEG_FREE. */
-static
-xdes_t*
-fseg_get_last_non_free_extent(
-/*==========================*/
- /* out: the last extent descriptor, or NULL if
- none */
- fseg_header_t* header, /* in: segment header */
- mtr_t* mtr) /* in: mtr */
-{
- buf_block_t* block;
- fil_addr_t last;
- ulint space;
- xdes_t* descr;
-
- ut_ad(header && mtr);
-
- block = buf_block_align(header);
- buf_page_x_lock(block, mtr);
-
- space = buf_page_get_space(block);
-
- last = fil_addr_null;
-
- if (flst_get_len(header + FSEG_NOT_FULL, mtr) > 0) {
- last = flst_get_last(header + FSEG_NOT_FULL, mtr);
- } else if (flst_get_len(header + FSEG_FULL, mtr) > 0) {
- last = flst_get_last(header + FSEG_FULL, mtr);
- }
-
- if (last.page == FIL_NULL) {
- return(NULL);
- } else {
- descr = xdes_lst_get_descriptor(space, last, mtr);
- return(descr);
- }
-}
-
-/**************************************************************************
-Returns the next extent descriptor for a segment. We think of the extent
-lists of the segment catenated in the order FSEG_FULL -> FSEG_NOT_FULL
--> FSEG_FREE. */
-static
-xdes_t*
-fseg_get_next_extent(
-/*=================*/
- /* out: next extent descriptor, or NULL if
- none */
- fseg_header_t* header, /* in: segment header */
- xdes_t* descr, /* in: previous extent descriptor */
- mtr_t* mtr) /* in: mtr */
-{
- fil_addr_t next_addr;
- buf_block_t* block;
- ulint space;
-
- ut_ad(header && descr && mtr);
-
- block = buf_block_align(header);
- buf_page_x_lock(block, mtr);
-
- space = buf_page_get_space(block);
-
- next_addr = flst_get_next_addr(descr + XDES_FLST_NODE, mtr);
-
- if (next_addr.page == FIL_NULL) {
- /* This is the last extent in the list. */
- if (xdes_is_full(descr, mtr)) {
- /* descr is in FSEG_FULL list */
- if (flst_get_len(header + FSEG_NOT_FULL, mtr) > 0) {
- next_addr = flst_get_first(header
- + FSEG_NOT_FULL, mtr);
- } else if (flst_get_len(header + FSEG_FREE, mtr) > 0) {
- next_addr = flst_get_first(header
- + FSEG_FREE, mtr);
- }
- } else if (!xdes_is_full(descr, mtr)
- && !xdes_is_free(descr, mtr)) {
- /* descr is in FSEG_NOT_FULL list */
- if (flst_get_len(header + FSEG_FREE, mtr) > 0) {
- next_addr = flst_get_first(header
- + FSEG_FREE, mtr);
- }
- }
- }
-
- if (next_addr.page != FIL_NULL) {
- descr = xdes_lst_get_descriptor(space, next_addr, mtr);
- ut_ad(descr);
- return(descr);
- } else {
- return(NULL);
- }
-}
-
-/**************************************************************************
-Returns the previous extent descriptor for a segment. We think of the extent
-lists of the segment catenated in the order FSEG_FULL -> FSEG_NOT_FULL
--> FSEG_FREE. */
-static
-xdes_t*
-fseg_get_prev_extent(
-/*=================*/
- /* out: previous extent descriptor, or NULL if
- none */
- fseg_header_t* header, /* in: segment header */
- xdes_t* descr, /* in: extent descriptor */
- mtr_t* mtr) /* in: mtr */
-{
- fil_addr_t prev_addr;
- buf_block_t* block;
- ulint space;
-
- ut_ad(header && descr && mtr);
-
- block = buf_block_align(header);
- buf_page_x_lock(block, mtr);
-
- space = buf_page_get_space(block);
-
- prev_addr = flst_get_prev_addr(descr + XDES_FLST_NODE, mtr);
-
- if (prev_addr.page == FIL_NULL) {
- /* This is the first extent in the list. */
- if (xdes_is_free(descr, mtr)) {
- /* descr is in FSEG_FREE list */
- if (flst_get_len(header + FSEG_NOT_FULL, mtr) > 0) {
- prev_addr = flst_get_last(header
- + FSEG_NOT_FULL, mtr);
- } else if (flst_get_len(header + FSEG_FULL, mtr) > 0) {
- prev_addr = flst_get_last(header
- + FSEG_FULL, mtr);
- }
- } else if (!xdes_is_full(descr, mtr)
- && !xdes_is_free(descr, mtr)) {
- /* descr is in FSEG_NOT_FULL list */
- if (flst_get_len(header + FSEG_FULL, mtr) > 0) {
- prev_addr = flst_get_last(header
- + FSEG_FULL, mtr);
- }
- }
- }
-
- if (prev_addr.page != FIL_NULL) {
- descr = xdes_lst_get_descriptor(space, prev_addr, mtr);
- ut_ad(descr);
- return(descr);
- } else {
- return(NULL);
- }
-}
-
-/*************************************************************************
-Gets the first used page number in the given extent assigned to a
-specific segment, or its successors, in the order defined in
-fsp_get_next_extent. */
-static
-ulint
-fseg_extent_get_next_page_no(
-/*=========================*/
- /* next used page number in the given extent
- or a successor of it, FIL_NULL if no page
- found */
- fseg_header_t* header, /* in: segment header */
- xdes_t* descr, /* in: extent descriptor, if this is NULL, the
- function returns FIL_NULL */
- mtr_t* mtr) /* in: mtr */
-{
- ulint bit;
-
- UT_NOT_USED(header);
- ut_ad((descr == NULL) || (xdes_get_state(descr, mtr) == XDES_FSEG));
-
- for (;;) {
- if (descr == NULL) {
- return(FIL_NULL);
- }
-
- bit = xdes_find_bit(descr, XDES_FREE_BIT, FALSE, 0, mtr);
-
- if (bit == ULINT_UNDEFINED) {
- /* No page found in this extent: the extent is in
- FSEG_FREE list, thus, no used page can be found
- in successors */
- return(FIL_NULL);
- } else {
- return(xdes_get_offset(descr) + bit);
- }
- }
-}
-
-/*************************************************************************
-Gets the last used page number in the given extent assigned to a
-specific segment, or its predecessor extents, in the order defined in
-fsp_get_next_extent. If the page cannot be found from the extents,
-the last page of the fragment list is returned, or FIL_NULL if it is
-empty.*/
-static
-ulint
-fseg_extent_get_prev_page_no(
-/*=========================*/
- /* previous used page number in the given
- extent or a predecessor, FIL_NULL
- if no page found */
- fseg_header_t* header, /* in: segment header */
- xdes_t* descr, /* in: extent descriptor, if this is NULL, the
- function returns the last page of the fragment
- list, if any */
- mtr_t* mtr) /* in: mtr */
-{
- ulint prev_page_no;
- ulint bit;
- fil_addr_t last_frag_page_addr;
-
- ut_ad((descr == NULL) || (xdes_get_state(descr, mtr) == XDES_FSEG));
-
- for (;;) {
- if (descr == NULL) {
- prev_page_no = FIL_NULL;
- break;
- }
-
- bit = xdes_find_bit_downward(descr, XDES_FREE_BIT, FALSE,
- FSP_EXTENT_SIZE - 1, mtr);
-
- if (bit == ULINT_UNDEFINED) {
- descr = fseg_get_prev_extent(header, descr, mtr);
- } else {
- prev_page_no = xdes_get_offset(descr) + bit;
- break;
- }
- }
-
- if (prev_page_no == FIL_NULL) {
- last_frag_page_addr = flst_get_last(header + FSEG_FRAG, mtr);
- prev_page_no = last_frag_page_addr.page;
- }
-
- return(prev_page_no);
-}
-
-/**************************************************************************
-Returns the page number of the first segment page. If no pages have been
-freed from the segment, and the pages were allocated with the hint page
-number always one greater than previous page, then it is guaranteed that
-this function returns the first allocated page. */
-
-ulint
-fseg_get_first_page_no(
-/*===================*/
- /* out: page number, FIL_NULL if no
- page found */
- fseg_header_t* header, /* in: segment header */
- mtr_t* mtr) /* in: mtr */
-{
- buf_block_t* block;
- ulint first_page_no;
- xdes_t* descr;
- fil_addr_t first_frag_page_addr;
-
- ut_ad(header);
-
- mtr_x_lock(&fsp_latch, mtr);
-
- block = buf_block_align(header);
- buf_page_x_lock(block, mtr);
-
- /* Find first page */
- first_frag_page_addr = flst_get_first(header + FSEG_FRAG, mtr);
- first_page_no = first_frag_page_addr.page;
-
- if (first_page_no == FIL_NULL) {
- descr = fseg_get_first_extent(header, mtr);
- first_page_no = fseg_extent_get_next_page_no(header, descr,
- mtr);
- }
-
- return(first_page_no);
-}
-
-/**************************************************************************
-Returns the page number of the last segment page. If no pages have been
-freed from the segment, and the pages were allocated with the hint page
-number always one greater than previous page, then it is guaranteed that
-this function returns the last allocated page. */
-
-ulint
-fseg_get_last_page_no(
-/*==================*/
- /* out: page number, FIL_NULL if no
- page found */
- fseg_header_t* header, /* in: segment header */
- mtr_t* mtr) /* in: mtr */
-{
- buf_block_t* block;
- ulint last_page_no;
- xdes_t* descr;
-
- ut_ad(header);
-
- mtr_x_lock(&fsp_latch, mtr);
-
- block = buf_block_align(header);
- buf_page_x_lock(block, mtr);
-
- descr = fseg_get_last_non_free_extent(header, mtr);
- last_page_no = fseg_extent_get_prev_page_no(header, descr, mtr);
-
- return(last_page_no);
-}
-
-/**************************************************************************
-Returns the page number of the next segment page. If no pages have been
-freed from the segment, and the pages were allocated with the hint page
-number always one greater than previous page, then it is guaranteed that
-this function steps the pages through in the order they were allocated
-to the segment. */
-
-ulint
-fseg_get_next_page_no(
-/*==================*/
- /* out: page number, FIL_NULL if no
- page left */
- fseg_header_t* header, /* in: segment header */
- ulint page_no,/* in: previous page number */
- mtr_t* mtr) /* in: mtr */
-{
- buf_block_t* block;
- buf_frame_t* frame;
- ulint space;
- ulint next_page_no;
- xdes_t* descr;
- ulint bit;
- fil_addr_t next_frag_page_addr;
- fseg_page_header_t* page_header;
-
- ut_ad(header);
-
- mtr_x_lock(&fsp_latch, mtr);
-
- block = buf_block_align(header);
- buf_page_x_lock(block, mtr);
-
- space = buf_page_get_space(block);
-
- descr = xdes_get_descriptor(space, page_no, mtr);
- ut_ad(xdes_get_bit(descr, XDES_FREE_BIT,
- page_no % FSP_EXTENT_SIZE, mtr) == FALSE);
-
- if (xdes_get_state(descr, mtr) == XDES_FSEG) {
- /* The extent of the current page belongs to the segment */
- bit = xdes_find_bit(descr, XDES_FREE_BIT, FALSE,
- (page_no + 1) % FSP_EXTENT_SIZE,
- mtr);
- if ((bit == ULINT_UNDEFINED)
- || (bit <= (page_no % FSP_EXTENT_SIZE))) {
- /* No higher address pages in this extent */
- descr = fseg_get_next_extent(header, descr, mtr);
- next_page_no = fseg_extent_get_next_page_no(
- header, descr, mtr);
- } else {
- next_page_no = xdes_get_offset(descr) + bit;
- }
- } else {
- /* Current page is a fragment page */
- block = buf_page_get(space, page_no, mtr);
- buf_page_x_lock(block, mtr);
- frame = buf_block_get_frame(block);
- page_header = frame + FSEG_PAGE_HEADER_OFFSET;
- next_frag_page_addr = flst_get_next_addr(
- page_header + FSEG_PAGE_FRAG_NODE,
- mtr);
-
- next_page_no = next_frag_page_addr.page;
- if (next_page_no == FIL_NULL) {
- descr = fseg_get_first_extent(header, mtr);
- next_page_no = fseg_extent_get_next_page_no(
- header, descr, mtr);
- }
- }
- return(next_page_no);
-}
-
-/**************************************************************************
-Returns the page number of the previous segment page. If no pages have been
-freed from the segment, and the pages were allocated with the hint page
-number always one greater than the previous page, then it is guaranteed that
-this function steps through the pages in the order opposite to the allocation
-order of the pages. */
-
-ulint
-fseg_get_prev_page_no(
-/*==================*/
- /* out: page number, FIL_NULL if no page
- left */
- fseg_header_t* header, /* in: segment header */
- ulint page_no,/* in: page number */
- mtr_t* mtr) /* in: mtr */
-{
- buf_block_t* block;
- buf_frame_t* frame;
- ulint space;
- ulint prev_page_no;
- xdes_t* descr;
- ulint bit;
- fil_addr_t prev_frag_page_addr;
- fseg_page_header_t* page_header;
-
- ut_ad(header);
-
- mtr_x_lock(&fsp_latch, mtr);
-
- block = buf_block_align(header);
- buf_page_x_lock(block, mtr);
-
- space = buf_page_get_space(block);
-
- descr = xdes_get_descriptor(space, page_no, mtr);
- ut_ad(xdes_get_bit(descr, XDES_FREE_BIT,
- page_no % FSP_EXTENT_SIZE, mtr) == FALSE);
-
- if (xdes_get_state(descr, mtr) == XDES_FSEG) {
- /* The extent of the current page belongs to the segment */
- bit = xdes_find_bit_downward(descr, XDES_FREE_BIT, FALSE,
- (page_no - 1) % FSP_EXTENT_SIZE,
- mtr);
- if ((bit == ULINT_UNDEFINED)
- || (bit >= (page_no % FSP_EXTENT_SIZE))) {
- /* No lower address pages in this extent */
- descr = fseg_get_prev_extent(header, descr, mtr);
- prev_page_no = fseg_extent_get_prev_page_no(
- header, descr, mtr);
- } else {
- prev_page_no = xdes_get_offset(descr) + bit;
- }
- } else {
- /* Current page is a fragment page */
- block = buf_page_get(space, page_no, mtr);
- buf_page_x_lock(block, mtr);
- frame = buf_block_get_frame(block);
- page_header = frame + FSEG_PAGE_HEADER_OFFSET;
- prev_frag_page_addr = flst_get_prev_addr(
- page_header + FSEG_PAGE_FRAG_NODE,
- mtr);
-
- prev_page_no = prev_frag_page_addr.page;
- }
- return(prev_page_no);
-}
-
-#endif
-
-/***********************************************************************
-Validates a segment. */
-static
-bool
-fseg_validate_low(
-/*==============*/
- /* out: TRUE if ok */
- fseg_header_t* header, /* in: segment header */
- mtr_t* mtr2) /* in: mtr */
-{
- ulint space;
- dulint seg_id;
- mtr_t mtr;
- xdes_t* descr;
- fil_addr_t node_addr;
- ulint n_used = 0;
- ulint n_used2 = 0;
- flst_node_t* node;
- buf_frame_t* frame;
- fseg_page_header_t* page_header;
-
- ut_ad(mtr_memo_contains(mtr2, buf_block_align(header),
- MTR_MEMO_BUF_FIX));
- buf_page_x_lock(buf_block_align(header), mtr2);
-
- space = buf_page_get_space(buf_block_align(header));
-
- seg_id = mtr_read_dulint(header + FSEG_ID, MLOG_8BYTES, mtr2);
- n_used = mtr_read_ulint(header + FSEG_NOT_FULL_N_USED,
- MLOG_4BYTES, mtr2);
-
- flst_validate(header + FSEG_FRAG, mtr2);
- flst_validate(header + FSEG_FREE, mtr2);
- flst_validate(header + FSEG_NOT_FULL, mtr2);
- flst_validate(header + FSEG_FULL, mtr2);
-
- /* Validate FSEG_FREE list */
- node_addr = flst_get_first(header + FSEG_FREE, mtr2);
-
- while (!fil_addr_is_null(node_addr)) {
- mtr_start(&mtr);
- mtr_x_lock(&fsp_latch, &mtr);
-
- descr = xdes_lst_get_descriptor(space, node_addr, &mtr);
-
- ut_a(xdes_get_n_used(descr, &mtr) == 0);
- ut_a(xdes_get_state(descr, &mtr) == XDES_FSEG);
- ut_a(0 == ut_dulint_cmp(
- mtr_read_dulint(descr + XDES_ID, MLOG_8BYTES,
- &mtr), seg_id));
-
- node_addr = flst_get_next_addr(descr + XDES_FLST_NODE, &mtr);
- mtr_commit(&mtr);
- }
-
- /* Validate FSEG_NOT_FULL list */
-
- node_addr = flst_get_first(header + FSEG_NOT_FULL, mtr2);
-
- while (!fil_addr_is_null(node_addr)) {
- mtr_start(&mtr);
- mtr_x_lock(&fsp_latch, &mtr);
-
- descr = xdes_lst_get_descriptor(space, node_addr, &mtr);
-
- ut_a(xdes_get_n_used(descr, &mtr) > 0);
- ut_a(xdes_get_n_used(descr, &mtr) < FSP_EXTENT_SIZE);
- ut_a(xdes_get_state(descr, &mtr) == XDES_FSEG);
- ut_a(0 == ut_dulint_cmp(
- mtr_read_dulint(descr + XDES_ID, MLOG_8BYTES,
- &mtr), seg_id));
-
- n_used2 += xdes_get_n_used(descr, &mtr);
-
- node_addr = flst_get_next_addr(descr + XDES_FLST_NODE, &mtr);
- mtr_commit(&mtr);
- }
-
- /* Validate FSEG_FULL list */
-
- node_addr = flst_get_first(header + FSEG_FULL, mtr2);
-
- while (!fil_addr_is_null(node_addr)) {
- mtr_start(&mtr);
- mtr_x_lock(&fsp_latch, &mtr);
-
- descr = xdes_lst_get_descriptor(space, node_addr, &mtr);
-
- ut_a(xdes_get_n_used(descr, &mtr) == FSP_EXTENT_SIZE);
- ut_a(xdes_get_state(descr, &mtr) == XDES_FSEG);
- ut_a(0 == ut_dulint_cmp(
- mtr_read_dulint(descr + XDES_ID, MLOG_8BYTES,
- &mtr), seg_id));
-
- node_addr = flst_get_next_addr(descr + XDES_FLST_NODE, &mtr);
- mtr_commit(&mtr);
- }
-
- /* Validate FSEG_FRAG list */
- node_addr = flst_get_first(header + FSEG_FRAG, mtr2);
-
- while (!fil_addr_is_null(node_addr)) {
- mtr_start(&mtr);
- mtr_x_lock(&fsp_latch, &mtr);
-
- node = fut_get_ptr_x_lock(space, node_addr, &mtr);
- frame = buf_frame_align(node);
- page_header = frame + FSEG_PAGE_HEADER_OFFSET;
- ut_a(0 == ut_dulint_cmp(
- mtr_read_dulint(page_header + FSEG_PAGE_SEG_ID,
- MLOG_8BYTES, &mtr), seg_id));
-
- node_addr = flst_get_next_addr(node, &mtr);
- mtr_commit(&mtr);
- }
-
- ut_a(n_used == n_used2);
-
- return(TRUE);
-}
-
-/***********************************************************************
-Validates a segment. */
-
-bool
-fseg_validate(
-/*==========*/
- /* out: TRUE if ok */
- fseg_header_t* header, /* in: segment header */
- mtr_t* mtr2) /* in: mtr */
-{
- bool ret;
-
- mtr_x_lock(&fsp_latch, mtr2);
- ret = fseg_validate_low(header, mtr2);
-
- return(ret);
-}
-
-/***********************************************************************
-Writes info of a segment. */
-static
-void
-fseg_print_low(
-/*===========*/
- fseg_header_t* header, /* in: segment header */
- mtr_t* mtr) /* in: mtr */
-{
- ulint space;
- ulint seg_id_low;
- ulint seg_id_high;
- ulint n_used;
- ulint n_frag;
- ulint n_free;
- ulint n_not_full;
- ulint n_full;
- ulint reserved;
- ulint used;
- ulint page_no;
-
- ut_ad(mtr_memo_contains(mtr, buf_block_align(header),
- MTR_MEMO_BUF_FIX));
- buf_page_x_lock(buf_block_align(header), mtr);
-
- space = buf_page_get_space(buf_block_align(header));
- page_no = buf_page_get_offset(buf_block_align(header));
-
- reserved = fseg_n_reserved_pages_low(header, &used, mtr);
-
- seg_id_low = ut_dulint_get_low(mtr_read_dulint(header + FSEG_ID,
- MLOG_8BYTES, mtr));
- seg_id_high = ut_dulint_get_high(mtr_read_dulint(header + FSEG_ID,
- MLOG_8BYTES, mtr));
-
- n_used = mtr_read_ulint(header + FSEG_NOT_FULL_N_USED,
- MLOG_4BYTES, mtr);
-
- n_frag = flst_get_len(header + FSEG_FRAG, mtr);
- n_free = flst_get_len(header + FSEG_FREE, mtr);
- n_not_full = flst_get_len(header + FSEG_NOT_FULL, mtr);
- n_full = flst_get_len(header + FSEG_FULL, mtr);
-
- printf(
- "SEGMENT id %lu %lu space %lu; page %lu; res %lu used %lu; full ext %lu\n",
- seg_id_high, seg_id_low, space, page_no, reserved, used,
- n_full);
- printf(
- "fragm pages %lu; free extents %lu; not full extents %lu: pages %lu\n",
- n_frag, n_free, n_not_full, n_used);
-}
-
-/***********************************************************************
-Writes info of a segment. */
-
-void
-fseg_print(
-/*=======*/
- fseg_header_t* header, /* in: segment header */
- mtr_t* mtr) /* in: mtr */
-{
- mtr_x_lock(&fsp_latch, mtr);
-
- fseg_print_low(header, mtr);
-}
-
-/***********************************************************************
-Validates the file space system and its segments. */
-
-bool
-fsp_validate(
-/*=========*/
- /* out: TRUE if ok */
- ulint space) /* in: space id */
-{
- fsp_header_t* header;
- fseg_header_t* seg_header;
- ulint size;
- ulint free_limit;
- ulint frag_n_used;
- mtr_t mtr;
- mtr_t mtr2;
- xdes_t* descr;
- fil_addr_t node_addr;
- ulint descr_count = 0;
- ulint n_used = 0;
- ulint n_used2 = 0;
- ulint n_full_frag_pages;
-
- /* Start first a mini-transaction mtr2 to lock out all other threads
- from the fsp system */
- mtr_start(&mtr2);
- mtr_x_lock(&fsp_latch, &mtr2);
-
- mtr_start(&mtr);
- mtr_x_lock(&fsp_latch, &mtr);
-
- header = fsp_get_space_header(space, &mtr);
-
- size = mtr_read_ulint(header + FSP_SIZE, MLOG_4BYTES, &mtr);
- free_limit = mtr_read_ulint(header + FSP_FREE_LIMIT,
- MLOG_4BYTES, &mtr);
- frag_n_used = mtr_read_ulint(header + FSP_FRAG_N_USED,
- MLOG_4BYTES, &mtr);
-
- n_full_frag_pages = FSP_EXTENT_SIZE *
- flst_get_len(header + FSP_FULL_FRAG, &mtr);
-
- ut_a(free_limit <= size);
-
- flst_validate(header + FSP_FREE, &mtr);
- flst_validate(header + FSP_FREE_FRAG, &mtr);
- flst_validate(header + FSP_FULL_FRAG, &mtr);
- flst_validate(header + FSP_SEGS, &mtr);
-
- mtr_commit(&mtr);
-
- /* Validate FSP_FREE list */
- mtr_start(&mtr);
- mtr_x_lock(&fsp_latch, &mtr);
-
- header = fsp_get_space_header(space, &mtr);
- node_addr = flst_get_first(header + FSP_FREE, &mtr);
-
- mtr_commit(&mtr);
-
- while (!fil_addr_is_null(node_addr)) {
- mtr_start(&mtr);
- mtr_x_lock(&fsp_latch, &mtr);
-
- descr_count++;
- descr = xdes_lst_get_descriptor(space, node_addr, &mtr);
-
- ut_a(xdes_get_n_used(descr, &mtr) == 0);
- ut_a(xdes_get_state(descr, &mtr) == XDES_FREE);
-
- node_addr = flst_get_next_addr(descr + XDES_FLST_NODE, &mtr);
- mtr_commit(&mtr);
- }
-
- /* Validate FSP_FREE_FRAG list */
- mtr_start(&mtr);
- mtr_x_lock(&fsp_latch, &mtr);
-
- header = fsp_get_space_header(space, &mtr);
- node_addr = flst_get_first(header + FSP_FREE_FRAG, &mtr);
-
- mtr_commit(&mtr);
-
- while (!fil_addr_is_null(node_addr)) {
- mtr_start(&mtr);
- mtr_x_lock(&fsp_latch, &mtr);
-
- descr_count++;
- descr = xdes_lst_get_descriptor(space, node_addr, &mtr);
-
- ut_a(xdes_get_n_used(descr, &mtr) > 0);
- ut_a(xdes_get_n_used(descr, &mtr) < FSP_EXTENT_SIZE);
- ut_a(xdes_get_state(descr, &mtr) == XDES_FREE_FRAG);
-
- n_used += xdes_get_n_used(descr, &mtr);
- node_addr = flst_get_next_addr(descr + XDES_FLST_NODE, &mtr);
-
- mtr_commit(&mtr);
- }
-
- /* Validate FSP_FULL_FRAG list */
- mtr_start(&mtr);
- mtr_x_lock(&fsp_latch, &mtr);
-
- header = fsp_get_space_header(space, &mtr);
- node_addr = flst_get_first(header + FSP_FULL_FRAG, &mtr);
-
- mtr_commit(&mtr);
-
- while (!fil_addr_is_null(node_addr)) {
- mtr_start(&mtr);
- mtr_x_lock(&fsp_latch, &mtr);
-
- descr_count++;
- descr = xdes_lst_get_descriptor(space, node_addr, &mtr);
-
- ut_a(xdes_get_n_used(descr, &mtr) == FSP_EXTENT_SIZE);
- ut_a(xdes_get_state(descr, &mtr) == XDES_FULL_FRAG);
-
- node_addr = flst_get_next_addr(descr + XDES_FLST_NODE, &mtr);
- mtr_commit(&mtr);
- }
-
- /* Validate segments */
- mtr_start(&mtr);
- mtr_x_lock(&fsp_latch, &mtr);
-
- header = fsp_get_space_header(space, &mtr);
- node_addr = flst_get_first(header + FSP_SEGS, &mtr);
-
- mtr_commit(&mtr);
-
- while (!fil_addr_is_null(node_addr)) {
- mtr_start(&mtr);
- mtr_x_lock(&fsp_latch, &mtr);
-
- seg_header = fut_get_ptr_x_lock(space, node_addr,
- &mtr) - FSEG_FLST_NODE;
- fseg_validate_low(seg_header, &mtr);
-
- descr_count += flst_get_len(seg_header + FSEG_FREE, &mtr);
- descr_count += flst_get_len(seg_header + FSEG_FULL, &mtr);
- descr_count += flst_get_len(seg_header + FSEG_NOT_FULL, &mtr);
-
- n_used2 += flst_get_len(seg_header + FSEG_FRAG, &mtr);
-
- node_addr = flst_get_next_addr(seg_header + FSEG_FLST_NODE,
- &mtr);
- mtr_commit(&mtr);
- }
-
- ut_a(descr_count * FSP_EXTENT_SIZE == free_limit);
- ut_a(n_used + n_full_frag_pages
- == n_used2 + (free_limit + XDES_DESCRIBED_PER_PAGE - 1)
- / XDES_DESCRIBED_PER_PAGE);
- ut_a(frag_n_used == n_used);
-
- mtr_commit(&mtr2);
- return(TRUE);
-}
-
-/***********************************************************************
-Prints info of a file space. */
-
-void
-fsp_print(
-/*======*/
- ulint space) /* in: space id */
-{
- fsp_header_t* header;
- fseg_header_t* seg_header;
- ulint size;
- ulint free_limit;
- ulint frag_n_used;
- mtr_t mtr;
- mtr_t mtr2;
- fil_addr_t node_addr;
- ulint n_free;
- ulint n_free_frag;
- ulint n_full_frag;
- ulint n_segs;
- ulint seg_id_low;
- ulint seg_id_high;
-
- /* Start first a mini-transaction mtr2 to lock out all other threads
- from the fsp system */
- mtr_start(&mtr2);
- mtr_x_lock(&fsp_latch, &mtr2);
-
- mtr_start(&mtr);
- mtr_x_lock(&fsp_latch, &mtr);
-
- header = fsp_get_space_header(space, &mtr);
-
- size = mtr_read_ulint(header + FSP_SIZE, MLOG_4BYTES, &mtr);
- free_limit = mtr_read_ulint(header + FSP_FREE_LIMIT,
- MLOG_4BYTES, &mtr);
- frag_n_used = mtr_read_ulint(header + FSP_FRAG_N_USED,
- MLOG_4BYTES, &mtr);
-
- n_free = flst_get_len(header + FSP_FREE, &mtr);
- n_free_frag = flst_get_len(header + FSP_FREE_FRAG, &mtr);
- n_full_frag = flst_get_len(header + FSP_FULL_FRAG, &mtr);
- n_segs = flst_get_len(header + FSP_SEGS, &mtr);
- seg_id_low = ut_dulint_get_low(mtr_read_dulint(header + FSP_SEG_ID,
- MLOG_8BYTES, &mtr));
- seg_id_high = ut_dulint_get_high(mtr_read_dulint(header + FSP_SEG_ID,
- MLOG_8BYTES, &mtr));
-
- printf("FILE SPACE INFO: id %lu\n", space);
-
- printf("size %lu, free limit %lu, free extents %lu\n",
- size, free_limit, n_free);
- printf(
- "not full frag extents %lu: used pages %lu, full frag extents %lu\n",
- n_free_frag, frag_n_used, n_full_frag);
-
- printf("number of segments %lu, first seg id not used %lu %lu\n",
- n_segs, seg_id_high, seg_id_low);
-
- /* Print segments */
- node_addr = flst_get_first(header + FSP_SEGS, &mtr);
-
- mtr_commit(&mtr);
-
- while (!fil_addr_is_null(node_addr)) {
- mtr_start(&mtr);
- mtr_x_lock(&fsp_latch, &mtr);
-
- seg_header = fut_get_ptr_x_lock(space, node_addr,
- &mtr) - FSEG_FLST_NODE;
- fseg_print_low(seg_header, &mtr);
-
- node_addr = flst_get_next_addr(seg_header + FSEG_FLST_NODE,
- &mtr);
- mtr_commit(&mtr);
- }
-
- mtr_commit(&mtr2);
-}
-
diff --git a/innobase/fsp/ts/del.c b/innobase/fsp/ts/del.c
deleted file mode 100644
index 885797bdc76..00000000000
--- a/innobase/fsp/ts/del.c
+++ /dev/null
@@ -1,891 +0,0 @@
-/************************************************************************
-The test module for the file system and buffer manager
-
-(c) 1995 Innobase Oy
-
-Created 11/16/1995 Heikki Tuuri
-*************************************************************************/
-
-#include "string.h"
-
-#include "os0thread.h"
-#include "os0file.h"
-#include "ut0ut.h"
-#include "ut0byte.h"
-#include "sync0sync.h"
-#include "mem0mem.h"
-#include "fil0fil.h"
-#include "..\buf0buf.h"
-#include "..\buf0buf.h1"
-#include "..\buf0buf.h2"
-#include "..\buf0flu.h"
-#include "..\buf0lru.h"
-#include "mtr0buf.h"
-#include "mtr0log.h"
-#include "fsp0fsp.h"
-#include "log0log.h"
-
-os_file_t files[1000];
-
-mutex_t ios_mutex;
-ulint ios;
-ulint n[5];
-
-
-/************************************************************************
-Io-handler thread function. */
-
-ulint
-handler_thread(
-/*===========*/
- void* arg)
-{
- ulint segment;
- void* mess;
- ulint i;
- bool ret;
-
- segment = *((ulint*)arg);
-
- printf("Thread %lu starts\n", segment);
-
- for (i = 0;; i++) {
- ret = fil_aio_wait(segment, &mess);
- ut_a(ret);
-
- buf_page_io_complete((buf_block_t*)mess);
-
- mutex_enter(&ios_mutex);
- ios++;
- mutex_exit(&ios_mutex);
-
- }
-
- return(0);
-}
-
-/************************************************************************
-Creates the test database files. */
-
-void
-create_db(void)
-/*===========*/
-{
- ulint i;
- buf_block_t* block;
- byte* frame;
- ulint j;
- ulint tm, oldtm;
- mtr_t mtr;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1; i++) {
- for (j = 0; j < 4096; j++) {
- mtr_start(&mtr);
- if (j == 0) {
- fsp_header_init(i, 4096, &mtr);
-
- block = mtr_page_get(i, j, NULL, &mtr);
- } else {
- block = mtr_page_create(i, j, &mtr);
- }
-
- frame = buf_block_get_frame(block);
-
- mtr_page_x_lock(block, &mtr);
-
- mlog_write_ulint(frame + FIL_PAGE_PREV,
- j - 1, MLOG_4BYTES, &mtr);
-
- mlog_write_ulint(frame + FIL_PAGE_NEXT,
- j + 1, MLOG_4BYTES, &mtr);
-
- mlog_write_ulint(frame + FIL_PAGE_OFFSET,
- j, MLOG_4BYTES, &mtr);
-
- mtr_commit(&mtr);
- }
- }
-
- tm = ut_clock();
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
-
- /* Flush the pool of dirty pages by reading low-offset pages */
- for (i = 0; i < 1000; i++) {
-
- mtr_start(&mtr);
- block = mtr_page_get(0, i, NULL, &mtr);
-
- frame = buf_block_get_frame(block);
-
- mtr_page_s_lock(block, &mtr);
-
- ut_a(mtr_read_ulint(frame + FIL_PAGE_OFFSET, MLOG_4BYTES,
- &mtr) == i);
-
- mtr_commit(&mtr);
- }
-
- os_thread_sleep(1000000);
-
- ut_a(buf_all_freed());
-}
-
-/*************************************************************************
-Creates the files for the file system test and inserts them to
-the file system. */
-
-void
-create_files(void)
-/*==============*/
-{
- bool ret;
- ulint i, k;
- char name[20];
- os_thread_t thr[5];
- os_thread_id_t id[5];
-
- strcpy(name, "j:\\tsfile1");
-
- for (k = 0; k < 1; k++) {
- for (i = 0; i < 4; i++) {
-
- name[9] = (char)((ulint)'0' + i);
-
- files[i] = os_file_create(name, OS_FILE_CREATE,
- OS_FILE_TABLESPACE, &ret);
-
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(
- name, OS_FILE_OPEN,
- OS_FILE_TABLESPACE, &ret);
-
- ut_a(ret);
- }
-
- ret = os_file_set_size(files[i], 4096 * 8192, 0);
- ut_a(ret);
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create("noname", k, OS_FILE_TABLESPACE);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, 4096, k);
- }
- }
-
- ios = 0;
-
- mutex_create(&ios_mutex);
-
- for (i = 0; i < 5; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(handler_thread, n + i, id + i);
- }
-}
-
-/************************************************************************
-Reads the test database files. */
-
-void
-test1(void)
-/*=======*/
-{
- ulint i, j, k;
- buf_block_t* block;
- byte* frame;
- ulint tm, oldtm;
-
- buf_flush_batch(BUF_FLUSH_LIST, 1000);
-
- os_thread_sleep(1000000);
-
- buf_all_freed();
-
- oldtm = ut_clock();
-
- for (k = 0; k < 1; k++) {
- for (i = 0; i < 1; i++) {
- for (j = 0; j < 409; j++) {
- block = buf_page_get(i, j, NULL);
-
- frame = buf_block_get_frame(block);
-
- buf_page_s_lock(block);
-
- ut_a(*((ulint*)(frame + 16)) == j);
-
- buf_page_s_unlock(block);
-
- buf_page_release(block);
- }
- }
- }
-
- tm = ut_clock();
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
-
-}
-
-/************************************************************************
-Reads the test database files. */
-
-void
-test2(void)
-/*=======*/
-{
- ulint i, j, k, rnd;
- buf_block_t* block;
- byte* frame;
- ulint tm, oldtm;
-
- oldtm = ut_clock();
-
- rnd = 123;
-
- for (k = 0; k < 100; k++) {
- rnd += 23651;
- rnd = rnd % 4096;
-
- i = rnd / 4096;
- j = rnd % 2048;
-
- block = buf_page_get(i, j, NULL);
-
- frame = buf_block_get_frame(block);
-
- buf_page_s_lock(block);
-
- ut_a(*((ulint*)(frame + 16)) == j);
-
- buf_page_s_unlock(block);
-
- buf_page_release(block);
- }
-
- tm = ut_clock();
- printf("Wall clock time for random read %lu milliseconds\n",
- tm - oldtm);
-}
-
-/************************************************************************
-Reads the test database files. */
-
-void
-test4(void)
-/*=======*/
-{
- ulint i, j, k, rnd;
- buf_block_t* block;
- byte* frame;
- ulint tm, oldtm;
-
- /* Flush the pool of high-offset pages */
- for (i = 0; i < 1000; i++) {
-
- block = buf_page_get(0, i, NULL);
-
- frame = buf_block_get_frame(block);
-
- buf_page_s_lock(block);
-
- ut_a(*((ulint*)(frame + 16)) == i);
-
- buf_page_s_unlock(block);
-
- buf_page_release(block);
- }
-
- printf("Test starts\n");
-
- oldtm = ut_clock();
-
- rnd = 123;
-
- for (k = 0; k < 400; k++) {
-
- rnd += 4357;
-
- i = 0;
- j = 1001 + rnd % 3000;
-
- block = buf_page_get(i, j, NULL);
-
- frame = buf_block_get_frame(block);
-
- buf_page_s_lock(block);
-
- ut_a(*((ulint*)(frame + 16)) == j);
-
- buf_page_s_unlock(block);
-
- buf_page_release(block);
- }
-
- tm = ut_clock();
- printf(
- "Wall clock time for %lu random no read-ahead %lu milliseconds\n",
- k, tm - oldtm);
-
- /* Flush the pool of high-offset pages */
- for (i = 0; i < 1000; i++) {
-
- block = buf_page_get(0, i, NULL);
-
- frame = buf_block_get_frame(block);
-
- buf_page_s_lock(block);
-
- ut_a(*((ulint*)(frame + 16)) == i);
-
- buf_page_s_unlock(block);
-
- buf_page_release(block);
- }
-
- printf("Test starts\n");
-
- oldtm = ut_clock();
-
- rnd = 123;
-
- for (k = 0; k < 400; k++) {
-
- rnd += 4357;
-
- i = 0;
- j = 1001 + rnd % 400;
-
- block = buf_page_get(i, j, NULL);
-
- frame = buf_block_get_frame(block);
-
- buf_page_s_lock(block);
-
- ut_a(*((ulint*)(frame + 16)) == j);
-
- buf_page_s_unlock(block);
-
- buf_page_release(block);
- }
-
- tm = ut_clock();
- printf(
- "Wall clock time for %lu random read-ahead %lu milliseconds\n",
- k, tm - oldtm);
-
-}
-
-/************************************************************************
-Tests speed of CPU algorithms. */
-
-void
-test3(void)
-/*=======*/
-{
- ulint i, j;
- buf_block_t* block;
- ulint tm, oldtm;
-
- for (i = 0; i < 400; i++) {
-
- block = buf_page_get(0, i, NULL);
-
- buf_page_release(block);
- }
-
- os_thread_sleep(2000000);
-
- oldtm = ut_clock();
-
- for (j = 0; j < 500; j++) {
- for (i = 0; i < 200; i++) {
-
- block = buf_page_get(0, i, NULL);
-
-/*
- buf_page_s_lock(block);
-
- buf_page_s_unlock(block);
-*/
-
- buf_page_release(block);
-
- }
- }
-
- tm = ut_clock();
- printf("Wall clock time for %lu page get-release %lu milliseconds\n",
- i * j, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (j = 0; j < 500; j++) {
- for (i = 0; i < 200; i++) {
-
- buf_page_get(0, i, NULL);
-/*
- buf_page_s_lock(block);
-
- buf_page_s_unlock(block);
-*/
- buf_page_release(block);
- }
- }
-
- tm = ut_clock();
- printf("Wall clock time for %lu block get-release %lu milliseconds\n",
- i * j, tm - oldtm);
-
-
- oldtm = ut_clock();
-
- for (i = 0; i < 100000; i++) {
- block = buf_block_alloc();
- buf_block_free(block);
- }
-
- tm = ut_clock();
- printf("Wall clock time for %lu block alloc-free %lu milliseconds\n",
- i, tm - oldtm);
-
- ha_print_info(buf_pool->page_hash);
-}
-
-/************************************************************************
-Frees the spaces in the file system. */
-
-void
-free_system(void)
-/*=============*/
-{
- ulint i;
-
- for (i = 0; i < 1; i++) {
- fil_space_free(i);
- }
-}
-
-/************************************************************************
-Test for file space management. */
-
-void
-test5(void)
-/*=======*/
-{
- mtr_t mtr;
- ulint seg_page;
- ulint new_page;
- ulint seg_page2;
- ulint new_page2;
- buf_block_t* block;
- bool finished;
- ulint i;
- ulint reserved;
- ulint used;
- ulint tm, oldtm;
-
- os_thread_sleep(1000000);
-
- buf_validate();
-
- buf_print();
-
- mtr_start(&mtr);
-
- seg_page = fseg_create(0, 0, 1000, 555, &mtr);
-
- mtr_commit(&mtr);
-
- os_thread_sleep(1000000);
- buf_validate();
- printf("Segment created: header page %lu\n", seg_page);
-
- mtr_start(&mtr);
-
- block = mtr_page_get(0, seg_page, NULL, &mtr);
-
- new_page = fseg_alloc_free_page(buf_block_get_frame(block) + 1000,
- 2, FSP_UP, &mtr);
-
- mtr_commit(&mtr);
-
- buf_validate();
- buf_print();
- printf("Segment page allocated %lu\n", new_page);
-
- finished = FALSE;
-
- while (!finished) {
-
- mtr_start(&mtr);
-
- block = mtr_page_get(0, seg_page, NULL, &mtr);
-
- finished = fseg_free_step(
- buf_block_get_frame(block) + 1000, &mtr);
-
- mtr_commit(&mtr);
- }
-
- /***********************************************/
- os_thread_sleep(1000000);
- buf_validate();
- buf_print();
- mtr_start(&mtr);
-
- seg_page = fseg_create(0, 0, 1000, 557, &mtr);
-
- mtr_commit(&mtr);
-
- ut_a(seg_page == 1);
-
- printf("Segment created: header page %lu\n", seg_page);
-
- new_page = seg_page;
- for (i = 0; i < 1023; i++) {
-
- mtr_start(&mtr);
-
- block = mtr_page_get(0, seg_page, NULL, &mtr);
-
- new_page = fseg_alloc_free_page(
- buf_block_get_frame(block) + 1000,
- new_page + 1, FSP_UP, &mtr);
- if (i < FSP_EXTENT_SIZE - 1) {
- ut_a(new_page == 2 + i);
- } else {
- ut_a(new_page == i + FSP_EXTENT_SIZE + 1);
- }
-
- printf("%lu %lu; ", i, new_page);
- if (i % 10 == 0) {
- printf("\n");
- }
-
- mtr_commit(&mtr);
- }
-
- buf_print();
- buf_validate();
-
- mtr_start(&mtr);
-
- block = mtr_page_get(0, seg_page, NULL, &mtr);
-
- mtr_page_s_lock(block, &mtr);
-
- reserved = fseg_n_reserved_pages(buf_block_get_frame(block) + 1000,
- &used, &mtr);
-
- ut_a(used == 1024);
- ut_a(reserved >= 1024);
-
- printf("Pages used in segment %lu reserved by segment %lu \n",
- used, reserved);
-
- mtr_commit(&mtr);
-
- finished = FALSE;
-
- while (!finished) {
-
- mtr_start(&mtr);
-
- block = mtr_page_get(0, seg_page, NULL, &mtr);
-
- finished = fseg_free_step(
- buf_block_get_frame(block) + 1000, &mtr);
-
- mtr_commit(&mtr);
- }
-
- buf_print();
- buf_validate();
-
- /***********************************************/
-
- mtr_start(&mtr);
-
- seg_page = fseg_create(0, 0, 1000, 557, &mtr);
-
- mtr_commit(&mtr);
-
- ut_a(seg_page == 1);
-
- mtr_start(&mtr);
-
- seg_page2 = fseg_create(0, 0, 1000, 558, &mtr);
-
- mtr_commit(&mtr);
-
- ut_a(seg_page2 == 2);
-
- new_page = seg_page;
- new_page2 = seg_page2;
-
- for (;;) {
-
- mtr_start(&mtr);
-
- block = mtr_page_get(0, seg_page, NULL, &mtr);
-
- new_page = fseg_alloc_free_page(
- buf_block_get_frame(block) + 1000,
- new_page + 1, FSP_UP, &mtr);
-
- printf("1:%lu %lu; ", i, new_page);
- if (i % 10 == 0) {
- printf("\n");
- }
-
- new_page = fseg_alloc_free_page(
- buf_block_get_frame(block) + 1000,
- new_page + 1, FSP_UP, &mtr);
-
- printf("1:%lu %lu; ", i, new_page);
- if (i % 10 == 0) {
- printf("\n");
- }
-
- mtr_commit(&mtr);
-
- mtr_start(&mtr);
-
- block = mtr_page_get(0, seg_page2, NULL, &mtr);
-
- new_page2 = fseg_alloc_free_page(
- buf_block_get_frame(block) + 1000,
- new_page2 + 1, FSP_UP, &mtr);
-
- printf("2:%lu %lu; ", i, new_page2);
- if (i % 10 == 0) {
- printf("\n");
- }
-
- mtr_commit(&mtr);
-
- if (new_page2 == FIL_NULL) {
- break;
- }
- }
-
- mtr_start(&mtr);
-
- block = mtr_page_get(0, seg_page, NULL, &mtr);
-
- mtr_page_s_lock(block, &mtr);
-
- reserved = fseg_n_reserved_pages(buf_block_get_frame(block) + 1000,
- &used, &mtr);
-
- printf("Pages used in segment 1 %lu, reserved by segment %lu \n",
- used, reserved);
-
- mtr_commit(&mtr);
-
- mtr_start(&mtr);
-
- block = mtr_page_get(0, seg_page2, NULL, &mtr);
-
- mtr_page_s_lock(block, &mtr);
-
- reserved = fseg_n_reserved_pages(buf_block_get_frame(block) + 1000,
- &used, &mtr);
-
- printf("Pages used in segment 2 %lu, reserved by segment %lu \n",
- used, reserved);
-
- mtr_commit(&mtr);
-
- for (;;) {
-
- mtr_start(&mtr);
-
- block = mtr_page_get(0, seg_page, NULL, &mtr);
-
- fseg_free_step(
- buf_block_get_frame(block) + 1000, &mtr);
-
- block = mtr_page_get(0, seg_page2, NULL, &mtr);
-
- finished = fseg_free_step(
- buf_block_get_frame(block) + 1000, &mtr);
-
- mtr_commit(&mtr);
-
- if (finished) {
- break;
- }
- }
-
- mtr_start(&mtr);
-
- seg_page2 = fseg_create(0, 0, 1000, 558, &mtr);
-
- mtr_commit(&mtr);
-
- i = 0;
- for (;;) {
- mtr_start(&mtr);
-
- block = mtr_page_get(0, seg_page2, NULL, &mtr);
-
- new_page2 = fseg_alloc_free_page(
- buf_block_get_frame(block) + 1000,
- 557, FSP_DOWN, &mtr);
-
- printf("%lu %lu; ", i, new_page2);
- mtr_commit(&mtr);
-
- if (new_page2 == FIL_NULL) {
- break;
- }
- i++;
- }
-
- for (;;) {
-
- mtr_start(&mtr);
-
- block = mtr_page_get(0, seg_page, NULL, &mtr);
-
- finished = fseg_free_step(
- buf_block_get_frame(block) + 1000, &mtr);
-
- mtr_commit(&mtr);
-
- if (finished) {
- break;
- }
- }
-
- for (;;) {
-
- mtr_start(&mtr);
-
- block = mtr_page_get(0, seg_page2, NULL, &mtr);
-
- finished = fseg_free_step(
- buf_block_get_frame(block) + 1000, &mtr);
-
- mtr_commit(&mtr);
-
- if (finished) {
- break;
- }
- }
-
-
- /***************************************/
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1000; i++) {
- mtr_start(&mtr);
-
- seg_page = fseg_create(0, 0, 1000, 555, &mtr);
-
- mtr_commit(&mtr);
-
- mtr_start(&mtr);
-
- block = mtr_page_get(0, seg_page, NULL, &mtr);
-
- new_page = fseg_alloc_free_page(buf_block_get_frame(block) + 1000,
- 2, FSP_UP, &mtr);
-
- mtr_commit(&mtr);
-
- finished = FALSE;
-
- while (!finished) {
-
- mtr_start(&mtr);
-
- block = mtr_page_get(0, seg_page, NULL, &mtr);
-
- finished = fseg_free_step(
- buf_block_get_frame(block) + 1000, &mtr);
-
- mtr_commit(&mtr);
- }
- }
-
- tm = ut_clock();
- printf("Wall clock time for %lu seg crea+free %lu millisecs\n",
- i, tm - oldtm);
-
- buf_validate();
-
- buf_flush_batch(BUF_FLUSH_LIST, 500);
-
- os_thread_sleep(1000000);
-
- buf_all_freed();
-}
-
-
-/************************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
- ulint n;
-
- oldtm = ut_clock();
-
- os_aio_init(160, 5);
- sync_init();
- mem_init();
- fil_init(26); /* Allow 25 open files at a time */
- buf_pool_init(1000, 1000);
- log_init();
-
- buf_validate();
-
- ut_a(fil_validate());
-
- create_files();
-
- create_db();
-
- buf_validate();
-
- test5();
-/*
- test1();
-
- test3();
-
- test4();
-
- test2();
-*/
- buf_validate();
-
- n = buf_flush_batch(BUF_FLUSH_LIST, 500);
-
- os_thread_sleep(1000000);
-
- buf_all_freed();
-
- free_system();
-
- tm = ut_clock();
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/fsp/ts/makefile b/innobase/fsp/ts/makefile
deleted file mode 100644
index cd56e791b31..00000000000
--- a/innobase/fsp/ts/makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-include ..\..\makefile.i
-
-tsfsp: ..\fsp.lib tsfsp.c
- $(CCOM) $(CFL) -I.. -I..\.. ..\..\btr.lib ..\..\trx.lib ..\..\pars.lib ..\..\que.lib ..\..\lock.lib ..\..\row.lib ..\..\read.lib ..\..\srv.lib ..\..\com.lib ..\..\usr.lib ..\..\thr.lib ..\..\fut.lib ..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\buf.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tsfsp.c $(LFL)
-
-
-
-
-
-
-
-
-
diff --git a/innobase/fsp/ts/tsfsp.c b/innobase/fsp/ts/tsfsp.c
deleted file mode 100644
index ba6a35ebc69..00000000000
--- a/innobase/fsp/ts/tsfsp.c
+++ /dev/null
@@ -1,1234 +0,0 @@
-/************************************************************************
-The test module for file space management
-
-(c) 1996 Innobase Oy
-
-Created 1/4/1996 Heikki Tuuri
-*************************************************************************/
-
-#include "string.h"
-
-#include "os0thread.h"
-#include "os0file.h"
-#include "ut0ut.h"
-#include "ut0byte.h"
-#include "sync0sync.h"
-#include "mem0mem.h"
-#include "fil0fil.h"
-#include "mach0data.h"
-#include "buf0buf.h"
-#include "buf0flu.h"
-#include "log0log.h"
-#include "fut0lst.h"
-#include "fut0fut.h"
-#include "mtr0mtr.h"
-#include "mtr0log.h"
-#include "..\fsp0fsp.h"
-
-os_file_t files[1000];
-
-mutex_t ios_mutex;
-ulint ios;
-ulint n[10];
-
-mutex_t incs_mutex;
-ulint incs;
-ulint page_nos[10000];
-
-#define N_SPACES 1
-#define N_FILES 2
-#define FILE_SIZE 1000 /* must be > 512 */
-#define POOL_SIZE 1000
-#define COUNTER_OFFSET 1500
-
-#define LOOP_SIZE 150
-#define N_THREADS 5
-
-
-ulint zero = 0;
-
-buf_block_t* bl_arr[POOL_SIZE];
-
-/************************************************************************
-Io-handler thread function. */
-
-ulint
-handler_thread(
-/*===========*/
- void* arg)
-{
- ulint segment;
- void* mess;
- ulint i;
- bool ret;
-
- segment = *((ulint*)arg);
-
- printf("Io handler thread %lu starts\n", segment);
-
- for (i = 0;; i++) {
- ret = fil_aio_wait(segment, &mess);
- ut_a(ret);
-
- buf_page_io_complete((buf_block_t*)mess);
-
- mutex_enter(&ios_mutex);
- ios++;
- mutex_exit(&ios_mutex);
-
- }
-
- return(0);
-}
-
-/*************************************************************************
-Creates the files for the file system test and inserts them to
-the file system. */
-
-void
-create_files(void)
-/*==============*/
-{
- bool ret;
- ulint i, k;
- char name[20];
- os_thread_t thr[5];
- os_thread_id_t id[5];
-
- printf("--------------------------------------------------------\n");
- printf("Create or open database files\n");
-
- strcpy(name, "tsfile00");
-
- for (k = 0; k < N_SPACES; k++) {
- for (i = 0; i < N_FILES; i++) {
-
- name[6] = (char)((ulint)'0' + k);
- name[7] = (char)((ulint)'0' + i);
-
- files[i] = os_file_create(name, OS_FILE_CREATE,
- OS_FILE_TABLESPACE, &ret);
-
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(
- name, OS_FILE_OPEN,
- OS_FILE_TABLESPACE, &ret);
-
- ut_a(ret);
- }
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create(name, k, OS_FILE_TABLESPACE);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, FILE_SIZE, k);
- }
- }
-
- ios = 0;
-
- mutex_create(&ios_mutex);
-
- for (i = 0; i < 5; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(handler_thread, n + i, id + i);
- }
-}
-
-/************************************************************************
-Creates the test database files. */
-
-void
-create_db(void)
-/*===========*/
-{
- ulint i;
- buf_block_t* block;
- byte* frame;
- ulint j;
- ulint tm, oldtm;
- mtr_t mtr;
-
- printf("--------------------------------------------------------\n");
- printf("Write database pages\n");
-
- oldtm = ut_clock();
-
- for (i = 0; i < N_SPACES; i++) {
- for (j = 0; j < FILE_SIZE * N_FILES; j++) {
- mtr_start(&mtr);
-
- block = buf_page_create(i, j, &mtr);
-
- frame = buf_block_get_frame(block);
-
- buf_page_x_lock(block, &mtr);
-
- if (j > FILE_SIZE * N_FILES
- - 64 * 2 - 1) {
- mlog_write_ulint(frame + FIL_PAGE_PREV, j - 5,
- MLOG_4BYTES, &mtr);
- mlog_write_ulint(frame + FIL_PAGE_NEXT, j - 7,
- MLOG_4BYTES, &mtr);
- } else {
- mlog_write_ulint(frame + FIL_PAGE_PREV, j - 1,
- MLOG_4BYTES, &mtr);
- mlog_write_ulint(frame + FIL_PAGE_NEXT, j + 1,
- MLOG_4BYTES, &mtr);
- }
-
- mlog_write_ulint(frame + FIL_PAGE_OFFSET, j,
- MLOG_4BYTES, &mtr);
- mlog_write_ulint(frame + FIL_PAGE_SPACE, i,
- MLOG_4BYTES, &mtr);
- mlog_write_ulint(frame + COUNTER_OFFSET, 0,
- MLOG_4BYTES, &mtr);
-
- mtr_commit(&mtr);
- }
- }
-
- tm = ut_clock();
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
-}
-
-/************************************************************************
-Reads the test database files. */
-
-void
-test1(void)
-/*=======*/
-{
- ulint i, j, k;
- buf_block_t* block;
- byte* frame;
- ulint tm, oldtm;
- mtr_t mtr;
-
- printf("--------------------------------------------------------\n");
- printf("TEST 1. Read linearly database files\n");
-
- oldtm = ut_clock();
-
- for (k = 0; k < 1; k++) {
- for (i = 0; i < N_SPACES; i++) {
- for (j = 0; j < N_FILES * FILE_SIZE; j++) {
- mtr_start(&mtr);
-
- block = buf_page_get(i, j, &mtr);
-
- frame = buf_block_get_frame(block);
-
- buf_page_s_lock(block, &mtr);
-
- ut_a(mtr_read_ulint(frame + FIL_PAGE_OFFSET,
- MLOG_4BYTES, &mtr)
- == j);
- ut_a(mtr_read_ulint(frame + FIL_PAGE_SPACE,
- MLOG_4BYTES, &mtr)
- == i);
-
- mtr_commit(&mtr);
- }
- }
- }
-
- tm = ut_clock();
- printf("Wall clock time for %lu pages %lu milliseconds\n",
- k * i * j, tm - oldtm);
- buf_validate();
-}
-
-/************************************************************************
-Test for file-based lists. */
-
-void
-test2(void)
-/*=======*/
-{
- mtr_t mtr;
- buf_frame_t* frame;
- buf_block_t* block;
- ulint i;
- flst_base_node_t* base1;
- fil_addr_t base_addr1;
- flst_base_node_t* base2;
- fil_addr_t base_addr2;
- flst_node_t* node;
- fil_addr_t node_addr;
- flst_node_t* node2;
- fil_addr_t node_addr2;
- flst_node_t* node3;
- fil_addr_t node_addr3;
-
-#define BPAGE 10
-#define BASE1 300
-#define BASE2 500
-#define NODE1 800
-#define NODE2 900
-#define NODE3 1000
-#define NODE4 1100
-#define INDEX 30
-
- buf_validate();
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, BPAGE, &mtr);
- frame = buf_block_get_frame(block);
-
- flst_init(frame + BASE1, &mtr);
- flst_init(frame + BASE2, &mtr);
-
- mtr_commit(&mtr);
-
- printf("-------------------------------------------\n");
- printf("TEST 2. Test of file-based two-way lists \n");
-
- base_addr1.page = BPAGE;
- base_addr1.boffset = BASE1;
-
- base_addr2.page = BPAGE;
- base_addr2.boffset = BASE2;
-
- printf(
- "Add 1000 elements in list1 in reversed order and in list2 in order\n");
- for (i = 0; i < 1000; i++) {
- mtr_start(&mtr);
-
- base1 = fut_get_ptr(0, base_addr1, &mtr);
- base2 = fut_get_ptr(0, base_addr2, &mtr);
-
- block = buf_page_get(0, i, &mtr);
- frame = buf_block_get_frame(block);
-
- buf_page_x_lock(block, &mtr);
-
- flst_add_first(base1, frame + NODE1, &mtr);
- mlog_write_ulint(frame + NODE1 + INDEX, i,
- MLOG_4BYTES, &mtr);
- flst_add_last(base2, frame + NODE2, &mtr);
- mlog_write_ulint(frame + NODE2 + INDEX, i,
- MLOG_4BYTES, &mtr);
-
- mtr_commit(&mtr);
- }
-
- mtr_start(&mtr);
-
- base1 = fut_get_ptr(0, base_addr1, &mtr);
- base2 = fut_get_ptr(0, base_addr2, &mtr);
-
- flst_validate(base1, &mtr);
- flst_validate(base2, &mtr);
-
- flst_print(base1, &mtr);
- flst_print(base2, &mtr);
-
- mtr_commit(&mtr);
-
- mtr_start(&mtr);
-
- base1 = fut_get_ptr_s_lock(0, base_addr1, &mtr);
-
- node_addr = flst_get_first(base1, &mtr);
-
- mtr_commit(&mtr);
-
- printf("Check order of elements in list1\n");
- for (i = 0; i < 1000; i++) {
- mtr_start(&mtr);
- ut_a(!fil_addr_is_null(node_addr));
-
- node = fut_get_ptr_x_lock(0, node_addr, &mtr);
-
- ut_a(mtr_read_ulint(node + INDEX, MLOG_4BYTES, &mtr) ==
- 999 - i);
-
- node_addr = flst_get_next_addr(node, &mtr);
- mtr_commit(&mtr);
- }
-
- ut_a(fil_addr_is_null(node_addr));
-
- mtr_start(&mtr);
-
- base2 = fut_get_ptr_s_lock(0, base_addr2, &mtr);
-
- node_addr = flst_get_first(base2, &mtr);
-
- mtr_commit(&mtr);
-
- printf("Check order of elements in list2\n");
- for (i = 0; i < 1000; i++) {
- mtr_start(&mtr);
- ut_a(!fil_addr_is_null(node_addr));
-
- node = fut_get_ptr_x_lock(0, node_addr, &mtr);
-
- ut_a(mtr_read_ulint(node + INDEX, MLOG_4BYTES, &mtr)
- == i);
-
- node_addr = flst_get_next_addr(node, &mtr);
- mtr_commit(&mtr);
- }
-
- ut_a(fil_addr_is_null(node_addr));
-
- mtr_start(&mtr);
-
- base1 = fut_get_ptr(0, base_addr1, &mtr);
- base2 = fut_get_ptr(0, base_addr2, &mtr);
-
- flst_validate(base1, &mtr);
- flst_validate(base2, &mtr);
-
- mtr_commit(&mtr);
-
- mtr_start(&mtr);
-
- base1 = fut_get_ptr_s_lock(0, base_addr1, &mtr);
-
- node_addr = flst_get_first(base1, &mtr);
-
- mtr_commit(&mtr);
-
- for (i = 0; i < 500; i++) {
- mtr_start(&mtr);
- ut_a(!fil_addr_is_null(node_addr));
-
- node = fut_get_ptr_x_lock(0, node_addr, &mtr);
-
- node_addr = flst_get_next_addr(node, &mtr);
- mtr_commit(&mtr);
- }
-
- printf("Add 200 elements to the middle of list1\n");
- for (i = 0; i < 100; i++) {
- mtr_start(&mtr);
-
- node = fut_get_ptr_x_lock(0, node_addr, &mtr);
-
- node_addr2.page = i;
- node_addr2.boffset = NODE3;
- node2 = fut_get_ptr_x_lock(0, node_addr2, &mtr);
-
- node_addr3.page = i;
- node_addr3.boffset = NODE4;
- node3 = fut_get_ptr_x_lock(0, node_addr3, &mtr);
-
- mlog_write_ulint(node2 + INDEX, 99 - i, MLOG_4BYTES, &mtr);
-
- block = buf_page_get(0, BPAGE, &mtr);
- frame = buf_block_get_frame(block);
-
- base1 = frame + BASE1;
-
- flst_insert_after(base1, node, node2, &mtr);
- flst_insert_before(base1, node3, node, &mtr);
-
- if (i % 17 == 0) {
- flst_validate(base1, &mtr);
- }
- mtr_commit(&mtr);
- }
-
- printf("Check that 100 of the inserted nodes are in order\n");
- mtr_start(&mtr);
- ut_a(!fil_addr_is_null(node_addr));
-
- node = fut_get_ptr_x_lock(0, node_addr, &mtr);
-
- node_addr = flst_get_next_addr(node, &mtr);
- mtr_commit(&mtr);
-
- for (i = 0; i < 100; i++) {
- mtr_start(&mtr);
- ut_a(!fil_addr_is_null(node_addr));
-
- node = fut_get_ptr_x_lock(0, node_addr, &mtr);
-
- ut_a(mtr_read_ulint(node + INDEX, MLOG_4BYTES, &mtr)
- == i);
-
- node_addr = flst_get_next_addr(node, &mtr);
- mtr_commit(&mtr);
- }
-
- printf("Remove 899 elements from the middle of list1\n");
- mtr_start(&mtr);
-
- base1 = fut_get_ptr_x_lock(0, base_addr1, &mtr);
-
- node_addr = flst_get_first(base1, &mtr);
-
- flst_print(base1, &mtr);
- mtr_commit(&mtr);
-
- for (i = 0; i < 300; i++) {
- mtr_start(&mtr);
- ut_a(!fil_addr_is_null(node_addr));
-
- node = fut_get_ptr_x_lock(0, node_addr, &mtr);
-
- node_addr = flst_get_next_addr(node, &mtr);
- mtr_commit(&mtr);
- }
-
- for (i = 0; i < 899; i++) {
-
- mtr_start(&mtr);
-
- base1 = fut_get_ptr_x_lock(0, base_addr1, &mtr);
-
- node_addr = flst_get_first(base1, &mtr);
-
- node = fut_get_ptr_x_lock(0, node_addr, &mtr);
-
- node_addr = flst_get_next_addr(node, &mtr);
-
- ut_a(!fil_addr_is_null(node_addr));
-
- node2 = fut_get_ptr_x_lock(0, node_addr, &mtr);
-
- flst_remove(base1, node2, &mtr);
-
- if (i % 17 == 0) {
- flst_validate(base1, &mtr);
- }
-
- mtr_commit(&mtr);
- }
-
- printf("Remove 301 elements from the start of list1\n");
- for (i = 0; i < 301; i++) {
-
- mtr_start(&mtr);
-
- base1 = fut_get_ptr_x_lock(0, base_addr1, &mtr);
-
- node_addr = flst_get_first(base1, &mtr);
-
- node = fut_get_ptr_x_lock(0, node_addr, &mtr);
-
- flst_remove(base1, node, &mtr);
-
- if (i % 17 == 0) {
- flst_validate(base1, &mtr);
- }
-
- mtr_commit(&mtr);
- }
-
- mtr_start(&mtr);
-
- base1 = fut_get_ptr_x_lock(0, base_addr1, &mtr);
-
- ut_a(flst_get_len(base1, &mtr) == 0);
- flst_print(base1, &mtr);
-
- mtr_commit(&mtr);
-}
-
-/************************************************************************
-Inits space header of space 0. */
-
-void
-init_space(void)
-/*============*/
-{
- mtr_t mtr;
-
- printf("Init space header\n");
-
- mtr_start(&mtr);
-
- fsp_header_init(0, FILE_SIZE * N_FILES, &mtr);
-
- mtr_commit(&mtr);
-}
-
-/************************************************************************
-Test for file space management. */
-
-void
-test5(void)
-/*=======*/
-{
- mtr_t mtr;
- ulint seg_page;
- ulint new_page;
- ulint seg_page2;
- ulint new_page2;
- ulint seg_page3;
- buf_block_t* block;
- bool finished;
- ulint i;
- ulint reserved;
- ulint used;
- ulint tm, oldtm;
-
- buf_validate();
-
- fsp_validate(0);
- fsp_print(0);
-
- mtr_start(&mtr);
-
- seg_page = fseg_create(0, 0, 1000, &mtr);
-
- mtr_commit(&mtr);
-
- fsp_validate(0);
-
- buf_validate();
- printf("Segment created: header page %lu, byte offset %lu\n",
- seg_page, 1000);
- fsp_print(0);
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, seg_page, &mtr);
-
- new_page = fseg_alloc_free_page(buf_block_get_frame(block) + 1000,
- 2, FSP_UP, &mtr);
-
- mtr_commit(&mtr);
-
- fsp_print(0);
- fsp_validate(0);
- buf_validate();
- printf("Segment page allocated %lu\n", new_page);
-
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, seg_page, &mtr);
-
- fseg_free_page(buf_block_get_frame(block) + 1000,
- 0, new_page, &mtr);
-
- mtr_commit(&mtr);
-
- fsp_validate(0);
- printf("Segment page freed %lu\n", new_page);
-
- finished = FALSE;
-
- while (!finished) {
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, seg_page, &mtr);
-
- finished = fseg_free_step(
- buf_block_get_frame(block) + 1000, &mtr);
-
- mtr_commit(&mtr);
- }
- fsp_validate(0);
-
- /***********************************************/
- buf_validate();
- mtr_start(&mtr);
-
- seg_page = fseg_create(0, 0, 1000, &mtr);
-
- mtr_commit(&mtr);
-
- ut_a(seg_page == 2);
-
- printf("Segment created: header page %lu\n", seg_page);
-
- new_page = seg_page;
- for (i = 0; i < 511; i++) {
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, seg_page, &mtr);
-
- new_page = fseg_alloc_free_page(
- buf_block_get_frame(block) + 1000,
- new_page + 1, FSP_UP, &mtr);
- printf("%lu %lu; ", i, new_page);
- if (i % 10 == 0) {
- printf("\n");
- }
-
- mtr_commit(&mtr);
-
- if (i % 117 == 0) {
- fsp_validate(0);
- }
- }
-
- fsp_validate(0);
- buf_validate();
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, seg_page, &mtr);
-
- reserved = fseg_n_reserved_pages(buf_block_get_frame(block) + 1000,
- &used, &mtr);
-
- ut_a(used == 512);
- ut_a(reserved >= 512);
-
- printf("Pages used in segment %lu reserved by segment %lu \n",
- used, reserved);
-
- mtr_commit(&mtr);
-
- finished = FALSE;
-
- while (!finished) {
- i++;
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, seg_page, &mtr);
-
- finished = fseg_free_step(
- buf_block_get_frame(block) + 1000, &mtr);
-
- mtr_commit(&mtr);
-
- if (i % 117 == 0) {
- fsp_validate(0);
- }
- }
-
- fsp_validate(0);
- buf_validate();
-
- /***********************************************/
-
- mtr_start(&mtr);
-
- seg_page = fseg_create(0, 0, 1000, &mtr);
-
- mtr_commit(&mtr);
-
- ut_a(seg_page == 2);
-
- mtr_start(&mtr);
-
- seg_page2 = fseg_create(0, 0, 1000, &mtr);
-
- mtr_commit(&mtr);
-
- ut_a(seg_page2 == 3);
-
- new_page = seg_page;
- new_page2 = seg_page2;
-
- for (;;) {
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, seg_page, &mtr);
-
- new_page = fseg_alloc_free_page(
- buf_block_get_frame(block) + 1000,
- new_page + 1, FSP_UP, &mtr);
-
- printf("1:%lu %lu; ", i, new_page);
- if (i % 10 == 0) {
- printf("\n");
- }
-
- new_page = fseg_alloc_free_page(
- buf_block_get_frame(block) + 1000,
- new_page + 1, FSP_UP, &mtr);
-
- printf("1:%lu %lu; ", i, new_page);
- if (i % 10 == 0) {
- printf("\n");
- }
-
- mtr_commit(&mtr);
-
- i++;
- if (i % 217 == 0) {
- fsp_validate(0);
- }
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, seg_page2, &mtr);
-
- new_page2 = fseg_alloc_free_page(
- buf_block_get_frame(block) + 1000,
- new_page2 + 1, FSP_DOWN, &mtr);
-
- printf("2:%lu %lu; ", i, new_page2);
- if (i % 10 == 0) {
- printf("\n");
- }
-
- mtr_commit(&mtr);
-
- if (new_page2 == FIL_NULL) {
- break;
- }
- }
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, seg_page, &mtr);
-
- reserved = fseg_n_reserved_pages(buf_block_get_frame(block) + 1000,
- &used, &mtr);
-
- printf("Pages used in segment 1 %lu, reserved by segment %lu \n",
- used, reserved);
-
- mtr_commit(&mtr);
- fsp_validate(0);
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, seg_page2, &mtr);
-
- reserved = fseg_n_reserved_pages(buf_block_get_frame(block) + 1000,
- &used, &mtr);
-
- printf("Pages used in segment 2 %lu, reserved by segment %lu \n",
- used, reserved);
-
- mtr_commit(&mtr);
-
- fsp_print(0);
-
- for (;;) {
-
- i++;
- mtr_start(&mtr);
-
- block = buf_page_get(0, seg_page, &mtr);
-
- fseg_free_step(
- buf_block_get_frame(block) + 1000, &mtr);
-
- block = buf_page_get(0, seg_page2, &mtr);
-
- finished = fseg_free_step(
- buf_block_get_frame(block) + 1000, &mtr);
-
- mtr_commit(&mtr);
-
- if (finished) {
- break;
- }
-
- if (i % 117 == 0) {
- fsp_validate(0);
- }
- }
-
- fsp_validate(0);
-
- mtr_start(&mtr);
-
- seg_page3 = fseg_create(0, 0, 1000, &mtr);
- page_nos[0] = seg_page3;
- new_page2 = seg_page3;
-
- mtr_commit(&mtr);
-
- for (i = 1; i < 250; i++) {
- mtr_start(&mtr);
-
- block = buf_page_get(0, seg_page3, &mtr);
-
- new_page2 = fseg_alloc_free_page(
- buf_block_get_frame(block) + 1000,
- new_page2 + 1, FSP_UP, &mtr);
- page_nos[i] = new_page2;
-
- mtr_commit(&mtr);
- }
-
- /*************************************************/
-
- mtr_start(&mtr);
-
- fseg_create(0, seg_page3, 1500, &mtr);
-
- mtr_commit(&mtr);
-
- for (i = 0; i < 250; i++) {
- mtr_start(&mtr);
-
- block = buf_page_get(0, seg_page3, &mtr);
-
- new_page2 = fseg_alloc_free_page(
- buf_block_get_frame(block) + 1500,
- new_page2 + 1, FSP_UP, &mtr);
- page_nos[i] = new_page2;
-
- mtr_commit(&mtr);
- }
-
- printf("---------------------------------------------------------\n");
- printf("TEST 5A13. Test free_step.\n");
-
- fseg_free(0, seg_page3, 1500);
-
- printf("---------------------------------------------------------\n");
- printf("TEST 5A3. Test free_step.\n");
-
- for (;;) {
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, seg_page3, &mtr);
-
- finished = fseg_free_step(
- buf_block_get_frame(block) + 1000, &mtr);
-
- mtr_commit(&mtr);
-
- if (finished) {
- break;
- }
- }
-
- /***************************************************/
-
- mtr_start(&mtr);
-
- seg_page2 = fseg_create(0, 0, 1000, &mtr);
- page_nos[0] = seg_page2;
- new_page2 = seg_page2;
-
- mtr_commit(&mtr);
-
- i = 1;
- for (;;) {
- mtr_start(&mtr);
-
- block = buf_page_get(0, seg_page2, &mtr);
-
- new_page2 = fseg_alloc_free_page(
- buf_block_get_frame(block) + 1000,
- new_page2 + 1, FSP_UP, &mtr);
- page_nos[i] = new_page2;
-/*
- printf("%lu %lu; ", i, new_page2);
-*/
- mtr_commit(&mtr);
-
- if (new_page2 == FIL_NULL) {
- break;
- }
- i++;
- }
-
- printf("---------------------------------------------------------\n");
- printf("TEST 5D. Test free_step.\n");
-
- for (;;) {
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, seg_page, &mtr);
-
- finished = fseg_free_step(
- buf_block_get_frame(block) + 1000, &mtr);
-
- mtr_commit(&mtr);
-
- if (finished) {
- break;
- }
- }
-
- for (;;) {
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, seg_page2, &mtr);
-
- finished = fseg_free_step(
- buf_block_get_frame(block) + 1000, &mtr);
-
- mtr_commit(&mtr);
-
- if (finished) {
- break;
- }
- }
-
-
- /***************************************/
-
- oldtm = ut_clock();
-
- fsp_validate(0);
-
- for (i = 0; i < 10; i++) {
- mtr_start(&mtr);
-
- seg_page = fseg_create(0, 0, 1000, &mtr);
-
- mtr_commit(&mtr);
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, seg_page, &mtr);
-
- new_page = fseg_alloc_free_page(buf_block_get_frame(block) + 1000,
- 3, FSP_UP, &mtr);
-
- mtr_commit(&mtr);
-
- finished = FALSE;
-
- while (!finished) {
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, seg_page, &mtr);
-
- finished = fseg_free_step(
- buf_block_get_frame(block) + 1000, &mtr);
-
- mtr_commit(&mtr);
- }
- }
-
- tm = ut_clock();
- printf("Wall clock time for %lu seg crea+free %lu millisecs\n",
- i, tm - oldtm);
-
- buf_validate();
- fsp_validate(0);
- fsp_print(0);
-
- buf_flush_batch(BUF_FLUSH_LIST, 2000);
- os_thread_sleep(3000000);
-
-/* buf_print(); */
- buf_all_freed();
-}
-
-/************************************************************************
-Random test thread function. */
-
-ulint
-random_thread(
-/*===========*/
- void* arg)
-{
- ulint n;
- ulint i, j, t, p, sp, d, b;
- ulint s;
- ulint arr[FILE_SIZE * N_FILES];
- ulint seg_page;
- fseg_header_t* seg_header;
- fil_addr_t seg_addr;
- byte dir;
- ulint k;
- mtr_t mtr;
- bool finished;
- ulint used;
- ulint reserved;
-
- n = *((ulint*)arg);
- n = os_thread_get_curr_id();
-
- printf("Random test thread %lu starts\n", n);
-
- for (i = 0; i < 30; i++) {
- t = ut_rnd_gen_ulint() % 10;
- s = ut_rnd_gen_ulint() % FILE_SIZE * N_FILES;
- p = 0;
- sp = ut_rnd_gen_ulint() % N_SPACES;
- d = ut_rnd_gen_ulint() % 3;
- b = ut_rnd_gen_ulint() % 3;
-
- if (i % 10 == 0) {
- printf("Thr %lu round %lu starts\n", n, i);
- }
- ut_a(buf_validate());
-
- if (t != 0) {
- do {
- mtr_start(&mtr);
- seg_page = fseg_create(sp, p, 1000, &mtr);
- mtr_commit(&mtr);
- } while (seg_page == FIL_NULL);
-
- seg_addr.page = seg_page;
- seg_addr.boffset = 1000;
-
- k = 0;
- j = 0;
- while (j < s) {
- j++;
- if (d == 0) {
- dir = FSP_DOWN;
- } else if (d == 1) {
- dir = FSP_NO_DIR;
- } else {
- dir = FSP_UP;
- }
- mtr_start(&mtr);
- seg_header = fut_get_ptr(sp, seg_addr, &mtr);
-
- if (b != 0) {
- arr[k] = fseg_alloc_free_page(seg_header,
- p, dir, &mtr);
- k++;
- } else if (k > 0) {
- fseg_free_page(seg_header, sp, arr[k - 1],
- &mtr);
- k--;
- }
-
- mtr_commit(&mtr);
- if ((k > 0) && (arr[k - 1] == FIL_NULL)) {
- k--;
- break;
- }
- if (p > 0) {
- p = arr[k - 1] + dir - 1;
- }
- if (j % 577 == 0) {
- if (k > 0) {
- p = arr[k / 2] + 1;
- } else {
- p = 0;
- }
- d = ut_rnd_gen_ulint() % 3;
- b = ut_rnd_gen_ulint() % 3;
- }
- }
- finished = FALSE;
- mtr_start(&mtr);
-
- seg_header = fut_get_ptr(sp, seg_addr, &mtr);
-
- reserved = fseg_n_reserved_pages(seg_header,
- &used, &mtr);
-
- printf("Pages used in segment %lu reserved by segment %lu \n",
- used, reserved);
-
- mtr_commit(&mtr);
-
- printf("Thread %lu starts releasing seg %lu size %lu\n", n,
- seg_addr.page, k);
- while (!finished) {
- mtr_start(&mtr);
- seg_header = fut_get_ptr(sp, seg_addr, &mtr);
-
- finished = fseg_free_step(seg_header, &mtr);
- mtr_commit(&mtr);
- }
- } else {
- fsp_print(sp);
- printf("Thread %lu validates fsp\n", n);
- fsp_validate(sp);
- buf_validate();
- }
- } /* for i */
- printf("\nRandom test thread %lu exits\n", os_thread_get_curr_id());
- return(0);
-}
-
-/*************************************************************************
-Performs random operations on the buffer with several threads. */
-
-void
-test6(void)
-/*=======*/
-{
- ulint i;
- os_thread_t thr[N_THREADS + 1];
- os_thread_id_t id[N_THREADS + 1];
- ulint n[N_THREADS + 1];
-
- printf("--------------------------------------------------------\n");
- printf("TEST 6. Random multi-thread test on the buffer \n");
-
- incs = 0;
- mutex_create(&incs_mutex);
-
- for (i = 0; i < N_THREADS; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(random_thread, n + i, id + i);
- }
-
- for (i = 0; i < N_THREADS; i++) {
- os_thread_wait(thr[i]);
- }
-}
-
-/************************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
-
- oldtm = ut_clock();
-
- os_aio_init(160, 5);
- sync_init();
- mem_init();
- fil_init(26); /* Allow 25 open files at a time */
- buf_pool_init(POOL_SIZE, POOL_SIZE);
- log_init();
- fsp_init();
-
- buf_validate();
-
- ut_a(fil_validate());
-
- create_files();
-
- create_db();
-
- buf_validate();
-
-/* test1(); */
-/* buf_validate(); */
-/*
- test2();
- buf_validate();
-*/
- init_space();
-
- test5();
- buf_validate();
-
-/* test6(); */
-
- buf_flush_batch(BUF_FLUSH_LIST, POOL_SIZE + 1);
-/* buf_print(); */
- buf_validate();
-
- os_thread_sleep(1000000);
-
-/* buf_print(); */
- buf_all_freed();
-
- tm = ut_clock();
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/ha/ha0ha.c b/innobase/ha/ha0ha.c
index 3f36879e80b..5e807406ce0 100644
--- a/innobase/ha/ha0ha.c
+++ b/innobase/ha/ha0ha.c
@@ -66,33 +66,6 @@ ha_create(
}
/*****************************************************************
-Checks that a hash table node is in the chain. */
-
-ibool
-ha_node_in_chain(
-/*=============*/
- /* out: TRUE if in chain */
- hash_cell_t* cell, /* in: hash table cell */
- ha_node_t* node) /* in: external chain node */
-{
- ha_node_t* node2;
-
- node2 = cell->node;
-
- while (node2 != NULL) {
-
- if (node2 == node) {
-
- return(TRUE);
- }
-
- node2 = node2->next;
- }
-
- return(FALSE);
-}
-
-/*****************************************************************
Inserts an entry into a hash table. If an entry with the same fold number
is found, its node is updated to point to the new data, and no new node
is inserted. */
@@ -116,8 +89,9 @@ ha_insert_for_fold(
ulint hash;
ut_ad(table && data);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold)));
-
+#endif /* UNIV_SYNC_DEBUG */
hash = hash_calc_hash(fold, table);
cell = hash_get_nth_cell(table, hash);
@@ -213,8 +187,9 @@ ha_delete(
{
ha_node_t* node;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold)));
-
+#endif /* UNIV_SYNC_DEBUG */
node = ha_search_with_data(table, fold, data);
ut_a(node);
@@ -264,8 +239,9 @@ ha_remove_all_nodes_to_page(
{
ha_node_t* node;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold)));
-
+#endif /* UNIV_SYNC_DEBUG */
node = ha_chain_get_first(table, fold);
while (node) {
diff --git a/innobase/ha/hash0hash.c b/innobase/ha/hash0hash.c
index facdea66198..372104e54b3 100644
--- a/innobase/ha/hash0hash.c
+++ b/innobase/ha/hash0hash.c
@@ -22,6 +22,7 @@ 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));
}
@@ -34,41 +35,10 @@ 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. */
@@ -98,7 +68,9 @@ 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 */
@@ -119,6 +91,7 @@ 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);
@@ -140,6 +113,7 @@ 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/ha/ts/makefile b/innobase/ha/ts/makefile
deleted file mode 100644
index aea21f11141..00000000000
--- a/innobase/ha/ts/makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-
-include ..\..\makefile.i
-
-tsha: ..\ha.lib tsha.c makefile
- $(CCOM) $(CFL) -I.. -I..\.. ..\..\btr.lib ..\..\trx.lib ..\..\pars.lib ..\..\que.lib ..\..\lock.lib ..\..\row.lib ..\..\read.lib ..\..\srv.lib ..\..\com.lib ..\..\usr.lib ..\..\thr.lib ..\..\fut.lib ..\..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\buf.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tsha.c $(LFL)
-
-
-
-
-
-
-
diff --git a/innobase/ha/ts/tsha.c b/innobase/ha/ts/tsha.c
deleted file mode 100644
index fd9a2e12f6e..00000000000
--- a/innobase/ha/ts/tsha.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/************************************************************************
-The test module for hash table
-
-(c) 1994, 1995 Innobase Oy
-
-Created 1/25/1994 Heikki Tuuri
-*************************************************************************/
-
-#include "ut0ut.h"
-#include "ha0ha.h"
-#include "mem0mem.h"
-#include "sync0sync.h"
-
-ulint ulint_array[200000];
-
-void
-test1(void)
-{
- hash_table_t* table1;
- ulint i;
- ulint n313 = 313;
- ulint n414 = 414;
-
- printf("------------------------------------------------\n");
- printf("TEST 1. BASIC TEST\n");
-
- table1 = ha_create(50000);
-
- ha_insert_for_fold(table1, 313, &n313);
-
- ha_insert_for_fold(table1, 313, &n414);
-
- ut_a(ha_validate(table1));
-
- ha_delete(table1, 313, &n313);
- ha_delete(table1, 313, &n414);
-
- ut_a(ha_validate(table1));
-
- printf("------------------------------------------------\n");
- printf("TEST 2. TEST OF MASSIVE INSERTS AND DELETES\n");
-
- table1 = ha_create(10000);
-
- for (i = 0; i < 200000; i++) {
- ulint_array[i] = i;
- }
-
- for (i = 0; i < 50000; i++) {
- ha_insert_for_fold(table1, i * 7, ulint_array + i);
- }
-
- ut_a(ha_validate(table1));
-
- for (i = 0; i < 50000; i++) {
- ha_delete(table1, i * 7, ulint_array + i);
- }
-
- ut_a(ha_validate(table1));
-}
-
-void
-test2(void)
-{
- hash_table_t* table1;
- ulint i;
- ulint oldtm, tm;
- ha_node_t* node;
-
- printf("------------------------------------------------\n");
- printf("TEST 3. SPEED TEST\n");
-
- table1 = ha_create(300000);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 200000; i++) {
- ha_insert_for_fold(table1, i * 27877, ulint_array + i);
- }
-
- tm = ut_clock();
-
- printf("Wall clock time for %lu inserts %lu millisecs\n",
- i, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 200000; i++) {
- node = ha_search(table1, i * 27877);
- }
-
- tm = ut_clock();
-
- printf("Wall clock time for %lu searches %lu millisecs\n",
- i, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 200000; i++) {
- ha_delete(table1, i * 27877, ulint_array + i);
- }
-
- tm = ut_clock();
-
- printf("Wall clock time for %lu deletes %lu millisecs\n",
- i, tm - oldtm);
-}
-
-void
-main(void)
-{
- sync_init();
- mem_init(1000000);
-
- test1();
-
- test2();
-
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c
index 805f08af361..42ca34e7f10 100644
--- a/innobase/ibuf/ibuf0ibuf.c
+++ b/innobase/ibuf/ibuf0ibuf.c
@@ -270,7 +270,9 @@ ibuf_header_page_get(
page = buf_page_get(space, FSP_IBUF_HEADER_PAGE_NO, RW_X_LATCH, mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_IBUF_HEADER);
+#endif /* UNIV_SYNC_DEBUG */
return(page);
}
@@ -295,7 +297,9 @@ ibuf_tree_root_get(
page = buf_page_get(space, FSP_IBUF_TREE_ROOT_PAGE_NO, RW_X_LATCH,
mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_TREE_NODE);
+#endif /* UNIV_SYNC_DEBUG */
return(page);
}
@@ -407,7 +411,9 @@ ibuf_data_sizes_update(
{
ulint old_size;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&ibuf_mutex));
+#endif /* UNIV_SYNC_DEBUG */
old_size = data->size;
@@ -489,7 +495,9 @@ ibuf_data_init_for_space(
root = buf_page_get(space, FSP_IBUF_TREE_ROOT_PAGE_NO, RW_X_LATCH,
&mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(root, SYNC_TREE_NODE);
+#endif /* UNIV_SYNC_DEBUG */
data->size = 0;
data->n_inserts = 0;
@@ -721,7 +729,9 @@ ibuf_bitmap_get_map_page(
page = buf_page_get(space, ibuf_bitmap_page_no_calc(page_no),
RW_X_LATCH, mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_IBUF_BITMAP);
+#endif /* UNIV_SYNC_DEBUG */
return(page);
}
@@ -1446,7 +1456,9 @@ ibuf_data_enough_free_for_insert(
/* out: TRUE if enough free pages in list */
ibuf_data_t* data) /* in: ibuf data for the space */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&ibuf_mutex));
+#endif /* UNIV_SYNC_DEBUG */
/* We want a big margin of free pages, because a B-tree can sometimes
grow in size also if records are deleted from it, as the node pointers
@@ -1472,7 +1484,9 @@ ibuf_data_too_much_free(
/* out: TRUE if enough free pages in list */
ibuf_data_t* data) /* in: ibuf data for the space */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&ibuf_mutex));
+#endif /* UNIV_SYNC_DEBUG */
if (data->free_list_len >= 3 + data->size / 2 + 3 * data->height) {
@@ -1532,7 +1546,9 @@ ibuf_add_free_page(
page = buf_page_get(space, page_no, RW_X_LATCH, &mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_TREE_NODE_NEW);
+#endif /* UNIV_SYNC_DEBUG */
ibuf_enter();
@@ -1653,7 +1669,9 @@ ibuf_remove_free_page(
page = buf_page_get(space, page_no, RW_X_LATCH, &mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_TREE_NODE);
+#endif /* UNIV_SYNC_DEBUG */
/* Remove the page from the free list and update the ibuf size data */
@@ -1694,14 +1712,16 @@ ibuf_free_excess_pages(
{
ibuf_data_t* ibuf_data;
ulint i;
-
+
if (space != 0) {
fprintf(stderr,
"InnoDB: Error: calling ibuf_free_excess_pages for space %lu\n", (ulong) space);
return;
}
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(fil_space_get_latch(space), RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(rw_lock_get_x_lock_count(fil_space_get_latch(space)) == 1);
ut_ad(!ibuf_inside());
@@ -2208,7 +2228,9 @@ ibuf_get_volume_buffered(
prev_page = buf_page_get(0, prev_page_no, RW_X_LATCH, mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(prev_page, SYNC_TREE_NODE);
+#endif /* UNIV_SYNC_DEBUG */
rec = page_get_supremum_rec(prev_page);
rec = page_rec_get_prev(rec);
@@ -2269,7 +2291,9 @@ count_later:
next_page = buf_page_get(0, next_page_no, RW_X_LATCH, mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(next_page, SYNC_TREE_NODE);
+#endif /* UNIV_SYNC_DEBUG */
rec = page_get_infimum_rec(next_page);
rec = page_rec_get_next(rec);
@@ -3018,7 +3042,9 @@ loop:
IB__FILE__, __LINE__,
&mtr);
ut_a(success);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_TREE_NODE);
+#endif /* UNIV_SYNC_DEBUG */
}
/* Position pcur in the insert buffer at the first entry for this
@@ -3261,7 +3287,9 @@ ibuf_validate_low(void)
ibuf_data_t* data;
ulint sum_sizes;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&ibuf_mutex));
+#endif /* UNIV_SYNC_DEBUG */
sum_sizes = 0;
diff --git a/innobase/include/Makefile.am b/innobase/include/Makefile.am
index 8664f6dfc17..2584357e24a 100644
--- a/innobase/include/Makefile.am
+++ b/innobase/include/Makefile.am
@@ -18,21 +18,20 @@
noinst_HEADERS = btr0btr.h btr0btr.ic btr0cur.h btr0cur.ic \
btr0pcur.h btr0pcur.ic btr0sea.h btr0sea.ic btr0types.h \
buf0buf.h buf0buf.ic buf0flu.h buf0flu.ic buf0lru.h \
- buf0lru.ic buf0rea.h buf0types.h com0com.h com0com.ic \
- com0shm.h com0shm.ic data0data.h data0data.ic data0type.h \
+ buf0lru.ic buf0rea.h buf0types.h data0data.h data0data.ic data0type.h \
data0type.ic data0types.h db0err.h dict0boot.h \
dict0boot.ic dict0crea.h dict0crea.ic dict0dict.h \
dict0dict.ic dict0load.h dict0load.ic dict0mem.h \
dict0mem.ic dict0types.h dyn0dyn.h dyn0dyn.ic eval0eval.h \
eval0eval.ic eval0proc.h eval0proc.ic fil0fil.h fsp0fsp.h \
fsp0fsp.ic fut0fut.h fut0fut.ic fut0lst.h fut0lst.ic \
- ha0ha.h ha0ha.ic hash0hash.h hash0hash.ic ib_odbc.h \
+ ha0ha.h ha0ha.ic hash0hash.h hash0hash.ic \
ibuf0ibuf.h ibuf0ibuf.ic ibuf0types.h lock0lock.h \
lock0lock.ic lock0types.h log0log.h log0log.ic log0recv.h \
log0recv.ic mach0data.h mach0data.ic makefilewin.i \
mem0dbg.h mem0dbg.ic mem0mem.h mem0mem.ic mem0pool.h \
mem0pool.ic mtr0log.h mtr0log.ic mtr0mtr.h mtr0mtr.ic \
- mtr0types.h odbc0odbc.h os0file.h os0proc.h os0proc.ic \
+ mtr0types.h os0file.h os0proc.h os0proc.ic \
os0shm.h os0shm.ic os0sync.h os0sync.ic os0thread.h \
os0thread.ic page0cur.h page0cur.ic page0page.h \
page0page.ic page0types.h pars0grm.h pars0opt.h \
@@ -50,7 +49,7 @@ noinst_HEADERS = btr0btr.h btr0btr.ic btr0cur.h btr0cur.ic \
thr0loc.h thr0loc.ic trx0purge.h trx0purge.ic trx0rec.h \
trx0rec.ic trx0roll.h trx0roll.ic trx0rseg.h trx0rseg.ic \
trx0sys.h trx0sys.ic trx0trx.h trx0trx.ic trx0types.h \
- trx0undo.h trx0undo.ic univ.i univold.i univoldmysql.i \
+ trx0undo.h trx0undo.ic univ.i \
usr0sess.h usr0sess.ic usr0types.h ut0byte.h ut0byte.ic \
ut0dbg.h ut0lst.h ut0mem.h ut0mem.ic ut0rnd.h ut0rnd.ic \
ut0sort.h ut0ut.h ut0ut.ic
diff --git a/innobase/include/btr0btr.ic b/innobase/include/btr0btr.ic
index 301a73b3444..b0aa0756307 100644
--- a/innobase/include/btr0btr.ic
+++ b/innobase/include/btr0btr.ic
@@ -45,8 +45,7 @@ btr_page_set_index_id(
dulint id, /* in: index id */
mtr_t* mtr) /* in: mtr */
{
- mlog_write_dulint(page + PAGE_HEADER + PAGE_INDEX_ID, id,
- MLOG_8BYTES, mtr);
+ mlog_write_dulint(page + PAGE_HEADER + PAGE_INDEX_ID, id, mtr);
}
/******************************************************************
diff --git a/innobase/include/btr0cur.h b/innobase/include/btr0cur.h
index 31aecef8104..f1334656d53 100644
--- a/innobase/include/btr0cur.h
+++ b/innobase/include/btr0cur.h
@@ -365,17 +365,6 @@ btr_cur_parse_update_in_place(
byte* ptr, /* in: buffer */
byte* end_ptr,/* in: buffer end */
page_t* page); /* in: page or NULL */
-/***************************************************************
-Parses a redo log record of updating a record, but not in-place. */
-
-byte*
-btr_cur_parse_opt_update(
-/*=====================*/
- /* out: end of log record or NULL */
- byte* ptr, /* in: buffer */
- byte* end_ptr,/* in: buffer end */
- page_t* page, /* in: page or NULL */
- mtr_t* mtr); /* in: mtr or NULL */
/********************************************************************
Parses the redo log record for delete marking or unmarking of a clustered
index record. */
@@ -446,16 +435,6 @@ btr_cur_mark_dtuple_inherited_extern(
ulint n_ext_vec, /* in: number of elements in ext_vec */
upd_t* update); /* in: update vector */
/***********************************************************************
-Marks all extern fields in a record as owned by the record. This function
-should be called if the delete mark of a record is removed: a not delete
-marked record always owns all its extern fields. */
-
-void
-btr_cur_unmark_extern_fields(
-/*=========================*/
- rec_t* rec, /* in: record in a clustered index */
- mtr_t* mtr); /* in: mtr */
-/***********************************************************************
Marks all extern fields in a dtuple as owned by the record. */
void
diff --git a/innobase/include/btr0sea.h b/innobase/include/btr0sea.h
index ee762a12221..ce4140ecf92 100644
--- a/innobase/include/btr0sea.h
+++ b/innobase/include/btr0sea.h
@@ -49,21 +49,6 @@ btr_search_info_update(
dict_index_t* index, /* in: index of the cursor */
btr_cur_t* cursor);/* in: cursor which was just positioned */
/**********************************************************************
-Tries to guess the right search position based on the search pattern info
-of the index. */
-
-ibool
-btr_search_guess_on_pattern(
-/*========================*/
- /* out: TRUE if succeeded */
- dict_index_t* index, /* in: index */
- btr_search_t* info, /* in: index search info */
- dtuple_t* tuple, /* in: logical record */
- ulint mode, /* in: PAGE_CUR_L, ... */
- ulint latch_mode, /* in: BTR_SEARCH_LEAF, ... */
- btr_cur_t* cursor, /* out: tree cursor */
- mtr_t* mtr); /* in: mtr */
-/**********************************************************************
Tries to guess the right search position based on the hash search info
of the index. Note that if mode is PAGE_CUR_LE, which is used in inserts,
and the function returns TRUE, then cursor->up_match and cursor->low_match
@@ -140,26 +125,6 @@ btr_search_update_hash_on_delete(
record to delete using btr_cur_search_...,
the record is not yet deleted */
/************************************************************************
-Prints info of the search system. */
-
-void
-btr_search_print_info(void);
-/*=======================*/
-/************************************************************************
-Prints info of searches on an index. */
-
-void
-btr_search_index_print_info(
-/*========================*/
- dict_index_t* index); /* in: index */
-/************************************************************************
-Prints info of searches on a table. */
-
-void
-btr_search_table_print_info(
-/*========================*/
- char* name); /* in: table name */
-/************************************************************************
Validates the search system. */
ibool
@@ -249,7 +214,9 @@ extern rw_lock_t* btr_search_latch_temp;
#define btr_search_latch (*btr_search_latch_temp)
+#ifdef UNIV_SEARCH_PERF_STAT
extern ulint btr_search_n_succ;
+#endif /* UNIV_SEARCH_PERF_STAT */
extern ulint btr_search_n_hash_fail;
/* After change in n_fields or n_bytes in info, this many rounds are waited
diff --git a/innobase/include/btr0sea.ic b/innobase/include/btr0sea.ic
index 63a3a658cf4..8a41042f713 100644
--- a/innobase/include/btr0sea.ic
+++ b/innobase/include/btr0sea.ic
@@ -44,8 +44,10 @@ btr_search_info_update(
{
btr_search_t* info;
- ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_SHARED)
- && !rw_lock_own(&btr_search_latch, RW_LOCK_EX));
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_SHARED));
+ ut_ad(!rw_lock_own(&btr_search_latch, RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
info = btr_search_get_info(index);
diff --git a/innobase/include/buf0buf.h b/innobase/include/buf0buf.h
index 3f2fd5bbbe0..3cab717546a 100644
--- a/innobase/include/buf0buf.h
+++ b/innobase/include/buf0buf.h
@@ -562,11 +562,11 @@ buf_awe_map_page_to_frame(
we need to map the page should also
add the block to the
awe_LRU_free_mapped list */
+#ifdef UNIV_SYNC_DEBUG
/*************************************************************************
Adds latch level info for the rw-lock protecting the buffer frame. This
should be called in the debug version after a successful latching of a
-page if we know the latching order level of the acquired latch. If
-UNIV_SYNC_DEBUG is not defined, compiles to an empty function. */
+page if we know the latching order level of the acquired latch. */
UNIV_INLINE
void
buf_page_dbg_add_level(
@@ -574,6 +574,7 @@ buf_page_dbg_add_level(
buf_frame_t* frame, /* in: buffer page where we have acquired
a latch */
ulint level); /* in: latching order level */
+#endif /* UNIV_SYNC_DEBUG */
/*************************************************************************
Gets a pointer to the memory frame of a block. */
UNIV_INLINE
diff --git a/innobase/include/buf0buf.ic b/innobase/include/buf0buf.ic
index eb22bae7ff0..cb54785128f 100644
--- a/innobase/include/buf0buf.ic
+++ b/innobase/include/buf0buf.ic
@@ -130,7 +130,9 @@ buf_pool_clock_tic(void)
/*====================*/
/* out: new clock value */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
buf_pool->ulint_clock++;
@@ -221,7 +223,7 @@ buf_block_align(
"InnoDB: how to force recovery.\n",
(long)ptr, (long)frame_zero,
(long)(buf_pool->high_end));
- ut_a(0);
+ ut_error;
}
block = *(buf_pool->blocks_of_frames + (((ulint)(ptr - frame_zero))
@@ -257,7 +259,7 @@ buf_frame_align(
"InnoDB: how to force recovery.\n",
(long)ptr, (long)(buf_pool->frame_zero),
(long)(buf_pool->high_end));
- ut_a(0);
+ ut_error;
}
return(frame);
@@ -447,8 +449,10 @@ buf_frame_modify_clock_inc(
block = buf_block_align(frame);
+#ifdef UNIV_SYNC_DEBUG
ut_ad((mutex_own(&(buf_pool->mutex)) && (block->buf_fix_count == 0))
|| rw_lock_own(&(block->lock), RW_LOCK_EXCLUSIVE));
+#endif /*UNIV_SYNC_DEBUG */
UT_DULINT_INC(block->modify_clock);
@@ -466,8 +470,10 @@ buf_block_modify_clock_inc(
/* out: new value */
buf_block_t* block) /* in: block */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad((mutex_own(&(buf_pool->mutex)) && (block->buf_fix_count == 0))
|| rw_lock_own(&(block->lock), RW_LOCK_EXCLUSIVE));
+#endif /* UNIV_SYNC_DEBUG */
UT_DULINT_INC(block->modify_clock);
@@ -490,12 +496,15 @@ buf_frame_get_modify_clock(
block = buf_block_align(frame);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&(block->lock), RW_LOCK_SHARED)
|| rw_lock_own(&(block->lock), RW_LOCK_EXCLUSIVE));
+#endif /* UNIV_SYNC_DEBUG */
return(block->modify_clock);
}
+#ifdef UNIV_SYNC_DEBUG
/***********************************************************************
Increments the bufferfix count. */
UNIV_INLINE
@@ -515,7 +524,7 @@ buf_block_buf_fix_inc_debug(
#endif
block->buf_fix_count++;
}
-
+#else /* UNIV_SYNC_DEBUG */
/***********************************************************************
Increments the bufferfix count. */
UNIV_INLINE
@@ -526,7 +535,7 @@ buf_block_buf_fix_inc(
{
block->buf_fix_count++;
}
-
+#endif /* UNIV_SYNC_DEBUG */
/**********************************************************************
Returns the control block of a file page, NULL if not found. */
UNIV_INLINE
@@ -541,7 +550,9 @@ buf_page_hash_get(
ulint fold;
ut_ad(buf_pool);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
/* Look for the page in the hash table */
@@ -641,6 +652,7 @@ buf_page_release(
}
}
+#ifdef UNIV_SYNC_DEBUG
/*************************************************************************
Adds latch level info for the rw-lock protecting the buffer frame. This
should be called in the debug version after a successful latching of a
@@ -655,7 +667,6 @@ buf_page_dbg_add_level(
ulint level __attribute__((unused))) /* in: latching order
level */
{
-#ifdef UNIV_SYNC_DEBUG
sync_thread_add_level(&(buf_block_align(frame)->lock), level);
-#endif
}
+#endif /* UNIV_SYNC_DEBUG */
diff --git a/innobase/include/buf0flu.ic b/innobase/include/buf0flu.ic
index e2faf773cab..d6dbdcc0865 100644
--- a/innobase/include/buf0flu.ic
+++ b/innobase/include/buf0flu.ic
@@ -40,8 +40,10 @@ buf_flush_note_modification(
ut_ad(block);
ut_ad(block->state == BUF_BLOCK_FILE_PAGE);
ut_ad(block->buf_fix_count > 0);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX));
ut_ad(mutex_own(&(buf_pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(ut_dulint_cmp(mtr->start_lsn, ut_dulint_zero) != 0);
ut_ad(mtr->modifications);
@@ -76,7 +78,9 @@ buf_flush_recv_note_modification(
ut_ad(block);
ut_ad(block->state == BUF_BLOCK_FILE_PAGE);
ut_ad(block->buf_fix_count > 0);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&(block->lock), RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
mutex_enter(&(buf_pool->mutex));
diff --git a/innobase/include/com0com.h b/innobase/include/com0com.h
deleted file mode 100644
index 6f04b6a3f11..00000000000
--- a/innobase/include/com0com.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/******************************************************
-The communication primitives
-
-(c) 1995 Innobase Oy
-
-Created 9/23/1995 Heikki Tuuri
-*******************************************************/
-
-/* This module defines a standard datagram communication
-function interface for use in the database. We assume that
-the communication medium is reliable. */
-
-#ifndef com0com_h
-#define com0com_h
-
-#include "univ.i"
-
-/* The communications endpoint type definition */
-typedef struct com_endpoint_struct com_endpoint_t;
-
-/* Possible endpoint communication types */
-#define COM_SHM 1 /* communication through shared memory */
-
-/* Option numbers for endpoint */
-#define COM_OPT_MAX_DGRAM_SIZE 1
-
-/* Error numbers */
-#define COM_ERR_NOT_SPECIFIED 1
-#define COM_ERR_NOT_BOUND 2
-#define COM_ERR_ALREADY_BOUND 3
-#define COM_ERR_MAX_DATAGRAM_SIZE_NOT_SET 4
-#define COM_ERR_DATA_BUFFER_TOO_SMALL 5
-#define COM_ERR_ADDR_BUFFER_TOO_SMALL 6
-#define COM_ERR_DATA_TOO_LONG 7
-#define COM_ERR_ADDR_TOO_LONG 8
-#define COM_ERR_DGRAM_NOT_DELIVERED 9
-
-/* Maximum allowed address length in bytes */
-#define COM_MAX_ADDR_LEN 100
-
-/*************************************************************************
-Creates a communications endpoint. */
-
-com_endpoint_t*
-com_endpoint_create(
-/*================*/
- /* out, own: communications endpoint, NULL if
- did not succeed */
- ulint type); /* in: communication type of endpoint:
- only COM_SHM supported */
-/*************************************************************************
-Frees a communications endpoint. */
-
-ulint
-com_endpoint_free(
-/*==============*/
- /* out: O if succeed, else error number */
- com_endpoint_t* ep); /* in, own: communications endpoint */
-/*************************************************************************
-Sets an option, like the maximum datagram size for an endpoint.
-The options may vary depending on the endpoint type. */
-
-ulint
-com_endpoint_set_option(
-/*====================*/
- /* out: 0 if succeed, else error number */
- com_endpoint_t* ep, /* in: endpoint */
- ulint optno, /* in: option number, only
- COM_OPT_MAX_DGRAM_SIZE currently supported */
- byte* optval, /* in: pointer to a buffer containing the
- option value to set */
- ulint optlen);/* in: option value buffer length */
-/*************************************************************************
-Binds a communications endpoint to a specified address. */
-
-ulint
-com_bind(
-/*=====*/
- /* out: 0 if succeed, else error number */
- com_endpoint_t* ep, /* in: communications endpoint */
- char* name, /* in: address name */
- ulint len); /* in: name length */
-/*************************************************************************
-Waits for a datagram to arrive at an endpoint. */
-
-ulint
-com_recvfrom(
-/*=========*/
- /* out: 0 if succeed, else error number */
- com_endpoint_t* ep, /* in: communications endpoint */
- byte* buf, /* out: datagram buffer; the buffer must be
- supplied by the caller */
- ulint buf_len,/* in: datagram buffer length */
- ulint* len, /* out: datagram length */
- char* from, /* out: address name buffer; the buffer must be
- supplied by the caller */
- ulint from_len,/* in: address name buffer length */
- ulint* addr_len);/* out: address name length */
-/*************************************************************************
-Sends a datagram to a specified destination. */
-
-ulint
-com_sendto(
-/*=======*/
- /* out: 0 if succeed, else error number */
- com_endpoint_t* ep, /* in: communications endpoint */
- byte* buf, /* in: datagram buffer */
- ulint len, /* in: datagram length */
- char* to, /* in: address name buffer */
- ulint tolen); /* in: address name length */
-/*************************************************************************
-Gets the maximum datagram size for an endpoint. */
-
-ulint
-com_endpoint_get_max_size(
-/*======================*/
- /* out: maximum size */
- com_endpoint_t* ep); /* in: endpoint */
-
-
-#ifndef UNIV_NONINL
-#include "com0com.ic"
-#endif
-
-#endif
diff --git a/innobase/include/com0com.ic b/innobase/include/com0com.ic
deleted file mode 100644
index cec1cb190cc..00000000000
--- a/innobase/include/com0com.ic
+++ /dev/null
@@ -1,7 +0,0 @@
-/******************************************************
-The communication primitives
-
-(c) 1995 Innobase Oy
-
-Created 9/23/1995 Heikki Tuuri
-*******************************************************/
diff --git a/innobase/include/com0shm.h b/innobase/include/com0shm.h
deleted file mode 100644
index 7de9c4ac2de..00000000000
--- a/innobase/include/com0shm.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/******************************************************
-The communication through shared memory
-
-(c) 1995 Innobase Oy
-
-Created 9/23/1995 Heikki Tuuri
-*******************************************************/
-
-#ifndef com0shm_h
-#define com0shm_h
-
-#include "univ.i"
-
-typedef struct com_shm_endpoint_struct com_shm_endpoint_t;
-
-/* The performance of communication in NT depends on how
-many times a system call is made (excluding os_thread_yield,
-as that is the fastest way to switch thread).
-The following variable counts such events. */
-
-extern ulint com_shm_system_call_count;
-
-
-/*************************************************************************
-Creates a communications endpoint. */
-
-com_shm_endpoint_t*
-com_shm_endpoint_create(void);
-/*=========================*/
- /* out, own: communications endpoint, NULL if
- did not succeed */
-/*************************************************************************
-Frees a communications endpoint. */
-
-ulint
-com_shm_endpoint_free(
-/*==================*/
- /* out: O if succeed, else error number */
- com_shm_endpoint_t* ep);/* in, own: communications endpoint */
-/*************************************************************************
-Sets an option, like the maximum datagram size for an endpoint.
-The options may vary depending on the endpoint type. */
-
-ulint
-com_shm_endpoint_set_option(
-/*========================*/
- /* out: 0 if succeed, else error number */
- com_shm_endpoint_t* ep, /* in: endpoint */
- ulint optno, /* in: option number, only
- COM_OPT_MAX_DGRAM_SIZE currently supported */
- byte* optval, /* in: pointer to a buffer containing the
- option value to set */
- ulint optlen);/* in: option value buffer length */
-/*************************************************************************
-Bind a communications endpoint to a specified address. */
-
-ulint
-com_shm_bind(
-/*=========*/
- /* out: 0 if succeed, else error number */
- com_shm_endpoint_t* ep, /* in: communications endpoint */
- char* name, /* in: address name */
- ulint len); /* in: address name length */
-/*************************************************************************
-Waits for a datagram to arrive at an endpoint. */
-
-ulint
-com_shm_recvfrom(
-/*=============*/
- /* out: 0 if succeed, else error number */
- com_shm_endpoint_t* ep, /* in: communications endpoint */
- byte* buf, /* out: datagram buffer; the buffer is
- supplied by the caller */
- ulint buf_len,/* in: datagram buffer length */
- ulint* len, /* out: datagram length */
- char* from, /* out: address name buffer; the buffer is
- supplied by the caller */
- ulint from_len,/* in: address name buffer length */
- ulint* addr_len);/* out: address name length */
-/*************************************************************************
-Sends a datagram to the specified destination. */
-
-ulint
-com_shm_sendto(
-/*===========*/
- /* out: 0 if succeed, else error number */
- com_shm_endpoint_t* ep, /* in: communications endpoint */
- byte* buf, /* in: datagram buffer */
- ulint len, /* in: datagram length */
- char* to, /* in: address name buffer */
- ulint tolen); /* in: address name length */
-
-ulint
-com_shm_endpoint_get_size(
-/*======================*/
- com_shm_endpoint_t* ep);
-
-
-#ifndef UNIV_NONINL
-#include "com0shm.ic"
-#endif
-
-#endif
diff --git a/innobase/include/com0shm.ic b/innobase/include/com0shm.ic
deleted file mode 100644
index e0d3cb26f69..00000000000
--- a/innobase/include/com0shm.ic
+++ /dev/null
@@ -1,7 +0,0 @@
-/******************************************************
-Communication through shared memory
-
-(c) 1995 Innobase Oy
-
-Created 9/23/1995 Heikki Tuuri
-*******************************************************/
diff --git a/innobase/include/data0data.h b/innobase/include/data0data.h
index 889d148d3fe..c4e93bec738 100644
--- a/innobase/include/data0data.h
+++ b/innobase/include/data0data.h
@@ -262,6 +262,14 @@ dtuple_set_types_binary(
/*====================*/
dtuple_t* tuple, /* in: data tuple */
ulint n); /* in: number of fields to set */
+/**************************************************************************
+Checks if a dtuple contains an SQL null value. */
+UNIV_INLINE
+ibool
+dtuple_contains_null(
+/*=================*/
+ /* out: TRUE if some field is SQL null */
+ dtuple_t* tuple); /* in: dtuple */
/**************************************************************
Checks that a data field is typed. Asserts an error if not. */
@@ -367,84 +375,6 @@ dtuple_big_rec_free(
/*================*/
big_rec_t* vector); /* in, own: big rec vector; it is
freed in this function */
-/***************************************************************
-Generates a random tuple. */
-
-dtuple_t*
-dtuple_gen_rnd_tuple(
-/*=================*/
- /* out: pointer to the tuple */
- mem_heap_t* heap); /* in: memory heap where generated */
-/*******************************************************************
-Generates a test tuple for sort and comparison tests. */
-
-void
-dtuple_gen_test_tuple(
-/*==================*/
- dtuple_t* tuple, /* in/out: a tuple with 3 fields */
- ulint i); /* in: a number, 0 <= i < 512 */
-/*******************************************************************
-Generates a test tuple for B-tree speed tests. */
-
-void
-dtuple_gen_test_tuple3(
-/*===================*/
- dtuple_t* tuple, /* in/out: a tuple with 3 fields */
- ulint i, /* in: a number < 1000000 */
- ulint type, /* in: DTUPLE_TEST_FIXED30, ... */
- byte* buf); /* in: a buffer of size >= 8 bytes */
-/*******************************************************************
-Generates a test tuple for B-tree speed tests. */
-
-void
-dtuple_gen_search_tuple3(
-/*=====================*/
- dtuple_t* tuple, /* in/out: a tuple with 1 or 2 fields */
- ulint i, /* in: a number < 1000000 */
- byte* buf); /* in: a buffer of size >= 8 bytes */
-/*******************************************************************
-Generates a test tuple for TPC-A speed test. */
-
-void
-dtuple_gen_test_tuple_TPC_A(
-/*========================*/
- dtuple_t* tuple, /* in/out: a tuple with >= 3 fields */
- ulint i, /* in: a number < 10000 */
- byte* buf); /* in: a buffer of size >= 16 bytes */
-/*******************************************************************
-Generates a test tuple for B-tree speed tests. */
-
-void
-dtuple_gen_search_tuple_TPC_A(
-/*==========================*/
- dtuple_t* tuple, /* in/out: a tuple with 1 field */
- ulint i, /* in: a number < 10000 */
- byte* buf); /* in: a buffer of size >= 16 bytes */
-/*******************************************************************
-Generates a test tuple for TPC-C speed test. */
-
-void
-dtuple_gen_test_tuple_TPC_C(
-/*========================*/
- dtuple_t* tuple, /* in/out: a tuple with >= 12 fields */
- ulint i, /* in: a number < 100000 */
- byte* buf); /* in: a buffer of size >= 16 bytes */
-/*******************************************************************
-Generates a test tuple for B-tree speed tests. */
-
-void
-dtuple_gen_search_tuple_TPC_C(
-/*==========================*/
- dtuple_t* tuple, /* in/out: a tuple with 1 field */
- ulint i, /* in: a number < 100000 */
- byte* buf); /* in: a buffer of size >= 16 bytes */
-
-/* Types of the third field in dtuple_gen_test_tuple3 */
-#define DTUPLE_TEST_FIXED30 1
-#define DTUPLE_TEST_RND30 2
-#define DTUPLE_TEST_RND3500 3
-#define DTUPLE_TEST_FIXED2000 4
-#define DTUPLE_TEST_FIXED3 5
/*######################################################################*/
@@ -472,9 +402,11 @@ struct dtuple_struct {
UT_LIST_NODE_T(dtuple_t) tuple_list;
/* data tuples can be linked into a
list using this field */
- ulint magic_n;
-};
+#ifdef UNIV_DEBUG
+ ulint magic_n;
#define DATA_TUPLE_MAGIC_N 65478679
+#endif /* UNIV_DEBUG */
+};
/* A slot for a field in a big rec vector */
diff --git a/innobase/include/data0data.ic b/innobase/include/data0data.ic
index d356664df21..def80d3f430 100644
--- a/innobase/include/data0data.ic
+++ b/innobase/include/data0data.ic
@@ -406,3 +406,28 @@ data_write_sql_null(
data[j] = '\0';
}
}
+
+/**************************************************************************
+Checks if a dtuple contains an SQL null value. */
+UNIV_INLINE
+ibool
+dtuple_contains_null(
+/*=================*/
+ /* out: TRUE if some field is SQL null */
+ dtuple_t* tuple) /* in: dtuple */
+{
+ ulint n;
+ ulint i;
+
+ n = dtuple_get_n_fields(tuple);
+
+ for (i = 0; i < n; i++) {
+ if (dfield_get_len(dtuple_get_nth_field(tuple, i))
+ == UNIV_SQL_NULL) {
+
+ return(TRUE);
+ }
+ }
+
+ return(FALSE);
+}
diff --git a/innobase/include/data0type.h b/innobase/include/data0type.h
index f202230bb94..2b27ead5fac 100644
--- a/innobase/include/data0type.h
+++ b/innobase/include/data0type.h
@@ -11,6 +11,9 @@ Created 1/16/1996 Heikki Tuuri
#include "univ.i"
+extern ulint data_mysql_default_charset_coll;
+extern ulint data_mysql_latin1_swedish_charset_coll;
+
/* SQL data type struct */
typedef struct dtype_struct dtype_t;
@@ -18,31 +21,79 @@ typedef struct dtype_struct dtype_t;
data type */
extern dtype_t* dtype_binary;
-/* Data main types of SQL data */
-#define DATA_VARCHAR 1 /* character varying */
-#define DATA_CHAR 2 /* fixed length character */
+/*-------------------------------------------*/
+/* The 'MAIN TYPE' of a column */
+#define DATA_VARCHAR 1 /* character varying of the
+ latin1_swedish_ci charset-collation */
+#define DATA_CHAR 2 /* fixed length character of the
+ latin1_swedish_ci charset-collation */
#define DATA_FIXBINARY 3 /* binary string of fixed length */
#define DATA_BINARY 4 /* binary string */
-#define DATA_BLOB 5 /* binary large object, or a TEXT type; if
- prtype & DATA_NONLATIN1 != 0 the data must
- be compared by MySQL as a whole field; if
- prtype & DATA_BINARY_TYPE == 0, then this is
- actually a TEXT column */
+#define DATA_BLOB 5 /* binary large object, or a TEXT type;
+ if prtype & DATA_BINARY_TYPE == 0, then this is
+ actually a TEXT column (or a BLOB created
+ with < 4.0.14) */
#define DATA_INT 6 /* integer: can be any size 1 - 8 bytes */
#define DATA_SYS_CHILD 7 /* address of the child page in node pointer */
#define DATA_SYS 8 /* system column */
+
/* Data types >= DATA_FLOAT must be compared using the whole field, not as
binary strings */
+
#define DATA_FLOAT 9
#define DATA_DOUBLE 10
#define DATA_DECIMAL 11 /* decimal number stored as an ASCII string */
-#define DATA_VARMYSQL 12 /* non-latin1 varying length char */
-#define DATA_MYSQL 13 /* non-latin1 fixed length char */
+#define DATA_VARMYSQL 12 /* any charset varying length char */
+#define DATA_MYSQL 13 /* any charset fixed length char */
+ /* NOTE that 4.1.1 used DATA_MYSQL and
+ DATA_VARMYSQL for all character sets, and the
+ charset-collation for tables created with it
+ can also be latin1_swedish_ci */
#define DATA_MTYPE_MAX 63 /* dtype_store_for_order_and_null_size()
requires the values are <= 63 */
/*-------------------------------------------*/
-/* In the lowest byte in the precise type we store the MySQL type code
-(not applicable for system columns). */
+/* The 'PRECISE TYPE' of a column */
+/*
+Tables created by a MySQL user have the following convention:
+
+- In the least significant byte in the precise type we store the MySQL type
+code (not applicable for system columns).
+
+- In the second least significant byte we OR flags DATA_NOT_NULL,
+DATA_UNSIGNED, DATA_BINARY_TYPE.
+
+- In the third least significant byte of the precise type of string types we
+store the MySQL charset-collation code. In DATA_BLOB columns created with
+< 4.0.14 we do not actually know if it is a BLOB or a TEXT column. Since there
+are no indexes on prefixes of BLOB or TEXT columns in < 4.0.14, this is no
+problem, though.
+
+Note that versions < 4.1.2 or < 5.0.1 did not store the charset code to the
+precise type, since the charset was always the default charset of the MySQL
+installation. If the stored charset code is 0 in the system table SYS_COLUMNS
+of InnoDB, that means that the default charset of this MySQL installation
+should be used.
+
+When loading a table definition from the system tables to the InnoDB data
+dictionary cache in main memory, InnoDB versions >= 4.1.2 and >= 5.0.1 check
+if the stored charset-collation is 0, and if that is the case and the type is
+a non-binary string, replace that 0 by the default charset-collation code of
+this MySQL installation. In short, in old tables, the charset-collation code
+in the system tables on disk can be 0, but in in-memory data structures
+(dtype_t), the charset-collation code is always != 0 for non-binary string
+types.
+
+In new tables, in binary string types, the charset-collation code is the
+MySQL code for the 'binary charset', that is, != 0.
+
+For binary string types and for DATA_CHAR, DATA_VARCHAR, and for those
+DATA_BLOB which are binary or have the charset-collation latin1_swedish_ci,
+InnoDB performs all comparisons internally, without resorting to the MySQL
+comparison functions. This is to save CPU time.
+
+InnoDB's own internal system tables have different precise types for their
+columns, and for them the precise type is usually not used at all.
+*/
#define DATA_ENGLISH 4 /* English language character string: this
is a relic from pre-MySQL time and only used
@@ -69,7 +120,7 @@ be less than 256 */
#define DATA_MIX_ID_LEN 9 /* maximum stored length for mix id (in a
compressed dulint form) */
#define DATA_N_SYS_COLS 4 /* number of system columns defined above */
-/*-------------------------------------------*/
+
/* Flags ORed to the precise data type */
#define DATA_NOT_NULL 256 /* this is ORed to the precise type when
the column is declared as NOT NULL */
@@ -79,20 +130,53 @@ be less than 256 */
string, this is ORed to the precise type:
this only holds for tables created with
>= MySQL-4.0.14 */
-#define DATA_NONLATIN1 2048 /* if the data type is a DATA_BLOB (actually
- TEXT) of a non-latin1 type, this is ORed to
- the precise type: this only holds for tables
- created with >= MySQL-4.0.14 */
+/* #define DATA_NONLATIN1 2048 This is a relic from < 4.1.2 and < 5.0.1.
+ In earlier versions this was set for some
+ BLOB columns.
+*/
/*-------------------------------------------*/
/* This many bytes we need to store the type information affecting the
alphabetical order for a single field and decide the storage size of an
SQL null*/
-#define DATA_ORDER_NULL_TYPE_BUF_SIZE 4
-/* In the >= 4.1.x storage format we need 2 bytes more for the charset */
+#define DATA_ORDER_NULL_TYPE_BUF_SIZE 4
+/* In the >= 4.1.x storage format we add 2 bytes more so that we can also
+store the charset-collation number; one byte is left unused, though */
#define DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE 6
/*************************************************************************
+Checks if a data main type is a string type. Also a BLOB is considered a
+string type. */
+
+ibool
+dtype_is_string_type(
+/*=================*/
+ /* out: TRUE if string type */
+ ulint mtype); /* in: InnoDB main data type code: DATA_CHAR, ... */
+/*************************************************************************
+Checks if a type is a binary string type. Note that for tables created with
+< 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column. For
+those DATA_BLOB columns this function currently returns FALSE. */
+
+ibool
+dtype_is_binary_string_type(
+/*========================*/
+ /* out: TRUE if binary string type */
+ ulint mtype, /* in: main data type */
+ ulint prtype);/* in: precise type */
+/*************************************************************************
+Checks if a type is a non-binary string type. That is, dtype_is_string_type is
+TRUE and dtype_is_binary_string_type is FALSE. Note that for tables created
+with < 4.0.14, we do not know if a DATA_BLOB column is a BLOB or a TEXT column.
+For those DATA_BLOB columns this function currently returns TRUE. */
+
+ibool
+dtype_is_non_binary_string_type(
+/*============================*/
+ /* out: TRUE if non-binary string type */
+ ulint mtype, /* in: main data type */
+ ulint prtype);/* in: precise type */
+/*************************************************************************
Sets a data type structure. */
UNIV_INLINE
void
@@ -126,6 +210,23 @@ dtype_get_prtype(
/*=============*/
dtype_t* type);
/*************************************************************************
+Gets the MySQL charset-collation code for MySQL string types. */
+UNIV_INLINE
+ulint
+dtype_get_charset_coll(
+/*===================*/
+ ulint prtype);/* in: precise data type */
+/*************************************************************************
+Forms a precise type from the < 4.1.2 format precise type plus the
+charset-collation code. */
+
+ulint
+dtype_form_prtype(
+/*==============*/
+ ulint old_prtype, /* in: the MySQL type code and the flags
+ DATA_BINARY_TYPE etc. */
+ ulint charset_coll); /* in: MySQL charset-collation code */
+/*************************************************************************
Gets the type length. */
UNIV_INLINE
ulint
@@ -225,9 +326,8 @@ dtype_print(
struct dtype_struct{
ulint mtype; /* main data type */
ulint prtype; /* precise type; MySQL data type */
- ulint chrset; /* MySQL character set code */
- /* remaining two fields do not affect alphabetical ordering: */
+ /* the remaining two fields do not affect alphabetical ordering: */
ulint len; /* length */
ulint prec; /* precision */
diff --git a/innobase/include/data0type.ic b/innobase/include/data0type.ic
index 5d39b3e430b..946b646ffbf 100644
--- a/innobase/include/data0type.ic
+++ b/innobase/include/data0type.ic
@@ -27,7 +27,6 @@ dtype_set(
type->prtype = prtype;
type->len = len;
type->prec = prec;
- type->chrset = 0;
ut_ad(dtype_validate(type));
}
@@ -73,6 +72,17 @@ dtype_get_prtype(
}
/*************************************************************************
+Gets the MySQL charset-collation code for MySQL string types. */
+UNIV_INLINE
+ulint
+dtype_get_charset_coll(
+/*===================*/
+ ulint prtype) /* in: precise data type */
+{
+ return((prtype >> 16) & 0xFFUL);
+}
+
+/*************************************************************************
Gets the type length. */
UNIV_INLINE
ulint
@@ -147,20 +157,25 @@ dtype_new_store_for_order_and_null_size(
buf[0] = buf[0] | 128;
}
- if (type->prtype & DATA_NONLATIN1) {
- buf[0] = buf[0] | 64;
- }
+ /* In versions < 4.1.2 we had: if (type->prtype & DATA_NONLATIN1) {
+ buf[0] = buf[0] | 64;
+ }
+ */
buf[1] = (byte)(type->prtype & 0xFFUL);
mach_write_to_2(buf + 2, type->len & 0xFFFFUL);
- mach_write_to_2(buf + 4, type->chrset & 0xFFFFUL);
+ mach_write_to_2(buf + 4, dtype_get_charset_coll(type->prtype));
+
+ /* Note that the second last byte is left unused, because the
+ charset-collation code is always < 256 */
}
/**************************************************************************
Reads to a type the stored information which determines its alphabetical
-ordering and the storage size of an SQL NULL value. */
+ordering and the storage size of an SQL NULL value. This is the < 4.1.x
+storage format. */
UNIV_INLINE
void
dtype_read_for_order_and_null_size(
@@ -177,17 +192,16 @@ dtype_read_for_order_and_null_size(
type->prtype = type->prtype | DATA_BINARY_TYPE;
}
- if (buf[0] & 64) {
- type->prtype = type->prtype | DATA_NONLATIN1;
- }
-
type->len = mach_read_from_2(buf + 2);
+
+ type->prtype = dtype_form_prtype(type->prtype,
+ data_mysql_default_charset_coll);
}
/**************************************************************************
Reads to a type the stored information which determines its alphabetical
-ordering and the storage size of an SQL NULL value. This is the 4.1.x storage
-format. */
+ordering and the storage size of an SQL NULL value. This is the >= 4.1.x
+storage format. */
UNIV_INLINE
void
dtype_new_read_for_order_and_null_size(
@@ -195,6 +209,8 @@ dtype_new_read_for_order_and_null_size(
dtype_t* type, /* in: type struct */
byte* buf) /* in: buffer for stored type order info */
{
+ ulint charset_coll;
+
ut_ad(6 == DATA_NEW_ORDER_NULL_TYPE_BUF_SIZE);
type->mtype = buf[0] & 63;
@@ -204,14 +220,28 @@ dtype_new_read_for_order_and_null_size(
type->prtype = type->prtype | DATA_BINARY_TYPE;
}
- if (buf[0] & 64) {
- type->prtype = type->prtype | DATA_NONLATIN1;
- }
-
type->len = mach_read_from_2(buf + 2);
- type->chrset = mach_read_from_2(buf + 4);
-}
+ mach_read_from_2(buf + 4);
+
+ charset_coll = mach_read_from_2(buf + 4);
+
+ if (dtype_is_string_type(type->mtype)) {
+ ut_a(charset_coll < 256);
+
+ if (charset_coll == 0) {
+ /* This insert buffer record was inserted with MySQL
+ version < 4.1.2, and the charset-collation code was not
+ explicitly stored to dtype->prtype at that time. It
+ must be the default charset-collation of this MySQL
+ installation. */
+
+ charset_coll = data_mysql_default_charset_coll;
+ }
+
+ type->prtype = dtype_form_prtype(type->prtype, charset_coll);
+ }
+}
/***************************************************************************
Returns the size of a fixed size data type, 0 if not a fixed size type. */
@@ -250,7 +280,7 @@ dtype_get_fixed_size(
case DATA_VARMYSQL:
case DATA_BLOB:
return(0);
- default: ut_a(0);
+ default: ut_error;
}
return(0);
diff --git a/innobase/include/dict0crea.h b/innobase/include/dict0crea.h
index ccdedff42c8..8b6944fc605 100644
--- a/innobase/include/dict0crea.h
+++ b/innobase/include/dict0crea.h
@@ -17,15 +17,6 @@ Created 1/8/1996 Heikki Tuuri
#include "mtr0mtr.h"
/*************************************************************************
-Creates the default clustered index for a table: the records are ordered
-by row id. */
-
-void
-dict_create_default_index(
-/*======================*/
- dict_table_t* table, /* in: table */
- trx_t* trx); /* in: transaction handle */
-/*************************************************************************
Creates a table create graph. */
tab_node_t*
@@ -81,12 +72,25 @@ dict_create_or_check_foreign_constraint_tables(void);
/*================================================*/
/* out: DB_SUCCESS or error code */
/************************************************************************
-Adds foreign key definitions to data dictionary tables in the database. */
+Adds foreign key definitions to data dictionary tables in the database. We
+look at table->foreign_list, and also generate names to constraints that were
+not named by the user. A generated constraint has a name of the format
+databasename/tablename_ibfk_<number>, where the numbers start from 1, and are
+given locally for this table, that is, the number is not global, as in the
+old format constraints < 4.0.18 it used to be. */
ulint
dict_create_add_foreigns_to_dictionary(
/*===================================*/
/* out: error code or DB_SUCCESS */
+ ulint start_id,/* in: if we are actually doing ALTER TABLE
+ ADD CONSTRAINT, we want to generate constraint
+ numbers which are bigger than in the table so
+ far; we number the constraints from
+ start_id + 1 up; start_id should be set to 0 if
+ we are creating a new table, or if the table
+ so far has no constraints for which the name
+ was generated here */
dict_table_t* table, /* in: table */
trx_t* trx); /* in: transaction */
diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h
index 234dece2cda..688685cff8b 100644
--- a/innobase/include/dict0dict.h
+++ b/innobase/include/dict0dict.h
@@ -26,6 +26,14 @@ Created 1/8/1996 Heikki Tuuri
#include "ut0byte.h"
#include "trx0types.h"
+/************************************************************************
+Get the database name length in a table name. */
+
+ulint
+dict_get_db_name_len(
+/*=================*/
+ /* out: database name length */
+ char* name); /* in: table name in the form dbname '/' tablename */
/*************************************************************************
Accepts a specified string. Comparisons are case-insensitive. */
@@ -217,6 +225,15 @@ dict_foreign_add_to_cache(
/* out: DB_SUCCESS or error code */
dict_foreign_t* foreign); /* in, own: foreign key constraint */
/*************************************************************************
+Checks if a table is referenced by foreign keys. */
+
+ibool
+dict_table_referenced_by_foreign_key(
+/*=================================*/
+ /* out: TRUE if table is referenced by a
+ foreign key */
+ dict_table_t* table); /* in: InnoDB table */
+/*************************************************************************
Scans a table create SQL string and adds to the data dictionary
the foreign key constraints declared in the string. This function
should be called after the indexes for a table have been created.
@@ -476,6 +493,17 @@ dict_table_get_sys_col_no(
/* out: column number */
dict_table_t* table, /* in: table */
ulint sys); /* in: DATA_ROW_ID, ... */
+/************************************************************************
+Checks if a column is in the ordering columns of the clustered index of a
+table. Column prefixes are treated like whole columns. */
+
+ibool
+dict_table_col_in_clustered_key(
+/*============================*/
+ /* out: TRUE if the column, or its prefix, is
+ in the clustered key */
+ dict_table_t* table, /* in: table */
+ ulint n); /* in: column number */
/***********************************************************************
Copies types of columns contained in table to tuple. */
@@ -660,13 +688,6 @@ dict_index_get_tree(
/* out: index tree */
dict_index_t* index); /* in: index */
/*************************************************************************
-Gets the column data type. */
-UNIV_INLINE
-dtype_t*
-dict_col_get_type(
-/*==============*/
- dict_col_t* col);
-/*************************************************************************
Gets the field order criterion. */
UNIV_INLINE
ulint
diff --git a/innobase/include/dict0dict.ic b/innobase/include/dict0dict.ic
index c5982c162a7..b70822e331f 100644
--- a/innobase/include/dict0dict.ic
+++ b/innobase/include/dict0dict.ic
@@ -543,8 +543,10 @@ dict_table_check_if_in_cache_low(
ulint table_fold;
ut_ad(table_name);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
-
+#endif /* UNIV_SYNC_DEBUG */
+
/* Look for the table name in the hash table */
table_fold = ut_fold_string(table_name);
@@ -566,8 +568,10 @@ dict_table_get_low(
dict_table_t* table;
ut_ad(table_name);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
-
+#endif /* UNIV_SYNC_DEBUG */
+
table = dict_table_check_if_in_cache_low(table_name);
if (table == NULL) {
@@ -621,7 +625,9 @@ dict_table_get_on_id_low(
dict_table_t* table;
ulint fold;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
UT_NOT_USED(trx);
/* Look for the table name in the hash table */
diff --git a/innobase/include/dict0mem.h b/innobase/include/dict0mem.h
index b18e20a644a..23753df4079 100644
--- a/innobase/include/dict0mem.h
+++ b/innobase/include/dict0mem.h
@@ -198,10 +198,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 */
+};
/* Data structure for an index */
struct dict_index_struct{
@@ -247,7 +248,10 @@ 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:
@@ -298,9 +302,6 @@ 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 */
@@ -419,10 +420,12 @@ 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 */
+ next inserted row */
+#ifdef UNIV_DEBUG
ulint magic_n;/* magic number */
-};
#define DICT_TABLE_MAGIC_N 76333786
+#endif /* UNIV_DEBUG */
+};
/* Data structure for a stored procedure */
struct dict_proc_struct{
diff --git a/innobase/include/fut0fut.ic b/innobase/include/fut0fut.ic
index 0f1aa9dd9ae..6a107786376 100644
--- a/innobase/include/fut0fut.ic
+++ b/innobase/include/fut0fut.ic
@@ -30,7 +30,9 @@ fut_get_ptr(
ptr = buf_page_get(space, addr.page, rw_latch, mtr) + addr.boffset;
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(ptr, SYNC_NO_ORDER_CHECK);
+#endif /* UNIV_SYNC_DEBUG */
return(ptr);
}
diff --git a/innobase/include/ha0ha.ic b/innobase/include/ha0ha.ic
index 77064cdf9da..5369ca7f273 100644
--- a/innobase/include/ha0ha.ic
+++ b/innobase/include/ha0ha.ic
@@ -81,7 +81,9 @@ ha_search(
{
ha_node_t* node;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold)));
+#endif /* UNIV_SYNC_DEBUG */
node = ha_chain_get_first(table, fold);
@@ -111,7 +113,9 @@ ha_search_and_get_data(
{
ha_node_t* node;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold)));
+#endif /* UNIV_SYNC_DEBUG */
node = ha_chain_get_first(table, fold);
@@ -170,7 +174,9 @@ ha_search_with_data(
{
ha_node_t* node;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold)));
+#endif /* UNIV_SYNC_DEBUG */
node = ha_chain_get_first(table, fold);
@@ -200,7 +206,9 @@ ha_search_and_delete_if_found(
{
ha_node_t* node;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold)));
+#endif /* UNIV_SYNC_DEBUG */
node = ha_search_with_data(table, fold, data);
diff --git a/innobase/include/hash0hash.h b/innobase/include/hash0hash.h
index 2e9ab498116..79efe016324 100644
--- a/innobase/include/hash0hash.h
+++ b/innobase/include/hash0hash.h
@@ -53,15 +53,24 @@ hash_calc_hash(
/* out: hashed value */
ulint fold, /* in: folded value */
hash_table_t* table); /* in: hash table */
+/************************************************************************
+Assert that the mutex for the table in a hash operation is owned. */
+#ifdef UNIV_SYNC_DEBUG
+# define HASH_ASSERT_OWNED(TABLE, FOLD) \
+ut_ad(!(TABLE)->mutexes || mutex_own(hash_get_mutex(TABLE, FOLD)));
+#else
+# define HASH_ASSERT_OWNED(TABLE, FOLD)
+#endif
+
/***********************************************************************
Inserts a struct to a hash table. */
#define HASH_INSERT(TYPE, NAME, TABLE, FOLD, DATA)\
-{\
+do {\
hash_cell_t* cell3333;\
TYPE* struct3333;\
\
- ut_ad(!(TABLE)->mutexes || mutex_own(hash_get_mutex(TABLE, FOLD)));\
+ HASH_ASSERT_OWNED(TABLE, FOLD)\
\
(DATA)->NAME = NULL;\
\
@@ -79,17 +88,17 @@ Inserts a struct to a hash table. */
\
struct3333->NAME = DATA;\
}\
-}
+} while (0)
/***********************************************************************
Deletes a struct from a hash table. */
#define HASH_DELETE(TYPE, NAME, TABLE, FOLD, DATA)\
-{\
+do {\
hash_cell_t* cell3333;\
TYPE* struct3333;\
\
- ut_ad(!(TABLE)->mutexes || mutex_own(hash_get_mutex(TABLE, FOLD)));\
+ HASH_ASSERT_OWNED(TABLE, FOLD)\
\
cell3333 = hash_get_nth_cell(TABLE, hash_calc_hash(FOLD, TABLE));\
\
@@ -100,13 +109,13 @@ Deletes a struct from a hash table. */
\
while (struct3333->NAME != DATA) {\
\
- ut_a(struct3333)\
+ ut_a(struct3333);\
struct3333 = struct3333->NAME;\
}\
\
struct3333->NAME = DATA->NAME;\
}\
-}
+} while (0)
/***********************************************************************
Gets the first struct in a hash chain, NULL if none. */
@@ -124,7 +133,7 @@ Looks for a struct in a hash table. */
#define HASH_SEARCH(NAME, TABLE, FOLD, DATA, TEST)\
{\
\
- ut_ad(!(TABLE)->mutexes || mutex_own(hash_get_mutex(TABLE, FOLD)));\
+ HASH_ASSERT_OWNED(TABLE, FOLD)\
\
(DATA) = HASH_GET_FIRST(TABLE, hash_calc_hash(FOLD, TABLE));\
\
@@ -160,7 +169,7 @@ the heap. The fold value must be stored in the struct NODE in a field named
'fold'. */
#define HASH_DELETE_AND_COMPACT(TYPE, NAME, TABLE, NODE)\
-{\
+do {\
TYPE* node111;\
TYPE* top_node111;\
hash_cell_t* cell111;\
@@ -211,33 +220,7 @@ the heap. The fold value must be stored in the struct NODE in a field named
/* Free the space occupied by the top node */\
\
mem_heap_free_top(hash_get_heap(TABLE, fold111), sizeof(TYPE));\
-}
-
-/***********************************************************************
-Calculates the number of stored structs in a hash table. */
-
-#define HASH_GET_N_NODES(TYPE, NAME, TABLE, N)\
-{\
- hash_cell_t* cell3333;\
- TYPE* struct3333;\
- ulint i3333;\
-\
- (N) = 0;\
-\
- for (i3333 = 0; i3333 < hash_get_n_cells(TABLE); i3333++) {\
-\
- cell3333 = hash_get_nth_cell(TABLE, i3333);\
-\
- struct3333 = cell3333->node;\
-\
- while (struct3333) {\
-\
- (N) = (N) + 1;\
-\
- struct = HASH_GET_NEXT(NAME, struct3333);\
- }\
- }\
-}
+} while (0)
/****************************************************************
Gets the mutex index for a fold value in a hash table. */
@@ -300,21 +283,6 @@ 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 */
@@ -335,10 +303,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 */
+};
#ifndef UNIV_NONINL
#include "hash0hash.ic"
diff --git a/innobase/include/hash0hash.ic b/innobase/include/hash0hash.ic
index 0d713140c13..1b9acfa2f34 100644
--- a/innobase/include/hash0hash.ic
+++ b/innobase/include/hash0hash.ic
@@ -18,6 +18,7 @@ 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);
@@ -32,6 +33,7 @@ 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);
}
@@ -45,6 +47,7 @@ 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));
}
@@ -58,6 +61,7 @@ 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));
}
@@ -71,6 +75,7 @@ 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]);
@@ -88,6 +93,8 @@ hash_get_heap(
{
ulint i;
+ ut_ad(table->magic_n == HASH_TABLE_MAGIC_N);
+
if (table->heap) {
return(table->heap);
}
@@ -107,6 +114,7 @@ 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/ib_odbc.h b/innobase/include/ib_odbc.h
deleted file mode 100644
index 86884b41d39..00000000000
--- a/innobase/include/ib_odbc.h
+++ /dev/null
@@ -1,149 +0,0 @@
-/******************************************************
-Innobase ODBC client library header; this is equivalent to
-the standard sql.h ODBC header file
-
-(c) 1998 Innobase Oy
-
-Created 2/22/1998 Heikki Tuuri
-*******************************************************/
-
-#ifndef ib_odbc_h
-#define ib_odbc_h
-
-typedef unsigned char UCHAR;
-typedef signed char SCHAR;
-typedef long int SDWORD;
-typedef short int SWORD;
-typedef unsigned long int UDWORD;
-typedef unsigned short int UWORD;
-
-typedef void* PTR;
-
-typedef void* HENV;
-typedef void* HDBC;
-typedef void* HSTMT;
-
-typedef signed short RETCODE;
-
-/* RETCODEs */
-#define SQL_NO_DATA_FOUND (-3)
-#define SQL_INVALID_HANDLE (-2)
-#define SQL_ERROR (-1)
-#define SQL_SUCCESS 0
-
-/* Standard SQL datatypes, using ANSI type numbering */
-#define SQL_CHAR 1
-#define SQL_INTEGER 4
-#define SQL_VARCHAR 12
-
-/* C datatype to SQL datatype mapping */
-#define SQL_C_CHAR SQL_CHAR
-#define SQL_C_LONG SQL_INTEGER
-
-/* Special length value */
-#define SQL_NULL_DATA (-1)
-
-#define SQL_PARAM_INPUT 1
-#define SQL_PARAM_OUTPUT 4
-
-/* Null handles */
-#define SQL_NULL_HENV NULL
-#define SQL_NULL_HDBC NULL
-#define SQL_NULL_HSTM NULL
-
-
-/**************************************************************************
-Allocates an SQL environment. */
-
-RETCODE
-SQLAllocEnv(
-/*========*/
- /* out: SQL_SUCCESS */
- HENV* phenv); /* out: pointer to an environment handle */
-/**************************************************************************
-Allocates an SQL connection. */
-
-RETCODE
-SQLAllocConnect(
-/*============*/
- /* out: SQL_SUCCESS */
- HENV henv, /* in: pointer to an environment handle */
- HDBC* phdbc); /* out: pointer to a connection handle */
-/**************************************************************************
-Allocates an SQL statement. */
-
-RETCODE
-SQLAllocStmt(
-/*=========*/
- HDBC hdbc, /* in: SQL connection */
- HSTMT* phstmt); /* out: pointer to a statement handle */
-/**************************************************************************
-Connects to a database server process (establishes a connection and a
-session). */
-
-RETCODE
-SQLConnect(
-/*=======*/
- /* out: SQL_SUCCESS */
- HDBC hdbc, /* in: SQL connection handle */
- UCHAR* szDSN, /* in: data source name (server name) */
- SWORD cbDSN, /* in: data source name length */
- UCHAR* szUID, /* in: user name */
- SWORD cbUID, /* in: user name length */
- UCHAR* szAuthStr, /* in: password */
- SWORD cbAuthStr); /* in: password length */
-/**************************************************************************
-Makes the server to parse and optimize an SQL string. */
-
-RETCODE
-SQLPrepare(
-/*=======*/
- /* out: SQL_SUCCESS */
- HSTMT hstmt, /* in: statement handle */
- UCHAR* szSqlStr, /* in: SQL string */
- SDWORD cbSqlStr); /* in: SQL string length */
-/**************************************************************************
-Binds a parameter in a prepared statement. */
-
-RETCODE
-SQLBindParameter(
-/*=============*/
- /* out: SQL_SUCCESS */
- HSTMT hstmt, /* in: statement handle */
- UWORD ipar, /* in: parameter index, starting from 1 */
- SWORD fParamType, /* in: SQL_PARAM_INPUT or SQL_PARAM_OUTPUT */
- SWORD fCType, /* in: SQL_C_CHAR, ... */
- SWORD fSqlType, /* in: SQL_CHAR, ... */
- UDWORD cbColDef, /* in: precision: ignored */
- SWORD ibScale, /* in: scale: ignored */
- PTR rgbValue, /* in: pointer to a buffer for the data */
- SDWORD cbValueMax, /* in: buffer size */
- SDWORD* pcbValue); /* in: pointer to a buffer for the data
- length or SQL_NULL_DATA */
-/**************************************************************************
-Executes a prepared statement where all parameters have been bound. */
-
-RETCODE
-SQLExecute(
-/*=======*/
- /* out: SQL_SUCCESS or SQL_ERROR */
- HSTMT hstmt); /* in: statement handle */
-/**************************************************************************
-Queries an error message. */
-
-RETCODE
-SQLError(
-/*=====*/
- /* out: SQL_SUCCESS or SQL_NO_DATA_FOUND */
- HENV henv, /* in: SQL_NULL_HENV */
- HDBC hdbc, /* in: SQL_NULL_HDBC */
- HSTMT hstmt, /* in: statement handle */
- UCHAR* szSqlState, /* in/out: SQLSTATE as a null-terminated string,
- (currently, always == "S1000") */
- SDWORD* pfNativeError, /* out: native error code */
- UCHAR* szErrorMsg, /* in/out: buffer for an error message as a
- null-terminated string */
- SWORD cbErrorMsgMax, /* in: buffer size for szErrorMsg */
- SWORD* pcbErrorMsg); /* out: error message length */
-
-#endif
diff --git a/innobase/include/ibuf0ibuf.h b/innobase/include/ibuf0ibuf.h
index bf03b06bd28..8ef67df26f8 100644
--- a/innobase/include/ibuf0ibuf.h
+++ b/innobase/include/ibuf0ibuf.h
@@ -177,15 +177,6 @@ ibuf_page_low(
mtr_t* mtr); /* in: mtr which will contain an x-latch to the
bitmap page if the page is not one of the fixed
address ibuf pages */
-/*************************************************************************
-Checks if an index page has so much free space that the free bit should
-be set TRUE in the ibuf bitmap. */
-
-ibool
-ibuf_index_page_has_free(
-/*=====================*/
- /* out: TRUE if there is enough free space */
- page_t* page); /* in: non-unique secondary index page */
/***************************************************************************
Frees excess pages from the ibuf free list. This function is called when an OS
thread calls fsp services to allocate a new file segment, or a new page to a
diff --git a/innobase/include/lock0lock.h b/innobase/include/lock0lock.h
index 49f4597b30c..103d28cd130 100644
--- a/innobase/include/lock0lock.h
+++ b/innobase/include/lock0lock.h
@@ -442,14 +442,6 @@ lock_rec_hash(
ulint space, /* in: space */
ulint page_no);/* in: page number */
/*************************************************************************
-Gets the mutex protecting record locks on a given page address. */
-
-mutex_t*
-lock_rec_get_mutex_for_addr(
-/*========================*/
- ulint space, /* in: space id */
- ulint page_no);/* in: page number */
-/*************************************************************************
Checks that a transaction id is sensible, i.e., not in the future. */
ibool
diff --git a/innobase/include/lock0lock.ic b/innobase/include/lock0lock.ic
index 64c43c88d2e..fabc9256401 100644
--- a/innobase/include/lock0lock.ic
+++ b/innobase/include/lock0lock.ic
@@ -64,7 +64,9 @@ lock_clust_rec_some_has_impl(
{
dulint trx_id;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(index->type & DICT_CLUSTERED);
ut_ad(page_rec_is_user_rec(rec));
diff --git a/innobase/include/log0log.h b/innobase/include/log0log.h
index dc44429d636..2bdc158502f 100644
--- a/innobase/include/log0log.h
+++ b/innobase/include/log0log.h
@@ -18,7 +18,9 @@ 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
@@ -719,11 +721,13 @@ 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 7ae7e859032..e273b6a292b 100644
--- a/innobase/include/log0log.ic
+++ b/innobase/include/log0log.ic
@@ -10,6 +10,7 @@ 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. */
@@ -21,6 +22,7 @@ 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. */
@@ -255,7 +257,9 @@ log_block_init(
{
ulint no;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
no = log_block_convert_lsn_to_no(lsn);
@@ -277,7 +281,9 @@ log_block_init_in_old_format(
{
ulint no;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
no = log_block_convert_lsn_to_no(lsn);
@@ -407,7 +413,9 @@ log_get_online_backup_lsn_low(void)
/* out: online_backup_lsn, the caller must
own the log_sys mutex */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(log_sys->online_backup_state);
return(log_sys->online_backup_lsn);
@@ -422,7 +430,9 @@ log_get_online_backup_state_low(void)
/* out: online backup state, the caller must
own the log_sys mutex */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
return(log_sys->online_backup_state);
}
diff --git a/innobase/include/mach0data.h b/innobase/include/mach0data.h
index 006f55d5f1f..f28c9422670 100644
--- a/innobase/include/mach0data.h
+++ b/innobase/include/mach0data.h
@@ -88,25 +88,6 @@ mach_read_from_4(
/*=============*/
/* out: ulint integer */
byte* b); /* in: pointer to four bytes */
-/***********************************************************
-The following function is used to store data from a ulint to memory
-in standard order:
-we store the most significant byte to the lowest address. */
-UNIV_INLINE
-void
-mach_write(
-/*=======*/
- byte* b, /* in: pointer to sizeof(ulint) bytes where to store */
- ulint n); /* in: ulint integer to be stored */
-/************************************************************
-The following function is used to fetch data from memory to a ulint.
-The most significant byte is at the lowest address. */
-UNIV_INLINE
-ulint
-mach_read(
-/*======*/
- /* out: ulint integer */
- byte* b); /* in: pointer to sizeof(ulint) bytes */
/*************************************************************
Writes a ulint in a compressed form. */
UNIV_INLINE
diff --git a/innobase/include/mach0data.ic b/innobase/include/mach0data.ic
index 0934c27d9f4..3ccdcf1dc0a 100644
--- a/innobase/include/mach0data.ic
+++ b/innobase/include/mach0data.ic
@@ -167,44 +167,6 @@ mach_read_from_4(
#endif
}
-/***********************************************************
-The following function is used to store data from a ulint to memory
-in standard order: we store the most significant byte to the lowest
-address. */
-UNIV_INLINE
-void
-mach_write(
-/*=======*/
- byte* b, /* in: pointer to 4 bytes where to store */
- ulint n) /* in: ulint integer to be stored */
-{
- ut_ad(b);
-
- b[0] = (byte)(n >> 24);
- b[1] = (byte)(n >> 16);
- b[2] = (byte)(n >> 8);
- b[3] = (byte)n;
-}
-
-/************************************************************
-The following function is used to fetch data from memory to a ulint.
-The most significant byte is at the lowest address. */
-UNIV_INLINE
-ulint
-mach_read(
-/*======*/
- /* out: ulint integer */
- byte* b) /* in: pointer to 4 bytes */
-{
- ut_ad(b);
-
- return( ((ulint)(b[0]) << 24)
- + ((ulint)(b[1]) << 16)
- + ((ulint)(b[2]) << 8)
- + (ulint)(b[3])
- );
-}
-
/*************************************************************
Writes a ulint in a compressed form where the first byte codes the
length of the stored ulint. We look at the most significant bits of
diff --git a/innobase/include/mem0dbg.h b/innobase/include/mem0dbg.h
index 0b1aa53d694..6c92d669be3 100644
--- a/innobase/include/mem0dbg.h
+++ b/innobase/include/mem0dbg.h
@@ -60,6 +60,7 @@ 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 */
+#ifdef UNIV_MEM_DEBUG
/******************************************************************
Prints the contents of a memory heap. */
@@ -67,6 +68,7 @@ void
mem_heap_print(
/*===========*/
mem_heap_t* heap); /* in: memory heap */
+#endif /* UNIV_MEM_DEBUG */
/******************************************************************
Checks that an object is a memory heap (or a block of it) */
@@ -83,20 +85,7 @@ mem_heap_validate(
/*==============*/
/* out: TRUE if ok */
mem_heap_t* heap); /* in: memory heap */
-/*********************************************************************
-Prints information of dynamic memory usage and currently live
-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);
-/*====================*/
+#ifdef UNIV_MEM_DEBUG
/*********************************************************************
TRUE if no memory is currently allocated. */
@@ -118,6 +107,7 @@ ibool
mem_validate(void);
/*===============*/
/* out: TRUE if ok */
+#endif /* UNIV_MEM_DEBUG */
/****************************************************************
Tries to find neigboring memory allocation blocks and dumps to stderr
the neighborhood of a given pointer. */
diff --git a/innobase/include/mem0dbg.ic b/innobase/include/mem0dbg.ic
index 765e23e747e..6efac719760 100644
--- a/innobase/include/mem0dbg.ic
+++ b/innobase/include/mem0dbg.ic
@@ -7,6 +7,7 @@ compilation module but is included in mem0mem.*.
Created 6/8/1994 Heikki Tuuri
*************************************************************************/
+#ifdef UNIV_MEM_DEBUG
extern mutex_t mem_hash_mutex;
extern ulint mem_current_allocated_memory;
@@ -89,3 +90,4 @@ mem_field_trailer_set_check(byte* field, ulint check);
ulint
mem_field_trailer_get_check(byte* field);
+#endif /* UNIV_MEM_DEBUG */
diff --git a/innobase/include/mem0mem.ic b/innobase/include/mem0mem.ic
index 1ff8c66e80a..fb4cef49ec9 100644
--- a/innobase/include/mem0mem.ic
+++ b/innobase/include/mem0mem.ic
@@ -162,7 +162,7 @@ mem_heap_alloc(
mem_block_set_free(block, free + MEM_SPACE_NEEDED(n));
- #ifdef UNIV_MEM_DEBUG
+#ifdef UNIV_MEM_DEBUG
/* In the debug version write debugging info to the field */
mem_field_init((byte*)buf, n);
@@ -171,7 +171,7 @@ mem_heap_alloc(
caller */
buf = (byte*)buf + MEM_FIELD_HEADER_SIZE;
- #endif
+#endif
#ifdef UNIV_SET_MEM_TO_ZERO
memset(buf, '\0', n);
#endif
@@ -212,15 +212,15 @@ mem_heap_free_heap_top(
{
mem_block_t* block;
mem_block_t* prev_block;
- #ifdef UNIV_MEM_DEBUG
+#ifdef UNIV_MEM_DEBUG
ibool error;
ulint total_size;
ulint size;
- #endif
+#endif
ut_ad(mem_heap_check(heap));
- #ifdef UNIV_MEM_DEBUG
+#ifdef UNIV_MEM_DEBUG
/* Validate the heap and get its total allocated size */
mem_heap_validate_or_print(heap, NULL, FALSE, &error, &total_size,
@@ -232,7 +232,7 @@ mem_heap_free_heap_top(
NULL);
ut_a(!error);
- #endif
+#endif
block = UT_LIST_GET_LAST(heap->base);
@@ -259,7 +259,7 @@ mem_heap_free_heap_top(
/* Set the free field of block */
mem_block_set_free(block, old_top - (byte*)block);
- #ifdef UNIV_MEM_DEBUG
+#ifdef UNIV_MEM_DEBUG
ut_ad(mem_block_get_start(block) <= mem_block_get_free(block));
/* In the debug version erase block from top up */
@@ -271,7 +271,7 @@ mem_heap_free_heap_top(
mem_current_allocated_memory -= (total_size - size);
mutex_exit(&mem_hash_mutex);
- #endif
+#endif
/* If free == start, we may free the block if it is not the first
one */
@@ -317,7 +317,7 @@ mem_heap_get_top(
buf = (byte*)block + mem_block_get_free(block) - MEM_SPACE_NEEDED(n);
- #ifdef UNIV_MEM_DEBUG
+#ifdef UNIV_MEM_DEBUG
ut_ad(mem_block_get_start(block) <=(ulint)((byte*)buf - (byte*)block));
/* In the debug version, advance buf to point at the storage which
@@ -327,7 +327,7 @@ mem_heap_get_top(
/* Check that the field lengths agree */
ut_ad(n == (ulint)mem_field_header_get_len(buf));
- #endif
+#endif
return(buf);
}
@@ -351,13 +351,13 @@ mem_heap_free_top(
/* Subtract the free field of block */
mem_block_set_free(block, mem_block_get_free(block)
- MEM_SPACE_NEEDED(n));
- #ifdef UNIV_MEM_DEBUG
+#ifdef UNIV_MEM_DEBUG
ut_ad(mem_block_get_start(block) <= mem_block_get_free(block));
/* In the debug version check the consistency, and erase field */
mem_field_erase((byte*)block + mem_block_get_free(block), n);
- #endif
+#endif
/* If free == start, we may free the block if it is not the first
one */
@@ -417,7 +417,7 @@ mem_heap_create_func(
/* Add the created block itself as the first block in the list */
UT_LIST_ADD_FIRST(list, block->base, block);
- #ifdef UNIV_MEM_DEBUG
+#ifdef UNIV_MEM_DEBUG
if (block == NULL) {
@@ -426,7 +426,7 @@ mem_heap_create_func(
mem_hash_insert(block, file_name, line);
- #endif
+#endif
return(block);
}
@@ -452,14 +452,14 @@ mem_heap_free_func(
block = UT_LIST_GET_LAST(heap->base);
- #ifdef UNIV_MEM_DEBUG
+#ifdef UNIV_MEM_DEBUG
/* In the debug version remove the heap from the hash table of heaps
and check its consistency */
mem_hash_remove(heap, file_name, line);
- #endif
+#endif
if (heap->free_block) {
mem_heap_free_block_free(heap);
@@ -493,18 +493,6 @@ mem_alloc_func(
ulint line /* in: line where created */
)
{
-#ifdef notdefined
- void* buf;
-
- buf = mem_area_alloc(n, mem_comm_pool);
-
-#ifdef UNIV_SET_MEM_TO_ZERO
- memset(buf, '\0', n);
-#endif
- return(buf);
-
-#else
-
mem_heap_t* heap;
void* buf;
@@ -525,8 +513,6 @@ mem_alloc_func(
ut_a((byte*)heap == (byte*)buf - MEM_BLOCK_HEADER_SIZE
- MEM_FIELD_HEADER_SIZE);
return(buf);
-
-#endif
}
/*******************************************************************
@@ -542,17 +528,11 @@ mem_free_func(
ulint line /* in: line where created */
)
{
-#ifdef notdefined
-
- mem_area_free(ptr, mem_comm_pool);
-
-#else
mem_heap_t* heap;
heap = (mem_heap_t*)((byte*)ptr - MEM_BLOCK_HEADER_SIZE
- MEM_FIELD_HEADER_SIZE);
mem_heap_free_func(heap, file_name, line);
-#endif
}
/*********************************************************************
diff --git a/innobase/include/mtr0log.h b/innobase/include/mtr0log.h
index da942dd45d7..f50c1dfcb6a 100644
--- a/innobase/include/mtr0log.h
+++ b/innobase/include/mtr0log.h
@@ -32,7 +32,6 @@ mlog_write_dulint(
/*==============*/
byte* ptr, /* in: pointer where to write */
dulint val, /* in: value to write */
- byte type, /* in: MLOG_8BYTES */
mtr_t* mtr); /* in: mini-transaction handle */
/************************************************************
Writes a string to a file page buffered in the buffer pool. Writes the
@@ -133,15 +132,6 @@ mlog_write_initial_log_record_fast(
byte type, /* in: log item type: MLOG_1BYTE, ... */
byte* log_ptr,/* in: pointer to mtr log which has been opened */
mtr_t* mtr); /* in: mtr */
-/****************************************************************
-Writes the contents of a mini-transaction log, if any, to the database log. */
-
-dulint
-mlog_write(
-/*=======*/
- dyn_array_t* mlog, /* in: mlog */
- ibool* modifications); /* out: TRUE if there were
- log items to write */
/************************************************************
Parses an initial log record written by mlog_write_initial_log_record. */
diff --git a/innobase/include/mtr0mtr.h b/innobase/include/mtr0mtr.h
index c47fb54a6f8..9cf592f71e1 100644
--- a/innobase/include/mtr0mtr.h
+++ b/innobase/include/mtr0mtr.h
@@ -132,16 +132,6 @@ void
mtr_commit(
/*=======*/
mtr_t* mtr); /* in: mini-transaction */
-/****************************************************************
-Writes to the database log the full contents of the pages that this mtr is
-the first to modify in the buffer pool. This function is called when the
-database is in the online backup state. */
-
-void
-mtr_log_write_backup_entries(
-/*=========================*/
- mtr_t* mtr, /* in: mini-transaction */
- dulint backup_lsn); /* in: online backup lsn */
/**************************************************************
Sets and returns a savepoint in mtr. */
UNIV_INLINE
@@ -205,7 +195,6 @@ mtr_read_dulint(
/*===========*/
/* out: value read */
byte* ptr, /* in: pointer from where to read */
- ulint type, /* in: MLOG_8BYTES */
mtr_t* mtr); /* in: mini-transaction handle */
/*************************************************************************
This macro locks an rw-lock in s-mode. */
@@ -306,7 +295,12 @@ 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;
@@ -321,15 +315,12 @@ 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_ACTIVE 12231
-#define MTR_COMMITTING 56456
-#define MTR_COMMITTED 34676
-
#ifndef UNIV_NONINL
#include "mtr0mtr.ic"
#endif
diff --git a/innobase/include/odbc0odbc.h b/innobase/include/odbc0odbc.h
deleted file mode 100644
index 7f842b54b27..00000000000
--- a/innobase/include/odbc0odbc.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/******************************************************
-Innobase ODBC client library additional header
-
-(c) 1998 Innobase Oy
-
-Created 2/22/1998 Heikki Tuuri
-*******************************************************/
-
-#ifndef odbc0odbc_h
-#define odbc0odbc_h
-
-#include "ib_odbc.h"
-
-/* Datagram size in communications */
-#define ODBC_DATAGRAM_SIZE 8192
-
-/* Communication address maximum length in bytes */
-#define ODBC_ADDRESS_SIZE COM_MAX_ADDR_LEN
-
-#endif
diff --git a/innobase/include/os0file.h b/innobase/include/os0file.h
index 5f2d6e3ed21..813e6e72e65 100644
--- a/innobase/include/os0file.h
+++ b/innobase/include/os0file.h
@@ -20,6 +20,9 @@ extern ibool os_do_not_call_flush_at_each_write;
extern ibool os_has_said_disk_full;
extern ibool os_aio_print_debug;
+extern ulint os_file_n_pending_preads;
+extern ulint os_file_n_pending_pwrites;
+
#ifdef __WIN__
/* We define always WIN_ASYNC_IO, and check at run-time whether
@@ -60,6 +63,7 @@ log. */
#define OS_FILE_CREATE 52
#define OS_FILE_OVERWRITE 53
#define OS_FILE_OPEN_RAW 54
+#define OS_FILE_CREATE_PATH 55
#define OS_FILE_READ_ONLY 333
#define OS_FILE_READ_WRITE 444
@@ -228,7 +232,9 @@ os_file_create_simple(
string */
ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened
(if does not exist, error), or OS_FILE_CREATE if a new
- file is created (if exists, error) */
+ file is created (if exists, error), or
+ OS_FILE_CREATE_PATH if new file (if exists, error) and
+ subdirectories along its path are created (if needed)*/
ulint access_type,/* in: OS_FILE_READ_ONLY or OS_FILE_READ_WRITE */
ibool* success);/* out: TRUE if succeed, FALSE if error */
/********************************************************************
@@ -421,6 +427,59 @@ os_file_write(
ulint offset_high,/* in: most significant 32 bits of
offset */
ulint n); /* in: number of bytes to write */
+/***********************************************************************
+Check the existence and type of the given file. */
+
+ibool
+os_file_status(
+/*===========*/
+ /* out: TRUE if call succeeded */
+ char * path, /* in: pathname of the file */
+ ibool * exists, /* out: TRUE if file exists */
+ os_file_type_t* type); /* out: type of the file (if it exists) */
+/********************************************************************
+The function os_file_dirname returns a directory component of a
+null-terminated pathname string. In the usual case, dirname returns
+the string up to, but not including, the final '/', and basename
+is the component following the final '/'. Trailing '/' charac­
+ters are not counted as part of the pathname.
+
+If path does not contain a slash, dirname returns the string ".".
+
+Concatenating the string returned by dirname, a "/", and the basename
+yields a complete pathname.
+
+The return value is a copy of the directory component of the pathname.
+The copy is allocated from heap. It is the caller responsibility
+to free it after it is no longer needed.
+
+The following list of examples (taken from SUSv2) shows the strings
+returned by dirname and basename for different paths:
+
+ path dirname basename
+ "/usr/lib" "/usr" "lib"
+ "/usr/" "/" "usr"
+ "usr" "." "usr"
+ "/" "/" "/"
+ "." "." "."
+ ".." "." ".."
+*/
+
+char*
+os_file_dirname(
+/*============*/
+ /* out, own: directory component of the
+ pathname */
+ char* path); /* in: pathname */
+/********************************************************************
+Creates all missing subdirectories along the given path. */
+
+ibool
+os_file_create_subdirs_if_needed(
+/*=============================*/
+ /* out: TRUE if call succeeded
+ FALSE otherwise */
+ char* path); /* in: path name */
/****************************************************************************
Initializes the asynchronous io system. Creates separate aio array for
non-ibuf read and write, a third aio array for the ibuf i/o, with just one
diff --git a/innobase/include/os0proc.h b/innobase/include/os0proc.h
index 664952bd166..d0d3cf82e38 100644
--- a/innobase/include/os0proc.h
+++ b/innobase/include/os0proc.h
@@ -102,37 +102,6 @@ os_mem_alloc_nocache(
/*=================*/
/* out: allocated memory */
ulint n); /* in: number of bytes */
-#ifdef notdefined
-/********************************************************************
-Creates a new process. */
-
-ibool
-os_process_create(
-/*==============*/
- char* name, /* in: name of the executable to start
- or its full path name */
- char* cmd, /* in: command line for the starting
- process, or NULL if no command line
- specified */
- os_process_t* proc, /* out: handle to the process */
- os_process_id_t* id); /* out: process id */
-/**************************************************************************
-Exits a process. */
-
-void
-os_process_exit(
-/*============*/
- ulint code); /* in: exit code */
-/**************************************************************************
-Gets process exit code. */
-
-ibool
-os_process_get_exit_code(
-/*=====================*/
- /* out: TRUE if succeed, FALSE if fail */
- os_process_t proc, /* in: handle to the process */
- ulint* code); /* out: exit code */
-#endif
/********************************************************************
Sets the priority boost for threads released from waiting within the current
process. */
diff --git a/innobase/include/os0thread.h b/innobase/include/os0thread.h
index 554ca0563e4..6603229e524 100644
--- a/innobase/include/os0thread.h
+++ b/innobase/include/os0thread.h
@@ -99,13 +99,6 @@ os_thread_t
os_thread_get_curr(void);
/*====================*/
/*********************************************************************
-Waits for a thread to terminate. */
-
-void
-os_thread_wait(
-/*===========*/
- os_thread_t thread); /* in: thread to wait */
-/*********************************************************************
Advises the os to give up remainder of the thread's time slice. */
void
diff --git a/innobase/include/page0cur.h b/innobase/include/page0cur.h
index c3f0decdb4b..c85669ed4df 100644
--- a/innobase/include/page0cur.h
+++ b/innobase/include/page0cur.h
@@ -32,8 +32,11 @@ Created 10/4/1994 Heikki Tuuri
which extend it */
#define PAGE_CUR_DBG 6
-
+#ifdef PAGE_CUR_ADAPT
+# ifdef UNIV_SEARCH_PERF_STAT
extern ulint page_cur_short_succ;
+# endif /* UNIV_SEARCH_PERF_STAT */
+#endif /* PAGE_CUR_ADAPT */
/*************************************************************
Gets pointer to the page frame where the cursor is positioned. */
diff --git a/innobase/include/pars0pars.h b/innobase/include/pars0pars.h
index e08b071e246..8ff226ebbd0 100644
--- a/innobase/include/pars0pars.h
+++ b/innobase/include/pars0pars.h
@@ -21,7 +21,9 @@ extern int yydebug;
/* If the following is set TRUE, the lexer will print the SQL string
as it tokenizes it */
+#ifdef UNIV_SQL_DEBUG
extern ibool pars_print_lexed;
+#endif /* UNIV_SQL_DEBUG */
/* Global variable used while parsing a single procedure or query : the code is
NOT re-entrant */
@@ -390,41 +392,18 @@ pars_procedure_definition(
table */
sym_node_t* param_list, /* in: parameter declaration list */
que_node_t* stat_list); /* in: statement list */
-/*****************************************************************
-Reads stored procedure input parameter values from a buffer. */
-
-void
-pars_proc_read_input_params_from_buf(
-/*=================================*/
- que_t* graph, /* in: query graph which contains a stored procedure */
- byte* buf); /* in: buffer */
-/*****************************************************************
-Writes stored procedure output parameter values to a buffer. */
-ulint
-pars_proc_write_output_params_to_buf(
-/*=================================*/
- byte* buf, /* in: buffer which must be big enough */
- que_t* graph); /* in: query graph which contains a stored procedure */
/*****************************************************************
Parses a stored procedure call, when this is not within another stored
-procedure, that is, the client issues a procedure call directly. */
+procedure, that is, the client issues a procedure call directly.
+In MySQL/InnoDB, stored InnoDB procedures are invoked via the
+parsed procedure tree, not via InnoDB SQL, so this function is not used. */
que_fork_t*
pars_stored_procedure_call(
/*=======================*/
/* out: query graph */
sym_node_t* sym_node); /* in: stored procedure name */
-/*****************************************************************
-Writes info about query parameter markers (denoted with '?' in ODBC) into a
-buffer. */
-
-ulint
-pars_write_query_param_info(
-/*========================*/
- /* out: number of bytes used for info in buf */
- byte* buf, /* in: buffer which must be big enough */
- que_fork_t* graph); /* in: parsed query graph */
/**********************************************************************
Completes a query graph by adding query thread and fork nodes
above it and prepares the graph for running. The fork created is of
diff --git a/innobase/include/que0que.h b/innobase/include/que0que.h
index a3ed18e2b14..bcd7aed7e88 100644
--- a/innobase/include/que0que.h
+++ b/innobase/include/que0que.h
@@ -216,9 +216,7 @@ que_fork_start_command(
QUE_THR_RUNNING state, or NULL; the query
thread should be executed by que_run_threads
by the caller */
- que_fork_t* fork, /* in: a query fork */
- ulint command,/* in: command SESS_COMM_FETCH_NEXT, ... */
- ulint param); /* in: possible parameter to the command */
+ que_fork_t* fork); /* in: a query fork */
/***************************************************************************
Gets the trx of a query thread. */
UNIV_INLINE
@@ -309,22 +307,6 @@ 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 */
@@ -388,11 +370,6 @@ struct que_fork_struct{
sym_tab_t* sym_tab; /* symbol table of the query,
generated by the parser, or NULL
if the graph was created 'by hand' */
- ulint id; /* id of this query graph */
- ulint command; /* command currently executed in the
- graph */
- ulint param; /* possible command parameter */
-
/* The following cur_... fields are relevant only in a select graph */
ulint cur_end; /* QUE_CUR_NOT_DEFINED, QUE_CUR_START,
diff --git a/innobase/include/que0que.ic b/innobase/include/que0que.ic
index ae4ed10560f..a63922f8c80 100644
--- a/innobase/include/que0que.ic
+++ b/innobase/include/que0que.ic
@@ -238,21 +238,3 @@ 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/rem0cmp.ic b/innobase/include/rem0cmp.ic
index ebf513f538c..75cb3ef04e8 100644
--- a/innobase/include/rem0cmp.ic
+++ b/innobase/include/rem0cmp.ic
@@ -9,24 +9,6 @@ Created 7/1/1994 Heikki Tuuri
/*****************************************************************
This function is used to compare two data fields for which we know the
data type. */
-
-int
-cmp_data_data_slow(
-/*===============*/
- /* out: 1, 0, -1, if data1 is greater, equal,
- less than data2, respectively */
- dtype_t* cur_type,/* in: data type of the fields */
- byte* data1, /* in: data field (== a pointer to a memory
- buffer) */
- ulint len1, /* in: data field length or UNIV_SQL_NULL */
- byte* data2, /* in: data field (== a pointer to a memory
- buffer) */
- ulint len2); /* in: data field length or UNIV_SQL_NULL */
-
-
-/*****************************************************************
-This function is used to compare two data fields for which we know the
-data type. */
UNIV_INLINE
int
cmp_data_data(
diff --git a/innobase/include/row0ins.h b/innobase/include/row0ins.h
index a5b4b74e7fc..f3f0b7e8eca 100644
--- a/innobase/include/row0ins.h
+++ b/innobase/include/row0ins.h
@@ -145,10 +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 */
+};
/* Insert node types */
#define INS_SEARCHED 0 /* INSERT INTO ... SELECT ... */
diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h
index fade3709631..32a0c8b5d75 100644
--- a/innobase/include/row0mysql.h
+++ b/innobase/include/row0mysql.h
@@ -510,13 +510,15 @@ struct row_prebuilt_struct {
byte* ins_upd_rec_buff;/* buffer for storing data converted
to the Innobase format from the MySQL
format */
- ibool hint_no_need_to_fetch_extra_cols;
- /* normally this is TRUE, but
- MySQL will set this to FALSE
- if we might be required to fetch also
- other columns than mentioned in the
- query: the clustered index column(s),
- or an auto-increment column*/
+ ulint hint_need_to_fetch_extra_cols;
+ /* normally this is set to 0; if this
+ is set to ROW_RETRIEVE_PRIMARY_KEY,
+ then we should at least retrieve all
+ columns in the primary key; if this
+ is set to ROW_RETRIEVE_ALL_COLS, then
+ we must retrieve all columns in the
+ key (if read_just_key == 1), or all
+ columns in the table */
upd_node_t* upd_node; /* Innobase SQL update node used
to perform updates and deletes */
que_fork_t* ins_graph; /* Innobase SQL query graph used
@@ -572,6 +574,11 @@ struct row_prebuilt_struct {
#define ROW_MYSQL_DUMMY_TEMPLATE 3 /* dummy template used in
row_scan_and_check_index */
+/* Values for hint_need_to_fetch_extra_cols */
+#define ROW_RETRIEVE_PRIMARY_KEY 1
+#define ROW_RETRIEVE_ALL_COLS 2
+
+
#ifndef UNIV_NONINL
#include "row0mysql.ic"
#endif
diff --git a/innobase/include/row0row.h b/innobase/include/row0row.h
index d1befbbbad3..3956f3c1692 100644
--- a/innobase/include/row0row.h
+++ b/innobase/include/row0row.h
@@ -68,16 +68,6 @@ row_build_index_entry(
dict_index_t* index, /* in: index on the table */
mem_heap_t* heap); /* in: memory heap from which the memory for
the index entry is allocated */
-/*********************************************************************
-Builds an index entry from a row. */
-
-void
-row_build_index_entry_to_tuple(
-/*===========================*/
- dtuple_t* entry, /* in/out: index entry; the dtuple must have
- enough fields for the index! */
- dtuple_t* row, /* in: row */
- dict_index_t* index); /* in: index on the table */
/***********************************************************************
An inverse function to dict_row_build_index_entry. Builds a row from a
record in a clustered index. */
@@ -103,21 +93,6 @@ row_build(
mem_heap_t* heap); /* in: memory heap from which the memory
needed is allocated */
/***********************************************************************
-An inverse function to dict_row_build_index_entry. Builds a row from a
-record in a clustered index. */
-
-void
-row_build_to_tuple(
-/*===============*/
- dtuple_t* row, /* in/out: row built; see the NOTE below! */
- dict_index_t* index, /* in: clustered index */
- rec_t* rec); /* in: record in the clustered index;
- NOTE: the data fields in the row will point
- directly into this record, therefore,
- the buffer page of this record must be
- at least s-latched and the latch held
- as long as the row dtuple is used! */
-/***********************************************************************
Converts an index record to a typed data tuple. */
dtuple_t*
diff --git a/innobase/include/row0upd.h b/innobase/include/row0upd.h
index f5e0a88231f..687e90deee5 100644
--- a/innobase/include/row0upd.h
+++ b/innobase/include/row0upd.h
@@ -384,10 +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 */
+};
/* Node execution states */
#define UPD_NODE_SET_IX_LOCK 1 /* execution came to the node from
diff --git a/innobase/include/row0upd.ic b/innobase/include/row0upd.ic
index 1878431d1a4..6b9deeac5e3 100644
--- a/innobase/include/row0upd.ic
+++ b/innobase/include/row0upd.ic
@@ -107,8 +107,10 @@ row_upd_rec_sys_fields(
dulint roll_ptr)/* in: roll ptr of the undo log record */
{
ut_ad(index->type & DICT_CLUSTERED);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!buf_block_align(rec)->is_hashed
|| rw_lock_own(&btr_search_latch, RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
row_set_rec_trx_id(rec, index, trx->id);
row_set_rec_roll_ptr(rec, index, roll_ptr);
diff --git a/innobase/include/srv0srv.h b/innobase/include/srv0srv.h
index 6e47c468d26..8aac71de2a9 100644
--- a/innobase/include/srv0srv.h
+++ b/innobase/include/srv0srv.h
@@ -13,7 +13,6 @@ Created 10/10/1995 Heikki Tuuri
#include "univ.i"
#include "sync0sync.h"
#include "os0sync.h"
-#include "com0com.h"
#include "que0types.h"
#include "trx0types.h"
@@ -216,13 +215,7 @@ srv_boot(void);
/*==========*/
/* out: DB_SUCCESS or error code */
/*************************************************************************
-Initializes the server. */
-
-void
-srv_init(void);
-/*==========*/
-/*************************************************************************
-Frees the OS fast mutex created in srv_init(). */
+Frees the OS fast mutex created in srv_boot(). */
void
srv_free(void);
@@ -272,23 +265,6 @@ srv_master_thread(
/* out: a dummy parameter */
void* arg); /* in: a dummy parameter required by
os_thread_create */
-/*************************************************************************
-Reads a keyword and a value from a file. */
-
-ulint
-srv_read_init_val(
-/*==============*/
- /* out: DB_SUCCESS or error code */
- FILE* initfile, /* in: file pointer */
- char* keyword, /* in: keyword before value(s), or NULL if
- no keyword read */
- char* str_buf, /* in/out: buffer for a string value to read,
- buffer size must be 10000 bytes, if NULL
- then not read */
- ulint* num_val, /* out: numerical value to read, if NULL
- then not read */
- ibool print_not_err); /* in: if TRUE, then we will not print
- error messages to console */
/***********************************************************************
Tells the Innobase server that there has been activity in the database
and wakes up the master thread if it is suspended (not sleeping). Used
@@ -428,9 +404,6 @@ struct srv_sys_struct{
os_event_t operational; /* created threads must wait for the
server to become operational by
waiting for this event */
- com_endpoint_t* endpoint; /* the communication endpoint of the
- server */
-
srv_table_t* threads; /* server thread table */
UT_LIST_BASE_NODE_T(que_thr_t)
tasks; /* task queue */
diff --git a/innobase/include/srv0start.h b/innobase/include/srv0start.h
index 97a59fd14c7..0074de537c3 100644
--- a/innobase/include/srv0start.h
+++ b/innobase/include/srv0start.h
@@ -21,16 +21,6 @@ srv_normalize_path_for_win(
/*=======================*/
char* str); /* in/out: null-terminated character string */
/*************************************************************************
-Adds a slash or a backslash to the end of a string if it is missing
-and the string is not empty. */
-
-char*
-srv_add_path_separator_if_needed(
-/*=============================*/
- /* out, own: string which has the separator if the
- string is not empty */
- char* str); /* in: null-terminated character string */
-/*************************************************************************
Reads the data files and their sizes from a character string given in
the .cnf file. */
diff --git a/innobase/include/sync0rw.h b/innobase/include/sync0rw.h
index 5aa3dcdffc3..d71691b4353 100644
--- a/innobase/include/sync0rw.h
+++ b/innobase/include/sync0rw.h
@@ -25,13 +25,16 @@ smaller than 30 and the order of the numerical values like below! */
#define RW_NO_LATCH 3
typedef struct rw_lock_struct rw_lock_t;
+#ifdef UNIV_SYNC_DEBUG
typedef struct rw_lock_debug_struct rw_lock_debug_t;
+#endif /* UNIV_SYNC_DEBUG */
typedef UT_LIST_BASE_NODE_T(rw_lock_t) rw_lock_list_t;
extern rw_lock_list_t rw_lock_list;
extern mutex_t rw_lock_list_mutex;
+#ifdef UNIV_SYNC_DEBUG
/* The global mutex which protects debug info lists of all rw-locks.
To modify the debug info list of an rw-lock, this mutex has to be
@@ -42,6 +45,7 @@ extern os_event_t rw_lock_debug_event; /* If deadlock detection does
may wait for this event */
extern ibool rw_lock_debug_waiters; /* This is set to TRUE, if
there may be waiters for the event */
+#endif /* UNIV_SYNC_DEBUG */
extern ulint rw_s_system_call_count;
extern ulint rw_s_spin_wait_count;
@@ -327,6 +331,7 @@ ulint
rw_lock_get_reader_count(
/*=====================*/
rw_lock_t* lock);
+#ifdef UNIV_SYNC_DEBUG
/**********************************************************************
Checks if the thread has locked the rw-lock in the specified mode, with
the pass value == 0. */
@@ -337,6 +342,7 @@ rw_lock_own(
rw_lock_t* lock, /* in: rw-lock */
ulint lock_type); /* in: lock type: RW_LOCK_SHARED,
RW_LOCK_EX */
+#endif /* UNIV_SYNC_DEBUG */
/**********************************************************************
Checks if somebody has locked the rw-lock in the specified mode. */
@@ -346,6 +352,7 @@ rw_lock_is_locked(
rw_lock_t* lock, /* in: rw-lock */
ulint lock_type); /* in: lock type: RW_LOCK_SHARED,
RW_LOCK_EX */
+#ifdef UNIV_SYNC_DEBUG
/*******************************************************************
Prints debug info of an rw-lock. */
@@ -392,6 +399,7 @@ void
rw_lock_debug_print(
/*================*/
rw_lock_debug_t* info); /* in: debug struct */
+#endif /* UNIV_SYNC_DEBUG */
/* NOTE! The structure appears here only for the compiler to know its size.
Do not use its fields directly! The structure used in the spin lock
@@ -434,10 +442,12 @@ struct rw_lock_struct {
UT_LIST_NODE_T(rw_lock_t) list;
/* All allocated rw locks are put into a
list */
+#ifdef UNIV_SYNC_DEBUG
UT_LIST_BASE_NODE_T(rw_lock_debug_t) debug_list;
/* In the debug version: pointer to the debug
info list of the lock */
- ulint level; /* Debug version: level in the global latching
+#endif /* UNIV_SYNC_DEBUG */
+ ulint level; /* Level in the global latching
order; default SYNC_LEVEL_NONE */
char* cfile_name; /* File name where lock created */
ulint cline; /* Line where created */
@@ -450,6 +460,7 @@ struct rw_lock_struct {
#define RW_LOCK_MAGIC_N 22643
+#ifdef UNIV_SYNC_DEBUG
/* The structure for storing debug info of an rw-lock */
struct rw_lock_debug_struct {
@@ -464,6 +475,7 @@ struct rw_lock_debug_struct {
/* Debug structs are linked in a two-way
list */
};
+#endif /* UNIV_SYNC_DEBUG */
#ifndef UNIV_NONINL
#include "sync0rw.ic"
diff --git a/innobase/include/sync0rw.ic b/innobase/include/sync0rw.ic
index 36ef0a985ed..8fc93f4a9da 100644
--- a/innobase/include/sync0rw.ic
+++ b/innobase/include/sync0rw.ic
@@ -20,6 +20,7 @@ rw_lock_s_lock_spin(
be passed to another thread to unlock */
char* file_name,/* in: file name where lock requested */
ulint line); /* in: line where requested */
+#ifdef UNIV_SYNC_DEBUG
/**********************************************************************
Inserts the debug information for an rw-lock. */
@@ -40,7 +41,7 @@ rw_lock_remove_debug_info(
rw_lock_t* lock, /* in: rw-lock */
ulint pass, /* in: pass value */
ulint lock_type); /* in: lock type */
-
+#endif /* UNIV_SYNC_DEBUG */
/************************************************************************
Accessor functions for rw lock. */
@@ -132,19 +133,19 @@ rw_lock_s_lock_low(
char* file_name, /* in: file name where lock requested */
ulint line) /* in: line where requested */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(rw_lock_get_mutex(lock)));
-
+#endif /* UNIV_SYNC_DEBUG */
/* Check if the writer field is free */
if (lock->writer == RW_LOCK_NOT_LOCKED) {
/* Set the shared lock by incrementing the reader count */
lock->reader_count++;
- #ifdef UNIV_SYNC_DEBUG
+#ifdef UNIV_SYNC_DEBUG
rw_lock_add_debug_info(lock, pass, RW_LOCK_SHARED, file_name,
line);
- #endif
-
+#endif
lock->last_s_file_name = file_name;
lock->last_s_line = line;
@@ -175,9 +176,9 @@ rw_lock_s_lock_direct(
lock->last_s_file_name = file_name;
lock->last_s_line = line;
- #ifdef UNIV_SYNC_DEBUG
+#ifdef UNIV_SYNC_DEBUG
rw_lock_add_debug_info(lock, 0, RW_LOCK_SHARED, file_name, line);
- #endif
+#endif
}
/**********************************************************************
@@ -204,9 +205,9 @@ rw_lock_x_lock_direct(
lock->last_x_file_name = file_name;
lock->last_x_line = line;
- #ifdef UNIV_SYNC_DEBUG
+#ifdef UNIV_SYNC_DEBUG
rw_lock_add_debug_info(lock, 0, RW_LOCK_EX, file_name, line);
- #endif
+#endif
}
/**********************************************************************
@@ -236,7 +237,9 @@ rw_lock_s_lock_func(
the threads which have s-locked a latch. This would use some CPU
time. */
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!rw_lock_own(lock, RW_LOCK_SHARED)); /* see NOTE above */
+#endif /* UNIV_SYNC_DEBUG */
mutex_enter(rw_lock_get_mutex(lock));
@@ -275,10 +278,10 @@ rw_lock_s_lock_func_nowait(
/* Set the shared lock by incrementing the reader count */
lock->reader_count++;
- #ifdef UNIV_SYNC_DEBUG
+#ifdef UNIV_SYNC_DEBUG
rw_lock_add_debug_info(lock, 0, RW_LOCK_SHARED, file_name,
line);
- #endif
+#endif
lock->last_s_file_name = file_name;
lock->last_s_line = line;
@@ -320,9 +323,9 @@ rw_lock_x_lock_func_nowait(
lock->writer_count++;
lock->pass = 0;
- #ifdef UNIV_SYNC_DEBUG
+#ifdef UNIV_SYNC_DEBUG
rw_lock_add_debug_info(lock, 0, RW_LOCK_EX, file_name, line);
- #endif
+#endif
lock->last_x_file_name = file_name;
lock->last_x_line = line;
@@ -361,9 +364,9 @@ rw_lock_s_unlock_func(
ut_a(lock->reader_count > 0);
lock->reader_count--;
- #ifdef UNIV_SYNC_DEBUG
+#ifdef UNIV_SYNC_DEBUG
rw_lock_remove_debug_info(lock, pass, RW_LOCK_SHARED);
- #endif
+#endif
/* If there may be waiters and this was the last s-lock,
signal the object */
@@ -402,9 +405,9 @@ rw_lock_s_unlock_direct(
lock->reader_count--;
- #ifdef UNIV_SYNC_DEBUG
+#ifdef UNIV_SYNC_DEBUG
rw_lock_remove_debug_info(lock, 0, RW_LOCK_SHARED);
- #endif
+#endif
ut_ad(!lock->waiters);
ut_ad(rw_lock_validate(lock));
@@ -442,9 +445,9 @@ rw_lock_x_unlock_func(
rw_lock_set_writer(lock, RW_LOCK_NOT_LOCKED);
}
- #ifdef UNIV_SYNC_DEBUG
+#ifdef UNIV_SYNC_DEBUG
rw_lock_remove_debug_info(lock, pass, RW_LOCK_EX);
- #endif
+#endif
/* If there may be waiters, signal the lock */
if (lock->waiters && (lock->writer_count == 0)) {
@@ -486,9 +489,9 @@ rw_lock_x_unlock_direct(
rw_lock_set_writer(lock, RW_LOCK_NOT_LOCKED);
}
- #ifdef UNIV_SYNC_DEBUG
+#ifdef UNIV_SYNC_DEBUG
rw_lock_remove_debug_info(lock, 0, RW_LOCK_EX);
- #endif
+#endif
ut_ad(!lock->waiters);
ut_ad(rw_lock_validate(lock));
diff --git a/innobase/include/sync0sync.h b/innobase/include/sync0sync.h
index 330b6b77b08..3a7203bbb56 100644
--- a/innobase/include/sync0sync.h
+++ b/innobase/include/sync0sync.h
@@ -185,6 +185,7 @@ sync_thread_levels_empty_gen(
allowed to be owned by the thread,
also purge_is_running mutex is
allowed */
+#ifdef UNIV_SYNC_DEBUG
/**********************************************************************
Checks that the current thread owns the mutex. Works only
in the debug version. */
@@ -217,6 +218,7 @@ Prints debug info of currently reserved mutexes. */
void
mutex_list_print_info(void);
/*========================*/
+#endif /* UNIV_SYNC_DEBUG */
/**********************************************************************
NOT to be used outside this module except in debugging! Gets the value
of the lock word. */
@@ -225,6 +227,7 @@ ulint
mutex_get_lock_word(
/*================*/
mutex_t* mutex); /* in: mutex */
+#ifdef UNIV_SYNC_DEBUG
/**********************************************************************
NOT to be used outside this module except in debugging! Gets the waiters
field in a mutex. */
@@ -234,15 +237,7 @@ mutex_get_waiters(
/*==============*/
/* out: value to set */
mutex_t* mutex); /* in: mutex */
-/**********************************************************************
-Implements the memory barrier operation which makes a serialization point to
-the instruction flow. This is needed because the Pentium may speculatively
-execute reads before preceding writes are committed. We could also use here
-any LOCKed instruction (see Intel Software Dev. Manual, Vol. 3). */
-
-void
-mutex_fence(void);
-/*=============*/
+#endif /* UNIV_SYNC_DEBUG */
/*
LATCHING ORDER WITHIN THE DATABASE
@@ -451,13 +446,13 @@ struct mutex_struct {
Otherwise, this is 0. */
UT_LIST_NODE_T(mutex_t) list; /* All allocated mutexes are put into
a list. Pointers to the next and prev. */
+#ifdef UNIV_SYNC_DEBUG
+ const char* file_name; /* File where the mutex was locked */
+ ulint line; /* Line where the mutex was locked */
os_thread_id_t thread_id; /* Debug version: The thread id of the
thread which locked the mutex. */
- char* file_name; /* Debug version: File name where the mutex
- was locked */
- ulint line; /* Debug version: Line where the mutex was
- locked */
- ulint level; /* Debug version: level in the global latching
+#endif /* UNIV_SYNC_DEBUG */
+ ulint level; /* Level in the global latching
order; default SYNC_LEVEL_NONE */
char* cfile_name; /* File name where mutex created */
ulint cline; /* Line where created */
diff --git a/innobase/include/sync0sync.ic b/innobase/include/sync0sync.ic
index c11cc0d196e..758c8524f66 100644
--- a/innobase/include/sync0sync.ic
+++ b/innobase/include/sync0sync.ic
@@ -25,6 +25,7 @@ mutex_spin_wait(
mutex_t* mutex, /* in: pointer to mutex */
char* file_name,/* in: file name where mutex requested */
ulint line); /* in: line where requested */
+#ifdef UNIV_SYNC_DEBUG
/**********************************************************************
Sets the debug information for a reserved mutex. */
@@ -34,6 +35,7 @@ mutex_set_debug_info(
mutex_t* mutex, /* in: mutex */
char* file_name, /* in: file where requested */
ulint line); /* in: line where requested */
+#endif /* UNIV_SYNC_DEBUG */
/**********************************************************************
Releases the threads waiting in the primary wait array for this mutex. */
@@ -200,9 +202,9 @@ mutex_exit(
/*=======*/
mutex_t* mutex) /* in: pointer to mutex */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(mutex));
-#ifdef UNIV_SYNC_DEBUG
mutex->thread_id = ULINT_UNDEFINED;
sync_thread_reset_level(mutex);
@@ -249,14 +251,9 @@ mutex_enter_func(
the atomic test_and_set; we could peek, and possibly save time. */
if (!mutex_test_and_set(mutex)) {
-
- #ifdef UNIV_SYNC_DEBUG
+#ifdef UNIV_SYNC_DEBUG
mutex_set_debug_info(mutex, file_name, line);
- #endif
-
- mutex->file_name = file_name;
- mutex->line = line;
-
+#endif
return; /* Succeeded! */
}
diff --git a/innobase/include/trx0rseg.ic b/innobase/include/trx0rseg.ic
index 6b242b66c09..35e927f5e79 100644
--- a/innobase/include/trx0rseg.ic
+++ b/innobase/include/trx0rseg.ic
@@ -24,7 +24,9 @@ trx_rsegf_get(
header = TRX_RSEG + buf_page_get(space, page_no, RW_X_LATCH, mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(header, SYNC_RSEG_HEADER);
+#endif /* UNIV_SYNC_DEBUG */
return(header);
}
@@ -45,7 +47,9 @@ trx_rsegf_get_new(
header = TRX_RSEG + buf_page_get(space, page_no, RW_X_LATCH, mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(header, SYNC_RSEG_HEADER_NEW);
+#endif /* UNIV_SYNC_DEBUG */
return(header);
}
@@ -64,7 +68,7 @@ trx_rsegf_get_nth_undo(
if (n >= TRX_RSEG_N_SLOTS) {
fprintf(stderr,
"InnoDB: Error: trying to get slot %lu of rseg\n", (unsigned long) n);
- ut_a(0);
+ ut_error;
}
return(mtr_read_ulint(rsegf + TRX_RSEG_UNDO_SLOTS +
@@ -85,7 +89,7 @@ trx_rsegf_set_nth_undo(
if (n >= TRX_RSEG_N_SLOTS) {
fprintf(stderr,
"InnoDB: Error: trying to set slot %lu of rseg\n", (unsigned long) n);
- ut_a(0);
+ ut_error;
}
mlog_write_ulint(rsegf + TRX_RSEG_UNDO_SLOTS + n * TRX_RSEG_SLOT_SIZE,
diff --git a/innobase/include/trx0sys.ic b/innobase/include/trx0sys.ic
index 343e6d7c2fa..8f455e554ea 100644
--- a/innobase/include/trx0sys.ic
+++ b/innobase/include/trx0sys.ic
@@ -60,7 +60,9 @@ trx_sys_get_nth_rseg(
trx_sys_t* sys, /* in: trx system */
ulint n) /* in: index of slot */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(kernel_mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(n < TRX_SYS_N_RSEGS);
return(sys->rseg_array[n]);
@@ -98,7 +100,9 @@ trx_sysf_get(
header = TRX_SYS + buf_page_get(TRX_SYS_SPACE, TRX_SYS_PAGE_NO,
RW_X_LATCH, mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(header, SYNC_TRX_SYS_HEADER);
+#endif /* UNIV_SYNC_DEBUG */
return(header);
}
@@ -115,7 +119,9 @@ trx_sysf_rseg_get_space(
ulint i, /* in: slot index == rseg id */
mtr_t* mtr) /* in: mtr */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(kernel_mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(sys_header);
ut_ad(i < TRX_SYS_N_RSEGS);
@@ -138,7 +144,9 @@ trx_sysf_rseg_get_page_no(
mtr_t* mtr) /* in: mtr */
{
ut_ad(sys_header);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(kernel_mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(i < TRX_SYS_N_RSEGS);
return(mtr_read_ulint(sys_header + TRX_SYS_RSEGS
@@ -158,7 +166,9 @@ trx_sysf_rseg_set_space(
ulint space, /* in: space id */
mtr_t* mtr) /* in: mtr */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(kernel_mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(sys_header);
ut_ad(i < TRX_SYS_N_RSEGS);
@@ -182,7 +192,9 @@ trx_sysf_rseg_set_page_no(
slot is reset to unused */
mtr_t* mtr) /* in: mtr */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(kernel_mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(sys_header);
ut_ad(i < TRX_SYS_N_RSEGS);
@@ -236,7 +248,9 @@ trx_get_on_id(
{
trx_t* trx;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(kernel_mutex)));
+#endif /* UNIV_SYNC_DEBUG */
trx = UT_LIST_GET_FIRST(trx_sys->trx_list);
@@ -266,7 +280,9 @@ trx_list_get_min_trx_id(void)
{
trx_t* trx;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(kernel_mutex)));
+#endif /* UNIV_SYNC_DEBUG */
trx = UT_LIST_GET_LAST(trx_sys->trx_list);
@@ -289,7 +305,9 @@ trx_is_active(
{
trx_t* trx;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(kernel_mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (ut_dulint_cmp(trx_id, trx_list_get_min_trx_id()) < 0) {
@@ -325,7 +343,9 @@ trx_sys_get_new_trx_id(void)
{
dulint id;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
/* VERY important: after the database is started, max_trx_id value is
divisible by TRX_SYS_TRX_ID_WRITE_MARGIN, and the following if
@@ -355,7 +375,9 @@ trx_sys_get_new_trx_no(void)
/*========================*/
/* out: new, allocated trx number */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
return(trx_sys_get_new_trx_id());
}
diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h
index 6b08b674db8..d9b91ee62dc 100644
--- a/innobase/include/trx0trx.h
+++ b/innobase/include/trx0trx.h
@@ -203,13 +203,9 @@ trx_sig_send(
ulint type, /* in: signal type */
ulint sender, /* in: TRX_SIG_SELF or
TRX_SIG_OTHER_SESS */
- ibool reply, /* in: TRUE if the sender of the signal
- wants reply after the operation induced
- by the signal is completed; if type
- is TRX_SIG_END_WAIT, this must be
- FALSE */
que_thr_t* receiver_thr, /* in: query thread which wants the
- reply, or NULL */
+ reply, or NULL; if type is
+ TRX_SIG_END_WAIT, this must be NULL */
trx_savept_t* savept, /* in: possible rollback savepoint, or
NULL */
que_thr_t** next_thr); /* in/out: next query thread to run;
@@ -225,7 +221,6 @@ been handled. */
void
trx_sig_reply(
/*==========*/
- trx_t* trx, /* in: trx handle */
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
@@ -297,15 +292,9 @@ struct trx_sig_struct{
TRX_SIG_BEING_HANDLED */
ulint sender; /* TRX_SIG_SELF or
TRX_SIG_OTHER_SESS */
- ibool reply; /* TRUE if the sender of the signal
+ que_thr_t* receiver; /* non-NULL if the sender of the signal
wants reply after the operation induced
- by the signal is completed; if this
- field is TRUE and the receiver field
- below is NULL, then a SUCCESS message
- is sent to the client of the session
- to which this trx belongs */
- que_thr_t* receiver; /* query thread which wants the reply,
- or NULL */
+ by the signal is completed */
trx_savept_t savept; /* possible rollback savepoint */
UT_LIST_NODE_T(trx_sig_t)
signals; /* queue of pending signals to the
diff --git a/innobase/include/trx0undo.h b/innobase/include/trx0undo.h
index 7f0378c68d3..20002076cc3 100644
--- a/innobase/include/trx0undo.h
+++ b/innobase/include/trx0undo.h
@@ -251,20 +251,6 @@ trx_undo_update_cleanup(
page_t* undo_page, /* in: update undo log header page,
x-latched */
mtr_t* mtr); /* in: mtr */
-/**************************************************************************
-Discards an undo log and puts the segment to the list of cached update undo
-log segments. This optimized function is called if there is no need to
-keep the update undo log because there exist no read views and the transaction
-made no delete markings, which would make purge necessary. We restrict this
-to undo logs of size 1 to make things simpler. */
-
-dulint
-trx_undo_update_cleanup_by_discard(
-/*===============================*/
- /* out: log sequence number at which mtr is
- committed */
- trx_t* trx, /* in: trx owning the update undo log */
- mtr_t* mtr); /* in: mtr */
/**********************************************************************
Frees or caches an insert undo log after a transaction commit or rollback.
Knowledge of inserts is not needed after a commit or rollback, therefore
diff --git a/innobase/include/trx0undo.ic b/innobase/include/trx0undo.ic
index bedbc02b00b..a04b234b495 100644
--- a/innobase/include/trx0undo.ic
+++ b/innobase/include/trx0undo.ic
@@ -126,7 +126,9 @@ trx_undo_page_get(
page = buf_page_get(space, page_no, RW_X_LATCH, mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_TRX_UNDO_PAGE);
+#endif /* UNIV_SYNC_DEBUG */
return(page);
}
@@ -146,7 +148,9 @@ trx_undo_page_get_s_latched(
page = buf_page_get(space, page_no, RW_S_LATCH, mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_TRX_UNDO_PAGE);
+#endif /* UNIV_SYNC_DEBUG */
return(page);
}
diff --git a/innobase/include/univold.i b/innobase/include/univold.i
deleted file mode 100644
index 8bcd28e180f..00000000000
--- a/innobase/include/univold.i
+++ /dev/null
@@ -1,164 +0,0 @@
-/***************************************************************************
-Version control for database, common definitions, and include files
-
-(c) 1994 - 2000 Innobase Oy
-
-Created 1/20/1994 Heikki Tuuri
-****************************************************************************/
-
-#ifndef univ_i
-#define univ_i
-
-#define UNIV_INTEL
-#define UNIV_PENTIUM
-/* If UNIV_WINNT is not defined, we assume Windows 95 */
-
-#define UNIV_WINNT
-#define UNIV_WINNT4
-#define __NT__
-
-#define UNIV_VISUALC
-
-#define __WIN__
-#define _WIN32_WINNT 0x0400
-
-/* DEBUG VERSION CONTROL
- ===================== */
-/* Make a non-inline debug version */
-/*
-#define UNIV_DEBUG
-#define UNIV_MEM_DEBUG
-#define UNIV_SYNC_DEBUG
-#define UNIV_SEARCH_DEBUG
-
-#define UNIV_IBUF_DEBUG
-
-#define UNIV_SEARCH_PERF_STAT
-#define UNIV_SYNC_PERF_STAT
-*/
-#define UNIV_LIGHT_MEM_DEBUG
-
-#define YYDEBUG 1
-/*
-#define UNIV_SQL_DEBUG
-#define UNIV_LOG_DEBUG
-*/
- /* the above option prevents forcing of log to disk
- at a buffer page write: it should be tested with this
- option off; also some ibuf tests are suppressed */
-/*
-#define UNIV_BASIC_LOG_DEBUG
-*/
- /* the above option enables basic recovery debugging:
- new allocated file pages are reset */
-
-/* The debug version is slower, thus we may change the length of test loops
-depending on the UNIV_DBC parameter */
-#ifdef UNIV_DEBUG
-#define UNIV_DBC 1
-#else
-#define UNIV_DBC 100
-#endif
-
-#ifndef UNIV_DEBUG
-/* Definition for inline version */
-
-#ifdef UNIV_VISUALC
-#define UNIV_INLINE __inline
-#elif defined(UNIV_GNUC)
-#define UNIV_INLINE extern __inline__
-#endif
-
-#else
-/* If we want to compile a noninlined version we use the following macro
-definitions: */
-
-#define UNIV_NONINL
-#define UNIV_INLINE
-
-#endif /* UNIV_DEBUG */
-/* If the compiler does not know inline specifier, we use: */
-/*
-#define UNIV_INLINE static
-*/
-
-
-/*
- MACHINE VERSION CONTROL
- =======================
-*/
-
-#ifdef UNIV_PENTIUM
-
-/* In a 32-bit computer word size is 4 */
-#define UNIV_WORD_SIZE 4
-
-/* The following alignment is used in memory allocations in memory heap
-management to ensure correct alignment for doubles etc. */
-#define UNIV_MEM_ALIGNMENT 8
-
-/* The following alignment is used in aligning lints etc. */
-#define UNIV_WORD_ALIGNMENT UNIV_WORD_SIZE
-
-#endif
-
-/*
- DATABASE VERSION CONTROL
- ========================
-*/
-
-/* The universal page size of the database */
-#define UNIV_PAGE_SIZE (2 * 8192)/* NOTE! Currently, this has to be a
- power of 2 and divisible by
- UNIV_MEM_ALIGNMENT */
-
-/* Do non-buffered io in buffer pool read/write operations */
-#define UNIV_NON_BUFFERED_IO
-
-/* Maximum number of parallel threads in a parallelized operation */
-#define UNIV_MAX_PARALLELISM 32
-
-/*
- UNIVERSAL TYPE DEFINITIONS
- ==========================
-*/
-
-
-typedef unsigned char byte;
-
-/* An other basic type we use is unsigned long integer which is intended to be
-equal to the word size of the machine. */
-
-typedef unsigned long int ulint;
-
-typedef long int lint;
-
-/* The following type should be at least a 64-bit floating point number */
-typedef double utfloat;
-
-/* The 'undefined' value for a ulint */
-#define ULINT_UNDEFINED ((ulint)(-1))
-
-/* The undefined 32-bit unsigned integer */
-#define ULINT32_UNDEFINED 0xFFFFFFFF
-
-/* Maximum value for a ulint */
-#define ULINT_MAX ((ulint)(-2))
-
-
-/* Definition of the boolean type */
-typedef ulint bool;
-
-#define TRUE 1
-#define FALSE 0
-
-/* The following number as the length of a logical field means that the field
-has the SQL NULL as its value. */
-#define UNIV_SQL_NULL ULINT_UNDEFINED
-
-#include <stdio.h>
-#include "ut0dbg.h"
-#include "ut0ut.h"
-#include "db0err.h"
-
-#endif
diff --git a/innobase/include/univoldmysql.i b/innobase/include/univoldmysql.i
deleted file mode 100644
index 269b584d073..00000000000
--- a/innobase/include/univoldmysql.i
+++ /dev/null
@@ -1,181 +0,0 @@
-/***************************************************************************
-Version control for database, common definitions, and include files
-
-(c) 1994 - 1996 Innobase Oy
-
-Created 1/20/1994 Heikki Tuuri
-****************************************************************************/
-
-#ifndef univ_i
-#define univ_i
-
-#define UNIV_INTEL
-#define UNIV_PENTIUM
-/* If UNIV_WINNT is not defined, we assume Windows 95 */
-
-#define UNIV_WINNT
-#define UNIV_WINNT4
-
-#define UNIV_VISUALC
-
-/* DEBUG VERSION CONTROL
- ===================== */
-/* Make a profiler version where mutex_fence does not use CPUID and therefore
-is not totally safe. The sync-library must be recompiled before profiling. */
-/*
-#define UNIV_PROFILE
-*/
-/* When the following flag is defined, also mutex lock word reset to 0
-in mutex_exit is performed using a serializing instruction, which does not
-allow speculative reads be performed before memory writes */
-/*
-#define SYNC_SERIALIZE_MUTEX_RESET
-*/
-/* Make a non-inline debug version */
-
-#define UNIV_DEBUG
-#define UNIV_MEM_DEBUG
-#define UNIV_SYNC_DEBUG
-#define UNIV_SEARCH_DEBUG
-
-#define UNIV_IBUF_DEBUG
-
-#define UNIV_SEARCH_PERF_STAT
-#define UNIV_SYNC_PERF_STAT
-
-
-#define UNIV_LIGHT_MEM_DEBUG
-
-#define YYDEBUG 1
-/*
-#define UNIV_SQL_DEBUG
-#define UNIV_LOG_DEBUG
-*/
- /* the above option prevents forcing of log to disk
- at a buffer page write: it should be tested with this
- option off; also some ibuf tests are suppressed */
-/*
-#define UNIV_BASIC_LOG_DEBUG
-*/
- /* the above option enables basic recovery debugging:
- new allocated file pages are reset */
-
-/* The debug version is slower, thus we may change the length of test loops
-depending on the UNIV_DBC parameter */
-#ifdef UNIV_DEBUG
-#define UNIV_DBC 1
-#else
-#define UNIV_DBC 100
-#endif
-
-#ifndef UNIV_DEBUG
-/* Definition for inline version */
-
-#ifdef UNIV_VISUALC
-#define UNIV_INLINE __inline
-#elif defined(UNIV_GNUC)
-#define UNIV_INLINE extern __inline__
-#endif
-
-#else
-/* If we want to compile a noninlined version we use the following macro
-definitions: */
-
-#define UNIV_NONINL
-#define UNIV_INLINE
-
-#endif /* UNIV_DEBUG */
-/* If the compiler does not know inline specifier, we use: */
-/*
-#define UNIV_INLINE static
-*/
-
-
-/*
- MACHINE VERSION CONTROL
- =======================
-*/
-
-#ifdef UNIV_PENTIUM
-
-/* In a 32-bit computer word size is 4 */
-#define UNIV_WORD_SIZE 4
-
-/* The following alignment is used in memory allocations in memory heap
-management to ensure correct alignment for doubles etc. */
-#define UNIV_MEM_ALIGNMENT 8
-
-/* The following alignment is used in aligning lints etc. */
-#define UNIV_WORD_ALIGNMENT UNIV_WORD_SIZE
-
-#endif
-
-/*
- DATABASE VERSION CONTROL
- ========================
-*/
-
-/* The universal page size of the database */
-#define UNIV_PAGE_SIZE 8192 /* NOTE! Currently, this has to be a
- power of 2 and divisible by
- UNIV_MEM_ALIGNMENT */
-/* 2-based logarithm of UNIV_PAGE_SIZE */
-#define UNIV_PAGE_SIZE_SHIFT 13
-
-/* Do asynchronous io in buffer pool read/write operations */
-#ifdef UNIV_WINNT
-#define UNIV_ASYNC_IO
-#endif
-
-/* Do non-buffered io in buffer pool read/write operations */
-#define UNIV_NON_BUFFERED_IO
-
-/* Maximum number of parallel threads in a parallelized operation */
-#define UNIV_MAX_PARALLELISM 32
-
-/*
- UNIVERSAL TYPE DEFINITIONS
- ==========================
-*/
-
-/*
-typedef unsigned char byte;
-*/
-
-/* An other basic type we use is unsigned long integer which is intended to be
-equal to the word size of the machine. */
-
-typedef unsigned long int ulint;
-
-typedef long int lint;
-
-/* The following type should be at least a 64-bit floating point number */
-typedef double utfloat;
-
-/* The 'undefined' value for a ulint */
-#define ULINT_UNDEFINED ((ulint)(-1))
-
-/* The undefined 32-bit unsigned integer */
-#define ULINT32_UNDEFINED 0xFFFFFFFF
-
-/* Maximum value for a ulint */
-#define ULINT_MAX ((ulint)(-2))
-
-/* Definition of the boolean type */
-#ifndef bool
-typedef ulint bool;
-#endif
-
-#define TRUE 1
-#define FALSE 0
-
-/* The following number as the length of a logical field means that the field
-has the SQL NULL as its value. */
-#define UNIV_SQL_NULL ULINT_UNDEFINED
-
-#include <stdio.h>
-#include "ut0dbg.h"
-#include "ut0ut.h"
-#include "db0err.h"
-
-#endif
diff --git a/innobase/include/usr0sess.h b/innobase/include/usr0sess.h
index 365f828ecfc..c7bcfb20fed 100644
--- a/innobase/include/usr0sess.h
+++ b/innobase/include/usr0sess.h
@@ -11,7 +11,6 @@ Created 6/25/1996 Heikki Tuuri
#include "univ.i"
#include "ut0byte.h"
-#include "hash0hash.h"
#include "trx0types.h"
#include "srv0srv.h"
#include "trx0types.h"
@@ -19,74 +18,14 @@ Created 6/25/1996 Heikki Tuuri
#include "que0types.h"
#include "data0data.h"
#include "rem0rec.h"
-#include "com0com.h"
-/* The session system global data structure */
-extern sess_sys_t* sess_sys;
-
-/*************************************************************************
-Sets the session id in a client message. */
-
-void
-sess_cli_msg_set_sess(
-/*==================*/
- byte* str, /* in/out: message string */
- dulint sess_id);/* in: session id */
-/***************************************************************************
-Sets the message type of a message from the client. */
-UNIV_INLINE
-void
-sess_cli_msg_set_type(
-/*==================*/
- byte* str, /* in: message string */
- ulint type); /* in: message type */
-/***************************************************************************
-Gets the message type of a message from the server. */
-UNIV_INLINE
-ulint
-sess_srv_msg_get_type(
-/*==================*/
- /* out: message type */
- byte* str); /* in: message string */
-/***************************************************************************
-Creates a session sytem at database start. */
-
-void
-sess_sys_init_at_db_start(void);
-/*===========================*/
/*************************************************************************
Opens a session. */
sess_t*
-sess_open(
-/*======*/
+sess_open(void);
+/*============*/
/* out, own: session object */
- com_endpoint_t* endpoint, /* in: communication endpoint used
- for communicating with the client */
- byte* addr_buf, /* in: client address */
- ulint addr_len); /* in: client address length */
-/*************************************************************************
-Closes a session, freeing the memory occupied by it. */
-
-void
-sess_close(
-/*=======*/
- sess_t* sess); /* in, own: session object */
-/*************************************************************************
-Raises an SQL error. */
-
-void
-sess_raise_error_low(
-/*=================*/
- trx_t* trx, /* in: transaction */
- ulint err_no, /* in: error number */
- ulint type, /* in: more info of the error, or 0 */
- dict_table_t* table, /* in: dictionary table or NULL */
- dict_index_t* index, /* in: table index or NULL */
- dtuple_t* tuple, /* in: tuple to insert or NULL */
- rec_t* rec, /* in: record or NULL */
- char* err_str);/* in: arbitrary null-terminated error string,
- or NULL */
/*************************************************************************
Closes a session, freeing the memory occupied by it, if it is in a state
where it should be closed. */
@@ -96,221 +35,25 @@ sess_try_close(
/*===========*/
/* out: TRUE if closed */
sess_t* sess); /* in, own: session object */
-/*************************************************************************
-Initializes the first fields of a message to client. */
-
-void
-sess_srv_msg_init(
-/*==============*/
- sess_t* sess, /* in: session object */
- byte* buf, /* in: message buffer, must be at least of size
- SESS_SRV_MSG_DATA */
- ulint type); /* in: message type */
-/*************************************************************************
-Sends a simple message to client. */
-
-void
-sess_srv_msg_send_simple(
-/*=====================*/
- sess_t* sess, /* in: session object */
- ulint type, /* in: message type */
- ulint rel_kernel); /* in: SESS_RELEASE_KERNEL or
- SESS_NOT_RELEASE_KERNEL */
-/***************************************************************************
-Processes a message from a client. NOTE: May release the kernel mutex
-temporarily. */
-
-void
-sess_receive_msg_rel_kernel(
-/*========================*/
- sess_t* sess, /* in: session */
- byte* str, /* in: message string */
- ulint len); /* in: message length */
-/***************************************************************************
-When a command has been completed, this function sends the message about it
-to the client. */
-
-void
-sess_command_completed_message(
-/*===========================*/
- sess_t* sess, /* in: session */
- byte* msg, /* in: message buffer */
- ulint len); /* in: message data length */
-/***********************************************************************
-Starts a new connection and a session, or starts a query based on a client
-message. This is called by a SRV_COM thread. */
-
-void
-sess_process_cli_msg(
-/*=================*/
- byte* str, /* in: message string */
- ulint len, /* in: string length */
- byte* addr, /* in: address string */
- ulint alen); /* in: address length */
-
/* The session handle. All fields are protected by the kernel mutex */
struct sess_struct{
- dulint id; /* session id */
- dulint usr_id; /* user id */
- hash_node_t hash; /* hash chain node */
- ulint refer_count; /* reference count to the session
- object: when this drops to zero
- and the session has no query graphs
- left, discarding the session object
- is allowed */
- dulint error_count; /* if this counter has increased while
- a thread is parsing an SQL command,
- its graph should be discarded */
- ibool disconnecting; /* TRUE if the session is to be
- disconnected when its reference
- count drops to 0 */
ulint state; /* state of the session */
- dulint msgs_sent; /* count of messages sent to the
- client */
- dulint msgs_recv; /* count of messages received from the
- client */
- ibool client_waits; /* when the session receives a message
- from the client, this set to TRUE, and
- when the session sends a message to
- the client this is set to FALSE */
trx_t* trx; /* transaction object permanently
assigned for the session: the
transaction instance designated by the
trx id changes, but the memory
structure is preserved */
- ulint next_graph_id; /* next query graph id to assign */
UT_LIST_BASE_NODE_T(que_t)
graphs; /* query graphs belonging to this
session */
- /*------------------------------*/
- ulint err_no; /* latest error number, 0 if none */
- char* err_str; /* latest error string */
- ulint err_len; /* error string length */
- /*------------------------------*/
- com_endpoint_t* endpoint; /* server communications endpoint used
- to communicate with the client */
- char* addr_buf; /* client address string */
- ulint addr_len; /* client address string length */
- /*------------------------------*/
- byte* big_msg; /* if the client sends a message which
- does not fit in a single packet,
- it is assembled in this buffer; if
- this field is not NULL, it is assumed
- that the message should be catenated
- here */
- ulint big_msg_size; /* size of the big message buffer */
- ulint big_msg_len; /* length of data in the big message
- buffer */
-};
-
-/* The session system; this is protected by the kernel mutex */
-struct sess_sys_struct{
- ulint state; /* state of the system:
- SESS_SYS_RUNNING or
- SESS_SYS_SHUTTING_DOWN */
- sess_t* shutdown_req; /* if shutdown was requested by some
- session, confirmation of shutdown
- completion should be sent to this
- session */
- dulint free_sess_id; /* first unused session id */
- hash_table_t* hash; /* hash table of the sessions */
};
-
-/*---------------------------------------------------*/
-/* The format of an incoming message from a client */
-#define SESS_CLI_MSG_CHECKSUM 0 /* the checksum should be the first
- field in the message */
-#define SESS_CLI_MSG_SESS_ID 4 /* this is set to 0 if the client
- wants to connect and establish
- a new session */
-#define SESS_CLI_MSG_SESS_ID_CHECK 12 /* checksum of the sess id field */
-#define SESS_CLI_MSG_TYPE 16
-#define SESS_CLI_MSG_NO 20
-#define SESS_CLI_MSG_CONTINUE 28 /* 0, or SESS_MSG_FIRST_PART
- SESS_MSG_MIDDLE_PART, or
- SESS_MSG_LAST_PART */
-#define SESS_CLI_MSG_CONT_SIZE 32 /* size of a multipart message in
- kilobytes (rounded upwards) */
-#define SESS_CLI_MSG_DATA 36
-/*---------------------------------------------------*/
-
-/* Client-to-session message types */
-#define SESS_CLI_CONNECT 1
-#define SESS_CLI_PREPARE 2
-#define SESS_CLI_EXECUTE 3
-#define SESS_CLI_BREAK_EXECUTION 4
-
-/* Client-to-session statement command types */
-#define SESS_COMM_FETCH_NEXT 1
-#define SESS_COMM_FETCH_PREV 2
-#define SESS_COMM_FETCH_FIRST 3
-#define SESS_COMM_FETCH_LAST 4
-#define SESS_COMM_FETCH_NTH 5
-#define SESS_COMM_FETCH_NTH_LAST 6
-#define SESS_COMM_EXECUTE 7
-#define SESS_COMM_NO_COMMAND 8
-
-/*---------------------------------------------------*/
-/* The format of an outgoing message from a session to the client */
-#define SESS_SRV_MSG_CHECKSUM 0 /* the checksum should be the first
- field in the message */
-#define SESS_SRV_MSG_SESS_ID 4
-#define SESS_SRV_MSG_TYPE 12
-#define SESS_SRV_MSG_NO 16
-#define SESS_SRV_MSG_CONTINUE 24 /* 0, or SESS_MSG_FIRST_PART
- SESS_MSG_MIDDLE_PART, or
- SESS_MSG_LAST_PART */
-#define SESS_SRV_MSG_CONT_SIZE 28 /* size of a multipart message
- in kilobytes (rounded upward) */
-#define SESS_SRV_MSG_DATA 32
-/*---------------------------------------------------*/
-
-/* Session-to-client message types */
-#define SESS_SRV_ACCEPT_CONNECT 1
-#define SESS_SRV_SUCCESS 2
-#define SESS_SRV_ERROR 3
-
-/* Multipart messages */
-#define SESS_MSG_SINGLE_PART 0
-#define SESS_MSG_FIRST_PART 1
-#define SESS_MSG_MIDDLE_PART 2
-#define SESS_MSG_LAST_PART 3
-
-/* Error numbers */
-#define SESS_ERR_NONE 0
-#define SESS_ERR_TRX_COMMITTED 1
-#define SESS_ERR_TRX_ROLLED_BACK 2
-#define SESS_ERR_SESSION_DISCONNECTED 3
-#define SESS_ERR_REPLY_FAILED 4
-#define SESS_ERR_CANNOT_BREAK_OP 5
-#define SESS_ERR_MSG_LOST 6
-#define SESS_ERR_MSG_CORRUPTED 7
-#define SESS_ERR_EXTRANEOUS_MSG 8
-#define SESS_ERR_OUT_OF_MEMORY 9
-#define SESS_ERR_SQL_ERROR 10
-#define SESS_ERR_STMT_NOT_FOUND 11
-#define SESS_ERR_STMT_NOT_READY 12
-#define SESS_ERR_EXTRANEOUS_SRV_MSG 13
-#define SESS_ERR_BREAK_BY_CLIENT 14
-
/* Session states */
#define SESS_ACTIVE 1
#define SESS_ERROR 2 /* session contains an error message
which has not yet been communicated
to the client */
-/* Session system states */
-#define SESS_SYS_RUNNING 1
-#define SESS_SYS_SHUTTING_DOWN 2
-
-/* Session hash table size */
-#define SESS_HASH_SIZE 1024
-
-/* Flags used in sess_srv_msg_send */
-#define SESS_RELEASE_KERNEL 1
-#define SESS_NOT_RELEASE_KERNEL 2
-
#ifndef UNIV_NONINL
#include "usr0sess.ic"
#endif
diff --git a/innobase/include/usr0sess.ic b/innobase/include/usr0sess.ic
index ee2592c7963..c851d5745b9 100644
--- a/innobase/include/usr0sess.ic
+++ b/innobase/include/usr0sess.ic
@@ -5,27 +5,3 @@ Sessions
Created 6/25/1996 Heikki Tuuri
*******************************************************/
-
-/***************************************************************************
-Sets the message type of a message from the client. */
-UNIV_INLINE
-void
-sess_cli_msg_set_type(
-/*==================*/
- byte* str, /* in: message string */
- ulint type) /* in: message type */
-{
- mach_write_to_4(str + SESS_CLI_MSG_TYPE, type);
-}
-
-/***************************************************************************
-Gets the message type of a message from the server. */
-UNIV_INLINE
-ulint
-sess_srv_msg_get_type(
-/*==================*/
- /* out: message type */
- byte* str) /* in: message string */
-{
- return(mach_read_from_4(str + SESS_SRV_MSG_TYPE));
-}
diff --git a/innobase/include/usr0types.h b/innobase/include/usr0types.h
index 67070ccce27..29359425169 100644
--- a/innobase/include/usr0types.h
+++ b/innobase/include/usr0types.h
@@ -10,7 +10,5 @@ Created 6/25/1996 Heikki Tuuri
#define usr0types_h
typedef struct sess_struct sess_t;
-typedef struct sess_sys_struct sess_sys_t;
-typedef struct sess_sig_struct sess_sig_t;
#endif
diff --git a/innobase/include/ut0dbg.h b/innobase/include/ut0dbg.h
index 9b07d5da488..085b4811a73 100644
--- a/innobase/include/ut0dbg.h
+++ b/innobase/include/ut0dbg.h
@@ -10,7 +10,6 @@ Created 1/30/1994 Heikki Tuuri
#define ut0dbg_h
#include "univ.i"
-#include <assert.h>
#include <stdlib.h>
#include "os0thread.h"
@@ -24,7 +23,7 @@ extern const char* ut_dbg_msg_assert_fail;
extern const char* ut_dbg_msg_trap;
extern const char* ut_dbg_msg_stop;
-#define ut_a(EXPR)\
+#define ut_a(EXPR) do {\
if (!((ulint)(EXPR) + ut_dbg_zero)) {\
ut_print_timestamp(stderr);\
fprintf(stderr, ut_dbg_msg_assert_fail,\
@@ -33,38 +32,32 @@ extern const char* ut_dbg_msg_stop;
fputs("InnoDB: Failing assertion: " #EXPR "\n", stderr);\
fputs(ut_dbg_msg_trap, stderr);\
ut_dbg_stop_threads = TRUE;\
- (*ut_dbg_null_ptr)++;\
+ if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = NULL;\
}\
if (ut_dbg_stop_threads) {\
fprintf(stderr, ut_dbg_msg_stop,\
os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\
os_thread_sleep(1000000000);\
- }
+ }\
+} while (0)
-#define ut_error\
+#define ut_error do {\
ut_print_timestamp(stderr);\
fprintf(stderr, ut_dbg_msg_assert_fail,\
os_thread_pf(os_thread_get_curr_id()), IB__FILE__, (ulint)__LINE__);\
fprintf(stderr, ut_dbg_msg_trap);\
ut_dbg_stop_threads = TRUE;\
- (*ut_dbg_null_ptr)++;
+ if (*(ut_dbg_null_ptr)) ut_dbg_null_ptr = NULL;\
+} while (0)
#ifdef UNIV_DEBUG
#define ut_ad(EXPR) ut_a(EXPR)
-#define ut_d(EXPR) {EXPR;}
+#define ut_d(EXPR) do {EXPR;} while (0)
#else
#define ut_ad(EXPR)
#define ut_d(EXPR)
#endif
-
#define UT_NOT_USED(A) A = A
-
-
-
-
-
-
#endif
-
diff --git a/innobase/include/ut0mem.h b/innobase/include/ut0mem.h
index ba6905a8618..b7dfe77a08e 100644
--- a/innobase/include/ut0mem.h
+++ b/innobase/include/ut0mem.h
@@ -95,10 +95,26 @@ ut_str_catenate(
/* out, own: catenated null-terminated string */
char* str1, /* in: null-terminated string */
char* str2); /* in: null-terminated string */
+/**************************************************************************
+Return a copy of the given string. The returned string must be freed
+using mem_free. */
+
+char*
+ut_strdup(
+/*======*/
+ /* out, own: cnull-terminated string */
+ char* str); /* in: null-terminated string */
+/**************************************************************************
+Checks if a null-terminated string contains a certain character. */
+
+ibool
+ut_str_contains(
+/*============*/
+ char* str, /* in: null-terminated string */
+ char c); /* in: character */
#ifndef UNIV_NONINL
#include "ut0mem.ic"
#endif
#endif
-
diff --git a/innobase/include/ut0rnd.ic b/innobase/include/ut0rnd.ic
index e166a26fe86..5493c37404a 100644
--- a/innobase/include/ut0rnd.ic
+++ b/innobase/include/ut0rnd.ic
@@ -176,19 +176,19 @@ ut_fold_string(
/* out: folded value */
char* str) /* in: null-terminated string */
{
- #ifdef UNIV_DEBUG
+#ifdef UNIV_DEBUG
ulint i = 0;
- #endif
+#endif
ulint fold = 0;
ut_ad(str);
while (*str != '\0') {
- #ifdef UNIV_DEBUG
+#ifdef UNIV_DEBUG
i++;
ut_a(i < 100);
- #endif
+#endif
fold = ut_fold_ulint_pair(fold, (ulint)(*str));
str++;
diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c
index 3541604a09a..2430380d65c 100644
--- a/innobase/lock/lock0lock.c
+++ b/innobase/lock/lock0lock.c
@@ -343,179 +343,6 @@ lock_deadlock_recursive(
#define lock_mutex_enter_kernel() mutex_enter(&kernel_mutex)
#define lock_mutex_exit_kernel() mutex_exit(&kernel_mutex)
-#ifdef notdefined
-/*************************************************************************
-Reserves the kernel mutex. This function is used in this module to allow
-monitoring the contention degree on the kernel mutex caused by the lock
-operations. */
-UNIV_INLINE
-void
-lock_mutex_enter_kernel(void)
-/*=========================*/
-{
- mutex_enter(&kernel_mutex);
-}
-
-/*************************************************************************
-Releases the kernel mutex. This function is used in this module to allow
-monitoring the contention degree on the kernel mutex caused by the lock
-operations. */
-UNIV_INLINE
-void
-lock_mutex_exit_kernel(void)
-/*=========================*/
-{
- mutex_exit(&kernel_mutex);
-}
-#endif
-
-#ifdef notdefined
-
-/*************************************************************************
-Gets the mutex protecting record locks for a page in the buffer pool. */
-UNIV_INLINE
-mutex_t*
-lock_rec_get_mutex(
-/*===============*/
- byte* ptr) /* in: pointer to somewhere within a buffer frame */
-{
- return(buf_frame_get_lock_mutex(ptr));
-}
-
-/*************************************************************************
-Reserves the mutex protecting record locks for a page in the buffer pool. */
-UNIV_INLINE
-void
-lock_rec_mutex_enter(
-/*=================*/
- byte* ptr) /* in: pointer to somewhere within a buffer frame */
-{
- mutex_enter(lock_rec_get_mutex(ptr));
-}
-
-/*************************************************************************
-Releases the mutex protecting record locks for a page in the buffer pool. */
-UNIV_INLINE
-void
-lock_rec_mutex_exit(
-/*================*/
- byte* ptr) /* in: pointer to somewhere within a buffer frame */
-{
- mutex_exit(lock_rec_get_mutex(ptr));
-}
-
-/*************************************************************************
-Checks if the caller owns the mutex to record locks of a page. Works only in
-the debug version. */
-UNIV_INLINE
-ibool
-lock_rec_mutex_own(
-/*===============*/
- /* out: TRUE if the current OS thread has reserved the
- mutex */
- byte* ptr) /* in: pointer to somewhere within a buffer frame */
-{
- return(mutex_own(lock_rec_get_mutex(ptr)));
-}
-
-/*************************************************************************
-Gets the mutex protecting record locks on a given page address. */
-
-mutex_t*
-lock_rec_get_mutex_for_addr(
-/*========================*/
- ulint space, /* in: space id */
- ulint page_no)/* in: page number */
-{
- return(hash_get_mutex(lock_sys->rec_hash,
- lock_rec_fold(space, page_no)));
-}
-
-/*************************************************************************
-Checks if the caller owns the mutex to record locks of a page. Works only in
-the debug version. */
-UNIV_INLINE
-ibool
-lock_rec_mutex_own_addr(
-/*====================*/
- ulint space, /* in: space id */
- ulint page_no)/* in: page number */
-{
- return(mutex_own(lock_rec_get_mutex_for_addr(space, page_no)));
-}
-
-/*************************************************************************
-Reserves all the mutexes protecting record locks. */
-UNIV_INLINE
-void
-lock_rec_mutex_enter_all(void)
-/*==========================*/
-{
- hash_table_t* table;
- ulint n_mutexes;
- ulint i;
-
- table = lock_sys->rec_hash;
-
- n_mutexes = table->n_mutexes;
-
- for (i = 0; i < n_mutexes; i++) {
-
- mutex_enter(hash_get_nth_mutex(table, i));
- }
-}
-
-/*************************************************************************
-Releases all the mutexes protecting record locks. */
-UNIV_INLINE
-void
-lock_rec_mutex_exit_all(void)
-/*=========================*/
-{
- hash_table_t* table;
- ulint n_mutexes;
- ulint i;
-
- table = lock_sys->rec_hash;
-
- n_mutexes = table->n_mutexes;
-
- for (i = 0; i < n_mutexes; i++) {
-
- mutex_exit(hash_get_nth_mutex(table, i));
- }
-}
-
-/*************************************************************************
-Checks that the current OS thread owns all the mutexes protecting record
-locks. */
-UNIV_INLINE
-ibool
-lock_rec_mutex_own_all(void)
-/*========================*/
- /* out: TRUE if owns all */
-{
- hash_table_t* table;
- ulint n_mutexes;
- ibool owns_yes = TRUE;
- ulint i;
-
- table = lock_sys->rec_hash;
-
- n_mutexes = table->n_mutexes;
-
- for (i = 0; i < n_mutexes; i++) {
- if (!mutex_own(hash_get_nth_mutex(table, i))) {
-
- owns_yes = FALSE;
- }
- }
-
- return(owns_yes);
-}
-
-#endif
-
/*************************************************************************
Checks that a transaction id is sensible, i.e., not in the future. */
@@ -1126,7 +953,9 @@ lock_rec_get_next_on_page(
ulint space;
ulint page_no;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(lock_get_type(lock) == LOCK_REC);
space = lock->un_member.rec_lock.space;
@@ -1163,7 +992,9 @@ lock_rec_get_first_on_page_addr(
{
lock_t* lock;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
lock = HASH_GET_FIRST(lock_sys->rec_hash,
lock_rec_hash(space, page_no));
@@ -1221,7 +1052,9 @@ lock_rec_get_first_on_page(
ulint space;
ulint page_no;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
hash = buf_frame_get_lock_hash_val(ptr);
@@ -1253,7 +1086,9 @@ lock_rec_get_next(
rec_t* rec, /* in: record on a page */
lock_t* lock) /* in: lock */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(lock_get_type(lock) == LOCK_REC);
for (;;) {
@@ -1282,7 +1117,9 @@ lock_rec_get_first(
{
lock_t* lock;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
lock = lock_rec_get_first_on_page(rec);
@@ -1370,7 +1207,9 @@ lock_rec_get_prev(
ulint page_no;
lock_t* found_lock = NULL;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(lock_get_type(in_lock) == LOCK_REC);
space = in_lock->un_member.rec_lock.space;
@@ -1410,7 +1249,9 @@ lock_table_has(
{
lock_t* lock;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
/* Look for stronger locks the same trx already has on the table */
@@ -1454,7 +1295,9 @@ lock_rec_has_expl(
{
lock_t* lock;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad((precise_mode & LOCK_MODE_MASK) == LOCK_S
|| (precise_mode & LOCK_MODE_MASK) == LOCK_X);
ut_ad(!(precise_mode & LOCK_INSERT_INTENTION));
@@ -1501,7 +1344,9 @@ lock_rec_other_has_expl_req(
{
lock_t* lock;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(mode == LOCK_X || mode == LOCK_S);
ut_ad(gap == 0 || gap == LOCK_GAP);
ut_ad(wait == 0 || wait == LOCK_WAIT);
@@ -1540,7 +1385,9 @@ lock_rec_other_has_conflicting(
{
lock_t* lock;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
lock = lock_rec_get_first(rec);
@@ -1572,7 +1419,9 @@ lock_rec_find_similar_on_page(
lock_t* lock;
ulint heap_no;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
heap_no = rec_get_heap_no(rec);
@@ -1606,7 +1455,9 @@ lock_sec_rec_some_has_impl_off_kernel(
{
page_t* page;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(!(index->type & DICT_CLUSTERED));
ut_ad(page_rec_is_user_rec(rec));
@@ -1664,7 +1515,9 @@ lock_rec_create(
ulint n_bits;
ulint n_bytes;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
page = buf_frame_align(rec);
space = buf_frame_get_space_id(page);
@@ -1748,7 +1601,9 @@ lock_rec_enqueue_waiting(
lock_t* lock;
trx_t* trx;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
/* Test if there already is some other reason to suspend thread:
we do not enqueue a lock request if the query thread should be
@@ -1756,7 +1611,7 @@ lock_rec_enqueue_waiting(
if (que_thr_stop(thr)) {
- ut_a(0);
+ ut_error;
return(DB_QUE_THR_SUSPENDED);
}
@@ -1834,7 +1689,9 @@ lock_rec_add_to_queue(
page_t* page;
ibool somebody_waits = FALSE;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad((type_mode & (LOCK_WAIT | LOCK_GAP))
|| ((type_mode & LOCK_MODE_MASK) != LOCK_S)
|| !lock_rec_other_has_expl_req(LOCK_X, 0, LOCK_WAIT, rec, trx));
@@ -1914,7 +1771,9 @@ lock_rec_lock_fast(
lock_t* lock;
ulint heap_no;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad((LOCK_MODE_MASK & mode) != LOCK_S
|| lock_table_has(thr_get_trx(thr), index->table, LOCK_IS));
ut_ad((LOCK_MODE_MASK & mode) != LOCK_X
@@ -1978,7 +1837,9 @@ lock_rec_lock_slow(
trx_t* trx;
ulint err;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad((LOCK_MODE_MASK & mode) != LOCK_S
|| lock_table_has(thr_get_trx(thr), index->table, LOCK_IS));
ut_ad((LOCK_MODE_MASK & mode) != LOCK_X
@@ -2023,7 +1884,7 @@ possible, enqueues a waiting lock request. This is a low-level function
which does NOT look at implicit locks! Checks lock compatibility within
explicit locks. This function sets a normal next-key lock, or in the case
of a page supremum record, a gap type lock. */
-
+static
ulint
lock_rec_lock(
/*==========*/
@@ -2040,7 +1901,9 @@ lock_rec_lock(
{
ulint err;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad((LOCK_MODE_MASK & mode) != LOCK_S
|| lock_table_has(thr_get_trx(thr), index->table, LOCK_IS));
ut_ad((LOCK_MODE_MASK & mode) != LOCK_X
@@ -2078,7 +1941,9 @@ lock_rec_has_to_wait_in_queue(
ulint page_no;
ulint heap_no;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(lock_get_wait(wait_lock));
ut_ad(lock_get_type(wait_lock) == LOCK_REC);
@@ -2105,13 +1970,15 @@ lock_rec_has_to_wait_in_queue(
/*****************************************************************
Grants a lock to a waiting lock request and releases the waiting
transaction. */
-
+static
void
lock_grant(
/*=======*/
lock_t* lock) /* in: waiting lock request */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
lock_reset_lock_and_trx_wait(lock);
@@ -2153,7 +2020,9 @@ lock_rec_cancel(
/*============*/
lock_t* lock) /* in: waiting record lock request */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(lock_get_type(lock) == LOCK_REC);
/* Reset the bit (there can be only one set bit) in the lock bitmap */
@@ -2172,7 +2041,7 @@ lock_rec_cancel(
Removes a record lock request, waiting or granted, from the queue and
grants locks to other transactions in the queue if they now are entitled
to a lock. NOTE: all record locks contained in in_lock are removed. */
-
+static
void
lock_rec_dequeue_from_page(
/*=======================*/
@@ -2186,7 +2055,9 @@ lock_rec_dequeue_from_page(
lock_t* lock;
trx_t* trx;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(lock_get_type(in_lock) == LOCK_REC);
trx = in_lock->trx;
@@ -2229,7 +2100,9 @@ lock_rec_discard(
ulint page_no;
trx_t* trx;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(lock_get_type(in_lock) == LOCK_REC);
trx = in_lock->trx;
@@ -2258,7 +2131,9 @@ lock_rec_free_all_from_discard_page(
lock_t* lock;
lock_t* next_lock;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
space = buf_frame_get_space_id(page);
page_no = buf_frame_get_page_no(page);
@@ -2291,7 +2166,9 @@ lock_rec_reset_and_release_wait(
lock_t* lock;
ulint heap_no;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
heap_no = rec_get_heap_no(rec);
@@ -2323,7 +2200,9 @@ lock_rec_inherit_to_gap(
{
lock_t* lock;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
lock = lock_rec_get_first(rec);
@@ -2343,7 +2222,7 @@ lock_rec_inherit_to_gap(
Makes a record to inherit the gap locks (except LOCK_INSERT_INTENTION type)
of another record as gap type locks, but does not reset the lock bits of the
other record. Also waiting lock requests are inherited as GRANTED gap locks. */
-
+static
void
lock_rec_inherit_to_gap_if_gap_lock(
/*================================*/
@@ -2353,7 +2232,9 @@ lock_rec_inherit_to_gap_if_gap_lock(
{
lock_t* lock;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
lock = lock_rec_get_first(rec);
@@ -2386,7 +2267,9 @@ lock_rec_move(
ulint heap_no;
ulint type_mode;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
heap_no = rec_get_heap_no(donator);
@@ -3022,7 +2905,9 @@ lock_deadlock_occurs(
char* err_buf;
ut_ad(trx && lock);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
retry:
/* We check that adding this trx to the waits-for graph
does not produce a cycle. First mark all active transactions
@@ -3064,11 +2949,6 @@ retry:
ut_a(strlen(lock_latest_err_buf) < 4100);
- /*
- sess_raise_error_low(trx, DB_DEADLOCK, lock->type_mode, table,
- index, NULL, NULL, NULL);
- */
-
return(TRUE);
}
@@ -3103,7 +2983,9 @@ lock_deadlock_recursive(
ulint ret;
ut_a(trx && start && wait_lock);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
if (trx->deadlock_mark == 1) {
/* We have already exhaustively searched the subtree starting
@@ -3294,7 +3176,9 @@ lock_table_create(
lock_t* lock;
ut_ad(table && trx);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
if (type_mode == LOCK_AUTO_INC) {
/* Only one trx can have the lock on the table
@@ -3344,7 +3228,9 @@ lock_table_remove_low(
dict_table_t* table;
trx_t* trx;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
table = lock->un_member.tab_lock.table;
trx = lock->trx;
@@ -3378,14 +3264,16 @@ lock_table_enqueue_waiting(
lock_t* lock;
trx_t* trx;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
/* Test if there already is some other reason to suspend thread:
we do not enqueue a lock request if the query thread should be
stopped anyway */
if (que_thr_stop(thr)) {
- ut_a(0);
+ ut_error;
return(DB_QUE_THR_SUSPENDED);
}
@@ -3448,7 +3336,9 @@ lock_table_other_has_incompatible(
{
lock_t* lock;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
lock = UT_LIST_GET_LAST(table->locks);
@@ -3588,7 +3478,7 @@ lock_table_has_to_wait_in_queue(
Removes a table lock request, waiting or granted, from the queue and grants
locks to other transactions in the queue, if they now are entitled to a
lock. */
-
+static
void
lock_table_dequeue(
/*===============*/
@@ -3598,7 +3488,9 @@ lock_table_dequeue(
{
lock_t* lock;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(lock_get_type(in_lock) == LOCK_TABLE);
lock = UT_LIST_GET_NEXT(un_member.tab_lock.locks, in_lock);
@@ -3654,7 +3546,9 @@ lock_release_off_kernel(
ulint count;
lock_t* lock;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
lock = UT_LIST_GET_LAST(trx->trx_locks);
@@ -3715,7 +3609,9 @@ lock_cancel_waiting_and_release(
/*============================*/
lock_t* lock) /* in: waiting lock request */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
if (lock_get_type(lock) == LOCK_REC) {
@@ -3748,7 +3644,9 @@ lock_reset_all_on_table_for_trx(
lock_t* lock;
lock_t* prev_lock;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
lock = UT_LIST_GET_LAST(trx->trx_locks);
@@ -3810,7 +3708,9 @@ lock_table_print(
500 bytes */
lock_t* lock) /* in: table type lock */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(lock_get_type(lock) == LOCK_TABLE);
buf += sprintf(buf, "TABLE LOCK table %s trx id %lu %lu",
@@ -3857,7 +3757,9 @@ lock_rec_print(
char* buf_start = buf;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(lock_get_type(lock) == LOCK_REC);
space = lock->un_member.rec_lock.space;
@@ -3921,7 +3823,9 @@ lock_rec_print(
}
if (page) {
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_NO_ORDER_CHECK);
+#endif /* UNIV_SYNC_DEBUG */
}
for (i = 0; i < lock_rec_get_n_bits(lock); i++) {
@@ -3966,7 +3870,9 @@ lock_get_n_rec_locks(void)
ulint n_locks = 0;
ulint i;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
for (i = 0; i < hash_get_n_cells(lock_sys->rec_hash); i++) {
@@ -4238,7 +4144,9 @@ lock_table_queue_validate(
lock_t* lock;
ibool is_waiting;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
is_waiting = FALSE;
@@ -4391,12 +4299,16 @@ lock_rec_validate_page(
ulint i;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
mtr_start(&mtr);
page = buf_page_get(space, page_no, RW_X_LATCH, &mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_NO_ORDER_CHECK);
+#endif /* UNIV_SYNC_DEBUG */
lock_mutex_enter_kernel();
loop:
@@ -4642,7 +4554,9 @@ lock_rec_convert_impl_to_expl(
{
trx_t* impl_trx;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(page_rec_is_user_rec(rec));
if (index->type & DICT_CLUSTERED) {
diff --git a/innobase/log/log0log.c b/innobase/log/log0log.c
index f041137840c..e99ea269920 100644
--- a/innobase/log/log0log.c
+++ b/innobase/log/log0log.c
@@ -32,7 +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 */
@@ -86,9 +88,8 @@ the previous */
Completes a checkpoint write i/o to a log file. */
static
void
-log_io_complete_checkpoint(
-/*=======================*/
- log_group_t* group); /* in: log group */
+log_io_complete_checkpoint(void);
+/*============================*/
/**********************************************************
Completes an archiving i/o. */
static
@@ -133,7 +134,9 @@ log_buf_pool_get_oldest_modification(void)
{
dulint lsn;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
lsn = buf_pool_get_oldest_modification();
@@ -231,7 +234,9 @@ log_write_low(
ulint data_len;
byte* log_block;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
part_loop:
/* Calculate a part length */
@@ -298,7 +303,9 @@ log_close(void)
log_t* log = log_sys;
ulint checkpoint_age;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
lsn = log->lsn;
@@ -414,7 +421,9 @@ log_group_get_capacity(
/* out: capacity in bytes */
log_group_t* group) /* in: log group */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
return((group->file_size - LOG_FILE_HDR_SIZE) * group->n_files);
}
@@ -430,7 +439,9 @@ log_group_calc_size_offset(
ulint offset, /* in: real offset within the log group */
log_group_t* group) /* in: log group */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
return(offset - LOG_FILE_HDR_SIZE * (1 + offset / group->file_size));
}
@@ -446,7 +457,9 @@ log_group_calc_real_offset(
ulint offset, /* in: size offset within the log group */
log_group_t* group) /* in: log group */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
return(offset + LOG_FILE_HDR_SIZE
* (1 + offset / (group->file_size - LOG_FILE_HDR_SIZE)));
@@ -469,7 +482,9 @@ log_group_calc_lsn_offset(
ib_longlong group_size;
ib_longlong offset;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
/* If total log file size is > 2 GB we can easily get overflows
with 32-bit integers. Use 64-bit integers instead. */
@@ -583,7 +598,9 @@ log_calc_max_ages(void)
ulint archive_margin;
ulint smallest_archive_margin;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
mutex_enter(&(log_sys->mutex));
@@ -655,7 +672,18 @@ failure:
if (!success) {
fprintf(stderr,
-"InnoDB: Error: log file group too small for innodb_thread_concurrency\n");
+"InnoDB: Error: ib_logfiles are too small for innodb_thread_concurrency %lu.\n"
+"InnoDB: The combined size of ib_logfiles should be bigger than\n"
+"InnoDB: 200 kB * innodb_thread_concurrency.\n"
+"InnoDB: To get mysqld to start up, set innodb_thread_concurrency in my.cnf\n"
+"InnoDB: to a lower value, for example, to 8. After an ERROR-FREE shutdown\n"
+"InnoDB: of mysqld you can adjust the size of ib_logfiles, as explained in\n"
+"InnoDB: section 5 of http://www.innodb.com/ibman.php",
+ (ulong)srv_thread_concurrency);
+ fprintf(stderr,
+"InnoDB: Cannot continue operation. Calling exit(1).\n");
+
+ exit(1);
}
return(success);
@@ -862,7 +890,9 @@ log_flush_do_unlocks(
ulint code) /* in: any ORed combination of LOG_UNLOCK_FLUSH_LOCK
and LOG_UNLOCK_NONE_FLUSHED_LOCK */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
/* NOTE that we must own the log mutex when doing the setting of the
events: this is because transactions will wait for these events to
@@ -894,14 +924,17 @@ log_group_check_flush_completion(
/* out: LOG_UNLOCK_NONE_FLUSHED_LOCK or 0 */
log_group_t* group) /* in: log group */
{
- ut_ad(mutex_own(&(log_sys->mutex)));
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (!log_sys->one_flushed && group->n_pending_writes == 0) {
-
+#ifdef UNIV_LOG_DEBUG
if (log_debug_writes) {
printf("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;
@@ -909,10 +942,12 @@ log_group_check_flush_completion(
return(LOG_UNLOCK_NONE_FLUSHED_LOCK);
}
+#ifdef UNIV_LOG_DEBUG
if (log_debug_writes && (group->n_pending_writes == 0)) {
printf("Log flushed to group %lu\n", (ulong) group->id);
}
+#endif /* UNIV_LOG_DEBUG */
return(0);
}
@@ -928,7 +963,9 @@ log_sys_check_flush_completion(void)
ulint move_start;
ulint move_end;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (log_sys->n_pending_writes == 0) {
@@ -986,12 +1023,20 @@ log_io_complete(
fil_flush(group->space_id);
}
- log_io_complete_checkpoint(group);
+#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();
return;
}
- ut_a(0); /* We currently use synchronous writing of the
+ ut_error; /* We currently use synchronous writing of the
logs and cannot end up here! */
if (srv_unix_file_flush_method != SRV_UNIX_O_DSYNC
@@ -1035,7 +1080,9 @@ log_group_file_header_flush(
UT_NOT_USED(type);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(nth_file < group->n_files);
@@ -1049,11 +1096,13 @@ log_group_file_header_flush(
dest_offset = nth_file * group->file_size;
+#ifdef UNIV_LOG_DEBUG
if (log_debug_writes) {
printf(
"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++;
@@ -1103,7 +1152,9 @@ log_group_write_buf(
ulint next_offset;
ulint i;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(len % OS_FILE_LOG_BLOCK_SIZE == 0);
ut_a(ut_dulint_get_low(start_lsn) % OS_FILE_LOG_BLOCK_SIZE == 0);
@@ -1136,6 +1187,7 @@ loop:
write_len = len;
}
+#ifdef UNIV_LOG_DEBUG
if (log_debug_writes) {
printf(
@@ -1160,6 +1212,7 @@ 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 */
@@ -1287,6 +1340,7 @@ loop:
return;
}
+#ifdef UNIV_LOG_DEBUG
if (log_debug_writes) {
printf("Writing log from %lu %lu up to lsn %lu %lu\n",
(ulong) ut_dulint_get_high(log_sys->written_to_all_lsn),
@@ -1294,6 +1348,7 @@ 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++;
@@ -1502,7 +1557,9 @@ void
log_complete_checkpoint(void)
/*=========================*/
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(log_sys->n_pending_checkpoint_writes == 0);
log_sys->next_checkpoint_no
@@ -1517,9 +1574,8 @@ log_complete_checkpoint(void)
Completes an asynchronous checkpoint info write i/o to a log file. */
static
void
-log_io_complete_checkpoint(
-/*=======================*/
- log_group_t* group) /* in: log group */
+log_io_complete_checkpoint(void)
+/*============================*/
{
mutex_enter(&(log_sys->mutex));
@@ -1527,11 +1583,6 @@ log_io_complete_checkpoint(
log_sys->n_pending_checkpoint_writes--;
- if (log_debug_writes) {
- printf("Checkpoint info written to group %lu\n",
- (ulong) group->id);
- }
-
if (log_sys->n_pending_checkpoint_writes == 0) {
log_complete_checkpoint();
}
@@ -1593,7 +1644,9 @@ log_group_checkpoint(
byte* buf;
ulint i;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(LOG_CHECKPOINT_SIZE <= OS_FILE_LOG_BLOCK_SIZE);
buf = group->checkpoint_buf;
@@ -1747,7 +1800,9 @@ log_group_read_checkpoint_info(
log_group_t* group, /* in: log group */
ulint field) /* in: LOG_CHECKPOINT_1 or LOG_CHECKPOINT_2 */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
log_sys->n_log_ios++;
@@ -1765,7 +1820,9 @@ log_groups_write_checkpoint_info(void)
{
log_group_t* group;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
group = UT_LIST_GET_FIRST(log_sys->log_groups);
@@ -1850,12 +1907,14 @@ log_checkpoint(
log_sys->next_checkpoint_lsn = oldest_lsn;
+#ifdef UNIV_LOG_DEBUG
if (log_debug_writes) {
printf("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();
@@ -2030,7 +2089,9 @@ log_group_read_log_seg(
ulint source_offset;
ibool sync;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
sync = FALSE;
@@ -2102,9 +2163,11 @@ log_group_archive_file_header_write(
byte* buf;
ulint dest_offset;
+#ifdef UNIV_SYNC_DEBUG
ut_a(0);
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(nth_file < group->n_files);
@@ -2141,9 +2204,11 @@ log_group_archive_completed_header_write(
byte* buf;
ulint dest_offset;
+#ifdef UNIV_SYNC_DEBUG
ut_a(0);
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(nth_file < group->n_files);
buf = *(group->archive_file_header_bufs + nth_file);
@@ -2182,9 +2247,11 @@ log_group_archive(
ulint n_files;
ulint open_mode;
+#ifdef UNIV_SYNC_DEBUG
ut_a(0);
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
start_lsn = log_sys->archived_lsn;
@@ -2234,9 +2301,11 @@ loop:
exit(1);
}
+#ifdef UNIV_LOG_DEBUG
if (log_debug_writes) {
printf("Created archive file %s\n", name);
}
+#endif /* UNIV_LOG_DEBUG */
ret = os_file_close(file_handle);
@@ -2263,6 +2332,7 @@ loop:
len = group->file_size - (next_offset % group->file_size);
}
+#ifdef UNIV_LOG_DEBUG
if (log_debug_writes) {
printf(
"Archiving starting at lsn %lu %lu, len %lu to group %lu\n",
@@ -2270,6 +2340,7 @@ loop:
(ulong) ut_dulint_get_low(start_lsn),
(ulong) len, (ulong) group->id);
}
+#endif /* UNIV_LOG_DEBUG */
log_sys->n_pending_archive_ios++;
@@ -2309,9 +2380,11 @@ log_archive_groups(void)
{
log_group_t* group;
+#ifdef UNIV_SYNC_DEBUG
ut_a(0);
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
group = UT_LIST_GET_FIRST(log_sys->log_groups);
@@ -2334,9 +2407,11 @@ log_archive_write_complete_groups(void)
dulint end_lsn;
ulint i;
+#ifdef UNIV_SYNC_DEBUG
ut_a(0);
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
group = UT_LIST_GET_FIRST(log_sys->log_groups);
@@ -2360,10 +2435,12 @@ log_archive_write_complete_groups(void)
trunc_files = n_files - 1;
}
+#ifdef UNIV_LOG_DEBUG
if (log_debug_writes && trunc_files) {
printf("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,
@@ -2386,9 +2463,11 @@ 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) {
printf("Archiving writes completed\n");
}
+#endif /* UNIV_LOG_DEBUG */
}
/**********************************************************
@@ -2398,16 +2477,20 @@ void
log_archive_check_completion_low(void)
/*==================================*/
{
+#ifdef UNIV_SYNC_DEBUG
ut_a(0);
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (log_sys->n_pending_archive_ios == 0
&& log_sys->archiving_phase == LOG_ARCHIVE_READ) {
+#ifdef UNIV_LOG_DEBUG
if (log_debug_writes) {
printf("Archiving read completed\n");
}
+#endif /* UNIV_LOG_DEBUG */
/* Archive buffer has now been read in: start archive writes */
@@ -2501,8 +2584,7 @@ loop:
start_lsn = log_sys->archived_lsn;
if (calc_new_limit) {
- ut_a(log_sys->archive_buf_size % OS_FILE_LOG_BLOCK_SIZE
- == 0);
+ ut_a(log_sys->archive_buf_size % OS_FILE_LOG_BLOCK_SIZE == 0);
limit_lsn = ut_dulint_add(start_lsn,
log_sys->archive_buf_size);
@@ -2556,6 +2638,7 @@ loop:
log_sys->next_archived_lsn = limit_lsn;
+#ifdef UNIV_LOG_DEBUG
if (log_debug_writes) {
printf("Archiving from lsn %lu %lu to lsn %lu %lu\n",
(ulong) ut_dulint_get_high(log_sys->archived_lsn),
@@ -2563,6 +2646,7 @@ 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 */
@@ -2638,7 +2722,9 @@ log_archive_close_groups(
log_group_t* group;
ulint trunc_len;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (log_sys->archiving_state == LOG_ARCH_OFF) {
@@ -2667,12 +2753,14 @@ log_archive_close_groups(
group->archived_file_no += 2;
}
+#ifdef UNIV_LOG_DEBUG
if (log_debug_writes) {
printf(
"Incrementing arch file no to %lu in log group %lu\n",
(ulong) group->archived_file_no + 2,
(ulong) group->id);
}
+#endif /* UNIV_LOG_DEBUG */
}
}
@@ -3142,6 +3230,7 @@ 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. */
@@ -3161,7 +3250,9 @@ log_check_log_recs(
byte* buf1;
byte* scan_buf;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (len == 0) {
@@ -3192,6 +3283,7 @@ 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 01679a374b0..432a6ed1e85 100644
--- a/innobase/log/log0recv.c
+++ b/innobase/log/log0recv.c
@@ -165,14 +165,16 @@ void
recv_sys_empty_hash(void)
/*=====================*/
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(recv_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (recv_sys->n_addrs != 0) {
fprintf(stderr,
"InnoDB: Error: %lu pages with log records were left unprocessed!\n"
"InnoDB: Maximum page number with log records on it %lu\n",
(ulong) recv_sys->n_addrs,
(ulong) recv_max_parsed_page_no);
- ut_a(0);
+ ut_error;
}
hash_table_free(recv_sys->addr_hash);
@@ -181,9 +183,10 @@ 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
void
recv_sys_free(void)
/*===============*/
@@ -200,6 +203,7 @@ recv_sys_free(void)
mutex_exit(&(recv_sys->mutex));
}
+#endif /* !UNIV_LOG_DEBUG */
/************************************************************
Truncates possible corrupted or extra records from a log group. */
@@ -358,7 +362,7 @@ Copies a log segment from the most up-to-date log group to the other log
groups, so that they all contain the latest log data. Also writes the info
about the latest checkpoint to the groups, and inits the fields in the group
memory structs to up-to-date values. */
-
+static
void
recv_synchronize_groups(
/*====================*/
@@ -483,6 +487,7 @@ 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",
@@ -492,6 +497,7 @@ recv_find_max_checkpoint(
+ LOG_CHECKPOINT_CHECKSUM_1));
}
+#endif /* UNIV_LOG_DEBUG */
goto not_consistent;
}
@@ -505,12 +511,14 @@ 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;
@@ -1076,7 +1084,9 @@ recv_recover_page(
&mtr);
ut_a(success);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_NO_ORDER_CHECK);
+#endif /* UNIV_SYNC_DEBUG */
}
/* Read the newest modification lsn from the page */
@@ -1141,6 +1151,7 @@ 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",
@@ -1148,7 +1159,8 @@ 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);
mach_write_to_8(page + UNIV_PAGE_SIZE
@@ -1278,14 +1290,13 @@ loop:
goto loop;
}
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(!allow_ibuf == mutex_own(&log_sys->mutex));
+#endif /* UNIV_SYNC_DEBUG */
if (!allow_ibuf) {
- ut_ad(mutex_own(&(log_sys->mutex)));
-
recv_no_ibuf_operations = TRUE;
- } else {
- ut_ad(!mutex_own(&(log_sys->mutex)));
}
-
+
recv_sys->apply_log_recs = TRUE;
recv_sys->apply_batch_on = TRUE;
@@ -1315,8 +1326,10 @@ loop:
page = buf_page_get(space, page_no,
RW_X_LATCH, &mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page,
SYNC_NO_ORDER_CHECK);
+#endif /* UNIV_SYNC_DEBUG */
recv_recover_page(FALSE, FALSE, page,
space, page_no);
mtr_commit(&mtr);
@@ -1539,7 +1552,9 @@ recv_update_replicate(
replica = buf_page_get(space + RECV_REPLICA_SPACE_ADD, page_no,
RW_X_LATCH, &mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(replica, SYNC_NO_ORDER_CHECK);
+#endif /* UNIV_SYNC_DEBUG */
ptr = recv_parse_or_apply_log_rec_body(type, body, end_ptr, replica,
&mtr);
@@ -1608,7 +1623,9 @@ recv_compare_replicate(
replica = buf_page_get(space + RECV_REPLICA_SPACE_ADD, page_no,
RW_X_LATCH, &mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(replica, SYNC_NO_ORDER_CHECK);
+#endif /* UNIV_SYNC_DEBUG */
recv_check_identical(page + FIL_PAGE_DATA,
replica + FIL_PAGE_DATA,
@@ -1649,7 +1666,9 @@ recv_compare_spaces(
IB__FILE__, __LINE__,
&mtr);
if (frame) {
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(frame, SYNC_NO_ORDER_CHECK);
+#endif /* UNIV_SYNC_DEBUG */
ut_memcpy(page, frame, UNIV_PAGE_SIZE);
} else {
/* Read it from file */
@@ -1662,7 +1681,9 @@ recv_compare_spaces(
IB__FILE__, __LINE__,
&mtr);
if (frame) {
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(frame, SYNC_NO_ORDER_CHECK);
+#endif /* UNIV_SYNC_DEBUG */
ut_memcpy(replica, frame, UNIV_PAGE_SIZE);
} else {
/* Read it from file */
@@ -1803,10 +1824,11 @@ 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(
/*===========================*/
@@ -1824,6 +1846,7 @@ recv_check_incomplete_log_recs(
&page_no, &body));
}
}
+#endif /* UNIV_LOG_DEBUG */
/***********************************************************
Prints diagnostic info of corrupt log. */
@@ -1912,7 +1935,9 @@ recv_parse_log_recs(
byte* body;
ulint n_recs;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(!ut_dulint_is_zero(recv_sys->parse_start_lsn));
loop:
ptr = recv_sys->buf + recv_sys->recovered_offset;
@@ -1965,12 +1990,14 @@ 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 */
@@ -2052,13 +2079,15 @@ loop:
*/
}
+#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++;
@@ -2463,6 +2492,7 @@ 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",
@@ -2470,6 +2500,7 @@ 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 */
}
/************************************************************
@@ -2850,10 +2881,12 @@ 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();
@@ -2895,8 +2928,9 @@ recv_reset_logs(
{
log_group_t* group;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(log_sys->mutex)));
-
+#endif /* UNIV_SYNC_DEBUG */
log_sys->lsn = ut_dulint_align_up(lsn, OS_FILE_LOG_BLOCK_SIZE);
group = UT_LIST_GET_FIRST(log_sys->log_groups);
@@ -3164,6 +3198,7 @@ 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",
@@ -3171,6 +3206,7 @@ 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/log/trash/log0trsh.c b/innobase/log/trash/log0trsh.c
deleted file mode 100644
index 7f48118a0d1..00000000000
--- a/innobase/log/trash/log0trsh.c
+++ /dev/null
@@ -1,648 +0,0 @@
-/******************************************************
-Recovery
-
-(c) 1997 Innobase Oy
-
-Created 9/20/1997 Heikki Tuuri
-*******************************************************/
-
-#include "log0recv.h"
-
-#ifdef UNIV_NONINL
-#include "log0recv.ic"
-#endif
-
-#include "mem0mem.h"
-#include "buf0buf.h"
-#include "buf0flu.h"
-#include "srv0srv.h"
-
-/* Size of block reads when the log groups are scanned forward to do
-roll-forward */
-#define RECV_SCAN_SIZE (4 * UNIV_PAGE_SIZE)
-
-/* Size of block reads when the log groups are scanned backwards to synchronize
-them */
-#define RECV_BACK_SCAN_SIZE (4 * UNIV_PAGE_SIZE)
-
-recv_sys_t* recv_sys = NULL;
-
-recv_recover_page(block->frame, block->space, block->offset);
-
-/************************************************************
-Creates the recovery system. */
-
-void
-recv_sys_create(void)
-/*=================*/
-{
- ut_a(recv_sys == NULL);
-
- recv_sys = mem_alloc(sizeof(recv_t));
-
- mutex_create(&(recv_sys->mutex));
-
- recv_sys->hash = NULL;
- recv_sys->heap = NULL;
-}
-
-/************************************************************
-Inits the recovery system for a recovery operation. */
-
-void
-recv_sys_init(void)
-/*===============*/
-{
- recv_sys->hash = hash_create(buf_pool_get_curr_size() / 64);
- recv_sys->heap = mem_heap_create_in_buffer(256);
-}
-
-/************************************************************
-Empties the recovery system. */
-
-void
-recv_sys_empty(void)
-/*================*/
-{
- mutex_enter(&(recv_sys->mutex));
-
- hash_free(recv_sys->hash);
- mem_heap_free(recv_sys->heap);
-
- recv_sys->hash = NULL;
- recv_sys->heap = NULL;
-
- mutex_exit(&(recv_sys->mutex));
-}
-
-/***********************************************************
-For recovery purposes copies the log buffer to a group to synchronize log
-data. */
-static
-void
-recv_log_buf_flush(
-/*===============*/
- log_group_t* group, /* in: log group */
- dulint start_lsn, /* in: start lsn of the log data in
- the log buffer; must be divisible by
- OS_FILE_LOG_BLOCK_SIZE */
- dulint end_lsn) /* in: end lsn of the log data in the
- log buffer; must be divisible by
- OS_FILE_LOG_BLOCK_SIZE */
-{
- ulint len;
-
- ut_ad(mutex_own(&(log_sys->mutex)));
-
- len = ut_dulint_minus(end_lsn, start_lsn);
-
- log_group_write_buf(LOG_RECOVER, group, log_sys->buf, len, start_lsn,
- 0);
-}
-
-/***********************************************************
-Compares two buffers containing log segments and determines the highest lsn
-where they match, if any. */
-static
-dulint
-recv_log_bufs_cmp(
-/*==============*/
- /* out: if no match found, ut_dulint_zero or
- if start_lsn == LOG_START_LSN, returns
- LOG_START_LSN; otherwise the highest matching
- lsn */
- byte* recv_buf, /* in: buffer containing valid log data */
- byte* buf, /* in: buffer of data from a possibly
- incompletely written log group */
- dulint start_lsn, /* in: buffer start lsn, must be divisible
- by OS_FILE_LOG_BLOCK_SIZE and must be >=
- LOG_START_LSN */
- dulint end_lsn, /* in: buffer end lsn, must be divisible
- by OS_FILE_LOG_BLOCK_SIZE */
- dulint recovered_lsn) /* in: recovery succeeded up to this lsn */
-{
- ulint len;
- ulint offset;
- byte* log_block1;
- byte* log_block2;
- ulint no;
- ulint data_len;
-
- ut_ad(ut_dulint_cmp(start_lsn, LOG_START_LSN) >= 0);
-
- if (ut_dulint_cmp(end_lsn, recovered_lsn) > 0) {
- end_lsn = ut_dulint_align_up(recovered_lsn,
- OS_FILE_LOG_BLOCK_SIZE);
- }
-
- len = ut_dulint_minus(end_lsn, start_lsn);
-
- if (len == 0) {
-
- goto no_match;
- }
-
- ut_ad(len % OS_FILE_LOG_BLOCK_SIZE == 0);
-
- log_block1 = recv_buf + len;
- log_block2 = buf + len;
-
- for (;;) {
- log_block1 -= OS_FILE_LOG_BLOCK_SIZE;
- log_block2 -= OS_FILE_LOG_BLOCK_SIZE;
-
- no = log_block_get_hdr_no(log_block1);
- ut_a(no == log_block_get_trl_no(log_block1));
-
- if ((no == log_block_get_hdr_no(log_block2))
- && (no == log_block_get_trl_no(log_block2))) {
-
- /* Match found if the block is not corrupted */
-
- data_len = log_block_get_data_len(log_block2);
-
- if (0 == ut_memcmp(log_block1 + LOG_BLOCK_DATA,
- log_block2 + LOG_BLOCK_DATA,
- data_len - LOG_BLOCK_DATA)) {
-
- /* Match found */
-
- return(ut_dulint_add(start_lsn,
- log_block2 - buf + data_len));
- }
- }
-
- if (log_block1 == recv_buf) {
-
- /* No match found */
-
- break;
- }
- }
-no_match:
- if (ut_dulint_cmp(start_lsn, LOG_START_LSN) == 0) {
-
- return(LOG_START_LSN);
- }
-
- return(ut_dulint_zero);
-}
-
-/************************************************************
-Copies a log segment from the most up-to-date log group to the other log
-group, so that it contains the latest log data. */
-static
-void
-recv_copy_group(
-/*============*/
- log_group_t* up_to_date_group, /* in: the most up-to-date
- log group */
- log_group_t* group, /* in: copy to this log group */
- dulint_lsn recovered_lsn) /* in: recovery succeeded up
- to this lsn */
-{
- dulint start_lsn;
- dulint end_lsn;
- dulint match;
- byte* buf;
- byte* buf1;
-
- ut_ad(mutex_own(&(log_sys->mutex)));
-
- if (0 == ut_dulint_cmp(LOG_START_LSN, recovered_lsn)) {
-
- return;
- }
-
- ut_ad(RECV_BACK_SCAN_SIZE <= log_sys->buf_size);
-
- buf1 = mem_alloc(2 * RECV_BACK_SCAN_SIZE);
- buf = ut_align(buf, RECV_BACK_SCAN_SIZE););
-
- end_lsn = ut_dulint_align_up(recovered_lsn, RECV_BACK_SCAN_SIZE);
-
- match = ut_dulint_zero;
-
- for (;;) {
- if (ut_dulint_cmp(ut_dulint_add(LOG_START_LSN,
- RECV_BACK_SCAN_SIZE), end_lsn) >= 0) {
- start_lsn = LOG_START_LSN;
- } else {
- start_lsn = ut_dulint_subtract(end_lsn,
- RECV_BACK_SCAN_SIZE);
- }
-
- log_group_read_log_seg(LOG_RECOVER, buf, group, start_lsn,
- end_lsn);
- log_group_read_log_seg(LOG_RECOVER, log_sys->buf,
- up_to_date_group, start_lsn, end_lsn);
-
- match = recv_log_bufs_cmp(log_sys->buf, buf, start_lsn,
- end_lsn, recovered_lsn);
-
- if (ut_dulint_cmp(match, recovered_lsn) != 0) {
- recv_log_buf_flush(group, start_lsn, end_lsn);
- }
-
- if (!ut_dulint_zero(match)) {
-
- mem_free(buf1);
-
- return;
- }
-
- end_lsn = start_lsn;
- }
-}
-
-/************************************************************
-Copies a log segment from the most up-to-date log group to the other log
-groups, so that they all contain the latest log data. Also writes the info
-about the latest checkpoint to the groups, and inits the fields in the group
-memory structs to up-to-date values. */
-
-void
-recv_synchronize_groups(
-/*====================*/
- log_group_t* up_to_date_group, /* in: the most up-to-date
- log group */
- dulint_lsn recovered_lsn, /* in: recovery succeeded up
- to this lsn */
- log_group_t* max_checkpoint_group) /* in: the group with the most
- recent checkpoint info */
-{
- log_group_t* group;
-
- ut_ad(mutex_own(&(log_sys->mutex)));
-
- group = UT_LIST_GET_FIRST(log_sys->log_groups);
-
- while (group) {
- if (group != up_to_date_group) {
-
- /* Copy log data */
-
- recv_copy_group(group, up_to_date_group,
- recovered_lsn);
- }
-
- if (group != max_checkpoint_group) {
-
- /* Copy the checkpoint info to the group */
-
- log_group_checkpoint(group);
-
- mutex_exit(&(log_sys->mutex));
-
- /* Wait for the checkpoint write to complete */
- rw_lock_s_lock(&(log_sys->checkpoint_lock));
- rw_lock_s_unlock(&(log_sys->checkpoint_lock));
-
- mutex_enter(&(log_sys->mutex));
- }
-
- /* Update the fields in the group struct to correspond to
- recovered_lsn */
-
- log_group_set_fields(group, recovered_lsn);
-
- group = UT_LIST_GET_NEXT(log_groups, group);
- }
-}
-
-/************************************************************
-Looks for the maximum consistent checkpoint from the log groups. */
-static
-ulint
-recv_find_max_checkpoint(
-/*=====================*/
- /* out: error code or DB_SUCCESS */
- log_group_t** max_group, /* out: max group */
- ulint* max_field) /* out: LOG_CHECKPOINT_1 or
- LOG_CHECKPOINT_2 */
-{
- log_group_t* group;
- dulint max_no;
- dulint cp_no;
- ulint field;
- ulint fold;
- byte* buf;
-
- ut_ad(mutex_own(&(log_sys->mutex)));
-
- /* Look for the latest checkpoint from the log groups */
- group = UT_LIST_GET_FIRST(log_sys->log_groups);
-
- checkpoint_no = ut_dulint_zero;
- checkpoint_lsn = ut_dulint_zero;
- *max_group = NULL;
-
- buf = log_sys->checkpoint_buf;
-
- while (group) {
- group->state = LOG_GROUP_CORRUPTED;
-
- for (field = LOG_CHECKPOINT_1; field <= LOG_CHECKPOINT_2;
- field += LOG_CHECKPOINT_2 - LOG_CHECKPOINT_1) {
-
- log_group_read_checkpoint_info(group, field);
-
- /* Check the consistency of the checkpoint info */
- fold = ut_fold_binary(buf, LOG_CHECKPOINT_CHECKSUM_1);
-
- if (fold != mach_read_from_4(buf
- + LOG_CHECKPOINT_CHECKSUM_1)) {
- goto not_consistent;
- }
-
- fold = ut_fold_binary(buf + LOG_CHECKPOINT_LSN,
- LOG_CHECKPOINT_CHECKSUM_2
- - LOG_CHECKPOINT_LSN);
- if (fold != mach_read_from_4(buf
- + LOG_CHECKPOINT_CHECKSUM_2)) {
- goto not_consistent;
- }
-
- group->state = LOG_GROUP_OK;
-
- group->lsn = mach_read_from_8(buf
- + LOG_CHECKPOINT_LSN);
- group->lsn_offset = mach_read_from_4(buf
- + LOG_CHECKPOINT_OFFSET);
- group->lsn_file_count = mach_read_from_4(
- buf + LOG_CHECKPOINT_FILE_COUNT);
-
- cp_no = mach_read_from_8(buf + LOG_CHECKPOINT_NO);
-
- if (ut_dulint_cmp(cp_no, max_no) >= 0) {
- *max_group = group;
- *max_field = field;
- max_no = cp_no;
- }
-
- not_consistent:
- }
-
- group = UT_LIST_GET_NEXT(log_groups, group);
- }
-
- if (*max_group == NULL) {
-
- return(DB_ERROR);
- }
-
- return(DB_SUCCESS);
-}
-
-/***********************************************************
-Parses log records from a buffer and stores them to a hash table to wait
-merging to file pages. If the hash table becomes too big, merges automatically
-it to file pages. */
-static
-bool
-recv_parse_and_hash_log_recs(
-/*=========================*/
- /* out: TRUE if limit_lsn has been reached */
- byte* buf, /* in: buffer containing a log segment or
- garbage */
- ulint len, /* in: buffer length */
- dulint start_lsn, /* in: buffer start lsn */
- dulint limit_lsn, /* in: recover at least to this lsn */
- dulint* recovered_lsn) /* out: was able to parse up to this lsn */
-{
-
-}
-
-/************************************************************
-Recovers from a checkpoint. When this function returns, the database is able
-to start processing new user transactions, but the function
-recv_recovery_from_checkpoint_finish should be called later to complete
-the recovery and free the resources used in it. */
-
-ulint
-recv_recovery_from_checkpoint_start(
-/*================================*/
- /* out: error code or DB_SUCCESS */
- dulint limit_lsn) /* in: recover up to this lsn if possible */
-{
- log_group_t* max_cp_group;
- log_group_t* up_to_date_group;
- ulint max_cp_field;
- byte* buf;
- ulint err;
- dulint checkpoint_lsn;
- dulint checkpoint_no;
- dulint recovered_lsn;
- dulint old_lsn;
- dulint end_lsn;
- dulint start_lsn;
- bool finished;
- dulint flush_start_lsn;
-
- mutex_enter(&(log_sys->mutex));
-
- /* Look for the latest checkpoint from any of the log groups */
-
- err = recv_find_max_checkpoint(&max_cp_group, &max_cp_field);
-
- if (err != DB_SUCCESS) {
- mutex_exit(&(log_sys->mutex));
-
- return(err);
- }
-
- log_group_read_checkpoint_info(max_cp_group, max_cp_field);
-
- buf = log_sys->checkpoint_buf;
-
- checkpoint_lsn = mach_read_from_8(buf + LOG_CHECKPOINT_LSN);
- checkpoint_no = mach_read_from_8(buf + LOG_CHECKPOINT_NO);
-
- if (ut_dulint_cmp(limit_lsn, checkpoint_lsn) < 0) {
- mutex_exit(&(log_sys->mutex));
-
- return(DB_ERROR);
- }
-
- /* Start reading the log groups from the checkpoint lsn up. The
- variable flush_start_lsn tells a lsn up to which the log is known
- to be contiguously written in all log groups. */
-
- recovered_lsn = checkpoint_lsn;
- flush_start_lsn = ut_dulint_align_down(checkpoint_lsn,
- OS_FILE_LOG_BLOCK_SIZE);
- up_to_date_group = max_cp_group;
-
- ut_ad(RECV_SCAN_SIZE <= log_sys->buf_size);
-
- group = UT_LIST_GET_FIRST(log_sys->log_groups);
-
- while (group) {
- finished = FALSE;
-
- if (group->state == LOG_GROUP_CORRUPTED) {
- finished = TRUE;
- }
-
- start_lsn = flush_start_lsn;
-
- while (!finished) {
- end_lsn = ut_dulint_add(start_lsn, RECV_SCAN_SIZE);
-
- log_group_read_log_seg(LOG_RECOVER, log_sys->buf,
- group, start_lsn, end_lsn);
- old_lsn = recovered_lsn;
-
- finished = recv_parse_and_hash_log_recs(log_sys->buf,
- RECV_SCAN_SIZE, start_lsn,
- limit_lsn, &flush_start_lsn,
- &recovered_lsn);
-
- if (ut_dulint_cmp(recovered_lsn, old_lsn) > 0) {
-
- /* We found a more up-to-date group */
- up_to_date_group = group;
- }
-
- start_lsn = end_lsn;
- }
-
- group = UT_LIST_GET_NEXT(log_groups, group);
- }
-
- /* Delete possible corrupted or extra log records from all log
- groups */
-
- recv_truncate_groups(recovered_lsn);
-
- /* Synchronize the uncorrupted log groups to the most up-to-date log
- group; we may also have to copy checkpoint info to groups */
-
- log_sys->next_checkpoint_lsn = checkpoint_lsn;
- log_sys->next_checkpoint_no = checkpoint_no;
-
- recv_synchronize_groups(up_to_date_group, _lsn, max_cp_group);
-
- log_sys->next_checkpoint_no = ut_dulint_add(checkpoint_no, 1);
-
- /* The database is now ready to start almost normal processing of user
- transactions */
-
- return(DB_SUCCESS);
-}
-
-/************************************************************
-Completes recovery from a checkpoint. */
-
-void
-recv_recovery_from_checkpoint_finish(void)
-/*======================================*/
-{
- /* Rollback the uncommitted transactions which have no user session */
-
- trx_rollback_all_without_sess();
-
- /* Merge the hashed log records */
-
- recv_merge_hashed_log_recs();
-
- /* Free the resources of the recovery system */
-
- recv_sys_empty();
-}
-
-/****************************************************************
-Writes to the log a record about incrementing the row id counter. */
-UNIV_INLINE
-void
-log_write_row_id_incr_rec(void)
-/*===========================*/
-{
- log_t* log = log_sys;
- ulint data_len;
-
- mutex_enter(&(log->mutex));
-
- data_len = (log->buf_free % OS_FILE_LOG_BLOCK_SIZE) + 1;
-
- if (data_len >= OS_FILE_LOG_BLOCK_SIZE - LOG_BLOCK_TRL_SIZE) {
-
- /* The string does not fit within the current log block
- or the the block would become full */
-
- mutex_exit(&(log->mutex));
-
- log_write_row_id_incr_rec_slow();
-
- return;
- }
-
- *(log->buf + log->buf_free) = MLOG_INCR_ROW_ID | MLOG_SINGLE_REC_FLAG;
-
- log_block_set_data_len(ut_align_down(log->buf + log->buf_free,
- OS_FILE_LOG_BLOCK_SIZE),
- data_len);
-#ifdef UNIV_LOG_DEBUG
- log->old_buf_free = log->buf_free;
- log->old_lsn = log->lsn;
- log_check_log_recs(log->buf + log->buf_free, 1, log->lsn);
-#endif
- log->buf_free++;
-
- ut_ad(log->buf_free <= log->buf_size);
-
- UT_DULINT_INC(log->lsn);
-
- mutex_exit(&(log->mutex));
-}
-
-/****************************************************************
-Writes to the log a record about incrementing the row id counter. */
-static
-void
-log_write_row_id_incr_rec_slow(void)
-/*================================*/
-{
- byte type;
-
- log_reserve_and_open(1);
-
- type = MLOG_INCR_ROW_ID | MLOG_SINGLE_REC_FLAG;
-
- log_write_low(&type, 1);
-
- log_close();
-
- log_release();
-}
-
-/**************************************************************************
-Parses and applies a log record MLOG_SET_ROW_ID. */
-
-byte*
-dict_hdr_parse_set_row_id(
-/*======================*/
- /* out: end of log record or NULL */
- byte* ptr, /* in: buffer */
- byte* end_ptr,/* in: buffer end */
- page_t* page) /* in: page or NULL */
-{
- dulint dval;
-
- ptr = mach_dulint_parse_compressed(ptr, end_ptr, &dval);
-
- if (ptr == NULL) {
-
- return(NULL);
- }
-
- if (!page) {
-
- return(ptr);
- }
-
- mach_write_to_8(page + DICT_HDR + DICT_HDR_ROW_ID, dval);
-
- return(ptr);
-}
-
diff --git a/innobase/mach/ts/makefile b/innobase/mach/ts/makefile
deleted file mode 100644
index e9531e6ebe0..00000000000
--- a/innobase/mach/ts/makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-
-include ..\..\makefile.i
-
-tsmach: ..\mach.lib tsmach.c
- $(CCOM) $(CFL) -I.. -I..\.. ..\mach.lib ..\..\ut.lib ..\..\os.lib tsmach.c $(LFL)
-
-
-
-
-
-
-
diff --git a/innobase/mach/ts/tsmach.c b/innobase/mach/ts/tsmach.c
deleted file mode 100644
index a4b67227d20..00000000000
--- a/innobase/mach/ts/tsmach.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/************************************************************************
-The test module for the machine-dependent utilities
-
-(c) 1995 Innobase Oy
-
-Created 11/28/1995 Heikki Tuuri
-*************************************************************************/
-
-#include "../mach0data.h"
-
-byte arr[4000000];
-
-
-/*********************************************************************
-Test for ulint write and read. */
-
-void
-test1(void)
-/*=======*/
-{
- ulint a, i, j;
- ulint tm, oldtm;
-
- printf("-------------------------------------------\n");
- printf("TEST 1. Speed test of ulint read and write \n");
-
- a = 0;
-
- oldtm = ut_clock();
-
- for (j = 0; j < 100; j++) {
- for (i = 0; i < 10000; i++) {
-
- a += mach_read_from_4(arr + i * 4);
- }
- }
-
- tm = ut_clock();
-
- printf("Wall clock time for read of %lu ulints %lu millisecs\n",
- j * i, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (j = 0; j < 100; j++) {
- for (i = 0; i < 10000; i++) {
-
- a += mach_read(arr + i * 4);
- }
- }
-
- tm = ut_clock();
-
- printf("Wall clock time for read of %lu ulints %lu millisecs\n",
- j * i, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (j = 0; j < 100; j++) {
- for (i = 0; i < 10000; i++) {
-
- a += mach_read_from_4(arr + i * 4 + 1);
- }
- }
-
- tm = ut_clock();
-
- printf("Wall clock time for read of %lu ulints %lu millisecs\n",
- j * i, tm - oldtm);
- oldtm = ut_clock();
-
- for (j = 0; j < 100; j++) {
- for (i = 0; i < 10000; i++) {
-
- a += mach_read(arr + i * 4 + 1);
- }
- }
-
- tm = ut_clock();
-
- printf("Wall clock time for read of %lu ulints %lu millisecs\n",
- j * i, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1000000; i++) {
-
- a += mach_read_from_4(arr + i * 4);
- }
-
- tm = ut_clock();
-
- printf("Wall clock time for read of %lu ulints %lu millisecs\n",
- i, tm - oldtm);
- oldtm = ut_clock();
-
- for (i = 0; i < 1000000; i++) {
-
- a += mach_read(arr + i * 4);
- }
-
- tm = ut_clock();
-
- printf("Wall clock time for read of %lu ulints %lu millisecs\n",
- i, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (j = 0; j < 100; j++) {
- for (i = 0; i < 10000; i++) {
-
- a += mach_read_from_2(arr + i * 2);
- }
- }
-
- tm = ut_clock();
-
- printf("Wall clock time for read of %lu 16-bit ints %lu millisecs\n",
- j * i, tm - oldtm);
-}
-
-/*********************************************************************
-Test for ulint write and read. */
-
-void
-test2(void)
-/*=======*/
-{
- ulint a[2];
-
- printf("-------------------------------------------\n");
- printf("TEST 2. Correctness test of ulint read and write \n");
-
- mach_write_to_4((byte*)&a, 737237727);
-
- ut_a(737237727 == mach_read_from_4((byte*)&a));
-
- mach_write_to_2((byte*)&a, 7372);
-
- ut_a(7372 == mach_read_from_2((byte*)&a));
-
- mach_write_to_1((byte*)&a, 27);
-
- ut_a(27 == mach_read_from_1((byte*)&a));
-
- mach_write((byte*)&a, 737237727);
-
- ut_a(737237727 == mach_read((byte*)&a));
-}
-
-void
-main(void)
-{
- test1();
- test2();
-
- printf("TEST SUCCESSFULLY COMPLETED!\n");
-}
diff --git a/innobase/mem/mem0dbg.c b/innobase/mem/mem0dbg.c
index 004197a5b8e..d521143eb47 100644
--- a/innobase/mem/mem0dbg.c
+++ b/innobase/mem/mem0dbg.c
@@ -7,6 +7,7 @@ but is included in mem0mem.* !
Created 6/9/1994 Heikki Tuuri
*************************************************************************/
+#ifdef UNIV_MEM_DEBUG
mutex_t mem_hash_mutex; /* The mutex which protects in the
debug version the hash table containing
the list of live memory heaps, and
@@ -16,12 +17,11 @@ mutex_t mem_hash_mutex; /* The mutex which protects in the
extent of memory allocations. Only used in the debug version.
Protected by mem_hash_mutex above. */
-ulint mem_n_created_heaps = 0;
-ulint mem_n_allocations = 0;
-ulint mem_total_allocated_memory = 0;
-ulint mem_current_allocated_memory = 0;
-ulint mem_max_allocated_memory = 0;
-ulint mem_last_print_info = 0;
+static ulint mem_n_created_heaps = 0;
+static ulint mem_n_allocations = 0;
+static ulint mem_total_allocated_memory = 0;
+ulint mem_current_allocated_memory = 0;
+static ulint mem_max_allocated_memory = 0;
/* Size of the hash table for memory management tracking */
#define MEM_HASH_SIZE 997
@@ -43,12 +43,12 @@ struct mem_hash_node_struct {
typedef UT_LIST_BASE_NODE_T(mem_hash_node_t) mem_hash_cell_t;
/* The hash table of allocated heaps */
-mem_hash_cell_t mem_hash_table[MEM_HASH_SIZE];
+static mem_hash_cell_t mem_hash_table[MEM_HASH_SIZE];
/* The base node of the list of all allocated heaps */
-mem_hash_cell_t mem_all_list_base;
+static mem_hash_cell_t mem_all_list_base;
-ibool mem_hash_initialized = FALSE;
+static ibool mem_hash_initialized = FALSE;
UNIV_INLINE
@@ -65,45 +65,44 @@ mem_hash_get_nth_cell(ulint i)
return(&(mem_hash_table[i]));
}
+#endif /* UNIV_MEM_DEBUG */
/* Accessor functions for a memory field in the debug version */
void
mem_field_header_set_len(byte* field, ulint len)
{
- ut_ad(len >= 0);
-
- mach_write(field - 2 * sizeof(ulint), len);
+ mach_write_to_4(field - 2 * sizeof(ulint), len);
}
ulint
mem_field_header_get_len(byte* field)
{
- return(mach_read(field - 2 * sizeof(ulint)));
+ return(mach_read_from_4(field - 2 * sizeof(ulint)));
}
void
mem_field_header_set_check(byte* field, ulint check)
{
- mach_write(field - sizeof(ulint), check);
+ mach_write_to_4(field - sizeof(ulint), check);
}
ulint
mem_field_header_get_check(byte* field)
{
- return(mach_read(field - sizeof(ulint)));
+ return(mach_read_from_4(field - sizeof(ulint)));
}
void
mem_field_trailer_set_check(byte* field, ulint check)
{
- mach_write(field + mem_field_header_get_len(field), check);
+ mach_write_to_4(field + mem_field_header_get_len(field), check);
}
ulint
mem_field_trailer_get_check(byte* field)
{
- return(mach_read(field +
+ return(mach_read_from_4(field +
mem_field_header_get_len(field)));
}
@@ -164,6 +163,7 @@ mem_field_init(
mem_field_header_set_check(usr_buf, rnd);
mem_field_trailer_set_check(usr_buf, rnd);
+#ifdef UNIV_MEM_DEBUG
/* Update the memory allocation information */
mutex_enter(&mem_hash_mutex);
@@ -182,6 +182,7 @@ mem_field_init(
combination of 0xBA and 0xBE */
mem_init_buf(usr_buf, n);
+#endif /* UNIV_MEM_DEBUG */
}
/**********************************************************************
@@ -191,12 +192,14 @@ void
mem_field_erase(
/*============*/
byte* buf, /* in: memory field */
- ulint n) /* in: how many bytes the user requested */
+ ulint n __attribute__((unused)))
+ /* in: how many bytes the user requested */
{
byte* usr_buf;
usr_buf = buf + MEM_FIELD_HEADER_SIZE;
-
+
+#ifdef UNIV_MEM_DEBUG
mutex_enter(&mem_hash_mutex);
mem_current_allocated_memory -= n;
mutex_exit(&mem_hash_mutex);
@@ -208,8 +211,10 @@ mem_field_erase(
combination of 0xDE and 0xAD */
mem_erase_buf(buf, MEM_SPACE_NEEDED(n));
+#endif /* UNIV_MEM_DEBUG */
}
+#ifdef UNIV_MEM_DEBUG
/*******************************************************************
Initializes a buffer to a random combination of hex BA and BE.
Used to initialize allocated memory. */
@@ -372,6 +377,7 @@ mem_hash_remove(
mutex_exit(&mem_hash_mutex);
}
+#endif /* UNIV_MEM_DEBUG */
/*******************************************************************
Checks a memory heap for consistency and prints the contents if requested.
@@ -408,12 +414,12 @@ mem_heap_validate_or_print(
ulint total_len = 0;
ulint block_count = 0;
ulint phys_len = 0;
- #ifdef UNIV_MEM_DEBUG
+#ifdef UNIV_MEM_DEBUG
ulint len;
byte* field;
byte* user_field;
ulint check_field;
- #endif
+#endif
/* Pessimistically, we set the parameters to error values */
if (us_size != NULL) {
@@ -451,7 +457,7 @@ mem_heap_validate_or_print(
return;
}
- #ifdef UNIV_MEM_DEBUG
+#ifdef UNIV_MEM_DEBUG
/* We can trace the fields of the block only in the debug
version */
if (print) {
@@ -518,7 +524,7 @@ mem_heap_validate_or_print(
return;
}
- #endif
+#endif
block = UT_LIST_GET_NEXT(list, block);
block_count++;
@@ -603,130 +609,7 @@ mem_heap_validate(
return(TRUE);
}
-/*********************************************************************
-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 __attribute__((unused)))
- /* 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
-
- 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);
-}
-
/*********************************************************************
TRUE if no memory is currently allocated. */
@@ -735,8 +618,6 @@ mem_all_freed(void)
/*===============*/
/* out: TRUE if no heaps exist */
{
- #ifdef UNIV_MEM_DEBUG
-
mem_hash_node_t* node;
ulint heap_count = 0;
ulint i;
@@ -764,15 +645,6 @@ mem_all_freed(void)
} else {
return(FALSE);
}
-
- #else
-
- printf(
- "Sorry, non-debug version cannot check if all memory is freed.\n");
-
- return(FALSE);
-
- #endif
}
/*********************************************************************
@@ -783,8 +655,6 @@ mem_validate_no_assert(void)
/*========================*/
/* out: TRUE if error */
{
- #ifdef UNIV_MEM_DEBUG
-
mem_hash_node_t* node;
ulint n_heaps = 0;
ulint allocated_mem;
@@ -843,14 +713,6 @@ mem_validate_no_assert(void)
mutex_exit(&mem_hash_mutex);
return(error);
-
- #else
-
- printf("Sorry, non-debug version cannot validate dynamic memory\n");
-
- return(FALSE);
-
- #endif
}
/****************************************************************
@@ -865,6 +727,7 @@ mem_validate(void)
return(TRUE);
}
+#endif /* UNIV_MEM_DEBUG */
/****************************************************************
Tries to find neigboring memory allocation blocks and dumps to stderr
diff --git a/innobase/mem/mem0mem.c b/innobase/mem/mem0mem.c
index 94cf85dfd63..6de8d0c5f20 100644
--- a/innobase/mem/mem0mem.c
+++ b/innobase/mem/mem0mem.c
@@ -294,13 +294,13 @@ mem_heap_block_free(
init_block = block->init_block;
block->magic_n = MEM_FREED_BLOCK_MAGIC_N;
- #ifdef UNIV_MEM_DEBUG
+#ifdef UNIV_MEM_DEBUG
/* In the debug version we set the memory to a random combination
of hex 0xDE and 0xAD. */
mem_erase_buf((byte*)block, len);
- #endif
+#endif
if (init_block) {
/* Do not have to free: do nothing */
diff --git a/innobase/mem/mem0pool.c b/innobase/mem/mem0pool.c
index 2817e1f12d4..4f1ac2bcd7c 100644
--- a/innobase/mem/mem0pool.c
+++ b/innobase/mem/mem0pool.c
@@ -259,7 +259,9 @@ mem_pool_fill_free_list(
mem_area_t* area2;
ibool ret;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(pool->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (i >= 63) {
/* We come here when we have run out of space in the
@@ -296,7 +298,7 @@ mem_pool_fill_free_list(
if (UT_LIST_GET_LEN(pool->free_list[i + 1]) == 0) {
mem_analyze_corruption((byte*)area);
- ut_a(0);
+ ut_error;
}
UT_LIST_REMOVE(free_list, pool->free_list[i + 1], area);
@@ -374,7 +376,7 @@ mem_area_alloc(
"InnoDB: Probably a race condition because now the area is marked free!\n");
}
- ut_a(0);
+ ut_error;
}
if (UT_LIST_GET_LEN(pool->free_list[n]) == 0) {
@@ -384,7 +386,7 @@ mem_area_alloc(
(ulong) n);
mem_analyze_corruption((byte*)area);
- ut_a(0);
+ ut_error;
}
ut_ad(mem_area_get_size(area) == ut_2_exp(n));
@@ -480,7 +482,7 @@ mem_area_free(
"InnoDB: element is marked free!\n");
mem_analyze_corruption((byte*)area);
- ut_a(0);
+ ut_error;
}
size = mem_area_get_size(area);
@@ -491,7 +493,7 @@ mem_area_free(
"InnoDB: previous allocated area!\n");
mem_analyze_corruption((byte*)area);
- ut_a(0);
+ ut_error;
}
#ifdef UNIV_LIGHT_MEM_DEBUG
@@ -508,7 +510,7 @@ mem_area_free(
(ulong) size, (ulong) next_size);
mem_analyze_corruption((byte*)area);
- ut_a(0);
+ ut_error;
}
}
#endif
diff --git a/innobase/mem/ts/makefile b/innobase/mem/ts/makefile
deleted file mode 100644
index 0f6855322ce..00000000000
--- a/innobase/mem/ts/makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-
-include ..\..\makefile.i
-
-tsmem: ..\mem.lib tsmem.c makefile
- $(CCOM) $(CFL) -I.. -I..\.. ..\mem.lib ..\..\btr.lib ..\..\trx.lib ..\..\pars.lib ..\..\que.lib ..\..\lock.lib ..\..\row.lib ..\..\read.lib ..\..\srv.lib ..\..\com.lib ..\..\usr.lib ..\..\thr.lib ..\..\fut.lib ..\..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\buf.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\os.lib tsmem.c $(LFL)
-
-
-
-
-
-
-
diff --git a/innobase/mem/ts/tsmem.c b/innobase/mem/ts/tsmem.c
deleted file mode 100644
index 4a108251673..00000000000
--- a/innobase/mem/ts/tsmem.c
+++ /dev/null
@@ -1,497 +0,0 @@
-/************************************************************************
-The test module for the memory management of Innobase
-
-(c) 1994, 1995 Innobase Oy
-
-Created 6/10/1994 Heikki Tuuri
-*************************************************************************/
-
-#include "../mem0mem.h"
-#include "sync0sync.h"
-#include "ut0rnd.h"
-
-mem_heap_t* heap_arr[1200];
-
-byte* buf_arr[10000];
-ulint rnd_arr[10000];
-
-
-#ifdef UNIV_DEBUG
-/*********************************************************************
-Debug version test. */
-
-void
-test1(void)
-/*=======*/
-{
- mem_heap_t* heap_1, *heap_2;
- byte* buf_1, *buf_2, *buf_3;
- byte check;
- bool error;
- ulint i;
- ulint j;
- ulint sum;
- ulint user_size;
- ulint phys_size, phys_size_1, phys_size_2;
- ulint n_blocks;
- ulint p;
- byte block[1024];
- byte* top_1, *top_2;
-
- /* For this test to work the memory alignment must be
- even (presumably a reasonable assumption) */
- ut_a(0 == (UNIV_MEM_ALIGNMENT & 1));
-
- printf("-------------------------------------------\n");
- printf("TEST 1. Basic test \n");
-
- heap_1 = mem_heap_create(0);
-
- buf_1 = mem_heap_alloc(heap_1, 11);
-
- heap_2 = mem_heap_create(0);
-
- buf_2 = mem_heap_alloc(heap_1, 15);
-
- /* Test that the field is properly initialized */
- for (i = 0; i < 11; i++) {
- ut_a((*(buf_1 + i) == 0xBA) || (*(buf_1 + i) == 0xBE));
- }
-
- check = *(buf_1 + 11);
-
- mem_validate();
-
- /* Make an advertent error in the heap */
- (*(buf_1 + 11))++;
-
- error = mem_validate_no_assert();
-
- ut_a(error);
-
- /* Fix the error in heap before freeing */
- *(buf_1 + 11) = check;
-
- mem_print_info();
-
- /* Free the top buffer buf_2 */
- mem_heap_free_top(heap_1, 15);
-
- /* Test that the field is properly erased */
- for (i = 0; i < 15; i++) {
- ut_a((*(buf_2 + i) == 0xDE) || (*(buf_2 + i) == 0xAD));
- }
-
- /* Test that a new buffer is allocated from the same position
- as buf_2 */
- buf_3 = mem_heap_alloc(heap_1, 15);
-
- ut_a(buf_3 == buf_2);
-
- mem_heap_free(heap_1);
-
- /* Test that the field is properly erased */
- for (i = 0; i < 11; i++) {
- ut_a((*(buf_1 + i) == 0xDE) || (*(buf_1 + i) == 0xAD));
- }
-
- mem_validate();
-
- mem_print_info();
-
- printf("-------------------------------------------\n");
- printf("TEST 2. Test of massive allocation and freeing\n");
-
- sum = 0;
- for (i = 0; i < 10000; i++) {
-
- j = ut_rnd_gen_ulint() % 16 + 15;
-
- sum = sum + j;
-
- buf_1 = mem_heap_alloc(heap_2, j);
- rnd_arr[i] = j;
-
- buf_arr[i] = buf_1;
-
- ut_a(buf_1 == mem_heap_get_top(heap_2, j));
- }
-
- mem_heap_validate_or_print(heap_2, NULL, FALSE, &error, &user_size,
- &phys_size_1,
- &n_blocks);
-
- ut_a(!error);
- ut_a(user_size == sum);
-
- (*(buf_1 - 1))++;
-
- ut_a(mem_validate_no_assert());
-
- (*(buf_1 - 1))--;
-
- mem_print_info();
-
-
- for (p = 10000; p > 0 ; p--) {
-
- j = rnd_arr[p - 1];
-
- ut_a(buf_arr[p - 1] == mem_heap_get_top(heap_2, j));
- mem_heap_free_top(heap_2, j);
- }
-
- mem_print_info();
-
- mem_heap_free(heap_2);
-
- mem_print_info();
-
- printf("-------------------------------------------\n");
- printf("TEST 3. More tests on the validating \n");
-
- heap_1 = mem_heap_create(UNIV_MEM_ALIGNMENT * 20);
-
- buf_1 = mem_heap_alloc(heap_1, UNIV_MEM_ALIGNMENT * 20);
-
- mem_heap_validate_or_print(heap_1, NULL, FALSE, &error, &user_size,
- &phys_size_1,
- &n_blocks);
-
- ut_a((ulint)(buf_1 - (byte*)heap_1) == (MEM_BLOCK_HEADER_SIZE
- + MEM_FIELD_HEADER_SIZE));
-
- mem_validate();
-
- mem_print_info();
-
- ut_a(user_size == UNIV_MEM_ALIGNMENT * 20);
- ut_a(phys_size_1 == (ulint)(ut_calc_align(MEM_FIELD_HEADER_SIZE
- + UNIV_MEM_ALIGNMENT * 20
- + MEM_FIELD_TRAILER_SIZE,
- UNIV_MEM_ALIGNMENT)
- + MEM_BLOCK_HEADER_SIZE));
-
- ut_a(n_blocks == 1);
-
- buf_2 = mem_heap_alloc(heap_1, UNIV_MEM_ALIGNMENT * 3 - 1);
-
- mem_heap_validate_or_print(heap_1, NULL, FALSE, &error,
- &user_size, &phys_size_2,
- &n_blocks);
-
- printf("Physical size of the heap %ld\n", phys_size_2);
-
- ut_a(!error);
- ut_a(user_size == UNIV_MEM_ALIGNMENT * 23 - 1);
- ut_a(phys_size_2 == (ulint) (phys_size_1
- + ut_calc_align(MEM_FIELD_HEADER_SIZE
- + phys_size_1 * 2
- + MEM_FIELD_TRAILER_SIZE,
- UNIV_MEM_ALIGNMENT)
- + MEM_BLOCK_HEADER_SIZE));
-
- ut_a(n_blocks == 2);
-
- buf_3 = mem_heap_alloc(heap_1, UNIV_MEM_ALIGNMENT * 3 + 5);
-
- ut_a((ulint)(buf_3 - buf_2) == ut_calc_align(
- (UNIV_MEM_ALIGNMENT * 3
- + MEM_FIELD_TRAILER_SIZE),
- UNIV_MEM_ALIGNMENT)
- + MEM_FIELD_HEADER_SIZE);
-
-
- ut_memcpy(buf_3, buf_2, UNIV_MEM_ALIGNMENT * 3);
-
- mem_heap_validate_or_print(heap_1, NULL, FALSE, &error,
- &user_size, &phys_size,
- &n_blocks);
-
- ut_a(!error);
- ut_a(user_size == UNIV_MEM_ALIGNMENT * 26 + 4);
- ut_a(phys_size == phys_size_2);
- ut_a(n_blocks == 2);
-
-
- /* Make an advertent error to buf_3 */
-
- (*(buf_3 - 1))++;
-
- mem_heap_validate_or_print(heap_1, NULL, FALSE, &error,
- &user_size, &phys_size,
- &n_blocks);
-
- ut_a(error);
- ut_a(user_size == 0);
- ut_a(phys_size == 0);
- ut_a(n_blocks == 0);
-
- /* Fix the error and make another */
-
- (*(buf_3 - 1))--;
- (*(buf_3 + UNIV_MEM_ALIGNMENT * 3 + 5))++;
-
- mem_heap_validate_or_print(heap_1, NULL, FALSE, &error,
- &user_size, &phys_size,
- &n_blocks);
-
- ut_a(error);
-
- (*(buf_3 + UNIV_MEM_ALIGNMENT * 3 + 5))--;
-
- buf_1 = mem_heap_alloc(heap_1, UNIV_MEM_ALIGNMENT + 4);
-
- ut_a((ulint)(buf_1 - buf_3) == ut_calc_align(UNIV_MEM_ALIGNMENT * 3 + 5
- + MEM_FIELD_TRAILER_SIZE ,
- UNIV_MEM_ALIGNMENT)
- + MEM_FIELD_HEADER_SIZE);
-
-
- mem_heap_validate_or_print(heap_1, NULL, FALSE, &error,
- &user_size, &phys_size,
- &n_blocks);
-
- ut_a(!error);
- ut_a(user_size == UNIV_MEM_ALIGNMENT * 27 + 8);
- ut_a(phys_size == phys_size_2);
- ut_a(n_blocks == 2);
-
-
- mem_print_info();
-
- mem_heap_free(heap_1);
-
- printf("-------------------------------------------\n");
- printf("TEST 4. Test of massive allocation \n");
- printf("of heaps to test the hash table\n");
-
- for (i = 0; i < 500; i++) {
- heap_arr[i] = mem_heap_create(i);
- buf_2 = mem_heap_alloc(heap_arr[i], 2 * i);
- }
-
- mem_validate();
-
- for (i = 0; i < 500; i++) {
- mem_heap_free(heap_arr[i]);
- }
-
- mem_validate();
-
- mem_print_info();
-
- /* Validating a freed heap should generate an error */
-
- mem_heap_validate_or_print(heap_1, NULL, FALSE, &error,
- NULL, NULL, NULL);
-
- ut_a(error);
-
- printf("-------------------------------------------\n");
- printf("TEST 5. Test of mem_alloc and mem_free \n");
-
- buf_1 = mem_alloc(11100);
- buf_2 = mem_alloc(23);
-
- ut_memcpy(buf_2, buf_1, 23);
-
- mem_validate();
-
- mem_print_info();
-
- mem_free(buf_1);
- mem_free(buf_2);
-
- mem_validate();
-
- printf("-------------------------------------------\n");
- printf("TEST 6. Test of mem_heap_print \n");
-
- heap_1 = mem_heap_create(0);
-
- buf_1 = mem_heap_alloc(heap_1, 7);
-
- ut_memcpy(buf_1, "Pascal", 7);
-
- for (i = 0; i < 10; i++) {
- buf_1 = mem_heap_alloc(heap_1, 6);
- ut_memcpy(buf_1, "Cobol", 6);
- }
-
- printf("A heap with 1 Pascal and 10 Cobol's\n");
- mem_heap_print(heap_1);
-
- for (i = 0; i < 10; i++) {
- mem_heap_free_top(heap_1, 6);
- }
-
- printf("A heap with 1 Pascal and 0 Cobol's\n");
- mem_heap_print(heap_1);
-
- ut_a(mem_all_freed() == FALSE);
-
- mem_heap_free(heap_1);
-
- ut_a(mem_all_freed() == TRUE);
-
- mem_print_info();
-
- printf("-------------------------------------------\n");
- printf("TEST 7. Test of mem_heap_fast_create \n");
-
- heap_1 = mem_heap_fast_create(1024, block);
-
- buf_1 = mem_heap_alloc(heap_1, 7);
-
- ut_memcpy(buf_1, "Pascal", 7);
-
- for (i = 0; i < 1000; i++) {
- buf_1 = mem_heap_alloc(heap_1, 6);
- ut_memcpy(buf_1, "Cobol", 6);
- }
-
- for (i = 0; i < 1000; i++) {
- mem_heap_free_top(heap_1, 6);
- }
-
- ut_a(mem_all_freed() == FALSE);
-
- mem_heap_free(heap_1);
-
- ut_a(mem_all_freed() == TRUE);
-
- mem_print_info();
-
- printf("-------------------------------------------\n");
- printf("TEST 8. Test of heap top freeing \n");
-
- heap_1 = mem_heap_fast_create(1024, block);
-
- top_1 = mem_heap_get_heap_top(heap_1);
-
- buf_1 = mem_heap_alloc(heap_1, 7);
-
- ut_memcpy(buf_1, "Pascal", 7);
-
- for (i = 0; i < 500; i++) {
- buf_1 = mem_heap_alloc(heap_1, 6);
- ut_memcpy(buf_1, "Cobol", 6);
- }
-
- top_2 = mem_heap_get_heap_top(heap_1);
-
- for (i = 0; i < 500; i++) {
- buf_1 = mem_heap_alloc(heap_1, 6);
- ut_memcpy(buf_1, "Cobol", 6);
- }
-
- mem_heap_free_heap_top(heap_1, top_2);
-
- mem_heap_free_heap_top(heap_1, top_1);
-
- ut_a(mem_all_freed() == FALSE);
-
- for (i = 0; i < 500; i++) {
- buf_1 = mem_heap_alloc(heap_1, 6);
- ut_memcpy(buf_1, "Cobol", 6);
-
- }
-
- mem_heap_empty(heap_1);
-
- for (i = 0; i < 500; i++) {
- buf_1 = mem_heap_alloc(heap_1, 6);
- ut_memcpy(buf_1, "Cobol", 6);
-
- }
-
- mem_heap_free(heap_1);
-
- ut_a(mem_all_freed() == TRUE);
-
- mem_print_info();
-
-}
-#endif /* UNIV_DEBUG */
-
-/****************************************************************
-Allocation speed test. */
-
-void
-test2(void)
-/*=======*/
-{
- mem_heap_t* heap;
- ulint tm, oldtm;
- ulint i;
- byte* buf;
- byte block[512];
-
- printf("-------------------------------------------\n");
- printf("TEST B1. Test of speed \n");
-
- oldtm = ut_clock();
-
- for (i = 0; i < 10000 * UNIV_DBC * UNIV_DBC; i++) {
- heap = mem_heap_create(500);
- mem_heap_free(heap);
- }
-
- tm = ut_clock();
-
- printf("Time for %ld heap create-free pairs %ld millisecs.\n",
- i, tm - oldtm);
-
-
- oldtm = ut_clock();
-
- for (i = 0; i < 10000 * UNIV_DBC * UNIV_DBC; i++) {
- heap = mem_heap_fast_create(512, block);
- mem_heap_free(heap);
- }
-
- tm = ut_clock();
-
- printf("Time for %ld heap fast-create-free pairs %ld millisecs.\n",
- i, tm - oldtm);
-
-
- heap = mem_heap_create(500);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 10000 * UNIV_DBC * UNIV_DBC; i++) {
- buf = mem_heap_alloc(heap, 50);
- mem_heap_free_top(heap, 50);
- }
-
- tm = ut_clock();
-
- printf("Time for %ld heap alloc-free-top pairs %ld millisecs.\n",
- i, tm - oldtm);
-
- mem_heap_free(heap);
-}
-
-
-void
-main(void)
-{
- sync_init();
- mem_init(2500000);
-
- #ifdef UNIV_DEBUG
-
- test1();
-
- #endif
-
- test2();
-
- ut_ad(sync_all_freed());
-
- ut_ad(mem_all_freed());
-
- printf("TEST SUCCESSFULLY COMPLETED!\n");
-}
diff --git a/innobase/mtr/mtr0log.c b/innobase/mtr/mtr0log.c
index 4b5d7e61de6..5a4aaa2377d 100644
--- a/innobase/mtr/mtr0log.c
+++ b/innobase/mtr/mtr0log.c
@@ -59,7 +59,7 @@ mlog_write_initial_log_record(
fprintf(stderr,
"InnoDB: Error: trying to write to a stray memory location %lx\n",
(ulong) ptr);
- ut_a(0);
+ ut_error;
}
log_ptr = mlog_open(mtr, 20);
@@ -222,7 +222,7 @@ mlog_write_ulint(
fprintf(stderr,
"InnoDB: Error: trying to write to a stray memory location %lx\n",
(ulong) ptr);
- ut_a(0);
+ ut_error;
}
if (type == MLOG_1BYTE) {
@@ -261,7 +261,6 @@ mlog_write_dulint(
/*==============*/
byte* ptr, /* in: pointer where to write */
dulint val, /* in: value to write */
- byte type, /* in: MLOG_8BYTES */
mtr_t* mtr) /* in: mini-transaction handle */
{
byte* log_ptr;
@@ -270,11 +269,10 @@ mlog_write_dulint(
fprintf(stderr,
"InnoDB: Error: trying to write to a stray memory location %lx\n",
(ulong) ptr);
- ut_a(0);
+ ut_error;
}
ut_ad(ptr && mtr);
- ut_ad(type == MLOG_8BYTES);
mach_write_to_8(ptr, val);
@@ -286,7 +284,8 @@ mlog_write_dulint(
return;
}
- log_ptr = mlog_write_initial_log_record_fast(ptr, type, log_ptr, mtr);
+ log_ptr = mlog_write_initial_log_record_fast(ptr, MLOG_8BYTES,
+ log_ptr, mtr);
mach_write_to_2(log_ptr, ptr - buf_frame_align(ptr));
log_ptr += 2;
@@ -314,7 +313,7 @@ mlog_write_string(
fprintf(stderr,
"InnoDB: Error: trying to write to a stray memory location %lx\n",
(ulong) ptr);
- ut_a(0);
+ ut_error;
}
ut_ad(ptr && mtr);
ut_a(len < UNIV_PAGE_SIZE);
diff --git a/innobase/mtr/mtr0mtr.c b/innobase/mtr/mtr0mtr.c
index 63ce491523b..ac1a638063d 100644
--- a/innobase/mtr/mtr0mtr.c
+++ b/innobase/mtr/mtr0mtr.c
@@ -171,7 +171,7 @@ mtr_log_parse_full_page(
/****************************************************************
Writes to the database log the full contents of the pages that this mtr has
modified. */
-
+static
void
mtr_log_write_backup_full_pages(
/*============================*/
@@ -495,13 +495,11 @@ mtr_read_dulint(
/*===========*/
/* out: value read */
byte* ptr, /* in: pointer from where to read */
- ulint type __attribute__((unused)), /* in: MLOG_8BYTES */
mtr_t* mtr __attribute__((unused)))
/* in: mini-transaction handle */
{
ut_ad(mtr->state == MTR_ACTIVE);
ut_ad(ptr && mtr);
- ut_ad(type == MLOG_8BYTES);
ut_ad(mtr_memo_contains(mtr, buf_block_align(ptr),
MTR_MEMO_PAGE_S_FIX) ||
mtr_memo_contains(mtr, buf_block_align(ptr),
diff --git a/innobase/mtr/ts/makefile b/innobase/mtr/ts/makefile
deleted file mode 100644
index 3a155fb1401..00000000000
--- a/innobase/mtr/ts/makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-include ..\..\makefile.i
-
-tsmtr: ..\mtr.lib tsmtr.c
- $(CCOM) $(CFL) -I.. -I..\.. ..\mtr.lib ..\..\dyn.lib ..\..\log.lib ..\..\mach.lib ..\..\buf.lib ..\..\fil.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tsmtr.c $(LFL)
-
diff --git a/innobase/mtr/ts/tsbuf.c b/innobase/mtr/ts/tsbuf.c
deleted file mode 100644
index a2a18d7afaf..00000000000
--- a/innobase/mtr/ts/tsbuf.c
+++ /dev/null
@@ -1,531 +0,0 @@
-/************************************************************************
-The test module for the file system and buffer manager
-
-(c) 1995 Innobase Oy
-
-Created 11/16/1995 Heikki Tuuri
-*************************************************************************/
-
-#include "os0thread.h"
-#include "os0file.h"
-#include "ut0ut.h"
-#include "sync0sync.h"
-#include "mem0mem.h"
-#include "fil0fil.h"
-#include "..\buf0buf.h"
-#include "..\buf0flu.h"
-#include "..\buf0lru.h"
-
-os_file_t files[1000];
-
-mutex_t ios_mutex;
-ulint ios;
-ulint n[5];
-
-
-/************************************************************************
-Io-handler thread function. */
-
-ulint
-handler_thread(
-/*===========*/
- void* arg)
-{
- ulint segment;
- void* mess;
- ulint i;
- bool ret;
-
- segment = *((ulint*)arg);
-
- printf("Thread %lu starts\n", segment);
-
- for (i = 0;; i++) {
- ret = fil_aio_wait(segment, &mess);
- ut_a(ret);
-
- buf_page_io_complete((buf_block_t*)mess);
-
- mutex_enter(&ios_mutex);
- ios++;
- mutex_exit(&ios_mutex);
-
- }
-
- return(0);
-}
-
-/************************************************************************
-Creates the test database files. */
-
-void
-create_db(void)
-/*===========*/
-{
- ulint i;
- buf_block_t* block;
- byte* frame;
- ulint j;
- ulint tm, oldtm;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1; i++) {
- for (j = 0; j < 4096; j++) {
- block = buf_page_create(i, j);
-
- frame = buf_block_get_frame(block);
-
- rw_lock_x_lock(buf_page_get_lock(block));
-
- if (j > 0) {
- fil_page_set_prev(frame, j - 1);
- } else {
- fil_page_set_prev(frame, 0);
- }
-
- if (j < 4095) {
- fil_page_set_next(frame, j + 1);
- } else {
- fil_page_set_next(frame, 0);
- }
-
- *((ulint*)(frame + 16)) = j;
-
- buf_page_note_modification(block);
-
- rw_lock_x_unlock(buf_page_get_lock(block));
-
- buf_page_release(block);
- }
- }
-
- tm = ut_clock();
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
-
-/* buf_LRU_print(); */
-
- /* Flush the pool of dirty pages by reading low-offset pages */
- for (i = 0; i < 1000; i++) {
-
- block = buf_page_get(0, i, NULL);
-
- frame = buf_block_get_frame(block);
-
- rw_lock_s_lock(buf_page_get_lock(block));
-
- ut_a(*((ulint*)(frame + 16)) == i);
-
- rw_lock_s_unlock(buf_page_get_lock(block));
-
- buf_page_release(block);
- }
-
-/* buf_LRU_print(); */
-
- os_thread_sleep(1000000);
-
- ut_a(buf_all_freed());
-}
-
-/*************************************************************************
-Creates the files for the file system test and inserts them to
-the file system. */
-
-void
-create_files(void)
-/*==============*/
-{
- bool ret;
- ulint i, k;
- char name[10];
- os_thread_t thr[5];
- os_thread_id_t id[5];
-
- name[0] = 't';
- name[1] = 's';
- name[2] = 'f';
- name[3] = 'i';
- name[4] = 'l';
- name[5] = 'e';
- name[8] = '\0';
-
- for (k = 0; k < 1; k++) {
- for (i = 0; i < 1; i++) {
-
- name[6] = (char)(k + (ulint)'a');
- name[7] = (char)(i + (ulint)'a');
-
- files[i] = os_file_create("j:\\tsfile4", OS_FILE_CREATE,
- OS_FILE_TABLESPACE, &ret);
-
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(
- "j:\\tsfile4", OS_FILE_OPEN,
- OS_FILE_TABLESPACE, &ret);
-
- ut_a(ret);
- }
-
- ret = os_file_set_size(files[i], 4096 * 8192, 0);
- ut_a(ret);
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create("noname", k, OS_FILE_TABLESPACE);
- }
-
- ut_a(fil_validate());
-
- fil_node_create("j:\\tsfile4", 4096, k);
- }
- }
-
- ios = 0;
-
- mutex_create(&ios_mutex);
-
- for (i = 0; i < 5; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(handler_thread, n + i, id + i);
- }
-}
-
-/************************************************************************
-Reads the test database files. */
-
-void
-test1(void)
-/*=======*/
-{
- ulint i, j, k;
- buf_block_t* block;
- byte* frame;
- ulint tm, oldtm;
-
- buf_flush_batch(BUF_FLUSH_LIST, 1000);
-
- os_thread_sleep(1000000);
-
- buf_all_freed();
-
- oldtm = ut_clock();
-
- for (k = 0; k < 1; k++) {
- for (i = 0; i < 1; i++) {
- for (j = 0; j < 409; j++) {
- block = buf_page_get(i, j, NULL);
-
- frame = buf_block_get_frame(block);
-
- rw_lock_s_lock(buf_page_get_lock(block));
-
- ut_a(*((ulint*)(frame + 16)) == j);
-
- rw_lock_s_unlock(buf_page_get_lock(block));
-
- buf_page_release(block);
- }
- }
- }
-
- tm = ut_clock();
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
-
-}
-
-/************************************************************************
-Reads the test database files. */
-
-void
-test2(void)
-/*=======*/
-{
- ulint i, j, k, rnd;
- buf_block_t* block;
- byte* frame;
- ulint tm, oldtm;
-
- oldtm = ut_clock();
-
- rnd = 123;
-
- for (k = 0; k < 100; k++) {
- rnd += 23651;
- rnd = rnd % 4096;
-
- i = rnd / 4096;
- j = rnd % 2048;
-
- block = buf_page_get(i, j, NULL);
-
- frame = buf_block_get_frame(block);
-
- rw_lock_s_lock(buf_page_get_lock(block));
-
- ut_a(*((ulint*)(frame + 16)) == j);
-
- rw_lock_s_unlock(buf_page_get_lock(block));
-
- buf_page_release(block);
- }
-
- tm = ut_clock();
- printf("Wall clock time for random read %lu milliseconds\n",
- tm - oldtm);
-}
-
-/************************************************************************
-Reads the test database files. */
-
-void
-test4(void)
-/*=======*/
-{
- ulint i, j, k, rnd;
- buf_block_t* block;
- byte* frame;
- ulint tm, oldtm;
-
- /* Flush the pool of high-offset pages */
- for (i = 0; i < 1000; i++) {
-
- block = buf_page_get(0, i, NULL);
-
- frame = buf_block_get_frame(block);
-
- rw_lock_s_lock(buf_page_get_lock(block));
-
- ut_a(*((ulint*)(frame + 16)) == i);
-
- rw_lock_s_unlock(buf_page_get_lock(block));
-
- buf_page_release(block);
- }
-
- printf("Test starts\n");
-
- oldtm = ut_clock();
-
- rnd = 123;
-
- for (k = 0; k < 400; k++) {
-
- rnd += 4357;
-
- i = 0;
- j = 1001 + rnd % 3000;
-
- block = buf_page_get(i, j, NULL);
-
- frame = buf_block_get_frame(block);
-
- rw_lock_s_lock(buf_page_get_lock(block));
-
- ut_a(*((ulint*)(frame + 16)) == j);
-
- rw_lock_s_unlock(buf_page_get_lock(block));
-
- buf_page_release(block);
- }
-
- tm = ut_clock();
- printf(
- "Wall clock time for %lu random no read-ahead %lu milliseconds\n",
- k, tm - oldtm);
-
- /* Flush the pool of high-offset pages */
- for (i = 0; i < 1000; i++) {
-
- block = buf_page_get(0, i, NULL);
-
- frame = buf_block_get_frame(block);
-
- rw_lock_s_lock(buf_page_get_lock(block));
-
- ut_a(*((ulint*)(frame + 16)) == i);
-
- rw_lock_s_unlock(buf_page_get_lock(block));
-
- buf_page_release(block);
- }
-
- printf("Test starts\n");
-
- oldtm = ut_clock();
-
- rnd = 123;
-
- for (k = 0; k < 400; k++) {
-
- rnd += 4357;
-
- i = 0;
- j = 1001 + rnd % 400;
-
- block = buf_page_get(i, j, NULL);
-
- frame = buf_block_get_frame(block);
-
- rw_lock_s_lock(buf_page_get_lock(block));
-
- ut_a(*((ulint*)(frame + 16)) == j);
-
- rw_lock_s_unlock(buf_page_get_lock(block));
-
- buf_page_release(block);
- }
-
- tm = ut_clock();
- printf(
- "Wall clock time for %lu random read-ahead %lu milliseconds\n",
- k, tm - oldtm);
-
-}
-
-/************************************************************************
-Tests speed of CPU algorithms. */
-
-void
-test3(void)
-/*=======*/
-{
- ulint i, j;
- buf_block_t* block;
- ulint tm, oldtm;
-
- for (i = 0; i < 400; i++) {
-
- block = buf_page_get(0, i, NULL);
-
- buf_page_release(block);
- }
-
- os_thread_sleep(2000000);
-
- oldtm = ut_clock();
-
- for (j = 0; j < 500; j++) {
- for (i = 0; i < 200; i++) {
-
- block = buf_page_get(0, i, NULL);
-
-/*
- rw_lock_s_lock(buf_page_get_lock(block));
-
- rw_lock_s_unlock(buf_page_get_lock(block));
-*/
-
- buf_page_release(block);
-
- }
- }
-
- tm = ut_clock();
- printf("Wall clock time for %lu page get-release %lu milliseconds\n",
- i * j, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (j = 0; j < 500; j++) {
- for (i = 0; i < 200; i++) {
-
- buf_block_get(block);
-/*
- rw_lock_s_lock(buf_page_get_lock(block));
-
- rw_lock_s_unlock(buf_page_get_lock(block));
-*/
- buf_page_release(block);
- }
- }
-
- tm = ut_clock();
- printf("Wall clock time for %lu block get-release %lu milliseconds\n",
- i * j, tm - oldtm);
-
-
- oldtm = ut_clock();
-
- for (i = 0; i < 100000; i++) {
- block = buf_block_alloc();
- buf_block_free(block);
- }
-
- tm = ut_clock();
- printf("Wall clock time for %lu block alloc-free %lu milliseconds\n",
- i, tm - oldtm);
-
- ha_print_info(buf_pool->page_hash);
-}
-
-/************************************************************************
-Frees the spaces in the file system. */
-
-void
-free_system(void)
-/*=============*/
-{
- ulint i;
-
- for (i = 0; i < 1; i++) {
- fil_space_free(i);
- }
-}
-
-/************************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
- ulint n;
-
- oldtm = ut_clock();
-
- os_aio_init(160, 5);
- sync_init();
- mem_init();
- fil_init(26); /* Allow 25 open files at a time */
- buf_pool_init(1000, 1000);
-
- buf_validate();
-
- ut_a(fil_validate());
-
- create_files();
-
- create_db();
-
- buf_validate();
-
- test1();
-
- test3();
-
- test4();
-
- test2();
-
- buf_validate();
-
- n = buf_flush_batch(BUF_FLUSH_LIST, 500);
-
- os_thread_sleep(1000000);
-
- buf_all_freed();
-
- free_system();
-
- tm = ut_clock();
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/mtr/ts/tsmtr.c b/innobase/mtr/ts/tsmtr.c
deleted file mode 100644
index 42997cd2699..00000000000
--- a/innobase/mtr/ts/tsmtr.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/************************************************************************
-The test module for the mini-transaction utilities
-
-(c) 1995 Innobase Oy
-
-Created 11/26/1995 Heikki Tuuri
-*************************************************************************/
-
-#include "sync0sync.h"
-#include "sync0rw.h"
-#include "mem0mem.h"
-#include "log0log.h"
-#include "..\mtr0mtr.h"
-#include "..\mtr0log.h"
-
-rw_lock_t rwl[MTR_BUF_MEMO_SIZE];
-
-/*********************************************************************
-Test for mtr buffer */
-
-void
-test1(void)
-/*=======*/
-{
- ulint i;
- mtr_t mtr;
-
- printf("-------------------------------------------\n");
- printf("MTR-TEST 1. Test of mtr buffer\n");
-
- mtr_start(&mtr);
-
- for (i = 0; i < MTR_BUF_MEMO_SIZE; i++) {
- rw_lock_create(rwl + i);
- }
-
- for (i = 0; i < MTR_BUF_MEMO_SIZE; i++) {
- rw_lock_s_lock(rwl + i);
- mtr_memo_push(&mtr, rwl + i, MTR_MEMO_S_LOCK);
- }
-
- mtr_commit(&mtr);
-
- rw_lock_list_print_info();
- ut_ad(rw_lock_n_locked() == 0);
-
-}
-
-/************************************************************************
-Speed test function. */
-void
-speed_mtr(void)
-/*===========*/
-{
- mtr_t mtr;
-
- mtr_start(&mtr);
-
- mtr_s_lock(rwl, &mtr);
- mtr_s_lock(rwl + 1, &mtr);
- mtr_s_lock(rwl + 2, &mtr);
-
- mtr_commit(&mtr);
-}
-
-/************************************************************************
-Speed test function without mtr. */
-void
-speed_no_mtr(void)
-/*===========*/
-{
- rw_lock_s_lock(rwl);
- rw_lock_s_lock(rwl + 1);
- rw_lock_s_lock(rwl + 2);
- rw_lock_s_unlock(rwl + 2);
- rw_lock_s_unlock(rwl + 1);
- rw_lock_s_unlock(rwl);
-}
-
-/************************************************************************
-Speed test function. */
-
-void
-test2(void)
-/*======*/
-{
- ulint tm, oldtm;
- ulint i, j;
- mtr_t mtr;
- byte buf[50];
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1000 * UNIV_DBC * UNIV_DBC; i++) {
- speed_mtr();
- }
-
- tm = ut_clock();
- printf("Wall clock time for %lu mtrs %lu milliseconds\n",
- i, tm - oldtm);
- oldtm = ut_clock();
-
- for (i = 0; i < 1000 * UNIV_DBC * UNIV_DBC; i++) {
- speed_no_mtr();
- }
-
- tm = ut_clock();
- printf("Wall clock time for %lu no-mtrs %lu milliseconds\n",
- i, tm - oldtm);
-
- oldtm = ut_clock();
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
- mtr_start(&mtr);
- for (j = 0; j < 250; j++) {
- mlog_catenate_ulint(&mtr, 5, MLOG_1BYTE);
- mlog_catenate_ulint(&mtr, i, MLOG_4BYTES);
- mlog_catenate_ulint(&mtr, i + 1, MLOG_4BYTES);
- mlog_catenate_string(&mtr, buf, 50);
- }
- mtr_commit(&mtr);
- }
- tm = ut_clock();
- printf("Wall clock time for %lu log writes %lu milliseconds\n",
- i * j, tm - oldtm);
- mtr_start(&mtr);
- for (j = 0; j < 250; j++) {
- mlog_catenate_ulint(&mtr, 5, MLOG_1BYTE);
- mlog_catenate_ulint(&mtr, i, MLOG_4BYTES);
- mlog_catenate_ulint(&mtr, i + 1, MLOG_4BYTES);
- mlog_catenate_string(&mtr, buf, 50);
- }
-
- mtr_print(&mtr);
- mtr_commit(&mtr);
-}
-
-/************************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
-
- oldtm = ut_clock();
-
- sync_init();
- mem_init();
- log_init();
-
- test1();
- test2();
-
- tm = ut_clock();
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/odbc/Makefile.am b/innobase/odbc/Makefile.am
deleted file mode 100644
index f4282ba3907..00000000000
--- a/innobase/odbc/Makefile.am
+++ /dev/null
@@ -1,24 +0,0 @@
-# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
-# & Innobase Oy
-#
-# 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 ../include/Makefile.i
-
-noinst_LIBRARIES = libodbc.a
-
-libodbc_a_SOURCES = odbc0odbc.c
-
-EXTRA_PROGRAMS =
diff --git a/innobase/odbc/makefilewin b/innobase/odbc/makefilewin
deleted file mode 100644
index 969043e096d..00000000000
--- a/innobase/odbc/makefilewin
+++ /dev/null
@@ -1,7 +0,0 @@
-include ..\include\makefile.i
-
-innobase.lib: odbc0odbc.obj
- lib -out:..\libs\innobase.lib odbc0odbc.obj ..\libs\btr.lib ..\libs\eval.lib ..\libs\ibuf.lib ..\libs\trx.lib ..\libs\pars.lib ..\libs\que.lib ..\libs\lock.lib ..\libs\row.lib ..\libs\read.lib ..\libs\srv.lib ..\libs\com.lib ..\libs\usr.lib ..\libs\thr.lib ..\libs\fut.lib ..\libs\fsp.lib ..\libs\page.lib ..\libs\dyn.lib ..\libs\mtr.lib ..\libs\log.lib ..\libs\rem.lib ..\libs\fil.lib ..\libs\buf.lib ..\libs\dict.lib ..\libs\data.lib ..\libs\mach.lib ..\libs\ha.lib ..\libs\ut.lib ..\libs\sync.lib ..\libs\mem.lib ..\libs\os.lib
-
-odbc0odbc.obj: odbc0odbc.c
- $(CCOM) $(CFL) -c odbc0odbc.c
diff --git a/innobase/odbc/odbc0dummy.c b/innobase/odbc/odbc0dummy.c
deleted file mode 100644
index e44677aa266..00000000000
--- a/innobase/odbc/odbc0dummy.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Used to screen off linker 'undefined symbol' errors
-when making an ODBC client library */
-
-
-unsigned long srv_test_cache_evict;
-
-void buf_frame_alloc(void)
-{}
-
-void buf_frame_free(void)
-{}
-
-void trx_create(void)
-{}
-
-void* kernel_mutex_temp;
-
-void trx_sig_send(void)
-{}
-
-void rec_sprintf(void)
-{}
-
-void dtuple_sprintf(void)
-{}
-
-void pars_write_query_param_info (void)
-{}
-
-void que_graph_try_free (void)
-{}
-
-void pars_sql (void)
-{}
-
-void que_run_threads (void)
-{}
-
-void que_fork_start_command(void)
-{}
-
-void dict_procedure_add_to_cache(void)
-{}
-
-void dict_mem_procedure_create(void)
-{}
-
-void pars_proc_read_input_params_from_buf(void)
-{}
-
-void dict_procedure_reserve_parsed_copy(void)
-{}
-
-void* srv_sys;
-
-void* srv_print_latch_waits;
-
-void* srv_spin_wait_delay;
-
-void* srv_n_spin_wait_rounds;
-
-void* buf_debug_prints;
diff --git a/innobase/odbc/odbc0odbc.c b/innobase/odbc/odbc0odbc.c
deleted file mode 100644
index 0deb17c6714..00000000000
--- a/innobase/odbc/odbc0odbc.c
+++ /dev/null
@@ -1,714 +0,0 @@
-/******************************************************
-Innobase ODBC client library
-
-(c) 1998 Innobase Oy
-
-Created 2/22/1998 Heikki Tuuri
-*******************************************************/
-
-#include "odbc0odbc.h"
-
-#include "mem0mem.h"
-#include "com0com.h"
-#include "usr0sess.h"
-
-#define ODBC_STAT_INITIAL 1
-#define ODBC_STAT_PREPARED 2
-#define ODBC_STAT_EXECUTED 3
-
-
-typedef struct odbc_conn_struct odbc_conn_t;
-typedef struct odbc_env_struct odbc_env_t;
-
-/* ODBC parameter description struct */
-
-typedef struct odbc_param_struct odbc_param_t;
-struct odbc_param_struct{
- ulint data_type; /* SQL_CHAR, ... */
- ibool is_input; /* TRUE if an input parameter of a stored
- procedure, FALSE if an output parameter */
- byte* buf; /* buffer where the value is stored before
- SQLExecute, or where it comes after SQLExecute
- in the case of an output parameter */
- lint* data_len; /* pointer to where the data len or the value
- SQL_NULL_DATA is stored */
- ulint buf_len; /* buffer size */
-};
-
-/* ODBC statement data structure */
-
-typedef struct odbc_stat_struct odbc_stat_t;
-struct odbc_stat_struct{
- ulint state; /* ODBC_STAT_INITIAL,
- ODBC_STAT_PREPARED,
- ODBC_STAT_EXECUTED */
- ulint id; /* statement id */
- ulint n_params; /* number of parameters */
- odbc_param_t* params; /* pointer to an array describing
- the parameters, if any */
- ulint n_params_bound; /* number of parameters that have
- been bound: the statement cannot be
- executed before n_params_bound
- == n_params */
- byte* error_msg; /* possible error message, or NULL;
- allocated separately from dynamic
- memory */
- ulint error_msg_len; /* error mesage length if it is
- non-NULL */
- odbc_conn_t* conn; /* connection */
- UT_LIST_NODE_T(odbc_stat_t)
- stat_list; /* list of the statements of the
- connection */
-};
-
-/* ODBC connection data structure */
-
-struct odbc_conn_struct{
- ibool connected; /* TRUE if connected */
- char* server_name; /* server name where connected
- (= server address) */
- ulint server_name_len;/* length of the server name */
- com_endpoint_t* com_endpoint; /* connection endpoint for this client
- connection */
- dulint out_msg_count; /* count of outgoing messages */
- byte* out_datagram_buf;/* buffer for outgoing datagrams to
- the server */
- byte* in_datagram_buf;/* buffer for incoming datagrams from
- the server */
- byte* addr_buf; /* buffer for the address from which
- an incoming datagram came; in practice,
- this will be the server address */
- dulint sess_id; /* user session id, once the
- connection to the server is
- established */
- odbc_env_t* env; /* environment */
- UT_LIST_BASE_NODE_T(odbc_stat_t)
- stat_list; /* list of the statements of the
- connection */
- UT_LIST_NODE_T(odbc_conn_t)
- conn_list; /* list of the connections of the
- environment */
-};
-
-/* ODBC environment data structure */
-
-struct odbc_env_struct{
- UT_LIST_BASE_NODE_T(odbc_conn_t) conn_list;
- /* list of the connections of the
- environment */
-};
-
-/**************************************************************************
-Gets the nth parameter description struct for a statement. */
-UNIV_INLINE
-odbc_param_t*
-stat_get_nth_param(
-/*===============*/
- /* out: nth parameter */
- odbc_stat_t* stat, /* in: pointer to statement handle */
- ulint i) /* in: parameter index */
-{
- ut_ad(stat->n_params > i);
-
- return(stat->params + i);
-}
-
-/**************************************************************************
-Allocates an SQL environment. */
-
-RETCODE
-SQLAllocEnv(
-/*========*/
- /* out: SQL_SUCCESS */
- HENV* phenv) /* out: pointer to an environment handle */
-{
- odbc_env_t* env;
-
- if (!sync_initialized) {
- sync_init();
- mem_init(2000000);
- }
-
- env = mem_alloc(sizeof(odbc_env_t));
-
- UT_LIST_INIT(env->conn_list);
-
- *phenv = env;
-
- return(SQL_SUCCESS);
-}
-
-/**************************************************************************
-Allocates an SQL connection. */
-
-RETCODE
-SQLAllocConnect(
-/*============*/
- /* out: SQL_SUCCESS */
- HENV henv, /* in: pointer to an environment handle */
- HDBC* phdbc) /* out: pointer to a connection handle */
-{
- odbc_conn_t* conn;
- odbc_env_t* env;
-
- ut_a(henv);
-
- env = henv;
- conn = mem_alloc(sizeof(odbc_conn_t));
-
- conn->connected = FALSE;
- conn->env = env;
-
- UT_LIST_INIT(conn->stat_list);
-
- UT_LIST_ADD_LAST(conn_list, env->conn_list, conn);
-
- *phdbc = conn;
-
- return(SQL_SUCCESS);
-}
-
-/**************************************************************************
-Allocates an SQL statement. */
-
-RETCODE
-SQLAllocStmt(
-/*=========*/
- HDBC hdbc, /* in: SQL connection */
- HSTMT* phstmt) /* out: pointer to a statement handle */
-{
- odbc_conn_t* conn;
- odbc_stat_t* stat;
-
- ut_a(hdbc);
-
- conn = hdbc;
-
- stat = mem_alloc(sizeof(odbc_stat_t));
-
- stat->state = ODBC_STAT_INITIAL;
- stat->error_msg = NULL;
- stat->conn = conn;
-
- UT_LIST_ADD_LAST(stat_list, conn->stat_list, stat);
-
- *phstmt = stat;
-
- return(SQL_SUCCESS);
-}
-
-/**************************************************************************
-Sends the message in datagram_buf to the server. */
-static
-void
-odbc_send_cli_msg(
-/*==============*/
- odbc_conn_t* conn, /* in: connection, does not have to be
- connected yet */
- ulint len) /* in: message length (excluding the standard
- header of size SESS_CLI_MSG_DATA) */
-{
- ulint ret;
- ulint fold;
- byte* msg;
-
- ut_a(len + SESS_CLI_MSG_DATA <= ODBC_DATAGRAM_SIZE);
-
- msg = conn->out_datagram_buf;
-
- mach_write_to_8(msg + SESS_CLI_MSG_NO, conn->out_msg_count);
-
- UT_DULINT_INC(conn->out_msg_count);
-
- fold = ut_fold_binary(msg + 4, len + SESS_CLI_MSG_DATA - 4);
-
- ut_ad(SESS_CLI_MSG_CHECKSUM == 0);
-
- mach_write_to_4(msg + SESS_CLI_MSG_CHECKSUM, fold);
-
- ret = com_sendto(conn->com_endpoint, msg, SESS_CLI_MSG_DATA + len,
- conn->server_name, conn->server_name_len);
- ut_a(ret == 0);
-}
-
-/**************************************************************************
-Receives a message in datagram_buf from the server. */
-static
-void
-odbc_recv_srv_msg(
-/*==============*/
- odbc_conn_t* conn, /* in: connection, does not have to be
- connected yet */
- ulint* len) /* out: received message length (excluding the
- standard header of size SESS_SRV_MSG_DATA) */
-{
- ulint total_len;
- ulint addr_len;
- ulint ret;
-
- ret = com_recvfrom(conn->com_endpoint, conn->in_datagram_buf,
- ODBC_DATAGRAM_SIZE, &total_len, (char*)conn->addr_buf,
- ODBC_ADDRESS_SIZE, &addr_len);
- ut_a(ret == 0);
- ut_a(total_len >= SESS_SRV_MSG_DATA);
-
- *len = total_len - SESS_SRV_MSG_DATA;
-}
-
-/**************************************************************************
-Connects to a database server process (establishes a connection and a
-session). */
-
-RETCODE
-SQLConnect(
-/*=======*/
- /* out: SQL_SUCCESS */
- HDBC hdbc, /* in: SQL connection handle */
- UCHAR* szDSN, /* in: data source name (server name) */
- SWORD cbDSN, /* in: data source name length */
- UCHAR* szUID, /* in: user name */
- SWORD cbUID, /* in: user name length */
- UCHAR* szAuthStr, /* in: password */
- SWORD cbAuthStr) /* in: password length */
-{
- com_endpoint_t* ep;
- odbc_conn_t* conn;
- ulint err;
- ulint size;
- byte* msg;
- ulint len;
- UCHAR catenated_name[100];
-
- ut_a(hdbc && szDSN);
-
- UT_NOT_USED(szUID);
- UT_NOT_USED(cbUID);
- UT_NOT_USED(szAuthStr);
- UT_NOT_USED(cbAuthStr);
-
- conn = hdbc;
-
- ut_a(!conn->connected);
-
- conn->server_name = mem_alloc(cbDSN);
- ut_memcpy(conn->server_name, szDSN, cbDSN);
-
- conn->server_name_len = cbDSN;
-
- ep = com_endpoint_create(COM_SHM);
-
- ut_a(ep);
-
- conn->com_endpoint = ep;
-
- conn->out_msg_count = ut_dulint_zero;
-
- size = ODBC_DATAGRAM_SIZE;
-
- err = com_endpoint_set_option(ep, COM_OPT_MAX_DGRAM_SIZE,
- (byte*)&size, 4);
- ut_a(err == 0);
-
- /* Make the data source name catenated to user name as the
- address of the communications endpoint */
-
- ut_a((ulint)cbDSN + (ulint)cbUID < 100);
-
- ut_memcpy(catenated_name, szDSN, (ulint)cbDSN);
- ut_memcpy(catenated_name + (ulint)cbDSN, szUID, (ulint)cbUID);
-
- err = com_bind(ep, (char*)catenated_name, (ulint)cbDSN
- + (ulint)cbUID);
- ut_a(err == 0);
-
- conn->in_datagram_buf = mem_alloc(ODBC_DATAGRAM_SIZE);
-
- msg = mem_alloc(ODBC_DATAGRAM_SIZE);
-
- conn->out_datagram_buf = msg;
- conn->addr_buf = mem_alloc(ODBC_ADDRESS_SIZE);
-
- /* Set the session id to dulint 0 as we are not yet connected */
-
- sess_cli_msg_set_sess(msg, ut_dulint_zero);
- sess_cli_msg_set_type(msg, SESS_CLI_CONNECT);
-
- /*------------------------------------------*/
-
- odbc_send_cli_msg(conn, 0);
-
- odbc_recv_srv_msg(conn, &len);
-
- /*------------------------------------------*/
-
- ut_a(len == 0);
- ut_a(sess_srv_msg_get_type(conn->in_datagram_buf)
- == SESS_SRV_ACCEPT_CONNECT);
-
- conn->sess_id = mach_read_from_8(conn->in_datagram_buf
- + SESS_SRV_MSG_SESS_ID);
-
- /* Write the session id to out_datagram_buf: it will not be rewritten
- until the connection is closed, as the session id will stay the same */
-
- sess_cli_msg_set_sess(msg, conn->sess_id);
-
- /* We currently only send single part messages: the following will
- stay 0 during the connection */
-
- mach_write_to_4(msg + SESS_CLI_MSG_CONTINUE, 0);
- mach_write_to_4(msg + SESS_CLI_MSG_CONT_SIZE, 0);
-
- conn->connected = TRUE;
-
- return(SQL_SUCCESS);
-}
-
-/**************************************************************************
-Stores an error message to a statement handle, so that it can be later
-queried with SQLError. */
-static
-void
-odbc_stat_store_error_msg(
-/*======================*/
- odbc_stat_t* stat, /* in: statement handle */
- byte* msg, /* in: error message sent by the server */
- ulint len) /* in: length of msg */
-{
- if (stat->error_msg) {
- mem_free(stat->error_msg);
- }
-
- stat->error_msg_len = len;
-
- len += SESS_SRV_MSG_DATA;
-
- stat->error_msg = mem_alloc(len);
- ut_memcpy(stat->error_msg, msg, len);
-}
-
-/**************************************************************************
-Queries an error message. */
-
-RETCODE
-SQLError(
-/*=====*/
- /* out: SQL_SUCCESS or SQL_NO_DATA_FOUND */
- HENV henv, /* in: SQL_NULL_HENV */
- HDBC hdbc, /* in: SQL_NULL_HDBC */
- HSTMT hstmt, /* in: statement handle */
- UCHAR* szSqlState, /* in/out: SQLSTATE as a null-terminated string,
- (currently, always == "S1000") */
- SDWORD* pfNativeError, /* out: native error code */
- UCHAR* szErrorMsg, /* in/out: buffer for an error message as a
- null-terminated string */
- SWORD cbErrorMsgMax, /* in: buffer size for szErrorMsg */
- SWORD* pcbErrorMsg) /* out: error message length */
-{
- odbc_stat_t* stat;
- ulint len;
-
- ut_a(henv == SQL_NULL_HENV);
- ut_a(hdbc == SQL_NULL_HDBC);
- ut_a(hstmt);
- ut_a(cbErrorMsgMax > 1);
-
- stat = hstmt;
-
- if (stat->error_msg == NULL) {
-
- return(SQL_NO_DATA_FOUND);
- }
-
- *pfNativeError = 0;
- ut_memcpy(szSqlState, (char *) "S1000", 6);
-
- len = (ulint)cbErrorMsgMax - 1;
-
- if (stat->error_msg_len < len) {
- len = stat->error_msg_len;
- }
-
- ut_memcpy(szErrorMsg, stat->error_msg + SESS_SRV_MSG_DATA, len);
-
- *(szErrorMsg + len) = '\0';
-
- *pcbErrorMsg = (SWORD)len;
-
- if (stat->error_msg) {
- mem_free(stat->error_msg);
- stat->error_msg = NULL;
- }
-
- return(SQL_SUCCESS);
-}
-
-/**************************************************************************
-Makes the server to parse and optimize an SQL string. */
-
-RETCODE
-SQLPrepare(
-/*=======*/
- /* out: SQL_SUCCESS or SQL_ERROR */
- HSTMT hstmt, /* in: statement handle */
- UCHAR* szSqlStr, /* in: SQL string */
- SDWORD cbSqlStr) /* in: SQL string length */
-{
- odbc_stat_t* stat;
- odbc_conn_t* conn;
- odbc_param_t* param;
- ulint len;
- byte* msg;
- ulint i;
-
- stat = hstmt;
- conn = stat->conn;
-
- if (stat->error_msg) {
- mem_free(stat->error_msg);
- stat->error_msg = NULL;
- }
-
- ut_memcpy(conn->out_datagram_buf + SESS_CLI_MSG_DATA, szSqlStr,
- 1 + (ulint)cbSqlStr);
-
- sess_cli_msg_set_type(conn->out_datagram_buf, SESS_CLI_PREPARE);
-
- /* The client message will be decoded in sess_receive_prepare */
-
- /*------------------------------------------*/
-
- odbc_send_cli_msg(conn, 1 + (ulint)cbSqlStr);
-
- odbc_recv_srv_msg(conn, &len);
-
- /*------------------------------------------*/
-
- /* The server message was coded in sess_receive_prepare */
-
- ut_a(len >= 8);
-
- msg = conn->in_datagram_buf;
-
- if (sess_srv_msg_get_type(msg) != SESS_SRV_SUCCESS) {
-
- ut_a(sess_srv_msg_get_type(msg) == SESS_SRV_ERROR);
-
- odbc_stat_store_error_msg(stat, msg, len);
-
- return(SQL_ERROR);
- }
-
- stat->id = mach_read_from_4(msg + SESS_SRV_MSG_DATA);
-
- stat->n_params = mach_read_from_4(msg + SESS_SRV_MSG_DATA + 4);
-
- stat->n_params_bound = 0;
-
- ut_a(len == 8 + stat->n_params);
-
- if (stat->n_params > 0) {
-
- stat->params = mem_alloc(stat->n_params
- * sizeof(odbc_param_t));
- for (i = 0; i < stat->n_params; i++) {
- param = stat_get_nth_param(stat, i);
-
- param->is_input = mach_read_from_1(
- msg + SESS_SRV_MSG_DATA + 8 + i);
- /* Set buf to NULL so that we know when the parameter
- has been bound */
-
- param->buf = NULL;
- }
- }
-
- stat->state = ODBC_STAT_PREPARED;
-
- return(SQL_SUCCESS);
-}
-
-/**************************************************************************
-Binds a parameter in a prepared statement. */
-
-RETCODE
-SQLBindParameter(
-/*=============*/
- /* out: SQL_SUCCESS */
- HSTMT hstmt, /* in: statement handle */
- UWORD ipar, /* in: parameter index, starting from 1 */
- SWORD fParamType, /* in: SQL_PARAM_INPUT or SQL_PARAM_OUTPUT */
- SWORD fCType, /* in: SQL_C_CHAR, ... */
- SWORD fSqlType, /* in: SQL_CHAR, ... */
- UDWORD cbColDef, /* in: precision: ignored */
- SWORD ibScale, /* in: scale: ignored */
- PTR rgbValue, /* in: pointer to a buffer for the data */
- SDWORD cbValueMax, /* in: buffer size */
- SDWORD* pcbValue) /* in: pointer to a buffer for the data
- length or SQL_NULL_DATA */
-{
- odbc_stat_t* stat;
- odbc_param_t* param;
-
- stat = hstmt;
-
- ut_a(stat->state != ODBC_STAT_INITIAL);
- ut_a(rgbValue);
- ut_a(ipar <= stat->n_params);
- ut_a(ipar > 0);
- ut_a(cbValueMax >= 0);
- ut_a(pcbValue);
-
- UT_NOT_USED(ibScale);
- UT_NOT_USED(fCType);
- UT_NOT_USED(cbColDef);
-
- if (stat->error_msg) {
- mem_free(stat->error_msg);
- stat->error_msg = NULL;
- }
-
- param = stat_get_nth_param(stat, ipar - 1);
-
- if (param->buf == NULL) {
- stat->n_params_bound++;
- }
-
- param->data_type = fSqlType;
-
- ut_a((fParamType != SQL_PARAM_INPUT) || param->is_input);
- ut_a((fParamType == SQL_PARAM_INPUT) || !param->is_input);
-
- param->buf = rgbValue;
- param->buf_len = cbValueMax;
- param->data_len = pcbValue;
-
- return(SQL_SUCCESS);
-}
-
-/**************************************************************************
-Executes a prepared statement where all parameters have been bound. */
-
-RETCODE
-SQLExecute(
-/*=======*/
- /* out: SQL_SUCCESS or SQL_ERROR */
- HSTMT hstmt) /* in: statement handle */
-{
- odbc_stat_t* stat;
- odbc_conn_t* conn;
- odbc_param_t* param;
- lint len;
- ulint msg_len;
- byte* msg;
- byte* ptr;
- lint int_val;
- ulint i;
-
- stat = hstmt;
-
- ut_a(stat->state != ODBC_STAT_INITIAL);
- ut_a(stat->n_params == stat->n_params_bound);
-
- if (stat->error_msg) {
- mem_free(stat->error_msg);
- stat->error_msg = NULL;
- }
-
- conn = stat->conn;
- msg = conn->out_datagram_buf;
-
- sess_cli_msg_set_type(msg, SESS_CLI_EXECUTE);
-
- ptr = msg + SESS_CLI_MSG_DATA;
-
- mach_write_to_4(ptr, stat->id);
-
- ptr += 4;
-
- for (i = 0; i < stat->n_params; i++) {
-
- param = stat_get_nth_param(stat, i);
-
- if (param->is_input) {
- /* Copy its length and data to the message buffer */
-
- len = *(param->data_len);
-
- mach_write_to_4(ptr, (ulint)len);
-
- ptr += 4;
-
- if (len != SQL_NULL_DATA) {
- if (param->data_type == SQL_INTEGER) {
- ut_ad(len == 4);
- int_val = *((lint*)(param->buf));
-
- mach_write_to_4(ptr, (ulint)int_val);
- } else {
- ut_memcpy(ptr, param->buf, len);
- }
-
- ptr += len;
- }
- }
- }
-
- /* The client message will be decoded in sess_receive_command */
-
- /*------------------------------------------*/
-
- odbc_send_cli_msg(conn, ptr - (msg + SESS_CLI_MSG_DATA));
-
- odbc_recv_srv_msg(conn, &msg_len);
-
- /*------------------------------------------*/
-
- /* The server message was coded in sess_command_completed_message */
-
- msg = conn->in_datagram_buf;
-
- if (sess_srv_msg_get_type(msg) != SESS_SRV_SUCCESS) {
-
- ut_a(sess_srv_msg_get_type(msg) == SESS_SRV_ERROR);
-
- odbc_stat_store_error_msg(stat, msg, msg_len);
-
- return(SQL_ERROR);
- }
-
- ptr = msg + SESS_SRV_MSG_DATA;
-
- for (i = 0; i < stat->n_params; i++) {
-
- param = stat_get_nth_param(stat, i);
-
- if (!param->is_input) {
- /* Copy its length and data from the message buffer */
-
- len = (lint)mach_read_from_4(ptr);
-
- ptr += 4;
-
- *(param->data_len) = len;
-
- if (len != SQL_NULL_DATA) {
- if (param->data_type == SQL_INTEGER) {
- ut_ad(len == 4);
-
- int_val = (lint)mach_read_from_4(ptr);
-
- *((lint*)(param->buf)) = int_val;
- } else {
- ut_memcpy(param->buf, ptr, (ulint)len);
- }
-
- ptr += len;
- }
- }
- }
-
- ut_ad(msg + SESS_SRV_MSG_DATA + msg_len == ptr);
-
- return(SQL_SUCCESS);
-}
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c
index a87ab974b83..7973cfc6fe8 100644
--- a/innobase/os/os0file.c
+++ b/innobase/os/os0file.c
@@ -716,7 +716,9 @@ os_file_create_simple(
string */
ulint create_mode,/* in: OS_FILE_OPEN if an existing file is opened
(if does not exist, error), or OS_FILE_CREATE if a new
- file is created (if exists, error) */
+ file is created (if exists, error), or
+ OS_FILE_CREATE_PATH if new file (if exists, error) and
+ subdirectories along its path are created (if needed)*/
ulint access_type,/* in: OS_FILE_READ_ONLY or OS_FILE_READ_WRITE */
ibool* success)/* out: TRUE if succeed, FALSE if error */
{
@@ -734,6 +736,14 @@ try_again:
create_flag = OPEN_EXISTING;
} else if (create_mode == OS_FILE_CREATE) {
create_flag = CREATE_NEW;
+ } else if (create_mode == OS_FILE_CREATE_PATH) {
+ /* create subdirs along the path if needed */
+ *success = os_file_create_subdirs_if_needed(name);
+ if (!*success) {
+ ut_error;
+ }
+ create_flag = CREATE_NEW;
+ create_mode = OS_FILE_CREATE;
} else {
create_flag = 0;
ut_error;
@@ -787,6 +797,14 @@ try_again:
}
} else if (create_mode == OS_FILE_CREATE) {
create_flag = O_RDWR | O_CREAT | O_EXCL;
+ } else if (create_mode == OS_FILE_CREATE_PATH) {
+ /* create subdirs along the path if needed */
+ *success = os_file_create_subdirs_if_needed(name);
+ if (!*success) {
+ return (-1);
+ }
+ create_flag = O_RDWR | O_CREAT | O_EXCL;
+ create_mode = OS_FILE_CREATE;
} else {
create_flag = 0;
ut_error;
@@ -1068,7 +1086,7 @@ try_again:
} else if (type == OS_DATA_FILE) {
type_str = "DATA";
} else {
- ut_a(0);
+ ut_error;
}
if (purpose == OS_FILE_AIO) {
@@ -1076,7 +1094,7 @@ try_again:
} else if (purpose == OS_FILE_NORMAL) {
purpose_str = "NORMAL";
} else {
- ut_a(0);
+ ut_error;
}
/* printf("Opening file %s, mode %s, type %s, purpose %s\n",
@@ -1558,7 +1576,7 @@ os_file_flush(
/* It is a fatal error if a file flush does not succeed, because then
the database can get corrupt on disk */
- ut_a(0);
+ ut_error;
return(FALSE);
#else
@@ -1593,7 +1611,7 @@ os_file_flush(
/* It is a fatal error if a file flush does not succeed, because then
the database can get corrupt on disk */
- ut_a(0);
+ ut_error;
return(FALSE);
#endif
@@ -2114,6 +2132,185 @@ retry:
#endif
}
+/***********************************************************************
+Check the existence and type of the given file. */
+
+ibool
+os_file_status(
+/*===========*/
+ /* out: TRUE if call succeeded */
+ char* path, /* in: pathname of the file */
+ ibool* exists, /* out: TRUE if file exists */
+ os_file_type_t* type) /* out: type of the file (if it exists) */
+{
+#ifdef __WIN__
+ int ret;
+ struct _stat statinfo;
+
+ ret = _stat(path, &statinfo);
+ if (ret && (errno == ENOENT || errno == ENOTDIR)) {
+ /* file does not exist */
+ *exists = FALSE;
+ return(TRUE);
+ } else if (ret) {
+ /* file exists, but stat call failed */
+
+ os_file_handle_error_no_exit(0, path, "stat");
+
+ return(FALSE);
+ }
+
+ if (_S_IFDIR & statinfo.st_mode) {
+ *type = OS_FILE_TYPE_DIR;
+ } else if (_S_IFREG & statinfo.st_mode) {
+ *type = OS_FILE_TYPE_FILE;
+ } else {
+ *type = OS_FILE_TYPE_UNKNOWN;
+ }
+
+ *exists = TRUE;
+
+ return(TRUE);
+#else
+ int ret;
+ struct stat statinfo;
+
+ ret = stat(path, &statinfo);
+ if (ret && (errno == ENOENT || errno == ENOTDIR)) {
+ /* file does not exist */
+ *exists = FALSE;
+ return(TRUE);
+ } else if (ret) {
+ /* file exists, but stat call failed */
+
+ os_file_handle_error_no_exit(0, path, "stat");
+
+ return(FALSE);
+ }
+
+ if (S_ISDIR(statinfo.st_mode)) {
+ *type = OS_FILE_TYPE_DIR;
+ } else if (S_ISLNK(statinfo.st_mode)) {
+ *type = OS_FILE_TYPE_LINK;
+ } else if (S_ISREG(statinfo.st_mode)) {
+ *type = OS_FILE_TYPE_FILE;
+ } else {
+ *type = OS_FILE_TYPE_UNKNOWN;
+ }
+
+ *exists = TRUE;
+
+ return(TRUE);
+#endif
+}
+
+/* path name separator character */
+#ifdef __WIN__
+# define OS_FILE_PATH_SEPARATOR '\\'
+#else
+# define OS_FILE_PATH_SEPARATOR '/'
+#endif
+
+/********************************************************************
+The function os_file_dirname returns a directory component of a
+null-terminated pathname string. In the usual case, dirname returns
+the string up to, but not including, the final '/', and basename
+is the component following the final '/'. Trailing '/' charac­
+ters are not counted as part of the pathname.
+
+If path does not contain a slash, dirname returns the string ".".
+
+Concatenating the string returned by dirname, a "/", and the basename
+yields a complete pathname.
+
+The return value is a copy of the directory component of the pathname.
+The copy is allocated from heap. It is the caller responsibility
+to free it after it is no longer needed.
+
+The following list of examples (taken from SUSv2) shows the strings
+returned by dirname and basename for different paths:
+
+ path dirname basename
+ "/usr/lib" "/usr" "lib"
+ "/usr/" "/" "usr"
+ "usr" "." "usr"
+ "/" "/" "/"
+ "." "." "."
+ ".." "." ".."
+*/
+
+char*
+os_file_dirname(
+/*============*/
+ /* out, own: directory component of the
+ pathname */
+ char* path) /* in: pathname */
+{
+ char* dir;
+ int i, length, last_slash;
+
+ /* find the offset of the last slash */
+ length = ut_strlen(path);
+ for (i = length - 1; i >= 0 && path[i] != OS_FILE_PATH_SEPARATOR; i++);
+ last_slash = i;
+
+ if (last_slash < 0) {
+ /* no slash in the path, return "." */
+ return(ut_strdup((char*)"."));
+ }
+
+ /* ok, there is a slash */
+
+ if (last_slash == 0) {
+ /* last slash is the first char of the path */
+ return(ut_strdup((char*)"/"));
+ }
+
+ /* non-trivial directory component */
+ dir = ut_strdup(path);
+ dir[last_slash] = 0;
+
+ return(dir);
+}
+
+/********************************************************************
+Creates all missing subdirectories along the given path. */
+
+ibool
+os_file_create_subdirs_if_needed(
+/*=============================*/
+ /* out: TRUE if call succeeded
+ FALSE otherwise */
+ char* path) /* in: path name */
+{
+ char* subdir;
+ static char rootdir[2] = { OS_FILE_PATH_SEPARATOR, 0 };
+ ibool success, subdir_exists;
+ os_file_type_t type;
+
+ subdir = os_file_dirname(path);
+ if (0 == strcmp(subdir, rootdir) || 0 == strcmp(subdir, ".")) {
+ /* subdir is root or cwd, nothing to do */
+ ut_free(subdir);
+ return(TRUE);
+ }
+
+ /* test if subdir exists */
+ success = os_file_status(subdir, &subdir_exists, &type);
+ if (success && !subdir_exists) {
+ /* subdir does not exist, create it */
+ success = os_file_create_subdirs_if_needed(subdir);
+ if (!success) {
+ ut_free(subdir);
+ return(FALSE);
+ }
+ success = os_file_create_directory(subdir, FALSE);
+ }
+
+ ut_free(subdir);
+ return(success);
+}
+
/********************************************************************
Returns a pointer to the nth slot in the aio array. */
static
@@ -2430,7 +2627,7 @@ os_aio_get_array_no(
return(3);
} else {
- ut_a(0);
+ ut_error;
return(0);
}
@@ -2457,7 +2654,7 @@ os_aio_get_array_from_no(
return(os_aio_write_array);
} else {
- ut_a(0);
+ ut_error;
return(NULL);
}
@@ -3047,7 +3244,7 @@ os_aio_posix_handle(
if (sig != SIGRTMIN + 1 + array_no) {
- ut_a(0);
+ ut_error;
return(FALSE);
}
@@ -3312,7 +3509,7 @@ consecutive_loop:
slot->name, (ulong) slot->offset_high,
(ulong) slot->offset,
(ulong) total_len);
- ut_a(0);
+ ut_error;
}
/* Do a 'last millisecond' check that the page end
diff --git a/innobase/os/os0fileold.c b/innobase/os/os0fileold.c
deleted file mode 100644
index a9554727f0e..00000000000
--- a/innobase/os/os0fileold.c
+++ /dev/null
@@ -1,1956 +0,0 @@
-/******************************************************
-The interface to the operating system file i/o primitives
-
-(c) 1995 Innobase Oy
-
-Created 10/21/1995 Heikki Tuuri
-*******************************************************/
-
-#include "os0file.h"
-#include "os0sync.h"
-#include "ut0mem.h"
-
-#ifndef __WIN__
-#include <errno.h>
-#endif
-
-/* We use these mutexes to protect lseek + file i/o operation, if the
-OS does not provide an atomic pread or pwrite, or similar */
-#define OS_FILE_N_SEEK_MUTEXES 16
-os_mutex_t os_file_seek_mutexes[OS_FILE_N_SEEK_MUTEXES];
-
-/* In simulated aio, merge at most this many consecutive i/os */
-#define OS_AIO_MERGE_N_CONSECUTIVE 32
-
-/* If this flag is TRUE, then we will use the native aio of the
-OS (provided we compiled Innobase with it in), otherwise we will
-use simulated aio we build below with threads */
-
-bool os_aio_use_native_aio = FALSE;
-
-/* The aio array slot structure */
-typedef struct os_aio_slot_struct os_aio_slot_t;
-
-struct os_aio_slot_struct{
- bool is_read; /* TRUE if a read operation */
- ulint pos; /* index of the slot in the aio
- array */
- bool reserved; /* TRUE if this slot is reserved */
- ulint len; /* length of the block to read or
- write */
- byte* buf; /* buffer used in i/o */
- ulint type; /* OS_FILE_READ or OS_FILE_WRITE */
- ulint offset; /* 32 low bits of file offset in
- bytes */
- ulint offset_high; /* 32 high bits of file offset */
- os_file_t file; /* file where to read or write */
- char* name; /* file name or path */
- bool io_already_done;/* used only in simulated aio:
- TRUE if the physical i/o already
- made and only the slot message
- needs to be passed to the caller
- of os_aio_simulated_handle */
- void* message1; /* message which is given by the */
- void* message2; /* the requester of an aio operation
- and which can be used to identify
- which pending aio operation was
- completed */
-#ifdef WIN_ASYNC_IO
- OVERLAPPED control; /* Windows control block for the
- aio request */
-#elif defined(POSIX_ASYNC_IO)
- struct aiocb control; /* Posix control block for aio
- request */
-#endif
-};
-
-/* The aio array structure */
-typedef struct os_aio_array_struct os_aio_array_t;
-
-struct os_aio_array_struct{
- os_mutex_t mutex; /* the mutex protecting the aio array */
- os_event_t not_full; /* The event which is set to signaled
- state when there is space in the aio
- outside the ibuf segment */
- ulint n_slots; /* Total number of slots in the aio array.
- This must be divisible by n_threads. */
- ulint n_segments;/* Number of segments in the aio array of
- pending aio requests. A thread can wait
- separately for any one of the segments. */
- ulint n_reserved;/* Number of reserved slots in the
- aio array outside the ibuf segment */
- os_aio_slot_t* slots; /* Pointer to the slots in the array */
- os_event_t* events; /* Pointer to an array of event handles
- where we copied the handles from slots,
- in the same order. This can be used in
- WaitForMultipleObjects; used only in
- Windows */
-};
-
-/* Array of events used in simulated aio */
-os_event_t* os_aio_segment_wait_events = NULL;
-
-/* The aio arrays for non-ibuf i/o and ibuf i/o, as well as sync aio. These
-are NULL when the module has not yet been initialized. */
-os_aio_array_t* os_aio_read_array = NULL;
-os_aio_array_t* os_aio_write_array = NULL;
-os_aio_array_t* os_aio_ibuf_array = NULL;
-os_aio_array_t* os_aio_log_array = NULL;
-os_aio_array_t* os_aio_sync_array = NULL;
-
-ulint os_aio_n_segments = ULINT_UNDEFINED;
-
-/***************************************************************************
-Retrieves the last error number if an error occurs in a file io function.
-The number should be retrieved before any other OS calls (because they may
-overwrite the error number). If the number is not known to this program,
-the OS error number + 100 is returned. */
-
-ulint
-os_file_get_last_error(void)
-/*========================*/
- /* out: error number, or OS error number + 100 */
-{
- ulint err;
-
-#ifdef __WIN__
-
- err = (ulint) GetLastError();
-
- if (err == ERROR_FILE_NOT_FOUND) {
- return(OS_FILE_NOT_FOUND);
- } else if (err == ERROR_DISK_FULL) {
- return(OS_FILE_DISK_FULL);
- } else if (err == ERROR_FILE_EXISTS) {
- return(OS_FILE_ALREADY_EXISTS);
- } else {
- return(100 + err);
- }
-#else
- err = (ulint) errno;
-
- printf("%lu\n", err);
- perror("os0file:");
-
- if (err == ENOSPC ) {
- return(OS_FILE_DISK_FULL);
-#ifdef POSIX_ASYNC_IO
- } else if (err == EAGAIN) {
- return(OS_FILE_AIO_RESOURCES_RESERVED);
-#endif
- } else if (err == ENOENT) {
- return(OS_FILE_NOT_FOUND);
- } else if (err == EEXIST) {
- return(OS_FILE_ALREADY_EXISTS);
- } else {
- return(100 + err);
- }
-#endif
-}
-
-/********************************************************************
-Does error handling when a file operation fails. If we have run out
-of disk space, then the user can clean the disk. If we do not find
-a specified file, then the user can copy it to disk. */
-static
-bool
-os_file_handle_error(
-/*=================*/
- /* out: TRUE if we should retry the operation */
- os_file_t file, /* in: file pointer */
- char* name) /* in: name of a file or NULL */
-{
- int input_char;
- ulint err;
-
- err = os_file_get_last_error();
-
- if (err == OS_FILE_DISK_FULL) {
-ask_again:
- printf("\n");
- if (name) {
- printf(
- "Innobase encountered a problem with file %s.\n",
- name);
- }
- printf("Disk is full. Try to clean the disk to free space\n");
- printf("before answering the following: How to continue?\n");
- printf("(Y == freed some space: try again)\n");
- printf("(N == crash the database: will restart it)?\n");
-ask_with_no_question:
- input_char = getchar();
-
- if (input_char == (int) 'N') {
- ut_error;
-
- return(FALSE);
- } else if (input_char == (int) 'Y') {
-
- return(TRUE);
- } else if (input_char == (int) '\n') {
-
- goto ask_with_no_question;
- } else {
- goto ask_again;
- }
- } else if (err == OS_FILE_AIO_RESOURCES_RESERVED) {
-
- return(TRUE);
- } else {
- ut_error;
- }
-
- return(FALSE);
-}
-
-/********************************************************************
-Opens an existing file or creates a new. */
-
-os_file_t
-os_file_create(
-/*===========*/
- /* out, own: handle to the file, not defined if error,
- error number can be retrieved with os_get_last_error */
- char* name, /* in: name of the file or path as a null-terminated
- string */
- ulint create_mode, /* in: OS_FILE_OPEN if an existing file is opened
- (if does not exist, error), or OS_FILE_CREATE if a new
- file is created (if exists, error), OS_FILE_OVERWRITE
- if a new is created or an old overwritten */
- ulint purpose,/* in: OS_FILE_AIO, if asynchronous, non-buffered i/o
- is desired, OS_FILE_NORMAL, if any normal file */
- bool* success)/* out: TRUE if succeed, FALSE if error */
-{
-#ifdef __WIN__
- os_file_t file;
- DWORD create_flag;
- DWORD attributes;
- bool retry;
-
-try_again:
- ut_a(name);
-
- if (create_mode == OS_FILE_OPEN) {
- create_flag = OPEN_EXISTING;
- } else if (create_mode == OS_FILE_CREATE) {
- create_flag = CREATE_NEW;
- } else if (create_mode == OS_FILE_OVERWRITE) {
- create_flag = CREATE_ALWAYS;
- } else {
- create_flag = 0;
- ut_error;
- }
-
- if (purpose == OS_FILE_AIO) {
- /* use asynchronous (overlapped) io and no buffering
- of writes in the OS */
- attributes = 0;
-#ifdef WIN_ASYNC_IO
- if (os_aio_use_native_aio) {
- attributes = attributes | FILE_FLAG_OVERLAPPED;
- }
-#endif
-#ifdef UNIV_NON_BUFFERED_IO
- attributes = attributes | FILE_FLAG_NO_BUFFERING;
-#endif
- } else if (purpose == OS_FILE_NORMAL) {
- attributes = 0
-#ifdef UNIV_NON_BUFFERED_IO
- | FILE_FLAG_NO_BUFFERING
-#endif
- ;
- } else {
- attributes = 0;
- ut_error;
- }
-
- file = CreateFile(name,
- GENERIC_READ | GENERIC_WRITE, /* read and write
- access */
- FILE_SHARE_READ,/* file can be read by other
- processes */
- NULL, /* default security attributes */
- create_flag,
- attributes,
- NULL); /* no template file */
-
- if (file == INVALID_HANDLE_VALUE) {
- *success = FALSE;
-
- if (create_mode != OS_FILE_OPEN
- && os_file_get_last_error() == OS_FILE_DISK_FULL) {
-
- retry = os_file_handle_error(file, name);
-
- if (retry) {
- goto try_again;
- }
- }
- } else {
- *success = TRUE;
- }
-
- return(file);
-#else
- os_file_t file;
- int create_flag;
- bool retry;
-
-try_again:
- ut_a(name);
-
- if (create_mode == OS_FILE_OPEN) {
- create_flag = O_RDWR;
- } else if (create_mode == OS_FILE_CREATE) {
- create_flag = O_RDWR | O_CREAT | O_EXCL;
- } else if (create_mode == OS_FILE_OVERWRITE) {
- create_flag = O_RDWR | O_CREAT | O_TRUNC;
- } else {
- create_flag = 0;
- ut_error;
- }
-
- UT_NOT_USED(purpose);
-
- if (create_mode == OS_FILE_CREATE) {
-
- file = open(name, create_flag, S_IRWXU | S_IRWXG | S_IRWXO);
- } else {
- file = open(name, create_flag);
- }
-
- if (file == -1) {
- *success = FALSE;
-
- printf("Error in opening file %s, errno %lu\n", name,
- (ulint)errno);
- perror("os0file.c:");
-
- if (create_mode != OS_FILE_OPEN
- && errno == ENOSPC) {
-
- retry = os_file_handle_error(file, name);
-
- if (retry) {
- goto try_again;
- }
- }
- } else {
- *success = TRUE;
- }
-
- return(file);
-#endif
-}
-
-/***************************************************************************
-Closes a file handle. In case of error, error number can be retrieved with
-os_file_get_last_error. */
-
-bool
-os_file_close(
-/*==========*/
- /* out: TRUE if success */
- os_file_t file) /* in, own: handle to a file */
-{
-#ifdef __WIN__
- BOOL ret;
-
- ut_a(file);
-
- ret = CloseHandle(file);
-
- if (ret) {
- return(TRUE);
- }
-
- return(FALSE);
-#else
- int ret;
-
- ret = close(file);
-
- if (ret == -1) {
- return(FALSE);
- }
-
- return(TRUE);
-#endif
-}
-
-/***************************************************************************
-Gets a file size. */
-
-bool
-os_file_get_size(
-/*=============*/
- /* out: TRUE if success */
- os_file_t file, /* in: handle to a file */
- ulint* size, /* out: least significant 32 bits of file
- size */
- ulint* size_high)/* out: most significant 32 bits of size */
-{
-#ifdef __WIN__
- DWORD high;
- DWORD low;
-
- low = GetFileSize(file, &high);
-
- if ((low == 0xFFFFFFFF) && (GetLastError() != NO_ERROR)) {
- return(FALSE);
- }
-
- *size = low;
- *size_high = high;
-
- return(TRUE);
-#else
- *size = (ulint) lseek(file, 0, SEEK_END);
- *size_high = 0;
-
- return(TRUE);
-#endif
-}
-
-/***************************************************************************
-Sets a file size. This function can be used to extend or truncate a file. */
-
-bool
-os_file_set_size(
-/*=============*/
- /* out: TRUE if success */
- char* name, /* in: name of the file or path as a
- null-terminated string */
- os_file_t file, /* in: handle to a file */
- ulint size, /* in: least significant 32 bits of file
- size */
- ulint size_high)/* in: most significant 32 bits of size */
-{
-#ifdef __WIN__
- DWORD high;
- DWORD low;
- DWORD ret;
- BOOL ret2;
- DWORD err;
- bool retry;
-
-try_again:
- low = size;
- high = size_high;
-
- ret = SetFilePointer(file, low, &high, FILE_BEGIN);
-
- if (ret == 0xFFFFFFFF && GetLastError() != NO_ERROR) {
- err = GetLastError();
-
- goto error_handling;
- }
-
- ret2 = SetEndOfFile(file);
-
- if (ret2) {
- ret2 = os_file_flush(file);
- }
-
- if (ret2) {
- return(TRUE);
- }
-#else
- ulint offset;
- ulint n_bytes;
- ulint low;
- ssize_t ret;
- bool retry;
- ulint i;
- byte buf[UNIV_PAGE_SIZE * 8];
-
- /* Write buffer full of zeros */
- for (i = 0; i < UNIV_PAGE_SIZE * 8; i++) {
- buf[i] = '\0';
- }
-
-try_again:
- low = size;
-#if (UNIV_WORD_SIZE == 8)
- low = low + (size_high << 32);
-#endif
- while (offset < low) {
- if (low - offset < UNIV_PAGE_SIZE * 8) {
- n_bytes = low - offset;
- } else {
- n_bytes = UNIV_PAGE_SIZE * 8;
- }
-
- ret = pwrite(file, buf, n_bytes, offset);
-
- if (ret != n_bytes) {
- goto error_handling;
- }
- offset += n_bytes;
- }
-
- ret = os_file_flush(file);
-
- if (ret) {
- return(TRUE);
- }
-#endif
-
-error_handling:
- retry = os_file_handle_error(file, name);
-
- if (retry) {
- goto try_again;
- }
-
- ut_error;
-}
-
-/***************************************************************************
-Flushes the write buffers of a given file to the disk. */
-
-bool
-os_file_flush(
-/*==========*/
- /* out: TRUE if success */
- os_file_t file) /* in, own: handle to a file */
-{
-#ifdef __WIN__
- BOOL ret;
-
- ut_a(file);
-
- ret = FlushFileBuffers(file);
-
- if (ret) {
- return(TRUE);
- }
-
- return(FALSE);
-#else
- int ret;
-
- ret = fsync(file);
-
- if (ret == 0) {
- return(TRUE);
- }
-
- return(FALSE);
-#endif
-}
-
-
-#ifndef __WIN__
-/***********************************************************************
-Does a synchronous read operation in Posix. */
-static
-ssize_t
-os_file_pread(
-/*==========*/
- /* out: number of bytes read, -1 if error */
- os_file_t file, /* in: handle to a file */
- void* buf, /* in: buffer where to read */
- ulint n, /* in: number of bytes to read */
- ulint offset) /* in: offset from where to read */
-{
-#ifdef HAVE_PREAD
- return(pread(file, buf, n, (off_t) offset));
-#else
- ssize_t ret;
- ulint i;
-
- /* Protect the seek / read operation with a mutex */
- i = ((ulint) file) % OS_FILE_N_SEEK_MUTEXES;
-
- os_mutex_enter(os_file_seek_mutexes[i]);
-
- ret = lseek(file, (off_t) offset, 0);
-
- if (ret < 0) {
- os_mutex_exit(os_file_seek_mutexes[i]);
-
- return(ret);
- }
-
- ret = read(file, buf, n);
-
- os_mutex_exit(os_file_seek_mutexes[i]);
-
- return(ret);
-#endif
-}
-
-/***********************************************************************
-Does a synchronous write operation in Posix. */
-static
-ssize_t
-os_file_pwrite(
-/*===========*/
- /* out: number of bytes written, -1 if error */
- os_file_t file, /* in: handle to a file */
- void* buf, /* in: buffer from where to write */
- ulint n, /* in: number of bytes to write */
- ulint offset) /* in: offset where to write */
-{
-#ifdef HAVE_PWRITE
- return(pwrite(file, buf, n, (off_t) offset));
-#else
- ssize_t ret;
- ulint i;
-
- /* Protect the seek / write operation with a mutex */
- i = ((ulint) file) % OS_FILE_N_SEEK_MUTEXES;
-
- os_mutex_enter(os_file_seek_mutexes[i]);
-
- ret = lseek(file, (off_t) offset, 0);
-
- if (ret < 0) {
- os_mutex_exit(os_file_seek_mutexes[i]);
-
- return(ret);
- }
-
- ret = write(file, buf, n);
-
- os_mutex_exit(os_file_seek_mutexes[i]);
-
- return(ret);
-#endif
-}
-#endif
-
-/***********************************************************************
-Requests a synchronous positioned read operation. */
-
-bool
-os_file_read(
-/*=========*/
- /* out: TRUE if request was
- successful, FALSE if fail */
- os_file_t file, /* in: handle to a file */
- void* buf, /* in: buffer where to read */
- ulint offset, /* in: least significant 32 bits of file
- offset where to read */
- ulint offset_high, /* in: most significant 32 bits of
- offset */
- ulint n) /* in: number of bytes to read */
-{
-#ifdef __WIN__
- BOOL ret;
- DWORD len;
- DWORD ret2;
- DWORD err;
- DWORD low;
- DWORD high;
- bool retry;
- ulint i;
-
-try_again:
- ut_ad(file);
- ut_ad(buf);
- ut_ad(n > 0);
-
- low = offset;
- high = offset_high;
-
- /* Protect the seek / read operation with a mutex */
- i = ((ulint) file) % OS_FILE_N_SEEK_MUTEXES;
-
- os_mutex_enter(os_file_seek_mutexes[i]);
-
- ret2 = SetFilePointer(file, low, &high, FILE_BEGIN);
-
- if (ret2 == 0xFFFFFFFF && GetLastError() != NO_ERROR) {
- err = GetLastError();
-
- os_mutex_exit(os_file_seek_mutexes[i]);
-
- goto error_handling;
- }
-
- ret = ReadFile(file, buf, n, &len, NULL);
-
- os_mutex_exit(os_file_seek_mutexes[i]);
-
- if (ret && len == n) {
- return(TRUE);
- }
-
- err = GetLastError();
-#else
- bool retry;
- ssize_t ret;
- ulint i;
-
-#if (UNIV_WORD_SIZE == 8)
- offset = offset + (offset_high << 32);
-#endif
-try_again:
- /* Protect the seek / read operation with a mutex */
- i = ((ulint) file) % OS_FILE_N_SEEK_MUTEXES;
-
- os_mutex_enter(os_file_seek_mutexes[i]);
-
- ret = os_file_pread(file, buf, n, (off_t) offset);
-
- if (ret == n) {
- os_mutex_exit(os_file_seek_mutexes[i]);
-
- return(TRUE);
- }
-#endif
-error_handling:
- retry = os_file_handle_error(file, NULL);
-
- if (retry) {
- goto try_again;
- }
-
- ut_error;
-
- return(FALSE);
-}
-
-/***********************************************************************
-Requests a synchronous write operation. */
-
-bool
-os_file_write(
-/*==========*/
- /* out: TRUE if request was
- successful, FALSE if fail */
- char* name, /* in: name of the file or path as a
- null-terminated string */
- os_file_t file, /* in: handle to a file */
- void* buf, /* in: buffer from which to write */
- ulint offset, /* in: least significant 32 bits of file
- offset where to write */
- ulint offset_high, /* in: most significant 32 bits of
- offset */
- ulint n) /* in: number of bytes to write */
-{
-#ifdef __WIN__
- BOOL ret;
- DWORD len;
- DWORD ret2;
- DWORD err;
- DWORD low;
- DWORD high;
- bool retry;
- ulint i;
-
-try_again:
- ut_ad(file);
- ut_ad(buf);
- ut_ad(n > 0);
-
- low = offset;
- high = offset_high;
-
- /* Protect the seek / write operation with a mutex */
- i = ((ulint) file) % OS_FILE_N_SEEK_MUTEXES;
-
- os_mutex_enter(os_file_seek_mutexes[i]);
-
- ret2 = SetFilePointer(file, low, &high, FILE_BEGIN);
-
- if (ret2 == 0xFFFFFFFF && GetLastError() != NO_ERROR) {
- err = GetLastError();
-
- os_mutex_exit(os_file_seek_mutexes[i]);
-
- goto error_handling;
- }
-
- ret = WriteFile(file, buf, n, &len, NULL);
-
- os_mutex_exit(os_file_seek_mutexes[i]);
-
- if (ret && len == n) {
- return(TRUE);
- }
-#else
- bool retry;
- ssize_t ret;
-
-#if (UNIV_WORD_SIZE == 8)
- offset = offset + (offset_high << 32);
-#endif
-try_again:
- ret = pwrite(file, buf, n, (off_t) offset);
-
- if (ret == n) {
- return(TRUE);
- }
-#endif
-
-error_handling:
- retry = os_file_handle_error(file, name);
-
- if (retry) {
- goto try_again;
- }
-
- ut_error;
-
- return(FALSE);
-}
-
-/********************************************************************
-Returns a pointer to the nth slot in the aio array. */
-static
-os_aio_slot_t*
-os_aio_array_get_nth_slot(
-/*======================*/
- /* out: pointer to slot */
- os_aio_array_t* array, /* in: aio array */
- ulint index) /* in: index of the slot */
-{
- ut_a(index < array->n_slots);
-
- return((array->slots) + index);
-}
-
-/****************************************************************************
-Creates an aio wait array. */
-static
-os_aio_array_t*
-os_aio_array_create(
-/*================*/
- /* out, own: aio array */
- ulint n, /* in: maximum number of pending aio operations
- allowed; n must be divisible by n_segments */
- ulint n_segments) /* in: number of segments in the aio array */
-{
- os_aio_array_t* array;
- ulint i;
- os_aio_slot_t* slot;
-#ifdef WIN_ASYNC_IO
- OVERLAPPED* over;
-#endif
- ut_a(n > 0);
- ut_a(n_segments > 0);
- ut_a(n % n_segments == 0);
-
- array = ut_malloc(sizeof(os_aio_array_t));
-
- array->mutex = os_mutex_create(NULL);
- array->not_full = os_event_create(NULL);
- array->n_slots = n;
- array->n_segments = n_segments;
- array->n_reserved = 0;
- array->slots = ut_malloc(n * sizeof(os_aio_slot_t));
- array->events = ut_malloc(n * sizeof(os_event_t));
-
- for (i = 0; i < n; i++) {
- slot = os_aio_array_get_nth_slot(array, i);
-
- slot->pos = i;
- slot->reserved = FALSE;
-#ifdef WIN_ASYNC_IO
- over = &(slot->control);
-
- over->hEvent = os_event_create(NULL);
-
- *((array->events) + i) = over->hEvent;
-#elif defined(POSIX_ASYNC_IO)
- slot->ready = os_event_create(NULL);
-#endif
- }
-
- return(array);
-}
-
-/****************************************************************************
-Initializes the asynchronous io system. Creates separate aio array for
-non-ibuf read and write, a third aio array for the ibuf i/o, with just one
-segment, two aio arrays for log reads and writes with one segment, and a
-synchronous aio array of the specified size. The combined number of segments
-in the three first aio arrays is the parameter n_segments given to the
-function. The caller must create an i/o handler thread for each segment in
-the four first arrays, but not for the sync aio array. */
-
-void
-os_aio_init(
-/*========*/
- ulint n, /* in: maximum number of pending aio operations
- allowed; n must be divisible by n_segments */
- ulint n_segments, /* in: combined number of segments in the four
- first aio arrays; must be >= 4 */
- ulint n_slots_sync) /* in: number of slots in the sync aio array */
-{
- ulint n_read_segs;
- ulint n_write_segs;
- ulint n_per_seg;
- ulint i;
-
- ut_ad(n % n_segments == 0);
- ut_ad(n_segments >= 4);
-
- n_per_seg = n / n_segments;
- n_write_segs = (n_segments - 2) / 2;
- n_read_segs = n_segments - 2 - n_write_segs;
-
- os_aio_read_array = os_aio_array_create(n_read_segs * n_per_seg,
- n_read_segs);
- os_aio_write_array = os_aio_array_create(n_write_segs * n_per_seg,
- n_write_segs);
- os_aio_ibuf_array = os_aio_array_create(n_per_seg, 1);
-
- os_aio_log_array = os_aio_array_create(n_per_seg, 1);
-
- os_aio_sync_array = os_aio_array_create(n_slots_sync, 1);
-
- os_aio_n_segments = n_segments;
-
-#if !(defined(WIN_ASYNC_IO) || defined(POSIX_ASYNC_IO))
- os_aio_use_native_aio = FALSE;
-#endif
- os_aio_validate();
-
- for (i = 0; i < OS_FILE_N_SEEK_MUTEXES; i++) {
- os_file_seek_mutexes[i] = os_mutex_create(NULL);
- }
-
- os_aio_segment_wait_events = ut_malloc(n_segments * sizeof(void*));
-
- for (i = 0; i < n_segments; i++) {
- os_aio_segment_wait_events[i] = os_event_create(NULL);
- }
-}
-
-/**************************************************************************
-Calculates segment number for a slot. */
-static
-ulint
-os_aio_get_segment_no_from_slot(
-/*============================*/
- /* out: segment number (which is the number
- used by, for example, i/o-handler threads) */
- os_aio_array_t* array, /* in: aio wait array */
- os_aio_slot_t* slot) /* in: slot in this array */
-{
- ulint segment;
- ulint seg_len;
-
- if (array == os_aio_ibuf_array) {
- segment = 0;
-
- } else if (array == os_aio_log_array) {
- segment = 1;
-
- } else if (array == os_aio_read_array) {
- seg_len = os_aio_read_array->n_slots /
- os_aio_read_array->n_segments;
-
- segment = 2 + slot->pos / seg_len;
- } else {
- ut_a(array == os_aio_write_array);
- seg_len = os_aio_write_array->n_slots /
- os_aio_write_array->n_segments;
-
- segment = os_aio_read_array->n_segments + 2
- + slot->pos / seg_len;
- }
-
- return(segment);
-}
-
-/**************************************************************************
-Calculates local segment number and aio array from global segment number. */
-static
-ulint
-os_aio_get_array_and_local_segment(
-/*===============================*/
- /* out: local segment number within
- the aio array */
- os_aio_array_t** array, /* out: aio wait array */
- ulint global_segment)/* in: global segment number */
-{
- ulint segment;
-
- ut_a(global_segment < os_aio_n_segments);
-
- if (global_segment == 0) {
- *array = os_aio_ibuf_array;
- segment = 0;
-
- } else if (global_segment == 1) {
- *array = os_aio_log_array;
- segment = 0;
-
- } else if (global_segment < os_aio_read_array->n_segments + 2) {
- *array = os_aio_read_array;
-
- segment = global_segment - 2;
- } else {
- *array = os_aio_write_array;
-
- segment = global_segment - (os_aio_read_array->n_segments + 2);
- }
-
- return(segment);
-}
-
-/***********************************************************************
-Gets an integer value designating a specified aio array. This is used
-to give numbers to signals in Posix aio. */
-static
-ulint
-os_aio_get_array_no(
-/*================*/
- os_aio_array_t* array) /* in: aio array */
-{
- if (array == os_aio_ibuf_array) {
-
- return(0);
-
- } else if (array == os_aio_log_array) {
-
- return(1);
-
- } else if (array == os_aio_read_array) {
-
- return(2);
- } else if (array == os_aio_write_array) {
-
- return(3);
- } else {
- ut_a(0);
-
- return(0);
- }
-}
-
-/***********************************************************************
-Gets the aio array for its number. */
-static
-os_aio_array_t*
-os_aio_get_array_from_no(
-/*=====================*/
- /* out: aio array */
- ulint n) /* in: array number */
-{
- if (n == 0) {
- return(os_aio_ibuf_array);
- } else if (n == 1) {
-
- return(os_aio_log_array);
- } else if (n == 2) {
-
- return(os_aio_read_array);
- } else if (n == 3) {
-
- return(os_aio_write_array);
- } else {
- ut_a(0);
-
- return(NULL);
- }
-}
-
-/***********************************************************************
-Requests for a slot in the aio array. If no slot is available, waits until
-not_full-event becomes signaled. */
-static
-os_aio_slot_t*
-os_aio_array_reserve_slot(
-/*======================*/
- /* out: pointer to slot */
- ulint type, /* in: OS_FILE_READ or OS_FILE_WRITE */
- os_aio_array_t* array, /* in: aio array */
- void* message1,/* in: message to be passed along with
- the aio operation */
- void* message2,/* in: message to be passed along with
- the aio operation */
- os_file_t file, /* in: file handle */
- char* name, /* in: name of the file or path as a
- null-terminated string */
- void* buf, /* in: buffer where to read or from which
- to write */
- ulint offset, /* in: least significant 32 bits of file
- offset */
- ulint offset_high, /* in: most significant 32 bits of
- offset */
- ulint len) /* in: length of the block to read or write */
-{
- os_aio_slot_t* slot;
-#ifdef WIN_ASYNC_IO
- OVERLAPPED* control;
-#elif POSIX_ASYNC_IO
- struct aiocb* control;
- ulint type;
-#endif
- ulint i;
-loop:
- os_mutex_enter(array->mutex);
-
- if (array->n_reserved == array->n_slots) {
- os_mutex_exit(array->mutex);
- os_event_wait(array->not_full);
-
- goto loop;
- }
-
- for (i = 0;; i++) {
- slot = os_aio_array_get_nth_slot(array, i);
-
- if (slot->reserved == FALSE) {
- break;
- }
- }
-
- array->n_reserved++;
-
- if (array->n_reserved == array->n_slots) {
- os_event_reset(array->not_full);
- }
-
- slot->reserved = TRUE;
- slot->message1 = message1;
- slot->message2 = message2;
- slot->file = file;
- slot->name = name;
- slot->len = len;
- slot->type = type;
- slot->buf = buf;
- slot->offset = offset;
- slot->offset_high = offset_high;
- slot->io_already_done = FALSE;
-
-#ifdef WIN_ASYNC_IO
- control = &(slot->control);
- control->Offset = (DWORD)offset;
- control->OffsetHigh = (DWORD)offset_high;
- os_event_reset(control->hEvent);
-
-#elif POSIX_ASYNC_IO
-
-#if (UNIV_WORD_SIZE == 8)
- offset = offset + (offset_high << 32);
-#else
- ut_a(offset_high == 0);
-#endif
- control = &(slot->control);
- control->aio_fildes = file;
- control->aio_buf = buf;
- control->aio_nbytes = len;
- control->aio_offset = offset;
- control->aio_reqprio = 0;
- control->aio_sigevent.sigev_notify = SIGEV_SIGNAL;
- control->aio_sigevent.signo =
- SIGRTMAX + 1 + os_aio_get_array_no(array);
- /* TODO: How to choose the signal numbers? */
- control->aio_sigevent.sigev_value.sival_ptr = slot;
-#endif
- os_mutex_exit(array->mutex);
-
- return(slot);
-}
-
-/***********************************************************************
-Frees a slot in the aio array. */
-static
-void
-os_aio_array_free_slot(
-/*===================*/
- os_aio_array_t* array, /* in: aio array */
- os_aio_slot_t* slot) /* in: pointer to slot */
-{
- ut_ad(array);
- ut_ad(slot);
-
- os_mutex_enter(array->mutex);
-
- ut_ad(slot->reserved);
-
- slot->reserved = FALSE;
-
- array->n_reserved--;
-
- if (array->n_reserved == array->n_slots - 1) {
- os_event_set(array->not_full);
- }
-
-#ifdef WIN_ASYNC_IO
- os_event_reset(slot->control.hEvent);
-#endif
- os_mutex_exit(array->mutex);
-}
-
-/**************************************************************************
-Wakes up a simulated aio i/o-handler thread if it has something to do. */
-static
-void
-os_aio_simulated_wake_handler_thread(
-/*=================================*/
- ulint global_segment) /* in: the number of the segment in the aio
- arrays */
-{
- os_aio_array_t* array;
- ulint segment;
- os_aio_slot_t* slot;
- ulint n;
- ulint i;
-
- ut_ad(!os_aio_use_native_aio);
-
- segment = os_aio_get_array_and_local_segment(&array, global_segment);
-
- n = array->n_slots / array->n_segments;
-
- /* Look through n slots after the segment * n'th slot */
-
- os_mutex_enter(array->mutex);
-
- for (i = 0; i < n; i++) {
- slot = os_aio_array_get_nth_slot(array, i + segment * n);
-
- if (slot->reserved) {
- /* Found an i/o request */
-
- break;
- }
- }
-
- os_mutex_exit(array->mutex);
-
- if (i < n) {
- os_event_set(os_aio_segment_wait_events[global_segment]);
- }
-}
-
-/**************************************************************************
-Wakes up simulated aio i/o-handler threads if they have something to do. */
-
-void
-os_aio_simulated_wake_handler_threads(void)
-/*=======================================*/
-{
- ulint i;
-
- if (os_aio_use_native_aio) {
- /* We do not use simulated aio: do nothing */
-
- return;
- }
-
- for (i = 0; i < os_aio_n_segments; i++) {
- os_aio_simulated_wake_handler_thread(i);
- }
-}
-
-/***********************************************************************
-Requests an asynchronous i/o operation. */
-
-bool
-os_aio(
-/*===*/
- /* out: TRUE if request was queued
- successfully, FALSE if fail */
- ulint type, /* in: OS_FILE_READ or OS_FILE_WRITE */
- ulint mode, /* in: OS_AIO_NORMAL, ..., possibly ORed
- to OS_AIO_SIMULATED_WAKE_LATER: the
- last flag advises this function not to wake
- i/o-handler threads, but the caller will
- do the waking explicitly later, in this
- way the caller can post several requests in
- a batch; NOTE that the batch must not be
- so big that it exhausts the slots in aio
- arrays! NOTE that a simulated batch
- may introduce hidden chances of deadlocks,
- because i/os are not actually handled until
- all have been posted: use with great
- caution! */
- char* name, /* in: name of the file or path as a
- null-terminated string */
- os_file_t file, /* in: handle to a file */
- void* buf, /* in: buffer where to read or from which
- to write */
- ulint offset, /* in: least significant 32 bits of file
- offset where to read or write */
- ulint offset_high, /* in: most significant 32 bits of
- offset */
- ulint n, /* in: number of bytes to read or write */
- void* message1,/* in: messages for the aio handler (these
- can be used to identify a completed aio
- operation); if mode is OS_AIO_SYNC, these
- are ignored */
- void* message2)
-{
- os_aio_array_t* array;
- os_aio_slot_t* slot;
-#ifdef WIN_ASYNC_IO
- BOOL ret = TRUE;
- DWORD len = n;
- void* dummy_mess1;
- void* dummy_mess2;
-#endif
- ulint err = 0;
- bool retry;
- ulint wake_later;
-
- ut_ad(file);
- ut_ad(buf);
- ut_ad(n > 0);
- ut_ad(n % OS_FILE_LOG_BLOCK_SIZE == 0);
- ut_ad((ulint)buf % OS_FILE_LOG_BLOCK_SIZE == 0)
- ut_ad(offset % OS_FILE_LOG_BLOCK_SIZE == 0);
- ut_ad(os_aio_validate());
-
- wake_later = mode & OS_AIO_SIMULATED_WAKE_LATER;
- mode = mode & (~OS_AIO_SIMULATED_WAKE_LATER);
-
- if (mode == OS_AIO_SYNC
-#ifdef WIN_ASYNC_IO
- && !os_aio_use_native_aio
-#endif
- ) {
- /* This is actually an ordinary synchronous read or write:
- no need to use an i/o-handler thread. NOTE that if we use
- Windows async i/o, Windows does not allow us to use
- ordinary synchronous os_file_read etc. on the same file,
- therefore we have built a special mechanism for synchronous
- wait in the Windows case. */
-
- if (type == OS_FILE_READ) {
- return(os_file_read(file, buf, offset, offset_high, n));
- }
-
- ut_a(type == OS_FILE_WRITE);
-
- return(os_file_write(name, file, buf, offset, offset_high, n));
- }
-
-try_again:
- if (mode == OS_AIO_NORMAL) {
- if (type == OS_FILE_READ) {
- array = os_aio_read_array;
- } else {
- array = os_aio_write_array;
- }
- } else if (mode == OS_AIO_IBUF) {
- ut_ad(type == OS_FILE_READ);
-
- array = os_aio_ibuf_array;
- } else if (mode == OS_AIO_LOG) {
-
- array = os_aio_log_array;
- } else if (mode == OS_AIO_SYNC) {
- array = os_aio_sync_array;
- } else {
- ut_error;
- }
-
- slot = os_aio_array_reserve_slot(type, array, message1, message2, file,
- name, buf, offset, offset_high, n);
- if (type == OS_FILE_READ) {
- if (os_aio_use_native_aio) {
-#ifdef WIN_ASYNC_IO
- ret = ReadFile(file, buf, (DWORD)n, &len,
- &(slot->control));
-#elif defined(POSIX_ASYNC_IO)
- err = (ulint) aio_read(&(slot->control));
-#endif
- } else {
- if (!wake_later) {
- os_aio_simulated_wake_handler_thread(
- os_aio_get_segment_no_from_slot(array, slot));
- }
- }
- } else if (type == OS_FILE_WRITE) {
- if (os_aio_use_native_aio) {
-#ifdef WIN_ASYNC_IO
- ret = WriteFile(file, buf, (DWORD)n, &len,
- &(slot->control));
-#elif defined(POSIX_ASYNC_IO)
- err = (ulint) aio_write(&(slot->control));
-#endif
- } else {
- if (!wake_later) {
- os_aio_simulated_wake_handler_thread(
- os_aio_get_segment_no_from_slot(array, slot));
- }
- }
- } else {
- ut_error;
- }
-
-#ifdef WIN_ASYNC_IO
- if ((ret && len == n)
- || (!ret && GetLastError() == ERROR_IO_PENDING)) {
-
- /* aio was queued successfully! */
-
- if (mode == OS_AIO_SYNC) {
- /* We want a synchronous i/o operation on a file
- where we also use async i/o: in Windows we must
- use the same wait mechanism as for async i/o */
-
- return(os_aio_windows_handle(ULINT_UNDEFINED,
- slot->pos,
- &dummy_mess1, &dummy_mess2));
- }
-
- return(TRUE);
- }
-#else
- if (err == 0) {
- /* aio was queued successfully! */
-
- return(TRUE);
- }
-#endif
- os_aio_array_free_slot(array, slot);
-
- retry = os_file_handle_error(file, name);
-
- if (retry) {
-
- goto try_again;
- }
-
- ut_error;
-
- return(FALSE);
-}
-
-#ifdef WIN_ASYNC_IO
-/**************************************************************************
-This function is only used in Windows asynchronous i/o.
-Waits for an aio operation to complete. This function is used to wait the
-for completed requests. The aio array of pending requests is divided
-into segments. The thread specifies which segment or slot it wants to wait
-for. NOTE: this function will also take care of freeing the aio slot,
-therefore no other thread is allowed to do the freeing! */
-
-bool
-os_aio_windows_handle(
-/*==================*/
- /* out: TRUE if the aio operation succeeded */
- ulint segment, /* in: the number of the segment in the aio
- arrays to wait for; segment 0 is the ibuf
- i/o thread, segment 1 the log i/o thread,
- then follow the non-ibuf read threads, and as
- the last are the non-ibuf write threads; if
- this is ULINT_UNDEFINED, then it means that
- sync aio is used, and this parameter is
- ignored */
- ulint pos, /* this parameter is used only in sync aio:
- wait for the aio slot at this position */
- void** message1, /* out: the messages passed with the aio
- request; note that also in the case where
- the aio operation failed, these output
- parameters are valid and can be used to
- restart the operation, for example */
- void** message2)
-{
- os_aio_array_t* array;
- os_aio_slot_t* slot;
- ulint n;
- ulint i;
- bool ret_val;
- ulint err;
- BOOL ret;
- DWORD len;
-
- if (segment == ULINT_UNDEFINED) {
- array = os_aio_sync_array;
- segment = 0;
- } else {
- segment = os_aio_get_array_and_local_segment(&array, segment);
- }
-
- /* NOTE! We only access constant fields in os_aio_array. Therefore
- we do not have to acquire the protecting mutex yet */
-
- ut_ad(os_aio_validate());
- ut_ad(segment < array->n_segments);
-
- n = array->n_slots / array->n_segments;
-
- if (array == os_aio_sync_array) {
- ut_ad(pos < array->n_slots);
- os_event_wait(array->events[pos]);
- i = pos;
- } else {
- i = os_event_wait_multiple(n, (array->events) + segment * n);
- }
-
- os_mutex_enter(array->mutex);
-
- slot = os_aio_array_get_nth_slot(array, i + segment * n);
-
- ut_a(slot->reserved);
-
- ret = GetOverlappedResult(slot->file, &(slot->control), &len, TRUE);
-
- *message1 = slot->message1;
- *message2 = slot->message2;
-
- if (ret && len == slot->len) {
- ret_val = TRUE;
- } else {
- err = GetLastError();
- ut_error;
-
- ret_val = FALSE;
- }
-
- os_mutex_exit(array->mutex);
-
- os_aio_array_free_slot(array, slot);
-
- return(ret_val);
-}
-#endif
-
-#ifdef POSIX_ASYNC_IO
-/**************************************************************************
-This function is only used in Posix asynchronous i/o. Waits for an aio
-operation to complete. */
-
-bool
-os_aio_posix_handle(
-/*================*/
- /* out: TRUE if the aio operation succeeded */
- ulint array_no, /* in: array number 0 - 3 */
- void** message1, /* out: the messages passed with the aio
- request; note that also in the case where
- the aio operation failed, these output
- parameters are valid and can be used to
- restart the operation, for example */
- void** message2)
-{
- os_aio_array_t* array;
- os_aio_slot_t* slot;
- siginfo_t info;
- sigset_t sigset;
- int ret;
-
- sigemptyset(&sigset);
- sigaddset(&sigset, SIGRTMAX + 1 + array_no);
-
- ret = sigwaitinfo(&sigset, &info);
-
- if (ret != SIGRTMAX + 1 + array_no) {
-
- ut_a(0);
-
- return(FALSE);
- }
-
- array = os_aio_get_array_from_no(array_no);
-
- os_mutex_enter(array->mutex);
-
- slot = siginfo.si_value.sival_ptr;
-
- ut_a(slot->reserved);
-
- *message1 = slot->message1;
- *message2 = slot->message2;
-
- os_mutex_exit(array->mutex);
-
- os_aio_array_free_slot(array, slot);
-
- return(TRUE);
-}
-#endif
-
-/**************************************************************************
-Does simulated aio. This function should be called by an i/o-handler
-thread. */
-
-bool
-os_aio_simulated_handle(
-/*====================*/
- /* out: TRUE if the aio operation succeeded */
- ulint global_segment, /* in: the number of the segment in the aio
- arrays to wait for; segment 0 is the ibuf
- i/o thread, segment 1 the log i/o thread,
- then follow the non-ibuf read threads, and as
- the last are the non-ibuf write threads */
- void** message1, /* out: the messages passed with the aio
- request; note that also in the case where
- the aio operation failed, these output
- parameters are valid and can be used to
- restart the operation, for example */
- void** message2)
-{
- os_aio_array_t* array;
- ulint segment;
- os_aio_slot_t* slot;
- os_aio_slot_t* slot2;
- os_aio_slot_t* consecutive_ios[OS_AIO_MERGE_N_CONSECUTIVE];
- ulint n_consecutive;
- ulint total_len;
- ulint offs;
- byte* combined_buf;
- bool ret;
- ulint n;
- ulint i;
-
- segment = os_aio_get_array_and_local_segment(&array, global_segment);
-
-restart:
- /* NOTE! We only access constant fields in os_aio_array. Therefore
- we do not have to acquire the protecting mutex yet */
-
- ut_ad(os_aio_validate());
- ut_ad(segment < array->n_segments);
-
- n = array->n_slots / array->n_segments;
-
- /* Look through n slots after the segment * n'th slot */
-
- os_mutex_enter(array->mutex);
-
- /* Check if there is a slot for which the i/o has already been
- done */
-
- for (i = 0; i < n; i++) {
- slot = os_aio_array_get_nth_slot(array, i + segment * n);
-
- if (slot->reserved && slot->io_already_done) {
-
- goto slot_io_done;
- }
- }
-
- n_consecutive = 0;
-
- for (i = 0; i < n; i++) {
- slot = os_aio_array_get_nth_slot(array, i + segment * n);
-
- if (slot->reserved) {
- /* Found an i/o request */
- consecutive_ios[n_consecutive] = slot;
- n_consecutive++;
-
- break;
- }
- }
-
- /* Check if there are several consecutive blocks to read or write */
-
-consecutive_loop:
- for (i = 0; i < n; i++) {
- slot2 = os_aio_array_get_nth_slot(array, i + segment * n);
-
- if (slot2->reserved && slot2 != slot
- && slot2->offset == slot->offset + slot->len
- && slot->offset + slot->len > slot->offset /* check that
- sum does not wrap over */
- && slot2->offset_high == slot->offset_high
- && slot2->type == slot->type
- && slot2->file == slot->file) {
-
- /* Found a consecutive i/o request */
-
- consecutive_ios[n_consecutive] = slot2;
- n_consecutive++;
-
- slot = slot2;
-
- if (n_consecutive < OS_AIO_MERGE_N_CONSECUTIVE) {
-
- goto consecutive_loop;
- } else {
- break;
- }
- }
- }
-
- if (n_consecutive == 0) {
-
- /* No i/o requested at the moment */
-
- goto wait_for_io;
- }
-
- /* We have now collected n_consecutive i/o requests in the array;
- allocate a single buffer which can hold all data, and perform the
- i/o */
-
- total_len = 0;
- slot = consecutive_ios[0];
-
- for (i = 0; i < n_consecutive; i++) {
- total_len += consecutive_ios[i]->len;
- }
-
- if (n_consecutive == 1) {
- /* We can use the buffer of the i/o request */
- combined_buf = slot->buf;
- } else {
- combined_buf = ut_malloc(total_len);
-
- ut_a(combined_buf);
- }
-
- /* We release the array mutex for the time of the i/o: NOTE that
- this assumes that there is just one i/o-handler thread serving
- a single segment of slots! */
-
- os_mutex_exit(array->mutex);
-
- if (slot->type == OS_FILE_WRITE && n_consecutive > 1) {
- /* Copy the buffers to the combined buffer */
- offs = 0;
-
- for (i = 0; i < n_consecutive; i++) {
-
- ut_memcpy(combined_buf + offs, consecutive_ios[i]->buf,
- consecutive_ios[i]->len);
- offs += consecutive_ios[i]->len;
- }
- }
-
- /* Do the i/o with ordinary, synchronous i/o functions: */
- if (slot->type == OS_FILE_WRITE) {
- ret = os_file_write(slot->name, slot->file, combined_buf,
- slot->offset, slot->offset_high, total_len);
- } else {
- ret = os_file_read(slot->file, combined_buf,
- slot->offset, slot->offset_high, total_len);
- }
-
- ut_a(ret);
-
- if (slot->type == OS_FILE_READ && n_consecutive > 1) {
- /* Copy the combined buffer to individual buffers */
- offs = 0;
-
- for (i = 0; i < n_consecutive; i++) {
-
- ut_memcpy(consecutive_ios[i]->buf, combined_buf + offs,
- consecutive_ios[i]->len);
- offs += consecutive_ios[i]->len;
- }
- }
-
- if (n_consecutive > 1) {
- ut_free(combined_buf);
- }
-
- os_mutex_enter(array->mutex);
-
- /* Mark the i/os done in slots */
-
- for (i = 0; i < n_consecutive; i++) {
- consecutive_ios[i]->io_already_done = TRUE;
- }
-
- /* We return the messages for the first slot now, and if there were
- several slots, the messages will be returned with subsequent calls
- of this function */
-
-slot_io_done:
-
- ut_a(slot->reserved);
-
- *message1 = slot->message1;
- *message2 = slot->message2;
-
- os_mutex_exit(array->mutex);
-
- os_aio_array_free_slot(array, slot);
-
- return(ret);
-
-wait_for_io:
- /* We wait here until there again can be i/os in the segment
- of this thread */
-
- os_event_reset(os_aio_segment_wait_events[global_segment]);
-
- os_mutex_exit(array->mutex);
-
- os_event_wait(os_aio_segment_wait_events[global_segment]);
-
- goto restart;
-}
-
-/**************************************************************************
-Validates the consistency of an aio array. */
-static
-bool
-os_aio_array_validate(
-/*==================*/
- /* out: TRUE if ok */
- os_aio_array_t* array) /* in: aio wait array */
-{
- os_aio_slot_t* slot;
- ulint n_reserved = 0;
- ulint i;
-
- ut_a(array);
-
- os_mutex_enter(array->mutex);
-
- ut_a(array->n_slots > 0);
- ut_a(array->n_segments > 0);
-
- for (i = 0; i < array->n_slots; i++) {
- slot = os_aio_array_get_nth_slot(array, i);
-
- if (slot->reserved) {
- n_reserved++;
- ut_a(slot->len > 0);
- }
- }
-
- ut_a(array->n_reserved == n_reserved);
-
- os_mutex_exit(array->mutex);
-
- return(TRUE);
-}
-
-/**************************************************************************
-Validates the consistency the aio system. */
-
-bool
-os_aio_validate(void)
-/*=================*/
- /* out: TRUE if ok */
-{
- os_aio_array_validate(os_aio_read_array);
- os_aio_array_validate(os_aio_write_array);
- os_aio_array_validate(os_aio_ibuf_array);
- os_aio_array_validate(os_aio_log_array);
- os_aio_array_validate(os_aio_sync_array);
-
- return(TRUE);
-}
-
-/**************************************************************************
-Prints info of the aio arrays. */
-
-void
-os_aio_print(void)
-/*==============*/
-{
- os_aio_array_t* array;
- os_aio_slot_t* slot;
- ulint n_reserved;
- ulint i;
-
- array = os_aio_read_array;
-loop:
- ut_a(array);
-
- printf("INFO OF AN AIO ARRAY\n");
-
- os_mutex_enter(array->mutex);
-
- ut_a(array->n_slots > 0);
- ut_a(array->n_segments > 0);
-
- n_reserved = 0;
-
- for (i = 0; i < array->n_slots; i++) {
- slot = os_aio_array_get_nth_slot(array, i);
-
- if (slot->reserved) {
- n_reserved++;
- printf("Reserved slot, messages %lx %lx\n",
- slot->message1, slot->message2);
- ut_a(slot->len > 0);
- }
- }
-
- ut_a(array->n_reserved == n_reserved);
-
- printf("Total of %lu reserved aio slots\n", n_reserved);
-
- os_mutex_exit(array->mutex);
-
- if (array == os_aio_read_array) {
- array = os_aio_write_array;
-
- goto loop;
- }
-
- if (array == os_aio_write_array) {
- array = os_aio_ibuf_array;
-
- goto loop;
- }
-
- if (array == os_aio_ibuf_array) {
- array = os_aio_log_array;
-
- goto loop;
- }
-
- if (array == os_aio_log_array) {
- array = os_aio_sync_array;
-
- goto loop;
- }
-}
-
-/**************************************************************************
-Checks that all slots in the system have been freed, that is, there are
-no pending io operations. */
-
-bool
-os_aio_all_slots_free(void)
-/*=======================*/
- /* out: TRUE if all free */
-{
- os_aio_array_t* array;
- ulint n_res = 0;
-
- array = os_aio_read_array;
-
- os_mutex_enter(array->mutex);
-
- n_res += array->n_reserved;
-
- os_mutex_exit(array->mutex);
-
- array = os_aio_write_array;
-
- os_mutex_enter(array->mutex);
-
- n_res += array->n_reserved;
-
- os_mutex_exit(array->mutex);
-
- array = os_aio_ibuf_array;
-
- os_mutex_enter(array->mutex);
-
- n_res += array->n_reserved;
-
- os_mutex_exit(array->mutex);
-
- array = os_aio_log_array;
-
- os_mutex_enter(array->mutex);
-
- n_res += array->n_reserved;
-
- os_mutex_exit(array->mutex);
-
- array = os_aio_sync_array;
-
- os_mutex_enter(array->mutex);
-
- n_res += array->n_reserved;
-
- os_mutex_exit(array->mutex);
-
- if (n_res == 0) {
-
- return(TRUE);
- }
-
- return(FALSE);
-}
diff --git a/innobase/os/os0proc.c b/innobase/os/os0proc.c
index a427c595bc0..85791c55348 100644
--- a/innobase/os/os0proc.c
+++ b/innobase/os/os0proc.c
@@ -515,83 +515,6 @@ os_mem_alloc_nocache(
#endif
}
-#ifdef notdefined
-/********************************************************************
-Creates a new process. */
-
-ibool
-os_process_create(
-/*==============*/
- char* name, /* in: name of the executable to start
- or its full path name */
- char* cmd, /* in: command line for the starting
- process, or NULL if no command line
- specified */
- os_process_t* proc, /* out: handle to the process */
- os_process_id_t* id) /* out: process id */
-
-{
- BOOL ret;
- PROCESS_INFORMATION pinfo;
- STARTUPINFO sinfo;
-
- /* The following assignments are default for the startupinfo
- structure */
- sinfo.cb = sizeof(STARTUPINFO);
- sinfo.lpReserved = NULL;
- sinfo.lpDesktop = NULL;
- sinfo.cbReserved2 = 0;
- sinfo.lpReserved = NULL;
-
- ret = CreateProcess(name,
- cmd,
- NULL, /* No security attributes */
- NULL, /* No thread security attrs */
- FALSE, /* Do not inherit handles */
- 0, /* No creation flags */
- NULL, /* No environment */
- NULL, /* Same current directory */
- &sinfo,
- &pinfo);
-
- *proc = pinfo.hProcess;
- *id = pinfo.dwProcessId;
-
- return(ret);
-}
-
-/**************************************************************************
-Exits a process. */
-
-void
-os_process_exit(
-/*============*/
- ulint code) /* in: exit code */
-{
- ExitProcess((UINT)code);
-}
-
-/**************************************************************************
-Gets a process exit code. */
-
-ibool
-os_process_get_exit_code(
-/*=====================*/
- /* out: TRUE if succeed, FALSE if fail */
- os_process_t proc, /* in: handle to the process */
- ulint* code) /* out: exit code */
-{
- DWORD ex_code;
- BOOL ret;
-
- ret = GetExitCodeProcess(proc, &ex_code);
-
- *code = (ulint)ex_code;
-
- return(ret);
-}
-#endif /* notdedfined */
-
/********************************************************************
Sets the priority boost for threads released from waiting within the current
process. */
diff --git a/innobase/os/os0trash.c b/innobase/os/os0trash.c
deleted file mode 100644
index e896ac9f083..00000000000
--- a/innobase/os/os0trash.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Stores the old console mode when echo is turned off */
-ulint os_old_console_mode;
-
-/********************************************************************
-Turns off echo from console input. */
-
-void
-os_console_echo_off(void)
-/*=====================*/
-{
- GetConsoleMode(stdio, &os_old_console_mode);
- SetConsoleMode(stdio, ENABLE_PROCESSED_INPUT);
-}
-
-/********************************************************************
-Turns on echo in console input. */
-
-void
-os_console_echo_on(void)
-/*====================*/
-{
- SetConsoleMode(stdio, &os_old_console_mode);
-}
-
-/********************************************************************
-Reads a character from the console. */
-
-char
-os_read_console(void)
-/*=================*/
-{
- char input_char;
- ulint n_chars;
-
- n_chars = 0;
-
- while (n_chars == 0) {
- ReadConsole(stdio, &input_char, 1, &n_chars, NULL);
- }
-
- return(input_char);
-}
-
diff --git a/innobase/os/ts/makefile b/innobase/os/ts/makefile
deleted file mode 100644
index 0e145a14e7f..00000000000
--- a/innobase/os/ts/makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-include ..\..\makefile.i
-
-doall: tsos tsosaux
-
-
-tsos: ..\os.lib tsos.c
- $(CCOM) $(CFL) -I.. -I..\.. ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\os.lib tsos.c $(LFL)
-
-tsosaux: tsosaux.c
- $(CCOM) $(CFL) -I.. -I..\.. ..\..\ut.lib ..\os.lib tsosaux.c $(LFL)
-
-
-
-
-
-
-
diff --git a/innobase/os/ts/tsos.c b/innobase/os/ts/tsos.c
deleted file mode 100644
index ecc10b86d2f..00000000000
--- a/innobase/os/ts/tsos.c
+++ /dev/null
@@ -1,793 +0,0 @@
-/************************************************************************
-The test module for the operating system interface
-
-(c) 1995 Innobase Oy
-
-Created 9/27/1995 Heikki Tuuri
-*************************************************************************/
-
-
-#include "../os0thread.h"
-#include "../os0shm.h"
-#include "../os0proc.h"
-#include "../os0sync.h"
-#include "../os0file.h"
-#include "ut0ut.h"
-#include "ut0mem.h"
-#include "sync0sync.h"
-#include "mem0mem.h"
-
-#define _WIN32_WINNT 0x0400
-#include "n:\program files\devstudio\vc\include\windows.h"
-#include "n:\program files\devstudio\vc\include\winbase.h"
-
-ulint last_thr = 1;
-
-byte global_buf[4000000];
-
-ulint* cache_buf;
-
-os_file_t file;
-os_file_t file2;
-
-os_event_t gl_ready;
-
-mutex_t ios_mutex;
-ulint ios;
-ulint rnd = 9837497;
-
-/********************************************************************
-Start function for threads in test1. */
-
-ulint
-thread(void* arg)
-/*==============*/
-{
- ulint i;
- void* arg2;
- ulint count = 0;
- ulint n;
- ulint rnd_loc;
- byte local_buf[2000];
-
- arg2 = arg;
-
- n = *((ulint*)arg);
-
-/* printf("Thread %lu started!\n", n); */
-
- for (i = 0; i < 8000; i++) {
-
- rnd_loc = rnd;
- rnd += 763482469;
-
- ut_memcpy(global_buf + (rnd_loc % 1500000) + 8200, local_buf,
- 2000);
- if (last_thr != n) {
- count++;
- last_thr = n;
- }
-
- if (i % 32 == 0) {
- os_thread_yield();
- }
- }
-
- printf("Thread %lu exits: %lu thread switches noticed\n", n, count);
-
- return(0);
-}
-
-/*********************************************************************
-Test of the speed of wait for multiple events. */
-
-void
-testa1(void)
-/*========*/
-{
- ulint i;
- os_event_t arr[64];
- ulint tm, oldtm;
-
- printf("-------------------------------------------------\n");
- printf("TEST A1. Speed of waits\n");
-
- for (i = 0; i < 64; i++) {
- arr[i] = os_event_create(NULL);
- ut_a(arr[i]);
- }
-
- os_event_set(arr[1]);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 10000; i++) {
- os_event_wait_multiple(4, arr);
- }
-
- tm = ut_clock();
-
- printf("Wall clock time for %lu multiple waits %lu millisecs\n",
- i, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 10000; i++) {
- os_event_wait(arr[1]);
- }
-
- tm = ut_clock();
-
- printf("Wall clock time for %lu single waits %lu millisecs\n",
- i, tm - oldtm);
-
-
- for (i = 0; i < 64; i++) {
- os_event_free(arr[i]);
- }
-}
-
-/*********************************************************************
-Test for threads. */
-
-void
-test1(void)
-/*=======*/
-{
- os_thread_t thr[64];
- os_thread_id_t id[64];
- ulint n[64];
- ulint tm, oldtm;
- ulint i, j;
-
- printf("-------------------------------------------\n");
- printf("OS-TEST 1. Test of thread switching through yield\n");
-
- printf("Main thread %lu starts!\n", os_thread_get_curr_id());
-
- for (j = 0; j < 2; j++) {
-
- oldtm = ut_clock();
-
- for (i = 0; i < 64; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(thread, n + i, id + i);
-/* printf("Thread %lu created, id %lu \n", i, id[i]); */
- }
-
- for (i = 0; i < 64; i++) {
- os_thread_wait(thr[i]);
- }
-
- tm = ut_clock();
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 64; i++) {
-
- thr[5] = os_thread_create(thread, n + 5, id + 5);
-
-/* printf("Thread created, id %lu \n", id[5]); */
-
- os_thread_wait(thr[5]);
- }
-
- tm = ut_clock();
- printf("Wall clock time for single thread test %lu milliseconds\n",
- tm - oldtm);
- }
-}
-
-/*********************************************************************
-Test for shared memory and process switching through yield. */
-
-void
-test2(void)
-/*=======*/
-{
- os_shm_t shm;
- ulint tm, oldtm;
- ulint* pr_no;
- ulint count;
- ulint i;
- bool ret;
- os_process_t proc;
- os_process_id_t proc_id;
-
- printf("-------------------------------------------\n");
- printf("OS-TEST 2. Test of process switching through yield\n");
-
- shm = os_shm_create(1000, "TSOS_SHM");
-
- pr_no = os_shm_map(shm);
-
- *pr_no = 1;
- count = 0;
-
- ret = os_process_create("tsosaux.exe", NULL, &proc, &proc_id);
-
- printf("Last error: %lu\n", os_thread_get_last_error());
-
- ut_a(ret);
-
- printf("Process 1 starts test!\n");
-
- oldtm = ut_clock();
-
- for (i = 0; i < 500000; i++) {
- if (*pr_no != 1) {
- count++;
- *pr_no = 1;
- }
-
- os_thread_yield();
- }
-
- tm = ut_clock();
-
- printf("Process 1 finishes test: %lu process switches noticed\n",
- count);
-
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
-
- os_shm_unmap(shm);
-
- os_shm_free(shm);
-}
-
-#ifdef notdefined
-
-/*********************************************************************
-Test for asynchronous file io. */
-
-void
-test3(void)
-/*=======*/
-{
- ulint i;
- ulint j;
- void* mess;
- bool ret;
- void* buf;
- ulint rnd;
- ulint addr[64];
- ulint serv[64];
- ulint tm, oldtm;
-
- printf("-------------------------------------------\n");
- printf("OS-TEST 3. Test of asynchronous file io\n");
-
- /* Align the buffer for file io */
-
- buf = (void*)(((ulint)global_buf + 6300) & (~0xFFF));
-
- rnd = ut_time();
-
- rnd = rnd * 3416133;
-
- printf("rnd seed %lu\n", rnd % 4900);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 32; i++) {
-
- ret = os_aio_read(file, buf, 8192 * (rnd % 4900), 0,
- 8192, (void*)i);
- ut_a(ret);
- rnd += 1;
- ret = os_aio_wait(0, &mess);
- ut_a(ret);
- }
-
- tm = ut_clock();
- printf("Wall clock time for synchr. io %lu milliseconds\n",
- tm - oldtm);
-
- rnd = rnd * 3416133;
-
- printf("rnd seed %lu\n", rnd % 5000);
-
- oldtm = ut_clock();
-
- for (j = 0; j < 5; j++) {
-
- rnd = rnd + 3416133;
-
- for (i = 0; i < 16; i++) {
- ret = os_aio_read(file, buf, 8192 * (rnd % 5000), 0, 8192,
- (void*)i);
- addr[i] = rnd % 5000;
- ut_a(ret);
- rnd += 1;
- }
-
-
- for (i = 0; i < 16; i++) {
- ret = os_aio_read(file, buf, 8192 * (rnd % 5000), 0, 8192,
- (void*)i);
- addr[i] = rnd % 5000;
- ut_a(ret);
- rnd += 1;
- }
-
- rnd = rnd + 3416133;
-
- for (i = 0; i < 32; i++) {
- ret = os_aio_wait(0, &mess);
- ut_a(ret);
- ut_a((ulint)mess < 64);
- serv[(ulint)mess] = i;
- }
- }
- tm = ut_clock();
- printf("Wall clock time for aio %lu milliseconds\n", tm - oldtm);
-
- rnd = rnd * 3416133;
-
- printf("rnd seed %lu\n", rnd % 4900);
-
- oldtm = ut_clock();
-
-for (j = 0; j < 5; j++) {
-
- rnd = rnd + 3416133;
-
- for (i = 0; i < 1; i++) {
- ret = os_aio_read(file, buf, 8192 * (rnd % 4900), 0,
- 64 * 8192, (void*)i);
- ut_a(ret);
- rnd += 4;
- ret = os_aio_wait(0, &mess);
- ut_a(ret);
- ut_a((ulint)mess < 64);
- }
-}
- tm = ut_clock();
- printf("Wall clock time for synchr. io %lu milliseconds\n",
- tm - oldtm);
-
-
-/*
- for (i = 0; i < 63; i++) {
- printf("read %lu addr %lu served as %lu\n",
- i, addr[i], serv[i]);
- }
-*/
-
- ut_a(ret);
-}
-
-/************************************************************************
-Io-handler thread function. */
-
-ulint
-handler_thread(
-/*===========*/
- void* arg)
-{
- ulint segment;
- void* mess;
- ulint i;
- bool ret;
-
- segment = *((ulint*)arg);
-
- printf("Thread %lu starts\n", segment);
-
- for (i = 0;; i++) {
- ret = os_aio_wait(segment, &mess);
-
- mutex_enter(&ios_mutex);
- ios++;
- mutex_exit(&ios_mutex);
-
- ut_a(ret);
-/* printf("Message for thread %lu %lu\n", segment,
- (ulint)mess); */
- if ((ulint)mess == 3333) {
- os_event_set(gl_ready);
- }
- }
-
- return(0);
-}
-
-/************************************************************************
-Test of io-handler threads */
-
-void
-test4(void)
-/*=======*/
-{
- ulint i;
- ulint j;
- bool ret;
- void* buf;
- ulint rnd;
- ulint tm, oldtm;
- os_thread_t thr[5];
- os_thread_id_t id[5];
- ulint n[5];
-
- printf("-------------------------------------------\n");
- printf("OS-TEST 4. Test of asynchronous file io\n");
-
- /* Align the buffer for file io */
-
- buf = (void*)(((ulint)global_buf + 6300) & (~0xFFF));
-
- gl_ready = os_event_create(NULL);
- ios = 0;
-
- sync_init();
- mem_init();
-
- mutex_create(&ios_mutex);
-
- for (i = 0; i < 5; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(handler_thread, n + i, id + i);
- }
-
- rnd = 0;
-
- oldtm = ut_clock();
-
-for (j = 0; j < 128; j++) {
-
-
- for (i = 0; i < 32; i++) {
- ret = os_aio_read(file, (byte*)buf + 8192 * (rnd % 100),
- 8192 * (rnd % 4096), 0,
- 8192, (void*)i);
- ut_a(ret);
- rnd += 1;
- }
-
-/*
- rnd += 67475941;
-
- for (i = 0; i < 1; i++) {
- ret = os_aio_read(file2, buf, 8192 * (rnd % 5000), 0,
- 8192, (void*)i);
- ut_a(ret);
- rnd += 1;
- }
-*/
-}
- ret = os_aio_read(file, buf, 8192 * (rnd % 4096), 0, 8192,
- (void*)3333);
- ut_a(ret);
-
- ut_a(!os_aio_all_slots_free());
-/*
- printf("Starting flush!\n");
- ret = os_file_flush(file);
- ut_a(ret);
- printf("Ending flush!\n");
-*/
- tm = ut_clock();
-
- printf("All ios queued! N ios: %lu\n", ios);
-
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
-
- os_event_wait(gl_ready);
-
- tm = ut_clock();
- printf("N ios: %lu\n", ios);
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
-
- os_thread_sleep(2000000);
-
- printf("N ios: %lu\n", ios);
-
- ut_a(os_aio_all_slots_free());
-}
-
-/*************************************************************************
-Initializes the asyncronous io system for tests. */
-
-void
-init_aio(void)
-/*==========*/
-{
- bool ret;
- ulint i;
- void* buf;
- void* mess;
-
- buf = (void*)(((ulint)global_buf + 6300) & (~0xFFF));
-
- os_aio_init(160, 5);
- file = os_file_create("j:\\tsfile2", OS_FILE_CREATE, OS_FILE_TABLESPACE,
- &ret);
-
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() == OS_FILE_ALREADY_EXISTS);
-
- file = os_file_create("j:\\tsfile2", OS_FILE_OPEN,
- OS_FILE_TABLESPACE, &ret);
-
- ut_a(ret);
- } else {
-
- for (i = 0; i < 4100; i++) {
- ret = os_aio_write(file, buf, 8192 * i, 0, 8192, NULL);
- ut_a(ret);
-
- ret = os_aio_wait(0, &mess);
-
- ut_a(ret);
- ut_a(mess == NULL);
- }
- }
-
- file2 = os_file_create("F:\\tmp\\tsfile", OS_FILE_CREATE,
- OS_FILE_TABLESPACE,
- &ret);
-
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() == OS_FILE_ALREADY_EXISTS);
-
- file2 = os_file_create("F:\\tmp\\tsfile", OS_FILE_OPEN,
- OS_FILE_TABLESPACE, &ret);
-
- ut_a(ret);
- } else {
-
- for (i = 0; i < 5000; i++) {
- ret = os_aio_write(file2, buf, 8192 * i, 0, 8192, NULL);
- ut_a(ret);
-
- ret = os_aio_wait(0, &mess);
-
- ut_a(ret);
- ut_a(mess == NULL);
- }
- }
-}
-
-/************************************************************************
-Test of synchronous io */
-
-void
-test5(void)
-/*=======*/
-{
- ulint i, j, k;
- bool ret;
- void* buf;
- ulint rnd = 0;
- ulint tm = 0;
- ulint oldtm = 0;
- os_file_t files[1000];
- char name[5];
- ulint err;
-
- printf("-------------------------------------------\n");
- printf("OS-TEST 5. Test of creating and opening of many files\n");
-
- /* Align the buffer for file io */
-
- buf = (void*)(((ulint)global_buf + 6300) & (~0xFFF));
-
- name[2] = '.';
- name[3] = 'd';
- name[4] = '\0';
-
- oldtm = ut_clock();
-
- for (j = 0; j < 20; j++) {
- for (i = 0; i < 20; i++) {
- name[0] = (char)(i + (ulint)'A');
- name[1] = (char)(j + (ulint)'A');
- files[j * 20 + i] = os_file_create(name, OS_FILE_CREATE,
- OS_FILE_NORMAL, &ret);
- if (!ret) {
- err = os_file_get_last_error();
- }
- ut_a(ret);
- }
- }
-
- for (k = 0; k < i * j; k++) {
- ret = os_file_close(files[k]);
- ut_a(ret);
- }
-
- for (j = 0; j < 20; j++) {
- for (i = 0; i < 20; i++) {
- name[0] = (char)(i + (ulint)'A');
- name[1] = (char)(j + (ulint)'A');
- ret = os_file_delete(name);
- ut_a(ret);
- }
- }
-
- tm = ut_clock();
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
-}
-
-/************************************************************************
-Test of synchronous io */
-
-void
-test6(void)
-/*=======*/
-{
- ulint i, j;
- bool ret;
- void* buf;
- ulint rnd = 0;
- ulint tm = 0;
- ulint oldtm = 0;
- os_file_t s_file;
-
- printf("-------------------------------------------\n");
- printf("OS-TEST 6. Test of synchronous io\n");
-
- buf = (void*)(((ulint)global_buf + 6300) & (~0xFFF));
-
- ret = os_file_close(file);
- ut_a(ret);
-
- ret = os_file_close(file2);
- ut_a(ret);
-
- s_file = os_file_create("tsfile", OS_FILE_OPEN,
- OS_FILE_NORMAL, &ret);
- if (!ret) {
- printf("Error no %lu\n", os_file_get_last_error());
- }
-
- ut_a(ret);
-
- rnd = ut_time() * 6346353;
-
- oldtm = ut_clock();
-
- for (j = 0; j < 100; j++) {
-
- rnd += 8072791;
-
- for (i = 0; i < 32; i++) {
- ret = os_file_read(s_file, buf, 8192 * (rnd % 5000), 0,
- 8192);
- ut_a(ret);
- rnd += 1;
- }
- }
-
- tm = ut_clock();
-
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
-}
-
-/************************************************************************
-Test of file size operations. */
-
-void
-test7(void)
-/*=======*/
-{
- bool ret;
- os_file_t f;
- ulint len;
- ulint high;
-
- printf("-------------------------------------------\n");
- printf("OS-TEST 7. Test of setting and getting file size\n");
-
-
- f = os_file_create("sizefile", OS_FILE_CREATE, OS_FILE_TABLESPACE,
- &ret);
- ut_a(ret);
-
- ret = os_file_get_size(f, &len, &high);
- ut_a(ret);
-
- ut_a(len == 0);
- ut_a(high == 0);
-
- ret = os_file_set_size(f, 5000000, 0);
- ut_a(ret);
-
- ret = os_file_get_size(f, &len, &high);
- ut_a(ret);
-
- ut_a(len == 5000000);
- ut_a(high == 0);
-
- ret = os_file_set_size(f, 4000000, 0);
- ut_a(ret);
-
- ret = os_file_get_size(f, &len, &high);
- ut_a(ret);
-
- ut_a(len == 4000000);
- ut_a(high == 0);
-
- ret = os_file_close(f);
- ut_a(ret);
-
- ret = os_file_delete("sizefile");
- ut_a(ret);
-}
-#endif
-
-/************************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
- ulint i;
- CRITICAL_SECTION cs;
- ulint sum;
- ulint rnd;
-
- cache_buf = VirtualAlloc(NULL, 4 * 1024, MEM_COMMIT,
- PAGE_READWRITE /* | PAGE_NOCACHE */);
- oldtm = ut_clock();
-
- sum = 0;
- rnd = 0;
-
- for (i = 0; i < 1000000; i++) {
-
- sum += cache_buf[rnd * (16)];
-
- rnd += 1;
-
- if (rnd > 7) {
- rnd = 0;
- }
- }
-
- tm = ut_clock();
-
- printf("Wall clock time for cache test %lu milliseconds\n", tm - oldtm);
-
- InterlockedExchange(&i, 5);
-
- InitializeCriticalSection(&cs);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 10000000; i++) {
-
- TryEnterCriticalSection(&cs);
-
- LeaveCriticalSection(&cs);
- }
-
- tm = ut_clock();
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
-
- testa1();
-
- test1();
-
-/* test2(); */
-
-/* init_aio(); */
-/*
- test3();
-*/
-/* test4();
-
- test5();
-
- test6();
-
- test7(); */
-
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
-
diff --git a/innobase/os/ts/tsosaux.c b/innobase/os/ts/tsosaux.c
deleted file mode 100644
index 8f7780844e9..00000000000
--- a/innobase/os/ts/tsosaux.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/************************************************************************
-The test module for the operating system interface
-Auxiliary executable run alongside tsos.exe to test
-process switching speed
-
-(c) 1995 Innobase Oy
-
-Created 9/27/1995 Heikki Tuuri
-*************************************************************************/
-
-
-#include "../os0thread.h"
-#include "../os0shm.h"
-#include "../os0proc.h"
-#include "ut0ut.h"
-
-/*********************************************************************
-Test for shared memory and process switching through yield. */
-
-void
-test2(void)
-/*=======*/
-{
- os_shm_t shm;
- ulint tm, oldtm;
- ulint* pr_no;
- ulint count;
- ulint i;
-
- printf("-------------------------------------------\n");
- printf("OS-TEST 2. Test of process switching through yield\n");
-
-
- shm = os_shm_create(1000, "TSOS_SHM");
-
- pr_no = os_shm_map(shm);
-
- count = 0;
-
- printf("Process 2 starts test!\n");
-
- oldtm = ut_clock();
-
- for (i = 0; i < 100000; i++) {
- if (*pr_no != 2) {
- count++;
- *pr_no = 2;
- }
- os_thread_yield();
- }
-
- tm = ut_clock();
-
- printf("Process 2 finishes test: %lu process switches noticed\n",
- count);
-
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
-
-
- os_shm_unmap(shm);
-
- os_shm_free(shm);
-}
-
-/************************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
-
- oldtm = ut_clock();
-
- test2();
-
- tm = ut_clock();
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-
- os_process_exit(0);
-}
diff --git a/innobase/page/page0cur.c b/innobase/page/page0cur.c
index 89dad4f268f..5d26d12bf20 100644
--- a/innobase/page/page0cur.c
+++ b/innobase/page/page0cur.c
@@ -16,11 +16,12 @@ Created 10/4/1994 Heikki Tuuri
#include "log0recv.h"
#include "rem0cmp.h"
-ulint page_cur_short_succ = 0;
-
-ulint page_rnd = 976722341;
+static ulint page_rnd = 976722341;
#ifdef PAGE_CUR_ADAPT
+# ifdef UNIV_SEARCH_PERF_STAT
+ulint page_cur_short_succ = 0;
+# endif /* UNIV_SEARCH_PERF_STAT */
/********************************************************************
Tries a search shortcut based on the last insert. */
@@ -716,7 +717,7 @@ page_cur_parse_insert_rec(
buf_page_print(page);
- ut_a(0);
+ ut_error;
}
ut_memcpy(buf, rec_get_start(cursor_rec), mismatch_index);
diff --git a/innobase/page/page0page.c b/innobase/page/page0page.c
index 9c9e1f4156c..c64a7590b94 100644
--- a/innobase/page/page0page.c
+++ b/innobase/page/page0page.c
@@ -19,9 +19,6 @@ Created 2/2/1994 Heikki Tuuri
#include "btr0sea.h"
#include "buf0buf.h"
-/* A cached template page used in page_create */
-page_t* page_template = NULL;
-
/* THE INDEX PAGE
==============
@@ -113,7 +110,7 @@ page_dir_find_owner_slot(
buf_page_print(page);
- ut_a(0);
+ ut_error;
}
i--;
@@ -321,20 +318,6 @@ page_create(
fil_page_set_type(page, FIL_PAGE_INDEX);
- /* If we have a page template, copy the page structure from there */
-
- if (page_template) {
- ut_memcpy(page + PAGE_HEADER,
- page_template + PAGE_HEADER, PAGE_HEADER_PRIV_END);
- ut_memcpy(page + PAGE_DATA,
- page_template + PAGE_DATA,
- PAGE_SUPREMUM_END - PAGE_DATA);
- ut_memcpy(page + UNIV_PAGE_SIZE - PAGE_EMPTY_DIR_START,
- page_template + UNIV_PAGE_SIZE - PAGE_EMPTY_DIR_START,
- PAGE_EMPTY_DIR_START - PAGE_DIR);
- return(frame);
- }
-
heap = mem_heap_create(200);
/* 3. CREATE THE INFIMUM AND SUPREMUM RECORDS */
@@ -409,17 +392,6 @@ page_create(
rec_set_next_offs(infimum_rec, (ulint)(supremum_rec - page));
rec_set_next_offs(supremum_rec, 0);
-#ifdef notdefined
- /* Disable the use of page_template: there is a race condition here:
- while one thread is creating page_template, another one can start
- using it before the memcpy completes! */
-
- if (page_template == NULL) {
- page_template = mem_alloc(UNIV_PAGE_SIZE);
-
- ut_memcpy(page_template, page, UNIV_PAGE_SIZE);
- }
-#endif
return(page);
}
@@ -469,7 +441,7 @@ page_copy_rec_list_end_no_locks(
(ulong)(rec - page),
(ulong)(page_cur_get_rec(&cur1) - page),
(ulong)(page_cur_get_rec(&cur2) - new_page));
- ut_a(0);
+ ut_error;
}
page_cur_move_to_next(&cur1);
diff --git a/innobase/page/ts/makefile b/innobase/page/ts/makefile
deleted file mode 100644
index cf96509ee73..00000000000
--- a/innobase/page/ts/makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-include ..\..\makefile.i
-
-tspage: ..\page.lib tspage.c
- $(CCOM) $(CFL) -I.. -I..\.. ..\page.lib ..\..\btr.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\buf.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tspage.c $(LFL)
-
-
-
-
-
-
-
-
-
diff --git a/innobase/page/ts/tspage.c b/innobase/page/ts/tspage.c
deleted file mode 100644
index 3b8869e5e14..00000000000
--- a/innobase/page/ts/tspage.c
+++ /dev/null
@@ -1,705 +0,0 @@
-/************************************************************************
-The test for the index page
-
-(c) 1994-1996 Innobase Oy
-
-Created 1/31/1994 Heikki Tuuri
-*************************************************************************/
-
-#include "sync0sync.h"
-#include "ut0mem.h"
-#include "mem0mem.h"
-#include "data0data.h"
-#include "data0type.h"
-#include "dict0dict.h"
-#include "buf0buf.h"
-#include "os0file.h"
-#include "fil0fil.h"
-#include "rem0rec.h"
-#include "rem0cmp.h"
-#include "mtr0mtr.h"
-#include "log0log.h"
-#include "..\page0page.h"
-#include "..\page0cur.h"
-
-os_file_t files[1000];
-
-mutex_t ios_mutex;
-ulint ios;
-ulint n[10];
-
-mutex_t incs_mutex;
-ulint incs;
-
-byte bigbuf[1000000];
-
-#define N_SPACES 1
-#define N_FILES 2
-#define FILE_SIZE 1000 /* must be > 512 */
-#define POOL_SIZE 1000
-#define COUNTER_OFFSET 1500
-
-#define LOOP_SIZE 150
-#define N_THREADS 5
-
-
-ulint zero = 0;
-
-buf_block_t* bl_arr[POOL_SIZE];
-
-/************************************************************************
-Io-handler thread function. */
-
-ulint
-handler_thread(
-/*===========*/
- void* arg)
-{
- ulint segment;
- void* mess;
- ulint i;
- bool ret;
-
- segment = *((ulint*)arg);
-
- printf("Io handler thread %lu starts\n", segment);
-
- for (i = 0;; i++) {
- ret = fil_aio_wait(segment, &mess);
- ut_a(ret);
-
- buf_page_io_complete((buf_block_t*)mess);
-
- mutex_enter(&ios_mutex);
- ios++;
- mutex_exit(&ios_mutex);
-
- }
-
- return(0);
-}
-
-/*************************************************************************
-Creates the files for the file system test and inserts them to
-the file system. */
-
-void
-create_files(void)
-/*==============*/
-{
- bool ret;
- ulint i, k;
- char name[20];
- os_thread_t thr[5];
- os_thread_id_t id[5];
-
- printf("--------------------------------------------------------\n");
- printf("Create or open database files\n");
-
- strcpy(name, "j:\\tsfile00");
-
- for (k = 0; k < N_SPACES; k++) {
- for (i = 0; i < N_FILES; i++) {
-
- name[9] = (char)((ulint)'0' + k);
- name[10] = (char)((ulint)'0' + i);
-
- files[i] = os_file_create(name, OS_FILE_CREATE,
- OS_FILE_TABLESPACE, &ret);
-
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(
- name, OS_FILE_OPEN,
- OS_FILE_TABLESPACE, &ret);
-
- ut_a(ret);
- }
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create(name, k, OS_FILE_TABLESPACE);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, FILE_SIZE, k);
- }
- }
-
- ios = 0;
-
- mutex_create(&ios_mutex);
-
- for (i = 0; i < 5; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(handler_thread, n + i, id + i);
- }
-}
-
-/*********************************************************************
-Test for index page. */
-
-void
-test1(void)
-/*=======*/
-{
- page_t* page;
- dtuple_t* tuple;
- mem_heap_t* heap;
- ulint i;
- ulint rnd = 0;
- rec_t* rec;
- page_cur_t cursor;
- dict_index_t* index;
- dict_table_t* table;
- buf_block_t* block;
- buf_frame_t* frame;
- mtr_t mtr;
-
- printf("-------------------------------------------------\n");
- printf("TEST 1. Basic test\n");
-
- heap = mem_heap_create(0);
-
- table = dict_table_create("TS_TABLE1", 3);
-
- dict_table_add_col(table, "COL1", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
- dict_table_add_col(table, "COL2", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
- dict_table_add_col(table, "COL3", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
-
- ut_a(0 == dict_table_publish(table));
-
- index = dict_index_create("TS_TABLE1", "IND1", 0, 3, 0);
-
- dict_index_add_field(index, "COL1", 0);
- dict_index_add_field(index, "COL2", 0);
- dict_index_add_field(index, "COL3", 0);
-
- ut_a(0 == dict_index_publish(index));
-
- index = dict_index_get("TS_TABLE1", "IND1");
- ut_a(index);
-
- tuple = dtuple_create(heap, 3);
-
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd + 534671) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
-/* page_print_list(page, 151); */
-
- ut_a(page_validate(page, index));
- ut_a(page_get_n_recs(page) == 512);
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd + 7771) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- page_cur_delete_rec(&cursor, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
- ut_a(page_get_n_recs(page) == 0);
-
- ut_a(page_validate(page, index));
- page = page_create(frame, &mtr);
-
- rnd = 311;
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd + 1) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
- ut_a(page_validate(page, index));
- ut_a(page_get_n_recs(page) == 512);
-
- rnd = 217;
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd + 1) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- page_cur_delete_rec(&cursor, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
- ut_a(page_validate(page, index));
- ut_a(page_get_n_recs(page) == 0);
- page = page_create(frame, &mtr);
-
- rnd = 291;
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd - 1) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
- ut_a(page_validate(page, index));
- ut_a(page_get_n_recs(page) == 512);
-
- rnd = 277;
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd - 1) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- page_cur_delete_rec(&cursor, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
- ut_a(page_validate(page, index));
- ut_a(page_get_n_recs(page) == 0);
-
- mtr_commit(&mtr);
- mem_heap_free(heap);
-}
-
-/*********************************************************************
-Test for index page. */
-
-void
-test2(void)
-/*=======*/
-{
- page_t* page;
- dtuple_t* tuple;
- mem_heap_t* heap;
- ulint i, j;
- ulint rnd = 0;
- rec_t* rec;
- page_cur_t cursor;
- dict_index_t* index;
- dict_table_t* table;
- buf_block_t* block;
- buf_frame_t* frame;
- ulint tm, oldtm;
- byte buf[8];
- mtr_t mtr;
- mtr_t mtr2;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2. Speed test\n");
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1000 * UNIV_DBC * UNIV_DBC; i++) {
- ut_memcpy(bigbuf, bigbuf + 800, 800);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu mem copys of 800 bytes %lu millisecs\n",
- i, tm - oldtm);
-
- oldtm = ut_clock();
-
- rnd = 0;
- for (i = 0; i < 1000 * UNIV_DBC * UNIV_DBC; i++) {
- ut_memcpy(bigbuf + rnd, bigbuf + rnd + 800, 800);
- rnd += 1600;
- if (rnd > 995000) {
- rnd = 0;
- }
- }
-
- tm = ut_clock();
- printf("Wall time for %lu mem copys of 800 bytes %lu millisecs\n",
- i, tm - oldtm);
-
- heap = mem_heap_create(0);
-
- table = dict_table_create("TS_TABLE2", 2);
-
- dict_table_add_col(table, "COL1", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
- dict_table_add_col(table, "COL2", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
-
- ut_a(0 == dict_table_publish(table));
-
- index = dict_index_create("TS_TABLE2", "IND2", 0, 2, 0);
-
- dict_index_add_field(index, "COL1", 0);
- dict_index_add_field(index, "COL2", 0);
-
- ut_a(0 == dict_index_publish(index));
-
- index = dict_index_get("TS_TABLE2", "IND2");
- ut_a(index);
-
- tuple = dtuple_create(heap, 3);
-
- oldtm = ut_clock();
-
- rnd = 677;
- for (i = 0; i < 5 * UNIV_DBC * UNIV_DBC; i++) {
-
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- for (j = 0; j < 200; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple3(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
- ut_a(rec);
- }
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf("Wall time for insertion of %lu recs %lu milliseconds\n",
- i * j, tm - oldtm);
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, 5, &mtr);
- buf_page_s_lock(block, &mtr);
-
- page = buf_block_get_frame(block);
- ut_a(page_validate(page, index));
- mtr_commit(&mtr);
-
- oldtm = ut_clock();
-
- rnd = 677;
- for (i = 0; i < 5 * UNIV_DBC * UNIV_DBC; i++) {
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- for (j = 0; j < 200; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple3(tuple, rnd, buf);
- }
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf(
- "Wall time for %lu empty loops with page create %lu milliseconds\n",
- i * j, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 5 * UNIV_DBC * UNIV_DBC; i++) {
-
-
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- mtr_commit(&mtr);
-
- rnd = 100;
- for (j = 0; j < 200; j++) {
- mtr_start(&mtr2);
-
- block = buf_page_get(0, 5, &mtr2);
- buf_page_x_lock(block, &mtr2);
-
- page = buf_block_get_frame(block);
-
- rnd = (rnd + 1) % 1000;
- dtuple_gen_test_tuple3(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr2);
- ut_a(rec);
-
- mtr_commit(&mtr2);
- }
- }
-
- tm = ut_clock();
- printf(
- "Wall time for sequential insertion of %lu recs %lu milliseconds\n",
- i * j, tm - oldtm);
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, 5, &mtr);
- buf_page_s_lock(block, &mtr);
-
- page = buf_block_get_frame(block);
- ut_a(page_validate(page, index));
- mtr_commit(&mtr);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 5 * UNIV_DBC * UNIV_DBC; i++) {
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- rnd = 500;
- for (j = 0; j < 200; j++) {
- rnd = (rnd - 1) % 1000;
- dtuple_gen_test_tuple3(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
- ut_a(rec);
- }
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf(
- "Wall time for descend. seq. insertion of %lu recs %lu milliseconds\n",
- i * j, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 5 * UNIV_DBC * UNIV_DBC; i++) {
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- rnd = 677;
-
- for (j = 0; j < 200; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple3(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
- ut_a(rec);
- }
-
- rnd = 677;
- for (j = 0; j < 200; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple3(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- page_cur_delete_rec(&cursor, &mtr);
- }
- ut_a(page_get_n_recs(page) == 0);
-
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf("Wall time for insert and delete of %lu recs %lu milliseconds\n",
- i * j, tm - oldtm);
-
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- rnd = 677;
-
- for (j = 0; j < 200; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple3(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
- ut_a(rec);
- }
- ut_a(page_validate(page, index));
- mtr_print(&mtr);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 5 * UNIV_DBC * UNIV_DBC; i++) {
- rnd = 677;
- for (j = 0; j < 200; j++) {
-/* rnd = (rnd + 54841) % 1000;*/
- dtuple_gen_test_tuple3(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
- }
- }
-
- tm = ut_clock();
- printf("Wall time for search of %lu recs %lu milliseconds\n",
- i * j, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 5 * UNIV_DBC * UNIV_DBC; i++) {
- rnd = 677;
- for (j = 0; j < 200; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple3(tuple, rnd, buf);
- }
- }
-
- tm = ut_clock();
- printf("Wall time for %lu empty loops %lu milliseconds\n",
- i * j, tm - oldtm);
- mtr_commit(&mtr);
-}
-
-/********************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
-
- sync_init();
- mem_init();
- os_aio_init(160, 5);
- fil_init(25);
- buf_pool_init(100, 100);
- dict_init();
- log_init();
-
- create_files();
-
- oldtm = ut_clock();
-
- ut_rnd_set_seed(19);
-
- test1();
- test2();
-
- mem_print_info();
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/pars/lexyy.c b/innobase/pars/lexyy.c
index 7c6711d2f97..f014200b2a6 100644
--- a/innobase/pars/lexyy.c
+++ b/innobase/pars/lexyy.c
@@ -627,7 +627,7 @@ Linux.
#define malloc(A) mem_alloc(A)
#define free(A) mem_free(A)
#define realloc(P, A) mem_realloc(P, A, __FILE__, __LINE__)
-#define exit(A) ut_a(0)
+#define exit(A) ut_error
#define YY_INPUT(buf, result, max_size) pars_get_lex_chars(buf, &result, max_size)
#define comment 1
diff --git a/innobase/pars/pars0pars.c b/innobase/pars/pars0pars.c
index 3e43b6ae262..5bbfca831f2 100644
--- a/innobase/pars/pars0pars.c
+++ b/innobase/pars/pars0pars.c
@@ -29,13 +29,14 @@ on 1/27/1998 */
#include "trx0trx.h"
#include "trx0roll.h"
#include "lock0lock.h"
-#include "odbc0odbc.h"
#include "eval0eval.h"
+#ifdef UNIV_SQL_DEBUG
/* If the following is set TRUE, the lexer will print the SQL string
as it tokenizes it */
ibool pars_print_lexed = FALSE;
+#endif /* UNIV_SQL_DEBUG */
/* Global variable used while parsing a single procedure or query : the code is
NOT re-entrant */
@@ -389,7 +390,7 @@ pars_resolve_exp_variables_and_types(
}
if (!node) {
- printf("PARSER ERROR: Unresolved identifier %s\n",
+ fprintf(stderr, "PARSER ERROR: Unresolved identifier %s\n",
sym_node->name);
}
@@ -522,25 +523,6 @@ pars_resolve_exp_list_columns(
}
/*************************************************************************
-Retrieves the stored procedure definition for a procedure name. */
-static
-void
-pars_retrieve_procedure_def(
-/*========================*/
- sym_node_t* sym_node) /* in: procedure name node */
-{
- ut_a(sym_node);
- ut_a(que_node_get_type(sym_node) == QUE_NODE_SYMBOL);
-
- sym_node->resolved = TRUE;
- sym_node->token_type = SYM_PROCEDURE_NAME;
-
- sym_node->procedure_def = dict_procedure_get((char*)sym_node->name,
- NULL);
- ut_a(sym_node->procedure_def);
-}
-
-/*************************************************************************
Retrieves the table definition for a table name id. */
static
void
@@ -1662,219 +1644,22 @@ pars_procedure_definition(
/*****************************************************************
Parses a stored procedure call, when this is not within another stored
-procedure, that is, the client issues a procedure call directly. */
+procedure, that is, the client issues a procedure call directly.
+In MySQL/InnoDB, stored InnoDB procedures are invoked via the
+parsed procedure tree, not via InnoDB SQL, so this function is not used. */
que_fork_t*
pars_stored_procedure_call(
/*=======================*/
/* out: query graph */
- sym_node_t* sym_node) /* in: stored procedure name */
+ sym_node_t* sym_node __attribute__((unused)))
+ /* in: stored procedure name */
{
- call_node_t* node;
- que_fork_t* fork;
- que_thr_t* thr;
- mem_heap_t* heap;
-
- heap = pars_sym_tab_global->heap;
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_PROCEDURE_CALL, heap);
- fork->trx = NULL;
-
- thr = que_thr_create(fork, heap);
-
- node = mem_heap_alloc(heap, sizeof(call_node_t));
-
- thr->child = node;
-
- node->common.type = QUE_NODE_CALL;
- node->common.parent = thr;
-
- sym_node->token_type = SYM_PROCEDURE_NAME;
-
- pars_retrieve_procedure_def(sym_node);
-
- node->procedure_def = sym_node->procedure_def;
- node->proc_name = sym_node;
-
- node->sym_tab = pars_sym_tab_global;
-
- pars_sym_tab_global->query_graph = fork;
-
- return(fork);
-}
-
-/*****************************************************************
-Writes info about query parameter markers (denoted with '?' in ODBC) into a
-buffer. */
-
-ulint
-pars_write_query_param_info(
-/*========================*/
- /* out: number of bytes used for info in buf */
- byte* buf, /* in: buffer which must be big enough */
- que_fork_t* graph) /* in: parsed query graph */
-{
- que_thr_t* thr;
- call_node_t* call_node;
- dict_proc_t* procedure_def;
- que_t* stored_graph;
- proc_node_t* proc_node;
- sym_node_t* param;
- ulint n_params;
- ibool is_input;
-
- /* We currently support parameter markers only in stored procedure
- calls, and there ALL procedure parameters must be marked with '?':
- no literal values are allowed */
-
- thr = UT_LIST_GET_FIRST(graph->thrs);
-
- n_params = 0;
-
- if (que_node_get_type(thr->child) == QUE_NODE_CALL) {
- call_node = thr->child;
-
- procedure_def = call_node->procedure_def;
-
- stored_graph = dict_procedure_reserve_parsed_copy(
- procedure_def);
- proc_node = que_fork_get_child(stored_graph);
-
- param = proc_node->param_list;
-
- while (param) {
- if (param->param_type == PARS_INPUT) {
- is_input = TRUE;
- } else {
- is_input = FALSE;
- }
-
- mach_write_to_1(buf + 4 + n_params, is_input);
-
- n_params++;
-
- param = que_node_get_next(param);
- }
-
- dict_procedure_release_parsed_copy(stored_graph);
- }
-
- mach_write_to_4(buf, n_params);
-
- return(4 + n_params);
+ ut_error;
+ return(NULL);
}
/*****************************************************************
-Reads stored procedure input parameter values from a buffer. */
-
-void
-pars_proc_read_input_params_from_buf(
-/*=================================*/
- que_t* graph, /* in: query graph which contains a stored procedure */
- byte* buf) /* in: buffer */
-{
- que_thr_t* thr;
- proc_node_t* proc_node;
- sym_node_t* param;
- byte* ptr;
- ulint len;
- lint odbc_len;
-
- ut_ad(graph->fork_type == QUE_FORK_PROCEDURE);
-
- thr = UT_LIST_GET_FIRST(graph->thrs);
-
- proc_node = thr->child;
-
- ptr = buf;
-
- param = proc_node->param_list;
-
- while (param) {
- if (param->param_type == PARS_INPUT) {
- odbc_len = (lint)mach_read_from_4(ptr);
-
- ptr += 4;
-
- if (odbc_len == SQL_NULL_DATA) {
- len = UNIV_SQL_NULL;
- } else {
- len = (ulint)odbc_len;
- }
-
- eval_node_copy_and_alloc_val(param, ptr, len);
-
- if (len != UNIV_SQL_NULL) {
- ptr += len;
- }
- }
-
- param = que_node_get_next(param);
- }
-
- ut_ad(ptr - buf < ODBC_DATAGRAM_SIZE);
-}
-
-/*****************************************************************
-Writes stored procedure output parameter values to a buffer. */
-
-ulint
-pars_proc_write_output_params_to_buf(
-/*=================================*/
- /* out: bytes used in buf */
- byte* buf, /* in: buffer which must be big enough */
- que_t* graph) /* in: query graph which contains a stored procedure */
-{
- que_thr_t* thr;
- proc_node_t* proc_node;
- sym_node_t* param;
- dfield_t* dfield;
- byte* ptr;
- ulint len;
- lint odbc_len;
-
- ut_ad(graph->fork_type == QUE_FORK_PROCEDURE);
-
- thr = UT_LIST_GET_FIRST(graph->thrs);
-
- proc_node = thr->child;
-
- ptr = buf;
-
- param = proc_node->param_list;
-
- while (param) {
- if (param->param_type == PARS_OUTPUT) {
- dfield = que_node_get_val(param);
-
- len = dfield_get_len(dfield);
-
- if (len == UNIV_SQL_NULL) {
- odbc_len = SQL_NULL_DATA;
- } else {
- odbc_len = (lint)len;
- }
-
- mach_write_to_4(ptr, (ulint)odbc_len);
-
- ptr += 4;
-
- if (len != UNIV_SQL_NULL) {
- ut_memcpy(ptr, dfield_get_data(dfield), len);
-
- ptr += len;
- }
- }
-
- param = que_node_get_next(param);
- }
-
- ut_ad(ptr - buf < ODBC_DATAGRAM_SIZE);
-
- return((ulint)(ptr - buf));
-}
-
-/*****************************************************************
Retrieves characters to the lexical analyzer. */
void
@@ -1886,13 +1671,12 @@ pars_get_lex_chars(
in the buffer */
{
int len;
- char print_buf[16];
len = pars_sym_tab_global->string_len
- pars_sym_tab_global->next_char_pos;
if (len == 0) {
#ifdef YYDEBUG
- /* printf("SQL string ends\n"); */
+ /* fputs("SQL string ends\n", stderr); */
#endif
*result = 0;
@@ -1903,18 +1687,18 @@ pars_get_lex_chars(
len = max_size;
}
+#ifdef UNIV_SQL_DEBUG
if (pars_print_lexed) {
if (len >= 5) {
len = 5;
}
-
- ut_memcpy(print_buf, pars_sym_tab_global->sql_string +
- pars_sym_tab_global->next_char_pos, len);
- print_buf[len] = '\0';
-
- printf("%s", print_buf);
+
+ fwrite(pars_sym_tab_global->sql_string +
+ pars_sym_tab_global->next_char_pos,
+ 1, len, stderr);
}
+#endif /* UNIV_SQL_DEBUG */
ut_memcpy(buf, pars_sym_tab_global->sql_string +
pars_sym_tab_global->next_char_pos, len);
@@ -1944,7 +1728,7 @@ yyerror(
{
ut_ad(s);
- printf("PARSER ERROR: Syntax error in SQL string\n");
+ fputs("PARSER ERROR: Syntax error in SQL string\n", stderr);
ut_error;
}
@@ -1968,10 +1752,10 @@ pars_sql(
heap = mem_heap_create(256);
+#ifdef UNIV_SYNC_DEBUG
/* Currently, the parser is not reentrant: */
-
ut_ad(mutex_own(&(dict_sys->mutex)));
-
+#endif /* UNIV_SYNC_DEBUG */
pars_sym_tab_global = sym_tab_create(heap);
len = ut_strlen(str);
@@ -1996,7 +1780,7 @@ pars_sql(
graph->sym_tab = pars_sym_tab_global;
- /* printf("SQL graph size %lu\n", mem_heap_get_size(heap)); */
+ /* fprintf(stderr, "SQL graph size %lu\n", mem_heap_get_size(heap)); */
return(graph);
}
diff --git a/innobase/que/que0que.c b/innobase/que/que0que.c
index 7e4babd43ef..b2608b6d175 100644
--- a/innobase/que/que0que.c
+++ b/innobase/que/que0que.c
@@ -7,7 +7,7 @@ Created 5/27/1996 Heikki Tuuri
*******************************************************/
#include "que0que.h"
-
+
#ifdef UNIV_NONINL
#include "que0que.ic"
#endif
@@ -25,7 +25,6 @@ Created 5/27/1996 Heikki Tuuri
#include "log0log.h"
#include "eval0proc.h"
#include "eval0eval.h"
-#include "odbc0odbc.h"
#define QUE_PARALLELIZE_LIMIT (64 * 256 * 256 * 256)
#define QUE_ROUND_ROBIN_LIMIT (64 * 256 * 256 * 256)
@@ -73,37 +72,6 @@ void
que_thr_move_to_run_state(
/*======================*/
que_thr_t* thr); /* in: an query thread */
-/**************************************************************************
-Tries to parallelize query if it is not parallel enough yet. */
-static
-que_thr_t*
-que_try_parallelize(
-/*================*/
- /* out: next thread to execute */
- que_thr_t* thr); /* in: query thread */
-
-#ifdef notdefined
-/********************************************************************
-Adds info about the number of inserted rows etc. to the message to the
-client. */
-static
-void
-que_thr_add_update_info(
-/*====================*/
- que_thr_t* thr) /* in: query thread */
-{
- que_fork_t* graph;
-
- graph = thr->graph;
-
- mach_write_to_8(thr->msg_buf + SESS_SRV_MSG_N_INSERTS,
- graph->n_inserts);
- mach_write_to_8(thr->msg_buf + SESS_SRV_MSG_N_UPDATES,
- graph->n_updates);
- mach_write_to_8(thr->msg_buf + SESS_SRV_MSG_N_DELETES,
- graph->n_deletes);
-}
-#endif
/***************************************************************************
Adds a query graph to the session's list of graphs. */
@@ -114,7 +82,9 @@ que_graph_publish(
que_t* graph, /* in: graph */
sess_t* sess) /* in: session */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
UT_LIST_ADD_LAST(graphs, sess->graphs, graph);
}
@@ -221,7 +191,9 @@ que_thr_end_wait(
{
ibool was_active;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(thr);
ut_ad((thr->state == QUE_THR_LOCK_WAIT)
|| (thr->state == QUE_THR_PROCEDURE_WAIT)
@@ -260,7 +232,9 @@ que_thr_end_wait_no_next_thr(
ut_a(thr->state == QUE_THR_LOCK_WAIT); /* In MySQL this is the
only possible state here */
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(thr);
ut_ad((thr->state == QUE_THR_LOCK_WAIT)
|| (thr->state == QUE_THR_PROCEDURE_WAIT)
@@ -310,15 +284,9 @@ que_fork_start_command(
QUE_THR_RUNNING state, or NULL; the query
thread should be executed by que_run_threads
by the caller */
- que_fork_t* fork, /* in: a query fork */
- ulint command,/* in: command SESS_COMM_FETCH_NEXT, ... */
- ulint param) /* in: possible parameter to the command */
+ que_fork_t* fork) /* in: a query fork */
{
que_thr_t* thr;
-
- /* Set the command parameters in the fork root */
- fork->command = command;
- fork->param = param;
fork->state = QUE_FORK_ACTIVE;
@@ -401,7 +369,9 @@ que_fork_error_handle(
{
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);
@@ -515,7 +485,7 @@ que_graph_free_recursive(
"que_thr struct appears corrupt; magic n %lu\n",
(unsigned long) thr->magic_n);
mem_analyze_corruption((byte*)thr);
- ut_a(0);
+ ut_error;
}
thr->magic_n = QUE_THR_MAGIC_FREED;
@@ -627,7 +597,7 @@ que_graph_free_recursive(
"que_node struct appears corrupt; type %lu\n",
(unsigned long) que_node_get_type(node));
mem_analyze_corruption((byte*)node);
- ut_a(0);
+ ut_error;
}
}
@@ -671,7 +641,9 @@ que_graph_try_free(
{
sess_t* sess;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
sess = (graph->trx)->sess;
@@ -696,65 +668,20 @@ does nothing! */
void
que_thr_handle_error(
/*=================*/
- que_thr_t* thr, /* in: query thread */
- ulint err_no, /* in: error number */
- byte* err_str,/* in, own: error string or NULL; NOTE: the
+ que_thr_t* thr __attribute__((unused)),
+ /* in: query thread */
+ ulint err_no __attribute__((unused)),
+ /* in: error number */
+ byte* err_str __attribute__((unused)),
+ /* in, own: error string or NULL; NOTE: the
function will take care of freeing of the
string! */
- ulint err_len)/* in: error string length */
+ ulint err_len __attribute__((unused)))
+ /* in: error string length */
{
- UT_NOT_USED(thr);
- UT_NOT_USED(err_no);
- UT_NOT_USED(err_str);
- UT_NOT_USED(err_len);
-
/* Does nothing */
}
-/**************************************************************************
-Tries to parallelize query if it is not parallel enough yet. */
-static
-que_thr_t*
-que_try_parallelize(
-/*================*/
- /* out: next thread to execute */
- que_thr_t* thr) /* in: query thread */
-{
- ut_ad(thr);
-
- /* Does nothing yet */
-
- return(thr);
-}
-
-/********************************************************************
-Builds a command completed-message to the client. */
-static
-ulint
-que_build_srv_msg(
-/*==============*/
- /* out: message data length */
- byte* buf, /* in: message buffer */
- que_fork_t* fork, /* in: query graph where execution completed */
- sess_t* sess) /* in: session */
-{
- ulint len;
-
- /* Currently, we only support stored procedures: */
- ut_ad(fork->fork_type == QUE_FORK_PROCEDURE);
-
- if (sess->state == SESS_ERROR) {
-
- return(0);
- }
-
- sess_srv_msg_init(sess, buf, SESS_SRV_SUCCESS);
-
- len = pars_proc_write_output_params_to_buf(buf + SESS_SRV_MSG_DATA,
- fork);
- return(len);
-}
-
/********************************************************************
Performs an execution step on a thr node. */
static
@@ -851,10 +778,6 @@ que_thr_dec_refer_count(
que_fork_t* fork;
trx_t* trx;
sess_t* sess;
- ibool send_srv_msg = FALSE;
- ibool release_stored_proc = FALSE;
- ulint msg_len = 0;
- byte msg_buf[ODBC_DATAGRAM_SIZE];
ulint fork_type;
ibool stopped;
@@ -875,8 +798,8 @@ que_thr_dec_refer_count(
already canceled before we came here: continue
running the thread */
- /* printf(
- "!!!!!!!!!! Wait already ended: continue thr\n"); */
+ /* fputs("!!!!!!!! Wait already ended: continue thr\n",
+ stderr); */
if (next_thr && *next_thr == NULL) {
*next_thr = thr;
@@ -929,40 +852,13 @@ que_thr_dec_refer_count(
} else if (fork_type == QUE_FORK_MYSQL_INTERFACE) {
/* Do nothing */
- } else if (fork->common.parent == NULL
- && fork->caller == NULL
- && UT_LIST_GET_LEN(trx->signals) == 0) {
-
- ut_a(0); /* not used in MySQL */
-
- /* Reply to the client */
-
- /* que_thr_add_update_info(thr); */
-
- fork->state = QUE_FORK_COMMAND_WAIT;
-
- msg_len = que_build_srv_msg(msg_buf, fork, sess);
-
- send_srv_msg = TRUE;
-
- if (fork->fork_type == QUE_FORK_PROCEDURE) {
-
- release_stored_proc = TRUE;
- }
-
- ut_ad(trx->graph == fork);
-
- trx->graph = NULL;
} else {
- /* Subprocedure calls not implemented yet */
- ut_a(0);
+ ut_error; /* not used in MySQL */
}
}
if (UT_LIST_GET_LEN(trx->signals) > 0 && trx->n_active_thrs == 0) {
- ut_ad(!send_srv_msg);
-
/* If the trx is signaled and its query thread count drops to
zero, then we start processing a signal; from it we may get
a new query thread to run */
@@ -976,26 +872,6 @@ que_thr_dec_refer_count(
}
mutex_exit(&kernel_mutex);
-
- if (send_srv_msg) {
- /* Note that, as we do not own the kernel mutex at this point,
- and neither do we own it all the time when doing the actual
- communication operation within the next function, it is
- possible that the messages will not get delivered in the right
- sequential order. This is possible if the client communicates
- an extra message to the server while the message below is still
- undelivered. But then the client should notice that there
- is an error in the order numbers of the messages. */
-
- sess_command_completed_message(sess, msg_buf, msg_len);
- }
-
- if (release_stored_proc) {
-
- /* Return the stored procedure graph to the dictionary cache */
-
- dict_procedure_release_parsed_copy(fork);
- }
}
/**************************************************************************
@@ -1013,7 +889,9 @@ que_thr_stop(
que_t* graph;
ibool ret = TRUE;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
graph = thr->graph;
trx = graph->trx;
@@ -1110,7 +988,7 @@ que_thr_move_to_run_state_for_mysql(
mem_analyze_corruption((byte*)thr);
- ut_a(0);
+ ut_error;
}
if (!thr->is_active) {
@@ -1147,7 +1025,7 @@ que_thr_stop_for_mysql_no_error(
mem_analyze_corruption((byte*)thr);
- ut_a(0);
+ ut_error;
}
thr->state = QUE_THR_COMPLETED;
@@ -1158,69 +1036,67 @@ 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(
/*================*/
que_node_t* node) /* in: query graph node */
{
- ulint type;
- char* str;
- ulint addr;
+ ulint type;
+ const char* str;
type = que_node_get_type(node);
- addr = (ulint)node;
-
if (type == QUE_NODE_SELECT) {
- str = (char *) "SELECT";
+ str = "SELECT";
} else if (type == QUE_NODE_INSERT) {
- str = (char *) "INSERT";
+ str = "INSERT";
} else if (type == QUE_NODE_UPDATE) {
- str = (char *) "UPDATE";
+ str = "UPDATE";
} else if (type == QUE_NODE_WHILE) {
- str = (char *) "WHILE";
+ str = "WHILE";
} else if (type == QUE_NODE_ASSIGNMENT) {
- str = (char *) "ASSIGNMENT";
+ str = "ASSIGNMENT";
} else if (type == QUE_NODE_IF) {
- str = (char *) "IF";
+ str = "IF";
} else if (type == QUE_NODE_FETCH) {
- str = (char *) "FETCH";
+ str = "FETCH";
} else if (type == QUE_NODE_OPEN) {
- str = (char *) "OPEN";
+ str = "OPEN";
} else if (type == QUE_NODE_PROC) {
- str = (char *) "STORED PROCEDURE";
+ str = "STORED PROCEDURE";
} else if (type == QUE_NODE_FUNC) {
- str = (char *) "FUNCTION";
+ str = "FUNCTION";
} else if (type == QUE_NODE_LOCK) {
- str = (char *) "LOCK";
+ str = "LOCK";
} else if (type == QUE_NODE_THR) {
- str = (char *) "QUERY THREAD";
+ str = "QUERY THREAD";
} else if (type == QUE_NODE_COMMIT) {
- str = (char *) "COMMIT";
+ str = "COMMIT";
} else if (type == QUE_NODE_UNDO) {
- str = (char *) "UNDO ROW";
+ str = "UNDO ROW";
} else if (type == QUE_NODE_PURGE) {
- str = (char *) "PURGE ROW";
+ str = "PURGE ROW";
} else if (type == QUE_NODE_ROLLBACK) {
- str = (char *) "ROLLBACK";
+ str = "ROLLBACK";
} else if (type == QUE_NODE_CREATE_TABLE) {
- str = (char *) "CREATE TABLE";
+ str = "CREATE TABLE";
} else if (type == QUE_NODE_CREATE_INDEX) {
- str = (char *) "CREATE INDEX";
+ str = "CREATE INDEX";
} else if (type == QUE_NODE_FOR) {
- str = (char *) "FOR LOOP";
+ str = "FOR LOOP";
} else if (type == QUE_NODE_RETURN) {
- str = (char *) "RETURN";
+ str = "RETURN";
} else {
- str = (char *) "UNKNOWN NODE TYPE";
+ str = "UNKNOWN NODE TYPE";
}
- printf("Node type %lu: %s, address %lx\n", (unsigned long) type, str,
- (unsigned long) addr);
+ fprintf(stderr, "Node type %lu: %s, address %p\n", (ulong) type, str, node);
}
+#endif /* UNIV_DEBUG */
/**************************************************************************
Performs an execution step on a query thread. */
@@ -1249,7 +1125,7 @@ que_thr_step(
#ifdef UNIV_DEBUG
if (que_trace_on) {
- printf("To execute: ");
+ fputs("To execute: ", stderr);
que_node_print_info(node);
}
#endif
@@ -1331,85 +1207,6 @@ que_thr_step(
return(thr);
}
-/***********************************************************************
-Checks if there is a need for a query thread switch or stopping the current
-thread. */
-
-que_thr_t*
-que_thr_check_if_switch(
-/*====================*/
- que_thr_t* thr, /* in: current query thread */
- ulint* cumul_resource) /* in: amount of resources used
- by the current call of que_run_threads
- (resources used by the OS thread!) */
-{
- que_thr_t* next_thr;
- ibool stopped;
-
- if (que_thr_peek_stop(thr)) {
-
- mutex_enter(&kernel_mutex);
-
- stopped = que_thr_stop(thr);
-
- mutex_exit(&kernel_mutex);
-
- if (stopped) {
- /* If a signal is processed, we may get a new query
- thread next_thr to run */
-
- next_thr = NULL;
-
- que_thr_dec_refer_count(thr, &next_thr);
-
- if (next_thr == NULL) {
-
- return(NULL);
- }
-
- thr = next_thr;
- }
- }
-
- if (thr->resource > QUE_PARALLELIZE_LIMIT) {
-
- /* Try parallelization of the query thread */
- thr = que_try_parallelize(thr);
-
- thr->resource = 0;
- }
-
- (*cumul_resource)++;
-
- if (*cumul_resource > QUE_ROUND_ROBIN_LIMIT) {
-
- /* It is time to round-robin query threads in the
- server task queue */
-
- if (srv_get_thread_type() == SRV_COM) {
- /* This OS thread is a SRV_COM thread: we put
- the query thread to the task queue and return
- to allow the OS thread to receive more
- messages from clients */
-
- ut_ad(thr->is_active);
-
- srv_que_task_enqueue(thr);
-
- return(NULL);
- } else {
- /* Change the query thread if there is another
- in the server task queue */
-
- thr = srv_que_round_robin(thr);
- }
-
- *cumul_resource = 0;
- }
-
- return(thr);
-}
-
/**************************************************************************
Runs query threads. Note that the individual query thread which is run
within this function may change if, e.g., the OS thread executing this
@@ -1425,7 +1222,9 @@ que_run_threads(
ulint loop_count;
ut_ad(thr->state == QUE_THR_RUNNING);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
/* cumul_resource counts how much resources the OS thread (NOT the
query thread) has spent in this function */
@@ -1433,27 +1232,6 @@ que_run_threads(
loop_count = QUE_MAX_LOOPS_WITHOUT_CHECK;
cumul_resource = 0;
loop:
- if (loop_count >= QUE_MAX_LOOPS_WITHOUT_CHECK) {
-
-/* In MySQL this thread switch is never needed!
-
- loop_count = 0;
-
- next_thr = que_thr_check_if_switch(thr, &cumul_resource);
-
- if (next_thr != thr) {
- if (next_thr == NULL) {
-
- return;
- }
-
- loop_count = QUE_MAX_LOOPS_WITHOUT_CHECK;
- }
-
- thr = next_thr;
-*/
- }
-
/* Check that there is enough space in the log to accommodate
possible log entries by this query step; if the operation can touch
more than about 4 pages, checks must be made also within the query
diff --git a/innobase/read/read0read.c b/innobase/read/read0read.c
index 4a8aaee39ca..889612deef4 100644
--- a/innobase/read/read0read.c
+++ b/innobase/read/read0read.c
@@ -54,9 +54,10 @@ read_view_oldest_copy_or_open_new(
ulint insert_done = 0;
ulint n;
ulint i;
-
- ut_ad(mutex_own(&kernel_mutex));
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
old_view = UT_LIST_GET_LAST(trx_sys->view_list);
if (old_view == NULL) {
@@ -132,9 +133,9 @@ read_view_open_now(
read_view_t* view;
trx_t* trx;
ulint n;
-
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
-
+#endif /* UNIV_SYNC_DEBUG */
view = read_view_create_low(UT_LIST_GET_LEN(trx_sys->trx_list), heap);
view->creator = cr_trx;
@@ -195,8 +196,9 @@ read_view_close(
/*============*/
read_view_t* view) /* in: read view */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
-
+#endif /* UNIV_SYNC_DEBUG */
UT_LIST_REMOVE(view_list, trx_sys->view_list, view);
}
diff --git a/innobase/rem/rem0cmp.c b/innobase/rem/rem0cmp.c
index abfba3a31c9..254ebeec8c9 100644
--- a/innobase/rem/rem0cmp.c
+++ b/innobase/rem/rem0cmp.c
@@ -58,13 +58,14 @@ cmp_debug_dtuple_rec_with_match(
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
must be a copy of the the one in ha_innobase.cc! */
-
+extern
int
innobase_mysql_cmp(
-/*===============*/
+/*===============*/
/* out: 1, 0, -1, if a is greater,
equal, less than b, respectively */
- int mysql_type, /* in: MySQL type */
+ int mysql_type, /* in: MySQL type */
+ uint charset_number, /* in: number of the charset */
unsigned char* a, /* in: data field */
unsigned int a_length, /* in: data field length,
not UNIV_SQL_NULL */
@@ -97,16 +98,28 @@ cmp_types_are_equal(
dtype_t* type1, /* in: type 1 */
dtype_t* type2) /* in: type 2 */
{
- if ((type1->mtype == DATA_VARCHAR && type2->mtype == DATA_CHAR)
- || (type1->mtype == DATA_CHAR && type2->mtype == DATA_VARCHAR)
- || (type1->mtype == DATA_FIXBINARY && type2->mtype == DATA_BINARY)
- || (type1->mtype == DATA_BINARY && type2->mtype == DATA_FIXBINARY)
- || (type1->mtype == DATA_MYSQL && type2->mtype == DATA_VARMYSQL)
- || (type1->mtype == DATA_VARMYSQL && type2->mtype == DATA_MYSQL)) {
-
- return(TRUE);
+ if (dtype_is_non_binary_string_type(type1->mtype, type1->prtype)
+ && dtype_is_non_binary_string_type(type2->mtype, type2->prtype)) {
+
+ /* Both are non-binary string types: they can be compared if
+ and only if the charset-collation is the same */
+
+ if (dtype_get_charset_coll(type1->prtype)
+ == dtype_get_charset_coll(type2->prtype)) {
+ return(TRUE);
+ }
+
+ return(FALSE);
}
+ if (dtype_is_binary_string_type(type1->mtype, type1->prtype)
+ && dtype_is_binary_string_type(type2->mtype, type2->prtype)) {
+
+ /* Both are binary string types: they can be compared */
+
+ return(TRUE);
+ }
+
if (type1->mtype != type2->mtype) {
return(FALSE);
@@ -128,11 +141,6 @@ cmp_types_are_equal(
return(FALSE);
}
- if (type1->mtype == DATA_BLOB && (type1->prtype & DATA_BINARY_TYPE)
- != (type2->prtype & DATA_BINARY_TYPE)) {
- return(FALSE);
- }
-
return(TRUE);
}
@@ -269,12 +277,13 @@ cmp_whole_field(
return(innobase_mysql_cmp(
(int)(type->prtype & DATA_MYSQL_TYPE_MASK),
+ (uint)dtype_get_charset_coll(type->prtype),
a, a_length, b, b_length));
default:
fprintf(stderr,
"InnoDB: unknown type number %lu\n",
(ulong) data_type);
- ut_a(0);
+ ut_error;
}
return(0);
@@ -322,7 +331,9 @@ cmp_data_data_slow(
if (cur_type->mtype >= DATA_FLOAT
|| (cur_type->mtype == DATA_BLOB
- && (cur_type->prtype & DATA_NONLATIN1))) {
+ && 0 == (cur_type->prtype & DATA_BINARY_TYPE)
+ && dtype_get_charset_coll(cur_type->prtype) !=
+ data_mysql_latin1_swedish_charset_coll)) {
return(cmp_whole_field(cur_type, data1, len1, data2, len2));
}
@@ -523,8 +534,10 @@ cmp_dtuple_rec_with_match(
}
if (cur_type->mtype >= DATA_FLOAT
- || (cur_type->mtype == DATA_BLOB
- && (cur_type->prtype & DATA_NONLATIN1))) {
+ || (cur_type->mtype == DATA_BLOB
+ && 0 == (cur_type->prtype & DATA_BINARY_TYPE)
+ && dtype_get_charset_coll(cur_type->prtype) !=
+ data_mysql_latin1_swedish_charset_coll)) {
ret = cmp_whole_field(cur_type,
dfield_get_data(dtuple_field), dtuple_f_len,
@@ -845,8 +858,10 @@ cmp_rec_rec_with_match(
}
if (cur_type->mtype >= DATA_FLOAT
- || (cur_type->mtype == DATA_BLOB
- && (cur_type->prtype & DATA_NONLATIN1))) {
+ || (cur_type->mtype == DATA_BLOB
+ && 0 == (cur_type->prtype & DATA_BINARY_TYPE)
+ && dtype_get_charset_coll(cur_type->prtype) !=
+ data_mysql_latin1_swedish_charset_coll)) {
ret = cmp_whole_field(cur_type,
rec1_b_ptr, rec1_f_len,
diff --git a/innobase/rem/rem0rec.c b/innobase/rem/rem0rec.c
index 5a3996c9dce..3d0b997db85 100644
--- a/innobase/rem/rem0rec.c
+++ b/innobase/rem/rem0rec.c
@@ -108,12 +108,12 @@ rec_get_nth_field(
if (n > 1024) {
fprintf(stderr, "Error: trying to access field %lu in rec\n",
(ulong) n);
- ut_a(0);
+ ut_error;
}
if (rec == NULL) {
fprintf(stderr, "Error: rec is NULL pointer\n");
- ut_a(0);
+ ut_error;
}
if (rec_get_1byte_offs_flag(rec)) {
diff --git a/innobase/rem/ts/makefile b/innobase/rem/ts/makefile
deleted file mode 100644
index c429afa273e..00000000000
--- a/innobase/rem/ts/makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-include ..\..\makefile.i
-
-tsrem: ..\rem.lib tsrem.c
- $(CCOM) $(CFL) -I.. -I..\.. ..\rem.lib ..\..\page.lib ..\..\mtr.lib ..\..\btr.lib ..\..\log.lib ..\..\dyn.lib ..\..\fil.lib ..\..\buf.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tsrem.c $(LFL)
-
-
-
-
-
-
-
-
-
diff --git a/innobase/rem/ts/tsrem.c b/innobase/rem/ts/tsrem.c
deleted file mode 100644
index 4f2bdde0068..00000000000
--- a/innobase/rem/ts/tsrem.c
+++ /dev/null
@@ -1,464 +0,0 @@
-/************************************************************************
-The test for the record manager
-
-(c) 1994-1996 Innobase Oy
-
-Created 1/25/1994 Heikki Tuuri
-*************************************************************************/
-
-#include "sync0sync.h"
-#include "mem0mem.h"
-#include "data0data.h"
-#include "data0type.h"
-#include "dict0dict.h"
-#include "buf0buf.h"
-#include "fil0fil.h"
-#include "../rem0rec.h"
-#include "../rem0cmp.h"
-
-byte buf1[100000];
-
-/*********************************************************************
-Test for data tuples. */
-
-void
-test1(void)
-/*=======*/
-{
- dtype_t* type;
- dtuple_t* tuple, *tuple2;
- dfield_t* field;
- mem_heap_t* heap;
- ulint i, j;
- ulint n;
- char* p_Pascal;
- char* p_Cobol;
-
- heap = mem_heap_create(0);
-
- printf("-------------------------------------------\n");
- printf("DATA TUPLE-TEST 1. Basic tests.\n");
-
- tuple = dtuple_create(heap, 2);
-
- field = dtuple_get_nth_field(tuple, 0);
- dfield_set_data(field, "Pascal", 7);
- dtype_set(dfield_get_type(field), DATA_CHAR, DATA_ENGLISH, 7, 0);
-
- field = dtuple_get_nth_field(tuple, 1);
- dfield_set_data(field, "Cobol", 6);
- dtype_set(dfield_get_type(field), DATA_CHAR, DATA_ENGLISH, 6, 0);
-
- dtuple_validate(tuple);
- dtuple_print(tuple);
-
- tuple2 = dtuple_create(heap, 10);
-
- for (i = 0; i < 10; i++) {
- field = dtuple_get_nth_field(tuple2, i);
- dfield_set_data(field, NULL, UNIV_SQL_NULL);
- dtype_set(dfield_get_type(field), DATA_CHAR, DATA_ENGLISH,
- 6, 0);
- }
-
- dtuple_print(tuple2);
-
- printf("-------------------------------------------\n");
- printf("DATA TUPLE-TEST 2. Accessor function tests.\n");
-
- tuple = dtuple_create(heap, 2);
-
- p_Pascal = "Pascal";
- p_Cobol = "Cobol";
-
- field = dtuple_get_nth_field(tuple, 0);
- dfield_set_data(field, p_Pascal, 7);
- dtype_set(dfield_get_type(field), DATA_CHAR, DATA_ENGLISH, 7, 0);
-
- field = dtuple_get_nth_field(tuple, 1);
- dfield_set_data(field, p_Cobol, 6);
- dtype_set(dfield_get_type(field), DATA_VARCHAR, DATA_ENGLISH, 16, 3);
-
- ut_a(dtuple_get_n_fields(tuple) == 2);
-
- field = dtuple_get_nth_field(tuple, 0);
- ut_a(p_Pascal == dfield_get_data(field));
- ut_a(7 == dfield_get_len(field));
- type = dfield_get_type(field);
- ut_a(type->mtype == DATA_CHAR);
- ut_a(type->prtype == DATA_ENGLISH);
- ut_a(type->len == 7);
- ut_a(type->prec == 0);
-
- field = dtuple_get_nth_field(tuple, 1);
- ut_a(p_Cobol == dfield_get_data(field));
- ut_a(6 == dfield_get_len(field));
- type = dfield_get_type(field);
- ut_a(type->mtype == DATA_VARCHAR);
- ut_a(type->prtype == DATA_ENGLISH);
- ut_a(type->len == 16);
- ut_a(type->prec == 3);
-
- printf("-------------------------------------------\n");
- printf("DATA TYPE-TEST 3. Other function tests\n");
-
- ut_a(dtuple_get_data_size(tuple) == 13);
-
- ut_a(dtuple_fold(tuple, 2) == dtuple_fold(tuple, 2));
- ut_a(dtuple_fold(tuple, 1) != dtuple_fold(tuple, 2));
-
- printf("-------------------------------------------\n");
- printf("DATA TUPLE-TEST 4. Random tuple generation test\n");
-
- for (i = 0; i < 500; i++) {
- tuple = dtuple_gen_rnd_tuple(heap);
- printf("%lu ", i);
-
- dtuple_validate(tuple);
- n = dtuple_get_n_fields(tuple);
-
- if (n < 25) {
- tuple2 = dtuple_create(heap, n);
- for (j = 0; j < n; j++) {
- dfield_copy(
- dtuple_get_nth_field(tuple2, j),
- dtuple_get_nth_field(tuple, j));
- }
- dtuple_validate(tuple2);
-
- ut_a(dtuple_fold(tuple, n) ==
- dtuple_fold(tuple2, n));
- }
- }
-
- mem_print_info();
- mem_heap_free(heap);
-}
-
-/**********************************************************************
-Test for physical records. */
-
-void
-test2(void)
-/*=======*/
-{
- dtuple_t* tuple, *tuple2;
- dfield_t* field;
- mem_heap_t* heap;
- ulint i, n;
- char* p_Pascal;
- char* p_Cobol;
- rec_t* rec, *rec2;
- byte* data;
- ulint len;
- byte* buf;
-
- heap = mem_heap_create(0);
-
- printf("-------------------------------------------\n");
- printf("REC-TEST 1. Basic tests.\n");
-
- tuple = dtuple_create(heap, 2);
-
- p_Pascal = "Pascal";
- p_Cobol = "Cobol";
-
- field = dtuple_get_nth_field(tuple, 0);
- dfield_set_data(field, "Pascal", 7);
- dtype_set(dfield_get_type(field), DATA_CHAR, DATA_ENGLISH, 7, 0);
-
- field = dtuple_get_nth_field(tuple, 1);
- dfield_set_data(field, "Cobol", 6);
- dtype_set(dfield_get_type(field), DATA_CHAR, DATA_ENGLISH, 6, 0);
-
- tuple2 = dtuple_create(heap, 37);
-
- for (i = 0; i < 37; i++) {
- field = dtuple_get_nth_field(tuple2, i);
- dfield_set_data(field, NULL, UNIV_SQL_NULL);
- dtype_set(dfield_get_type(field), DATA_CHAR,
- DATA_ENGLISH, 6, 0);
- }
-
- rec = rec_convert_dtuple_to_rec(buf1, tuple);
-
- rec_validate(rec);
- rec_print(rec);
-
- rec2 = rec_convert_dtuple_to_rec(buf1 + 1000, tuple2);
-
- rec_validate(rec2);
-
- data = rec_get_nth_field(rec, 0, &len);
-
- ut_a(0 == memcmp(p_Pascal, data, 7));
- ut_a(len == 7);
-
- data = rec_get_nth_field(rec, 1, &len);
-
- ut_a(0 == memcmp(p_Cobol, data, 6));
- ut_a(len == 6);
-
- ut_a(2 == rec_get_n_fields(rec));
-
- for (i = 0; i < 37; i++) {
- data = rec_get_nth_field(rec2, i, &len);
- ut_a(len == UNIV_SQL_NULL);
- }
-
- printf("-------------------------------------------\n");
- printf("REC-TEST 2. Test of accessor functions\n");
-
- rec_set_next_offs(rec, 8190);
- rec_set_n_owned(rec, 15);
- rec_set_heap_no(rec, 0);
-
- ut_a(rec_get_next_offs(rec) == 8190);
- ut_a(rec_get_n_owned(rec) == 15);
- ut_a(rec_get_heap_no(rec) == 0);
-
- rec_set_next_offs(rec, 1);
- rec_set_n_owned(rec, 1);
- rec_set_heap_no(rec, 8190);
-
- ut_a(rec_get_next_offs(rec) == 1);
- ut_a(rec_get_n_owned(rec) == 1);
- ut_a(rec_get_heap_no(rec) == 8190);
-
- buf = mem_heap_alloc(heap, 6);
-
- rec_copy_nth_field(buf, rec, 1, &len);
-
- ut_a(ut_memcmp(p_Cobol, buf, len) == 0);
- ut_a(len == 6);
-
- rec_set_nth_field(rec, 1, "Algol", 6);
-
- rec_validate(rec);
-
- rec_copy_nth_field(buf, rec, 1, &len);
-
- ut_a(ut_memcmp("Algol", buf, len) == 0);
- ut_a(len == 6);
-
- ut_a(rec_get_data_size(rec) == 13);
- ut_a((ulint)(rec_get_end(rec) - rec) == 13);
- ut_a(14 == (ulint)(rec - rec_get_start(rec)));
-
- ut_a(rec_get_size(rec) == 27);
-
- mem_heap_free(heap);
-
- printf("-------------------------------------------\n");
- printf("REC-TEST 3. Massive test of conversions \n");
-
- heap = mem_heap_create(0);
-
- for (i = 0; i < 100; i++) {
-
- tuple = dtuple_gen_rnd_tuple(heap);
-
- if (i % 10 == 0) {
- printf("%lu ", i);
- }
-
- if (i % 10 == 0) {
- printf(
- "data tuple generated: %lu fields, data size %lu\n",
- dtuple_get_n_fields(tuple),
- dtuple_get_data_size(tuple));
- }
-
- dtuple_validate(tuple);
-
- rec = rec_convert_dtuple_to_rec(buf1, tuple);
-
- rec_validate(rec);
-
- n = dtuple_get_n_fields(tuple);
-
- ut_a(cmp_dtuple_rec_prefix_equal(tuple, rec, n));
- ut_a(dtuple_fold(tuple, n) == rec_fold(rec, n));
- ut_a(rec_get_converted_size(tuple) == rec_get_size(rec));
- ut_a(rec_get_data_size(rec) == dtuple_get_data_size(tuple));
- }
-
- mem_print_info();
- mem_heap_free(heap);
-}
-
-/**********************************************************************
-Test for comparisons. */
-
-void
-test3(void)
-/*=======*/
-{
- dtuple_t* tuple, *tuple2, *tuple3;
- dfield_t* field;
- mem_heap_t* heap;
- ulint i, j;
- ulint field_match, byte_match;
- rec_t* rec;
- rec_t* rec2;
- ulint tm, oldtm;
- dict_index_t* index;
- dict_table_t* table;
-
- heap = mem_heap_create(0);
-
- printf("-------------------------------------------\n");
- printf("CMP-TEST 1. Basic tests.\n");
-
- tuple = dtuple_create(heap, 2);
-
- field = dtuple_get_nth_field(tuple, 0);
- dfield_set_data(field, "Pascal", 7);
- dtype_set(dfield_get_type(field), DATA_CHAR, DATA_ENGLISH, 7, 0);
-
- field = dtuple_get_nth_field(tuple, 1);
- dfield_set_data(field, "Cobol", 6);
- dtype_set(dfield_get_type(field), DATA_CHAR, DATA_ENGLISH, 6, 0);
-
- tuple2 = dtuple_create(heap, 2);
-
- field = dtuple_get_nth_field(tuple2, 0);
- dfield_set_data(field, "Pascal", 7);
- dtype_set(dfield_get_type(field), DATA_CHAR, DATA_ENGLISH, 7, 0);
-
- field = dtuple_get_nth_field(tuple2, 1);
- dfield_set_data(field, "Cobom", 6);
- dtype_set(dfield_get_type(field), DATA_CHAR, DATA_ENGLISH, 6, 0);
-
- tuple3 = dtuple_create(heap, 2);
-
- field = dtuple_get_nth_field(tuple3, 0);
- dfield_set_data(field, "PaSCal", 7);
- dtype_set(dfield_get_type(field), DATA_CHAR, DATA_ENGLISH, 7, 0);
-
- field = dtuple_get_nth_field(tuple3, 1);
- dfield_set_data(field, "CobOL", 6);
- dtype_set(dfield_get_type(field), DATA_CHAR, DATA_ENGLISH, 6, 0);
-
- rec = rec_convert_dtuple_to_rec(buf1, tuple);
-
- rec_validate(rec);
-
- ut_a(!cmp_dtuple_rec_prefix_equal(tuple2, rec, 2));
- ut_a(cmp_dtuple_rec_prefix_equal(tuple, rec, 2));
- ut_a(cmp_dtuple_rec_prefix_equal(tuple3, rec, 2));
-
- oldtm = ut_clock();
- j = 0;
- for (i = 0; i < 1000; i++) {
- field_match = 1;
- byte_match = 4;
- if (1 == cmp_dtuple_rec_with_match(tuple2, rec,
- &field_match, &byte_match)) {
- j++;
- }
- }
- tm = ut_clock();
- printf("Time for fast comp. %lu records = %lu\n", j, tm - oldtm);
-
- ut_a(field_match == 1);
- ut_a(byte_match == 4);
-
- oldtm = ut_clock();
- j = 0;
- for (i = 0; i < 1000; i++) {
- field_match = 0;
- byte_match = 0;
- if (1 == cmp_dtuple_rec_with_match(tuple2, rec,
- &field_match, &byte_match)) {
- j++;
- }
- }
- tm = ut_clock();
- printf("Time for test comp. %lu records = %lu\n", j, tm - oldtm);
-
- ut_a(field_match == 1);
- ut_a(byte_match == 4);
-
- printf("-------------------------------------------\n");
- printf(
- "CMP-TEST 2. A systematic test of comparisons and conversions\n");
-
- tuple = dtuple_create(heap, 3);
- tuple2 = dtuple_create(heap, 3);
-
- table = dict_table_create("TS_TABLE1", 3);
-
- dict_table_add_col(table, "COL1", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
- dict_table_add_col(table, "COL2", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
- dict_table_add_col(table, "COL3", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
-
- ut_a(0 == dict_table_publish(table));
-
- index = dict_index_create("TS_TABLE1", "IND1", 0, 3, 0);
-
- dict_index_add_field(index, "COL1", 0);
- dict_index_add_field(index, "COL2", 0);
- dict_index_add_field(index, "COL3", 0);
-
- ut_a(0 == dict_index_publish(index));
-
- index = dict_index_get("TS_TABLE1", "IND1");
- ut_a(index);
-
- /* Compare all test data tuples to each other */
- for (i = 0; i < 512; i++) {
- dtuple_gen_test_tuple(tuple, i);
- rec = rec_convert_dtuple_to_rec(buf1, tuple);
- ut_a(rec_validate(rec));
-
- ut_a(0 == cmp_dtuple_rec(tuple, rec));
-
- for (j = 0; j < 512; j++) {
- dtuple_gen_test_tuple(tuple2, j);
- ut_a(dtuple_validate(tuple2));
-
- rec2 = rec_convert_dtuple_to_rec(buf1 + 500, tuple2);
-
- if (j < i) {
- ut_a(-1 == cmp_dtuple_rec(tuple2, rec));
- ut_a(-1 == cmp_rec_rec(rec2, rec, index));
- } else if (j == i) {
- ut_a(0 == cmp_dtuple_rec(tuple2, rec));
- ut_a(0 == cmp_rec_rec(rec2, rec, index));
- } else if (j > i) {
- ut_a(1 == cmp_dtuple_rec(tuple2, rec));
- ut_a(1 == cmp_rec_rec(rec2, rec, index));
- }
- }
- }
- mem_heap_free(heap);
-}
-
-/********************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
-
- sync_init();
- mem_init();
- fil_init(25);
- buf_pool_init(100, 100);
- dict_init();
-
- oldtm = ut_clock();
-
- ut_rnd_set_seed(19);
-
- test1();
- test2();
- test3();
-
- tm = ut_clock();
- printf("CPU time for test %lu microseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c
index c89f41f69ad..fc1f7a19d53 100644
--- a/innobase/row/row0ins.c
+++ b/innobase/row/row0ins.c
@@ -38,7 +38,7 @@ This prototype is copied from /mysql/sql/ha_innodb.cc.
Invalidates the MySQL query cache for the table.
NOTE that the exact prototype of this function has to be in
/innobase/row/row0ins.c! */
-
+extern
void
innobase_invalidate_query_cache(
/*============================*/
@@ -80,9 +80,9 @@ ins_node_create(
node->trx_id = ut_dulint_zero;
node->entry_sys_heap = mem_heap_create(128);
-
- node->magic_n = INS_NODE_MAGIC_N;
-
+#ifdef UNIV_DEBUG
+ node->magic_n = INS_NODE_MAGIC_N;
+#endif /* UNIV_DEBUG */
return(node);
}
@@ -194,6 +194,7 @@ 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;
@@ -682,14 +683,6 @@ row_ins_foreign_check_on_constraint(
(DICT_FOREIGN_ON_DELETE_CASCADE
| DICT_FOREIGN_ON_DELETE_SET_NULL))) {
- /* No action is defined: return a foreign key error if
- NO ACTION is not specified */
-
- if (foreign->type & DICT_FOREIGN_ON_DELETE_NO_ACTION) {
-
- return(DB_SUCCESS);
- }
-
row_ins_foreign_report_err((char*)"Trying to delete",
thr, foreign,
btr_pcur_get_rec(pcur), entry);
@@ -703,14 +696,6 @@ row_ins_foreign_check_on_constraint(
/* This is an UPDATE */
- /* No action is defined: return a foreign key error if
- NO ACTION is not specified */
-
- if (foreign->type & DICT_FOREIGN_ON_UPDATE_NO_ACTION) {
-
- return(DB_SUCCESS);
- }
-
row_ins_foreign_report_err((char*)"Trying to update",
thr, foreign,
btr_pcur_get_rec(pcur), entry);
@@ -871,7 +856,7 @@ row_ins_foreign_check_on_constraint(
"InnoDB: Make a detailed bug report and send it\n");
fprintf(stderr, "InnoDB: to mysql@lists.mysql.com\n");
- ut_a(0);
+ ut_error;
*/
err = DB_SUCCESS;
@@ -1047,8 +1032,10 @@ row_ins_check_foreign_constraint(
mtr_t mtr;
run_again:
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_SHARED));
-
+#endif /* UNIV_SYNC_DEBUG */
+
err = DB_SUCCESS;
if (thr_get_trx(thr)->check_foreigns == FALSE) {
@@ -1365,58 +1352,6 @@ row_ins_check_foreign_constraints(
return(DB_SUCCESS);
}
-/*************************************************************************
-Reports a UNIQUE key error to dict_unique_err_buf so that SHOW INNODB
-STATUS can print it. */
-static
-void
-row_ins_unique_report_err(
-/*======================*/
- que_thr_t* thr, /* in: query thread */
- rec_t* rec, /* in: a record in the index */
- dtuple_t* entry, /* in: index entry to insert in the index */
- dict_index_t* index) /* in: index */
-{
- UT_NOT_USED(thr);
- UT_NOT_USED(rec);
- UT_NOT_USED(entry);
- UT_NOT_USED(index);
-
-#ifdef notdefined
- /* Disable reporting to test if the slowdown of REPLACE in 4.0.13 was
- caused by this! */
-
- char* buf = dict_unique_err_buf;
-
- /* The foreign err mutex protects also dict_unique_err_buf */
-
- mutex_enter(&dict_foreign_err_mutex);
-
- ut_sprintf_timestamp(buf);
- sprintf(buf + strlen(buf), " Transaction:\n");
- trx_print(buf + strlen(buf), thr_get_trx(thr));
-
- sprintf(buf + strlen(buf),
-"Unique key constraint fails for table %.500s.\n", index->table_name);
- sprintf(buf + strlen(buf),
-"Trying to add in index %.500s (%lu fields unique) tuple:\n", index->name,
- dict_index_get_n_unique(index));
-
- dtuple_sprintf(buf + strlen(buf), 1000, entry);
-
- sprintf(buf + strlen(buf),
-"\nBut there is already a record:\n");
-
- rec_sprintf(buf + strlen(buf), 1000, rec);
-
- sprintf(buf + strlen(buf), "\n");
-
- ut_a(strlen(buf) < DICT_FOREIGN_ERR_BUF_LEN);
-
- mutex_exit(&dict_foreign_err_mutex);
-#endif
-}
-
/*******************************************************************
Checks if a unique key violation to rec would occur at the index entry
insert. */
@@ -1547,8 +1482,6 @@ row_ins_scan_sec_index_for_duplicate(
if (cmp == 0) {
if (row_ins_dupl_error_with_rec(rec, entry, index)) {
- row_ins_unique_report_err(thr, rec, entry,
- index);
err = DB_DUPLICATE_KEY;
thr_get_trx(thr)->error_info = index;
@@ -1643,8 +1576,6 @@ row_ins_duplicate_error_in_clust(
if (row_ins_dupl_error_with_rec(rec, entry,
cursor->index)) {
trx->error_info = cursor->index;
- row_ins_unique_report_err(thr, rec, entry,
- cursor->index);
return(DB_DUPLICATE_KEY);
}
}
@@ -1667,9 +1598,6 @@ row_ins_duplicate_error_in_clust(
if (row_ins_dupl_error_with_rec(rec, entry,
cursor->index)) {
trx->error_info = cursor->index;
-
- row_ins_unique_report_err(thr, rec, entry,
- cursor->index);
return(DB_DUPLICATE_KEY);
}
}
@@ -2115,6 +2043,7 @@ 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) {
@@ -2179,7 +2108,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 cf7a3efcdfc..49e5aeac2e4 100644
--- a/innobase/row/row0mysql.c
+++ b/innobase/row/row0mysql.c
@@ -287,7 +287,7 @@ handle_new_error:
} else {
fprintf(stderr, "InnoDB: unknown error code %lu\n",
(ulong) err);
- ut_a(0);
+ ut_error;
}
if (trx->error_state != DB_SUCCESS) {
@@ -402,7 +402,7 @@ row_prebuilt_free(
mem_analyze_corruption((byte*)prebuilt);
- ut_a(0);
+ ut_error;
}
prebuilt->magic_n = ROW_PREBUILT_FREED;
@@ -450,7 +450,7 @@ row_prebuilt_free(
mem_analyze_corruption(
prebuilt->fetch_cache[i]);
- ut_a(0);
+ ut_error;
}
mem_free((prebuilt->fetch_cache[i]) - 4);
@@ -482,7 +482,7 @@ row_update_prebuilt_trx(
mem_analyze_corruption((byte*)trx);
- ut_a(0);
+ ut_error;
}
if (prebuilt->magic_n != ROW_PREBUILT_ALLOCATED) {
@@ -493,7 +493,7 @@ row_update_prebuilt_trx(
mem_analyze_corruption((byte*)prebuilt);
- ut_a(0);
+ ut_error;
}
prebuilt->trx = trx;
@@ -720,7 +720,7 @@ row_insert_for_mysql(
mem_analyze_corruption((byte*)prebuilt);
- ut_a(0);
+ ut_error;
}
if (srv_created_new_raw || srv_force_recovery) {
@@ -936,7 +936,7 @@ row_update_for_mysql(
mem_analyze_corruption((byte*)prebuilt);
- ut_a(0);
+ ut_error;
}
if (srv_created_new_raw || srv_force_recovery) {
@@ -1289,9 +1289,11 @@ row_create_table_for_mysql(
ulint err;
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX));
- ut_ad(trx->dict_operation_lock_mode == RW_X_LATCH);
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
+ ut_ad(trx->dict_operation_lock_mode == RW_X_LATCH);
if (srv_created_new_raw) {
fprintf(stderr,
@@ -1408,10 +1410,12 @@ row_create_table_for_mysql(
"UNIV_MEM_DEBUG defined in univ.i and the server must be\n"
"quiet because allocation from a mem heap is not protected\n"
"by any semaphore.\n");
-
+#ifdef UNIV_MEM_DEBUG
ut_a(mem_validate());
-
printf("Memory validated\n");
+#else /* UNIV_MEM_DEBUG */
+ puts("Memory NOT validated (recompile with UNIV_MEM_DEBUG)");
+#endif /* UNIV_MEM_DEBUG */
}
heap = mem_heap_create(512);
@@ -1422,8 +1426,7 @@ row_create_table_for_mysql(
thr = pars_complete_graph_for_exec(node, trx, heap);
- ut_a(thr == que_fork_start_command(que_node_get_parent(thr),
- SESS_COMM_EXECUTE, 0));
+ ut_a(thr == que_fork_start_command(que_node_get_parent(thr)));
que_run_threads(thr);
err = trx->error_state;
@@ -1494,8 +1497,10 @@ row_create_index_for_mysql(
ulint err;
ulint i, j;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX));
ut_ad(mutex_own(&(dict_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
trx->op_info = (char *) "creating index";
@@ -1550,8 +1555,7 @@ row_create_index_for_mysql(
thr = pars_complete_graph_for_exec(node, trx, heap);
- ut_a(thr == que_fork_start_command(que_node_get_parent(thr),
- SESS_COMM_EXECUTE, 0));
+ ut_a(thr == que_fork_start_command(que_node_get_parent(thr)));
que_run_threads(thr);
err = trx->error_state;
@@ -1602,8 +1606,10 @@ row_table_add_foreign_constraints(
ulint keywordlen;
ulint err;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(sql_string);
trx->op_info = (char *) "adding foreign keys";
@@ -1774,7 +1780,9 @@ row_get_background_drop_list_len_low(void)
/*======================================*/
/* out: how many tables in list */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
if (!row_mysql_drop_list_inited) {
@@ -1926,7 +1934,7 @@ row_discard_tablespace_for_mysql(
graph->fork_type = QUE_FORK_MYSQL_INTERFACE;
- ut_a(thr = que_fork_start_command(graph, SESS_COMM_EXECUTE, 0));
+ ut_a(thr = que_fork_start_command(graph));
que_run_threads(thr);
@@ -2085,6 +2093,7 @@ row_drop_table_for_mysql(
char* name, /* in: table name */
trx_t* trx) /* in: transaction handle */
{
+ dict_foreign_t* foreign;
dict_table_t* table;
ulint space_id;
que_thr_t* thr;
@@ -2252,8 +2261,10 @@ row_drop_table_for_mysql(
locked_dictionary = TRUE;
}
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(dict_sys->mutex)));
ut_ad(rw_lock_own(&dict_operation_lock, RW_LOCK_EX));
+#endif /* UNIV_SYNC_DEBUG */
graph = pars_sql(buf);
@@ -2282,6 +2293,38 @@ row_drop_table_for_mysql(
goto funct_exit;
}
+ /* Check if the table is referenced by foreign key constraints from
+ some other table (not the table itself) */
+
+ foreign = UT_LIST_GET_FIRST(table->referenced_list);
+
+ while (foreign && foreign->foreign_table == table) {
+ foreign = UT_LIST_GET_NEXT(referenced_list, foreign);
+ }
+
+ if (foreign && trx->check_foreigns) {
+ char* buf = dict_foreign_err_buf;
+
+ /* We only allow dropping a referenced table if
+ FOREIGN_KEY_CHECKS is set to 0 */
+
+ err = DB_CANNOT_DROP_CONSTRAINT;
+
+ mutex_enter(&dict_foreign_err_mutex);
+ ut_sprintf_timestamp(buf);
+
+ sprintf(buf + strlen(buf),
+ " Cannot drop table %.500s\n", name);
+ sprintf(buf + strlen(buf),
+"because it is referenced by %.500s\n", foreign->foreign_table_name);
+
+ ut_a(strlen(buf) < DICT_FOREIGN_ERR_BUF_LEN);
+
+ mutex_exit(&dict_foreign_err_mutex);
+
+ goto funct_exit;
+ }
+
if (table->n_mysql_handles_opened > 0) {
ut_print_timestamp(stderr);
@@ -2321,7 +2364,7 @@ row_drop_table_for_mysql(
trx->dict_operation = TRUE;
trx->table_id = table->id;
- ut_a(thr = que_fork_start_command(graph, SESS_COMM_EXECUTE, 0));
+ ut_a(thr = que_fork_start_command(graph));
que_run_threads(thr);
@@ -2334,7 +2377,7 @@ row_drop_table_for_mysql(
row_mysql_handle_errors(&err, trx, thr, NULL);
- ut_a(0);
+ ut_error;
} else {
space_id = table->space;
dict_table_remove_from_cache(table);
@@ -2469,7 +2512,7 @@ row_is_mysql_tmp_table_name(
{
ulint i;
- for (i = 0; i <= ut_strlen(name) - 5; i++) {
+ for (i = 0; i + 5 <= ut_strlen(name); i++) {
if (ut_memcmp(name + i, (char*)"/#sql", 5) == 0) {
return(TRUE);
@@ -2505,6 +2548,7 @@ row_rename_table_for_mysql(
ulint keywordlen;
ulint len;
ulint i;
+ char* db_name;
ibool success;
char buf[2 * OS_FILE_MAX_PATH];
@@ -2593,6 +2637,15 @@ row_rename_table_for_mysql(
"PROCEDURE RENAME_TABLE_PROC () IS\n"
"new_table_name CHAR;\n"
"old_table_name CHAR;\n"
+ "gen_constr_prefix CHAR;\n"
+ "new_db_name CHAR;\n"
+ "foreign_id CHAR;\n"
+ "new_foreign_id CHAR;\n"
+ "old_db_name_len INT;\n"
+ "old_t_name_len INT;\n"
+ "new_db_name_len INT;\n"
+ "id_len INT;\n"
+ "found INT;\n"
"BEGIN\n"
"new_table_name :='";
@@ -2619,32 +2672,94 @@ row_rename_table_for_mysql(
}
str3 = mem_heap_alloc(heap,
- 1000 + 500 * n_constraints_to_drop);
+ 1000 + 1000 * n_constraints_to_drop);
*str3 = '\0';
sprintf(str3,
"';\n"
"UPDATE SYS_TABLES SET NAME = new_table_name\n"
"WHERE NAME = old_table_name;\n");
+ db_name = mem_heap_alloc(heap, 1 + dict_get_db_name_len(
+ old_name));
+ ut_memcpy(db_name, old_name, dict_get_db_name_len(old_name));
+ db_name[dict_get_db_name_len(old_name)] = '\0';
+
+ /* Internally, old format < 4.0.18 constraints have as the
+ constraint id <number>_<number>, while new format constraints
+ have <databasename>/<constraintname>. */
+
for (i = 0; i < n_constraints_to_drop; i++) {
+
sprintf(str3 + strlen(str3),
- "DELETE FROM SYS_FOREIGN_COLS WHERE ID = '%s';\n"
- "DELETE FROM SYS_FOREIGN WHERE ID = '%s';\n",
+ "DELETE FROM SYS_FOREIGN_COLS WHERE ID = '%s/%s';\n"
+ "DELETE FROM SYS_FOREIGN WHERE ID = '%s/%s';\n",
+ db_name, constraints_to_drop[i],
+ db_name, constraints_to_drop[i]);
+
+ if (!ut_str_contains(constraints_to_drop[i], '/')) {
+ /* If this happens to be an old format
+ constraint, let us delete it. Since all new
+ format constraints contain '/', it does no
+ harm to run these DELETEs anyway. */
+
+ sprintf(str3 + strlen(str3),
+ "DELETE FROM SYS_FOREIGN_COLS WHERE ID = '%s';\n"
+ "DELETE FROM SYS_FOREIGN WHERE ID = '%s';\n",
constraints_to_drop[i],
constraints_to_drop[i]);
+ }
}
sprintf(str3 + strlen(str3),
"END;\n");
- ut_a(strlen(str3) < 1000 + 500 * n_constraints_to_drop);
+ ut_a(strlen(str3) < 1000 + 1000 * n_constraints_to_drop);
} else {
str3 = (char*)
"';\n"
"UPDATE SYS_TABLES SET NAME = new_table_name\n"
"WHERE NAME = old_table_name;\n"
- "UPDATE SYS_FOREIGN SET FOR_NAME = new_table_name\n"
- "WHERE FOR_NAME = old_table_name;\n"
+ "found := 1;\n"
+ "old_db_name_len := INSTR(old_table_name, '/') - 1;\n"
+ "new_db_name_len := INSTR(new_table_name, '/') - 1;\n"
+ "new_db_name := SUBSTR(new_table_name, 0, new_db_name_len);\n"
+ "old_t_name_len := LENGTH(old_table_name);\n"
+ "gen_constr_prefix := CONCAT(old_table_name, '_ibfk_');\n"
+ "WHILE found = 1 LOOP\n"
+ " SELECT ID INTO foreign_id\n"
+ " FROM SYS_FOREIGN\n"
+ " WHERE FOR_NAME = old_table_name;\n"
+ " IF (SQL % NOTFOUND) THEN\n"
+ " found := 0;\n"
+ " ELSE\n"
+ " UPDATE SYS_FOREIGN\n"
+ " SET FOR_NAME = new_table_name\n"
+ " WHERE ID = foreign_id;\n"
+ " id_len := LENGTH(foreign_id);\n"
+ " IF (INSTR(foreign_id, '/') > 0) THEN\n"
+ " IF (INSTR(foreign_id,\n"
+ " gen_constr_prefix) > 0)\n"
+ " THEN\n"
+ " new_foreign_id :=\n"
+ " CONCAT(new_table_name,\n"
+ " SUBSTR(foreign_id, old_t_name_len,\n"
+ " id_len - old_t_name_len));\n"
+ " ELSE\n"
+ " new_foreign_id :=\n"
+ " CONCAT(new_db_name,\n"
+ " SUBSTR(foreign_id,\n"
+ " old_db_name_len,\n"
+ " id_len - old_db_name_len));\n"
+ " END IF;\n"
+ " UPDATE SYS_FOREIGN\n"
+ " SET ID = new_foreign_id\n"
+ " WHERE ID = foreign_id;\n"
+ " UPDATE SYS_FOREIGN_COLS\n"
+ " SET ID = new_foreign_id\n"
+ " WHERE ID = foreign_id;\n"
+ " END IF;\n"
+ " END IF;\n"
+ "END LOOP;\n"
"UPDATE SYS_FOREIGN SET REF_NAME = new_table_name\n"
"WHERE REF_NAME = old_table_name;\n"
"END;\n";
@@ -2679,7 +2794,7 @@ row_rename_table_for_mysql(
graph->fork_type = QUE_FORK_MYSQL_INTERFACE;
- ut_a(thr = que_fork_start_command(graph, SESS_COMM_EXECUTE, 0));
+ ut_a(thr = que_fork_start_command(graph));
que_run_threads(thr);
diff --git a/innobase/row/row0purge.c b/innobase/row/row0purge.c
index d5895f20461..a409b64f8e4 100644
--- a/innobase/row/row0purge.c
+++ b/innobase/row/row0purge.c
@@ -140,7 +140,7 @@ row_purge_remove_clust_if_poss_low(
} else if (err == DB_OUT_OF_FILE_SPACE) {
success = FALSE;
} else {
- ut_a(0);
+ ut_error;
}
}
@@ -266,7 +266,7 @@ row_purge_remove_sec_if_poss_low(
} else if (err == DB_OUT_OF_FILE_SPACE) {
success = FALSE;
} else {
- ut_a(0);
+ ut_error;
}
}
}
@@ -447,8 +447,10 @@ skip_secondaries:
data_field = buf_page_get(0, page_no, RW_X_LATCH, &mtr)
+ offset + internal_offset;
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(buf_frame_align(data_field),
SYNC_TRX_UNDO_PAGE);
+#endif /* UNIV_SYNC_DEBUG */
data_field_len = ufield->new_val.len;
diff --git a/innobase/row/row0row.c b/innobase/row/row0row.c
index 6c0c6c04cd5..6820cb5bccd 100644
--- a/innobase/row/row0row.c
+++ b/innobase/row/row0row.c
@@ -236,61 +236,6 @@ row_build(
return(row);
}
-#ifdef notdefined
-/***********************************************************************
-An inverse function to dict_row_build_index_entry. Builds a row from a
-record in a clustered index. */
-
-void
-row_build_to_tuple(
-/*===============*/
- dtuple_t* row, /* in/out: row built; see the NOTE below! */
- dict_index_t* index, /* in: clustered index */
- rec_t* rec) /* in: record in the clustered index;
- NOTE: the data fields in the row will point
- directly into this record, therefore,
- the buffer page of this record must be
- at least s-latched and the latch held
- as long as the row dtuple is used!
- NOTE 2: does not work with externally
- stored fields! */
-{
- dict_table_t* table;
- ulint n_fields;
- ulint i;
- dfield_t* dfield;
- byte* field;
- ulint len;
- ulint row_len;
- dict_col_t* col;
-
- ut_ad(index && rec);
- ut_ad(index->type & DICT_CLUSTERED);
-
- table = index->table;
- row_len = dict_table_get_n_cols(table);
-
- dtuple_set_info_bits(row, rec_get_info_bits(rec));
-
- n_fields = dict_index_get_n_fields(index);
-
- ut_ad(n_fields == rec_get_n_fields(rec));
-
- dict_table_copy_types(row, table);
-
- for (i = 0; i < n_fields; i++) {
-
- col = dict_field_get_col(dict_index_get_nth_field(index, i));
- dfield = dtuple_get_nth_field(row, dict_col_get_no(col));
- field = rec_get_nth_field(rec, i, &len);
-
- dfield_set_data(dfield, field, len);
- }
-
- ut_ad(dtuple_check_typed(row));
-}
-#endif
-
/***********************************************************************
Converts an index record to a typed data tuple. NOTE that externally
stored (often big) fields are NOT copied to heap. */
@@ -461,7 +406,7 @@ row_build_row_ref_in_tuple(
if (!table) {
fprintf(stderr, "InnoDB: table %s for index %s not found\n",
index->table_name, index->name);
- ut_a(0);
+ ut_error;
}
clust_index = dict_table_get_first_index(table);
@@ -470,7 +415,7 @@ row_build_row_ref_in_tuple(
fprintf(stderr,
"InnoDB: clust index for table %s for index %s not found\n",
index->table_name, index->name);
- ut_a(0);
+ ut_error;
}
ref_len = dict_index_get_n_unique(clust_index);
diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c
index 57de309c090..4f70cea2058 100644
--- a/innobase/row/row0sel.c
+++ b/innobase/row/row0sel.c
@@ -930,7 +930,9 @@ row_sel_try_search_shortcut(
ut_ad(node->read_view);
ut_ad(plan->unique_search);
ut_ad(!plan->must_get_clust);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&btr_search_latch, RW_LOCK_SHARED));
+#endif /* UNIV_SYNC_DEBUG */
row_sel_open_pcur(node, plan, TRUE, mtr);
@@ -2080,7 +2082,7 @@ row_sel_store_row_id_to_prebuilt(
(ulong) len, index->table_name, index->name,
(ulong) dict_index_get_sys_col_pos(index, DATA_ROW_ID),
err_buf);
- ut_a(0);
+ ut_error;
}
ut_memcpy(prebuilt->row_id, data, len);
@@ -2770,7 +2772,7 @@ row_search_for_mysql(
mem_analyze_corruption((byte*)prebuilt);
- ut_a(0);
+ ut_error;
}
if (trx->n_mysql_tables_in_use == 0) {
@@ -2831,7 +2833,7 @@ row_search_for_mysql(
if (direction != prebuilt->fetch_direction) {
if (prebuilt->n_fetch_cached > 0) {
- ut_a(0);
+ ut_error;
/* TODO: scrollable cursor: restore cursor to
the place of the latest returned row,
or better: prevent caching for a scroll
@@ -2886,7 +2888,16 @@ row_search_for_mysql(
if (match_mode == ROW_SEL_EXACT
&& index->type & DICT_UNIQUE
&& dtuple_get_n_fields(search_tuple)
- == dict_index_get_n_unique(index)) {
+ == dict_index_get_n_unique(index)
+ && (index->type & DICT_CLUSTERED
+ || !dtuple_contains_null(search_tuple))) {
+
+ /* Note above that a UNIQUE secondary index can contain many
+ rows with the same key value if one of the columns is the SQL
+ null. A clustered index under MySQL can never contain null
+ columns because we demand that all the columns in primary key
+ are non-null. */
+
unique_search = TRUE;
/* Even if the condition is unique, MySQL seems to try to
diff --git a/innobase/row/row0undo.c b/innobase/row/row0undo.c
index f223bb5eed5..613d0a3b890 100644
--- a/innobase/row/row0undo.c
+++ b/innobase/row/row0undo.c
@@ -334,7 +334,7 @@ row_undo_step(
exit(1);
}
- ut_a(0);
+ ut_error;
return(NULL);
}
diff --git a/innobase/row/row0upd.c b/innobase/row/row0upd.c
index b9e9b8c15c9..f8739b65c2f 100644
--- a/innobase/row/row0upd.c
+++ b/innobase/row/row0upd.c
@@ -77,8 +77,8 @@ index record. This is only used in foreign key checks and we can assume
that index does not contain column prefixes. */
static
ibool
-row_upd_changes_first_fields(
-/*=========================*/
+row_upd_changes_first_fields_binary(
+/*================================*/
/* out: TRUE if changes */
dtuple_t* entry, /* in: old value of index entry */
dict_index_t* index, /* in: index of entry */
@@ -196,7 +196,7 @@ row_upd_check_references_constraints(
if (foreign->referenced_index == index
&& (node->is_delete
- || row_upd_changes_first_fields(entry, index,
+ || row_upd_changes_first_fields_binary(entry, index,
node->update, foreign->n_fields))) {
if (foreign->foreign_table == NULL) {
@@ -287,7 +287,9 @@ upd_node_create(
node->select = NULL;
node->heap = mem_heap_create(128);
- node->magic_n = UPD_NODE_MAGIC_N;
+#ifdef UNIV_DEBUG
+ node->magic_n = UPD_NODE_MAGIC_N;
+#endif /* UNIV_DEBUG */
node->cmpl_info = 0;
@@ -1048,8 +1050,8 @@ index record. This is only used in foreign key checks and we can assume
that index does not contain column prefixes. */
static
ibool
-row_upd_changes_first_fields(
-/*=========================*/
+row_upd_changes_first_fields_binary(
+/*================================*/
/* out: TRUE if changes */
dtuple_t* entry, /* in: index entry */
dict_index_t* index, /* in: index of entry */
@@ -1074,15 +1076,16 @@ row_upd_changes_first_fields(
col = dict_field_get_col(ind_field);
col_pos = dict_col_get_clust_pos(col);
+ ut_a(ind_field->prefix_len == 0);
+
for (j = 0; j < n_upd_fields; j++) {
upd_field = upd_get_nth_field(update, j);
if (col_pos == upd_field->field_no
- && (ind_field->prefix_len > 0
- || 0 != cmp_dfield_dfield(
+ && !dfield_datas_are_binary_equal(
dtuple_get_nth_field(entry, i),
- &(upd_field->new_val)))) {
+ &(upd_field->new_val))) {
return(TRUE);
}
}
@@ -1804,6 +1807,7 @@ 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;
@@ -1923,6 +1927,7 @@ 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/row/row0vers.c b/innobase/row/row0vers.c
index fca56389e45..bc17ede89e3 100644
--- a/innobase/row/row0vers.c
+++ b/innobase/row/row0vers.c
@@ -60,8 +60,10 @@ row_vers_impl_x_locked_off_kernel(
ulint err;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
ut_ad(!rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED));
+#endif /* UNIV_SYNC_DEBUG */
mutex_exit(&kernel_mutex);
@@ -254,7 +256,9 @@ row_vers_must_preserve_del_marked(
mtr_t* mtr) /* in: mtr holding the latch on the clustered index
record; it will also hold the latch on purge_view */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED));
+#endif /* UNIV_SYNC_DEBUG */
mtr_s_lock(&(purge_sys->latch), mtr);
@@ -302,7 +306,9 @@ row_vers_old_has_index_entry(
ut_ad(mtr_memo_contains(mtr, buf_block_align(rec), MTR_MEMO_PAGE_X_FIX)
|| mtr_memo_contains(mtr, buf_block_align(rec),
MTR_MEMO_PAGE_S_FIX));
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED));
+#endif /* UNIV_SYNC_DEBUG */
mtr_s_lock(&(purge_sys->latch), mtr);
clust_index = dict_table_get_first_index(index->table);
@@ -411,7 +417,9 @@ row_vers_build_for_consistent_read(
ut_ad(mtr_memo_contains(mtr, buf_block_align(rec), MTR_MEMO_PAGE_X_FIX)
|| mtr_memo_contains(mtr, buf_block_align(rec),
MTR_MEMO_PAGE_S_FIX));
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(!read_view_sees_trx_id(view, row_get_rec_trx_id(rec, index)));
rw_lock_s_lock(&(purge_sys->latch));
diff --git a/innobase/row/ts/makefile b/innobase/row/ts/makefile
deleted file mode 100644
index 589db50d4ed..00000000000
--- a/innobase/row/ts/makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-include ..\..\makefile.i
-
-tstcur: ..\tcur.lib tstcur.c
- $(CCOM) $(CFL) -I.. -I..\.. ..\tcur.lib ..\..\trx.lib ..\..\btr.lib ..\..\fut.lib ..\..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\buf.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tstcur.c $(LFL)
-
-
-
-
-
-
-
-
-
diff --git a/innobase/row/ts/tstcur.c b/innobase/row/ts/tstcur.c
deleted file mode 100644
index f5a5eb1f9f3..00000000000
--- a/innobase/row/ts/tstcur.c
+++ /dev/null
@@ -1,1087 +0,0 @@
-/************************************************************************
-Test for the index system
-
-(c) 1994-1996 Innobase Oy
-
-Created 2/16/1996 Heikki Tuuri
-*************************************************************************/
-
-#include "sync0sync.h"
-#include "ut0mem.h"
-#include "mem0mem.h"
-#include "data0data.h"
-#include "data0type.h"
-#include "dict0dict.h"
-#include "buf0buf.h"
-#include "os0file.h"
-#include "fil0fil.h"
-#include "fsp0fsp.h"
-#include "rem0rec.h"
-#include "rem0cmp.h"
-#include "mtr0mtr.h"
-#include "log0log.h"
-#include "page0page.h"
-#include "page0cur.h"
-#include "trx0trx.h"
-#include "dict0boot.h"
-#include "trx0sys.h"
-#include "dict0crea.h"
-#include "btr0btr.h"
-#include "btr0pcur.h"
-#include "rem0rec.h"
-#include "..\tcur0ins.h"
-
-os_file_t files[1000];
-
-mutex_t ios_mutex;
-ulint ios;
-ulint n[10];
-
-mutex_t incs_mutex;
-ulint incs;
-
-byte bigbuf[1000000];
-
-#define N_SPACES 1
-#define N_FILES 1
-#define FILE_SIZE 4000 /* must be > 512 */
-#define POOL_SIZE 1000
-#define COUNTER_OFFSET 1500
-
-#define LOOP_SIZE 150
-#define N_THREADS 5
-
-
-ulint zero = 0;
-
-buf_block_t* bl_arr[POOL_SIZE];
-
-/************************************************************************
-Io-handler thread function. */
-
-ulint
-handler_thread(
-/*===========*/
- void* arg)
-{
- ulint segment;
- void* mess;
- ulint i;
- bool ret;
-
- segment = *((ulint*)arg);
-
- printf("Io handler thread %lu starts\n", segment);
-
- for (i = 0;; i++) {
- ret = fil_aio_wait(segment, &mess);
- ut_a(ret);
-
- buf_page_io_complete((buf_block_t*)mess);
-
- mutex_enter(&ios_mutex);
- ios++;
- mutex_exit(&ios_mutex);
-
- }
-
- return(0);
-}
-
-/*************************************************************************
-Creates the files for the file system test and inserts them to
-the file system. */
-
-void
-create_files(void)
-/*==============*/
-{
- bool ret;
- ulint i, k;
- char name[20];
- os_thread_t thr[5];
- os_thread_id_t id[5];
-
- printf("--------------------------------------------------------\n");
- printf("Create or open database files\n");
-
- strcpy(name, "tsfile00");
-
- for (k = 0; k < N_SPACES; k++) {
- for (i = 0; i < N_FILES; i++) {
-
- name[6] = (char)((ulint)'0' + k);
- name[7] = (char)((ulint)'0' + i);
-
- files[i] = os_file_create(name, OS_FILE_CREATE,
- OS_FILE_TABLESPACE, &ret);
-
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(
- name, OS_FILE_OPEN,
- OS_FILE_TABLESPACE, &ret);
-
- ut_a(ret);
- }
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create(name, k, OS_FILE_TABLESPACE);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, FILE_SIZE, k);
- }
- }
-
- ios = 0;
-
- mutex_create(&ios_mutex);
-
- for (i = 0; i < 5; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(handler_thread, n + i, id + i);
- }
-}
-
-/************************************************************************
-Inits space header of space 0. */
-
-void
-init_space(void)
-/*============*/
-{
- mtr_t mtr;
-
- printf("Init space header\n");
-
- mtr_start(&mtr);
-
- fsp_header_init(0, FILE_SIZE * N_FILES, &mtr);
-
- mtr_commit(&mtr);
-}
-
-/*********************************************************************
-Test for index page. */
-
-void
-test1(void)
-/*=======*/
-{
- dtuple_t* tuple;
- mem_heap_t* heap;
- mem_heap_t* heap2;
- ulint rnd = 0;
- dict_index_t* index;
- dict_table_t* table;
- byte buf[16];
- ulint i, j;
- ulint tm, oldtm;
- trx_t* trx;
-/* dict_tree_t* tree;*/
- btr_pcur_t pcur;
- btr_pcur_t pcur2;
- mtr_t mtr;
- mtr_t mtr2;
- byte* field;
- ulint len;
- dtuple_t* search_tuple;
- dict_tree_t* index_tree;
- rec_t* rec;
-
- UT_NOT_USED(len);
- UT_NOT_USED(field);
- UT_NOT_USED(pcur2);
-/*
- printf("\n\n\nPress 2 x enter to start test\n");
-
- while (EOF == getchar()) {
-
- }
-
- getchar();
-*/
- printf("-------------------------------------------------\n");
- printf("TEST 1. CREATE TABLE WITH 3 COLUMNS AND WITH 3 INDEXES\n");
-
- heap = mem_heap_create(1024);
- heap2 = mem_heap_create(1024);
-
- trx = trx_start(ULINT_UNDEFINED);
-
- table = dict_mem_table_create("TS_TABLE1", 0, 3);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
-
- ut_a(TRUE == dict_create_table(table, trx));
-
- index = dict_mem_index_create("TS_TABLE1", "IND1", 75046,
- DICT_CLUSTERED, 2);
-
- dict_mem_index_add_field(index, "COL1", 0);
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- ut_a(TRUE == dict_create_index(index, trx));
-
- trx_commit(trx);
-
- trx = trx_start(ULINT_UNDEFINED);
-
- index = dict_mem_index_create("TS_TABLE1", "IND2", 0, DICT_UNIQUE, 1);
-
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- ut_a(TRUE == dict_create_index(index, trx));
-
- trx_commit(trx);
-
- trx = trx_start(ULINT_UNDEFINED);
-
- index = dict_mem_index_create("TS_TABLE1", "IND3", 0, DICT_UNIQUE, 1);
-
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- ut_a(TRUE == dict_create_index(index, trx));
-
- trx_commit(trx);
-/*
- tree = dict_index_get_tree(dict_table_get_first_index(table));
-
- btr_print_tree(tree, 10);
-*/
- dict_table_print(table);
-
- /*---------------------------------------------------------*/
-/*
- printf("\n\n\nPress 2 x enter to continue test\n");
-
- while (EOF == getchar()) {
-
- }
- getchar();
-*/
- printf("-------------------------------------------------\n");
- printf("TEST 2. INSERT 1 ROW TO THE TABLE\n");
-
- trx = trx_start(ULINT_UNDEFINED);
-
- tuple = dtuple_create(heap, 3);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- dtuple_gen_test_tuple3(tuple, 0, buf);
- tcur_insert(tuple, table, heap2, trx);
-
- trx_commit(trx);
-/*
- tree = dict_index_get_tree(dict_table_get_first_index(table));
-
- btr_print_tree(tree, 10);
-*/
-/*
- printf("\n\n\nPress 2 x enter to continue test\n");
-
- while (EOF == getchar()) {
-
- }
- getchar();
-*/
- printf("-------------------------------------------------\n");
- printf("TEST 3. INSERT MANY ROWS TO THE TABLE IN A SINGLE TRX\n");
-
- rnd = 0;
- oldtm = ut_clock();
-
- trx = trx_start(ULINT_UNDEFINED);
- for (i = 0; i < 300 * UNIV_DBC * UNIV_DBC; i++) {
-
- if (i % 5000 == 0) {
- /* dict_table_print(table);
- buf_print();
- buf_LRU_print();
- printf("%lu rows inserted\n", i); */
- }
-
- table = dict_table_get("TS_TABLE1", trx);
-
- if (i == 2180) {
- rnd = rnd % 200000;
- }
-
- rnd = (rnd + 1) % 200000;
-
- dtuple_gen_test_tuple3(tuple, rnd, buf);
-
- tcur_insert(tuple, table, heap2, trx);
-
- mem_heap_empty(heap2);
-
- if (i % 4 == 3) {
- }
- }
- trx_commit(trx);
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
- printf("%lu rows inserted\n", i);
-/*
- printf("\n\n\nPress 2 x enter to continue test\n");
-
- while (EOF == getchar()) {
-
- }
- getchar();
-*/
- printf("-------------------------------------------------\n");
- printf("TEST 4. PRINT PART OF CONTENTS OF EACH INDEX TREE\n");
-
-/*
- mem_print_info();
-*/
-
-/*
- tree = dict_index_get_tree(dict_table_get_first_index(table));
-
- btr_print_tree(tree, 10);
-
- tree = dict_index_get_tree(dict_table_get_next_index(
- dict_table_get_first_index(table)));
-
- btr_print_tree(tree, 5);
-*/
-/*
- printf("\n\n\nPress 2 x enter to continue test\n");
-
- while (EOF == getchar()) {
-
- }
- getchar();
-*/
-/* mem_print_info(); */
-
- os_thread_sleep(5000000);
-
- for (j = 0; j < 5; j++) {
- printf("-------------------------------------------------\n");
- printf("TEST 5. CALCULATE THE JOIN OF THE TABLE WITH ITSELF\n");
-
- i = 0;
-
- oldtm = ut_clock();
-
- mtr_start(&mtr);
-
- index_tree = dict_index_get_tree(UT_LIST_GET_FIRST(table->indexes));
-
- search_tuple = dtuple_create(heap, 2);
-
- dtuple_gen_search_tuple3(search_tuple, i, buf);
-
- btr_pcur_open(index_tree, search_tuple, PAGE_CUR_GE,
- BTR_SEARCH_LEAF, &pcur, &mtr);
-
- ut_a(btr_pcur_move_to_next(&pcur, &mtr));
-
- while (!btr_pcur_is_after_last_in_tree(&pcur, &mtr)) {
-
- if (i % 20000 == 0) {
- printf("%lu rows joined\n", i);
- }
-
- index_tree = dict_index_get_tree(
- UT_LIST_GET_FIRST(table->indexes));
-
- rec = btr_pcur_get_rec(&pcur);
-
- rec_copy_prefix_to_dtuple(search_tuple, rec, 2, heap2);
-
- mtr_start(&mtr2);
-
- btr_pcur_open(index_tree, search_tuple, PAGE_CUR_GE,
- BTR_SEARCH_LEAF, &pcur2, &mtr2);
-
- btr_pcur_move_to_next(&pcur2, &mtr2);
-
- rec = btr_pcur_get_rec(&pcur2);
-
- field = rec_get_nth_field(rec, 1, &len);
-
- ut_a(len == 8);
-
- ut_a(ut_memcmp(field, dfield_get_data(
- dtuple_get_nth_field(search_tuple, 1)),
- len) == 0);
-
- btr_pcur_close(&pcur2, &mtr);
-
- mem_heap_empty(heap2);
-
- mtr_commit(&mtr2);
-
- btr_pcur_store_position(&pcur, &mtr);
- mtr_commit(&mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_restore_position(BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_move_to_next(&pcur, &mtr);
- i++;
- }
-
- btr_pcur_close(&pcur, &mtr);
- mtr_commit(&mtr);
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
- printf("%lu rows joined\n", i);
- }
-
- oldtm = ut_clock();
-
-/*
- printf("\n\n\nPress 2 x enter to continue test\n");
-
- while (EOF == getchar()) {
-
- }
- getchar();
-*/
- printf("-------------------------------------------------\n");
- printf("TEST 6. INSERT MANY ROWS TO THE TABLE IN SEPARATE TRXS\n");
-
- rnd = 200000;
-
- for (i = 0; i < 350; i++) {
-
- if (i % 4 == 0) {
- }
- trx = trx_start(ULINT_UNDEFINED);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- if (i == 2180) {
- rnd = rnd % 200000;
- }
-
- rnd = (rnd + 1) % 200000;
-
- dtuple_gen_test_tuple3(tuple, rnd, buf);
-
- tcur_insert(tuple, table, heap2, trx);
-
- trx_commit(trx);
-
- mem_heap_empty(heap2);
- if (i % 4 == 3) {
- }
- }
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
- printf("%lu rows inserted in %lu transactions\n", i, i);
-/*
- printf("\n\n\nPress 2 x enter to continue test\n");
-
- while (EOF == getchar()) {
-
- }
- getchar();
-*/
- printf("-------------------------------------------------\n");
- printf("TEST 7. PRINT MEMORY ALLOCATION INFO\n");
-
- mem_print_info();
-/*
- printf("\n\n\nPress 2 x enter to continue test\n");
-
- while (EOF == getchar()) {
-
- }
- getchar();
-*/
- printf("-------------------------------------------------\n");
- printf("TEST 8. PRINT SEMAPHORE INFO\n");
-
- sync_print();
-
-
-
-#ifdef notdefined
- rnd = 90000;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1000 * UNIV_DBC * UNIV_DBC; i++) {
-
- mtr_start(&mtr);
-
- if (i == 50000) {
- rnd = rnd % 200000;
- }
-
- rnd = (rnd + 595659561) % 200000;
-
- dtuple_gen_test_tuple3(tuple, rnd, buf);
-
- btr_pcur_open(tree, tuple, PAGE_CUR_GE,
- BTR_SEARCH_LEAF, &cursor, &mtr);
-
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1000 * UNIV_DBC * UNIV_DBC; i++) {
-
- mtr_start(&mtr);
-
- rnd = (rnd + 35608971) % 200000 + 1;
-
- dtuple_gen_test_tuple3(tuple, rnd, buf);
-
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
-
-/* btr_print_tree(tree, 3); */
-
-#endif
- mem_heap_free(heap);
-}
-
-
-#ifdef notdefined
-
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd + 534671) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
-/* page_print_list(page, 151); */
-
- ut_a(page_validate(page, index));
- ut_a(page_get_n_recs(page) == 512);
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd + 7771) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- page_cur_delete_rec(&cursor, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
- ut_a(page_get_n_recs(page) == 0);
-
- ut_a(page_validate(page, index));
- page = page_create(frame, &mtr);
-
- rnd = 311;
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd + 1) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
- ut_a(page_validate(page, index));
- ut_a(page_get_n_recs(page) == 512);
-
- rnd = 217;
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd + 1) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- page_cur_delete_rec(&cursor, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
- ut_a(page_validate(page, index));
- ut_a(page_get_n_recs(page) == 0);
- page = page_create(frame, &mtr);
-
- rnd = 291;
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd - 1) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
- ut_a(page_validate(page, index));
- ut_a(page_get_n_recs(page) == 512);
-
- rnd = 277;
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd - 1) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- page_cur_delete_rec(&cursor, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
- ut_a(page_validate(page, index));
- ut_a(page_get_n_recs(page) == 0);
-
- mtr_commit(&mtr);
- mem_heap_free(heap);
-}
-
-/*********************************************************************
-Test for index page. */
-
-void
-test2(void)
-/*=======*/
-{
- page_t* page;
- dtuple_t* tuple;
- mem_heap_t* heap;
- ulint i, j;
- ulint rnd = 0;
- rec_t* rec;
- page_cur_t cursor;
- dict_index_t* index;
- dict_table_t* table;
- buf_block_t* block;
- buf_frame_t* frame;
- ulint tm, oldtm;
- byte buf[8];
- mtr_t mtr;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2. Speed test\n");
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1000 * UNIV_DBC * UNIV_DBC; i++) {
- ut_memcpy(bigbuf, bigbuf + 800, 800);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu mem copys of 800 bytes %lu millisecs\n",
- i, tm - oldtm);
-
- oldtm = ut_clock();
-
- rnd = 0;
- for (i = 0; i < 1000 * UNIV_DBC * UNIV_DBC; i++) {
- ut_memcpy(bigbuf + rnd, bigbuf + rnd + 800, 800);
- rnd += 1600;
- if (rnd > 995000) {
- rnd = 0;
- }
- }
-
- tm = ut_clock();
- printf("Wall time for %lu mem copys of 800 bytes %lu millisecs\n",
- i, tm - oldtm);
-
- heap = mem_heap_create(0);
-
- table = dict_table_create("TS_TABLE2", 2);
-
- dict_table_add_col(table, "COL1", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
- dict_table_add_col(table, "COL2", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
-
- ut_a(0 == dict_table_publish(table));
-
- index = dict_index_create("TS_TABLE2", "IND2", 0, 2, 0);
-
- dict_index_add_field(index, "COL1", 0);
- dict_index_add_field(index, "COL2", 0);
-
- ut_a(0 == dict_index_publish(index));
-
- index = dict_index_get("TS_TABLE2", "IND2");
- ut_a(index);
-
- tuple = dtuple_create(heap, 2);
-
- oldtm = ut_clock();
-
- rnd = 677;
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
-
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
- ut_a(rec);
- }
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf("Wall time for insertion of %lu recs %lu milliseconds\n",
- i * j, tm - oldtm);
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, 5, &mtr);
- buf_page_s_lock(block, &mtr);
-
- page = buf_block_get_frame(block);
- ut_a(page_validate(page, index));
- mtr_commit(&mtr);
-
- oldtm = ut_clock();
-
- rnd = 677;
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- }
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf(
- "Wall time for %lu empty loops with page create %lu milliseconds\n",
- i * j, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
-
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- rnd = 100;
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 1) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
- ut_a(rec);
- }
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf(
- "Wall time for sequential insertion of %lu recs %lu milliseconds\n",
- i * j, tm - oldtm);
-
-
- oldtm = ut_clock();
-
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- rnd = 500;
- for (j = 0; j < 250; j++) {
- rnd = (rnd - 1) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
- ut_a(rec);
- }
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf(
- "Wall time for descend. seq. insertion of %lu recs %lu milliseconds\n",
- i * j, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- rnd = 677;
-
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
- ut_a(rec);
- }
-
- rnd = 677;
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- page_cur_delete_rec(&cursor, &mtr);
- }
- ut_a(page_get_n_recs(page) == 0);
-
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf("Wall time for insert and delete of %lu recs %lu milliseconds\n",
- i * j, tm - oldtm);
-
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- rnd = 677;
-
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
- ut_a(rec);
- }
- ut_a(page_validate(page, index));
- mtr_print(&mtr);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
- rnd = 677;
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
- }
- }
-
- tm = ut_clock();
- printf("Wall time for search of %lu recs %lu milliseconds\n",
- i * j, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
- rnd = 677;
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- }
- }
-
- tm = ut_clock();
- printf("Wall time for %lu empty loops %lu milliseconds\n",
- i * j, tm - oldtm);
- mtr_commit(&mtr);
-}
-
-#endif
-
-/********************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
- mtr_t mtr;
-
- sync_init();
- mem_init();
- os_aio_init(160, 5);
- fil_init(25);
- buf_pool_init(POOL_SIZE, POOL_SIZE);
- fsp_init();
- log_init();
-
- create_files();
- init_space();
-
- mtr_start(&mtr);
-
- trx_sys_create(&mtr);
- dict_create(&mtr);
-
- mtr_commit(&mtr);
-
-
- oldtm = ut_clock();
-
- ut_rnd_set_seed(19);
-
- test1();
-
-/* mem_print_info(); */
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/srv/srv0que.c b/innobase/srv/srv0que.c
index 4d36adfefa4..ac8bd7d0e65 100644
--- a/innobase/srv/srv0que.c
+++ b/innobase/srv/srv0que.c
@@ -83,7 +83,9 @@ srv_que_task_enqueue_low(
{
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);
diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c
index d2368c5341f..838e63b3e25 100644
--- a/innobase/srv/srv0srv.c
+++ b/innobase/srv/srv0srv.c
@@ -34,12 +34,9 @@ Created 10/8/1995 Heikki Tuuri
#include "sync0sync.h"
#include "sync0ipm.h"
#include "thr0loc.h"
-#include "com0com.h"
-#include "com0shm.h"
#include "que0que.h"
#include "srv0que.h"
#include "log0recv.h"
-#include "odbc0odbc.h"
#include "pars0pars.h"
#include "usr0sess.h"
#include "lock0lock.h"
@@ -253,9 +250,6 @@ ibool srv_use_adaptive_hash_indexes = TRUE;
ulint srv_n_spin_wait_rounds = 20;
ulint srv_spin_wait_delay = 5;
ibool srv_priority_boost = TRUE;
-char srv_endpoint_name[COM_MAX_ADDR_LEN];
-ulint srv_n_com_threads = ULINT_MAX;
-ulint srv_n_worker_threads = ULINT_MAX;
ibool srv_print_thread_releases = FALSE;
ibool srv_print_lock_waits = FALSE;
@@ -263,14 +257,14 @@ ibool srv_print_buf_io = FALSE;
ibool srv_print_log_io = FALSE;
ibool srv_print_latch_waits = FALSE;
-ulint srv_n_rows_inserted = 0;
-ulint srv_n_rows_updated = 0;
-ulint srv_n_rows_deleted = 0;
-ulint srv_n_rows_read = 0;
-ulint srv_n_rows_inserted_old = 0;
-ulint srv_n_rows_updated_old = 0;
-ulint srv_n_rows_deleted_old = 0;
-ulint srv_n_rows_read_old = 0;
+ulint srv_n_rows_inserted = 0;
+ulint srv_n_rows_updated = 0;
+ulint srv_n_rows_deleted = 0;
+ulint srv_n_rows_read = 0;
+static ulint srv_n_rows_inserted_old = 0;
+static ulint srv_n_rows_updated_old = 0;
+static ulint srv_n_rows_deleted_old = 0;
+static ulint srv_n_rows_read_old = 0;
/*
Set the following to 0 if you want InnoDB to write messages on
@@ -630,7 +624,9 @@ srv_suspend_thread(void)
ulint slot_no;
ulint type;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
slot_no = thr_local_get_slot_no(os_thread_get_curr_id());
@@ -681,7 +677,9 @@ srv_release_threads(
ut_ad(type >= SRV_WORKER);
ut_ad(type <= SRV_MASTER);
ut_ad(n > 0);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
for (i = 0; i < OS_THREAD_MAX_N; i++) {
@@ -741,924 +739,9 @@ srv_get_thread_type(void)
return(type);
}
-/***********************************************************************
-Increments by 1 the count of active threads of the type given
-and releases master thread if necessary. */
-static
-void
-srv_inc_thread_count(
-/*=================*/
- ulint type) /* in: type of the thread */
-{
- mutex_enter(&kernel_mutex);
-
- srv_activity_count++;
-
- srv_n_threads_active[type]++;
-
- if (srv_n_threads_active[SRV_MASTER] == 0) {
-
- srv_release_threads(SRV_MASTER, 1);
- }
-
- mutex_exit(&kernel_mutex);
-}
-
-/***********************************************************************
-Decrements by 1 the count of active threads of the type given. */
-static
-void
-srv_dec_thread_count(
-/*=================*/
- ulint type) /* in: type of the thread */
-
-{
- mutex_enter(&kernel_mutex);
-
- /* FIXME: the following assertion sometimes fails: */
-
- if (srv_n_threads_active[type] == 0) {
- printf("Error: thread type %lu\n", (ulong) type);
-
- ut_ad(0);
- }
-
- srv_n_threads_active[type]--;
-
- mutex_exit(&kernel_mutex);
-}
-
-/***********************************************************************
-Calculates the number of allowed utility threads for a thread to decide if
-it has to suspend itself in the thread table. */
-static
-ulint
-srv_max_n_utilities(
-/*================*/
- /* out: maximum number of allowed utilities
- of the type given */
- ulint type) /* in: utility type */
-{
- ulint ret;
-
- if (srv_n_threads_active[SRV_COM] == 0) {
- if (srv_meter[type] > srv_meter_low_water[type]) {
- return(srv_n_threads[type] / 2);
- } else {
- return(0);
- }
- } else {
-
- if (srv_meter[type] < srv_meter_foreground[type]) {
- return(0);
- }
- ret = 1 + ((srv_n_threads[type]
- * (ulint)(srv_meter[type] - srv_meter_foreground[type]))
- / (ulint)(1000 - srv_meter_foreground[type]));
- if (ret > srv_n_threads[type]) {
- return(srv_n_threads[type]);
- } else {
- return(ret);
- }
- }
-}
-
-/***********************************************************************
-Increments the utility meter by the value given and releases utility
-threads if necessary. */
-
-void
-srv_increment_meter(
-/*================*/
- ulint type, /* in: utility type */
- ulint n) /* in: value to add to meter */
-{
- ulint m;
-
- mutex_enter(&kernel_mutex);
-
- srv_meter[type] += n;
-
- m = srv_max_n_utilities(type);
-
- if (m > srv_n_threads_active[type]) {
-
- srv_release_threads(type, m - srv_n_threads_active[type]);
- }
-
- mutex_exit(&kernel_mutex);
-}
-
-/***********************************************************************
-Releases max number of utility threads if no queries are active and
-the high-water mark for the utility is exceeded. */
-
-void
-srv_release_max_if_no_queries(void)
-/*===============================*/
-{
- ulint m;
- ulint type;
-
- mutex_enter(&kernel_mutex);
-
- if (srv_n_threads_active[SRV_COM] > 0) {
- mutex_exit(&kernel_mutex);
-
- return;
- }
-
- type = SRV_RECOVERY;
-
- m = srv_n_threads[type] / 2;
-
- if ((srv_meter[type] > srv_meter_high_water[type])
- && (srv_n_threads_active[type] < m)) {
-
- srv_release_threads(type, m - srv_n_threads_active[type]);
-
- printf("Releasing max background\n");
- }
-
- mutex_exit(&kernel_mutex);
-}
-
-#ifdef notdefined
-/***********************************************************************
-Releases one utility thread if no queries are active and
-the high-water mark 2 for the utility is exceeded. */
-static
-void
-srv_release_one_if_no_queries(void)
-/*===============================*/
-{
- ulint m;
- ulint type;
-
- mutex_enter(&kernel_mutex);
-
- if (srv_n_threads_active[SRV_COM] > 0) {
- mutex_exit(&kernel_mutex);
-
- return;
- }
-
- type = SRV_RECOVERY;
-
- m = 1;
-
- if ((srv_meter[type] > srv_meter_high_water2[type])
- && (srv_n_threads_active[type] < m)) {
-
- srv_release_threads(type, m - srv_n_threads_active[type]);
-
- printf("Releasing one background\n");
- }
-
- mutex_exit(&kernel_mutex);
-}
-
-/***********************************************************************
-Decrements the utility meter by the value given and suspends the calling
-thread, which must be an utility thread of the type given, if necessary. */
-static
-void
-srv_decrement_meter(
-/*================*/
- ulint type, /* in: utility type */
- ulint n) /* in: value to subtract from meter */
-{
- ulint opt;
- os_event_t event;
-
- mutex_enter(&kernel_mutex);
-
- if (srv_meter[type] < n) {
- srv_meter[type] = 0;
- } else {
- srv_meter[type] -= n;
- }
-
- opt = srv_max_n_utilities(type);
-
- if (opt < srv_n_threads_active[type]) {
-
- event = srv_suspend_thread();
- mutex_exit(&kernel_mutex);
-
- os_event_wait(event);
- } else {
- mutex_exit(&kernel_mutex);
- }
-}
-#endif
-
-/*************************************************************************
-Implements the server console. */
-
-ulint
-srv_console(
-/*========*/
- /* out: return code, not used */
- void* arg) /* in: argument, not used */
-{
- char command[256];
-
- UT_NOT_USED(arg);
-
- mutex_enter(&kernel_mutex);
- srv_table_reserve_slot(SRV_CONSOLE);
- mutex_exit(&kernel_mutex);
-
- os_event_wait(srv_sys->operational);
-
- for (;;) {
- scanf("%s", command);
-
- srv_inc_thread_count(SRV_CONSOLE);
-
- if (command[0] == 'c') {
- printf("Making checkpoint\n");
-
- log_make_checkpoint_at(ut_dulint_max, TRUE);
-
- printf("Checkpoint completed\n");
-
- } else if (command[0] == 'd') {
- srv_sim_disk_wait_pct = atoi(command + 1);
-
- printf(
- "Starting disk access simulation with pct %lu\n",
- (ulong) srv_sim_disk_wait_pct);
- } else {
- printf("\nNot supported!\n");
- }
-
- srv_dec_thread_count(SRV_CONSOLE);
- }
-
- return(0); /* Not reached */
-}
-
-/*************************************************************************
-Creates the first communication endpoint for the server. This
-first call also initializes the com0com.* module. */
-
-void
-srv_communication_init(
-/*===================*/
- char* endpoint) /* in: server address */
-{
- ulint ret;
- ulint len;
-
- srv_sys->endpoint = com_endpoint_create(COM_SHM);
-
- ut_a(srv_sys->endpoint);
-
- len = ODBC_DATAGRAM_SIZE;
-
- ret = com_endpoint_set_option(srv_sys->endpoint,
- COM_OPT_MAX_DGRAM_SIZE,
- (byte*)&len, sizeof(ulint));
- ut_a(ret == 0);
-
- ret = com_bind(srv_sys->endpoint, endpoint, ut_strlen(endpoint));
-
- ut_a(ret == 0);
-}
-
-#ifdef notdefined
-
-/*************************************************************************
-Implements the recovery utility. */
-static
-ulint
-srv_recovery_thread(
-/*================*/
- /* out: return code, not used */
- void* arg) /* in: not used */
-{
- ulint slot_no;
- os_event_t event;
-
- UT_NOT_USED(arg);
-
- slot_no = srv_table_reserve_slot(SRV_RECOVERY);
-
- os_event_wait(srv_sys->operational);
-
- for (;;) {
- /* Finish a possible recovery */
-
- srv_inc_thread_count(SRV_RECOVERY);
-
-/* recv_recovery_from_checkpoint_finish(); */
-
- srv_dec_thread_count(SRV_RECOVERY);
-
- mutex_enter(&kernel_mutex);
- event = srv_suspend_thread();
- mutex_exit(&kernel_mutex);
-
- /* Wait for somebody to release this thread; (currently, this
- should never be released) */
-
- os_event_wait(event);
- }
-
- return(0);
-}
-
-/*************************************************************************
-Implements the purge utility. */
-
-ulint
-srv_purge_thread(
-/*=============*/
- /* out: return code, not used */
- void* arg) /* in: not used */
-{
- UT_NOT_USED(arg);
-
- os_event_wait(srv_sys->operational);
-
- for (;;) {
- trx_purge();
- }
-
- return(0);
-}
-#endif /* notdefined */
-
-/*************************************************************************
-Creates the utility threads. */
-
-void
-srv_create_utility_threads(void)
-/*============================*/
-{
-/* os_thread_t thread;
- os_thread_id_t thr_id; */
- ulint i;
-
- mutex_enter(&kernel_mutex);
-
- srv_n_threads[SRV_RECOVERY] = 1;
- srv_n_threads_active[SRV_RECOVERY] = 1;
-
- mutex_exit(&kernel_mutex);
-
- for (i = 0; i < 1; i++) {
- /* thread = os_thread_create(srv_recovery_thread, NULL, &thr_id); */
-
- /* ut_a(thread); */
- }
-
-/* thread = os_thread_create(srv_purge_thread, NULL, &thr_id);
-
- ut_a(thread); */
-}
-
-#ifdef notdefined
-/*************************************************************************
-Implements the communication threads. */
-static
-ulint
-srv_com_thread(
-/*===========*/
- /* out: return code; not used */
- void* arg) /* in: not used */
-{
- byte* msg_buf;
- byte* addr_buf;
- ulint msg_len;
- ulint addr_len;
- ulint ret;
-
- UT_NOT_USED(arg);
-
- srv_table_reserve_slot(SRV_COM);
-
- os_event_wait(srv_sys->operational);
-
- msg_buf = mem_alloc(com_endpoint_get_max_size(srv_sys->endpoint));
- addr_buf = mem_alloc(COM_MAX_ADDR_LEN);
-
- for (;;) {
- ret = com_recvfrom(srv_sys->endpoint, msg_buf,
- com_endpoint_get_max_size(srv_sys->endpoint),
- &msg_len, (char*)addr_buf, COM_MAX_ADDR_LEN,
- &addr_len);
- ut_a(ret == 0);
-
- srv_inc_thread_count(SRV_COM);
-
- sess_process_cli_msg(msg_buf, msg_len, addr_buf, addr_len);
-
-/* srv_increment_meter(SRV_RECOVERY, 1); */
-
- srv_dec_thread_count(SRV_COM);
-
- /* Release one utility thread for each utility if
- high water mark 2 is exceeded and there are no
- active queries. This is done to utilize possible
- quiet time in the server. */
-
- srv_release_one_if_no_queries();
- }
-
- return(0);
-}
-#endif
-
-/*************************************************************************
-Creates the communication threads. */
-
-void
-srv_create_com_threads(void)
-/*========================*/
-{
- /* os_thread_t thread;
- os_thread_id_t thr_id; */
- ulint i;
-
- srv_n_threads[SRV_COM] = srv_n_com_threads;
-
- for (i = 0; i < srv_n_com_threads; i++) {
- /* thread = os_thread_create(srv_com_thread, NULL, &thr_id); */
- /* ut_a(thread); */
- }
-}
-
-#ifdef notdefined
-/*************************************************************************
-Implements the worker threads. */
-static
-ulint
-srv_worker_thread(
-/*==============*/
- /* out: return code, not used */
- void* arg) /* in: not used */
-{
- os_event_t event;
-
- UT_NOT_USED(arg);
-
- srv_table_reserve_slot(SRV_WORKER);
-
- os_event_wait(srv_sys->operational);
-
- for (;;) {
- mutex_enter(&kernel_mutex);
- event = srv_suspend_thread();
- mutex_exit(&kernel_mutex);
-
- /* Wait for somebody to release this thread */
- os_event_wait(event);
-
- srv_inc_thread_count(SRV_WORKER);
-
- /* Check in the server task queue if there is work for this
- thread, and do the work */
-
- srv_que_task_queue_check();
-
- srv_dec_thread_count(SRV_WORKER);
-
- /* Release one utility thread for each utility if
- high water mark 2 is exceeded and there are no
- active queries. This is done to utilize possible
- quiet time in the server. */
-
- srv_release_one_if_no_queries();
- }
-
- return(0);
-}
-#endif
-
-/*************************************************************************
-Creates the worker threads. */
-
-void
-srv_create_worker_threads(void)
-/*===========================*/
-{
-/* os_thread_t thread;
- os_thread_id_t thr_id; */
- ulint i;
-
- srv_n_threads[SRV_WORKER] = srv_n_worker_threads;
- srv_n_threads_active[SRV_WORKER] = srv_n_worker_threads;
-
- for (i = 0; i < srv_n_worker_threads; i++) {
- /* thread = os_thread_create(srv_worker_thread, NULL, &thr_id); */
- /* ut_a(thread); */
- }
-}
-
-#ifdef notdefined
-/*************************************************************************
-Reads a keyword and a value from a file. */
-
-ulint
-srv_read_init_val(
-/*==============*/
- /* out: DB_SUCCESS or error code */
- FILE* initfile, /* in: file pointer */
- char* keyword, /* in: keyword before value(s), or NULL if
- no keyword read */
- char* str_buf, /* in/out: buffer for a string value to read,
- buffer size must be 10000 bytes, if NULL
- then not read */
- ulint* num_val, /* out: numerical value to read, if NULL
- then not read */
- ibool print_not_err) /* in: if TRUE, then we will not print
- error messages to console */
-{
- ulint ret;
- char scan_buf[10000];
-
- if (keyword == NULL) {
-
- goto skip_keyword;
- }
-
- ret = fscanf(initfile, "%9999s", scan_buf);
-
- if (ret == 0 || ret == EOF || 0 != ut_strcmp(scan_buf, keyword)) {
- if (print_not_err) {
-
- return(DB_ERROR);
- }
-
- printf("Error in InnoDB booting: keyword %s not found\n",
- keyword);
- printf("from the initfile!\n");
-
- return(DB_ERROR);
- }
-skip_keyword:
- if (num_val == NULL && str_buf == NULL) {
-
- return(DB_SUCCESS);
- }
-
- ret = fscanf(initfile, "%9999s", scan_buf);
-
- if (ret == EOF || ret == 0) {
- if (print_not_err) {
-
- return(DB_ERROR);
- }
-
- printf(
- "Error in InnoDB booting: could not read first value after %s\n",
- keyword);
- printf("from the initfile!\n");
-
- return(DB_ERROR);
- }
-
- if (str_buf) {
- ut_memcpy(str_buf, scan_buf, 10000);
-
- printf("init keyword %s value %s read\n", keyword, str_buf);
-
- if (!num_val) {
- return(DB_SUCCESS);
- }
-
- ret = fscanf(initfile, "%9999s", scan_buf);
-
- if (ret == EOF || ret == 0) {
-
- if (print_not_err) {
-
- return(DB_ERROR);
- }
-
- printf(
- "Error in InnoDB booting: could not read second value after %s\n",
- keyword);
- printf("from the initfile!\n");
-
- return(DB_ERROR);
- }
- }
-
- if (ut_strlen(scan_buf) > 9) {
-
- if (print_not_err) {
-
- return(DB_ERROR);
- }
-
- printf(
- "Error in InnoDB booting: numerical value too big after %s\n",
- keyword);
- printf("in the initfile!\n");
-
- return(DB_ERROR);
- }
-
- *num_val = (ulint)atoi(scan_buf);
-
- if (*num_val >= 1000000000) {
-
- if (print_not_err) {
-
- return(DB_ERROR);
- }
-
- printf(
- "Error in InnoDB booting: numerical value too big after %s\n",
- keyword);
- printf("in the initfile!\n");
-
- return(DB_ERROR);
- }
-
- printf("init keyword %s value %lu read\n", keyword, *num_val);
-
- return(DB_SUCCESS);
-}
-
-/*************************************************************************
-Reads keywords and values from an initfile. */
-
-ulint
-srv_read_initfile(
-/*==============*/
- /* out: DB_SUCCESS or error code */
- FILE* initfile) /* in: file pointer */
-{
- char str_buf[10000];
- ulint n;
- ulint i;
- ulint ulint_val;
- ulint val1;
- ulint val2;
- ulint err;
-
- err = srv_read_init_val(initfile, "INNOBASE_DATA_HOME_DIR",
- str_buf, NULL, FALSE);
- if (err != DB_SUCCESS) return(err);
-
- srv_data_home = ut_malloc(ut_strlen(str_buf) + 1);
- ut_memcpy(srv_data_home, str_buf, ut_strlen(str_buf) + 1);
-
- err = srv_read_init_val(initfile,"TABLESPACE_NUMBER_OF_DATA_FILES",
- NULL, &n, FALSE);
- if (err != DB_SUCCESS) return(err);
-
- srv_n_data_files = n;
-
- srv_data_file_names = ut_malloc(n * sizeof(char*));
- srv_data_file_sizes = ut_malloc(n * sizeof(ulint));
-
- for (i = 0; i < n; i++) {
- err = srv_read_init_val(initfile,
- "DATA_FILE_PATH_AND_SIZE_MB",
- str_buf, &ulint_val, FALSE);
- if (err != DB_SUCCESS) return(err);
-
- srv_data_file_names[i] = ut_malloc(ut_strlen(str_buf) + 1);
- ut_memcpy(srv_data_file_names[i], str_buf,
- ut_strlen(str_buf) + 1);
- srv_data_file_sizes[i] = ulint_val
- * ((1024 * 1024) / UNIV_PAGE_SIZE);
- }
-
- err = srv_read_init_val(initfile,
- "NUMBER_OF_MIRRORED_LOG_GROUPS", NULL,
- &srv_n_log_groups, FALSE);
- if (err != DB_SUCCESS) return(err);
-
- err = srv_read_init_val(initfile,
- "NUMBER_OF_LOG_FILES_IN_GROUP", NULL,
- &srv_n_log_files, FALSE);
- if (err != DB_SUCCESS) return(err);
-
- err = srv_read_init_val(initfile, "LOG_FILE_SIZE_KB", NULL,
- &srv_log_file_size, FALSE);
- if (err != DB_SUCCESS) return(err);
-
- srv_log_file_size = srv_log_file_size / (UNIV_PAGE_SIZE / 1024);
-
- srv_log_group_home_dirs = ut_malloc(srv_n_log_files * sizeof(char*));
-
- for (i = 0; i < srv_n_log_groups; i++) {
-
- err = srv_read_init_val(initfile,
- "INNOBASE_LOG_GROUP_HOME_DIR",
- str_buf, NULL, FALSE);
- if (err != DB_SUCCESS) return(err);
-
- srv_log_group_home_dirs[i] = ut_malloc(ut_strlen(str_buf) + 1);
- ut_memcpy(srv_log_group_home_dirs[i], str_buf,
- ut_strlen(str_buf) + 1);
- }
-
- err = srv_read_init_val(initfile, "INNOBASE_LOG_ARCH_DIR",
- str_buf, NULL, FALSE);
- if (err != DB_SUCCESS) return(err);
-
- srv_arch_dir = ut_malloc(ut_strlen(str_buf) + 1);
- ut_memcpy(srv_arch_dir, str_buf, ut_strlen(str_buf) + 1);
-
- err = srv_read_init_val(initfile, "LOG_ARCHIVE_ON(1/0)", NULL,
- &srv_log_archive_on, FALSE);
- if (err != DB_SUCCESS) return(err);
-
- err = srv_read_init_val(initfile, "LOG_BUFFER_SIZE_KB", NULL,
- &srv_log_buffer_size, FALSE);
- if (err != DB_SUCCESS) return(err);
-
- srv_log_buffer_size = srv_log_buffer_size / (UNIV_PAGE_SIZE / 1024);
-
- err = srv_read_init_val(initfile, "FLUSH_LOG_AT_TRX_COMMIT(1/0)", NULL,
- &srv_flush_log_at_trx_commit, FALSE);
- if (err != DB_SUCCESS) return(err);
-
- err = srv_read_init_val(initfile, "BUFFER_POOL_SIZE_MB", NULL,
- &srv_pool_size, FALSE);
- if (err != DB_SUCCESS) return(err);
-
- srv_pool_size = srv_pool_size * ((1024 * 1024) / UNIV_PAGE_SIZE);
-
- err = srv_read_init_val(initfile, "ADDITIONAL_MEM_POOL_SIZE_MB", NULL,
- &srv_mem_pool_size, FALSE);
- if (err != DB_SUCCESS) return(err);
-
- srv_mem_pool_size = srv_mem_pool_size * 1024 * 1024;
-
- srv_lock_table_size = 20 * srv_pool_size;
-
- err = srv_read_init_val(initfile, "NUMBER_OF_FILE_IO_THREADS", NULL,
- &srv_n_file_io_threads, FALSE);
- if (err != DB_SUCCESS) return(err);
-
- err = srv_read_init_val(initfile, "SRV_RECOVER_FROM_BACKUP",
- NULL, NULL, TRUE);
- if (err == DB_SUCCESS) {
- srv_archive_recovery = TRUE;
- srv_archive_recovery_limit_lsn = ut_dulint_max;
-
- err = srv_read_init_val(initfile, NULL, NULL, &val1, TRUE);
- err = srv_read_init_val(initfile, NULL, NULL, &val2, TRUE);
-
- if (err == DB_SUCCESS) {
- srv_archive_recovery_limit_lsn =
- ut_dulint_create(val1, val2);
- }
- }
-
- /* err = srv_read_init_val(initfile,
- "SYNC_NUMBER_OF_SPIN_WAIT_ROUNDS", NULL,
- &srv_n_spin_wait_rounds);
-
- err = srv_read_init_val(initfile, "SYNC_SPIN_WAIT_DELAY", NULL,
- &srv_spin_wait_delay); */
- return(DB_SUCCESS);
-}
-
-/*************************************************************************
-Reads keywords and a values from an initfile. In case of an error, exits
-from the process. */
-
-void
-srv_read_initfile(
-/*==============*/
- FILE* initfile) /* in: file pointer */
-{
- char str_buf[10000];
- ulint ulint_val;
-
- srv_read_init_val(initfile, FALSE, "SRV_ENDPOINT_NAME", str_buf,
- &ulint_val);
- ut_a(ut_strlen(str_buf) < COM_MAX_ADDR_LEN);
-
- ut_memcpy(srv_endpoint_name, str_buf, COM_MAX_ADDR_LEN);
-
- srv_read_init_val(initfile, TRUE, "SRV_N_COM_THREADS", str_buf,
- &srv_n_com_threads);
-
- srv_read_init_val(initfile, TRUE, "SRV_N_WORKER_THREADS", str_buf,
- &srv_n_worker_threads);
-
- srv_read_init_val(initfile, TRUE, "SYNC_N_SPIN_WAIT_ROUNDS", str_buf,
- &srv_n_spin_wait_rounds);
-
- srv_read_init_val(initfile, TRUE, "SYNC_SPIN_WAIT_DELAY", str_buf,
- &srv_spin_wait_delay);
-
- srv_read_init_val(initfile, TRUE, "THREAD_PRIORITY_BOOST", str_buf,
- &srv_priority_boost);
-
- srv_read_init_val(initfile, TRUE, "N_SPACES", str_buf, &srv_n_spaces);
- srv_read_init_val(initfile, TRUE, "N_FILES", str_buf, &srv_n_files);
- srv_read_init_val(initfile, TRUE, "FILE_SIZE", str_buf,
- &srv_file_size);
-
- srv_read_init_val(initfile, TRUE, "N_LOG_GROUPS", str_buf,
- &srv_n_log_groups);
- srv_read_init_val(initfile, TRUE, "N_LOG_FILES", str_buf,
- &srv_n_log_files);
- srv_read_init_val(initfile, TRUE, "LOG_FILE_SIZE", str_buf,
- &srv_log_file_size);
- srv_read_init_val(initfile, TRUE, "LOG_ARCHIVE_ON", str_buf,
- &srv_log_archive_on);
- srv_read_init_val(initfile, TRUE, "LOG_BUFFER_SIZE", str_buf,
- &srv_log_buffer_size);
- srv_read_init_val(initfile, TRUE, "FLUSH_LOG_AT_TRX_COMMIT", str_buf,
- &srv_flush_log_at_trx_commit);
-
-
- srv_read_init_val(initfile, TRUE, "POOL_SIZE", str_buf,
- &srv_pool_size);
- srv_read_init_val(initfile, TRUE, "MEM_POOL_SIZE", str_buf,
- &srv_mem_pool_size);
- srv_read_init_val(initfile, TRUE, "LOCK_TABLE_SIZE", str_buf,
- &srv_lock_table_size);
-
- srv_read_init_val(initfile, TRUE, "SIM_DISK_WAIT_PCT", str_buf,
- &srv_sim_disk_wait_pct);
-
- srv_read_init_val(initfile, TRUE, "SIM_DISK_WAIT_LEN", str_buf,
- &srv_sim_disk_wait_len);
-
- srv_read_init_val(initfile, TRUE, "SIM_DISK_WAIT_BY_YIELD", str_buf,
- &srv_sim_disk_wait_by_yield);
-
- srv_read_init_val(initfile, TRUE, "SIM_DISK_WAIT_BY_WAIT", str_buf,
- &srv_sim_disk_wait_by_wait);
-
- srv_read_init_val(initfile, TRUE, "MEASURE_CONTENTION", str_buf,
- &srv_measure_contention);
-
- srv_read_init_val(initfile, TRUE, "MEASURE_BY_SPIN", str_buf,
- &srv_measure_by_spin);
-
-
- srv_read_init_val(initfile, TRUE, "PRINT_THREAD_RELEASES", str_buf,
- &srv_print_thread_releases);
-
- srv_read_init_val(initfile, TRUE, "PRINT_LOCK_WAITS", str_buf,
- &srv_print_lock_waits);
- if (srv_print_lock_waits) {
- lock_print_waits = TRUE;
- }
-
- srv_read_init_val(initfile, TRUE, "PRINT_BUF_IO", str_buf,
- &srv_print_buf_io);
- if (srv_print_buf_io) {
- buf_debug_prints = TRUE;
- }
-
- srv_read_init_val(initfile, TRUE, "PRINT_LOG_IO", str_buf,
- &srv_print_log_io);
- if (srv_print_log_io) {
- log_debug_writes = TRUE;
- }
-
- srv_read_init_val(initfile, TRUE, "PRINT_PARSED_SQL", str_buf,
- &srv_print_parsed_sql);
- if (srv_print_parsed_sql) {
- pars_print_lexed = TRUE;
- }
-
- srv_read_init_val(initfile, TRUE, "PRINT_LATCH_WAITS", str_buf,
- &srv_print_latch_waits);
-
- srv_read_init_val(initfile, TRUE, "TEST_EXTRA_MUTEXES", str_buf,
- &srv_test_extra_mutexes);
- srv_read_init_val(initfile, TRUE, "TEST_NOCACHE", str_buf,
- &srv_test_nocache);
- srv_read_init_val(initfile, TRUE, "TEST_CACHE_EVICT", str_buf,
- &srv_test_cache_evict);
-
- srv_read_init_val(initfile, TRUE, "TEST_SYNC", str_buf,
- &srv_test_sync);
- srv_read_init_val(initfile, TRUE, "TEST_N_THREADS", str_buf,
- &srv_test_n_threads);
- srv_read_init_val(initfile, TRUE, "TEST_N_LOOPS", str_buf,
- &srv_test_n_loops);
- srv_read_init_val(initfile, TRUE, "TEST_N_FREE_RNDS", str_buf,
- &srv_test_n_free_rnds);
- srv_read_init_val(initfile, TRUE, "TEST_N_RESERVED_RNDS", str_buf,
- &srv_test_n_reserved_rnds);
- srv_read_init_val(initfile, TRUE, "TEST_N_MUTEXES", str_buf,
- &srv_test_n_mutexes);
- srv_read_init_val(initfile, TRUE, "TEST_ARRAY_SIZE", str_buf,
- &srv_test_array_size);
-}
-#endif
-
/*************************************************************************
Initializes the server. */
-
+static
void
srv_init(void)
/*==========*/
@@ -2100,7 +1183,9 @@ srv_table_reserve_slot_for_mysql(void)
srv_slot_t* slot;
ulint i;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
i = 0;
slot = srv_mysql_table + i;
@@ -2130,7 +1215,7 @@ srv_table_reserve_slot_for_mysql(void)
(ulong) difftime(ut_time(), slot->suspend_time));
}
- ut_a(0);
+ ut_error;
}
slot = srv_mysql_table + i;
@@ -2165,7 +1250,9 @@ srv_suspend_mysql_thread(
ibool had_dict_lock = FALSE;
ibool was_declared_inside_innodb = FALSE;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
trx = thr_get_trx(thr);
@@ -2284,7 +1371,9 @@ srv_release_mysql_thread_if_suspended(
srv_slot_t* slot;
ulint i;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
for (i = 0; i < OS_THREAD_MAX_N; i++) {
@@ -2380,6 +1469,13 @@ srv_sprintf_innodb_monitor(
buf = buf + strlen(buf);
ut_a(buf < buf_end + 1500);
+ /* Conceptually, srv_innodb_monitor_mutex has a very high latching
+ order level in sync0sync.h, while dict_foreign_err_mutex has a very
+ low level 135. Therefore we can reserve the latter mutex here without
+ a danger of a deadlock of threads. */
+
+ mutex_enter(&dict_foreign_err_mutex);
+
if (*dict_foreign_err_buf != '\0') {
buf += sprintf(buf,
"------------------------\n"
@@ -2391,18 +1487,7 @@ srv_sprintf_innodb_monitor(
}
}
- ut_a(buf < buf_end + 1500);
-
- if (*dict_unique_err_buf != '\0') {
- buf += sprintf(buf,
-"---------------------------------------------------------------\n"
-"LATEST UNIQUE KEY ERROR (is masked in REPLACE or INSERT IGNORE)\n"
-"---------------------------------------------------------------\n");
-
- if (buf_end - buf > 6000) {
- buf+= sprintf(buf, "%.4000s", dict_unique_err_buf);
- }
- }
+ mutex_exit(&dict_foreign_err_mutex);
ut_a(buf < buf_end + 1500);
@@ -2448,7 +1533,7 @@ srv_sprintf_innodb_monitor(
"----------------------\n");
buf += sprintf(buf,
"Total memory allocated " ULINTPF
- "; in additional pool allocated" ULINTPF "\n",
+ "; in additional pool allocated " ULINTPF "\n",
ut_total_allocated_memory,
mem_pool_get_reserved(mem_comm_pool));
@@ -2486,13 +1571,13 @@ srv_sprintf_innodb_monitor(
#ifdef UNIV_LINUX
buf += sprintf(buf,
- "Main thread process no. %lu, id %lu, state: %s\n",
+ "Main thread process no. %lu, id %lu, state: %.29s\n",
(ulong) srv_main_thread_process_no,
(ulong) srv_main_thread_id,
srv_main_thread_op_info);
#else
buf += sprintf(buf,
- "Main thread id %lu, state: %s\n",
+ "Main thread id %lu, state: %.29s\n",
(ulong) srv_main_thread_id,
srv_main_thread_op_info);
#endif
@@ -2765,13 +1850,6 @@ loop:
srv_refresh_innodb_monitor_stats();
}
-/* mem_print_new_info();
-
- if (cnt % 10 == 0) {
-
- mem_print_info();
- }
-*/
sync_array_print_long_waits();
/* Flush stdout and stderr so that a database user gets their output
@@ -3244,12 +2322,6 @@ flush_loop:
goto background_loop;
}
-/* mem_print_new_info();
- */
-
-#ifdef UNIV_SEARCH_PERF_STAT
-/* btr_search_print_info(); */
-#endif
/* There is no work for background operations either: suspend
master thread to wait for more server activity */
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
index e6fdc95fad0..7b50877709b 100644
--- a/innobase/srv/srv0start.c
+++ b/innobase/srv/srv0start.c
@@ -40,7 +40,6 @@ Created 2/16/1996 Heikki Tuuri
#include "rem0rec.h"
#include "srv0srv.h"
#include "que0que.h"
-#include "com0com.h"
#include "usr0sess.h"
#include "lock0lock.h"
#include "trx0roll.h"
@@ -447,9 +446,9 @@ io_handler_thread(
}
#ifdef __WIN__
-#define SRV_PATH_SEPARATOR "\\"
+#define SRV_PATH_SEPARATOR '\\'
#else
-#define SRV_PATH_SEPARATOR "/"
+#define SRV_PATH_SEPARATOR '/'
#endif
/*************************************************************************
@@ -477,31 +476,26 @@ srv_normalize_path_for_win(
Adds a slash or a backslash to the end of a string if it is missing
and the string is not empty. */
+static
char*
srv_add_path_separator_if_needed(
/*=============================*/
- /* out, own: string which has the separator if the
+ /* out: string which has the separator if the
string is not empty */
char* str) /* in: null-terminated character string */
{
char* out_str;
+ ulint len = ut_strlen(str);
- if (ut_strlen(str) == 0) {
+ if (len == 0 || str[len - 1] == SRV_PATH_SEPARATOR) {
return(str);
}
- if (str[ut_strlen(str) - 1] == SRV_PATH_SEPARATOR[0]) {
- out_str = ut_malloc(ut_strlen(str) + 1);
-
- sprintf(out_str, "%s", str);
-
- return(out_str);
- }
-
- out_str = ut_malloc(ut_strlen(str) + 2);
-
- sprintf(out_str, "%s%s", str, SRV_PATH_SEPARATOR);
+ out_str = ut_malloc(len + 2);
+ memcpy(out_str, str, len);
+ out_str[len] = SRV_PATH_SEPARATOR;
+ out_str[len + 1] = 0;
return(out_str);
}
@@ -908,80 +902,6 @@ skip_size_check:
return(DB_SUCCESS);
}
-#ifdef notdefined
-/*********************************************************************
-This thread is used to measure contention of latches. */
-static
-ulint
-test_measure_cont(
-/*==============*/
- void* arg)
-{
- ulint i, j;
- ulint pcount, kcount, s_scount, s_xcount, s_mcount, lcount;
-
- UT_NOT_USED(arg);
-
- fprintf(stderr, "Starting contention measurement\n");
-
- for (i = 0; i < 1000; i++) {
-
- pcount = 0;
- kcount = 0;
- s_scount = 0;
- s_xcount = 0;
- s_mcount = 0;
- lcount = 0;
-
- for (j = 0; j < 100; j++) {
-
- if (srv_measure_by_spin) {
- ut_delay(ut_rnd_interval(0, 20000));
- } else {
- os_thread_sleep(20000);
- }
-
- if (kernel_mutex.lock_word) {
- kcount++;
- }
-
- if (buf_pool->mutex.lock_word) {
- pcount++;
- }
-
- if (log_sys->mutex.lock_word) {
- lcount++;
- }
-
- if (btr_search_latch.reader_count) {
- s_scount++;
- }
-
- if (btr_search_latch.writer != RW_LOCK_NOT_LOCKED) {
- s_xcount++;
- }
-
- if (btr_search_latch.mutex.lock_word) {
- s_mcount++;
- }
- }
-
- fprintf(stderr,
- "Mutex res. l %lu, p %lu, k %lu s x %lu s s %lu s mut %lu of %lu\n",
- lcount, pcount, kcount, s_xcount, s_scount, s_mcount, j);
-
-/* sync_print_wait_info(); */
-
- fprintf(stderr,
- "log i/o %lu n non sea %lu n succ %lu n h fail %lu\n",
- log_sys->n_log_ios, btr_cur_n_non_sea,
- btr_search_n_succ, btr_search_n_hash_fail);
- }
-
- return(0);
-}
-#endif
-
/********************************************************************
Starts InnoDB and creates a new database if database files
are not found and the user wants. Server parameters are
@@ -1379,8 +1299,6 @@ NetWare. */
mutex_exit(&(log_sys->mutex));
}
- sess_sys_init_at_db_start();
-
if (create_new_db) {
mtr_start(&mtr);
diff --git a/innobase/srv/ts/makefile b/innobase/srv/ts/makefile
deleted file mode 100644
index 0b743e37a20..00000000000
--- a/innobase/srv/ts/makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-include ..\..\makefile.i
-
-tssrv: ..\srv.lib tssrv.c makefile
- $(CCOM) $(CFL) -I.. -I..\.. ..\srv.lib ..\..\trx.lib ..\..\pars.lib ..\..\que.lib ..\..\lock.lib ..\..\row.lib ..\..\read.lib ..\..\com.lib ..\..\usr.lib ..\..\thr.lib ..\..\btr.lib ..\..\fut.lib ..\..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\buf.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tssrv.c $(LFL)
-
-
-
-
-
-
-
-
diff --git a/innobase/srv/ts/tsdbc.c b/innobase/srv/ts/tsdbc.c
deleted file mode 100644
index 83ba081959d..00000000000
--- a/innobase/srv/ts/tsdbc.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/************************************************************************
-Database client test program
-
-(c) 1995 Innobase Oy
-
-Created 10/10/1995 Heikki Tuuri
-*************************************************************************/
-
-#include "com0com.h"
-#include "com0shm.h"
-#include "ut0ut.h"
-#include "mem0mem.h"
-#include "os0thread.h"
-#include "sync0ipm.h"
-#include "sync0sync.h"
-
-byte buf[10000];
-char addr[150];
-
-void
-test1(void)
-/*=======*/
-{
- com_endpoint_t* ep;
- ulint ret;
- ulint size;
- ulint len;
- ulint addr_len;
- ulint i, j;
- ulint tm, oldtm;
-
-
- oldtm = ut_clock();
-
- for (i = 0; i < 10000; i++) {
-
- ut_delay(100);
- }
-
- for (j = 0; j < i / 10; j++) {
-
- ut_delay(200);
- }
-
- tm = ut_clock();
- printf("Wall clock time for test without server %ld milliseconds\n",
- tm - oldtm);
- printf("%lu rounds\n", i);
-
- ep = com_endpoint_create(COM_SHM);
-
- ut_a(ep);
-
- size = 8192;
-
- ret = com_endpoint_set_option(ep, COM_OPT_MAX_DGRAM_SIZE,
- (byte*)&size, 0);
-
- ut_a(ret == 0);
-
- ret = com_bind(ep, "CLI", 3);
-
- ut_a(ret == 0);
-
- printf("Client endpoint created!\n");
-
- oldtm = ut_clock();
-
- for (i = 0; i < 50000; i++) {
-
- ret = com_sendto(ep, (byte*)"Hello from client!\n", 18, "ibsrv", 5);
-
- ut_a(ret == 0);
-
- ret = com_recvfrom(ep, buf, 10000, &len, addr, 150, &addr_len);
-
- ut_a(ret == 0);
-
- buf[len] = '\0';
- addr[addr_len] = '\0';
-/*
- printf(
- "Message of len %lu\n%s \nreceived from address %s of len %lu\n",
- len, buf, addr, addr_len);
-*/
- }
-
-
- tm = ut_clock();
- printf("Wall clock time for test %ld milliseconds\n", tm - oldtm);
- printf("%lu message pairs\n", i);
-
-
- printf("System calls in com_shm %lu ip_mutex %lu mutex %lu\n",
- com_shm_system_call_count,
- ip_mutex_system_call_count,
- mutex_system_call_count);
-
-
- ret = com_endpoint_free(ep);
-
- ut_ad(ret == 0);
-}
-
-void
-main(void)
-/*======*/
-{
-
-
-
- sync_init();
- mem_init();
-
- test1();
-
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/srv/ts/tssrv.c b/innobase/srv/ts/tssrv.c
deleted file mode 100644
index 92b98c4554e..00000000000
--- a/innobase/srv/ts/tssrv.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/******************************************************
-Test for the database server
-
-(c) 1995 Innobase Oy
-
-Created 10/10/1995 Heikki Tuuri
-*******************************************************/
-
-#include "srv0srv.h"
-#include "os0proc.h"
-#include "ut0mem.h"
-
-
-/***************************************************************************
-The main function of the server. */
-
-void
-main(
-/*=*/
-#ifdef notdefined
-
- ulint argc, /* in: number of string arguments given on
- the command line */
- char* argv[]
-#endif
-) /* in: array of character pointers giving
- the arguments */
-{
-/*
- if (argc != 2) {
- printf("Error! Wrong number of command line arguments!\n");
- printf("Usage: ib <init-file-name>\n");
- os_process_exit(1);
- }
-*/
- srv_boot("init.ib"/*argv[1]*/);
-
- os_process_exit(0);
-}
diff --git a/innobase/sync/sync0arr.c b/innobase/sync/sync0arr.c
index 9bcee34a7d1..8082f598b0c 100644
--- a/innobase/sync/sync0arr.c
+++ b/innobase/sync/sync0arr.c
@@ -14,6 +14,7 @@ Created 9/5/1995 Heikki Tuuri
#include "sync0sync.h"
#include "sync0rw.h"
#include "os0sync.h"
+#include "os0file.h"
#include "srv0srv.h"
/*
@@ -99,6 +100,7 @@ struct sync_array_struct {
since creation of the array */
};
+#ifdef UNIV_SYNC_DEBUG
/**********************************************************************
This function is called only in the debug version. Detects a deadlock
of one or more threads because of waits of semaphores. */
@@ -112,6 +114,7 @@ sync_array_detect_deadlock(
sync_cell_t* start, /* in: cell where recursive search started */
sync_cell_t* cell, /* in: cell to search */
ulint depth); /* in: recursion depth */
+#endif /* UNIV_SYNC_DEBUG */
/*********************************************************************
Gets the nth cell in array. */
@@ -464,13 +467,17 @@ sync_array_cell_print(
mutex = cell->old_wait_mutex;
buf += sprintf(buf,
- "Mutex at %lx created file %s line %lu, lock var %lu\n",
- (ulong) mutex, mutex->cfile_name,
- (ulong) mutex->cline, (ulong) mutex->lock_word);
- buf += sprintf(buf,
- "Last time reserved in file %s line %lu, waiters flag %lu\n",
- mutex->file_name, (ulong) mutex->line,
- (ulong) mutex->waiters);
+ "Mutex at %p created file %s line %lu, lock var %lu\n"
+#ifdef UNIV_SYNC_DEBUG
+ "Last time reserved in file %s line %lu, "
+#endif /* UNIV_SYNC_DEBUG */
+ "waiters flag %lu\n",
+ mutex, mutex->cfile_name, (ulong) mutex->cline,
+ (ulong) mutex->lock_word,
+#ifdef UNIV_SYNC_DEBUG
+ mutex->file_name, (ulong) mutex->line,
+#endif /* UNIV_SYNC_DEBUG */
+ (ulong) mutex->waiters);
} else if (type == RW_LOCK_EX || type == RW_LOCK_SHARED) {
@@ -522,6 +529,7 @@ sync_array_cell_print(
}
}
+#ifdef UNIV_SYNC_DEBUG
/**********************************************************************
Looks for a cell with the given thread id. */
static
@@ -693,7 +701,6 @@ sync_array_detect_deadlock(
sync_array_cell_print(buf, cell);
printf("rw-lock %lx %s ", (ulong) lock, buf);
rw_lock_debug_print(debug);
-
return(TRUE);
}
}
@@ -743,6 +750,7 @@ sync_array_detect_deadlock(
return(TRUE); /* Execution never reaches this line: for compiler
fooling only */
}
+#endif /* UNIV_SYNC_DEBUG */
/**********************************************************************
Determines if we can wake up the thread waiting for a sempahore. */
@@ -936,7 +944,7 @@ sync_array_print_long_waits(void)
"InnoDB: We intentionally crash the server, because it appears to be hung.\n"
);
- ut_a(0);
+ ut_error;
}
}
@@ -945,6 +953,16 @@ sync_array_print_long_waits(void)
"InnoDB: ###### Starts InnoDB Monitor for 30 secs to print diagnostic info:\n");
old_val = srv_print_innodb_monitor;
+ /* If some crucial semaphore is reserved, then also the InnoDB
+ Monitor can hang, and we do not get diagnostics. Since in
+ many cases an InnoDB hang is caused by a pwrite() or a pread()
+ call hanging inside the operating system, let us print right
+ now the values of pending calls of these. */
+
+ fprintf(stderr,
+"InnoDB: Pending preads %lu, pwrites %lu\n", (ulong)os_file_n_pending_preads,
+ (ulong)os_file_n_pending_pwrites);
+
srv_print_innodb_monitor = TRUE;
os_event_set(srv_lock_timeout_thread_event);
diff --git a/innobase/sync/sync0rw.c b/innobase/sync/sync0rw.c
index f552af1d1f0..93fd9f14575 100644
--- a/innobase/sync/sync0rw.c
+++ b/innobase/sync/sync0rw.c
@@ -31,6 +31,7 @@ ulint rw_x_exit_count = 0;
rw_lock_list_t rw_lock_list;
mutex_t rw_lock_list_mutex;
+#ifdef UNIV_SYNC_DEBUG
/* The global mutex which protects debug info lists of all rw-locks.
To modify the debug info list of an rw-lock, this mutex has to be
acquired in addition to the mutex protecting the lock. */
@@ -76,6 +77,7 @@ rw_lock_debug_free(
{
mem_free(info);
}
+#endif /* UNIV_SYNC_DEBUG */
/**********************************************************************
Creates, or rather, initializes an rw-lock object in a specified memory
@@ -107,10 +109,12 @@ rw_lock_create_func(
lock->writer_is_wait_ex = FALSE;
+#ifdef UNIV_SYNC_DEBUG
UT_LIST_INIT(lock->debug_list);
- lock->magic_n = RW_LOCK_MAGIC_N;
lock->level = SYNC_LEVEL_NONE;
+#endif /* UNIV_SYNC_DEBUG */
+ lock->magic_n = RW_LOCK_MAGIC_N;
lock->cfile_name = cfile_name;
lock->cline = cline;
@@ -319,8 +323,9 @@ rw_lock_x_lock_low(
char* file_name,/* in: file name where lock requested */
ulint line) /* in: line where requested */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(rw_lock_get_mutex(lock)));
-
+#endif /* UNIV_SYNC_DEBUG */
if (rw_lock_get_writer(lock) == RW_LOCK_NOT_LOCKED) {
if (rw_lock_get_reader_count(lock) == 0) {
@@ -330,10 +335,10 @@ rw_lock_x_lock_low(
lock->writer_count++;
lock->pass = pass;
- #ifdef UNIV_SYNC_DEBUG
+#ifdef UNIV_SYNC_DEBUG
rw_lock_add_debug_info(lock, pass, RW_LOCK_EX,
file_name, line);
- #endif
+#endif
lock->last_x_file_name = file_name;
lock->last_x_line = line;
@@ -346,10 +351,10 @@ rw_lock_x_lock_low(
lock->pass = pass;
lock->writer_is_wait_ex = TRUE;
- #ifdef UNIV_SYNC_DEBUG
+#ifdef UNIV_SYNC_DEBUG
rw_lock_add_debug_info(lock, pass, RW_LOCK_WAIT_EX,
file_name, line);
- #endif
+#endif
return(RW_LOCK_WAIT_EX);
}
@@ -365,11 +370,11 @@ rw_lock_x_lock_low(
lock->pass = pass;
lock->writer_is_wait_ex = FALSE;
- #ifdef UNIV_SYNC_DEBUG
+#ifdef UNIV_SYNC_DEBUG
rw_lock_remove_debug_info(lock, pass, RW_LOCK_WAIT_EX);
rw_lock_add_debug_info(lock, pass, RW_LOCK_EX,
file_name, line);
- #endif
+#endif
lock->last_x_file_name = file_name;
lock->last_x_line = line;
@@ -388,10 +393,10 @@ rw_lock_x_lock_low(
lock->writer_count++;
- #ifdef UNIV_SYNC_DEBUG
+#ifdef UNIV_SYNC_DEBUG
rw_lock_add_debug_info(lock, pass, RW_LOCK_EX, file_name,
line);
- #endif
+#endif
lock->last_x_file_name = file_name;
lock->last_x_line = line;
@@ -528,6 +533,7 @@ lock_loop:
goto lock_loop;
}
+#ifdef UNIV_SYNC_DEBUG
/**********************************************************************
Acquires the debug mutex. We cannot use the mutex defined in sync0sync,
because the debug mutex is also acquired in sync0arr while holding the OS
@@ -653,6 +659,7 @@ rw_lock_remove_debug_info(
ut_error;
}
+#endif /* UNIV_SYNC_DEBUG */
/**********************************************************************
Sets the rw-lock latching level field. */
@@ -666,6 +673,7 @@ rw_lock_set_level(
lock->level = level;
}
+#ifdef UNIV_SYNC_DEBUG
/**********************************************************************
Checks if the thread has locked the rw-lock in the specified mode, with
the pass value == 0. */
@@ -683,9 +691,6 @@ rw_lock_own(
ut_ad(lock);
ut_ad(rw_lock_validate(lock));
-#ifndef UNIV_SYNC_DEBUG
- ut_error;
-#endif
mutex_enter(&(lock->mutex));
info = UT_LIST_GET_FIRST(lock->debug_list);
@@ -708,6 +713,7 @@ rw_lock_own(
return(FALSE);
}
+#endif /* UNIV_SYNC_DEBUG */
/**********************************************************************
Checks if somebody has locked the rw-lock in the specified mode. */
@@ -744,6 +750,7 @@ rw_lock_is_locked(
return(ret);
}
+#ifdef UNIV_SYNC_DEBUG
/*******************************************************************
Prints debug info of currently locked rw-locks. */
@@ -751,8 +758,6 @@ void
rw_lock_list_print_info(void)
/*=========================*/
{
-#ifndef UNIV_SYNC_DEBUG
-#else
rw_lock_t* lock;
ulint count = 0;
rw_lock_debug_t* info;
@@ -796,7 +801,6 @@ rw_lock_list_print_info(void)
printf("Total number of rw-locks %ld\n", count);
mutex_exit(&rw_lock_list_mutex);
-#endif
}
/*******************************************************************
@@ -807,11 +811,6 @@ rw_lock_print(
/*==========*/
rw_lock_t* lock __attribute__((unused))) /* in: rw-lock */
{
-#ifndef UNIV_SYNC_DEBUG
- printf(
- "Sorry, cannot give rw-lock info in non-debug version!\n");
-#else
- ulint count = 0;
rw_lock_debug_t* info;
printf("-------------\n");
@@ -834,7 +833,6 @@ rw_lock_print(
info = UT_LIST_GET_NEXT(list, info);
}
}
-#endif
}
/*************************************************************************
@@ -875,12 +873,6 @@ ulint
rw_lock_n_locked(void)
/*==================*/
{
-#ifndef UNIV_SYNC_DEBUG
- printf(
- "Sorry, cannot give rw-lock info in non-debug version!\n");
- ut_error;
- return(0);
-#else
rw_lock_t* lock;
ulint count = 0;
@@ -903,5 +895,5 @@ rw_lock_n_locked(void)
mutex_exit(&rw_lock_list_mutex);
return(count);
-#endif
}
+#endif /* UNIV_SYNC_DEBUG */
diff --git a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c
index 424f5b1b35a..64f76f5ee77 100644
--- a/innobase/sync/sync0sync.c
+++ b/innobase/sync/sync0sync.c
@@ -159,7 +159,7 @@ struct sync_thread_struct{
};
/* Number of slots reserved for each OS thread in the sync level array */
-#define SYNC_THREAD_N_LEVELS 7000
+#define SYNC_THREAD_N_LEVELS 10000
struct sync_level_struct{
void* latch; /* pointer to a mutex or an rw-lock; NULL means that
@@ -167,46 +167,6 @@ struct sync_level_struct{
ulint level; /* level of the latch in the latching order */
};
-
-#if defined(notdefined) && defined(__GNUC__) && defined(UNIV_INTEL_X86)
-
-ulint
-sync_gnuc_intelx86_test_and_set(
- /* out: old value of the lock word */
- ulint* lw) /* in: pointer to the lock word */
-{
- ulint res;
-
- /* In assembly we use the so-called AT & T syntax where
- the order of operands is inverted compared to the ordinary Intel
- syntax. The 'l' after the mnemonics denotes a 32-bit operation.
- The line after the code tells which values come out of the asm
- code, and the second line tells the input to the asm code. */
-
- asm volatile("movl $1, %%eax; xchgl (%%ecx), %%eax" :
- "=eax" (res), "=m" (*lw) :
- "ecx" (lw));
- return(res);
-}
-
-void
-sync_gnuc_intelx86_reset(
- ulint* lw) /* in: pointer to the lock word */
-{
- /* In assembly we use the so-called AT & T syntax where
- the order of operands is inverted compared to the ordinary Intel
- syntax. The 'l' after the mnemonics denotes a 32-bit operation. */
-
- asm volatile("movl $0, %%eax; xchgl (%%ecx), %%eax" :
- "=m" (*lw) :
- "ecx" (lw) :
- "eax"); /* gcc does not seem to understand
- that our asm code resets eax: tell it
- explicitly that after the third ':' */
-}
-
-#endif
-
/**********************************************************************
Creates, or rather, initializes a mutex object in a specified memory
location (which must be appropriately aligned). The mutex is initialized
@@ -220,7 +180,7 @@ mutex_create_func(
char* cfile_name, /* in: file name where created */
ulint cline) /* in: file line where created */
{
-#if defined(_WIN32) && defined(UNIV_CAN_USE_X86_ASSEMBLER) && !defined(__NETWARE)
+#if defined(_WIN32) && defined(UNIV_CAN_USE_X86_ASSEMBLER)
mutex_reset_lock_word(mutex);
#else
os_fast_mutex_init(&(mutex->os_fast_mutex));
@@ -228,8 +188,10 @@ mutex_create_func(
#endif
mutex_set_waiters(mutex, 0);
mutex->magic_n = MUTEX_MAGIC_N;
+#ifdef UNIV_SYNC_DEBUG
mutex->line = 0;
mutex->file_name = (char *) "not yet reserved";
+#endif /* UNIV_SYNC_DEBUG */
mutex->level = SYNC_LEVEL_NONE;
mutex->cfile_name = cfile_name;
mutex->cline = cline;
@@ -306,20 +268,19 @@ mutex_enter_nowait(
/*===============*/
/* out: 0 if succeed, 1 if not */
mutex_t* mutex, /* in: pointer to mutex */
- char* file_name, /* in: file name where mutex
+ char* file_name __attribute__((unused)),
+ /* in: file name where mutex
requested */
- ulint line) /* in: line where requested */
+ ulint line __attribute__((unused)))
+ /* in: line where requested */
{
ut_ad(mutex_validate(mutex));
if (!mutex_test_and_set(mutex)) {
- #ifdef UNIV_SYNC_DEBUG
+#ifdef UNIV_SYNC_DEBUG
mutex_set_debug_info(mutex, file_name, line);
- #endif
-
- mutex->file_name = file_name;
- mutex->line = line;
+#endif
return(0); /* Succeeded! */
}
@@ -415,12 +376,9 @@ spin_loop:
if (mutex_test_and_set(mutex) == 0) {
/* Succeeded! */
- #ifdef UNIV_SYNC_DEBUG
+#ifdef UNIV_SYNC_DEBUG
mutex_set_debug_info(mutex, file_name, line);
- #endif
-
- mutex->file_name = file_name;
- mutex->line = line;
+#endif
return;
}
@@ -462,12 +420,9 @@ spin_loop:
sync_array_free_cell(sync_primary_wait_array, index);
- #ifdef UNIV_SYNC_DEBUG
+#ifdef UNIV_SYNC_DEBUG
mutex_set_debug_info(mutex, file_name, line);
- #endif
-
- mutex->file_name = file_name;
- mutex->line = line;
+#endif
if (srv_print_latch_waits) {
printf(
@@ -519,6 +474,7 @@ mutex_signal_object(
sync_array_signal_object(sync_primary_wait_array, mutex);
}
+#ifdef UNIV_SYNC_DEBUG
/**********************************************************************
Sets the debug information for a reserved mutex. */
@@ -556,7 +512,8 @@ mutex_get_debug_info(
*file_name = mutex->file_name;
*line = mutex->line;
*thread_id = mutex->thread_id;
-}
+}
+#endif /* UNIV_SYNC_DEBUG */
/**********************************************************************
Sets the mutex latching level field. */
@@ -570,6 +527,7 @@ mutex_set_level(
mutex->level = level;
}
+#ifdef UNIV_SYNC_DEBUG
/**********************************************************************
Checks that the current thread owns the mutex. Works only in the debug
version. */
@@ -602,8 +560,6 @@ void
mutex_list_print_info(void)
/*=======================*/
{
-#ifndef UNIV_SYNC_DEBUG
-#else
mutex_t* mutex;
char* file_name;
ulint line;
@@ -636,7 +592,6 @@ mutex_list_print_info(void)
printf("Total number of mutexes %ld\n", count);
mutex_exit(&mutex_list_mutex);
-#endif
}
/**********************************************************************
@@ -646,12 +601,6 @@ ulint
mutex_n_reserved(void)
/*==================*/
{
-#ifndef UNIV_SYNC_DEBUG
- printf("Sorry, cannot give mutex info in non-debug version!\n");
- ut_error;
-
- return(0);
-#else
mutex_t* mutex;
ulint count = 0;
@@ -674,7 +623,6 @@ mutex_n_reserved(void)
return(count - 1); /* Subtract one, because this function itself
was holding one mutex (mutex_list_mutex) */
-#endif
}
/**********************************************************************
@@ -685,19 +633,9 @@ ibool
sync_all_freed(void)
/*================*/
{
- #ifdef UNIV_SYNC_DEBUG
- if (mutex_n_reserved() + rw_lock_n_locked() == 0) {
-
- return(TRUE);
- } else {
- return(FALSE);
- }
- #else
- ut_error;
-
- return(FALSE);
- #endif
+ return(mutex_n_reserved() + rw_lock_n_locked() == 0);
}
+#endif /* UNIV_SYNC_DEBUG */
/**********************************************************************
Gets the value in the nth slot in the thread level arrays. */
@@ -794,9 +732,6 @@ sync_thread_levels_g(
thread */
ulint limit) /* in: level limit */
{
- char* file_name;
- ulint line;
- os_thread_id_t thread_id;
sync_level_t* slot;
rw_lock_t* lock;
mutex_t* mutex;
@@ -821,18 +756,28 @@ sync_thread_levels_g(
(ulong) mutex->cline);
if (mutex_get_lock_word(mutex) != 0) {
+#ifdef UNIV_SYNC_DEBUG
+ char* file_name;
+ ulint line;
+ os_thread_id_t thread_id;
mutex_get_debug_info(mutex,
&file_name, &line, &thread_id);
- printf("InnoDB: Locked mutex: addr %lx thread %ld file %s line %ld\n",
- (ulong) mutex, (ulong) os_thread_pf(thread_id),
- file_name, (ulong) line);
+ fprintf(stderr,
+ "InnoDB: Locked mutex: addr %p thread %ld file %s line %ld\n",
+ mutex, os_thread_pf(thread_id), file_name, (ulong) line);
+#else /* UNIV_SYNC_DEBUG */
+ fprintf(stderr,
+ "InnoDB: Locked mutex: addr %p\n", mutex);
+#endif /* UNIV_SYNC_DEBUG */
} else {
- printf("Not locked\n");
+ fputs("Not locked\n", stderr);
}
} else {
+#ifdef UNIV_SYNC_DEBUG
rw_lock_print(lock);
+#endif /* UNIV_SYNC_DEBUG */
}
return(FALSE);
@@ -972,7 +917,9 @@ sync_thread_add_level(
if ((latch == (void*)&sync_thread_mutex)
|| (latch == (void*)&mutex_list_mutex)
+#ifdef UNIV_SYNC_DEBUG
|| (latch == (void*)&rw_lock_debug_mutex)
+#endif /* UNIV_SYNC_DEBUG */
|| (latch == (void*)&rw_lock_list_mutex)) {
return;
@@ -1152,7 +1099,9 @@ sync_thread_reset_level(
if ((latch == (void*)&sync_thread_mutex)
|| (latch == (void*)&mutex_list_mutex)
+#ifdef UNIV_SYNC_DEBUG
|| (latch == (void*)&rw_lock_debug_mutex)
+#endif /* UNIV_SYNC_DEBUG */
|| (latch == (void*)&rw_lock_list_mutex)) {
return(FALSE);
@@ -1238,11 +1187,13 @@ sync_init(void)
mutex_create(&rw_lock_list_mutex);
mutex_set_level(&rw_lock_list_mutex, SYNC_NO_ORDER_CHECK);
+#ifdef UNIV_SYNC_DEBUG
mutex_create(&rw_lock_debug_mutex);
mutex_set_level(&rw_lock_debug_mutex, SYNC_NO_ORDER_CHECK);
rw_lock_debug_event = os_event_create(NULL);
rw_lock_debug_waiters = FALSE;
+#endif /* UNIV_SYNC_DEBUG */
}
/**********************************************************************
@@ -1307,9 +1258,11 @@ sync_print(
char* buf, /* in/out: buffer where to print */
char* buf_end) /* in: buffer end */
{
+#ifdef UNIV_SYNC_DEBUG
mutex_list_print_info();
rw_lock_list_print_info();
+#endif /* UNIV_SYNC_DEBUG */
sync_array_print_info(buf, buf_end, sync_primary_wait_array);
diff --git a/innobase/sync/ts/makefile b/innobase/sync/ts/makefile
deleted file mode 100644
index 95011f51466..00000000000
--- a/innobase/sync/ts/makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-include ..\..\makefile.i
-
-tssync: ..\sync.lib tssync.c makefile
- $(CCOM) $(CFL) -I.. -I..\.. ..\sync.lib ..\..\mach.lib ..\..\ut.lib ..\..\mem.lib ..\..\os.lib tssync.c $(LFL)
-
-
-
-
-
-
-
diff --git a/innobase/sync/ts/tssync.c b/innobase/sync/ts/tssync.c
deleted file mode 100644
index bf30a603284..00000000000
--- a/innobase/sync/ts/tssync.c
+++ /dev/null
@@ -1,1366 +0,0 @@
-/************************************************************************
-The test module for the syncronization primitives
-
-(c) 1995 Innobase Oy
-
-Created 9/9/1995 Heikki Tuuri
-*************************************************************************/
-
-
-#include "../sync0sync.h"
-#include "../sync0rw.h"
-#include "../sync0arr.h"
-#include "../sync0ipm.h"
-#include "ut0ut.h"
-#include "mem0mem.h"
-#include "os0sync.h"
-#include "os0thread.h"
-#include "os0sync.h"
-
-mutex_t mutex;
-mutex_t mutex1;
-mutex_t mutex2;
-mutex_t mutex3;
-mutex_t mutex4;
-
-ip_mutex_t ip_mutex;
-
-ip_mutex_t ip_mutex1;
-ip_mutex_t ip_mutex2;
-ip_mutex_t ip_mutex3;
-ip_mutex_t ip_mutex4;
-
-ip_mutex_hdl_t* iph;
-
-ip_mutex_hdl_t* iph1;
-ip_mutex_hdl_t* iph2;
-ip_mutex_hdl_t* iph3;
-ip_mutex_hdl_t* iph4;
-
-
-rw_lock_t rw1;
-rw_lock_t rw2;
-rw_lock_t rw3;
-rw_lock_t rw4;
-
-rw_lock_t rw9;
-rw_lock_t rw10;
-mutex_t mutex9;
-
-os_mutex_t osm;
-
-ulint last_thr;
-ulint switch_count;
-ulint glob_count;
-ulint glob_inc;
-ulint rc;
-
-bool qprint = FALSE;
-
-/********************************************************************
-Start function for thread 1 in test1. */
-ulint
-thread1(void* arg)
-/*==============*/
-{
- ulint i, j;
- void* arg2;
-
- arg2 = arg;
-
- printf("Thread1 started!\n");
-
- mutex_enter(&mutex);
-
- printf("Thread1 owns now the mutex!\n");
-
- j = 0;
-
- for (i = 1; i < 1000000; i++) {
- j += i;
- }
-
- printf("Thread1 releases now the mutex!\n");
-
- mutex_exit(&mutex);
-
- return(j);
-}
-
-/********************************************************************
-Start function for thread 2 in test1. */
-ulint
-thread2(void* arg)
-/*==============*/
-{
- ulint i, j;
- void* arg2;
-
- arg2 = arg;
-
- printf("Thread2 started!\n");
-
- mutex_enter(&mutex);
-
- printf("Thread2 owns now the mutex!\n");
-
- j = 0;
-
- for (i = 1; i < 1000000; i++) {
- j += i;
- }
-
- printf("Thread2 releases now the mutex!\n");
-
- mutex_exit(&mutex);
-
- return(j);
-}
-
-/********************************************************************
-Start function for the competing threads in test2. The function tests
-the behavior lock-coupling through 4 mutexes. */
-
-ulint
-thread_n(volatile void* arg)
-/*========================*/
-{
- ulint i, j, k, n;
-
- n = *((ulint*)arg);
-
- printf("Thread %ld started!\n", n);
-
- for (k = 0; k < 2000 * UNIV_DBC; k++) {
-
- mutex_enter(&mutex1);
-
- if (last_thr != n) {
- switch_count++;
- last_thr = n;
- }
-
- j = 0;
-
- for (i = 1; i < 400; i++) {
- j += i;
- }
-
- mutex_enter(&mutex2);
-
- mutex_exit(&mutex1);
-
- for (i = 1; i < 400; i++) {
- j += i;
- }
- mutex_enter(&mutex3);
-
- mutex_exit(&mutex2);
-
- for (i = 1; i < 400; i++) {
- j += i;
- }
- mutex_enter(&mutex4);
-
- mutex_exit(&mutex3);
-
- for (i = 1; i < 400; i++) {
- j += i;
- }
-
- mutex_exit(&mutex4);
- }
-
- printf("Thread %ld exits!\n", n);
-
- return(j);
-}
-
-/********************************************************************
-Start function for mutex exclusion checking in test3. */
-
-ulint
-thread_x(void* arg)
-/*===============*/
-{
- ulint k;
- void* arg2;
-
- arg2 = arg;
-
- printf("Starting thread!\n");
-
- for (k = 0; k < 200000 * UNIV_DBC; k++) {
-
- mutex_enter(&mutex);
-
- glob_count += glob_inc;
-
- mutex_exit(&mutex);
-
- }
-
- printf("Exiting thread!\n");
-
- return(0);
-}
-
-
-
-void
-test1(void)
-/*=======*/
-{
- os_thread_t thr1, thr2;
- os_thread_id_t id1, id2;
- ulint i, j;
- ulint tm, oldtm;
- ulint* lp;
-
- printf("-------------------------------------------\n");
- printf("SYNC-TEST 1. Test of mutexes.\n");
-
-
- printf("Main thread %ld starts!\n",
- os_thread_get_curr_id());
-
- osm = os_mutex_create(NULL);
-
- os_mutex_enter(osm);
- os_mutex_exit(osm);
-
- os_mutex_free(osm);
-
-
- mutex_create(&mutex);
-
- lp = &j;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1000000; i++) {
- id1 = os_thread_get_curr_id();
- }
-
- tm = ut_clock();
- printf("Wall clock time for %ld thread_get_id %ld milliseconds\n",
- i, tm - oldtm);
-
-
- oldtm = ut_clock();
-
- for (i = 0; i < 100000 * UNIV_DBC; i++) {
-
- mutex_enter(&mutex);
- mutex_exit(&mutex);
- }
-
- tm = ut_clock();
- printf("Wall clock time for %ld mutex lock-unlock %ld milliseconds\n",
- i, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1000000; i++) {
-
- mutex_fence();
- }
-
- tm = ut_clock();
- printf("Wall clock time for %ld fences %ld milliseconds\n",
- i, tm - oldtm);
-
- mutex_enter(&mutex);
-
- mutex_list_print_info();
-
- ut_ad(1 == mutex_n_reserved());
- ut_ad(FALSE == sync_all_freed());
-
- thr1 = os_thread_create(thread1,
- NULL,
- &id1);
-
- printf("Thread1 created, id %ld \n", id1);
-
- thr2 = os_thread_create(thread2,
- NULL,
- &id2);
-
- printf("Thread2 created, id %ld \n", id2);
-
-
- j = 0;
-
- for (i = 1; i < 20000000; i++) {
- j += i;
- }
-
- sync_print();
-
- sync_array_validate(sync_primary_wait_array);
-
- printf("Main thread releases now mutex!\n");
-
- mutex_exit(&mutex);
-
- os_thread_wait(thr2);
-
- os_thread_wait(thr1);
-}
-
-/******************************************************************
-Test function for possible convoy problem. */
-
-void
-test2(void)
-/*=======*/
-{
- os_thread_t thr1, thr2, thr3, thr4, thr5;
- os_thread_id_t id1, id2, id3, id4, id5;
- ulint tm, oldtm;
- ulint n1, n2, n3, n4, n5;
-
- printf("-------------------------------------------\n");
- printf("SYNC-TEST 2. Test of possible convoy problem.\n");
-
- printf("System call count %lu\n", mutex_system_call_count);
-
- mutex_create(&mutex1);
- mutex_create(&mutex2);
- mutex_create(&mutex3);
- mutex_create(&mutex4);
-
- switch_count = 0;
-
- oldtm = ut_clock();
-
- n1 = 1;
-
- thr1 = os_thread_create(thread_n,
- &n1,
- &id1);
-
- os_thread_wait(thr1);
-
-
- tm = ut_clock();
- printf("Wall clock time for single thread %ld milliseconds\n",
- tm - oldtm);
- printf("System call count %lu\n", mutex_system_call_count);
-
- switch_count = 0;
-
- oldtm = ut_clock();
-
- n1 = 1;
- thr1 = os_thread_create(thread_n,
- &n1,
- &id1);
- n2 = 2;
- thr2 = os_thread_create(thread_n,
- &n2,
- &id2);
- n3 = 3;
- thr3 = os_thread_create(thread_n,
- &n3,
- &id3);
- n4 = 4;
- thr4 = os_thread_create(thread_n,
- &n4,
- &id4);
- n5 = 5;
- thr5 = os_thread_create(thread_n,
- &n5,
- &id5);
-
-
- os_thread_wait(thr1);
- os_thread_wait(thr2);
- os_thread_wait(thr3);
- os_thread_wait(thr4);
- os_thread_wait(thr5);
-
-
- tm = ut_clock();
- printf("Wall clock time for 5 threads %ld milliseconds\n",
- tm - oldtm);
- printf("%ld thread switches occurred\n", switch_count);
-
- printf("If this is not 5 x single thread time, possibly convoy!\n");
-
- printf("System call count %lu\n", mutex_system_call_count);
-}
-
-/******************************************************************
-Test function for possible exclusion failure. */
-
-void
-test3(void)
-/*=======*/
-{
- os_thread_t thr1, thr2;
- os_thread_id_t id1, id2;
-
- printf("-------------------------------------------\n");
- printf("SYNC-TEST 3. Test of possible exclusion failure.\n");
-
- glob_count = 0;
- glob_inc = 1;
-
- thr1 = os_thread_create(thread_x,
- NULL,
- &id1);
- thr2 = os_thread_create(thread_x,
- NULL,
- &id2);
-
- os_thread_wait(thr2);
- os_thread_wait(thr1);
-
- ut_a(glob_count == 400000 * UNIV_DBC);
-}
-
-/******************************************************************
-Test function for measuring the spin wait loop cycle time. */
-
-void
-test4(void)
-/*=======*/
-{
-volatile ulint* ptr;
- ulint i, tm, oldtm;
-
- printf("-------------------------------------------\n");
- printf("SYNC-TEST 4. Test of spin wait loop cycle time.\n");
- printf("Use this time to set the SYNC_SPIN_ROUNDS constant.\n");
-
-
- glob_inc = 1;
-
- ptr = &glob_inc;
-
- oldtm = ut_clock();
-
- i = 0;
-
- while ((*ptr != 0) && (i < 10000000)) {
- i++;
- }
-
- tm = ut_clock();
- printf("Wall clock time for %ld cycles %ld milliseconds\n",
- i, tm - oldtm);
-}
-
-/********************************************************************
-Start function for s-lock thread in test5. */
-ulint
-thread_srw(void* arg)
-/*==============*/
-{
- ulint i, j;
- void* arg2;
-
- arg2 = arg;
-
- printf("Thread_srw started!\n");
-
- rw_lock_s_lock(&rw1);
-
- printf("Thread_srw has now s-lock!\n");
-
- j = 0;
-
- for (i = 1; i < 1000000; i++) {
- j += i;
- }
-
- printf("Thread_srw releases now the s-lock!\n");
-
- rw_lock_s_unlock(&rw1);
-
- return(j);
-}
-
-/********************************************************************
-Start function for x-lock thread in test5. */
-ulint
-thread_xrw(void* arg)
-/*==============*/
-{
- ulint i, j;
- void* arg2;
-
- arg2 = arg;
-
- printf("Thread_xrw started!\n");
-
- rw_lock_x_lock(&rw1);
-
- printf("Thread_xrw has now x-lock!\n");
-
- j = 0;
-
- for (i = 1; i < 1000000; i++) {
- j += i;
- }
-
- printf("Thread_xrw releases now the x-lock!\n");
-
- rw_lock_x_unlock(&rw1);
-
- return(j);
-}
-
-
-void
-test5(void)
-/*=======*/
-{
- os_thread_t thr1, thr2;
- os_thread_id_t id1, id2;
- ulint i, j;
- ulint tm, oldtm;
-
- printf("-------------------------------------------\n");
- printf("SYNC-TEST 5. Test of read-write locks.\n");
-
-
- printf("Main thread %ld starts!\n",
- os_thread_get_curr_id());
-
-
- rw_lock_create(&rw1);
-
- oldtm = ut_clock();
-
-
- for (i = 0; i < 10000 * UNIV_DBC * UNIV_DBC; i++) {
-
- rw_lock_s_lock(&rw1);
-
- rw_lock_s_unlock(&rw1);
-
- }
-
- tm = ut_clock();
- printf("Wall clock time for %ld rw s-lock-unlock %ld milliseconds\n",
- i, tm - oldtm);
-
-
- oldtm = ut_clock();
-
-
- for (i = 0; i < 10000 * UNIV_DBC * UNIV_DBC; i++) {
-
- mutex_enter(&mutex);
- rc++;
- mutex_exit(&mutex);
-
- mutex_enter(&mutex);
- rc--;
- mutex_exit(&mutex);
- }
-
- tm = ut_clock();
- printf("Wall clock time for %ld rw test %ld milliseconds\n",
- i, tm - oldtm);
-
-
-
- oldtm = ut_clock();
-
- for (i = 0; i < 10000 * UNIV_DBC * UNIV_DBC; i++) {
-
- rw_lock_x_lock(&rw1);
- rw_lock_x_unlock(&rw1);
-
- }
-
- tm = ut_clock();
- printf("Wall clock time for %ld rw x-lock-unlock %ld milliseconds\n",
- i, tm - oldtm);
-
-
- /* Test recursive x-locking */
- for (i = 0; i < 10000; i++) {
- rw_lock_x_lock(&rw1);
- }
-
- for (i = 0; i < 10000; i++) {
-
- rw_lock_x_unlock(&rw1);
- }
-
- /* Test recursive s-locking */
- for (i = 0; i < 10000; i++) {
-
- rw_lock_s_lock(&rw1);
- }
-
- for (i = 0; i < 10000; i++) {
-
- rw_lock_s_unlock(&rw1);
- }
-
- rw_lock_s_lock(&rw1);
-
- ut_ad(1 == rw_lock_n_locked());
-
- mem_print_info();
-
- rw_lock_list_print_info();
-
- thr2 = os_thread_create(thread_xrw,
- NULL,
- &id2);
-
- printf("Thread_xrw created, id %ld \n", id2);
-
-
- thr1 = os_thread_create(thread_srw,
- NULL,
- &id1);
-
- printf("Thread_srw created, id %ld \n", id1);
-
- j = 0;
-
- for (i = 1; i < 10000000; i++) {
- j += i;
- }
-
- rw_lock_list_print_info();
-
- sync_array_validate(sync_primary_wait_array);
-
- printf("Main thread releases now rw-lock!\n");
-
- rw_lock_s_unlock(&rw1);
-
- os_thread_wait(thr2);
-
- os_thread_wait(thr1);
-
- sync_array_print_info(sync_primary_wait_array);
-}
-
-/********************************************************************
-Start function for the competing s-threads in test6. The function tests
-the behavior lock-coupling through 4 rw-locks. */
-
-ulint
-thread_qs(volatile void* arg)
-/*========================*/
-{
- ulint i, j, k, n;
-
- arg = arg;
-
- n = os_thread_get_curr_id();
-
- printf("S-Thread %ld started, thread id %lu\n", n,
- os_thread_get_curr_id());
-
- for (k = 0; k < 1000 * UNIV_DBC; k++) {
-
- if (qprint)
- printf("S-Thread %ld starts round %ld!\n", n, k);
-
- rw_lock_s_lock(&rw1);
-
- if (qprint)
- printf("S-Thread %ld got lock 1 on round %ld!\n", n, k);
-
-
- if (last_thr != n) {
- switch_count++;
- last_thr = n;
- }
-
- j = 0;
-
- for (i = 1; i < 400; i++) {
- j += i;
- }
-
- rw_lock_s_lock(&rw2);
-
- if (qprint)
- printf("S-Thread %ld got lock 2 on round %ld!\n", n, k);
-
-
- rw_lock_s_unlock(&rw1);
-
- if (qprint)
- printf("S-Thread %ld released lock 1 on round %ld!\n", n, k);
-
-
- for (i = 1; i < 400; i++) {
- j += i;
- }
- rw_lock_s_lock(&rw3);
-
- if (qprint)
- printf("S-Thread %ld got lock 3 on round %ld!\n", n, k);
-
-
- rw_lock_s_unlock(&rw2);
- if (qprint)
- printf("S-Thread %ld released lock 2 on round %ld!\n", n, k);
-
-
- for (i = 1; i < 400; i++) {
- j += i;
- }
- rw_lock_s_lock(&rw4);
-
- if (qprint)
- printf("S-Thread %ld got lock 4 on round %ld!\n", n, k);
-
-
- rw_lock_s_unlock(&rw3);
- if (qprint)
- printf("S-Thread %ld released lock 3 on round %ld!\n", n, k);
-
-
- for (i = 1; i < 400; i++) {
- j += i;
- }
-
- rw_lock_s_unlock(&rw4);
- if (qprint)
- printf("S-Thread %ld released lock 4 on round %ld!\n", n, k);
-
- }
-
- printf("S-Thread %ld exits!\n", n);
-
- return(j);
-}
-
-/********************************************************************
-Start function for the competing x-threads in test6. The function tests
-the behavior lock-coupling through 4 rw-locks. */
-
-ulint
-thread_qx(volatile void* arg)
-/*========================*/
-{
- ulint i, j, k, n;
-
- arg = arg;
-
- n = os_thread_get_curr_id();
-
- printf("X-Thread %ld started, thread id %lu\n", n,
- os_thread_get_curr_id());
-
- for (k = 0; k < 1000 * UNIV_DBC; k++) {
-
- if (qprint)
- printf("X-Thread %ld round %ld!\n", n, k);
-
-
- rw_lock_x_lock(&rw1);
- if (qprint)
- printf("X-Thread %ld got lock 1 on round %ld!\n", n, k);
-
-
- if (last_thr != n) {
- switch_count++;
- last_thr = n;
- }
-
- j = 0;
-
- for (i = 1; i < 400; i++) {
- j += i;
- }
-
- rw_lock_x_lock(&rw2);
- if (qprint)
- printf("X-Thread %ld got lock 2 on round %ld!\n", n, k);
-
-
- rw_lock_x_unlock(&rw1);
- if (qprint)
- printf("X-Thread %ld released lock 1 on round %ld!\n", n, k);
-
-
- for (i = 1; i < 400; i++) {
- j += i;
- }
- rw_lock_x_lock(&rw3);
- if (qprint)
- printf("X-Thread %ld got lock 3 on round %ld!\n", n, k);
-
-
- rw_lock_x_unlock(&rw2);
- if (qprint)
- printf("X-Thread %ld released lock 2 on round %ld!\n", n, k);
-
-
- for (i = 1; i < 400; i++) {
- j += i;
- }
- rw_lock_x_lock(&rw4);
- if (qprint)
- printf("X-Thread %ld got lock 4 on round %ld!\n", n, k);
-
- rw_lock_x_unlock(&rw3);
- if (qprint)
- printf("X-Thread %ld released lock 3 on round %ld!\n", n, k);
-
-
- for (i = 1; i < 400; i++) {
- j += i;
- }
-
- rw_lock_x_unlock(&rw4);
- if (qprint)
- printf("X-Thread %ld released lock 4 on round %ld!\n", n, k);
-
- }
-
- printf("X-Thread %ld exits!\n", n);
-
- return(j);
-}
-
-/******************************************************************
-Test function for possible queuing problems with rw-locks. */
-
-void
-test6(void)
-/*=======*/
-{
- os_thread_t thr1, thr2, thr3, thr4, thr5;
- os_thread_id_t id1, id2, id3, id4, id5;
- ulint tm, oldtm;
- ulint n1, n2, n3, n4, n5;
-
- printf("-------------------------------------------\n");
- printf(
- "SYNC-TEST 6. Test of possible queuing problems with rw-locks.\n");
-/*
- sync_array_print_info(sync_primary_wait_array);
-*/
-
- rw_lock_create(&rw2);
- rw_lock_create(&rw3);
- rw_lock_create(&rw4);
-
- switch_count = 0;
-
-
- oldtm = ut_clock();
-
- n1 = 1;
-
- thr1 = os_thread_create(thread_qs,
- &n1,
- &id1);
-
- os_thread_wait(thr1);
-
-
- tm = ut_clock();
- printf("Wall clock time for single s-lock thread %ld milliseconds\n",
- tm - oldtm);
-
- oldtm = ut_clock();
-
- n1 = 1;
-
- thr1 = os_thread_create(thread_qx,
- &n1,
- &id1);
-
- os_thread_wait(thr1);
-
-
- tm = ut_clock();
- printf("Wall clock time for single x-lock thread %ld milliseconds\n",
- tm - oldtm);
-
- switch_count = 0;
-
- oldtm = ut_clock();
-
-
- n1 = 1;
- thr1 = os_thread_create(thread_qx,
- &n1,
- &id1);
-
- n2 = 2;
- thr2 = os_thread_create(thread_qs,
- &n2,
- &id2);
-
- n3 = 3;
- thr3 = os_thread_create(thread_qx,
- &n3,
- &id3);
-
-
- n4 = 4;
- thr4 = os_thread_create(thread_qs,
- &n4,
- &id4);
-
- n5 = 5;
- thr5 = os_thread_create(thread_qx,
- &n5,
- &id5);
-
- os_thread_wait(thr1);
-
- os_thread_wait(thr2);
-
- os_thread_wait(thr3);
-
- os_thread_wait(thr4);
-
- os_thread_wait(thr5);
-
-
- tm = ut_clock();
- printf("Wall clock time for 5 threads %ld milliseconds\n",
- tm - oldtm);
- printf("at least %ld thread switches occurred\n", switch_count);
-
- printf(
- "If this is not 2 x s-thread + 3 x x-thread time, possibly convoy!\n");
-
- rw_lock_list_print_info();
-
- sync_array_print_info(sync_primary_wait_array);
-
-}
-
-/********************************************************************
-Start function for thread in test7. */
-ulint
-ip_thread(void* arg)
-/*================*/
-{
- ulint i, j;
- void* arg2;
- ulint ret;
- ulint tm, oldtm;
-
- arg2 = arg;
-
- printf("Thread started!\n");
-
- oldtm = ut_clock();
-
- ret = ip_mutex_enter(iph, 100000);
-
-/* ut_a(ret == SYNC_TIME_EXCEEDED);
-*/
- tm = ut_clock();
-
- printf("Wall clock time for wait failure %ld ms\n", tm - oldtm);
-
- ret = ip_mutex_enter(iph, SYNC_INFINITE_TIME);
-
- ut_a(ret == 0);
-
- printf("Thread owns now the ip mutex!\n");
-
- j = 0;
-
- for (i = 1; i < 1000000; i++) {
- j += i;
- }
-
- printf("Thread releases now the ip mutex!\n");
-
- ip_mutex_exit(iph);
-
- return(j);
-}
-
-/*********************************************************************
-Test for interprocess mutex. */
-void
-test7(void)
-/*=======*/
-{
- os_thread_t thr1;
- os_thread_id_t id1;
- ulint i, j;
- ulint tm, oldtm;
-
- printf("-------------------------------------------\n");
- printf("SYNC-TEST 7. Test of ip mutex.\n");
-
-
- printf("Main thread %ld starts!\n",
- os_thread_get_curr_id());
-
- ip_mutex_create(&ip_mutex, "IPMUTEX", &iph);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 100000 * UNIV_DBC; i++) {
-
- ip_mutex_enter(iph, SYNC_INFINITE_TIME);
- ip_mutex_exit(iph);
- }
-
- tm = ut_clock();
- printf("Wall clock time for %ld ip mutex lock-unlock %ld ms\n",
- i, tm - oldtm);
-
-
- ip_mutex_enter(iph, SYNC_INFINITE_TIME);
-
- thr1 = os_thread_create(ip_thread,
- NULL,
- &id1);
-
- printf("Thread created, id %ld \n", id1);
-
-
- j = 0;
-
- for (i = 1; i < 100000000; i++) {
- j += i;
- }
-
- printf("Main thread releases now ip mutex!\n");
-
- ip_mutex_exit(iph);
-
- os_thread_wait(thr1);
-
- ip_mutex_free(iph);
-}
-
-/********************************************************************
-Start function for the competing threads in test8. The function tests
-the behavior lock-coupling through 4 ip mutexes. */
-
-ulint
-thread_ipn(volatile void* arg)
-/*========================*/
-{
- ulint i, j, k, n;
-
- n = *((ulint*)arg);
-
- printf("Thread %ld started!\n", n);
-
- for (k = 0; k < 2000 * UNIV_DBC; k++) {
-
- ip_mutex_enter(iph1, SYNC_INFINITE_TIME);
-
- if (last_thr != n) {
- switch_count++;
- last_thr = n;
- }
-
- j = 0;
-
- for (i = 1; i < 400; i++) {
- j += i;
- }
-
- ip_mutex_enter(iph2, SYNC_INFINITE_TIME);
-
- ip_mutex_exit(iph1);
-
- for (i = 1; i < 400; i++) {
- j += i;
- }
- ip_mutex_enter(iph3, SYNC_INFINITE_TIME);
-
- ip_mutex_exit(iph2);
-
- for (i = 1; i < 400; i++) {
- j += i;
- }
- ip_mutex_enter(iph4, SYNC_INFINITE_TIME);
-
- ip_mutex_exit(iph3);
-
- for (i = 1; i < 400; i++) {
- j += i;
- }
-
- ip_mutex_exit(iph4);
- }
-
- printf("Thread %ld exits!\n", n);
-
- return(j);
-}
-
-/******************************************************************
-Test function for ip mutex. */
-
-void
-test8(void)
-/*=======*/
-{
- os_thread_t thr1, thr2, thr3, thr4, thr5;
- os_thread_id_t id1, id2, id3, id4, id5;
- ulint tm, oldtm;
- ulint n1, n2, n3, n4, n5;
-
- printf("-------------------------------------------\n");
- printf("SYNC-TEST 8. Test for ip mutex.\n");
-
-
- ip_mutex_create(&ip_mutex1, "jhfhk", &iph1);
- ip_mutex_create(&ip_mutex2, "jggfg", &iph2);
- ip_mutex_create(&ip_mutex3, "hfdx", &iph3);
- ip_mutex_create(&ip_mutex4, "kjghg", &iph4);
-
- switch_count = 0;
-
- oldtm = ut_clock();
-
- n1 = 1;
-
- thr1 = os_thread_create(thread_ipn,
- &n1,
- &id1);
-
- os_thread_wait(thr1);
-
-
- tm = ut_clock();
- printf("Wall clock time for single thread %lu milliseconds\n",
- tm - oldtm);
-
- switch_count = 0;
-
- oldtm = ut_clock();
-
- n1 = 1;
- thr1 = os_thread_create(thread_ipn,
- &n1,
- &id1);
- n2 = 2;
- thr2 = os_thread_create(thread_ipn,
- &n2,
- &id2);
- n3 = 3;
- thr3 = os_thread_create(thread_ipn,
- &n3,
- &id3);
- n4 = 4;
- thr4 = os_thread_create(thread_ipn,
- &n4,
- &id4);
- n5 = 5;
- thr5 = os_thread_create(thread_ipn,
- &n5,
- &id5);
-
- os_thread_wait(thr1);
- os_thread_wait(thr2);
- os_thread_wait(thr3);
- os_thread_wait(thr4);
- os_thread_wait(thr5);
-
-
- tm = ut_clock();
- printf("Wall clock time for 5 threads %ld milliseconds\n",
- tm - oldtm);
- printf("%ld thread switches occurred\n", switch_count);
-
- printf("If this is not 5 x single thread time, possibly convoy!\n");
-
- ip_mutex_free(iph1);
- ip_mutex_free(iph2);
- ip_mutex_free(iph3);
- ip_mutex_free(iph4);
-}
-
-
-/********************************************************************
-Start function for s-lock thread in test9. */
-ulint
-thread_srw9(void* arg)
-/*==================*/
-{
- void* arg2;
-
- arg2 = arg;
-
- printf("Thread_srw9 started!\n");
-
- rw_lock_x_lock(&rw10);
-
- printf("Thread_srw9 has now x-lock on rw10, wait for mutex!\n");
-
- mutex_enter(&mutex9);
-
- return(0);
-}
-
-/********************************************************************
-Start function for x-lock thread in test9. */
-ulint
-thread_xrw9(void* arg)
-/*==================*/
-{
- void* arg2;
-
- arg2 = arg;
-
- printf("Thread_xrw started!\n");
-
- mutex_enter(&mutex9);
- printf("Thread_xrw9 has now mutex9, wait for rw9!\n");
-
- rw_lock_x_lock(&rw9);
-
- return(0);
-}
-
-void
-test9(void)
-/*=======*/
-{
- os_thread_t thr1, thr2;
- os_thread_id_t id1, id2;
-
- printf("-------------------------------------------\n");
- printf("SYNC-TEST 9. Test of deadlock detection.\n");
-
-
- printf("Main thread %ld starts!\n",
- os_thread_get_curr_id());
-
- rw_lock_create(&rw9);
- rw_lock_create(&rw10);
- mutex_create(&mutex9);
-
- rw_lock_s_lock(&rw9);
- printf("Main thread has now s-lock on rw9\n");
-
- thr2 = os_thread_create(thread_xrw9,
- NULL,
- &id2);
-
- printf("Thread_xrw9 created, id %ld \n", id2);
-
- os_thread_sleep(1000000);
-
- thr1 = os_thread_create(thread_srw9,
- NULL,
- &id1);
-
- printf("Thread_srw9 created, id %ld \n", id1);
-
- os_thread_sleep(1000000);
-
- sync_array_print_info(sync_primary_wait_array);
-
- printf("Now we should have a deadlock of 3 threads:\n");
-
- rw_lock_s_lock(&rw10);
-}
-
-void
-test10(void)
-/*=======*/
-{
- printf("-------------------------------------------\n");
- printf("SYNC-TEST 10. Test of deadlock detection on self-deadlock.\n");
-
-
- printf("Main thread %ld starts!\n",
- os_thread_get_curr_id());
-
- mutex_create(&mutex9);
-
- printf("Now we should have a deadlock of this thread on mutex:\n");
-
- mutex_enter(&mutex9);
- mutex_enter(&mutex9);
-}
-
-void
-test11(void)
-/*=======*/
-{
- printf("-------------------------------------------\n");
- printf("SYNC-TEST 11. Test of deadlock detection on self-deadlock.\n");
-
-
- printf("Main thread %ld starts!\n",
- os_thread_get_curr_id());
-
- rw_lock_create(&rw9);
-
- printf("Now we should have a deadlock of this thread on X-lock:\n");
-
- rw_lock_x_lock(&rw9);
- rw_lock_s_lock_gen(&rw9, 567);
-}
-
-
-/************************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
-
- sync_init();
- mem_init();
-
- oldtm = ut_clock();
-
- test1();
-
- test2();
-
- test3();
-
- test4();
-
- test5();
-
- test6();
-
- test7();
-
- test8();
-
- /* This test SHOULD result in assert on deadlock! */
-/* test9();*/
-
- /* This test SHOULD result in assert on deadlock! */
-/* test10();*/
-
- /* This test SHOULD result in assert on deadlock! */
-/* test11();*/
-
- ut_ad(0 == mutex_n_reserved());
- ut_ad(0 == rw_lock_n_locked());
- ut_ad(sync_all_freed());
-
-
- ut_ad(mem_all_freed());
-
- sync_close();
-
- tm = ut_clock();
- printf("Wall clock time for test %ld milliseconds\n", tm - oldtm);
- printf("System call count %lu\n", mutex_system_call_count);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
-
-
diff --git a/innobase/thr/thr0loc.c b/innobase/thr/thr0loc.c
index 839cb024f25..a17d09fcca6 100644
--- a/innobase/thr/thr0loc.c
+++ b/innobase/thr/thr0loc.c
@@ -46,10 +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 */
+};
/***********************************************************************
Returns the local storage struct for a thread. */
@@ -64,7 +65,9 @@ thr_local_get(
try_again:
ut_ad(thr_local_hash);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&thr_local_mutex));
+#endif /* UNIV_SYNC_DEBUG */
/* Look for the local struct in the hash table */
@@ -167,8 +170,9 @@ 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);
@@ -207,7 +211,7 @@ thr_local_free(
mutex_exit(&thr_local_mutex);
- ut_a(local->magic_n == THR_LOCAL_MAGIC_N);
+ ut_ad(local->magic_n == THR_LOCAL_MAGIC_N);
mem_free(local);
}
diff --git a/innobase/thr/ts/makefile b/innobase/thr/ts/makefile
deleted file mode 100644
index 517f50d197a..00000000000
--- a/innobase/thr/ts/makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-include ..\..\makefile.i
-
-tsthr: ..\thr.lib tsthr.c makefile
- $(CCOM) $(CFL) -I.. -I..\.. ..\thr.lib ..\..\ha.lib ..\..\sync.lib ..\..\ut.lib ..\..\mem.lib ..\..\os.lib tsthr.c $(LFL)
-
-
-
-
-
-
-
diff --git a/innobase/thr/ts/tsthr.c b/innobase/thr/ts/tsthr.c
deleted file mode 100644
index af5aaa54522..00000000000
--- a/innobase/thr/ts/tsthr.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/************************************************************************
-The test module for the thread management of Innobase
-
-(c) 1995 Innobase Oy
-
-Created 10/5/1995 Heikki Tuuri
-*************************************************************************/
-
-#include "../thr0loc.h"
-#include "sync0sync.h"
-#include "mem0mem.h"
-#include "os0thread.h"
-#include "os0sync.h"
-#include "ut0ut.h"
-
-ulint val = 500;
-os_event_t event;
-
-/******************************************************************
-Thread start function in test1. */
-
-ulint
-thread1(
-/*====*/
- void* arg)
-{
- ulint n;
-
- thr_local_create();
-
- n = *((ulint*)arg);
-
- printf("Thread %lu starts\n", n);
-
- thr_local_set_slot_no(os_thread_get_curr_id(), n);
-
- ut_a(n == thr_local_get_slot_no(os_thread_get_curr_id()));
-
- os_event_wait(event);
-
- thr_local_free();
-
- os_thread_exit(0);
-
- return(0);
-}
-
-/******************************************************************
-Test function for local storage. */
-
-void
-test1(void)
-/*=======*/
-{
- os_thread_t thr1, thr2, thr3, thr4, thr5;
- os_thread_id_t id1, id2, id3, id4, id5;
- ulint tm, oldtm;
- ulint n1, n2, n3, n4, n5;
-
- printf("-------------------------------------------\n");
- printf("THR-TEST 1. Test of local storage\n");
-
- event = os_event_create(NULL);
-
- oldtm = ut_clock();
-
- n1 = 1;
- thr1 = os_thread_create(thread1,
- &n1,
- &id1);
- n2 = 2;
- thr2 = os_thread_create(thread1,
- &n2,
- &id2);
- n3 = 3;
- thr3 = os_thread_create(thread1,
- &n3,
- &id3);
- n4 = 4;
- thr4 = os_thread_create(thread1,
- &n4,
- &id4);
- n5 = 5;
- thr5 = os_thread_create(thread1,
- &n5,
- &id5);
-
- os_thread_sleep(500000);
-
- ut_a(n1 == thr_local_get_slot_no(id1));
- ut_a(n2 == thr_local_get_slot_no(id2));
- ut_a(n3 == thr_local_get_slot_no(id3));
- ut_a(n4 == thr_local_get_slot_no(id4));
- ut_a(n5 == thr_local_get_slot_no(id5));
-
- os_event_set(event);
-
- os_thread_wait(thr1);
- os_thread_wait(thr2);
- os_thread_wait(thr3);
- os_thread_wait(thr4);
- os_thread_wait(thr5);
-
- tm = ut_clock();
- printf("Wall clock time for 5 threads %ld milliseconds\n",
- tm - oldtm);
-}
-
-/************************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
-
- sync_init();
- mem_init();
- thr_local_init();
-
- oldtm = ut_clock();
-
- test1();
-
- thr_local_close();
-
- tm = ut_clock();
- printf("Wall clock time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/trx/trx0purge.c b/innobase/trx/trx0purge.c
index 31223aa280e..558a0825fd7 100644
--- a/innobase/trx/trx0purge.c
+++ b/innobase/trx/trx0purge.c
@@ -45,7 +45,9 @@ trx_purge_update_undo_must_exist(
the undo log still exists in the system */
dulint trx_id) /* in: transaction id */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED));
+#endif /* UNIV_SYNC_DEBUG */
if (!read_view_sees_trx_id(purge_sys->view, trx_id)) {
@@ -195,9 +197,9 @@ void
trx_purge_sys_create(void)
/*======================*/
{
- com_endpoint_t* com_endpoint;
-
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
purge_sys = mem_alloc(sizeof(trx_purge_t));
@@ -219,9 +221,7 @@ trx_purge_sys_create(void)
purge_sys->arr = trx_undo_arr_create();
- com_endpoint = (com_endpoint_t*)purge_sys; /* This is a dummy non-NULL
- value */
- purge_sys->sess = sess_open(com_endpoint, (byte*)"purge_system", 13);
+ purge_sys->sess = sess_open();
purge_sys->trx = purge_sys->sess->trx;
@@ -262,7 +262,9 @@ trx_purge_add_update_undo_to_history(
ut_ad(undo);
rseg = undo->rseg;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(rseg->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
rseg_header = trx_rsegf_get(rseg->space, rseg->page_no, mtr);
@@ -276,7 +278,7 @@ trx_purge_add_update_undo_to_history(
if (undo->id >= TRX_RSEG_N_SLOTS) {
fprintf(stderr,
"InnoDB: Error: undo->id is %lu\n", (ulong) undo->id);
- ut_a(0);
+ ut_error;
}
trx_rsegf_set_nth_undo(rseg_header, undo->id, FIL_NULL, mtr);
@@ -295,8 +297,7 @@ trx_purge_add_update_undo_to_history(
undo_header + TRX_UNDO_HISTORY_NODE, mtr);
/* Write the trx number to the undo log header */
- mlog_write_dulint(undo_header + TRX_UNDO_TRX_NO, trx->no, MLOG_8BYTES,
- mtr);
+ mlog_write_dulint(undo_header + TRX_UNDO_TRX_NO, trx->no, mtr);
/* Write information about delete markings to the undo log header */
if (!undo->del_marks) {
@@ -338,7 +339,9 @@ trx_purge_free_segment(
/* printf("Freeing an update undo log segment\n"); */
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(purge_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
loop:
mtr_start(&mtr);
mutex_enter(&(rseg->mutex));
@@ -434,7 +437,9 @@ trx_purge_truncate_rseg_history(
ulint n_removed_logs = 0;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(purge_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
mtr_start(&mtr);
mutex_enter(&(rseg->mutex));
@@ -520,7 +525,9 @@ trx_purge_truncate_history(void)
dulint limit_trx_no;
dulint limit_undo_no;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(purge_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
trx_purge_arr_get_biggest(purge_sys->arr, &limit_trx_no,
&limit_undo_no);
@@ -560,7 +567,9 @@ trx_purge_truncate_if_arr_empty(void)
/*=================================*/
/* out: TRUE if array empty */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(purge_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (purge_sys->arr->n_used == 0) {
@@ -589,7 +598,9 @@ trx_purge_rseg_get_next_history_log(
ibool del_marks;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(purge_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
mutex_enter(&(rseg->mutex));
@@ -669,7 +680,9 @@ trx_purge_choose_next_log(void)
ulint offset = 0; /* remove warning (??? bug ???) */
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(purge_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(purge_sys->next_stored == FALSE);
rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list);
@@ -770,7 +783,9 @@ trx_purge_get_next_rec(
ulint cmpl_info;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(purge_sys->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(purge_sys->next_stored);
space = purge_sys->rseg->space;
@@ -1001,7 +1016,7 @@ trx_purge(void)
/* Should not happen */
- ut_a(0);
+ ut_error;
return(0);
}
@@ -1034,11 +1049,11 @@ trx_purge(void)
mutex_enter(&kernel_mutex);
- thr = que_fork_start_command(purge_sys->query, SESS_COMM_EXECUTE, 0);
+ thr = que_fork_start_command(purge_sys->query);
ut_ad(thr);
-/* thr2 = que_fork_start_command(purge_sys->query, SESS_COMM_EXECUTE, 0);
+/* thr2 = que_fork_start_command(purge_sys->query);
ut_ad(thr2); */
diff --git a/innobase/trx/trx0rec.c b/innobase/trx/trx0rec.c
index a0f500e51d7..bd37a4b506b 100644
--- a/innobase/trx/trx0rec.c
+++ b/innobase/trx/trx0rec.c
@@ -41,47 +41,6 @@ trx_undof_page_add_undo_rec_log(
byte* log_ptr;
ulint len;
-#ifdef notdefined
- ulint i;
- byte* prev_rec_ptr;
- byte* ptr;
- ulint min_len;
-
- ut_ad(new_free >= old_free + 4);
-
- i = 0;
- ptr = undo_page + old_free + 2;
-
- if (old_free > mach_read_from_2(undo_page + TRX_UNDO_PAGE_HDR
- + TRX_UNDO_PAGE_START)) {
- prev_rec_ptr = undo_page + mach_read_from_2(ptr - 4) + 2;
-
- min_len = ut_min(new_free - old_free - 4,
- (undo_page + old_free - 2) - prev_rec_ptr);
- for (;;) {
- if (i >= min_len) {
-
- break;
- } else if ((*ptr == *prev_rec_ptr)
- || ((*ptr == *prev_rec_ptr + 1)
- && (ptr + 1 == suffix))) {
- i++;
- ptr++;
- prev_rec_ptr++;
- } else {
- break;
- }
- }
- }
-
- mlog_write_initial_log_record(undo_page, MLOG_UNDO_INSERT, mtr);
-
- mlog_catenate_ulint(mtr, old_free, MLOG_2BYTES);
-
- mlog_catenate_ulint_compressed(mtr, i);
-
- mlog_catenate_string(mtr, ptr, new_free - old_free - 2 - i);
-#endif
log_ptr = mlog_open(mtr, 30 + MLOG_BUF_MARGIN);
if (log_ptr == NULL) {
@@ -1111,7 +1070,9 @@ trx_undo_report_row_operation(
IB__FILE__, __LINE__,
&mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(undo_page, SYNC_TRX_UNDO_PAGE);
+#endif /* UNIV_SYNC_DEBUG */
if (op_type == TRX_UNDO_INSERT_OP) {
offset = trx_undo_page_report_insert(undo_page, trx,
@@ -1238,7 +1199,9 @@ trx_undo_get_undo_rec(
trx_undo_rec_t** undo_rec, /* out, own: copy of the record */
mem_heap_t* heap) /* in: memory heap where copied */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED));
+#endif /* UNIV_SYNC_DEBUG */
if (!trx_purge_update_undo_must_exist(trx_id)) {
@@ -1298,7 +1261,9 @@ trx_undo_prev_version_build(
ulint i;
char err_buf[1000];
+#ifdef UNIV_SYNC_DEBUG
ut_ad(rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(mtr_memo_contains(index_mtr, buf_block_align(index_rec),
MTR_MEMO_PAGE_S_FIX) ||
mtr_memo_contains(index_mtr, buf_block_align(index_rec),
diff --git a/innobase/trx/trx0roll.c b/innobase/trx/trx0roll.c
index 1f053aeed89..6a25304c7ef 100644
--- a/innobase/trx/trx0roll.c
+++ b/innobase/trx/trx0roll.c
@@ -73,8 +73,7 @@ trx_general_rollback_for_mysql(
thr = pars_complete_graph_for_exec(roll_node, trx, heap);
- ut_a(thr == que_fork_start_command(que_node_get_parent(thr),
- SESS_COMM_EXECUTE, 0));
+ ut_a(thr == que_fork_start_command(que_node_get_parent(thr)));
que_run_threads(thr);
mutex_enter(&kernel_mutex);
@@ -354,8 +353,7 @@ trx_rollback_or_clean_all_without_sess(void)
/* Open a dummy session */
if (!trx_dummy_sess) {
- trx_dummy_sess = sess_open(NULL, (byte*)"Dummy sess",
- ut_strlen((char *) "Dummy sess"));
+ trx_dummy_sess = sess_open();
}
mutex_exit(&kernel_mutex);
@@ -418,7 +416,7 @@ loop:
trx->graph = fork;
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
+ ut_a(thr == que_fork_start_command(fork));
trx_roll_max_undo_no = ut_conv_dulint_to_longlong(trx->undo_no);
trx_roll_progress_printed_pct = 0;
@@ -678,8 +676,10 @@ trx_roll_try_truncate(
dulint limit;
dulint biggest;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(trx->undo_mutex)));
ut_ad(mutex_own(&((trx->rseg)->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
trx->pages_undone = 0;
@@ -722,7 +722,9 @@ trx_roll_pop_top_rec(
trx_undo_rec_t* prev_rec;
page_t* prev_rec_page;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(trx->undo_mutex)));
+#endif /* UNIV_SYNC_DEBUG */
undo_page = trx_undo_page_get_s_latched(undo->space,
undo->top_page_no, mtr);
@@ -946,7 +948,9 @@ trx_rollback(
que_thr_t* thr;
/* que_thr_t* thr2; */
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad((trx->undo_no_arr == NULL) || ((trx->undo_no_arr)->n_used == 0));
/* Initialize the rollback field in the transaction */
@@ -981,11 +985,11 @@ trx_rollback(
trx->graph = roll_graph;
trx->que_state = TRX_QUE_ROLLING_BACK;
- thr = que_fork_start_command(roll_graph, SESS_COMM_EXECUTE, 0);
+ thr = que_fork_start_command(roll_graph);
ut_ad(thr);
-/* thr2 = que_fork_start_command(roll_graph, SESS_COMM_EXECUTE, 0);
+/* thr2 = que_fork_start_command(roll_graph);
ut_ad(thr2); */
@@ -1015,7 +1019,9 @@ trx_roll_graph_build(
que_thr_t* thr;
/* que_thr_t* thr2; */
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
heap = mem_heap_create(512);
fork = que_fork_create(NULL, NULL, QUE_FORK_ROLLBACK, heap);
@@ -1042,7 +1048,9 @@ trx_finish_error_processing(
trx_sig_t* sig;
trx_sig_t* next_sig;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
sig = UT_LIST_GET_FIRST(trx->signals);
@@ -1075,14 +1083,16 @@ trx_finish_partial_rollback_off_kernel(
{
trx_sig_t* sig;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
sig = UT_LIST_GET_FIRST(trx->signals);
/* Remove the signal from the signal queue and send reply message
to it */
- trx_sig_reply(trx, sig, next_thr);
+ trx_sig_reply(sig, next_thr);
trx_sig_remove(trx, sig);
trx->que_state = TRX_QUE_RUNNING;
@@ -1106,7 +1116,9 @@ trx_finish_rollback_off_kernel(
trx_sig_t* sig;
trx_sig_t* next_sig;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_a(trx->undo_no_arr == NULL || trx->undo_no_arr->n_used == 0);
@@ -1145,7 +1157,7 @@ trx_finish_rollback_off_kernel(
if (sig->type == TRX_SIG_TOTAL_ROLLBACK) {
- trx_sig_reply(trx, sig, next_thr);
+ trx_sig_reply(sig, next_thr);
trx_sig_remove(trx, sig);
}
@@ -1213,7 +1225,7 @@ trx_rollback_step(
success = trx_sig_send(thr_get_trx(thr),
sig_no, TRX_SIG_SELF,
- TRUE, thr, savept, NULL);
+ thr, savept, NULL);
thr->state = QUE_THR_SIG_REPLY_WAIT;
diff --git a/innobase/trx/trx0rseg.c b/innobase/trx/trx0rseg.c
index b1fb8a9539c..e3885c86def 100644
--- a/innobase/trx/trx0rseg.c
+++ b/innobase/trx/trx0rseg.c
@@ -60,7 +60,9 @@ trx_rseg_header_create(
page_t* page;
ut_ad(mtr);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(mtr_memo_contains(mtr, fil_space_get_latch(space),
MTR_MEMO_X_LOCK));
sys_header = trx_sysf_get(mtr);
@@ -81,7 +83,9 @@ trx_rseg_header_create(
return(FIL_NULL);
}
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_RSEG_HEADER_NEW);
+#endif /* UNIV_SYNC_DEBUG */
page_no = buf_frame_get_page_no(page);
@@ -132,7 +136,9 @@ trx_rseg_mem_create(
fil_addr_t node_addr;
ulint sum_of_undo_sizes;
- ut_ad(mutex_own(&kernel_mutex));
+#ifdef UNIV_SYNC_DEBUG
+ ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
rseg = mem_alloc(sizeof(trx_rseg_t));
@@ -173,8 +179,7 @@ trx_rseg_mem_create(
+ node_addr.boffset;
rseg->last_trx_no = mtr_read_dulint(
- undo_log_hdr + TRX_UNDO_TRX_NO,
- MLOG_8BYTES, mtr);
+ undo_log_hdr + TRX_UNDO_TRX_NO, mtr);
rseg->last_del_marks = mtr_read_ulint(
undo_log_hdr + TRX_UNDO_DEL_MARKS,
MLOG_2BYTES, mtr);
diff --git a/innobase/trx/trx0sys.c b/innobase/trx/trx0sys.c
index d9eace5ad9a..57cfcef7d6f 100644
--- a/innobase/trx/trx0sys.c
+++ b/innobase/trx/trx0sys.c
@@ -134,7 +134,9 @@ trx_sys_mark_upgraded_to_multiple_tablespaces(void)
mtr_start(&mtr);
page = buf_page_get(TRX_SYS_SPACE, TRX_SYS_PAGE_NO, RW_X_LATCH, &mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_NO_ORDER_CHECK);
+#endif /* UNIV_SYNC_DEBUG */
doublewrite = page + TRX_SYS_DOUBLEWRITE;
@@ -177,7 +179,9 @@ start_again:
mtr_start(&mtr);
page = buf_page_get(TRX_SYS_SPACE, TRX_SYS_PAGE_NO, RW_X_LATCH, &mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_NO_ORDER_CHECK);
+#endif /* UNIV_SYNC_DEBUG */
doublewrite = page + TRX_SYS_DOUBLEWRITE;
@@ -187,7 +191,7 @@ start_again:
just read in some numbers */
trx_doublewrite_init(doublewrite);
-
+
mtr_commit(&mtr);
} else {
fprintf(stderr,
@@ -211,7 +215,9 @@ start_again:
/* fseg_create acquires a second latch on the page,
therefore we must declare it: */
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page2, SYNC_NO_ORDER_CHECK);
+#endif /* UNIV_SYNC_DEBUG */
if (page2 == NULL) {
fprintf(stderr,
@@ -254,7 +260,9 @@ start_again:
new_page = buf_page_get(TRX_SYS_SPACE, page_no,
RW_X_LATCH, &mtr);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(new_page, SYNC_NO_ORDER_CHECK);
+#endif /* UNIV_SYNC_DEBUG */
/* Make a dummy change to the page to ensure it will
be written to disk in a flush */
@@ -510,7 +518,9 @@ trx_in_trx_list(
{
trx_t* trx;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(kernel_mutex)));
+#endif /* UNIV_SYNC_DEBUG */
trx = UT_LIST_GET_FIRST(trx_sys->trx_list);
@@ -537,14 +547,16 @@ trx_sys_flush_max_trx_id(void)
trx_sysf_t* sys_header;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
mtr_start(&mtr);
sys_header = trx_sysf_get(&mtr);
mlog_write_dulint(sys_header + TRX_SYS_TRX_ID_STORE,
- trx_sys->max_trx_id, MLOG_8BYTES, &mtr);
+ trx_sys->max_trx_id, &mtr);
mtr_commit(&mtr);
}
@@ -736,7 +748,9 @@ trx_sysf_rseg_find_free(
ulint page_no;
ulint i;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(kernel_mutex)));
+#endif /* UNIV_SYNC_DEBUG */
sys_header = trx_sysf_get(mtr);
@@ -782,13 +796,15 @@ trx_sysf_create(
mtr);
ut_a(buf_frame_get_page_no(page) == TRX_SYS_PAGE_NO);
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(page, SYNC_TRX_SYS_HEADER);
+#endif /* UNIV_SYNC_DEBUG */
sys_header = trx_sysf_get(mtr);
/* Start counting transaction ids from number 1 up */
mlog_write_dulint(sys_header + TRX_SYS_TRX_ID_STORE,
- ut_dulint_create(0, 1), MLOG_8BYTES, mtr);
+ ut_dulint_create(0, 1), mtr);
/* Reset the rollback segment slots */
for (i = 0; i < TRX_SYS_N_RSEGS; i++) {
@@ -843,8 +859,7 @@ trx_sys_init_at_db_start(void)
trx_sys->max_trx_id = ut_dulint_add(
ut_dulint_align_up(
mtr_read_dulint(sys_header
- + TRX_SYS_TRX_ID_STORE,
- MLOG_8BYTES, &mtr),
+ + TRX_SYS_TRX_ID_STORE, &mtr),
TRX_SYS_TRX_ID_WRITE_MARGIN),
2 * TRX_SYS_TRX_ID_WRITE_MARGIN);
diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c
index 3926cfa03c5..54358ad3d4c 100644
--- a/innobase/trx/trx0trx.c
+++ b/innobase/trx/trx0trx.c
@@ -73,7 +73,9 @@ trx_create(
{
trx_t* trx;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
trx = mem_alloc(sizeof(trx_t));
@@ -171,8 +173,7 @@ trx_allocate_for_mysql(void)
/* Open a dummy session */
if (!trx_dummy_sess) {
- trx_dummy_sess = sess_open(NULL, (byte*)"Dummy sess",
- ut_strlen((char *) "Dummy sess"));
+ trx_dummy_sess = sess_open();
}
trx = trx_create(trx_dummy_sess);
@@ -205,8 +206,7 @@ trx_allocate_for_background(void)
/* Open a dummy session */
if (!trx_dummy_sess) {
- trx_dummy_sess = sess_open(NULL, (byte*)"Dummy sess",
- ut_strlen("Dummy sess"));
+ trx_dummy_sess = sess_open();
}
trx = trx_create(trx_dummy_sess);
@@ -241,7 +241,9 @@ trx_free(
{
char err_buf[1000];
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
if (trx->declared_to_be_inside_innodb) {
ut_print_timestamp(stderr);
@@ -347,7 +349,9 @@ trx_list_insert_ordered(
{
trx_t* trx2;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
trx2 = UT_LIST_GET_FIRST(trx_sys->trx_list);
@@ -509,7 +513,9 @@ trx_assign_rseg(void)
{
trx_rseg_t* rseg = trx_sys->latest_rseg;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
loop:
/* Get next rseg in a round-robin fashion */
@@ -546,7 +552,9 @@ trx_start_low(
{
trx_rseg_t* rseg;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(trx->rseg == NULL);
if (trx->type == TRX_PURGE) {
@@ -621,7 +629,9 @@ trx_commit_off_kernel(
ibool must_flush_log = FALSE;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
rseg = trx->rseg;
@@ -650,29 +660,6 @@ trx_commit_off_kernel(
if (undo) {
mutex_enter(&kernel_mutex);
-#ifdef notdefined
- /* !!!!!!!!! There is a bug here: purge and rollback
- need the whole stack of old record versions even if no
- consistent read would need them!! This is because they
- decide on the basis of the old versions when we can
- remove delete marked secondary index records! */
-
- if (!undo->del_marks && (undo->size == 1)
- && (UT_LIST_GET_LEN(trx_sys->view_list) == 1)) {
-
- /* There is no need to save the update undo
- log: discard it; note that &mtr gets committed
- while we must hold the kernel mutex and
- therefore this optimization may add to the
- contention of the kernel mutex. */
-
- lsn = trx_undo_update_cleanup_by_discard(trx,
- &mtr);
- mutex_exit(&(rseg->mutex));
-
- goto shortcut;
- }
-#endif
trx->no = trx_sys_get_new_trx_no();
mutex_exit(&kernel_mutex);
@@ -714,11 +701,13 @@ trx_commit_off_kernel(
TRX_SYS_MYSQL_MASTER_LOG_INFO, &mtr);
}
- /* If we did not take the shortcut, the following call
- commits the mini-transaction, making the whole transaction
- committed in the file-based world at this log sequence number;
- otherwise, we get the commit lsn from the call of
- trx_undo_update_cleanup_by_discard above.
+ /* The following call commits the mini-transaction, making the
+ whole transaction committed in the file-based world, at this
+ log sequence number. The transaction becomes 'durable' when
+ we write the log to disk, but in the logical sense the commit
+ in the file-based data structures (undo logs etc.) happens
+ here.
+
NOTE that transaction numbers, which are assigned only to
transactions with an update undo log, do not necessarily come
in exactly the same order as commit lsn's, if the transactions
@@ -738,7 +727,9 @@ trx_commit_off_kernel(
}
ut_ad(trx->conc_state == TRX_ACTIVE);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
/* The following assignment makes the transaction committed in memory
and makes its changes to data visible to other transactions.
@@ -827,7 +818,7 @@ trx_commit_off_kernel(
log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, FALSE);
} else {
- ut_a(0);
+ ut_error;
}
trx->commit_lsn = lsn;
@@ -918,7 +909,9 @@ trx_handle_commit_sig_off_kernel(
trx_sig_t* sig;
trx_sig_t* next_sig;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
trx->que_state = TRX_QUE_COMMITTING;
@@ -936,7 +929,7 @@ trx_handle_commit_sig_off_kernel(
if (sig->type == TRX_SIG_COMMIT) {
- trx_sig_reply(trx, sig, next_thr);
+ trx_sig_reply(sig, next_thr);
trx_sig_remove(trx, sig);
}
@@ -958,7 +951,9 @@ trx_end_lock_wait(
{
que_thr_t* thr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(trx->que_state == TRX_QUE_LOCK_WAIT);
thr = UT_LIST_GET_FIRST(trx->wait_thrs);
@@ -985,7 +980,9 @@ trx_lock_wait_to_suspended(
{
que_thr_t* thr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(trx->que_state == TRX_QUE_LOCK_WAIT);
thr = UT_LIST_GET_FIRST(trx->wait_thrs);
@@ -1013,7 +1010,9 @@ trx_sig_reply_wait_to_suspended(
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);
@@ -1025,7 +1024,6 @@ trx_sig_reply_wait_to_suspended(
thr->state = QUE_THR_SUSPENDED;
sig->receiver = NULL;
- sig->reply = FALSE;
UT_LIST_REMOVE(reply_signals, trx->reply_signals, sig);
@@ -1047,7 +1045,9 @@ trx_sig_is_compatible(
{
trx_sig_t* sig;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
if (UT_LIST_GET_LEN(trx->signals) == 0) {
@@ -1119,13 +1119,9 @@ trx_sig_send(
ulint type, /* in: signal type */
ulint sender, /* in: TRX_SIG_SELF or
TRX_SIG_OTHER_SESS */
- ibool reply, /* in: TRUE if the sender of the signal
- wants reply after the operation induced
- by the signal is completed; if type
- is TRX_SIG_END_WAIT, this must be
- FALSE */
que_thr_t* receiver_thr, /* in: query thread which wants the
- reply, or NULL */
+ reply, or NULL; if type is
+ TRX_SIG_END_WAIT, this must be NULL */
trx_savept_t* savept, /* in: possible rollback savepoint, or
NULL */
que_thr_t** next_thr) /* in/out: next query thread to run;
@@ -1139,16 +1135,16 @@ trx_sig_send(
trx_t* receiver_trx;
ut_ad(trx);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
if (!trx_sig_is_compatible(trx, type, sender)) {
/* The signal is not compatible with the other signals in
the queue: do nothing */
- ut_a(0);
+ ut_error;
- /* sess_raise_error_low(trx, 0, 0, NULL, NULL, NULL, NULL,
- "Incompatible signal"); */
return(FALSE);
}
@@ -1171,7 +1167,6 @@ trx_sig_send(
sig->type = type;
sig->state = TRX_SIG_WAITING;
sig->sender = sender;
- sig->reply = reply;
sig->receiver = receiver_thr;
if (savept) {
@@ -1196,10 +1191,7 @@ trx_sig_send(
signal to the end of the queue, if the session is not yet
in the error state: */
- ut_a(0);
-
- sess_raise_error_low(trx, 0, 0, NULL, NULL, NULL, NULL,
- (char *) "Signal from another session, or a break execution signal");
+ ut_error;
}
/* If there were no other signals ahead in the queue, try to start
@@ -1224,7 +1216,9 @@ trx_end_signal_handling(
/*====================*/
trx_t* trx) /* in: trx */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(trx->handling_signals == TRUE);
trx->handling_signals = FALSE;
@@ -1258,7 +1252,9 @@ loop:
we can process immediately */
ut_ad(trx);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
if (trx->handling_signals && (UT_LIST_GET_LEN(trx->signals) == 0)) {
@@ -1333,7 +1329,7 @@ loop:
} else if (type == TRX_SIG_BREAK_EXECUTION) {
- trx_sig_reply(trx, sig, next_thr);
+ trx_sig_reply(sig, next_thr);
trx_sig_remove(trx, sig);
} else {
ut_error;
@@ -1349,7 +1345,6 @@ handled. */
void
trx_sig_reply(
/*==========*/
- trx_t* trx, /* in: trx handle */
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
@@ -1359,11 +1354,12 @@ trx_sig_reply(
{
trx_t* receiver_trx;
- ut_ad(trx && sig);
+ ut_ad(sig);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
- if (sig->reply && (sig->receiver != NULL)) {
-
+ if (sig->receiver != NULL) {
ut_ad((sig->receiver)->state == QUE_THR_SIG_REPLY_WAIT);
receiver_trx = thr_get_trx(sig->receiver);
@@ -1374,18 +1370,8 @@ trx_sig_reply(
que_thr_end_wait(sig->receiver, next_thr);
- sig->reply = FALSE;
- sig->receiver = NULL;
-
- } else if (sig->reply) {
- /* In this case the reply should be sent to the client of
- the session of the transaction */
-
- sig->reply = FALSE;
sig->receiver = NULL;
- sess_srv_msg_send_simple(trx->sess, SESS_SRV_SUCCESS,
- SESS_NOT_RELEASE_KERNEL);
}
}
@@ -1399,9 +1385,10 @@ trx_sig_remove(
trx_sig_t* sig) /* in, own: signal */
{
ut_ad(trx && sig);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
- ut_ad(sig->reply == FALSE);
ut_ad(sig->receiver == NULL);
UT_LIST_REMOVE(signals, trx->signals, sig);
@@ -1463,8 +1450,7 @@ trx_commit_step(
/* Send the commit signal to the transaction */
success = trx_sig_send(thr_get_trx(thr), TRX_SIG_COMMIT,
- TRX_SIG_SELF, TRUE, thr, NULL,
- &next_thr);
+ TRX_SIG_SELF, thr, NULL, &next_thr);
mutex_exit(&kernel_mutex);
@@ -1550,7 +1536,7 @@ trx_commit_complete_for_mysql(
log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, FALSE);
} else {
- ut_a(0);
+ ut_error;
}
trx->op_info = (char*)"";
diff --git a/innobase/trx/trx0undo.c b/innobase/trx/trx0undo.c
index f3f93734a49..0a47134c163 100644
--- a/innobase/trx/trx0undo.c
+++ b/innobase/trx/trx0undo.c
@@ -391,7 +391,9 @@ trx_undo_seg_create(
ibool success;
ut_ad(mtr && id && rseg_hdr);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(rseg->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
/*
if (type == TRX_UNDO_INSERT) {
printf("Creating insert undo log segment\n");
@@ -431,7 +433,9 @@ trx_undo_seg_create(
return(NULL);
}
+#ifdef UNIV_SYNC_DEBUG
buf_page_dbg_add_level(undo_page, SYNC_TRX_UNDO_PAGE);
+#endif /* UNIV_SYNC_DEBUG */
page_hdr = undo_page + TRX_UNDO_PAGE_HDR;
seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
@@ -737,13 +741,14 @@ trx_undo_add_page(
ulint n_reserved;
ibool success;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(trx->undo_mutex)));
ut_ad(!mutex_own(&kernel_mutex));
+ ut_ad(mutex_own(&(trx->rseg->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
rseg = trx->rseg;
- ut_ad(mutex_own(&(rseg->mutex)));
-
if (rseg->curr_size == rseg->max_size) {
return(FIL_NULL);
@@ -813,8 +818,10 @@ trx_undo_free_page(
UT_NOT_USED(hdr_offset);
ut_a(hdr_page_no != page_no);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex));
ut_ad(mutex_own(&(rseg->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
undo_page = trx_undo_page_get(space, page_no, mtr);
@@ -861,7 +868,9 @@ trx_undo_free_page_in_rollback(
ulint last_page_no;
ut_ad(undo->hdr_page_no != page_no);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(trx->undo_mutex)));
+#endif /* UNIV_SYNC_DEBUG */
last_page_no = trx_undo_free_page(undo->rseg, FALSE, undo->space,
undo->hdr_page_no, undo->hdr_offset,
@@ -915,12 +924,13 @@ trx_undo_truncate_end(
trx_rseg_t* rseg;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(trx->undo_mutex)));
+ ut_ad(mutex_own(&(trx->rseg->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
rseg = trx->rseg;
- ut_ad(mutex_own(&(rseg->mutex)));
-
for (;;) {
mtr_start(&mtr);
@@ -994,7 +1004,9 @@ trx_undo_truncate_start(
ulint page_no;
mtr_t mtr;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(rseg->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (0 == ut_dulint_cmp(limit, ut_dulint_zero)) {
@@ -1060,8 +1072,9 @@ trx_undo_seg_free(
while (!finished) {
mtr_start(&mtr);
-
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
mutex_enter(&(rseg->mutex));
seg_header = trx_undo_page_get(undo->space, undo->hdr_page_no,
@@ -1117,7 +1130,7 @@ trx_undo_mem_create_at_db_start(
if (id >= TRX_RSEG_N_SLOTS) {
fprintf(stderr,
"InnoDB: Error: undo->id is %lu\n", (ulong) id);
- ut_a(0);
+ ut_error;
}
undo_page = trx_undo_page_get(rseg->space, page_no, mtr);
@@ -1134,8 +1147,7 @@ trx_undo_mem_create_at_db_start(
undo_header = undo_page + offset;
- trx_id = mtr_read_dulint(undo_header + TRX_UNDO_TRX_ID, MLOG_8BYTES,
- mtr);
+ trx_id = mtr_read_dulint(undo_header + TRX_UNDO_TRX_ID, mtr);
mutex_enter(&(rseg->mutex));
undo = trx_undo_mem_create(rseg, id, type, trx_id, page_no, offset);
@@ -1145,8 +1157,7 @@ trx_undo_mem_create_at_db_start(
undo->dict_operation = mtr_read_ulint(
undo_header + TRX_UNDO_DICT_OPERATION,
MLOG_2BYTES, mtr);
- undo->table_id = mtr_read_dulint(undo_header + TRX_UNDO_TABLE_ID,
- MLOG_8BYTES, mtr);
+ undo->table_id = mtr_read_dulint(undo_header + TRX_UNDO_TABLE_ID, mtr);
undo->state = state;
undo->size = flst_get_len(seg_header + TRX_UNDO_PAGE_LIST, mtr);
@@ -1270,12 +1281,14 @@ trx_undo_mem_create(
{
trx_undo_t* undo;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(rseg->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (id >= TRX_RSEG_N_SLOTS) {
fprintf(stderr,
"InnoDB: Error: undo->id is %lu\n", (ulong) id);
- ut_a(0);
+ ut_error;
}
undo = mem_alloc(sizeof(trx_undo_t));
@@ -1314,14 +1327,16 @@ trx_undo_mem_init_for_reuse(
is created */
ulint offset) /* in: undo log header byte offset on page */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&((undo->rseg)->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (undo->id >= TRX_RSEG_N_SLOTS) {
fprintf(stderr, "InnoDB: Error: undo->id is %lu\n",
(ulong) undo->id);
mem_analyze_corruption((byte*)undo);
- ut_a(0);
+ ut_error;
}
undo->state = TRX_UNDO_ACTIVE;
@@ -1345,7 +1360,7 @@ trx_undo_mem_free(
if (undo->id >= TRX_RSEG_N_SLOTS) {
fprintf(stderr,
"InnoDB: Error: undo->id is %lu\n", (ulong) undo->id);
- ut_a(0);
+ ut_error;
}
mem_free(undo);
@@ -1373,7 +1388,9 @@ trx_undo_create(
trx_undo_t* undo;
page_t* undo_page;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(rseg->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (rseg->curr_size == rseg->max_size) {
@@ -1424,7 +1441,9 @@ trx_undo_reuse_cached(
page_t* undo_page;
ulint offset;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(rseg->mutex)));
+#endif /* UNIV_SYNC_DEBUG */
if (type == TRX_UNDO_INSERT) {
@@ -1448,13 +1467,12 @@ trx_undo_reuse_cached(
}
ut_ad(undo->size == 1);
- ut_ad(undo->hdr_page_no == undo->top_page_no);
if (undo->id >= TRX_RSEG_N_SLOTS) {
fprintf(stderr, "InnoDB: Error: undo->id is %lu\n",
(ulong) undo->id);
mem_analyze_corruption((byte*)undo);
- ut_a(0);
+ ut_error;
}
undo_page = trx_undo_page_get(undo->space, undo->hdr_page_no, mtr);
@@ -1495,7 +1513,7 @@ trx_undo_mark_as_dict_operation(
trx->dict_operation, MLOG_2BYTES, mtr);
mlog_write_dulint(hdr_page + undo->hdr_offset + TRX_UNDO_TABLE_ID,
- trx->table_id, MLOG_8BYTES, mtr);
+ trx->table_id, mtr);
undo->dict_operation = trx->dict_operation;
undo->table_id = trx->table_id;
@@ -1522,11 +1540,15 @@ trx_undo_assign_undo(
rseg = trx->rseg;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(trx->undo_mutex)));
+#endif /* UNIV_SYNC_DEBUG */
mtr_start(&mtr);
+#ifdef UNIV_SYNC_DEBUG
ut_ad(!mutex_own(&kernel_mutex));
+#endif /* UNIV_SYNC_DEBUG */
mutex_enter(&(rseg->mutex));
undo = trx_undo_reuse_cached(rseg, type, trx->id, &mtr);
@@ -1587,7 +1609,7 @@ trx_undo_set_state_at_finish(
fprintf(stderr, "InnoDB: Error: undo->id is %lu\n",
(ulong) undo->id);
mem_analyze_corruption((byte*)undo);
- ut_a(0);
+ ut_error;
}
undo_page = trx_undo_page_get(undo->space, undo->hdr_page_no, mtr);
@@ -1632,8 +1654,9 @@ trx_undo_update_cleanup(
undo = trx->update_undo;
rseg = trx->rseg;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&(rseg->mutex)));
-
+#endif /* UNIV_SYNC_DEBUG */
trx_purge_add_update_undo_to_history(trx, undo_page, mtr);
UT_LIST_REMOVE(undo_list, rseg->update_undo_list, undo);
@@ -1650,54 +1673,6 @@ trx_undo_update_cleanup(
}
}
-/**************************************************************************
-Discards an undo log and puts the segment to the list of cached update undo
-log segments. This optimized function is called if there is no need to keep
-the update undo log because there exist no read views and the transaction
-made no delete markings, which would make purge necessary. We restrict this
-to undo logs of size 1 to make things simpler. */
-
-dulint
-trx_undo_update_cleanup_by_discard(
-/*===============================*/
- /* out: log sequence number at which mtr is
- committed */
- trx_t* trx, /* in: trx owning the update undo log */
- mtr_t* mtr) /* in: mtr */
-{
- trx_rseg_t* rseg;
- trx_undo_t* undo;
- page_t* undo_page;
-
- undo = trx->update_undo;
- rseg = trx->rseg;
-
- ut_ad(mutex_own(&(rseg->mutex)));
- ut_ad(mutex_own(&kernel_mutex));
- ut_ad(undo->size == 1);
- ut_ad(undo->del_marks == FALSE);
- ut_ad(UT_LIST_GET_LEN(trx_sys->view_list) == 1);
-
- /* NOTE: we must hold the kernel mutex, because we must prevent
- creation of new read views before mtr gets committed! */
-
- undo_page = trx_undo_page_get(undo->space, undo->hdr_page_no, mtr);
-
- trx_undo_discard_latest_update_undo(undo_page, mtr);
-
- undo->state = TRX_UNDO_CACHED;
-
- UT_LIST_REMOVE(undo_list, rseg->update_undo_list, undo);
-
- trx->update_undo = NULL;
-
- UT_LIST_ADD_FIRST(undo_list, rseg->update_undo_cached, undo);
-
- mtr_commit(mtr);
-
- return(mtr->end_lsn);
-}
-
/**********************************************************************
Frees or caches an insert undo log after a transaction commit or rollback.
Knowledge of inserts is not needed after a commit or rollback, therefore
diff --git a/innobase/trx/ts/makefile b/innobase/trx/ts/makefile
deleted file mode 100644
index 48e4befcb27..00000000000
--- a/innobase/trx/ts/makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-include ..\..\makefile.i
-
-tstrx: ..\trx.lib tstrx.c
- $(CCOM) $(CFL) -I.. -I..\.. ..\trx.lib ..\..\pars.lib ..\..\que.lib ..\..\lock.lib ..\..\row.lib ..\..\read.lib ..\..\srv.lib ..\..\com.lib ..\..\usr.lib ..\..\thr.lib ..\..\btr.lib ..\..\fut.lib ..\..\fsp.lib ..\..\page.lib ..\..\dyn.lib ..\..\mtr.lib ..\..\log.lib ..\..\rem.lib ..\..\fil.lib ..\..\buf.lib ..\..\dict.lib ..\..\data.lib ..\..\mach.lib ..\..\ha.lib ..\..\ut.lib ..\..\sync.lib ..\..\mem.lib ..\..\os.lib tstrx.c $(LFL)
-
-
-
-
-
-
-
-
-
diff --git a/innobase/trx/ts/tstrx.c b/innobase/trx/ts/tstrx.c
deleted file mode 100644
index f69c02dd51e..00000000000
--- a/innobase/trx/ts/tstrx.c
+++ /dev/null
@@ -1,1663 +0,0 @@
-/************************************************************************
-Test for the transaction system
-
-(c) 1994-1997 Innobase Oy
-
-Created 2/16/1996 Heikki Tuuri
-*************************************************************************/
-
-#include "sync0sync.h"
-#include "ut0mem.h"
-#include "mem0mem.h"
-#include "data0data.h"
-#include "data0type.h"
-#include "dict0dict.h"
-#include "buf0buf.h"
-#include "os0file.h"
-#include "fil0fil.h"
-#include "fsp0fsp.h"
-#include "rem0rec.h"
-#include "rem0cmp.h"
-#include "mtr0mtr.h"
-#include "log0log.h"
-#include "page0page.h"
-#include "page0cur.h"
-#include "trx0trx.h"
-#include "dict0boot.h"
-#include "trx0sys.h"
-#include "dict0crea.h"
-#include "btr0btr.h"
-#include "btr0pcur.h"
-#include "rem0rec.h"
-#include "srv0srv.h"
-#include "que0que.h"
-#include "com0com.h"
-#include "usr0sess.h"
-#include "lock0lock.h"
-#include "trx0roll.h"
-#include "row0ins.h"
-#include "row0upd.h"
-
-os_file_t files[1000];
-
-mutex_t ios_mutex;
-ulint ios;
-ulint n[10];
-
-mutex_t incs_mutex;
-ulint incs;
-
-byte bigbuf[1000000];
-
-#define N_SPACES 1
-#define N_FILES 1
-#define FILE_SIZE 1024 /* must be > 512 */
-#define POOL_SIZE 512
-#define COUNTER_OFFSET 1500
-
-#define LOOP_SIZE 150
-#define N_THREADS 5
-
-
-ulint zero = 0;
-
-buf_block_t* bl_arr[POOL_SIZE];
-
-/************************************************************************
-Io-handler thread function. */
-
-ulint
-handler_thread(
-/*===========*/
- void* arg)
-{
- ulint segment;
- void* mess;
- ulint i;
- bool ret;
-
- segment = *((ulint*)arg);
-
- printf("Io handler thread %lu starts\n", segment);
-
- for (i = 0;; i++) {
- ret = fil_aio_wait(segment, &mess);
- ut_a(ret);
-
- buf_page_io_complete((buf_block_t*)mess);
-
- mutex_enter(&ios_mutex);
- ios++;
- mutex_exit(&ios_mutex);
-
- }
-
- return(0);
-}
-
-/*************************************************************************
-Creates the files for the file system test and inserts them to
-the file system. */
-
-void
-create_files(void)
-/*==============*/
-{
- bool ret;
- ulint i, k;
- char name[20];
- os_thread_t thr[5];
- os_thread_id_t id[5];
-
- printf("--------------------------------------------------------\n");
- printf("Create or open database files\n");
-
- strcpy(name, "tsfile00");
-
- for (k = 0; k < N_SPACES; k++) {
- for (i = 0; i < N_FILES; i++) {
-
- name[6] = (char)((ulint)'0' + k);
- name[7] = (char)((ulint)'0' + i);
-
- files[i] = os_file_create(name, OS_FILE_CREATE,
- OS_FILE_TABLESPACE, &ret);
-
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(
- name, OS_FILE_OPEN,
- OS_FILE_TABLESPACE, &ret);
-
- ut_a(ret);
- } else {
- ut_a(os_file_set_size(files[i], 8192 * FILE_SIZE, 0));
- }
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create(name, k, OS_FILE_TABLESPACE);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, FILE_SIZE, k);
- }
- }
-
- ios = 0;
-
- mutex_create(&ios_mutex);
-
- for (i = 0; i < 5; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(handler_thread, n + i, id + i);
- }
-}
-
-/************************************************************************
-Inits space header of space 0. */
-
-void
-init_space(void)
-/*============*/
-{
- mtr_t mtr;
-
- printf("Init space header\n");
-
- mtr_start(&mtr);
-
- fsp_header_init(0, FILE_SIZE * N_FILES, &mtr);
-
- mtr_commit(&mtr);
-}
-
-/*********************************************************************
-Test for table creation. */
-
-ulint
-test1(
-/*==*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- dict_index_t* index;
- dict_table_t* table;
- que_fork_t* fork;
- que_thr_t* thr;
- trx_t* trx;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1. CREATE TABLE WITH 3 COLUMNS AND WITH 3 INDEXES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- table = dict_mem_table_create("TS_TABLE1", 0, 3);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- /*------------------------------------*/
- /* CREATE TABLE */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = tab_create_graph_create(fork, thr, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS"); */
- /*-------------------------------------*/
- /* CREATE CLUSTERED INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND1", 0, DICT_CLUSTERED,
- 2);
- dict_mem_index_add_field(index, "COL1", 0);
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- /*-------------------------------------*/
- /* CREATE SECONDARY INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND2", 0, 0, 2);
-
- dict_mem_index_add_field(index, "COL2", 0);
- dict_mem_index_add_field(index, "COL1", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- /*-------------------------------------*/
- /* CREATE ANOTHER SECONDARY INDEX */
-
- index = dict_mem_index_create("TS_TABLE1", "IND3", 0, 0, 2);
-
- dict_mem_index_add_field(index, "COL2", 0);
- dict_mem_index_add_field(index, "COL1", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- return(0);
-}
-
-/*********************************************************************
-Another test for table creation. */
-
-ulint
-test1_5(
-/*====*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- dict_index_t* index;
- dict_table_t* table;
- que_fork_t* fork;
- que_thr_t* thr;
- trx_t* trx;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1.5. CREATE TABLE WITH 3 COLUMNS AND WITH 1 INDEX\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- table = dict_mem_table_create("TS_TABLE2", 0, 3);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- /*------------------------------------*/
- /* CREATE TABLE */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = tab_create_graph_create(fork, thr, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS"); */
- /*-------------------------------------*/
- /* CREATE CLUSTERED INDEX */
-
- index = dict_mem_index_create("TS_TABLE2", "IND1", 0, DICT_CLUSTERED,
- 2);
- dict_mem_index_add_field(index, "COL1", 0);
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- return(0);
-}
-
-/*********************************************************************
-Another test for table creation. */
-
-ulint
-test1_6(
-/*====*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- dict_index_t* index;
- dict_table_t* table;
- que_fork_t* fork;
- que_thr_t* thr;
- trx_t* trx;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 1.5. CREATE TABLE WITH 3 COLUMNS AND WITH 1 INDEX\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- table = dict_mem_table_create("TS_TABLE3", 0, 3);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
- /*------------------------------------*/
- /* CREATE TABLE */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = tab_create_graph_create(fork, thr, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_TABLES");
- dict_table_print_by_name("SYS_COLUMNS"); */
- /*-------------------------------------*/
- /* CREATE CLUSTERED INDEX */
-
- index = dict_mem_index_create("TS_TABLE3", "IND1", 0, DICT_CLUSTERED,
- 2);
- dict_mem_index_add_field(index, "COL1", 0);
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = ind_create_graph_create(fork, thr, index, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* dict_table_print_by_name("SYS_INDEXES");
- dict_table_print_by_name("SYS_FIELDS"); */
-
- return(0);
-}
-
-/*********************************************************************
-Test for inserts. */
-
-ulint
-test2(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- byte buf[100];
- ulint count = 0;
- ins_node_t* node;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2. MASSIVE INSERT\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* MASSIVE INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- node = ins_node_create(fork, thr, row, table, heap);
-
- thr->child = node;
-
- row_ins_init_sys_fields_at_sql_compile(node->row, node->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(node->row, node->table, trx);
-
- node->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- mem_print_info();
-
- oldtm = ut_clock();
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- rnd = (rnd + 1) % 200000;
-
- dtuple_gen_test_tuple3(row, rnd, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- mem_print_info();
-
-/* dict_table_print_by_name("TS_TABLE1"); */
- /*-------------------------------------*/
- /* ROLLBACK */
-#ifdef notdefined
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu inserts %lu milliseconds\n",
- i, tm - oldtm);
- /*-------------------------------------*/
-#endif
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- /*-------------------------------------*/
- count++;
-
- if (count < 1) {
- goto loop;
- }
- return(0);
-}
-
-/*********************************************************************
-Test for updates. */
-
-ulint
-test3(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint rnd;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- byte* ptr;
- ulint len;
- ulint err;
-
- UT_NOT_USED(arg);
-
- printf("-------------------------------------------------\n");
- printf("TEST 3. UPDATES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- thr->child = ins_node_create(fork, thr, row, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 3; i++) {
-
- dtuple_gen_test_tuple3(row, i, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- dict_table_print_by_name("TS_TABLE1");
- /*-------------------------------------*/
- /* UPDATE ROWS */
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- update = upd_create(1, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- dtuple_gen_test_tuple3(row, 1, DTUPLE_TEST_FIXED30, buf);
- entry = dtuple_create(heap, 2);
- dfield_copy(dtuple_get_nth_field(entry, 0),
- dtuple_get_nth_field(row, 0));
- dfield_copy(dtuple_get_nth_field(entry, 1),
- dtuple_get_nth_field(row, 1));
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(tree, entry, PAGE_CUR_G, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- ufield->col_no = 2;
- dfield_set_data(&(ufield->new_val), "updated field", 14);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- mtr_start(&mtr);
-
- ut_a(btr_pcur_restore_position(BTR_SEARCH_LEAF, &pcur, &mtr));
-
- ptr = rec_get_nth_field(btr_pcur_get_rec(&pcur), 5, &len);
-
- ut_a(ut_memcmp(ptr, "updated field", 14) == 0);
-
- btr_pcur_commit(&pcur);
-
- dict_table_print_by_name("TS_TABLE1");
-
- ufield = upd_get_nth_field(update, 0);
-
- ufield->col_no = 0;
- dfield_set_data(&(ufield->new_val), "31415926", 9);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- dict_table_print_by_name("TS_TABLE1");
- /*-------------------------------------*/
- /* ROLLBACK */
-#ifdef notdefined
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu updates %lu milliseconds\n",
- i, tm - oldtm);
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- /*-------------------------------------*/
-#endif
- dict_table_print_by_name("TS_TABLE1");
- count++;
-
- if (count < 1) {
- goto loop;
- }
- return(0);
-}
-
-/*********************************************************************
-Test for massive updates. */
-
-ulint
-test4(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- ulint j;
- ulint rnd;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- byte* ptr;
- ulint len;
- ulint err;
-
- printf("-------------------------------------------------\n");
- printf("TEST 4. MASSIVE UPDATES\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-loop:
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* INSERT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- thr->child = ins_node_create(fork, thr, row, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < *((ulint*)arg); i++) {
-
- dtuple_gen_test_tuple3(row, i, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu inserts %lu milliseconds\n", i, tm - oldtm);
-
-#ifdef notdefined
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- dict_table_print_by_name("TS_TABLE1");
- /*-------------------------------------*/
- /* UPDATE ROWS */
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-#endif
- fork = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- update = upd_create(1, heap);
-
- node = upd_node_create(fork, thr, table, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = 0;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- for (j = 0; j < 2; j++) {
- for (i = 0; i < *((ulint*)arg); i++) {
-
- dtuple_gen_test_tuple3(row, i, DTUPLE_TEST_FIXED30, buf);
- entry = dtuple_create(heap, 2);
- dfield_copy(dtuple_get_nth_field(entry, 0),
- dtuple_get_nth_field(row, 0));
- dfield_copy(dtuple_get_nth_field(entry, 1),
- dtuple_get_nth_field(row, 1));
-
- index = dict_table_get_first_index(table);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(tree, entry, PAGE_CUR_G, BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_store_position(&pcur, &mtr);
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- btr_pcur_commit(&pcur);
-
- ufield = upd_get_nth_field(update, 0);
-
- ufield->col_no = 2;
- dfield_set_data(&(ufield->new_val), "updated field", 14);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- } /* for (i = ... */
- }
- mtr_start(&mtr);
-
- ut_a(btr_pcur_restore_position(BTR_SEARCH_LEAF, &pcur, &mtr));
-
- ptr = rec_get_nth_field(btr_pcur_get_rec(&pcur), 5, &len);
-
- ut_a(ut_memcmp(ptr, "updated field", 14) == 0);
-
- btr_pcur_commit(&pcur);
-
- dict_table_print_by_name("TS_TABLE1");
-
- ufield = upd_get_nth_field(update, 0);
-
- ufield->col_no = 0;
- dfield_set_data(&(ufield->new_val), "31415926", 9);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(
- thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- dict_table_print_by_name("TS_TABLE1");
- /*-------------------------------------*/
- /* ROLLBACK */
-
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = roll_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for rollback of %lu updates %lu milliseconds\n",
- i, tm - oldtm);
-#ifdef notdefined
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- oldtm = ut_clock();
-
- que_run_threads(thr);
-
- tm = ut_clock();
- printf("Wall time for commit %lu milliseconds\n", tm - oldtm);
-
- /*-------------------------------------*/
-#endif
- dict_table_print_by_name("TS_TABLE1");
- count++;
-
- if (count < 1) {
- goto loop;
- }
- return(0);
-}
-
-/*********************************************************************
-Init TS_TABLE2 for TPC-A transaction. */
-
-ulint
-test4_5(
-/*====*/
- void* arg)
-{
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork;
- dict_table_t* table;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- dtuple_t* row;
- byte buf[100];
-
- arg = arg;
-
- printf("-------------------------------------------------\n");
- printf("TEST 4_5. INIT FOR TPC-A\n");
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- /*-------------------------------------*/
- /* INSERT INTO TABLE TO UPDATE */
-
- for (i = 0; i < 100; i++) {
- fork = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- table = dict_table_get("TS_TABLE2", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- thr->child = ins_node_create(fork, thr, row, table, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- mutex_exit(&kernel_mutex);
-
- dtuple_gen_test_tuple3(row, i, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- }
-/* dict_table_print_by_name("TS_TABLE2"); */
-
- /*-------------------------------------*/
- /* COMMIT */
- fork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- fork->trx = trx;
-
- thr = que_thr_create(fork, fork, heap);
-
- thr->child = commit_node_create(fork, thr, heap);
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork, trx->sess);
-
- trx->graph = fork;
-
- ut_a(thr == que_fork_start_command(fork, SESS_COMM_EXECUTE, 0));
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- /*-----------------------------------*/
-
- return(0);
-}
-
-/*********************************************************************
-Test for TPC-A transaction. */
-
-ulint
-test5(
-/*==*/
- void* arg)
-{
- ulint tm, oldtm;
- sess_t* sess;
- com_endpoint_t* com_endpoint;
- mem_heap_t* heap;
- que_fork_t* fork1;
- que_fork_t* fork2;
- que_fork_t* cfork;
- dict_table_t* table;
- dict_table_t* table2;
- que_thr_t* thr;
- trx_t* trx;
- ulint i;
- dtuple_t* row;
- dtuple_t* entry;
- byte buf[100];
- ulint count = 0;
- btr_pcur_t pcur;
- upd_t* update;
- upd_field_t* ufield;
- dict_tree_t* tree;
- dict_index_t* index;
- mtr_t mtr;
- upd_node_t* node;
- ulint err;
- ins_node_t* inode;
-
- arg = arg;
-
- printf("-------------------------------------------------\n");
- printf("TEST 5. TPC-A %lu \n", *((ulint*)arg));
-
- oldtm = ut_clock();
-
- heap = mem_heap_create(512);
-
- com_endpoint = (com_endpoint_t*)heap; /* This is a dummy non-NULL
- value */
- mutex_enter(&kernel_mutex);
-
- sess = sess_open(ut_dulint_zero, com_endpoint, (byte*)"user1", 6);
-
- trx = sess->trx;
-
- mutex_exit(&kernel_mutex);
-
- ut_a(trx_start(trx, ULINT_UNDEFINED));
- /*-----------------------------------*/
-
- fork1 = que_fork_create(NULL, NULL, QUE_FORK_INSERT, heap);
- fork1->trx = trx;
-
- thr = que_thr_create(fork1, fork1, heap);
-
- table = dict_table_get("TS_TABLE3", trx);
-
- row = dtuple_create(heap, 3 + DATA_N_SYS_COLS);
-
- dict_table_copy_types(row, table);
-
- inode = ins_node_create(fork1, thr, row, table, heap);
-
- thr->child = inode;
-
- row_ins_init_sys_fields_at_sql_compile(inode->row, inode->table, heap);
- row_ins_init_sys_fields_at_sql_prepare(inode->row, inode->table, trx);
-
- inode->init_all_sys_fields = FALSE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork1, trx->sess);
-
- trx->graph = fork1;
-
- mutex_exit(&kernel_mutex);
-
- fork2 = que_fork_create(NULL, NULL, QUE_FORK_UPDATE, heap);
- fork2->trx = trx;
-
- thr = que_thr_create(fork2, fork2, heap);
-
- table2 = dict_table_get("TS_TABLE2", trx);
-
- update = upd_create(1, heap);
-
- entry = dtuple_create(heap, 2);
- dfield_copy(dtuple_get_nth_field(entry, 0),
- dtuple_get_nth_field(row, 0));
- dfield_copy(dtuple_get_nth_field(entry, 1),
- dtuple_get_nth_field(row, 1));
-
- node = upd_node_create(fork2, thr, table2, &pcur, update, heap);
- thr->child = node;
-
- node->cmpl_info = UPD_NODE_NO_ORD_CHANGE | UPD_NODE_NO_SIZE_CHANGE;
-
- mutex_enter(&kernel_mutex);
-
- que_graph_publish(fork2, trx->sess);
-
- trx->graph = fork2;
-
- mutex_exit(&kernel_mutex);
-
- cfork = que_fork_create(NULL, NULL, QUE_FORK_EXECUTE, heap);
- cfork->trx = trx;
-
- thr = que_thr_create(cfork, cfork, heap);
-
- thr->child = commit_node_create(cfork, thr, heap);
-
- oldtm = ut_clock();
-loop:
- /*-------------------------------------*/
- /* INSERT */
-
-/* printf("Trx %lu %lu starts, thr %lu\n",
- ut_dulint_get_low(trx->id),
- (ulint)trx,
- *((ulint*)arg)); */
-
- dtuple_gen_test_tuple3(row, count, DTUPLE_TEST_FIXED30, buf);
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(fork1, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- /*-------------------------------------*/
- /* 3 UPDATES */
-
- for (i = 0; i < 3; i++) {
-
- dtuple_gen_search_tuple3(entry, *((ulint*)arg), buf);
-
- index = dict_table_get_first_index(table2);
- tree = dict_index_get_tree(index);
-
- btr_pcur_set_mtr(&pcur, &mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_open(tree, entry, PAGE_CUR_G, BTR_MODIFY_LEAF, &pcur, &mtr);
-
-/* btr_pcur_store_position(&pcur, &mtr); */
-
- err = lock_clust_rec_read_check_and_lock(0, btr_pcur_get_rec(&pcur),
- index, LOCK_X, thr);
- ut_a(err == DB_SUCCESS);
-
- ufield = upd_get_nth_field(update, 0);
-
- ufield->col_no = 2;
- dfield_set_data(&(ufield->new_val),
- "updated field1234567890123456", 30);
-
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(fork2, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
- } /* for (i = ... */
-
- /*-------------------------------------*/
- /* COMMIT */
-#ifdef notdefined
- mutex_enter(&kernel_mutex);
-
- thr = que_fork_start_command(cfork, SESS_COMM_EXECUTE, 0);
-
- mutex_exit(&kernel_mutex);
-
- que_run_threads(thr);
-
-/* printf("Trx %lu %lu committed\n", ut_dulint_get_low(trx->id),
- (ulint)trx); */
-#endif
- count++;
-
- if (count < 1000) {
- ut_a(trx_start(trx, ULINT_UNDEFINED));
-
- goto loop;
- }
-
- tm = ut_clock();
- printf("Wall time for TPC-A %lu trxs %lu milliseconds\n",
- count, tm - oldtm);
-
- /*-------------------------------------*/
-/* dict_table_print_by_name("TS_TABLE2");
- dict_table_print_by_name("TS_TABLE3"); */
-
- return(0);
-}
-
-/********************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
- os_thread_id_t id[5];
- ulint n1000[5];
- ulint i;
- ulint n5000 = 500;
-
- srv_boot("initfile");
- os_aio_init(160, 5);
- fil_init(25);
- buf_pool_init(POOL_SIZE, POOL_SIZE);
- fsp_init();
- log_init();
-
- create_files();
- init_space();
-
- sess_sys_init_at_db_start();
-
- trx_sys_create();
-
- lock_sys_create(1024);
-
- dict_create();
-
- oldtm = ut_clock();
-
- ut_rnd_set_seed(19);
-
- test1(NULL);
- test1_5(NULL);
- test1_6(NULL);
- test4_5(NULL);
-
- for (i = 1; i < 5; i++) {
- n1000[i] = i;
- id[i] = id[i];
-/* os_thread_create(test5, n1000 + i, id + i); */
- }
-
-/* mem_print_info(); */
-
-/* test2(&n5000); */
-
- n5000 = 30;
-
- test5(&n5000);
-
- n5000 = 30;
-/* test5(&n5000); */
-
-/* mem_print_info(); */
-
-/* dict_table_print_by_name("TS_TABLE1"); */
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/trx/ts/tsttrxold.c b/innobase/trx/ts/tsttrxold.c
deleted file mode 100644
index 13faa7ac79f..00000000000
--- a/innobase/trx/ts/tsttrxold.c
+++ /dev/null
@@ -1,1089 +0,0 @@
-/************************************************************************
-Test for the transaction system
-
-(c) 1994-1997 Innobase Oy
-
-Created 2/16/1996 Heikki Tuuri
-*************************************************************************/
-
-#include "sync0sync.h"
-#include "ut0mem.h"
-#include "mem0mem.h"
-#include "data0data.h"
-#include "data0type.h"
-#include "dict0dict.h"
-#include "buf0buf.h"
-#include "os0file.h"
-#include "fil0fil.h"
-#include "fsp0fsp.h"
-#include "rem0rec.h"
-#include "rem0cmp.h"
-#include "mtr0mtr.h"
-#include "log0log.h"
-#include "page0page.h"
-#include "page0cur.h"
-#include "trx0trx.h"
-#include "dict0boot.h"
-#include "trx0sys.h"
-#include "dict0crea.h"
-#include "btr0btr.h"
-#include "btr0pcur.h"
-#include "rem0rec.h"
-
-os_file_t files[1000];
-
-mutex_t ios_mutex;
-ulint ios;
-ulint n[10];
-
-mutex_t incs_mutex;
-ulint incs;
-
-byte bigbuf[1000000];
-
-#define N_SPACES 1
-#define N_FILES 1
-#define FILE_SIZE 4000 /* must be > 512 */
-#define POOL_SIZE 1000
-#define COUNTER_OFFSET 1500
-
-#define LOOP_SIZE 150
-#define N_THREADS 5
-
-
-ulint zero = 0;
-
-buf_block_t* bl_arr[POOL_SIZE];
-
-/************************************************************************
-Io-handler thread function. */
-
-ulint
-handler_thread(
-/*===========*/
- void* arg)
-{
- ulint segment;
- void* mess;
- ulint i;
- bool ret;
-
- segment = *((ulint*)arg);
-
- printf("Io handler thread %lu starts\n", segment);
-
- for (i = 0;; i++) {
- ret = fil_aio_wait(segment, &mess);
- ut_a(ret);
-
- buf_page_io_complete((buf_block_t*)mess);
-
- mutex_enter(&ios_mutex);
- ios++;
- mutex_exit(&ios_mutex);
-
- }
-
- return(0);
-}
-
-/*************************************************************************
-Creates the files for the file system test and inserts them to
-the file system. */
-
-void
-create_files(void)
-/*==============*/
-{
- bool ret;
- ulint i, k;
- char name[20];
- os_thread_t thr[5];
- os_thread_id_t id[5];
-
- printf("--------------------------------------------------------\n");
- printf("Create or open database files\n");
-
- strcpy(name, "tsfile00");
-
- for (k = 0; k < N_SPACES; k++) {
- for (i = 0; i < N_FILES; i++) {
-
- name[6] = (char)((ulint)'0' + k);
- name[7] = (char)((ulint)'0' + i);
-
- files[i] = os_file_create(name, OS_FILE_CREATE,
- OS_FILE_TABLESPACE, &ret);
-
- if (ret == FALSE) {
- ut_a(os_file_get_last_error() ==
- OS_FILE_ALREADY_EXISTS);
-
- files[i] = os_file_create(
- name, OS_FILE_OPEN,
- OS_FILE_TABLESPACE, &ret);
-
- ut_a(ret);
- }
-
- ret = os_file_close(files[i]);
- ut_a(ret);
-
- if (i == 0) {
- fil_space_create(name, k, OS_FILE_TABLESPACE);
- }
-
- ut_a(fil_validate());
-
- fil_node_create(name, FILE_SIZE, k);
- }
- }
-
- ios = 0;
-
- mutex_create(&ios_mutex);
-
- for (i = 0; i < 5; i++) {
- n[i] = i;
-
- thr[i] = os_thread_create(handler_thread, n + i, id + i);
- }
-}
-
-/************************************************************************
-Inits space header of space 0. */
-
-void
-init_space(void)
-/*============*/
-{
- mtr_t mtr;
-
- printf("Init space header\n");
-
- mtr_start(&mtr);
-
- fsp_header_init(0, FILE_SIZE * N_FILES, &mtr);
-
- mtr_commit(&mtr);
-}
-
-#ifdef notdefined
-
-/*********************************************************************
-Test for index page. */
-
-void
-test1(void)
-/*=======*/
-{
- dtuple_t* tuple;
- mem_heap_t* heap;
- mem_heap_t* heap2;
- ulint rnd = 0;
- dict_index_t* index;
- dict_table_t* table;
- byte buf[16];
- ulint i, j;
- ulint tm, oldtm;
- trx_t* trx;
-/* dict_tree_t* tree;*/
- btr_pcur_t pcur;
- btr_pcur_t pcur2;
- mtr_t mtr;
- mtr_t mtr2;
- byte* field;
- ulint len;
- dtuple_t* search_tuple;
- dict_tree_t* index_tree;
- rec_t* rec;
-
- UT_NOT_USED(len);
- UT_NOT_USED(field);
- UT_NOT_USED(pcur2);
-/*
- printf("\n\n\nPress 2 x enter to start test\n");
-
- while (EOF == getchar()) {
-
- }
-
- getchar();
-*/
- printf("-------------------------------------------------\n");
- printf("TEST 1. CREATE TABLE WITH 3 COLUMNS AND WITH 3 INDEXES\n");
-
- heap = mem_heap_create(1024);
- heap2 = mem_heap_create(1024);
-
- trx = trx_start(ULINT_UNDEFINED);
-
- table = dict_mem_table_create("TS_TABLE1", 0, 3);
-
- dict_mem_table_add_col(table, "COL1", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL2", DATA_VARCHAR,
- DATA_ENGLISH, 10, 0);
- dict_mem_table_add_col(table, "COL3", DATA_VARCHAR,
- DATA_ENGLISH, 100, 0);
-
- ut_a(TRUE == dict_create_table(table, trx));
-
- index = dict_mem_index_create("TS_TABLE1", "IND1", 75046,
- DICT_CLUSTERED, 2);
-
- dict_mem_index_add_field(index, "COL1", 0);
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- ut_a(TRUE == dict_create_index(index, trx));
-
- trx_commit(trx);
-
- trx = trx_start(ULINT_UNDEFINED);
-
- index = dict_mem_index_create("TS_TABLE1", "IND2", 0, DICT_UNIQUE, 1);
-
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- ut_a(TRUE == dict_create_index(index, trx));
-
- trx_commit(trx);
-
- trx = trx_start(ULINT_UNDEFINED);
-
- index = dict_mem_index_create("TS_TABLE1", "IND3", 0, DICT_UNIQUE, 1);
-
- dict_mem_index_add_field(index, "COL2", 0);
-
- ut_a(mem_heap_validate(index->heap));
-
- ut_a(TRUE == dict_create_index(index, trx));
-
- trx_commit(trx);
-/*
- tree = dict_index_get_tree(dict_table_get_first_index(table));
-
- btr_print_tree(tree, 10);
-*/
- dict_table_print(table);
-
- /*---------------------------------------------------------*/
-/*
- printf("\n\n\nPress 2 x enter to continue test\n");
-
- while (EOF == getchar()) {
-
- }
- getchar();
-*/
- printf("-------------------------------------------------\n");
- printf("TEST 2. INSERT 1 ROW TO THE TABLE\n");
-
- trx = trx_start(ULINT_UNDEFINED);
-
- tuple = dtuple_create(heap, 3);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- dtuple_gen_test_tuple3(tuple, 0, buf);
- tcur_insert(tuple, table, heap2, trx);
-
- trx_commit(trx);
-/*
- tree = dict_index_get_tree(dict_table_get_first_index(table));
-
- btr_print_tree(tree, 10);
-*/
-/*
- printf("\n\n\nPress 2 x enter to continue test\n");
-
- while (EOF == getchar()) {
-
- }
- getchar();
-*/
- printf("-------------------------------------------------\n");
- printf("TEST 3. INSERT MANY ROWS TO THE TABLE IN A SINGLE TRX\n");
-
- rnd = 0;
- oldtm = ut_clock();
-
- trx = trx_start(ULINT_UNDEFINED);
- for (i = 0; i < 300 * UNIV_DBC * UNIV_DBC; i++) {
-
- if (i % 5000 == 0) {
- /* dict_table_print(table);
- buf_print();
- buf_LRU_print();
- printf("%lu rows inserted\n", i); */
- }
-
- table = dict_table_get("TS_TABLE1", trx);
-
- if (i == 2180) {
- rnd = rnd % 200000;
- }
-
- rnd = (rnd + 1) % 200000;
-
- dtuple_gen_test_tuple3(tuple, rnd, buf);
-
- tcur_insert(tuple, table, heap2, trx);
-
- mem_heap_empty(heap2);
-
- if (i % 4 == 3) {
- }
- }
- trx_commit(trx);
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
- printf("%lu rows inserted\n", i);
-/*
- printf("\n\n\nPress 2 x enter to continue test\n");
-
- while (EOF == getchar()) {
-
- }
- getchar();
-*/
- printf("-------------------------------------------------\n");
- printf("TEST 4. PRINT PART OF CONTENTS OF EACH INDEX TREE\n");
-
-/*
- mem_print_info();
-*/
-
-/*
- tree = dict_index_get_tree(dict_table_get_first_index(table));
-
- btr_print_tree(tree, 10);
-
- tree = dict_index_get_tree(dict_table_get_next_index(
- dict_table_get_first_index(table)));
-
- btr_print_tree(tree, 5);
-*/
-/*
- printf("\n\n\nPress 2 x enter to continue test\n");
-
- while (EOF == getchar()) {
-
- }
- getchar();
-*/
-/* mem_print_info(); */
-
- os_thread_sleep(5000000);
-
- for (j = 0; j < 5; j++) {
- printf("-------------------------------------------------\n");
- printf("TEST 5. CALCULATE THE JOIN OF THE TABLE WITH ITSELF\n");
-
- i = 0;
-
- oldtm = ut_clock();
-
- mtr_start(&mtr);
-
- index_tree = dict_index_get_tree(UT_LIST_GET_FIRST(table->indexes));
-
- search_tuple = dtuple_create(heap, 2);
-
- dtuple_gen_search_tuple3(search_tuple, i, buf);
-
- btr_pcur_open(index_tree, search_tuple, PAGE_CUR_GE,
- BTR_SEARCH_LEAF, &pcur, &mtr);
-
- ut_a(btr_pcur_move_to_next(&pcur, &mtr));
-
- while (!btr_pcur_is_after_last_in_tree(&pcur, &mtr)) {
-
- if (i % 20000 == 0) {
- printf("%lu rows joined\n", i);
- }
-
- index_tree = dict_index_get_tree(
- UT_LIST_GET_FIRST(table->indexes));
-
- rec = btr_pcur_get_rec(&pcur);
-
- rec_copy_prefix_to_dtuple(search_tuple, rec, 2, heap2);
-
- mtr_start(&mtr2);
-
- btr_pcur_open(index_tree, search_tuple, PAGE_CUR_GE,
- BTR_SEARCH_LEAF, &pcur2, &mtr2);
-
- btr_pcur_move_to_next(&pcur2, &mtr2);
-
- rec = btr_pcur_get_rec(&pcur2);
-
- field = rec_get_nth_field(rec, 1, &len);
-
- ut_a(len == 8);
-
- ut_a(ut_memcmp(field, dfield_get_data(
- dtuple_get_nth_field(search_tuple, 1)),
- len) == 0);
-
- btr_pcur_close(&pcur2, &mtr);
-
- mem_heap_empty(heap2);
-
- mtr_commit(&mtr2);
-
- btr_pcur_store_position(&pcur, &mtr);
- mtr_commit(&mtr);
-
- mtr_start(&mtr);
-
- btr_pcur_restore_position(BTR_SEARCH_LEAF, &pcur, &mtr);
-
- btr_pcur_move_to_next(&pcur, &mtr);
- i++;
- }
-
- btr_pcur_close(&pcur, &mtr);
- mtr_commit(&mtr);
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
- printf("%lu rows joined\n", i);
- }
-
- oldtm = ut_clock();
-
-/*
- printf("\n\n\nPress 2 x enter to continue test\n");
-
- while (EOF == getchar()) {
-
- }
- getchar();
-*/
- printf("-------------------------------------------------\n");
- printf("TEST 6. INSERT MANY ROWS TO THE TABLE IN SEPARATE TRXS\n");
-
- rnd = 200000;
-
- for (i = 0; i < 350; i++) {
-
- if (i % 4 == 0) {
- }
- trx = trx_start(ULINT_UNDEFINED);
-
- table = dict_table_get("TS_TABLE1", trx);
-
- if (i == 2180) {
- rnd = rnd % 200000;
- }
-
- rnd = (rnd + 1) % 200000;
-
- dtuple_gen_test_tuple3(tuple, rnd, buf);
-
- tcur_insert(tuple, table, heap2, trx);
-
- trx_commit(trx);
-
- mem_heap_empty(heap2);
- if (i % 4 == 3) {
- }
- }
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
- printf("%lu rows inserted in %lu transactions\n", i, i);
-/*
- printf("\n\n\nPress 2 x enter to continue test\n");
-
- while (EOF == getchar()) {
-
- }
- getchar();
-*/
- printf("-------------------------------------------------\n");
- printf("TEST 7. PRINT MEMORY ALLOCATION INFO\n");
-
- mem_print_info();
-/*
- printf("\n\n\nPress 2 x enter to continue test\n");
-
- while (EOF == getchar()) {
-
- }
- getchar();
-*/
- printf("-------------------------------------------------\n");
- printf("TEST 8. PRINT SEMAPHORE INFO\n");
-
- sync_print();
-
-#endif
-
-#ifdef notdefined
- rnd = 90000;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1000 * UNIV_DBC * UNIV_DBC; i++) {
-
- mtr_start(&mtr);
-
- if (i == 50000) {
- rnd = rnd % 200000;
- }
-
- rnd = (rnd + 595659561) % 200000;
-
- dtuple_gen_test_tuple3(tuple, rnd, buf);
-
- btr_pcur_open(tree, tuple, PAGE_CUR_GE,
- BTR_SEARCH_LEAF, &cursor, &mtr);
-
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
-
- rnd = 0;
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1000 * UNIV_DBC * UNIV_DBC; i++) {
-
- mtr_start(&mtr);
-
- rnd = (rnd + 35608971) % 200000 + 1;
-
- dtuple_gen_test_tuple3(tuple, rnd, buf);
-
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
-
-/* btr_print_tree(tree, 3); */
-
-#endif
-/*
- mem_heap_free(heap);
-}
-*/
-
-#ifdef notdefined
-
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd + 534671) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
-/* page_print_list(page, 151); */
-
- ut_a(page_validate(page, index));
- ut_a(page_get_n_recs(page) == 512);
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd + 7771) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- page_cur_delete_rec(&cursor, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
- ut_a(page_get_n_recs(page) == 0);
-
- ut_a(page_validate(page, index));
- page = page_create(frame, &mtr);
-
- rnd = 311;
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd + 1) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
- ut_a(page_validate(page, index));
- ut_a(page_get_n_recs(page) == 512);
-
- rnd = 217;
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd + 1) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- page_cur_delete_rec(&cursor, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
- ut_a(page_validate(page, index));
- ut_a(page_get_n_recs(page) == 0);
- page = page_create(frame, &mtr);
-
- rnd = 291;
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd - 1) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
- ut_a(page_validate(page, index));
- ut_a(page_get_n_recs(page) == 512);
-
- rnd = 277;
-
- for (i = 0; i < 512; i++) {
-
- rnd = (rnd - 1) % 512;
-
- if (i % 27 == 0) {
- ut_a(page_validate(page, index));
- }
-
- dtuple_gen_test_tuple(tuple, rnd);
-
-/* dtuple_print(tuple);*/
-
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- page_cur_delete_rec(&cursor, &mtr);
-
- ut_a(rec);
-
- rec_validate(rec);
-/* page_print_list(page, 151); */
- }
-
- ut_a(page_validate(page, index));
- ut_a(page_get_n_recs(page) == 0);
-
- mtr_commit(&mtr);
- mem_heap_free(heap);
-}
-
-/*********************************************************************
-Test for index page. */
-
-void
-test2(void)
-/*=======*/
-{
- page_t* page;
- dtuple_t* tuple;
- mem_heap_t* heap;
- ulint i, j;
- ulint rnd = 0;
- rec_t* rec;
- page_cur_t cursor;
- dict_index_t* index;
- dict_table_t* table;
- buf_block_t* block;
- buf_frame_t* frame;
- ulint tm, oldtm;
- byte buf[8];
- mtr_t mtr;
-
- printf("-------------------------------------------------\n");
- printf("TEST 2. Speed test\n");
-
- oldtm = ut_clock();
-
- for (i = 0; i < 1000 * UNIV_DBC * UNIV_DBC; i++) {
- ut_memcpy(bigbuf, bigbuf + 800, 800);
- }
-
- tm = ut_clock();
- printf("Wall time for %lu mem copys of 800 bytes %lu millisecs\n",
- i, tm - oldtm);
-
- oldtm = ut_clock();
-
- rnd = 0;
- for (i = 0; i < 1000 * UNIV_DBC * UNIV_DBC; i++) {
- ut_memcpy(bigbuf + rnd, bigbuf + rnd + 800, 800);
- rnd += 1600;
- if (rnd > 995000) {
- rnd = 0;
- }
- }
-
- tm = ut_clock();
- printf("Wall time for %lu mem copys of 800 bytes %lu millisecs\n",
- i, tm - oldtm);
-
- heap = mem_heap_create(0);
-
- table = dict_table_create("TS_TABLE2", 2);
-
- dict_table_add_col(table, "COL1", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
- dict_table_add_col(table, "COL2", DATA_VARCHAR, DATA_ENGLISH, 10, 0);
-
- ut_a(0 == dict_table_publish(table));
-
- index = dict_index_create("TS_TABLE2", "IND2", 0, 2, 0);
-
- dict_index_add_field(index, "COL1", 0);
- dict_index_add_field(index, "COL2", 0);
-
- ut_a(0 == dict_index_publish(index));
-
- index = dict_index_get("TS_TABLE2", "IND2");
- ut_a(index);
-
- tuple = dtuple_create(heap, 2);
-
- oldtm = ut_clock();
-
- rnd = 677;
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
-
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
- ut_a(rec);
- }
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf("Wall time for insertion of %lu recs %lu milliseconds\n",
- i * j, tm - oldtm);
-
- mtr_start(&mtr);
-
- block = buf_page_get(0, 5, &mtr);
- buf_page_s_lock(block, &mtr);
-
- page = buf_block_get_frame(block);
- ut_a(page_validate(page, index));
- mtr_commit(&mtr);
-
- oldtm = ut_clock();
-
- rnd = 677;
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- }
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf(
- "Wall time for %lu empty loops with page create %lu milliseconds\n",
- i * j, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
-
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- rnd = 100;
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 1) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
- ut_a(rec);
- }
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf(
- "Wall time for sequential insertion of %lu recs %lu milliseconds\n",
- i * j, tm - oldtm);
-
-
- oldtm = ut_clock();
-
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- rnd = 500;
- for (j = 0; j < 250; j++) {
- rnd = (rnd - 1) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
- ut_a(rec);
- }
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf(
- "Wall time for descend. seq. insertion of %lu recs %lu milliseconds\n",
- i * j, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- rnd = 677;
-
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
- ut_a(rec);
- }
-
- rnd = 677;
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- page_cur_delete_rec(&cursor, &mtr);
- }
- ut_a(page_get_n_recs(page) == 0);
-
- mtr_commit(&mtr);
- }
-
- tm = ut_clock();
- printf("Wall time for insert and delete of %lu recs %lu milliseconds\n",
- i * j, tm - oldtm);
-
- mtr_start(&mtr);
-
- block = buf_page_create(0, 5, &mtr);
- buf_page_x_lock(block, &mtr);
-
- frame = buf_block_get_frame(block);
-
- page = page_create(frame, &mtr);
-
- rnd = 677;
-
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
-
- rec = page_cur_insert_rec(&cursor, tuple, NULL, &mtr);
- ut_a(rec);
- }
- ut_a(page_validate(page, index));
- mtr_print(&mtr);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
- rnd = 677;
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- page_cur_search(page, tuple, PAGE_CUR_G, &cursor);
- }
- }
-
- tm = ut_clock();
- printf("Wall time for search of %lu recs %lu milliseconds\n",
- i * j, tm - oldtm);
-
- oldtm = ut_clock();
-
- for (i = 0; i < 4 * UNIV_DBC * UNIV_DBC; i++) {
- rnd = 677;
- for (j = 0; j < 250; j++) {
- rnd = (rnd + 54841) % 1000;
- dtuple_gen_test_tuple2(tuple, rnd, buf);
- }
- }
-
- tm = ut_clock();
- printf("Wall time for %lu empty loops %lu milliseconds\n",
- i * j, tm - oldtm);
- mtr_commit(&mtr);
-}
-
-#endif
-
-/********************************************************************
-Main test function. */
-
-void
-main(void)
-/*======*/
-{
- ulint tm, oldtm;
- mtr_t mtr;
-
- sync_init();
- mem_init();
- os_aio_init(160, 5);
- fil_init(25);
- buf_pool_init(POOL_SIZE, POOL_SIZE);
- fsp_init();
- log_init();
-
- create_files();
- init_space();
-
- mtr_start(&mtr);
-
- trx_sys_create(&mtr);
- dict_create(&mtr);
-
- mtr_commit(&mtr);
-
-
- oldtm = ut_clock();
-
- ut_rnd_set_seed(19);
-
- test1();
-
-/* mem_print_info(); */
-
- tm = ut_clock();
- printf("Wall time for test %lu milliseconds\n", tm - oldtm);
- printf("TESTS COMPLETED SUCCESSFULLY!\n");
-}
diff --git a/innobase/usr/usr0sess.c b/innobase/usr/usr0sess.c
index d74153e323f..359c1552421 100644
--- a/innobase/usr/usr0sess.c
+++ b/innobase/usr/usr0sess.c
@@ -12,327 +12,54 @@ Created 6/25/1996 Heikki Tuuri
#include "usr0sess.ic"
#endif
-#include "ut0rnd.h"
-#include "mach0data.h"
-#include "ha0ha.h"
#include "trx0trx.h"
-#include "que0que.h"
-#include "pars0pars.h"
-#include "pars0sym.h"
-#include "dict0dict.h"
-#include "dict0mem.h"
-#include "odbc0odbc.h"
-
-#define SESS_ERR_BUF_SIZE 8192
-
-/* The session system global data structure */
-sess_sys_t* sess_sys = NULL;
-
-/*************************************************************************
-Communicates an error message to the client. If sess->client_waits is not
-TRUE, puts the session to error state and does not try to send the error
-message. */
-static
-void
-sess_srv_msg_send_error(
-/*====================*/
- sess_t* sess); /* in: session object */
-/*************************************************************************
-Copies error info to a session. Sends to the transaction a signal which will
-rollback the latest incomplete SQL statement and then send the error message
-to the client. NOTE: This function will take care of the freeing of the error
-string, thus the caller must supply a copy of the error string. */
-static
-void
-sess_error_low(
-/*===========*/
- sess_t* sess, /* in: session object */
- ulint err_no, /* in: error number */
- char* err_str);/* in, own: error string or NULL;
- NOTE: the function will take care of freeing of the
- string! */
-
-/*************************************************************************
-Folds a session id to a ulint. Because this function is used also in
-calculating a checksum for the id to write in the message, it is performs
-also a XOR operation to mix the values more thoroughly. */
-UNIV_INLINE
-ulint
-sess_id_fold(
-/*=========*/
- /* out: folded value; can be used also as the checksum
- for id */
- dulint id) /* in: session id */
-{
- return(ut_fold_dulint(id) ^ 2945794411U);
-}
/*************************************************************************
-Sets the session id in a client message. */
-
-void
-sess_cli_msg_set_sess(
-/*==================*/
- byte* str, /* in/out: message string */
- dulint sess_id)/* in: session id */
-{
- ulint fold;
-
- mach_write_to_8(str + SESS_CLI_MSG_SESS_ID, sess_id);
-
- fold = sess_id_fold(sess_id);
-
- mach_write_to_4(str + SESS_CLI_MSG_SESS_ID_CHECK, fold);
-}
-
-/*************************************************************************
-Returns the session to which a message from a client is addressed.
-NOTE: this function does not assume that the message is uncorrupted. */
+Closes a session, freeing the memory occupied by it. */
static
-sess_t*
-sess_cli_msg_get_sess(
-/*==================*/
- /* out: session, NULL if not found */
- byte* str, /* in: message string */
- ulint len) /* in: message string length */
-{
- sess_t* sess;
- ulint fold;
- dulint id;
-
- ut_ad(mutex_own(&kernel_mutex));
-
- if (len < SESS_CLI_MSG_SESS_ID_CHECK + 4) {
-
- return(NULL);
- }
-
- id = mach_read_from_8(str + SESS_CLI_MSG_SESS_ID);
-
- fold = sess_id_fold(id);
-
- if (fold != mach_read_from_4(str + SESS_CLI_MSG_SESS_ID_CHECK)) {
-
- return(NULL);
- }
-
- HASH_SEARCH(hash, sess_sys->hash, fold, sess,
- UT_DULINT_EQ(id, sess->id));
- return(sess);
-}
-
-/***************************************************************************
-Decrements the reference count of a session and closes it, if desired. */
-UNIV_INLINE
-void
-sess_refer_count_dec(
-/*=================*/
- sess_t* sess) /* in: session */
-{
- ut_ad(mutex_own(&kernel_mutex));
- ut_ad(sess->refer_count > 0);
-
- sess->refer_count--;
-
- if (sess->disconnecting && (sess->refer_count == 0)) {
-
- sess_close(sess);
- }
-}
-
-/***************************************************************************
-Increments the reference count of a session. */
-UNIV_INLINE
void
-sess_refer_count_inc(
-/*=================*/
- sess_t* sess) /* in: session */
-{
- ut_ad(mutex_own(&kernel_mutex));
-
- sess->refer_count++;
-}
-
-/***************************************************************************
-Creates a session system at a database start. */
-
-void
-sess_sys_init_at_db_start(void)
-/*===========================*/
-{
- sess_sys = mem_alloc(sizeof(sess_sys_t));
-
- sess_sys->state = SESS_SYS_RUNNING;
- sess_sys->free_sess_id = ut_dulint_create(0, 1);
- sess_sys->hash = hash_create(SESS_HASH_SIZE);
-}
-
-/***************************************************************************
-Gets the message type of a message from client. */
-UNIV_INLINE
-ulint
-sess_cli_msg_get_type(
-/*==================*/
- /* out: message type */
- byte* str) /* in: message string */
-{
- ut_ad(mutex_own(&kernel_mutex));
-
- return(mach_read_from_4(str + SESS_CLI_MSG_TYPE));
-}
-
-/***************************************************************************
-Gets the message number of a message from client. */
-UNIV_INLINE
-dulint
-sess_cli_msg_get_msg_no(
-/*====================*/
- /* out: message number */
- byte* str) /* in: message string */
-{
- ut_ad(mutex_own(&kernel_mutex));
-
- return(mach_read_from_8(str + SESS_CLI_MSG_NO));
-}
-
-/***************************************************************************
-Gets the continue field of a message from client. */
-UNIV_INLINE
-ulint
-sess_cli_msg_get_continue(
-/*======================*/
- /* out: SESS_MSG_SINGLE_PART, ... */
- byte* str) /* in: message string */
-{
- ut_ad(mutex_own(&kernel_mutex));
-
- return(mach_read_from_4(str + SESS_CLI_MSG_CONTINUE));
-}
-
-/***************************************************************************
-Gets the size of a big message in kilobytes. */
-UNIV_INLINE
-ulint
-sess_cli_msg_get_cont_size(
-/*=======================*/
- /* out: size in kilobytes */
- byte* str) /* in: message string */
-{
- ut_ad(mutex_own(&kernel_mutex));
-
- return(mach_read_from_4(str + SESS_CLI_MSG_CONT_SIZE));
-}
-
-/*************************************************************************
-Checks the consistency of a message from a client. */
-UNIV_INLINE
-ibool
-sess_cli_msg_check_consistency(
-/*===========================*/
- /* out: TRUE if ok */
- byte* str, /* in: message string */
- ulint len) /* in: message string length */
-{
- ulint fold;
-
- ut_ad(mutex_own(&kernel_mutex));
-
- if (len < SESS_CLI_MSG_DATA) {
-
- return(FALSE);
- }
-
- ut_ad(SESS_CLI_MSG_CHECKSUM == 0);
-
- fold = ut_fold_binary(str + 4, len - 4);
-
- if (mach_read_from_4(str + SESS_CLI_MSG_CHECKSUM) != fold) {
-
- return(FALSE);
- }
-
- return(TRUE);
-}
+sess_close(
+/*=======*/
+ sess_t* sess); /* in, own: session object */
/*************************************************************************
Opens a session. */
sess_t*
-sess_open(
-/*======*/
+sess_open(void)
+/*===========*/
/* out, own: session object */
- com_endpoint_t* endpoint, /* in: communication endpoint used
- for receiving messages from the client,
- or NULL if no client */
- byte* addr_buf, /* in: client address (= user name) */
- ulint addr_len) /* in: client address length */
{
sess_t* sess;
- ulint fold;
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
-
+#endif /* UNIV_SYNC_DEBUG */
sess = mem_alloc(sizeof(sess_t));
- sess->id = sess_sys->free_sess_id;
- UT_DULINT_INC(sess_sys->free_sess_id);
-
sess->state = SESS_ACTIVE;
- sess->disconnecting = FALSE;
- sess->msgs_sent = ut_dulint_zero;
- sess->msgs_recv = ut_dulint_zero;
- sess->client_waits = TRUE;
- sess->err_no = 0;
- sess->err_str = NULL;
- sess->error_count = ut_dulint_zero;
-
- sess->big_msg = NULL;
sess->trx = trx_create(sess);
- sess->next_graph_id = 0;
-
UT_LIST_INIT(sess->graphs);
- fold = sess_id_fold(sess->id);
-
- HASH_INSERT(sess_t, hash, sess_sys->hash, fold, sess);
-
- sess->endpoint = endpoint;
- sess->addr_buf = mem_alloc(addr_len);
-
- ut_memcpy(sess->addr_buf, addr_buf, addr_len);
-
- sess->addr_len = addr_len;
-
return(sess);
}
/*************************************************************************
Closes a session, freeing the memory occupied by it. */
+static
void
sess_close(
/*=======*/
sess_t* sess) /* in, own: session object */
{
- ulint fold;
-
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
- ut_ad(sess->disconnecting);
+#endif /* UNIV_SYNC_DEBUG */
ut_ad(sess->trx == NULL);
- ut_ad(sess->refer_count == 0);
-
- fold = ut_fold_dulint(sess->id);
- HASH_DELETE(sess_t, hash, sess_sys->hash, fold, sess);
-
-/* sess_reply_to_client_rel_kernel(sess); */
-
- if (sess->err_str != NULL) {
- mem_free(sess->err_str);
- }
- mem_free(sess->addr_buf);
mem_free(sess);
}
@@ -346,10 +73,10 @@ sess_try_close(
/* out: TRUE if closed */
sess_t* sess) /* in, own: session object */
{
+#ifdef UNIV_SYNC_DEBUG
ut_ad(mutex_own(&kernel_mutex));
-
- if (sess->disconnecting && (UT_LIST_GET_LEN(sess->graphs) == 0)
- && (sess->refer_count == 0)) {
+#endif /* UNIV_SYNC_DEBUG */
+ if (UT_LIST_GET_LEN(sess->graphs) == 0) {
sess_close(sess);
return(TRUE);
@@ -357,818 +84,3 @@ sess_try_close(
return(FALSE);
}
-
-/*************************************************************************
-Initializes the first fields of a message to client. */
-
-void
-sess_srv_msg_init(
-/*==============*/
- sess_t* sess, /* in: session object */
- byte* buf, /* in: message buffer, must be at least of size
- SESS_SRV_MSG_DATA */
- ulint type) /* in: message type */
-{
- ut_ad(mutex_own(&kernel_mutex));
-
- sess->msgs_sent = ut_dulint_add(sess->msgs_sent, 1);
-
- mach_write_to_8(buf + SESS_SRV_MSG_SESS_ID, sess->id);
- mach_write_to_4(buf + SESS_SRV_MSG_TYPE, type);
- mach_write_to_8(buf + SESS_SRV_MSG_NO, sess->msgs_sent);
-
- ut_ad(com_endpoint_get_max_size(sess->endpoint) >= SESS_SRV_MSG_DATA);
-}
-
-/*************************************************************************
-Sends a message to the client. */
-static
-ulint
-sess_srv_msg_send_low(
-/*==================*/
- /* out: 0 if success, else error number */
- sess_t* sess, /* in: session object */
- byte* buf, /* in: message buffer */
- ulint len, /* in: message length */
- ulint rel_ker)/* in: SESS_RELEASE_KERNEL if the kernel mutex should
- be temporarily released in the call; otherwise
- SESS_NOT_RELEASE_KERNEL */
-{
- ulint ret;
-
- ut_ad((rel_ker == SESS_NOT_RELEASE_KERNEL)
- || (rel_ker == SESS_RELEASE_KERNEL));
- ut_ad(mutex_own(&kernel_mutex));
- ut_ad(len <= com_endpoint_get_max_size(sess->endpoint));
- ut_ad(len >= SESS_SRV_MSG_DATA);
-
- if (sess->client_waits == FALSE) {
- sess_error_low(sess, SESS_ERR_EXTRANEOUS_SRV_MSG, NULL);
-
- return(1);
- }
-
- /* The client will now receive an error message: if the session is
- in the error state, we can reset it to the normal state */
-
- if (sess->state == SESS_ERROR) {
- sess->state = SESS_ACTIVE;
- }
-
- /* We reset the client_waits flag to FALSE, regardless of whether the
- message gets delivered to the client or not. This convention makes
- things simpler. */
-
- sess->client_waits = FALSE;
-
- if (rel_ker == SESS_RELEASE_KERNEL) {
-
- mutex_exit(&kernel_mutex);
- }
-
- ret = com_sendto(sess->endpoint, buf, len, sess->addr_buf,
- sess->addr_len);
- if (rel_ker == SESS_RELEASE_KERNEL) {
-
- mutex_enter(&kernel_mutex);
- }
-
- if (ret != 0) {
- sess_error_low(sess, SESS_ERR_REPLY_FAILED, NULL);
- }
-
- return(ret);
-}
-
-/*************************************************************************
-Sends a message to the client. If the session is in the error state, sends
-the error message instead of buf. */
-static
-ulint
-sess_srv_msg_send(
-/*==============*/
- /* out: 0 if success, else error number */
- sess_t* sess, /* in: session object */
- byte* buf, /* in: message buffer */
- ulint len, /* in: message length */
- ulint rel_ker)/* in: SESS_RELEASE_KERNEL if the kernel mutex should
- be temporarily released in the call; otherwise
- SESS_NOT_RELEASE_KERNEL */
-{
- ulint ret;
-
- ut_ad(mutex_own(&kernel_mutex));
-
- if (sess->state == SESS_ERROR) {
-
- sess_srv_msg_send_error(sess);
-
- return(2);
- }
-
- ret = sess_srv_msg_send_low(sess, buf, len, rel_ker);
-
- return(ret);
-}
-
-/*************************************************************************
-Sends a simple message to client. */
-
-void
-sess_srv_msg_send_simple(
-/*=====================*/
- sess_t* sess, /* in: session object */
- ulint type, /* in: message type */
- ulint rel_kernel) /* in: SESS_RELEASE_KERNEL or
- SESS_NOT_RELEASE_KERNEL */
-{
- byte buf[SESS_SRV_MSG_DATA];
-
- ut_ad(mutex_own(&kernel_mutex));
-
- sess_srv_msg_init(sess, buf, type);
-
- sess_srv_msg_send(sess, buf, SESS_SRV_MSG_DATA, rel_kernel);
-}
-
-/*************************************************************************
-Communicates an error message to the client. If sess->client_waits is not
-TRUE, puts the session to error state and does not try to send the error
-message. */
-static
-void
-sess_srv_msg_send_error(
-/*====================*/
- sess_t* sess) /* in: session object */
-{
- ulint err_no;
- byte* err_str;
- ulint err_len;
- ulint max_len;
- byte buf[SESS_ERR_BUF_SIZE];
- ulint ret;
-
- ut_ad(sess->client_waits);
- ut_ad(mutex_own(&kernel_mutex));
- ut_ad(sess->state == SESS_ERROR);
- ut_ad(!UT_LIST_GET_FIRST((sess->trx)->signals));
-
- if (!sess->client_waits) {
- /* Cannot send the error message now: leave the session to
- the error state and send it later */
-
- return;
- }
-
- err_no = sess->err_no;
- err_str = (byte*)sess->err_str;
- err_len = sess->err_len;
-
- max_len = ut_min(SESS_ERR_BUF_SIZE,
- com_endpoint_get_max_size(sess->endpoint));
-
- sess_srv_msg_init(sess, buf, SESS_SRV_ERROR);
-
- if (err_len + SESS_SRV_MSG_DATA > max_len) {
-
- err_len = max_len - SESS_SRV_MSG_DATA;
- }
-
- ut_memcpy(buf + SESS_SRV_MSG_DATA, err_str, err_len);
-
- ret = sess_srv_msg_send_low(sess, buf, SESS_SRV_MSG_DATA + err_len,
- SESS_NOT_RELEASE_KERNEL);
-}
-
-/*************************************************************************
-Copies error info to a session. Sends to the transaction a signal which will
-rollback the latest incomplete SQL statement and then send the error message
-to the client. NOTE: This function will take care of the freeing of the error
-string, thus the caller must supply a copy of the error string. */
-static
-void
-sess_error_low(
-/*===========*/
- sess_t* sess, /* in: session object */
- ulint err_no, /* in: error number */
- char* err_str)/* in, own: error string or NULL;
- NOTE: the function will take care of freeing of the
- string! */
-{
- ut_ad(mutex_own(&kernel_mutex));
-
- UT_DULINT_INC(sess->error_count);
-
- printf("Error string::: %s\n", err_str);
-
- if (sess->state == SESS_ERROR) {
- /* Ignore the error because the session is already in the
- error state */
-
- if (err_str) {
- mem_free(err_str);
- }
-
- return;
- }
-
- sess->err_no = err_no;
-
- if (sess->err_str) {
- mem_free(sess->err_str);
- }
-
- sess->err_str = err_str;
- sess->err_len = ut_strlen(err_str);
- sess->state = SESS_ERROR;
-
- if (sess->big_msg) {
-
- mem_free(sess->big_msg);
- }
-
- /* Send a signal which will roll back the latest incomplete SQL
- statement: the error message will be sent to the client by the error
- handling mechanism after the rollback is completed. */
-
- trx_sig_send(sess->trx, TRX_SIG_ERROR_OCCURRED, TRX_SIG_SELF, FALSE,
- NULL, NULL, NULL);
-}
-
-/*************************************************************************
-Raises an SQL error. */
-
-void
-sess_raise_error_low(
-/*=================*/
- trx_t* trx, /* in: transaction */
- ulint err_no, /* in: error number */
- ulint type, /* in: more info of the error, or 0 */
- dict_table_t* table, /* in: dictionary table or NULL */
- dict_index_t* index, /* in: table index or NULL */
- dtuple_t* tuple, /* in: tuple to insert or NULL */
- rec_t* rec, /* in: record or NULL */
- char* err_str)/* in: arbitrary null-terminated error string,
- or NULL */
-{
- char* str;
- ulint len;
-
- ut_ad(mutex_own(&kernel_mutex));
-
- str = mem_alloc(64000);
-
- len = 0;
-
- len += sprintf(str + len, "Error number: %lu", (ulong) err_no);
-
- if (type) {
- len += sprintf(str + len, ", type: %lu", (ulong) type);
- }
-
- if (table) {
- len += sprintf(str + len, ", table: %s", table->name);
- }
-
- if (index) {
- len += sprintf(str + len, ", index: %s", index->name);
- }
-
- if (tuple) {
- len += sprintf(str + len, ", tuple:");
- len += dtuple_sprintf(str + len, 8192, tuple);
- }
-
- if (rec) {
- len += sprintf(str + len, ", record:");
- len += rec_sprintf(str + len, 8192, rec);
- }
-
- if (err_str) {
- len += sprintf(str + len, ", %s", err_str);
- }
-
- str[len] = '\0';
-
- ut_a(len < 64000);
-
- if (trx->sess) {
- sess_error_low(trx->sess, err_no, str);
- } else {
- mem_free(str);
- }
-}
-
-/***************************************************************************
-Processes a client message which is part of a bigger message. */
-static
-ibool
-sess_receive_msg_part(
-/*==================*/
- /* TRUE if message completed */
- sess_t* sess, /* in: session */
- byte* str, /* in: message string */
- ulint len) /* in: message length */
-{
- ulint cont;
-
- cont = sess_cli_msg_get_continue(str);
-
- ut_ad(cont != SESS_MSG_SINGLE_PART);
-
- if (cont == SESS_MSG_FIRST_PART) {
- if (sess->big_msg) {
- sess_error_low(sess, SESS_ERR_MSG_LOST, NULL);
-
- return(FALSE);
- }
-
- sess->big_msg_size = 1024 * sess_cli_msg_get_cont_size(str);
- sess->big_msg = mem_alloc(sess->big_msg_size);
-
- if (sess->big_msg == NULL) {
- sess_error_low(sess, SESS_ERR_OUT_OF_MEMORY, NULL);
-
- return(FALSE);
- }
-
- ut_memcpy(sess->big_msg, str, len);
- sess->big_msg_len = len;
-
- return(FALSE);
- } else {
- if (sess->big_msg == NULL) {
- sess_error_low(sess, SESS_ERR_MSG_LOST, NULL);
-
- return(FALSE);
- }
-
- ut_memcpy(sess->big_msg + sess->big_msg_len,
- str + SESS_CLI_MSG_DATA, len - SESS_CLI_MSG_DATA);
-
- sess->big_msg_len += len - SESS_CLI_MSG_DATA;
-
- if (cont == SESS_MSG_MIDDLE_PART) {
-
- return(FALSE);
- }
-
- return(TRUE);
- }
-}
-
-/***************************************************************************
-Processes a client message which requires SQL parsing. This function decodes
-the client message built in SQLPrepare. NOTE: The kernel mutex is temporarily
-released within this function. */
-static
-void
-sess_receive_prepare(
-/*=================*/
- sess_t* sess, /* in: session */
- byte* cli_msg,/* in: client message */
- ulint len) /* in: message length */
-{
- dulint error_count;
- que_t* graph;
- byte msg[ODBC_DATAGRAM_SIZE];
-
- UT_NOT_USED(len);
-
- ut_ad(mutex_own(&kernel_mutex));
-
- error_count = sess->error_count;
-
- /* Make sure the session object is not freed during the parsing */
-
- sess_refer_count_inc(sess);
-
- /* We release the kernel mutex before parsing the command: this is
- to reduce contention on the kernel mutex */
-
- mutex_exit(&kernel_mutex);
-
-/* printf("To parse query %s\n", (char*)(cli_msg + SESS_CLI_MSG_DATA)); */
-
- graph = pars_sql((char*)(cli_msg + SESS_CLI_MSG_DATA));
-
- mutex_enter(&kernel_mutex);
-
- if (graph == NULL) {
- /* Error in parsing */
- sess_error_low(sess, SESS_ERR_SQL_ERROR, NULL);
-
- sess_refer_count_dec(sess);
-
- ut_error;
-
- return;
- }
-
- if (!UT_DULINT_EQ(error_count, sess->error_count)) {
-
- /* An error, or an asyncronous signal on the session happened
- when the kernel mutex was not reserved: discard graph */
-
- graph->state = QUE_FORK_INVALID;
-
- que_graph_try_free(graph);
-
- sess_refer_count_dec(sess);
-
- ut_error;
-
- return;
- }
-
- UT_LIST_ADD_LAST(graphs, sess->graphs, graph);
-
- graph->id = sess->next_graph_id;
- sess->next_graph_id++;
-
- /* Tell the client that the preparation succeeded and communicate info
- about the possible query parameters: the message will be decoded in
- SQLPrepare */
-
- ut_ad(sess->client_waits);
-
- sess_srv_msg_init(sess, msg, SESS_SRV_SUCCESS);
-
- mach_write_to_4(msg + SESS_SRV_MSG_DATA, graph->id);
-
- mutex_exit(&kernel_mutex);
-
- len = pars_write_query_param_info(msg + SESS_SRV_MSG_DATA + 4, graph);
-
- mutex_enter(&kernel_mutex);
-
- sess_srv_msg_send(sess, msg, SESS_SRV_MSG_DATA + 4 + len,
- SESS_RELEASE_KERNEL);
- sess_refer_count_dec(sess);
-}
-
-/***************************************************************************
-Processes a client message which does not require SQL parsing. This function
-decodes the client message built in SQLExecute. */
-static
-void
-sess_receive_command(
-/*=================*/
- sess_t* sess, /* in: session */
- byte* cli_msg,/* in: client message */
- ulint len, /* in: message length */
- ulint type) /* in: message type */
-{
- proc_node_t* proc_node;
- call_node_t* call_node;
- dict_proc_t* dict_proc;
- que_thr_t* thr;
- que_t* graph;
- ulint stat_id;
-
- UT_NOT_USED(len);
- UT_NOT_USED(type);
-
- ut_ad(mutex_own(&kernel_mutex));
-
- sess->client_waits = TRUE;
-
- stat_id = mach_read_from_4(cli_msg + SESS_CLI_MSG_DATA);
-
- /* Look for the statement from the list of query graphs */
-
- graph = UT_LIST_GET_FIRST(sess->graphs);
-
- while (graph != NULL) {
-
- if (graph->id == stat_id) {
-
- break;
- }
-
- graph = UT_LIST_GET_NEXT(graphs, graph);
- }
-
- if (graph == NULL) {
- /* Could not find the right graph: error */
- sess_error_low(sess, SESS_ERR_STMT_NOT_FOUND, NULL);
-
- return;
- }
-
- if (graph->state != QUE_FORK_COMMAND_WAIT) {
- sess_error_low(sess, SESS_ERR_STMT_NOT_READY, NULL);
-
- return;
- }
-
-/* printf("To execute stat %lu\n", stat_id); */
-
- if (graph->fork_type == QUE_FORK_PROCEDURE_CALL) {
- /* It is a stored procedure call: retrieve a parsed copy of
- the procedure from the dictionary cache */
-
- mutex_exit(&kernel_mutex);
-
- call_node = que_fork_get_child(graph);
-
- graph = dict_procedure_reserve_parsed_copy(
- call_node->procedure_def);
- graph->trx = sess->trx;
-
- /* Retrieve the procedure input parameters from the message */
-
- pars_proc_read_input_params_from_buf(graph,
- cli_msg + SESS_CLI_MSG_DATA + 4);
- mutex_enter(&kernel_mutex);
- } else {
- /* It is a create procedure command: add the procedure to the
- dictionary cache */
- ut_ad(graph->fork_type == QUE_FORK_PROCEDURE);
-
- mutex_exit(&kernel_mutex);
-
- proc_node = que_fork_get_child(graph);
-
- dict_proc = dict_mem_procedure_create(proc_node->proc_id->name,
- proc_node->sym_tab->sql_string,
- graph);
-
- dict_procedure_add_to_cache(dict_proc);
-
- mutex_enter(&kernel_mutex);
-
- sess_srv_msg_send_simple(sess, SESS_SRV_SUCCESS,
- SESS_RELEASE_KERNEL);
- return;
- }
-
- /* Choose a query thread for execution */
- thr = que_fork_start_command(graph, SESS_COMM_EXECUTE, 0);
-
- ut_ad(thr);
-
- sess->trx->graph = graph;
-
- mutex_exit(&kernel_mutex);
-
- /* Run query threads with the kernel mutex released */
-
- que_run_threads(thr);
-
- mutex_enter(&kernel_mutex);
-}
-
-/***************************************************************************
-When a command has been completed, this function sends the message about it
-to the client. */
-
-void
-sess_command_completed_message(
-/*===========================*/
- sess_t* sess, /* in: session */
- byte* msg, /* in: message buffer */
- ulint len) /* in: message data length */
-{
- mutex_enter(&kernel_mutex);
-
- sess_srv_msg_send(sess, msg, SESS_SRV_MSG_DATA + len,
- SESS_RELEASE_KERNEL);
- mutex_exit(&kernel_mutex);
-}
-
-/***************************************************************************
-Processes a break message from the client. */
-static
-void
-sess_receive_break(
-/*===============*/
- sess_t* sess) /* in: session */
-{
- ut_ad(mutex_own(&kernel_mutex));
-
- /* Rollback the latest incomplete SQL statement */
-
- sess_error_low(sess, SESS_ERR_BREAK_BY_CLIENT, NULL);
-}
-
-/***************************************************************************
-Processes a message from a client. NOTE: Releases the kernel mutex temporarily
-when parsing an SQL string. */
-
-void
-sess_receive_msg_rel_kernel(
-/*========================*/
- sess_t* sess, /* in: session */
- byte* str, /* in: message string */
- ulint len) /* in: message length */
-{
- dulint msg_no;
- ulint msg_type;
- ulint cont;
- ibool is_big_msg = FALSE;
- ibool client_waited;
-
- ut_ad(mutex_own(&kernel_mutex));
- ut_ad(!sess->disconnecting);
-
- client_waited = sess->client_waits;
-
- sess->client_waits = TRUE;
-
- if (sess->state == SESS_ERROR) {
-
- /* Send a buffered error message */
- sess_srv_msg_send_error(sess);
-
- return;
- }
-
- if (FALSE == sess_cli_msg_check_consistency(str, len)) {
- /* Message from the client was corrupted */
-
- sess_error_low(sess, SESS_ERR_MSG_CORRUPTED, NULL);
-
- return;
- }
-
- msg_no = sess_cli_msg_get_msg_no(str);
-
- UT_DULINT_INC(sess->msgs_recv);
-
- if (!UT_DULINT_EQ(msg_no, sess->msgs_recv)) {
-
- sess_error_low(sess, SESS_ERR_MSG_LOST, NULL);
-
- sess->msgs_recv = msg_no;
-
- return;
- }
-
- msg_type = sess_cli_msg_get_type(str);
-
- if (msg_type == SESS_CLI_BREAK_EXECUTION) {
-
- sess_receive_break(sess);
-
- return;
- }
-
- if (client_waited) {
- /* Client sent an extraneous message which is not a break
- command: an error */
-
- sess_error_low(sess, SESS_ERR_EXTRANEOUS_MSG, NULL);
-
- return;
- }
-
- /*-----------------------------------------------------------*/
- /* Handle big messages */
-
- cont = sess_cli_msg_get_continue(str);
-
- if (cont == SESS_MSG_SINGLE_PART) {
- if (sess->big_msg) {
-
- sess_error_low(sess, SESS_ERR_MSG_LOST, NULL);
-
- return;
- }
- } else {
- ut_error; /* Not in use */
-
- is_big_msg = sess_receive_msg_part(sess, str, len);
-
- if (is_big_msg) {
- str = sess->big_msg;
- len = sess->big_msg_len;
- sess->big_msg = NULL;
- } else {
- return;
- }
- }
-
- /*-----------------------------------------------------------*/
- /* The session has received a complete message from the client */
-
- ut_ad(!UT_LIST_GET_FIRST((sess->trx)->signals));
-
- if (msg_type == SESS_CLI_PREPARE) {
- /* Note that the kernel mutex is temporarily released when
- the SQL string is parsed */
-
- sess_receive_prepare(sess, str, len);
- } else {
- /* Note that the kernel mutex is temporarily released when the
- command is executed */
-
- sess_receive_command(sess, str, len, msg_type);
- }
-
- if (is_big_msg) {
- mem_free(str);
- }
-}
-
-/***********************************************************************
-Opens a new connection and creates a session. */
-static
-ibool
-sess_open_connection(
-/*=================*/
- byte* str, /* in: message string */
- ulint len, /* in: string length */
- byte* addr, /* in: user address string */
- ulint alen) /* in: user address length */
-{
- dulint sess_id;
- sess_t* sess;
-
- sess_id = mach_read_from_8(str + SESS_CLI_MSG_SESS_ID);
-
- if (!(UT_DULINT_EQ(sess_id, ut_dulint_zero))
- || !(sess_cli_msg_get_type(str) == SESS_CLI_CONNECT)) {
-
- /* It is not a valid connect message */
-
- return(FALSE);
- }
-
- ut_a(len == SESS_CLI_MSG_DATA);
-
- sess = sess_open(srv_sys->endpoint, addr, alen);
-
- sess_srv_msg_send_simple(sess, SESS_SRV_ACCEPT_CONNECT,
- SESS_NOT_RELEASE_KERNEL);
- return(TRUE);
-}
-
-/***********************************************************************
-Starts a new connection and a session, or starts a query based on a client
-message. This is called by a SRV_COM thread. */
-
-void
-sess_process_cli_msg(
-/*=================*/
- byte* str, /* in: message string */
- ulint len, /* in: string length */
- byte* addr, /* in: address string */
- ulint alen) /* in: address length */
-{
- sess_t* sess;
- ibool success;
-
- UT_NOT_USED(addr);
- UT_NOT_USED(alen);
-
- mutex_enter(&kernel_mutex);
-
- sess = sess_cli_msg_get_sess(str, len);
-
- if (sess == NULL) {
- /* There was no matching session */
-
- if (sess_cli_msg_check_consistency(str, len)) {
-
- /* As the message is consistent, it may be a connect
- message */
-
- /* printf("%s\n", addr); */
-
- success = sess_open_connection(str, len, addr, alen);
-
- if (success) {
- mutex_exit(&kernel_mutex);
-
- return;
- }
- }
-
- /* Could not make sense of the message: write an error entry
- to the system error log */
-
- /* srv_err_log_insert(
- "MESSAGE SENT TO AN UNKNOWN SESSION");*/
- ut_error;
-
- mutex_exit(&kernel_mutex);
-
- return;
- }
-
- if (sess->disconnecting) {
-
- /* srv_err_log_insert(
- "MESSAGE SENT TO A DISCONNECTING SESSION");*/
- ut_error;
-
- mutex_exit(&kernel_mutex);
-
- return;
- }
-
- sess_receive_msg_rel_kernel(sess, str, len);
-
- mutex_exit(&kernel_mutex);
-}
diff --git a/innobase/ut/ts/makefile b/innobase/ut/ts/makefile
deleted file mode 100644
index 5ef15ade794..00000000000
--- a/innobase/ut/ts/makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-
-include ..\..\makefile.i
-
-tsut: ..\ut.lib tsut.c
- $(CCOM) $(CFL) -I.. -I..\.. ..\ut.lib ..\..\os.lib tsut.c $(LFL)
-
-
-
-
-
-
-
diff --git a/innobase/ut/ts/tsut.c b/innobase/ut/ts/tsut.c
deleted file mode 100644
index 81c9ff79f96..00000000000
--- a/innobase/ut/ts/tsut.c
+++ /dev/null
@@ -1,347 +0,0 @@
-/************************************************************************
-The test module for the utilities
-
-(c) 1995 Innobase Oy
-
-Created 10/28/1995 Heikki Tuuri
-*************************************************************************/
-
-#include "../ut0lst.h"
-#include "../ut0mem.h"
-#include "../ut0byte.h"
-#include "../ut0sort.h"
-#include "../ut0rnd.h"
-
-typedef struct node_struct node_t;
-struct node_struct {
- ulint index;
- ulint zyx;
- UT_LIST_NODE_T(node_t) list1;
- ulint yzx;
- UT_LIST_NODE_T(node_t) list2;
-};
-
-/* Arrays to be sorted */
-ulint uarr[100000];
-ulint aux_uarr[100000];
-dulint duarr[100000];
-dulint aux_duarr[100000];
-
-/*********************************************************************
-Tests for two-way lists. */
-
-void
-test1(void)
-/*=======*/
-{
- ulint i;
- UT_LIST_BASE_NODE_T(node_t) base1;
- UT_LIST_BASE_NODE_T(node_t) base2;
- node_t* node;
- node_t* node2;
-
- printf("-------------------------------------------\n");
- printf("TEST 1. Test of two-way lists \n");
-
- UT_LIST_INIT(base1);
- UT_LIST_INIT(base2);
-
- for (i = 0; i < 1000; i++) {
- node = ut_malloc(sizeof(node_t));
-
- node->index = 999 - i;
-
- UT_LIST_ADD_FIRST(list1, base1, node);
- UT_LIST_ADD_LAST(list2, base2, node);
- }
-
- UT_LIST_VALIDATE(list1, node_t, base1);
- UT_LIST_VALIDATE(list2, node_t, base2);
-
- node = UT_LIST_GET_FIRST(base1);
-
- for (i = 0; i < 1000; i++) {
-
- ut_a(node);
- ut_a(node->index == i);
-
- node = UT_LIST_GET_NEXT(list1, node);
- }
-
- ut_a(node == NULL);
-
- node = UT_LIST_GET_FIRST(base2);
-
- for (i = 0; i < 1000; i++) {
-
- ut_a(node);
- ut_a(node->index == 999 - i);
-
- node = UT_LIST_GET_NEXT(list2, node);
- }
-
- ut_a(node == NULL);
-
- UT_LIST_VALIDATE(list1, node_t, base1);
- UT_LIST_VALIDATE(list2, node_t, base2);
-
- node = UT_LIST_GET_FIRST(base1);
-
- for (i = 0; i < 500; i++) {
-
- ut_a(node);
- ut_a(node->index == i);
-
- node = UT_LIST_GET_NEXT(list1, node);
- }
-
- for (i = 0; i < 100; i++) {
- node2 = ut_malloc(sizeof(node_t));
-
- node2->index = 99 - i;
-
- UT_LIST_INSERT_AFTER(list1, base1, node, node2);
- UT_LIST_VALIDATE(list1, node_t, base1);
- }
-
- node2 = ut_malloc(sizeof(node_t));
- node2->index = 1000;
- UT_LIST_INSERT_AFTER(list1, base1, UT_LIST_GET_LAST(base1), node2);
-
- node2 = node;
-
- for (i = 0; i < 100; i++) {
- node2 = UT_LIST_GET_NEXT(list1, node2);
-
- ut_a(node2);
- ut_a(node2->index == i);
- }
-
- UT_LIST_VALIDATE(list1, node_t, base1);
-
- for (i = 0; i < 600; i++) {
-
- node2 = UT_LIST_GET_NEXT(list1, node);
-
- UT_LIST_REMOVE(list1, base1, node2);
- UT_LIST_VALIDATE(list1, node_t, base1);
- }
-
- node2 = UT_LIST_GET_NEXT(list1, node);
-
- UT_LIST_VALIDATE(list1, node_t, base1);
- UT_LIST_VALIDATE(list2, node_t, base2);
-
- ut_a(UT_LIST_GET_LEN(base1) == 501);
-
- ut_a(UT_LIST_GET_LAST(base1) == node);
-
- for (i = 0; i < 500; i++) {
-
- node = UT_LIST_GET_PREV(list1, node);
- }
-
- ut_a(UT_LIST_GET_FIRST(base1) == node);
-
- for (i = 0; i < 501; i++) {
-
- node2 = UT_LIST_GET_FIRST(base1);
-
- UT_LIST_REMOVE(list1, base1, node2);
- }
-
- UT_LIST_VALIDATE(list1, node_t, base1);
- UT_LIST_VALIDATE(list2, node_t, base2);
-
- ut_a(UT_LIST_GET_LEN(base1) == 0);
- ut_a(UT_LIST_GET_LEN(base2) == 1000);
-}
-
-/*********************************************************************
-Tests for dulints. */
-
-void
-test2(void)
-/*=======*/
-{
- dulint a, b;
-
- printf("-------------------------------------------\n");
- printf("TEST 2. Test of dulints \n");
-
- a = ut_dulint_create(0xFFFFFFFF, 0xFFFFFFFF);
-
- b = a;
-
- ut_a(ut_dulint_cmp(a, b) == 0);
-
- ut_a(ut_dulint_get_low(b) == 0xFFFFFFFF);
- ut_a(ut_dulint_get_high(b) == 0xFFFFFFFF);
-
- a = ut_dulint_create(0xFFFFFFFE, 0xFFFFFFFF);
- ut_a(ut_dulint_cmp(a, b) == -1);
- ut_a(ut_dulint_cmp(b, a) == 1);
-
- a = ut_dulint_create(0xFFFFFFFF, 0xFFFFFFFE);
- ut_a(ut_dulint_cmp(a, b) == -1);
- ut_a(ut_dulint_cmp(b, a) == 1);
-
- a = ut_dulint_create(5, 0xFFFFFFFF);
-
- a = ut_dulint_add(a, 5);
-
- ut_a(ut_dulint_get_low(a) == 4);
- ut_a(ut_dulint_get_high(a) == 6);
-
- a = ut_dulint_create(5, 0x80000000);
-
- a = ut_dulint_add(a, 0x80000000);
-
- ut_a(ut_dulint_get_low(a) == 0);
- ut_a(ut_dulint_get_high(a) == 6);
-
- a = ut_dulint_create(5, 10);
-
- a = ut_dulint_add(a, 20);
-
- ut_a(ut_dulint_get_low(a) == 30);
- ut_a(ut_dulint_get_high(a) == 5);
-}
-
-/***************************************************************
-Comparison function for ulints. */
-UNIV_INLINE
-int
-cmp_ulint(ulint a, ulint b)
-/*=======================*/
-{
- if (a < b) {
- return(-1);
- } else if (b < a) {
- return(1);
- } else {
- return(0);
- }
-}
-
-/****************************************************************
-Sort function for ulint arrays. */
-void
-sort_ulint(ulint* arr, ulint* aux_arr, ulint low, ulint high)
-/*=========================================================*/
-{
- ut_ad(high <= 100000);
-
- UT_SORT_FUNCTION_BODY(sort_ulint, arr, aux_arr, low, high,
- cmp_ulint);
-}
-
-/****************************************************************
-Sort function for dulint arrays. */
-void
-sort_dulint(dulint* arr, dulint* aux_arr, ulint low, ulint high)
-/*=========================================================*/
-{
- ut_ad(high <= 100000);
-
- UT_SORT_FUNCTION_BODY(sort_dulint, arr, aux_arr, low, high,
- ut_dulint_cmp);
-}
-
-/*********************************************************************
-Tests for sorting. */
-
-void
-test3(void)
-/*=======*/
-{
- ulint i, j;
- ulint tm, oldtm;
-
- printf("-------------------------------------------\n");
- printf("TEST 3. Test of sorting \n");
-
- for (i = 0; i < 100000; i++) {
- uarr[i] = ut_rnd_gen_ulint();
- }
-
- oldtm = ut_clock();
-
- for (j = 0; j < 1; j++) {
- i = 100000;
-
- sort_ulint(uarr, aux_uarr, 0, i);
- }
-
- tm = ut_clock();
-
- printf("Wall clock time for sort of %lu ulints %lu millisecs\n",
- j * i, tm - oldtm);
-
- for (i = 1; i < 100000; i++) {
- ut_a(uarr[i - 1] < uarr[i]);
- }
-
- for (i = 0; i < 100000; i++) {
- uarr[i] = 99999 - i;
- }
-
- sort_ulint(uarr, aux_uarr, 0, 100000);
-
- for (i = 1; i < 100000; i++) {
- ut_a(uarr[i] == i);
- }
-
- sort_ulint(uarr, aux_uarr, 0, 100000);
-
- for (i = 1; i < 100000; i++) {
- ut_a(uarr[i] == i);
- }
-
- sort_ulint(uarr, aux_uarr, 5, 6);
-
- for (i = 1; i < 100000; i++) {
- ut_a(uarr[i] == i);
- }
-
- for (i = 0; i < 100000; i++) {
- uarr[i] = 5;
- }
-
- sort_ulint(uarr, aux_uarr, 0, 100000);
-
- for (i = 1; i < 100000; i++) {
- ut_a(uarr[i] == 5);
- }
-
- for (i = 0; i < 100000; i++) {
- duarr[i] = ut_dulint_create(ut_rnd_gen_ulint() & 0xFFFFFFFF,
- ut_rnd_gen_ulint() & 0xFFFFFFFF);
- }
-
- oldtm = ut_clock();
-
- i = 100000;
-
- sort_dulint(duarr, aux_duarr, 0, i);
-
- tm = ut_clock();
-
- printf("Wall clock time for sort of %lu dulints %lu millisecs\n",
- j * i, tm - oldtm);
-
- for (i = 1; i < 100000; i++) {
- ut_a(ut_dulint_cmp(duarr[i - 1], duarr[i]) < 0);
- }
-
-}
-
-void
-main(void)
-{
- test1();
- test2();
- test3();
-
- printf("TEST SUCCESSFULLY COMPLETED!\n");
-}
diff --git a/innobase/ut/ut0dbg.c b/innobase/ut/ut0dbg.c
index 6cd0ed62454..3697e31050f 100644
--- a/innobase/ut/ut0dbg.c
+++ b/innobase/ut/ut0dbg.c
@@ -23,6 +23,11 @@ const char* ut_dbg_msg_assert_fail =
"InnoDB: Assertion failure in thread %lu in file %s line %lu\n";
const char* ut_dbg_msg_trap =
"InnoDB: We intentionally generate a memory trap.\n"
-"InnoDB: Send a detailed bug report to mysql@lists.mysql.com.\n";
+"InnoDB: Send a detailed bug report to mysql@lists.mysql.com.\n"
+"InnoDB: If you get repeated assertion failures or crashes, even\n"
+"InnoDB: immediately after the mysqld startup, there may be\n"
+"InnoDB: corruption in the InnoDB tablespace. See section 6.1 of\n"
+"InnoDB: http://www.innodb.com/ibman.php about forcing recovery.\n";
+
const char* ut_dbg_msg_stop =
"InnoDB: Thread %lu stopped in file %s line %lu\n";
diff --git a/innobase/ut/ut0mem.c b/innobase/ut/ut0mem.c
index c367ea10ee1..f7c0e1be9bd 100644
--- a/innobase/ut/ut0mem.c
+++ b/innobase/ut/ut0mem.c
@@ -258,3 +258,51 @@ ut_str_catenate(
return(str);
}
+
+/**************************************************************************
+Checks if a null-terminated string contains a certain character. */
+
+ibool
+ut_str_contains(
+/*============*/
+ char* str, /* in: null-terminated string */
+ char c) /* in: character */
+{
+ ulint len;
+ ulint i;
+
+ len = ut_strlen(str);
+
+ for (i = 0; i < len; i++) {
+ if (str[i] == c) {
+
+ return(TRUE);
+ }
+ }
+
+ return(FALSE);
+}
+
+/**************************************************************************
+Return a copy of the given string. The returned string must be freed
+using mem_free. */
+
+char*
+ut_strdup(
+/*======*/
+ /* out, own: cnull-terminated string */
+ char* str) /* in: null-terminated string */
+{
+ ulint len;
+ char* copy;
+
+ len = ut_strlen(str);
+
+ copy = mem_alloc(len + 1);
+
+ ut_memcpy(copy, str, len);
+
+ copy[len] = 0;
+
+ return(copy);
+}
diff --git a/isam/isamchk.c b/isam/isamchk.c
index 4e7ab7ec854..8fa6b7ad4c0 100644
--- a/isam/isamchk.c
+++ b/isam/isamchk.c
@@ -3413,6 +3413,6 @@ static int update_state_info( N_INFO *info, uint update)
return 0;
}
err:
- print_error("%d when updateing keyfile",my_errno);
+ print_error("%d when updating keyfile",my_errno);
return 1;
}
diff --git a/libmysql/Makefile.shared b/libmysql/Makefile.shared
index 1cffae4dc56..883ea2b5932 100644
--- a/libmysql/Makefile.shared
+++ b/libmysql/Makefile.shared
@@ -32,7 +32,7 @@ target_sources = libmysql.c password.c manager.c \
get_password.c errmsg.c
mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \
- strmake.lo strend.lo \
+ strmake.lo strend.lo strtod.lo \
strnlen.lo strfill.lo is_prefix.lo \
int2str.lo str2int.lo strinstr.lo strcont.lo \
strcend.lo bcmp.lo ctype-latin1.lo \
@@ -42,7 +42,8 @@ mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \
ctype-big5.lo ctype-czech.lo ctype-euc_kr.lo \
ctype-win1250ch.lo ctype-utf8.lo ctype-extra.lo \
ctype-ucs2.lo ctype-gb2312.lo ctype-gbk.lo \
- ctype-sjis.lo ctype-tis620.lo ctype-ujis.lo xml.lo
+ ctype-sjis.lo ctype-tis620.lo ctype-ujis.lo \
+ ctype-uca.lo xml.lo
mystringsextra= strto.c
dbugobjects = dbug.lo # IT IS IN SAFEMALLOC.C sanity.lo
@@ -50,7 +51,7 @@ mysysheaders = mysys_priv.h my_static.h
vioheaders = vio_priv.h
mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \
my_create.lo my_delete.lo mf_tempfile.lo my_open.lo \
- my_read.lo my_write.lo errors.lo \
+ my_file.lo my_read.lo my_write.lo errors.lo \
my_error.lo my_getwd.lo my_div.lo \
mf_pack.lo my_messnc.lo mf_dirname.lo mf_fn_ext.lo\
mf_wcomp.lo typelib.lo safemalloc.lo my_alloc.lo \
diff --git a/libmysql/client_settings.h b/libmysql/client_settings.h
index b1a85f567f9..a9695801e65 100644
--- a/libmysql/client_settings.h
+++ b/libmysql/client_settings.h
@@ -22,9 +22,8 @@ extern my_string mysql_unix_port;
CLIENT_PROTOCOL_41 | CLIENT_SECURE_CONNECTION)
sig_handler pipe_sig_handler(int sig __attribute__((unused)));
-my_bool stmt_close(MYSQL_STMT *stmt, my_bool skip_list);
void read_user_name(char *name);
-my_bool send_file_to_server(MYSQL *mysql, const char *filename);
+my_bool handle_local_infile(MYSQL *mysql, const char *net_filename);
/*
Let the user specify that we don't want SIGPIPE; This doesn't however work
@@ -55,9 +54,10 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt);
MYSQL_DATA * cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
uint fields);
int cli_stmt_execute(MYSQL_STMT *stmt);
-MYSQL_DATA * cli_read_binary_rows(MYSQL_STMT *stmt);
+int cli_read_binary_rows(MYSQL_STMT *stmt);
int cli_unbuffered_fetch(MYSQL *mysql, char **row);
-const char * cli_read_statistic(MYSQL *mysql);
+const char * cli_read_statistics(MYSQL *mysql);
+int cli_read_change_user_result(MYSQL *mysql, char *buff, const char *passwd);
#ifdef EMBEDDED_LIBRARY
int init_embedded_server(int argc, char **argv, char **groups);
diff --git a/libmysql/errmsg.c b/libmysql/errmsg.c
index 569267ddb37..ad93c1b8f9e 100644
--- a/libmysql/errmsg.c
+++ b/libmysql/errmsg.c
@@ -52,9 +52,10 @@ const char *client_errors[]=
"Error connecting to master:",
"SSL connection error",
"Malformed packet",
+ "This client library is licensed only for use with MySQL servers having '%s' license",
"Invalid use of null pointer",
"Statement not prepared",
- "Not all parameters data supplied",
+ "Parameters data was not supplied",
"Data truncated",
"No parameters exists in the statement",
"Invalid parameter number",
@@ -72,7 +73,9 @@ const char *client_errors[]=
"Can't open shared memory. Can't send the request event to server (%lu)",
"Wrong or unknown protocol",
"Invalid connection handle",
- "Connection using old (pre 4.1.1) authentication protocol refused (client option 'secure_auth' enabled)"
+ "Connection using old (pre 4.1.1) authentication protocol refused (client option 'secure_auth' enabled)",
+ "Row retrieval was cancelled by mysql_stmt_close() call",
+ "Attempt to read column without prior row fetch"
};
/* Start of code added by Roberto M. Serqueira - martinsc@uol.com.br - 05.24.2001 */
@@ -108,9 +111,10 @@ const char *client_errors[]=
"Error connecting to master:",
"SSL connection error",
"Malformed packet",
+ "This client library is licensed only for use with MySQL servers having '%s' license",
"Invalid use of null pointer",
"Statement not prepared",
- "Not all parameters data supplied",
+ "Parameters data was not supplied",
"Data truncated",
"No parameters exists in the statement",
"Invalid parameter number",
@@ -128,7 +132,9 @@ const char *client_errors[]=
"Can't open shared memory. Can't send the request event to server (%lu)",
"Wrong or unknown protocol",
"Invalid connection handle",
- "Connection using old (pre 4.1.1) authentication protocol refused (client option 'secure_auth' enabled)"
+ "Connection using old (pre 4.1.1) authentication protocol refused (client option 'secure_auth' enabled)",
+ "Row retrieval was cancelled by mysql_stmt_close() call",
+ "Attempt to read column without prior row fetch"
};
#else /* ENGLISH */
@@ -162,6 +168,7 @@ const char *client_errors[]=
"Error connecting to master:",
"SSL connection error",
"Malformed packet",
+ "This client library is licensed only for use with MySQL servers having '%s' license",
"Invalid use of null pointer",
"Statement not prepared",
"Not all parameters data supplied",
@@ -182,7 +189,9 @@ const char *client_errors[]=
"Can't open shared memory. Can't send the request event to server (%lu)",
"Wrong or unknown protocol",
"Invalid connection handle",
- "Connection using old (pre 4.1.1) authentication protocol refused (client option 'secure_auth' enabled)"
+ "Connection using old (pre 4.1.1) authentication protocol refused (client option 'secure_auth' enabled)",
+ "Row retrieval was cancelled by mysql_stmt_close() call",
+ "Attempt to read column without prior row fetch"
};
#endif
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c
index b3f4ccc4b4d..e63a583a0dd 100644
--- a/libmysql/libmysql.c
+++ b/libmysql/libmysql.c
@@ -89,7 +89,6 @@ static void append_wild(char *to,char *end,const char *wild);
sig_handler pipe_sig_handler(int sig);
static ulong mysql_sub_escape_string(CHARSET_INFO *charset_info, char *to,
const char *from, ulong length);
-my_bool stmt_close(MYSQL_STMT *stmt, my_bool skip_list);
static my_bool mysql_client_init= 0;
static my_bool org_my_init_done= 0;
@@ -259,7 +258,8 @@ mysql_debug(const char *debug __attribute__((unused)))
#else
{
char buff[80];
- strmov(strmov(buff,"libmysql: "),env);
+ buff[sizeof(buff)-1]= 0;
+ strxnmov(buff,sizeof(buff)-1,"libmysql: ", env, NullS);
MessageBox((HWND) 0,"Debugging variable MYSQL_DEBUG used",buff,MB_OK);
}
#endif
@@ -603,16 +603,97 @@ mysql_connect(MYSQL *mysql,const char *host,
#endif
+#ifdef CHECK_LICENSE
+/*
+ Check server side variable 'license'.
+ If the variable does not exist or does not contain 'Commercial',
+ we're talking to non-commercial server from commercial client.
+ SYNOPSIS
+ check_license()
+ RETURN VALUE
+ 0 success
+ !0 network error or the server is not commercial.
+ Error code is saved in mysql->net.last_errno.
+*/
+
+static int check_license(MYSQL *mysql)
+{
+ MYSQL_ROW row;
+ MYSQL_RES *res;
+ NET *net= &mysql->net;
+ static const char query[]= "SELECT @@license";
+ static const char required_license[]= LICENSE;
+
+ if (mysql_real_query(mysql, query, sizeof(query)-1))
+ {
+ if (net->last_errno == ER_UNKNOWN_SYSTEM_VARIABLE)
+ {
+ net->last_errno= CR_WRONG_LICENSE;
+ sprintf(net->last_error, ER(net->last_errno), required_license);
+ }
+ return 1;
+ }
+ if (!(res= mysql_use_result(mysql)))
+ return 1;
+ row= mysql_fetch_row(res);
+ /*
+ If no rows in result set, or column value is NULL (none of these
+ two is ever true for server variables now), or column value
+ mismatch, set wrong license error.
+ */
+ if (!net->last_errno &&
+ (!row || !row[0] ||
+ strncmp(row[0], required_license, sizeof(required_license))))
+ {
+ net->last_errno= CR_WRONG_LICENSE;
+ sprintf(net->last_error, ER(net->last_errno), required_license);
+ }
+ mysql_free_result(res);
+ return net->last_errno;
+}
+#endif /* CHECK_LICENSE */
+
+
/**************************************************************************
Change user and database
**************************************************************************/
+int cli_read_change_user_result(MYSQL *mysql, char *buff, const char *passwd)
+{
+ NET *net= &mysql->net;
+ ulong pkt_length;
+
+ pkt_length= net_safe_read(mysql);
+
+ if (pkt_length == packet_error)
+ return 1;
+
+ if (pkt_length == 1 && net->read_pos[0] == 254 &&
+ mysql->server_capabilities & CLIENT_SECURE_CONNECTION)
+ {
+ /*
+ By sending this very specific reply server asks us to send scrambled
+ password in old format. The reply contains scramble_323.
+ */
+ scramble_323(buff, mysql->scramble, passwd);
+ if (my_net_write(net, buff, SCRAMBLE_LENGTH_323 + 1) || net_flush(net))
+ {
+ net->last_errno= CR_SERVER_LOST;
+ strmov(net->sqlstate, unknown_sqlstate);
+ strmov(net->last_error,ER(net->last_errno));
+ return 1;
+ }
+ /* Read what server thinks about out new auth message report */
+ if (net_safe_read(mysql) == packet_error)
+ return 1;
+ }
+ return 0;
+}
+
my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
const char *passwd, const char *db)
{
char buff[512],*end=buff;
- NET *net= &mysql->net;
- ulong pkt_length;
DBUG_ENTER("mysql_change_user");
if (!user)
@@ -646,31 +727,8 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
/* Write authentication package */
simple_command(mysql,COM_CHANGE_USER, buff,(ulong) (end-buff),1);
- pkt_length= net_safe_read(mysql);
-
- if (pkt_length == packet_error)
- goto error;
-
- if (pkt_length == 1 && net->read_pos[0] == 254 &&
- mysql->server_capabilities & CLIENT_SECURE_CONNECTION)
- {
- /*
- By sending this very specific reply server asks us to send scrambled
- password in old format. The reply contains scramble_323.
- */
- scramble_323(buff, mysql->scramble, passwd);
- if (my_net_write(net, buff, SCRAMBLE_LENGTH_323 + 1) || net_flush(net))
- {
- net->last_errno= CR_SERVER_LOST;
- strmov(net->sqlstate, unknown_sqlstate);
- strmov(net->last_error,ER(net->last_errno));
- goto error;
- }
- /* Read what server thinks about out new auth message report */
- if (net_safe_read(mysql) == packet_error)
- goto error;
- }
-
+ if ((*mysql->methods->read_change_user_result)(mysql, buff, passwd))
+ DBUG_RETURN(1);
/* Free old connect information */
my_free(mysql->user,MYF(MY_ALLOW_ZERO_PTR));
my_free(mysql->passwd,MYF(MY_ALLOW_ZERO_PTR));
@@ -681,9 +739,6 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
mysql->passwd=my_strdup(passwd,MYF(MY_WME));
mysql->db= db ? my_strdup(db,MYF(MY_WME)) : 0;
DBUG_RETURN(0);
-
-error:
- DBUG_RETURN(1);
}
#if defined(HAVE_GETPWUID) && defined(NO_GETPWUID_DECL)
@@ -692,7 +747,7 @@ char* getlogin(void);
#endif
#if defined(__NETWARE__)
-/* default to "root" on NetWare */
+/* Default to value of USER on NetWare, if unset use "UNKNOWN_USER" */
void read_user_name(char *name)
{
char *str=getenv("USER");
@@ -739,45 +794,63 @@ void read_user_name(char *name)
#endif
-my_bool send_file_to_server(MYSQL *mysql, const char *filename)
+my_bool handle_local_infile(MYSQL *mysql, const char *net_filename)
{
- int fd, readcount;
my_bool result= 1;
uint packet_length=MY_ALIGN(mysql->net.max_packet-16,IO_SIZE);
- char *buf, tmp_name[FN_REFLEN];
NET *net= &mysql->net;
- DBUG_ENTER("send_file_to_server");
+ int readcount;
+ void *li_ptr; /* pass state to local_infile functions */
+ char *buf; /* buffer to be filled by local_infile_read */
+ struct st_mysql_options *options= &mysql->options;
+ DBUG_ENTER("handle_local_infile");
- if (!(buf=my_malloc(packet_length,MYF(0))))
+ /* check that we've got valid callback functions */
+ if (!(options->local_infile_init &&
+ options->local_infile_read &&
+ options->local_infile_end &&
+ options->local_infile_error))
+ {
+ /* if any of the functions is invalid, set the default */
+ mysql_set_local_infile_default(mysql);
+ }
+
+ /* copy filename into local memory and allocate read buffer */
+ if (!(buf=my_malloc(packet_length, MYF(0))))
{
strmov(net->sqlstate, unknown_sqlstate);
strmov(net->last_error, ER(net->last_errno=CR_OUT_OF_MEMORY));
DBUG_RETURN(1);
}
- fn_format(tmp_name,filename,"","",4); /* Convert to client format */
- if ((fd = my_open(tmp_name,O_RDONLY, MYF(0))) < 0)
+ /* initialize local infile (open file, usually) */
+ if ((*options->local_infile_init)(&li_ptr, net_filename))
{
my_net_write(net,"",0); /* Server needs one packet */
net_flush(net);
strmov(net->sqlstate, unknown_sqlstate);
- net->last_errno=EE_FILENOTFOUND;
- my_snprintf(net->last_error,sizeof(net->last_error)-1,
- EE(net->last_errno),tmp_name, errno);
+ net->last_errno= (*options->local_infile_error)(li_ptr,
+ net->last_error,
+ sizeof(net->last_error)-1);
goto err;
}
- while ((readcount = (int) my_read(fd,(byte*) buf,packet_length,MYF(0))) > 0)
+ /* read blocks of data from local infile callback */
+ while ((readcount =
+ (*options->local_infile_read)(li_ptr, buf,
+ packet_length)) > 0)
{
if (my_net_write(net,buf,readcount))
{
- DBUG_PRINT("error",("Lost connection to MySQL server during LOAD DATA of local file"));
+ DBUG_PRINT("error",
+ ("Lost connection to MySQL server during LOAD DATA of local file"));
strmov(net->sqlstate, unknown_sqlstate);
net->last_errno=CR_SERVER_LOST;
strmov(net->last_error,ER(net->last_errno));
goto err;
}
}
+
/* Send empty packet to mark end of file */
if (my_net_write(net,"",0) || net_flush(net))
{
@@ -786,24 +859,186 @@ my_bool send_file_to_server(MYSQL *mysql, const char *filename)
sprintf(net->last_error,ER(net->last_errno),errno);
goto err;
}
+
if (readcount < 0)
{
- strmov(net->sqlstate, unknown_sqlstate);
- net->last_errno=EE_READ; /* the errmsg for not entire file read */
- my_snprintf(net->last_error,sizeof(net->last_error)-1,
- tmp_name,errno);
+ net->last_errno= (*options->local_infile_error)(li_ptr,
+ net->last_error,
+ sizeof(net->last_error)-1);
goto err;
}
+
result=0; /* Ok */
err:
- if (fd >= 0)
- (void) my_close(fd,MYF(0));
- my_free(buf,MYF(0));
+ /* free up memory allocated with _init, usually */
+ (*options->local_infile_end)(li_ptr);
DBUG_RETURN(result);
}
+/****************************************************************************
+ Default handlers for LOAD LOCAL INFILE
+****************************************************************************/
+
+typedef struct st_default_local_infile
+{
+ int fd;
+ int error_num;
+ const char *filename;
+ char error_msg[LOCAL_INFILE_ERROR_LEN];
+} default_local_infile_data;
+
+
+/*
+ Open file for LOAD LOCAL INFILE
+
+ SYNOPSIS
+ default_local_infile_init()
+ ptr Store pointer to internal data here
+ filename File name to open. This may be in unix format !
+
+
+ NOTES
+ Even if this function returns an error, the load data interface
+ guarantees that default_local_infile_end() is called.
+
+ RETURN
+ 0 ok
+ 1 error
+*/
+
+static int default_local_infile_init(void **ptr, const char *filename)
+{
+ default_local_infile_data *data;
+ char tmp_name[FN_REFLEN];
+
+ if (!(*ptr= data= ((default_local_infile_data *)
+ my_malloc(sizeof(default_local_infile_data), MYF(0)))))
+ return 1; /* out of memory */
+
+ data->error_msg[0]= 0;
+ data->error_num= 0;
+ data->filename= filename;
+
+ fn_format(tmp_name, filename, "", "", MY_UNPACK_FILENAME);
+ if ((data->fd = my_open(tmp_name, O_RDONLY, MYF(0))) < 0)
+ {
+ data->error_num= my_errno;
+ my_snprintf(data->error_msg, sizeof(data->error_msg)-1,
+ EE(EE_FILENOTFOUND), tmp_name, data->error_num);
+ return 1;
+ }
+ return 0; /* ok */
+}
+
+
+/*
+ Read data for LOAD LOCAL INFILE
+
+ SYNOPSIS
+ default_local_infile_read()
+ ptr Points to handle allocated by _init
+ buf Read data here
+ buf_len Ammount of data to read
+
+ RETURN
+ > 0 number of bytes read
+ == 0 End of data
+ < 0 Error
+*/
+
+static int default_local_infile_read(void *ptr, char *buf, uint buf_len)
+{
+ int count;
+ default_local_infile_data*data = (default_local_infile_data *) ptr;
+
+ if ((count= (int) my_read(data->fd, (byte *) buf, buf_len, MYF(0))) < 0)
+ {
+ data->error_num= EE_READ; /* the errmsg for not entire file read */
+ my_snprintf(data->error_msg, sizeof(data->error_msg)-1,
+ EE(EE_READ),
+ data->filename, my_errno);
+ }
+ return count;
+}
+
+
+/*
+ Read data for LOAD LOCAL INFILE
+
+ SYNOPSIS
+ default_local_infile_end()
+ ptr Points to handle allocated by _init
+ May be NULL if _init failed!
+
+ RETURN
+*/
+
+static void default_local_infile_end(void *ptr)
+{
+ default_local_infile_data *data= (default_local_infile_data *) ptr;
+ if (data) /* If not error on open */
+ {
+ if (data->fd >= 0)
+ my_close(data->fd, MYF(MY_WME));
+ my_free(ptr, MYF(MY_WME));
+ }
+}
+
+
+/*
+ Return error from LOAD LOCAL INFILE
+
+ SYNOPSIS
+ default_local_infile_end()
+ ptr Points to handle allocated by _init
+ May be NULL if _init failed!
+ error_msg Store error text here
+ error_msg_len Max lenght of error_msg
+
+ RETURN
+ error message number
+*/
+
+static int
+default_local_infile_error(void *ptr, char *error_msg, uint error_msg_len)
+{
+ default_local_infile_data *data = (default_local_infile_data *) ptr;
+ if (data) /* If not error on open */
+ {
+ strmake(error_msg, data->error_msg, error_msg_len);
+ return data->error_num;
+ }
+ /* This can only happen if we got error on malloc of handle */
+ strmov(error_msg, ER(CR_OUT_OF_MEMORY));
+ return CR_OUT_OF_MEMORY;
+}
+
+
+void
+mysql_set_local_infile_handler(MYSQL *mysql,
+ int (*local_infile_init)(void **, const char *),
+ int (*local_infile_read)(void *, char *, uint),
+ void (*local_infile_end)(void *),
+ int (*local_infile_error)(void *, char *, uint))
+{
+ mysql->options.local_infile_init= local_infile_init;
+ mysql->options.local_infile_read= local_infile_read;
+ mysql->options.local_infile_end= local_infile_end;
+ mysql->options.local_infile_error= local_infile_error;
+}
+
+
+void mysql_set_local_infile_default(MYSQL *mysql)
+{
+ mysql->options.local_infile_init= default_local_infile_init;
+ mysql->options.local_infile_read= default_local_infile_read;
+ mysql->options.local_infile_end= default_local_infile_end;
+ mysql->options.local_infile_error= default_local_infile_error;
+}
+
+
/**************************************************************************
Do a query. If query returned rows, free old rows.
Read data by mysql_store_result or by repeat call of mysql_fetch_row
@@ -863,6 +1098,7 @@ STDCALL mysql_set_master(MYSQL* mysql, const char* host,
return 0;
}
+
int
STDCALL mysql_add_slave(MYSQL* mysql, const char* host,
unsigned int port,
@@ -984,6 +1220,7 @@ mysql_list_tables(MYSQL *mysql, const char *wild)
DBUG_RETURN (mysql_store_result(mysql));
}
+
MYSQL_FIELD *cli_list_fields(MYSQL *mysql)
{
MYSQL_DATA *query;
@@ -1059,6 +1296,7 @@ mysql_list_processes(MYSQL *mysql)
DBUG_RETURN(mysql_store_result(mysql));
}
+
#ifdef USE_OLD_FUNCTIONS
int STDCALL
mysql_create_db(MYSQL *mysql, const char *db)
@@ -1096,6 +1334,7 @@ mysql_refresh(MYSQL *mysql,uint options)
DBUG_RETURN(simple_command(mysql,COM_REFRESH,(char*) bits,1,0));
}
+
int STDCALL
mysql_kill(MYSQL *mysql,ulong pid)
{
@@ -1123,7 +1362,8 @@ mysql_dump_debug_info(MYSQL *mysql)
DBUG_RETURN(simple_command(mysql,COM_DEBUG,0,0,0));
}
-const char *cli_read_statistic(MYSQL *mysql)
+
+const char *cli_read_statistics(MYSQL *mysql)
{
mysql->net.read_pos[mysql->packet_length]=0; /* End of stat string */
if (!mysql->net.read_pos[0])
@@ -1136,13 +1376,14 @@ const char *cli_read_statistic(MYSQL *mysql)
return (char*) mysql->net.read_pos;
}
+
const char * STDCALL
mysql_stat(MYSQL *mysql)
{
DBUG_ENTER("mysql_stat");
if (simple_command(mysql,COM_STATISTICS,0,0,0))
return mysql->net.last_error;
- DBUG_RETURN((*mysql->methods->read_statistic)(mysql));
+ DBUG_RETURN((*mysql->methods->read_statistics)(mysql));
}
@@ -1541,21 +1782,6 @@ void set_stmt_errmsg(MYSQL_STMT * stmt, const char *err, int errcode,
}
-/*
- Set the internal error message to mysql handler
-*/
-
-static void set_mysql_error(MYSQL * mysql, int errcode, const char *sqlstate)
-{
- DBUG_ENTER("set_mysql_error");
- DBUG_PRINT("enter", ("error :%d '%s'", errcode, ER(errcode)));
- DBUG_ASSERT(mysql != 0);
-
- mysql->net.last_errno= errcode;
- strmov(mysql->net.last_error, ER(errcode));
- strmov(mysql->net.sqlstate, sqlstate);
-}
-
/*
Reallocate the NET package to be at least of 'length' bytes
@@ -1588,6 +1814,10 @@ static my_bool my_realloc_str(NET *net, ulong length)
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);
+
/*
Read the prepared statement results ..
@@ -1603,13 +1833,12 @@ static my_bool my_realloc_str(NET *net, ulong length)
my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
{
uchar *pos;
- uint field_count;
- ulong length, param_count;
+ uint field_count, param_count;
MYSQL_DATA *fields_data;
DBUG_ENTER("read_prepare_result");
mysql= mysql->last_used_con;
- if ((length= net_safe_read(mysql)) == packet_error)
+ if (net_safe_read(mysql) == packet_error)
DBUG_RETURN(1);
pos= (uchar*) mysql->net.read_pos;
@@ -1617,6 +1846,16 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
field_count= uint2korr(pos); pos+= 2;
param_count= uint2korr(pos); pos+= 2;
+ if (param_count != 0)
+ {
+ MYSQL_DATA *param_data;
+
+ /* skip parameters data: we don't support it yet */
+ if (!(param_data= (*mysql->methods->read_rows)(mysql, (MYSQL_FIELD*)0, 7)))
+ DBUG_RETURN(1);
+ free_rows(param_data);
+ }
+
if (field_count != 0)
{
if (!(mysql->server_status & SERVER_STATUS_AUTOCOMMIT))
@@ -1636,76 +1875,170 @@ my_bool cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt)
DBUG_RETURN(0);
}
+#ifdef HAVE_DEPRECATED_411_API
+MYSQL_STMT * STDCALL mysql_prepare(MYSQL *mysql, const char *query,
+ unsigned long query_length)
+{
+ MYSQL_STMT *stmt;
+ DBUG_ENTER("mysql_prepare");
+
+ stmt= mysql_stmt_init(mysql);
+ if (stmt && mysql_stmt_prepare(stmt, query, query_length))
+ {
+ mysql_stmt_close(stmt);
+ DBUG_RETURN(0);
+ }
+ DBUG_RETURN(stmt);
+}
+#endif
/*
- Prepare the query and return the new statement handle to
- caller.
+ Allocate memory and init prepared statement structure
+ SYNOPSIS
+ mysql_stmt_init()
+ mysql connection handle
- Also update the total parameter count along with resultset
- metadata information by reading from server
+ RETURN VALUE
+ statement structure upon success and NULL if out of
+ memory
*/
-
-MYSQL_STMT *STDCALL
-mysql_prepare(MYSQL *mysql, const char *query, ulong length)
+MYSQL_STMT * STDCALL
+mysql_stmt_init(MYSQL *mysql)
{
- MYSQL_STMT *stmt;
- DBUG_ENTER("mysql_prepare");
- DBUG_ASSERT(mysql != 0);
+ MYSQL_STMT *stmt;
+ DBUG_ENTER("mysql_stmt_init");
if (!(stmt= (MYSQL_STMT *) my_malloc(sizeof(MYSQL_STMT),
- MYF(MY_WME | MY_ZEROFILL))) ||
- !(stmt->query= my_strdup_with_length((byte *) query, length, MYF(0))))
+ MYF(MY_WME | MY_ZEROFILL))))
{
- my_free((gptr) stmt, MYF(MY_ALLOW_ZERO_PTR));
set_mysql_error(mysql, CR_OUT_OF_MEMORY, unknown_sqlstate);
DBUG_RETURN(0);
}
+
+ init_alloc_root(&stmt->mem_root, 2048, 2048);
+ init_alloc_root(&stmt->result.alloc, 4096, 4096);
+ stmt->result.alloc.min_malloc= sizeof(MYSQL_ROWS);
+ mysql->stmts= list_add(mysql->stmts, &stmt->list);
+ stmt->list.data= stmt;
+ stmt->state= MYSQL_STMT_INIT_DONE;
+ stmt->mysql= mysql;
+ stmt->read_row_func= stmt_read_row_no_data;
+ /* The rest of statement members was bzeroed inside malloc */
+
+ DBUG_RETURN(stmt);
+}
+
+/*
+ Prepare server side statement with query:
+ SYNOPSIS
+ mysql_stmt_prepare()
+ query statement to prepare
+ length statement length
+
+ DESCRIPTION
+ - 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,
+ number of columns in result set (if any), and result set metadata.
+ 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
+*/
+
+
+int STDCALL
+mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
+{
+ MYSQL *mysql= stmt->mysql;
+ DBUG_ENTER("mysql_stmt_prepare");
+
+ if (!mysql)
+ {
+ /* mysql can be reset in mysql_close called from mysql_reconnect */
+ set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate);
+ DBUG_RETURN(1);
+ }
+
+ if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE)
+ {
+ /* This is second prepare with another statement */
+ char buff[4];
+
+ mysql_stmt_free_result(stmt);
+ /*
+ These members must be reset for API to
+ function in case of error or misuse.
+ */
+ stmt->bind_param_done= stmt->bind_result_done= FALSE;
+ stmt->param_count= stmt->field_count= 0;
+ stmt->last_errno= 0;
+ stmt->last_error[0]= '\0';
+ free_root(&stmt->mem_root, MYF(MY_KEEP_PREALLOC));
+
+ int4store(buff, stmt->stmt_id);
+ /*
+ If there was a 'use' result from another statement, or from
+ mysql_use_result it won't be freed in mysql_stmt_free_result and
+ we should get 'Commands out of sync' here.
+ */
+ if (simple_command(mysql, COM_CLOSE_STMT, buff, 4, 1))
+ {
+ set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
+ mysql->net.sqlstate);
+ DBUG_RETURN(1);
+ }
+ stmt->state= MYSQL_STMT_INIT_DONE;
+ }
+
if (simple_command(mysql, COM_PREPARE, query, length, 1))
{
- stmt_close(stmt, 1);
- DBUG_RETURN(0);
+ set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
+ mysql->net.sqlstate);
+ DBUG_RETURN(1);
}
- init_alloc_root(&stmt->mem_root,8192,0);
if ((*mysql->methods->read_prepare_result)(mysql, stmt))
{
- stmt_close(stmt, 1);
- DBUG_RETURN(0);
+ set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
+ mysql->net.sqlstate);
+ DBUG_RETURN(1);
}
+ /*
+ 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->field_count))))
{
set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate);
- DBUG_RETURN(0);
+ DBUG_RETURN(1);
}
stmt->bind= stmt->params + stmt->param_count;
- stmt->state= MY_ST_PREPARE;
- stmt->mysql= mysql;
- mysql->stmts= list_add(mysql->stmts, &stmt->list);
- mysql->status= MYSQL_STATUS_READY;
- stmt->list.data= stmt;
+ stmt->state= MYSQL_STMT_PREPARE_DONE;
DBUG_PRINT("info", ("Parameter count: %ld", stmt->param_count));
- DBUG_RETURN(stmt);
+ DBUG_RETURN(0);
}
/*
Get the execute query meta information for non-select
- statements (on demand).
+ statements.
*/
-unsigned int alloc_stmt_fields(MYSQL_STMT *stmt)
+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;
- if (stmt->state != MY_ST_EXECUTE || !mysql->field_count)
- return 0;
-
stmt->field_count= mysql->field_count;
/*
@@ -1746,25 +2079,30 @@ unsigned int alloc_stmt_fields(MYSQL_STMT *stmt)
*/
MYSQL_RES * STDCALL
-mysql_get_metadata(MYSQL_STMT *stmt)
+mysql_stmt_result_metadata(MYSQL_STMT *stmt)
{
MYSQL_RES *result;
- DBUG_ENTER("mysql_get_metadata");
+ DBUG_ENTER("mysql_stmt_result_metadata");
- if (!stmt->field_count || !stmt->fields)
+ /*
+ stmt->fields is only defined if stmt->field_count is not null;
+ stmt->field_count is initialized in prepare.
+ */
+ if (!stmt->field_count)
+ DBUG_RETURN(0);
+
+ if (!(result=(MYSQL_RES*) my_malloc(sizeof(*result),
+ MYF(MY_WME | MY_ZEROFILL))))
{
- if (!alloc_stmt_fields(stmt))
- DBUG_RETURN(0);
- }
- if (!(result=(MYSQL_RES*) my_malloc(sizeof(*result)+
- sizeof(ulong)*stmt->field_count,
- MYF(MY_WME | MY_ZEROFILL))))
- return 0;
+ set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate);
+ DBUG_RETURN(0);
+ }
- result->methods= stmt->mysql->methods;
- result->eof=1; /* Marker for buffered */
+ result->methods= stmt->mysql->methods;
+ result->eof= 1; /* Marker for buffered */
result->fields= stmt->fields;
result->field_count= stmt->field_count;
+ /* The rest of members of 'result' was bzeroed inside malloc */
DBUG_RETURN(result);
}
@@ -1774,9 +2112,9 @@ mysql_get_metadata(MYSQL_STMT *stmt)
*/
MYSQL_RES * STDCALL
-mysql_param_result(MYSQL_STMT *stmt)
+mysql_stmt_param_metadata(MYSQL_STMT *stmt)
{
- DBUG_ENTER("mysql_param_result");
+ DBUG_ENTER("mysql_stmt_param_metadata");
if (!stmt->param_count)
DBUG_RETURN(0);
@@ -1958,11 +2296,9 @@ static void store_param_null(NET *net, MYSQL_BIND *param)
client application
*/
-
static my_bool store_param(MYSQL_STMT *stmt, MYSQL_BIND *param)
{
- MYSQL *mysql= stmt->mysql;
- NET *net = &mysql->net;
+ NET *net= &stmt->mysql->net;
DBUG_ENTER("store_param");
DBUG_PRINT("enter",("type: %d, buffer:%lx, length: %lu is_null: %d",
param->buffer_type,
@@ -1996,21 +2332,24 @@ static my_bool execute(MYSQL_STMT * stmt, char *packet, ulong length)
{
MYSQL *mysql= stmt->mysql;
NET *net= &mysql->net;
- char buff[MYSQL_STMT_HEADER];
+ char buff[4 /* size of stmt id */ +
+ 5 /* execution flags */];
DBUG_ENTER("execute");
DBUG_PRINT("enter",("packet: %s, length :%d",packet ? packet :" ", length));
mysql->last_used_con= mysql;
int4store(buff, stmt->stmt_id); /* Send stmt id to server */
- if (cli_advanced_command(mysql, COM_EXECUTE, buff,
- MYSQL_STMT_HEADER, packet,
- length, 1) ||
+ buff[4]= (char) 0; /* no flags */
+ int4store(buff+5, 1); /* iteration count */
+ if (cli_advanced_command(mysql, COM_EXECUTE, buff, sizeof(buff),
+ packet, length, 1) ||
(*mysql->methods->read_query_result)(mysql))
{
set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate);
DBUG_RETURN(1);
}
stmt->affected_rows= mysql->affected_rows;
+ stmt->insert_id= mysql->insert_id;
DBUG_RETURN(0);
}
@@ -2028,6 +2367,12 @@ int cli_stmt_execute(MYSQL_STMT *stmt)
uint null_count;
my_bool result;
+ if (!stmt->bind_param_done)
+ {
+ set_stmt_error(stmt, CR_PARAMS_NOT_BOUND, unknown_sqlstate);
+ DBUG_RETURN(1);
+ }
+
net_clear(net); /* Sets net->write_pos */
/* Reserve place for null-marker bytes */
null_count= (stmt->param_count+7) /8;
@@ -2062,7 +2407,6 @@ int cli_stmt_execute(MYSQL_STMT *stmt)
set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate);
DBUG_RETURN(1);
}
- net->write_pos= net->buff; /* Reset for net_write() */
result= execute(stmt, param_data, length);
stmt->send_types_to_server=0;
my_free(param_data, MYF(MY_WME));
@@ -2072,21 +2416,143 @@ int cli_stmt_execute(MYSQL_STMT *stmt)
}
/*
+ Read one row from buffered result set. Result set is created by prior
+ call to mysql_stmt_store_result().
+ SYNOPSIS
+ stmt_read_row_buffered()
+
+ RETURN VALUE
+ 0 - success; *row is set to valid row pointer (row data
+ is stored in result set buffer)
+ MYSQL_NO_DATA - end of result set. *row is set to NULL
+*/
+
+static int stmt_read_row_buffered(MYSQL_STMT *stmt, unsigned char **row)
+{
+ if (stmt->data_cursor)
+ {
+ *row= (uchar *) stmt->data_cursor->data;
+ stmt->data_cursor= stmt->data_cursor->next;
+ return 0;
+ }
+ *row= 0;
+ return MYSQL_NO_DATA;
+}
+
+/*
+ Read one row from network: unbuffered non-cursor fetch.
+ If last row was read, or error occured, erase this statement
+ from record pointing to object unbuffered fetch is performed from.
+
+ SYNOPSIS
+ stmt_read_row_unbuffered()
+ stmt statement handle
+ row pointer to write pointer to row data;
+
+ RETURN VALUE
+ 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
+ MYSQL_NO_DATA - end of file was read from network;
+ *row is 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.
+ */
+ if (!mysql)
+ {
+ set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate);
+ return 1;
+ }
+ if (mysql->status != MYSQL_STATUS_GET_RESULT)
+ {
+ set_stmt_error(stmt, stmt->unbuffered_fetch_cancelled ?
+ CR_FETCH_CANCELLED : CR_COMMANDS_OUT_OF_SYNC,
+ unknown_sqlstate);
+ goto error;
+ }
+ if ((*mysql->methods->unbuffered_fetch)(mysql, (char**) row))
+ {
+ set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
+ mysql->net.sqlstate);
+ goto error;
+ }
+ if (!*row)
+ {
+ mysql->status= MYSQL_STATUS_READY;
+ rc= MYSQL_NO_DATA;
+ goto error;
+ }
+ return 0;
+error:
+ if (mysql->unbuffered_fetch_owner == &stmt->unbuffered_fetch_cancelled)
+ mysql->unbuffered_fetch_owner= 0;
+ return rc;
+}
+
+/*
+ Default read row function to not SIGSEGV in client in
+ case of wrong sequence of API calls.
+*/
+
+static int
+stmt_read_row_no_data(MYSQL_STMT *stmt __attribute__((unused)),
+ unsigned char **row __attribute__((unused)))
+{
+ if ((int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE)
+ {
+ set_stmt_error(stmt, CR_NO_PREPARE_STMT, unknown_sqlstate);
+ return 1;
+ }
+ return MYSQL_NO_DATA;
+}
+
+/*
Execute the prepared query
*/
-int STDCALL mysql_execute(MYSQL_STMT *stmt)
+int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt)
{
- DBUG_ENTER("mysql_execute");
+ MYSQL *mysql= stmt->mysql;
+ DBUG_ENTER("mysql_stmt_execute");
- if ((*stmt->mysql->methods->stmt_execute)(stmt))
+ if (!mysql)
+ {
+ set_stmt_error(stmt, CR_SERVER_LOST, unknown_sqlstate);
DBUG_RETURN(1);
+ }
+
+ mysql_stmt_free_result(stmt);
+ /*
+ No need to check for stmt->state: if the statement wasn't
+ prepared we'll get 'unknown statemenet handler' error from server.
+ */
+ if (mysql->methods->stmt_execute(stmt))
+ DBUG_RETURN(1);
+ if (!stmt->field_count && 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);
+ }
- stmt->state= MY_ST_EXECUTE;
- mysql_free_result(stmt->result);
- stmt->result= (MYSQL_RES *)0;
- stmt->result_buffered= 0;
- stmt->current_row= 0;
+ stmt->state= MYSQL_STMT_EXECUTE_DONE;
+ if (stmt->field_count)
+ {
+ stmt->mysql->unbuffered_fetch_owner= &stmt->unbuffered_fetch_cancelled;
+ stmt->unbuffered_fetch_cancelled= FALSE;
+ stmt->read_row_func= stmt_read_row_unbuffered;
+ }
DBUG_RETURN(0);
}
@@ -2095,9 +2561,9 @@ int STDCALL mysql_execute(MYSQL_STMT *stmt)
Return total parameters count in the statement
*/
-ulong STDCALL mysql_param_count(MYSQL_STMT * stmt)
+ulong STDCALL mysql_stmt_param_count(MYSQL_STMT * stmt)
{
- DBUG_ENTER("mysql_param_count");
+ DBUG_ENTER("mysql_stmt_param_count");
DBUG_RETURN(stmt->param_count);
}
@@ -2111,6 +2577,15 @@ my_ulonglong STDCALL mysql_stmt_affected_rows(MYSQL_STMT *stmt)
}
+/*
+ Return last inserted id for auto_increment columns
+*/
+
+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;
@@ -2118,11 +2593,21 @@ static my_bool int_is_null_false= 0;
Setup the parameter data buffers from application
*/
-my_bool STDCALL mysql_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;
- DBUG_ENTER("mysql_bind_param");
+ DBUG_ENTER("mysql_stmt_bind_param");
+
+ if (!stmt->param_count)
+ {
+ if ((int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE)
+ {
+ set_stmt_error(stmt, CR_NO_PREPARE_STMT, unknown_sqlstate);
+ DBUG_RETURN(1);
+ }
+ DBUG_RETURN(0);
+ }
/* Allocated on prepare */
memcpy((char*) stmt->params, (char*) bind,
@@ -2135,13 +2620,6 @@ my_bool STDCALL mysql_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind)
param->param_number= count++;
param->long_data_used= 0;
- /*
- If param->length is not given, change it to point to buffer_length.
- This way we can always use *param->length to get the length of data
- */
- if (!param->length)
- param->length= &param->buffer_length;
-
/* If param->is_null is not set, then the value can never be NULL */
if (!param->is_null)
param->is_null= &int_is_null_false;
@@ -2208,10 +2686,16 @@ my_bool STDCALL mysql_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind)
param->buffer_type, count);
DBUG_RETURN(1);
}
+ /*
+ If param->length is not given, change it to point to buffer_length.
+ This way we can always use *param->length to get the length of data
+ */
+ if (!param->length)
+ param->length= &param->buffer_length;
}
/* We have to send/resendtype information to MySQL */
- stmt->send_types_to_server= 1;
- stmt->param_buffers= 1;
+ stmt->send_types_to_server= TRUE;
+ stmt->bind_param_done= TRUE;
DBUG_RETURN(0);
}
@@ -2224,7 +2708,7 @@ my_bool STDCALL mysql_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind)
Send long data in pieces to the server
SYNOPSIS
- mysql_send_long_data()
+ mysql_stmt_send_long_data()
stmt Statement handler
param_number Parameter number (0 - N-1)
data Data to send to server
@@ -2237,14 +2721,24 @@ my_bool STDCALL mysql_bind_param(MYSQL_STMT *stmt, MYSQL_BIND * bind)
my_bool STDCALL
-mysql_send_long_data(MYSQL_STMT *stmt, uint param_number,
+mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
const char *data, ulong length)
{
MYSQL_BIND *param;
- DBUG_ENTER("mysql_send_long_data");
+ DBUG_ENTER("mysql_stmt_send_long_data");
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.
+ */
+ if (param_number >= stmt->param_count)
+ {
+ set_stmt_error(stmt, CR_INVALID_PARAMETER_NO, unknown_sqlstate);
+ DBUG_RETURN(1);
+ }
param= stmt->params+param_number;
if (param->buffer_type < MYSQL_TYPE_TINY_BLOB ||
@@ -2807,17 +3301,28 @@ static void fetch_result_str(MYSQL_BIND *param, uchar **row)
Setup the bind buffers for resultset processing
*/
-my_bool STDCALL mysql_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind)
+my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind)
{
MYSQL_BIND *param, *end;
ulong bind_count;
uint param_count= 0;
- DBUG_ENTER("mysql_bind_result");
+ DBUG_ENTER("mysql_stmt_bind_result");
DBUG_ASSERT(stmt != 0);
- if (!(bind_count= stmt->field_count) &&
- !(bind_count= alloc_stmt_fields(stmt)))
+ if (!stmt->field_count)
+ {
+ if ((int) stmt->state < (int) MYSQL_STMT_PREPARE_DONE)
+ {
+ set_stmt_error(stmt, CR_NO_PREPARE_STMT, unknown_sqlstate);
+ }
DBUG_RETURN(0);
+ }
+ bind_count= stmt->field_count;
+
+ /*
+ 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);
@@ -2826,7 +3331,7 @@ my_bool STDCALL mysql_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind)
{
/*
Set param->is_null to point to a dummy variable if it's not set.
- This is to make the excute code easier
+ This is to make the execute code easier
*/
if (!param->is_null)
param->is_null= &param->internal_is_null;
@@ -2898,7 +3403,7 @@ my_bool STDCALL mysql_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind)
DBUG_RETURN(1);
}
}
- stmt->res_buffers= 1;
+ stmt->bind_result_done= TRUE;
DBUG_RETURN(0);
}
@@ -2912,9 +3417,18 @@ static int stmt_fetch_row(MYSQL_STMT *stmt, uchar *row)
MYSQL_BIND *bind, *end;
MYSQL_FIELD *field, *field_end;
uchar *null_ptr, bit;
+ /*
+ Precondition: if stmt->field_count is zero or row is NULL, read_row_*
+ function must return no data.
+ */
+ DBUG_ASSERT(stmt->field_count);
+ DBUG_ASSERT(row);
- if (!row || !stmt->res_buffers)
+ if (!stmt->bind_result_done)
+ {
+ /* If output parameters were not bound we should just return success */
return 0;
+ }
null_ptr= row;
row+= (stmt->field_count+9)/8; /* skip null bits */
@@ -2961,59 +3475,24 @@ int cli_unbuffered_fetch(MYSQL *mysql, char **row)
Fetch and return row data to bound buffers, if any
*/
-int STDCALL mysql_fetch(MYSQL_STMT *stmt)
+int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt)
{
- MYSQL *mysql= stmt->mysql;
+ int rc;
uchar *row;
- DBUG_ENTER("mysql_fetch");
+ DBUG_ENTER("mysql_stmt_fetch");
- stmt->last_fetched_column= 0; /* reset */
- if (stmt->result_buffered) /* buffered */
+ if ((rc= (*stmt->read_row_func)(stmt, &row)) ||
+ (rc= stmt_fetch_row(stmt, row)))
{
- MYSQL_RES *res;
-
- if (!(res= stmt->result))
- goto no_data;
-
- if (!res->data_cursor)
- {
- stmt->current_row= 0;
- goto no_data;
- }
- row= (uchar *)res->data_cursor->data;
- res->data_cursor= res->data_cursor->next;
+ stmt->state= MYSQL_STMT_PREPARE_DONE; /* XXX: this is buggy */
+ stmt->read_row_func= stmt_read_row_no_data;
}
- else /* un-buffered */
+ else
{
- if (mysql->status != MYSQL_STATUS_GET_RESULT)
- {
- if (!stmt->field_count)
- goto no_data;
-
- set_stmt_error(stmt, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate);
- DBUG_RETURN(1);
- }
-
- if((*mysql->methods->unbuffered_fetch)(mysql, ( char **)&row))
- {
- set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
- mysql->net.sqlstate);
- DBUG_RETURN(1);
- }
- if (!row)
- {
- mysql->status= MYSQL_STATUS_READY;
- stmt->current_row= 0;
- goto no_data;
- }
+ /* This is to know in mysql_stmt_fetch_column that data was fetched */
+ stmt->state= MYSQL_STMT_FETCH_DONE;
}
-
- stmt->current_row= row;
- DBUG_RETURN(stmt_fetch_row(stmt, row));
-
-no_data:
- DBUG_PRINT("info", ("end of data"));
- DBUG_RETURN(MYSQL_NO_DATA); /* no more data */
+ DBUG_RETURN(rc);
}
@@ -3021,10 +3500,10 @@ no_data:
Fetch data for one specified column data
SYNOPSIS
- mysql_fetch_column()
+ mysql_stmt_fetch_column()
stmt Prepared statement handler
bind Where data should be placed. Should be filled in as
- when calling mysql_bind_result()
+ when calling mysql_stmt_bind_result()
column Column to fetch (first column is 0)
ulong offset Offset in result data (to fetch blob in pieces)
This is normally 0
@@ -3033,14 +3512,23 @@ no_data:
1 error
*/
-int STDCALL mysql_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind,
- uint column, ulong offset)
+int STDCALL mysql_stmt_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind,
+ uint column, ulong offset)
{
MYSQL_BIND *param= stmt->bind+column;
- DBUG_ENTER("mysql_fetch_column");
+ DBUG_ENTER("mysql_stmt_fetch_column");
+
+ if ((int) stmt->state < (int) MYSQL_STMT_FETCH_DONE)
+ {
+ set_stmt_error(stmt, CR_NO_DATA, unknown_sqlstate);
+ return 1;
+ }
+ if (column >= stmt->field_count)
+ {
+ set_stmt_error(stmt, CR_INVALID_PARAMETER_NO, unknown_sqlstate);
+ DBUG_RETURN(1);
+ }
- if (!stmt->current_row)
- goto no_data;
if (param->null_field)
{
@@ -3061,10 +3549,6 @@ int STDCALL mysql_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind,
fetch_results(bind, field, &row);
}
DBUG_RETURN(0);
-
-no_data:
- DBUG_PRINT("info", ("end of data"));
- DBUG_RETURN(MYSQL_NO_DATA); /* no more data */
}
@@ -3072,70 +3556,46 @@ no_data:
Read all rows of data from server (binary format)
*/
-MYSQL_DATA *cli_read_binary_rows(MYSQL_STMT *stmt)
+int cli_read_binary_rows(MYSQL_STMT *stmt)
{
ulong pkt_len;
uchar *cp;
MYSQL *mysql= stmt->mysql;
- MYSQL_DATA *result;
- MYSQL_ROWS *cur, **prev_ptr;
+ MYSQL_DATA *result= &stmt->result;
+ MYSQL_ROWS *cur, **prev_ptr= &result->data;
NET *net = &mysql->net;
- DBUG_ENTER("read_binary_rows");
-
- mysql= mysql->last_used_con;
- if ((pkt_len= net_safe_read(mysql)) == packet_error)
- {
- set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
- mysql->net.sqlstate);
-
- DBUG_RETURN(0);
- }
- if (mysql->net.read_pos[0] == 254) /* end of data */
- return 0;
+ DBUG_ENTER("cli_read_binary_rows");
- if (!(result=(MYSQL_DATA*) my_malloc(sizeof(MYSQL_DATA),
- MYF(MY_WME | MY_ZEROFILL))))
- {
- set_stmt_errmsg(stmt, ER(CR_OUT_OF_MEMORY), CR_OUT_OF_MEMORY,
- unknown_sqlstate);
- DBUG_RETURN(0);
- }
- init_alloc_root(&result->alloc,8192,0); /* Assume rowlength < 8192 */
- result->alloc.min_malloc= sizeof(MYSQL_ROWS);
- prev_ptr= &result->data;
- result->rows= 0;
+ mysql= mysql->last_used_con;
- while (*(cp=net->read_pos) != 254 || pkt_len >= 8)
+ while ((pkt_len= net_safe_read(mysql)) != packet_error)
{
- result->rows++;
-
- if (!(cur= (MYSQL_ROWS*) alloc_root(&result->alloc,sizeof(MYSQL_ROWS))) ||
- !(cur->data= ((MYSQL_ROW) alloc_root(&result->alloc, pkt_len))))
+ cp= net->read_pos;
+ if (cp[0] != 254 || pkt_len >= 8)
{
- free_rows(result);
- set_stmt_errmsg(stmt, ER(CR_OUT_OF_MEMORY), CR_OUT_OF_MEMORY,
- unknown_sqlstate);
- DBUG_RETURN(0);
+ if (!(cur= (MYSQL_ROWS*) alloc_root(&result->alloc,
+ sizeof(MYSQL_ROWS) + pkt_len - 1)))
+ {
+ set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate);
+ DBUG_RETURN(1);
+ }
+ cur->data= (MYSQL_ROW) (cur+1);
+ *prev_ptr= cur;
+ prev_ptr= &cur->next;
+ memcpy((char *) cur->data, (char *) cp+1, pkt_len-1);
+ ++result->rows;
}
- *prev_ptr= cur;
- prev_ptr= &cur->next;
- memcpy(cur->data, (char*)cp+1, pkt_len-1);
-
- if ((pkt_len=net_safe_read(mysql)) == packet_error)
+ else
{
- free_rows(result);
+ /* end of data */
+ *prev_ptr= 0;
+ mysql->warning_count= uint2korr(cp+1);
+ mysql->server_status= uint2korr(cp+3);
DBUG_RETURN(0);
}
}
- *prev_ptr= 0;
- if (pkt_len > 1)
- {
- mysql->warning_count= uint2korr(cp+1);
- mysql->server_status= uint2korr(cp+3);
- DBUG_PRINT("info",("warning_count: %ld", mysql->warning_count));
- }
- DBUG_PRINT("exit",("Got %d rows",result->rows));
- DBUG_RETURN(result);
+ set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate);
+ DBUG_RETURN(1);
}
@@ -3146,41 +3606,40 @@ MYSQL_DATA *cli_read_binary_rows(MYSQL_STMT *stmt)
int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
{
MYSQL *mysql= stmt->mysql;
- MYSQL_RES *result;
+ MYSQL_DATA *result= &stmt->result;
DBUG_ENTER("mysql_stmt_store_result");
mysql= mysql->last_used_con;
if (!stmt->field_count)
DBUG_RETURN(0);
- if (mysql->status != MYSQL_STATUS_GET_RESULT)
+ if ((int) stmt->state < (int) MYSQL_STMT_EXECUTE_DONE ||
+ mysql->status != MYSQL_STATUS_GET_RESULT)
{
set_stmt_error(stmt, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate);
DBUG_RETURN(1);
}
- mysql->status= MYSQL_STATUS_READY; /* server is ready */
- if (!(result= (MYSQL_RES*) my_malloc((uint) (sizeof(MYSQL_RES)+
- sizeof(ulong) *
- stmt->field_count),
- MYF(MY_WME | MY_ZEROFILL))))
+ if (result->data)
{
- set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate);
- DBUG_RETURN(1);
+ free_root(&result->alloc, MYF(MY_KEEP_PREALLOC));
+ result->data= NULL;
+ result->rows= 0;
+ stmt->data_cursor= NULL;
}
- result->methods= mysql->methods;
- stmt->result_buffered= 1;
- if (!(result->data= (*stmt->mysql->methods->read_binary_rows)(stmt)))
+ if ((*mysql->methods->read_binary_rows)(stmt))
{
- my_free((gptr) result,MYF(0));
- DBUG_RETURN(0);
+ free_root(&result->alloc, MYF(MY_KEEP_PREALLOC));
+ result->data= NULL;
+ result->rows= 0;
+ DBUG_RETURN(1);
}
- mysql->affected_rows= result->row_count= result->data->rows;
- stmt->affected_rows= result->row_count;
- result->data_cursor= result->data->data;
- result->fields= stmt->fields;
- result->field_count= stmt->field_count;
- stmt->result= result;
- DBUG_RETURN(0); /* Data buffered, must be fetched with mysql_fetch() */
+
+ stmt->data_cursor= result->data;
+ mysql->affected_rows= stmt->affected_rows= result->rows;
+ stmt->read_row_func= stmt_read_row_buffered;
+ mysql->unbuffered_fetch_owner= 0; /* set in stmt_execute */
+ mysql->status= MYSQL_STATUS_READY; /* server is ready */
+ DBUG_RETURN(0); /* Data buffered, must be fetched with mysql_stmt_fetch() */
}
@@ -3191,19 +3650,11 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
MYSQL_ROW_OFFSET STDCALL
mysql_stmt_row_seek(MYSQL_STMT *stmt, MYSQL_ROW_OFFSET row)
{
- MYSQL_RES *result;
+ MYSQL_ROW_OFFSET offset= stmt->data_cursor;
DBUG_ENTER("mysql_stmt_row_seek");
- if ((result= stmt->result))
- {
- MYSQL_ROW_OFFSET return_value= result->data_cursor;
- result->current_row= 0;
- result->data_cursor= row;
- DBUG_RETURN(return_value);
- }
-
- DBUG_PRINT("exit", ("stmt doesn't contain any resultset"));
- DBUG_RETURN(0);
+ stmt->data_cursor= row;
+ DBUG_RETURN(offset);
}
@@ -3216,11 +3667,7 @@ mysql_stmt_row_tell(MYSQL_STMT *stmt)
{
DBUG_ENTER("mysql_stmt_row_tell");
- if (stmt->result)
- DBUG_RETURN(stmt->result->data_cursor);
-
- DBUG_PRINT("exit", ("stmt doesn't contain any resultset"));
- DBUG_RETURN(0);
+ DBUG_RETURN(stmt->data_cursor);
}
@@ -3231,20 +3678,13 @@ mysql_stmt_row_tell(MYSQL_STMT *stmt)
void STDCALL
mysql_stmt_data_seek(MYSQL_STMT *stmt, my_ulonglong row)
{
- MYSQL_RES *result;
+ MYSQL_ROWS *tmp= stmt->result.data;
DBUG_ENTER("mysql_stmt_data_seek");
DBUG_PRINT("enter",("row id to seek: %ld",(long) row));
- if ((result= stmt->result))
- {
- MYSQL_ROWS *tmp= 0;
- if (result->data)
- for (tmp=result->data->data; row-- && tmp ; tmp = tmp->next) ;
- result->current_row= 0;
- result->data_cursor= tmp;
- }
- else
- DBUG_PRINT("exit", ("stmt doesn't contain any resultset"));
+ for (; tmp && row; --row, tmp= tmp->next)
+ ;
+ stmt->data_cursor= tmp;
DBUG_VOID_RETURN;
}
@@ -3257,10 +3697,44 @@ my_ulonglong STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt)
{
DBUG_ENTER("mysql_stmt_num_rows");
- if (stmt->result)
- DBUG_RETURN(stmt->result->row_count);
+ DBUG_RETURN(stmt->result.rows);
+}
+
+my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt)
+{
+ MYSQL_DATA *result= &stmt->result;
+ DBUG_ENTER("mysql_stmt_free_result");
+
+ DBUG_ASSERT(stmt != 0);
- DBUG_PRINT("exit", ("stmt doesn't contain any resultset"));
+ if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE)
+ {
+ MYSQL *mysql= stmt->mysql;
+
+ if (result->data)
+ {
+ /* Result buffered */
+ free_root(&result->alloc, MYF(MY_KEEP_PREALLOC));
+ result->data= NULL;
+ result->rows= 0;
+ stmt->data_cursor= NULL;
+ }
+
+ if (mysql && stmt->field_count &&
+ (int) stmt->state > (int) MYSQL_STMT_PREPARE_DONE)
+ {
+ if (mysql->unbuffered_fetch_owner == &stmt->unbuffered_fetch_cancelled)
+ mysql->unbuffered_fetch_owner= 0;
+ if (mysql->status != MYSQL_STATUS_READY)
+ {
+ /* There is a result set and it belongs to this statement */
+ flush_use_result(mysql);
+ mysql->status= MYSQL_STATUS_READY;
+ }
+ }
+ stmt->state= MYSQL_STMT_PREPARE_DONE;
+ stmt->read_row_func= stmt_read_row_no_data;
+ }
DBUG_RETURN(0);
}
@@ -3274,81 +3748,53 @@ my_ulonglong STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt)
SYNOPSIS
mysql_stmt_close()
stmt Statement handle
- skip_list Flag to indicate delete from list or not
+
RETURN VALUES
0 ok
1 error
*/
-my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt)
-{
- MYSQL *mysql;
- DBUG_ENTER("mysql_stmt_free_result");
-
- DBUG_ASSERT(stmt != 0);
-
- mysql= stmt->mysql;
- if (mysql->status != MYSQL_STATUS_READY)
- {
- /* Clear the current execution status */
- DBUG_PRINT("warning",("Not all packets read, clearing them"));
- for (;;)
- {
- ulong pkt_len;
- if ((pkt_len= net_safe_read(mysql)) == packet_error)
- break;
- if (pkt_len <= 8 && mysql->net.read_pos[0] == 254)
- break;
- }
- mysql->status= MYSQL_STATUS_READY;
- }
- mysql_free_result(stmt->result);
- stmt->result= 0;
- stmt->result_buffered= 0;
- stmt->current_row= 0;
- DBUG_RETURN(0);
-}
-
-
-my_bool stmt_close(MYSQL_STMT *stmt, my_bool skip_list)
+my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
{
- MYSQL *mysql;
+ MYSQL *mysql= stmt->mysql;
+ int rc= 0;
DBUG_ENTER("mysql_stmt_close");
- DBUG_ASSERT(stmt != 0);
-
- if (!(mysql= stmt->mysql))
- {
- my_free((gptr) stmt, MYF(MY_WME));
- DBUG_RETURN(0);
- }
- mysql_stmt_free_result(stmt);
- if (stmt->state == MY_ST_PREPARE || stmt->state == MY_ST_EXECUTE)
+ free_root(&stmt->result.alloc, MYF(0));
+ free_root(&stmt->mem_root, MYF(0));
+
+ if (mysql)
{
- char buff[4];
- int4store(buff, stmt->stmt_id);
- if (simple_command(mysql, COM_CLOSE_STMT, buff, 4, 1))
+ mysql->stmts= list_delete(mysql->stmts, &stmt->list);
+ if ((int) stmt->state > (int) MYSQL_STMT_INIT_DONE)
{
- set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
- mysql->net.sqlstate);
- stmt->mysql= NULL; /* connection isn't valid anymore */
- DBUG_RETURN(1);
+ char buff[4];
+
+ if (mysql->unbuffered_fetch_owner == &stmt->unbuffered_fetch_cancelled)
+ 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.
+ */
+ flush_use_result(mysql);
+ if (mysql->unbuffered_fetch_owner)
+ *mysql->unbuffered_fetch_owner= TRUE;
+ mysql->status= MYSQL_STATUS_READY;
+ }
+ int4store(buff, stmt->stmt_id);
+ if ((rc= simple_command(mysql, COM_CLOSE_STMT, buff, 4, 1)))
+ {
+ set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno,
+ mysql->net.sqlstate);
+ }
}
}
- stmt->field_count= 0;
- free_root(&stmt->mem_root, MYF(0));
- if (!skip_list)
- mysql->stmts= list_delete(mysql->stmts, &stmt->list);
- mysql->status= MYSQL_STATUS_READY;
- my_free((gptr) stmt->query, MYF(MY_WME));
- my_free((gptr) stmt, MYF(MY_WME));
- DBUG_RETURN(0);
-}
+ my_free((gptr) stmt, MYF(MY_WME));
-my_bool STDCALL mysql_stmt_close(MYSQL_STMT *stmt)
-{
- return stmt_close(stmt, 0);
+ DBUG_RETURN(test(rc));
}
/*
@@ -3361,6 +3807,10 @@ my_bool STDCALL mysql_stmt_reset(MYSQL_STMT *stmt)
MYSQL *mysql;
DBUG_ENTER("mysql_stmt_reset");
DBUG_ASSERT(stmt != 0);
+
+ /* 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 */
diff --git a/libmysql/libmysql.def b/libmysql/libmysql.def
index 868275d1d5d..4f6347776e0 100644
--- a/libmysql/libmysql.def
+++ b/libmysql/libmysql.def
@@ -28,13 +28,13 @@ EXPORTS
my_print_variables
my_realloc
my_strdup
- my_thread_end
- my_thread_init
+ mysql_thread_end
+ mysql_thread_init
myodbc_remove_escape
mysql_affected_rows
mysql_autocommit
- mysql_bind_param
- mysql_bind_result
+ mysql_stmt_bind_param
+ mysql_stmt_bind_result
mysql_change_user
mysql_character_set_name
mysql_close
@@ -46,9 +46,9 @@ EXPORTS
mysql_errno
mysql_error
mysql_escape_string
- mysql_execute
- mysql_fetch
- mysql_fetch_column
+ mysql_stmt_execute
+ mysql_stmt_fetch
+ mysql_stmt_fetch_column
mysql_fetch_field
mysql_fetch_field_direct
mysql_fetch_fields
@@ -78,11 +78,11 @@ EXPORTS
mysql_num_rows
mysql_odbc_escape_string
mysql_options
- mysql_param_count
- mysql_param_result
+ mysql_stmt_param_count
+ mysql_stmt_param_metadata
mysql_ping
mysql_prepare
- mysql_get_metadata
+ mysql_stmt_result_metadata
mysql_query
mysql_read_query_result
mysql_real_connect
@@ -93,7 +93,7 @@ EXPORTS
mysql_row_seek
mysql_row_tell
mysql_select_db
- mysql_send_long_data
+ mysql_stmt_send_long_data
mysql_send_query
mysql_shutdown
mysql_ssl_set
@@ -124,3 +124,6 @@ EXPORTS
strmake
strmov
strxmov
+ mysql_stmt_prepare
+ mysql_stmt_init
+ mysql_stmt_insert_id
diff --git a/libmysql/manager.c b/libmysql/manager.c
index ddf9b6c1010..f1c8d045e6c 100644
--- a/libmysql/manager.c
+++ b/libmysql/manager.c
@@ -133,7 +133,7 @@ MYSQL_MANAGER* STDCALL mysql_manager_connect(MYSQL_MANAGER* con,
if (!hp)
{
con->last_errno=tmp_errno;
- sprintf(con->last_error,"Could not resolve host '%s'",host);
+ sprintf(con->last_error,"Could not resolve host '%-.64s'",host);
my_gethostbyname_r_free();
goto err;
}
diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am
index ddf275eab81..ccdf724df68 100644
--- a/libmysqld/Makefile.am
+++ b/libmysqld/Makefile.am
@@ -89,9 +89,9 @@ libmysqld.a: libmysqld_int.a $(INC_LIB)
cd tmp ; \
for file in *.a ; do \
bfile=`basename $$file .a` ; \
- ar x $$file; \
+ $(AR) x $$file; \
for obj in *.o ; do mv $$obj $${bfile}_$$obj ; done ; \
- ar q ../libmysqld_int2.a *.o ; \
+ $(AR) q ../libmysqld_int2.a *.o ; \
rm -f *.o ; \
done
mv libmysqld_int2.a libmysqld.a
diff --git a/libmysqld/emb_qcache.cc b/libmysqld/emb_qcache.cc
index 4dac154ab80..0b6416632b7 100644
--- a/libmysqld/emb_qcache.cc
+++ b/libmysqld/emb_qcache.cc
@@ -428,7 +428,6 @@ int emb_load_querycache_result(THD *thd, Querycache_stream *src)
*prev_row= row;
row->data= columns;
MYSQL_ROW col_end= columns + mysql->field_count;
- uint len;
for (; columns < col_end; columns++)
src->load_column(&data->alloc, columns);
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc
index 188227c21f9..cfb50d3907a 100644
--- a/libmysqld/lib_sql.cc
+++ b/libmysqld/lib_sql.cc
@@ -189,8 +189,9 @@ static int emb_stmt_execute(MYSQL_STMT *stmt)
thd->data= 0;
}
if (emb_advanced_command(stmt->mysql, COM_EXECUTE,0,0,
- (const char*)&stmt->stmt_id,sizeof(stmt->stmt_id),1)
- || emb_mysql_read_query_result(stmt->mysql))
+ (const char*)&stmt->stmt_id,sizeof(stmt->stmt_id),
+ 1) ||
+ emb_mysql_read_query_result(stmt->mysql))
{
NET *net= &stmt->mysql->net;
set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate);
@@ -199,9 +200,14 @@ static int emb_stmt_execute(MYSQL_STMT *stmt)
DBUG_RETURN(0);
}
-MYSQL_DATA *emb_read_binary_rows(MYSQL_STMT *stmt)
+int emb_read_binary_rows(MYSQL_STMT *stmt)
{
- return emb_read_rows(stmt->mysql, 0, 0);
+ MYSQL_DATA *data;
+ if (!(data= emb_read_rows(stmt->mysql, 0, 0)))
+ return 1;
+ stmt->result= *data;
+ my_free((char *) data, MYF(0));
+ return 0;
}
int emb_unbuffered_fetch(MYSQL *mysql, char **row)
@@ -233,7 +239,7 @@ static void emb_free_embedded_thd(MYSQL *mysql)
delete thd;
}
-static const char * emb_read_statistic(MYSQL *mysql)
+static const char * emb_read_statistics(MYSQL *mysql)
{
THD *thd= (THD*)mysql->thd;
return thd->net.last_error;
@@ -245,19 +251,26 @@ static MYSQL_RES * emb_mysql_store_result(MYSQL *mysql)
return mysql_store_result(mysql);
}
-int emb_next_result(MYSQL *mysql)
+my_bool emb_next_result(MYSQL *mysql)
{
THD *thd= (THD*)mysql->thd;
DBUG_ENTER("emb_next_result");
if (emb_advanced_command(mysql, COM_QUERY,0,0,
- thd->query_rest.ptr(),thd->query_rest.length(),1)
- || emb_mysql_read_query_result(mysql))
+ thd->query_rest.ptr(),thd->query_rest.length(),1) ||
+ emb_mysql_read_query_result(mysql))
DBUG_RETURN(1);
DBUG_RETURN(0); /* No more results */
}
+int emb_read_change_user_result(MYSQL *mysql,
+ char *buff __attribute__((unused)),
+ const char *passwd __attribute__((unused)))
+{
+ return mysql_errno(mysql);
+}
+
MYSQL_METHODS embedded_methods=
{
emb_mysql_read_query_result,
@@ -271,8 +284,9 @@ MYSQL_METHODS embedded_methods=
emb_read_binary_rows,
emb_unbuffered_fetch,
emb_free_embedded_thd,
- emb_read_statistic,
- emb_next_result
+ emb_read_statistics,
+ emb_next_result,
+ emb_read_change_user_result
};
C_MODE_END
@@ -318,10 +332,10 @@ char ** copy_arguments_ptr= 0;
int init_embedded_server(int argc, char **argv, char **groups)
{
- char glob_hostname[FN_REFLEN];
-
- /* This mess is to allow people to call the init function without
- * having to mess with a fake argv */
+ /*
+ This mess is to allow people to call the init function without
+ having to mess with a fake argv
+ */
int *argcp;
char ***argvp;
int fake_argc = 1;
@@ -389,28 +403,11 @@ int init_embedded_server(int argc, char **argv, char **groups)
udf_init();
#endif
- if (opt_bin_log)
- {
- if (!opt_bin_logname)
- {
- char tmp[FN_REFLEN];
- /* TODO: The following should be using fn_format(); We just need to
- first change fn_format() to cut the file name if it's too long.
- */
- strmake(tmp,glob_hostname,FN_REFLEN-5);
- strmov(strcend(tmp,'.'),"-bin");
- opt_bin_logname=my_strdup(tmp,MYF(MY_WME));
- }
- open_log(&mysql_bin_log, glob_hostname, opt_bin_logname, "-bin",
- opt_binlog_index_name, LOG_BIN, 0, 0, max_binlog_size);
- using_update_log=1;
- }
-
(void) thr_setconcurrency(concurrency); // 10 by default
if (
#ifdef HAVE_BERKELEY_DB
- !berkeley_skip ||
+ (have_berkeley_db == SHOW_OPTION_YES) ||
#endif
(flush_time && flush_time != ~(ulong) 0L))
{
@@ -499,6 +496,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));
+ check_user(thd, COM_CONNECT, NULL, 0, thd->db, true);
return 0;
}
@@ -612,8 +610,8 @@ bool Protocol::send_fields(List<Item> *list, uint flag)
}
else
{
- client_field->def= strdup_root(field_alloc, tmp.ptr());
- client_field->def_length= tmp.length();
+ client_field->def= strdup_root(field_alloc, res->ptr());
+ client_field->def_length= res->length();
}
}
else
diff --git a/ltconfig b/ltconfig
index c4a16f77012..cc52d4b824f 100755
--- a/ltconfig
+++ b/ltconfig
@@ -2877,6 +2877,9 @@ DLLTOOL="$DLLTOOL"
# Used on cygwin: object dumper.
OBJDUMP="$OBJDUMP"
+# compatibility with ancient libtool :)
+SED=sed
+
# Used on cygwin: assembler.
AS="$AS"
diff --git a/ltmain.sh b/ltmain.sh
index e82e48a9ca0..953f6e71761 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -1,7 +1,7 @@
# ltmain.sh - Provide generalized library-building support services.
# NOTE: Changing this file will not affect anything until you rerun configure.
#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
# Free Software Foundation, Inc.
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
#
@@ -49,14 +49,14 @@ EOF
fi
# The name of this program.
-progname=`$echo "$0" | sed 's%^.*/%%'`
+progname=`$echo "$0" | ${SED} 's%^.*/%%'`
modename="$progname"
# Constants.
PROGRAM=ltmain.sh
PACKAGE=libtool
-VERSION=1.4.2
-TIMESTAMP=" (1.922.2.53 2001/09/11 03:18:52)"
+VERSION=1.5
+TIMESTAMP=" (1.1220.2.1 2003/04/14 22:48:00)"
default_mode=
help="Try \`$progname --help' for more information."
@@ -67,10 +67,19 @@ rm="rm -f"
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
+Xsed="${SED}"' -e 1s/^X//'
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
-SP2NL='tr \040 \012'
-NL2SP='tr \015\012 \040\040'
+# test EBCDIC or ASCII
+case `echo A|od -x` in
+ *[Cc]1*) # EBCDIC based system
+ SP2NL="tr '\100' '\n'"
+ NL2SP="tr '\r\n' '\100\100'"
+ ;;
+ *) # Assume ASCII based system
+ SP2NL="tr '\040' '\012'"
+ NL2SP="tr '\015\012' '\040\040'"
+ ;;
+esac
# NLS nuisances.
# Only set LANG and LC_ALL to C if already set.
@@ -88,8 +97,8 @@ fi
: ${IFS=" "}
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
- echo "$modename: not configured to build any kind of library" 1>&2
- echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ $echo "$modename: not configured to build any kind of library" 1>&2
+ $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
exit 1
fi
@@ -105,8 +114,51 @@ execute_dlfiles=
lo2o="s/\\.lo\$/.${objext}/"
o2lo="s/\\.${objext}\$/.lo/"
+#####################################
+# Shell function definitions:
+# This seems to be the best place for them
+
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+win32_libid () {
+ win32_libid_type="unknown"
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
+ grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+ win32_nmres=`eval $NM -f posix -A $1 | \
+ $SED -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
+ if test "X$win32_nmres" = "Ximport" ; then
+ win32_libid_type="x86 archive import"
+ else
+ win32_libid_type="x86 archive static"
+ fi
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $echo $win32_libid_type
+}
+
+# End of Shell function definitions
+#####################################
+
# Parse our command line options once, thoroughly.
-while test $# -gt 0
+while test "$#" -gt 0
do
arg="$1"
shift
@@ -122,6 +174,33 @@ do
execute_dlfiles)
execute_dlfiles="$execute_dlfiles $arg"
;;
+ tag)
+ tagname="$arg"
+
+ # Check whether tagname contains only valid characters
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ $echo "$progname: invalid tag name: $tagname" 1>&2
+ exit 1
+ ;;
+ esac
+
+ case $tagname in
+ CC)
+ # Don't test for the "default" C tag, as we know, it's there, but
+ # not specially marked.
+ ;;
+ *)
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
+ taglist="$taglist $tagname"
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
+ else
+ $echo "$progname: ignoring unknown tag $tagname" 1>&2
+ fi
+ ;;
+ esac
+ ;;
*)
eval "$prev=\$arg"
;;
@@ -139,17 +218,25 @@ do
;;
--version)
- echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
+ $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
+ $echo
+ $echo "Copyright (C) 2003 Free Software Foundation, Inc."
+ $echo "This is free software; see the source for copying conditions. There is NO"
+ $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
exit 0
;;
--config)
- sed -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
+ ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
+ done
exit 0
;;
--debug)
- echo "$progname: enabling shell trace mode"
+ $echo "$progname: enabling shell trace mode"
set -x
;;
@@ -158,16 +245,16 @@ do
;;
--features)
- echo "host: $host"
+ $echo "host: $host"
if test "$build_libtool_libs" = yes; then
- echo "enable shared libraries"
+ $echo "enable shared libraries"
else
- echo "disable shared libraries"
+ $echo "disable shared libraries"
fi
if test "$build_old_libs" = yes; then
- echo "enable static libraries"
+ $echo "enable static libraries"
else
- echo "disable static libraries"
+ $echo "disable static libraries"
fi
exit 0
;;
@@ -177,10 +264,19 @@ do
--mode) prevopt="--mode" prev=mode ;;
--mode=*) mode="$optarg" ;;
+ --preserve-dup-deps) duplicate_deps="yes" ;;
+
--quiet | --silent)
show=:
;;
+ --tag) prevopt="--tag" prev=tag ;;
+ --tag=*)
+ set tag "$optarg" ${1+"$@"}
+ shift
+ prev=tag
+ ;;
+
-dlopen)
prevopt="-dlopen"
prev=execute_dlfiles
@@ -214,8 +310,10 @@ if test -z "$show_help"; then
# Infer the operation mode.
if test -z "$mode"; then
+ $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
+ $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
case $nonopt in
- *cc | *++ | gcc* | *-gcc*)
+ *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
mode=link
for arg
do
@@ -270,158 +368,127 @@ if test -z "$show_help"; then
modename="$modename: compile"
# Get the compilation command and the source file.
base_compile=
- prev=
- lastarg=
- srcfile="$nonopt"
+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
suppress_output=
+ arg_mode=normal
+ libobj=
- user_target=no
for arg
do
- case $prev in
- "") ;;
- xcompiler)
- # Aesthetically quote the previous argument.
- prev=
- lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
-
- case $arg in
- # Double-quote args containing other shell metacharacters.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
+ case "$arg_mode" in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg="$arg"
+ arg_mode=normal
+ ;;
- # Add the previous argument to base_compile.
- if test -z "$base_compile"; then
- base_compile="$lastarg"
- else
- base_compile="$base_compile $lastarg"
- fi
+ target )
+ libobj="$arg"
+ arg_mode=normal
continue
;;
- esac
- # Accept any command-line options.
- case $arg in
- -o)
- if test "$user_target" != "no"; then
- $echo "$modename: you cannot specify \`-o' more than once" 1>&2
- exit 1
- fi
- user_target=next
- ;;
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ if test -n "$libobj" ; then
+ $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+ exit 1
+ fi
+ arg_mode=target
+ continue
+ ;;
- -static)
- build_old_libs=yes
- continue
- ;;
+ -static)
+ build_old_libs=yes
+ continue
+ ;;
- -prefer-pic)
- pic_mode=yes
- continue
- ;;
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
- -prefer-non-pic)
- pic_mode=no
- continue
- ;;
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
- -Xcompiler)
- prev=xcompiler
- continue
- ;;
+ -Xcompiler)
+ arg_mode=arg # the next one goes into the "base_compile" arg list
+ continue # The current "srcfile" will either be retained or
+ ;; # replaced later. I would guess that would be a bug.
- -Wc,*)
- args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
- lastarg=
- save_ifs="$IFS"; IFS=','
- for arg in $args; do
- IFS="$save_ifs"
+ -Wc,*)
+ args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+ lastarg=
+ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
- # Double-quote args containing other shell metacharacters.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- case $arg in
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- arg="\"$arg\""
- ;;
- esac
- lastarg="$lastarg $arg"
- done
- IFS="$save_ifs"
- lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
+ # Double-quote args containing other shell metacharacters.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ lastarg="$lastarg $arg"
+ done
+ IFS="$save_ifs"
+ lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
- # Add the arguments to base_compile.
- if test -z "$base_compile"; then
- base_compile="$lastarg"
- else
+ # Add the arguments to base_compile.
base_compile="$base_compile $lastarg"
- fi
- continue
- ;;
- esac
+ continue
+ ;;
- case $user_target in
- next)
- # The next one is the -o target name
- user_target=yes
- continue
- ;;
- yes)
- # We got the output file
- user_target=set
- libobj="$arg"
- continue
+ * )
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg="$srcfile"
+ srcfile="$arg"
+ ;;
+ esac # case $arg
;;
- esac
-
- # Accept the current argument as the source file.
- lastarg="$srcfile"
- srcfile="$arg"
+ esac # case $arg_mode
# Aesthetically quote the previous argument.
-
- # Backslashify any backslashes, double quotes, and dollar signs.
- # These are the only characters that are still specially
- # interpreted inside of double-quoted scrings.
lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+ case $lastarg in
# Double-quote args containing other shell metacharacters.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
- case $lastarg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
lastarg="\"$lastarg\""
;;
esac
- # Add the previous argument to base_compile.
- if test -z "$base_compile"; then
- base_compile="$lastarg"
- else
- base_compile="$base_compile $lastarg"
- fi
- done
+ base_compile="$base_compile $lastarg"
+ done # for arg
- case $user_target in
- set)
- ;;
- no)
- # Get the name of the library object.
- libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+ case $arg_mode in
+ arg)
+ $echo "$modename: you must specify an argument for -Xcompile"
+ exit 1
;;
- *)
+ target)
$echo "$modename: you must specify a target with \`-o'" 1>&2
exit 1
;;
+ *)
+ # Get the name of the library object.
+ [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+ ;;
esac
# Recognize several different file suffixes.
# If the user specifies -o file.o, it is replaced with file.lo
- xform='[cCFSfmso]'
+ xform='[cCFSifmso]'
case $libobj in
*.ada) xform=ada ;;
*.adb) xform=adb ;;
@@ -429,10 +496,13 @@ if test -z "$show_help"; then
*.asm) xform=asm ;;
*.c++) xform=c++ ;;
*.cc) xform=cc ;;
+ *.ii) xform=ii ;;
+ *.class) xform=class ;;
*.cpp) xform=cpp ;;
*.cxx) xform=cxx ;;
*.f90) xform=f90 ;;
*.for) xform=for ;;
+ *.java) xform=java ;;
esac
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
@@ -445,6 +515,56 @@ if test -z "$show_help"; then
;;
esac
+ # Infer tagged configuration to use if any are available and
+ # if one wasn't chosen via the "--tag" command line option.
+ # Only attempt this if the compiler in the base compile
+ # command doesn't match the default compiler.
+ if test -n "$available_tags" && test -z "$tagname"; then
+ case $base_compile in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
+ case "$base_compile " in
+ "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ $echo "$modename: unable to infer tagged configuration"
+ $echo "$modename: specify a tag with \`--tag'" 1>&2
+ exit 1
+# else
+# $echo "$modename: using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+
+ objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+ xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$obj"; then
+ xdir=
+ else
+ xdir=$xdir/
+ fi
+ lobj=${xdir}$objdir/$objname
+
if test -z "$base_compile"; then
$echo "$modename: you must specify a compilation command" 1>&2
$echo "$help" 1>&2
@@ -453,9 +573,9 @@ if test -z "$show_help"; then
# Delete any leftover library objects.
if test "$build_old_libs" = yes; then
- removelist="$obj $libobj"
+ removelist="$obj $lobj $libobj ${libobj}T"
else
- removelist="$libobj"
+ removelist="$lobj $libobj ${libobj}T"
fi
$run $rm $removelist
@@ -467,7 +587,7 @@ if test -z "$show_help"; then
pic_mode=default
;;
esac
- if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then
+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
# non-PIC code in shared libraries is not supported
pic_mode=default
fi
@@ -480,6 +600,7 @@ if test -z "$show_help"; then
removelist="$removelist $output_obj $lockfile"
trap "$run $rm $removelist; exit 1" 1 2 15
else
+ output_obj=
need_locks=no
lockfile=
fi
@@ -493,7 +614,7 @@ if test -z "$show_help"; then
done
elif test "$need_locks" = warn; then
if test -f "$lockfile"; then
- echo "\
+ $echo "\
*** ERROR, $lockfile exists and contains:
`cat $lockfile 2>/dev/null`
@@ -507,56 +628,55 @@ compiler."
$run $rm $removelist
exit 1
fi
- echo $srcfile > "$lockfile"
+ $echo $srcfile > "$lockfile"
fi
if test -n "$fix_srcfile_path"; then
eval srcfile=\"$fix_srcfile_path\"
fi
+ $run $rm "$libobj" "${libobj}T"
+
+ # Create a libtool object file (analogous to a ".la" file),
+ # but don't create it if we're doing a dry run.
+ test -z "$run" && cat > ${libobj}T <<EOF
+# $libobj - a libtool object file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+EOF
+
# Only build a PIC object if we are building libtool libraries.
if test "$build_libtool_libs" = yes; then
# Without this assignment, base_compile gets emptied.
fbsd_hideous_sh_bug=$base_compile
if test "$pic_mode" != no; then
- # All platforms use -DPIC, to notify preprocessed assembler code.
- command="$base_compile $srcfile $pic_flag -DPIC"
+ command="$base_compile $srcfile $pic_flag"
else
# Don't build PIC code
command="$base_compile $srcfile"
fi
- if test "$build_old_libs" = yes; then
- lo_libobj="$libobj"
- dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$dir" = "X$libobj"; then
- dir="$objdir"
- else
- dir="$dir/$objdir"
- fi
- libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
- if test -d "$dir"; then
- $show "$rm $libobj"
- $run $rm $libobj
- else
- $show "$mkdir $dir"
- $run $mkdir $dir
- status=$?
- if test $status -ne 0 && test ! -d $dir; then
- exit $status
- fi
+ if test ! -d "${xdir}$objdir"; then
+ $show "$mkdir ${xdir}$objdir"
+ $run $mkdir ${xdir}$objdir
+ status=$?
+ if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
+ exit $status
fi
fi
- if test "$compiler_o_lo" = yes; then
- output_obj="$libobj"
- command="$command -o $output_obj"
- elif test "$compiler_c_o" = yes; then
- output_obj="$obj"
- command="$command -o $output_obj"
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ command="$command -o $lobj"
fi
- $run $rm "$output_obj"
+ $run $rm "$lobj" "$output_obj"
+
$show "$command"
if $run eval "$command"; then :
else
@@ -565,8 +685,8 @@ compiler."
fi
if test "$need_locks" = warn &&
- test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
- echo "\
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $echo "\
*** ERROR, $lockfile contains:
`cat $lockfile 2>/dev/null`
@@ -585,9 +705,9 @@ compiler."
fi
# Just move the object if needed, then go on to compile the next one
- if test x"$output_obj" != x"$libobj"; then
- $show "$mv $output_obj $libobj"
- if $run $mv $output_obj $libobj; then :
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ $show "$mv $output_obj $lobj"
+ if $run $mv $output_obj $lobj; then :
else
error=$?
$run $rm $removelist
@@ -595,48 +715,21 @@ compiler."
fi
fi
- # If we have no pic_flag, then copy the object into place and finish.
- if (test -z "$pic_flag" || test "$pic_mode" != default) &&
- test "$build_old_libs" = yes; then
- # Rename the .lo from within objdir to obj
- if test -f $obj; then
- $show $rm $obj
- $run $rm $obj
- fi
-
- $show "$mv $libobj $obj"
- if $run $mv $libobj $obj; then :
- else
- error=$?
- $run $rm $removelist
- exit $error
- fi
+ # Append the name of the PIC object to the libtool object file.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object='$objdir/$objname'
- xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$obj"; then
- xdir="."
- else
- xdir="$xdir"
- fi
- baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"`
- libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
- # Now arrange that obj and lo_libobj become the same file
- $show "(cd $xdir && $LN_S $baseobj $libobj)"
- if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then
- # Unlock the critical section if it was locked
- if test "$need_locks" != no; then
- $run $rm "$lockfile"
- fi
- exit 0
- else
- error=$?
- $run $rm $removelist
- exit $error
- fi
- fi
+EOF
# Allow error messages only from the first compilation.
suppress_output=' >/dev/null 2>&1'
+ else
+ # No PIC object so indicate it doesn't exist in the libtool
+ # object file.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object=none
+
+EOF
fi
# Only build a position-dependent object if we build old libraries.
@@ -645,17 +738,15 @@ compiler."
# Don't build PIC code
command="$base_compile $srcfile"
else
- # All platforms use -DPIC, to notify preprocessed assembler code.
- command="$base_compile $srcfile $pic_flag -DPIC"
+ command="$base_compile $srcfile $pic_flag"
fi
if test "$compiler_c_o" = yes; then
command="$command -o $obj"
- output_obj="$obj"
fi
# Suppress compiler output if we already did a PIC compilation.
command="$command$suppress_output"
- $run $rm "$output_obj"
+ $run $rm "$obj" "$output_obj"
$show "$command"
if $run eval "$command"; then :
else
@@ -664,8 +755,8 @@ compiler."
fi
if test "$need_locks" = warn &&
- test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
- echo "\
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $echo "\
*** ERROR, $lockfile contains:
`cat $lockfile 2>/dev/null`
@@ -684,7 +775,7 @@ compiler."
fi
# Just move the object if needed
- if test x"$output_obj" != x"$obj"; then
+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
$show "$mv $output_obj $obj"
if $run $mv $output_obj $obj; then :
else
@@ -694,23 +785,25 @@ compiler."
fi
fi
- # Create an invalid libtool object if no PIC, so that we do not
- # accidentally link it into a program.
- if test "$build_libtool_libs" != yes; then
- $show "echo timestamp > $libobj"
- $run eval "echo timestamp > \$libobj" || exit $?
- else
- # Move the .lo from within objdir
- $show "$mv $libobj $lo_libobj"
- if $run $mv $libobj $lo_libobj; then :
- else
- error=$?
- $run $rm $removelist
- exit $error
- fi
- fi
+ # Append the name of the non-PIC object the libtool object file.
+ # Only append if the libtool object file exists.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object='$objname'
+
+EOF
+ else
+ # Append the name of the non-PIC object the libtool object file.
+ # Only append if the libtool object file exists.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object=none
+
+EOF
fi
+ $run $mv "${libobj}T" "${libobj}"
+
# Unlock the critical section if it was locked
if test "$need_locks" != no; then
$run $rm "$lockfile"
@@ -727,7 +820,7 @@ compiler."
# It is impossible to link a dll without this setting, and
# we shouldn't force the makefile maintainer to figure out
# which system we are compiling for in order to pass an extra
- # flag for every libtool invokation.
+ # flag for every libtool invocation.
# allow_undefined=no
# FIXME: Unfortunately, there are problems with the above when trying
@@ -742,6 +835,7 @@ compiler."
;;
esac
libtool_args="$nonopt"
+ base_compile="$nonopt"
compile_command="$nonopt"
finalize_command="$nonopt"
@@ -757,6 +851,7 @@ compiler."
linker_flags=
dllsearchpath=
lib_search_path=`pwd`
+ inst_prefix_dir=
avoid_version=no
dlfiles=
@@ -771,6 +866,7 @@ compiler."
module=no
no_install=no
objs=
+ non_pic_objects=
prefer_static_libs=no
preload=no
prev=
@@ -782,6 +878,7 @@ compiler."
temp_rpath=
thread_safe=no
vinfo=
+ vinfo_number=no
# We need to know -static, to get the right output filenames.
for arg
@@ -812,8 +909,9 @@ compiler."
test -n "$old_archive_from_new_cmds" && build_old_libs=yes
# Go through the arguments, transforming them on the way.
- while test $# -gt 0; do
+ while test "$#" -gt 0; do
arg="$1"
+ base_compile="$base_compile $arg"
shift
case $arg in
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
@@ -887,11 +985,123 @@ compiler."
prev=
continue
;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
release)
release="-$arg"
prev=
continue
;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat $save_arg`
+ do
+# moreargs="$moreargs $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ # If there is no directory component, then add one.
+ case $arg in
+ */* | *\\*) . $arg ;;
+ *) . ./$arg ;;
+ esac
+
+ if test -z "$pic_object" || \
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none && \
+ test "$non_pic_object" = none; then
+ $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+ exit 1
+ fi
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ libobjs="$libobjs $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if test -z "$run"; then
+ $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+ exit 1
+ else
+ # Dry-run case.
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+ non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+ libobjs="$libobjs $pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ fi
+ fi
+ done
+ else
+ $echo "$modename: link input file \`$save_arg' does not exist"
+ exit 1
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
rpath | xrpath)
# We need an absolute path.
case $arg in
@@ -930,13 +1140,21 @@ compiler."
finalize_command="$finalize_command $wl$qarg"
continue
;;
+ xcclinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $qarg"
+ prev=
+ compile_command="$compile_command $qarg"
+ finalize_command="$finalize_command $qarg"
+ continue
+ ;;
*)
eval "$prev=\"\$arg\""
prev=
continue
;;
esac
- fi # test -n $prev
+ fi # test -n "$prev"
prevarg="$arg"
@@ -988,11 +1206,16 @@ compiler."
continue
;;
+ -inst-prefix-dir)
+ prev=inst_prefix
+ continue
+ ;;
+
# The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
# so, if we see these flags be careful not to treat them like -L
-L[A-Z][A-Z]*:*)
case $with_gcc/$host in
- no/*-*-irix*)
+ no/*-*-irix* | /*-*-irix*)
compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg"
;;
@@ -1043,18 +1266,22 @@ compiler."
# These systems don't actually have a C library (as such)
test "X$arg" = "X-lc" && continue
;;
- *-*-openbsd*)
+ *-*-openbsd* | *-*-freebsd*)
# Do not include libc due to us having libc/libc_r.
test "X$arg" = "X-lc" && continue
;;
- esac
- elif test "X$arg" = "X-lc_r"; then
- case $host in
- *-*-openbsd*)
- # Do not include libc_r directly, use -pthread flag.
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ deplibs="$deplibs -framework System"
continue
- ;;
esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+ *-*-openbsd* | *-*-freebsd*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
fi
deplibs="$deplibs $arg"
continue
@@ -1065,6 +1292,34 @@ compiler."
continue
;;
+ # gcc -m* arguments should be passed to the linker via $compiler_flags
+ # in order to pass architecture information to the linker
+ # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
+ # but this is not reliable with gcc because gcc may use -mfoo to
+ # select a different linker, different libraries, etc, while
+ # -Wl,-mfoo simply passes -mfoo to the linker.
+ -m*)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ if test "$with_gcc" = "yes" ; then
+ compiler_flags="$compiler_flags $arg"
+ fi
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ continue
+ ;;
+
-no-fast-install)
fast_install=no
continue
@@ -1089,6 +1344,11 @@ compiler."
continue
;;
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
-o) prev=output ;;
-release)
@@ -1141,6 +1401,11 @@ compiler."
prev=vinfo
continue
;;
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ continue
+ ;;
-Wc,*)
args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
@@ -1189,6 +1454,11 @@ compiler."
continue
;;
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
# Some other compiler flag.
-* | +*)
# Unknown arguments in both finalize_command and compile_command need
@@ -1201,29 +1471,101 @@ compiler."
esac
;;
- *.lo | *.$objext)
- # A library or standard object.
- if test "$prev" = dlfiles; then
- # This file was specified with -dlopen.
- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- dlfiles="$dlfiles $arg"
- prev=
- continue
- else
- # If libtool objects are unsupported, then we need to preload.
- prev=dlprefiles
- fi
- fi
+ *.$objext)
+ # A standard object.
+ objs="$objs $arg"
+ ;;
- if test "$prev" = dlprefiles; then
- # Preload the old-style object.
- dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
- prev=
- else
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ # If there is no directory component, then add one.
case $arg in
- *.lo) libobjs="$libobjs $arg" ;;
- *) objs="$objs $arg" ;;
+ */* | *\\*) . $arg ;;
+ *) . ./$arg ;;
esac
+
+ if test -z "$pic_object" || \
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none && \
+ test "$non_pic_object" = none; then
+ $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+ exit 1
+ fi
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ libobjs="$libobjs $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if test -z "$run"; then
+ $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+ exit 1
+ else
+ # Dry-run case.
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+ non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+ libobjs="$libobjs $pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ fi
fi
;;
@@ -1277,12 +1619,54 @@ compiler."
exit 1
fi
+ # Infer tagged configuration to use if any are available and
+ # if one wasn't chosen via the "--tag" command line option.
+ # Only attempt this if the compiler in the base link
+ # command doesn't match the default compiler.
+ if test -n "$available_tags" && test -z "$tagname"; then
+ case $base_compile in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
+ case $base_compile in
+ "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
+ # The compiler in $compile_command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ $echo "$modename: unable to infer tagged configuration"
+ $echo "$modename: specify a tag with \`--tag'" 1>&2
+ exit 1
+# else
+# $echo "$modename: using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+
if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
eval arg=\"$export_dynamic_flag_spec\"
compile_command="$compile_command $arg"
finalize_command="$finalize_command $arg"
fi
+ oldlibs=
# calculate the name of the file, without its directory
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
libobjs_save="$libobjs"
@@ -1303,11 +1687,11 @@ compiler."
output_objdir="$output_objdir/$objdir"
fi
# Create the object directory.
- if test ! -d $output_objdir; then
+ if test ! -d "$output_objdir"; then
$show "$mkdir $output_objdir"
$run $mkdir $output_objdir
status=$?
- if test $status -ne 0 && test ! -d $output_objdir; then
+ if test "$status" -ne 0 && test ! -d "$output_objdir"; then
exit $status
fi
fi
@@ -1325,16 +1709,47 @@ compiler."
*) linkmode=prog ;; # Anything else should be a program.
esac
+ case $host in
+ *cygwin* | *mingw* | *pw32*)
+ # don't eliminate duplcations in $postdeps and $predeps
+ duplicate_compiler_generated_deps=yes
+ ;;
+ *)
+ duplicate_compiler_generated_deps=$duplicate_deps
+ ;;
+ esac
specialdeplibs=
+
libs=
# Find all interdependent deplibs by searching for libraries
# that are linked more than once (e.g. -la -lb -la)
for deplib in $deplibs; do
- case "$libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
libs="$libs $deplib"
done
+
+ if test "$linkmode" = lib; then
+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+ esac
+ pre_post_deps="$pre_post_deps $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+ fi
+
deplibs=
newdependency_libs=
newlib_search_path=
@@ -1366,28 +1781,33 @@ compiler."
;;
esac
for pass in $passes; do
- if test $linkmode = prog; then
- # Determine which files to process
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan"; then
+ libs="$deplibs"
+ deplibs=
+ fi
+ if test "$linkmode" = prog; then
case $pass in
- dlopen)
- libs="$dlfiles"
- save_deplibs="$deplibs" # Collect dlpreopened libraries
- deplibs=
- ;;
+ dlopen) libs="$dlfiles" ;;
dlpreopen) libs="$dlprefiles" ;;
link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
esac
fi
+ if test "$pass" = dlopen; then
+ # Collect dlpreopened libraries
+ save_deplibs="$deplibs"
+ deplibs=
+ fi
for deplib in $libs; do
lib=
found=no
case $deplib in
-l*)
- if test $linkmode = oldlib && test $linkmode = obj; then
- $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2
+ if test "$linkmode" != lib && test "$linkmode" != prog; then
+ $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
continue
fi
- if test $pass = conv; then
+ if test "$pass" = conv; then
deplibs="$deplib $deplibs"
continue
fi
@@ -1407,25 +1827,61 @@ compiler."
finalize_deplibs="$deplib $finalize_deplibs"
else
deplibs="$deplib $deplibs"
- test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
fi
continue
+ else # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if (${SED} -e '2q' $lib |
+ grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ library_names=
+ old_library=
+ case $lib in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+ for l in $old_library $library_names; do
+ ll="$l"
+ done
+ if test "X$ll" = "X$old_library" ; then # only static version available
+ found=no
+ ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$ladir" = "X$lib" && ladir="."
+ lib=$ladir/$old_library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
fi
;; # -l
-L*)
case $linkmode in
lib)
deplibs="$deplib $deplibs"
- test $pass = conv && continue
+ test "$pass" = conv && continue
newdependency_libs="$deplib $newdependency_libs"
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
;;
prog)
- if test $pass = conv; then
+ if test "$pass" = conv; then
deplibs="$deplib $deplibs"
continue
fi
- if test $pass = scan; then
+ if test "$pass" = scan; then
deplibs="$deplib $deplibs"
newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
else
@@ -1434,13 +1890,13 @@ compiler."
fi
;;
*)
- $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2
+ $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
;;
esac # linkmode
continue
;; # -L
-R*)
- if test $pass = link; then
+ if test "$pass" = link; then
dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
# Make sure the xrpath contains only unique directories.
case "$xrpath " in
@@ -1453,28 +1909,30 @@ compiler."
;;
*.la) lib="$deplib" ;;
*.$libext)
- if test $pass = conv; then
+ if test "$pass" = conv; then
deplibs="$deplib $deplibs"
continue
fi
case $linkmode in
lib)
if test "$deplibs_check_method" != pass_all; then
- echo
- echo "*** Warning: This library needs some functionality provided by $deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have."
+ $echo
+ $echo "*** Warning: Trying to link with static lib archive $deplib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because the file extensions .$libext of this argument makes me believe"
+ $echo "*** that it is just a static archive that I should not used here."
else
- echo
- echo "*** Warning: Linking the shared library $output against the"
- echo "*** static library $deplib is not portable!"
+ $echo
+ $echo "*** Warning: Linking the shared library $output against the"
+ $echo "*** static library $deplib is not portable!"
deplibs="$deplib $deplibs"
fi
continue
;;
prog)
- if test $pass != link; then
+ if test "$pass" != link; then
deplibs="$deplib $deplibs"
else
compile_deplibs="$deplib $compile_deplibs"
@@ -1485,14 +1943,18 @@ compiler."
esac # linkmode
;; # *.$libext
*.lo | *.$objext)
- if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
- # If there is no dlopen support or we're linking statically,
- # we need to preload.
- newdlprefiles="$newdlprefiles $deplib"
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- newdlfiles="$newdlfiles $deplib"
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ elif test "$linkmode" = prog; then
+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ newdlprefiles="$newdlprefiles $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ newdlfiles="$newdlfiles $deplib"
+ fi
fi
continue
;;
@@ -1501,14 +1963,14 @@ compiler."
continue
;;
esac # case $deplib
- if test $found = yes || test -f "$lib"; then :
+ if test "$found" = yes || test -f "$lib"; then :
else
$echo "$modename: cannot find the library \`$lib'" 1>&2
exit 1
fi
# Check to see that this really is a libtool archive.
- if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
else
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1
@@ -1524,8 +1986,9 @@ compiler."
library_names=
old_library=
# If the library was installed with an old release of libtool,
- # it will not redefine variable installed.
+ # it will not redefine variables installed, or shouldnotlink
installed=yes
+ shouldnotlink=no
# Read the .la file
case $lib in
@@ -1535,13 +1998,12 @@ compiler."
if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan" ||
- { test $linkmode = oldlib && test $linkmode = obj; }; then
- # Add dl[pre]opened files of deplib
+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
fi
- if test $pass = conv; then
+ if test "$pass" = conv; then
# Only check for convenience libraries
deplibs="$lib $deplibs"
if test -z "$libdir"; then
@@ -1555,18 +2017,21 @@ compiler."
tmp_libs=
for deplib in $dependency_libs; do
deplibs="$deplib $deplibs"
- case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
tmp_libs="$tmp_libs $deplib"
done
- elif test $linkmode != prog && test $linkmode != lib; then
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
$echo "$modename: \`$lib' is not a convenience library" 1>&2
exit 1
fi
continue
fi # $pass = conv
+
# Get the name of the library we link against.
linklib=
for l in $old_library $library_names; do
@@ -1578,15 +2043,17 @@ compiler."
fi
# This library was specified with -dlopen.
- if test $pass = dlopen; then
+ if test "$pass" = dlopen; then
if test -z "$libdir"; then
$echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
exit 1
fi
if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
# If there is no dlname, no dlopen support or we're linking
- # statically, we need to preload.
- dlprefiles="$dlprefiles $lib"
+ # statically, we need to preload. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ dlprefiles="$dlprefiles $lib $dependency_libs"
else
newdlfiles="$newdlfiles $lib"
fi
@@ -1627,7 +2094,7 @@ compiler."
name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
# This library was specified with -dlpreopen.
- if test $pass = dlpreopen; then
+ if test "$pass" = dlpreopen; then
if test -z "$libdir"; then
$echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
exit 1
@@ -1646,18 +2113,19 @@ compiler."
if test -z "$libdir"; then
# Link the convenience library
- if test $linkmode = lib; then
+ if test "$linkmode" = lib; then
deplibs="$dir/$old_library $deplibs"
elif test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$dir/$old_library $compile_deplibs"
finalize_deplibs="$dir/$old_library $finalize_deplibs"
else
- deplibs="$lib $deplibs"
+ deplibs="$lib $deplibs" # used for prog,scan pass
fi
continue
fi
- if test $linkmode = prog && test $pass != link; then
+
+ if test "$linkmode" = prog && test "$pass" != link; then
newlib_search_path="$newlib_search_path $ladir"
deplibs="$lib $deplibs"
@@ -1673,28 +2141,36 @@ compiler."
-L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
esac
# Need to link against all dependency_libs?
- if test $linkalldeplibs = yes; then
+ if test "$linkalldeplibs" = yes; then
deplibs="$deplib $deplibs"
else
# Need to hardcode shared library paths
# or/and link against static libraries
newdependency_libs="$deplib $newdependency_libs"
fi
- case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
tmp_libs="$tmp_libs $deplib"
done # for deplib
continue
fi # $linkmode = prog...
- link_static=no # Whether the deplib will be linked statically
- if test -n "$library_names" &&
- { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
- # Link against this shared library
+ if test "$linkmode,$pass" = "prog,link"; then
+ if test -n "$library_names" &&
+ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var"; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath " in
+ *" $dir "*) ;;
+ *" $absdir "*) ;;
+ *) temp_rpath="$temp_rpath $dir" ;;
+ esac
+ fi
- if test "$linkmode,$pass" = "prog,link" ||
- { test $linkmode = lib && test $hardcode_into_libs = yes; }; then
# Hardcode the library path.
# Skip directories that are in the system default run-time
# search path.
@@ -1716,17 +2192,6 @@ compiler."
esac
;;
esac
- if test $linkmode = prog; then
- # We need to hardcode the library path
- if test -n "$shlibpath_var"; then
- # Make sure the rpath contains only unique directories.
- case "$temp_rpath " in
- *" $dir "*) ;;
- *" $absdir "*) ;;
- *) temp_rpath="$temp_rpath $dir" ;;
- esac
- fi
- fi
fi # $linkmode,$pass = prog,link...
if test "$alldeplibs" = yes &&
@@ -1736,11 +2201,51 @@ compiler."
# We only need to search for static libraries
continue
fi
+ fi
+ link_static=no # Whether the deplib will be linked statically
+ if test -n "$library_names" &&
+ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
if test "$installed" = no; then
notinst_deplibs="$notinst_deplibs $lib"
need_relink=yes
fi
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on some systems (darwin)
+ if test "$shouldnotlink" = yes && test "$pass" = link ; then
+ $echo
+ if test "$linkmode" = prog; then
+ $echo "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $echo "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $echo "*** $linklib is not portable!"
+ fi
+ if test "$linkmode" = lib &&
+ test "$hardcode_into_libs" = yes; then
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) compile_rpath="$compile_rpath $absdir"
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
+ esac
+ ;;
+ esac
+ fi
if test -n "$old_archive_from_expsyms_cmds"; then
# figure out the soname
@@ -1754,7 +2259,7 @@ compiler."
elif test -n "$soname_spec"; then
# bleh windows
case $host in
- *cygwin*)
+ *cygwin* | mingw*)
major=`expr $current - $age`
versuffix="-$major"
;;
@@ -1766,8 +2271,8 @@ compiler."
# Make a new name for the extract_expsyms_cmds to use
soroot="$soname"
- soname=`echo $soroot | sed -e 's/^.*\///'`
- newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
+ soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
+ newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
# If the library has no export list, then create one now
if test -f "$output_objdir/$soname-def"; then :
@@ -1798,9 +2303,9 @@ compiler."
# make sure the library variables are pointing to the new library
dir=$output_objdir
linklib=$newlib
- fi # test -n $old_archive_from_expsyms_cmds
+ fi # test -n "$old_archive_from_expsyms_cmds"
- if test $linkmode = prog || test "$mode" != relink; then
+ if test "$linkmode" = prog || test "$mode" != relink; then
add_shlibpath=
add_dir=
add=
@@ -1809,6 +2314,22 @@ compiler."
immediate | unsupported)
if test "$hardcode_direct" = no; then
add="$dir/$linklib"
+ case $host in
+ *-*-sco3.2v5* ) add_dir="-L$dir" ;;
+ *-*-darwin* )
+ # if the lib is a module then we can not link against it, someone
+ # is ignoring the new warnings I added
+ if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
+ $echo "** Warning, lib $linklib is a module, not a shared library"
+ if test -z "$old_library" ; then
+ $echo
+ $echo "** And there doesn't seem to be a static archive available"
+ $echo "** The link will probably fail, sorry"
+ else
+ add="$dir/$old_library"
+ fi
+ fi
+ esac
elif test "$hardcode_minus_L" = no; then
case $host in
*-*-sunos*) add_shlibpath="$dir" ;;
@@ -1827,6 +2348,14 @@ compiler."
add="$dir/$linklib"
elif test "$hardcode_minus_L" = yes; then
add_dir="-L$dir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case "$libdir" in
+ [\\/]*)
+ add_dir="-L$inst_prefix_dir$libdir $add_dir"
+ ;;
+ esac
+ fi
add="-l$name"
elif test "$hardcode_shlibpath_var" = yes; then
add_shlibpath="$dir"
@@ -1849,7 +2378,7 @@ compiler."
*) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
esac
fi
- if test $linkmode = prog; then
+ if test "$linkmode" = prog; then
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
test -n "$add" && compile_deplibs="$add $compile_deplibs"
else
@@ -1866,7 +2395,7 @@ compiler."
fi
fi
- if test $linkmode = prog || test "$mode" = relink; then
+ if test "$linkmode" = prog || test "$mode" = relink; then
add_shlibpath=
add_dir=
add=
@@ -1882,17 +2411,27 @@ compiler."
*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
esac
add="-l$name"
+ elif test "$hardcode_automatic" = yes; then
+ if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
+ add="$inst_prefix_dir$libdir/$linklib"
+ else
+ add="$libdir/$linklib"
+ fi
else
# We cannot seem to hardcode it, guess we'll fake it.
- if test "X$installed" = Xyes; then
- add_dir="-L$libdir"
- else
- add_dir="-L$DESTDIR$libdir"
+ add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case "$libdir" in
+ [\\/]*)
+ add_dir="-L$inst_prefix_dir$libdir $add_dir"
+ ;;
+ esac
fi
add="-l$name"
fi
- if test $linkmode = prog; then
+ if test "$linkmode" = prog; then
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
else
@@ -1900,16 +2439,7 @@ compiler."
test -n "$add" && deplibs="$add $deplibs"
fi
fi
- elif test $linkmode = prog; then
- if test "$alldeplibs" = yes &&
- { test "$deplibs_check_method" = pass_all ||
- { test "$build_libtool_libs" = yes &&
- test -n "$library_names"; }; }; then
- # We only need to search for static libraries
- continue
- fi
-
- # Try to link the static library
+ elif test "$linkmode" = prog; then
# Here we assume that one of hardcode_direct or hardcode_minus_L
# is not unsupported. This is valid on all known static and
# shared platforms.
@@ -1929,20 +2459,21 @@ compiler."
# Just print a warning and add the library to dependency_libs so
# that the program can be linked against the static library.
- echo
- echo "*** Warning: This library needs some functionality provided by $lib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have."
+ $echo
+ $echo "*** Warning: This system can not link to static lib archive $lib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have."
if test "$module" = yes; then
- echo "*** Therefore, libtool will create a static module, that should work "
- echo "*** as long as the dlopening application is linked with the -dlopen flag."
+ $echo "*** But as you try to build a module library, libtool will still create "
+ $echo "*** a static module, that should work as long as the dlopening application"
+ $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
if test -z "$global_symbol_pipe"; then
- echo
- echo "*** However, this would only work if libtool was able to extract symbol"
- echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
- echo "*** not find such a program. So, this module is probably useless."
- echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ $echo
+ $echo "*** However, this would only work if libtool was able to extract symbol"
+ $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ $echo "*** not find such a program. So, this module is probably useless."
+ $echo "*** \`nm' from GNU binutils and a full rebuild may help."
fi
if test "$build_old_libs" = no; then
build_libtool_libs=module
@@ -1959,10 +2490,10 @@ compiler."
fi
fi # link shared/static library?
- if test $linkmode = lib; then
+ if test "$linkmode" = lib; then
if test -n "$dependency_libs" &&
- { test $hardcode_into_libs != yes || test $build_old_libs = yes ||
- test $link_static = yes; }; then
+ { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
+ test "$link_static" = yes; }; then
# Extract -R from dependency_libs
temp_deplibs=
for libdir in $dependency_libs; do
@@ -1985,13 +2516,15 @@ compiler."
tmp_libs=
for deplib in $dependency_libs; do
newdependency_libs="$deplib $newdependency_libs"
- case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
tmp_libs="$tmp_libs $deplib"
done
- if test $link_all_deplibs != no; then
+ if test "$link_all_deplibs" != no; then
# Add the search paths of all dependency libraries
for deplib in $dependency_libs; do
case $deplib in
@@ -2011,9 +2544,9 @@ compiler."
;;
esac
if grep "^installed=no" $deplib > /dev/null; then
- path="-L$absdir/$objdir"
+ path="$absdir/$objdir"
else
- eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -z "$libdir"; then
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
exit 1
@@ -2021,12 +2554,53 @@ compiler."
if test "$absdir" != "$libdir"; then
$echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
fi
- path="-L$absdir"
+ path="$absdir"
fi
+ depdepl=
+ case $host in
+ *-*-darwin*)
+ # we do not want to link against static libs, but need to link against shared
+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names" ; then
+ for tmp in $deplibrary_names ; do
+ depdepl=$tmp
+ done
+ if test -f "$path/$depdepl" ; then
+ depdepl="$path/$depdepl"
+ fi
+ newlib_search_path="$newlib_search_path $path"
+ path=""
+ fi
+ ;;
+ *)
+ path="-L$path"
+ ;;
+ esac
+
+ ;;
+ -l*)
+ case $host in
+ *-*-darwin*)
+ # Again, we only want to link against shared libraries
+ eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
+ for tmp in $newlib_search_path ; do
+ if test -f "$tmp/lib$tmp_libs.dylib" ; then
+ eval depdepl="$tmp/lib$tmp_libs.dylib"
+ break
+ fi
+ done
+ path=""
+ ;;
+ *) continue ;;
+ esac
;;
*) continue ;;
esac
case " $deplibs " in
+ *" $depdepl "*) ;;
+ *) deplibs="$deplibs $depdepl" ;;
+ esac
+ case " $deplibs " in
*" $path "*) ;;
*) deplibs="$deplibs $path" ;;
esac
@@ -2034,15 +2608,15 @@ compiler."
fi # link_all_deplibs != no
fi # linkmode = lib
done # for deplib in $libs
- if test $pass = dlpreopen; then
+ dependency_libs="$newdependency_libs"
+ if test "$pass" = dlpreopen; then
# Link the dlpreopened libraries before other libraries
for deplib in $save_deplibs; do
deplibs="$deplib $deplibs"
done
fi
- if test $pass != dlopen; then
- test $pass != scan && dependency_libs="$newdependency_libs"
- if test $pass != conv; then
+ if test "$pass" != dlopen; then
+ if test "$pass" != conv; then
# Make sure lib_search_path contains only unique directories.
lib_search_path=
for dir in $newlib_search_path; do
@@ -2064,9 +2638,30 @@ compiler."
eval tmp_libs=\"\$$var\"
new_libs=
for deplib in $tmp_libs; do
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
case $deplib in
-L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
*)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
case " $specialdeplibs " in
*" $deplib "*) new_libs="$deplib $new_libs" ;;
*)
@@ -2094,19 +2689,31 @@ compiler."
eval $var=\"$tmp_libs\"
done # for var
fi
- if test "$pass" = "conv" &&
- { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then
- libs="$deplibs" # reset libs
- deplibs=
- fi
+ # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs ; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=""
+ ;;
+ esac
+ if test -n "$i" ; then
+ tmp_libs="$tmp_libs $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
done # for pass
- if test $linkmode = prog; then
+ if test "$linkmode" = prog; then
dlfiles="$newdlfiles"
dlprefiles="$newdlprefiles"
fi
case $linkmode in
oldlib)
+ if test -n "$deplibs"; then
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
+ fi
+
if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
fi
@@ -2120,7 +2727,7 @@ compiler."
fi
if test -n "$vinfo"; then
- $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
+ $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
fi
if test -n "$release"; then
@@ -2142,6 +2749,7 @@ compiler."
case $outputname in
lib*)
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+ eval shared_ext=\"$shrext\"
eval libname=\"$libname_spec\"
;;
*)
@@ -2153,6 +2761,7 @@ compiler."
if test "$need_lib_prefix" != no; then
# Add the "lib" prefix for modules if required
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+ eval shared_ext=\"$shrext\"
eval libname=\"$libname_spec\"
else
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
@@ -2165,9 +2774,9 @@ compiler."
$echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
exit 1
else
- echo
- echo "*** Warning: Linking the shared library $output against the non-libtool"
- echo "*** objects $objs is not portable!"
+ $echo
+ $echo "*** Warning: Linking the shared library $output against the non-libtool"
+ $echo "*** objects $objs is not portable!"
libobjs="$libobjs $objs"
fi
fi
@@ -2177,7 +2786,7 @@ compiler."
fi
set dummy $rpath
- if test $# -gt 2; then
+ if test "$#" -gt 2; then
$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
fi
install_libdir="$2"
@@ -2186,14 +2795,16 @@ compiler."
if test -z "$rpath"; then
if test "$build_libtool_libs" = yes; then
# Building a libtool convenience library.
- libext=al
+ # Some compilers have problems with a `.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
oldlibs="$output_objdir/$libname.$libext $oldlibs"
build_libtool_libs=convenience
build_old_libs=yes
fi
if test -n "$vinfo"; then
- $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
+ $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
fi
if test -n "$release"; then
@@ -2212,9 +2823,46 @@ compiler."
exit 1
fi
- current="$2"
- revision="$3"
- age="$4"
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major="$2"
+ number_minor="$3"
+ number_revision="$4"
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # which has an extra 1 added just for fun
+ #
+ case $version_type in
+ darwin|linux|osf|windows)
+ current=`expr $number_major + $number_minor`
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+ ;;
+ irix|nonstopux)
+ current=`expr $number_major + $number_minor - 1`
+ age="$number_minor"
+ revision="$number_minor"
+ ;;
+ esac
+ ;;
+ no)
+ current="$2"
+ revision="$3"
+ age="$4"
+ ;;
+ esac
# Check that each of the things are valid numbers.
case $current in
@@ -2244,7 +2892,7 @@ compiler."
;;
esac
- if test $age -gt $current; then
+ if test "$age" -gt "$current"; then
$echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
$echo "$modename: \`$vinfo' is not valid version information" 1>&2
exit 1
@@ -2277,16 +2925,21 @@ compiler."
versuffix=".$current";
;;
- irix)
+ irix | nonstopux)
major=`expr $current - $age + 1`
- verstring="sgi$major.$revision"
+
+ case $version_type in
+ nonstopux) verstring_prefix=nonstopux ;;
+ *) verstring_prefix=sgi ;;
+ esac
+ verstring="$verstring_prefix$major.$revision"
# Add in all the interfaces that we are compatible with.
loop=$revision
- while test $loop != 0; do
+ while test "$loop" -ne 0; do
iface=`expr $revision - $loop`
loop=`expr $loop - 1`
- verstring="sgi$major.$iface:$verstring"
+ verstring="$verstring_prefix$major.$iface:$verstring"
done
# Before this point, $major must not contain `.'.
@@ -2300,13 +2953,13 @@ compiler."
;;
osf)
- major=`expr $current - $age`
+ major=.`expr $current - $age`
versuffix=".$current.$age.$revision"
verstring="$current.$age.$revision"
# Add in all the interfaces that we are compatible with.
loop=$age
- while test $loop != 0; do
+ while test "$loop" -ne 0; do
iface=`expr $current - $loop`
loop=`expr $loop - 1`
verstring="$verstring:${iface}.0"
@@ -2330,7 +2983,7 @@ compiler."
*)
$echo "$modename: unknown library version type \`$version_type'" 1>&2
- echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
exit 1
;;
esac
@@ -2338,12 +2991,11 @@ compiler."
# Clear the version info if we defaulted, and they specified a release.
if test -z "$vinfo" && test -n "$release"; then
major=
- verstring="0.0"
case $version_type in
darwin)
# we can't check for "0.0" in archive_cmds due to quoting
# problems, so we reset it completely
- verstring=""
+ verstring=
;;
*)
verstring="0.0"
@@ -2377,9 +3029,24 @@ compiler."
fi
if test "$mode" != relink; then
- # Remove our outputs.
- $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
- $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$echo "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+ removelist="$removelist $p"
+ ;;
+ *) ;;
+ esac
+ done
+ if test -n "$removelist"; then
+ $show "${rm}r $removelist"
+ $run ${rm}r $removelist
+ fi
fi
# Now set the variables for building old libraries.
@@ -2392,9 +3059,9 @@ compiler."
# Eliminate all temporary directories.
for path in $notinst_path; do
- lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
- deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
- dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
+ lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
+ deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
+ dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
done
if test -n "$xrpath"; then
@@ -2407,7 +3074,7 @@ compiler."
*) finalize_rpath="$finalize_rpath $libdir" ;;
esac
done
- if test $hardcode_into_libs != yes || test $build_old_libs = yes; then
+ if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
dependency_libs="$temp_xrpath $dependency_libs"
fi
fi
@@ -2445,12 +3112,13 @@ compiler."
*-*-netbsd*)
# Don't link with libc until the a.out ld.so is fixed.
;;
- *-*-openbsd*)
+ *-*-openbsd* | *-*-freebsd*)
# Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
;;
- *)
+ *)
# Add libc to deplibs on all other systems if necessary.
- if test $build_libtool_need_lc = "yes"; then
+ if test "$build_libtool_need_lc" = "yes"; then
deplibs="$deplibs -lc"
fi
;;
@@ -2477,7 +3145,7 @@ compiler."
# This might be a little naive. We might want to check
# whether the library exists or not. But this is on
# osf3 & osf4 and I'm not really sure... Just
- # implementing what was already the behaviour.
+ # implementing what was already the behavior.
newdeplibs=$deplibs
;;
test_compile)
@@ -2490,64 +3158,88 @@ compiler."
int main() { return 0; }
EOF
$rm conftest
- $CC -o conftest conftest.c $deplibs
- if test $? -eq 0 ; then
+ $LTCC -o conftest conftest.c $deplibs
+ if test "$?" -eq 0 ; then
ldd_output=`ldd conftest`
for i in $deplibs; do
name="`expr $i : '-l\(.*\)'`"
# If $name is empty we are operating on a -L argument.
- if test -n "$name" && test "$name" != "0"; then
- libname=`eval \\$echo \"$libname_spec\"`
- deplib_matches=`eval \\$echo \"$library_names_spec\"`
- set dummy $deplib_matches
- deplib_match=$2
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
- else
- droppeddeps=yes
- echo
- echo "*** Warning: This library needs some functionality provided by $i."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have."
+ if test "$name" != "" && test "$name" -ne "0"; then
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+ deplib_match=$2
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: dynamic linker does not accept needed library $i."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which I believe you do not have"
+ $echo "*** because a test_compile did reveal that the linker did not use it for"
+ $echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
fi
else
newdeplibs="$newdeplibs $i"
fi
done
else
- # Error occured in the first compile. Let's try to salvage the situation:
- # Compile a seperate program for each library.
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
for i in $deplibs; do
name="`expr $i : '-l\(.*\)'`"
- # If $name is empty we are operating on a -L argument.
- if test -n "$name" && test "$name" != "0"; then
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" && test "$name" != "0"; then
$rm conftest
- $CC -o conftest conftest.c $i
+ $LTCC -o conftest conftest.c $i
# Did it work?
- if test $? -eq 0 ; then
+ if test "$?" -eq 0 ; then
ldd_output=`ldd conftest`
- libname=`eval \\$echo \"$libname_spec\"`
- deplib_matches=`eval \\$echo \"$library_names_spec\"`
- set dummy $deplib_matches
- deplib_match=$2
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
- else
- droppeddeps=yes
- echo
- echo "*** Warning: This library needs some functionality provided by $i."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have."
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+ deplib_match=$2
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: dynamic linker does not accept needed library $i."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because a test_compile did reveal that the linker did not use this one"
+ $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
fi
else
droppeddeps=yes
- echo
- echo "*** Warning! Library $i is needed by this library but I was not able to"
- echo "*** make it link in! You will probably need to install it or some"
- echo "*** library that it depends on before this library will be fully"
- echo "*** functional. Installing it before continuing would be even better."
+ $echo
+ $echo "*** Warning! Library $i is needed by this library but I was not able to"
+ $echo "*** make it link in! You will probably need to install it or some"
+ $echo "*** library that it depends on before this library will be fully"
+ $echo "*** functional. Installing it before continuing would be even better."
fi
else
newdeplibs="$newdeplibs $i"
@@ -2561,11 +3253,20 @@ EOF
for a_deplib in $deplibs; do
name="`expr $a_deplib : '-l\(.*\)'`"
# If $name is empty we are operating on a -L argument.
- if test -n "$name" && test "$name" != "0"; then
- libname=`eval \\$echo \"$libname_spec\"`
- for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
- for potent_lib in $potential_libs; do
+ if test "$name" != "" && test "$name" != "0"; then
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
# Follow soft links.
if ls -lLd "$potent_lib" 2>/dev/null \
| grep " -> " >/dev/null; then
@@ -2578,28 +3279,36 @@ EOF
# but so what?
potlib="$potent_lib"
while test -h "$potlib" 2>/dev/null; do
- potliblink=`ls -ld $potlib | sed 's/.* -> //'`
+ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
case $potliblink in
[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
esac
done
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
- | sed 10q \
- | egrep "$file_magic_regex" > /dev/null; then
+ | ${SED} 10q \
+ | $EGREP "$file_magic_regex" > /dev/null; then
newdeplibs="$newdeplibs $a_deplib"
a_deplib=""
break 2
fi
- done
- done
+ done
+ done
+ fi
if test -n "$a_deplib" ; then
droppeddeps=yes
- echo
- echo "*** Warning: This library needs some functionality provided by $a_deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have."
+ $echo
+ $echo "*** Warning: linker path does not have real file for library $a_deplib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $echo "*** with $libname but no candidates were found. (...for file magic test)"
+ else
+ $echo "*** with $libname and none of the candidates passed a file format test"
+ $echo "*** using a file magic. Last file checked: $potlib"
+ fi
fi
else
# Add a -L argument.
@@ -2614,26 +3323,44 @@ EOF
name="`expr $a_deplib : '-l\(.*\)'`"
# If $name is empty we are operating on a -L argument.
if test -n "$name" && test "$name" != "0"; then
- libname=`eval \\$echo \"$libname_spec\"`
- for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
- for potent_lib in $potential_libs; do
- if eval echo \"$potent_lib\" 2>/dev/null \
- | sed 10q \
- | egrep "$match_pattern_regex" > /dev/null; then
- newdeplibs="$newdeplibs $a_deplib"
- a_deplib=""
- break 2
- fi
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ potlib="$potent_lib" # see symlink-check above in file_magic test
+ if eval $echo \"$potent_lib\" 2>/dev/null \
+ | ${SED} 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
done
- done
+ fi
if test -n "$a_deplib" ; then
droppeddeps=yes
- echo
- echo "*** Warning: This library needs some functionality provided by $a_deplib."
- echo "*** I have the capability to make that library automatically link in when"
- echo "*** you link to this library. But I can only do this if you have a"
- echo "*** shared version of the library, which you do not appear to have."
+ $echo
+ $echo "*** Warning: linker path does not have real file for library $a_deplib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
+ else
+ $echo "*** with $libname and none of the candidates passed a file format test"
+ $echo "*** using a regex pattern. Last file checked: $potlib"
+ fi
fi
else
# Add a -L argument.
@@ -2643,16 +3370,23 @@ EOF
;;
none | unknown | *)
newdeplibs=""
- if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
- -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
- grep . >/dev/null; then
- echo
+ tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
+ -e 's/ -[LR][^ ]*//g'`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ for i in $predeps $postdeps ; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
+ done
+ fi
+ if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
+ | grep . >/dev/null; then
+ $echo
if test "X$deplibs_check_method" = "Xnone"; then
- echo "*** Warning: inter-library dependencies are not supported in this platform."
+ $echo "*** Warning: inter-library dependencies are not supported in this platform."
else
- echo "*** Warning: inter-library dependencies are not known to be supported."
+ $echo "*** Warning: inter-library dependencies are not known to be supported."
fi
- echo "*** All declared inter-library dependencies are being dropped."
+ $echo "*** All declared inter-library dependencies are being dropped."
droppeddeps=yes
fi
;;
@@ -2672,17 +3406,17 @@ EOF
if test "$droppeddeps" = yes; then
if test "$module" = yes; then
- echo
- echo "*** Warning: libtool could not satisfy all declared inter-library"
- echo "*** dependencies of module $libname. Therefore, libtool will create"
- echo "*** a static module, that should work as long as the dlopening"
- echo "*** application is linked with the -dlopen flag."
+ $echo
+ $echo "*** Warning: libtool could not satisfy all declared inter-library"
+ $echo "*** dependencies of module $libname. Therefore, libtool will create"
+ $echo "*** a static module, that should work as long as the dlopening"
+ $echo "*** application is linked with the -dlopen flag."
if test -z "$global_symbol_pipe"; then
- echo
- echo "*** However, this would only work if libtool was able to extract symbol"
- echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
- echo "*** not find such a program. So, this module is probably useless."
- echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ $echo
+ $echo "*** However, this would only work if libtool was able to extract symbol"
+ $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ $echo "*** not find such a program. So, this module is probably useless."
+ $echo "*** \`nm' from GNU binutils and a full rebuild may help."
fi
if test "$build_old_libs" = no; then
oldlibs="$output_objdir/$libname.$libext"
@@ -2692,16 +3426,16 @@ EOF
build_libtool_libs=no
fi
else
- echo "*** The inter-library dependencies that have been dropped here will be"
- echo "*** automatically added whenever a program is linked with this library"
- echo "*** or is declared to -dlopen it."
-
- if test $allow_undefined = no; then
- echo
- echo "*** Since this library must not contain undefined symbols,"
- echo "*** because either the platform does not support them or"
- echo "*** it was explicitly requested with -no-undefined,"
- echo "*** libtool will only create a static version of it."
+ $echo "*** The inter-library dependencies that have been dropped here will be"
+ $echo "*** automatically added whenever a program is linked with this library"
+ $echo "*** or is declared to -dlopen it."
+
+ if test "$allow_undefined" = no; then
+ $echo
+ $echo "*** Since this library must not contain undefined symbols,"
+ $echo "*** because either the platform does not support them or"
+ $echo "*** it was explicitly requested with -no-undefined,"
+ $echo "*** libtool will only create a static version of it."
if test "$build_old_libs" = no; then
oldlibs="$output_objdir/$libname.$libext"
build_libtool_libs=module
@@ -2723,7 +3457,7 @@ EOF
# Test again, we may have decided not to build it any more
if test "$build_libtool_libs" = yes; then
- if test $hardcode_into_libs = yes; then
+ if test "$hardcode_into_libs" = yes; then
# Hardcode the library paths
hardcode_libdirs=
dep_rpath=
@@ -2759,7 +3493,11 @@ EOF
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
- eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ if test -n "$hardcode_libdir_flag_spec_ld"; then
+ eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ else
+ eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ fi
fi
if test -n "$runpath_var" && test -n "$perm_rpath"; then
# We should set the runpath_var.
@@ -2779,6 +3517,7 @@ EOF
fi
# Get the real and link names of the library.
+ eval shared_ext=\"$shrext\"
eval library_names=\"$library_names_spec\"
set dummy $library_names
realname="$2"
@@ -2789,7 +3528,9 @@ EOF
else
soname="$realname"
fi
- test -z "$dlname" && dlname=$soname
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
lib="$output_objdir/$realname"
for link
@@ -2797,23 +3538,6 @@ EOF
linknames="$linknames $link"
done
- # Ensure that we have .o objects for linkers which dislike .lo
- # (e.g. aix) in case we are running --disable-static
- for obj in $libobjs; do
- xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$obj"; then
- xdir="."
- else
- xdir="$xdir"
- fi
- baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
- oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
- if test ! -f $xdir/$oldobj; then
- $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
- $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
- fi
- done
-
# Use standard objects if they are pic
test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
@@ -2827,13 +3551,21 @@ EOF
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
- $show "$cmd"
- $run eval "$cmd" || exit $?
+ if len=`expr "X$cmd" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ $show "using reloadable object file for export list..."
+ skipped_export=:
+ fi
done
IFS="$save_ifs"
if test -n "$export_symbols_regex"; then
- $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
- $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
+ $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
$show "$mv \"${export_symbols}T\" \"$export_symbols\""
$run eval '$mv "${export_symbols}T" "$export_symbols"'
fi
@@ -2844,17 +3576,29 @@ EOF
$run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
fi
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ tmp_deplibs="$tmp_deplibs $test_deplib"
+ ;;
+ esac
+ done
+ deplibs="$tmp_deplibs"
+
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
else
gentop="$output_objdir/${outputname}x"
$show "${rm}r $gentop"
$run ${rm}r "$gentop"
- $show "mkdir $gentop"
- $run mkdir "$gentop"
+ $show "$mkdir $gentop"
+ $run $mkdir "$gentop"
status=$?
- if test $status -ne 0 && test ! -d "$gentop"; then
+ if test "$status" -ne 0 && test ! -d "$gentop"; then
exit $status
fi
generated="$generated $gentop"
@@ -2870,16 +3614,42 @@ EOF
$show "${rm}r $xdir"
$run ${rm}r "$xdir"
- $show "mkdir $xdir"
- $run mkdir "$xdir"
+ $show "$mkdir $xdir"
+ $run $mkdir "$xdir"
status=$?
- if test $status -ne 0 && test ! -d "$xdir"; then
+ if test "$status" -ne 0 && test ! -d "$xdir"; then
exit $status
fi
+ # We will extract separately just the conflicting names and we will no
+ # longer touch any unique names. It is faster to leave these extract
+ # automatically by $AR in one run.
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+ if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+ $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+ $AR t "$xabs" | sort | uniq -cd | while read -r count name
+ do
+ i=1
+ while test "$i" -le "$count"
+ do
+ # Put our $i before any first dot (extension)
+ # Never overwrite any file
+ name_to="$name"
+ while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+ do
+ name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+ done
+ $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+ $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+ i=`expr $i + 1`
+ done
+ done
+ fi
- libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
+ libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
done
fi
fi
@@ -2895,10 +3665,130 @@ EOF
fi
# Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval cmds=\"$module_expsym_cmds\"
+ else
+ eval cmds=\"$module_cmds\"
+ fi
+ else
if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
eval cmds=\"$archive_expsym_cmds\"
else
eval cmds=\"$archive_cmds\"
+ fi
+ fi
+
+ if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise.
+ $echo "creating reloadable object files..."
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ delfiles=
+ last_robj=
+ k=1
+ output=$output_objdir/$save_output-${k}.$objext
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ eval test_cmds=\"$reload_cmds $objlist $last_robj\"
+ if test "X$objlist" = X ||
+ { len=`expr "X$test_cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len"; }; then
+ objlist="$objlist $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test "$k" -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
+ fi
+ last_robj=$output_objdir/$save_output-${k}.$objext
+ k=`expr $k + 1`
+ output=$output_objdir/$save_output-${k}.$objext
+ objlist=$obj
+ len=1
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+
+ if ${skipped_export-false}; then
+ $show "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $run $rm $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
+ fi
+
+ # Set up a command to remove the reloadale object files
+ # after they are used.
+ i=0
+ while test "$i" -lt "$k"
+ do
+ i=`expr $i + 1`
+ delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
+ done
+
+ $echo "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval cmds=\"$archive_expsym_cmds\"
+ else
+ eval cmds=\"$archive_cmds\"
+ fi
+
+ # Append the command to remove the reloadable object files
+ # to the just-reset $cmds.
+ eval cmds=\"\$cmds~$rm $delfiles\"
fi
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
@@ -2990,10 +3880,10 @@ EOF
gentop="$output_objdir/${obj}x"
$show "${rm}r $gentop"
$run ${rm}r "$gentop"
- $show "mkdir $gentop"
- $run mkdir "$gentop"
+ $show "$mkdir $gentop"
+ $run $mkdir "$gentop"
status=$?
- if test $status -ne 0 && test ! -d "$gentop"; then
+ if test "$status" -ne 0 && test ! -d "$gentop"; then
exit $status
fi
generated="$generated $gentop"
@@ -3009,16 +3899,42 @@ EOF
$show "${rm}r $xdir"
$run ${rm}r "$xdir"
- $show "mkdir $xdir"
- $run mkdir "$xdir"
+ $show "$mkdir $xdir"
+ $run $mkdir "$xdir"
status=$?
- if test $status -ne 0 && test ! -d "$xdir"; then
+ if test "$status" -ne 0 && test ! -d "$xdir"; then
exit $status
fi
+ # We will extract separately just the conflicting names and we will no
+ # longer touch any unique names. It is faster to leave these extract
+ # automatically by $AR in one run.
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+ if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+ $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+ $AR t "$xabs" | sort | uniq -cd | while read -r count name
+ do
+ i=1
+ while test "$i" -le "$count"
+ do
+ # Put our $i before any first dot (extension)
+ # Never overwrite any file
+ name_to="$name"
+ while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+ do
+ name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+ done
+ $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+ $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+ i=`expr $i + 1`
+ done
+ done
+ fi
- reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
+ reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
done
fi
fi
@@ -3054,8 +3970,8 @@ EOF
# Create an invalid libtool object if no PIC, so that we don't
# accidentally link it into a program.
- $show "echo timestamp > $libobj"
- $run eval "echo timestamp > $libobj" || exit $?
+ # $show "echo timestamp > $libobj"
+ # $run eval "echo timestamp > $libobj" || exit $?
exit 0
fi
@@ -3071,20 +3987,6 @@ EOF
$run eval "$cmd" || exit $?
done
IFS="$save_ifs"
- else
- # Just create a symlink.
- $show $rm $libobj
- $run $rm $libobj
- xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$libobj"; then
- xdir="."
- else
- xdir="$xdir"
- fi
- baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
- oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
- $show "(cd $xdir && $LN_S $oldobj $baseobj)"
- $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
fi
if test -n "$gentop"; then
@@ -3097,7 +3999,7 @@ EOF
prog)
case $host in
- *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;;
+ *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
esac
if test -n "$vinfo"; then
$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
@@ -3122,6 +4024,16 @@ EOF
;;
esac
+ case $host in
+ *darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ if test "$tagname" = CXX ; then
+ compile_command="$compile_command ${wl}-bind_at_load"
+ finalize_command="$finalize_command ${wl}-bind_at_load"
+ fi
+ ;;
+ esac
+
compile_command="$compile_command $compile_deplibs"
finalize_command="$finalize_command $finalize_deplibs"
@@ -3272,12 +4184,12 @@ extern \"C\" {
done
if test -n "$exclude_expsyms"; then
- $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
$run eval '$mv "$nlist"T "$nlist"'
fi
if test -n "$export_symbols_regex"; then
- $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
$run eval '$mv "$nlist"T "$nlist"'
fi
@@ -3285,9 +4197,9 @@ extern \"C\" {
if test -z "$export_symbols"; then
export_symbols="$output_objdir/$output.exp"
$run $rm $export_symbols
- $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
else
- $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
+ $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
$run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
$run eval 'mv "$nlist"T "$nlist"'
fi
@@ -3295,8 +4207,8 @@ extern \"C\" {
for arg in $dlprefiles; do
$show "extracting global C symbols from \`$arg'"
- name=`echo "$arg" | sed -e 's%^.*/%%'`
- $run eval 'echo ": $name " >> "$nlist"'
+ name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
+ $run eval '$echo ": $name " >> "$nlist"'
$run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
done
@@ -3305,12 +4217,18 @@ extern \"C\" {
test -f "$nlist" || : > "$nlist"
if test -n "$exclude_expsyms"; then
- egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
$mv "$nlist"T "$nlist"
fi
# Try sorting and uniquifying the output.
- if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
+ if grep -v "^: " < "$nlist" |
+ if sort -k 3 </dev/null >/dev/null 2>&1; then
+ sort -k 3
+ else
+ sort +2
+ fi |
+ uniq > "$nlist"S; then
:
else
grep -v "^: " < "$nlist" > "$nlist"S
@@ -3319,7 +4237,7 @@ extern \"C\" {
if test -f "$nlist"S; then
eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
else
- echo '/* NONE */' >> "$output_objdir/$dlsyms"
+ $echo '/* NONE */' >> "$output_objdir/$dlsyms"
fi
$echo >> "$output_objdir/$dlsyms" "\
@@ -3371,18 +4289,18 @@ static const void *lt_preloaded_setup() {
*-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
case "$compile_command " in
*" -static "*) ;;
- *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
+ *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
esac;;
*-*-hpux*)
case "$compile_command " in
*" -static "*) ;;
- *) pic_flag_for_symtable=" $pic_flag -DPIC";;
+ *) pic_flag_for_symtable=" $pic_flag";;
esac
esac
# Now compile the dynamic symbol file.
- $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
- $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+ $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+ $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
# Clean up the generated files.
$show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
@@ -3407,7 +4325,7 @@ static const void *lt_preloaded_setup() {
finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
fi
- if test $need_relink = no || test "$build_libtool_libs" != yes; then
+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
# Replace the output file specification.
compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
link_command="$compile_command$compile_rpath"
@@ -3532,7 +4450,7 @@ static const void *lt_preloaded_setup() {
relink_command="$var=\"$var_value\"; export $var; $relink_command"
fi
done
- relink_command="cd `pwd`; $relink_command"
+ relink_command="(cd `pwd`; $relink_command)"
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
fi
@@ -3552,13 +4470,228 @@ static const void *lt_preloaded_setup() {
# win32 will think the script is a binary if it has
# a .exe suffix, so we strip it off here.
case $output in
- *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
+ *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
esac
# test for cygwin because mv fails w/o .exe extensions
case $host in
- *cygwin*) exeext=.exe ;;
+ *cygwin*)
+ exeext=.exe
+ outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
*) exeext= ;;
esac
+ case $host in
+ *cygwin* | *mingw* )
+ cwrappersource=`$echo ${objdir}/lt-${output}.c`
+ cwrapper=`$echo ${output}.exe`
+ $rm $cwrappersource $cwrapper
+ trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
+
+ cat > $cwrappersource <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+
+ Currently, it simply execs the wrapper *script* "/bin/sh $output",
+ but could eventually absorb all of the scripts functionality and
+ exec $objdir/$outputname directly.
+*/
+EOF
+ cat >> $cwrappersource<<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef DIR_SEPARATOR
+#define DIR_SEPARATOR '/'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+ defined (__OS2__)
+#define HAVE_DOS_BASED_FILE_SYSTEM
+#ifndef DIR_SEPARATOR_2
+#define DIR_SEPARATOR_2 '\\'
+#endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+const char *program_name = NULL;
+
+void * xmalloc (size_t num);
+char * xstrdup (const char *string);
+char * basename (const char *name);
+char * fnqualify(const char *path);
+char * strendzap(char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int i;
+
+ program_name = (char *) xstrdup ((char *) basename (argv[0]));
+ newargz = XMALLOC(char *, argc+2);
+EOF
+
+ cat >> $cwrappersource <<EOF
+ newargz[0] = "$SHELL";
+EOF
+
+ cat >> $cwrappersource <<"EOF"
+ newargz[1] = fnqualify(argv[0]);
+ /* we know the script has the same name, without the .exe */
+ /* so make sure newargz[1] doesn't end in .exe */
+ strendzap(newargz[1],".exe");
+ for (i = 1; i < argc; i++)
+ newargz[i+1] = xstrdup(argv[i]);
+ newargz[argc+1] = NULL;
+EOF
+
+ cat >> $cwrappersource <<EOF
+ execv("$SHELL",newargz);
+EOF
+
+ cat >> $cwrappersource <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+ void * p = (void *) malloc (num);
+ if (!p)
+ lt_fatal ("Memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
+;
+}
+
+char *
+basename (const char *name)
+{
+ const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* Skip over the disk name in MSDOS pathnames. */
+ if (isalpha (name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ return (char *) base;
+}
+
+char *
+fnqualify(const char *path)
+{
+ size_t size;
+ char *p;
+ char tmp[LT_PATHMAX + 1];
+
+ assert(path != NULL);
+
+ /* Is it qualified already? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ if (isalpha (path[0]) && path[1] == ':')
+ return xstrdup (path);
+#endif
+ if (IS_DIR_SEPARATOR (path[0]))
+ return xstrdup (path);
+
+ /* prepend the current directory */
+ /* doesn't handle '~' */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal ("getcwd failed");
+ size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
+ p = XMALLOC(char, size);
+ sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
+ return p;
+}
+
+char *
+strendzap(char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert(str != NULL);
+ assert(pat != NULL);
+
+ len = strlen(str);
+ patlen = strlen(pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (strcmp(str, pat) == 0)
+ *str = '\0';
+ }
+ return str;
+}
+
+static void
+lt_error_core (int exit_status, const char * mode,
+ const char * message, va_list ap)
+{
+ fprintf (stderr, "%s: %s: ", program_name, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+ va_end (ap);
+}
+EOF
+ # we should really use a build-platform specific compiler
+ # here, but OTOH, the wrappers (shell script and this C one)
+ # are only useful if you want to execute the "real" binary.
+ # Since the "real" binary is built for $host, then this
+ # wrapper might as well be built for $host, too.
+ $run $LTCC -s -o $cwrapper $cwrappersource
+ ;;
+ esac
$rm $output
trap "$rm $output; exit 1" 1 2 15
@@ -3576,7 +4709,7 @@ static const void *lt_preloaded_setup() {
# Sed substitution that helps us do robust quoting. It backslashifies
# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
+Xsed='${SED} -e 1s/^X//'
sed_quote_subst='$sed_quote_subst'
# The HP-UX ksh and POSIX shell print the target directory to stdout
@@ -3614,7 +4747,7 @@ else
test \"x\$thisdir\" = \"x\$file\" && thisdir=.
# Follow symbolic links until we get to the real thisdir.
- file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
+ file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
while test -n \"\$file\"; do
destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
@@ -3627,7 +4760,7 @@ else
fi
file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
- file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
done
# Try to get the absolute directory name.
@@ -3636,12 +4769,12 @@ else
"
if test "$fast_install" = yes; then
- echo >> $output "\
+ $echo >> $output "\
program=lt-'$outputname'$exeext
progdir=\"\$thisdir/$objdir\"
if test ! -f \"\$progdir/\$program\" || \\
- { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
file=\"\$\$-\$program\"
@@ -3652,7 +4785,7 @@ else
$rm \"\$progdir/\$file\"
fi"
- echo >> $output "\
+ $echo >> $output "\
# relink executable if necessary
if test -n \"\$relink_command\"; then
@@ -3670,13 +4803,13 @@ else
$rm \"\$progdir/\$file\"
fi"
else
- echo >> $output "\
+ $echo >> $output "\
program='$outputname'
progdir=\"\$thisdir/$objdir\"
"
fi
- echo >> $output "\
+ $echo >> $output "\
if test -f \"\$progdir/\$program\"; then"
@@ -3707,14 +4840,6 @@ else
# Run the actual program with our arguments.
"
case $host in
- # win32 systems need to use the prog path for dll
- # lookup to work
- *-*-cygwin* | *-*-pw32*)
- $echo >> $output "\
- exec \$progdir/\$program \${1+\"\$@\"}
-"
- ;;
-
# Backslashes separate directories on plain windows
*-*-mingw | *-*-os2*)
$echo >> $output "\
@@ -3724,11 +4849,7 @@ else
*)
$echo >> $output "\
- # Export the path to the program.
- PATH=\"\$progdir:\$PATH\"
- export PATH
-
- exec \$program \${1+\"\$@\"}
+ exec \$progdir/\$program \${1+\"\$@\"}
"
;;
esac
@@ -3740,7 +4861,7 @@ else
# The program doesn't exist.
\$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
\$echo \"This script is just a wrapper for \$program.\" 1>&2
- echo \"See the $PACKAGE documentation for more information.\" 1>&2
+ $echo \"See the $PACKAGE documentation for more information.\" 1>&2
exit 1
fi
fi\
@@ -3763,7 +4884,7 @@ fi\
oldobjs="$libobjs_save"
build_libtool_libs=no
else
- oldobjs="$objs$old_deplibs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
+ oldobjs="$old_deplibs $non_pic_objects"
fi
addlibs="$old_convenience"
fi
@@ -3772,10 +4893,10 @@ fi\
gentop="$output_objdir/${outputname}x"
$show "${rm}r $gentop"
$run ${rm}r "$gentop"
- $show "mkdir $gentop"
- $run mkdir "$gentop"
+ $show "$mkdir $gentop"
+ $run $mkdir "$gentop"
status=$?
- if test $status -ne 0 && test ! -d "$gentop"; then
+ if test "$status" -ne 0 && test ! -d "$gentop"; then
exit $status
fi
generated="$generated $gentop"
@@ -3792,14 +4913,40 @@ fi\
$show "${rm}r $xdir"
$run ${rm}r "$xdir"
- $show "mkdir $xdir"
- $run mkdir "$xdir"
+ $show "$mkdir $xdir"
+ $run $mkdir "$xdir"
status=$?
- if test $status -ne 0 && test ! -d "$xdir"; then
+ if test "$status" -ne 0 && test ! -d "$xdir"; then
exit $status
fi
+ # We will extract separately just the conflicting names and we will no
+ # longer touch any unique names. It is faster to leave these extract
+ # automatically by $AR in one run.
$show "(cd $xdir && $AR x $xabs)"
$run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+ if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+ $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+ $AR t "$xabs" | sort | uniq -cd | while read -r count name
+ do
+ i=1
+ while test "$i" -le "$count"
+ do
+ # Put our $i before any first dot (extension)
+ # Never overwrite any file
+ name_to="$name"
+ while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+ do
+ name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+ done
+ $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+ $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+ i=`expr $i + 1`
+ done
+ done
+ fi
oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
done
@@ -3809,25 +4956,65 @@ fi\
if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
eval cmds=\"$old_archive_from_new_cmds\"
else
- # Ensure that we have .o objects in place in case we decided
- # not to build a shared library, and have fallen back to building
- # static libs even though --disable-static was passed!
- for oldobj in $oldobjs; do
- if test ! -f $oldobj; then
- xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
- if test "X$xdir" = "X$oldobj"; then
- xdir="."
+ eval cmds=\"$old_archive_cmds\"
+
+ if len=`expr "X$cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # the command line is too long to link in one step, link in parts
+ $echo "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+ # GNU ar 2.10+ was changed to match POSIX; thus no paths are
+ # encoded into archives. This makes 'ar r' malfunction in
+ # this piecewise linking case whenever conflicting object
+ # names appear in distinct ar calls; check, warn and compensate.
+ if (for obj in $save_oldobjs
+ do
+ $echo "X$obj" | $Xsed -e 's%^.*/%%'
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
+ $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
+ AR_FLAGS=cq
+ fi
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ for obj in $save_oldobjs
+ do
+ oldobjs="$objlist $obj"
+ objlist="$objlist $obj"
+ eval test_cmds=\"$old_archive_cmds\"
+ if len=`expr "X$test_cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len"; then
+ :
else
- xdir="$xdir"
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ if test "$obj" = "$last_oldobj" ; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
fi
- baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
- obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
- $show "(cd $xdir && ${LN_S} $obj $baseobj)"
- $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test "X$oldobjs" = "X" ; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~$old_archive_cmds\"
fi
- done
-
- eval cmds=\"$old_archive_cmds\"
+ fi
fi
save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
@@ -3862,7 +5049,7 @@ fi\
fi
done
# Quote the link command for shipping.
- relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
+ relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
# Only create the output if not a dry run.
@@ -3879,7 +5066,7 @@ fi\
case $deplib in
*.la)
name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
- eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
if test -z "$libdir"; then
$echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
exit 1
@@ -3893,7 +5080,7 @@ fi\
newdlfiles=
for lib in $dlfiles; do
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
- eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
if test -z "$libdir"; then
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1
@@ -3904,7 +5091,7 @@ fi\
newdlprefiles=
for lib in $dlprefiles; do
name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
- eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
if test -z "$libdir"; then
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
exit 1
@@ -3917,7 +5104,7 @@ fi\
# place dlname in correct position for cygwin
tdlname=$dlname
case $host,$output,$installed,$module,$dlname in
- *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
esac
$echo > $output "\
# $outputname - a libtool library file
@@ -3946,13 +5133,16 @@ revision=$revision
# Is this an already installed library?
installed=$installed
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
# Files to dlopen/dlpreopen
dlopen='$dlfiles'
dlpreopen='$dlprefiles'
# Directory that this library needs to be installed in:
libdir='$install_libdir'"
- if test "$installed" = no && test $need_relink = yes; then
+ if test "$installed" = no && test "$need_relink" = yes; then
$echo >> $output "\
relink_command=\"$relink_command\""
fi
@@ -4088,7 +5278,7 @@ relink_command=\"$relink_command\""
# Not a directory, so check to see that there is only one file specified.
set dummy $files
- if test $# -gt 2; then
+ if test "$#" -gt 2; then
$echo "$modename: \`$dest' is not a directory" 1>&2
$echo "$help" 1>&2
exit 1
@@ -4128,7 +5318,7 @@ relink_command=\"$relink_command\""
*.la)
# Check to see that this really is a libtool archive.
- if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
else
$echo "$modename: \`$file' is not a valid libtool archive" 1>&2
$echo "$help" 1>&2
@@ -4145,21 +5335,12 @@ relink_command=\"$relink_command\""
esac
# Add the libdir to current_libdirs if it is the destination.
- DESTDIR=
if test "X$destdir" = "X$libdir"; then
case "$current_libdirs " in
*" $libdir "*) ;;
*) current_libdirs="$current_libdirs $libdir" ;;
esac
else
- case "$destdir" in
- *"$libdir")
- DESTDIR=`$echo "$destdir" | sed -e 's!'"$libdir"'$!!'`
- if test "X$destdir" != "X$DESTDIR$libdir"; then
- DESTDIR=
- fi
- ;;
- esac
# Note the libdir as a future libdir.
case "$future_libdirs " in
*" $libdir "*) ;;
@@ -4172,16 +5353,35 @@ relink_command=\"$relink_command\""
dir="$dir$objdir"
if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ if test "$inst_prefix_dir" = "$destdir"; then
+ $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
+ exit 1
+ fi
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ else
+ relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+ fi
+
$echo "$modename: warning: relinking \`$file'" 1>&2
- export DESTDIR
$show "$relink_command"
if $run eval "$relink_command"; then :
else
$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
- continue
+ exit 1
fi
fi
- unset DESTDIR
# See the names of the shared library.
set dummy $library_names
@@ -4201,7 +5401,7 @@ relink_command=\"$relink_command\""
$run eval "$striplib $destdir/$realname" || exit $?
fi
- if test $# -gt 0; then
+ if test "$#" -gt 0; then
# Delete the old symlinks, and create new ones.
for linkname
do
@@ -4287,20 +5487,48 @@ relink_command=\"$relink_command\""
destfile="$destdir/$destfile"
fi
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=""
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ file=`$echo $file|${SED} 's,.exe$,,'`
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
# Do a test to see if this is really a libtool program.
- if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ case $host in
+ *cygwin*|*mingw*)
+ wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
notinst_deplibs=
relink_command=
+ # To insure that "foo" is sourced, and not "foo.exe",
+ # finese the cygwin/MSYS system by explicitly sourcing "foo."
+ # which disallows the automatic-append-.exe behavior.
+ case $build in
+ *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
+ *) wrapperdot=${wrapper} ;;
+ esac
# If there is no directory component, then add one.
case $file in
- */* | *\\*) . $file ;;
- *) . ./$file ;;
+ */* | *\\*) . ${wrapperdot} ;;
+ *) . ./${wrapperdot} ;;
esac
# Check the variables that should have been set.
if test -z "$notinst_deplibs"; then
- $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
+ $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
exit 1
fi
@@ -4323,10 +5551,17 @@ relink_command=\"$relink_command\""
done
relink_command=
+ # To insure that "foo" is sourced, and not "foo.exe",
+ # finese the cygwin/MSYS system by explicitly sourcing "foo."
+ # which disallows the automatic-append-.exe behavior.
+ case $build in
+ *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
+ *) wrapperdot=${wrapper} ;;
+ esac
# If there is no directory component, then add one.
case $file in
- */* | *\\*) . $file ;;
- *) . ./$file ;;
+ */* | *\\*) . ${wrapperdot} ;;
+ *) . ./${wrapperdot} ;;
esac
outputname=
@@ -4334,13 +5569,14 @@ relink_command=\"$relink_command\""
if test "$finalize" = yes && test -z "$run"; then
tmpdir="/tmp"
test -n "$TMPDIR" && tmpdir="$TMPDIR"
- tmpdir="$tmpdir/libtool-$$"
+ tmpdir=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null` ||
+ tmpdir="$tmpdir/libtool-$$"
if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
else
$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
continue
fi
- file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
outputname="$tmpdir/$file"
# Replace the output file specification.
relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
@@ -4358,14 +5594,14 @@ relink_command=\"$relink_command\""
fi
else
# Install the binary that we compiled earlier.
- file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+ file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
fi
fi
# remove .exe since cygwin /usr/bin/install will append another
# one anyways
case $install_prog,$host in
- /usr/bin/install*,*cygwin*)
+ */usr/bin/install*,*cygwin*)
case $file:$destfile in
*.exe:*.exe)
# this is ok
@@ -4374,7 +5610,7 @@ relink_command=\"$relink_command\""
destfile=$destfile.exe
;;
*:*.exe)
- destfile=`echo $destfile | sed -e 's,.exe$,,'`
+ destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
;;
esac
;;
@@ -4459,42 +5695,42 @@ relink_command=\"$relink_command\""
fi
# Exit here if they wanted silent mode.
- test "$show" = ":" && exit 0
+ test "$show" = : && exit 0
- echo "----------------------------------------------------------------------"
- echo "Libraries have been installed in:"
+ $echo "----------------------------------------------------------------------"
+ $echo "Libraries have been installed in:"
for libdir in $libdirs; do
- echo " $libdir"
+ $echo " $libdir"
done
- echo
- echo "If you ever happen to want to link against installed libraries"
- echo "in a given directory, LIBDIR, you must either use libtool, and"
- echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
- echo "flag during linking and do at least one of the following:"
+ $echo
+ $echo "If you ever happen to want to link against installed libraries"
+ $echo "in a given directory, LIBDIR, you must either use libtool, and"
+ $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ $echo "flag during linking and do at least one of the following:"
if test -n "$shlibpath_var"; then
- echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
- echo " during execution"
+ $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ $echo " during execution"
fi
if test -n "$runpath_var"; then
- echo " - add LIBDIR to the \`$runpath_var' environment variable"
- echo " during linking"
+ $echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ $echo " during linking"
fi
if test -n "$hardcode_libdir_flag_spec"; then
libdir=LIBDIR
eval flag=\"$hardcode_libdir_flag_spec\"
- echo " - use the \`$flag' linker flag"
+ $echo " - use the \`$flag' linker flag"
fi
if test -n "$admincmds"; then
- echo " - have your system administrator run these commands:$admincmds"
+ $echo " - have your system administrator run these commands:$admincmds"
fi
if test -f /etc/ld.so.conf; then
- echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
fi
- echo
- echo "See any operating system documentation about shared libraries for"
- echo "more information, such as the ld(1) and ld.so(8) manual pages."
- echo "----------------------------------------------------------------------"
+ $echo
+ $echo "See any operating system documentation about shared libraries for"
+ $echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ $echo "----------------------------------------------------------------------"
exit 0
;;
@@ -4522,7 +5758,7 @@ relink_command=\"$relink_command\""
case $file in
*.la)
# Check to see that this really is a libtool archive.
- if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
else
$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
$echo "$help" 1>&2
@@ -4593,7 +5829,7 @@ relink_command=\"$relink_command\""
-*) ;;
*)
# Do a test to see if this is really a libtool program.
- if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
# If there is no directory component, then add one.
case $file in
*/* | *\\*) . $file ;;
@@ -4616,7 +5852,7 @@ relink_command=\"$relink_command\""
eval "export $shlibpath_var"
fi
- # Restore saved enviroment variables
+ # Restore saved environment variables
if test "${save_LC_ALL+set}" = set; then
LC_ALL="$save_LC_ALL"; export LC_ALL
fi
@@ -4625,14 +5861,14 @@ relink_command=\"$relink_command\""
fi
# Now prepare to actually exec the command.
- exec_cmd='"$cmd"$args'
+ exec_cmd="\"\$cmd\"$args"
else
# Display what would be done.
if test -n "$shlibpath_var"; then
eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
$echo "export $shlibpath_var"
fi
- $echo "$cmd$args"
+ eval \$echo \"\$cmd\"$args
exit 0
fi
;;
@@ -4666,19 +5902,20 @@ relink_command=\"$relink_command\""
rmdirs=
+ origobjdir="$objdir"
for file in $files; do
dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
if test "X$dir" = "X$file"; then
dir=.
- objdir="$objdir"
+ objdir="$origobjdir"
else
- objdir="$dir/$objdir"
+ objdir="$dir/$origobjdir"
fi
name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
- test $mode = uninstall && objdir="$dir"
+ test "$mode" = uninstall && objdir="$dir"
# Remember objdir for removal later, being careful to avoid duplicates
- if test $mode = clean; then
+ if test "$mode" = clean; then
case " $rmdirs " in
*" $objdir "*) ;;
*) rmdirs="$rmdirs $objdir" ;;
@@ -4702,7 +5939,7 @@ relink_command=\"$relink_command\""
case $name in
*.la)
# Possibly a libtool archive, so verify it.
- if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
. $dir/$name
# Delete the libtool libraries and symlinks.
@@ -4710,9 +5947,9 @@ relink_command=\"$relink_command\""
rmfiles="$rmfiles $objdir/$n"
done
test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
- test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+ test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
- if test $mode = uninstall; then
+ if test "$mode" = uninstall; then
if test -n "$library_names"; then
# Do each command in the postuninstall commands.
eval cmds=\"$postuninstall_cmds\"
@@ -4721,7 +5958,7 @@ relink_command=\"$relink_command\""
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd"
- if test $? != 0 && test "$rmforce" != yes; then
+ if test "$?" -ne 0 && test "$rmforce" != yes; then
exit_status=1
fi
done
@@ -4736,7 +5973,7 @@ relink_command=\"$relink_command\""
IFS="$save_ifs"
$show "$cmd"
$run eval "$cmd"
- if test $? != 0 && test "$rmforce" != yes; then
+ if test "$?" -ne 0 && test "$rmforce" != yes; then
exit_status=1
fi
done
@@ -4748,22 +5985,52 @@ relink_command=\"$relink_command\""
;;
*.lo)
- if test "$build_old_libs" = yes; then
- oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
- rmfiles="$rmfiles $dir/$oldobj"
+ # Possibly a libtool object, so verify it.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+
+ # Read the .lo file
+ . $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" \
+ && test "$pic_object" != none; then
+ rmfiles="$rmfiles $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" \
+ && test "$non_pic_object" != none; then
+ rmfiles="$rmfiles $dir/$non_pic_object"
+ fi
fi
;;
*)
- # Do a test to see if this is a libtool program.
- if test $mode = clean &&
- (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
- relink_command=
- . $dir/$file
+ if test "$mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+ file=`$echo $file|${SED} 's,.exe$,,'`
+ noexename=`$echo $name|${SED} 's,.exe$,,'`
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ rmfiles="$rmfiles $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ relink_command=
+ . $dir/$noexename
- rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
- if test "$fast_install" = yes && test -n "$relink_command"; then
- rmfiles="$rmfiles $objdir/lt-$name"
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+ rmfiles="$rmfiles $objdir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+ rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+ fi
fi
fi
;;
@@ -4771,6 +6038,7 @@ relink_command=\"$relink_command\""
$show "$rm $rmfiles"
$run $rm $rmfiles || exit_status=1
done
+ objdir="$origobjdir"
# Try to remove the ${objdir}s in the directories where we deleted files
for dir in $rmdirs; do
@@ -4818,6 +6086,7 @@ Provide generalized library-building support services.
--mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
--quiet same as \`--silent'
--silent don't print informational messages
+ --tag=TAG use configuration variables from tag TAG
--version print version information
MODE must be one of the following:
@@ -4831,7 +6100,9 @@ MODE must be one of the following:
uninstall remove libraries from an installed directory
MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
-a more detailed description of MODE."
+a more detailed description of MODE.
+
+Report bugs to <bug-libtool@gnu.org>."
exit 0
;;
@@ -4943,6 +6214,7 @@ The following components of LINK-COMMAND are treated specially:
-no-install link a not-installable executable
-no-undefined declare that a library does not refer to external symbols
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -objectlist FILE Use a list of object files found in FILE to specify objects
-release RELEASE specify package release information
-rpath LIBDIR the created library will eventually be installed in LIBDIR
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
@@ -4988,11 +6260,31 @@ Otherwise, only FILE itself is deleted using RM."
;;
esac
-echo
+$echo
$echo "Try \`$modename --help' for more information about other modes."
exit 0
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
# Local Variables:
# mode:shell-script
# sh-indentation:2
diff --git a/man/Makefile.am b/man/Makefile.am
index 9f919e77b8f..37eb8a13f4e 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -21,7 +21,26 @@ man_MANS = mysql.1 isamchk.1 isamlog.1 mysql_zap.1 mysqlaccess.1 \
mysqladmin.1 mysqld.1 mysqld_multi.1 mysqldump.1 mysqlshow.1 \
perror.1 replace.1 mysqld_safe.1 mysql_fix_privilege_tables.1
-EXTRA_DIST = $(man_MANS)
+EXTRA_DIST = mysql.1.in isamchk.1.in isamlog.1.in mysql_zap.1.in \
+ mysqlaccess.1.in mysqladmin.1.in mysqld.1.in mysqld_multi.1.in \
+ mysqldump.1.in mysqlshow.1.in perror.1.in replace.1.in \
+ mysqld_safe.1.in mysql_fix_privilege_tables.1.in
+
+CLEANFILES = $(man_MANS)
+
+SUFFIXES = .in
+
+.in:
+ @RM@ -f $@ $@-t
+ @SED@ \
+ -e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \
+ -e 's!@''sysconfdir''@!@sysconfdir@!' \
+ -e 's!@''bindir''@!$(bindir)!g' \
+ -e 's!@''libexecdir''@!$(libexecdir)!g' \
+ -e 's!@''localstatedir''@!$(localstatedir)!g' \
+ -e 's!@''MYSQL_NO_DASH_VERSION''@!@MYSQL_NO_DASH_VERSION@!' \
+ $< > $@-t
+ @MV@ $@-t $@
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/man/isamchk.1 b/man/isamchk.1.in
index 341e968a131..cad1303ee55 100644
--- a/man/isamchk.1
+++ b/man/isamchk.1.in
@@ -1,4 +1,4 @@
-.TH isamchk 1 "19 December 2000" "MySQL 4.0" "MySQL database"
+.TH isamchk 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME
.BR isamchk
\- Description, check and repair of ISAM tables.
@@ -114,24 +114,29 @@ Print version and exit.
.BR \-w | \-\-wait
Wait if table is locked.
.SH "SEE ALSO"
-isamchk (1),
-isamlog (1),
-mysqlaccess (1),
-mysqladmin (1),
-mysqlbug (1),
-mysqld (1),
-mysqldump (1),
-mysqlshow (1),
-msql2mysql (1),
-perror (1),
-replace (1),
-mysqld_safe (1),
-which1 (1),
-zap (1),
+isamlog(1),
+mysql(1),
+mysqlaccess(1),
+mysqladmin(1),
+mysqld(1),
+mysqld_multi(1),
+mysqld_safe(1),
+mysqldump(1),
+mysql_fix_privilege_tables(1),
+mysqlshow(1),
+mysql_zap(1),
+perror(1),
+replace(1)
+.P
+For more information please refer to the MySQL reference
+manual, which may already be installed locally and which
+is also available online at http://www.mysql.com/doc/en/
+.SH BUGS
+Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR
-Ver 1.0, distribution 3.23.29a
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
+Michael (Monty) Widenius (monty@mysql.com),
+MySQL AB (http://www.mysql.com/).
This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen
(kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
diff --git a/man/isamlog.1 b/man/isamlog.1.in
index 402c3052ad8..6040f6c4ad8 100644
--- a/man/isamlog.1
+++ b/man/isamlog.1.in
@@ -1,4 +1,4 @@
-.TH isamlog 1 "19 December 2000" "MySQL 4.0" "MySQL database"
+.TH isamlog 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME
isamlog - Write info about whats in a nisam log file.
.SH USAGE
@@ -71,27 +71,31 @@ If one gives table names as arguments only these tables will be updated
.SH "SEE ALSO"
-
-isamchk (1),
-isamlog (1),
-mysqlaccess (1),
-mysqladmin (1),
-mysqlbug (1),
-mysqld (1),
-mysqldump (1),
-mysqlshow (1),
-msql2mysql (1),
-perror (1),
-replace (1),
-mysqld_safe (1),
-which1 (1),
-zap (1),
+isamchk(1),
+mysql(1),
+mysqlaccess(1),
+mysqladmin(1),
+mysqld(1),
+mysqld_multi(1),
+mysqld_safe(1),
+mysqldump(1),
+mysql_fix_privilege_tables(1),
+mysqlshow(1),
+mysql_zap(1),
+perror(1),
+replace(1)
+.P
+For more information please refer to the MySQL reference
+manual, which may already be installed locally and which
+is also available online at http://www.mysql.com/doc/en/
+.SH BUGS
+Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR
-Ver 1.0, distribution 3.23.29a
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
+Michael (Monty) Widenius (monty@mysql.com),
+MySQL AB (http://www.mysql.com/).
This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen
(kill-9@kill-9.dk), Mercurmedia Data Model Architect /
diff --git a/man/mysql.1 b/man/mysql.1.in
index c0c37716b14..35ff48693e1 100644
--- a/man/mysql.1
+++ b/man/mysql.1.in
@@ -1,6 +1,8 @@
-.TH mysql 1 "19 December 2000" "MySQL 4.0" "MySQL database"
+.TH mysql 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME
mysql \- text-based client for mysqld, a SQL-based relational database daemon
+.SH USAGE
+mysql [OPTIONS] [Database]
.SH SYNOPSIS
.B mysql
.RB [ \-B | \-\-batch ]
@@ -105,16 +107,19 @@ version number and exit.
Wait and retry if the database server connection is down.
.SH FILES
.TP 2.2i
-.I /depot/bin/mysql
-executable
+.I @sysconfdir@/my.cnf
+MySQL configuration file
.TP
-.I /depot/bin/mysqld
-executable
+.I @bindir@/mysql
+Client executable
.TP
-.I /depot/bin/mysqld_safe
+.I @libexecdir@/mysqld
+Server executable
+.TP
+.I @bindir@/mysqld_safe
executable shell script for starting mysqld safely
.TP
-.I /site/var/mysql/data
+.I @localstatedir@
location of database files
.SH EXAMPLE
You can also read a backup dump file back into MySQL with:
@@ -124,24 +129,29 @@ You can also read a backup dump file back into MySQL with:
.BR <
backup-file.sql
.SH "SEE ALSO"
-isamchk (1),
-isamlog (1),
-mysqlaccess (1),
-mysqladmin (1),
-mysqlbug (1),
-mysqld (1),
-mysqldump (1),
-mysqlshow (1),
-msql2mysql (1),
-perror (1),
-replace (1),
-mysqld_safe (1),
-which1 (1),
-zap (1),
+isamchk(1),
+isamlog(1),
+mysqlaccess(1),
+mysqladmin(1),
+mysqld(1),
+mysqld_multi(1),
+mysqld_safe(1),
+mysqldump(1),
+mysql_fix_privilege_tables(1),
+mysqlshow(1),
+mysql_zap(1),
+perror(1),
+replace(1)
+.P
+For more information please refer to the MySQL reference
+manual, which may already be installed locally and which
+is also available online at http://www.mysql.com/doc/en/
+.SH BUGS
+Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR
-Ver 6.3, distribution 3.20.20
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+Ver 6.3, distribution @MYSQL_NO_DASH_VERSION@
+Michael (Monty) Widenius (monty@mysql.com),
+MySQL AB (http://www.mysql.com/)
This software comes with no warranty.
Manual page by R. P. C. Rodgers,
Lister Hill National Center for Biomedical Communication,
diff --git a/man/mysql_fix_privilege_tables.1 b/man/mysql_fix_privilege_tables.1.in
index 4ed81368098..1d42681f298 100644
--- a/man/mysql_fix_privilege_tables.1
+++ b/man/mysql_fix_privilege_tables.1.in
@@ -1,4 +1,4 @@
-.TH mysql 1 "17 March 2003" "MySQL 4.0" "MySQL database"
+.TH mysql 1 "17 March 2003" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME
mysql_fix_privilege_tables \- Fixes MySQL privilege tables.
.SH SYNOPSIS
@@ -14,7 +14,25 @@ If you get 'Access denied' errors, run the script again
and give the MySQL root user password as an argument.
.SH "SEE ALSO"
-mysql (1), mysqld (1)
+isamchk(1),
+isamlog(1),
+mysql(1),
+mysqlaccess(1),
+mysqladmin(1),
+mysqld(1),
+mysqld_multi(1),
+mysqld_safe(1),
+mysqldump(1),
+mysqlshow(1),
+mysql_zap(1),
+perror(1),
+replace(1)
+.P
+For more information please refer to the MySQL reference
+manual, which may already be installed locally and which
+is also available online at http://www.mysql.com/doc/en/
+.SH BUGS
+Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR
This manpage was written by Christian Hammers <ch@debian.org>.
diff --git a/man/mysql_zap.1 b/man/mysql_zap.1
deleted file mode 100644
index 71931c03db6..00000000000
--- a/man/mysql_zap.1
+++ /dev/null
@@ -1,34 +0,0 @@
-.TH zap 1 "19 December 2000" "MySQL 4.0" "MySQL database"
-.SH NAME
-zap - a perl script used to kill processes
-.SH USAGE
-/usr/bin/mysql_zap [-signal] [-?Ift] pattern
-.SH SYNOPSIS
-.B zap
-.RB [ \-I | \-? ]
-.RB [ \-f ]
-.RB [ \-t ]
-.SH DESCRIPTION
-.TP
-.BR zap
-supports by executing
-.TP
-.BR \-I | \-?
-info
-.TP
-.BR \-f
-force
-.TP
-.BR \-t
-test
-.SH NOTE
-If
-.BR -f
-isn't given, ask user for confirmation for each process to kill. If signal isn't given, try first with signal 15 and after that with signal 9. If
-.BR -t
-is given the processes is only shown on stdout.
-.SH "SEE ALSO"
-isamchk (1), isamlog (1), mysqlaccess (1), mysqladmin (1), mysqlbug (1), mysqld (1), mysqldump (1), mysqlshow (1), msql2mysql (1), perror (1), replace (1), mysqld_safe (1), which1 (1), zap (1),
-.SH AUTHOR
-Ver 1.0, distribution 3.23.29a Michael (Monty) Widenius (monty@tcx.se), TCX Datakonsult AB (http://www.tcx.se). This software comes with no warranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mercurmedia.com)
-.\" end of man page \ No newline at end of file
diff --git a/man/mysql_zap.1.in b/man/mysql_zap.1.in
new file mode 100644
index 00000000000..511a8feaa7c
--- /dev/null
+++ b/man/mysql_zap.1.in
@@ -0,0 +1,52 @@
+.TH zap 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
+.SH NAME
+zap - a perl script used to kill processes
+.SH USAGE
+/usr/bin/mysql_zap [-signal] [-?Ift] pattern
+.SH SYNOPSIS
+.B zap
+.RB [ \-I | \-? ]
+.RB [ \-f ]
+.RB [ \-t ]
+.SH DESCRIPTION
+.TP
+.BR zap
+supports by executing
+.TP
+.BR \-I | \-?
+info
+.TP
+.BR \-f
+force
+.TP
+.BR \-t
+test
+.SH NOTE
+If
+.BR -f
+isn't given, ask user for confirmation for each process to kill. If signal isn't given, try first with signal 15 and after that with signal 9. If
+.BR -t
+is given the processes is only shown on stdout.
+.SH "SEE ALSO"
+isamchk(1),
+isamlog(1),
+mysql(1),
+mysqlaccess(1),
+mysqladmin(1),
+mysqld(1),
+mysqld_multi(1),
+mysqld_safe(1),
+mysqldump(1),
+mysql_fix_privilege_tables(1),
+mysqlshow(1),
+perror(1),
+replace(1)
+.P
+For more information please refer to the MySQL reference
+manual, which may already be installed locally and which
+is also available online at http://www.mysql.com/doc/en/
+.SH BUGS
+Please refer to http://bugs.mysql.com/ to report bugs.
+.SH AUTHOR
+Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@ Michael (Monty) Widenius (monty@mysql.com), MySQL AB (http://www.mysql.com/). This software comes with no warranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mercurmedia.com)
+.\" end of man page
diff --git a/man/mysqlaccess.1 b/man/mysqlaccess.1.in
index 95e392b1194..9a5e58541d2 100644
--- a/man/mysqlaccess.1
+++ b/man/mysqlaccess.1.in
@@ -1,4 +1,4 @@
-.TH mysqlaccess 1 "19 December 2000" "MySQL 4.0" "MySQL database"
+.TH mysqlaccess 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME
.BR mysqlaccess
\- Create new users to mysql.
@@ -95,24 +95,29 @@ If no host is given, `localhost' is assumed
Wildcards (*,?,%,_) are allowed for host, user and db, but be sure
to escape them from your shell!! (i.e., type \\* or '*')
.SH "SEE ALSO"
-isamchk (1),
-isamlog (1),
-mysqlaccess (1),
-mysqladmin (1),
-mysqlbug (1),
-mysqld (1),
-mysqldump (1),
-mysqlshow (1),
-msql2mysql (1),
-perror (1),
-replace (1),
-mysqld_safe (1),
-which1 (1),
-zap (1),
+isamchk(1),
+isamlog(1),
+mysql(1),
+mysqladmin(1),
+mysqld(1),
+mysqld_multi(1),
+mysqld_safe(1),
+mysqldump(1),
+mysql_fix_privilege_tables(1),
+mysqlshow(1),
+mysql_zap(1),
+perror(1),
+replace(1)
+.P
+For more information please refer to the MySQL reference
+manual, which may already be installed locally and which
+is also available online at http://www.mysql.com/doc/en/
+.SH BUGS
+Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR
-Ver 1.0, distribution 3.23.29a
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
+Michael (Monty) Widenius (monty@mysql.com),
+MySQL AB (http://www.mysql.com/).
This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen
(kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
diff --git a/man/mysqladmin.1 b/man/mysqladmin.1.in
index 693e8aa5a72..a549f1c0e22 100644
--- a/man/mysqladmin.1
+++ b/man/mysqladmin.1.in
@@ -1,4 +1,4 @@
-.TH mysqladmin 1 "19 December 2000" "MySQL 4.0" "MySQL database"
+.TH mysqladmin 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME
mysqladmin [OPTIONS] command command.... \- A utility for performing administrative operations
.SH OPTION SYNOPSIS
@@ -178,31 +178,32 @@ Prints variables available
.BR version
Get version info from server
.SH "SEE ALSO"
-isamchk (1),
-isamlog (1),
-mysqlaccess (1),
-mysqladmin (1),
-mysqlbug (1),
-mysqld (1),
-mysqldump (1),
-mysqlshow (1),
-msql2mysql (1),
-perror (1),
-replace (1),
-mysqld_safe (1),
-which1 (1),
-zap (1),
+isamchk(1),
+isamlog(1),
+mysql(1),
+mysqlaccess(1),
+mysqld(1),
+mysqld_multi(1),
+mysqld_safe(1),
+mysqldump(1),
+mysql_fix_privilege_tables(1),
+mysqlshow(1),
+mysql_zap(1),
+perror(1),
+replace(1)
+.P
+For more information please refer to the MySQL reference
+manual, which may already be installed locally and which
+is also available online at http://www.mysql.com/doc/en/
+.SH BUGS
+Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR
-Ver 1.0, distribution 3.23.29a
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
+Michael (Monty) Widenius (monty@mysql.com),
+MySQL AB (http://www.mysql.com/).
This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen
(kill-9@kill-9.dk), Mercurmedia Data Model Architect /
system developer (http://www.mercurmedia.com)
.\" end of man page
-
-
-
-
diff --git a/man/mysqld.1 b/man/mysqld.1.in
index 98247cd9445..719711edca2 100644
--- a/man/mysqld.1
+++ b/man/mysqld.1.in
@@ -1,7 +1,6 @@
-.TH mysqld 1 "19 December 2000" "MySQL 4.0" "MySQL database"
+.TH mysqld 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME
-.BR mysqld
- \- Starts the MySQL server demon
+mysqld \- The MySQL server demon
.SH USAGE
mysqld [OPTIONS]
.SH SYNOPSIS
@@ -204,24 +203,29 @@ Output version information and exit.
.SH NOTE
.SH "SEE ALSO"
-isamchk (1),
-isamlog (1),
-mysqlaccess (1),
-mysqladmin (1),
-mysqlbug (1),
-mysqld (1),
-mysqldump (1),
-mysqlshow (1),
-msql2mysql (1),
-perror (1),
-replace (1),
-mysqld_safe (1),
-which1 (1),
-zap (1),
+isamchk(1),
+isamlog(1),
+mysql(1),
+mysqlaccess(1),
+mysqladmin(1),
+mysqld_multi(1),
+mysqld_safe(1),
+mysqldump(1),
+mysql_fix_privilege_tables(1),
+mysqlshow(1),
+mysql_zap(1),
+perror(1),
+replace(1)
+.P
+For more information please refer to the MySQL reference
+manual, which may already be installed locally and which
+is also available online at http://www.mysql.com/doc/en/
+.SH BUGS
+Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR
-Ver 1.0, distribution 3.23.29a
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
+Michael (Monty) Widenius (monty@mysql.com),
+MySQL AB (http://www.mysql.com/).
This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen
(kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
diff --git a/man/mysqld_multi.1 b/man/mysqld_multi.1.in
index 47418835939..26e7a091b60 100644
--- a/man/mysqld_multi.1
+++ b/man/mysqld_multi.1.in
@@ -1,4 +1,4 @@
-.TH mysqld_multi 1 "19 December 2000" "MySQL 4.0" "MySQL database"
+.TH mysqld_multi 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME
mysqld_multi - is meant for managing several mysqld processes running in different UNIX sockets and TCP/IP ports.
.SH USAGE
@@ -58,27 +58,31 @@ Please see the mysql manual for more detailed information on this.
.SH "SEE ALSO"
-
-isamchk (1),
-isamlog (1),
-mysqlaccess (1),
-mysqladmin (1),
-mysqlbug (1),
-mysqld (1),
-mysqldump (1),
-mysqlshow (1),
-msql2mysql (1),
-perror (1),
-replace (1),
-mysqld_safe (1),
-which1 (1),
-zap (1),
+isamchk(1),
+isamlog(1),
+mysql(1),
+mysqlaccess(1),
+mysqladmin(1),
+mysqld(1),
+mysqld_safe(1),
+mysqldump(1),
+mysql_fix_privilege_tables(1),
+mysqlshow(1),
+mysql_zap(1),
+perror(1),
+replace(1)
+.P
+For more information please refer to the MySQL reference
+manual, which may already be installed locally and which
+is also available online at http://www.mysql.com/doc/en/
+.SH BUGS
+Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR
-Ver 1.0, distribution 3.23.29a
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
+Michael (Monty) Widenius (monty@mysql.com),
+MySQL AB (http://www.mysql.com/).
This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen
(kill-9@kill-9.dk), Mercurmedia Data Model Architect /
diff --git a/man/mysqld_safe.1 b/man/mysqld_safe.1.in
index 3679346d7db..641f34677c7 100644
--- a/man/mysqld_safe.1
+++ b/man/mysqld_safe.1.in
@@ -1,4 +1,4 @@
-.TH safe_mysqld 1 "19 December 2000" "MySQL 4.0" "MySQL database"
+.TH safe_mysqld 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME
mysqld_safe \- start the mysqld daemon on Unix.
.SH SYNOPSIS
@@ -60,22 +60,27 @@ Set the timezone (the TZ) variable to the value of this parameter.
.SH NOTE
Note that all options on the command line to mysqld_safe are passed to mysqld. If you wants to use any options in mysqld_safe that mysqld doesn't support, you must specify these in the option file.
.SH "SEE ALSO"
-isamchk (1),
-isamlog (1),
-mysqlaccess (1),
-mysqladmin (1),
-mysqlbug (1),
-mysqld (1),
-mysqldump (1),
-mysqlshow (1),
-msql2mysql (1),
-perror (1),
-replace (1),
-mysqld_safe (1),
-which1 (1),
-zap (1),
+isamchk(1),
+isamlog(1),
+mysql(1),
+mysqlaccess(1),
+mysqladmin(1),
+mysqld(1),
+mysqld_multi(1),
+mysqldump(1),
+mysql_fix_privilege_tables(1),
+mysqlshow(1),
+mysql_zap(1),
+perror(1),
+replace(1)
+.P
+For more information please refer to the MySQL reference
+manual, which may already be installed locally and which
+is also available online at http://www.mysql.com/doc/en/
+.SH BUGS
+Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR
-Ver 1.0, distribution 3.23.29a
+Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
Michael (Monty) Widenius (monty@mysql.com),
MySQL AB (http://www.mysql.com).
This software comes with no warranty.
diff --git a/man/mysqldump.1 b/man/mysqldump.1.in
index 6907fcc8777..34d83dbe0b3 100644
--- a/man/mysqldump.1
+++ b/man/mysqldump.1.in
@@ -1,4 +1,4 @@
-.TH mysqldump 1 "19 December 2000" "MySQL 4.0" "MySQL database"
+.TH mysqldump 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME
mysqldump \- text-based client for dumping or backing up mysql databases , tables and or data.
@@ -247,24 +247,29 @@ If all the databases are wanted, one can use:
mysqldump \fP\fI\-\-all\-databases\fP > all_databases.sql
.SH "SEE ALSO"
-isamchk (1),
-isamlog (1),
-mysqlaccess (1),
-mysqladmin (1),
-mysqlbug (1),
-mysqld (1),
-mysqldump (1),
-mysqlshow (1),
-msql2mysql (1),
-perror (1),
-replace (1),
-mysqld_safe (1),
-which1 (1),
-zap (1),
+isamchk(1),
+isamlog(1),
+mysql(1),
+mysqlaccess(1),
+mysqladmin(1),
+mysqld(1),
+mysqld_multi(1),
+mysqld_safe(1),
+mysql_fix_privilege_tables(1),
+mysqlshow(1),
+mysql_zap(1),
+perror(1),
+replace(1)
+.P
+For more information please refer to the MySQL reference
+manual, which may already be installed locally and which
+is also available online at http://www.mysql.com/doc/en/
+.SH BUGS
+Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR
-Ver 1.0, distribution 3.23.29a
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
+Michael (Monty) Widenius (monty@mysql.com),
+MySQL AB (http://www.mysql.com/).
This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen
(kill-9@kill-9.dk), Mercurmedia Data Model Architect /
diff --git a/man/mysqlshow.1 b/man/mysqlshow.1.in
index 39590b54375..903d9620fd6 100644
--- a/man/mysqlshow.1
+++ b/man/mysqlshow.1.in
@@ -1,4 +1,4 @@
-.TH mysqlshow 1 "19 December 2000" "MySQL 4.0" "MySQL database"
+.TH mysqlshow 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME
.BR mysqlshow
\- Shows the structure of a mysql database (databases,tables and columns)
@@ -67,24 +67,29 @@ If no column is given then all matching columns and columntypes in table
are shown
.SH "SEE ALSO"
-isamchk (1),
-isamlog (1),
-mysqlaccess (1),
-mysqladmin (1),
-mysqlbug (1),
-mysqld (1),
-mysqldump (1),
-mysqlshow (1),
-msql2mysql (1),
-perror (1),
-replace (1),
-mysqld_safe (1),
-which1 (1),
-zap (1),
+isamchk(1),
+isamlog(1),
+mysql(1),
+mysqlaccess(1),
+mysqladmin(1),
+mysqld(1),
+mysqld_multi(1),
+mysqld_safe(1),
+mysqldump(1),
+mysql_fix_privilege_tables(1),
+mysql_zap(1),
+perror(1),
+replace(1)
+.P
+For more information please refer to the MySQL reference
+manual, which may already be installed locally and which
+is also available online at http://www.mysql.com/doc/en/
+.SH BUGS
+Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR
-Ver 1.0, distribution 3.23.29a
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
+Michael (Monty) Widenius (monty@mysql.com),
+MySQL AB (http://www.mysql.com/).
This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen
(kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
diff --git a/man/perror.1 b/man/perror.1.in
index b8eec8af318..f9efb48510b 100644
--- a/man/perror.1
+++ b/man/perror.1.in
@@ -1,4 +1,4 @@
-.TH perror 1 "19 December 2000" "MySQL 4.0" "MySQL database"
+.TH perror 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME
perror \- describes a system or MySQL error code.
.SH SYNOPSIS
@@ -27,24 +27,29 @@ shell> perror 64 79
Error code 64: Machine is not on the network
Error code 79: Can not access a needed shared library
.SH "SEE ALSO"
-isamchk (1),
-isamlog (1),
-mysqlaccess (1),
-mysqladmin (1),
-mysqlbug (1),
-mysqld (1),
-mysqldump (1),
-mysqlshow (1),
-msql2mysql (1),
-perror (1),
-replace (1),
-mysqld_safe (1),
-which1 (1),
-zap (1),
+isamchk(1),
+isamlog(1),
+mysql(1),
+mysqlaccess(1),
+mysqladmin(1),
+mysqld(1),
+mysqld_multi(1),
+mysqld_safe(1),
+mysqldump(1),
+mysql_fix_privilege_tables(1),
+mysqlshow(1),
+mysql_zap(1),
+replace(1)
+.P
+For more information please refer to the MySQL reference
+manual, which may already be installed locally and which
+is also available online at http://www.mysql.com/doc/en/
+.SH BUGS
+Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR
-Ver 1.0, distribution 3.23.29a
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
+Michael (Monty) Widenius (monty@mysql.com),
+MySQL AB (http://www.mysql.com/).
This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen
(kill-9@kill\-9.dk), Mercurmedia Data Model Architect /
diff --git a/man/replace.1 b/man/replace.1.in
index 46d542d57f4..395411f7e9f 100644
--- a/man/replace.1
+++ b/man/replace.1.in
@@ -1,4 +1,4 @@
-.TH replace 1 "19 December 2000" "MySQL 4.0" "MySQL database"
+.TH replace 1 "19 December 2000" "MySQL @MYSQL_BASE_VERSION@" "MySQL database"
.SH NAME
.TP
replace - A utility program that is used by msql2mysql, but that has more general applicability as well. replace changes strings in place in files or on the standard input. Uses a finite state machine to match longer strings first. Can be used to swap strings.
@@ -41,24 +41,29 @@ this command swaps a and b in the given files:
.TP
shell> replace a b b a -- file1 file2 ...
.SH "SEE ALSO"
-isamchk (1),
-isamlog (1),
-mysqlaccess (1),
-mysqladmin (1),
-mysqlbug (1),
-mysqld (1),
-mysqldump (1),
-mysqlshow (1),
-msql2mysql (1),
-perror (1),
-replace (1),
-mysqld_safe (1),
-which1 (1),
-zap (1),
+isamchk(1),
+isamlog(1),
+mysql(1),
+mysqlaccess(1),
+mysqladmin(1),
+mysqld(1),
+mysqld_multi(1),
+mysqld_safe(1),
+mysqldump(1),
+mysql_fix_privilege_tables(1),
+mysqlshow(1),
+mysql_zap(1),
+perror(1),
+.P
+For more information please refer to the MySQL reference
+manual, which may already be installed locally and which
+is also available online at http://www.mysql.com/doc/en/
+.SH BUGS
+Please refer to http://bugs.mysql.com/ to report bugs.
.SH AUTHOR
-Ver 1.0, distribution 3.23.29a
-Michael (Monty) Widenius (monty@tcx.se),
-TCX Datakonsult AB (http://www.tcx.se).
+Ver 1.0, distribution @MYSQL_NO_DASH_VERSION@
+Michael (Monty) Widenius (monty@mysql.com),
+MySQL AB (http://www.mysql.com/).
This software comes with no warranty.
Manual page by L. (Kill-9) Pedersen
(kill-9@kill-9.dk), Mercurmedia Data Model Architect /
diff --git a/myisam/Makefile.am b/myisam/Makefile.am
index fdcfc6d0d41..5aa0740261e 100644
--- a/myisam/Makefile.am
+++ b/myisam/Makefile.am
@@ -21,18 +21,18 @@ INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include
LDADD = @CLIENT_EXTRA_LDFLAGS@ libmyisam.a ../mysys/libmysys.a \
../dbug/libdbug.a ../strings/libmystrings.a
pkglib_LIBRARIES = libmyisam.a
-bin_PROGRAMS = myisamchk myisamlog myisampack
+bin_PROGRAMS = myisamchk myisamlog myisampack myisam_ftdump
myisamchk_DEPENDENCIES= $(LIBRARIES)
myisamlog_DEPENDENCIES= $(LIBRARIES)
myisampack_DEPENDENCIES=$(LIBRARIES)
-noinst_PROGRAMS = mi_test1 mi_test2 mi_test3 rt_test sp_test ft_dump #ft_test1 ft_eval
+noinst_PROGRAMS = mi_test1 mi_test2 mi_test3 rt_test sp_test #ft_test1 ft_eval
noinst_HEADERS = myisamdef.h rt_index.h rt_key.h rt_mbr.h sp_defs.h fulltext.h ftdefs.h ft_test1.h ft_eval.h
mi_test1_DEPENDENCIES= $(LIBRARIES)
mi_test2_DEPENDENCIES= $(LIBRARIES)
mi_test3_DEPENDENCIES= $(LIBRARIES)
#ft_test1_DEPENDENCIES= $(LIBRARIES)
#ft_eval_DEPENDENCIES= $(LIBRARIES)
-ft_dump_DEPENDENCIES= $(LIBRARIES)
+myisam_ftdump_DEPENDENCIES= $(LIBRARIES)
rt_test_DEPENDENCIES= $(LIBRARIES)
sp_test_DEPENDENCIES= $(LIBRARIES)
libmyisam_a_SOURCES = mi_open.c mi_extra.c mi_info.c mi_rkey.c \
diff --git a/myisam/ft_boolean_search.c b/myisam/ft_boolean_search.c
index 8cbb7a71a43..1d4bfee86a4 100644
--- a/myisam/ft_boolean_search.c
+++ b/myisam/ft_boolean_search.c
@@ -54,19 +54,20 @@ static double _nwghts[11]=
static double *nwghts=_nwghts+5; /* nwghts[i] = -0.5*1.5**i */
#define FTB_FLAG_TRUNC 1 /* MUST be 1 */
-#define FTB_FLAG_YES 2 /* These two - YES and NO */
-#define FTB_FLAG_NO 4 /* should NEVER be set both */
+#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 */
typedef struct st_ftb_expr FTB_EXPR;
struct st_ftb_expr
{
FTB_EXPR *up;
- my_off_t docid[2];
+ uint flags;
/* ^^^^^^^^^^^^^^^^^^ FTB_{EXPR,WORD} common section */
+ my_off_t docid[2];
float weight;
float cur_weight;
byte *quot, *qend;
- uint flags;
uint yesses; /* number of "yes" words matched */
uint nos; /* number of "no" words matched */
uint ythresh; /* number of "yes" words in expr */
@@ -76,13 +77,13 @@ struct st_ftb_expr
typedef struct st_ftb_word
{
FTB_EXPR *up;
- MI_KEYDEF *keyinfo;
- my_off_t docid[2]; /* for index search and for scan */
+ uint flags;
/* ^^^^^^^^^^^^^^^^^^ FTB_{EXPR,WORD} common section */
+ my_off_t docid[2]; /* for index search and for scan */
my_off_t key_root;
+ MI_KEYDEF *keyinfo;
float weight;
uint ndepth;
- uint flags;
uint len;
uchar off;
byte word[1];
@@ -123,7 +124,7 @@ static int FTB_WORD_cmp_list(CHARSET_INFO *cs, FTB_WORD **a, FTB_WORD **b)
{
/* ORDER BY word DESC, ndepth DESC */
int i= mi_compare_text(cs, (uchar*) (*b)->word+1,(*b)->len-1,
- (uchar*) (*a)->word+1,(*a)->len-1,0);
+ (uchar*) (*a)->word+1,(*a)->len-1,0,0);
if (!i)
i=CMP_NUM((*b)->ndepth,(*a)->ndepth);
return i;
@@ -193,7 +194,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
}
static int _ftb_no_dupes_cmp(void* not_used __attribute__((unused)),
- const void *a,const void *b)
+ const void *a,const void *b)
{
return CMP_NUM((*((my_off_t*)a)), (*((my_off_t*)b)));
}
@@ -227,7 +228,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
ftbw->len - (ftbw->flags & FTB_FLAG_TRUNC),
(uchar*) ftbw->word + (ftbw->flags & FTB_FLAG_TRUNC),
ftbw->len - (ftbw->flags & FTB_FLAG_TRUNC),
- 0);
+ 0,0);
}
if (r) /* not found */
@@ -238,9 +239,9 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
if ((ftbw->flags & FTB_FLAG_YES) && ftbw->up->up==0)
{
/*
- This word MUST BE present in every document returned,
- so we can stop the search right now
- */
+ This word MUST BE present in every document returned,
+ so we can stop the search right now
+ */
ftb->state=INDEX_DONE;
return 1; /* search is done */
}
@@ -250,7 +251,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
/* going up to the first-level tree to continue search there */
_mi_dpointer(info, (uchar*) (ftbw->word+ftbw->off+HA_FT_WLEN),
- ftbw->key_root);
+ ftbw->key_root);
ftbw->key_root=info->s->state.key_root[ftb->keynr];
ftbw->keyinfo=info->s->keyinfo+ftb->keynr;
ftbw->off=0;
@@ -297,7 +298,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
if (ftbw->flags & FTB_FLAG_TRUNC)
{
/*
- special treatment for truncation operator
+ special treatment for truncation operator
1. there are some (besides this) +words
| no need to search in the index, it can never ADD new rows
| to the result, and to remove half-matched rows we do scan anyway
@@ -348,7 +349,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
- uint query_len)
+ uint query_len)
{
FTB *ftb;
FTB_EXPR *ftbe;
@@ -419,7 +420,7 @@ static int _ftb_strstr(const byte *s0, const byte *e0,
while (p0 < e0)
{
while (p0 < e0 && cs->to_upper[(uint) (uchar) *p0++] !=
- cs->to_upper[(uint) (uchar) *s1])
+ cs->to_upper[(uint) (uchar) *s1])
/* no-op */;
if (p0 >= e0)
return 0;
@@ -429,7 +430,7 @@ static int _ftb_strstr(const byte *s0, const byte *e0,
p1=s1+1;
while (p0 < e0 && p1 < e1 && cs->to_upper[(uint) (uchar) *p0] ==
- cs->to_upper[(uint) (uchar) *p1])
+ cs->to_upper[(uint) (uchar) *p1])
p0++, p1++;
if (p1 == e1 && (!e_before || p0 == e0 || !true_word_char(cs, p0[0])))
return 1;
@@ -487,12 +488,12 @@ static void _ftb_climb_the_tree(FTB *ftb, FTB_WORD *ftbw, FT_SEG_ITERATOR *ftsi_
if (yn & FTB_FLAG_NO)
{
/*
- NOTE: special sort function of queue assures that all
- (yn & FTB_FLAG_NO) != 0
- events for every particular subexpression will
- "auto-magically" happen BEFORE all the
- (yn & FTB_FLAG_YES) != 0 events. So no
- already matched expression can become not-matched again.
+ NOTE: special sort function of queue assures that all
+ (yn & FTB_FLAG_NO) != 0
+ events for every particular subexpression will
+ "auto-magically" happen BEFORE all the
+ (yn & FTB_FLAG_YES) != 0 events. So no
+ already matched expression can become not-matched again.
*/
++ftbe->nos;
break;
@@ -500,11 +501,12 @@ static void _ftb_climb_the_tree(FTB *ftb, FTB_WORD *ftbw, FT_SEG_ITERATOR *ftsi_
else
{
if (ftbe->ythresh)
- weight/=3;
+ weight/=3;
ftbe->cur_weight += weight;
if ((int) ftbe->yesses < ythresh)
break;
- yn= ((int) ftbe->yesses++ == ythresh) ? ftbe->flags : 0 ;
+ if (!(yn & FTB_FLAG_WONLY))
+ yn= ((int) ftbe->yesses++ == ythresh) ? ftbe->flags : FTB_FLAG_WONLY ;
weight*= ftbe->weight;
}
}
@@ -535,8 +537,8 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
ftb->queue.first_cmp_arg=(void *)&curdoc;
while (ftb->state == INDEX_SEARCH &&
- (curdoc=((FTB_WORD *)queue_top(& ftb->queue))->docid[0]) !=
- HA_POS_ERROR)
+ (curdoc=((FTB_WORD *)queue_top(& ftb->queue))->docid[0]) !=
+ HA_POS_ERROR)
{
while (curdoc == (ftbw=(FTB_WORD *)queue_top(& ftb->queue))->docid[0])
{
@@ -554,7 +556,7 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
/* curdoc matched ! */
if (is_tree_inited(&ftb->no_dupes) &&
tree_insert(&ftb->no_dupes, &curdoc, 0,
- ftb->no_dupes.custom_arg)->count >1)
+ ftb->no_dupes.custom_arg)->count >1)
/* but it managed already to get past this line once */
continue;
@@ -631,7 +633,7 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length)
ftbw=ftb->list[c];
if (mi_compare_text(ftb->charset, (uchar*) word.pos, word.len,
(uchar*) ftbw->word+1, ftbw->len-1,
- (my_bool) (ftbw->flags&FTB_FLAG_TRUNC)) >0)
+ (my_bool) (ftbw->flags&FTB_FLAG_TRUNC),0) >0)
b=c;
else
a=c;
@@ -641,7 +643,7 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length)
ftbw=ftb->list[c];
if (mi_compare_text(ftb->charset, (uchar*) word.pos, word.len,
(uchar*) ftbw->word+1,ftbw->len-1,
- (my_bool) (ftbw->flags&FTB_FLAG_TRUNC)))
+ (my_bool) (ftbw->flags&FTB_FLAG_TRUNC),0))
break;
if (ftbw->docid[1] == docid)
continue;
diff --git a/myisam/ft_nlq_search.c b/myisam/ft_nlq_search.c
index 1e3d47577d2..03875abe7b0 100644
--- a/myisam/ft_nlq_search.c
+++ b/myisam/ft_nlq_search.c
@@ -64,8 +64,8 @@ static int FT_SUPERDOC_cmp(void* cmp_arg __attribute__((unused)),
static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
{
- int subkeys;
- uint keylen, r, doc_cnt;
+ int subkeys, r;
+ uint keylen, doc_cnt;
FT_SUPERDOC sdoc, *sptr;
TREE_ELEMENT *selem;
double gweight=1;
@@ -73,7 +73,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
uchar *keybuff=aio->keybuff;
MI_KEYDEF *keyinfo=info->s->keyinfo+aio->keynr;
my_off_t key_root=info->s->state.key_root[aio->keynr];
- uint extra=HA_FT_WLEN+info->s->base.rec_reflength+1;
+ uint extra=HA_FT_WLEN+info->s->base.rec_reflength;
#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT
float tmp_weight;
#else
@@ -96,10 +96,10 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
if (keylen &&
mi_compare_text(aio->charset,info->lastkey+1,
- info->lastkey_length-extra, keybuff+1,keylen-1,0))
+ info->lastkey_length-extra-1, keybuff+1,keylen-1,0,0))
break;
- subkeys=ft_sintXkorr(info->lastkey+keylen);
+ subkeys=ft_sintXkorr(info->lastkey+info->lastkey_length-extra);
if (subkeys<0)
{
if (doc_cnt)
@@ -174,7 +174,7 @@ static int walk_and_push(FT_SUPERDOC *from,
{
DBUG_ENTER("walk_and_copy");
from->doc.weight+=from->tmp_weight*from->word_ptr->weight;
- set_if_smaller(best->elements, ft_query_expansion_limit-1)
+ set_if_smaller(best->elements, ft_query_expansion_limit-1);
queue_insert(best, (byte *)& from->doc);
DBUG_RETURN(0);
}
diff --git a/myisam/ft_parser.c b/myisam/ft_parser.c
index 0318bcbed10..b0fe180d0fb 100644
--- a/myisam/ft_parser.c
+++ b/myisam/ft_parser.c
@@ -27,7 +27,7 @@ typedef struct st_ft_docstat {
static int FT_WORD_cmp(CHARSET_INFO* cs, FT_WORD *w1, FT_WORD *w2)
{
return mi_compare_text(cs, (uchar*) w1->pos, w1->len,
- (uchar*) w2->pos, w2->len, 0);
+ (uchar*) w2->pos, w2->len, 0, 0);
}
static int walk_and_copy(FT_WORD *word,uint32 count,FT_DOCSTAT *docstat)
@@ -73,6 +73,26 @@ FT_WORD * ft_linearize(TREE *wtree)
DBUG_RETURN(wlist);
}
+my_bool ft_boolean_check_syntax_string(const byte *str)
+{
+ uint i, j;
+
+ if (!str ||
+ (strlen(str)+1 != sizeof(ft_boolean_syntax)) ||
+ (str[0] != ' ' && str[1] != ' '))
+ return 1;
+ for (i=0; i<sizeof(ft_boolean_syntax); i++)
+ {
+ /* limiting to 7-bit ascii only */
+ if ((unsigned char)(str[i]) > 127 || my_isalnum(default_charset_info, str[i]))
+ return 1;
+ for (j=0; j<i; j++)
+ if (str[i] == str[j] && (i != 11 || j != 10))
+ return 1;
+ }
+ return 0;
+}
+
/* returns:
* 0 - eof
* 1 - word found
@@ -93,27 +113,30 @@ byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end,
for (;doc<end;doc++)
{
if (true_word_char(cs,*doc)) break;
- if (*doc == FTB_RQUOT && param->quot) {
+ if (*doc == FTB_RQUOT && param->quot)
+ {
param->quot=doc;
*start=doc+1;
return 3; /* FTB_RBR */
}
- if ((*doc == FTB_LBR || *doc == FTB_RBR || *doc == FTB_LQUOT)
- && !param->quot)
+ if (!param->quot)
{
- /* param->prev=' '; */
- *start=doc+1;
- if (*doc == FTB_LQUOT) param->quot=*start;
- return (*doc == FTB_RBR)+2;
- }
- if (param->prev == ' ' && !param->quot)
- {
- if (*doc == FTB_YES ) { param->yesno=+1; continue; } else
- if (*doc == FTB_EGAL) { param->yesno= 0; continue; } else
- if (*doc == FTB_NO ) { param->yesno=-1; continue; } else
- if (*doc == FTB_INC ) { param->plusminus++; continue; } else
- if (*doc == FTB_DEC ) { param->plusminus--; continue; } else
- if (*doc == FTB_NEG ) { param->pmsign=!param->pmsign; continue; }
+ if (*doc == FTB_LBR || *doc == FTB_RBR || *doc == FTB_LQUOT)
+ {
+ /* param->prev=' '; */
+ *start=doc+1;
+ if (*doc == FTB_LQUOT) param->quot=*start;
+ return (*doc == FTB_RBR)+2;
+ }
+ if (param->prev == ' ')
+ {
+ if (*doc == FTB_YES ) { param->yesno=+1; continue; } else
+ if (*doc == FTB_EGAL) { param->yesno= 0; continue; } else
+ if (*doc == FTB_NO ) { param->yesno=-1; continue; } else
+ if (*doc == FTB_INC ) { param->plusminus++; continue; } else
+ if (*doc == FTB_DEC ) { param->plusminus--; continue; } else
+ if (*doc == FTB_NEG ) { param->pmsign=!param->pmsign; continue; }
+ }
}
param->prev=*doc;
param->yesno=(FTB_YES==' ') ? 1 : (param->quot != 0);
@@ -139,6 +162,11 @@ byte ft_get_word(CHARSET_INFO *cs, byte **start, byte *end,
return 1;
}
}
+ if (param->quot)
+ {
+ param->quot=*start=doc;
+ return 3; /* FTB_RBR */
+ }
return 0;
}
diff --git a/myisam/ft_static.c b/myisam/ft_static.c
index 0dcea5bec0c..7168406d027 100644
--- a/myisam/ft_static.c
+++ b/myisam/ft_static.c
@@ -21,7 +21,7 @@
ulong ft_min_word_len=4;
ulong ft_max_word_len=HA_FT_MAXCHARLEN;
ulong ft_query_expansion_limit=5;
-const char *ft_boolean_syntax="+ -><()~*:\"\"&|";
+char ft_boolean_syntax[]="+ -><()~*:\"\"&|";
const HA_KEYSEG ft_keysegs[FT_SEGS]={
{
diff --git a/myisam/ft_stopwords.c b/myisam/ft_stopwords.c
index 6682de18c65..112af87d201 100644
--- a/myisam/ft_stopwords.c
+++ b/myisam/ft_stopwords.c
@@ -32,7 +32,7 @@ static int FT_STOPWORD_cmp(void* cmp_arg __attribute__((unused)),
{
return mi_compare_text(default_charset_info,
(uchar *)w1->pos,w1->len,
- (uchar *)w2->pos,w2->len,0);
+ (uchar *)w2->pos,w2->len,0,0);
}
static void FT_STOPWORD_free(FT_STOPWORD *w, TREE_FREE action,
diff --git a/myisam/ft_update.c b/myisam/ft_update.c
index 4015abbbeba..beccc062270 100644
--- a/myisam/ft_update.c
+++ b/myisam/ft_update.c
@@ -179,7 +179,7 @@ int _mi_ft_cmp(MI_INFO *info, uint keynr, const byte *rec1, const byte *rec2)
if ((ftsi1.pos != ftsi2.pos) &&
(!ftsi1.pos || !ftsi2.pos ||
mi_compare_text(cs, (uchar*) ftsi1.pos,ftsi1.len,
- (uchar*) ftsi2.pos,ftsi2.len,0)))
+ (uchar*) ftsi2.pos,ftsi2.len,0,0)))
DBUG_RETURN(THOSE_TWO_DAMN_KEYS_ARE_REALLY_DIFFERENT);
}
DBUG_RETURN(GEE_THEY_ARE_ABSOLUTELY_IDENTICAL);
@@ -207,7 +207,7 @@ int _mi_ft_update(MI_INFO *info, uint keynr, byte *keybuf,
while(old_word->pos && new_word->pos)
{
cmp= mi_compare_text(cs, (uchar*) old_word->pos,old_word->len,
- (uchar*) new_word->pos,new_word->len,0);
+ (uchar*) new_word->pos,new_word->len,0,0);
cmp2= cmp ? 0 : (fabs(old_word->weight - new_word->weight) > 1.e-5);
if (cmp < 0 || cmp2)
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index 762eef15d68..2d89efa61f6 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -98,7 +98,9 @@ int chk_status(MI_CHECK *param, register MI_INFO *info)
/* Don't count this as a real warning, as check can correct this ! */
uint save=param->warning_printed;
mi_check_print_warning(param,
- "%d clients is using or hasn't closed the table properly",
+ share->state.open_count==1 ?
+ "%d client is using or hasn't closed the table properly" :
+ "%d clients are using or haven't closed the table properly",
share->state.open_count);
/* If this will be fixed by the check, forget the warning */
if (param->testflag & T_UPDATE_STATE)
@@ -409,7 +411,7 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
if (chk_index(param,info,keyinfo,share->state.key_root[key],info->buff,
&keys, param->key_crc+key,1))
DBUG_RETURN(-1);
- if(!(keyinfo->flag & HA_FULLTEXT))
+ if(!(keyinfo->flag & (HA_FULLTEXT | HA_SPATIAL)))
{
if (keys != info->state->records)
{
@@ -558,6 +560,10 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
DBUG_ENTER("chk_index");
DBUG_DUMP("buff",(byte*) buff,mi_getint(buff));
+ /* TODO: implement appropriate check for RTree keys */
+ if (keyinfo->flag & HA_SPATIAL)
+ DBUG_RETURN(0);
+
if (!(temp_buff=(uchar*) my_alloca((uint) keyinfo->block_length)))
{
mi_check_print_error(param,"Not enough memory for keyblock");
@@ -947,7 +953,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
info->checksum=mi_checksum(info,record);
if (param->testflag & (T_EXTEND | T_MEDIUM | T_VERBOSE))
{
- if (_mi_rec_check(info,record, info->rec_buff))
+ if (_mi_rec_check(info,record, info->rec_buff,block_info.rec_len))
{
mi_check_print_error(param,"Found wrong packed record at %s",
llstr(start_recpos,llbuff));
@@ -1073,7 +1079,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
for (key=0 ; key < info->s->base.keys; key++)
{
if (key_checksum[key] != param->key_crc[key] &&
- !(info->s->keyinfo[key].flag & HA_FULLTEXT))
+ !(info->s->keyinfo[key].flag & (HA_FULLTEXT | HA_SPATIAL)))
{
mi_check_print_error(param,"Checksum for key: %2d doesn't match checksum for records",
key+1);
@@ -1268,11 +1274,12 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
I think mi_repair and mi_repair_by_sort should do the same
(according, e.g. to ha_myisam::repair), but as mi_repair doesn't
touch key_map it cannot be used to T_CREATE_MISSING_KEYS.
- That is what the next line is for... (serg)
+ That is what the next line is for
*/
- share->state.key_map= ((((ulonglong) 1L << share->base.keys)-1) &
- param->keys_in_use);
+ if (param->testflag & T_CREATE_MISSING_KEYS)
+ share->state.key_map= ((((ulonglong) 1L << share->base.keys)-1) &
+ param->keys_in_use);
info->state->key_file_length=share->base.keystart;
@@ -2389,6 +2396,11 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
sort_param[i].record= (((char *)(sort_param+share->base.keys))+
(share->base.pack_reclength * i));
+ if (!mi_alloc_rec_buff(info, -1, &sort_param[i].rec_buff))
+ {
+ mi_check_print_error(param,"Not enough memory!");
+ goto err;
+ }
sort_param[i].key_length=share->rec_reflength;
for (keyseg=sort_param[i].seg; keyseg->type != HA_KEYTYPE_END;
@@ -2966,7 +2978,8 @@ static int sort_get_next_record(MI_SORT_PARAM *sort_param)
info->checksum=mi_checksum(info,sort_param->record);
if ((param->testflag & (T_EXTEND | T_REP)) || searching)
{
- if (_mi_rec_check(info, sort_param->record, sort_param->rec_buff))
+ if (_mi_rec_check(info, sort_param->record, sort_param->rec_buff,
+ sort_param->find_length))
{
mi_check_print_info(param,"Found wrong packed record at %s",
llstr(sort_param->start_recpos,llbuff));
@@ -3301,7 +3314,7 @@ static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a)
if (val_off == a_len &&
mi_compare_text(sort_param->seg->charset,
((uchar *)a)+1,a_len-1,
- ft_buf->lastkey+1,val_off-1, 0)==0)
+ ft_buf->lastkey+1,val_off-1, 0, 0)==0)
{
if (!ft_buf->buf) /* store in second-level tree */
{
@@ -3823,7 +3836,7 @@ int update_state_info(MI_CHECK *param, MI_INFO *info,uint update)
return 0;
}
err:
- mi_check_print_error(param,"%d when updateing keyfile",my_errno);
+ mi_check_print_error(param,"%d when updating keyfile",my_errno);
return 1;
}
@@ -3953,18 +3966,18 @@ static my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows)
void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows)
{
MYISAM_SHARE *share=info->s;
- uint i;
- if (!info->state->records) /* Don't do this if old rows */
+ MI_KEYDEF *key=share->keyinfo;
+ uint i;
+
+ DBUG_ASSERT(info->state->records == 0 &&
+ (!rows || rows >= MI_MIN_ROWS_TO_DISABLE_INDEXES));
+ for (i=0 ; i < share->base.keys ; i++,key++)
{
- MI_KEYDEF *key=share->keyinfo;
- for (i=0 ; i < share->base.keys ; i++,key++)
+ if (!(key->flag & (HA_NOSAME | HA_SPATIAL | HA_AUTO_KEY)) &&
+ ! mi_too_big_key_for_sort(key,rows) && info->s->base.auto_key != i+1)
{
- if (!(key->flag & (HA_NOSAME | HA_SPATIAL | HA_AUTO_KEY)) &&
- ! mi_too_big_key_for_sort(key,rows) && info->s->base.auto_key != i+1)
- {
- share->state.key_map&= ~ ((ulonglong) 1 << i);
- info->update|= HA_STATE_CHANGED;
- }
+ share->state.key_map&= ~ ((ulonglong) 1 << i);
+ info->update|= HA_STATE_CHANGED;
}
}
}
diff --git a/myisam/mi_create.c b/myisam/mi_create.c
index 72633966b54..5682862c39a 100644
--- a/myisam/mi_create.c
+++ b/myisam/mi_create.c
@@ -383,7 +383,13 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
my_errno=HA_WRONG_CREATE_OPTION;
goto err;
}
- if ((keydef->flag & (HA_NOSAME | HA_NULL_PART_KEY)) == HA_NOSAME)
+ /*
+ key_segs may be 0 in the case when we only want to be able to
+ add on row into the table. This can happen with some DISTINCT queries
+ in MySQL
+ */
+ if ((keydef->flag & (HA_NOSAME | HA_NULL_PART_KEY)) == HA_NOSAME &&
+ key_segs)
share.state.rec_per_key_part[key_segs-1]=1L;
length+=key_length;
keydef->block_length= MI_BLOCK_SIZE(length,pointer,MI_MAX_KEYPTR_SIZE);
diff --git a/myisam/mi_dynrec.c b/myisam/mi_dynrec.c
index 079779bd0ef..30a4762abe0 100644
--- a/myisam/mi_dynrec.c
+++ b/myisam/mi_dynrec.c
@@ -14,7 +14,15 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
- /* Functions to handle space-packed-records and blobs */
+/*
+ Functions to handle space-packed-records and blobs
+
+ A row may be stored in one or more linked blocks.
+ The block size is between MI_MIN_BLOCK_LENGTH and MI_MAX_BLOCK_LENGTH.
+ Each block is aligned on MI_DYN_ALIGN_SIZE.
+ The reson for the max block size is to not have too many different types
+ of blocks. For the differnet block types, look at _mi_get_block_info()
+*/
#include "myisamdef.h"
#include <assert.h>
@@ -148,7 +156,7 @@ static int write_dynamic_record(MI_INFO *info, const byte *record,
} while (reclength);
DBUG_RETURN(0);
- err:
+err:
DBUG_RETURN(1);
}
@@ -264,37 +272,62 @@ static bool unlink_deleted_block(MI_INFO *info, MI_BLOCK_INFO *block_info)
DBUG_RETURN(0);
}
- /* Delete datarecord from database */
- /* info->rec_cache.seek_not_done is updated in cmp_record */
-static int delete_dynamic_record(MI_INFO *info, my_off_t filepos,
- uint second_read)
+/*
+ Add a backward link to delete block
+
+ SYNOPSIS
+ update_backward_delete_link()
+ info MyISAM handler
+ delete_block Position to delete block to update.
+ If this is 'HA_OFFSET_ERROR', nothing will be done
+ filepos Position to block that 'delete_block' should point to
+
+ RETURN
+ 0 ok
+ 1 error. In this case my_error is set.
+*/
+
+static int update_backward_delete_link(MI_INFO *info, my_off_t delete_block,
+ my_off_t filepos)
{
- uint length,b_type;
- MI_BLOCK_INFO block_info,del_block;
- int error=0;
- my_bool remove_next_block;
- DBUG_ENTER("delete_dynamic_record");
+ MI_BLOCK_INFO block_info;
+ DBUG_ENTER("update_backward_delete_link");
- /* First add a link from the last block to the new one */
- if (info->s->state.dellink != HA_OFFSET_ERROR)
+ if (delete_block != HA_OFFSET_ERROR)
{
block_info.second_read=0;
- if (_mi_get_block_info(&block_info,info->dfile,info->s->state.dellink)
+ if (_mi_get_block_info(&block_info,info->dfile,delete_block)
& BLOCK_DELETED)
{
char buff[8];
mi_sizestore(buff,filepos);
- if (my_pwrite(info->dfile,buff,8,info->s->state.dellink+12,
- MYF(MY_NABP)))
- error=1; /* Error on write */
+ if (my_pwrite(info->dfile,buff, 8, delete_block+12, MYF(MY_NABP)))
+ DBUG_RETURN(1); /* Error on write */
}
else
{
- error=1; /* Wrong delete link */
my_errno=HA_ERR_WRONG_IN_RECORD;
+ DBUG_RETURN(1); /* Wrong delete link */
}
}
+ return 0;
+}
+
+ /* Delete datarecord from database */
+ /* info->rec_cache.seek_not_done is updated in cmp_record */
+
+static int delete_dynamic_record(MI_INFO *info, my_off_t filepos,
+ uint second_read)
+{
+ uint length,b_type;
+ MI_BLOCK_INFO block_info,del_block;
+ int error;
+ my_bool remove_next_block;
+ DBUG_ENTER("delete_dynamic_record");
+
+ /* First add a link from the last block to the new one */
+ error= update_backward_delete_link(info, info->s->state.dellink, filepos);
block_info.second_read=second_read;
do
@@ -518,21 +551,11 @@ int _mi_write_part_record(MI_INFO *info,
*reclength-=(length-head_length);
*flag=6;
- if (del_length && next_delete_block != HA_OFFSET_ERROR)
+ if (del_length)
{
/* link the next delete block to this */
- MI_BLOCK_INFO del_block;
- del_block.second_read=0;
- if (!(_mi_get_block_info(&del_block,info->dfile,next_delete_block)
- & BLOCK_DELETED))
- {
- my_errno=HA_ERR_WRONG_IN_RECORD;
- goto err;
- }
- mi_sizestore(del_block.header+12,info->s->state.dellink);
- if (my_pwrite(info->dfile,(char*) del_block.header+12,8,
- next_delete_block+12,
- MYF(MY_NABP)))
+ if (update_backward_delete_link(info, next_delete_block,
+ info->s->state.dellink))
goto err;
}
@@ -574,6 +597,8 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, byte *record,
{
uint tmp=MY_ALIGN(reclength - length + 3 +
test(reclength >= 65520L),MI_DYN_ALIGN_SIZE);
+ /* Don't create a block bigger than MI_MAX_BLOCK_LENGTH */
+ tmp= min(length+tmp, MI_MAX_BLOCK_LENGTH)-length;
/* Check if we can extend this block */
if (block_info.filepos + block_info.block_len ==
info->state->data_file_length &&
@@ -588,9 +613,15 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, byte *record,
info->update|= HA_STATE_WRITE_AT_END | HA_STATE_EXTEND_BLOCK;
length+=tmp;
}
- else
+ else if (length < MI_MAX_BLOCK_LENGTH - MI_MIN_BLOCK_LENGTH)
{
- /* Check if next block is a deleted block */
+ /*
+ Check if next block is a deleted block
+ Above we have MI_MIN_BLOCK_LENGTH to avoid the problem where
+ the next block is so small it can't be splited which could
+ casue problems
+ */
+
MI_BLOCK_INFO del_block;
del_block.second_read=0;
if (_mi_get_block_info(&del_block,info->dfile,
@@ -601,7 +632,35 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, byte *record,
DBUG_PRINT("info",("Extending current block"));
if (unlink_deleted_block(info,&del_block))
goto err;
- length+=del_block.block_len;
+ if ((length+=del_block.block_len) > MI_MAX_BLOCK_LENGTH)
+ {
+ /*
+ New block was too big, link overflow part back to
+ delete list
+ */
+ my_off_t next_pos;
+ ulong rest_length= length-MI_MAX_BLOCK_LENGTH;
+ set_if_bigger(rest_length, MI_MIN_BLOCK_LENGTH);
+ next_pos= del_block.filepos+ del_block.block_len - rest_length;
+
+ if (update_backward_delete_link(info, info->s->state.dellink,
+ next_pos))
+ DBUG_RETURN(1);
+
+ /* create delete link for data that didn't fit into the page */
+ del_block.header[0]=0;
+ mi_int3store(del_block.header+1, rest_length);
+ mi_sizestore(del_block.header+4,info->s->state.dellink);
+ bfill(del_block.header+12,8,255);
+ if (my_pwrite(info->dfile,(byte*) del_block.header,20, next_pos,
+ MYF(MY_NABP)))
+ DBUG_RETURN(1);
+ info->s->state.dellink= next_pos;
+ info->s->state.split++;
+ info->state->del++;
+ info->state->empty+= rest_length;
+ length-= rest_length;
+ }
}
}
}
@@ -615,7 +674,10 @@ static int update_dynamic_record(MI_INFO *info, my_off_t filepos, byte *record,
&record,&reclength,&flag))
goto err;
if ((filepos=block_info.next_filepos) == HA_OFFSET_ERROR)
+ {
+ /* Start writing data on deleted blocks */
filepos=info->s->state.dellink;
+ }
}
if (block_info.next_filepos != HA_OFFSET_ERROR)
@@ -744,7 +806,8 @@ uint _mi_rec_pack(MI_INFO *info, register byte *to, register const byte *from)
Returns 0 if record is ok.
*/
-my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff)
+my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff,
+ ulong packed_length)
{
uint length,new_length,flag,bit,i;
char *pos,*end,*packpos,*to;
@@ -836,8 +899,7 @@ my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff)
to+=length;
}
}
- if (info->packed_length != (uint) (to - rec_buff)
- + test(info->s->calc_checksum) ||
+ if (packed_length != (uint) (to - rec_buff) + test(info->s->calc_checksum) ||
(bit != 1 && (flag & ~(bit - 1))))
goto err;
if (info->s->calc_checksum)
@@ -850,7 +912,7 @@ my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *rec_buff)
}
DBUG_RETURN(0);
- err:
+err:
DBUG_RETURN(1);
}
@@ -966,8 +1028,8 @@ ulong _mi_rec_unpack(register MI_INFO *info, register byte *to, byte *from,
if (info->s->calc_checksum)
from++;
if (to == to_end && from == from_end && (bit == 1 || !(flag & ~(bit-1))))
- DBUG_RETURN((info->packed_length=found_length));
- err:
+ DBUG_RETURN(found_length);
+err:
my_errno=HA_ERR_RECORD_DELETED;
DBUG_PRINT("error",("to_end: %lx -> %lx from_end: %lx -> %lx",
to,to_end,from,from_end));
@@ -1210,7 +1272,7 @@ int _mi_cmp_dynamic_record(register MI_INFO *info, register const byte *record)
}
}
my_errno=0;
- err:
+err:
if (buffer != info->rec_buff)
my_afree((gptr) buffer);
DBUG_RETURN(my_errno);
diff --git a/myisam/mi_extra.c b/myisam/mi_extra.c
index ce072d7d57e..4b011ca424f 100644
--- a/myisam/mi_extra.c
+++ b/myisam/mi_extra.c
@@ -19,6 +19,9 @@
#include <sys/mman.h>
#endif
+static void mi_extra_keyflag(MI_INFO *info, enum ha_extra_function function);
+
+
/*
Set options and buffers to optimize table handling
@@ -355,6 +358,10 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
case HA_EXTRA_PRELOAD_BUFFER_SIZE:
info->preload_buff_size= *((ulong *) extra_arg);
break;
+ case HA_EXTRA_CHANGE_KEY_TO_UNIQUE:
+ case HA_EXTRA_CHANGE_KEY_TO_DUP:
+ mi_extra_keyflag(info, function);
+ break;
case HA_EXTRA_KEY_CACHE:
case HA_EXTRA_NO_KEY_CACHE:
default:
@@ -367,3 +374,27 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function, void *extra_arg)
}
DBUG_RETURN(error);
} /* mi_extra */
+
+
+/*
+ Start/Stop Inserting Duplicates Into a Table, WL#1648.
+ */
+static void mi_extra_keyflag(MI_INFO *info, enum ha_extra_function function)
+{
+ uint idx;
+
+ for (idx= 0; idx< info->s->base.keys; idx++)
+ {
+ switch (function) {
+ case HA_EXTRA_CHANGE_KEY_TO_UNIQUE:
+ info->s->keyinfo[idx].flag|= HA_NOSAME;
+ break;
+ case HA_EXTRA_CHANGE_KEY_TO_DUP:
+ info->s->keyinfo[idx].flag&= ~(HA_NOSAME);
+ break;
+ default:
+ break;
+ }
+ }
+}
+
diff --git a/myisam/mi_locking.c b/myisam/mi_locking.c
index 816748d459a..b13ebfb4cad 100644
--- a/myisam/mi_locking.c
+++ b/myisam/mi_locking.c
@@ -286,6 +286,21 @@ void mi_copy_status(void* to,void *from)
((MI_INFO*) to)->state= &((MI_INFO*) from)->save_state;
}
+
+/*
+ Check if should allow concurrent inserts
+
+ IMPLEMENTATION
+ Don't allow concurrent inserts if we have a hole in the table.
+
+ NOTES
+ Rtree indexes are disabled in mi_open()
+
+ RETURN
+ 0 ok to use concurrent inserts
+ 1 not ok
+*/
+
my_bool mi_check_status(void* param)
{
MI_INFO *info=(MI_INFO*) param;
diff --git a/myisam/mi_rnext.c b/myisam/mi_rnext.c
index e1cf916d6d9..6e6056f98d9 100644
--- a/myisam/mi_rnext.c
+++ b/myisam/mi_rnext.c
@@ -57,47 +57,45 @@ int mi_rnext(MI_INFO *info, byte *buf, int inx)
}
else
{
- switch(info->s->keyinfo[inx].key_alg)
- {
- case HA_KEY_ALG_RTREE:
+ switch (info->s->keyinfo[inx].key_alg) {
+ case HA_KEY_ALG_RTREE:
/*
- Note that rtree doesn't support that the table
- may be changed since last call, so we do need
- to skip rows inserted by other threads like in btree
+ Note that rtree doesn't support that the table
+ may be changed since last call, so we do need
+ to skip rows inserted by other threads like in btree
*/
- error=rtree_get_next(info,inx,info->lastkey_length);
- break;
+ error= rtree_get_next(info,inx,info->lastkey_length);
+ break;
- case HA_KEY_ALG_BTREE:
- default:
- if (!changed)
- {
- error=_mi_search_next(info,info->s->keyinfo+inx,info->lastkey,
- info->lastkey_length,flag,
- info->s->state.key_root[inx]);
- }
- else
- {
- error=_mi_search(info,info->s->keyinfo+inx,info->lastkey,
- USE_WHOLE_KEY,flag, info->s->state.key_root[inx]);
- }
- if (!error && info->s->concurrent_insert)
- {
- while (info->lastpos >= info->state->data_file_length)
- {
- /* Skip rows that are inserted by other threads since we got a lock */
- if ((error=_mi_search_next(info,info->s->keyinfo+inx,info->lastkey,
- info->lastkey_length,
- SEARCH_BIGGER,
- info->s->state.key_root[inx])))
- break;
- }
- }
+ case HA_KEY_ALG_BTREE:
+ default:
+ if (!changed)
+ error= _mi_search_next(info,info->s->keyinfo+inx,info->lastkey,
+ info->lastkey_length,flag,
+ info->s->state.key_root[inx]);
+ else
+ error= _mi_search(info,info->s->keyinfo+inx,info->lastkey,
+ USE_WHOLE_KEY,flag, info->s->state.key_root[inx]);
}
}
if (info->s->concurrent_insert)
+ {
+ if (!error)
+ {
+ while (info->lastpos >= info->state->data_file_length)
+ {
+ /* Skip rows inserted by other threads since we got a lock */
+ if ((error=_mi_search_next(info,info->s->keyinfo+inx,
+ info->lastkey,
+ info->lastkey_length,
+ SEARCH_BIGGER,
+ info->s->state.key_root[inx])))
+ break;
+ }
+ }
rw_unlock(&info->s->key_root_lock[inx]);
+ }
/* Don't clear if database-changed */
info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
info->update|= HA_STATE_NEXT_FOUND;
diff --git a/myisam/mi_rprev.c b/myisam/mi_rprev.c
index 4807e636252..b787210e037 100644
--- a/myisam/mi_rprev.c
+++ b/myisam/mi_rprev.c
@@ -52,21 +52,22 @@ int mi_rprev(MI_INFO *info, byte *buf, int inx)
error=_mi_search(info,share->keyinfo+inx,info->lastkey,
USE_WHOLE_KEY, flag, share->state.key_root[inx]);
- if (!error)
+ if (share->concurrent_insert)
{
- while (info->lastpos >= info->state->data_file_length)
+ if (!error)
{
- /* Skip rows that are inserted by other threads since we got a lock */
- if ((error=_mi_search_next(info,share->keyinfo+inx,info->lastkey,
- info->lastkey_length,
- SEARCH_SMALLER,
- share->state.key_root[inx])))
- break;
+ while (info->lastpos >= info->state->data_file_length)
+ {
+ /* Skip rows that are inserted by other threads since we got a lock */
+ if ((error=_mi_search_next(info,share->keyinfo+inx,info->lastkey,
+ info->lastkey_length,
+ SEARCH_SMALLER,
+ share->state.key_root[inx])))
+ break;
+ }
}
- }
-
- if (share->concurrent_insert)
rw_unlock(&share->key_root_lock[inx]);
+ }
info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
info->update|= HA_STATE_PREV_FOUND;
if (error)
diff --git a/myisam/mi_search.c b/myisam/mi_search.c
index 2871633102d..1c4342ff39a 100644
--- a/myisam/mi_search.c
+++ b/myisam/mi_search.c
@@ -18,6 +18,7 @@
#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,
@@ -273,7 +274,8 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
uchar *sort_order=keyinfo->seg->charset->sort_order;
uchar tt_buff[MI_MAX_KEY_BUFF+2], *t_buff=tt_buff+2;
uchar *saved_from, *saved_to, *saved_vseg;
- uint saved_length=0, saved_prefix_len=0;
+ uint saved_length=0, saved_prefix_len=0;
+ uint length_pack;
DBUG_ENTER("_mi_prefix_search");
LINT_INIT(length);
@@ -289,26 +291,24 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
page+=2+nod_flag;
*ret_pos=page;
kseg=key;
- {
- uint lenght_pack;
- get_key_pack_length(kseg_len,lenght_pack,kseg);
- key_len_skip=lenght_pack+kseg_len;
- key_len_left=(int) key_len- (int) key_len_skip;
- cmplen=(key_len_left>=0) ? kseg_len : key_len-lenght_pack;
- DBUG_PRINT("info",("key: '%.*s'",kseg_len,kseg));
- }
-/*
- Keys are compressed the following way:
+ get_key_pack_length(kseg_len,length_pack,kseg);
+ key_len_skip=length_pack+kseg_len;
+ key_len_left=(int) key_len- (int) key_len_skip;
+ cmplen=(key_len_left>=0) ? kseg_len : key_len-length_pack;
+ DBUG_PRINT("info",("key: '%.*s'",kseg_len,kseg));
- If the max length of first key segment <= 127 characters the prefix is
- 1 byte else it's 2 byte
+ /*
+ Keys are compressed the following way:
- prefix The high bit is set if this is a prefix for the prev key
- length Packed length if the previous was a prefix byte
- [length] Length character of data
- next-key-seg Next key segments
-*/
+ If the max length of first key segment <= 127 characters the prefix is
+ 1 byte else it's 2 byte
+
+ prefix The high bit is set if this is a prefix for the prev key
+ length Packed length if the previous was a prefix byte
+ [length] Length character of data
+ next-key-seg Next key segments
+ */
matched=0; /* how many char's from prefix were alredy matched */
len=0; /* length of previous key unpacked */
@@ -350,7 +350,8 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
saved_vseg=vseg;
saved_prefix_len=prefix_len;
- DBUG_PRINT("loop",("page: '%.*s%.*s'",prefix_len,t_buff+seg_len_pack,suffix_len,vseg));
+ DBUG_PRINT("loop",("page: '%.*s%.*s'",prefix_len,t_buff+seg_len_pack,
+ suffix_len,vseg));
{
uchar *from=vseg+suffix_len;
HA_KEYSEG *keyseg;
@@ -396,14 +397,15 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
matched=prefix_len+left;
- for(my_flag=0;left;left--)
+ for (my_flag=0;left;left--)
if ((my_flag= (int) sort_order[*vseg++] - (int) sort_order[*k++]))
break;
if (my_flag>0) /* mismatch */
break;
- else if (my_flag==0) /* match */
- { /*
+ if (my_flag==0) /* match */
+ {
+ /*
** len cmplen seg_left_len more_segs
** < matched=len; continue search
** > = prefix ? found : (matched=len; continue search)
@@ -414,30 +416,68 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
*/
if (len < cmplen)
{
- my_flag= -1;
+ if ((keyinfo->seg->type != HA_KEYTYPE_TEXT &&
+ keyinfo->seg->type != HA_KEYTYPE_VARTEXT))
+ my_flag= -1;
+ else
+ {
+ /* We have to compare k and vseg as if they where space extended */
+ uchar *end= k+ (cmplen - len);
+ for ( ; k < end && *k == ' '; k++) ;
+ if (k == end)
+ goto cmp_rest; /* should never happen */
+ if (*k < (uchar) ' ')
+ {
+ my_flag= 1; /* Compared string is smaller */
+ break;
+ }
+ my_flag= -1; /* Continue searching */
+ }
}
else if (len > cmplen)
{
- if ((my_flag= (!(nextflag & SEARCH_PREFIX) || key_len_left>0)))
- break;
- goto fix_flag;
- }
- else if (key_len_left>0)
- {
- uint not_used;
- if ((flag = ha_key_cmp(keyinfo->seg+1,vseg,
- k,key_len_left,nextflag,&not_used)) >= 0)
- break;
+ uchar *end;
+ if ((nextflag & SEARCH_PREFIX) && key_len_left == 0)
+ goto fix_flag;
+
+ /* We have to compare k and vseg as if they where space extended */
+ for (end=vseg + (len-cmplen) ;
+ vseg < end && *vseg == (uchar) ' ';
+ vseg++) ;
+ if (vseg == end)
+ goto cmp_rest; /* should never happen */
+
+ if (*vseg > (uchar) ' ')
+ {
+ my_flag= 1; /* Compared string is smaller */
+ break;
+ }
+ my_flag= -1; /* Continue searching */
}
else
- {
- /* at this line flag==-1 if the following lines were already
- visited and 0 otherwise, i.e. flag <=0 here always !!! */
- fix_flag:
- if (nextflag & (SEARCH_NO_FIND | SEARCH_LAST))
- flag=(nextflag & (SEARCH_BIGGER | SEARCH_LAST)) ? -1 : 1;
- if (flag>=0) break;
- }
+ {
+ cmp_rest:
+ if (key_len_left>0)
+ {
+ uint not_used;
+ if ((flag = ha_key_cmp(keyinfo->seg+1,vseg,
+ k,key_len_left,nextflag,&not_used)) >= 0)
+ break;
+ }
+ else
+ {
+ /*
+ at this line flag==-1 if the following lines were already
+ visited and 0 otherwise, i.e. flag <=0 here always !!!
+ */
+ fix_flag:
+ DBUG_ASSERT(flag <= 0);
+ if (nextflag & (SEARCH_NO_FIND | SEARCH_LAST))
+ flag=(nextflag & (SEARCH_BIGGER | SEARCH_LAST)) ? -1 : 1;
+ if (flag>=0)
+ break;
+ }
+ }
}
matched-=left;
}
@@ -1567,7 +1607,7 @@ _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key,
n_length-=tmp_length;
length-=tmp_length+next_length_pack; /* We gained these chars */
}
- if (n_length == 0)
+ if (n_length == 0 && ref_length == new_key_length)
{
s_temp->n_ref_length=pack_marker; /* Same as prev key */
}
diff --git a/myisam/mi_unique.c b/myisam/mi_unique.c
index f4ee39e55ca..38b4ed93311 100644
--- a/myisam/mi_unique.c
+++ b/myisam/mi_unique.c
@@ -180,7 +180,7 @@ int mi_unique_comp(MI_UNIQUEDEF *def, const byte *a, const byte *b,
if (type == HA_KEYTYPE_TEXT || type == HA_KEYTYPE_VARTEXT)
{
if (mi_compare_text(keyseg->charset, (uchar *) pos_a, length,
- (uchar *) pos_b, length, 0))
+ (uchar *) pos_b, length, 0, 0))
return 1;
}
else
diff --git a/myisam/mi_write.c b/myisam/mi_write.c
index 88e7f070642..c17f47fc1ae 100644
--- a/myisam/mi_write.c
+++ b/myisam/mi_write.c
@@ -500,7 +500,7 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo,
get_key_length(alen,a);
DBUG_ASSERT(info->ft1_to_ft2==0);
if (alen == blen &&
- mi_compare_text(keyinfo->seg->charset, a, alen, b, blen, 0)==0)
+ mi_compare_text(keyinfo->seg->charset, a, alen, b, blen, 0, 0)==0)
{
/* yup. converting */
info->ft1_to_ft2=(DYNAMIC_ARRAY *)
@@ -916,8 +916,8 @@ int mi_init_bulk_insert(MI_INFO *info, ulong cache_size, ha_rows rows)
DBUG_ENTER("_mi_init_bulk_insert");
DBUG_PRINT("enter",("cache_size: %lu", cache_size));
- if (info->bulk_insert || (rows && rows < MI_MIN_ROWS_TO_USE_BULK_INSERT))
- DBUG_RETURN(0);
+ DBUG_ASSERT(!info->bulk_insert &&
+ (!rows || rows >= MI_MIN_ROWS_TO_USE_BULK_INSERT));
for (i=total_keylength=num_keys=0 ; i < share->base.keys ; i++)
{
diff --git a/myisam/ft_dump.c b/myisam/myisam_ftdump.c
index 47134af71d6..8ab6a7600b2 100644
--- a/myisam/ft_dump.c
+++ b/myisam/myisam_ftdump.c
@@ -20,9 +20,9 @@
#include "ftdefs.h"
#include <my_getopt.h>
-static void get_options(int *argc,char **argv[]);
static void usage();
static void complain(int val);
+static my_bool get_one_option(int, const struct my_option *, char *);
static int count=0, stats=0, dump=0, lstats=0;
static my_bool verbose;
@@ -68,7 +68,8 @@ int main(int argc,char *argv[])
struct { MI_INFO *info; } aio0, *aio=&aio0; /* for GWS_IN_USE */
MY_INIT(argv[0]);
- get_options(&argc, &argv);
+ if ((error=handle_options(&argc, &argv, my_long_options, get_one_option)))
+ exit(error);
if (count || dump)
verbose=0;
if (!count && !dump && !lstats && !query)
@@ -80,12 +81,21 @@ int main(int argc,char *argv[])
if (argc < 2)
usage();
+ {
+ char *end;
+ inx= strtoll(argv[1], &end, 10);
+ if (*end)
+ usage();
+ }
+
init_key_cache(dflt_key_cache,MI_KEY_BLOCK_LENGTH,USE_BUFFER_INIT, 0, 0);
if (!(info=mi_open(argv[0],2,HA_OPEN_ABORT_IF_LOCKED)))
+ {
+ error=my_errno;
goto err;
+ }
- inx=atoi(argv[1]);
*buf2=0;
aio->info=info;
@@ -96,6 +106,8 @@ int main(int argc,char *argv[])
goto err;
}
+ mi_lock_database(info, F_EXTRA_LCK);
+
if (query)
{
#if 0
@@ -112,7 +124,7 @@ int main(int argc,char *argv[])
printf("%d rows matched\n",result->ndocs);
for(i=0 ; i<result->ndocs ; i++)
- printf("%9qx %20.7f\n",result->doc[i].dpos,result->doc[i].weight);
+ printf("%9lx %20.7f\n",(ulong)result->doc[i].dpos,result->doc[i].weight);
ft_nlq_close_search(result);
#else
@@ -179,6 +191,7 @@ int main(int argc,char *argv[])
if (verbose && (total%HOW_OFTEN_TO_WRITE)==0)
printf("%10ld\r",total);
}
+ mi_lock_database(info, F_UNLCK);
if (stats)
{
@@ -252,18 +265,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
}
-static void get_options(int *argc, char **argv[])
-{
- int ho_error;
-
- if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
- exit(ho_error);
-} /* get options */
-
-
static void usage()
{
- printf("Use: ft_dump <table_name> <index_no>\n");
+ printf("Use: myisam_ftdump <table_name> <index_num>\n");
my_print_help(my_long_options);
my_print_variables(my_long_options);
exit(1);
diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c
index 3e50e786089..a96632b4f3c 100644
--- a/myisam/myisamchk.c
+++ b/myisam/myisamchk.c
@@ -170,7 +170,7 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"character-sets-dir", OPT_CHARSETS_DIR,
"Directory where character sets are.",
- (gptr*) &set_charset_name, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (gptr*) &charsets_dir, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"check", 'c',
"Check table for errors.",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -253,7 +253,7 @@ static struct my_option my_long_options[] =
0, GET_ULL, OPT_ARG, 0, 0, 0, 0, 0, 0},
{"set-character-set", OPT_SET_CHARSET,
"Change the character set used by the index",
- 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (gptr*) &set_charset_name, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"set-variable", 'O',
"Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h
index 3788eeca1e3..987a9dfc39e 100644
--- a/myisam/myisamdef.h
+++ b/myisam/myisamdef.h
@@ -249,6 +249,8 @@ struct st_myisam_info {
my_off_t last_search_keypage; /* Last keypage when searching */
my_off_t dupp_key_pos;
ha_checksum checksum;
+ /* QQ: the folloing two xxx_length fields should be removed,
+ as they are not compatible with parallel repair */
ulong packed_length,blob_length; /* Length of found, packed record */
int dfile; /* The datafile */
uint opt_flag; /* Optim. for space/speed */
@@ -414,6 +416,7 @@ typedef struct st_mi_sort_param
#define MI_MIN_SIZE_BULK_INSERT_TREE 16384 /* this is per key */
#define MI_MIN_ROWS_TO_USE_BULK_INSERT 100
+#define MI_MIN_ROWS_TO_DISABLE_INDEXES 100
/* The UNIQUE check is done with a hashed long key */
@@ -577,7 +580,8 @@ extern byte *mi_alloc_rec_buff(MI_INFO *,ulong, byte**);
extern ulong _mi_rec_unpack(MI_INFO *info,byte *to,byte *from,
ulong reclength);
-extern my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *packpos);
+extern my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *packpos,
+ ulong reclength);
extern int _mi_write_part_record(MI_INFO *info,my_off_t filepos,ulong length,
my_off_t next_filepos,byte **record,
ulong *reclength,int *flag);
diff --git a/myisam/myisamlog.c b/myisam/myisamlog.c
index c9b00be7d9e..82f6277ce25 100644
--- a/myisam/myisamlog.c
+++ b/myisam/myisamlog.c
@@ -60,7 +60,6 @@ static int file_info_compare(void *cmp_arg, void *a,void *b);
static int test_if_open(struct file_info *key,element_count count,
struct test_if_open_param *param);
static void fix_blob_pointers(MI_INFO *isam,byte *record);
-static uint set_maximum_open_files(uint);
static int test_when_accessed(struct file_info *key,element_count count,
struct st_access_param *access_param);
static void file_info_free(struct file_info *info);
@@ -89,9 +88,8 @@ int main(int argc, char **argv)
log_filename=myisam_log_filename;
get_options(&argc,&argv);
- /* Nr of isam-files */
- max_files=(set_maximum_open_files(min(max_files,8))-6)/2;
-
+ /* Number of MyISAM files we can have open at one time */
+ max_files= (my_set_max_open_files(min(max_files,8))-6)/2;
if (update)
printf("Trying to %s MyISAM files according to log '%s'\n",
(recover ? "recover" : "update"),log_filename);
@@ -123,6 +121,7 @@ int main(int argc, char **argv)
printf("Had to do %d re-open because of too few possibly open files\n",
re_open_count);
VOID(mi_panic(HA_PANIC_CLOSE));
+ my_free_open_file_info();
my_end(test_info ? MY_CHECK_ERROR | MY_GIVE_INFO : MY_CHECK_ERROR);
exit(error);
return 0; /* No compiler warning */
@@ -732,38 +731,6 @@ static void fix_blob_pointers(MI_INFO *info, byte *record)
}
}
-static uint set_maximum_open_files(uint maximum_files)
-{
-#if defined(HAVE_GETRUSAGE) && defined(RLIMIT_NOFILE)
- struct rlimit rlimit;
- int old_max;
-
- if (maximum_files > MY_NFILE)
- maximum_files=MY_NFILE; /* Don't crash my_open */
-
- if (!getrlimit(RLIMIT_NOFILE,&rlimit))
- {
- old_max=rlimit.rlim_max;
- if (maximum_files && (int) maximum_files > old_max)
- rlimit.rlim_max=maximum_files;
- rlimit.rlim_cur=rlimit.rlim_max;
- if (setrlimit(RLIMIT_NOFILE,&rlimit))
- {
- if (old_max != (int) maximum_files)
- { /* Set as much as we can */
- rlimit.rlim_max=rlimit.rlim_cur=old_max;
- setrlimit(RLIMIT_NOFILE,&rlimit);
- }
- }
- getrlimit(RLIMIT_NOFILE,&rlimit); /* Read if broken setrlimit */
- if (maximum_files && maximum_files < rlimit.rlim_cur)
- VOID(fprintf(stderr,"Warning: Error from setrlimit: Max open files is %d\n",old_max));
- return rlimit.rlim_cur;
- }
-#endif
- return min(maximum_files,MY_NFILE);
-}
-
/* close the file with hasn't been accessed for the longest time */
/* ARGSUSED */
diff --git a/mysql-test/include/have_sjis.inc b/mysql-test/include/have_sjis.inc
new file mode 100644
index 00000000000..0d580a3a232
--- /dev/null
+++ b/mysql-test/include/have_sjis.inc
@@ -0,0 +1,4 @@
+-- require r/have_sjis.require
+disable_query_log;
+show collation like "sjis_japanese_ci";
+enable_query_log;
diff --git a/mysql-test/include/system_db_struct.inc b/mysql-test/include/system_db_struct.inc
new file mode 100644
index 00000000000..5a7aa26c65a
--- /dev/null
+++ b/mysql-test/include/system_db_struct.inc
@@ -0,0 +1,12 @@
+#
+# This test must examine structure of current system database
+#
+
+-- replace_result Tables_in_mysql Tables_in_db Tables_in_test Tables_in_db
+show tables;
+show create table db;
+show create table host;
+show create table user;
+show create table func;
+show create table tables_priv;
+show create table columns_priv;
diff --git a/mysql-test/install_test_db.sh b/mysql-test/install_test_db.sh
index 11ed1bb312c..ac5435f9832 100644
--- a/mysql-test/install_test_db.sh
+++ b/mysql-test/install_test_db.sh
@@ -5,20 +5,27 @@
# This scripts creates the privilege tables db, host, user, tables_priv,
# columns_priv in the mysql database, as well as the func table.
-if [ x$1 = x"-bin" ]; then
- shift 1
- execdir=../bin
- bindir=../bin
- BINARY_DIST=1
- fix_bin=mysql-test
- scriptdir=../bin
- libexecdir=../libexec
+if [ x$1 = x"--bin" ]; then
+ shift 1
+
+ # Check if it's a binary distribution or a 'make install'
+ if test -x ../libexec/mysqld
+ then
+ execdir=../libexec
+ else
+ execdir=../bin
+ fi
+ bindir=../bin
+ BINARY_DIST=1
+ fix_bin=mysql-test
+ scriptdir=../bin
+ libexecdir=../libexec
else
- execdir=../sql
- bindir=../client
- fix_bin=.
- scriptdir=../scripts
- libexecdir=../libexec
+ execdir=../sql
+ bindir=../client
+ fix_bin=.
+ scriptdir=../scripts
+ libexecdir=../libexec
fi
vardir=var
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh
index 3f7efd3d6bc..d0ce62cdcee 100644
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run.sh
@@ -10,7 +10,7 @@
# Access Definitions
#--
DB=test
-DBPASSWD=
+DBPASSWD=""
VERBOSE=""
USE_MANAGER=0
MY_TZ=GMT-3
@@ -18,7 +18,17 @@ TZ=$MY_TZ; export TZ # for UNIX_TIMESTAMP tests to work
LOCAL_SOCKET=@MYSQL_UNIX_ADDR@
# For query_cache test
-ulimit -n 1024
+case `uname` in
+ SCO_SV | UnixWare | OpenUNIX )
+ # do nothing (Causes strange behavior)
+ ;;
+ QNX)
+ # do nothing (avoid error message)
+ ;;
+ * )
+ ulimit -n 1024
+ ;;
+esac
#++
# Program Definitions
@@ -183,7 +193,8 @@ MY_LOG_DIR="$MYSQL_TEST_DIR/var/log"
# Set LD_LIBRARY_PATH if we are using shared libraries
#
LD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$LD_LIBRARY_PATH"
-export LD_LIBRARY_PATH
+DYLD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$DYLD_LIBRARY_PATH"
+export LD_LIBRARY_PATH DYLD_LIBRARY_PATH
MASTER_RUNNING=0
MASTER_MYPORT=9306
@@ -311,6 +322,8 @@ while test $# -gt 0; do
$ECHO "Note: you will get more meaningful output on a source distribution compiled with debugging option when running tests with --gdb option"
fi
DO_GDB=1
+ EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --gdb"
+ EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --gdb"
# This needs to be checked properly
# USE_MANAGER=1
USE_RUNNING_SERVER=""
@@ -412,8 +425,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
-export SLAVE_MYPORT
+export MASTER_MYPORT SLAVE_MYPORT
if [ x$SOURCE_DIST = x1 ] ; then
MY_BASEDIR=$MYSQL_TEST_DIR
@@ -460,15 +472,17 @@ if [ x$SOURCE_DIST = x1 ] ; then
MYSQL_TEST="strace -o $MYSQL_TEST_DIR/var/log/mysqltest.strace $MYSQL_TEST"
fi
- MYSQLADMIN="$BASEDIR/client/mysqladmin"
+ CLIENT_BINDIR="$BASEDIR/client"
+ MYSQLADMIN="$CLIENT_BINDIR/mysqladmin"
WAIT_PID="$BASEDIR/extra/mysql_waitpid"
- MYSQL_MANAGER_CLIENT="$BASEDIR/client/mysqlmanagerc"
+ MYSQL_MANAGER_CLIENT="$CLIENT_BINDIR/mysqlmanagerc"
MYSQL_MANAGER="$BASEDIR/tools/mysqlmanager"
- MYSQL_MANAGER_PWGEN="$BASEDIR/client/mysqlmanager-pwgen"
- MYSQL="$BASEDIR/client/mysql"
+ MYSQL_MANAGER_PWGEN="$CLIENT_BINDIR/mysqlmanager-pwgen"
+ MYSQL="$CLIENT_BINDIR/mysql"
LANGUAGE="$BASEDIR/sql/share/english/"
CHARSETSDIR="$BASEDIR/sql/share/charsets"
INSTALL_DB="./install_test_db"
+ MYSQL_FIX_SYSTEM_TABLES="$BASEDIR/scripts/mysql_fix_privilege_tables"
else
if test -x "$BASEDIR/libexec/mysqld"
then
@@ -476,16 +490,18 @@ else
else
MYSQLD="$VALGRIND $BASEDIR/bin/mysqld"
fi
- MYSQL_TEST="$BASEDIR/bin/mysqltest"
- MYSQL_DUMP="$BASEDIR/bin/mysqldump"
- MYSQL_BINLOG="$BASEDIR/bin/mysqlbinlog"
- MYSQLADMIN="$BASEDIR/bin/mysqladmin"
- WAIT_PID="$BASEDIR/bin/mysql_waitpid"
- MYSQL_MANAGER="$BASEDIR/bin/mysqlmanager"
- MYSQL_MANAGER_CLIENT="$BASEDIR/bin/mysqlmanagerc"
- MYSQL_MANAGER_PWGEN="$BASEDIR/bin/mysqlmanager-pwgen"
- MYSQL="$BASEDIR/bin/mysql"
- INSTALL_DB="./install_test_db -bin"
+ CLIENT_BINDIR="$BASEDIR/bin"
+ MYSQL_TEST="$CLIENT_BINDIR/mysqltest"
+ MYSQL_DUMP="$CLIENT_BINDIR/mysqldump"
+ MYSQL_BINLOG="$CLIENT_BINDIR/mysqlbinlog"
+ MYSQLADMIN="$CLIENT_BINDIR/mysqladmin"
+ WAIT_PID="$CLIENT_BINDIR/mysql_waitpid"
+ MYSQL_MANAGER="$CLIENT_BINDIR/mysqlmanager"
+ MYSQL_MANAGER_CLIENT="$CLIENT_BINDIR/mysqlmanagerc"
+ MYSQL_MANAGER_PWGEN="$CLIENT_BINDIR/mysqlmanager-pwgen"
+ MYSQL="$CLIENT_BINDIR/mysql"
+ INSTALL_DB="./install_test_db --bin"
+ MYSQL_FIX_SYSTEM_TABLES="$CLIENT_BINDIR/mysql_fix_privilege_tables"
if test -d "$BASEDIR/share/mysql/english"
then
LANGUAGE="$BASEDIR/share/mysql/english/"
@@ -496,10 +512,12 @@ else
fi
fi
-MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK $EXTRA_MYSQLDUMP_OPT"
+MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR $EXTRA_MYSQLBINLOG_OPT"
-export MYSQL_DUMP
-export MYSQL_BINLOG
+MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose=1"
+MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD"
+export MYSQL MYSQL_DUMP MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR
+
if [ -z "$MASTER_MYSQLD" ]
then
@@ -527,9 +545,9 @@ fi
if [ -w / ]
then
- # We are running as root; We need to add the --root argument
- EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --user=root"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --user=root"
+ # We are running as root; We need to add the --root argument
+ EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --user=root"
+ EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --user=root"
fi
@@ -1176,6 +1194,7 @@ run_testcase ()
master_init_script=$TESTDIR/$tname-master.sh
slave_init_script=$TESTDIR/$tname-slave.sh
slave_master_info_file=$TESTDIR/$tname.slave-mi
+ result_file=$tname
echo $tname > $CURRENT_TEST
SKIP_SLAVE=`$EXPR \( $tname : rpl \) = 0`
if [ "$USE_MANAGER" = 1 ] ; then
@@ -1225,6 +1244,11 @@ run_testcase ()
# Note that this must be set to space, not "" for test-reset to work
EXTRA_MASTER_OPT=" "
;;
+ --result-file=*)
+ result_file=`$ECHO "$EXTRA_MASTER_OPT" | $SED -e "s;--result-file=;;"`
+ # Note that this must be set to space, not "" for test-reset to work
+ EXTRA_MASTER_OPT=" "
+ ;;
esac
stop_master
echo "CURRENT_TEST: $tname" >> $MASTER_MYERR
@@ -1282,7 +1306,7 @@ run_testcase ()
if [ -f $tf ] ; then
$RM -f r/$tname.*reject
- mysql_test_args="-R r/$tname.result $EXTRA_MYSQL_TEST_OPT"
+ mysql_test_args="-R r/$result_file.result $EXTRA_MYSQL_TEST_OPT"
if [ -z "$DO_CLIENT_GDB" ] ; then
`$MYSQL_TEST $mysql_test_args < $tf 2> $TIMEFILE`;
else
@@ -1317,7 +1341,7 @@ run_testcase ()
$ECHO "$RES$RES_SPACE [ fail ]"
$ECHO
error_is
- show_failed_diff $tname
+ show_failed_diff $result_file
$ECHO
if [ x$FORCE != x1 ] ; then
$ECHO "Aborting: $tname failed. To continue, re-run with '--force'."
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index ce324dc1fa8..a7c1dbde697 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -1,4 +1,5 @@
drop table if exists t1,t2;
+drop database if exists mysqltest;
create table t1 (
col1 int not null auto_increment primary key,
col2 varchar(30) not null,
@@ -85,6 +86,45 @@ OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
DROP TABLE t1;
+create table t1 (i int unsigned not null auto_increment primary key);
+insert into t1 values (null),(null),(null),(null);
+alter table t1 drop i,add i int unsigned not null auto_increment, drop primary key, add primary key (i);
+select * from t1;
+i
+1
+2
+3
+4
+drop table t1;
+create table t1 (name char(15));
+insert into t1 (name) values ("current");
+create database mysqltest;
+create table mysqltest.t1 (name char(15));
+insert into mysqltest.t1 (name) values ("mysqltest");
+select * from t1;
+name
+current
+select * from mysqltest.t1;
+name
+mysqltest
+alter table t1 rename mysqltest.t1;
+ERROR 42S01: Table 't1' already exists
+select * from t1;
+name
+current
+select * from mysqltest.t1;
+name
+mysqltest
+drop table t1;
+drop database mysqltest;
+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'
+revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
+delete from mysql.user where user='mysqltest_1';
+drop database mysqltest;
create table t1 (n1 int not null, n2 int, n3 int, n4 float,
unique(n1),
key (n1, n2, n3, n4),
@@ -143,16 +183,6 @@ t1 1 n4 3 n2 A 10 NULL NULL YES BTREE
t1 1 n4 4 n3 A 10 NULL NULL YES BTREE
drop table t1;
create table t1 (i int unsigned not null auto_increment primary key);
-insert into t1 values (null),(null),(null),(null);
-alter table t1 drop i,add i int unsigned not null auto_increment, drop primary key, add primary key (i);
-select * from t1;
-i
-1
-2
-3
-4
-drop table t1;
-create table t1 (i int unsigned not null auto_increment primary key);
alter table t1 rename t2;
alter table t2 rename t1, add c char(10) comment "no comment";
show columns from t1;
@@ -291,7 +321,7 @@ alter table t1 change a a char(10) character set cp1251;
select a,hex(a) from t1;
a hex(a)
ÔÅÓÔ F2E5F1F2
-alter table t1 change a a char(10) binary;
+alter table t1 change a a binary(10);
select a,hex(a) from t1;
a hex(a)
òåñò F2E5F1F2
@@ -330,7 +360,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` char(10) character set koi8r default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-alter table t1 CHARACTER SET latin1;
+alter table t1 CONVERT TO CHARACTER SET latin1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -343,6 +373,22 @@ t1 CREATE TABLE `t1` (
`a` char(10) character set latin1 default NULL
) ENGINE=MyISAM DEFAULT CHARSET=cp1251
drop table t1;
+create table t1 (myblob longblob,mytext longtext)
+default charset latin1 collate latin1_general_cs;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `myblob` longblob,
+ `mytext` longtext collate latin1_general_cs
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_cs
+alter table t1 character set latin2;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `myblob` longblob,
+ `mytext` longtext character set latin1 collate latin1_general_cs
+) ENGINE=MyISAM DEFAULT CHARSET=latin2
+drop table t1;
CREATE TABLE t1 (
Host varchar(16) binary NOT NULL default '',
User varchar(16) binary NOT NULL default '',
diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result
index 7a7faf0db9a..9541fa6d355 100644
--- a/mysql-test/r/auto_increment.result
+++ b/mysql-test/r/auto_increment.result
@@ -142,7 +142,7 @@ explain extended select last_insert_id();
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 select high_priority no_cache 255 AS `last_insert_id()`
+Note 1003 select high_priority no_cache last_insert_id() AS `last_insert_id()`
insert into t1 set i = 254;
ERROR 23000: Duplicate entry '254' for key 1
select last_insert_id();
@@ -162,7 +162,7 @@ last_insert_id()
255
insert into t1 set i = null;
Warnings:
-Warning 1263 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 +213,7 @@ a b
delete from t1 where a=0;
update t1 set a=NULL where b=6;
Warnings:
-Warning 1262 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 +255,7 @@ a b
delete from t1 where a=0;
update t1 set a=NULL where b=13;
Warnings:
-Warning 1262 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-crash.result b/mysql-test/r/bdb-crash.result
index 8f5b8c08f1d..778890e85e3 100644
--- a/mysql-test/r/bdb-crash.result
+++ b/mysql-test/r/bdb-crash.result
@@ -30,3 +30,10 @@ ChargeID ServiceID ChargeDate ChargeAmount FedTaxes ProvTaxes ChargeStatus Charg
1 1 2001-03-01 1.00 1.00 1.00 New blablabla NULL now
2 1 2001-03-01 1.00 1.00 1.00 New NULL NULL now
drop table t1;
+create table t1 (a int) engine=bdb;
+set autocommit=0;
+insert into t1 values(1);
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status Operation need committed state
+drop table t1;
diff --git a/mysql-test/r/bdb.result b/mysql-test/r/bdb.result
index b02574cf8a3..bee40eac30d 100644
--- a/mysql-test/r/bdb.result
+++ b/mysql-test/r/bdb.result
@@ -1156,3 +1156,28 @@ create table t2 (c char(8) not null, b char(8) not null, a char(8) not null, pri
insert into t2 select * from t1;
delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
drop table t1,t2;
+create table t1 (a char(10), key(a), b int not null, key(b)) engine=bdb;
+insert into t1 values ('a',1),('A',2);
+explain select a from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 2
+select a from t1;
+a
+a
+A
+explain select b from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL b 4 NULL 2 Using index
+select b from t1;
+b
+1
+2
+alter table t1 modify a char(10) binary;
+explain select a from t1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL a 11 NULL 2 Using index
+select a from t1;
+a
+A
+a
+drop table t1;
diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result
index 4c6e1645451..4c70e72bdfb 100644
--- a/mysql-test/r/bigint.result
+++ b/mysql-test/r/bigint.result
@@ -84,3 +84,6 @@ quantity
10000000000000000000
10000000000000000000
drop table t1;
+SELECT '0x8000000000000001'+0;
+'0x8000000000000001'+0
+0
diff --git a/mysql-test/r/binary.result b/mysql-test/r/binary.result
index d4576791aed..f6ad190b05a 100644
--- a/mysql-test/r/binary.result
+++ b/mysql-test/r/binary.result
@@ -59,10 +59,8 @@ concat("-",a,"-",b,"-")
-hello-hello-
select concat("-",a,"-",b,"-") from t1 where b="hello ";
concat("-",a,"-",b,"-")
--hello-hello-
select concat("-",a,"-",b,"-") from t1 ignore index (b) where b="hello ";
concat("-",a,"-",b,"-")
--hello-hello-
alter table t1 modify b tinytext not null, drop key b, add key (b(100));
select concat("-",a,"-",b,"-") from t1 where b="hello ";
concat("-",a,"-",b,"-")
@@ -81,3 +79,34 @@ NULL
select b from t1 having binary b like '';
b
drop table t1;
+create table t1 (a char(15) binary, b binary(15));
+insert into t1 values ('aaa','bbb'),('AAA','BBB');
+select upper(a),upper(b) from t1;
+upper(a) upper(b)
+AAA bbb
+AAA BBB
+select lower(a),lower(b) from t1;
+lower(a) lower(b)
+aaa bbb
+aaa BBB
+select * from t1 where upper(a)='AAA';
+a b
+aaa bbb
+AAA BBB
+select * from t1 where lower(a)='aaa';
+a b
+aaa bbb
+AAA BBB
+select * from t1 where upper(b)='BBB';
+a b
+AAA BBB
+select * from t1 where lower(b)='bbb';
+a b
+aaa bbb
+select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1;
+charset(a) charset(b) charset(binary 'ccc')
+latin1 binary latin1
+select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1;
+collation(a) collation(b) collation(binary 'ccc')
+latin1_bin binary latin1_bin
+drop table t1;
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index 877a349d188..cdeb5b3dc21 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -51,11 +51,11 @@ CONVERT(DATE "2004-01-22 21:45:33",CHAR)
select CONVERT(DATE "2004-01-22 21:45:33",CHAR(4));
CONVERT(DATE "2004-01-22 21:45:33",CHAR(4))
2004
-select CONVERT(DATE "2004-01-22 21:45:33",CHAR(4) BINARY);
-CONVERT(DATE "2004-01-22 21:45:33",CHAR(4) BINARY)
+select CONVERT(DATE "2004-01-22 21:45:33",BINARY(4));
+CONVERT(DATE "2004-01-22 21:45:33",BINARY(4))
2004
-select CAST(DATE "2004-01-22 21:45:33" AS CHAR(4) BINARY);
-CAST(DATE "2004-01-22 21:45:33" AS CHAR(4) BINARY)
+select CAST(DATE "2004-01-22 21:45:33" AS BINARY(4));
+CAST(DATE "2004-01-22 21:45:33" AS BINARY(4))
2004
set names binary;
select cast(_latin1'test' as char character set latin2);
@@ -91,11 +91,11 @@ ab a ab a a
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `c1` char(2) binary NOT NULL default '',
- `c2` char(2) binary NOT NULL default '',
- `c3` char(2) binary NOT NULL default '',
- `c4` char(2) binary NOT NULL default '',
- `c5` char(2) binary NOT NULL default ''
+ `c1` binary(2) NOT NULL default '',
+ `c2` binary(2) NOT NULL default '',
+ `c3` binary(2) NOT NULL default '',
+ `c4` binary(2) NOT NULL default '',
+ `c5` binary(2) NOT NULL default ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
select
diff --git a/mysql-test/r/compare.result b/mysql-test/r/compare.result
index 3ad3465fac0..bf8a5106044 100644
--- a/mysql-test/r/compare.result
+++ b/mysql-test/r/compare.result
@@ -12,3 +12,27 @@ select * from t1;
id
000000000001
drop table t1;
+SELECT 'a' = 'a ';
+'a' = 'a '
+1
+SELECT 'a\0' < 'a';
+'a\0' < 'a'
+1
+SELECT 'a\0' < 'a ';
+'a\0' < 'a '
+1
+SELECT 'a\t' < 'a';
+'a\t' < 'a'
+1
+SELECT 'a\t' < 'a ';
+'a\t' < 'a '
+1
+CREATE TABLE t1 (a char(10) not null);
+INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a ');
+SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
+hex(a) STRCMP(a,'a') STRCMP(a,'a ')
+61 0 0
+6100 -1 -1
+6109 -1 -1
+61 0 0
+DROP TABLE t1;
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 940c9e9a50b..ce72c353d20 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 1262 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
@@ -44,6 +44,12 @@ create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
ERROR 42000: Incorrect table name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
create table a (`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` int);
ERROR 42000: Identifier name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long
+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
+create table test (a int default 100 auto_increment);
+ERROR 42000: Invalid default value for 'a'
create table 1ea10 (1a20 int,1e int);
insert into 1ea10 values(1,1);
select 1ea10.1a20,1e+ 1e+10 from 1ea10;
@@ -104,9 +110,9 @@ drop table t2;
create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("20:45:11" AS TIME) as t, CAST("2001-12-29 20:45:11" AS DATETIME) as dt;
describe t2;
Field Type Null Key Default Extra
-d date 0000-00-00
-t time 00:00:00
-dt datetime 0000-00-00 00:00:00
+d date YES NULL
+t time YES NULL
+dt datetime YES NULL
drop table t1,t2;
create table t1 (a tinyint);
create table t2 (a int) select * from t1;
@@ -262,6 +268,12 @@ a b
0 2
3 4
drop table t1;
+create table `t1 `(a int);
+ERROR 42000: Incorrect table name 't1 '
+create database `db1 `;
+ERROR 42000: Incorrect database name 'db1 '
+create table t1(`a ` int);
+ERROR 42000: Incorrect column name 'a '
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;
@@ -396,12 +408,12 @@ Field Type Null Key Default Extra
a int(11) YES NULL
b bigint(11) 0
c bigint(10) 0
-d date 0000-00-00
+d date YES NULL
e char(1)
-f datetime 0000-00-00 00:00:00
-g time 00:00:00
+f datetime YES NULL
+g time YES NULL
h longblob
-dd time 00:00:00
+dd time YES NULL
select * from t2;
a b c d e f g h dd
1 -7 7 2000-01-01 b 2000-01-01 00:00:00 05:04:03 yet another binary data 02:00:00
@@ -456,6 +468,20 @@ Field Type Null Key Default Extra
name varchar(10) YES NULL
age smallint(6) YES -1
drop table t1, t2;
+create table t1(cenum enum('a'), cset set('b'));
+create table t2(cenum enum('a','a'), cset set('b','b'));
+Warnings:
+Note 1291 Column 'cenum' has duplicated value 'a' in ENUM
+Note 1291 Column 'cset' has duplicated value 'b' in SET
+create table t3(cenum enum('a','A','a','c','c'), cset set('b','B','b','d','d'));
+Warnings:
+Note 1291 Column 'cenum' has duplicated value 'a' in ENUM
+Note 1291 Column 'cenum' has duplicated value 'A' in ENUM
+Note 1291 Column 'cenum' has duplicated value 'c' in ENUM
+Note 1291 Column 'cset' has duplicated value 'b' in SET
+Note 1291 Column 'cset' has duplicated value 'B' in SET
+Note 1291 Column 'cset' has duplicated value 'd' in SET
+drop table t1, t2, t3;
create database test_$1;
use test_$1;
select database();
@@ -468,3 +494,55 @@ NULL
select database();
database()
NULL
+use test;
+create table t1 (a int, index `primary` (a));
+ERROR 42000: Incorrect index name 'primary'
+create table t1 (a int, index `PRIMARY` (a));
+ERROR 42000: Incorrect index name 'PRIMARY'
+create table t1 (`primary` int, index(`primary`));
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `primary` int(11) default NULL,
+ KEY `primary_2` (`primary`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create table t2 (`PRIMARY` int, index(`PRIMARY`));
+show create table t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `PRIMARY` int(11) default NULL,
+ KEY `PRIMARY_2` (`PRIMARY`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create table t3 (a int);
+alter table t3 add index `primary` (a);
+ERROR 42000: Incorrect index name 'primary'
+alter table t3 add index `PRIMARY` (a);
+ERROR 42000: Incorrect index name 'PRIMARY'
+create table t4 (`primary` int);
+alter table t4 add index(`primary`);
+show create table t4;
+Table Create Table
+t4 CREATE TABLE `t4` (
+ `primary` int(11) default NULL,
+ KEY `primary_2` (`primary`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+create table t5 (`PRIMARY` int);
+alter table t5 add index(`PRIMARY`);
+show create table t5;
+Table Create Table
+t5 CREATE TABLE `t5` (
+ `PRIMARY` int(11) default NULL,
+ KEY `PRIMARY_2` (`PRIMARY`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1, t2, t3, t4, t5;
+CREATE TABLE t1(id varchar(10) NOT NULL PRIMARY KEY, dsc longtext);
+INSERT INTO t1 VALUES ('5000000001', NULL),('5000000003', 'Test'),('5000000004', NULL);
+CREATE TABLE t2(id varchar(15) NOT NULL, proc varchar(100) NOT NULL, runID varchar(16) NOT NULL, start datetime NOT NULL, PRIMARY KEY (id,proc,runID,start));
+INSERT INTO t2 VALUES ('5000000001', 'proc01', '20031029090650', '2003-10-29 13:38:40'),('5000000001', 'proc02', '20031029090650', '2003-10-29 13:38:51'),('5000000001', 'proc03', '20031029090650', '2003-10-29 13:38:11'),('5000000002', 'proc09', '20031024013310', '2003-10-24 01:33:11'),('5000000002', 'proc09', '20031024153537', '2003-10-24 15:36:04'),('5000000004', 'proc01', '20031024013641', '2003-10-24 01:37:29'),('5000000004', 'proc02', '20031024013641', '2003-10-24 01:37:39');
+CREATE TABLE t3 SELECT t1.dsc,COUNT(DISTINCT t2.id) AS countOfRuns FROM t1 LEFT JOIN t2 ON (t1.id=t2.id) GROUP BY t1.id;
+SELECT * FROM t3;
+dsc countOfRuns
+NULL 1
+Test 0
+NULL 1
+drop table t1, t2, t3;
diff --git a/mysql-test/r/ctype_collate.result b/mysql-test/r/ctype_collate.result
index add730fe68f..8f4ddedbfcf 100644
--- a/mysql-test/r/ctype_collate.result
+++ b/mysql-test/r/ctype_collate.result
@@ -337,15 +337,12 @@ SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_german2_ci;
latin1_f count(*)
A 4
AD 2
-AE 2
-Ä 2
+AE 4
AF 2
B 2
-SS 2
-ß 1
+SS 3
U 2
-UE 2
-Ü 2
+UE 4
Y 2
Z 2
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_general_ci;
@@ -431,13 +428,10 @@ A
AD
AE
AF
B
U
UE
SS
Y
Z
SELECT DISTINCT latin1_f COLLATE latin1_general_ci FROM t1;
@@ -509,8 +503,8 @@ ALTER TABLE t1 CHARACTER SET latin1 COLLATE latin1_bin;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `latin1_f` char(32) character set latin1 collate latin1_bin default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ `latin1_f` char(32) collate latin1_bin default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_bin
SHOW FIELDS FROM t1;
Field Type Null Key Default Extra
latin1_f char(32) YES NULL
diff --git a/mysql-test/r/ctype_cp1251.result b/mysql-test/r/ctype_cp1251.result
index a1f860e1f83..2a59f976156 100644
--- a/mysql-test/r/ctype_cp1251.result
+++ b/mysql-test/r/ctype_cp1251.result
@@ -1,4 +1,5 @@
drop table if exists t1;
+SET NAMES cp1251;
create table t1 (a varchar(10) not null);
insert into t1 values ("a"),("ab"),("abc");
select * from t1;
@@ -22,3 +23,34 @@ a
b
c
drop table t1;
+create table t1 (a char(15) binary, b binary(15));
+insert into t1 values ('aaa','bbb'),('AAA','BBB');
+select upper(a),upper(b) from t1;
+upper(a) upper(b)
+AAA bbb
+AAA BBB
+select lower(a),lower(b) from t1;
+lower(a) lower(b)
+aaa bbb
+aaa BBB
+select * from t1 where upper(a)='AAA';
+a b
+aaa bbb
+AAA BBB
+select * from t1 where lower(a)='aaa';
+a b
+aaa bbb
+AAA BBB
+select * from t1 where upper(b)='BBB';
+a b
+AAA BBB
+select * from t1 where lower(b)='bbb';
+a b
+aaa bbb
+select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1;
+charset(a) charset(b) charset(binary 'ccc')
+cp1251 binary cp1251
+select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1;
+collation(a) collation(b) collation(binary 'ccc')
+cp1251_bin binary cp1251_bin
+drop table t1;
diff --git a/mysql-test/r/ctype_create.result b/mysql-test/r/ctype_create.result
index b9146b5818f..e2dc8c1be66 100644
--- a/mysql-test/r/ctype_create.result
+++ b/mysql-test/r/ctype_create.result
@@ -17,4 +17,19 @@ t1 CREATE TABLE `t1` (
`a` char(10) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=cp1251
DROP TABLE t1;
+CREATE TABLE t1 (a char(10)) DEFAULT CHARACTER SET latin1;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(10) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t1;
+CREATE TABLE t1 (a char(10))
+DEFAULT CHARACTER SET latin1 COLLATE latin1_german1_ci;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` char(10) collate latin1_german1_ci default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german1_ci
+DROP TABLE t1;
DROP DATABASE db1;
diff --git a/mysql-test/r/ctype_mb.result b/mysql-test/r/ctype_mb.result
index edccb047c85..5e273b3c800 100644
--- a/mysql-test/r/ctype_mb.result
+++ b/mysql-test/r/ctype_mb.result
@@ -17,9 +17,9 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ('aaaabbbbccccdddd','aaaabbbbccccdddd','aaaabbbbccccdddd');
Warnings:
-Warning 1264 Data truncated for column 'c1' at row 1
-Warning 1264 Data truncated for column 'c2' at row 1
-Warning 1264 Data truncated for column 'c3' at row 1
+Warning 1265 Data truncated for column 'c1' at row 1
+Warning 1265 Data truncated for column 'c2' at row 1
+Warning 1265 Data truncated for column 'c3' at row 1
SELECT * FROM t1;
c1 c2 c3
aaaa aaaa aaaa
diff --git a/mysql-test/r/ctype_sjis.result b/mysql-test/r/ctype_sjis.result
new file mode 100644
index 00000000000..1e3e28784a5
--- /dev/null
+++ b/mysql-test/r/ctype_sjis.result
@@ -0,0 +1,43 @@
+drop table if exists t1;
+set names sjis;
+select 'a' like 'a';
+'a' like 'a'
+1
+select 'A' like 'a';
+'A' like 'a'
+1
+select 'A' like 'a' collate sjis_bin;
+'A' like 'a' collate sjis_bin
+0
+set @sjis1= _sjis 0xa1a2a3a4a5a6a7a8a9aaabacadaeaf;
+set @sjis2= _sjis 0xb0b1b2b3b4b5b6b7b8b9babbbcbdbebf;
+set @sjis3= _sjis 0xc0c1c2c3c4c5c6c7c8c9cacbcccdcecf;
+set @sjis4= _sjis 0xd0d1d2d3d4d5d6d7d8d9dadbdcdddedf;
+set @utf81= CONVERT(@sjis1 USING utf8);
+set @utf82= CONVERT(@sjis2 USING utf8);
+set @utf83= CONVERT(@sjis3 USING utf8);
+set @utf84= CONVERT(@sjis4 USING utf8);
+select hex(@utf81);
+hex(@utf81)
+EFBDA1EFBDA2EFBDA3EFBDA4EFBDA5EFBDA6EFBDA7EFBDA8EFBDA9EFBDAAEFBDABEFBDACEFBDADEFBDAEEFBDAF
+select hex(@utf82);
+hex(@utf82)
+EFBDB0EFBDB1EFBDB2EFBDB3EFBDB4EFBDB5EFBDB6EFBDB7EFBDB8EFBDB9EFBDBAEFBDBBEFBDBCEFBDBDEFBDBEEFBDBF
+select hex(@utf83);
+hex(@utf83)
+EFBE80EFBE81EFBE82EFBE83EFBE84EFBE85EFBE86EFBE87EFBE88EFBE89EFBE8AEFBE8BEFBE8CEFBE8DEFBE8EEFBE8F
+select hex(@utf84);
+hex(@utf84)
+EFBE90EFBE91EFBE92EFBE93EFBE94EFBE95EFBE96EFBE97EFBE98EFBE99EFBE9AEFBE9BEFBE9CEFBE9DEFBE9EEFBE9F
+select hex(CONVERT(@utf81 USING sjis));
+hex(CONVERT(@utf81 USING sjis))
+A1A2A3A4A5A6A7A8A9AAABACADAEAF
+select hex(CONVERT(@utf82 USING sjis));
+hex(CONVERT(@utf82 USING sjis))
+B0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF
+select hex(CONVERT(@utf83 USING sjis));
+hex(CONVERT(@utf83 USING sjis))
+C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF
+select hex(CONVERT(@utf84 USING sjis));
+hex(CONVERT(@utf84 USING sjis))
+D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF
diff --git a/mysql-test/r/ctype_tis620.result b/mysql-test/r/ctype_tis620.result
index 10164cd07ef..94c4b295713 100644
--- a/mysql-test/r/ctype_tis620.result
+++ b/mysql-test/r/ctype_tis620.result
@@ -111,3 +111,2791 @@ E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF
SELECT hex(convert(@uF USING tis620));
hex(convert(@uF USING tis620))
F0F1F2F3F4F5F6F7F8F9FAFBFFFFFFFF
+SET NAMES tis620;
+CREATE TABLE t1 (
+recid int(11) NOT NULL auto_increment,
+dyninfo text,
+PRIMARY KEY (recid)
+) ENGINE=MyISAM;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `recid` int(11) NOT NULL auto_increment,
+ `dyninfo` text,
+ PRIMARY KEY (`recid`)
+) ENGINE=MyISAM DEFAULT CHARSET=tis620
+INSERT INTO t1 VALUES (1,'color=\"STB,NPG\"\r\nengine=\"J30A13\"\r\nframe=\"MRHCG1640YP4\"\r\ngrade=\"V6\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CG164YEN\"\r\ntype=\"VT6\"\r\n');
+INSERT INTO t1 VALUES (2,'color=\"HTM,NPG,DEG,RGS\"\r\nengine=\"F23A5YP1\"\r\nframe=\"MRHCF8640YP3\"\r\ngrade=\"EXi AT\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CF864YE\"\r\ntype=\"EXA\"\r\n');
+SELECT DISTINCT
+(IF( LOCATE( 'year=\"', dyninfo ) = 1,
+SUBSTRING( dyninfo, 6+1, LOCATE('\"\r',dyninfo) - 6 -1),
+IF( LOCATE( '\nyear=\"', dyninfo ),
+SUBSTRING( dyninfo, LOCATE( '\nyear=\"', dyninfo ) + 7,
+LOCATE( '\"\r', SUBSTRING( dyninfo, LOCATE( '\nyear=\"', dyninfo ) +7 )) - 1), '' ))) AS year
+FROM t1
+HAVING year != '' ORDER BY year;
+year
+DROP TABLE t1;
+DROP TABLE IF EXISTS t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1
+(
+name varchar(50) NOT NULL default '',
+excelorder int(11) NOT NULL default '0',
+neworder int(11) NOT NULL default '0'
+) ENGINE=MyISAM DEFAULT CHARSET=tis620;
+INSERT INTO `t1` VALUES ('+45 BRETT',4,1),('+55 BRETT',5,2),('+56 BRETT',6,3),('-.55 BRETT',2,4),('-45 BRETT',8,5),('-55 BRETT',13,6),('.-55 BRETT',3,7),('.55 BRETT',1,8),('45 BRETT',7,9),('5 5 BRETT3',9,10),('5 5 BRETT2',10,11),('5 5 BRETT1',11,12),('5-5 BRETT',14,13),('55 BRETT',12,14),('55+ BRETT',17,15),('55- BRETT',15,16),('55. BRETT',16,17),('Ã.µË­Ô§ ¾Íã¨',1630,1630),('ÂÃç¤ì',1599,1599),('ÃÁÂì¨ÃÃÂì',1638,1638),('àÁà¨ÍÃìÍصÊÒË¡ÃÃÁä·Â (1989)',1583,1583),('àÁâ·ÃʻԹ¹Ôè§',1586,1586),('àÃÇѵ',1706,1706),('àÂ繨ԵÃ',1623,1623),('àÂ繨Եµì',1622,1622),('àÁÉÂÒ',1591,1591),('àÁÉÔ³Õ',1592,1592),('áÁé¹ÁÒµÃ',1595,1595),('àÂÒÇàÃÈ',1627,1627),('àÂÒÇÀÒ',1626,1626),('àÂÒÇÅѡɳì',1628,1628),('àÂÒÇ´Õ',1624,1624),('àÂÒǾÒ',1625,1625),('àÃÔ§ÃÐÇÕ',1708,1708),('àÃԧķ¸Ôì',1709,1709),('àÃÔ§·ÔÇÒ',1707,1707),('ÀÃÒ´Ã',1496,1496),('àâ­Ò',1702,1702),('âç§Ò¹àËÅç¡¡Ãا෾Ï',1712,1712),('âè¹ì»ÃÐàÊÃÔ°',1713,1713),('àóÙ',1703,1703),('àÁ´Ô¤ÃÒ¿·ì',1584,1584),('àÁµµÒ',1585,1585),('áÁ··ÕàÃÕÂÅ¡ÃØê» ¨Ó¡Ñ´',1594,1594),('àÁ¸Ò',1587,1587),('àÁ¸Õ',1590,1590),('àÁ¸ÒÇÕ',1588,1588),('â¸Թ',1629,1629),('àÁ¸Ô¹Õ',1589,1589),('Áâ¹',1553,1553),('Á⹪',1554,1554),('àþᾤ à·Ã´´Ôé§',1704,1704),('áþᾤ ¤Í¹ÊµÃѤªÑè¹',1711,1711),('àþᾤ¤Í¹ÊµÃѤªÑè¹',1705,1705),('àÃ×ͧÂÈ',1710,1710),('àÁ×ͧ·Í§',1593,1593),('ÁÂØÃÕ',1555,1555),('áÇÇÇÔÀÒ',1952,1952),('áÇÇÇ´Õ',1951,1951),('àÇèÂà©Ô¹ÍÔ¹´ÑÊàµÃÕ¹',1949,1949),('àÇÍÃìâ¡é ·ÃҹʻÍÃìµ',1950,1950),('ÀÇÔ¹',1497,1497),('Ãǧ·Í§',1639,1639),('ÁÐÅÔÇÑÅÂì',1560,1560),('ÃеÃÕ',1643,1643),('ÃоԹ·Ãì',1644,1644),('ÃоվÃ',1645,1645),('ÃоվÃó',1646,1646),('ÃоվÅ',1647,1647),('àËÁÇ´Õ',2452,2452),('âÊÃÊ',2438,2438),('àÈÃÉ°¸Ã',2050,2050),('àÈÃÉ°¾§Éì',2051,2051),('âÊÃѨ',2439,2439),('ÁËÀÑ®',1558,1558),('àÊÁÒ',2410,2410),('àÊÃÕ',2413,2413),('âÊÀÒ',2432,2432),('âÊÀÕ',2435,2435),('àÊÃÔÁÈÑ¡´Ôì',2412,2412),('àÊÃÔÁäªÂ¤éÒ¡ÃдÒÉ',2411,2411),('àËÃÕ­',2455,2455),('âÊÀÒ¾Ãó',2434,2434),('âÊÀÒ¾¨¹Õ',2433,2433),('âÊèԵ',2436,2436),('âÊÀ³',2431,2431),('âÈôÒ',2052,2052),('âÊôÒ',2437,2437),('àËÁ×͹¢ÇÑ­',2453,2453),('àËÁ×͹¾¹Í',2454,2454),('àÊÇÂ',2414,2414),('áÊǧ',2430,2430),('Áéǹáµé',1557,1557),('ÃÊÊؤ¹¸ì',1641,1641),('âÊÌÊ',2440,2440),('ÃÈÑ¡´Ôì',1640,1640),('ÁËÒÃÒª',1559,1559),('àÊÒÇÅѡɳì',2420,2420),('àÊÒǤ¹¸ì',2415,2415),('àÊÒdzÕ',2416,2416),('àÊÒdzÕÂì',2417,2417),('àÊÒǹÕÂì',2419,2419),('àÊÒǹԵÂì',2418,2418),('áËÅÁ·Í§ÊË¡ÒÃ',2456,2456),('àÊ¡ÊÃÃ',2405,2405),('àÊ¡ÊÃäì',2406,2406),('áʧÃÐÇÕ',2424,2424),('Âè§àΧÇѲ¹Ò¡ÒþÔÁ¾ì',1598,1598),('áʧà´×͹',2422,2422),('áʧªÑÂ',2421,2421),('áʧ·Í§',2423,2423),('àʶÕÂÃ',2407,2407),('áʹÃÑ¡',2428,2428),('áʹÂÒ¡Ã',2427,2427),('áʹÀ¾',2426,2426),('àʹËì',2408,2408),('áʹÊØ¢',2429,2429),('àʹÕÂì',2409,2409),('áʹ·ÇÕà·ç¡«ìä·Åì',2425,2425),('àÍ.à¨.¾ÅÒÊ·ì',2676,2676),('âÍàÃÕÂÅ·ÍÅ ¿Øé´',2716,2716),('áÍÃì«Õ à¿Ã· ¿ÍÃìàÇÔ´àµÍÃì',2712,2712),('áÍÃì¾Õà¾ÔÅÍÔ¹àµÍÃì๪Ñè¹á¹Å',2713,2713),('ÃÍÂÑÅàÍ繨Ôà¹ÕÂÃÔè§',1642,1642),('àÍàªÕÂàÊÃÔÁ¡Ô¨ÅÔÊ«Ôè§',2687,2687),('àÍçÁ .«Õ.¾ÕÅÔÊ«Ôè§',2690,2690),('àÍçÁ «Õ ÍÐâ¡Ãà¤ÁÕ¤ÍÅ',2691,2691),('àÍçÁ.àÍçÁ.«Õ.â»ÅÔàÁÍÃì',2693,2693),('àÍçÁ.«Õ.¾Õ. ÅÔÊ«Ôè§',2692,2692),('àÍçÁ«ÕÊÂÒÁ âŨÕʵԤÊì',2694,2694),('âÍÇÍÐËÅÑè¾ÒÃì·à«ç¹àµÍÃì',2717,2717),('àÍç¡«Õà«ÅàŹ¿ÍÃìÁ',2678,2678),('àÍçª àÍçÁ «Õ â»ÅÕàÁÍÃì',2684,2684),('àÍçª.àÍçÁ.«Õ.â»ÅÔàÁÍÃì',2685,2685),('àÍçª.àÍçÁ.«Õ.â»ÅÕàÁÍÃì (º¨¡.)',2686,2686),('àÍç¹ ´Õ ठ(»ÃÐà·Èä·Â)',2688,2688),('àÍÊ àÍÊ à¤ ¡Å¡ÒÃ',2697,2697),('àÍÊ à¨ ¾ÅÒÊ·ì á͹´ì ᾤ',2695,2695),('àÍÊ ¾Õ Ê᡹',2696,2696),('àÍÊ.àÍçÁ.ÇÕ ÊË¡ÒÃ',2701,2701),('àÍÊ.àÍÊ.ठ¡Å¡ÒÃ',2702,2702),('àÍÊ.àÍÊ.à¤.¡Å¡ÒÃ',2703,2703),('àÍÊ.àÍÊ.ÍÔ¹¡Íµ ÍÅÙÁÔà¹ÕÂÁ1999',2704,2704),('àÍÊ.à¤.ÍÕ.',2698,2698),('àÍÊ.«Õ.¾Õ.ᾤ',2699,2699),('àÍÊ.¾Õ.¹ÔµµÔé§',2700,2700),('áÍÊષ¾ÅÑÊ',2715,2715),('àÍÊÇÕ¹Ô··Ñ¹¾ÃÔ«ÔªÑè¹',2705,2705),('áÍÅ¿èÒ â»Ãà«Ê«Ôè§',2714,2714),('àÍ¡ÃÒª',2679,2679),('àÍ¡ÃÔ¹·Ãì',2680,2680),('àÍ¡ÊÔ·¸Ôì',2681,2681),('àÍ¡ÍÃö',2683,2683),('à͡͹ѹµì',2682,2682),('àÍ¡ªÑÂ',2677,2677),('àΧà¨ÃÔ­ªÑ ¡ÃØê» ÍÔ¹´ÑÊàµÃÕÂÅ',2725,2725),('ÂʹྪÃ',1600,1600),('á͹¹Ò',2709,2709),('á͹¹ÒÃÕ',2710,2710),('áͺºÕà¤ÃÊ·ì(»ÃÐà·Èä·Â)',2711,2711),('àÍ¿ ÍÕ «Ô¤ÅÔ¤ (¡Ãا෾)',2689,2689),('àÍ×éÍÁ¾Ã',2707,2707),('àÍ×éÍÍÒÃÕ',2708,2708),('àÍ×é;ѹ¸Øì',2706,2706),('ÃÑÈÁÕ',1674,1674),('ÃÑÈÁÕÀÑÊÊÃ',1675,1675),('ÀÑÊÇÃó',1511,1511),('ÀÑÊÅÔ¹',1510,1510),('ÁÑÅÅÔ¡Ò',1564,1564),('ÃÑ¡ÈÑ¡´Ôì',1649,1649),('ÃÑ¡ÉÔµÀÑ·Ã',1650,1650),('ÀÑ¡´Õ',1498,1498),('ÃÑ¡´Õ',1648,1648),('ÀѤ¨ÔÃÒ',1499,1499),('ÃѧÊÃäì',1651,1651),('ÃѧÊѹµì',1652,1652),('ÃѧÊÔÁÒ',1653,1653),('Áѧ¡Ãä·ÂʵÕźÒÃì',1561,1561),('ÃѪà¡ÅéÒ',1654,1654),('ÃѪ®Ò',1655,1655),('ÃѪ®Ò¾Ã',1656,1656),('ÃѪ´Ò',1657,1657),('ÃѪ¹Õ',1658,1658),('ÃѪ¹Õ¡Ã',1659,1659),('ÃѪ¹Õ¾Ã',1660,1660),('ÃÑ°ÊØ´Ò',1662,1662),('ÃÑ°¾§Éì',1661,1661),('Àѳ±ÔÃÒ',1500,1500),('Áѳ±¹Ò',1562,1562),('ÃѵÔÂÒ',1672,1672),('ÃѵÔÂÒÀóì',1673,1673),('Ãѵ³Ò',1663,1663),('ÃѵµÔÂÒ',1665,1665),('ÃѵµªÑÂ',1664,1664),('Ãѵ¹Àóì',1667,1667),('Ãѵ¹Á³Õ',1668,1668),('Ãѵ¹Ò',1669,1669),('Ãѵ¹ÒÀóì',1671,1671),('Ãѵ¹Ò¾Ã',1670,1670),('Ãѵ¹ªÑÂ',1666,1666),('ÀÑ·ÃÀÃ',1505,1505),('ÀÑ·ÃÃѧÊÕ',1506,1506),('ÀÑ·ÃÒÀóì',1508,1508),('ÀÑ·ÃÔ¹·Ãì',1509,1509),('ÀÑ·ÃÄ´Õ',1507,1507),('Àѷ÷ÔÃÒ',1501,1501),('ÀѷþÃ',1503,1503),('ÀѷþÅ',1504,1504),('Àѷþ§Èì',1502,1502),('ÁÑ·¹Ò',1563,1563),('Âѹ áÍÅ à¤âÂÊ',1601,1601),('ÃÒàÁÈÃì',1681,1681),('ÁÒÃÔÉÒ',1572,1572),('ÃÒÂÕ¹',1682,1682),('ÃÒહ',1678,1678),('ÀÒôÕ',1521,1521),('ÀÔôÕ',1531,1531),('ÁÒ⹪³ì',1570,1570),('ÁÒâ¹·',1571,1571),('ÀÒÇÔ³Õ',1524,1524),('ÀÒÇÔ¹',1525,1525),('ÀÒÇÔ¹Õ',1526,1526),('ÀÒǹÒ',1522,1522),('ÀÒǾѹ¸¹ì',1523,1523),('ÀÒÉÔµÒ',1527,1527),('ÂÔè§ÇÃó',1602,1602),('ÁÔÅàŹà¹ÕèÂÁ âÍ.àÍ 2000',1578,1578),('ÁÒÅÑÂ',1573,1573),('ÁÒÅÕ',1575,1575),('ÁÒÅÕÇÃó',1576,1576),('ÁÒÅÔ¹Õ',1574,1574),('ÀÒ¡Ã',1512,1512),('ÀÒ¤ÀÙÁÔ',1513,1513),('ÀÔ¨ÔµÃÒ',1528,1528),('ÁÒªÍÃì¡ÇÒ¹',1565,1565),('ÃҪѹÂì',1676,1676),('ÃÒªÒÍÙªÔâ¹',1677,1677),('ÀÔ­â­',1530,1530),('ÀÔ­­¾Ñ¡µÃì',1529,1529),('ÀÒ³Õ',1514,1514),('ÁÒ³Õ',1566,1566),('ÃÒ³Õ',1679,1679),('ÀÒ³Ø',1515,1515),('ÀÒ³ØÇÃó',1517,1517),('ÀҳؾÅ',1516,1516),('ÃÒµÃÕ',1680,1680),('ÁÔµ·ÔÃÒ',1577,1577),('ÁÒ¹Ð',1568,1568),('ÁÒ¹ÔµÂì',1569,1569),('ÁÒ¹¾',1567,1567),('ÀÒ¹ØÇѲ¹ì',1518,1518),('ÀÒ¹ØÇѵÃ',1519,1519),('ÀÒ¾Ã',1520,1520),('ÁÕ¾Å',1579,1579),('ÀÙÃÔÇÃò¡ì',1535,1535),('ÀÙÁÔ°Ò¹',1533,1533),('ÀÙÃÔ¾§Èì',1534,1534),('ÂÙà¹Õè¹á¡êÊá͹´ìàÅÁÔ¤ÑÅÊì',1621,1621),('ÀÙàºÈ',1532,1532),('ÃÙàºÕÂÍصÊÒË¡ÃÃÁ',1701,1701),('ÁÙËÐÁд×ÍàÃÐ',1582,1582),('ÀÙÉÔµ',1536,1536),('ÂÙ¹ÔÅÕàÇÍÃì ä·Â âÎÅ´Ôé§Êì',1618,1618),('ÂÙ¹ÔÅÕàÇÍÃìä·Â âÎÅ´Ôé§Êì',1619,1619),('ÂÙ¹Õ¤ ÍÍÃì¤Ô´',1620,1620),('âÅËСԨʵÕÅ',1744,1744),('àÅÍÊÃäì',1739,1739),('àÅÍÈÑ¡´Ôì',1738,1738),('àÅÍÊØ¢',1740,1740),('àÅͪÑÂ',1737,1737),('àÅÔÈÈÑ¡´Ôì',1742,1742),('àÅÔÈÊÒÁÒö â¸Ò',1743,1743),('àÅÔȪÑÂ',1741,1741),('ÁÅÄ´Õ',1556,1556),('â¡àÁÈ',206,206),('â¡àÇȹì',211,211),('à¡ÃÕ§§ÍÔ¹àµÍÃì๪Ñè¹á¹Å',179,179),('à¡ÃÕ§ÈÑ¡´Ôì',180,180),('à¡ÃÕ§ä¡Ã',177,177),('à¡ÃÕ§ªÑÂ',178,178),('à¡ÃÔ¡',174,174),('à¡ÃÔ¡ä¡Ã',175,175),('à¡ÃÔ¡¾§Éì',176,176),('Á¡Ãҹѹ·ì',1537,1537),('â¡Ážѹ¸ì',205,205),('â¡ÇÔ·',208,208),('â¡ÇÔ·Âì',209,209),('â¡ÇÔ¹',210,210),('à¡ç¨¾ÔÃس',170,170),('à¡ÉÁ',190,190),('à¡ÊÃ',196,195),('à¡ÉÁÊѹµì',191,191),('à¡ÊÃì',195,196),('à¡ÈÃÒ',182,182),('à¡ÉÃÒ',192,192),('à¡ÉÃÕ',193,193),('à¡ÈÃÔ¹·Ãì',183,183),('á¡éÇ',203,203),('á¡éÇã¨',204,204),('à¡ÈÇÅÕ',184,184),('à¡ÈÈÔÃÔ',185,185),('à¡ÈÊØ´Ò',186,186),('à¡ÉÕÂÃ',194,194),('à¡ÈÔ¹Õ',187,187),('â¡ÊÔ¹·Ãì',213,213),('â¡ÈÅ',212,212),('à¡È¡ØÅÀÒ',181,181),('à¡É³Õ',188,188),('à¡É´Ò',189,189),('à¡ÕÂõÔ',197,197),('à¡ÕÂõÔÊÇÑÊ´Ôì',201,201),('à¡ÕÂõÔÈÑ¡´Ôì',200,200),('à¡ÕÂõԻÀÒ',198,198),('à¡ÕÂõԾ§Éì',199,199),('â¡ÅºÍÅ ¤Í¹à¹ç¤ªÑè¹Êì',207,207),('ࡪÒ',171,171),('ࡳԡÒ',172,172),('ࡵØÁ³Õ',173,173),('à¡×éÍ¡ÙÅ',202,202),('á¢ä¢',235,235),('ठÊËÒÂÍÔÁà»ê¡«ì',262,262),('à¤.«Õ.¾Õ. áÁªªÕ¹à¹ÍÃÕè',263,263),('â¤Ãà¹Ê (ä·ÂᏴì)',270,270),('à¤Ã×ÍÇÑÅÂì',267,267),('á¤Ð¨éÍÂ',269,269),('षշÕÅÔÊ«Ôè§',264,264),('ह áÁç¡«ì (»ÃÐà·Èä·Â)',266,266),('ह áÁ¡«ì (»ÃÐà·Èä·Â)',265,265),('᤹¹Ù ÍÔ¹àµÍÃìà·Ã´',268,268),('â¦ÉÔµ',271,271),('§ÂØ·¸',1597,1597),('à§Ô¹·Ø¹à¡ÕÂõԹҤԹ',274,274),('Á§¡Ø®Ãѵ¹ì',1538,1538),('Á§¤Å',1539,1539),('Á§¤Å¡Òûѡ',1540,1540),('à¨ÃÕ§',409,409),('à¨ÃÔ­',407,407),('à¨ÃÔ­ªÑÂËÁéÍá»Å§ä¿¿éÒ',408,408),('á¨èÁ',414,414),('ã¨ÊÇÇäì',415,415),('à¨éÒ¾ÃÐÂÒÁÒÃì¤',411,411),('à¨É®Ò',410,410),('à¨ÕÂÁ¨Ôµ',413,413),('à¨ÔÁªÑÂ',412,412),('ਵ¹ì',401,401),('ਹ',402,402),('ਹà¹ÍÃÑÅ乫ì (»ÃÐà·Èä·Â)',405,405),('ਹÇÔ·Âì',406,406),('è¹Ò',1631,1631),('ਹ¨ÔÃÒ',403,403),('ਹµì³Ã§¤ì',404,404),('â©ÁÊØ´Ò',436,436),('â©ÁÅ´Ò',435,435),('à©Ô¹',434,434),('à©ÅÔÁ',428,428),('à©ÅÕÂÇ',433,433),('à©ÅÔÁ¢ÇÑ­',429,429),('à©ÅÔÁªÑÂ',430,430),('à©ÅÔÁªÒµÔ',431,431),('à©ÅÔÁ¾Ñ¹¸Øì',432,432),('àªÉ°Ò',555,555),('àªÍÃÔè§-¾ÅÒÇ á͹ÔÁÑÅ àÎéŪ',556,556),('àªÍÃÔè§-¾ÅÒÇá͹ÔÁÑÅàÎçŸ',557,557),('àªÕ§àΧ¡ÒêèÒ§',563,563),('àªÒÇÅÔµ',559,559),('àªÒǹҭ',558,558),('àªÕèÂǪҭ ÍÔ¹´ÑÊ·ÃÕè (1989)',564,564),('àªÕèÂǪҭÍÔ¹´ÑÊ·ÃÕ (1989)',565,565),('àªÕèÂǪҭÍÔ¹´ÑÊ·ÃÕè (1989)',566,566),('àªÕèÂǪҭÍÔ¹´ÑÊ·ÃÕè(1989)',567,567),('àªÔ´ÈÑ¡´Ôì',562,562),('àªÔ´¨Ôµµì',560,560),('àªÔ´ªÑÂ',561,561),('⪤',568,568),('⪤ªÑÂ',569,569),('ય°¡Ã',554,554),('⪵Ô',570,570),('⪵ÔÃÊ',571,571),('⪵ÔÇظ',572,572),('à«ÕÂÁà¡ÕÂÇ',589,589),('à«ÒÐ',588,588),('óç¤ì',1632,1632),('Á³à±ÕÂÃ',1546,1546),('Á³ÕÃѵ¹ì',1547,1547),('Á³°Ô´Ò',1541,1541),('Á³±Ò',1545,1545),('Á³±ÅÕ',1544,1544),('Á³±¹ì¡Ò­¨¹ì',1542,1542),('Á³±¹Ô¨',1543,1543),('â´Á',708,708),('à´ÍФÇÍÅÔµäÇÃì',705,705),('ôÒ',1633,1633),('à´ª',703,703),('à´ªÒ',704,704),('à´×͹à¾ç­',707,707),('à´×͹¹ÀÒ',706,706),('àµçÁà´ª',720,720),('ãµé à«é§ «Ñ¹',723,723),('àµ×͹ã¨',721,721),('àµ×͹µÒ',722,722),('à¶ÅÔ§ÈÑ¡´Ôì',734,734),('à·ÇÒ',802,802),('à·ÇÕ',803,803),('à·Ô´ä·',804,804),('à·¾',799,799),('෾ķ¸Ôì',801,801),('à·¾¾ÔºÙÅ',800,800),('Á¹ÑÊ',1550,1550),('Á¹ÑÊÇÕ',1551,1551),('à¹ÒÇÃѵ¹ì',1043,1043),('ùԮ°Ò',1634,1634),('Á¹Ù­',1552,1552),('Á¹µÃÕ',1549,1549),('๵ôÒÇ',1042,1042),('Á¹µìªÑÂ',1548,1548),('àºç­ÇÃó',1117,1117),('àºç·à·ÍÃì äÅ¿ì',1118,1118),('ອ¨ÁÒ',1114,1114),('ອ¨ÇÃó',1116,1116),('ອ¨ÅÑ¡É³ì ¾ÃÔé¹µÔé§',1115,1115),('ອ¨¾Ã',1113,1113),('à»ÃÁ',1265,1265),('à»ÃÁÈÃÕ',1268,1268),('à»ÃÁÊÔ·¸Ôì',1269,1269),('à»ÃÁÄ´Õ',1267,1267),('à»ÃÁ»ÃÐÀÒ',1266,1266),('à»à»ÍÃìÅÔ¿',1264,1264),('à»ÕèÂÁÊØ¢',1270,1270),('á»Å¹âÁ·Ô¿',1271,1271),('à¼Ô§',1291,1291),('༴ç¨',1290,1290),('á¾ÃÇ',1475,1475),('á¾ÃÇÒ',1476,1476),('à¾ÃÔÁàÁ¹¹Ôª ÍâÃáÁµÔê¡Êì ¾Õ·ÕÍÕ ÅÔÁÔàµç´',1468,1468),('à¾ç§ ¿Ù ËÅÔ¹',1456,1456),('à¾çªÃì',1457,1457),('à¾ç­ÈÃÕ',1467,1467),('à¾ç­¨Ñ¹·Ãì',1461,1461),('à¾ç­·Ô¾Âì',1462,1462),('à¾ç­¹ÀÒ',1463,1463),('à¾ç­»ÃÐÀÒ',1464,1464),('à¾ç­¼¡Ò',1465,1465),('à¾ç­¾ÔäÅ',1466,1466),('þÕÀÑ·Ã',1637,1637),('à¾Õ§¾Ã',1471,1471),('þվÃ',1635,1635),('þվѲ¹ì',1636,1636),('à¾ÅԹĴÕ',1470,1470),('à¾ÅÔ¹¨Ôµµì',1469,1469),('ྪÃÃѵ¹ì',1458,1458),('ྪÃÔ¹·Ãì',1460,1460),('ྪÃÅ´Ò',1459,1459),('á¾´´Ôé§ (ä·ÂᏴì)',1472,1472),('á¾´´Ôé§(ä·ÂᏴì)',1473,1473),('á¾¹´éÒ à»à»ÍÃì ¤ÒÃìµÑ¹Ê',1474,1474),('á¿ÃìàÇÂì ÍÔ¹àµÍÃì๪Ñè¹á¹Å',1495,1495),('á¿Ã§¤ì',1494,1494),('Ã×è¹ÇÃÒËì',1683,1683),('ÂØÀÒÀóì',1615,1615),('ÂØÀÒ¾Ã',1614,1614),('ÂØÇÃÕ',1617,1617),('ÂØÇ´Õ',1616,1616),('ÃØËйÒ',1700,1700),('ÃØé§',1684,1684),('ÃØè§âè¹ì',1693,1693),('ÃØè§âè¹ì¢¹Êè§',1694,1694),('ÃØè§àÃ×ͧ',1692,1692),('ÃØè§ÃÑÈÁÕ',1691,1691),('ÃØè§ÃѪ¹Õ',1689,1689),('ÃØè§Ãѵ¹ì',1690,1690),('ÃØè§à¾ªÃ',1688,1688),('ÃØè§ÇÔ·Âì',1696,1696),('ÃØè§ÍÃس',1697,1697),('ÃØé§ÅÒÇÃó',1695,1695),('ÃØ觷ÔÇÒ',1686,1686),('ÃØ觷ԾÂì',1685,1685),('ÃØ觹ÀÒ',1687,1687),('ÁØ¢',1580,1580),('ÂؤžÃ',1603,1603),('ÃبÒ',1698,1698),('ÃبÒÀÒ',1699,1699),('ÂØ´Ò',1604,1604),('ÁØ·ÔµÒ',1581,1581),('ÂØ·¸Â§',1607,1607),('ÂØ·¸¹Ò',1605,1605),('ÂØ·¸¹ÒÇÕ',1606,1606),('ÂظÒÁÒµÂì',1608,1608),('Âعâ¡Ð',1609,1609),('ÂؾÒ',1610,1610),('ÂؾÒÇ´Õ',1612,1612),('ÂؾԹ',1613,1613),('ÂؾҾÃ',1611,1611),('ÇÃÃѪ',1792,1792),('ÇÃÁÅ',1768,1768),('ÇÃóÀóì',1785,1785),('ÇÃóÀÒ',1786,1786),('ÇÃóÀ¾',1784,1784),('ÇÃóà¾ç­',1783,1783),('ÇÃóǴÕ',1787,1787),('ÇÃóÈÔÃÔ',1788,1788),('ÇÃóì´Õ',1773,1774),('ÇÃóÒ',1789,1789),('ÇÃóÕ',1790,1790),('ÇÃó¨Ôµ',1770,1770),('ÇÃóªÑÂ',1771,1771),('ÇÃó±¹Ò',1772,1772),('ÇÃó´Õ',1774,1773),('ÇÃó·¹Ò',1775,1775),('ÇÃó·¹Õ',1776,1776),('ÇÃó¸ÁÅ',1778,1778),('ÇÃó¸³Õ',1777,1777),('ÇÃó¹ÀÒ',1779,1779),('ÇÃó¹ÒÃÕ',1780,1780),('ÇÃó¾Ã',1781,1781),('ÇÃó¾Ò',1782,1782),('ÇÃà·¾',1762,1762),('ÇÃø¹Ò',1791,1791),('ÇÃÂØ·¸ì',1769,1769),('ÇÃÇÃó',1794,1794),('ÇÃÇÃø¹ì',1795,1795),('ÇÃÇѲ¹ì',1796,1796),('ÇÃÇÔÀÒ',1797,1797),('ÇÃÑ­¸Ã',1798,1798),('ÇÃÒ',1799,1799),('ÇÃÒÀóì',1803,1803),('ÇÃÒÃѵ¹ì',1804,1804),('ÇÃÔÁÒ',1810,1810),('ÇÃÕÇÃó',1812,1812),('ÇÃÒÇزÔ',1806,1806),('ÇÃÒÇظ',1807,1807),('ÇÃÔÈÃÒ',1811,1811),('ÇÃÒÅѡɳì',1805,1805),('ÇÃÒ§Ãѵ¹ì',1801,1801),('ÇÃÒ§¤³Ò',1800,1800),('ÇÃÔ¹·Ãì',1808,1808),('ÇÃÔ¹¸Ã',1809,1809),('ÇÃÒ¾Ã',1802,1802),('ÇÃÅѡɳì',1793,1793),('ÇáÒÃ',1758,1758),('ÇêÑÂ',1759,1759),('ÇêҵÔ',1760,1760),('ÇôÔÉ°ì',1761,1761),('ÇøѹÂì',1763,1763),('Çùت',1764,1764),('ÇþÅ',1767,1767),('Çþ§Éì',1765,1765),('Çþ¨¹ì',1766,1766),('ÇÃس',1813,1813),('Çèͧ',1819,1819),('ÇÊѹµì',1817,1817),('ÇÈÔ³Ò',1815,1815),('ÇÈÔ¹',1816,1816),('ÇÊØ',1818,1818),('CHEE KUNG FOOK',18,18),('CHEN CHIA YI',19,19),('CHI WAI DAVIT',20,20),('ÇÑʹÑÂ',1843,1843),('ÇÑȾÅ',1842,1842),('ÇÑÅÅÀ',1839,1839),('ÇÑÅÅÀÒ',1840,1840),('ÇÑÅÅÒÀÒ',1841,1841),('ÇѪÃÐ',1822,1822),('ÇѪÃÑ­­Ò',1823,1823),('ÇѪÃÕ',1825,1825),('ÇѪÃÔ¹·Ãì',1824,1824),('ÇѪáÃ',1820,1820),('ÇѪþÅ',1821,1821),('ÇѲ¹Ð',1826,1826),('ÇѲ¹Ò',1827,1827),('ÇѹÃѪ´Ò',1836,1836),('Çѹà©ÅÔÁ',1828,1828),('Çѹà¾ç­',1835,1835),('ÇѹÇÔÊÒ¢ì',1837,1837),('ÇѹʶÒ',1838,1838),('ÇѹªÑÂ',1829,1829),('ÇѹªÒµÔ',1830,1830),('Çѹ´Õ',1831,1831),('Çѹ·¹Ò',1832,1832),('Çѹ·¹Õ',1833,1833),('Çѹ·¹ÕÂì',1834,1834),('ÇÕ àÍÊ à¹à¹ÍÃÑÅ à¤Á',1916,1916),('ÇÔÃÁÅ',1886,1886),('ÇÔâè¹ì',1889,1889),('ÇÕÃ⪵Ô',1921,1921),('ÇÕÃà´ª',1922,1922),('ÇÕÃÂØ·Âì',1925,1925),('ÇÕÃÇÃó',1926,1926),('ÇÕÃÐ',1929,1929),('ÇÕÃÐà´ª',1933,1933),('ÇÕÃÐÂØ·¸ì',1936,1936),('ÇÕÃÐÇÃó',1937,1937),('ÇÕÃÐÇѲ¹ì',1938,1938),('ÇÕÃÐÈÑ¡´Ôì',1939,1939),('ÇÕÃЪÑÂ',1930,1930),('ÇÕÃЪÒÂ',1932,1932),('ÇÕÃЪҵÔ',1931,1931),('ÇÕÃоÅ',1935,1935),('ÇÕÃо§Éì',1934,1934),('ÇÕÃÈÑ¡´Ôì',1927,1927),('ÇÕÃÊÔ·¸Ôì',1928,1928),('ÇÔÃѪ',1887,1887),('ÇÔÃѵ¹ì',1888,1888),('ÇÒÃÕ',1849,1849),('ÇÔÀÒ',1875,1875),('ÇÕÃÒÀóì',1940,1940),('ÇÔÀÒÃѵ¹ì',1879,1879),('ÇÔÀÒÊ',1881,1881),('ÇÔÀÒɳÕÂì',1880,1880),('ÇÔÀҡóì',1876,1876),('ÇÔÀÒ¤',1877,1877),('ÇÒÃÔª',1848,1848),('ÇÔÀÒ¾Ãó',1878,1878),('ÇÔÀÙÉÔµ',1882,1882),('ÇÔÁÅ',1883,1883),('ÇÔÁÅÇÃó',1885,1885),('ÇÔÁžÃ',1884,1884),('ÇÔàªÉ°',1863,1863),('ÇÕêÑÂ',1920,1920),('ÇÔàªÕÂÃ',1864,1864),('ÇÕþÅ',1924,1924),('ÇÕþ§Èì',1923,1923),('ÇÒÃسÕ',1850,1850),('ÇÔÇ',1901,1901),('ÇÔÇÃø¹ì',1902,1902),('ÇÔÇѲ¹ì',1903,1903),('ÇÔÇѲ¹ìªÑÂ',1904,1904),('ÇÔÉÃب¹ì',1910,1910),('ÇÔÈÃص',1906,1906),('ÇÔÈÔÉ®ì',1908,1908),('ÇÔÈÔÉ°ì',1909,1909),('ÇÔÈÒÅ',1907,1907),('ÇÔÊÔ°ÈÑ¡´Ôì',1911,1911),('ÇÔÊÔ·¸Ôì',1912,1912),('ÇÔÊÙµ',1915,1915),('ÇÒʹÒ',1851,1851),('ÇÔȹÕ',1905,1905),('ÇÔÊØ·¸Ô',1914,1913),('ÇÔÊØ·¸Ôì',1913,1914),('ÇÔÅÇѳÂì',1890,1890),('ÇÔÅÒÇÃó',1891,1891),('ÇÔÅÒÇÑÅÂì',1893,1893),('ÇÔÅÒÇѳÂì',1892,1892),('ÇÔÅÒÊÔ¹Õ',1894,1894),('ÇÔÅÔµ',1895,1895),('ÇÔäÅ',1896,1896),('ÇÔäÅÃѵ¹ì',1898,1898),('ÇÔäÅÇÃó',1900,1900),('ÇÔäÅÅѡɳì',1899,1899),('ÇÔäžÃ',1897,1897),('ÇÔ¤Á',1853,1853),('ÇÔ¤µÍÃÕè â¾Ãà¡Ã·',1852,1852),('ÇÔ¨ÔÃÒ',1856,1856),('ÇÔ¨Òóì',1854,1854),('ÇÔ¨ÔµÃ',1855,1855),('ÇÔªÑÂ',1859,1859),('ÇÔªÒ­',1860,1860),('ÇÔªÔµ',1861,1861),('ÇÔªªÒ',1857,1857),('ÇÔª­ÐÃب',1858,1858),('ÇԪشÒ',1862,1862),('ÇÕ«èÒ (2000)',1917,1917),('ÇÔ­­Ø´Ò',1865,1865),('ÇÔ±ÙÅÂì',1866,1866),('ÇÒ³Õ',1844,1844),('ÇÕ³Ò',1918,1918),('ÇÔ·ÂÒ',1868,1868),('ÇÔ·ÇÑÊ',1869,1869),('ÇÒ·Ôµ',1845,1845),('ÇÒ·Ô¹',1846,1846),('ÇÒ·Ô¹ÕÂì',1847,1847),('ÇÔ·ÙÃ',1870,1870),('ÇÔ·¸ÇѪ',1867,1867),('ÇÔ¹ÊÃäì',1871,1871),('ÇÔ¹ÑÂ',1872,1872),('ÇÕ¹ÑÊ',1919,1919),('ÇÔ¹Ô¨',1873,1873),('ÇÔºÙÅÂì',1874,1874),('ÇÅѾÃ',1814,1814),('ǧà´×͹',1745,1745),('ǧÈìÇÒµ',1749,1749),('ǧÈìÊØÀÒ',1750,1750),('ǧÈìä¾±ÙÃÂì¡Ãç» º',1746,1746),('ǧÈìä¾±ÙÃÂì¡ÃÙê»',1748,1748),('ǧÈìä¾±ÙÃÂì¡ÃØê»',1747,1747),('ǨÕÃѵ¹ì',1751,1751),('ǪÔÃÒÀÒ',1752,1752),('ǹÑʹѹ·ì',1754,1754),('ǹѪ¾Ã',1753,1753),('ǹÒ',1755,1755),('ǹԪ',1756,1756),('ǹԴÒ',1757,1757),('ÇزÔÃѵ¹ì',1948,1948),('ÇزԡÃ',1941,1941),('ÇزԪÑÂ',1942,1942),('ÇزԹÑÂ',1944,1944),('ÇزԹѹ·ì',1943,1943),('ÇزԾÅ',1947,1947),('ÇزԾ§Èì',1945,1945),('ÇزԾ¨¹ì',1946,1946),('Ê ÍÒ´',2054,2054),('Ê.͹ѹµìàÍ繨Ôà¹ÕÂÃÔè§ á͹¤Í¹ÊµÃѤªÑè¹',2055,2055),('ÊÁ',2078,2078),('ÊÁÃ',2113,2113),('ÊÃÃàÊÃÔ°­',2142,2142),('ÊÁâÀª¹ì',2108,2108),('ÊÁâÁ·',2111,2111),('ÊÁÂÈ',2112,2112),('ÊÁÃÑ¡Éì',2114,2114),('ÊÁÁÒö',2109,2109),('ÊÁÁÒȹì',2110,2110),('ÊÁà¡ÕÂõÔ',2080,2080),('ÊÁã¨',2088,2088),('ÊÁ⪤',2093,2093),('ÊÁà´ª',2095,2095),('ÊÁÀ¾',2107,2107),('ÈÃÇÑÅÂì',1959,1959),('ÊÁǧÉì',2119,2119),('ÊÁÈÃÕ',2120,2120),('ÊÁËÁÒÂ',2126,2126),('ÊÁËÇѧ',2127,2127),('ÊÁÈÑ¡´Ôì',2121,2121),('ÊÁÈÔÃÔ',2122,2122),('ÊÁË­Ô§',2125,2125),('ÊÁÊØ¢',2123,2123),('ÊÁÊعÕÂì',2124,2124),('ÊÁÑÂ',2128,2128),('ÈÃÑ­­Ò',1960,1960),('ÊÃÑ­­Ò',2143,2143),('ÈÃѳÂì',1962,1962),('ÈÃѳ¾Ã',1961,1961),('ÊÂÒÁ',2133,2133),('ÊÂÒÁàÁ¦Õâ¾ÅÕàÁÍÃì',2139,2139),('ÊÂÒÁÂÙ¹Ôâ«Å',2140,2140),('ÈÃÕÃѵ¹ì',1977,1977),('ÈÃÕÀÒ',1976,1976),('ÈÃÒÁÒÈ',1963,1963),('ÈÂÒÁÅ',1957,1957),('ÊÂÒÁä´à¤ÕÂÇ',2136,2136),('ÊÂÒÁ¤Í¹àÇàÂÍÃì',2134,2134),('ÊÂÒÁªÑÂâ¾ÅÕàÁÍÃì',2135,2135),('ÊÂÒÁ¹ÔÊÊѹ ÍÍâµéâÁºÔÅ',2137,2137),('ÊÂÒÁ¾Ãà·Ã´à«ç¹àµÍÃì',2138,2138),('ÈÃÕà¾ç­',1975,1975),('ÊÃÒÂظ',2146,2146),('ÈÃÕÇѨ¹Ò',1978,1978),('ÈÃÕÇѲ¹Ò',1979,1979),('ÈÃÕÇÔ¡Ò',1980,1980),('ÈÃÒÇزÔ',1964,1964),('ÊÃÒÇزÔ',2147,2147),('ÈÃÒÇظ',1965,1965),('ÊÃÒÇظ',2148,2148),('ÈÃÕÊÁÃ\nÈÃÕÊÁÃ',1984,1983),('ÈÃÕÊÁÃ',1983,1984),('ÈÃÕÈÑ¡´Ôì',1981,1981),('ÈÃÕÊ¡ØÅ',1982,1982),('ÈÃÕÊØÇÃó¤Í¹àÇàÂÍÃìàºÅ·ì á͹´ì ÃѺàºÍÃì',1985,1985),('ÈÃÕÍÓ¾ÅÍصÊÒË¡ÃÃÁ',1987,1987),('ÈÃÕ͹§¤ì',1986,1986),('ÊÃÒ¡Ã',2144,2144),('ÈÃըѹ·Ãì',1967,1967),('ÈÃըѹ·ÃÒ',1968,1968),('ÊÃÒ­¨Ôµ',2145,2145),('ÈÃշͧà¹Áà¾Å·',1969,1969),('ÈÃշͧÍصÊÒË¡ÃÃÁ«Ñ¾¾ÅÒÂ',1970,1970),('ÊÁÔ·¸Ô',2131,2130),('ÊÁÔ·¸Ôì',2130,2131),('ÊÁÒ¹',2129,2129),('ËÃÔ¹',2446,2446),('ÊÃÔ¹ÃÒ',2149,2149),('ÈÃÕ¹ÇÅ',1971,1971),('ÈÃÔ¹·Ãì',1966,1966),('ÈÃÕ»ÃÐÀÒ',1973,1973),('ÈÃÕ»ÃÐä¾',1972,1972),('ÈÃÕ¾§Éì',1974,1974),('ÈÁÅÇÃó',1956,1956),('ÊÁÅѡɳì',2118,2118),('ÊàŤ·ì¿ÍÃìÁà¿ÍÃì¹Ôà¨ÍÃìáÅкصÃ',2152,2152),('ÊÁÄ´Õ',2115,2115),('ÊÁÄ·ÑÂ',2117,2117),('ÊÁÄ·¸Ôì',2116,2116),('ÊÁ¡ÁÅ',2079,2079),('ÊÁ¤ÇÃ',2081,2081),('ÊÁ¤Ô´',2082,2082),('ÊÁ¨Ôµ',2083,2083),('ÊÁ¨ÔµÃ',2086,2085),('ÊÁ¨ÔµÃì',2085,2086),('ÊÁ¨Ôµµì',2084,2084),('ÊÁ¨Ô¹µ¹Ò',2087,2087),('ÈêÑÂ',1958,1958),('ÊÁªÑÂ',2089,2089),('ÊÁªÒÂ',2092,2092),('ÊÁªÒ­',2090,2090),('ÊÁªÒµÔ',2091,2091),('ÊÁ´Õ',2094,2094),('Êáµ¹´ÒÃì´ ªÒÃìàµÍÃì (»ÃÐà·Èä·Â)',2066,2066),('ÊÁ·Ã§',2096,2096),('ÊÁ¹Ö¡',2097,2097),('ÊÁºÑµÔ',2098,2098),('ÊÁºÙóì',2100,2100),('ÊÁºØ­',2099,2099),('Êà»ç¤ à´ç¹ µÑÅ áź',2076,2076),('ÊÁ»Í§',2101,2101),('Ê໫¤ÍÁ',2077,2077),('ÊÁ¾Ã',2104,2104),('ÊÁ¾ÔÈ',2106,2106),('ÊÁ¾Å',2105,2105),('ÊÁ¾§Éì',2102,2102),('ÊÁ¾¨¹ì',2103,2103),('ÊÂØÁ¾Ã',2141,2141),('ÊÃب',2150,2150),('ÊÁتªÅ',2132,2132),('ÊÇÑÊ´Ôì',2154,2154),('ÊÇÕâè¹ì',2155,2155),('ÊÇÕÇÃó',2156,2156),('ËÇÒ¹',2448,2448),('ÊÇÅѡɳì',2153,2153),('Êзé͹',2161,2161),('ÈÈÁÅ',1989,1989),('ÊËà¡ÕÂõÔâÅËÐà¡ÕÂõÔ',2158,2158),('ÈÈÔ',1990,1990),('ÈÈÔÀÒ',1993,1993),('ÈÈÔÁÒ',1994,1994),('ÈÈÔÇÔÁÅ',1995,1995),('ÈÈÔÉÒ',1996,1996),('ÈÈÔ¸Ã',1991,1991),('ÈÈÔ¾Ã',1992,1992),('ÊÊԾѹ¸Øì',2157,2157),('Êè§àÊÃÔÁ',2062,2062),('Êè§ÈÃÕ',2061,2061),('Ê˾Å',2159,2159),('ËÍÁ¨Ñ¹·Ãì',2449,2449),('ÊÍÒ´',2160,2160),('ÊÑÁÄ·¸Ôì',2170,2170),('ÊÑÁ¾Ñ¹¸ì',2169,2169),('ËÑÊÂÒ',2451,2451),('ËÑʹÕ',2450,2450),('ÈÑ¡ÃÔ¹·Ãì',2003,2003),('ÈÑ¡´Ò',1997,1997),('ÈÑ¡´Ôì',1998,1998),('ÈÑ¡´ÔìàªÇ§',2000,2000),('ÈÑ¡´ÔìÇÔºÙÅÂì',2002,2002),('ÈÑ¡´ÔìªÑÂ',1999,1999),('ÈÑ¡´Ôì´Ò',2001,2001),('ÊѧÇÒÅÂì',2162,2162),('ÊѨ¾§Éì',2163,2163),('ÊÑ­ªÑÂ',2165,2165),('ÊÑ­ª¹Ò',2164,2164),('ÊÑ­­Ò',2166,2166),('ÈѹʹÕÂì',2004,2004),('ÊѹµÔ',2167,2167),('ÊѹµÔªÑÂ',2168,2168),('ÊÒÂã¨',2176,2176),('ÈÔâè¹ì',2030,2030),('ÊÒâè¹ì',2188,2188),('ÊÔâè¹ì',2228,2228),('ÊÒâê',2189,2189),('ÊÒ¹µì',2181,2181),('ÊÒÁÀ¾',2174,2174),('ÊÓÃÇÁ',2195,2195),('ÊÓÃÇÂ',2196,2196),('ÊÒÂÊÁÃ',2183,2183),('ÈÔÃÉÒ',2007,2007),('ÊÒÂÊسÕ',2184,2184),('ÊÒÂÊعÕÂì',2185,2185),('ÊÒÂѳ',2186,2186),('ÊÒÂѳËì',2187,2187),('ÈÔÃÔ',2009,2009),('ÈÔÃÔÃѨ¹ì',2024,2024),('ÈÔÃÔÃѵ¹ì',2025,2025),('ÊÔÃÔÃѵ¹ì',2223,2223),('ÈÔÁÒÃÕ',2006,2006),('ÈÔÃÔÁÒ',2023,2023),('ÊÔÃÔÁÒ',2222,2222),('ÈÔÃÔâ©Á',2012,2012),('ÊÔÃÔà´ª',2214,2214),('ÊÒÁÒö',2175,2175),('ÈÔÃÔà¾ç­',2022,2022),('ÈÔÃÔÇÃó',2027,2027),('ÊÔÃÔÇÃó',2225,2225),('ÊÔÃÔÇѲ¡ì',2226,2226),('ÈÔÃÔÇѲ¹ì',2028,2028),('ÊÔÃÔÇѲ¹Ò',2227,2227),('ÈÔÃÔÈÑ¡´Ôì',2029,2029),('ÈÔÃÔÅѡɳì',2026,2026),('ÊÔÃÔÅѡɳì',2224,2224),('ÈÔÃÔ¡ØÅ',2010,2010),('ÈÔÃԨѹ·Ãì',2011,2011),('ÈÔÃÔªÑÂ',2013,2013),('ÊÔÃÔªÑÂ',2213,2213),('ÊÓÃÒ­',2197,2197),('ÈÔÃÔ·Ñȹì',2014,2014),('ÈÔÃÔ¸Ã',2015,2015),('ÊÔÃÔ¹Ãѵ¹ì',2216,2216),('ÈÔÃÔ¹Òö',2017,2017),('ÈÔÃÔ¹­Ò',2016,2016),('ÊÔÃÔ¹¾Ã',2215,2215),('ÈÔÃԹت',2018,2018),('ÊÔÃÔ»ÃÐÀÒ',2217,2217),('ÈÔÃÒ¾Ã',2008,2008),('ÈÔÃÔ¾Ã',2020,2020),('ÊÔÃÔ¾Ã',2219,2219),('ÈÔÃÔ¾Ãó',2021,2021),('ÊÔÃÔ¾Ãó',2220,2220),('ÊÔÃԾѹ¸ì',2221,2221),('ÈÔÃÔ¾§Éì',2019,2019),('ÊÔÃÔ¾§Éì',2218,2218),('ÊÒÂÅÁ',2182,2182),('ÊÒÂä¿¿éÒä·Â-ÂÒ«Ò¡Ô',2180,2180),('ÊÒªÅ',2177,2177),('ÊÓà¹Õ§',2194,2194),('ÊÒ¹·Õ',2178,2178),('ÊÒ½¹',2179,2179),('ÈÔÇÒÀóì',2036,2036),('ÊÕÇÔ¡Ò',2231,2231),('ÊÒÇÔµÃÕ',2192,2192),('ÈÔÇÒ¾Ã',2035,2035),('ÊÔÇÅÕ',2229,2229),('ÈÔǾÃ',2033,2033),('ÈÔǾÅ',2034,2034),('ÈÔÅÒ',2032,2032),('ÊÒÅÕ',2190,2190),('ÊÓÅÕ',2199,2199),('ÊÒÅÕè',2191,2191),('ÈÔÅ»ªÑÂ',2031,2031),('ÊÓÄ·¸Ôì',2198,2198),('ÊÒ¤Ã',2171,2171),('ÊÔ§Ëì',2200,2200),('ÊÔ§Ëì¾Å',2201,2201),('ÊÔ§ËÒ',2202,2202),('ÊԵҹѹ',2203,2203),('ÊÔµÒ¾Ã',2204,2204),('ÊÔ·¸Ò',2205,2205),('ÊÔ·¸Ôà´ª',2208,2208),('ÊÔ·¸Ôì',2206,2206),('ÊÔ·¸ÔªÑÂ',2207,2207),('ÊÔ·¸Ô¾Ã',2209,2209),('ÊÔ·¸Ô¾Ãó',2210,2210),('ÊÔ·¸Ô¾Å',2211,2211),('ÊÒ¸Ôµ',2172,2172),('ÊÕ¹ÇÅ',2230,2230),('Êӹѡ¹âºÒÂáÅÐá¼¹¡Ãا෾ÁËÒ¹¤Ã',2193,2193),('ÊÒ¹ÔµÂì',2173,2173),('ÈÒ¹µÔᏴì',2005,2005),('ÊÔ¹·ÇÕ',2212,2212),('ÊÅÑ¡¨ÔµÃ',2151,2151),('ÈÅÔÉÒ',1988,1988),('ËÄ·Â',2447,2447),('Ê¡ÒÇÃѵ¹ì',2057,2057),('Ê¡ÅÃѵ¹ì',2056,2056),('È¡ÅÇÃó',1954,1954),('˧',2441,2441),('ʧǹ',2060,2060),('ʧèÒ',2064,2064),('ʧѴ',2063,2063),('ʧ¡ÃÒ¹µì',2059,2059),('ʧ¡Ã³ì',2058,2058),('ȨÕ',1955,1955),('ʴѺ¾Ô³',2065,2065),('ʶÔÃÂÒ',2068,2068),('ʶҾÃ',2067,2067),('Ë·ÑÂ',2442,2442),('Ë·ÑÂÃѵ¹ì',2444,2444),('Ë·Ñ·ԾÂì',2443,2443),('ʹã¨',2069,2069),('ʹͧ',2073,2073),('ʹÑè¹',2074,2074),('ʹԴÒ',2075,2075),('˹Öè§Ä·ÑÂ',2445,2445),('ʹ·ÂÒ',2070,2070),('ʹ¸ÂÒ',2072,2072),('ʹ¸¾',2071,2071),('ÈØÀÃ',2042,2042),('ÈØÀÃѵ¹ì',2043,2043),('ÈØÀÃÒÀóì',2044,2044),('ÊØÀÁÒÊ',2329,2329),('ÈØÀÁÔµÃ',2041,2041),('ÊØÃàªÉ°ì',2353,2353),('ÊØÀ⪤',2328,2328),('ÊØÃà´ª',2354,2354),('ÊØàÁ¸',2348,2348),('ÊØàÁ¸Õ¡ì',2349,2349),('ÉØÀÁ¹',2053,2053),('ÈØÀÇѲ¹ì',2046,2046),('ÈØÀÇÔ·Âì',2047,2047),('ÈØÀÈÑ¡´Ôì',2048,2048),('ÊØÃÈÑ¡´Ôì',2360,2360),('ÊØÃÊÔ·¸Ôì',2361,2361),('ÊØÀѤ',2330,2330),('ÊØÃѪ¹Õ¡Ã',2362,2362),('ÊØÀѵÃÒ',2331,2331),('ÊØÃѵÂÒ',2367,2367),('ÊØÃѵ¹Ç´Õ',2365,2364),('ÊØÃѵ¹ì',2363,2363),('ÊØÃѵ¹ìÇ´Õ',2364,2365),('ÊØÃѵ¹Ò',2366,2366),('ÊØÀÑ·ÃÒ',2332,2332),('ÊØÀÒ',2333,2333),('ÊØÀÒÀóì',2338,2338),('ÊØÃÕÂì',2381,2381),('ÊØÃÕÂì¾Ã',2382,2382),('ÊØÃÕÃѵ¹ì',2383,2383),('ÊØÃÔÂѹ',2375,2375),('ÊØÃÔÂѹµì',2376,2376),('ÊØÃÔÂÒ',2377,2377),('ÊØÃÕÁÒÈ',2380,2380),('ÊØÃÔ§Èì',2371,2371),('ÊØÀÒôÕ',2339,2339),('ÊØÃÔ¹',2372,2372),('ÊØÃÔ¹µì',2373,2373),('ÊØÃÔ¾§Èì',2374,2374),('ÊØÀÒÇ´Õ',2340,2340),('ÈØÀÔÊÃÒ',2049,2049),('ÊØÁÒÊÕ',2345,2345),('ÊØÁÒÅÕ',2344,2344),('ÊØÃÒ§¤¹Ò',2368,2368),('ÊØÃÔªÑÂ',2369,2369),('ÊØÀÔ­­Ò',2341,2341),('ÊØÀÒ³Õ',2334,2334),('ÊØÁÔµÃ',2346,2346),('ÊØÁÔµÃÒ',2347,2347),('ÊØÃÕ¸Ò¾Ã',2378,2378),('ÊØÃÔ¹·Ãì',2370,2370),('ÊØÀÒ¾',2335,2335),('ÊØÀÒ¾Ã',2336,2336),('ÊØÃÕ¾Ã',2379,2379),('ÊØÀÒ¾Ãó',2337,2337),('ÈØÀÅѡɳì',2045,2045),('ÈØÀ¡Ã',2037,2037),('ÈØÀ¡Ô¨',2038,2038),('ÊØÀ¡Ô¨',2326,2326),('ÊØáԨ',2350,2350),('ÈØÀªÑÂ',2039,2039),('ÊØêÑÂ',2351,2351),('ÊØÀªÒ',2327,2327),('ÊØêҵÔ',2352,2352),('ÊØ÷Թ',2355,2355),('ÊØà·¾',2289,2289),('ÊØÁ¹Ò',2343,2343),('ÊØ๵Ã',2307,2307),('ÊØÁ¹µì',2342,2342),('ÈØÀ¾Ã',2040,2040),('ÊØþѹ¸ì',2358,2358),('ÊØþѹ¸Øì',2359,2359),('ÊØþÅ',2357,2357),('ÊØþ§Éì',2356,2356),('ÊØÇÃó',2386,2386),('ÊØÇÃóÒ',2388,2388),('ÊØÇÃóÕ',2389,2389),('ÊØÇÃóÕÂì',2390,2390),('ÊØÇÃóªÑÂ',2387,2387),('ÊØÇÃѵ¹ì',2391,2391),('ÊØÇÀÑ·Ãì',2385,2385),('ÊØÇѲ¹ì',2392,2392),('ÊØÇѲ¹ìªÑÂ',2393,2393),('ÊØÇѲ¹Ò',2394,2394),('ÊØÇѵªÑÂ',2395,2395),('ÊØÇÔÃѪ',2402,2402),('ÊØÇÒÃÕ',2396,2396),('ÊØÇÔÁÅ',2401,2401),('ÊØÇÔªÑÂ',2397,2397),('ÊØÇÔªÒ',2398,2398),('ÊØÇÔ´Ò',2399,2399),('ÊØÇÔ·Âì',2400,2400),('ÊØËÑʪÒ',2404,2404),('ÊØÊÔÃÔ',2403,2403),('ÊØÅÑ´´Ò',2384,2384),('ÊØ¡ÃÕ',2232,2232),('ÊØ¡Ñ­­Ò',2233,2233),('ÊØ¡Ô¨',2235,2235),('ÊØ¡ÔµÔì',2236,2236),('ÊØ¡ÕµÔì',2237,2237),('ÊØ¡Ò¹´Ò',2234,2234),('ÊØ¡ØÁÒ',2238,2238),('ÊØ¢',2239,2239),('ÊØ¢ÊÇÑÊ´Ôì¡Å¡ÒÃ',2242,2242),('ÊØ¢Êѹµì',2243,2243),('ÊآĴÕ',2241,2241),('ÊØ¢ªÒÂ',2240,2240),('ÊØ¢ØÁ',2244,2244),('Êؤ¹¸ì',2245,2245),('Êؤ¹¸Ò',2246,2246),('ÊبÒÃÕ',2247,2247),('ÊبԵ',2248,2248),('ÊبԵÃÒ',2250,2250),('ÊبԵµÒ',2249,2249),('ÊبԹ´Ò',2251,2251),('ÊبԹµì',2252,2252),('ÊبԹµ¹ì',2253,2253),('ÊتÑÂ',2255,2255),('ÊتÒÂ',2258,2258),('ÊتÒÊÔ¹Õ',2259,2259),('ÊتҴÒ',2256,2256),('ÊتԵ',2260,2260),('ÊتҵÔ',2257,2257),('ÊتԹ',2261,2261),('ÊتÅ',2254,2254),('ÊرÒÁÒÈ',2262,2262),('ÊسÕ',2263,2263),('ÊØ´ÊÇÒ·',2265,2265),('Êشʧǹ',2264,2264),('ÊØ´Ò',2266,2266),('ÊØ´ÒÃѵ¹ì',2270,2270),('ÊØ´ÒÀÒ',2269,2269),('ÊØ´ÒÃÒ',2271,2271),('ÊØ´Õà¾é¹·ìà«ç¹àµÍÃì',2272,2272),('ÊØ´ÒªÅÕ',2267,2267),('ÊØ´Ò¾Ã',2268,2268),('ÊØ·ÃÕ',2282,2282),('ÊØ·ÑÈ',2283,2283),('ÊØ·Ñȹì',2284,2284),('ÊØ·ÔÈÒ',2288,2288),('ÊØ·ÔµÂì',2285,2285),('ÊØ·Ô¹',2286,2286),('ÊØ·Ô¾Ò',2287,2287),('ÊØ·¸ÔÇѲ¹ì',2280,2280),('ÊØ·¸ÔÈÑ¡´Ôì',2281,2281),('ÊØ·¸Ô쾧Éì',2278,2278),('ÊØ·¸Ô¡Ò¨',2274,2274),('ÊØ·¸ÔªÑÂ',2275,2275),('ÊØ·¸Ò·Ô¾Âì',2273,2273),('ÊØ·¸Ô¹Ñ¹·ì',2276,2276),('ÊØ·¸Ô¹Õ',2277,2277),('ÊØ·¸Ô¾Ãó',2279,2279),('ÊظÕ',2294,2294),('ÊظÕÃì',2295,2295),('ÊظÕÃÒ',2296,2296),('ÊظÔÈÑ¡´Ôì',2293,2293),('ÊظԴÒ',2292,2292),('ÊظҷԾÂì',2290,2290),('ÊظҹԸÔ',2291,2291),('Êعѷ·Õ',2299,2299),('Êعѹ·ì',2300,2300),('Êعѹ·Ò',2301,2301),('ÊعÕÂì',2306,2306),('ÊعÔÈÒ',2303,2303),('ÊعÔÉÒ',2304,2304),('ÊعÔÊÒ',2305,2305),('ÊعԵÒ',2302,2302),('Êع·Ã',2297,2297),('Êع·ÃÕ',2298,2298),('ÊØ»ÃÐÇÕ³ì',2309,2309),('ÊØ»ÃдÔÉ°ì',2308,2308),('ÊØ»ÃÕÃдÒ',2312,2312),('ÊØ»ÃÕÂÒ',2311,2311),('ÊØ»ÃÒ³Õ',2310,2310),('Êػѭ­Ò',2313,2313),('ÊؾÃ',2316,2316),('ÊؾÃÃÉÒ',2318,2318),('ÊؾÃóÕ',2317,2317),('ÊؾѲ¹ì',2320,2320),('ÊؾѵÃÒ',2321,2321),('ÊؾÕÃìªÑÂ',2325,2325),('ÊؾÔÈ',2324,2324),('ÊؾԪ­ìª­Ò',2322,2322),('ÊؾԹ',2323,2323),('ÊؾÅ',2319,2319),('Êؾ¨ÁÒÅÂì',2315,2315),('Êؾ¨¹ì',2314,2314),('GEORGE',21,21),('Í.à¨ÃÔ­ÎÒÃì´áÇÃì',2457,2457),('ÍÁÃÃѵ¹ì',2515,2515),('ÍÁÃà·¾',2514,2514),('ÍÁÃÈÑ¡´Ôì',2516,2516),('ÍÁÃÊÔÃÔ',2517,2517),('ÍÃÀÑ·Ãì',2534,2534),('ÍÁÃÒÅѡɳì',2518,2518),('ÍÃæÂì',2535,2535),('ÍÁêÑÂ',2513,2513),('ÍÃó¾',2536,2536),('ÍÃöÊÔ·¸Ôì',2540,2540),('ÍÃö¾Ã',2538,2538),('ÍÃö¾Å',2539,2539),('ÍÃö¾¹¸ì',2537,2537),('ÍÃ๵Ã',2530,2530),('ÍÃÇÃó',2542,2542),('ÍÃÇÔ· ÍÔ¹àµÍÃì๪Ñè¹á¹Å',2543,2543),('ÍÃÈÁ',2544,2544),('ÍÃÈÃÕ',2545,2545),('ÍÃÊÒ',2546,2546),('ÍÃèÒÁÈÃÕ',2551,2551),('ÍÃ͹§¤ì',2547,2547),('ÍÃÍØÁÒ',2548,2548),('ÍÃÑ­',2549,2549),('ÍÃÑ­­Ò',2550,2550),('ÍÀѹµÃÕÊì',2496,2496),('ÍÀÔÃÑ¡Éì',2507,2507),('ÍÃÔÂÒ',2555,2555),('ÍÃÔÂÒÀóì',2556,2556),('ÍÀÔÀÒ´Ò',2505,2505),('ÍÀÔવ',2501,2501),('ÍÀÔôÕ',2506,2506),('ÍÀÔà´ª',2503,2503),('ÍÀÔÇѲ¹ì',2508,2508),('ÍÀÔÇѹ·ì',2509,2509),('ÍÀÔÊÃ',2511,2511),('ÍÃÔÈÃÒ',2557,2557),('ÍÃÔÊÃÒ',2558,2558),('ÍÀÔÈÑ¡´Ôì',2510,2510),('ÍÃÔÊÒ',2559,2559),('ÍÀÔÊÔ·¸Ôì',2512,2512),('ÍÀÔªÑÂ',2497,2497),('ÍÃÔªÑÂ',2552,2552),('ÍÀÔªÒ µÔ',2498,2498),('ÍÀÔªÒµ',2499,2499),('ÍÀÔªÒµÔ',2500,2500),('ÍÀÔ­­Ò',2502,2502),('ÍÁÔµÒ',2519,2519),('ÍÀԹѹ·ì',2504,2504),('ÍÃÔ¹ª¹Ò',2553,2553),('ÍÁÔ¹µÒ',2520,2520),('ÍÃÔ¹·ÁÒ',2554,2554),('ÍÃÄ´Õ',2541,2541),('ÍèÔÃÒ',2522,2522),('ÍêÃ',2523,2523),('ÍêسËì',2524,2524),('Íóѭªì',2525,2525),('Íâ³·ÂÒ',2459,2459),('Í÷ÑÂ',2526,2526),('Í÷ԪÒ',2527,2527),('ÍùԵÂì',2528,2528),('Í⹪Ò',2495,2495),('Íùت',2529,2529),('ÍþÃó',2531,2531),('ÍþԹ',2532,2532),('ÍþԹ·Ãì',2533,2533),('ÍÃس',2560,2560),('ÍÃسÃѵ¹ì',2561,2561),('ÍÃسÃØè§',2562,2562),('ÍÃسÈÃÕ',2563,2563),('ÍÃسÕ',2564,2564),('ÍÂظÂѹ',2521,2521),('ÍǪÑÂ',2567,2567),('ÍÐÅÒ¹',2574,2574),('ÍФÙà·ç¤·ì',2573,2573),('ÍéÍ·ԾÂì',2571,2571),('ÍéÒÂÍÔé§',2612,2612),('ÍÍâµàÁªÑè¹à«ÍÃìÇÔÊ',2570,2570),('ÍÍÊ·ì ÍÍÂÊì',2572,2572),('ÎÍÊ·ì ÍÍÂÅì',2723,2723),('ÍͤµéÒ àÁÁâÁàÃÕÂÅ',2568,2568),('ÍͤµéÒàÁÁâÁàÃÕÂÅ',2569,2569),('ÍÑÁä¾ÇÃó',2594,2594),('ÍÑÁ¾Ã',2592,2592),('ÍÑÁ¾Ãó',2593,2593),('ÍѤÃà´ª',2575,2575),('ÍѤÃÇÔ·Âì',2578,2578),('ÍѤÃÇÔ¹·ì',2579,2579),('ÍѤÃÒ',2580,2580),('ÍѤþѨ¹ì',2577,2577),('ÍѤþ¹¸ì',2576,2576),('ÍѧʹÒ',2581,2581),('ÍѨ©ÃÒ',2582,2582),('ÍѪÂÒ',2583,2583),('ÍÑ­ªÅÕ',2587,2587),('ÍÑ­ª³Ò¾Ã',2584,2584),('ÍÑ­ª´Ò',2585,2585),('ÍÑ­ª¹Ò',2586,2586),('ÍÑ­ªØÅÕ',2588,2588),('ÍÑ®ÉÁÒ',2589,2589),('ÍѹÊÃÕÂì',2590,2590),('ÍÑ»ÊÃ',2591,2591),('ÍÒÃÂѹ',2616,2616),('ÍÒÃÂÒ',2617,2617),('ÍÔÁâ¡éá¾ç¤ ¤ÍÃì»ÍÃìàêÑè¹',2641,2641),('ÍÒÀóì',2606,2606),('ÍÒÃÁ³ì',2615,2615),('ÍÒÃì«Õ ¹ÔµáÇÃì',2613,2613),('ÍÒÃì«Ø»à»ÍÃì⫹Ԥ¾Ô¤ÍѾÊì',2614,2614),('ÍÒÃÑ¡Éì',2618,2618),('ÍÒÀÒ',2607,2607),('ÍÒÃÕ',2621,2621),('ÍÓÀÒ',2633,2633),('ÍÒÀÒÀóì',2611,2611),('ÍÒÃÕÂì',2622,2622),('ÍÒÃÕÂì àÊÁÒ©ÔÁ (ä·Âູ¡Ñ¹',2623,2623),('ÍÒÃÕÃѵ¹ì',2624,2624),('ÍÒÃÔÂÒ',2620,2620),('ÍÒÃÕÇÃó',2625,2625),('ÍÒÀÒ¡Ã',2608,2608),('ÍÒÀÒ³Õ',2609,2609),('ÍÒÀÒ¾Ã',2610,2610),('ÍÒÃÒ¾Ã',2619,2619),('ÍÔÈÃÒ',2642,2642),('ÍÔê¡«èÒ ÍÔ¹àµÍÃì๪Ñè¹á¹Åਹà¹ÃÑÅ à«ÅÅì',2634,2634),('ÍÓä¾',2632,2632),('ÍÒ¤Á',2595,2595),('Íԧ˷ÑÂ',2635,2635),('ÍÒ¨³Ã§¤ì',2596,2596),('ÍÒ«ÒÎÕ-ä·Â ÍÑÅÅÍÂ',2597,2597),('ÍҳѹÂì',2598,2598),('ÍÒ·Ô¡Ã',2599,2599),('ÍÕ·Õ«Õ',2643,2643),('ÍÒ·Ôµ',2600,2600),('ÍÔ·¸Ô¾Å',2636,2636),('ÍÔ¹àµÍÃìàÇç·(»ÃÐà·Èä·Â)',2638,2638),('ÍÓ¹ÇÂ',2626,2626),('ÍҹѴ',2603,2603),('ÍҹѹµÂÒ',2604,2604),('ÍÓ¹Ò¨',2627,2627),('ÍԹ䫷ìà¤Á',2637,2637),('ÍÔ¹·ÔÃÒ',2639,2639),('ÍÒ¹¹·ì',2601,2601),('ÍÒ¹¾',2602,2602),('ÍÒ¹ØÀÒ¾',2605,2605),('ÍÔ¾',2640,2640),('ÍÓ¾Ã',2628,2628),('ÍÓ¾Ãó',2629,2629),('ÍӾѹ¸ì',2631,2631),('ÍÓ¾Å',2630,2630),('ÎÙàÇÍÃìÍصÊÒË¡ÃÃÁ(»ÃÐà·Èä·Â)',2724,2724),('Íŧ¡Ã³ì',2566,2566),('Íŧ¡µ',2565,2565),('ͧÍÒ¨',2458,2458),('Í´Ôàá',2460,2460),('Í´ÔÈÃ',2461,2461),('Í´ÔÈÑ¡´Ôì',2462,2462),('Í´ØÅ',2463,2463),('Í´ØÅÂìà´ª',2465,2465),('Í´ØžѲ¹ì',2464,2464),('͵Թت',2466,2466),('͵ԾÃ',2467,2467),('ͶԪÒ',2468,2468),('͸Ի¾Å',2469,2469),('͹ÇѪ',2473,2473),('͹ѭ­Ò',2474,2474),('͹ѹµÈÑ¡´Ôì',2476,2476),('͹ѹµì',2475,2475),('͹§¤ìÇÃó',2471,2471),('͹§¤ì¹Ò®',2470,2470),('͹¹·ì',2472,2472),('͹ØÃÑÉì',2491,2491),('͹ØÃÑ¡Éì',2489,2489),('͹ØÃѵ¹ì',2490,2490),('͹ØÇѲ¹ì',2492,2492),('͹ØÊóì',2494,2494),('͹ØÈÑ¡´Ôì',2493,2493),('͹ءԵÔ',2477,2477),('͹ءÙÅ',2478,2478),('͹تÒ',2479,2479),('͹تԵ',2480,2480),('͹شÒ',2481,2481),('͹صÃ',2483,2483),('͹صµÃÒ',2482,2482),('͹طԵÒ',2484,2484),('͹ؾÃ',2487,2487),('͹ؾѹ¸ì',2488,2488),('͹ؾ§Èì',2485,2485),('͹ؾ§Éì',2486,2486),('ÍØÁÒ',2665,2665),('ÍØÃÕÂì',2667,2667),('ÍØÁÒ¾Ã',2666,2666),('ÍØà·¹·Ãì',2660,2660),('ÍØÉÒ',2673,2673),('ÍØÊÒËì',2674,2674),('ÍØè§á¤Ð',2644,2644),('ÍØɳÕ',2672,2672),('ÍØè¹ã¨',2661,2661),('ÍØÌÒÃ',2675,2675),('ÍØäÃ',2668,2668),('ÍØäÃÃѵ¹ì',2670,2670),('ÍØäÃÇÃó',2671,2671),('ÍØäþÃ',2669,2669),('ÍسÒÇ´Õ',2645,2645),('ÍØ´Á',2646,2646),('ÍØ´Ã',2654,2654),('ÍØ´ÁàÁ´Ô¤ÍÅ ÍÔ¤ÇÔ»àÁé¹',2650,2650),('ÍØ´ÁÇþѹ¸ì',2652,2652),('ÍØ´ÁÈÑ¡´Ôì',2653,2653),('ÍØ´ÁÅѡɳì',2651,2651),('ÍØ´Á¾Ã',2648,2648),('ÍØ´Á¾Ñ¹¸ì',2649,2649),('ÍØ´Á¾§Èì',2647,2647),('ÍصâÁ·Âì',2655,2655),('ÍصÊÒË¡ÃÃÁ¼éÒà¤Å×ͺ¾ÅÒʵԡä·Â',2656,2656),('ÍØ·ÑÂ',2657,2657),('ÍØ·ÑÂÇÃó',2658,2658),('ÍØ·ØÁ¾Ã',2659,2659),('ÍغÅ',2662,2662),('ÍغÅÇÃó',2664,2664),('ÍغžÃó',2663,2663),('KAWAIJIT',22,22),('KAWALJIT',23,23),('KOJI',24,24),('LOUIS',25,25),('PETER',26,26),('SHERMAN',27,27),('TAN',28,28),('Willem Arnold',29,29),('WONG',30,30),('WU',31,31),('ÅÐÁèÍÁ',1718,1718),('ÅÐàÍÕ´',1721,1721),('ÅÐÁÑÂ',1719,1719),('ÅÐÍͧ´ÒÇ',1720,1720),('ÅÑ¡ÉÁÕ',1724,1724),('ÅѡɳÒ',1723,1723),('ÅÑ¡¢³Ò',1722,1722),('ÅÑ­ª¹Ò',1725,1725),('ÅÑ´´Ò',1726,1726),('ÅÑ´´ÒÇÃó',1727,1727),('ÅÑ´´ÒÇÑÅÂì',1728,1728),('ÅÑ·¸ÈÑ¡´Ôì',1729,1729),('ÅÔÁ',1734,1734),('ÅÒÇѳÂì',1730,1730),('ÅÔÅÒÀóì',1735,1735),('ÅÓäÂ',1732,1732),('ÅÓä¾',1731,1731),('ÅÔ¹´ÒÇÃó',1733,1733),('ÅÅÔ´Ò',1716,1716),('ÅÅÔµÒ',1717,1717),('Å×ͪÑÂ',1736,1736),('äÁµÃÕ',1596,1596),('äÇ·Ô¹',1953,1953),('äÍ.àÍÊ.äÍ.ÍÔ¹àµÍÃì๪Ñè¹á¹Å',2721,2721),('äÍ.«Õ.«Õ.ÍÔ¹àµÍÃì๪Ñè¹á¹Å (ÁËÒª¹)',2718,2718),('äÍ.·Õ.áÍ´ìÇÒ¹« à·¤ ¨Ó¡Ñ´',2719,2719),('äÍ.·Õ.á͹´ìÇÒ¹« à·¤ ¨Ó¡Ñ´',2720,2720),('äÍÂàÃÈ',2722,2722),('ä¡Ãà·¾',215,215),('ä¡Ã¤Ó',214,214),('ä¡Ã¸ÇѪ',216,216),('äªÂÃѵ¹ì',575,575),('äªÂÁ§¤Å',574,574),('äªÂÒ',576,576),('äªÂ¹Ñ¹·¹ì',573,573),('ä´ÍСÅêÒÊ',709,709),('äµÃç¤ì',726,726),('äµÃà·¾',725,725),('äµÃ·È',724,724),('ä·Â',805,805),('ä·Â ¤Í¹Êì á͹´ì ºÔÅ´Ôé§',806,806),('ä·Â ´Õ à͹ ·Õ ྐྵ·ì',807,807),('ä·Â-àÍà«Õ ¾Õ.ÍÕ.ä¾é¾ì',824,808),('ä·ÂàÇŤ͹ÍصÊÒ¡ÃÃÁ',821,822),('ä·ÂÂÙà¹Õ¹¤ÇÍÅÅÔµÕé',820,821),('ä·Âà¡ÃÕ§ÊÔ觷Í',808,809),('ä·Âà¤ÁÕÀѳ±ì',810,811),('ä·Âà«çÅ·ÃÑÅà¤ÁÕ ª¹)',813,814),('ä·Âà«ç¹·ÃÑÅ à¤ÁÕ ª¹)',811,812),('ä·Âà«ç¹·ÃÑÅà¤ÁÕ',812,813),('ä·Âà¾ÔèÁ¾ÅÒʵԡ',819,820),('ä·ÂÍÔ¹àµÍÃì ÍÐâÃàÁµÔ¡Êì',823,824),('ä·ÂÍÔ¹àµÍÃì ¤ÍµµÍ¹¡Ò÷Í',822,823),('ä·Â¤Òà«ÎÔ¹',809,810),('ä·Â´Õà͹·Õྐྵ·ì',814,815),('ä·Âµ§¹ÔµµÔé§',815,816),('ä·Â¸Ò¹Õà¤ÁÕ',817,818),('ä·Â¸¹Ò¾Ò³ÔªÂì',816,817),('ä·Â¾ÃçÍ¡«ì',818,819),('Ä·¸Ôì',1714,1714),('Ä·¸ÔªÑÂ',1715,1715),('ä¼·',1292,1292),('ä¾àÃÒÐ',1485,1485),('ä¾âè¹ì',1486,1486),('ä¾ÃÊÔ·¸Ôì',1481,1481),('ä¾Ãʳ±ì',1480,1480),('ä¾ÃѪ',1482,1482),('ä¾Ãѵ¹ì',1483,1483),('ä¾ÃÔ¹·Ãì',1484,1484),('ä¾ÃÄ·¸Ôì',1479,1479),('ä¾ÇÑÅÂì',1488,1488),('ä¾ÈÔÃÔ',1490,1490),('ä¾ÈÒÅ',1489,1489),('ä¾ÊÔ°',1491,1491),('ä¾ÅÔ¹',1487,1487),('ä¾±ÙÃÂì',1477,1477),('侺ÙÅÂì',1478,1478),('¡.µÃÕ·Ô¾Âì ¤Í¹«ÑÅáµ¹·ì',32,32),('¡ÃíԡÒÃì',65,65),('¡ÃóԡÒ',66,66),('¡ÃóԡÒÃì',67,67),('¡ÃÇÔ·Âì',69,69),('¡ÃÇÅÑÂ',68,68),('¡ÃШ¡ä·ÂÍÒ«ÒÎÕ',72,72),('¡Ãͧá¡éÇ',70,70),('¡Ãͧ·Ô¾Âì',71,71),('¡ÃÕ±Ò',73,73),('¡ÁÅ',49,49),('¡ÁÅÃѪµì',55,55),('¡ÁÅÃѵ¹ì',56,56),('¡ÁÅÁÒÅÂì',54,54),('¡ÁÅÇÃó',57,57),('¡ÁũѵÃ',50,50),('¡ÁÅ·Ô¾Âì',51,51),('¡ÁžÃ',52,52),('¡ÁžÃó',53,53),('¡Ã¡ÁÅ',60,60),('¡Ã¡¹¡',58,58),('¡Ã¡¾Ã',59,59),('¡ÃªÑÂ',61,61),('¡Ã³ì',62,62),('¡Ã¹Ñ¹·ì',63,63),('¡Ã»ÃÕÂÒ',64,64),('¡Ãا෾¼ÅÔµàËÅç¡',74,74),('¡Ãاä·ÂÍØ»¡Ã³ì',76,76),('¡Ãاä·Â¤ÒÃìàÃé¹·ì ÍÔ¹àµÍÃì๪Ñè¹á¹Å',75,75),('¡ÃسÒ',77,77),('¡ÇÕ',93,93),('¡ÉÁÒ',94,94),('¡èÍà¡ÕÂõÔ',98,98),('¡ÊÔÇѹ',97,97),('¡ÉÔª­ì',95,95),('¡ÉÔ´ÔÈ',96,96),('¡Íºá¡éÇ',100,100),('¡ÍºÅÒÀ',102,102),('¡Íº¡ØÅ',99,99),('¡ÍººØ­',101,101),('¡Ñ ÅÂÒ',103,103),('¡ÑÁ»¹Ò¶',117,117),('¡ÑÁ»¹Ò·',118,118),('¡ÑÅÂÒ',119,119),('¡ÑÅÂÒÃѵ¹ì',121,121),('¡ÑÅÂÒ³Õ',120,120),('¡Ñ­ª¾Ã',104,104),('¡Ñ­­ÀѤ',105,105),('¡Ñ­­ìÇÃÒ',106,106),('¡Ñ­­ÒÁÒÈ',107,107),('¡Ñ­­ÒÇÕÃì',108,108),('¡Ñ³°Ô¡Ò',110,110),('¡Ñ³°ªÒ',109,109),('¡Ñ³·ÔÁÒ',111,111),('¡Ñ¹ÂÒÃѵ¹ì',116,116),('¡Ñ¹µì',112,112),('¡Ñ¹µÔ¡Ã',113,113),('¡Ñ¹¸ÔÁÒ',115,115),('¡Ñ¹¸ÔªÒ',114,114),('¡ÒÃÇÔÍÃ',128,128),('¡ÒÂÊÔ·¸Ôì',127,127),('¡Óá˧',134,134),('¡ÔÁÅÑé§',157,157),('¡ÕõÔ',158,158),('¡ÒÃسÕ',129,129),('¡ÒÈÔ',130,130),('¡Ô觡ҭ¨¹ì',135,135),('¡ÓäÃ',133,133),('¡Ô¨ÇÃó',137,137),('¡Ô¨µÔÂÒ',136,136),('¡Ò­¨¹ÇÃó',122,122),('¡Ò­¨¹Ò',123,123),('¡ÔµÔ¡Ã',153,153),('¡ÔµÔ¡Ã³ì',154,154),('¡ÔµÔ¡Ñ­­Ò',155,155),('¡ÔµÔªÒ­',156,156),('¡ÔµµÔ',138,138),('¡ÔµµÔÃѵ¹ì',150,150),('¡ÔµµÔÁÒ',148,148),('¡ÔµµÔÂÒ',149,149),('¡ÔµµÔÇѲ¹ì',151,151),('¡ÔµµÔÈÑ¡´Ôì',152,152),('¡ÔµµÔ¡Ñ¹µì',139,139),('¡ÔµµÔªÑÂ',140,140),('¡ÔµµÔ­Ò',141,141),('¡ÔµµÔ¹Ñ¹·ì',142,142),('¡ÔµµÔ¾Ñ²¹ì',146,146),('¡ÔµµÔ¾Ñ¹¸ì',147,147),('¡ÔµµÔ¾Å',145,145),('¡ÔµµÔ¾§Èì',143,143),('¡ÔµµÔ¾§Éì',144,144),('¡Ó¸Ã',131,131),('¡Ò¹´Ò',124,124),('¡Ò¹µì',125,125),('¡Ò¹µìÃÇÕ',126,126),('¡Ó¾Å',132,132),('¡Ùê´ÇÔÅ ÍÔ¹´ÑʵÃÕé',169,169),('¡ÄÉ®Ò',84,84),('¡ÄÉ®Õ',85,85),('¡ÄɮվÃ',86,86),('¡ÄɳÐ',89,89),('¡ÄɳÒ',90,90),('¡ÄɳÕ',91,91),('¡Äɳ¾Å',88,88),('¡Äɳ¾¨¹ì',87,87),('¡ÄÉ´Ò',92,92),('¡ÄȾÃó',83,83),('¡ÄªÇÃó',78,78),('¡ÄµÂÒ',80,80),('¡ÄµÔÂÒ',82,82),('¡ÄµÔ¡Ò¹·ì',81,81),('¡Äµº¾Ô¸',79,79),('¡ªÁÅ',35,35),('¡ª¡Ã',33,33),('¡ª¾Ã',34,34),('¡µÑ­­Ù',36,36),('¡¹ÔÉ°Ò',48,48),('¡¹¡',37,37),('¡¹¡Ãѵ¹ì',43,43),('¡¹¡ÇÃó',45,45),('¡¹¡ÈÃÕ',46,46),('¡¹¡Ò­¨¹ì',47,47),('¡¹¡Ä·¸Ôì',44,44),('¡¹¡¡Ò­¨¹ì',38,38),('¡¹¡ªÑÂ',39,39),('¡¹¡¹ÔÀÒ',40,40),('¡¹¡¹Øª',41,41),('¡¹¡¾Ã',42,42),('¡ØÁØ·¾Ñ¹¸ì',159,159),('¡ØéÂà«é§ ÍÔÁ»ÍÃìµ á͹´ì àÍç¡«ì»ÍÃìµ',160,160),('¡ØËÅÒº',168,168),('¡ØÊØÁÒ',167,167),('¡ØÅÂÒ',163,163),('¡ØÅÇ´Õ',165,165),('¡ØÅÈÔÃÔ',166,166),('¡ØÅÅ´Ò',164,164),('¡ØŹѹ·ì',161,161),('¡ØŹÒÃÕ',162,162),('¢ÇÑ­àÁ×èͧ',228,228),('¢ÇÑ­àÃ×͹',231,231),('¢ÇÑ­ã¨',223,223),('¢ÇÑ­à´×͹',225,225),('¢ÇÑ­à¾çªÃ',227,227),('¢ÇÑ­ÃØé§',230,230),('¢ÇÑ­ÂؾÒ',229,229),('¢ÇÑ­ªÑÂ',224,224),('¢ÇÑ­µÒ',226,226),('¢éÒÇÍÔèÁ·Ô¾Âì',233,233),('¢ÑµµÔÂÒ³Õ',232,232),('¢¨Ã',217,217),('¢¨Ãà¡ÕÂõÔ',218,218),('¢¨ÃÈÃÕ',219,219),('¢¨ÃÈÑ¡´Ôì',220,220),('¢¹ÔÉ°ì',221,221),('¢¹ÔÉ°Ò',222,222),('¢Ø¹·Í§',234,234),('¤Áà¾çªÃ',249,249),('¤ÃÒ¿·ìà´ÍÐàºÊ·ì',250,250),('¤Á¡ÃÔª',247,247),('¤Á¨Ñ¡Ã',248,248),('¤àª¹·Ãì',238,238),('¤à³È',244,244),('¤à¹Âì',246,246),('¤ÍÊÁÔ¤ ¤Í¹¤ÍÃì´ ¤ÍÃì»ÍàêÑè¹',251,251),('¤ÔÁ§¤ì',257,257),('¤Óá˧',256,256),('¤ÒÃìâ»Ãà¿ÊªÑè¹á¹Å',253,253),('¤Óó',255,255),('¤ÒÇÒ¤Ô¹',254,254),('¤Ò«ÙâÍÐ',252,252),('¤ÙèºØ­',260,260),('¤Ù»Ò¹Ò',261,261),('¤§à´ª',237,237),('¤§¡ÄÈ',236,236),('¤³ÒÇزÔ',240,240),('¤³ÔÈÃ',241,241),('¤³ÔÊÃ',242,242),('¤³Ò¡Ã',239,239),('¤³ØµÁì',243,243),('¤¸Ò',245,245),('¤Ø³Ò¡Ã',258,258),('¤Ø³Õ·Ã',259,259),('§ÒÁà¾ç­',273,273),('§ÒÁ¹Ô¨',272,272),('¨àÃ',298,298),('¨ÃÃÂÒ',285,285),('¨àÃÈÑ¡´Ôì',299,299),('¨ÃÇÃø¹ì',287,287),('¨ÃǾÃ',286,286),('¨ÃÑʪÑÂ',290,290),('¨ÃÑʾÅ',291,291),('¨ÃÑÅ',289,289),('¨ÃÑ­',288,288),('¨ÃÔÂÒ',294,294),('¨ÃÔÂÒÀóì',295,295),('¨ÃÔ¹·Ãì',292,292),('¨ÃÔ¹¸Ã',293,293),('¨ÃÙ­',297,297),('¨ÃظԴÒ',296,296),('¨ÍÁ¢ÇÑ­ã¨',300,300),('¨Ñ¡ÃÇÒÅ',304,304),('¨Ñ¡Ãѵ¹ì',305,305),('¨Ñ¡ÃÕ',307,307),('¨Ñ¡ÃÔ¹·Ãì',306,306),('¨Ñ¡Ã¡Äɳì',302,302),('¨Ñ¡Ã¡Äª',301,301),('¨Ñ¡Ã¾Ñ¹¸ì',303,303),('¨Ñ¡ÉÇѯ',308,308),('¨Ñ´ËÒ§Ò¹ÎÔÇáÁ¹àÍ繨Ôà¹ÕÂÃÔè§',309,309),('¨ÑµÃ´ÒÇ',310,310),('¨Ñ¹¨ÔÃÒ',311,311),('¨Ñ¹·Ã',314,314),('¨Ñ¹·ÃìÃѵ¹ì',321,321),('¨Ñ¹·Ãìà¨éÒ',315,315),('¨Ñ¹·Ãìà¾ç­',320,320),('¨Ñ¹·ÃìÇÔÁÅ',322,322),('¨Ñ¹·ÃìÇÔäÅ',323,323),('¨Ñ¹·ÃìÊØ´Ò',324,324),('¨Ñ¹·Ãì·Ô¾Âì',316,316),('¨Ñ¹·Ãì¸ÔÀÒ',317,317),('¨Ñ¹·Ãì¹ÀÒ',318,318),('¨Ñ¹·Ãì¾Ã',319,319),('¨Ñ¹·ÔÀÒ',326,326),('¨Ñ¹·ÔÁÒ',327,327),('¨Ñ¹·ÔÃÒ',329,329),('¨Ñ¹·ÔÁÒÀóì',328,328),('¨Ñ¹·Ô¡Ò',325,325),('¨Ñ¹··Õ',312,312),('¨Ñ¹·¹Ò',313,313),('¨ÔÃÀÑ·Ã',361,361),('¨ÔÃÀÒ',362,362),('¨ÓàÃÔ­',344,344),('¨ÔÃÇÃó',363,363),('¨ÔÃÇѲ¹ì',364,364),('¨ÔÃÐÀÒ',369,369),('¨ÕÃÐÇѲ¹ì',386,386),('¨ÔÃÐÈÑ¡´Ôì',370,370),('¨ÕÃйѹ·ì',385,385),('¨ÔÃоÃ',367,367),('¨ÔÃоÃó',368,368),('¨ÔÃÈÑ¡´Ôì',365,365),('¨ÕÃÈÑ¡´Ôì',384,384),('¨ÔÃÊØ´Ò',366,366),('¨ÕâÍà·¤¹Ô¤ (ä·ÂᏴì)',388,388),('¨ÓÃÑÊ',343,343),('¨ÔÃѪ´Ò',371,371),('¨ÔÃÑ°µÔì',372,372),('¨ÔÃÒÀóì',376,376),('¨ÒÃÕÃѵ¹ì',333,333),('¨ÔÃÒÀÒ',377,377),('¨ÔÃÒÂØ',378,378),('¨ÔÃÒÇÃó',379,379),('¨ÔÃÒÇÑÅÂì',380,380),('¨ÔÃÒÇزÔ',381,381),('¨ÔÃÒ¤Á',373,373),('¨ÔÃҹت',374,374),('¨ÔÃÒ¾Ã',375,375),('¨ÔþÃ',359,359),('¨ÕþÃó',383,383),('¨Ôþѹ¸ì',360,360),('¨ÒÃØÃѵ¹ì',338,338),('¨ÒÃØÇÃó',339,339),('¨ÒÃسÕ',334,334),('¨ÒÃسÕÂì',335,335),('¨ÒÃعѹ',336,336),('¨ÒÃغصÃ',337,337),('¨ÕÍÕ á¤»»ÔµÍÅ (»ÃÐà·Èä·Â)',387,387),('¨ÓÅͧ',345,345),('¨Ô³³ì',346,346),('¨ÔµÃÒ',354,354),('¨ÔµÃÒÀóì',355,355),('¨ÔµÃÅ´Ò',353,353),('¨ÔµµÁÒÊ',349,349),('¨Ôµµì',347,347),('¨Ôµµì¹ÔÉÒ',348,348),('¨ÔµµÒ',350,350),('¨ÔµµÔ',351,351),('¨ÔµµÔ¹¹Ñ¹·ì',352,352),('¨ÒµØç¤ì',331,331),('¨ÒµØùµì',332,332),('¨ÒµØ¾Ã',330,330),('¨Õ·Õ«Õ ·Ã§¾Ñ¹¸ì)',382,382),('¨Ó¹§',340,340),('¨Ó¹§¤ì',341,341),('¨Ô¹´Ò',356,356),('¨Ô¹µì¨Ø±Ò',357,357),('¨Ô¹µ¹Ò',358,358),('¨Ó»Õ',342,342),('¨§ÃÑ¡',277,277),('¨§ÃÑ¡Éì',278,278),('¨§Åѡɳì',279,279),('¨§¡Å',275,275),('¨§¡Å³Õ',276,276),('¨µØç¤ì',283,283),('¨µØÄ·¸Ôì',284,284),('¨µØ¾Ã',280,280),('¨µØ¾Ñ¹¸ì',282,282),('¨µØ¾Å',281,281),('¨ØÃÕÃѵ¹ì',395,395),('¨ØÌÒ',397,397),('¨ØÌÒÀóì',398,398),('¨ØÌÒÀÒ',399,399),('¨ØÌÒÅѡɳì',400,400),('¨ØÅÅ´Ò',396,396),('¨Ø±ÒÃѵ¹ì',393,393),('¨Ø±ÒÁÒÈ',391,391),('¨Ø±ÒÁÒÊ',392,392),('¨Ø±ÒÇÃó',394,394),('¨Ø±Ò·Ô¾Âì',389,389),('¨Ø±Ò¾Ñ¹¸ì',390,390),('©ÇÕÇÃó',419,419),('©Íé͹',420,420),('©ÑµÃÀóì',422,422),('©ÑµÃÈÔÃÔ',423,423),('©ÑµÃªÑÂ',421,421),('©Ñ¹·Ãѵ¹ì',425,425),('©Ñ¹·¹Ò',424,424),('©ÅÇÂ',416,416),('©Åͧ',417,417),('©ÅÒ´',418,418),('©×èÍ ¨Ôé¹ ÎÑéÇ',426,426),('©×èͨÔé¹ÎÑéÇ',427,427),('ª.ÊÂÒÁ¨Ñ¡ÃÂÒ¹à´ç¡àÅè¹',437,437),('ªÁ',450,450),('ªÁÀÑÊÊÃ',454,454),('ªÁÀٹت',455,455),('ªÁѾÃ',456,456),('ªÃÑÊÃÒ',463,463),('ªÃѪÊÃÒ',461,461),('ªÃѶ¨Ñ¹·Ãì',462,462),('ªÂÒÀóì',460,460),('ªÃÔ¹Ãѵ¹ì',465,465),('ªÃÔ¹·Ãì',464,464),('ªÂÒ¾Å',459,459),('ªÂ¹',458,458),('ªÁ¾Ù¹Øª',452,452),('ªÁ¾Ù¹Ø·',453,453),('ªÁ¾Å',451,451),('ªÇÔÈÒ',479,479),('ªÇÅÔµ',478,478),('ªÇ¹',475,475),('ªÇ¹ªÁ',476,476),('ªÇ¹¾ÔÈ',477,477),('ªÐÍé͹',485,485),('ªÐ¹ÔÅ',484,484),('ªèÍ',480,480),('ªèÍÍÑ­ªÑ­',483,483),('ªèͩѵÃ',481,481),('ªèÍ·Ô¾Âì',482,482),('ªÑÂÂÐ',509,509),('ªÑÂÂÈ',508,508),('ªÑÂÃѵ¹ì',511,511),('ªÑÂÀÑ·Ã',505,505),('ªÑÂÁ§¤Å',506,506),('ªÑ§³ì',507,507),('ªÑÂà¨ÃÔ­ãªèËÅÕʵÕÅ',496,496),('ªÑÂÂØ·¸',510,510),('ªÑÂÇѲ¹ì',512,512),('ªÑÂÊÔ·¸Ôì',513,513),('ªÑÂÊÔ¹¸Øì',514,514),('ªÑªҭ',498,498),('ªÑª¹Ð',497,497),('ªÑ³ç¤ì',499,499),('ªÑ¸ÇѲ¹ì',500,500),('ªÑ¹ѹ·ì',502,502),('ªÑ¹¤Ã',501,501),('ªÑ¾Ã',503,503),('ªÑ¾Å',504,504),('ªÑªÀÑÊÊÃ',489,489),('ªÑªÀ³',488,488),('ªÑªÁ³±ì',490,490),('ªÑªÁ¹±ì',491,491),('ªÑªÇÒÅÂì',493,492),('ªÑªÇÒÅìÂ',492,493),('ªÑªªÑÂ',486,486),('ªÑª®Ò',487,487),('ªÑ­ÉÒ',495,495),('ªÑ­­Ò',494,494),('ªÒÂ',524,524),('ªÒÇѳÂì',526,526),('ªÕÇÒ¾Ã',534,534),('ªÒÅÕ',525,525),('ªÒ­',515,515),('ªÒ­ÂØ·¸',518,518),('ªÒ­ÈÑ¡´Ôì',519,519),('ªÒ­ªÑÂ',516,516),('ªÒ­³Ã§¤ì',517,517),('ªÔ´ª¹¡',529,529),('ªÒµÃÕ',520,520),('ªÒµÔªÒÂ',521,521),('ªÒ¹',522,522),('ªÔ¹',530,530),('ªÔ¹Ãѵ¹ì',532,532),('ªÔ¹ÇѲ¹ì',533,533),('ªÓ¹Ô',528,528),('ªÓ¹Ò­',527,527),('ªÒ¹¹·ì',523,523),('ªÔ¹¾Ñ¹¸ì',531,531),('ªÙà¡ÉÁ',544,544),('ªÙà¡ÕÂõÔ',545,545),('ªÙÈÑ¡´Ôì',553,553),('ªÙ¨Ôµ',546,546),('ªÙ¨Ôµµì',547,547),('ªÙªÑÂ',548,548),('ªÙªÒµÔ',549,549),('ªÙªÕ¾',550,550),('ªÙ¾§Èì',551,551),('ªÙ¾§Éì',552,552),('ªÅÍ',468,468),('ªÅÍÁ',469,469),('ªÅÒ¡Ã',470,470),('ªÅÔ¡Ò',471,471),('ªÅÔ´Ò',472,472),('ªÅÔµ',473,473),('ªÅÔµÒ',474,474),('ªÅ¸Õ',467,467),('ªÅ¸ÔªÒ',466,466),('ªäÁ¾Ã',457,457),('ª®ÒÃѪ',438,438),('ª´Ò¡Ã',439,439),('ª¹ÁìÊØÇÃó',442,442),('ª¹Ð',443,443),('ª¹Ð⪵Ô',444,444),('ª¹Ñ­­Ò',445,445),('ª¹Ñ°',446,446),('ª¹Ñ¹Àóì',447,447),('ª¹ÒÀÒ',448,448),('ª¹Ô´Ò',449,449),('ª¹¹Ñ¹·ì',440,440),('ª¹¹ÔÈÒ',441,441),('ª×蹨Եµì',535,535),('ªØÁÊÒÂ',542,542),('ªØÁÈÔÃÔ',541,541),('ªØÁ¾Ã',539,539),('ªØÁ¾Å',540,540),('ªØÅÕ¾Ã',543,543),('ªØ´Ò¾Ã',536,536),('ªØµÔÁÒ',538,538),('ªØµÔ¡Ò­¨¹ì',537,537),('«è͹¡ÅÔè¹',577,577),('«Õ àÍç¹ äÍ',580,580),('«Õ ´Õ àÍçÁ àÍç¹àµÍÃìä¾ÃÊì',581,581),('«Õ.ÇÕ.àÍÊ.ÍÔ¹´ÑʵÃÕé',584,584),('«Õ.´Õ.ÍصÊÒË¡ÃÃÁ',582,582),('«Õ.·Õ.à·àŤÍÁ',583,583),('«ÕàÍç¹äÍàÍ繨Ôà¹ÕÂÃÔ觫Ѿ¾ÅÒÂ',586,586),('«Òâµéâ¤à¡ÕÂÇ ¡Ãا෾',578,578),('«Ô¡»éÒ (»ÃÐà·Èä·Â)',579,579),('«Õ´Õ ÍصÊÒË¡ÃÃÁ',585,585),('«Ù',587,587),('­Ò³ÀѤ',590,590),('­Õ¹ÀÒ',591,591),('¯Ç§¡ÁÅ',592,592),('°ÔµÔÃѪµì',605,605),('°ÔµÔÃѵ¹ì',606,606),('°ÔµÔÁÒ',604,604),('°ÔµÔà¸ÕÂÃ',600,600),('°ÔµÔ¡Ò¹µì',598,598),('°ÔµÔ³Ñ°',599,599),('°ÔµÔ¹Ñ¹·ì',601,601),('°ÔµÔ¾Ã',603,603),('°ÔµÔ¾§Èì',602,602),('°Ôµ¡Ò¹µì',597,597),('°Ò¹Ñ¹·ì',593,593),('°Ò¹ÔÊÃ',595,595),('°Ò¹ÔµÂì',594,594),('°Ò»¹ÇÔ·Âì',596,596),('±ÔÁÀì¹Øª',607,607),('³ÀÑ·Ã',609,609),('³Àѷáóì',610,610),('³Ã§ÃÑ¡Éì',617,617),('³Ã§ÈÑ¡´Ôì',619,619),('³Ã§Ä·¸Ôì',618,618),('³Ã§¤ì',611,611),('³Ã§¤ìÇÔ·Âì',615,615),('³Ã§¤ìÈÑ¡´Ôì',616,616),('³Ã§¤ìÄ·¸Ôì',614,614),('³Ã§¤ìªÑÂ',612,612),('³Ã§¤ì¾ÑªÃì',613,613),('³Ë·ÑÂ',620,620),('³ÑªªÒ',621,621),('³Ñ­­Ò',622,622),('³Ñ®°ÁÑÂ',623,623),('³Ñ®°ÇÃó',624,624),('³Ñ¯¾Å',625,625),('³Ñ°',626,626),('³Ñ°ÁÒ',645,645),('³Ñ°ÂÒ',646,646),('³Ñ°ÀÙÁÔ',643,643),('³Ñ°Á¹',644,644),('³Ñ°ÇÃÕÂì',647,647),('³Ñ°ÇѪÃì',648,648),('³Ñ°ÇѲ¹ì',649,649),('³Ñ°ÇѵÔ',650,650),('³Ñ°ÇزÔ',651,651),('³Ñ°ÊÃÑ­',653,653),('³Ñ°ÈÑ¡Âì',652,652),('³Ñ°Ë·ÑÂ',654,654),('³Ñ°Ô¡Ò',655,655),('³Ñ°¡Ã³ÔÈÒ',627,627),('³Ñ°¡Ò¹µì',629,629),('³Ñ°¡ÄµÒ',628,628),('³Ñ°¢¨Ã',630,630),('³Ñ°ªÒ',632,632),('³Ñ°ª¹Ñ­',631,631),('³Ñ°°Ò',633,633),('³Ñ°µÂÒ',634,634),('³Ñ°¹Ñ¹·ì',636,636),('³Ñ°¹¹·ì',635,635),('³Ñ°»¡Ã³ì',637,637),('³Ñ°¾Ã',641,641),('³Ñ°¾Å',642,642),('³Ñ°¾§Èì',638,638),('³Ñ°¾§Éì',639,639),('³Ñ°¾¨¹ì',640,640),('³Õç¤ì',657,657),('³ÔªÒ¡Ã',656,656),('³¸ÔµÒ',608,608),('³Øªª¹Ò',658,658),('´ÃÃ쪹Õ',661,661),('´ÃسÕ',662,662),('´Ç§Ãѵ¹ì',674,674),('´Ç§ã¨',667,667),('´Ç§à´×͹',669,669),('´Ç§Á¹·Ãì',673,673),('´Ç§Ë·ÑÂ',675,675),('´Ç§¡ÁÅ',665,665),('´Ç§¨Ñ¹·Ãì',666,666),('´Ç§´ÒÇ',668,668),('´Ç§¹ÀÒ',670,670),('´Ç§ºÅ',671,671),('´Ç§¾Ã',672,672),('´Í¡äÁé',676,676),('´Õ.ºÕ.ä´Á͹´ì (»ÃÐà·Èä·Â)',695,695),('´Ôàá',692,692),('´ÒÃÒÃѵ¹ì',680,680),('´ÒÃÒÇÃó',681,681),('´ÒÃÔ¡Ò',682,682),('´ÒÃÔ³Õ',683,683),('´ÒÃÔ¹',684,684),('´ÒÃÒ¹ÕÅì',679,679),('´Óç',689,689),('´Óç¤ì',690,690),('´ÒóÕ',677,677),('´ÒùÕÂì',678,678),('´Óà¹Ô¹',688,688),('´ÒÃسÕ',685,685),('´ÒÇÃÕ',687,687),('´ÒÇ»ÃСÒÂ',686,686),('´ÓËÃÔ',691,691),('´ÔÈ¡ØÅ',693,693),('´Ôʷѵ',694,694),('´ÅÄ´Õ',663,663),('´ÅÄ·ÑÂ',664,664),('´¹ÑÂ',659,659),('´¹Ø¾Å',660,660),('´ØÊÔµ',701,701),('´ØÊÔµà¤ÁÕÀѳ±ì',702,702),('´ØÉ®Õ',698,698),('´ØɳÕ',699,699),('´ØÉ´Õ',700,700),('´ØÅÂì¾Ñ²¹ì',697,697),('´ØžÅ',696,696),('µÐÇѹ',712,712),('µÐÅèÍÁÊÔ¹¾ÅÒʵԡ',711,711),('µèͨѡÃ',710,710),('µÑ觨Ñè§ËÅÍ´ä¿',713,713),('µÒà¿ç´',714,714),('µØê',715,715),('µØéÁ',717,717),('µØëÂ',718,718),('µØ꡵Ò',716,716),('µØÅÒÅѡɳì',719,719),('¶ÇÑÅ',729,729),('¶ÇÑÅÂì',730,730),('¶ÇÔÅ',731,731),('¶ÒÇÃ',733,733),('¶Ò³Ø¾§Èì',732,732),('¶¹ÍÁÈÑ¡´Ôì',727,727),('¶¹Ôµ¾Å',728,728),('·ÃÃȹÕÂì',745,745),('·ÃѾÂì¶ÒÇäéÒÇÑÊ´Ø',746,746),('·Ã§',737,737),('·Ã§ÇزÔ',741,741),('·Ã§ÈÃÕ',742,742),('·Ã§ÈÑ¡´Ôì',743,743),('·Ã§ÈÔÃÔ',744,744),('·Ã§ªÑ»Ñè¹·Í',738,738),('·Ã§¸ÃÃÁ',739,739),('·Ã§¾Å',740,740),('·ÇÕ',748,748),('·ÇÕÇѲ¹ì',752,752),('·ÇÕÈÃÕ',753,753),('·ÇÕÈÑ¡´Ôì',754,754),('·ÇÔª',747,747),('·ÇÕªÑÂ',749,749),('·ÇÕ»',750,750),('·ÇÕ¾Ã',751,751),('·èÒ·ÃÒÂá¨é§ÇѲ¹Ò',773,773),('·È¾Ã',755,755),('·È¾Å',756,756),('·Í§ãº',759,759),('·Í§ÊØ¢',763,763),('·Í§ÍÔ¹·Ãì',764,764),('·Í§¢ÒÇ',757,757),('·Í§¤Ó',758,758),('·Í§»Ò¹',760,760),('·Í§¾Ñ¹¸ì',761,761),('·Í§¾Ñ¹¸Øì',762,762),('·ÑÈÇÃó',772,772),('·ÑȹÇÃó',768,768),('·ÑȹÕÂì',770,770),('·ÑȹÕÂÒ',771,771),('·ÑȹվÃ',769,769),('·Ñ¡ÉÁ³¹ì',765,765),('·Ñ´´ÒÇ',766,766),('·Ñº·ÔÁ',767,767),('·Õ «Õ ¾Õ ÍÔ¹´ÑÊ·ÃÕé',791,791),('·Õ.àÍÊ.äÇÃì¤Ñ· á͹´ì áÁªªÕ¹¾ÒÃì·',794,794),('·Õ.äÍ.·Õ.ÍÔ¹àµÍÃì๪Ñè¹á¹Å',795,795),('·Õ.«Õ.«Õ.¾Ãç;à¾ÍÃìµÕé',792,792),('·Õ.«Õ.¾Õ.ÍÔ¹´ÑÊ·ÃÕé',793,793),('·ÕâÍàÍ â´¿à¤Á ÍÔ¹´ÃÑʵÕé',796,796),('·ÔÇÒ',789,789),('·ÔȾÅ',790,790),('·Ô¦ÑÁ¾Ã',774,774),('·Ô¹á¤¹ ÍÔ¹´ÑÊ·ÃÕ',775,775),('·Ô¾ÂìÇÃó',778,778),('·Ô¾ÂìÇÃس',779,779),('·Ô¾ÂìÇÑÅÂì',780,780),('·Ô¾ÂìÇÒÃÕ',781,781),('·Ô¾ÂìÇÔÁÅ',782,782),('·Ô¾ÂìÇ´Õ',777,777),('·Ô¾Âì¾Ò¾Ã',776,776),('·Ô¾ÇÃó',783,783),('·Ô¾ÇÑÅÂì',784,784),('·Ô¾ÇÔÁÅ',785,785),('·Ô¾ÊØ´Ò',786,786),('·Ô¾ÒÇÃó',788,788),('·Ô¾Ò¡Ã',787,787),('·ÙÃ',798,798),('·ÙÁÔ¹Ô·Êì ºÔ«Ôà¹Ê',797,797),('·¹§ÈÑ¡´Ôì',735,735),('·¹Ø',736,736),('¸ÃÃÁÈÒʵÃì',861,861),('¸ÃÃÁ¹Ù­',860,860),('¸à¹È',857,857),('¸à¹ÈÃì',858,858),('¸Á¹Ñ¹·ì',859,859),('¸ÇÑÅÃѵ¹ì',865,865),('¸ÇѪ',863,863),('¸ÇѪªÑÂ',864,864),('¸ÑªÇѲ¹ì',869,869),('¸ÑªÇ´Õ',868,868),('¸Ñª¡Ã',866,866),('¸Ñª¾Å',867,867),('¸Ñ­Ã´Ò',877,877),('¸Ñ­ª¹¡',870,870),('¸Ñ­­¸Ã',871,871),('¸Ñ­­¾Ñ²¹ì',872,872),('¸Ñ­³ÔªÒ',873,873),('¸Ñ­¹Ñ¹·ì',874,874),('¸Ñ­¾Ã',875,875),('¸Ñ­¾ÔÊÔ·¸Ôì',876,876),('¸ÕÃÀÑ·Ãì',896,896),('¸ÕÃÀÒ¾',897,897),('¸ÕÃÇѲ¹ì',898,898),('¸ÕÃÐ',901,901),('¸ÕÃÐÇѲ¹ì',904,904),('¸ÕÃЪÑÂ',902,902),('¸ÕÃоÅ',903,903),('¸ÕÃÈÑ¡´Ôì',899,899),('¸ÕÃÈÒ¹µÔ¾Ñ¹¸ì',900,900),('¸ÒÃÒ',883,883),('¸ÒÃÔ¹Õ',884,884),('¸ÓçÃѵ¹ì',886,886),('¸Óç¤ì',885,885),('¸ÕêÑÂ',890,890),('¸Ò÷ԾÂì',882,882),('¸Õùت',891,891),('¸ÕþѲ¹ì',895,895),('¸ÕþÅ',894,894),('¸Õþ§Èì',892,892),('¸Õþ§Éì',893,893),('¸Ò¡Ã',878,878),('¸Ò´Ò',879,879),('¸Ô´ÒÃѵ¹ì',887,887),('¸ÔµÔ¹Ñ¹·ì',888,888),('¸Ò¹Õ',881,881),('¸Ô¹Õ¡Ò­¨¹ì',889,889),('¸Ò¹Ô¹·Ãì',880,880),('¸Äµ',862,862),('¸§äªÂ',826,826),('¸§ªÑÂ',825,825),('¸³Ñ°',827,827),('¸¹âè¹ì',834,834),('¸¹ÃѪ',832,832),('¸¹Ãѵ¹ì',833,833),('¸¹ÇѲ¹ì',836,836),('¸¹Çѹ',837,837),('¸¹ÇÔµµ',838,838),('¸¹ÇÔ·Âì',839,839),('¸¹Ç´Õ',835,835),('¸¹ÐÃѪµì',841,841),('¸¹ÊÔ·¸Ôì',840,840),('¸¹ÑÊ',846,846),('¸¹Ñª¸Ô´Ò',842,842),('¸¹Ñ­­Ò',843,843),('¸¹Ñ¹µì',844,844),('¸¹Ñ¹·ì',845,845),('¸¹Ò',847,847),('¸¹ÒÀóì',850,850),('¸¹ÒÃÑ¡Éì',852,852),('¸¹ÒÀÒ',851,851),('¸¹ÒÇѪÃì',853,853),('¸¹ÔÉ°Ò',855,855),('¸¹Ò¤ÒÃÂÙâÍºÕ Ãѵ¹ÊÔ¹ ÊÒ¢ÒËÑÇËÁÒ¡',849,849),('¸¹Ò¤ÒáÃاÈÃÕÍÂظÂÒ º',848,848),('¸¹Ô´Ò',854,854),('¸¹Ù',856,856),('¸¹¡Ã',828,828),('¸¹¡Äµ',829,829),('¸¹¾Ã',830,830),('¸¹¾Å',831,831),('¹ à¿ÃÔÁàÁ¹¹Ôª ÍâÃáÁµÔê¡Êì ¾Õ·ÕÍÕ ÅÔÁÔàµç',906,906),('¹ ¾´Å',905,905),('¹àÃÈ',946,946),('¹ÃÀÑ·Ãì',939,939),('¹âõÁì',947,947),('¹ÀÇÃó',929,929),('¹ÀÑÊÊÃ',930,930),('¹ÀÑÊÊØÇÃó',931,931),('¹ÀÒ',932,932),('¹ÃÒ',940,940),('¹ÃÕ',945,945),('¹ÀÒÂØ·¸ì',934,934),('¹ÀÒÇÃó',935,935),('¹ÃÔÈ',943,943),('¹ÃÔÉ°',944,944),('¹ÀÔ¹·Ã',936,936),('¹ÃÔ¹·Ãì',941,941),('¹ÃÔ¹·Ãìà´ª',942,942),('¹ÀÒ¾Ã',933,933),('¹ÃªÑÂ',937,937),('¹À´Å',928,928),('¹Ã¾Å',938,938),('¹ÇÃѵ¹ì',956,956),('¹ÇÅÅÐÍÍ',960,960),('¹ÇŨѹ·Ãì',957,957),('¹ÇÅ©ÇÕ',958,958),('¹ÇžÃ',959,959),('¹Ç¡Ã³ì',954,954),('¹Ç¾Å',955,955),('¹éÓÁѹ¤ÒÅà·ê¡«ì',992,992),('¹éÓྪÃ',991,991),('¹éÓÍéÍÂ',994,994),('¹éÓ·Ô¾Âì',988,988),('¹éÓ½¹',989,989),('¹Ñ¹Ò',980,980),('¹Ñ­ªÅÒ',961,961),('¹Ñ¯¾Ã',962,962),('¹Ñ±¾Ã',963,963),('¹Ñ·ª¹¡',964,964),('¹Ñ·¸Á¹',965,965),('¹Ñ¹ªÑÂ',966,966),('¹Ñ¹·Ãѵ¹ì',973,973),('¹Ñ¹·ÁÒÊ',972,972),('¹Ñ¹·ÇÃó',975,975),('¹Ñ¹·Ç§Éì',974,974),('¹Ñ¹·ÈÑ¡´Ôì',976,976),('¹Ñ¹·Ò',977,977),('¹Ñ¹·ÔÂÒ',979,979),('¹Ñ¹·Ô¡Ò¹µì',978,978),('¹Ñ¹·ªÑÂ',967,967),('¹Ñ¹·¹ì',968,968),('¹Ñ¹·¹Ò',969,969),('¹Ñ¹·¾Ã',970,970),('¹Ñ¹·¾Å',971,971),('¹ÒÁ',983,983),('¹ÔÂÁ',1016,1016),('¹ÔÃÁÅ',1017,1017),('¹ÔÃѹ´Ã',1018,1018),('¹ÒÃÕ',985,985),('¹ÔÀÒ',1015,1015),('¹ÒÃÕÃѵ¹ì',986,986),('¹ÔÃÒÇÃóì',1019,1019),('¹ÒÃÔ¹·Ãì',984,984),('¹ÔâźÅ',1024,1024),('¹Ôà«Ð',998,998),('¹ÓÃØè§ä·Â ¡ÒÃìàÁ¹·ì',993,993),('¹ÔÃب¹ì',1020,1020),('¹ÔÃصµì',1021,1021),('¹ÔÇૹ¨ÙÃÕè¾ÃÔé¹µÔé§á͹´ì ᾤࡨ¨Ôé§',1025,1025),('¹ÔÇѲ¹ì',1026,1026),('¹ÔÇѵÃì',1027,1027),('¹ÔÇѵÔ',1028,1028),('¹ÔÇÒµ',1029,1029),('¹ÒÇÔ¹Õ',987,987),('¹ÔÈÃÒ',1030,1030),('¹ÔÊÒ',1033,1033),('¹ÔÈÒªÅ',1031,1031),('¹ÔÈÒ¾Ã',1032,1032),('¹ÔÅÀÒ',1022,1022),('¹ÔÅغÅ',1023,1023),('¹Ô¡Éì',995,995),('¹Ô¤Á',996,996),('¹ÔªÃªÕ¾',997,997),('¹Ò¯Êǧ',981,981),('¹Ô´',999,999),('¹Ô´Ò',1000,1000),('¹ÔµÂì',1001,1001),('¹ÒµÂÒ',982,982),('¹ÔµÂÒ',1002,1002),('¹ÔµÔ',1003,1003),('¹ÕµÔ',1034,1034),('¹ÔµÔÁÒ',1005,1005),('¹ÔµÔ¾§Éì',1004,1004),('¹Ô·ÃÒ',1006,1006),('¹Ô·Ñȹì',1007,1007),('¹Ô·ÑȹÕÂì',1008,1008),('¹Ô¸ÔÇ´Õ',1009,1009),('¹Ô»»Í¹à¾¹µì(»ÃÐà·Èä·Â)',1010,1010),('¹Ô¾Ñ·¸Ò',1013,1013),('¹Ô¾Ñ¹',1014,1014),('¹Ó¾Å',990,990),('¹Ô¾Å',1012,1012),('¹Ô¾¹¸ì',1011,1011),('¹Å¾Ãó',953,953),('¹ÄÁÒ³',952,952),('¹ÄÁÅ',951,951),('¹Ä³Õ',948,948),('¹Ä´Õ',949,949),('¹Ä·¸Ôì',950,950),('¹¤Ã',907,907),('¹¤Ã»°Á Î͹´éÒ¤ÒÃìÊì (1994)',908,908),('¹§Åѡɳì',911,911),('¹§ª¹¡',909,909),('¹§¹Øª',910,910),('¹·',912,912),('¹·Õ',914,914),('¹·Ô¹',913,913),('¹¹·ÈÑ¡´Ôì',915,915),('¹¾Ãѵ¹ì',924,924),('¹¾ÁÒÈ',923,923),('¹¾à¡éÒ',916,916),('¹¾ÇÃó',926,926),('¹¾Ò¾Ã',927,927),('¹¾ÄÔ·¸Ôì',925,925),('¹¾´Å',917,917),('¹¾´ÅÂì',918,918),('¹¾·Ñµ',919,919),('¹¾¾Ã',921,921),('¹¾¾Å',922,922),('¹¾¾§¤ì',920,920),('¹ØÈÃÒ',1039,1039),('¹ØÊÃÒ',1041,1041),('¹ØʺÒ',1040,1040),('¹ØªÂÒ',1037,1037),('¹ØªÃÕ',1038,1038),('¹Øª¨ÃÔ¹·Ãì',1035,1035),('¹Øª¹Ò¶',1036,1036),('ºÃç',1050,1050),('ºÃÃà¨Ô´',1049,1049),('ºÃÃÊÒÃ',1051,1051),('ºÃè§',1047,1047),('ºÃèº',1048,1048),('ºÃÔÇÃõ',1052,1052),('ºÇêÑÂ',1053,1053),('ºÑ§ÍÃ',1054,1054),('ºÑ­ªÒ',1055,1055),('ºÑ­­ÑµÔ',1056,1056),('ºÑ³±Ôµ',1057,1057),('ºÑ³±ÔµÂì',1058,1058),('ºÑµÃ¡ÃاÈÃÕÍÂظÂÒ',1060,1060),('ºÑµÃ¡Ãاä·Â',1059,1059),('ºÑ¹Å×ÍÈÑ¡´Ôì',1061,1061),('ºÕ á͹´ì «Õ ¾ÙÅÒÊ¡Õé',1067,1067),('ºÕ ÇÒ ¤ÍÃìâ¾àêÑè¹ ¨Ó¡Ñ´',1066,1066),('ºÕ.àÍç¹.ºÃÒà´ÍÃì',1068,1068),('ºÕ.àÍÊ.äÍ.àËÅç¡¡èÍÊÃéÒ§',1069,1069),('ºÓÃاä·Â',1064,1064),('ºÔǵÕéᾤ',1065,1065),('ºÒ§¡Í¡ªÕ·àÁç··ÑÅ',1062,1062),('ºÒ¹ªéÍÂ',1063,1063),('ºÙê·Êì (»ÃÐà·Èä·Â)',1111,1111),('ºÙê·ÊìáÁ¹Ùῤà¨ÍÃìÃÔè§ (»ÃÐà·Èä·Â)',1112,1112),('º§¡ª',1044,1044),('º§¡µÃѵ¹ì',1045,1045),('º«ì ÍÔ¹â¿Ãì à«ÍÃìÇÔÊ',1046,1046),('ºØÃÑ­ªÅÕ',1101,1101),('ºØÃÔ¹·Ãì',1102,1102),('ºØÈÃÒ',1103,1103),('ºØÉÂÒ',1108,1108),('ºØÉÃÒÀóì',1109,1109),('ºØÈÃÔ¹·Ãì',1105,1105),('ºØÈÃÒ¾Ã',1104,1104),('ºØËÅÑè¹',1110,1110),('ºØÉ¡Ã',1106,1106),('ºØɺÒ',1107,1107),('ºØ­àÂÕèÂÁ',1085,1085),('ºØ­ÃèÇÁ',1086,1086),('ºØ­áʧ',1098,1098),('ºØ­ÃÑ¡',1087,1087),('ºØ­Âѧ',1084,1084),('ºØ­ÁÕ',1083,1083),('ºØ­àÅÔÈ',1090,1090),('ºØ­à¡ÕÂõÔ',1070,1070),('ºØ­àªÔ´',1075,1075),('ºØ­ÈÃÕ',1091,1091),('ºØ­Êè§',1093,1093),('ºØ­ÈÔÃÔ ´ÕÇÔÅÍ»àÁ¹·ì',1092,1092),('ºØ­ÊÔ¹',1095,1095),('ºØ­Ê¹Í§',1094,1094),('ºØ­Ê׺',1096,1096),('ºØ­ÊØ¢',1097,1097),('ºØ­ÅѺ',1088,1088),('ºØ­Å×Í',1089,1089),('ºØ­¤§',1071,1071),('ºØ­ªèÇÂ',1072,1072),('ºØ­ªÑÂ',1073,1073),('ºØ­ªØº',1074,1074),('ºØ­«é͹',1076,1076),('ºØ­·ÃѾÂì',1077,1077),('ºØ­·ÇÕ',1078,1078),('ºØ­·Í§',1079,1079),('ºØ­¸ÃÃÁ',1080,1080),('ºØ­»ÃÐÊÔ·¸Ôì',1081,1081),('ºØ­¾§Éì',1082,1082),('ºØ³±Ôµ',1099,1099),('ºØ»¼Ò',1100,1100),('»ÃÐ⪹ì',1179,1179),('»ÃÐàÇÈ',1186,1186),('»ÃÐÁÇÅ',1171,1171),('»ÃÐàÊÃÔ°',1193,1193),('»ÃÐÁѾÃ',1172,1172),('»ÃÐÀÑÊ',1163,1163),('»ÃÐÀÑÊÃì',1164,1164),('»ÃÐÀÑÊÃÒ¾Ã',1165,1165),('»ÃÐÀÑÊÊÃ',1166,1166),('»ÃÐÀÒÀóì',1169,1169),('»ÃÐÀÒÊ',1170,1170),('»ÃÐÂÔ¹',1175,1175),('»ÃÐÀÒ¾Ã',1167,1167),('»ÃÐÀÒ¾Ãó',1168,1168),('»ÃÐÂÙÃ',1177,1177),('»ÃÐÂÙÃÈÃÕ',1178,1178),('»ÃÐÁÙÅ',1173,1173),('»ÃЧ¤ì',1174,1174),('»ÃÐà·×ͧ',1156,1156),('»ÃÐÂØ·¸',1176,1176),('»ÃÐÇѵÃ',1180,1180),('»ÃÐÇѵÔ',1181,1181),('»ÃÐÇÕ³Ò',1185,1185),('»ÃÐÇÔµÃ',1182,1182),('»ÃÐÇÔ·',1183,1183),('»ÃÐÇÔ·Âì',1184,1184),('»ÃÐÊÒÃ',1190,1190),('»ÃÐÊÒ·',1188,1188),('»ÃÐÊÔ·¸Ôì',1191,1191),('»ÃÐÊÒ¹',1189,1189),('»ÃÐʧ¤ì',1187,1187),('»ÃÐÊ׺',1192,1192),('»ÃÐä¾',1162,1162),('»ÃСͺ',1138,1138),('»ÃСÒÈ',1139,1139),('»ÃСÒÈÔµ',1140,1140),('»ÃСԨ',1141,1141),('»ÃСԵ',1142,1142),('»ÃФͧ',1143,1143),('»ÃШǺ',1145,1145),('»ÃШѡÉì',1146,1146),('»ÃШԵÃ',1147,1147),('»ÃШ§¨Ôµ',1144,1144),('»ÃЪÒ',1148,1148),('»ÃЪԵ',1149,1149),('»ÃЪØÁ¾Ã',1150,1150),('»Ãгµ',1151,1151),('»ÃдÔÉ°ì',1152,1152),('»ÃзѺã¨',1153,1153),('»Ãзջ',1154,1154),('»ÃзØÁ·Ô¾Âì',1155,1155),('»ÃоѲ¹ì',1160,1160),('»Ãоѹ¸ì',1161,1161),('»Ãоķ¸Ôì',1159,1159),('»Ãо¨¹ì',1157,1157),('»Ãо¹¸ì',1158,1158),('»ÀÑÊÊÃ',1132,1132),('»ÃѪ­Ò',1194,1194),('»ÃÒâÁ·Âì',1200,1200),('»ÃÕÂÒÀóì',1213,1213),('»ÃÔÂÒÇÃó',1208,1208),('»ÃÒö¹Ò',1201,1201),('»ÀÒÇÃÔ¹·ì',1135,1135),('»ÀÒÇÕ',1136,1136),('»ÀÒÇ´Õ',1134,1134),('»ÃÔȹÒ',1209,1209),('»ÃÔȹÕ',1210,1210),('»ÃÒ¡ÒÃ',1195,1195),('»ÃÒ§³Õ',1196,1196),('»ÃÕªÒ',1211,1211),('»ÃÒª­ì',1197,1197),('»ÃÕ­Ò',1212,1212),('»ÃÔ­­ì',1202,1202),('»ÃÔ­­Ò',1203,1203),('»ÃÔ­´Ò',1204,1204),('»ÃÒ³Õ',1198,1198),('»ÃÒ³ÕÂì',1199,1199),('»ÃÔ³´Ò',1205,1205),('»ÀÒ³Ø',1133,1133),('»ÃÔ·ÑÈ',1206,1206),('»ÃÔ¹´Ò',1207,1207),('»ÂصÒ',1137,1137),('»ÇÕ³ÃѪ',1214,1214),('»ÇÕ³Ò',1215,1215),('»Êѹµì',1216,1216),('»Êѹ¹ì',1217,1217),('»Í§À¾',1218,1218),('»Ñ­¨ÃÑÈÁÔì',1219,1219),('»Ñ­­Ò',1220,1220),('»Ñ­­Ò¾Ã',1221,1221),('»Ñ­­Ò¾Å',1222,1222),('»Ñ³ÃÊÕ',1223,1223),('»Ñ·Á',1224,1224),('»Ñ·ÁÒ',1225,1225),('»Ñ·ÁÒÇ´Õ',1226,1226),('»ÔÂÃѵ¹ì',1246,1246),('»ÔÂÁÒÀóì',1245,1245),('»ÔÂÇÃó',1247,1247),('»ÔÂÇѲ¹ì',1248,1248),('»ÔÂÐ',1250,1250),('»ÔÂÐÁÒÈ',1259,1259),('»ÔÂÐÈÑ¡´Ôì',1260,1260),('»ÔÂЪÑÂ',1251,1251),('»ÔÂйѹ·ì',1253,1253),('»ÔÂй¹·ì',1252,1252),('»ÔÂйت',1254,1254),('»ÔÂоÃ',1256,1256),('»ÔÂоѹ¸ì',1257,1257),('»ÔÂоѹ¸Øì',1258,1258),('»ÔÂо§Èì',1255,1255),('»ÔÂÈÑ¡´Ôì',1249,1249),('»ÒÃÔªÒµ',1230,1230),('»ÒÃÔªÒµÔ',1231,1231),('»ÒÃÕ³Ò',1233,1233),('»ÔÂÒ¾Ã',1261,1261),('»ÒÃԾѹ¸ì',1232,1232),('»Ô¡ҭ¨¹ì',1239,1239),('»Ô¹ѹ·ì',1240,1240),('»Ô¹ү',1241,1241),('»Ô¾Ã',1244,1244),('»Ô¾§Èì',1242,1242),('»Ô¾§Éì',1243,1243),('»Ôè¹ÁÒ⹪',1238,1238),('»Ôè¹Á³Õ',1237,1237),('»Ò˹ѹ',1234,1234),('»ÔÅѹ­Ò',1262,1262),('»Ò³ÔÊÃÒ',1227,1227),('»ÔµÔ',1235,1235),('»ÔµÔÇѪÃì',1236,1236),('»Ò¹',1228,1228),('»Ò¹à¾ªÃ',1229,1229),('»¡Ã³ì',1119,1119),('»®ÔÁÒ',1120,1120),('»¯ÔÁÒ',1123,1123),('»¯Ô­­Ò',1121,1121),('»¯Ô¾Å',1122,1122),('»°ÁÇѲ¹ì',1124,1124),('»³Ô´Ò',1126,1126),('»³ÔµÒ',1127,1127),('»³ªÑÂ',1125,1125),('»·ØÁ',1128,1128),('»·ØÁÒ',1130,1130),('»·ØÁ¾Ã',1129,1129),('»¹Ñ´´Ò',1131,1131),('»Ø³³ÂÒ',1263,1263),('¼à´ÔÁ',1277,1277),('¼èͧÈÃÕ',1279,1279),('¼èͧ¾Ãó',1278,1278),('¼è͹»ÃÐÀÒ',1280,1280),('¼èÒ¡ÒäÅѧ¡Í§¡ÅÒ§Êӹѡ»ÅÑ´¡Ãا෾ÁËÒ¹¤Ã',1285,1285),('¼éÒ¢¹Ë¹ÙªÔ¹àΧ',1281,1281),('¼éÒ¢¹Ë¹Ù«Ô¹àΧ',1282,1282),('¼éҢع˹٫ԹàΧ',1283,1283),('¼èÒ¹¿éÒ àÍ繨Ôà¹ÕÂÃÔè§',1284,1284),('¼ÒÊØ¢',1286,1286),('¼ÙéãË­èàÅç¡',1289,1289),('¼Ùé༴ç¨',1288,1288),('¼¡Ò¡Ãͧ',1272,1272),('¼¡Ò¾Ãó',1273,1273),('¼§',1274,1274),('¼¨§¨Ôµµì',1275,1275),('¼´Ø§ÈÑ¡´Ôì',1276,1276),('¼ØÊ´Õ',1287,1287),('½èÒ¡ÒäÅѧ¡Í§¡ÅÒ§ Êӹѡ»ÅÑ´¡Ãا෾ÁËÒ¹¤Ã',1293,1293),('¾Ã',1319,1319),('¾ÃÁ§¤Åà¿ÍÃì¹Ôà¨ÍÃì',1338,1338),('¾ÃóÃÒ³ì',1344,1344),('¾ÃóÊóì',1345,1345),('¾ÃóÕ',1347,1347),('¾ÃóԡÒ',1346,1346),('¾Ãó·ÔÀÒ',1339,1339),('¾Ãó¹ÔÀÒ',1340,1340),('¾Ãó»ÃÐä¾Ç´Õ',1341,1341),('¾Ãó¾ÃÃÉ',1342,1342),('¾Ãó¾ÔÁÅ',1343,1343),('¾Ãà·¾',1326,1326),('¾ÃøԴÒ',1348,1348),('¾Ãà¾ç­',1337,1337),('¾ÃÇÔÁÅ',1349,1349),('¾ÃÇÔäÅ',1350,1350),('¾ÃÐÃÒÁ 3 Î͹´éÒ¤ÒÃìÊì',1360,1360),('¾ÃÐÃÒÁ 3 ¤ÒÃìà«ç¹àµÍÃì',1359,1359),('¾ÃлÃÐá´§ Î͹´éÒ¤ÒÃìÊì',1357,1357),('¾ÃлÃÐá´§ Î͹´éÒ¤ÒÃìÊì ¨Ó¡Ñ´',1358,1358),('¾ÃÊÃǧ',1353,1353),('¾ÃËÁ¾Ñ²¹ì',1355,1355),('¾ÃÊÇÃäì',1354,1354),('¾ÃéÍÁªÑÂ',1356,1356),('¾ÃÈÑ¡´Ôì',1351,1351),('¾ÃÈÔÃÔ',1352,1352),('¾ÃÕàÁÕÂÃìà¤ÁÔ¤ÑÅ á͹´ì¾ÅÒʵԡ',1362,1362),('¾ÃÕàÁÕÂÃìÍÔ¹àµÍÃìÅÔ««Ôè§',1363,1363),('¾ÃÔéÁà¾ÃÒ',1361,1361),('¾Ã¡ÇÕ',1320,1320),('¾Ã¨Ôµµì',1321,1321),('¾ÃªÑÂ',1322,1322),('¾Ã·ÔÀÒ',1325,1325),('¾Ã·Ô¾Âì',1323,1323),('¾Ã·Ô¾Ò',1324,1324),('¾Ã¹ÀÒ',1328,1328),('¾Ã¹ÔµÔ¿ÔÅìÁá͹´ìÇÕ´ÕâÍ',1329,1329),('¾Â¹µì',1317,1317),('¾Ã¹·Õ',1327,1327),('¾Ã¾Ãó',1332,1332),('¾Ã¾ÔÁÅ',1335,1335),('¾Ã¾ÔäÅ',1336,1336),('¾Ã¾Å',1333,1333),('¾Ã¾ÅÒ§ÒÁ',1334,1334),('¾Ã¾§Éì',1330,1330),('¾Ã¾¹Ò',1331,1331),('¾Âا',1318,1318),('¾Ç§Ãѵ¹ì',1372,1372),('¾Ç§à¾ç­',1371,1371),('¾Ç§·Í§',1370,1370),('¾ÈÔ¹',1373,1373),('¾ÊØࡵÔì',1374,1374),('¾ÑʾÃ',1391,1391),('¾ÑÅÅÀ',1390,1390),('¾ÑªÃ',1376,1376),('¾ÑªÃÇäÅ',1377,1377),('¾ÑªÃÒ',1378,1378),('¾ÑªÃÕ',1382,1382),('¾ÑªÃÒÀóì',1379,1379),('¾ÑªÃÕÀóì',1384,1384),('¾ÑªÃÒÀÒ',1380,1380),('¾ÑªÃÔ¹·Ãì',1381,1381),('¾ÑªÃÕ¾Ã',1383,1383),('¾Ñª¹Õ',1375,1375),('¾Ñ²·ÇÕ',1385,1385),('¾Ñ²¹Ð',1387,1387),('¾Ñ²¹ªÑÂ',1386,1386),('¾Ñ²¾§Éì',1388,1388),('¾Ñ·¸ì¸ÕÃÒ',1389,1389),('¾Ô ÈÁÑÂ',1397,1397),('¾Õ.àÍÊ.¨Õ ÅÔÊ«Ôè§',1439,1439),('¾Õ.àÍÊ.¾ÅÒʵԡºÃÒà´ÍÃì á͹´ì«Ñ¹',1440,1440),('¾Õ.àÍÊ.¾ÅÒʵԡºÃÒà´ÍÃìá͹´ì«Ñ¹',1441,1441),('¾Õ.«Õ.àºÊ·ì ¤ÃÕàÍ·',1438,1438),('¾ÔÃÁÂì',1430,1430),('¾ÔÁÀÒ',1428,1428),('¾ÕÃÇزÔ',1446,1446),('¾ÕÃÐ',1448,1448),('¾ÕÃÐÈÑ¡´Ôì',1451,1451),('¾ÕÃоÅ',1450,1450),('¾ÕÃо§Èì',1449,1449),('¾ÕÃÈÔÅ»ì',1447,1447),('¾ÒÃҡ͹ÍÔ¹â¿à·¤',1396,1396),('¾ÔÁÅ',1429,1429),('¾ÔàªÉ°',1409,1408),('¾ÔàªÉ°ì',1408,1409),('¾Ôય',1406,1406),('¾Ôય°ì',1407,1407),('¾Òâµà¤ÁÕÍصÊÒË¡ÃÃÁ',1394,1394),('¾Õ÷ѵ',1444,1444),('¾Ôà·¾',1415,1415),('¾ÔÀ¾',1420,1420),('¾ÔÁ¾ìÀóì',1425,1425),('¾ÔÁ¾ìÀѤ',1426,1426),('¾ÔÁ¾ìã¨',1421,1421),('¾ÔÁ¾ìÇÔÁÅ',1427,1427),('¾ÔÁ¾ìª¹¡',1422,1422),('¾ÔÁ¾ì»ÃоÃó',1423,1423),('¾ÔÁ¾ì¾Ã',1424,1424),('¾ÕþѲ¹ì',1445,1445),('¾ÔÃس',1431,1431),('¾ÔÊÁÑÂ',1434,1434),('¾ÔÈÔÉ°ì',1432,1432),('¾ÔÊÔÉ°ì',1437,1437),('¾ÔÊÔ°',1435,1435),('¾ÔÊÔ·¸Ôì',1436,1436),('¾ÔɳØ',1433,1433),('¾Ô¨ÔµÃÒ',1398,1398),('¾ÔªÂÒ',1401,1401),('¾ÔªÑÂ',1402,1402),('¾ÔªÑÂÇѲ¹ì',1403,1403),('¾ÔªÔµ',1404,1404),('¾ÔªÔµ¾Å',1405,1405),('¾Ôª­ì',1399,1399),('¾Ôª´Ò',1400,1400),('¾Ô±ÙÃÂì',1410,1410),('¾Ò³Õ',1393,1393),('¾Ò³ÔªÂì',1392,1392),('¾Ô³ªØ´Ò',1411,1411),('¾Ô³¹ÀÒ',1412,1412),('¾Ô·ÂÒ',1413,1413),('¾Ô·Ñ¡Éì',1414,1414),('¾Ô¸Ò¹¡Ã',1416,1416),('¾Õ¹Ô¡«ì àÍç¡«ìà¾ÃÊ',1442,1442),('¾Õ¹Ô¡«ìàÍç¡«ìà¾ÃÊ',1443,1443),('¾Ò¹·Í§',1395,1395),('¾Ô¹¹ÔÀÒ',1417,1417),('¾ÔºÙÅÂì',1418,1418),('¾Ô¾Ñ²¹ì',1419,1419),('¾Ùŷͧ¾Ãç;à¾ÍÃìµÕé_',1454,1454),('¾ÙżÅ',1455,1455),('¾Ù¹ÈÑ¡´Ôì',1453,1453),('¾Ù¹¾Ñ¹¸ì',1452,1452),('¾Åà·¾',1366,1366),('¾ÅÊÔ·¸Ôì',1369,1369),('¾Å¡Äɳì',1364,1364),('¾ÅªÑÂ',1365,1365),('¾Å¾ÑªÃì',1367,1367),('¾Å¾Ñ²¹ì',1368,1368),('¾§ÈìÀѤ',1300,1300),('¾§Èìà¡ÕÂõÔ',1294,1294),('¾§Èìà·¾',1296,1296),('¾§Éìà·¾',1302,1302),('¾§ÉìÈÑ¡´Ôì',1304,1304),('¾§ÉìÊѹµì',1305,1305),('¾§ÈìÊØà¡ÉÁ',1301,1301),('¾§Éì͹ѹµì',1306,1306),('¾§ÈìªÒÂ',1295,1295),('¾§Éì¾Ã',1303,1303),('¾§Èì¾Ñ¹¸ì',1298,1298),('¾§Èì¾Ô¾Ñ²¹ì',1299,1299),('¾§È¸Ã',1297,1297),('¾¨ÁÒÅÂì',1312,1312),('¾¨ÁÒ¹',1311,1311),('¾¨¹ì',1307,1307),('¾¨¹Ò',1308,1308),('¾¨¹ÕÂì',1310,1310),('¾¨¹Òö',1309,1309),('¾¹Á',1313,1313),('¾¹ÁªÑÂ',1314,1314),('¾¹ÒÊѹ±ì',1315,1315),('¾¹Ô´Ò',1316,1316),('¿Õ¹Ô¡«ì àÍç¡«ìà¾ÃÊ',1493,1493),('¿ÅØÊÊÔ¡à¤Á',1492,1492);
+SELECT name FROM t1 ORDER BY name;
+name
++45 BRETT
++55 BRETT
++56 BRETT
+-.55 BRETT
+-45 BRETT
+-55 BRETT
+.-55 BRETT
+.55 BRETT
+45 BRETT
+5 5 BRETT3
+5 5 BRETT2
+5 5 BRETT1
+5-5 BRETT
+55 BRETT
+55+ BRETT
+55- BRETT
+55. BRETT
+CHEE KUNG FOOK
+CHEN CHIA YI
+CHI WAI DAVIT
+GEORGE
+KAWAIJIT
+KAWALJIT
+KOJI
+LOUIS
+PETER
+SHERMAN
+TAN
+Willem Arnold
+WONG
+WU
+¡.µÃÕ·Ô¾Âì ¤Í¹«ÑÅáµ¹·ì
+¡ª¡Ã
+¡ª¾Ã
+¡ªÁÅ
+¡µÑ­­Ù
+¡¹¡
+¡¹¡¡Ò­¨¹ì
+¡¹¡ªÑÂ
+¡¹¡¹ÔÀÒ
+¡¹¡¹Øª
+¡¹¡¾Ã
+¡¹¡Ãѵ¹ì
+¡¹¡Ä·¸Ôì
+¡¹¡ÇÃó
+¡¹¡ÈÃÕ
+¡¹¡Ò­¨¹ì
+¡¹ÔÉ°Ò
+¡ÁÅ
+¡ÁũѵÃ
+¡ÁÅ·Ô¾Âì
+¡ÁžÃ
+¡ÁžÃó
+¡ÁÅÁÒÅÂì
+¡ÁÅÃѪµì
+¡ÁÅÃѵ¹ì
+¡ÁÅÇÃó
+¡Ã¡¹¡
+¡Ã¡¾Ã
+¡Ã¡ÁÅ
+¡ÃªÑÂ
+¡Ã³ì
+¡Ã¹Ñ¹·ì
+¡Ã»ÃÕÂÒ
+¡ÃíԡÒÃì
+¡ÃóԡÒ
+¡ÃóԡÒÃì
+¡ÃÇÅÑÂ
+¡ÃÇÔ·Âì
+¡Ãͧá¡éÇ
+¡Ãͧ·Ô¾Âì
+¡ÃШ¡ä·ÂÍÒ«ÒÎÕ
+¡ÃÕ±Ò
+¡Ãا෾¼ÅÔµàËÅç¡
+¡Ãاä·Â¤ÒÃìàÃé¹·ì ÍÔ¹àµÍÃì๪Ñè¹á¹Å
+¡Ãاä·ÂÍØ»¡Ã³ì
+¡ÃسÒ
+¡ÄªÇÃó
+¡Äµº¾Ô¸
+¡ÄµÂÒ
+¡ÄµÔ¡Ò¹·ì
+¡ÄµÔÂÒ
+¡ÄȾÃó
+¡ÄÉ®Ò
+¡ÄÉ®Õ
+¡ÄɮվÃ
+¡Äɳ¾¨¹ì
+¡Äɳ¾Å
+¡ÄɳÐ
+¡ÄɳÒ
+¡ÄɳÕ
+¡ÄÉ´Ò
+¡ÇÕ
+¡ÉÁÒ
+¡ÉÔª­ì
+¡ÉÔ´ÔÈ
+¡ÊÔÇѹ
+¡èÍà¡ÕÂõÔ
+¡Íº¡ØÅ
+¡Íºá¡éÇ
+¡ÍººØ­
+¡ÍºÅÒÀ
+¡Ñ ÅÂÒ
+¡Ñ­ª¾Ã
+¡Ñ­­ÀѤ
+¡Ñ­­ìÇÃÒ
+¡Ñ­­ÒÁÒÈ
+¡Ñ­­ÒÇÕÃì
+¡Ñ³°ªÒ
+¡Ñ³°Ô¡Ò
+¡Ñ³·ÔÁÒ
+¡Ñ¹µì
+¡Ñ¹µÔ¡Ã
+¡Ñ¹¸ÔªÒ
+¡Ñ¹¸ÔÁÒ
+¡Ñ¹ÂÒÃѵ¹ì
+¡ÑÁ»¹Ò¶
+¡ÑÁ»¹Ò·
+¡ÑÅÂÒ
+¡ÑÅÂÒ³Õ
+¡ÑÅÂÒÃѵ¹ì
+¡Ò­¨¹ÇÃó
+¡Ò­¨¹Ò
+¡Ò¹´Ò
+¡Ò¹µì
+¡Ò¹µìÃÇÕ
+¡ÒÂÊÔ·¸Ôì
+¡ÒÃÇÔÍÃ
+¡ÒÃسÕ
+¡ÒÈÔ
+¡Ó¸Ã
+¡Ó¾Å
+¡ÓäÃ
+¡Óá˧
+¡Ô觡ҭ¨¹ì
+¡Ô¨µÔÂÒ
+¡Ô¨ÇÃó
+¡ÔµµÔ
+¡ÔµµÔ¡Ñ¹µì
+¡ÔµµÔªÑÂ
+¡ÔµµÔ­Ò
+¡ÔµµÔ¹Ñ¹·ì
+¡ÔµµÔ¾§Èì
+¡ÔµµÔ¾§Éì
+¡ÔµµÔ¾Å
+¡ÔµµÔ¾Ñ²¹ì
+¡ÔµµÔ¾Ñ¹¸ì
+¡ÔµµÔÁÒ
+¡ÔµµÔÂÒ
+¡ÔµµÔÃѵ¹ì
+¡ÔµµÔÇѲ¹ì
+¡ÔµµÔÈÑ¡´Ôì
+¡ÔµÔ¡Ã
+¡ÔµÔ¡Ã³ì
+¡ÔµÔ¡Ñ­­Ò
+¡ÔµÔªÒ­
+¡ÔÁÅÑé§
+¡ÕõÔ
+¡ØÁØ·¾Ñ¹¸ì
+¡ØéÂà«é§ ÍÔÁ»ÍÃìµ á͹´ì àÍç¡«ì»ÍÃìµ
+¡ØŹѹ·ì
+¡ØŹÒÃÕ
+¡ØÅÂÒ
+¡ØÅÅ´Ò
+¡ØÅÇ´Õ
+¡ØÅÈÔÃÔ
+¡ØÊØÁÒ
+¡ØËÅÒº
+¡Ùê´ÇÔÅ ÍÔ¹´ÑʵÃÕé
+à¡ç¨¾ÔÃس
+ࡪÒ
+ࡳԡÒ
+ࡵØÁ³Õ
+à¡ÃÔ¡
+à¡ÃÔ¡ä¡Ã
+à¡ÃÔ¡¾§Éì
+à¡ÃÕ§ä¡Ã
+à¡ÃÕ§ªÑÂ
+à¡ÃÕ§§ÍÔ¹àµÍÃì๪Ñè¹á¹Å
+à¡ÃÕ§ÈÑ¡´Ôì
+à¡È¡ØÅÀÒ
+à¡ÈÃÒ
+à¡ÈÃÔ¹·Ãì
+à¡ÈÇÅÕ
+à¡ÈÈÔÃÔ
+à¡ÈÊØ´Ò
+à¡ÈÔ¹Õ
+à¡É³Õ
+à¡É´Ò
+à¡ÉÁ
+à¡ÉÁÊѹµì
+à¡ÉÃÒ
+à¡ÉÃÕ
+à¡ÉÕÂÃ
+à¡ÊÃ
+à¡ÊÃì
+à¡ÕÂõÔ
+à¡ÕÂõԻÀÒ
+à¡ÕÂõԾ§Éì
+à¡ÕÂõÔÈÑ¡´Ôì
+à¡ÕÂõÔÊÇÑÊ´Ôì
+à¡×éÍ¡ÙÅ
+á¡éÇ
+á¡éÇã¨
+â¡Ážѹ¸ì
+â¡àÁÈ
+â¡ÅºÍÅ ¤Í¹à¹ç¤ªÑè¹Êì
+â¡ÇÔ·
+â¡ÇÔ·Âì
+â¡ÇÔ¹
+â¡àÇȹì
+â¡ÈÅ
+â¡ÊÔ¹·Ãì
+ä¡Ã¤Ó
+ä¡Ãà·¾
+ä¡Ã¸ÇѪ
+¢¨Ã
+¢¨Ãà¡ÕÂõÔ
+¢¨ÃÈÃÕ
+¢¨ÃÈÑ¡´Ôì
+¢¹ÔÉ°ì
+¢¹ÔÉ°Ò
+¢ÇÑ­ã¨
+¢ÇÑ­ªÑÂ
+¢ÇÑ­à´×͹
+¢ÇÑ­µÒ
+¢ÇÑ­à¾çªÃ
+¢ÇÑ­àÁ×èͧ
+¢ÇÑ­ÂؾÒ
+¢ÇÑ­ÃØé§
+¢ÇÑ­àÃ×͹
+¢ÑµµÔÂÒ³Õ
+¢éÒÇÍÔèÁ·Ô¾Âì
+¢Ø¹·Í§
+á¢ä¢
+¤§¡ÄÈ
+¤§à´ª
+¤àª¹·Ãì
+¤³Ò¡Ã
+¤³ÒÇزÔ
+¤³ÔÈÃ
+¤³ÔÊÃ
+¤³ØµÁì
+¤à³È
+¤¸Ò
+¤à¹Âì
+¤Á¡ÃÔª
+¤Á¨Ñ¡Ã
+¤Áà¾çªÃ
+¤ÃÒ¿·ìà´ÍÐàºÊ·ì
+¤ÍÊÁÔ¤ ¤Í¹¤ÍÃì´ ¤ÍÃì»ÍàêÑè¹
+¤Ò«ÙâÍÐ
+¤ÒÃìâ»Ãà¿ÊªÑè¹á¹Å
+¤ÒÇÒ¤Ô¹
+¤Óó
+¤Óá˧
+¤ÔÁ§¤ì
+¤Ø³Ò¡Ã
+¤Ø³Õ·Ã
+¤ÙèºØ­
+¤Ù»Ò¹Ò
+ठÊËÒÂÍÔÁà»ê¡«ì
+à¤.«Õ.¾Õ. áÁªªÕ¹à¹ÍÃÕè
+षշÕÅÔÊ«Ôè§
+ह áÁ¡«ì (»ÃÐà·Èä·Â)
+ह áÁç¡«ì (»ÃÐà·Èä·Â)
+à¤Ã×ÍÇÑÅÂì
+᤹¹Ù ÍÔ¹àµÍÃìà·Ã´
+á¤Ð¨éÍÂ
+â¤Ãà¹Ê (ä·ÂᏴì)
+â¦ÉÔµ
+§ÒÁ¹Ô¨
+§ÒÁà¾ç­
+à§Ô¹·Ø¹à¡ÕÂõԹҤԹ
+¨§¡Å
+¨§¡Å³Õ
+¨§ÃÑ¡
+¨§ÃÑ¡Éì
+¨§Åѡɳì
+¨µØ¾Ã
+¨µØ¾Å
+¨µØ¾Ñ¹¸ì
+¨µØç¤ì
+¨µØÄ·¸Ôì
+¨ÃÃÂÒ
+¨ÃǾÃ
+¨ÃÇÃø¹ì
+¨ÃÑ­
+¨ÃÑÅ
+¨ÃÑʪÑÂ
+¨ÃÑʾÅ
+¨ÃÔ¹·Ãì
+¨ÃÔ¹¸Ã
+¨ÃÔÂÒ
+¨ÃÔÂÒÀóì
+¨ÃظԴÒ
+¨ÃÙ­
+¨àÃ
+¨àÃÈÑ¡´Ôì
+¨ÍÁ¢ÇÑ­ã¨
+¨Ñ¡Ã¡Äª
+¨Ñ¡Ã¡Äɳì
+¨Ñ¡Ã¾Ñ¹¸ì
+¨Ñ¡ÃÇÒÅ
+¨Ñ¡Ãѵ¹ì
+¨Ñ¡ÃÔ¹·Ãì
+¨Ñ¡ÃÕ
+¨Ñ¡ÉÇѯ
+¨Ñ´ËÒ§Ò¹ÎÔÇáÁ¹àÍ繨Ôà¹ÕÂÃÔè§
+¨ÑµÃ´ÒÇ
+¨Ñ¹¨ÔÃÒ
+¨Ñ¹··Õ
+¨Ñ¹·¹Ò
+¨Ñ¹·Ã
+¨Ñ¹·Ãìà¨éÒ
+¨Ñ¹·Ãì·Ô¾Âì
+¨Ñ¹·Ãì¸ÔÀÒ
+¨Ñ¹·Ãì¹ÀÒ
+¨Ñ¹·Ãì¾Ã
+¨Ñ¹·Ãìà¾ç­
+¨Ñ¹·ÃìÃѵ¹ì
+¨Ñ¹·ÃìÇÔÁÅ
+¨Ñ¹·ÃìÇÔäÅ
+¨Ñ¹·ÃìÊØ´Ò
+¨Ñ¹·Ô¡Ò
+¨Ñ¹·ÔÀÒ
+¨Ñ¹·ÔÁÒ
+¨Ñ¹·ÔÁÒÀóì
+¨Ñ¹·ÔÃÒ
+¨ÒµØ¾Ã
+¨ÒµØç¤ì
+¨ÒµØùµì
+¨ÒÃÕÃѵ¹ì
+¨ÒÃسÕ
+¨ÒÃسÕÂì
+¨ÒÃعѹ
+¨ÒÃغصÃ
+¨ÒÃØÃѵ¹ì
+¨ÒÃØÇÃó
+¨Ó¹§
+¨Ó¹§¤ì
+¨Ó»Õ
+¨ÓÃÑÊ
+¨ÓàÃÔ­
+¨ÓÅͧ
+¨Ô³³ì
+¨Ôµµì
+¨Ôµµì¹ÔÉÒ
+¨ÔµµÁÒÊ
+¨ÔµµÒ
+¨ÔµµÔ
+¨ÔµµÔ¹¹Ñ¹·ì
+¨ÔµÃÅ´Ò
+¨ÔµÃÒ
+¨ÔµÃÒÀóì
+¨Ô¹´Ò
+¨Ô¹µì¨Ø±Ò
+¨Ô¹µ¹Ò
+¨ÔþÃ
+¨Ôþѹ¸ì
+¨ÔÃÀÑ·Ã
+¨ÔÃÀÒ
+¨ÔÃÇÃó
+¨ÔÃÇѲ¹ì
+¨ÔÃÈÑ¡´Ôì
+¨ÔÃÊØ´Ò
+¨ÔÃоÃ
+¨ÔÃоÃó
+¨ÔÃÐÀÒ
+¨ÔÃÐÈÑ¡´Ôì
+¨ÔÃѪ´Ò
+¨ÔÃÑ°µÔì
+¨ÔÃÒ¤Á
+¨ÔÃҹت
+¨ÔÃÒ¾Ã
+¨ÔÃÒÀóì
+¨ÔÃÒÀÒ
+¨ÔÃÒÂØ
+¨ÔÃÒÇÃó
+¨ÔÃÒÇÑÅÂì
+¨ÔÃÒÇزÔ
+¨Õ·Õ«Õ ·Ã§¾Ñ¹¸ì)
+¨ÕþÃó
+¨ÕÃÈÑ¡´Ôì
+¨ÕÃйѹ·ì
+¨ÕÃÐÇѲ¹ì
+¨ÕÍÕ á¤»»ÔµÍÅ (»ÃÐà·Èä·Â)
+¨ÕâÍà·¤¹Ô¤ (ä·ÂᏴì)
+¨Ø±Ò·Ô¾Âì
+¨Ø±Ò¾Ñ¹¸ì
+¨Ø±ÒÁÒÈ
+¨Ø±ÒÁÒÊ
+¨Ø±ÒÃѵ¹ì
+¨Ø±ÒÇÃó
+¨ØÃÕÃѵ¹ì
+¨ØÅÅ´Ò
+¨ØÌÒ
+¨ØÌÒÀóì
+¨ØÌÒÀÒ
+¨ØÌÒÅѡɳì
+ਵ¹ì
+ਹ
+ਹ¨ÔÃÒ
+ਹµì³Ã§¤ì
+ਹà¹ÍÃÑÅ乫ì (»ÃÐà·Èä·Â)
+ਹÇÔ·Âì
+à¨ÃÔ­
+à¨ÃÔ­ªÑÂËÁéÍá»Å§ä¿¿éÒ
+à¨ÃÕ§
+à¨É®Ò
+à¨éÒ¾ÃÐÂÒÁÒÃì¤
+à¨ÔÁªÑÂ
+à¨ÕÂÁ¨Ôµ
+á¨èÁ
+ã¨ÊÇÇäì
+©ÅÇÂ
+©Åͧ
+©ÅÒ´
+©ÇÕÇÃó
+©Íé͹
+©ÑµÃªÑÂ
+©ÑµÃÀóì
+©ÑµÃÈÔÃÔ
+©Ñ¹·¹Ò
+©Ñ¹·Ãѵ¹ì
+©×èÍ ¨Ôé¹ ÎÑéÇ
+©×èͨÔé¹ÎÑéÇ
+à©ÅÔÁ
+à©ÅÔÁ¢ÇÑ­
+à©ÅÔÁªÑÂ
+à©ÅÔÁªÒµÔ
+à©ÅÔÁ¾Ñ¹¸Øì
+à©ÅÕÂÇ
+à©Ô¹
+â©ÁÅ´Ò
+â©ÁÊØ´Ò
+ª.ÊÂÒÁ¨Ñ¡ÃÂÒ¹à´ç¡àÅè¹
+ª®ÒÃѪ
+ª´Ò¡Ã
+ª¹¹Ñ¹·ì
+ª¹¹ÔÈÒ
+ª¹ÁìÊØÇÃó
+ª¹Ð
+ª¹Ð⪵Ô
+ª¹Ñ­­Ò
+ª¹Ñ°
+ª¹Ñ¹Àóì
+ª¹ÒÀÒ
+ª¹Ô´Ò
+ªÁ
+ªÁ¾Å
+ªÁ¾Ù¹Øª
+ªÁ¾Ù¹Ø·
+ªÁÀÑÊÊÃ
+ªÁÀٹت
+ªÁѾÃ
+ªäÁ¾Ã
+ªÂ¹
+ªÂÒ¾Å
+ªÂÒÀóì
+ªÃѪÊÃÒ
+ªÃѶ¨Ñ¹·Ãì
+ªÃÑÊÃÒ
+ªÃÔ¹·Ãì
+ªÃÔ¹Ãѵ¹ì
+ªÅ¸ÔªÒ
+ªÅ¸Õ
+ªÅÍ
+ªÅÍÁ
+ªÅÒ¡Ã
+ªÅÔ¡Ò
+ªÅÔ´Ò
+ªÅÔµ
+ªÅÔµÒ
+ªÇ¹
+ªÇ¹ªÁ
+ªÇ¹¾ÔÈ
+ªÇÅÔµ
+ªÇÔÈÒ
+ªèÍ
+ªèͩѵÃ
+ªèÍ·Ô¾Âì
+ªèÍÍÑ­ªÑ­
+ªÐ¹ÔÅ
+ªÐÍé͹
+ªÑªªÑÂ
+ªÑª®Ò
+ªÑªÀ³
+ªÑªÀÑÊÊÃ
+ªÑªÁ³±ì
+ªÑªÁ¹±ì
+ªÑªÇÒÅÂì
+ªÑªÇÒÅìÂ
+ªÑ­­Ò
+ªÑ­ÉÒ
+ªÑÂà¨ÃÔ­ãªèËÅÕʵÕÅ
+ªÑª¹Ð
+ªÑªҭ
+ªÑ³ç¤ì
+ªÑ¸ÇѲ¹ì
+ªÑ¹¤Ã
+ªÑ¹ѹ·ì
+ªÑ¾Ã
+ªÑ¾Å
+ªÑÂÀÑ·Ã
+ªÑÂÁ§¤Å
+ªÑ§³ì
+ªÑÂÂÈ
+ªÑÂÂÐ
+ªÑÂÂØ·¸
+ªÑÂÃѵ¹ì
+ªÑÂÇѲ¹ì
+ªÑÂÊÔ·¸Ôì
+ªÑÂÊÔ¹¸Øì
+ªÒ­
+ªÒ­ªÑÂ
+ªÒ­³Ã§¤ì
+ªÒ­ÂØ·¸
+ªÒ­ÈÑ¡´Ôì
+ªÒµÃÕ
+ªÒµÔªÒÂ
+ªÒ¹
+ªÒ¹¹·ì
+ªÒÂ
+ªÒÅÕ
+ªÒÇѳÂì
+ªÓ¹Ò­
+ªÓ¹Ô
+ªÔ´ª¹¡
+ªÔ¹
+ªÔ¹¾Ñ¹¸ì
+ªÔ¹Ãѵ¹ì
+ªÔ¹ÇѲ¹ì
+ªÕÇÒ¾Ã
+ª×蹨Եµì
+ªØ´Ò¾Ã
+ªØµÔ¡Ò­¨¹ì
+ªØµÔÁÒ
+ªØÁ¾Ã
+ªØÁ¾Å
+ªØÁÈÔÃÔ
+ªØÁÊÒÂ
+ªØÅÕ¾Ã
+ªÙà¡ÉÁ
+ªÙà¡ÕÂõÔ
+ªÙ¨Ôµ
+ªÙ¨Ôµµì
+ªÙªÑÂ
+ªÙªÒµÔ
+ªÙªÕ¾
+ªÙ¾§Èì
+ªÙ¾§Éì
+ªÙÈÑ¡´Ôì
+ય°¡Ã
+àªÉ°Ò
+àªÍÃÔè§-¾ÅÒÇ á͹ÔÁÑÅ àÎéŪ
+àªÍÃÔè§-¾ÅÒÇá͹ÔÁÑÅàÎçŸ
+àªÒǹҭ
+àªÒÇÅÔµ
+àªÔ´¨Ôµµì
+àªÔ´ªÑÂ
+àªÔ´ÈÑ¡´Ôì
+àªÕ§àΧ¡ÒêèÒ§
+àªÕèÂǪҭ ÍÔ¹´ÑÊ·ÃÕè (1989)
+àªÕèÂǪҭÍÔ¹´ÑÊ·ÃÕè (1989)
+àªÕèÂǪҭÍÔ¹´ÑÊ·ÃÕ (1989)
+àªÕèÂǪҭÍÔ¹´ÑÊ·ÃÕè(1989)
+⪤
+⪤ªÑÂ
+⪵Ô
+⪵ÔÃÊ
+⪵ÔÇظ
+äªÂ¹Ñ¹·¹ì
+äªÂÁ§¤Å
+äªÂÃѵ¹ì
+äªÂÒ
+«è͹¡ÅÔè¹
+«Òâµéâ¤à¡ÕÂÇ ¡Ãا෾
+«Ô¡»éÒ (»ÃÐà·Èä·Â)
+«Õ àÍç¹ äÍ
+«Õ ´Õ àÍçÁ àÍç¹àµÍÃìä¾ÃÊì
+«Õ.´Õ.ÍصÊÒË¡ÃÃÁ
+«Õ.·Õ.à·àŤÍÁ
+«Õ.ÇÕ.àÍÊ.ÍÔ¹´ÑʵÃÕé
+«Õ´Õ ÍصÊÒË¡ÃÃÁ
+«ÕàÍç¹äÍàÍ繨Ôà¹ÕÂÃÔ觫Ѿ¾ÅÒÂ
+«Ù
+à«ÒÐ
+à«ÕÂÁà¡ÕÂÇ
+­Ò³ÀѤ
+­Õ¹ÀÒ
+¯Ç§¡ÁÅ
+°Ò¹Ñ¹·ì
+°Ò¹ÔµÂì
+°Ò¹ÔÊÃ
+°Ò»¹ÇÔ·Âì
+°Ôµ¡Ò¹µì
+°ÔµÔ¡Ò¹µì
+°ÔµÔ³Ñ°
+°ÔµÔà¸ÕÂÃ
+°ÔµÔ¹Ñ¹·ì
+°ÔµÔ¾§Èì
+°ÔµÔ¾Ã
+°ÔµÔÁÒ
+°ÔµÔÃѪµì
+°ÔµÔÃѵ¹ì
+±ÔÁÀì¹Øª
+³¸ÔµÒ
+³ÀÑ·Ã
+³Àѷáóì
+³Ã§¤ì
+³Ã§¤ìªÑÂ
+³Ã§¤ì¾ÑªÃì
+³Ã§¤ìÄ·¸Ôì
+³Ã§¤ìÇÔ·Âì
+³Ã§¤ìÈÑ¡´Ôì
+³Ã§ÃÑ¡Éì
+³Ã§Ä·¸Ôì
+³Ã§ÈÑ¡´Ôì
+³Ë·ÑÂ
+³ÑªªÒ
+³Ñ­­Ò
+³Ñ®°ÁÑÂ
+³Ñ®°ÇÃó
+³Ñ¯¾Å
+³Ñ°
+³Ñ°¡Ã³ÔÈÒ
+³Ñ°¡ÄµÒ
+³Ñ°¡Ò¹µì
+³Ñ°¢¨Ã
+³Ñ°ª¹Ñ­
+³Ñ°ªÒ
+³Ñ°°Ò
+³Ñ°µÂÒ
+³Ñ°¹¹·ì
+³Ñ°¹Ñ¹·ì
+³Ñ°»¡Ã³ì
+³Ñ°¾§Èì
+³Ñ°¾§Éì
+³Ñ°¾¨¹ì
+³Ñ°¾Ã
+³Ñ°¾Å
+³Ñ°ÀÙÁÔ
+³Ñ°Á¹
+³Ñ°ÁÒ
+³Ñ°ÂÒ
+³Ñ°ÇÃÕÂì
+³Ñ°ÇѪÃì
+³Ñ°ÇѲ¹ì
+³Ñ°ÇѵÔ
+³Ñ°ÇزÔ
+³Ñ°ÈÑ¡Âì
+³Ñ°ÊÃÑ­
+³Ñ°Ë·ÑÂ
+³Ñ°Ô¡Ò
+³ÔªÒ¡Ã
+³Õç¤ì
+³Øªª¹Ò
+´¹ÑÂ
+´¹Ø¾Å
+´ÃÃ쪹Õ
+´ÃسÕ
+´ÅÄ´Õ
+´ÅÄ·ÑÂ
+´Ç§¡ÁÅ
+´Ç§¨Ñ¹·Ãì
+´Ç§ã¨
+´Ç§´ÒÇ
+´Ç§à´×͹
+´Ç§¹ÀÒ
+´Ç§ºÅ
+´Ç§¾Ã
+´Ç§Á¹·Ãì
+´Ç§Ãѵ¹ì
+´Ç§Ë·ÑÂ
+´Í¡äÁé
+´ÒóÕ
+´ÒùÕÂì
+´ÒÃÒ¹ÕÅì
+´ÒÃÒÃѵ¹ì
+´ÒÃÒÇÃó
+´ÒÃÔ¡Ò
+´ÒÃÔ³Õ
+´ÒÃÔ¹
+´ÒÃسÕ
+´ÒÇ»ÃСÒÂ
+´ÒÇÃÕ
+´Óà¹Ô¹
+´Óç
+´Óç¤ì
+´ÓËÃÔ
+´Ôàá
+´ÔÈ¡ØÅ
+´Ôʷѵ
+´Õ.ºÕ.ä´Á͹´ì (»ÃÐà·Èä·Â)
+´ØžÅ
+´ØÅÂì¾Ñ²¹ì
+´ØÉ®Õ
+´ØɳÕ
+´ØÉ´Õ
+´ØÊÔµ
+´ØÊÔµà¤ÁÕÀѳ±ì
+à´ª
+à´ªÒ
+à´ÍФÇÍÅÔµäÇÃì
+à´×͹¹ÀÒ
+à´×͹à¾ç­
+â´Á
+ä´ÍСÅêÒÊ
+µèͨѡÃ
+µÐÅèÍÁÊÔ¹¾ÅÒʵԡ
+µÐÇѹ
+µÑ觨Ñè§ËÅÍ´ä¿
+µÒà¿ç´
+µØê
+µØ꡵Ò
+µØéÁ
+µØëÂ
+µØÅÒÅѡɳì
+àµçÁà´ª
+àµ×͹ã¨
+àµ×͹µÒ
+ãµé à«é§ «Ñ¹
+äµÃ·È
+äµÃà·¾
+äµÃç¤ì
+¶¹ÍÁÈÑ¡´Ôì
+¶¹Ôµ¾Å
+¶ÇÑÅ
+¶ÇÑÅÂì
+¶ÇÔÅ
+¶Ò³Ø¾§Èì
+¶ÒÇÃ
+à¶ÅÔ§ÈÑ¡´Ôì
+·¹§ÈÑ¡´Ôì
+·¹Ø
+·Ã§
+·Ã§ªÑ»Ñè¹·Í
+·Ã§¸ÃÃÁ
+·Ã§¾Å
+·Ã§ÇزÔ
+·Ã§ÈÃÕ
+·Ã§ÈÑ¡´Ôì
+·Ã§ÈÔÃÔ
+·ÃÃȹÕÂì
+·ÃѾÂì¶ÒÇäéÒÇÑÊ´Ø
+·ÇÔª
+·ÇÕ
+·ÇÕªÑÂ
+·ÇÕ»
+·ÇÕ¾Ã
+·ÇÕÇѲ¹ì
+·ÇÕÈÃÕ
+·ÇÕÈÑ¡´Ôì
+·È¾Ã
+·È¾Å
+·Í§¢ÒÇ
+·Í§¤Ó
+·Í§ãº
+·Í§»Ò¹
+·Í§¾Ñ¹¸ì
+·Í§¾Ñ¹¸Øì
+·Í§ÊØ¢
+·Í§ÍÔ¹·Ãì
+·Ñ¡ÉÁ³¹ì
+·Ñ´´ÒÇ
+·Ñº·ÔÁ
+·ÑȹÇÃó
+·ÑȹվÃ
+·ÑȹÕÂì
+·ÑȹÕÂÒ
+·ÑÈÇÃó
+·èÒ·ÃÒÂá¨é§ÇѲ¹Ò
+·Ô¦ÑÁ¾Ã
+·Ô¹á¤¹ ÍÔ¹´ÑÊ·ÃÕ
+·Ô¾Âì¾Ò¾Ã
+·Ô¾ÂìÇ´Õ
+·Ô¾ÂìÇÃó
+·Ô¾ÂìÇÃس
+·Ô¾ÂìÇÑÅÂì
+·Ô¾ÂìÇÒÃÕ
+·Ô¾ÂìÇÔÁÅ
+·Ô¾ÇÃó
+·Ô¾ÇÑÅÂì
+·Ô¾ÇÔÁÅ
+·Ô¾ÊØ´Ò
+·Ô¾Ò¡Ã
+·Ô¾ÒÇÃó
+·ÔÇÒ
+·ÔȾÅ
+·Õ «Õ ¾Õ ÍÔ¹´ÑÊ·ÃÕé
+·Õ.«Õ.«Õ.¾Ãç;à¾ÍÃìµÕé
+·Õ.«Õ.¾Õ.ÍÔ¹´ÑÊ·ÃÕé
+·Õ.àÍÊ.äÇÃì¤Ñ· á͹´ì áÁªªÕ¹¾ÒÃì·
+·Õ.äÍ.·Õ.ÍÔ¹àµÍÃì๪Ñè¹á¹Å
+·ÕâÍàÍ â´¿à¤Á ÍÔ¹´ÃÑʵÕé
+·ÙÁÔ¹Ô·Êì ºÔ«Ôà¹Ê
+·ÙÃ
+à·¾
+à·¾¾ÔºÙÅ
+෾ķ¸Ôì
+à·ÇÒ
+à·ÇÕ
+à·Ô´ä·
+ä·Â
+ä·Â ¤Í¹Êì á͹´ì ºÔÅ´Ôé§
+ä·Â ´Õ à͹ ·Õ ྐྵ·ì
+ä·Â-àÍà«Õ ¾Õ.ÍÕ.ä¾é¾ì
+ä·Âà¡ÃÕ§ÊÔ觷Í
+ä·Â¤Òà«ÎÔ¹
+ä·Âà¤ÁÕÀѳ±ì
+ä·Âà«ç¹·ÃÑÅ à¤ÁÕ ª¹)
+ä·Âà«ç¹·ÃÑÅà¤ÁÕ
+ä·Âà«çÅ·ÃÑÅà¤ÁÕ ª¹)
+ä·Â´Õà͹·Õྐྵ·ì
+ä·Âµ§¹ÔµµÔé§
+ä·Â¸¹Ò¾Ò³ÔªÂì
+ä·Â¸Ò¹Õà¤ÁÕ
+ä·Â¾ÃçÍ¡«ì
+ä·Âà¾ÔèÁ¾ÅÒʵԡ
+ä·ÂÂÙà¹Õ¹¤ÇÍÅÅÔµÕé
+ä·ÂàÇŤ͹ÍصÊÒ¡ÃÃÁ
+ä·ÂÍÔ¹àµÍÃì ¤ÍµµÍ¹¡Ò÷Í
+ä·ÂÍÔ¹àµÍÃì ÍÐâÃàÁµÔ¡Êì
+¸§ªÑÂ
+¸§äªÂ
+¸³Ñ°
+¸¹¡Ã
+¸¹¡Äµ
+¸¹¾Ã
+¸¹¾Å
+¸¹ÃѪ
+¸¹Ãѵ¹ì
+¸¹âè¹ì
+¸¹Ç´Õ
+¸¹ÇѲ¹ì
+¸¹Çѹ
+¸¹ÇÔµµ
+¸¹ÇÔ·Âì
+¸¹ÊÔ·¸Ôì
+¸¹ÐÃѪµì
+¸¹Ñª¸Ô´Ò
+¸¹Ñ­­Ò
+¸¹Ñ¹µì
+¸¹Ñ¹·ì
+¸¹ÑÊ
+¸¹Ò
+¸¹Ò¤ÒáÃاÈÃÕÍÂظÂÒ º
+¸¹Ò¤ÒÃÂÙâÍºÕ Ãѵ¹ÊÔ¹ ÊÒ¢ÒËÑÇËÁÒ¡
+¸¹ÒÀóì
+¸¹ÒÀÒ
+¸¹ÒÃÑ¡Éì
+¸¹ÒÇѪÃì
+¸¹Ô´Ò
+¸¹ÔÉ°Ò
+¸¹Ù
+¸à¹È
+¸à¹ÈÃì
+¸Á¹Ñ¹·ì
+¸ÃÃÁ¹Ù­
+¸ÃÃÁÈÒʵÃì
+¸Äµ
+¸ÇѪ
+¸ÇѪªÑÂ
+¸ÇÑÅÃѵ¹ì
+¸Ñª¡Ã
+¸Ñª¾Å
+¸ÑªÇ´Õ
+¸ÑªÇѲ¹ì
+¸Ñ­ª¹¡
+¸Ñ­­¸Ã
+¸Ñ­­¾Ñ²¹ì
+¸Ñ­³ÔªÒ
+¸Ñ­¹Ñ¹·ì
+¸Ñ­¾Ã
+¸Ñ­¾ÔÊÔ·¸Ôì
+¸Ñ­Ã´Ò
+¸Ò¡Ã
+¸Ò´Ò
+¸Ò¹Ô¹·Ãì
+¸Ò¹Õ
+¸Ò÷ԾÂì
+¸ÒÃÒ
+¸ÒÃÔ¹Õ
+¸Óç¤ì
+¸ÓçÃѵ¹ì
+¸Ô´ÒÃѵ¹ì
+¸ÔµÔ¹Ñ¹·ì
+¸Ô¹Õ¡Ò­¨¹ì
+¸ÕêÑÂ
+¸Õùت
+¸Õþ§Èì
+¸Õþ§Éì
+¸ÕþÅ
+¸ÕþѲ¹ì
+¸ÕÃÀÑ·Ãì
+¸ÕÃÀÒ¾
+¸ÕÃÇѲ¹ì
+¸ÕÃÈÑ¡´Ôì
+¸ÕÃÈÒ¹µÔ¾Ñ¹¸ì
+¸ÕÃÐ
+¸ÕÃЪÑÂ
+¸ÕÃоÅ
+¸ÕÃÐÇѲ¹ì
+¹ ¾´Å
+¹ à¿ÃÔÁàÁ¹¹Ôª ÍâÃáÁµÔê¡Êì ¾Õ·ÕÍÕ ÅÔÁÔàµç
+¹¤Ã
+¹¤Ã»°Á Î͹´éÒ¤ÒÃìÊì (1994)
+¹§ª¹¡
+¹§¹Øª
+¹§Åѡɳì
+¹·
+¹·Ô¹
+¹·Õ
+¹¹·ÈÑ¡´Ôì
+¹¾à¡éÒ
+¹¾´Å
+¹¾´ÅÂì
+¹¾·Ñµ
+¹¾¾§¤ì
+¹¾¾Ã
+¹¾¾Å
+¹¾ÁÒÈ
+¹¾Ãѵ¹ì
+¹¾ÄÔ·¸Ôì
+¹¾ÇÃó
+¹¾Ò¾Ã
+¹À´Å
+¹ÀÇÃó
+¹ÀÑÊÊÃ
+¹ÀÑÊÊØÇÃó
+¹ÀÒ
+¹ÀÒ¾Ã
+¹ÀÒÂØ·¸ì
+¹ÀÒÇÃó
+¹ÀÔ¹·Ã
+¹ÃªÑÂ
+¹Ã¾Å
+¹ÃÀÑ·Ãì
+¹ÃÒ
+¹ÃÔ¹·Ãì
+¹ÃÔ¹·Ãìà´ª
+¹ÃÔÈ
+¹ÃÔÉ°
+¹ÃÕ
+¹àÃÈ
+¹âõÁì
+¹Ä³Õ
+¹Ä´Õ
+¹Ä·¸Ôì
+¹ÄÁÅ
+¹ÄÁÒ³
+¹Å¾Ãó
+¹Ç¡Ã³ì
+¹Ç¾Å
+¹ÇÃѵ¹ì
+¹ÇŨѹ·Ãì
+¹ÇÅ©ÇÕ
+¹ÇžÃ
+¹ÇÅÅÐÍÍ
+¹Ñ­ªÅÒ
+¹Ñ¯¾Ã
+¹Ñ±¾Ã
+¹Ñ·ª¹¡
+¹Ñ·¸Á¹
+¹Ñ¹ªÑÂ
+¹Ñ¹·ªÑÂ
+¹Ñ¹·¹ì
+¹Ñ¹·¹Ò
+¹Ñ¹·¾Ã
+¹Ñ¹·¾Å
+¹Ñ¹·ÁÒÊ
+¹Ñ¹·Ãѵ¹ì
+¹Ñ¹·Ç§Éì
+¹Ñ¹·ÇÃó
+¹Ñ¹·ÈÑ¡´Ôì
+¹Ñ¹·Ò
+¹Ñ¹·Ô¡Ò¹µì
+¹Ñ¹·ÔÂÒ
+¹Ñ¹Ò
+¹Ò¯Êǧ
+¹ÒµÂÒ
+¹ÒÁ
+¹ÒÃÔ¹·Ãì
+¹ÒÃÕ
+¹ÒÃÕÃѵ¹ì
+¹ÒÇÔ¹Õ
+¹éÓ·Ô¾Âì
+¹éÓ½¹
+¹Ó¾Å
+¹éÓྪÃ
+¹éÓÁѹ¤ÒÅà·ê¡«ì
+¹ÓÃØè§ä·Â ¡ÒÃìàÁ¹·ì
+¹éÓÍéÍÂ
+¹Ô¡Éì
+¹Ô¤Á
+¹ÔªÃªÕ¾
+¹Ôà«Ð
+¹Ô´
+¹Ô´Ò
+¹ÔµÂì
+¹ÔµÂÒ
+¹ÔµÔ
+¹ÔµÔ¾§Éì
+¹ÔµÔÁÒ
+¹Ô·ÃÒ
+¹Ô·Ñȹì
+¹Ô·ÑȹÕÂì
+¹Ô¸ÔÇ´Õ
+¹Ô»»Í¹à¾¹µì(»ÃÐà·Èä·Â)
+¹Ô¾¹¸ì
+¹Ô¾Å
+¹Ô¾Ñ·¸Ò
+¹Ô¾Ñ¹
+¹ÔÀÒ
+¹ÔÂÁ
+¹ÔÃÁÅ
+¹ÔÃѹ´Ã
+¹ÔÃÒÇÃóì
+¹ÔÃب¹ì
+¹ÔÃصµì
+¹ÔÅÀÒ
+¹ÔÅغÅ
+¹ÔâźÅ
+¹ÔÇૹ¨ÙÃÕè¾ÃÔé¹µÔé§á͹´ì ᾤࡨ¨Ôé§
+¹ÔÇѲ¹ì
+¹ÔÇѵÃì
+¹ÔÇѵÔ
+¹ÔÇÒµ
+¹ÔÈÃÒ
+¹ÔÈÒªÅ
+¹ÔÈÒ¾Ã
+¹ÔÊÒ
+¹ÕµÔ
+¹Øª¨ÃÔ¹·Ãì
+¹Øª¹Ò¶
+¹ØªÂÒ
+¹ØªÃÕ
+¹ØÈÃÒ
+¹ØʺÒ
+¹ØÊÃÒ
+๵ôÒÇ
+à¹ÒÇÃѵ¹ì
+º§¡ª
+º§¡µÃѵ¹ì
+º«ì ÍÔ¹â¿Ãì à«ÍÃìÇÔÊ
+ºÃè§
+ºÃèº
+ºÃÃà¨Ô´
+ºÃç
+ºÃÃÊÒÃ
+ºÃÔÇÃõ
+ºÇêÑÂ
+ºÑ§ÍÃ
+ºÑ­ªÒ
+ºÑ­­ÑµÔ
+ºÑ³±Ôµ
+ºÑ³±ÔµÂì
+ºÑµÃ¡Ãاä·Â
+ºÑµÃ¡ÃاÈÃÕÍÂظÂÒ
+ºÑ¹Å×ÍÈÑ¡´Ôì
+ºÒ§¡Í¡ªÕ·àÁç··ÑÅ
+ºÒ¹ªéÍÂ
+ºÓÃاä·Â
+ºÔǵÕéᾤ
+ºÕ ÇÒ ¤ÍÃìâ¾àêÑè¹ ¨Ó¡Ñ´
+ºÕ á͹´ì «Õ ¾ÙÅÒÊ¡Õé
+ºÕ.àÍç¹.ºÃÒà´ÍÃì
+ºÕ.àÍÊ.äÍ.àËÅç¡¡èÍÊÃéÒ§
+ºØ­à¡ÕÂõÔ
+ºØ­¤§
+ºØ­ªèÇÂ
+ºØ­ªÑÂ
+ºØ­ªØº
+ºØ­àªÔ´
+ºØ­«é͹
+ºØ­·ÃѾÂì
+ºØ­·ÇÕ
+ºØ­·Í§
+ºØ­¸ÃÃÁ
+ºØ­»ÃÐÊÔ·¸Ôì
+ºØ­¾§Éì
+ºØ­ÁÕ
+ºØ­Âѧ
+ºØ­àÂÕèÂÁ
+ºØ­ÃèÇÁ
+ºØ­ÃÑ¡
+ºØ­ÅѺ
+ºØ­Å×Í
+ºØ­àÅÔÈ
+ºØ­ÈÃÕ
+ºØ­ÈÔÃÔ ´ÕÇÔÅÍ»àÁ¹·ì
+ºØ­Êè§
+ºØ­Ê¹Í§
+ºØ­ÊÔ¹
+ºØ­Ê׺
+ºØ­ÊØ¢
+ºØ­áʧ
+ºØ³±Ôµ
+ºØ»¼Ò
+ºØÃÑ­ªÅÕ
+ºØÃÔ¹·Ãì
+ºØÈÃÒ
+ºØÈÃÒ¾Ã
+ºØÈÃÔ¹·Ãì
+ºØÉ¡Ã
+ºØɺÒ
+ºØÉÂÒ
+ºØÉÃÒÀóì
+ºØËÅÑè¹
+ºÙê·Êì (»ÃÐà·Èä·Â)
+ºÙê·ÊìáÁ¹Ùῤà¨ÍÃìÃÔè§ (»ÃÐà·Èä·Â)
+ອ¨¾Ã
+ອ¨ÁÒ
+ອ¨ÅÑ¡É³ì ¾ÃÔé¹µÔé§
+ອ¨ÇÃó
+àºç­ÇÃó
+àºç·à·ÍÃì äÅ¿ì
+»¡Ã³ì
+»®ÔÁÒ
+»¯Ô­­Ò
+»¯Ô¾Å
+»¯ÔÁÒ
+»°ÁÇѲ¹ì
+»³ªÑÂ
+»³Ô´Ò
+»³ÔµÒ
+»·ØÁ
+»·ØÁ¾Ã
+»·ØÁÒ
+»¹Ñ´´Ò
+»ÀÑÊÊÃ
+»ÀÒ³Ø
+»ÀÒÇ´Õ
+»ÀÒÇÃÔ¹·ì
+»ÀÒÇÕ
+»ÂصÒ
+»ÃСͺ
+»ÃСÒÈ
+»ÃСÒÈÔµ
+»ÃСԨ
+»ÃСԵ
+»ÃФͧ
+»ÃШ§¨Ôµ
+»ÃШǺ
+»ÃШѡÉì
+»ÃШԵÃ
+»ÃЪÒ
+»ÃЪԵ
+»ÃЪØÁ¾Ã
+»Ãгµ
+»ÃдÔÉ°ì
+»ÃзѺã¨
+»Ãзջ
+»ÃзØÁ·Ô¾Âì
+»ÃÐà·×ͧ
+»Ãо¨¹ì
+»Ãо¹¸ì
+»Ãоķ¸Ôì
+»ÃоѲ¹ì
+»Ãоѹ¸ì
+»ÃÐä¾
+»ÃÐÀÑÊ
+»ÃÐÀÑÊÃì
+»ÃÐÀÑÊÃÒ¾Ã
+»ÃÐÀÑÊÊÃ
+»ÃÐÀÒ¾Ã
+»ÃÐÀÒ¾Ãó
+»ÃÐÀÒÀóì
+»ÃÐÀÒÊ
+»ÃÐÁÇÅ
+»ÃÐÁѾÃ
+»ÃÐÁÙÅ
+»ÃЧ¤ì
+»ÃÐÂÔ¹
+»ÃÐÂØ·¸
+»ÃÐÂÙÃ
+»ÃÐÂÙÃÈÃÕ
+»ÃÐ⪹ì
+»ÃÐÇѵÃ
+»ÃÐÇѵÔ
+»ÃÐÇÔµÃ
+»ÃÐÇÔ·
+»ÃÐÇÔ·Âì
+»ÃÐÇÕ³Ò
+»ÃÐàÇÈ
+»ÃÐʧ¤ì
+»ÃÐÊÒ·
+»ÃÐÊÒ¹
+»ÃÐÊÒÃ
+»ÃÐÊÔ·¸Ôì
+»ÃÐÊ׺
+»ÃÐàÊÃÔ°
+»ÃѪ­Ò
+»ÃÒ¡ÒÃ
+»ÃÒ§³Õ
+»ÃÒª­ì
+»ÃÒ³Õ
+»ÃÒ³ÕÂì
+»ÃÒâÁ·Âì
+»ÃÒö¹Ò
+»ÃÔ­­ì
+»ÃÔ­­Ò
+»ÃÔ­´Ò
+»ÃÔ³´Ò
+»ÃÔ·ÑÈ
+»ÃÔ¹´Ò
+»ÃÔÂÒÇÃó
+»ÃÔȹÒ
+»ÃÔȹÕ
+»ÃÕªÒ
+»ÃÕ­Ò
+»ÃÕÂÒÀóì
+»ÇÕ³ÃѪ
+»ÇÕ³Ò
+»Êѹµì
+»Êѹ¹ì
+»Í§À¾
+»Ñ­¨ÃÑÈÁÔì
+»Ñ­­Ò
+»Ñ­­Ò¾Ã
+»Ñ­­Ò¾Å
+»Ñ³ÃÊÕ
+»Ñ·Á
+»Ñ·ÁÒ
+»Ñ·ÁÒÇ´Õ
+»Ò³ÔÊÃÒ
+»Ò¹
+»Ò¹à¾ªÃ
+»ÒÃÔªÒµ
+»ÒÃÔªÒµÔ
+»ÒÃԾѹ¸ì
+»ÒÃÕ³Ò
+»Ò˹ѹ
+»ÔµÔ
+»ÔµÔÇѪÃì
+»Ôè¹Á³Õ
+»Ôè¹ÁÒ⹪
+»Ô¡ҭ¨¹ì
+»Ô¹ѹ·ì
+»Ô¹ү
+»Ô¾§Èì
+»Ô¾§Éì
+»Ô¾Ã
+»ÔÂÁÒÀóì
+»ÔÂÃѵ¹ì
+»ÔÂÇÃó
+»ÔÂÇѲ¹ì
+»ÔÂÈÑ¡´Ôì
+»ÔÂÐ
+»ÔÂЪÑÂ
+»ÔÂй¹·ì
+»ÔÂйѹ·ì
+»ÔÂйت
+»ÔÂо§Èì
+»ÔÂоÃ
+»ÔÂоѹ¸ì
+»ÔÂоѹ¸Øì
+»ÔÂÐÁÒÈ
+»ÔÂÐÈÑ¡´Ôì
+»ÔÂÒ¾Ã
+»ÔÅѹ­Ò
+»Ø³³ÂÒ
+à»à»ÍÃìÅÔ¿
+à»ÃÁ
+à»ÃÁ»ÃÐÀÒ
+à»ÃÁÄ´Õ
+à»ÃÁÈÃÕ
+à»ÃÁÊÔ·¸Ôì
+à»ÕèÂÁÊØ¢
+á»Å¹âÁ·Ô¿
+¼¡Ò¡Ãͧ
+¼¡Ò¾Ãó
+¼§
+¼¨§¨Ôµµì
+¼´Ø§ÈÑ¡´Ôì
+¼à´ÔÁ
+¼èͧ¾Ãó
+¼èͧÈÃÕ
+¼è͹»ÃÐÀÒ
+¼éÒ¢¹Ë¹ÙªÔ¹àΧ
+¼éÒ¢¹Ë¹Ù«Ô¹àΧ
+¼éҢع˹٫ԹàΧ
+¼èÒ¹¿éÒ àÍ繨Ôà¹ÕÂÃÔè§
+¼èÒ¡ÒäÅѧ¡Í§¡ÅÒ§Êӹѡ»ÅÑ´¡Ãا෾ÁËÒ¹¤Ã
+¼ÒÊØ¢
+¼ØÊ´Õ
+¼Ùé༴ç¨
+¼ÙéãË­èàÅç¡
+༴ç¨
+à¼Ô§
+ä¼·
+½èÒ¡ÒäÅѧ¡Í§¡ÅÒ§ Êӹѡ»ÅÑ´¡Ãا෾ÁËÒ¹¤Ã
+¾§Èìà¡ÕÂõÔ
+¾§ÈìªÒÂ
+¾§Èìà·¾
+¾§È¸Ã
+¾§Èì¾Ñ¹¸ì
+¾§Èì¾Ô¾Ñ²¹ì
+¾§ÈìÀѤ
+¾§ÈìÊØà¡ÉÁ
+¾§Éìà·¾
+¾§Éì¾Ã
+¾§ÉìÈÑ¡´Ôì
+¾§ÉìÊѹµì
+¾§Éì͹ѹµì
+¾¨¹ì
+¾¨¹Ò
+¾¨¹Òö
+¾¨¹ÕÂì
+¾¨ÁÒ¹
+¾¨ÁÒÅÂì
+¾¹Á
+¾¹ÁªÑÂ
+¾¹ÒÊѹ±ì
+¾¹Ô´Ò
+¾Â¹µì
+¾Âا
+¾Ã
+¾Ã¡ÇÕ
+¾Ã¨Ôµµì
+¾ÃªÑÂ
+¾Ã·Ô¾Âì
+¾Ã·Ô¾Ò
+¾Ã·ÔÀÒ
+¾Ãà·¾
+¾Ã¹·Õ
+¾Ã¹ÀÒ
+¾Ã¹ÔµÔ¿ÔÅìÁá͹´ìÇÕ´ÕâÍ
+¾Ã¾§Éì
+¾Ã¾¹Ò
+¾Ã¾Ãó
+¾Ã¾Å
+¾Ã¾ÅÒ§ÒÁ
+¾Ã¾ÔÁÅ
+¾Ã¾ÔäÅ
+¾Ãà¾ç­
+¾ÃÁ§¤Åà¿ÍÃì¹Ôà¨ÍÃì
+¾Ãó·ÔÀÒ
+¾Ãó¹ÔÀÒ
+¾Ãó»ÃÐä¾Ç´Õ
+¾Ãó¾ÃÃÉ
+¾Ãó¾ÔÁÅ
+¾ÃóÃÒ³ì
+¾ÃóÊóì
+¾ÃóԡÒ
+¾ÃóÕ
+¾ÃøԴÒ
+¾ÃÇÔÁÅ
+¾ÃÇÔäÅ
+¾ÃÈÑ¡´Ôì
+¾ÃÈÔÃÔ
+¾ÃÊÃǧ
+¾ÃÊÇÃäì
+¾ÃËÁ¾Ñ²¹ì
+¾ÃéÍÁªÑÂ
+¾ÃлÃÐá´§ Î͹´éÒ¤ÒÃìÊì
+¾ÃлÃÐá´§ Î͹´éÒ¤ÒÃìÊì ¨Ó¡Ñ´
+¾ÃÐÃÒÁ 3 ¤ÒÃìà«ç¹àµÍÃì
+¾ÃÐÃÒÁ 3 Î͹´éÒ¤ÒÃìÊì
+¾ÃÔéÁà¾ÃÒ
+¾ÃÕàÁÕÂÃìà¤ÁÔ¤ÑÅ á͹´ì¾ÅÒʵԡ
+¾ÃÕàÁÕÂÃìÍÔ¹àµÍÃìÅÔ««Ôè§
+¾Å¡Äɳì
+¾ÅªÑÂ
+¾Åà·¾
+¾Å¾ÑªÃì
+¾Å¾Ñ²¹ì
+¾ÅÊÔ·¸Ôì
+¾Ç§·Í§
+¾Ç§à¾ç­
+¾Ç§Ãѵ¹ì
+¾ÈÔ¹
+¾ÊØࡵÔì
+¾Ñª¹Õ
+¾ÑªÃ
+¾ÑªÃÇäÅ
+¾ÑªÃÒ
+¾ÑªÃÒÀóì
+¾ÑªÃÒÀÒ
+¾ÑªÃÔ¹·Ãì
+¾ÑªÃÕ
+¾ÑªÃÕ¾Ã
+¾ÑªÃÕÀóì
+¾Ñ²·ÇÕ
+¾Ñ²¹ªÑÂ
+¾Ñ²¹Ð
+¾Ñ²¾§Éì
+¾Ñ·¸ì¸ÕÃÒ
+¾ÑÅÅÀ
+¾ÑʾÃ
+¾Ò³ÔªÂì
+¾Ò³Õ
+¾Òâµà¤ÁÕÍصÊÒË¡ÃÃÁ
+¾Ò¹·Í§
+¾ÒÃҡ͹ÍÔ¹â¿à·¤
+¾Ô ÈÁÑÂ
+¾Ô¨ÔµÃÒ
+¾Ôª­ì
+¾Ôª´Ò
+¾ÔªÂÒ
+¾ÔªÑÂ
+¾ÔªÑÂÇѲ¹ì
+¾ÔªÔµ
+¾ÔªÔµ¾Å
+¾Ôય
+¾Ôય°ì
+¾ÔàªÉ°
+¾ÔàªÉ°ì
+¾Ô±ÙÃÂì
+¾Ô³ªØ´Ò
+¾Ô³¹ÀÒ
+¾Ô·ÂÒ
+¾Ô·Ñ¡Éì
+¾Ôà·¾
+¾Ô¸Ò¹¡Ã
+¾Ô¹¹ÔÀÒ
+¾ÔºÙÅÂì
+¾Ô¾Ñ²¹ì
+¾ÔÀ¾
+¾ÔÁ¾ìã¨
+¾ÔÁ¾ìª¹¡
+¾ÔÁ¾ì»ÃоÃó
+¾ÔÁ¾ì¾Ã
+¾ÔÁ¾ìÀóì
+¾ÔÁ¾ìÀѤ
+¾ÔÁ¾ìÇÔÁÅ
+¾ÔÁÀÒ
+¾ÔÁÅ
+¾ÔÃÁÂì
+¾ÔÃس
+¾ÔÈÔÉ°ì
+¾ÔɳØ
+¾ÔÊÁÑÂ
+¾ÔÊÔ°
+¾ÔÊÔ·¸Ôì
+¾ÔÊÔÉ°ì
+¾Õ.«Õ.àºÊ·ì ¤ÃÕàÍ·
+¾Õ.àÍÊ.¨Õ ÅÔÊ«Ôè§
+¾Õ.àÍÊ.¾ÅÒʵԡºÃÒà´ÍÃì á͹´ì«Ñ¹
+¾Õ.àÍÊ.¾ÅÒʵԡºÃÒà´ÍÃìá͹´ì«Ñ¹
+¾Õ¹Ô¡«ì àÍç¡«ìà¾ÃÊ
+¾Õ¹Ô¡«ìàÍç¡«ìà¾ÃÊ
+¾Õ÷ѵ
+¾ÕþѲ¹ì
+¾ÕÃÇزÔ
+¾ÕÃÈÔÅ»ì
+¾ÕÃÐ
+¾ÕÃо§Èì
+¾ÕÃоÅ
+¾ÕÃÐÈÑ¡´Ôì
+¾Ù¹¾Ñ¹¸ì
+¾Ù¹ÈÑ¡´Ôì
+¾Ùŷͧ¾Ãç;à¾ÍÃìµÕé_
+¾ÙżÅ
+à¾ç§ ¿Ù ËÅÔ¹
+à¾çªÃì
+ྪÃÃѵ¹ì
+ྪÃÅ´Ò
+ྪÃÔ¹·Ãì
+à¾ç­¨Ñ¹·Ãì
+à¾ç­·Ô¾Âì
+à¾ç­¹ÀÒ
+à¾ç­»ÃÐÀÒ
+à¾ç­¼¡Ò
+à¾ç­¾ÔäÅ
+à¾ç­ÈÃÕ
+à¾ÃÔÁàÁ¹¹Ôª ÍâÃáÁµÔê¡Êì ¾Õ·ÕÍÕ ÅÔÁÔàµç´
+à¾ÅÔ¹¨Ôµµì
+à¾ÅԹĴÕ
+à¾Õ§¾Ã
+á¾´´Ôé§ (ä·ÂᏴì)
+á¾´´Ôé§(ä·ÂᏴì)
+á¾¹´éÒ à»à»ÍÃì ¤ÒÃìµÑ¹Ê
+á¾ÃÇ
+á¾ÃÇÒ
+ä¾±ÙÃÂì
+侺ÙÅÂì
+ä¾ÃÄ·¸Ôì
+ä¾Ãʳ±ì
+ä¾ÃÊÔ·¸Ôì
+ä¾ÃѪ
+ä¾Ãѵ¹ì
+ä¾ÃÔ¹·Ãì
+ä¾àÃÒÐ
+ä¾âè¹ì
+ä¾ÅÔ¹
+ä¾ÇÑÅÂì
+ä¾ÈÒÅ
+ä¾ÈÔÃÔ
+ä¾ÊÔ°
+¿ÅØÊÊÔ¡à¤Á
+¿Õ¹Ô¡«ì àÍç¡«ìà¾ÃÊ
+á¿Ã§¤ì
+á¿ÃìàÇÂì ÍÔ¹àµÍÃì๪Ñè¹á¹Å
+ÀÃÒ´Ã
+ÀÇÔ¹
+ÀÑ¡´Õ
+ÀѤ¨ÔÃÒ
+Àѳ±ÔÃÒ
+Àѷ÷ÔÃÒ
+Àѷþ§Èì
+ÀѷþÃ
+ÀѷþÅ
+ÀÑ·ÃÀÃ
+ÀÑ·ÃÃѧÊÕ
+ÀÑ·ÃÄ´Õ
+ÀÑ·ÃÒÀóì
+ÀÑ·ÃÔ¹·Ãì
+ÀÑÊÅÔ¹
+ÀÑÊÇÃó
+ÀÒ¡Ã
+ÀÒ¤ÀÙÁÔ
+ÀÒ³Õ
+ÀÒ³Ø
+ÀҳؾÅ
+ÀÒ³ØÇÃó
+ÀÒ¹ØÇѲ¹ì
+ÀÒ¹ØÇѵÃ
+ÀÒ¾Ã
+ÀÒôÕ
+ÀÒǹÒ
+ÀÒǾѹ¸¹ì
+ÀÒÇÔ³Õ
+ÀÒÇÔ¹
+ÀÒÇÔ¹Õ
+ÀÒÉÔµÒ
+ÀÔ¨ÔµÃÒ
+ÀÔ­­¾Ñ¡µÃì
+ÀÔ­â­
+ÀÔôÕ
+ÀÙàºÈ
+ÀÙÁÔ°Ò¹
+ÀÙÃÔ¾§Èì
+ÀÙÃÔÇÃò¡ì
+ÀÙÉÔµ
+Á¡Ãҹѹ·ì
+Á§¡Ø®Ãѵ¹ì
+Á§¤Å
+Á§¤Å¡Òûѡ
+Á³°Ô´Ò
+Á³±¹ì¡Ò­¨¹ì
+Á³±¹Ô¨
+Á³±ÅÕ
+Á³±Ò
+Á³à±ÕÂÃ
+Á³ÕÃѵ¹ì
+Á¹µìªÑÂ
+Á¹µÃÕ
+Á¹ÑÊ
+Á¹ÑÊÇÕ
+Á¹Ù­
+Áâ¹
+Á⹪
+ÁÂØÃÕ
+ÁÅÄ´Õ
+Áéǹáµé
+ÁËÀÑ®
+ÁËÒÃÒª
+ÁÐÅÔÇÑÅÂì
+Áѧ¡Ãä·ÂʵÕźÒÃì
+Áѳ±¹Ò
+ÁÑ·¹Ò
+ÁÑÅÅÔ¡Ò
+ÁÒªÍÃì¡ÇÒ¹
+ÁÒ³Õ
+ÁÒ¹¾
+ÁÒ¹Ð
+ÁÒ¹ÔµÂì
+ÁÒ⹪³ì
+ÁÒâ¹·
+ÁÒÃÔÉÒ
+ÁÒÅÑÂ
+ÁÒÅÔ¹Õ
+ÁÒÅÕ
+ÁÒÅÕÇÃó
+ÁÔµ·ÔÃÒ
+ÁÔÅàŹà¹ÕèÂÁ âÍ.àÍ 2000
+ÁÕ¾Å
+ÁØ¢
+ÁØ·ÔµÒ
+ÁÙËÐÁд×ÍàÃÐ
+àÁà¨ÍÃìÍصÊÒË¡ÃÃÁä·Â (1989)
+àÁ´Ô¤ÃÒ¿·ì
+àÁµµÒ
+àÁâ·ÃʻԹ¹Ôè§
+àÁ¸Ò
+àÁ¸ÒÇÕ
+àÁ¸Ô¹Õ
+àÁ¸Õ
+àÁÉÂÒ
+àÁÉÔ³Õ
+àÁ×ͧ·Í§
+áÁ··ÕàÃÕÂÅ¡ÃØê» ¨Ó¡Ñ´
+áÁé¹ÁÒµÃ
+äÁµÃÕ
+§ÂØ·¸
+Âè§àΧÇѲ¹Ò¡ÒþÔÁ¾ì
+ÂÃç¤ì
+ÂʹྪÃ
+Âѹ áÍÅ à¤âÂÊ
+ÂÔè§ÇÃó
+ÂؤžÃ
+ÂØ´Ò
+ÂØ·¸¹Ò
+ÂØ·¸¹ÒÇÕ
+ÂØ·¸Â§
+ÂظÒÁÒµÂì
+Âعâ¡Ð
+ÂؾÒ
+ÂؾҾÃ
+ÂؾÒÇ´Õ
+ÂؾԹ
+ÂØÀÒ¾Ã
+ÂØÀÒÀóì
+ÂØÇ´Õ
+ÂØÇÃÕ
+ÂÙ¹ÔÅÕàÇÍÃì ä·Â âÎÅ´Ôé§Êì
+ÂÙ¹ÔÅÕàÇÍÃìä·Â âÎÅ´Ôé§Êì
+ÂÙ¹Õ¤ ÍÍÃì¤Ô´
+ÂÙà¹Õè¹á¡êÊá͹´ìàÅÁÔ¤ÑÅÊì
+àÂ繨Եµì
+àÂ繨ԵÃ
+àÂÒÇ´Õ
+àÂÒǾÒ
+àÂÒÇÀÒ
+àÂÒÇàÃÈ
+àÂÒÇÅѡɳì
+â¸Թ
+Ã.µË­Ô§ ¾Íã¨
+è¹Ò
+óç¤ì
+ôÒ
+ùԮ°Ò
+þվÃ
+þվѲ¹ì
+þÕÀÑ·Ã
+ÃÁÂì¨ÃÃÂì
+Ãǧ·Í§
+ÃÈÑ¡´Ôì
+ÃÊÊؤ¹¸ì
+ÃÍÂÑÅàÍ繨Ôà¹ÕÂÃÔè§
+ÃеÃÕ
+ÃоԹ·Ãì
+ÃоվÃ
+ÃоվÃó
+ÃоվÅ
+ÃÑ¡´Õ
+ÃÑ¡ÈÑ¡´Ôì
+ÃÑ¡ÉÔµÀÑ·Ã
+ÃѧÊÃäì
+ÃѧÊѹµì
+ÃѧÊÔÁÒ
+ÃѪà¡ÅéÒ
+ÃѪ®Ò
+ÃѪ®Ò¾Ã
+ÃѪ´Ò
+ÃѪ¹Õ
+ÃѪ¹Õ¡Ã
+ÃѪ¹Õ¾Ã
+ÃÑ°¾§Éì
+ÃÑ°ÊØ´Ò
+Ãѵ³Ò
+ÃѵµªÑÂ
+ÃѵµÔÂÒ
+Ãѵ¹ªÑÂ
+Ãѵ¹Àóì
+Ãѵ¹Á³Õ
+Ãѵ¹Ò
+Ãѵ¹Ò¾Ã
+Ãѵ¹ÒÀóì
+ÃѵÔÂÒ
+ÃѵÔÂÒÀóì
+ÃÑÈÁÕ
+ÃÑÈÁÕÀÑÊÊÃ
+ÃҪѹÂì
+ÃÒªÒÍÙªÔâ¹
+ÃÒહ
+ÃÒ³Õ
+ÃÒµÃÕ
+ÃÒàÁÈÃì
+ÃÒÂÕ¹
+Ã×è¹ÇÃÒËì
+ÃØé§
+ÃØ觷ԾÂì
+ÃØ觷ÔÇÒ
+ÃØ觹ÀÒ
+ÃØè§à¾ªÃ
+ÃØè§ÃѪ¹Õ
+ÃØè§Ãѵ¹ì
+ÃØè§ÃÑÈÁÕ
+ÃØè§àÃ×ͧ
+ÃØè§âè¹ì
+ÃØè§âè¹ì¢¹Êè§
+ÃØé§ÅÒÇÃó
+ÃØè§ÇÔ·Âì
+ÃØè§ÍÃس
+ÃبÒ
+ÃبÒÀÒ
+ÃØËйÒ
+ÃÙàºÕÂÍصÊÒË¡ÃÃÁ
+àâ­Ò
+àóÙ
+àþᾤ à·Ã´´Ôé§
+àþᾤ¤Í¹ÊµÃѤªÑè¹
+àÃÇѵ
+àÃÔ§·ÔÇÒ
+àÃÔ§ÃÐÇÕ
+àÃԧķ¸Ôì
+àÃ×ͧÂÈ
+áþᾤ ¤Í¹ÊµÃѤªÑè¹
+âç§Ò¹àËÅç¡¡Ãا෾Ï
+âè¹ì»ÃÐàÊÃÔ°
+Ä·¸Ôì
+Ä·¸ÔªÑÂ
+ÅÅÔ´Ò
+ÅÅÔµÒ
+ÅÐÁèÍÁ
+ÅÐÁÑÂ
+ÅÐÍͧ´ÒÇ
+ÅÐàÍÕ´
+ÅÑ¡¢³Ò
+ÅѡɳÒ
+ÅÑ¡ÉÁÕ
+ÅÑ­ª¹Ò
+ÅÑ´´Ò
+ÅÑ´´ÒÇÃó
+ÅÑ´´ÒÇÑÅÂì
+ÅÑ·¸ÈÑ¡´Ôì
+ÅÒÇѳÂì
+ÅÓä¾
+ÅÓäÂ
+ÅÔ¹´ÒÇÃó
+ÅÔÁ
+ÅÔÅÒÀóì
+Å×ͪÑÂ
+àÅͪÑÂ
+àÅÍÈÑ¡´Ôì
+àÅÍÊÃäì
+àÅÍÊØ¢
+àÅÔȪÑÂ
+àÅÔÈÈÑ¡´Ôì
+àÅÔÈÊÒÁÒö â¸Ò
+âÅËСԨʵÕÅ
+ǧà´×͹
+ǧÈìä¾±ÙÃÂì¡Ãç» º
+ǧÈìä¾±ÙÃÂì¡ÃØê»
+ǧÈìä¾±ÙÃÂì¡ÃÙê»
+ǧÈìÇÒµ
+ǧÈìÊØÀÒ
+ǨÕÃѵ¹ì
+ǪÔÃÒÀÒ
+ǹѪ¾Ã
+ǹÑʹѹ·ì
+ǹÒ
+ǹԪ
+ǹԴÒ
+ÇáÒÃ
+ÇêÑÂ
+ÇêҵÔ
+ÇôÔÉ°ì
+ÇÃà·¾
+ÇøѹÂì
+Çùت
+Çþ§Éì
+Çþ¨¹ì
+ÇþÅ
+ÇÃÁÅ
+ÇÃÂØ·¸ì
+ÇÃó¨Ôµ
+ÇÃóªÑÂ
+ÇÃó±¹Ò
+ÇÃó´Õ
+ÇÃóì´Õ
+ÇÃó·¹Ò
+ÇÃó·¹Õ
+ÇÃó¸³Õ
+ÇÃó¸ÁÅ
+ÇÃó¹ÀÒ
+ÇÃó¹ÒÃÕ
+ÇÃó¾Ã
+ÇÃó¾Ò
+ÇÃóà¾ç­
+ÇÃóÀ¾
+ÇÃóÀóì
+ÇÃóÀÒ
+ÇÃóǴÕ
+ÇÃóÈÔÃÔ
+ÇÃóÒ
+ÇÃóÕ
+ÇÃø¹Ò
+ÇÃÃѪ
+ÇÃÅѡɳì
+ÇÃÇÃó
+ÇÃÇÃø¹ì
+ÇÃÇѲ¹ì
+ÇÃÇÔÀÒ
+ÇÃÑ­¸Ã
+ÇÃÒ
+ÇÃÒ§¤³Ò
+ÇÃÒ§Ãѵ¹ì
+ÇÃÒ¾Ã
+ÇÃÒÀóì
+ÇÃÒÃѵ¹ì
+ÇÃÒÅѡɳì
+ÇÃÒÇزÔ
+ÇÃÒÇظ
+ÇÃÔ¹·Ãì
+ÇÃÔ¹¸Ã
+ÇÃÔÁÒ
+ÇÃÔÈÃÒ
+ÇÃÕÇÃó
+ÇÃس
+ÇÅѾÃ
+ÇÈÔ³Ò
+ÇÈÔ¹
+ÇÊѹµì
+ÇÊØ
+Çèͧ
+ÇѪáÃ
+ÇѪþÅ
+ÇѪÃÐ
+ÇѪÃÑ­­Ò
+ÇѪÃÔ¹·Ãì
+ÇѪÃÕ
+ÇѲ¹Ð
+ÇѲ¹Ò
+Çѹà©ÅÔÁ
+ÇѹªÑÂ
+ÇѹªÒµÔ
+Çѹ´Õ
+Çѹ·¹Ò
+Çѹ·¹Õ
+Çѹ·¹ÕÂì
+Çѹà¾ç­
+ÇѹÃѪ´Ò
+ÇѹÇÔÊÒ¢ì
+ÇѹʶÒ
+ÇÑÅÅÀ
+ÇÑÅÅÀÒ
+ÇÑÅÅÒÀÒ
+ÇÑȾÅ
+ÇÑʹÑÂ
+ÇÒ³Õ
+ÇÒ·Ôµ
+ÇÒ·Ô¹
+ÇÒ·Ô¹ÕÂì
+ÇÒÃÔª
+ÇÒÃÕ
+ÇÒÃسÕ
+ÇÒʹÒ
+ÇÔ¤µÍÃÕè â¾Ãà¡Ã·
+ÇÔ¤Á
+ÇÔ¨Òóì
+ÇÔ¨ÔµÃ
+ÇÔ¨ÔÃÒ
+ÇÔªªÒ
+ÇÔª­ÐÃب
+ÇÔªÑÂ
+ÇÔªÒ­
+ÇÔªÔµ
+ÇԪشÒ
+ÇÔàªÉ°
+ÇÔàªÕÂÃ
+ÇÔ­­Ø´Ò
+ÇÔ±ÙÅÂì
+ÇÔ·¸ÇѪ
+ÇÔ·ÂÒ
+ÇÔ·ÇÑÊ
+ÇÔ·ÙÃ
+ÇÔ¹ÊÃäì
+ÇÔ¹ÑÂ
+ÇÔ¹Ô¨
+ÇÔºÙÅÂì
+ÇÔÀÒ
+ÇÔÀҡóì
+ÇÔÀÒ¤
+ÇÔÀÒ¾Ãó
+ÇÔÀÒÃѵ¹ì
+ÇÔÀÒɳÕÂì
+ÇÔÀÒÊ
+ÇÔÀÙÉÔµ
+ÇÔÁÅ
+ÇÔÁžÃ
+ÇÔÁÅÇÃó
+ÇÔÃÁÅ
+ÇÔÃѪ
+ÇÔÃѵ¹ì
+ÇÔâè¹ì
+ÇÔÅÇѳÂì
+ÇÔÅÒÇÃó
+ÇÔÅÒÇѳÂì
+ÇÔÅÒÇÑÅÂì
+ÇÔÅÒÊÔ¹Õ
+ÇÔÅÔµ
+ÇÔäÅ
+ÇÔäžÃ
+ÇÔäÅÃѵ¹ì
+ÇÔäÅÅѡɳì
+ÇÔäÅÇÃó
+ÇÔÇ
+ÇÔÇÃø¹ì
+ÇÔÇѲ¹ì
+ÇÔÇѲ¹ìªÑÂ
+ÇÔȹÕ
+ÇÔÈÃص
+ÇÔÈÒÅ
+ÇÔÈÔÉ®ì
+ÇÔÈÔÉ°ì
+ÇÔÉÃب¹ì
+ÇÔÊÔ°ÈÑ¡´Ôì
+ÇÔÊÔ·¸Ôì
+ÇÔÊØ·¸Ô
+ÇÔÊØ·¸Ôì
+ÇÔÊÙµ
+ÇÕ àÍÊ à¹à¹ÍÃÑÅ à¤Á
+ÇÕ«èÒ (2000)
+ÇÕ³Ò
+ÇÕ¹ÑÊ
+ÇÕêÑÂ
+ÇÕÃ⪵Ô
+ÇÕÃà´ª
+ÇÕþ§Èì
+ÇÕþÅ
+ÇÕÃÂØ·Âì
+ÇÕÃÇÃó
+ÇÕÃÈÑ¡´Ôì
+ÇÕÃÊÔ·¸Ôì
+ÇÕÃÐ
+ÇÕÃЪÑÂ
+ÇÕÃЪҵÔ
+ÇÕÃЪÒÂ
+ÇÕÃÐà´ª
+ÇÕÃо§Éì
+ÇÕÃоÅ
+ÇÕÃÐÂØ·¸ì
+ÇÕÃÐÇÃó
+ÇÕÃÐÇѲ¹ì
+ÇÕÃÐÈÑ¡´Ôì
+ÇÕÃÒÀóì
+ÇزԡÃ
+ÇزԪÑÂ
+ÇزԹѹ·ì
+ÇزԹÑÂ
+ÇزԾ§Èì
+ÇزԾ¨¹ì
+ÇزԾÅ
+ÇزÔÃѵ¹ì
+àÇèÂà©Ô¹ÍÔ¹´ÑÊàµÃÕ¹
+àÇÍÃìâ¡é ·ÃҹʻÍÃìµ
+áÇÇÇ´Õ
+áÇÇÇÔÀÒ
+äÇ·Ô¹
+È¡ÅÇÃó
+ȨÕ
+ÈÁÅÇÃó
+ÈÂÒÁÅ
+ÈêÑÂ
+ÈÃÇÑÅÂì
+ÈÃÑ­­Ò
+ÈÃѳ¾Ã
+ÈÃѳÂì
+ÈÃÒÁÒÈ
+ÈÃÒÇزÔ
+ÈÃÒÇظ
+ÈÃÔ¹·Ãì
+ÈÃըѹ·Ãì
+ÈÃըѹ·ÃÒ
+ÈÃշͧà¹Áà¾Å·
+ÈÃշͧÍصÊÒË¡ÃÃÁ«Ñ¾¾ÅÒÂ
+ÈÃÕ¹ÇÅ
+ÈÃÕ»ÃÐä¾
+ÈÃÕ»ÃÐÀÒ
+ÈÃÕ¾§Éì
+ÈÃÕà¾ç­
+ÈÃÕÀÒ
+ÈÃÕÃѵ¹ì
+ÈÃÕÇѨ¹Ò
+ÈÃÕÇѲ¹Ò
+ÈÃÕÇÔ¡Ò
+ÈÃÕÈÑ¡´Ôì
+ÈÃÕÊ¡ØÅ
+ÈÃÕÊÁÃ
+ÈÃÕÊÁÃ
+ÈÃÕÊÁÃ
+ÈÃÕÊØÇÃó¤Í¹àÇàÂÍÃìàºÅ·ì á͹´ì ÃѺàºÍÃì
+ÈÃÕ͹§¤ì
+ÈÃÕÍÓ¾ÅÍصÊÒË¡ÃÃÁ
+ÈÅÔÉÒ
+ÈÈÁÅ
+ÈÈÔ
+ÈÈÔ¸Ã
+ÈÈÔ¾Ã
+ÈÈÔÀÒ
+ÈÈÔÁÒ
+ÈÈÔÇÔÁÅ
+ÈÈÔÉÒ
+ÈÑ¡´Ò
+ÈÑ¡´Ôì
+ÈÑ¡´ÔìªÑÂ
+ÈÑ¡´ÔìàªÇ§
+ÈÑ¡´Ôì´Ò
+ÈÑ¡´ÔìÇÔºÙÅÂì
+ÈÑ¡ÃÔ¹·Ãì
+ÈѹʹÕÂì
+ÈÒ¹µÔᏴì
+ÈÔÁÒÃÕ
+ÈÔÃÉÒ
+ÈÔÃÒ¾Ã
+ÈÔÃÔ
+ÈÔÃÔ¡ØÅ
+ÈÔÃԨѹ·Ãì
+ÈÔÃÔâ©Á
+ÈÔÃÔªÑÂ
+ÈÔÃÔ·Ñȹì
+ÈÔÃÔ¸Ã
+ÈÔÃÔ¹­Ò
+ÈÔÃÔ¹Òö
+ÈÔÃԹت
+ÈÔÃÔ¾§Éì
+ÈÔÃÔ¾Ã
+ÈÔÃÔ¾Ãó
+ÈÔÃÔà¾ç­
+ÈÔÃÔÁÒ
+ÈÔÃÔÃѨ¹ì
+ÈÔÃÔÃѵ¹ì
+ÈÔÃÔÅѡɳì
+ÈÔÃÔÇÃó
+ÈÔÃÔÇѲ¹ì
+ÈÔÃÔÈÑ¡´Ôì
+ÈÔâè¹ì
+ÈÔÅ»ªÑÂ
+ÈÔÅÒ
+ÈÔǾÃ
+ÈÔǾÅ
+ÈÔÇÒ¾Ã
+ÈÔÇÒÀóì
+ÈØÀ¡Ã
+ÈØÀ¡Ô¨
+ÈØÀªÑÂ
+ÈØÀ¾Ã
+ÈØÀÁÔµÃ
+ÈØÀÃ
+ÈØÀÃѵ¹ì
+ÈØÀÃÒÀóì
+ÈØÀÅѡɳì
+ÈØÀÇѲ¹ì
+ÈØÀÇÔ·Âì
+ÈØÀÈÑ¡´Ôì
+ÈØÀÔÊÃÒ
+àÈÃÉ°¸Ã
+àÈÃÉ°¾§Éì
+âÈôÒ
+ÉØÀÁ¹
+Ê ÍÒ´
+Ê.͹ѹµìàÍ繨Ôà¹ÕÂÃÔè§ á͹¤Í¹ÊµÃѤªÑè¹
+Ê¡ÅÃѵ¹ì
+Ê¡ÒÇÃѵ¹ì
+ʧ¡Ã³ì
+ʧ¡ÃÒ¹µì
+ʧǹ
+Êè§ÈÃÕ
+Êè§àÊÃÔÁ
+ʧѴ
+ʧèÒ
+ʴѺ¾Ô³
+Êáµ¹´ÒÃì´ ªÒÃìàµÍÃì (»ÃÐà·Èä·Â)
+ʶҾÃ
+ʶÔÃÂÒ
+ʹã¨
+ʹ·ÂÒ
+ʹ¸¾
+ʹ¸ÂÒ
+ʹͧ
+ʹÑè¹
+ʹԴÒ
+Êà»ç¤ à´ç¹ µÑÅ áź
+Ê໫¤ÍÁ
+ÊÁ
+ÊÁ¡ÁÅ
+ÊÁà¡ÕÂõÔ
+ÊÁ¤ÇÃ
+ÊÁ¤Ô´
+ÊÁ¨Ôµ
+ÊÁ¨Ôµµì
+ÊÁ¨ÔµÃ
+ÊÁ¨ÔµÃì
+ÊÁ¨Ô¹µ¹Ò
+ÊÁã¨
+ÊÁªÑÂ
+ÊÁªÒ­
+ÊÁªÒµÔ
+ÊÁªÒÂ
+ÊÁ⪤
+ÊÁ´Õ
+ÊÁà´ª
+ÊÁ·Ã§
+ÊÁ¹Ö¡
+ÊÁºÑµÔ
+ÊÁºØ­
+ÊÁºÙóì
+ÊÁ»Í§
+ÊÁ¾§Éì
+ÊÁ¾¨¹ì
+ÊÁ¾Ã
+ÊÁ¾Å
+ÊÁ¾ÔÈ
+ÊÁÀ¾
+ÊÁâÀª¹ì
+ÊÁÁÒö
+ÊÁÁÒȹì
+ÊÁâÁ·
+ÊÁÂÈ
+ÊÁÃ
+ÊÁÃÑ¡Éì
+ÊÁÄ´Õ
+ÊÁÄ·¸Ôì
+ÊÁÄ·ÑÂ
+ÊÁÅѡɳì
+ÊÁǧÉì
+ÊÁÈÃÕ
+ÊÁÈÑ¡´Ôì
+ÊÁÈÔÃÔ
+ÊÁÊØ¢
+ÊÁÊعÕÂì
+ÊÁË­Ô§
+ÊÁËÁÒÂ
+ÊÁËÇѧ
+ÊÁÑÂ
+ÊÁÒ¹
+ÊÁÔ·¸Ô
+ÊÁÔ·¸Ôì
+ÊÁتªÅ
+ÊÂÒÁ
+ÊÂÒÁ¤Í¹àÇàÂÍÃì
+ÊÂÒÁªÑÂâ¾ÅÕàÁÍÃì
+ÊÂÒÁä´à¤ÕÂÇ
+ÊÂÒÁ¹ÔÊÊѹ ÍÍâµéâÁºÔÅ
+ÊÂÒÁ¾Ãà·Ã´à«ç¹àµÍÃì
+ÊÂÒÁàÁ¦Õâ¾ÅÕàÁÍÃì
+ÊÂÒÁÂÙ¹Ôâ«Å
+ÊÂØÁ¾Ã
+ÊÃÃàÊÃÔ°­
+ÊÃÑ­­Ò
+ÊÃÒ¡Ã
+ÊÃÒ­¨Ôµ
+ÊÃÒÂظ
+ÊÃÒÇزÔ
+ÊÃÒÇظ
+ÊÃÔ¹ÃÒ
+ÊÃب
+ÊÅÑ¡¨ÔµÃ
+ÊàŤ·ì¿ÍÃìÁà¿ÍÃì¹Ôà¨ÍÃìáÅкصÃ
+ÊÇÅѡɳì
+ÊÇÑÊ´Ôì
+ÊÇÕâè¹ì
+ÊÇÕÇÃó
+ÊÊԾѹ¸Øì
+ÊËà¡ÕÂõÔâÅËÐà¡ÕÂõÔ
+Ê˾Å
+ÊÍÒ´
+Êзé͹
+ÊѧÇÒÅÂì
+ÊѨ¾§Éì
+ÊÑ­ª¹Ò
+ÊÑ­ªÑÂ
+ÊÑ­­Ò
+ÊѹµÔ
+ÊѹµÔªÑÂ
+ÊÑÁ¾Ñ¹¸ì
+ÊÑÁÄ·¸Ôì
+ÊÒ¤Ã
+ÊÒ¸Ôµ
+ÊÒ¹ÔµÂì
+ÊÒÁÀ¾
+ÊÒÁÒö
+ÊÒÂã¨
+ÊÒªÅ
+ÊÒ¹·Õ
+ÊÒ½¹
+ÊÒÂä¿¿éÒä·Â-ÂÒ«Ò¡Ô
+ÊÒ¹µì
+ÊÒÂÅÁ
+ÊÒÂÊÁÃ
+ÊÒÂÊسÕ
+ÊÒÂÊعÕÂì
+ÊÒÂѳ
+ÊÒÂѳËì
+ÊÒâè¹ì
+ÊÒâê
+ÊÒÅÕ
+ÊÒÅÕè
+ÊÒÇÔµÃÕ
+Êӹѡ¹âºÒÂáÅÐá¼¹¡Ãا෾ÁËÒ¹¤Ã
+ÊÓà¹Õ§
+ÊÓÃÇÁ
+ÊÓÃÇÂ
+ÊÓÃÒ­
+ÊÓÄ·¸Ôì
+ÊÓÅÕ
+ÊÔ§Ëì
+ÊÔ§Ëì¾Å
+ÊÔ§ËÒ
+ÊԵҹѹ
+ÊÔµÒ¾Ã
+ÊÔ·¸Ò
+ÊÔ·¸Ôì
+ÊÔ·¸ÔªÑÂ
+ÊÔ·¸Ôà´ª
+ÊÔ·¸Ô¾Ã
+ÊÔ·¸Ô¾Ãó
+ÊÔ·¸Ô¾Å
+ÊÔ¹·ÇÕ
+ÊÔÃÔªÑÂ
+ÊÔÃÔà´ª
+ÊÔÃÔ¹¾Ã
+ÊÔÃÔ¹Ãѵ¹ì
+ÊÔÃÔ»ÃÐÀÒ
+ÊÔÃÔ¾§Éì
+ÊÔÃÔ¾Ã
+ÊÔÃÔ¾Ãó
+ÊÔÃԾѹ¸ì
+ÊÔÃÔÁÒ
+ÊÔÃÔÃѵ¹ì
+ÊÔÃÔÅѡɳì
+ÊÔÃÔÇÃó
+ÊÔÃÔÇѲ¡ì
+ÊÔÃÔÇѲ¹Ò
+ÊÔâè¹ì
+ÊÔÇÅÕ
+ÊÕ¹ÇÅ
+ÊÕÇÔ¡Ò
+ÊØ¡ÃÕ
+ÊØ¡Ñ­­Ò
+ÊØ¡Ò¹´Ò
+ÊØ¡Ô¨
+ÊØ¡ÔµÔì
+ÊØ¡ÕµÔì
+ÊØ¡ØÁÒ
+ÊØ¢
+ÊØ¢ªÒÂ
+ÊآĴÕ
+ÊØ¢ÊÇÑÊ´Ôì¡Å¡ÒÃ
+ÊØ¢Êѹµì
+ÊØ¢ØÁ
+Êؤ¹¸ì
+Êؤ¹¸Ò
+ÊبÒÃÕ
+ÊبԵ
+ÊبԵµÒ
+ÊبԵÃÒ
+ÊبԹ´Ò
+ÊبԹµì
+ÊبԹµ¹ì
+ÊتÅ
+ÊتÑÂ
+ÊتҴÒ
+ÊتҵÔ
+ÊتÒÂ
+ÊتÒÊÔ¹Õ
+ÊتԵ
+ÊتԹ
+ÊرÒÁÒÈ
+ÊسÕ
+Êشʧǹ
+ÊØ´ÊÇÒ·
+ÊØ´Ò
+ÊØ´ÒªÅÕ
+ÊØ´Ò¾Ã
+ÊØ´ÒÀÒ
+ÊØ´ÒÃѵ¹ì
+ÊØ´ÒÃÒ
+ÊØ´Õà¾é¹·ìà«ç¹àµÍÃì
+ÊØ·¸Ò·Ô¾Âì
+ÊØ·¸Ô¡Ò¨
+ÊØ·¸ÔªÑÂ
+ÊØ·¸Ô¹Ñ¹·ì
+ÊØ·¸Ô¹Õ
+ÊØ·¸Ô쾧Éì
+ÊØ·¸Ô¾Ãó
+ÊØ·¸ÔÇѲ¹ì
+ÊØ·¸ÔÈÑ¡´Ôì
+ÊØ·ÃÕ
+ÊØ·ÑÈ
+ÊØ·Ñȹì
+ÊØ·ÔµÂì
+ÊØ·Ô¹
+ÊØ·Ô¾Ò
+ÊØ·ÔÈÒ
+ÊØà·¾
+ÊظҷԾÂì
+ÊظҹԸÔ
+ÊظԴÒ
+ÊظÔÈÑ¡´Ôì
+ÊظÕ
+ÊظÕÃì
+ÊظÕÃÒ
+Êع·Ã
+Êع·ÃÕ
+Êعѷ·Õ
+Êعѹ·ì
+Êعѹ·Ò
+ÊعԵÒ
+ÊعÔÈÒ
+ÊعÔÉÒ
+ÊعÔÊÒ
+ÊعÕÂì
+ÊØ๵Ã
+ÊØ»ÃдÔÉ°ì
+ÊØ»ÃÐÇÕ³ì
+ÊØ»ÃÒ³Õ
+ÊØ»ÃÕÂÒ
+ÊØ»ÃÕÃдÒ
+Êػѭ­Ò
+Êؾ¨¹ì
+Êؾ¨ÁÒÅÂì
+ÊؾÃ
+ÊؾÃóÕ
+ÊؾÃÃÉÒ
+ÊؾÅ
+ÊؾѲ¹ì
+ÊؾѵÃÒ
+ÊؾԪ­ìª­Ò
+ÊؾԹ
+ÊؾÔÈ
+ÊؾÕÃìªÑÂ
+ÊØÀ¡Ô¨
+ÊØÀªÒ
+ÊØÀ⪤
+ÊØÀÁÒÊ
+ÊØÀѤ
+ÊØÀѵÃÒ
+ÊØÀÑ·ÃÒ
+ÊØÀÒ
+ÊØÀÒ³Õ
+ÊØÀÒ¾
+ÊØÀÒ¾Ã
+ÊØÀÒ¾Ãó
+ÊØÀÒÀóì
+ÊØÀÒôÕ
+ÊØÀÒÇ´Õ
+ÊØÀÔ­­Ò
+ÊØÁ¹µì
+ÊØÁ¹Ò
+ÊØÁÒÅÕ
+ÊØÁÒÊÕ
+ÊØÁÔµÃ
+ÊØÁÔµÃÒ
+ÊØàÁ¸
+ÊØàÁ¸Õ¡ì
+ÊØáԨ
+ÊØêÑÂ
+ÊØêҵÔ
+ÊØÃàªÉ°ì
+ÊØÃà´ª
+ÊØ÷Թ
+ÊØþ§Éì
+ÊØþÅ
+ÊØþѹ¸ì
+ÊØþѹ¸Øì
+ÊØÃÈÑ¡´Ôì
+ÊØÃÊÔ·¸Ôì
+ÊØÃѪ¹Õ¡Ã
+ÊØÃѵ¹ì
+ÊØÃѵ¹Ç´Õ
+ÊØÃѵ¹ìÇ´Õ
+ÊØÃѵ¹Ò
+ÊØÃѵÂÒ
+ÊØÃÒ§¤¹Ò
+ÊØÃÔªÑÂ
+ÊØÃÔ¹·Ãì
+ÊØÃÔ§Èì
+ÊØÃÔ¹
+ÊØÃÔ¹µì
+ÊØÃÔ¾§Èì
+ÊØÃÔÂѹ
+ÊØÃÔÂѹµì
+ÊØÃÔÂÒ
+ÊØÃÕ¸Ò¾Ã
+ÊØÃÕ¾Ã
+ÊØÃÕÁÒÈ
+ÊØÃÕÂì
+ÊØÃÕÂì¾Ã
+ÊØÃÕÃѵ¹ì
+ÊØÅÑ´´Ò
+ÊØÇÀÑ·Ãì
+ÊØÇÃó
+ÊØÇÃóªÑÂ
+ÊØÇÃóÒ
+ÊØÇÃóÕ
+ÊØÇÃóÕÂì
+ÊØÇÃѵ¹ì
+ÊØÇѲ¹ì
+ÊØÇѲ¹ìªÑÂ
+ÊØÇѲ¹Ò
+ÊØÇѵªÑÂ
+ÊØÇÒÃÕ
+ÊØÇÔªÑÂ
+ÊØÇÔªÒ
+ÊØÇÔ´Ò
+ÊØÇÔ·Âì
+ÊØÇÔÁÅ
+ÊØÇÔÃѪ
+ÊØÊÔÃÔ
+ÊØËÑʪÒ
+àÊ¡ÊÃÃ
+àÊ¡ÊÃäì
+àʶÕÂÃ
+àʹËì
+àʹÕÂì
+àÊÁÒ
+àÊÃÔÁäªÂ¤éÒ¡ÃдÒÉ
+àÊÃÔÁÈÑ¡´Ôì
+àÊÃÕ
+àÊÇÂ
+àÊÒǤ¹¸ì
+àÊÒdzÕ
+àÊÒdzÕÂì
+àÊÒǹԵÂì
+àÊÒǹÕÂì
+àÊÒÇÅѡɳì
+áʧªÑÂ
+áʧà´×͹
+áʧ·Í§
+áʧÃÐÇÕ
+áʹ·ÇÕà·ç¡«ìä·Åì
+áʹÀ¾
+áʹÂÒ¡Ã
+áʹÃÑ¡
+áʹÊØ¢
+áÊǧ
+âÊÀ³
+âÊÀÒ
+âÊÀÒ¾¨¹Õ
+âÊÀÒ¾Ãó
+âÊÀÕ
+âÊèԵ
+âÊôÒ
+âÊÃÊ
+âÊÃѨ
+âÊÌÊ
+˧
+Ë·ÑÂ
+Ë·Ñ·ԾÂì
+Ë·ÑÂÃѵ¹ì
+˹Öè§Ä·ÑÂ
+ËÃÔ¹
+ËÄ·Â
+ËÇÒ¹
+ËÍÁ¨Ñ¹·Ãì
+ËÑʹÕ
+ËÑÊÂÒ
+àËÁÇ´Õ
+àËÁ×͹¢ÇÑ­
+àËÁ×͹¾¹Í
+àËÃÕ­
+áËÅÁ·Í§ÊË¡ÒÃ
+Í.à¨ÃÔ­ÎÒÃì´áÇÃì
+ͧÍÒ¨
+Íâ³·ÂÒ
+Í´Ôàá
+Í´ÔÈÃ
+Í´ÔÈÑ¡´Ôì
+Í´ØÅ
+Í´ØžѲ¹ì
+Í´ØÅÂìà´ª
+͵Թت
+͵ԾÃ
+ͶԪÒ
+͸Ի¾Å
+͹§¤ì¹Ò®
+͹§¤ìÇÃó
+͹¹·ì
+͹ÇѪ
+͹ѭ­Ò
+͹ѹµì
+͹ѹµÈÑ¡´Ôì
+͹ءԵÔ
+͹ءÙÅ
+͹تÒ
+͹تԵ
+͹شÒ
+͹صµÃÒ
+͹صÃ
+͹طԵÒ
+͹ؾ§Èì
+͹ؾ§Éì
+͹ؾÃ
+͹ؾѹ¸ì
+͹ØÃÑ¡Éì
+͹ØÃѵ¹ì
+͹ØÃÑÉì
+͹ØÇѲ¹ì
+͹ØÈÑ¡´Ôì
+͹ØÊóì
+Í⹪Ò
+ÍÀѹµÃÕÊì
+ÍÀÔªÑÂ
+ÍÀÔªÒ µÔ
+ÍÀÔªÒµ
+ÍÀÔªÒµÔ
+ÍÀÔવ
+ÍÀÔ­­Ò
+ÍÀÔà´ª
+ÍÀԹѹ·ì
+ÍÀÔÀÒ´Ò
+ÍÀÔôÕ
+ÍÀÔÃÑ¡Éì
+ÍÀÔÇѲ¹ì
+ÍÀÔÇѹ·ì
+ÍÀÔÈÑ¡´Ôì
+ÍÀÔÊÃ
+ÍÀÔÊÔ·¸Ôì
+ÍÁêÑÂ
+ÍÁÃà·¾
+ÍÁÃÃѵ¹ì
+ÍÁÃÈÑ¡´Ôì
+ÍÁÃÊÔÃÔ
+ÍÁÃÒÅѡɳì
+ÍÁÔµÒ
+ÍÁÔ¹µÒ
+ÍÂظÂѹ
+ÍèÔÃÒ
+ÍêÃ
+ÍêسËì
+Íóѭªì
+Í÷ÑÂ
+Í÷ԪÒ
+ÍùԵÂì
+Íùت
+ÍÃ๵Ã
+ÍþÃó
+ÍþԹ
+ÍþԹ·Ãì
+ÍÃÀÑ·Ãì
+ÍÃæÂì
+ÍÃó¾
+ÍÃö¾¹¸ì
+ÍÃö¾Ã
+ÍÃö¾Å
+ÍÃöÊÔ·¸Ôì
+ÍÃÄ´Õ
+ÍÃÇÃó
+ÍÃÇÔ· ÍÔ¹àµÍÃì๪Ñè¹á¹Å
+ÍÃÈÁ
+ÍÃÈÃÕ
+ÍÃÊÒ
+ÍÃ͹§¤ì
+ÍÃÍØÁÒ
+ÍÃÑ­
+ÍÃÑ­­Ò
+ÍÃèÒÁÈÃÕ
+ÍÃÔªÑÂ
+ÍÃÔ¹ª¹Ò
+ÍÃÔ¹·ÁÒ
+ÍÃÔÂÒ
+ÍÃÔÂÒÀóì
+ÍÃÔÈÃÒ
+ÍÃÔÊÃÒ
+ÍÃÔÊÒ
+ÍÃس
+ÍÃسÃѵ¹ì
+ÍÃسÃØè§
+ÍÃسÈÃÕ
+ÍÃسÕ
+Íŧ¡µ
+Íŧ¡Ã³ì
+ÍǪÑÂ
+ÍͤµéÒ àÁÁâÁàÃÕÂÅ
+ÍͤµéÒàÁÁâÁàÃÕÂÅ
+ÍÍâµàÁªÑè¹à«ÍÃìÇÔÊ
+ÍéÍ·ԾÂì
+ÍÍÊ·ì ÍÍÂÊì
+ÍФÙà·ç¤·ì
+ÍÐÅÒ¹
+ÍѤÃà´ª
+ÍѤþ¹¸ì
+ÍѤþѨ¹ì
+ÍѤÃÇÔ·Âì
+ÍѤÃÇÔ¹·ì
+ÍѤÃÒ
+ÍѧʹÒ
+ÍѨ©ÃÒ
+ÍѪÂÒ
+ÍÑ­ª³Ò¾Ã
+ÍÑ­ª´Ò
+ÍÑ­ª¹Ò
+ÍÑ­ªÅÕ
+ÍÑ­ªØÅÕ
+ÍÑ®ÉÁÒ
+ÍѹÊÃÕÂì
+ÍÑ»ÊÃ
+ÍÑÁ¾Ã
+ÍÑÁ¾Ãó
+ÍÑÁä¾ÇÃó
+ÍÒ¤Á
+ÍÒ¨³Ã§¤ì
+ÍÒ«ÒÎÕ-ä·Â ÍÑÅÅÍÂ
+ÍҳѹÂì
+ÍÒ·Ô¡Ã
+ÍÒ·Ôµ
+ÍÒ¹¹·ì
+ÍÒ¹¾
+ÍҹѴ
+ÍҹѹµÂÒ
+ÍÒ¹ØÀÒ¾
+ÍÒÀóì
+ÍÒÀÒ
+ÍÒÀÒ¡Ã
+ÍÒÀÒ³Õ
+ÍÒÀÒ¾Ã
+ÍÒÀÒÀóì
+ÍéÒÂÍÔé§
+ÍÒÃì«Õ ¹ÔµáÇÃì
+ÍÒÃì«Ø»à»ÍÃì⫹Ԥ¾Ô¤ÍѾÊì
+ÍÒÃÁ³ì
+ÍÒÃÂѹ
+ÍÒÃÂÒ
+ÍÒÃÑ¡Éì
+ÍÒÃÒ¾Ã
+ÍÒÃÔÂÒ
+ÍÒÃÕ
+ÍÒÃÕÂì
+ÍÒÃÕÂì àÊÁÒ©ÔÁ (ä·Âູ¡Ñ¹
+ÍÒÃÕÃѵ¹ì
+ÍÒÃÕÇÃó
+ÍÓ¹ÇÂ
+ÍÓ¹Ò¨
+ÍÓ¾Ã
+ÍÓ¾Ãó
+ÍÓ¾Å
+ÍӾѹ¸ì
+ÍÓä¾
+ÍÓÀÒ
+ÍÔê¡«èÒ ÍÔ¹àµÍÃì๪Ñè¹á¹Åਹà¹ÃÑÅ à«ÅÅì
+Íԧ˷ÑÂ
+ÍÔ·¸Ô¾Å
+ÍԹ䫷ìà¤Á
+ÍÔ¹àµÍÃìàÇç·(»ÃÐà·Èä·Â)
+ÍÔ¹·ÔÃÒ
+ÍÔ¾
+ÍÔÁâ¡éá¾ç¤ ¤ÍÃì»ÍÃìàêÑè¹
+ÍÔÈÃÒ
+ÍÕ·Õ«Õ
+ÍØè§á¤Ð
+ÍسÒÇ´Õ
+ÍØ´Á
+ÍØ´Á¾§Èì
+ÍØ´Á¾Ã
+ÍØ´Á¾Ñ¹¸ì
+ÍØ´ÁàÁ´Ô¤ÍÅ ÍÔ¤ÇÔ»àÁé¹
+ÍØ´ÁÅѡɳì
+ÍØ´ÁÇþѹ¸ì
+ÍØ´ÁÈÑ¡´Ôì
+ÍØ´Ã
+ÍصâÁ·Âì
+ÍصÊÒË¡ÃÃÁ¼éÒà¤Å×ͺ¾ÅÒʵԡä·Â
+ÍØ·ÑÂ
+ÍØ·ÑÂÇÃó
+ÍØ·ØÁ¾Ã
+ÍØà·¹·Ãì
+ÍØè¹ã¨
+ÍغÅ
+ÍغžÃó
+ÍغÅÇÃó
+ÍØÁÒ
+ÍØÁÒ¾Ã
+ÍØÃÕÂì
+ÍØäÃ
+ÍØäþÃ
+ÍØäÃÃѵ¹ì
+ꯊ̗̂
+ÍØɳÕ
+ÍØÉÒ
+ÍØÊÒËì
+ÍØÌÒÃ
+àÍ.à¨.¾ÅÒÊ·ì
+àÍ¡ªÑÂ
+àÍç¡«Õà«ÅàŹ¿ÍÃìÁ
+àÍ¡ÃÒª
+àÍ¡ÃÔ¹·Ãì
+àÍ¡ÊÔ·¸Ôì
+à͡͹ѹµì
+àÍ¡ÍÃö
+àÍçª àÍçÁ «Õ â»ÅÕàÁÍÃì
+àÍçª.àÍçÁ.«Õ.â»ÅÔàÁÍÃì
+àÍçª.àÍçÁ.«Õ.â»ÅÕàÁÍÃì (º¨¡.)
+àÍàªÕÂàÊÃÔÁ¡Ô¨ÅÔÊ«Ôè§
+àÍç¹ ´Õ ठ(»ÃÐà·Èä·Â)
+àÍ¿ ÍÕ «Ô¤ÅÔ¤ (¡Ãا෾)
+àÍçÁ .«Õ.¾ÕÅÔÊ«Ôè§
+àÍçÁ «Õ ÍÐâ¡Ãà¤ÁÕ¤ÍÅ
+àÍçÁ.«Õ.¾Õ. ÅÔÊ«Ôè§
+àÍçÁ.àÍçÁ.«Õ.â»ÅÔàÁÍÃì
+àÍçÁ«ÕÊÂÒÁ âŨÕʵԤÊì
+àÍÊ à¨ ¾ÅÒÊ·ì á͹´ì ᾤ
+àÍÊ ¾Õ Ê᡹
+àÍÊ àÍÊ à¤ ¡Å¡ÒÃ
+àÍÊ.à¤.ÍÕ.
+àÍÊ.«Õ.¾Õ.ᾤ
+àÍÊ.¾Õ.¹ÔµµÔé§
+àÍÊ.àÍçÁ.ÇÕ ÊË¡ÒÃ
+àÍÊ.àÍÊ.ठ¡Å¡ÒÃ
+àÍÊ.àÍÊ.à¤.¡Å¡ÒÃ
+àÍÊ.àÍÊ.ÍÔ¹¡Íµ ÍÅÙÁÔà¹ÕÂÁ1999
+àÍÊÇÕ¹Ô··Ñ¹¾ÃÔ«ÔªÑè¹
+àÍ×é;ѹ¸Øì
+àÍ×éÍÁ¾Ã
+àÍ×éÍÍÒÃÕ
+á͹¹Ò
+á͹¹ÒÃÕ
+áͺºÕà¤ÃÊ·ì(»ÃÐà·Èä·Â)
+áÍÃì«Õ à¿Ã· ¿ÍÃìàÇÔ´àµÍÃì
+áÍÃì¾Õà¾ÔÅÍÔ¹àµÍÃì๪Ñè¹á¹Å
+áÍÅ¿èÒ â»Ãà«Ê«Ôè§
+áÍÊષ¾ÅÑÊ
+âÍàÃÕÂÅ·ÍÅ ¿Øé´
+âÍÇÍÐËÅÑè¾ÒÃì·à«ç¹àµÍÃì
+äÍ.«Õ.«Õ.ÍÔ¹àµÍÃì๪Ñè¹á¹Å (ÁËÒª¹)
+äÍ.·Õ.áÍ´ìÇÒ¹« à·¤ ¨Ó¡Ñ´
+äÍ.·Õ.á͹´ìÇÒ¹« à·¤ ¨Ó¡Ñ´
+äÍ.àÍÊ.äÍ.ÍÔ¹àµÍÃì๪Ñè¹á¹Å
+äÍÂàÃÈ
+ÎÍÊ·ì ÍÍÂÅì
+ÎÙàÇÍÃìÍصÊÒË¡ÃÃÁ(»ÃÐà·Èä·Â)
+àΧà¨ÃÔ­ªÑ ¡ÃØê» ÍÔ¹´ÑÊàµÃÕÂÅ
+DROP TABLE t1;
+SELECT 'a' = 'a ';
+'a' = 'a '
+1
+SELECT 'a\0' < 'a';
+'a\0' < 'a'
+1
+SELECT 'a\0' < 'a ';
+'a\0' < 'a '
+1
+SELECT 'a\t' < 'a';
+'a\t' < 'a'
+1
+SELECT 'a\t' < 'a ';
+'a\t' < 'a '
+1
+CREATE TABLE t1 (a char(10) not null);
+INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a ');
+SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
+hex(a) STRCMP(a,'a') STRCMP(a,'a ')
+61 0 0
+6100 -1 -1
+6109 -1 -1
+61 0 0
+DROP TABLE t1;
diff --git a/mysql-test/r/ctype_ujis.result b/mysql-test/r/ctype_ujis.result
index 1730b17eaed..b66ede3bed4 100644
--- a/mysql-test/r/ctype_ujis.result
+++ b/mysql-test/r/ctype_ujis.result
@@ -64,3 +64,31 @@ select 'A' like 'a';
select 'A' like 'a' collate ujis_bin;
'A' like 'a' collate ujis_bin
0
+set @ujis1= _ujis 0x8EA18EA28EA38EA48EA58EA68EA78EA88EA98EAA8EAB8EAC8EAD8EAE8EAF;
+set @ujis2= _ujis 0x8EB08EB18EB28EB38EB48EB58EB68EB78EB88EB98EBA8EBB8EBC8EBD8EBE8EBF;
+set @ujis3= _ujis 0x8EC08EC18EC28EC38EC48EC58EC68EC78EC88EC98ECA8ECB8ECC8ECD8ECE8ECF;
+set @ujis4= _ujis 0x8ED08ED18ED28ED38ED48ED58ED68ED78ED88ED98EDA8EDB8EDC8EDD8EDE8EDF;
+select hex(@utf81:= CONVERT(@ujis1 USING utf8));
+hex(@utf81:= CONVERT(@ujis1 USING utf8))
+EFBDA1EFBDA2EFBDA3EFBDA4EFBDA5EFBDA6EFBDA7EFBDA8EFBDA9EFBDAAEFBDABEFBDACEFBDADEFBDAEEFBDAF
+select hex(@utf82:= CONVERT(@ujis2 USING utf8));
+hex(@utf82:= CONVERT(@ujis2 USING utf8))
+EFBDB0EFBDB1EFBDB2EFBDB3EFBDB4EFBDB5EFBDB6EFBDB7EFBDB8EFBDB9EFBDBAEFBDBBEFBDBCEFBDBDEFBDBEEFBDBF
+select hex(@utf83:= CONVERT(@ujis3 USING utf8));
+hex(@utf83:= CONVERT(@ujis3 USING utf8))
+EFBE80EFBE81EFBE82EFBE83EFBE84EFBE85EFBE86EFBE87EFBE88EFBE89EFBE8AEFBE8BEFBE8CEFBE8DEFBE8EEFBE8F
+select hex(@utf84:= CONVERT(@ujis4 USING utf8));
+hex(@utf84:= CONVERT(@ujis4 USING utf8))
+EFBE90EFBE91EFBE92EFBE93EFBE94EFBE95EFBE96EFBE97EFBE98EFBE99EFBE9AEFBE9BEFBE9CEFBE9DEFBE9EEFBE9F
+select @ujis1 = CONVERT(@utf81 USING ujis);
+@ujis1 = CONVERT(@utf81 USING ujis)
+1
+select @ujis2 = CONVERT(@utf82 USING ujis);
+@ujis2 = CONVERT(@utf82 USING ujis)
+1
+select @ujis3 = CONVERT(@utf83 USING ujis);
+@ujis3 = CONVERT(@utf83 USING ujis)
+1
+select @ujis4 = CONVERT(@utf84 USING ujis);
+@ujis4 = CONVERT(@utf84 USING ujis)
+1
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 8b7178993a7..28af71b7681 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -63,6 +63,30 @@ select 'A' like 'a' collate utf8_bin;
select _utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%');
_utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%')
1
+SELECT 'a' = 'a ';
+'a' = 'a '
+1
+SELECT 'a\0' < 'a';
+'a\0' < 'a'
+1
+SELECT 'a\0' < 'a ';
+'a\0' < 'a '
+1
+SELECT 'a\t' < 'a';
+'a\t' < 'a'
+1
+SELECT 'a\t' < 'a ';
+'a\t' < 'a '
+1
+CREATE TABLE t1 (a char(10) character set utf8 not null);
+INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a ');
+SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
+hex(a) STRCMP(a,'a') STRCMP(a,'a ')
+61 0 0
+6100 -1 -1
+6109 -1 -1
+61 0 0
+DROP TABLE t1;
select insert('txs',2,1,'hi'),insert('is ',4,0,'a'),insert('txxxxt',2,4,'es');
insert('txs',2,1,'hi') insert('is ',4,0,'a') insert('txxxxt',2,4,'es')
this is a test
@@ -73,7 +97,7 @@ create table t1 select date_format("2004-01-19 10:10:10", "%Y-%m-%d");
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `date_format("2004-01-19 10:10:10", "%Y-%m-%d")` char(10) binary default NULL
+ `date_format("2004-01-19 10:10:10", "%Y-%m-%d")` binary(10) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from t1;
date_format("2004-01-19 10:10:10", "%Y-%m-%d")
@@ -83,7 +107,7 @@ set names koi8r;
create table t1 (s1 char(1) character set utf8);
insert into t1 values (_koi8r'ÁÂ');
Warnings:
-Warning 1264 Data truncated for column 's1' at row 1
+Warning 1265 Data truncated for column 's1' at row 1
select s1,hex(s1),char_length(s1),octet_length(s1) from t1;
s1 hex(s1) char_length(s1) octet_length(s1)
Á D0B0 1 2
@@ -91,19 +115,19 @@ drop table t1;
create table t1 (s1 tinytext character set utf8);
insert into t1 select repeat('a',300);
Warnings:
-Warning 1264 Data truncated for column 's1' at row 1
+Warning 1265 Data truncated for column 's1' at row 1
insert into t1 select repeat('Ñ',300);
Warnings:
-Warning 1264 Data truncated for column 's1' at row 1
+Warning 1265 Data truncated for column 's1' at row 1
insert into t1 select repeat('aÑ',300);
Warnings:
-Warning 1264 Data truncated for column 's1' at row 1
+Warning 1265 Data truncated for column 's1' at row 1
insert into t1 select repeat('Ña',300);
Warnings:
-Warning 1264 Data truncated for column 's1' at row 1
+Warning 1265 Data truncated for column 's1' at row 1
insert into t1 select repeat('ÑÑ',300);
Warnings:
-Warning 1264 Data truncated for column 's1' at row 1
+Warning 1265 Data truncated for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161
@@ -122,19 +146,19 @@ drop table t1;
create table t1 (s1 text character set utf8);
insert into t1 select repeat('a',66000);
Warnings:
-Warning 1264 Data truncated for column 's1' at row 1
+Warning 1265 Data truncated for column 's1' at row 1
insert into t1 select repeat('Ñ',66000);
Warnings:
-Warning 1264 Data truncated for column 's1' at row 1
+Warning 1265 Data truncated for column 's1' at row 1
insert into t1 select repeat('aÑ',66000);
Warnings:
-Warning 1264 Data truncated for column 's1' at row 1
+Warning 1265 Data truncated for column 's1' at row 1
insert into t1 select repeat('Ña',66000);
Warnings:
-Warning 1264 Data truncated for column 's1' at row 1
+Warning 1265 Data truncated for column 's1' at row 1
insert into t1 select repeat('ÑÑ',66000);
Warnings:
-Warning 1264 Data truncated for column 's1' at row 1
+Warning 1265 Data truncated for column 's1' at row 1
select length(s1),char_length(s1) from t1;
length(s1) char_length(s1)
65535 65535
@@ -146,7 +170,7 @@ drop table t1;
create table t1 (s1 char(10) character set utf8);
insert into t1 values (0x41FF);
Warnings:
-Warning 1264 Data truncated for column 's1' at row 1
+Warning 1265 Data truncated for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
41
@@ -154,7 +178,7 @@ drop table t1;
create table t1 (s1 varchar(10) character set utf8);
insert into t1 values (0x41FF);
Warnings:
-Warning 1264 Data truncated for column 's1' at row 1
+Warning 1265 Data truncated for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
41
@@ -162,10 +186,35 @@ drop table t1;
create table t1 (s1 text character set utf8);
insert into t1 values (0x41FF);
Warnings:
-Warning 1264 Data truncated for column 's1' at row 1
+Warning 1265 Data truncated for column 's1' at row 1
select hex(s1) from t1;
hex(s1)
41
drop table t1;
-create table t1 (a char(160) character set utf8, primary key(a));
-ERROR HY000: Incorrect sub part key. The used key part isn't a string, the used length is longer than the key part or the storage engine doesn't support unique sub keys
+create table t1 (a text character set utf8, primary key(a(360)));
+ERROR 42000: Specified key was too long; max key length is 1000 bytes
+CREATE TABLE t1 ( a varchar(10) ) CHARACTER SET utf8;
+INSERT INTO t1 VALUES ( 'test' );
+SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = b.a;
+a a
+test test
+SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = 'test' and b.a = 'test';
+a a
+test test
+SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = b.a and a.a = 'test';
+a a
+test test
+DROP TABLE t1;
+create table t1 (a char(255) character set utf8);
+insert into t1 values('b'),('b');
+select * from t1 where a = 'b';
+a
+b
+b
+select * from t1 where a = 'b' and a = 'b';
+a
+b
+b
+select * from t1 where a = 'b' and a != 'b';
+a
+drop table t1;
diff --git a/mysql-test/r/date_formats.result b/mysql-test/r/date_formats.result
index 165a8d7011c..fba1d9f47e3 100644
--- a/mysql-test/r/date_formats.result
+++ b/mysql-test/r/date_formats.result
@@ -78,11 +78,11 @@ select str_to_date(concat('15-01-2001',' 2:59:58.999'),
concat('%d-%m-%Y',' ','%H:%i:%s.%f'));
str_to_date(concat('15-01-2001',' 2:59:58.999'),
concat('%d-%m-%Y',' ','%H:%i:%s.%f'))
-2001-01-15 02:59:58.000999
+2001-01-15 02:59:58.999000
create table t1 (date char(30), format char(30) not null);
insert into t1 values
('2003-01-02 10:11:12', '%Y-%m-%d %H:%i:%S'),
-('03-01-02 8:11:2.123456', '%y-%m-%d %H:%i:%S'),
+('03-01-02 8:11:2.123456', '%y-%m-%d %H:%i:%S.%#'),
('2003-01-02 10:11:12 PM', '%Y-%m-%d %h:%i:%S %p'),
('2003-01-02 01:11:12.12345AM', '%Y-%m-%d %h:%i:%S.%f%p'),
('2003-01-02 02:11:12.12345AM', '%Y-%m-%d %h:%i:%S.%f %p'),
@@ -106,16 +106,16 @@ insert into t1 values
select date,format,str_to_date(date, format) as str_to_date from t1;
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 8:11:2.123456 %y-%m-%d %H:%i:%S 2003-01-02 08:11:02
+03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 2003-01-02 08:11:02
2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 2003-01-02 22:11:12
-2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 01:11:12.012345
-2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.012345
-2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 00:11:12.012345
+2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 01:11:12.123450
+2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.123450
+2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 00:11:12.123450
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 2003-01-02 23:11:12
10:20:10 %H:%i:%s 0000-00-00 10:20:10
10:20:10 %h:%i:%s.%f 0000-00-00 10:20:10
10:20:10AM %h:%i:%s%p 0000-00-00 10:20:10
-10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.000044
+10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.440000
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58
15 September 2001 %d %M %Y 2001-09-15 00:00:00
15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00
@@ -130,16 +130,16 @@ Thursday 53 1998 %W %u %Y 1998-12-31 00:00:00
select date,format,concat('',str_to_date(date, format)) as con from t1;
date format con
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02 10:11:12
-03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S 2003-01-02 08:11:02
+03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 2003-01-02 08:11:02
2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 2003-01-02 22:11:12
-2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 01:11:12.012345
-2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.012345
-2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 00:11:12.012345
+2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 01:11:12.123450
+2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.123450
+2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 00:11:12.123450
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 2003-01-02 23:11:12
10:20:10 %H:%i:%s 0000-00-00 10:20:10
10:20:10 %h:%i:%s.%f 0000-00-00 10:20:10
10:20:10AM %h:%i:%s%p 0000-00-00 10:20:10
-10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.000044
+10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.440000
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58
15 September 2001 %d %M %Y 2001-09-15 00:00:00
15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00
@@ -154,16 +154,16 @@ Thursday 53 1998 %W %u %Y 1998-12-31 00:00:00
select date,format,cast(str_to_date(date, format) as datetime) as datetime from t1;
date format datetime
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02 10:11:12
-03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S 2003-01-02 08:11:02
+03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 2003-01-02 08:11:02
2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 2003-01-02 22:11:12
-2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 01:11:12.012345
-2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.012345
-2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 00:11:12.012345
+2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 01:11:12.123450
+2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02 02:11:12.123450
+2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 2003-01-02 00:11:12.123450
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 2003-01-02 23:11:12
10:20:10 %H:%i:%s 0000-00-00 10:20:10
10:20:10 %h:%i:%s.%f 0000-00-00 10:20:10
10:20:10AM %h:%i:%s%p 0000-00-00 10:20:10
-10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.000044
+10:20:10.44AM %h:%i:%s.%f%p 0000-00-00 10:20:10.440000
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 2001-01-15 12:59:58
15 September 2001 %d %M %Y 2001-09-15 00:00:00
15 SEPTEMB 2001 %d %M %Y 2001-09-15 00:00:00
@@ -178,7 +178,7 @@ Thursday 53 1998 %W %u %Y 1998-12-31 00:00:00
select date,format,DATE(str_to_date(date, format)) as date2 from t1;
date format date2
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 2003-01-02
-03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S 2003-01-02
+03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 2003-01-02
2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 2003-01-02
2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 2003-01-02
2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 2003-01-02
@@ -202,16 +202,16 @@ Thursday 53 1998 %W %u %Y 1998-12-31
select date,format,TIME(str_to_date(date, format)) as time from t1;
date format time
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 10:11:12
-03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S 08:11:02
+03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 08:11:02
2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 22:11:12
-2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 01:11:12.012345
-2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.012345
-2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.012345
+2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 01:11:12.123450
+2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450
+2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.123450
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12
10:20:10 %H:%i:%s 10:20:10
10:20:10 %h:%i:%s.%f 10:20:10
10:20:10AM %h:%i:%s%p 10:20:10
-10:20:10.44AM %h:%i:%s.%f%p 10:20:10.000044
+10:20:10.44AM %h:%i:%s.%f%p 10:20:10.440000
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58
15 September 2001 %d %M %Y 00:00:00
15 SEPTEMB 2001 %d %M %Y 00:00:00
@@ -226,16 +226,16 @@ Thursday 53 1998 %W %u %Y 00:00:00
select date,format,concat(TIME(str_to_date(date, format))) as time2 from t1;
date format time2
2003-01-02 10:11:12 %Y-%m-%d %H:%i:%S 10:11:12
-03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S 08:11:02
+03-01-02 8:11:2.123456 %y-%m-%d %H:%i:%S.%# 08:11:02
2003-01-02 10:11:12 PM %Y-%m-%d %h:%i:%S %p 22:11:12
-2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 01:11:12.012345
-2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.012345
-2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.012345
+2003-01-02 01:11:12.12345AM %Y-%m-%d %h:%i:%S.%f%p 01:11:12.123450
+2003-01-02 02:11:12.12345AM %Y-%m-%d %h:%i:%S.%f %p 02:11:12.123450
+2003-01-02 12:11:12.12345 am %Y-%m-%d %h:%i:%S.%f%p 00:11:12.123450
2003-01-02 11:11:12Pm %Y-%m-%d %h:%i:%S%p 23:11:12
10:20:10 %H:%i:%s 10:20:10
10:20:10 %h:%i:%s.%f 10:20:10
10:20:10AM %h:%i:%s%p 10:20:10
-10:20:10.44AM %h:%i:%s.%f%p 10:20:10.000044
+10:20:10.44AM %h:%i:%s.%f%p 10:20:10.440000
15-01-2001 12:59:58 %d-%m-%Y %H:%i:%S 12:59:58
15 September 2001 %d %M %Y 00:00:00
15 SEPTEMB 2001 %d %M %Y 00:00:00
@@ -302,11 +302,15 @@ date format str_to_date
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'
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'
drop table t1;
select get_format(DATE, 'USA') as a;
a
@@ -335,3 +339,56 @@ date_format(d,"%d")
14
14
drop table t1;
+select str_to_date("2003-....01ABCD-02 10:11:12.0012", "%Y-%.%m%@-%d %H:%i:%S.%f") as a;
+a
+2003-01-02 10:11:12.001200
+create table t1 select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f") as f1,
+str_to_date("10:11:12.0012", "%H:%i:%S.%f") as f2,
+str_to_date("2003-01-02", "%Y-%m-%d") as f3,
+str_to_date("02", "%d") as f4, str_to_date("02 10", "%d %H") as f5;
+describe t1;
+Field Type Null Key Default Extra
+f1 datetime YES NULL
+f2 time YES NULL
+f3 date YES NULL
+f4 date YES NULL
+f5 time YES NULL
+select * from t1;
+f1 f2 f3 f4 f5
+2003-01-02 10:11:12 10:11:12 2003-01-02 0000-00-02 58:00:00
+drop table t1;
+create table t1 select "02 10" as a, "%d %H" as b;
+select str_to_date(a,b) from t1;
+str_to_date(a,b)
+0000-00-02 10:00:00
+create table t2 select str_to_date(a,b) from t1;
+describe t2;
+Field Type Null Key Default Extra
+str_to_date(a,b) binary(29) YES NULL
+select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f") as f1,
+str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S") as f2,
+str_to_date("2003-01-02", "%Y-%m-%d") as f3,
+str_to_date("02 10:11:12", "%d %H:%i:%S.%f") as f4,
+str_to_date("02 10:11:12", "%d %H:%i:%S") as f5,
+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'
+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,
+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'
+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'
diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result
index 10f2c069429..f1acc5d2dfa 100644
--- a/mysql-test/r/delete.result
+++ b/mysql-test/r/delete.result
@@ -93,8 +93,8 @@ a b
2 12
delete ignore t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a);
Warnings:
-Error 1241 Subquery returns more than 1 row
-Error 1241 Subquery returns more than 1 row
+Error 1242 Subquery returns more than 1 row
+Error 1242 Subquery returns more than 1 row
select * from t11;
a b
0 10
@@ -113,8 +113,8 @@ a b
2 12
delete ignore from t11 where t11.b <> (select b from t2 where t11.a < t2.a);
Warnings:
-Error 1241 Subquery returns more than 1 row
-Error 1241 Subquery returns more than 1 row
+Error 1242 Subquery returns more than 1 row
+Error 1242 Subquery returns more than 1 row
select * from t11;
a b
0 10
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index 049d88c5154..f5754bb3332 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -213,7 +213,7 @@ ERROR 42000: You have an error in your SQL syntax. Check the manual that corres
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.
+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
insert into (select * from t1) values (5);
@@ -264,15 +264,15 @@ N M
2 2
3 0
UPDATE `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2, P2.N = 2;
-ERROR HY000: The target table P2 of the UPDATE is not updatable.
+ERROR HY000: The target table P2 of the UPDATE is not updatable
UPDATE `t1` AS P1 INNER JOIN (SELECT aaaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2;
ERROR 42S22: Unknown column 'aaaa' in 'field list'
delete P1.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
select * from t1;
N M
3 0
-delete P1.*,P2.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
-ERROR HY000: The target table P2 of the DELETE is not updatable.
+delete P1.*,p2.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS p2 ON P1.N = p2.N;
+ERROR HY000: The target table p2 of the DELETE is not updatable
delete P1.* from `t1` AS P1 INNER JOIN (SELECT aaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
ERROR 42S22: Unknown column 'aaa' in 'field list'
drop table t1;
@@ -320,3 +320,9 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> system NULL NULL NULL NULL 1
2 DERIVED t2 range PRIMARY PRIMARY 4 NULL 2 Using where; Using index
drop table t2;
+CREATE TABLE `t1` ( `itemid` int(11) NOT NULL default '0', `grpid` varchar(15) NOT NULL default '', `vendor` int(11) NOT NULL default '0', `date_` date NOT NULL default '0000-00-00', `price` decimal(12,2) NOT NULL default '0.00', PRIMARY KEY (`itemid`,`grpid`,`vendor`,`date_`), KEY `itemid` (`itemid`,`vendor`), KEY `itemid_2` (`itemid`,`date_`));
+insert into t1 values (128, 'rozn', 2, now(), 10),(128, 'rozn', 1, now(), 10);
+SELECT MIN(price) min, MAX(price) max, AVG(price) avg FROM (SELECT SUBSTRING( MAX(concat(date_,";",price)), 12) price FROM t1 WHERE itemid=128 AND grpid='rozn' GROUP BY itemid, grpid, vendor) lastprices;
+min max avg
+10.00 10.00 10
+DROP TABLE t1;
diff --git a/mysql-test/r/drop.result b/mysql-test/r/drop.result
index 3748af1b8f9..8b919964163 100644
--- a/mysql-test/r/drop.result
+++ b/mysql-test/r/drop.result
@@ -21,6 +21,7 @@ select * from mysqltest.mysqltest;
n
4
drop database if exists mysqltest;
+affected rows: 1
create database mysqltest;
drop database mysqltest;
flush tables with read lock;
diff --git a/mysql-test/r/drop_temp_table.result b/mysql-test/r/drop_temp_table.result
index 6d3f18f55e2..6eba97b089b 100644
--- a/mysql-test/r/drop_temp_table.result
+++ b/mysql-test/r/drop_temp_table.result
@@ -9,10 +9,6 @@ select get_lock("a",10);
get_lock("a",10)
1
show binlog events;
-Log_name Pos Event_type Server_id End_log_pos Info
-master-bin.000001 4 Format_desc 1 95 Server ver: VERSION, Binlog ver: 4
-master-bin.000001 95 Query 1 190 use `test`; create database `drop-temp+table-test`
-master-bin.000001 190 Query 1 306 use `drop-temp+table-test`; create temporary table `table:name` (a int)
-master-bin.000001 306 Query 1 447 use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE `drop-temp+table-test`.`table:name`
-master-bin.000001 447 Query 1 540 use `drop-temp+table-test`; DO RELEASE_LOCK("a")
+master-bin.000001 246 Query 1 246 use `drop-temp+table-test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `drop-temp+table-test`.`table:name`
+master-bin.000001 375 Query 1 375 use `drop-temp+table-test`; DO RELEASE_LOCK("a")
drop database `drop-temp+table-test`;
diff --git a/mysql-test/r/endspace.result b/mysql-test/r/endspace.result
new file mode 100644
index 00000000000..d2519523f36
--- /dev/null
+++ b/mysql-test/r/endspace.result
@@ -0,0 +1,196 @@
+drop table if exists t1;
+select 'a' = 'a', 'a' = 'a ', 'a ' = 'a';
+'a' = 'a' 'a' = 'a ' 'a ' = 'a'
+1 1 1
+select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a';
+'a\0' = 'a' 'a\0' < 'a' 'a\0' > 'a'
+0 1 0
+select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0';
+'a' = 'a\0' 'a' < 'a\0' 'a' > 'a\0'
+0 0 1
+select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a ';
+'a\0' = 'a ' 'a\0' < 'a ' 'a\0' > 'a '
+0 1 0
+select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0';
+'a ' = 'a\0' 'a ' < 'a\0' 'a ' > 'a\0'
+0 0 1
+select 'a a' > 'a', 'a \0' < 'a';
+'a a' > 'a' 'a \0' < 'a'
+1 1
+select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a';
+binary 'a a' > 'a' binary 'a \0' > 'a' binary 'a\0' > 'a'
+1 1 1
+create table t1 (text1 varchar(32) not NULL, KEY key1 (text1));
+insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%';
+text1
+teststring
+teststring
+select * from t1 where text1='teststring' or text1 like 'teststring_%';
+text1
+teststring
+teststring
+select * from t1 where text1='teststring' or text1 > 'teststring\t';
+text1
+teststring
+select * from t1 order by text1;
+text1
+nothing
+teststring
+teststring
+explain select * from t1 order by text1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL key1 32 NULL 3 Using index
+alter table t1 modify text1 char(32) binary not null;
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%';
+text1
+teststring
+teststring
+select * from t1 where text1='teststring' or text1 like 'teststring_%';
+text1
+teststring
+teststring
+select * from t1 where text1='teststring' or text1 > 'teststring\t';
+text1
+teststring
+select text1, length(text1) from t1 order by text1;
+text1 length(text1)
+nothing 7
+teststring 11
+teststring 10
+select text1, length(text1) from t1 order by binary text1;
+text1 length(text1)
+nothing 7
+teststring 10
+teststring 11
+alter table t1 modify text1 blob not null, drop key key1, add key key1 (text1(20));
+insert into t1 values ('teststring ');
+select concat('|', text1, '|') from t1 order by text1;
+concat('|', text1, '|')
+|nothing|
+|teststring|
+|teststring |
+|teststring |
+alter table t1 modify text1 text not null, pack_keys=1;
+select * from t1 where text1 like 'teststring_%';
+text1
+teststring
+teststring
+select * from t1 where text1='teststring' or text1 like 'teststring_%';
+text1
+teststring
+teststring
+teststring
+select * from t1 where text1='teststring' or text1 > 'teststring\t';
+text1
+teststring
+teststring
+select concat('|', text1, '|') from t1 order by text1;
+concat('|', text1, '|')
+|nothing|
+|teststring |
+|teststring|
+|teststring |
+drop table t1;
+create table t1 (text1 varchar(32) not NULL, KEY key1 (text1)) pack_keys=0;
+insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
+select * from t1 where text1='teststring' or text1 like 'teststring_%';
+text1
+teststring
+teststring
+select * from t1 where text1='teststring' or text1 >= 'teststring\t';
+text1
+teststring
+teststring
+drop table t1;
+create table t1 (text1 varchar(32) not NULL, KEY key1 using BTREE (text1)) engine=heap;
+insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
+select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%';
+text1
+teststring
+teststring
+select * from t1 where text1='teststring' or text1 like 'teststring_%';
+text1
+teststring
+teststring
+select * from t1 where text1='teststring' or text1 >= 'teststring\t';
+text1
+teststring
+teststring
+select * from t1 order by text1;
+text1
+nothing
+teststring
+teststring
+explain select * from t1 order by text1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL key1 32 NULL 3
+alter table t1 modify text1 char(32) binary not null;
+select * from t1 order by text1;
+text1
+nothing
+teststring
+teststring
+drop table t1;
+create table t1 (text1 varchar(32) not NULL, KEY key1 (text1)) engine=innodb;
+insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+select * from t1 where text1='teststring' or text1 like 'teststring_%';
+text1
+teststring
+teststring
+select * from t1 where text1='teststring' or text1 > 'teststring\t';
+text1
+teststring
+select * from t1 order by text1;
+text1
+nothing
+teststring
+teststring
+explain select * from t1 order by text1;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL key1 32 NULL 4 Using index
+alter table t1 modify text1 char(32) binary not null;
+select * from t1 order by text1;
+text1
+nothing
+teststring
+teststring
+alter table t1 modify text1 blob not null, drop key key1, add key key1 (text1(20));
+insert into t1 values ('teststring ');
+select concat('|', text1, '|') from t1 order by text1;
+concat('|', text1, '|')
+|nothing|
+|teststring|
+|teststring |
+|teststring |
+alter table t1 modify text1 text not null, pack_keys=1;
+select * from t1 where text1 like 'teststring_%';
+text1
+teststring
+teststring
+select text1, length(text1) from t1 where text1='teststring' or text1 like 'teststring_%';
+text1 length(text1)
+teststring 10
+teststring 11
+teststring 11
+select text1, length(text1) from t1 where text1='teststring' or text1 >= 'teststring\t';
+text1 length(text1)
+teststring 10
+teststring 11
+teststring 11
+select concat('|', text1, '|') from t1 order by text1;
+concat('|', text1, '|')
+|nothing|
+|teststring |
+|teststring|
+|teststring |
+drop table t1;
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result
index 04c36f059e2..02850e4d902 100644
--- a/mysql-test/r/fulltext.result
+++ b/mysql-test/r/fulltext.result
@@ -5,6 +5,10 @@ INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),
('Only MyISAM tables','support collections'),
('Function MATCH ... AGAINST()','is used to do a search'),
('Full-text search in MySQL', 'implements vector space model');
+SHOW INDEX FROM t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t1 1 a 1 a A NULL NULL NULL YES FULLTEXT
+t1 1 a 2 b A NULL NULL NULL YES FULLTEXT
select * from t1 where MATCH(a,b) AGAINST ("collections");
a b
Only MyISAM tables support collections
@@ -138,8 +142,15 @@ a b
MySQL has now support for full-text search
select * from t1 where MATCH a,b AGAINST ('"text i"' IN BOOLEAN MODE);
a b
+select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN BOOLEAN MODE);
+a b
+select * from t1 where MATCH a,b AGAINST ('+(+(support collections)) +foobar*' IN BOOLEAN MODE);
+a b
select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE);
a b
+select * from t1 where MATCH a,b AGAINST('"space model' IN BOOLEAN MODE);
+a b
+Full-text search in MySQL implements vector space model
select * from t1 where MATCH a AGAINST ("search" IN BOOLEAN MODE);
a b
Full-text search in MySQL implements vector space model
@@ -210,7 +221,7 @@ id
show keys from t2;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t2 1 tig 1 ticket A NULL NULL NULL YES BTREE
-t2 1 tix 1 inhalt A NULL 1 NULL YES FULLTEXT
+t2 1 tix 1 inhalt A NULL NULL NULL YES FULLTEXT
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -339,6 +350,9 @@ t collation(t)
aus Osnabrück utf8_general_ci
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
t collation(t)
+SELECT t, collation(t),MATCH t AGAINST ('Osnabruck') FROM t1 WHERE MATCH t AGAINST ('Osnabruck');
+t collation(t) MATCH t AGAINST ('Osnabruck')
+aus Osnabrück utf8_general_ci 1.591139793396
alter table t1 modify t varchar(200) collate latin1_german2_ci not null;
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrück');
t collation(t)
diff --git a/mysql-test/r/fulltext_var.result b/mysql-test/r/fulltext_var.result
index 89d477c1a7c..50afea2a500 100644
--- a/mysql-test/r/fulltext_var.result
+++ b/mysql-test/r/fulltext_var.result
@@ -1,7 +1,38 @@
+drop table if exists t1;
show variables like "ft\_%";
Variable_name Value
ft_boolean_syntax + -><()~*:""&|
-ft_min_word_len 4
ft_max_word_len 84
+ft_min_word_len 4
ft_query_expansion_limit 20
ft_stopword_file (built-in)
+create table t1 (b text not null);
+insert t1 values ('aaaaaa bbbbbb cccccc');
+insert t1 values ('bbbbbb cccccc');
+insert t1 values ('aaaaaa cccccc');
+select * from t1 where match b against ('+aaaaaa bbbbbb' in boolean mode);
+b
+aaaaaa bbbbbb cccccc
+aaaaaa cccccc
+set ft_boolean_syntax=' +-><()~*:""&|';
+ERROR HY000: Variable 'ft_boolean_syntax' is a GLOBAL variable and should be set with SET GLOBAL
+set global ft_boolean_syntax=' +-><()~*:""&|';
+select * from t1 where match b against ('+aaaaaa bbbbbb' in boolean mode);
+b
+aaaaaa bbbbbb cccccc
+bbbbbb cccccc
+set global ft_boolean_syntax='@ -><()~*:""&|';
+select * from t1 where match b against ('+aaaaaa bbbbbb' in boolean mode);
+b
+aaaaaa bbbbbb cccccc
+bbbbbb cccccc
+aaaaaa cccccc
+select * from t1 where match b against ('+aaaaaa @bbbbbb' in boolean mode);
+b
+aaaaaa bbbbbb cccccc
+bbbbbb cccccc
+set global ft_boolean_syntax='@ -><()~*:""@|';
+ERROR 42000: Variable 'ft_boolean_syntax' can't be set to the value of '@ -><()~*:""@|'
+set global ft_boolean_syntax='+ -><()~*:""@!|';
+ERROR 42000: Variable 'ft_boolean_syntax' can't be set to the value of '+ -><()~*:""@!|'
+drop table t1;
diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result
index 1fcda7748b3..61aa1c0a497 100644
--- a/mysql-test/r/func_compress.result
+++ b/mysql-test/r/func_compress.result
@@ -65,6 +65,6 @@ NULL
50000
NULL
Warnings:
-Error 1258 ZLIB: Input data was corrupted for zlib
-Error 1255 Too big size of uncompressed data. The maximum size is 1048576. (probably, length of uncompressed data was corrupted)
+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)
drop table t1;
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index af6f7956fe3..dccd87e3d75 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -59,11 +59,16 @@ grp group_concat(d order by a desc)
1 a
2 b,a
3 c,d,d,b,b,a
-select grp,group_concat(a order by a,d+c) from t1 group by grp;
-grp group_concat(a order by a,d+c)
+select grp,group_concat(a order by a,d+c-ascii(c)-a) from t1 group by grp;
+grp group_concat(a order by a,d+c-ascii(c)-a)
1 1
2 2,3
3 4,5,6,7,8,9
+select grp,group_concat(a order by d+c-ascii(c),a) from t1 group by grp;
+grp group_concat(a order by d+c-ascii(c),a)
+1 1
+2 3,2
+3 7,8,4,6,9,5
select grp,group_concat(c order by 1) from t1 group by grp;
grp group_concat(c order by 1)
1 a
@@ -136,17 +141,7 @@ grp ROUND(group_concat(a separator ""))
3 456789
drop table t1;
create table t1 (grp int, c char(10));
-insert into t1 values (1,NULL);
-insert into t1 values (2,"b");
-insert into t1 values (2,NULL);
-insert into t1 values (3,"E");
-insert into t1 values (3,NULL);
-insert into t1 values (3,"D");
-insert into t1 values (3,NULL);
-insert into t1 values (3,NULL);
-insert into t1 values (3,"D");
-insert into t1 values (4,"");
-insert into t1 values (5,NULL);
+insert into t1 values (1,NULL),(2,"b"),(2,NULL),(3,"E"),(3,NULL),(3,"D"),(3,NULL),(3,NULL),(3,"D"),(4,""),(5,NULL);
select grp,group_concat(c order by c) from t1 group by grp;
grp group_concat(c order by c)
1 NULL
@@ -163,10 +158,10 @@ grp group_concat(c)
4
5 NULL
Warnings:
-Warning 1259 1 line(s) was(were) cut by group_concat()
+Warning 1260 1 line(s) was(were) cut by group_concat()
show warnings;
Level Code Message
-Warning 1259 1 line(s) was(were) cut by group_concat()
+Warning 1260 1 line(s) was(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
@@ -207,9 +202,21 @@ NULL
drop table t1;
drop table t2;
create table t1 (bar varchar(32));
-insert into t1 values('test'),('test2');
-select * from t1 having group_concat(bar)='';
+insert into t1 values('test1'),('test2');
+select group_concat(bar order by concat(bar,bar)) from t1;
+group_concat(bar order by concat(bar,bar))
+test1,test2
+select group_concat(bar order by concat(bar,bar) desc) from t1;
+group_concat(bar order by concat(bar,bar) desc)
+test2,test1
+select bar from t1 having group_concat(bar)='';
+bar
+select bar from t1 having instr(group_concat(bar), "test") > 0;
bar
+test1
+select bar from t1 having instr(group_concat(bar order by concat(bar,bar) desc), "test2,test1") > 0;
+bar
+test1
drop table t1;
create table t1 (a int, a1 varchar(10));
create table t2 (a0 int);
@@ -222,3 +229,75 @@ select group_concat(a1 order by (t1.a)) from t1;
group_concat(a1 order by (t1.a))
b,a,c
drop table t1, t2;
+CREATE TABLE t1 (id1 tinyint(4) NOT NULL, id2 tinyint(4) NOT NULL);
+INSERT INTO t1 VALUES (1, 1),(1, 2),(1, 3),(1, 4),(1, 5),(2, 1),(2, 2),(2, 3);
+CREATE TABLE t2 (id1 tinyint(4) NOT NULL);
+INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
+SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 AND t1.id1=1 GROUP BY t1.id1;
+id1 concat_id
+1 1,2,3,4,5
+SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
+id1 concat_id
+1 1,2,3,4,5
+2 1,2,3
+SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY t1.id2 DESC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
+id1 concat_id
+1 5,4,3,2,1
+2 3,2,1
+SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY 6-t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
+id1 concat_id
+1 5,4,3,2,1
+2 3,2,1
+SELECT t1.id1, GROUP_CONCAT(t1.id2,6-t1.id2 ORDER BY 6-t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
+id1 concat_id
+1 51,42,33,24,15
+2 33,24,15
+SELECT t1.id1, GROUP_CONCAT(t1.id2,6-t1.id2 ORDER BY 6-t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
+id1 concat_id
+1 51,42,33,24,15
+2 33,24,15
+SELECT t1.id1, GROUP_CONCAT(t1.id2,"/",6-t1.id2 ORDER BY 1+0,6-t1.id2,t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
+id1 concat_id
+1 5/1,4/2,3/3,2/4,1/5
+2 3/3,2/4,1/5
+drop table t1,t2;
+create table t1 (s1 char(10), s2 int not null);
+insert into t1 values ('a',2),('b',2),('c',1),('a',3),('b',4),('c',4);
+select distinct s1 from t1 order by s2,s1;
+s1
+c
+a
+b
+select group_concat(distinct s1) from t1;
+group_concat(distinct s1)
+a,b,c
+select group_concat(distinct s1 order by s2) from t1 where s2 < 4;
+group_concat(distinct s1 order by s2)
+c,b,a
+select group_concat(distinct s1 order by s2) from t1;
+group_concat(distinct s1 order by s2)
+c,b,a,c
+drop table t1;
+create table t1 (a int, c int);
+insert into t1 values (1, 2), (2, 3), (2, 4), (3, 5);
+create table t2 (a int, c int);
+insert into t2 values (1, 5), (2, 4), (3, 3), (3,3);
+select group_concat(c) from t1;
+group_concat(c)
+2,3,4,5
+select group_concat(c order by (select c from t2 where t2.a=t1.a limit 1)) as grp from t1;
+grp
+5,4,3,2
+select group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a)) as grp from t1;
+grp
+5,4,3,2
+select group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a) desc) as grp from t1;
+grp
+2,4,3,5
+select a,c,(select group_concat(c order by a) from t2 where a=t1.a) as grp from t1 order by grp;
+a c grp
+3 5 3,3
+2 3 4
+2 4 4
+1 2 5
+drop table t1,t2;
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index 6a704f2847d..147d7776e4d 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -551,7 +551,7 @@ id select_type table type possible_keys key key_len ref rows Extra
explain
select min(a1) from t1 where a1 between a3 and 'KKK';
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL NULL NULL NULL NULL 14 Using where
+1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 14 Using where
explain
select min(a4) from t1 where (a4 + 0.01) between 0.07 and 0.08;
id select_type table type possible_keys key key_len ref rows Extra
diff --git a/mysql-test/r/func_if.result b/mysql-test/r/func_if.result
index bea16c07f86..0a04585d77d 100644
--- a/mysql-test/r/func_if.result
+++ b/mysql-test/r/func_if.result
@@ -59,6 +59,12 @@ id select_type table type possible_keys key key_len ref rows Extra
Warnings:
Note 1003 select high_priority nullif((test.t1.u = 0),_latin1'test') AS `nullif(u=0, 'test')` from test.t1
drop table t1;
+select NULLIF(NULL,NULL), NULLIF(NULL,1), NULLIF(NULL,1.0), NULLIF(NULL,"test");
+NULLIF(NULL,NULL) NULLIF(NULL,1) NULLIF(NULL,1.0) NULLIF(NULL,"test")
+NULL NULL NULL NULL
+select NULLIF(1,NULL), NULLIF(1.0, NULL), NULLIF("test", NULL);
+NULLIF(1,NULL) NULLIF(1.0, NULL) NULLIF("test", NULL)
+1 1.0 test
create table t1 (num double(12,2));
insert into t1 values (144.54);
select sum(if(num is null,0.00,num)) from t1;
diff --git a/mysql-test/r/func_like.result b/mysql-test/r/func_like.result
index 085e2f2f37e..75692738caf 100644
--- a/mysql-test/r/func_like.result
+++ b/mysql-test/r/func_like.result
@@ -37,6 +37,21 @@ select * from t1 where a like "%abc\d%";
a
abcd
drop table t1;
+create table t1 (a varchar(10), key(a));
+insert into t1 values ('a'), ('a\\b');
+select * from t1 where a like 'a\\%' escape '#';
+a
+a\b
+select * from t1 where a like 'a\\%' escape '#' and a like 'a\\\\b';
+a
+a\b
+drop table t1;
+create table t1 (a datetime);
+insert into t1 values ('2004-03-11 12:00:21');
+select * from t1 where a like '2004-03-11 12:00:21';
+a
+2004-03-11 12:00:21
+drop table t1;
SET NAMES koi8r;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET koi8r);
INSERT INTO t1 VALUES ('ÆÙ×Á'),('æÙ×Á'),('Æù×Á'),('ÆÙ÷Á'),('ÆÙ×á'),('æù÷á');
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index 151a2902423..9085849e582 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -101,6 +101,24 @@ Note 1003 select high_priority pi() AS `pi()`,sin((pi() / 2)) AS `sin(pi()/2)`,c
select degrees(pi()),radians(360);
degrees(pi()) radians(360)
180 6.2831853071796
+SELECT ACOS(1.0);
+ACOS(1.0)
+0.000000
+SELECT ASIN(1.0);
+ASIN(1.0)
+1.570796
+SELECT ACOS(0.2*5.0);
+ACOS(0.2*5.0)
+0.000000
+SELECT ACOS(0.5*2.0);
+ACOS(0.5*2.0)
+0.000000
+SELECT ASIN(0.8+0.2);
+ASIN(0.8+0.2)
+1.570796
+SELECT ASIN(1.2-0.2);
+ASIN(1.2-0.2)
+1.570796
explain extended select degrees(pi()),radians(360);
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/func_misc.result b/mysql-test/r/func_misc.result
index ec5f76409e7..5a9f0f68228 100644
--- a/mysql-test/r/func_misc.result
+++ b/mysql-test/r/func_misc.result
@@ -1,5 +1,5 @@
-select format(1.5555,0),format(123.5555,1),format(1234.5555,2),format(12345.5555,3),format(123456.5555,4),format(1234567.5555,5),format("12345.2399",2);
-format(1.5555,0) format(123.5555,1) format(1234.5555,2) format(12345.5555,3) format(123456.5555,4) format(1234567.5555,5) format("12345.2399",2)
+select format(1.5555,0),format(123.5555,1),format(1234.5555,2),format(12345.55555,3),format(123456.5555,4),format(1234567.5555,5),format("12345.2399",2);
+format(1.5555,0) format(123.5555,1) format(1234.5555,2) format(12345.55555,3) format(123456.5555,4) format(1234567.5555,5) format("12345.2399",2)
2 123.6 1,234.56 12,345.556 123,456.5555 1,234,567.55550 12,345.24
select inet_ntoa(inet_aton("255.255.255.255.255.255.255.255"));
inet_ntoa(inet_aton("255.255.255.255.255.255.255.255"))
@@ -19,6 +19,9 @@ hex(inet_aton('127.1'))
select hex(inet_aton('127.1.1'));
hex(inet_aton('127.1.1'))
7F010001
+select length(uuid()), charset(uuid()), length(unhex(replace(uuid(),_utf8'-',_utf8'')));
+length(uuid()) charset(uuid()) length(unhex(replace(uuid(),_utf8'-',_utf8'')))
+36 utf8 16
select length(format('nan', 2)) > 0;
length(format('nan', 2)) > 0
1
diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result
index 6bd4c6f46a2..3ea4e7f678d 100644
--- a/mysql-test/r/func_sapdb.result
+++ b/mysql-test/r/func_sapdb.result
@@ -159,14 +159,14 @@ time("1997-12-31 23:59:59.000001") as f9;
describe t1;
Field Type Null Key Default Extra
f1 date 0000-00-00
-f2 datetime 0000-00-00 00:00:00
-f3 time 00:00:00
+f2 datetime YES NULL
+f3 time YES NULL
f4 time 00:00:00
f5 time 00:00:00
f6 time 00:00:00
-f7 datetime 0000-00-00 00:00:00
-f8 date 0000-00-00
-f9 time 00:00:00
+f7 datetime YES NULL
+f8 date YES NULL
+f9 time YES NULL
select * from t1;
f1 f2 f3 f4 f5 f6 f7 f8 f9
1997-01-01 1998-01-02 01:01:00 49:01:01 46:58:57 -23:59:59 10:11:12 2001-12-01 01:01:01 1997-12-31 23:59:59
@@ -199,3 +199,18 @@ NULL NULL NULL NULL
NULL NULL NULL NULL
00:00:00 -24:00:00 24:00:00 NULL
drop table t1, test;
+select addtime("-01:01:01.01", "-23:59:59.1") as a;
+a
+-25:01:00.110000
+select microsecond("1997-12-31 23:59:59.01") as a;
+a
+10000
+select microsecond(19971231235959.01) as a;
+a
+10000
+select date_add("1997-12-31",INTERVAL "10.09" SECOND_MICROSECOND) as a;
+a
+1997-12-31 00:00:10.090000
+select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f");
+str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f")
+2003-01-02 10:11:12.001200
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index f08ae1b1efd..d3225679b3e 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -192,6 +192,15 @@ length(quote(concat(char(0),"test")))
select hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235))));
hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235))))
27E0E3E6E7E8EAEB27
+select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678");
+unhex(hex("foobar")) hex(unhex("1234567890ABCDEF")) unhex("345678")
+foobar 1234567890ABCDEF 4Vx
+select hex(unhex("1")), hex(unhex("12")), hex(unhex("123")), hex(unhex("1234")), hex(unhex("12345")), hex(unhex("123456"));
+hex(unhex("1")) hex(unhex("12")) hex(unhex("123")) hex(unhex("1234")) hex(unhex("12345")) hex(unhex("123456"))
+01 12 0123 1234 012345 123456
+select length(unhex(md5("abrakadabra")));
+length(unhex(md5("abrakadabra")))
+16
select reverse("");
reverse("")
@@ -268,6 +277,34 @@ INSERT INTO t1 VALUES (1, 'a545f661efdd1fb66fdee3aab79945bf');
SELECT 1 FROM t1 WHERE tmp=AES_DECRYPT(tmp,"password");
1
DROP TABLE t1;
+CREATE TABLE t1 (
+wid int(10) unsigned NOT NULL auto_increment,
+data_podp date default NULL,
+status_wnio enum('nowy','podp','real','arch') NOT NULL default 'nowy',
+PRIMARY KEY(wid),
+);
+INSERT INTO t1 VALUES (8,NULL,'real');
+INSERT INTO t1 VALUES (9,NULL,'nowy');
+SELECT elt(status_wnio,data_podp) FROM t1 GROUP BY wid;
+elt(status_wnio,data_podp)
+NULL
+NULL
+DROP TABLE t1;
+CREATE TABLE t1 (title text) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('Congress reconvenes in September to debate welfare and adult education');
+INSERT INTO t1 VALUES ('House passes the CAREERS bill');
+SELECT CONCAT("</a>",RPAD("",(55 - LENGTH(title)),".")) from t1;
+CONCAT("</a>",RPAD("",(55 - LENGTH(title)),"."))
+NULL
+</a>..........................
+DROP TABLE t1;
+CREATE TABLE t1 (i int, j int);
+INSERT INTO t1 VALUES (1,1),(2,2);
+SELECT DISTINCT i, ELT(j, '345', '34') FROM t1;
+i ELT(j, '345', '34')
+1 345
+2 34
+DROP TABLE t1;
select 1=_latin1'1';
1=_latin1'1'
1
@@ -302,6 +339,8 @@ select concat(_latin1'a',_latin2'a',_latin5'a');
ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE), (latin2_general_ci,COERCIBLE), (latin5_turkish_ci,COERCIBLE) for operation 'concat'
select concat(_latin1'a',_latin2'a',_latin5'a',_latin7'a');
ERROR HY000: Illegal mix of collations for operation 'concat'
+select concat_ws(_latin1'a',_latin2'a');
+ERROR HY000: Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and (latin2_general_ci,COERCIBLE) for operation 'concat_ws'
select FIELD('b','A','B');
FIELD('b','A','B')
2
@@ -514,7 +553,7 @@ insert(_latin2'abcd',2,3,_latin2'ef'),
replace(_latin2'abcd',_latin2'b',_latin2'B')
;
Warnings:
-Warning 1264 Data truncated for column 'format(130,10)' at row 1
+Warning 1265 Data truncated for column 'format(130,10)' at row 1
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -576,27 +615,6 @@ select * from t7
where concat(s1 collate latin1_general_ci,s1 collate latin1_swedish_ci) = 'AA';
ERROR HY000: Illegal mix of collations (latin1_general_ci,EXPLICIT) and (latin1_swedish_ci,EXPLICIT) for operation 'concat'
drop table t7;
-CREATE TABLE t1 (
-wid int(10) unsigned NOT NULL auto_increment,
-data_podp date default NULL,
-status_wnio enum('nowy','podp','real','arch') NOT NULL default 'nowy',
-PRIMARY KEY(wid),
-);
-INSERT INTO t1 VALUES (8,NULL,'real');
-INSERT INTO t1 VALUES (9,NULL,'nowy');
-SELECT elt(status_wnio,data_podp) FROM t1 GROUP BY wid;
-elt(status_wnio,data_podp)
-NULL
-NULL
-DROP TABLE t1;
-CREATE TABLE t1 (title text) ENGINE=MyISAM;
-INSERT INTO t1 VALUES ('Congress reconvenes in September to debate welfare and adult education');
-INSERT INTO t1 VALUES ('House passes the CAREERS bill');
-SELECT CONCAT("</a>",RPAD("",(55 - LENGTH(title)),".")) from t1;
-CONCAT("</a>",RPAD("",(55 - LENGTH(title)),"."))
-NULL
-</a>..........................
-DROP TABLE t1;
select substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2),substring_index("1abcd;2abcd;3abcd;4abcd", ';', -2);
substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2) substring_index("1abcd;2abcd;3abcd;4abcd", ';', -2)
1abcd;2abcd 3abcd;4abcd
@@ -608,3 +626,16 @@ Note 1003 select high_priority md5(_latin1'hello') AS `md5('hello')`,sha(_latin1
SELECT lpad(12345, 5, "#");
lpad(12345, 5, "#")
12345
+SELECT conv(71, 10, 36), conv('1Z', 36, 10);
+conv(71, 10, 36) conv('1Z', 36, 10)
+1Z 71
+create table t1 (id int(1), str varchar(10)) DEFAULT CHARSET=utf8;
+insert into t1 values (1,'aaaaaaaaaa'), (2,'bbbbbbbbbb');
+create table t2 (id int(1), str varchar(10)) DEFAULT CHARSET=utf8;
+insert into t2 values (1,'cccccccccc'), (2,'dddddddddd');
+select substring(concat(t1.str, t2.str), 1, 15) "name" from t1, t2
+where t2.id=t1.id order by name;
+name
+aaaaaaaaaaccccc
+bbbbbbbbbbddddd
+drop table t1, t2;
diff --git a/mysql-test/r/func_test.result b/mysql-test/r/func_test.result
index 7d0a76424fe..3a945c0826f 100644
--- a/mysql-test/r/func_test.result
+++ b/mysql-test/r/func_test.result
@@ -52,6 +52,9 @@ Note 1003 select high_priority (3 ^ 11) AS `3 ^ 11`,(1 ^ 1) AS `1 ^ 1`,(1 ^ 0) A
select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL;
1 XOR 1 1 XOR 0 0 XOR 1 0 XOR 0 NULL XOR 1 1 XOR NULL 0 XOR NULL
0 1 1 0 NULL NULL NULL
+select 1 like 2 xor 2 like 1;
+1 like 2 xor 2 like 1
+0
select 10 % 7, 10 mod 7, 10 div 3;
10 % 7 10 mod 7 10 div 3
3 3 3
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index 64a45837a15..b3726d58c96 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -563,17 +563,32 @@ 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
-create table t1 select last_day('2000-02-05') as a;
+create table t1 select last_day('2000-02-05') as a,
+from_days(to_days("960101")) as b;
describe t1;
Field Type Null Key Default Extra
a date 0000-00-00
+b date YES NULL
select * from t1;
-a
-2000-02-29
+a b
+2000-02-29 1996-01-01
drop table t1;
-select last_day('2000-02-05');
-last_day('2000-02-05')
-2000-02-29
+select last_day('2000-02-05') as a,
+from_days(to_days("960101")) as b;
+a b
+2000-02-29 1996-01-01
+select date_add(last_day("1997-12-1"), INTERVAL 1 DAY);
+date_add(last_day("1997-12-1"), INTERVAL 1 DAY)
+1998-01-01
+select length(last_day("1997-12-1"));
+length(last_day("1997-12-1"))
+10
+select last_day("1997-12-1")+0;
+last_day("1997-12-1")+0
+19971231
+select last_day("1997-12-1")+0.0;
+last_day("1997-12-1")+0.0
+19971231.0
select strcmp(date_sub(localtimestamp(), interval 3 hour), utc_timestamp())=0;
strcmp(date_sub(localtimestamp(), interval 3 hour), utc_timestamp())=0
1
@@ -597,6 +612,15 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select high_priority no_cache period_add(_latin1'9602',-(12)) AS `period_add("9602",-12)`,period_diff(199505,_latin1'9404') AS `period_diff(199505,"9404")`,from_days(to_days(_latin1'960101')) AS `from_days(to_days("960101"))`,dayofmonth(_latin1'1997-01-02') AS `dayofmonth("1997-01-02")`,month(_latin1'1997-01-02') AS `month("1997-01-02")`,monthname(_latin1'1972-03-04') AS `monthname("1972-03-04")`,dayofyear(_latin1'0000-00-00') AS `dayofyear("0000-00-00")`,hour(_latin1'1997-03-03 23:03:22') AS `HOUR("1997-03-03 23:03:22")`,minute(_latin1'23:03:22') AS `MINUTE("23:03:22")`,second(230322) AS `SECOND(230322)`,quarter(980303) AS `QUARTER(980303)`,week(_latin1'1998-03-03',0) AS `WEEK("1998-03-03")`,yearweek(_latin1'2000-01-01',1) AS `yearweek("2000-01-01",1)`,week(19950101,1) AS `week(19950101,1)`,year(_latin1'98-02-03') AS `year("98-02-03")`,(weekday(to_days(curdate())) - weekday(to_days(now()))) AS `weekday(curdate())-weekday(now())`,dayname(to_days(_latin1'1962-03-03')) AS `dayname("1962-03-03")`,unix_timestamp() AS `unix_timestamp()`,sec_to_time((time_to_sec(_latin1'0:30:47') / 6.21)) AS `sec_to_time(time_to_sec("0:30:47")/6.21)`,curtime() AS `curtime()`,utc_time() AS `utc_time()`,curdate() AS `curdate()`,utc_date() AS `utc_date()`,utc_timestamp() AS `utc_timestamp()`,date_format(_latin1'1997-01-02 03:04:05',_latin1'%M %W %D %Y %y %m %d %h %i %s %w') AS `date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w")`,from_unixtime(unix_timestamp(_latin1'1994-03-02 10:11:12')) AS `from_unixtime(unix_timestamp("1994-03-02 10:11:12"))`,(_latin1'1997-12-31 23:59:59' + interval 1 second) AS `"1997-12-31 23:59:59" + INTERVAL 1 SECOND`,(_latin1'1998-01-01 00:00:00' - interval 1 second) AS `"1998-01-01 00:00:00" - INTERVAL 1 SECOND`,(_latin1'1997-12-31' + interval 1 day) AS `INTERVAL 1 DAY + "1997-12-31"`,extract(year from _latin1'1999-01-02 10:11:12') AS `extract(YEAR FROM "1999-01-02 10:11:12")`,(_latin1'1997-12-31 23:59:59' + interval 1 second) AS `date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND)`
+SET @TMP=NOW();
+CREATE TABLE t1 (d DATETIME);
+INSERT INTO t1 VALUES (NOW());
+INSERT INTO t1 VALUES (NOW());
+INSERT INTO t1 VALUES (NOW());
+SELECT count(*) FROM t1 WHERE d>FROM_DAYS(TO_DAYS(@TMP)) AND d<=FROM_DAYS(TO_DAYS(@TMP)+1);
+count(*)
+3
+DROP TABLE t1;
explain extended select timestampdiff(SQL_TSI_WEEK, '2001-02-01', '2001-05-01') as a1,
timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05-01 12:58:58.119999') as a2;
id select_type table type possible_keys key key_len ref rows Extra
diff --git a/mysql-test/r/gis-rtree.result b/mysql-test/r/gis-rtree.result
index 2a47d0c048d..ab5338d383b 100644
--- a/mysql-test/r/gis-rtree.result
+++ b/mysql-test/r/gis-rtree.result
@@ -710,3 +710,43 @@ SELECT count(*) FROM t2;
count(*)
0
DROP TABLE t2;
+drop table if exists t1;
+Warnings:
+Note 1051 Unknown table 't1'
+CREATE TABLE t1 (a geometry NOT NULL, SPATIAL (a));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+analyze table t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+drop table t1;
diff --git a/mysql-test/r/gis.result b/mysql-test/r/gis.result
index 7ee16d54724..be33c05c578 100644
--- a/mysql-test/r/gis.result
+++ b/mysql-test/r/gis.result
@@ -1,115 +1,115 @@
-DROP TABLE IF EXISTS pt, ls, p, mpt, mls, mp, gc, geo;
-CREATE TABLE pt (fid INTEGER NOT NULL PRIMARY KEY, g POINT);
-CREATE TABLE ls (fid INTEGER NOT NULL PRIMARY KEY, g LINESTRING);
-CREATE TABLE p (fid INTEGER NOT NULL PRIMARY KEY, g POLYGON);
-CREATE TABLE mpt (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOINT);
-CREATE TABLE mls (fid INTEGER NOT NULL PRIMARY KEY, g MULTILINESTRING);
-CREATE TABLE mp (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOLYGON);
-CREATE TABLE gc (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRYCOLLECTION);
-CREATE TABLE geo (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRY);
-SHOW FIELDS FROM pt;
+DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+CREATE TABLE gis_point (fid INTEGER NOT NULL PRIMARY KEY, g POINT);
+CREATE TABLE gis_line (fid INTEGER NOT NULL PRIMARY KEY, g LINESTRING);
+CREATE TABLE gis_polygon (fid INTEGER NOT NULL PRIMARY KEY, g POLYGON);
+CREATE TABLE gis_multi_point (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOINT);
+CREATE TABLE gis_multi_line (fid INTEGER NOT NULL PRIMARY KEY, g MULTILINESTRING);
+CREATE TABLE gis_multi_polygon (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOLYGON);
+CREATE TABLE gis_geometrycollection (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRYCOLLECTION);
+CREATE TABLE gis_geometry (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRY);
+SHOW FIELDS FROM gis_point;
Field Type Null Key Default Extra
fid int(11) PRI 0
g point YES NULL
-SHOW FIELDS FROM ls;
+SHOW FIELDS FROM gis_line;
Field Type Null Key Default Extra
fid int(11) PRI 0
g linestring YES NULL
-SHOW FIELDS FROM p;
+SHOW FIELDS FROM gis_polygon;
Field Type Null Key Default Extra
fid int(11) PRI 0
g polygon YES NULL
-SHOW FIELDS FROM mpt;
+SHOW FIELDS FROM gis_multi_point;
Field Type Null Key Default Extra
fid int(11) PRI 0
g multipoint YES NULL
-SHOW FIELDS FROM mls;
+SHOW FIELDS FROM gis_multi_line;
Field Type Null Key Default Extra
fid int(11) PRI 0
g multilinestring YES NULL
-SHOW FIELDS FROM mp;
+SHOW FIELDS FROM gis_multi_polygon;
Field Type Null Key Default Extra
fid int(11) PRI 0
g multipolygon YES NULL
-SHOW FIELDS FROM gc;
+SHOW FIELDS FROM gis_geometrycollection;
Field Type Null Key Default Extra
fid int(11) PRI 0
g geometrycollection YES NULL
-SHOW FIELDS FROM geo;
+SHOW FIELDS FROM gis_geometry;
Field Type Null Key Default Extra
fid int(11) PRI 0
g geometry YES NULL
-INSERT INTO pt VALUES
+INSERT INTO gis_point VALUES
(101, PointFromText('POINT(10 10)')),
(102, PointFromText('POINT(20 10)')),
(103, PointFromText('POINT(20 20)')),
(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))));
-INSERT INTO ls VALUES
+INSERT INTO gis_line VALUES
(105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));
-INSERT INTO p VALUES
+INSERT INTO gis_polygon VALUES
(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));
-INSERT INTO mpt VALUES
+INSERT INTO gis_multi_point VALUES
(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));
-INSERT INTO mls VALUES
+INSERT INTO gis_multi_line VALUES
(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));
-INSERT INTO mp VALUES
+INSERT INTO gis_multi_polygon VALUES
(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));
-INSERT INTO gc VALUES
+INSERT INTO gis_geometrycollection VALUES
(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))));
-INSERT into geo SELECT * FROM pt;
-INSERT into geo SELECT * FROM ls;
-INSERT into geo SELECT * FROM p;
-INSERT into geo SELECT * FROM mpt;
-INSERT into geo SELECT * FROM mls;
-INSERT into geo SELECT * FROM mp;
-INSERT into geo SELECT * FROM gc;
-SELECT fid, AsText(g) FROM pt;
+INSERT into gis_geometry SELECT * FROM gis_point;
+INSERT into gis_geometry SELECT * FROM gis_line;
+INSERT into gis_geometry SELECT * FROM gis_polygon;
+INSERT into gis_geometry SELECT * FROM gis_multi_point;
+INSERT into gis_geometry SELECT * FROM gis_multi_line;
+INSERT into gis_geometry SELECT * FROM gis_multi_polygon;
+INSERT into gis_geometry SELECT * FROM gis_geometrycollection;
+SELECT fid, AsText(g) FROM gis_point;
fid AsText(g)
101 POINT(10 10)
102 POINT(20 10)
103 POINT(20 20)
104 POINT(10 20)
-SELECT fid, AsText(g) FROM ls;
+SELECT fid, AsText(g) FROM gis_line;
fid AsText(g)
105 LINESTRING(0 0,0 10,10 0)
106 LINESTRING(10 10,20 10,20 20,10 20,10 10)
107 LINESTRING(10 10,40 10)
-SELECT fid, AsText(g) FROM p;
+SELECT fid, AsText(g) FROM gis_polygon;
fid AsText(g)
108 POLYGON((10 10,20 10,20 20,10 20,10 10))
109 POLYGON((0 0,50 0,50 50,0 50,0 0),(10 10,20 10,20 20,10 20,10 10))
110 POLYGON((0 0,30 0,30 30,0 0))
-SELECT fid, AsText(g) FROM mpt;
+SELECT fid, AsText(g) FROM gis_multi_point;
fid AsText(g)
111 MULTIPOINT(0 0,10 10,10 20,20 20)
112 MULTIPOINT(1 1,11 11,11 21,21 21)
113 MULTIPOINT(3 6,4 10)
-SELECT fid, AsText(g) FROM mls;
+SELECT fid, AsText(g) FROM gis_multi_line;
fid AsText(g)
114 MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))
115 MULTILINESTRING((10 48,10 21,10 0))
116 MULTILINESTRING((1 2,3 5),(2 5,5 8,21 7))
-SELECT fid, AsText(g) FROM mp;
+SELECT fid, AsText(g) FROM gis_multi_polygon;
fid AsText(g)
117 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
118 MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))
119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
-SELECT fid, AsText(g) FROM gc;
+SELECT fid, AsText(g) FROM gis_geometrycollection;
fid AsText(g)
120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
-SELECT fid, AsText(g) FROM geo;
+SELECT fid, AsText(g) FROM gis_geometry;
fid AsText(g)
101 POINT(10 10)
102 POINT(20 10)
@@ -132,7 +132,7 @@ fid AsText(g)
119 MULTIPOLYGON(((0 3,3 3,3 0,0 3)))
120 GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10))
121 GEOMETRYCOLLECTION(POINT(44 6),LINESTRING(3 6,7 9))
-SELECT fid, Dimension(g) FROM geo;
+SELECT fid, Dimension(g) FROM gis_geometry;
fid Dimension(g)
101 0
102 0
@@ -155,7 +155,7 @@ fid Dimension(g)
119 2
120 1
121 1
-SELECT fid, GeometryType(g) FROM geo;
+SELECT fid, GeometryType(g) FROM gis_geometry;
fid GeometryType(g)
101 POINT
102 POINT
@@ -178,7 +178,7 @@ fid GeometryType(g)
119 MULTIPOLYGON
120 GEOMETRYCOLLECTION
121 GEOMETRYCOLLECTION
-SELECT fid, IsEmpty(g) FROM geo;
+SELECT fid, IsEmpty(g) FROM gis_geometry;
fid IsEmpty(g)
101 0
102 0
@@ -201,7 +201,7 @@ fid IsEmpty(g)
119 0
120 0
121 0
-SELECT fid, AsText(Envelope(g)) FROM geo;
+SELECT fid, AsText(Envelope(g)) FROM gis_geometry;
fid AsText(Envelope(g))
101 POLYGON((10 10,10 10,10 10,10 10,10 10))
102 POLYGON((20 10,20 10,20 10,20 10,20 10))
@@ -224,161 +224,165 @@ fid AsText(Envelope(g))
119 POLYGON((0 0,3 0,3 3,0 3,0 0))
120 POLYGON((0 0,10 0,10 10,0 10,0 0))
121 POLYGON((3 6,44 6,44 9,3 9,3 6))
-explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from geo;
+explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE geo ALL NULL NULL NULL NULL 21
+1 SIMPLE gis_geometry ALL NULL NULL NULL NULL 21
Warnings:
-Note 1003 select high_priority dimension(test.geo.g) AS `Dimension(g)`,geometrytype(test.geo.g) AS `GeometryType(g)`,isempty(test.geo.g) AS `IsEmpty(g)`,astext(envelope(test.geo.g)) AS `AsText(Envelope(g))` from test.geo
-SELECT fid, X(g) FROM pt;
+Note 1003 select high_priority dimension(test.gis_geometry.g) AS `Dimension(g)`,geometrytype(test.gis_geometry.g) AS `GeometryType(g)`,isempty(test.gis_geometry.g) AS `IsEmpty(g)`,astext(envelope(test.gis_geometry.g)) AS `AsText(Envelope(g))` from test.gis_geometry
+SELECT fid, X(g) FROM gis_point;
fid X(g)
101 10
102 20
103 20
104 10
-SELECT fid, Y(g) FROM pt;
+SELECT fid, Y(g) FROM gis_point;
fid Y(g)
101 10
102 10
103 20
104 20
-explain extended select X(g),Y(g) FROM pt;
+explain extended select X(g),Y(g) FROM gis_point;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE pt ALL NULL NULL NULL NULL 4
+1 SIMPLE gis_point ALL NULL NULL NULL NULL 4
Warnings:
-Note 1003 select high_priority x(test.pt.g) AS `X(g)`,y(test.pt.g) AS `Y(g)` from test.pt
-SELECT fid, AsText(StartPoint(g)) FROM ls;
+Note 1003 select high_priority x(test.gis_point.g) AS `X(g)`,y(test.gis_point.g) AS `Y(g)` from test.gis_point
+SELECT fid, AsText(StartPoint(g)) FROM gis_line;
fid AsText(StartPoint(g))
105 POINT(0 0)
106 POINT(10 10)
107 POINT(10 10)
-SELECT fid, AsText(EndPoint(g)) FROM ls;
+SELECT fid, AsText(EndPoint(g)) FROM gis_line;
fid AsText(EndPoint(g))
105 POINT(10 0)
106 POINT(10 10)
107 POINT(40 10)
-SELECT fid, GLength(g) FROM ls;
+SELECT fid, GLength(g) FROM gis_line;
fid GLength(g)
105 24.142135623731
106 40
107 30
-SELECT fid, NumPoints(g) FROM ls;
+SELECT fid, NumPoints(g) FROM gis_line;
fid NumPoints(g)
105 3
106 5
107 2
-SELECT fid, AsText(PointN(g, 2)) FROM ls;
+SELECT fid, AsText(PointN(g, 2)) FROM gis_line;
fid AsText(PointN(g, 2))
105 POINT(0 10)
106 POINT(20 10)
107 POINT(40 10)
-SELECT fid, IsClosed(g) FROM ls;
+SELECT fid, IsClosed(g) FROM gis_line;
fid IsClosed(g)
105 0
106 1
107 0
-explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM ls;
+explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM gis_line;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE ls ALL NULL NULL NULL NULL 3
+1 SIMPLE gis_line ALL NULL NULL NULL NULL 3
Warnings:
-Note 1003 select high_priority astext(startpoint(test.ls.g)) AS `AsText(StartPoint(g))`,astext(endpoint(test.ls.g)) AS `AsText(EndPoint(g))`,glength(test.ls.g) AS `GLength(g)`,numpoints(test.ls.g) AS `NumPoints(g)`,astext(pointn(test.ls.g,2)) AS `AsText(PointN(g, 2))`,isclosed(test.ls.g) AS `IsClosed(g)` from test.ls
-SELECT fid, AsText(Centroid(g)) FROM p;
+Note 1003 select high_priority astext(startpoint(test.gis_line.g)) AS `AsText(StartPoint(g))`,astext(endpoint(test.gis_line.g)) AS `AsText(EndPoint(g))`,glength(test.gis_line.g) AS `GLength(g)`,numpoints(test.gis_line.g) AS `NumPoints(g)`,astext(pointn(test.gis_line.g,2)) AS `AsText(PointN(g, 2))`,isclosed(test.gis_line.g) AS `IsClosed(g)` from test.gis_line
+SELECT fid, AsText(Centroid(g)) FROM gis_polygon;
fid AsText(Centroid(g))
108 POINT(15 15)
109 POINT(25.416666666667 25.416666666667)
110 POINT(20 10)
-SELECT fid, Area(g) FROM p;
+SELECT fid, Area(g) FROM gis_polygon;
fid Area(g)
108 100
109 2400
110 450
-SELECT fid, AsText(ExteriorRing(g)) FROM p;
+SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon;
fid AsText(ExteriorRing(g))
108 LINESTRING(10 10,20 10,20 20,10 20,10 10)
109 LINESTRING(0 0,50 0,50 50,0 50,0 0)
110 LINESTRING(0 0,30 0,30 30,0 0)
-SELECT fid, NumInteriorRings(g) FROM p;
+SELECT fid, NumInteriorRings(g) FROM gis_polygon;
fid NumInteriorRings(g)
108 0
109 1
110 0
-SELECT fid, AsText(InteriorRingN(g, 1)) FROM p;
+SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon;
fid AsText(InteriorRingN(g, 1))
108 NULL
109 LINESTRING(10 10,20 10,20 20,10 20,10 10)
110 NULL
-explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM p;
+explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM gis_polygon;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE p ALL NULL NULL NULL NULL 3
+1 SIMPLE gis_polygon ALL NULL NULL NULL NULL 3
Warnings:
-Note 1003 select high_priority astext(centroid(test.p.g)) AS `AsText(Centroid(g))`,area(test.p.g) AS `Area(g)`,astext(exteriorring(test.p.g)) AS `AsText(ExteriorRing(g))`,numinteriorrings(test.p.g) AS `NumInteriorRings(g)`,astext(interiorringn(test.p.g,1)) AS `AsText(InteriorRingN(g, 1))` from test.p
-SELECT fid, IsClosed(g) FROM mls;
+Note 1003 select high_priority astext(centroid(test.gis_polygon.g)) AS `AsText(Centroid(g))`,area(test.gis_polygon.g) AS `Area(g)`,astext(exteriorring(test.gis_polygon.g)) AS `AsText(ExteriorRing(g))`,numinteriorrings(test.gis_polygon.g) AS `NumInteriorRings(g)`,astext(interiorringn(test.gis_polygon.g,1)) AS `AsText(InteriorRingN(g, 1))` from test.gis_polygon
+SELECT fid, IsClosed(g) FROM gis_multi_line;
fid IsClosed(g)
114 0
115 0
116 0
-SELECT fid, AsText(Centroid(g)) FROM mp;
+SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon;
fid AsText(Centroid(g))
117 POINT(55.588527753042 17.426536064114)
118 POINT(55.588527753042 17.426536064114)
119 POINT(2 2)
-SELECT fid, Area(g) FROM mp;
+SELECT fid, Area(g) FROM gis_multi_polygon;
fid Area(g)
117 1684.5
118 1684.5
119 4.5
-SELECT fid, NumGeometries(g) from mpt;
+SELECT fid, NumGeometries(g) from gis_multi_point;
fid NumGeometries(g)
111 4
112 4
113 2
-SELECT fid, NumGeometries(g) from mls;
+SELECT fid, NumGeometries(g) from gis_multi_line;
fid NumGeometries(g)
114 2
115 1
116 2
-SELECT fid, NumGeometries(g) from mp;
+SELECT fid, NumGeometries(g) from gis_multi_polygon;
fid NumGeometries(g)
117 2
118 2
119 1
-SELECT fid, NumGeometries(g) from gc;
+SELECT fid, NumGeometries(g) from gis_geometrycollection;
fid NumGeometries(g)
120 2
121 2
-explain extended SELECT fid, NumGeometries(g) from mpt;
+explain extended SELECT fid, NumGeometries(g) from gis_multi_point;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE mpt ALL NULL NULL NULL NULL 3
+1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3
Warnings:
-Note 1003 select high_priority test.mpt.fid AS `fid`,numgeometries(test.mpt.g) AS `NumGeometries(g)` from test.mpt
-SELECT fid, AsText(GeometryN(g, 2)) from mpt;
+Note 1003 select high_priority test.gis_multi_point.fid AS `fid`,numgeometries(test.gis_multi_point.g) AS `NumGeometries(g)` from test.gis_multi_point
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
fid AsText(GeometryN(g, 2))
111 POINT(10 10)
112 POINT(11 11)
113 POINT(4 10)
-SELECT fid, AsText(GeometryN(g, 2)) from mls;
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line;
fid AsText(GeometryN(g, 2))
114 LINESTRING(16 0,16 23,16 48)
115 NULL
116 LINESTRING(2 5,5 8,21 7)
-SELECT fid, AsText(GeometryN(g, 2)) from mp;
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon;
fid AsText(GeometryN(g, 2))
117 POLYGON((59 18,67 18,67 13,59 13,59 18))
118 POLYGON((59 18,67 18,67 13,59 13,59 18))
119 NULL
-SELECT fid, AsText(GeometryN(g, 2)) from gc;
+SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection;
fid AsText(GeometryN(g, 2))
120 LINESTRING(0 0,10 10)
121 LINESTRING(3 6,7 9)
-explain extended SELECT fid, AsText(GeometryN(g, 2)) from mpt;
+SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection;
+fid AsText(GeometryN(g, 1))
+120 POINT(0 0)
+121 POINT(44 6)
+explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE mpt ALL NULL NULL NULL NULL 3
+1 SIMPLE gis_multi_point ALL NULL NULL NULL NULL 3
Warnings:
-Note 1003 select high_priority test.mpt.fid AS `fid`,astext(geometryn(test.mpt.g,2)) AS `AsText(GeometryN(g, 2))` from test.mpt
+Note 1003 select high_priority test.gis_multi_point.fid AS `fid`,astext(geometryn(test.gis_multi_point.g,2)) AS `AsText(GeometryN(g, 2))` from test.gis_multi_point
SELECT g1.fid as first, g2.fid as second,
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
-FROM gc g1, gc g2 ORDER BY first, second;
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
first second w c o e d t i r
120 120 1 1 0 1 0 0 1 0
120 121 0 0 0 0 0 0 1 0
@@ -388,46 +392,46 @@ explain extended SELECT g1.fid as first, g2.fid as second,
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
-FROM gc g1, gc g2 ORDER BY first, second;
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE g1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
1 SIMPLE g2 ALL NULL NULL NULL NULL 2
Warnings:
-Note 1003 select high_priority test.g1.fid AS `first`,test.g2.fid AS `second`,within(test.g1.g,test.g2.g) AS `w`,contains(test.g1.g,test.g2.g) AS `c`,overlaps(test.g1.g,test.g2.g) AS `o`,equals(test.g1.g,test.g2.g) AS `e`,disjoint(test.g1.g,test.g2.g) AS `d`,touches(test.g1.g,test.g2.g) AS `t`,intersects(test.g1.g,test.g2.g) AS `i`,crosses(test.g1.g,test.g2.g) AS `r` from test.gc g1 join test.gc g2 order by test.g1.fid,test.g2.fid
-DROP TABLE pt, ls, p, mpt, mls, mp, gc, geo;
-CREATE TABLE g1 (
-pt point,
+Note 1003 select high_priority test.g1.fid AS `first`,test.g2.fid AS `second`,within(test.g1.g,test.g2.g) AS `w`,contains(test.g1.g,test.g2.g) AS `c`,overlaps(test.g1.g,test.g2.g) AS `o`,equals(test.g1.g,test.g2.g) AS `e`,disjoint(test.g1.g,test.g2.g) AS `d`,touches(test.g1.g,test.g2.g) AS `t`,intersects(test.g1.g,test.g2.g) AS `i`,crosses(test.g1.g,test.g2.g) AS `r` from test.gis_geometrycollection g1 join test.gis_geometrycollection g2 order by test.g1.fid,test.g2.fid
+DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
+CREATE TABLE t1 (
+gp point,
ln linestring,
pg polygon,
-mpt multipoint,
+mp multipoint,
mln multilinestring,
mpg multipolygon,
gc geometrycollection,
gm geometry
);
-SHOW FIELDS FROM g1;
+SHOW FIELDS FROM t1;
Field Type Null Key Default Extra
-pt point YES NULL
+gp point YES NULL
ln linestring YES NULL
pg polygon YES NULL
-mpt multipoint YES NULL
+mp multipoint YES NULL
mln multilinestring YES NULL
mpg multipolygon YES NULL
gc geometrycollection YES NULL
gm geometry YES NULL
-ALTER TABLE g1 ADD fid INT NOT NULL;
-SHOW FIELDS FROM g1;
+ALTER TABLE t1 ADD fid INT NOT NULL;
+SHOW FIELDS FROM t1;
Field Type Null Key Default Extra
-pt point YES NULL
+gp point YES NULL
ln linestring YES NULL
pg polygon YES NULL
-mpt multipoint YES NULL
+mp multipoint YES NULL
mln multilinestring YES NULL
mpg multipolygon YES NULL
gc geometrycollection YES NULL
gm geometry YES NULL
fid int(11) 0
-DROP TABLE g1;
+DROP TABLE t1;
SELECT AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))));
AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))))
POINT(1 4)
@@ -454,3 +458,11 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select high_priority issimple(multipoint(point(3,6),point(4,10))) AS `issimple(MultiPoint(Point(3, 6), Point(4, 10)))`,issimple(point(3,6)) AS `issimple(Point(3, 6))`
+create table t1 (a geometry not null);
+insert into t1 values (GeomFromText('Point(1 2)'));
+insert into t1 values ('Garbage');
+ERROR HY000: Unknown error
+insert IGNORE into t1 values ('Garbage');
+ERROR HY000: Unknown error
+alter table t1 add spatial index(a);
+drop table t1;
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index 89426edb000..2c17373bd00 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -136,7 +136,7 @@ grant ALL PRIVILEGES on *.* to drop_user2@localhost with GRANT OPTION;
show grants for drop_user2@localhost;
Grants for drop_user2@localhost
GRANT ALL PRIVILEGES ON *.* TO 'drop_user2'@'localhost' WITH GRANT OPTION
-revoke all privileges, grant from drop_user2@localhost;
+revoke all privileges, grant option from drop_user2@localhost;
drop user drop_user2@localhost;
grant ALL PRIVILEGES on *.* to drop_user@localhost with GRANT OPTION;
grant ALL PRIVILEGES on test.* to drop_user@localhost with GRANT OPTION;
@@ -146,12 +146,43 @@ Grants for drop_user@localhost
GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION
GRANT ALL PRIVILEGES ON `test`.* TO 'drop_user'@'localhost' WITH GRANT OPTION
GRANT SELECT (a) ON `test`.`t1` TO 'drop_user'@'localhost'
-revoke all privileges, grant from drop_user@localhost;
+set sql_mode=ansi_quotes;
+show grants for drop_user@localhost;
+Grants for drop_user@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON "test".* TO 'drop_user'@'localhost' WITH GRANT OPTION
+GRANT SELECT (a) ON "test"."t1" TO 'drop_user'@'localhost'
+set sql_mode=default;
+set sql_quote_show_create=0;
+show grants for drop_user@localhost;
+Grants for drop_user@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON test.* TO 'drop_user'@'localhost' WITH GRANT OPTION
+GRANT SELECT (a) ON test.t1 TO 'drop_user'@'localhost'
+set sql_mode="ansi_quotes";
+show grants for drop_user@localhost;
+Grants for drop_user@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON test.* TO 'drop_user'@'localhost' WITH GRANT OPTION
+GRANT SELECT (a) ON test.t1 TO 'drop_user'@'localhost'
+set sql_quote_show_create=1;
+show grants for drop_user@localhost;
+Grants for drop_user@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON "test".* TO 'drop_user'@'localhost' WITH GRANT OPTION
+GRANT SELECT (a) ON "test"."t1" TO 'drop_user'@'localhost'
+set sql_mode="";
+show grants for drop_user@localhost;
+Grants for drop_user@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'drop_user'@'localhost' WITH GRANT OPTION
+GRANT ALL PRIVILEGES ON `test`.* TO 'drop_user'@'localhost' WITH GRANT OPTION
+GRANT SELECT (a) ON `test`.`t1` TO 'drop_user'@'localhost'
+revoke all privileges, grant option from drop_user@localhost;
show grants for drop_user@localhost;
Grants for drop_user@localhost
GRANT USAGE ON *.* TO 'drop_user'@'localhost'
drop user drop_user@localhost;
-revoke all privileges, grant from drop_user@localhost;
+revoke all privileges, grant option from drop_user@localhost;
ERROR HY000: Can't revoke all privileges, grant for one or more of the requested users
grant select(a) on test.t1 to drop_user1@localhost;
grant select on test.t1 to drop_user2@localhost;
@@ -160,8 +191,14 @@ grant select on *.* to drop_user4@localhost;
drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost,
drop_user4@localhost;
ERROR HY000: Can't drop one or more of the requested users
-revoke all privileges, grant from drop_user1@localhost, drop_user2@localhost,
+revoke all privileges, grant option from drop_user1@localhost, drop_user2@localhost,
drop_user3@localhost, drop_user4@localhost;
drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost,
drop_user4@localhost;
drop table t1;
+grant usage on *.* to mysqltest_1@localhost identified by "password";
+grant select, update, insert on test.* to mysqltest@localhost;
+show grants for mysqltest_1@localhost;
+Grants for mysqltest_1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' IDENTIFIED BY PASSWORD '*2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19'
+drop user mysqltest_1@localhost;
diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result
index 0b127188586..d0765e2721f 100644
--- a/mysql-test/r/grant2.result
+++ b/mysql-test/r/grant2.result
@@ -5,6 +5,9 @@ grant all privileges on `my\_%`.* to mysqltest_1@localhost with grant option;
select current_user();
current_user()
mysqltest_1@localhost
+select current_user;
+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_%'
diff --git a/mysql-test/r/grant_cache.result b/mysql-test/r/grant_cache.result
index f49db67a9f7..48068c0f68d 100644
--- a/mysql-test/r/grant_cache.result
+++ b/mysql-test/r/grant_cache.result
@@ -2,6 +2,12 @@ drop table if exists test.t1,mysqltest.t1,mysqltest.t2;
drop database if exists mysqltest;
reset query cache;
flush status;
+show grants for current_user;
+Grants for root@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+show grants;
+Grants for root@localhost
+GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
create database if not exists mysqltest;
create table mysqltest.t1 (a int,b int,c int);
create table mysqltest.t2 (a int,b int,c int);
@@ -41,17 +47,57 @@ grant SELECT on mysqltest.* to mysqltest_1@localhost;
grant SELECT on mysqltest.t1 to mysqltest_2@localhost;
grant SELECT on test.t1 to mysqltest_2@localhost;
grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost;
+show grants for current_user();
+Grants for mysqltest_1@localhost
+GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
+GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 6
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 0
+show status like "Qcache_not_cached";
+Variable_name Value
+Qcache_not_cached 0
select "user1";
user1
user1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 6
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 0
+show status like "Qcache_not_cached";
+Variable_name Value
+Qcache_not_cached 1
select * from t1;
a b c
1 1 1
2 2 2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 6
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 1
+show status like "Qcache_not_cached";
+Variable_name Value
+Qcache_not_cached 1
select a from t1 ;
a
1
2
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 6
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 2
+show status like "Qcache_not_cached";
+Variable_name Value
+Qcache_not_cached 1
select c from t1;
c
1
@@ -65,6 +111,9 @@ Qcache_hits 3
show status like "Qcache_not_cached";
Variable_name Value
Qcache_not_cached 1
+show grants for current_user();
+Grants for @localhost
+GRANT USAGE ON *.* TO ''@'localhost'
select "user2";
user2
user2
@@ -94,7 +143,7 @@ Variable_name Value
Qcache_hits 7
show status like "Qcache_not_cached";
Variable_name Value
-Qcache_not_cached 3
+Qcache_not_cached 2
select "user3";
user3
user3
@@ -118,10 +167,14 @@ Variable_name Value
Qcache_hits 7
show status like "Qcache_not_cached";
Variable_name Value
-Qcache_not_cached 8
+Qcache_not_cached 7
select "user4";
user4
user4
+show grants;
+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
select * from mysqltest.t1,test.t1;
@@ -144,7 +197,7 @@ Variable_name Value
Qcache_hits 8
show status like "Qcache_not_cached";
Variable_name Value
-Qcache_not_cached 9
+Qcache_not_cached 8
delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
delete from mysql.tables_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
diff --git a/mysql-test/r/handler.result b/mysql-test/r/handler.result
index d0ea16c5699..b25150919d6 100644
--- a/mysql-test/r/handler.result
+++ b/mysql-test/r/handler.result
@@ -175,3 +175,21 @@ ERROR 42S22: Unknown column 'W' in 'field list'
handler t1 read a=(a);
ERROR HY000: Wrong arguments to HANDLER ... READ
drop table t1;
+create table t1 (a char(5));
+insert into t1 values ("Ok");
+handler t1 open as t;
+handler t read first;
+a
+Ok
+use mysql;
+handler t read first;
+a
+Ok
+handler t close;
+handler test.t1 open as t;
+handler t read first;
+a
+Ok
+handler t close;
+use test;
+drop table t1;
diff --git a/mysql-test/r/have_sjis.require b/mysql-test/r/have_sjis.require
new file mode 100644
index 00000000000..72ce8ec88fe
--- /dev/null
+++ b/mysql-test/r/have_sjis.require
@@ -0,0 +1,2 @@
+Collation Charset Id Default Compiled Sortlen
+sjis_japanese_ci sjis 13 Yes Yes 1
diff --git a/mysql-test/r/heap_btree.result b/mysql-test/r/heap_btree.result
index ef63b1d4e00..5c60c97d674 100644
--- a/mysql-test/r/heap_btree.result
+++ b/mysql-test/r/heap_btree.result
@@ -173,9 +173,22 @@ f1 f2
drop table t1;
create table t1 (btn char(10) not null, key using BTREE (btn)) engine=heap;
insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i");
-explain select * from t1 where btn like "q%";
+explain select * from t1 where btn like "i%";
id select_type table type possible_keys key key_len ref rows Extra
-1 SIMPLE t1 ALL btn NULL NULL NULL 14 Using where
+1 SIMPLE t1 range btn btn 10 NULL 1 Using where
+explain select * from t1 where btn like "h%";
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range btn btn 10 NULL # Using where
+explain select * from t1 where btn like "a%";
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range btn btn 10 NULL 1 Using where
+explain select * from t1 where btn like "b%";
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 range btn btn 10 NULL 1 Using where
+select * from t1 where btn like "ff%";
+btn
+select * from t1 where btn like " %";
+btn
select * from t1 where btn like "q%";
btn
alter table t1 add column new_col char(1) not null, add key using BTREE (btn,new_col), drop key btn;
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index eb0b9af8e38..5e513061821 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -1084,11 +1084,7 @@ select * from t1;
id
select * from t2;
id t1_id
-drop table t1,t2;
-DROP TABLE IF EXISTS t1,t2;
-Warnings:
-Note 1051 Unknown table 't1'
-Note 1051 Unknown table 't2'
+drop table t2,t1;
CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) ENGINE=INNODB;
INSERT INTO t1 VALUES(1);
@@ -1333,13 +1329,29 @@ a
3
4
drop table t1;
+CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) ENGINE=INNODB;
+CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) ENGINE=INNODB;
+drop table t2,t1;
+create table `t1` (`id` int( 11 ) not null ,primary key ( `id` )) engine = innodb;
+insert into `t1`values ( 1 ) ;
+create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) engine = innodb;
+insert into `t2`values ( 1 ) ;
+create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) engine = innodb;
+insert into `t3`values ( 1 ) ;
+delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
+update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
+update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+ERROR 42S02: Unknown table 't1' in where clause
+drop table t3,t2,t1;
CREATE TABLE t1 (col1 int(1))ENGINE=InnoDB;
CREATE TABLE t2 (col1 int(1),stamp TIMESTAMP,INDEX stamp_idx
(stamp))ENGINE=InnoDB;
insert into t1 values (1),(2),(3);
insert into t2 values (1, 20020204130000),(2, 20020204130000),(4,20020204310000 ),(5,20020204230000);
Warnings:
-Warning 1264 Data truncated for column 'stamp' at row 3
+Warning 1265 Data truncated for column 'stamp' at row 3
SELECT col1 FROM t1 UNION SELECT col1 FROM t2 WHERE stamp <
'20020204120000' GROUP BY col1;
col1
@@ -1414,3 +1426,20 @@ test.t2 968604391
test.t3 968604391
test.t4 NULL
drop table t1,t2,t3;
+create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=innodb;
+insert into t1 values(1,'first','fff'),(2,'second','sss'),(3,'third','ttt');
+select name2 from t1 union all select name from t1 union all select id from t1;
+name2
+fff
+sss
+ttt
+first
+second
+third
+1
+2
+3
+drop table t1;
+create table t1 (a int) engine=innodb;
+create table t2 like t1;
+drop table t1,t2;
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index d9e57b48d39..44950d0927c 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 1262 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
@@ -87,6 +87,243 @@ create table t1 (c int);
insert into mysqltest.t1 set mysqltest.t1.c = '1';
drop database mysqltest;
use test;
+create table t1(number int auto_increment primary key, original_value varchar(50), f_double double, f_float float, f_double_7_2 double(7,2), f_float_4_3 float (4,3), f_double_u double unsigned, f_float_u float unsigned, f_double_15_1_u double(15,1) unsigned, f_float_3_1_u float (3,1) unsigned);
+set @value= "aa";
+insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
+Warnings:
+Warning 1265 Data truncated for column 'f_double' at row 1
+Warning 1265 Data truncated for column 'f_float' at row 1
+Warning 1265 Data truncated for column 'f_double_7_2' at row 1
+Warning 1265 Data truncated 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 1265 Data truncated for column 'f_double_15_1_u' at row 1
+Warning 1265 Data truncated for column 'f_float_3_1_u' at row 1
+select * from t1 where number =last_insert_id();
+number 1
+original_value aa
+f_double 0
+f_float 0
+f_double_7_2 0.00
+f_float_4_3 0.000
+f_double_u 0
+f_float_u 0
+f_double_15_1_u 0.0
+f_float_3_1_u 0.0
+set @value= "1aa";
+insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
+Warnings:
+Warning 1265 Data truncated for column 'f_double' at row 1
+Warning 1265 Data truncated for column 'f_float' at row 1
+Warning 1265 Data truncated for column 'f_double_7_2' at row 1
+Warning 1265 Data truncated 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 1265 Data truncated for column 'f_double_15_1_u' at row 1
+Warning 1265 Data truncated for column 'f_float_3_1_u' at row 1
+select * from t1 where number =last_insert_id();
+number 2
+original_value 1aa
+f_double 1
+f_float 1
+f_double_7_2 1.00
+f_float_4_3 1.000
+f_double_u 1
+f_float_u 1
+f_double_15_1_u 1.0
+f_float_3_1_u 1.0
+set @value= "aa1";
+insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
+Warnings:
+Warning 1265 Data truncated for column 'f_double' at row 1
+Warning 1265 Data truncated for column 'f_float' at row 1
+Warning 1265 Data truncated for column 'f_double_7_2' at row 1
+Warning 1265 Data truncated 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 1265 Data truncated for column 'f_double_15_1_u' at row 1
+Warning 1265 Data truncated for column 'f_float_3_1_u' at row 1
+select * from t1 where number =last_insert_id();
+number 3
+original_value aa1
+f_double 0
+f_float 0
+f_double_7_2 0.00
+f_float_4_3 0.000
+f_double_u 0
+f_float_u 0
+f_double_15_1_u 0.0
+f_float_3_1_u 0.0
+set @value= "1e+1111111111a";
+insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
+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 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 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 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 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 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
+select * from t1 where number =last_insert_id();
+number 4
+original_value 1e+1111111111a
+f_double 1.79769313486232e+308
+f_float 3.40282e+38
+f_double_7_2 99999.99
+f_float_4_3 9.999
+f_double_u 1.79769313486232e+308
+f_float_u 3.40282e+38
+f_double_15_1_u 99999999999999.9
+f_float_3_1_u 99.9
+set @value= "-1e+1111111111a";
+insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
+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 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 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 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 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 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 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
+select * from t1 where number =last_insert_id();
+number 5
+original_value -1e+1111111111a
+f_double -1.79769313486232e+308
+f_float -3.40282e+38
+f_double_7_2 -99999.99
+f_float_4_3 -9.999
+f_double_u 0
+f_float_u 0
+f_double_15_1_u 0.0
+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
+select * from t1 where number =last_insert_id();
+number 6
+original_value 1.7976931348623e+308
+f_double 1.79769313486232e+308
+f_float 3.40282e+38
+f_double_7_2 99999.99
+f_float_4_3 9.999
+f_double_u 1.79769313486232e+308
+f_float_u 3.40282e+38
+f_double_15_1_u 99999999999999.9
+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
+select * from t1 where number =last_insert_id();
+number 7
+original_value -1.7976931348623e+308
+f_double -1.79769313486232e+308
+f_float -3.40282e+38
+f_double_7_2 -99999.99
+f_float_4_3 -9.999
+f_double_u 0
+f_float_u 0
+f_double_15_1_u 0.0
+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
+select * from t1 where number =last_insert_id();
+number 8
+original_value 1e+111
+f_double 1e+111
+f_float 3.40282e+38
+f_double_7_2 99999.99
+f_float_4_3 9.999
+f_double_u 1e+111
+f_float_u 3.40282e+38
+f_double_15_1_u 99999999999999.9
+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
+select * from t1 where number =last_insert_id();
+number 9
+original_value -1e+111
+f_double -1e+111
+f_float -3.40282e+38
+f_double_7_2 -99999.99
+f_float_4_3 -9.999
+f_double_u 0
+f_float_u 0
+f_double_15_1_u 0.0
+f_float_3_1_u 0.0
+set @value= 1;
+insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
+select * from t1 where number =last_insert_id();
+number 10
+original_value 1
+f_double 1
+f_float 1
+f_double_7_2 1.00
+f_float_4_3 1.000
+f_double_u 1
+f_float_u 1
+f_double_15_1_u 1.0
+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
+select * from t1 where number =last_insert_id();
+number 11
+original_value -1
+f_double -1
+f_float -1
+f_double_7_2 -1.00
+f_float_4_3 -1.000
+f_double_u 0
+f_float_u 0
+f_double_15_1_u 0.0
+f_float_3_1_u 0.0
drop table if exists t1,t2,t3;
create table t1(id1 int not null auto_increment primary key, t char(12));
create table t2(id2 int not null, t char(12));
diff --git a/mysql-test/r/insert_select.result b/mysql-test/r/insert_select.result
index 378716ecc39..eb8c389e38f 100644
--- a/mysql-test/r/insert_select.result
+++ b/mysql-test/r/insert_select.result
@@ -595,3 +595,37 @@ CREATE TABLE t2 ( USID INTEGER UNSIGNED AUTO_INCREMENT, ServerID TINYINT UNSIGNE
INSERT INTO t1 VALUES (39,42,'Access-Granted','46','491721000045',2130706433,17690,NULL,NULL,'Localnet','491721000045','49172200000',754974766,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2003-07-18 00:11:21',NULL,NULL,20030718001121);
INSERT INTO t2 SELECT USID, ServerID, State, SessionID, User, NASAddr, NASPort, NASPortType, ConnectSpeed, CarrierType, CallingStationID, CalledStationID, AssignedAddr, SessionTime, PacketsIn, OctetsIn, PacketsOut, OctetsOut, TerminateCause, UnauthTime, AccessRequestTime, AcctStartTime, AcctLastTime, LastModification from t1 LIMIT 1;
drop table t1,t2;
+CREATE TABLE t1(
+Month date NOT NULL,
+Type tinyint(3) unsigned NOT NULL auto_increment,
+Field int(10) unsigned NOT NULL,
+Count int(10) unsigned NOT NULL,
+UNIQUE KEY Month (Month,Type,Field)
+);
+insert into t1 Values
+(20030901, 1, 1, 100),
+(20030901, 1, 2, 100),
+(20030901, 2, 1, 100),
+(20030901, 2, 2, 100),
+(20030901, 3, 1, 100);
+select * from t1;
+Month Type Field Count
+2003-09-01 1 1 100
+2003-09-01 1 2 100
+2003-09-01 2 1 100
+2003-09-01 2 2 100
+2003-09-01 3 1 100
+Select null, Field, Count From t1 Where Month=20030901 and Type=2;
+NULL Field Count
+NULL 1 100
+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
+select * from t2;
+No Field Count
+0 1 100
+0 2 100
+drop table t1, t2;
diff --git a/mysql-test/r/insert_update.result b/mysql-test/r/insert_update.result
index 3a7679ce1e3..53867bf4546 100644
--- a/mysql-test/r/insert_update.result
+++ b/mysql-test/r/insert_update.result
@@ -67,3 +67,41 @@ id select_type table type possible_keys key key_len ref rows Extra
Warnings:
Note 1003 select high_priority test.t1.a AS `a`,test.t1.b AS `b`,test.t1.c AS `c` from test.t1
DROP TABLE t1;
+create table t1(a int primary key, b int);
+insert into t1 values(1,1),(2,2),(3,3),(4,4),(5,5);
+select * from t1;
+a b
+1 1
+2 2
+3 3
+4 4
+5 5
+insert into t1 values(4,14),(5,15),(6,16),(7,17),(8,18)
+on duplicate key update b=b+10;
+affected rows: 7
+info: Records: 5 Duplicates: 2 Warnings: 0
+select * from t1;
+a b
+1 1
+2 2
+3 3
+4 14
+5 15
+6 16
+7 17
+8 18
+replace into t1 values(5,25),(6,26),(7,27),(8,28),(9,29);
+affected rows: 9
+info: Records: 5 Duplicates: 4 Warnings: 0
+select * from t1;
+a b
+1 1
+2 2
+3 3
+4 14
+5 25
+6 26
+7 27
+8 28
+9 29
+drop table t1;
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index 7dbc09f9cc0..f9e49c40dc1 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -277,11 +277,11 @@ CREATE TABLE t2 (ID INTEGER NOT NULL PRIMARY KEY, Value2 VARCHAR(255));
INSERT INTO t1 VALUES (1, 'A');
INSERT INTO t2 VALUES (1, 'B');
SELECT * FROM t1 NATURAL JOIN t2 WHERE 1 AND (Value1 = 'A' AND Value2 <> 'B');
-ID Value1 ID Value2
+ID Value1 Value2
SELECT * FROM t1 NATURAL JOIN t2 WHERE 1 AND Value1 = 'A' AND Value2 <> 'B';
-ID Value1 ID Value2
+ID Value1 Value2
SELECT * FROM t1 NATURAL JOIN t2 WHERE (Value1 = 'A' AND Value2 <> 'B') AND 1;
-ID Value1 ID Value2
+ID Value1 Value2
drop table t1,t2;
create table t1 (i int);
create table t2 (i int);
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index c40f86827f8..9d7c3d98952 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -124,8 +124,8 @@ grp a c id a c d
3 5 C 3 5 B 5
3 6 D 3 6 C 6
select t1.*,t2.* from t1 natural join t2;
-grp a c id a c d
-1 1 a 1 1 a 1
+grp a c id d
+1 1 a 1 1
drop table t1,t2;
CREATE TABLE t1 (
usr_id INT unsigned NOT NULL,
@@ -467,10 +467,10 @@ count color
15 white
7 green
select * from t2 natural join t1;
-count color color name
-10 green green lime
-7 green green lime
-5 black black grape
+count color name
+10 green lime
+7 green lime
+5 black grape
select t2.count, t1.name from t2 natural join t1;
count name
10 lime
diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result
index d8e10fd20c7..115f15bacb6 100644
--- a/mysql-test/r/key.result
+++ b/mysql-test/r/key.result
@@ -34,10 +34,10 @@ INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','N','N','N','N');
INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','N','N','N','N');
INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','','','','');
Warnings:
-Warning 1264 Data truncated for column 'transityes' at row 1
-Warning 1264 Data truncated for column 'shopsyes' at row 1
-Warning 1264 Data truncated for column 'schoolsyes' at row 1
-Warning 1264 Data truncated for column 'petsyes' at row 1
+Warning 1265 Data truncated for column 'transityes' at row 1
+Warning 1265 Data truncated for column 'shopsyes' at row 1
+Warning 1265 Data truncated for column 'schoolsyes' at row 1
+Warning 1265 Data truncated for column 'petsyes' at row 1
INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y');
INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y');
INSERT INTO t1 VALUES (900,'Vancouver','Shared/Roomate','Y','Y','Y','Y');
@@ -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 1262 Data truncated, NULL supplied to NOT NULL column 'c' at row 1
-Warning 1262 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
@@ -185,3 +185,24 @@ NULL 2
a 1
a 2
drop table t1;
+create table t1 (i int, a char(200), b text, unique (a), unique (b(300))) charset utf8;
+insert t1 values (1, repeat('a',210), repeat('b', 310));
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+insert t1 values (2, repeat(0xD0B1,215), repeat(0xD0B1, 310));
+Warnings:
+Warning 1265 Data truncated for column 'a' at row 1
+select i, length(a), length(b), char_length(a), char_length(b) from t1;
+i length(a) length(b) char_length(a) char_length(b)
+1 200 310 200 310
+2 400 620 200 310
+select i from t1 where a=repeat(_utf8 'a',200);
+i
+1
+select i from t1 where a=repeat(_utf8 0xD0B1,200);
+i
+2
+select i from t1 where b=repeat(_utf8 'b',310);
+i
+1
+drop table t1;
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index 0547596dfbd..5718397e1ec 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -2,12 +2,12 @@ drop table if exists t1;
create table t1 (a date, b date, c date not null, d date);
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',';
Warnings:
-Warning 1264 Data truncated for column 'a' at row 1
-Warning 1264 Data truncated for column 'c' at row 1
-Warning 1264 Data truncated for column 'd' at row 1
-Warning 1264 Data truncated for column 'a' at row 2
-Warning 1264 Data truncated for column 'b' at row 2
-Warning 1264 Data truncated for column 'd' at row 2
+Warning 1265 Data truncated for column 'a' at row 1
+Warning 1265 Data truncated for column 'c' at row 1
+Warning 1265 Data truncated for column 'd' at row 1
+Warning 1265 Data truncated for column 'a' at row 2
+Warning 1265 Data truncated for column 'b' at row 2
+Warning 1265 Data truncated for column 'd' at row 2
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' IGNORE 2 LINES;
SELECT * from t1;
a b c d
@@ -18,10 +18,10 @@ a b c d
truncate table t1;
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
Warnings:
-Warning 1264 Data truncated for column 'c' at row 1
-Warning 1264 Data truncated for column 'd' at row 1
-Warning 1264 Data truncated for column 'b' at row 2
-Warning 1264 Data truncated for column 'd' at row 2
+Warning 1265 Data truncated for column 'c' at row 1
+Warning 1265 Data truncated for column 'd' at row 1
+Warning 1265 Data truncated for column 'b' at row 2
+Warning 1265 Data truncated for column 'd' at row 2
SELECT * from t1;
a b c d
NULL NULL 0000-00-00 0000-00-00
@@ -31,7 +31,7 @@ drop table t1;
create table t1 (a text, b text);
load data infile '../../std_data/loaddata2.dat' into table t1 fields terminated by ',' enclosed by '''';
Warnings:
-Warning 1260 Row 3 doesn't contain data for all columns
+Warning 1261 Row 3 doesn't contain data for all columns
select concat('|',a,'|'), concat('|',b,'|') from t1;
concat('|',a,'|') concat('|',b,'|')
|Field A| |Field B|
@@ -43,10 +43,10 @@ drop table t1;
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 1264 Data truncated for column 'a' at row 3
-Warning 1261 Row 3 was truncated; It contained more data than there where input columns
-Warning 1264 Data truncated for column 'a' at row 5
-Warning 1261 Row 5 was truncated; It contained more data than there where input columns
+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 1265 Data truncated for column 'a' at row 5
+Warning 1262 Row 5 was truncated; It contained more data than there were input columns
select * from t1;
a b
1 row 1
@@ -57,8 +57,8 @@ a b
truncate table t1;
load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated by '' enclosed by '' lines terminated by '' ignore 1 lines;
Warnings:
-Warning 1264 Data truncated for column 'a' at row 4
-Warning 1260 Row 4 doesn't contain data for all columns
+Warning 1265 Data truncated for column 'a' at row 4
+Warning 1261 Row 4 doesn't contain data for all columns
select * from t1;
a b
1 row 1
diff --git a/mysql-test/r/lock.result b/mysql-test/r/lock.result
index 2cb9527b94b..429bc5ed352 100644
--- a/mysql-test/r/lock.result
+++ b/mysql-test/r/lock.result
@@ -41,5 +41,9 @@ lock tables t1 write;
check table t2;
Table Op Msg_type Msg_text
test.t2 check error Table 't2' was not locked with LOCK TABLES
+insert into t1 select nr from t1;
+ERROR HY000: Table 't1' was not locked with LOCK TABLES
unlock tables;
+lock tables t1 write, t1 as t1_alias read;
+insert into t1 select index1,nr from t1 as t1_alias;
drop table t1,t2;
diff --git a/mysql-test/r/lowercase0.require b/mysql-test/r/lowercase0.require
new file mode 100644
index 00000000000..a63906557f8
--- /dev/null
+++ b/mysql-test/r/lowercase0.require
@@ -0,0 +1,3 @@
+Variable_name Value
+lower_case_file_system ON
+lower_case_table_names 0
diff --git a/mysql-test/r/lowercase2.require b/mysql-test/r/lowercase2.require
new file mode 100644
index 00000000000..522eac63e81
--- /dev/null
+++ b/mysql-test/r/lowercase2.require
@@ -0,0 +1,2 @@
+Variable_name Value
+lower_case_table_names 2
diff --git a/mysql-test/r/lowercase_table.result b/mysql-test/r/lowercase_table.result
index 0ba4a4be945..8bf3db8cad0 100644
--- a/mysql-test/r/lowercase_table.result
+++ b/mysql-test/r/lowercase_table.result
@@ -1,4 +1,4 @@
-drop table if exists t1,t2,t3,t4,T1;
+drop table if exists t1,t2,t3,t4;
create table T1 (id int primary key, Word varchar(40) not null, Index(Word));
create table t4 (id int primary key, Word varchar(40) not null);
INSERT INTO T1 VALUES (1, 'a'), (2, 'b'), (3, 'c');
@@ -42,3 +42,19 @@ select count(bags.a) from t1 as Bags;
count(bags.a)
0
drop table t1;
+create table t1 (a int);
+create table t2 (a int);
+delete p1.*,P2.* from t1 as p1, t2 as p2 where p1.a=P2.a;
+delete P1.*,p2.* from t1 as P1, t2 as P2 where P1.a=p2.a;
+update t1 as p1, t2 as p2 SET p1.a=1,P2.a=1 where p1.a=P2.a;
+update t1 as P1, t2 as P2 SET P1.a=1,p2.a=1 where P1.a=p2.a;
+drop table t1,t2;
+create table t1 (a int);
+create table t2 (a int);
+select * from t1 c, t2 C;
+ERROR 42000: Not unique table/alias: 'C'
+select C.a, c.a from t1 c, t2 C;
+ERROR 42000: Not unique table/alias: 'C'
+drop table t1, t2;
+show tables;
+Tables_in_test
diff --git a/mysql-test/r/lowercase_table2.result b/mysql-test/r/lowercase_table2.result
new file mode 100644
index 00000000000..c29d52ffffc
--- /dev/null
+++ b/mysql-test/r/lowercase_table2.result
@@ -0,0 +1,123 @@
+DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3;
+DROP DATABASE IF EXISTS `TEST_$1`;
+DROP DATABASE IF EXISTS `test_$1`;
+CREATE TABLE T1 (a int);
+INSERT INTO T1 VALUES (1);
+SHOW TABLES LIKE "T1";
+Tables_in_test (T1)
+T1
+SHOW TABLES LIKE "t1";
+Tables_in_test (t1)
+T1
+SHOW CREATE TABLE T1;
+Table Create Table
+T1 CREATE TABLE `T1` (
+ `a` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+RENAME TABLE T1 TO T2;
+SHOW TABLES LIKE "T2";
+Tables_in_test (T2)
+T2
+SELECT * FROM t2;
+a
+1
+RENAME TABLE T2 TO t3;
+SHOW TABLES LIKE "T3";
+Tables_in_test (T3)
+t3
+RENAME TABLE T3 TO T1;
+SHOW TABLES LIKE "T1";
+Tables_in_test (T1)
+T1
+ALTER TABLE T1 add b int;
+SHOW TABLES LIKE "T1";
+Tables_in_test (T1)
+t1
+ALTER TABLE T1 RENAME T2;
+SHOW TABLES LIKE "T2";
+Tables_in_test (T2)
+T2
+LOCK TABLE T2 WRITE;
+ALTER TABLE T2 drop b;
+SHOW TABLES LIKE "T2";
+Tables_in_test (T2)
+t2
+UNLOCK TABLES;
+RENAME TABLE T2 TO T1;
+SHOW TABLES LIKE "T1";
+Tables_in_test (T1)
+T1
+SELECT * from T1;
+a
+1
+DROP TABLE T1;
+CREATE DATABASE `TEST_$1`;
+SHOW DATABASES LIKE "TEST%";
+Database (TEST%)
+TEST_$1
+DROP DATABASE `test_$1`;
+CREATE TABLE T1 (a int) engine=innodb;
+INSERT INTO T1 VALUES (1);
+SHOW TABLES LIKE "T1";
+Tables_in_test (T1)
+T1
+SHOW TABLES LIKE "t1";
+Tables_in_test (t1)
+T1
+SHOW CREATE TABLE T1;
+Table Create Table
+T1 CREATE TABLE `T1` (
+ `a` int(11) default NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin
+RENAME TABLE T1 TO T2;
+SHOW TABLES LIKE "T2";
+Tables_in_test (T2)
+t2
+SELECT * FROM t2;
+a
+1
+RENAME TABLE T2 TO t3;
+SHOW TABLES LIKE "T3";
+Tables_in_test (T3)
+t3
+RENAME TABLE T3 TO T1;
+SHOW TABLES LIKE "T1";
+Tables_in_test (T1)
+t1
+ALTER TABLE T1 add b int;
+SHOW TABLES LIKE "T1";
+Tables_in_test (T1)
+t1
+ALTER TABLE T1 RENAME T2;
+SHOW TABLES LIKE "T2";
+Tables_in_test (T2)
+t2
+LOCK TABLE T2 WRITE;
+ALTER TABLE T2 drop b;
+SHOW TABLES LIKE "T2";
+Tables_in_test (T2)
+t2
+UNLOCK TABLES;
+RENAME TABLE T2 TO T1;
+SHOW TABLES LIKE "T1";
+Tables_in_test (T1)
+t1
+SELECT * from T1;
+a
+1
+DROP TABLE T1;
+create table T1 (EVENT_ID int auto_increment primary key, LOCATION char(20));
+insert into T1 values (NULL,"Mic-4"),(NULL,"Mic-5"),(NULL,"Mic-6");
+SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3;
+LOCATION
+Mic-5
+Mic-6
+SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3;
+LOCATION
+Mic-5
+Mic-6
+SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3;
+LOCATION
+Mic-5
+Mic-6
+drop table T1;
diff --git a/mysql-test/r/lowercase_table3.result b/mysql-test/r/lowercase_table3.result
new file mode 100644
index 00000000000..362d17e0461
--- /dev/null
+++ b/mysql-test/r/lowercase_table3.result
@@ -0,0 +1,10 @@
+DROP TABLE IF EXISTS t1,T1;
+CREATE TABLE t1 (a int);
+SELECT * from T1;
+a
+drop table t1;
+flush tables;
+CREATE TABLE t1 (a int) type=INNODB;
+SELECT * from T1;
+Can't open file: 'T1.InnoDB'. (errno: 1)
+drop table t1;
diff --git a/mysql-test/r/lowercase_table_qcache.result b/mysql-test/r/lowercase_table_qcache.result
new file mode 100644
index 00000000000..f8d34e0f592
--- /dev/null
+++ b/mysql-test/r/lowercase_table_qcache.result
@@ -0,0 +1,24 @@
+set GLOBAL query_cache_size=1355776;
+drop database if exists MySQLtesT;
+create database MySQLtesT;
+create table MySQLtesT.t1 (a int);
+select * from MySQLtesT.t1;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+drop database mysqltest;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+use MySQL;
+select * from db;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+use test;
+select * from MySQL.db;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 0
+set GLOBAL query_cache_size=0;
diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result
new file mode 100644
index 00000000000..80a01a0ca90
--- /dev/null
+++ b/mysql-test/r/metadata.result
@@ -0,0 +1,62 @@
+drop table if exists t1,t2;
+select 1, 1.0, -1, "hello", NULL;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def 1 8 1 1 N 32769 0 8
+def 1.0 5 3 3 N 32769 1 8
+def -1 8 1 2 N 32769 0 8
+def hello 254 5 5 N 1 31 8
+def NULL 6 0 0 Y 32768 0 8
+1 1.0 -1 hello NULL
+1 1.0 -1 hello NULL
+create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp, l datetime, m enum('a','b'), n set('a','b'), o char(10));
+select * from t1;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 a a 1 4 0 Y 32768 0 63
+def test t1 t1 b b 2 6 0 Y 32768 0 63
+def test t1 t1 c c 9 9 0 Y 32768 0 63
+def test t1 t1 d d 3 11 0 Y 32768 0 63
+def test t1 t1 e e 8 20 0 Y 32768 0 63
+def test t1 t1 f f 4 3 0 Y 32768 2 63
+def test t1 t1 g g 5 4 0 Y 32768 3 63
+def test t1 t1 h h 0 7 0 Y 32768 4 63
+def test t1 t1 i i 13 4 0 Y 32864 0 63
+def test t1 t1 j j 10 10 0 Y 128 0 63
+def test t1 t1 k k 7 19 0 N 1217 0 63
+def test t1 t1 l l 12 19 0 Y 128 0 63
+def test t1 t1 m m 254 1 0 Y 256 0 8
+def test t1 t1 n n 254 3 0 Y 2048 0 8
+def test t1 t1 o o 254 10 0 Y 0 0 8
+a b c d e f g h i j k l m n o
+select a b, b c from t1 as t2;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t2 a b 1 4 0 Y 32768 0 63
+def test t1 t2 b c 2 6 0 Y 32768 0 63
+b c
+drop table t1;
+CREATE TABLE t1 (id tinyint(3) default NULL, data varchar(255) default NULL);
+INSERT INTO t1 VALUES (1,'male'),(2,'female');
+CREATE TABLE t2 (id tinyint(3) unsigned default NULL, data char(3) default '0');
+INSERT INTO t2 VALUES (1,'yes'),(2,'no');
+select t1.id, t1.data, t2.data from t1, t2 where t1.id = t2.id;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 id id 1 3 1 Y 32768 0 63
+def test t1 t1 data data 253 255 6 Y 0 0 8
+def test t2 t2 data data 254 3 3 Y 0 0 8
+id data data
+1 male yes
+2 female no
+select t1.id, t1.data, t2.data from t1, t2 where t1.id = t2.id order by t1.id;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 id id 1 3 1 Y 32768 0 63
+def test t1 t1 data data 253 255 6 Y 0 0 8
+def test t2 t2 data data 254 3 3 Y 0 0 8
+id data data
+1 male yes
+2 female no
+select t1.id from t1 union select t2.id from t2;
+Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr
+def test t1 t1 id id 1 3 1 Y 32768 0 63
+id
+1
+2
+drop table t1,t2;
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
index be09044f96f..10d07e51565 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -396,6 +396,45 @@ select 't1 rows after big delete', count(*) from t1;
t1 rows after big delete count(*)
t1 rows after big delete 1900001
drop table t1,t2;
+CREATE TABLE t1 ( a int );
+CREATE TABLE t2 ( a int );
+DELETE t1 FROM t1, t2 AS t3;
+DELETE t4 FROM t1, t1 AS t4;
+DELETE t3 FROM t1 AS t3, t1 AS t4;
+DELETE t1 FROM t1 AS t3, t2 AS t4;
+ERROR 42000: Not unique table/alias: 't1'
+INSERT INTO t1 values (1),(2);
+INSERT INTO t2 values (1),(2);
+DELETE t1 FROM t1 AS t2, t2 AS t1 where t1.a=t2.a and t1.a=1;
+SELECT * from t1;
+a
+1
+2
+SELECT * from t2;
+a
+2
+DELETE t2 FROM t1 AS t2, t2 AS t1 where t1.a=t2.a and t1.a=2;
+SELECT * from t1;
+a
+1
+SELECT * from t2;
+a
+2
+DROP TABLE t1,t2;
+create table `t1` (`p_id` int(10) unsigned NOT NULL auto_increment, `p_code` varchar(20) NOT NULL default '', `p_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`p_id`) );
+create table `t2` (`c2_id` int(10) unsigned NULL auto_increment, `c2_p_id` int(10) unsigned NOT NULL default '0', `c2_note` text NOT NULL, `c2_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`c2_id`), KEY `c2_p_id` (`c2_p_id`) );
+insert into t1 values (0,'A01-Comp',1);
+insert into t1 values (0,'B01-Comp',1);
+insert into t2 values (0,1,'A Note',1);
+update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2;
+select * from t1;
+p_id p_code p_active
+1 A01-Comp 1
+2 B01-Comp 1
+select * from t2;
+c2_id c2_p_id c2_note c2_active
+1 1 A Note 1
+drop table t1, t2;
set @ttype_save=@@storage_engine;
set @@storage_engine=innodb;
create table t1 ( c char(8) not null );
diff --git a/mysql-test/r/myisam-blob.result b/mysql-test/r/myisam-blob.result
new file mode 100644
index 00000000000..43db7c8badd
--- /dev/null
+++ b/mysql-test/r/myisam-blob.result
@@ -0,0 +1,44 @@
+drop table if exists t1;
+CREATE TABLE t1 (data LONGBLOB) ENGINE=myisam;
+INSERT INTO t1 (data) VALUES (NULL);
+UPDATE t1 set data=repeat('a',18*1024*1024);
+select length(data) from t1;
+length(data)
+18874368
+delete from t1 where left(data,1)='a';
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+truncate table t1;
+INSERT INTO t1 (data) VALUES (repeat('a',1*1024*1024));
+INSERT INTO t1 (data) VALUES (repeat('b',16*1024*1024-1024));
+delete from t1 where left(data,1)='b';
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+UPDATE t1 set data=repeat('c',17*1024*1024);
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+delete from t1 where left(data,1)='c';
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+INSERT INTO t1 set data=repeat('a',18*1024*1024);
+select length(data) from t1;
+length(data)
+18874368
+alter table t1 modify data blob;
+select length(data) from t1;
+length(data)
+0
+drop table t1;
+CREATE TABLE t1 (data BLOB) ENGINE=myisam;
+INSERT INTO t1 (data) VALUES (NULL);
+UPDATE t1 set data=repeat('a',18*1024*1024);
+Warnings:
+Warning 1265 Data truncated for column 'data' at row 1
+select length(data) from t1;
+length(data)
+65535
+drop table t1;
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index ec70cefc63f..d210048a5c7 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -322,11 +322,11 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
-CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), KEY t1 (a, b, c));
-ERROR 42000: Specified key was too long. Max key length is 500
-CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255));
-ALTER TABLE t1 ADD INDEX t1 (a, b, c);
-ERROR 42000: Specified key was too long. Max key length is 500
+CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255), KEY t1 (a, b, c, d, e));
+ERROR 42000: Specified key was too long; max key length is 1000 bytes
+CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255));
+ALTER TABLE t1 ADD INDEX t1 (a, b, c, d, e);
+ERROR 42000: Specified key was too long; max key length is 1000 bytes
DROP TABLE t1;
CREATE TABLE t1 (a int not null, b int, c int, key(b), key(c), key(a,b), key(c,a));
INSERT into t1 values (0, null, 0), (0, null, 1), (0, null, 2), (0, null,3), (1,1,4);
@@ -398,6 +398,90 @@ check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
+create table t1 ( a text not null, key a (a(20)));
+insert into t1 values ('aaa '),('aaa'),('aa');
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+repair table t1;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+select concat(a,'.') from t1 where a='aaa';
+concat(a,'.')
+aaa.
+aaa .
+select concat(a,'.') from t1 where binary a='aaa';
+concat(a,'.')
+aaa.
+update t1 set a='bbb' where a='aaa';
+select concat(a,'.') from t1;
+concat(a,'.')
+bbb.
+bbb.
+aa.
+drop table t1;
+create table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10)));
+insert into t1 values('807780', '477', '165');
+insert into t1 values('807780', '477', '162');
+insert into t1 values('807780', '472', '162');
+select * from t1 where a='807780' and b='477' and c='165';
+a b c
+807780 477 165
+drop table t1;
+create table t1 (a blob);
+insert into t1 values('a '),('a');
+select concat(a,'.') from t1 where a='a';
+concat(a,'.')
+a.
+select concat(a,'.') from t1 where a='a ';
+concat(a,'.')
+a .
+alter table t1 add key(a(2));
+select concat(a,'.') from t1 where a='a';
+concat(a,'.')
+a.
+select concat(a,'.') from t1 where a='a ';
+concat(a,'.')
+a .
+drop table t1;
+create table t1 (a int not null auto_increment primary key, b text not null, unique b (b(20)));
+insert into t1 (b) values ('a'),('a '),('a ');
+select concat(b,'.') from t1;
+concat(b,'.')
+a.
+a .
+a .
+update t1 set b='b ' where a=2;
+update t1 set b='b ' where a > 1;
+ERROR 23000: Duplicate entry 'b ' for key 2
+delete from t1 where b='b';
+select a,concat(b,'.') from t1;
+a concat(b,'.')
+1 a.
+3 a .
+drop table t1;
+create table t1 (a int not null);
+create table t2 (a int not null, primary key (a));
+insert into t1 values (1);
+insert into t2 values (1),(2);
+select sql_big_result distinct t1.a from t1,t2 order by t2.a;
+a
+1
+select distinct t1.a from t1,t2 order by t2.a;
+a
+1
+select sql_big_result distinct t1.a from t1,t2;
+a
+1
+explain select sql_big_result distinct t1.a from t1,t2 order by t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 1 Using temporary
+1 SIMPLE t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct
+explain select distinct t1.a from t1,t2 order by t2.a;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 system NULL NULL NULL NULL 1 Using temporary
+1 SIMPLE t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct
+drop table t1,t2;
CREATE TABLE t1 (`a` int(11) NOT NULL default '0', `b` int(11) NOT NULL default '0', UNIQUE KEY `a` USING RTREE (`a`,`b`)) ENGINE=MyISAM;
ERROR 42000: This version of MySQL doesn't yet support 'RTREE INDEX'
create table t1 (a int, b varchar(200), c text not null) checksum=1;
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 0e642f48f3c..b0a15d9a021 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -25,7 +25,7 @@ INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=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 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` decimal(240,20) default NULL
@@ -50,7 +50,7 @@ INSERT INTO t1 VALUES (-9e999999);
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=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 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` double default NULL
@@ -119,7 +119,7 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5');
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=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 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` varchar(255) default NULL
@@ -142,7 +142,7 @@ CREATE TABLE t1 (a int) ENGINE=MYISAM;
INSERT INTO t1 VALUES (1), (2);
/*!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 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,MYSQL40" */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` int(11) default NULL
@@ -161,7 +161,7 @@ UNLOCK TABLES;
/*!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 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,MYSQL323" */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` int(11) default NULL
@@ -184,7 +184,7 @@ create table ```a` (i int);
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=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 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO" */;
DROP TABLE IF EXISTS ```a`;
CREATE TABLE ```a` (
`i` int(11) default NULL
@@ -202,3 +202,103 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
drop table ```a`;
+create table t1(a int);
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=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" */;
+DROP TABLE IF EXISTS `t1`;
+CREATE TABLE `t1` (
+ `a` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+
+/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+LOCK TABLES `t1` WRITE;
+UNLOCK TABLES;
+/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,ANSI" */;
+DROP TABLE IF EXISTS "t1";
+CREATE TABLE "t1" (
+ "a" int(11) default NULL
+);
+
+
+/*!40000 ALTER TABLE "t1" DISABLE KEYS */;
+LOCK TABLES "t1" WRITE;
+UNLOCK TABLES;
+/*!40000 ALTER TABLE "t1" ENABLE KEYS */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+
+set global sql_mode='ANSI_QUOTES';
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=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" */;
+DROP TABLE IF EXISTS `t1`;
+CREATE TABLE `t1` (
+ `a` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+
+/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+LOCK TABLES `t1` WRITE;
+UNLOCK TABLES;
+/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="NO_AUTO_VALUE_ON_ZERO,ANSI" */;
+DROP TABLE IF EXISTS "t1";
+CREATE TABLE "t1" (
+ "a" int(11) default NULL
+);
+
+
+/*!40000 ALTER TABLE "t1" DISABLE KEYS */;
+LOCK TABLES "t1" WRITE;
+UNLOCK TABLES;
+/*!40000 ALTER TABLE "t1" ENABLE KEYS */;
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
+/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
+
+set global sql_mode='';
+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_SQL_MODE=@@SQL_MODE, SQL_MODE="" */;
+DROP TABLE IF EXISTS `t1`;
+CREATE TABLE `t1` (
+ `a` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+
+/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+
+1
+2
+3
+drop table t1;
diff --git a/mysql-test/r/negation_elimination.result b/mysql-test/r/negation_elimination.result
index 8ca8ae2f12e..a3a2bad7ec6 100644
--- a/mysql-test/r/negation_elimination.result
+++ b/mysql-test/r/negation_elimination.result
@@ -243,10 +243,6 @@ a
3
4
5
-6
-7
-8
-9
10
11
12
diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result
index aa56bce6453..cbd949d6e72 100644
--- a/mysql-test/r/null.result
+++ b/mysql-test/r/null.result
@@ -91,45 +91,45 @@ drop table t1;
CREATE TABLE t1 (a varchar(16) NOT NULL, b smallint(6) NOT NULL, c datetime NOT NULL, d smallint(6) NOT NULL);
INSERT INTO t1 SET a = "", d= "2003-01-14 03:54:55";
Warnings:
-Warning 1264 Data truncated for column 'd' at row 1
+Warning 1265 Data truncated for column 'd' at row 1
UPDATE t1 SET d=1/NULL;
Warnings:
-Warning 1264 Data truncated for column 'd' at row 1
+Warning 1265 Data truncated for column 'd' at row 1
UPDATE t1 SET d=NULL;
Warnings:
-Warning 1262 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 1262 Data truncated, NULL supplied to NOT NULL column 'a' at row 1
-Warning 1262 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 1262 Data truncated, NULL supplied to NOT NULL column 'b' at row 1
-Warning 1262 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 1262 Data truncated, NULL supplied to NOT NULL column 'c' at row 1
-Warning 1262 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 1262 Data truncated, NULL supplied to NOT NULL column 'd' at row 1
-Warning 1262 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 385108216bf..4dfd17991cc 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 1262 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/order_by.result b/mysql-test/r/order_by.result
index c1053087603..1a10c9c6ce9 100644
--- a/mysql-test/r/order_by.result
+++ b/mysql-test/r/order_by.result
@@ -333,10 +333,10 @@ a b c
1 NULL NULL
alter table t1 modify b int not null, modify c varchar(10) not null;
Warnings:
-Warning 1264 Data truncated for column 'b' at row 1
-Warning 1264 Data truncated for column 'c' at row 1
-Warning 1264 Data truncated for column 'b' at row 2
-Warning 1264 Data truncated for column 'c' at row 3
+Warning 1265 Data truncated for column 'b' at row 1
+Warning 1265 Data truncated for column 'c' at row 1
+Warning 1265 Data truncated for column 'b' at row 2
+Warning 1265 Data truncated for column 'c' at row 3
explain select * from t1 order by a, b, c;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL a 18 NULL 11 Using index
@@ -546,6 +546,14 @@ a b
1 2
5 NULL
DROP TABLE t1;
+create table t1(id int not null auto_increment primary key, t char(12));
+explain select id,t from t1 order by id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 Using filesort
+explain select id,t from t1 force index (primary) order by id;
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index NULL PRIMARY 4 NULL 1000
+drop table t1;
CREATE TABLE t1 (
FieldKey varchar(36) NOT NULL default '',
LongVal bigint(20) default NULL,
@@ -611,3 +619,35 @@ a b
5 2
6 2
drop table t1;
+create table t1 (a int not null auto_increment, b int not null, c int not null, d int not null,
+key(a,b,d), key(c,b,a));
+create table t2 like t1;
+insert into t1 values (NULL, 1, 2, 0), (NULL, 2, 1, 1), (NULL, 3, 4, 2), (NULL, 4, 3, 3);
+insert into t2 select null, b, c, d from t1;
+insert into t1 select null, b, c, d from t2;
+insert into t2 select null, b, c, d from t1;
+insert into t1 select null, b, c, d from t2;
+insert into t2 select null, b, c, d from t1;
+insert into t1 select null, b, c, d from t2;
+insert into t2 select null, b, c, d from t1;
+insert into t1 select null, b, c, d from t2;
+insert into t2 select null, b, c, d from t1;
+insert into t1 select null, b, c, d from t2;
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+set @row=10;
+insert into t1 select 1, b, c + (@row:=@row - 1) * 10, d - @row from t2 limit 10;
+select * from t1 where a=1 and b in (1) order by c, b, a;
+a b c d
+1 1 2 0
+1 1 12 -1
+1 1 52 -5
+1 1 92 -9
+select * from t1 where a=1 and b in (1);
+a b c d
+1 1 92 -9
+1 1 52 -5
+1 1 12 -1
+1 1 2 0
+drop table t1, t2;
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index c1d73f20e34..947a8ad25e1 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -292,7 +292,7 @@ DATABASE()
select ENCRYPT("test") from t1;
ENCRYPT("test")
select LAST_INSERT_ID() from t1;
-last_insert_id()
+LAST_INSERT_ID()
select RAND() from t1;
RAND()
select UNIX_TIMESTAMP() from t1;
@@ -593,7 +593,7 @@ select * from t1;
a
set GLOBAL query_cache_size=1024;
Warnings:
-Warning 1281 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 1281 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 1281 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 1281 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
@@ -774,6 +774,23 @@ select * from t3;
delete from t4 where a=1;
flush query cache;
drop table t1,t2,t3,t4;
+set query_cache_wlock_invalidate=1;
+create table t1 (a int not null);
+create table t2 (a int not null);
+select * from t1;
+a
+select * from t2;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+lock table t1 write, t2 read;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+unlock table;
+drop table t1,t2;
+set query_cache_wlock_invalidate=default;
SET NAMES koi8r;
CREATE TABLE t1 (a char(1) character set koi8r);
INSERT INTO t1 VALUES (_koi8r'á'),(_koi8r'Á');
@@ -829,6 +846,11 @@ SELECT * FROM test.t1;
a
USE test;
DROP TABLE t1;
+set character_set_results=null;
+select @@character_set_results;
+@@character_set_results
+NULL
+set character_set_results=default;
create table t1 (a int);
show status like "Qcache_queries_in_cache";
Variable_name Value
diff --git a/mysql-test/r/raid.result b/mysql-test/r/raid.result
index 6e16757a43d..690ef24d809 100644
--- a/mysql-test/r/raid.result
+++ b/mysql-test/r/raid.result
@@ -2,6 +2,7 @@ DROP TABLE IF EXISTS t1,t2;
DROP DATABASE IF EXISTS test_$1;
create database test_$1;
create table test_$1.r1 (i int) raid_type=1;
+create table test_$1.r2 (i int) raid_type=1 raid_chunks=32;
drop database test_$1;
CREATE TABLE t1 (
id int unsigned not null auto_increment primary key,
diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result
index 5e61b1c58c3..d1a5dd00370 100644
--- a/mysql-test/r/range.result
+++ b/mysql-test/r/range.result
@@ -150,7 +150,7 @@ believe in myself
drop table t1;
CREATE TABLE t1 (
t1ID int(10) unsigned NOT NULL auto_increment,
-art char(1) binary NOT NULL default '',
+art binary(1) NOT NULL default '',
KNR char(5) NOT NULL default '',
RECHNR char(6) NOT NULL default '',
POSNR char(2) NOT NULL default '',
@@ -289,6 +289,20 @@ SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1);
COUNT(*)
6
DROP TABLE t1;
+CREATE TABLE t1 ( a int not null, b int not null, INDEX ab(a,b) );
+INSERT INTO t1 VALUES (47,1), (70,1), (15,1), (15, 4);
+SELECT * FROM t1
+WHERE
+(
+( b =1 AND a BETWEEN 14 AND 21 ) OR
+( b =2 AND a BETWEEN 16 AND 18 ) OR
+( b =3 AND a BETWEEN 15 AND 19 ) OR
+(a BETWEEN 19 AND 47)
+);
+a b
+15 1
+47 1
+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/rename.result b/mysql-test/r/rename.result
index e422fbe49c1..9bcf1bc7f97 100644
--- a/mysql-test/r/rename.result
+++ b/mysql-test/r/rename.result
@@ -39,3 +39,17 @@ select * from t3;
drop table if exists t1,t2,t3,t4;
Warnings:
Note 1051 Unknown table 't4'
+CREATE TABLE t1 (a int);
+CREATE TABLE t3 (a int);
+FLUSH TABLES WITH READ LOCK;
+ RENAME TABLE t1 TO t2, t3 to t4;
+show tables;
+Tables_in_test
+t1
+t3
+UNLOCK TABLES;
+show tables;
+Tables_in_test
+t2
+t4
+drop table t2, t4;
diff --git a/mysql-test/r/repair_part1.result b/mysql-test/r/repair_part1.result
index e0030327743..6dcec409ea6 100644
--- a/mysql-test/r/repair_part1.result
+++ b/mysql-test/r/repair_part1.result
@@ -9,6 +9,21 @@ repair table t1 use_frm;
Table Op Msg_type Msg_text
test.t1 repair error The storage engine for the table doesn't support repair
drop table t1;
+create table t1(id int PRIMARY KEY, st varchar(10), KEY st_key(st));
+insert into t1 values(1, "One");
+alter table t1 disable keys;
+show keys from t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t1 0 PRIMARY 1 id A 1 NULL NULL BTREE
+t1 1 st_key 1 st A NULL NULL NULL YES BTREE disabled
+repair table t1 extended;
+Table Op Msg_type Msg_text
+test.t1 repair status OK
+show keys from t1;
+Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
+t1 0 PRIMARY 1 id A 1 NULL NULL BTREE
+t1 1 st_key 1 st A NULL NULL NULL YES BTREE disabled
+drop table t1;
repair table t1 use_frm;
Table Op Msg_type Msg_text
test.t1 repair error Table 'test.t1' doesn't exist
diff --git a/mysql-test/r/rpl000002.result b/mysql-test/r/rpl000002.result
index 56e34b4874f..e5e661795fe 100644
--- a/mysql-test/r/rpl000002.result
+++ b/mysql-test/r/rpl000002.result
@@ -23,8 +23,24 @@ insert into t2 set created=now();
select * from t2;
id created
1 1970-01-01 06:25:45
+create table t3 like t2;
+create temporary table t4 like t2;
+create table t5 select * from t4;
start slave;
select * from t2;
id created
1 1970-01-01 06:25:45
-drop table t2;
+show create table t3;
+Table Create Table
+t3 CREATE TABLE `t3` (
+ `id` int(11) NOT NULL auto_increment,
+ `created` datetime default NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show create table t5;
+Table Create Table
+t5 CREATE TABLE `t5` (
+ `id` int(11) NOT NULL default '0',
+ `created` datetime default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t2,t3,t5;
diff --git a/mysql-test/r/rpl000009.result b/mysql-test/r/rpl000009.result
index 1f78a505280..bb82dcb1e6a 100644
--- a/mysql-test/r/rpl000009.result
+++ b/mysql-test/r/rpl000009.result
@@ -112,6 +112,18 @@ n s
2 two test
3 three test
4 four test
+stop slave;
+reset slave;
+load data from master;
+start slave;
+insert into mysqltest.t1 values (5, 'five bar');
+select * from mysqltest.t1;
+n s
+1 one test
+2 two test
+3 three test
+4 four test
+5 five bar
load table mysqltest.t1 from master;
ERROR 42S01: Table 't1' already exists
drop table mysqltest.t1;
diff --git a/mysql-test/r/rpl_error_ignored_table.result b/mysql-test/r/rpl_error_ignored_table.result
index f5a535ea2ac..4a562dbfc70 100644
--- a/mysql-test/r/rpl_error_ignored_table.result
+++ b/mysql-test/r/rpl_error_ignored_table.result
@@ -9,7 +9,31 @@ insert into t1 values (1),(1);
ERROR 23000: Duplicate entry '1' for key 1
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 273 # # master-bin.000001 Yes Yes test.t1 0 0 273 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 213 slave-relay-bin.000002 257 master-bin.000001 Yes Yes test.t3,test.t1,test.t2 0 0 213 257 None 0 No #
show tables like 't1';
Tables_in_test (t1)
drop table t1;
+select get_lock('crash_lock%20C', 10);
+get_lock('crash_lock%20C', 10)
+1
+create table t2 (a int primary key);
+insert into t2 values(1);
+create table t3 (id int);
+insert into t3 values(connection_id());
+ update t2 set a = a + 1 + get_lock('crash_lock%20C', 10);
+select (@id := id) - id from t3;
+(@id := id) - id
+0
+kill @id;
+drop table t2,t3;
+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 table t1 (a int primary key)
+master-bin.000001 149 Query 1 149 use `test`; insert into t1 values (1),(1)
+master-bin.000001 213 Query 1 213 use `test`; drop table t1
+master-bin.000001 261 Query 1 261 use `test`; create table t2 (a int primary key)
+master-bin.000001 331 Query 1 331 use `test`; insert into t2 values(1)
+master-bin.000001 390 Query 1 390 use `test`; create table t3 (id int)
+master-bin.000001 449 Query 1 449 use `test`; insert into t3 values(connection_id())
+master-bin.000001 522 Query 1 522 use `test`; update t2 set a = a + 1 + get_lock('crash_lock%20C', 10)
+master-bin.000001 613 Query 1 613 use `test`; drop table t2,t3
diff --git a/mysql-test/r/rpl_heap.result b/mysql-test/r/rpl_heap.result
new file mode 100644
index 00000000000..1556bcd5f25
--- /dev/null
+++ b/mysql-test/r/rpl_heap.result
@@ -0,0 +1,29 @@
+reset master;
+drop table if exists t1;
+create table t1 (a int) type=HEAP;
+insert into t1 values(10);
+show binlog events from 79;
+Log_name Pos Event_type Server_id Orig_log_pos Info
+master-bin.001 79 Query 1 79 use `test`; create table t1 (a int) type=HEAP
+master-bin.001 147 Query 1 147 use `test`; DELETE FROM `test`.`t1`
+master-bin.001 205 Query 1 205 use `test`; insert into t1 values(10)
+reset slave;
+start slave;
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) default NULL
+) TYPE=HEAP
+select * from t1;
+a
+10
+select * from t1;
+a
+select * from t1 limit 10;
+a
+show binlog events in 'master-bin.002' from 79;
+Log_name Pos Event_type Server_id Orig_log_pos Info
+master-bin.002 79 Query 1 79 use `test`; DELETE FROM `test`.`t1`
+select * from t1;
+a
+drop table t1;
diff --git a/mysql-test/r/rpl_insert_id.result b/mysql-test/r/rpl_insert_id.result
index 6e331abf102..8001cb59a35 100644
--- a/mysql-test/r/rpl_insert_id.result
+++ b/mysql-test/r/rpl_insert_id.result
@@ -38,8 +38,8 @@ select * from t2;
b c
5 0
6 11
-drop table t1;
drop table t2;
+drop table t1;
create table t1(a int auto_increment, key(a));
create table t2(b int auto_increment, c int, key(b));
insert into t1 values (10);
diff --git a/mysql-test/r/rpl_multi_delete.result b/mysql-test/r/rpl_multi_delete.result
new file mode 100644
index 00000000000..e94a4e7947e
--- /dev/null
+++ b/mysql-test/r/rpl_multi_delete.result
@@ -0,0 +1,22 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+create table t1 (a int);
+create table t2 (a int);
+insert into t1 values (1);
+insert into t2 values (1);
+delete t1.* from t1, t2 where t1.a = t2.a;
+select * from t1;
+a
+select * from t2;
+a
+1
+select * from t1;
+a
+select * from t2;
+a
+1
+drop table t1,t2;
diff --git a/mysql-test/r/rpl_optimize.result b/mysql-test/r/rpl_optimize.result
new file mode 100644
index 00000000000..79891169fbc
--- /dev/null
+++ b/mysql-test/r/rpl_optimize.result
@@ -0,0 +1,27 @@
+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 not null auto_increment primary key, b int, key(b));
+INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+update t1 set b=(a/2*rand());
+delete from t1 order by b limit 10000;
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+drop table t1;
diff --git a/mysql-test/r/rpl_relayrotate.result b/mysql-test/r/rpl_relayrotate.result
index bd6e10409b9..42902e122b1 100644
--- a/mysql-test/r/rpl_relayrotate.result
+++ b/mysql-test/r/rpl_relayrotate.result
@@ -16,6 +16,21 @@ master_pos_wait('master-bin.001',3000)>=0
select max(a) from t1;
max(a)
8000
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 1
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 1
+begin;
+delete from t1;
+commit;
+show status like "binlog_cache_use";
+Variable_name Value
+Binlog_cache_use 2
+show status like "binlog_cache_disk_use";
+Variable_name Value
+Binlog_cache_disk_use 1
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 687207 # # master-bin.000001 Yes Yes 0 0 687207 # None 0 No #
diff --git a/mysql-test/r/rpl_temporary.result b/mysql-test/r/rpl_temporary.result
index 0c270958d8f..9826d4ff1c4 100644
--- a/mysql-test/r/rpl_temporary.result
+++ b/mysql-test/r/rpl_temporary.result
@@ -5,8 +5,21 @@ reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
reset master;
-SET @@session.pseudo_thread_id=100;
+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
+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
+SELECT @@session.sql_select_limit = @save_select_limit;
+@@session.sql_select_limit = @save_select_limit
+1
+SET @@session.pseudo_thread_id=100;
+SET @@session.pseudo_thread_id=connection_id();
+SET @@session.sql_log_bin=0;
+SET @@session.sql_log_bin=1;
drop table if exists t1,t2;
create table t1(f int);
create table t2(f int);
diff --git a/mysql-test/r/rpl_trunc_binlog.result b/mysql-test/r/rpl_trunc_binlog.result
index 2ae91e5f0e6..ad0fb9e5022 100644
--- a/mysql-test/r/rpl_trunc_binlog.result
+++ b/mysql-test/r/rpl_trunc_binlog.result
@@ -10,4 +10,4 @@ reset slave;
start slave;
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.000002 4 # # master-bin.000001 Yes No 0 Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. Probably cause is that the master died while writing the transaction to it's binary log. 0 79 # None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000002 4 slave-relay-bin.000002 123 master-bin.000001 Yes No 0 Rolling back unfinished transaction (no COMMIT or ROLLBACK) from relay log. A probable cause is that the master died while writing the transaction to its binary log. 0 79 326 None 0 No #
diff --git a/mysql-test/r/rpl_until.result b/mysql-test/r/rpl_until.result
index b6c525e0e9c..45bedd0b176 100644
--- a/mysql-test/r/rpl_until.result
+++ b/mysql-test/r/rpl_until.result
@@ -69,4 +69,4 @@ ERROR HY000: Wrong 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=710;
Warnings:
-Note 1253 Slave is already running
+Note 1254 Slave is already running
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 30b391dd947..43c41378f30 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2279,10 +2279,10 @@ a a a
2 2 2
3 3 3
select * from t1 natural join (t1 as t2 left join t1 as t3 using (a));
-a a a
-1 1 1
-2 2 2
-3 3 3
+a a
+1 1
+2 2
+3 3
select * from (t1 as t2 left join t1 as t3 using (a)) natural join t1;
a a a
1 1 1
@@ -2321,3 +2321,23 @@ left join t4 on id3 = id4 where id2 = 1 or id4 = 1;
id1 id2 id3 id4 id44
1 1 NULL NULL NULL
drop table t1,t2,t3,t4;
+create table t1(s varchar(10) not null);
+create table t2(s varchar(10) not null primary key);
+create table t3(s varchar(10) not null primary key);
+insert into t1 values ('one\t'), ('two\t');
+insert into t2 values ('one\r'), ('two\t');
+insert into t3 values ('one '), ('two\t');
+select * from t1 where s = 'one';
+s
+select * from t2 where s = 'one';
+s
+select * from t3 where s = 'one';
+s
+one
+select * from t1,t2 where t1.s = t2.s;
+s s
+two two
+select * from t2,t3 where t2.s = t3.s;
+s s
+two two
+drop table t1, t2, t3;
diff --git a/mysql-test/r/select_found.result b/mysql-test/r/select_found.result
index e302a0cefeb..23a39a242a1 100644
--- a/mysql-test/r/select_found.result
+++ b/mysql-test/r/select_found.result
@@ -208,3 +208,21 @@ select FOUND_ROWS();
FOUND_ROWS()
0
drop table t1;
+CREATE TABLE t1 ( a int not null, b int not null, KEY ab(a,b) );
+INSERT INTO t1 VALUES ( 47, 1 );
+INSERT INTO t1 VALUES ( 70, 1 );
+SELECT * FROM t1
+WHERE
+(
+( b =1 AND a BETWEEN 14 AND 21 ) OR
+( b =2 AND a BETWEEN 16 AND 18 ) OR
+( b =3 AND a BETWEEN 15 AND 19 )
+);
+a b
+DROP TABLE t1;
+CREATE TABLE t1 ( a integer, u varchar(15), r integer, key uao_idx( r, a, u));
+DELETE FROM t1
+WHERE ( r = 1 AND a IN ( 1, 2 ) AND ( u = 'w' OR u LIKE 'w/%' ) )
+OR ( r = 1 AND a IN ( 3 ) AND ( u = 'w/U' OR u LIKE 'w/U/%' ) )
+OR ( r = 1 AND a IN ( 1, 2, 3 ) AND ( u = 'w' ) );
+drop table t1;
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index 4645e7d9b9c..9d9b006cdd5 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -89,8 +89,8 @@ create table t1 (
test_set set( 'val1', 'val2', 'val3' ) not null default '',
name char(20) default 'O''Brien' comment 'O''Brien as default',
c int not null comment 'int column',
-`c-b` int comment 'name with a space',
-`space ` int comment 'name with a space',
+`c-b` int comment 'name with a minus',
+`space 2` int comment 'name with a space',
) comment = 'it\'s a table' ;
show create table t1;
Table Create Table
@@ -98,8 +98,8 @@ t1 CREATE TABLE `t1` (
`test_set` set('val1','val2','val3') NOT NULL default '',
`name` char(20) default 'O''Brien' COMMENT 'O''Brien as default',
`c` int(11) NOT NULL default '0' COMMENT 'int column',
- `c-b` int(11) default NULL COMMENT 'name with a space',
- `space ` int(11) default NULL COMMENT 'name with a space'
+ `c-b` int(11) default NULL COMMENT 'name with a minus',
+ `space 2` int(11) default NULL COMMENT 'name with a space'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='it''s a table'
set sql_quote_show_create=0;
show create table t1;
@@ -108,8 +108,8 @@ t1 CREATE TABLE t1 (
test_set set('val1','val2','val3') NOT NULL default '',
`name` char(20) default 'O''Brien' COMMENT 'O''Brien as default',
c int(11) NOT NULL default '0' COMMENT 'int column',
- `c-b` int(11) default NULL COMMENT 'name with a space',
- `space ` int(11) default NULL COMMENT 'name with a space'
+ `c-b` int(11) default NULL COMMENT 'name with a minus',
+ `space 2` int(11) default NULL COMMENT 'name with a space'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='it''s a table'
set sql_quote_show_create=1;
show full columns from t1;
@@ -117,8 +117,8 @@ Field Type Collation Null Key Default Extra Privileges Comment
test_set set('val1','val2','val3') latin1_swedish_ci select,insert,update,references
name char(20) latin1_swedish_ci YES O'Brien select,insert,update,references O'Brien as default
c int(11) NULL 0 select,insert,update,references int column
-c-b int(11) NULL YES NULL select,insert,update,references name with a space
-space int(11) NULL YES NULL select,insert,update,references name with a space
+c-b int(11) NULL YES NULL select,insert,update,references name with a minus
+space 2 int(11) NULL YES NULL select,insert,update,references name with a space
drop table t1;
create table t1 (a int not null, unique aa (a));
show create table t1;
@@ -225,7 +225,7 @@ t1 CREATE TABLE `t1` (
`empty_char` char(0) default NULL,
`type_char` char(2) default NULL,
`type_varchar` varchar(10) default NULL,
- `type_timestamp` timestamp NOT NULL,
+ `type_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`type_date` date NOT NULL default '0000-00-00',
`type_time` time NOT NULL default '00:00:00',
`type_datetime` datetime NOT NULL default '0000-00-00 00:00:00',
@@ -265,39 +265,13 @@ c decimal(4,3) YES NULL
d double(4,3) YES NULL
f float(4,3) YES NULL
drop table t1;
-SET sql_mode='';
-SET sql_quote_show_create=OFF;
-CREATE TABLE ```ab``cd``` (i INT);
-SHOW CREATE TABLE ```ab``cd```;
-Table Create Table
-`ab`cd` CREATE TABLE ```ab``cd``` (
- i int(11) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-DROP TABLE ```ab``cd```;
-CREATE TABLE ```ab````cd``` (i INT);
-SHOW CREATE TABLE ```ab````cd```;
-Table Create Table
-`ab``cd` CREATE TABLE ```ab````cd``` (
- i int(11) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-DROP TABLE ```ab````cd```;
-CREATE TABLE ```a` (i INT);
-SHOW CREATE TABLE ```a`;
-Table Create Table
-`a CREATE TABLE ```a` (
- i int(11) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-DROP TABLE ```a`;
-SET sql_mode='ANSI_QUOTES';
-CREATE TABLE """a" (i INT);
-SHOW CREATE TABLE """a";
-Table Create Table
-"a CREATE TABLE """a" (
- i int(11) default NULL
-) ENGINE=MyISAM DEFAULT CHARSET=latin1
-DROP TABLE """a";
-SET sql_mode='';
-SET sql_quote_show_create=OFF;
+SET @old_sql_mode= @@sql_mode, sql_mode= '';
+SET @old_sql_quote_show_create= @@sql_quote_show_create, sql_quote_show_create= OFF;
+CREATE TABLE `a/b` (i INT);
+ERROR 42000: Incorrect table name 'a/b'
+SET sql_mode= 'ANSI_QUOTES';
+SET sql_mode= '';
+SET sql_quote_show_create= OFF;
CREATE TABLE t1 (i INT);
SHOW CREATE TABLE t1;
Table Create Table
@@ -312,4 +286,117 @@ table CREATE TABLE `table` (
i int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE `table`;
-SET sql_quote_show_create=ON;
+SET sql_quote_show_create= @old_sql_quote_show_create;
+SET sql_mode= @old_sql_mode;
+select @@max_heap_table_size;
+@@max_heap_table_size
+1047552
+CREATE TABLE t1 (
+a int(11) default NULL,
+KEY a TYPE BTREE (a)
+) ENGINE=HEAP;
+CREATE TABLE t2 (
+b int(11) default NULL,
+index(b)
+) ENGINE=HEAP;
+CREATE TABLE t3 (
+a int(11) default NULL,
+b int(11) default NULL,
+KEY a TYPE BTREE (a),
+index(b)
+) ENGINE=HEAP;
+insert into t1 values (1),(2);
+insert into t2 values (1),(2);
+insert into t3 values (1,1),(2,2);
+show table status;
+Name Type Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 HEAP Fixed 2 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t2 HEAP Fixed 2 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t3 HEAP Fixed 2 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+insert into t1 values (3),(4);
+insert into t2 values (3),(4);
+insert into t3 values (3,3),(4,4);
+show table status;
+Name Type Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 HEAP Fixed 4 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t2 HEAP Fixed 4 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t3 HEAP Fixed 4 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+insert into t1 values (5);
+insert into t2 values (5);
+insert into t3 values (5,5);
+show table status;
+Name Type Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 HEAP Fixed 5 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t2 HEAP Fixed 5 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t3 HEAP Fixed 5 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+delete from t1 where a=3;
+delete from t2 where b=3;
+delete from t3 where a=3;
+show table status;
+Name Type Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 HEAP Fixed 4 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL
+t2 HEAP Fixed 4 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL
+t3 HEAP Fixed 4 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL
+delete from t1;
+delete from t2;
+delete from t3;
+show table status;
+Name Type Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 HEAP Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t2 HEAP Fixed 0 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t3 HEAP Fixed 0 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+insert into t1 values (5);
+insert into t2 values (5);
+insert into t3 values (5,5);
+show table status;
+Name Type Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 HEAP Fixed 1 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t2 HEAP Fixed 1 5 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+t3 HEAP Fixed 1 9 # # # 0 NULL NULL NULL NULL latin1_swedish_ci NULL
+delete from t1 where a=5;
+delete from t2 where b=5;
+delete from t3 where a=5;
+show table status;
+Name Type Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
+t1 HEAP Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL
+t2 HEAP Fixed 0 5 # # # 5 NULL NULL NULL NULL latin1_swedish_ci NULL
+t3 HEAP Fixed 0 9 # # # 9 NULL NULL NULL NULL latin1_swedish_ci NULL
+drop table t1, t2, t3;
+create database test_$1;
+show create database test_$1;
+Database Create Database
+test_$1 CREATE DATABASE `test_$1` /*!40100 DEFAULT CHARACTER SET latin1 */
+create table test_$1.t1(a int);
+insert into test_$1.t1 values(1);
+grant select on `test_$1`.* to mysqltest_1@localhost;
+grant usage on `test_$1`.* to mysqltest_2@localhost;
+grant drop on `test_$1`.* to mysqltest_3@localhost;
+select * from t1;
+a
+1
+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'
+drop 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'
+show create 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'
+drop 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'
+show create 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
+where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
+delete from mysql.db
+where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
+flush privileges;
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index 18d403313d7..19bda2fec44 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 1248 Select 2 was reduced during optimisation
+Note 1249 Select 2 was reduced during optimisation
Note 1003 select high_priority 2 AS `(select 2)`
SELECT (SELECT 1) UNION SELECT (SELECT 2);
(SELECT 1)
@@ -17,8 +17,8 @@ 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
3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1248 Select 2 was reduced during optimisation
-Note 1248 Select 4 was reduced during optimisation
+Note 1249 Select 2 was reduced during optimisation
+Note 1249 Select 4 was reduced during optimisation
Note 1003 select high_priority 1 AS `(SELECT 1)` union select 2 AS `(SELECT 2)`
SELECT (SELECT (SELECT 0 UNION SELECT 0));
(SELECT (SELECT 0 UNION SELECT 0))
@@ -29,7 +29,7 @@ id select_type table type possible_keys key key_len ref rows Extra
3 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
4 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1248 Select 2 was reduced during optimisation
+Note 1249 Select 2 was reduced during optimisation
Note 1003 select high_priority (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)
@@ -46,8 +46,8 @@ id select_type table type possible_keys key key_len ref rows Extra
3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
2 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1275 Field or reference 'a' of SELECT #3 was resolved in SELECT #1
-Note 1275 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1
+Note 1276 Field or reference 'a' of SELECT #3 was resolved in SELECT #1
+Note 1276 Field or reference 'b.a' of SELECT #3 was resolved in SELECT #1
Note 1003 select high_priority 1 AS `1` from (select 1 AS `a`) b having ((select b.a AS `a`) = 1)
SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1;
1
@@ -219,7 +219,7 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 Using where
Warnings:
-Note 1275 Field or reference 't4.a' of SELECT #3 was resolved in SELECT #1
+Note 1276 Field or reference 't4.a' of SELECT #3 was resolved in SELECT #1
Note 1003 select high_priority test.t4.b AS `b`,(select avg((test.t2.a + (select min(test.t3.a) AS `min(t3.a)` from test.t3 where (test.t3.a >= test.t4.a)))) AS `avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a))` from test.t2) AS `(select avg(t2.a+(select min(t3.a) from t3 where t3.a >= t4.a)) from t2)` from test.t4
select * from t3 where exists (select * from t2 where t2.b=t3.a);
a
@@ -307,8 +307,8 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY t1 system NULL NULL NULL NULL 1
3 DEPENDENT UNION t5 ALL NULL NULL NULL NULL 2 Using where
Warnings:
-Note 1275 Field or reference 't2.a' of SELECT #2 was resolved in SELECT #1
-Note 1275 Field or reference 't2.a' of SELECT #3 was resolved in SELECT #1
+Note 1276 Field or reference 't2.a' of SELECT #2 was resolved in SELECT #1
+Note 1276 Field or reference 't2.a' of SELECT #3 was resolved in SELECT #1
Note 1003 select high_priority (select test.t1.a AS `a` from test.t1 where (test.t1.a = test.t2.a) union select test.t5.a AS `a` from test.t5 where (test.t5.a = test.t2.a)) AS `(select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)`,test.t2.a AS `a` from test.t2
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
ERROR 21000: Subquery returns more than 1 row
@@ -326,7 +326,7 @@ 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
Warnings:
-Note 1275 Field or reference 'clinic_uq' of SELECT #2 was resolved in SELECT #1
+Note 1276 Field or reference 'clinic_uq' of SELECT #2 was resolved in SELECT #1
Note 1003 select high_priority 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) limit 1)
select * from t1 where a= (select a from t2,t4 where t2.b=t4.b);
ERROR 23000: Column: 'a' in field list is ambiguous
@@ -715,7 +715,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 1248 Select 2 was reduced during optimisation
+Note 1249 Select 2 was reduced during optimisation
Note 1003 select high_priority 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
@@ -727,8 +727,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 1248 Select 3 was reduced during optimisation
-Note 1248 Select 2 was reduced during optimisation
+Note 1249 Select 3 was reduced during optimisation
+Note 1249 Select 2 was reduced during optimisation
Note 1003 select high_priority 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
@@ -860,8 +860,8 @@ explain extended select (select a+1) from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 3
Warnings:
-Note 1275 Field or reference 'a' of SELECT #2 was resolved in SELECT #1
-Note 1248 Select 2 was reduced during optimisation
+Note 1276 Field or reference 'a' of SELECT #2 was resolved in SELECT #1
+Note 1249 Select 2 was reduced during optimisation
Note 1003 select high_priority (test.t1.a + 1) AS `(select a+1)` from test.t1
select (select a+1) from t1;
(select a+1)
@@ -978,7 +978,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
+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);
@@ -1049,12 +1049,12 @@ UNIQUE KEY `maxnumrep` (`maxnumrep`)
) ENGINE=MyISAM CHARSET=latin1;
INSERT INTO t1 VALUES ('joce','1','','joce'),('test','2','','test');
Warnings:
-Warning 1264 Data truncated for column 'date' at row 1
-Warning 1264 Data truncated for column 'date' at row 2
+Warning 1265 Data truncated for column 'date' at row 1
+Warning 1265 Data truncated for column 'date' at row 2
INSERT INTO t2 VALUES ('joce','1','','joce'),('test','2','','test');
Warnings:
-Warning 1264 Data truncated for column 'date' at row 1
-Warning 1264 Data truncated for column 'date' at row 2
+Warning 1265 Data truncated for column 'date' at row 1
+Warning 1265 Data truncated for column 'date' at row 2
INSERT INTO t3 VALUES (1,1);
SELECT DISTINCT topic FROM t2 WHERE NOT EXISTS(SELECT * FROM t3 WHERE
numeropost=topic);
@@ -1168,9 +1168,9 @@ SELECT 0 IN (SELECT 1 FROM t1 a);
EXPLAIN EXTENDED SELECT 0 IN (SELECT 1 FROM t1 a);
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
-2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
-Note 1003 select high_priority <in_optimizer>(0,<exists>(select 1 AS `Not_used` from test.t1 a where isnull(1) having <is_not_null_test>(1) limit 1)) AS `0 IN (SELECT 1 FROM t1 a)`
+Note 1003 select high_priority <in_optimizer>(0,<exists>(select 1 AS `Not_used` from test.t1 a limit 1)) AS `0 IN (SELECT 1 FROM t1 a)`
INSERT INTO t1 (pseudo) VALUES ('test1');
SELECT 0 IN (SELECT 1 FROM t1 a);
0 IN (SELECT 1 FROM t1 a)
@@ -1178,9 +1178,9 @@ SELECT 0 IN (SELECT 1 FROM t1 a);
EXPLAIN EXTENDED SELECT 0 IN (SELECT 1 FROM t1 a);
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
-2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
+2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
-Note 1003 select high_priority <in_optimizer>(0,<exists>(select 1 AS `Not_used` from test.t1 a where isnull(1) having <is_not_null_test>(1) limit 1)) AS `0 IN (SELECT 1 FROM t1 a)`
+Note 1003 select high_priority <in_optimizer>(0,<exists>(select 1 AS `Not_used` from test.t1 a limit 1)) AS `0 IN (SELECT 1 FROM t1 a)`
drop table t1;
CREATE TABLE `t1` (
`i` int(11) NOT NULL default '0',
@@ -1246,7 +1246,7 @@ insert into t1 values (1,0), (2,0), (3,0);
insert into t2 values (1,1), (2,1), (3,1), (2,2);
update ignore t1 set b=(select b from t2 where t1.a=t2.a);
Warnings:
-Error 1241 Subquery returns more than 1 row
+Error 1242 Subquery returns more than 1 row
select * from t1;
a b
1 1
@@ -1577,6 +1577,16 @@ INSERT INTO t2 VALUES (100, 200, 'C');
SELECT DISTINCT COLC FROM t1 WHERE COLA = (SELECT COLA FROM t2 WHERE COLB = 200 AND COLC ='C' LIMIT 1);
COLC
DROP TABLE t1, t2;
+CREATE TABLE t1 (a int(1));
+INSERT INTO t1 VALUES (1),(1),(1),(1),(1),(2),(3),(4),(5);
+SELECT DISTINCT (SELECT a) FROM t1 LIMIT 100;
+(SELECT a)
+1
+2
+3
+4
+5
+DROP TABLE t1;
create table t1 (a int, b decimal(13, 3));
insert into t1 values (1, 0.123);
select a, (select max(b) from t1) into outfile "subselect.out.file.1" from t1;
@@ -1611,3 +1621,97 @@ id max_anno_dep PIPPO
50 1990 0
51 1990 NULL
DROP TABLE t1, t2;
+create table t1 (a int);
+insert into t1 values (1), (2), (3);
+SET SQL_SELECT_LIMIT=1;
+select sum(a) from (select * from t1) as a;
+sum(a)
+6
+select 2 in (select * from t1);
+2 in (select * from t1)
+1
+SET SQL_SELECT_LIMIT=default;
+drop table t1;
+CREATE TABLE t1 (a int, b int, INDEX (a));
+INSERT INTO t1 VALUES (1, 1), (1, 2), (1, 3);
+SELECT * FROM t1 WHERE a = (SELECT MAX(a) FROM t1 WHERE a = 1) ORDER BY b;
+a b
+1 1
+1 2
+1 3
+DROP TABLE t1;
+create table t1(val varchar(10));
+insert into t1 values ('aaa'), ('bbb'),('eee'),('mmm'),('ppp');
+select count(*) from t1 as w1 where w1.val in (select w2.val from t1 as w2 where w2.val like 'm%') and w1.val in (select w3.val from t1 as w3 where w3.val like 'e%');
+count(*)
+0
+drop table t1;
+create table t1 (id int not null, text varchar(20) not null default '', primary key (id));
+insert into t1 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text11'), (12, 'text12');
+select * from t1 where id not in (select id from t1 where id < 8);
+id text
+8 text8
+9 text9
+10 text10
+11 text11
+12 text12
+select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null);
+id text
+8 text8
+9 text9
+10 text10
+11 text11
+12 text12
+explain extended select * from t1 where id not in (select id from t1 where id < 8);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 ALL NULL NULL NULL NULL 12 Using where
+2 DEPENDENT SUBQUERY t1 unique_subquery PRIMARY PRIMARY 4 func 1 Using index; Using where
+Warnings:
+Note 1003 select high_priority test.t1.id AS `id`,test.t1.text AS `text` from test.t1 where not(<in_optimizer>(test.t1.id,<exists>(<primary_index_lookup>(<cache>(test.t1.id) in t1 on PRIMARY where (test.t1.id < 8)))))
+explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY tt ALL NULL NULL NULL NULL 12 Using where
+2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.tt.id 7 Using where; Using index
+Warnings:
+Note 1276 Field or reference 'tt.id' of SELECT #2 was resolved in SELECT #1
+Note 1003 select high_priority test.tt.id AS `id`,test.tt.text AS `text` from test.t1 tt where not(exists(select test.t1.id AS `id` from test.t1 where ((test.t1.id < 8) and ((test.t1.id = test.tt.id) or isnull(test.t1.id))) having (test.t1.id is not null) limit 1))
+insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001');
+create table t2 (id int not null, text varchar(20) not null default '', primary key (id));
+insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10');
+select * from t1 a left join t2 b on (a.id=b.id or b.id is null) join t1 c on (if(isnull(b.id), 1000, b.id)=c.id);
+id text id text id text
+1 text1 1 text1 1 text1
+2 text2 2 text2 2 text2
+3 text3 3 text3 3 text3
+4 text4 4 text4 4 text4
+5 text5 5 text5 5 text5
+6 text6 6 text6 6 text6
+7 text7 7 text7 7 text7
+8 text8 8 text8 8 text8
+9 text9 9 text9 9 text9
+10 text10 10 text10 10 text10
+11 text11 11 text1 11 text11
+12 text12 12 text2 12 text12
+1000 text1000 NULL NULL 1000 text1000
+1001 text1001 NULL NULL 1000 text1000
+explain extended select * from t1 a left join t2 b on (a.id=b.id or b.id is null) join t1 c on (if(isnull(b.id), 1000, b.id)=c.id);
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE a ALL NULL NULL NULL NULL 14
+1 SIMPLE b eq_ref PRIMARY PRIMARY 4 test.a.id 2
+1 SIMPLE c eq_ref PRIMARY PRIMARY 4 func 1 Using where
+Warnings:
+Note 1003 select high_priority test.a.id AS `id`,test.a.text AS `text`,test.b.id AS `id`,test.b.text AS `text`,test.c.id AS `id`,test.c.text AS `text` from test.t1 a left join test.t2 b on(((test.a.id = test.b.id) or isnull(test.b.id))) join test.t1 c where (if(isnull(test.b.id),1000,test.b.id) = test.c.id)
+drop table t1,t2;
+create table t1 (a int);
+insert into t1 values (1);
+explain select benchmark(1000, (select a from t1 where a=sha(rand())));
+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
+2 UNCACHEABLE SUBQUERY t1 system NULL NULL NULL NULL 1
+drop table t1;
+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
+drop table t1,t2,t3;
diff --git a/mysql-test/r/subselect2.result b/mysql-test/r/subselect2.result
index b04fec26c6f..c2780a08d36 100644
--- a/mysql-test/r/subselect2.result
+++ b/mysql-test/r/subselect2.result
@@ -120,9 +120,9 @@ DOCID DOCNAME DOCTYPEID FOLDERID AUTHOR CREATED TITLE SUBTITLE DOCABSTRACT PUBLI
c373e9f5ad07993f3859444553544200 Last Discussion c373e9f5ad079174ff17444553544200 c373e9f5ad0796c0eca4444553544200 Goldilocks 2003-06-09 11:21:06 Title: Last Discussion NULL Setting new abstract and keeping doc checked out 2003-06-09 10:51:26 2003-06-09 10:51:26 NULL NULL NULL 03eea05112b845949f3fd03278b5fe43 2003-06-09 11:21:06 admin 0 NULL Discussion NULL NULL
EXPLAIN SELECT t2.*, t4.DOCTYPENAME, t1.CONTENTSIZE,t1.MIMETYPE FROM t2 INNER JOIN t4 ON t2.DOCTYPEID = t4.DOCTYPEID LEFT OUTER JOIN t1 ON t2.DOCID = t1.DOCID WHERE t2.FOLDERID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID IN(SELECT t3.FOLDERID FROM t3 WHERE t3.PARENTID='2f6161e879db43c1a5b82c21ddc49089' AND t3.FOLDERNAME = 'Level1') AND t3.FOLDERNAME = 'Level2') AND t3.FOLDERNAME = 'Level3') AND t3.FOLDERNAME = 'CopiedFolder') AND t3.FOLDERNAME = 'Movie Reviews') AND t2.DOCNAME = 'Last Discussion';
id select_type table type possible_keys key key_len ref rows Extra
-1 PRIMARY t1 system PRIMARY NULL NULL NULL 0 const row not found
-1 PRIMARY t2 ALL DDOCTYPEID_IDX NULL NULL NULL 9 Using where
+1 PRIMARY t2 ALL DDOCTYPEID_IDX NULL NULL NULL 10 Using where
1 PRIMARY t4 eq_ref PRIMARY PRIMARY 32 test.t2.DOCTYPEID 1
+1 PRIMARY t1 eq_ref PRIMARY PRIMARY 32 test.t2.DOCID 1
2 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
3 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
4 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,FFOLDERID_IDX PRIMARY 32 func 1 Using index; Using where
diff --git a/mysql-test/r/subselect_innodb.result b/mysql-test/r/subselect_innodb.result
index b2a055fa72c..9c1816e295c 100644
--- a/mysql-test/r/subselect_innodb.result
+++ b/mysql-test/r/subselect_innodb.result
@@ -62,7 +62,7 @@ processor_id (SELECT y.yod_id FROM t1 p2, t2 y WHERE p2.processor_id = p1.proces
1 1
2 2
3 3
-drop table t1,t2,t3;
+drop table t2,t1,t3;
CREATE TABLE t1 (
id int(11) NOT NULL default '0',
b int(11) default NULL,
diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result
index 6dc48a0a77e..08d75d8b562 100644
--- a/mysql-test/r/symlink.result
+++ b/mysql-test/r/symlink.result
@@ -64,9 +64,7 @@ t9 CREATE TABLE `t9` (
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/'
drop database mysqltest;
-create table t1 (a int not null) type=myisam;
-Warnings:
-Warning 1286 'TYPE=storage_engine' is deprecated. Use 'ENGINE=storage_engine' instead.
+create table t1 (a int not null) engine=myisam;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/r/synchronization.result b/mysql-test/r/synchronization.result
new file mode 100644
index 00000000000..ad9443c86da
--- /dev/null
+++ b/mysql-test/r/synchronization.result
@@ -0,0 +1,162 @@
+CREATE TABLE t1 (x1 int);
+ ALTER TABLE t1 CHANGE x1 x2 int;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `xx` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+ ALTER TABLE t1 CHANGE x2 x1 int;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `xx` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+ ALTER TABLE t1 CHANGE x1 x2 int;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `xx` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+ ALTER TABLE t1 CHANGE x2 x1 int;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `xx` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+ ALTER TABLE t1 CHANGE x1 x2 int;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `xx` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+ ALTER TABLE t1 CHANGE x2 x1 int;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `xx` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+ ALTER TABLE t1 CHANGE x1 x2 int;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `xx` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+ ALTER TABLE t1 CHANGE x2 x1 int;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `xx` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+ ALTER TABLE t1 CHANGE x1 x2 int;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `xx` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+ ALTER TABLE t1 CHANGE x2 x1 int;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `xx` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+ ALTER TABLE t1 CHANGE x1 x2 int;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `xx` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+ ALTER TABLE t1 CHANGE x2 x1 int;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `xx` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+ ALTER TABLE t1 CHANGE x1 x2 int;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `xx` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+ ALTER TABLE t1 CHANGE x2 x1 int;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `xx` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+ ALTER TABLE t1 CHANGE x1 x2 int;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `xx` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+ ALTER TABLE t1 CHANGE x2 x1 int;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `xx` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+ ALTER TABLE t1 CHANGE x1 x2 int;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `xx` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+ ALTER TABLE t1 CHANGE x2 x1 int;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `xx` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+ ALTER TABLE t1 CHANGE x1 x2 int;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `xx` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+ ALTER TABLE t1 CHANGE x2 x1 int;
+CREATE TABLE t2 LIKE t1;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TABLE `t2` (
+ `xx` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+DROP TABLE t2;
+DROP TABLE t1;
diff --git a/mysql-test/r/system_mysql_db.result b/mysql-test/r/system_mysql_db.result
new file mode 100644
index 00000000000..d53ace261bf
--- /dev/null
+++ b/mysql-test/r/system_mysql_db.result
@@ -0,0 +1,123 @@
+show tables;
+Tables_in_db
+columns_priv
+db
+func
+help_category
+help_keyword
+help_relation
+help_topic
+host
+tables_priv
+user
+show create table db;
+Table Create Table
+db CREATE TABLE `db` (
+ `Host` char(60) character set latin1 collate latin1_bin NOT NULL default '',
+ `Db` char(64) character set latin1 collate latin1_bin NOT NULL default '',
+ `User` char(16) character set latin1 collate latin1_bin NOT NULL default '',
+ `Select_priv` enum('N','Y') NOT NULL default 'N',
+ `Insert_priv` enum('N','Y') NOT NULL default 'N',
+ `Update_priv` enum('N','Y') NOT NULL default 'N',
+ `Delete_priv` enum('N','Y') NOT NULL default 'N',
+ `Create_priv` enum('N','Y') NOT NULL default 'N',
+ `Drop_priv` enum('N','Y') NOT NULL default 'N',
+ `Grant_priv` enum('N','Y') NOT NULL default 'N',
+ `References_priv` enum('N','Y') NOT NULL default 'N',
+ `Index_priv` enum('N','Y') NOT NULL default 'N',
+ `Alter_priv` enum('N','Y') NOT NULL default 'N',
+ `Create_tmp_table_priv` enum('N','Y') NOT NULL default 'N',
+ `Lock_tables_priv` enum('N','Y') NOT NULL default 'N',
+ PRIMARY KEY (`Host`,`Db`,`User`),
+ KEY `User` (`User`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Database privileges'
+show create table host;
+Table Create Table
+host CREATE TABLE `host` (
+ `Host` char(60) character set latin1 collate latin1_bin NOT NULL default '',
+ `Db` char(64) character set latin1 collate latin1_bin NOT NULL default '',
+ `Select_priv` enum('N','Y') NOT NULL default 'N',
+ `Insert_priv` enum('N','Y') NOT NULL default 'N',
+ `Update_priv` enum('N','Y') NOT NULL default 'N',
+ `Delete_priv` enum('N','Y') NOT NULL default 'N',
+ `Create_priv` enum('N','Y') NOT NULL default 'N',
+ `Drop_priv` enum('N','Y') NOT NULL default 'N',
+ `Grant_priv` enum('N','Y') NOT NULL default 'N',
+ `References_priv` enum('N','Y') NOT NULL default 'N',
+ `Index_priv` enum('N','Y') NOT NULL default 'N',
+ `Alter_priv` enum('N','Y') NOT NULL default 'N',
+ `Create_tmp_table_priv` enum('N','Y') NOT NULL default 'N',
+ `Lock_tables_priv` enum('N','Y') NOT NULL default 'N',
+ PRIMARY KEY (`Host`,`Db`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Host privileges; Merged with database privileges'
+show create table user;
+Table Create Table
+user CREATE TABLE `user` (
+ `Host` varchar(60) character set latin1 collate latin1_bin NOT NULL default '',
+ `User` varchar(16) character set latin1 collate latin1_bin NOT NULL default '',
+ `Password` varchar(41) character set latin1 collate latin1_bin NOT NULL default '',
+ `Select_priv` enum('N','Y') NOT NULL default 'N',
+ `Insert_priv` enum('N','Y') NOT NULL default 'N',
+ `Update_priv` enum('N','Y') NOT NULL default 'N',
+ `Delete_priv` enum('N','Y') NOT NULL default 'N',
+ `Create_priv` enum('N','Y') NOT NULL default 'N',
+ `Drop_priv` enum('N','Y') NOT NULL default 'N',
+ `Reload_priv` enum('N','Y') NOT NULL default 'N',
+ `Shutdown_priv` enum('N','Y') NOT NULL default 'N',
+ `Process_priv` enum('N','Y') NOT NULL default 'N',
+ `File_priv` enum('N','Y') NOT NULL default 'N',
+ `Grant_priv` enum('N','Y') NOT NULL default 'N',
+ `References_priv` enum('N','Y') NOT NULL default 'N',
+ `Index_priv` enum('N','Y') NOT NULL default 'N',
+ `Alter_priv` enum('N','Y') NOT NULL default 'N',
+ `Show_db_priv` enum('N','Y') NOT NULL default 'N',
+ `Super_priv` enum('N','Y') NOT NULL default 'N',
+ `Create_tmp_table_priv` enum('N','Y') NOT NULL default 'N',
+ `Lock_tables_priv` enum('N','Y') NOT NULL default 'N',
+ `Execute_priv` enum('N','Y') NOT NULL default 'N',
+ `Repl_slave_priv` enum('N','Y') NOT NULL default 'N',
+ `Repl_client_priv` enum('N','Y') NOT NULL default 'N',
+ `ssl_type` enum('','ANY','X509','SPECIFIED') NOT NULL default '',
+ `ssl_cipher` blob NOT NULL,
+ `x509_issuer` blob NOT NULL,
+ `x509_subject` blob NOT NULL,
+ `max_questions` int(11) unsigned NOT NULL default '0',
+ `max_updates` int(11) unsigned NOT NULL default '0',
+ `max_connections` int(11) unsigned NOT NULL default '0',
+ PRIMARY KEY (`Host`,`User`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Users and global privileges'
+show create table func;
+Table Create Table
+func CREATE TABLE `func` (
+ `name` char(64) character set latin1 collate latin1_bin NOT NULL default '',
+ `ret` tinyint(1) NOT NULL default '0',
+ `dl` char(128) NOT NULL default '',
+ `type` enum('function','aggregate') NOT NULL default 'function',
+ PRIMARY KEY (`name`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='User defined functions'
+show create table tables_priv;
+Table Create Table
+tables_priv CREATE TABLE `tables_priv` (
+ `Host` char(60) character set latin1 collate latin1_bin NOT NULL default '',
+ `Db` char(64) character set latin1 collate latin1_bin NOT NULL default '',
+ `User` char(16) character set latin1 collate latin1_bin NOT NULL default '',
+ `Table_name` char(64) character set latin1 collate latin1_bin NOT NULL default '',
+ `Grantor` char(77) NOT NULL default '',
+ `Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') NOT NULL default '',
+ `Column_priv` set('Select','Insert','Update','References') NOT NULL default '',
+ PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`),
+ KEY `Grantor` (`Grantor`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Table privileges'
+show create table columns_priv;
+Table Create Table
+columns_priv CREATE TABLE `columns_priv` (
+ `Host` char(60) character set latin1 collate latin1_bin NOT NULL default '',
+ `Db` char(64) character set latin1 collate latin1_bin NOT NULL default '',
+ `User` char(16) character set latin1 collate latin1_bin NOT NULL default '',
+ `Table_name` char(64) character set latin1 collate latin1_bin NOT NULL default '',
+ `Column_name` char(64) character set latin1 collate latin1_bin NOT NULL default '',
+ `Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `Column_priv` set('Select','Insert','Update','References') NOT NULL default '',
+ PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Column privileges'
diff --git a/mysql-test/r/system_mysql_db_refs.result b/mysql-test/r/system_mysql_db_refs.result
new file mode 100644
index 00000000000..e15934b03ac
--- /dev/null
+++ b/mysql-test/r/system_mysql_db_refs.result
@@ -0,0 +1,67 @@
+set @name="This is a very long string, that mustn't find room in a system field like Table_name. Thus it should be cut by the actual size of the field. So we can use this string to find out the actual length of the field and to use it in any compare queries";
+create table test_db select * from mysql.db;
+delete from test_db;
+insert into test_db (Host,Db,User) values (@name,@name,@name);
+create table test_host select * from mysql.host;
+delete from test_host;
+insert into test_host (Host,Db) values (@name,@name);
+create table test_user select * from mysql.user;
+delete from test_user;
+insert into test_user (Host,User) values (@name,@name);
+create table test_func select * from mysql.func;
+delete from test_func;
+insert into test_func (name) values (@name);
+create table test_tables_priv select * from mysql.tables_priv;
+delete from test_tables_priv;
+insert into test_tables_priv (Host,Db,User,Table_name) values (@name,@name,@name,@name);
+create table test_columns_priv select * from mysql.columns_priv;
+delete from test_columns_priv;
+insert into test_columns_priv (Host,Db,User,Table_name,Column_name) values (@name,@name,@name,@name,@name);
+select
+if(isnull(test_db.Host),'WRONG!!!','ok') as test_db_Host,
+if(isnull(test_host.Host),'WRONG!!!','ok') as test_host_Host,
+if(isnull(test_user.Host),'WRONG!!!','ok') as test_user_Host,
+if(isnull(test_tables_priv.Host),'WRONG!!!','ok') as test_tables_priv_Host,
+if(isnull(test_columns_priv.Host),'WRONG!!!','ok') as test_columns_priv_Host
+from test_db
+left join test_host on test_db.Host=test_host.Host
+left join test_user on test_db.Host=test_user.Host
+left join test_tables_priv on test_db.Host=test_tables_priv.Host
+left join test_columns_priv on test_db.Host=test_columns_priv.Host;
+test_db_Host test_host_Host test_user_Host test_tables_priv_Host test_columns_priv_Host
+ok ok ok ok ok
+select
+if(isnull(test_db.Db),'WRONG!!!','ok') as test_db_Db,
+if(isnull(test_host.Db),'WRONG!!!','ok') as test_host_Db,
+if(isnull(test_tables_priv.Db),'WRONG!!!','ok') as test_tables_priv_Db,
+if(isnull(test_columns_priv.Db),'WRONG!!!','ok') as est_columns_priv_Db
+from test_db
+left join test_host on test_db.Db=test_host.Db
+left join test_tables_priv on test_db.Db=test_tables_priv.Db
+left join test_columns_priv on test_db.Db=test_columns_priv.Db;
+test_db_Db test_host_Db test_tables_priv_Db est_columns_priv_Db
+ok ok ok ok
+select
+if(isnull(test_db.User),'WRONG!!!','ok') as test_db_User,
+if(isnull(test_user.User),'WRONG!!!','ok') as test_user_User,
+if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
+if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
+from test_db
+left join test_user on test_db.User=test_user.User
+left join test_tables_priv on test_db.User=test_tables_priv.User
+left join test_columns_priv on test_db.User=test_columns_priv.User;
+test_db_User test_user_User test_tables_priv_User test_columns_priv_User
+ok ok ok ok
+select
+if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
+if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
+from test_tables_priv
+left join test_columns_priv on test_tables_priv.Table_name=test_columns_priv.Table_name;
+test_tables_priv_User test_columns_priv_User
+ok ok
+drop table test_columns_priv;
+drop table test_tables_priv;
+drop table test_func;
+drop table test_host;
+drop table test_user;
+drop table test_db;
diff --git a/mysql-test/r/timezone.result b/mysql-test/r/timezone.result
index 20706408075..15f0d4121c7 100644
--- a/mysql-test/r/timezone.result
+++ b/mysql-test/r/timezone.result
@@ -32,3 +32,9 @@ ts from_unixtime(ts)
1048989599 2003-03-30 03:59:59
1048989601 2003-03-30 04:00:01
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'),
+unix_timestamp('2038-01-01 01:00:00');
+unix_timestamp('1970-01-01 01:00:00') unix_timestamp('1970-01-01 01:00:01') unix_timestamp('2038-01-01 00:59:59') unix_timestamp('2038-01-01 01:00:00')
+0 1 2145916799 0
diff --git a/mysql-test/r/true.require b/mysql-test/r/true.require
new file mode 100644
index 00000000000..09aae1ed1d0
--- /dev/null
+++ b/mysql-test/r/true.require
@@ -0,0 +1,2 @@
+TRUE
+1
diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result
index 255b7f0d942..e9861266b78 100644
--- a/mysql-test/r/type_blob.result
+++ b/mysql-test/r/type_blob.result
@@ -7,11 +7,11 @@ b text YES NULL
c blob YES NULL
d mediumtext YES NULL
e longtext YES NULL
-CREATE TABLE t2 (a char(257), b varchar(70000) binary, c varchar(70000000));
+CREATE TABLE t2 (a char(257), b varbinary(70000), c varchar(70000000));
Warnings:
-Warning 1245 Converting column 'a' from CHAR to TEXT
-Warning 1245 Converting column 'b' from CHAR to BLOB
-Warning 1245 Converting column 'c' from CHAR to TEXT
+Warning 1246 Converting column 'a' from CHAR to TEXT
+Warning 1246 Converting column 'b' from CHAR to BLOB
+Warning 1246 Converting column 'c' from CHAR to TEXT
show columns from t2;
Field Type Null Key Default Extra
a text YES NULL
@@ -57,7 +57,7 @@ select * from t1;
a
Where
drop table t1;
-create table t1 (t text,c char(10),b blob, d char(10) binary);
+create table t1 (t text,c char(10),b blob, d binary(10));
insert into t1 values (NULL,NULL,NULL,NULL);
insert into t1 values ("","","","");
insert into t1 values ("hello","hello","hello","hello");
@@ -73,14 +73,14 @@ Field Type Collation Null Key Default Extra Privileges Comment
t text latin1_swedish_ci YES NULL select,insert,update,references
c varchar(10) latin1_swedish_ci YES NULL select,insert,update,references
b blob NULL YES NULL select,insert,update,references
-d varchar(10) binary YES NULL select,insert,update,references
+d varbinary(10) NULL YES NULL select,insert,update,references
lock tables t1 WRITE;
show full fields from t1;
Field Type Collation Null Key Default Extra Privileges Comment
t text latin1_swedish_ci YES NULL select,insert,update,references
c varchar(10) latin1_swedish_ci YES NULL select,insert,update,references
b blob NULL YES NULL select,insert,update,references
-d varchar(10) binary YES NULL select,insert,update,references
+d varbinary(10) NULL YES NULL select,insert,update,references
unlock tables;
select t from t1 where t like "hello";
t
@@ -346,9 +346,17 @@ HELLO MY 1
a 1
hello 1
drop table t1;
-create table t1 (a text, key (a(300)));
-ERROR HY000: Incorrect sub part key. The used key part isn't a string, the used length is longer than the key part or the storage engine doesn't support unique sub keys
-create table t1 (a text, key (a(255)));
+create table t1 (a text, unique (a(2100)));
+ERROR 42000: Specified key was too long; max key length is 1000 bytes
+create table t1 (a text, key (a(2100)));
+Warnings:
+Warning 1071 Specified key was too long; max key length is 1000 bytes
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` text,
+ KEY `a` (`a`(1000))
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
CREATE TABLE t1 (
t1_id bigint(21) NOT NULL auto_increment,
@@ -656,3 +664,9 @@ id txt
2 Chevy
4 Ford
drop table t1;
+CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, PRIMARY KEY (i), KEY (c(1),c(1)));
+INSERT t1 VALUES (1,''),(2,''),(3,'asdfh'),(4,'');
+select max(i) from t1 where c = '';
+max(i)
+4
+drop table t1;
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index c1ee621697d..cc29c676283 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -2,11 +2,11 @@ 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 1264 Data truncated for column 't' at row 13
-Warning 1264 Data truncated for column 't' at row 14
-Warning 1264 Data truncated for column 't' at row 15
-Warning 1264 Data truncated for column 't' at row 16
-Warning 1264 Data truncated for column 't' at row 17
+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
select * from t1;
t
2000-01-01 00:00:00
diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result
index fa4cd231129..dc78369f583 100644
--- a/mysql-test/r/type_decimal.result
+++ b/mysql-test/r/type_decimal.result
@@ -158,17 +158,17 @@ 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 1263 Data truncated, out of range for column 'a' at row 1
-Warning 1263 Data truncated, out of range for column 'a' at row 2
-Warning 1263 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 1263 Data truncated, out of range for column 'a' at row 1
-Warning 1264 Data truncated for column 'a' at row 2
-Warning 1263 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 1265 Data truncated for column 'a' at row 2
+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 1264 Data truncated for column 'a' at row 3
+Warning 1265 Data truncated for column 'a' at row 3
select * from t1;
a
0.00
@@ -201,32 +201,32 @@ 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 1263 Data truncated, out of range for column 'a' at row 2
-Warning 1263 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 1263 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 1263 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 1263 Data truncated, out of range for column 'a' at row 1
-Warning 1263 Data truncated, out of range for column 'a' at row 2
-Warning 1263 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 1263 Data truncated, out of range for column 'a' at row 1
-Warning 1263 Data truncated, out of range for column 'a' at row 2
-Warning 1263 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 1263 Data truncated, out of range for column 'a' at row 1
-Warning 1264 Data truncated for column 'a' at row 2
-Warning 1263 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 1265 Data truncated for column 'a' at row 2
+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 1264 Data truncated for column 'a' at row 3
+Warning 1265 Data truncated for column 'a' at row 3
select * from t1;
a
0.00
@@ -259,32 +259,32 @@ 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 1263 Data truncated, out of range for column 'a' at row 2
-Warning 1263 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 1263 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 1263 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 1263 Data truncated, out of range for column 'a' at row 1
-Warning 1263 Data truncated, out of range for column 'a' at row 2
-Warning 1263 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 1263 Data truncated, out of range for column 'a' at row 1
-Warning 1263 Data truncated, out of range for column 'a' at row 2
-Warning 1263 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 1263 Data truncated, out of range for column 'a' at row 1
-Warning 1264 Data truncated for column 'a' at row 2
-Warning 1263 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 1265 Data truncated for column 'a' at row 2
+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 1264 Data truncated for column 'a' at row 3
+Warning 1265 Data truncated for column 'a' at row 3
select * from t1;
a
00000000.00
@@ -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 1263 Data truncated, out of range for column 'a' at row 1
-Warning 1263 Data truncated, out of range for column 'a' at row 2
-Warning 1263 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 1263 Data truncated, out of range for column 'a' at row 1
-Warning 1263 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 1263 Data truncated, out of range for column 'a' at row 1
-Warning 1263 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 1263 Data truncated, out of range for column 'a' at row 1
-Warning 1263 Data truncated, out of range for column 'a' at row 2
-Warning 1263 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 1263 Data truncated, out of range for column 'a' at row 1
-Warning 1263 Data truncated, out of range for column 'a' at row 2
-Warning 1263 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 1263 Data truncated, out of range for column 'a' at row 1
-Warning 1263 Data truncated, out of range for column 'a' at row 2
-Warning 1263 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
@@ -424,16 +424,16 @@ drop table t1;
create table t1(a decimal(10,0));
insert into t1 values ("1e4294967295");
Warnings:
-Warning 1264 Data truncated for column 'a' at row 1
-Warning 1263 Data truncated, out of range for column 'a' at row 1
+Warning 1265 Data truncated for column 'a' at row 1
+Warning 1264 Data truncated, out of range for column 'a' at row 1
select * from t1;
a
99999999999
delete from t1;
insert into t1 values("1e4294967297");
Warnings:
-Warning 1264 Data truncated for column 'a' at row 1
-Warning 1263 Data truncated, out of range for column 'a' at row 1
+Warning 1265 Data truncated for column 'a' at row 1
+Warning 1264 Data truncated, out of range for column 'a' at row 1
select * from t1;
a
99999999999
diff --git a/mysql-test/r/type_enum.result b/mysql-test/r/type_enum.result
index fe8f78453b7..976c484dabf 100644
--- a/mysql-test/r/type_enum.result
+++ b/mysql-test/r/type_enum.result
@@ -1639,13 +1639,13 @@ drop table t1;
create table t1 (a enum ('0','1'));
insert into t1 set a='foobar';
Warnings:
-Warning 1264 Data truncated for column 'a' at row 1
+Warning 1265 Data truncated for column 'a' at row 1
select * from t1;
a
update t1 set a = replace(a,'x','y');
Warnings:
-Warning 1264 Data truncated for column 'a' at row 1
+Warning 1265 Data truncated for column 'a' at row 1
select * from t1;
a
diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result
index 2a461942853..a0c0e0f5503 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 1263 Data truncated, out of range for column 'f1' at row 7
-Warning 1263 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 512df8fbaa9..8d80f342c1c 100644
--- a/mysql-test/r/type_ranges.result
+++ b/mysql-test/r/type_ranges.result
@@ -54,7 +54,7 @@ ushort smallint(5) unsigned zerofill NULL MUL 00000 select,insert,update,refer
umedium mediumint(8) unsigned NULL MUL 0 select,insert,update,references
ulong int(11) unsigned NULL MUL 0 select,insert,update,references
ulonglong bigint(13) unsigned NULL MUL 0 select,insert,update,references
-time_stamp timestamp NULL YES NULL select,insert,update,references
+time_stamp timestamp NULL YES CURRENT_TIMESTAMP select,insert,update,references
date_field date NULL YES NULL select,insert,update,references
time_field time NULL YES NULL select,insert,update,references
date_time datetime NULL YES NULL select,insert,update,references
@@ -89,34 +89,34 @@ 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 1263 Data truncated, out of range for column 'utiny' at row 1
-Warning 1263 Data truncated, out of range for column 'ushort' at row 1
-Warning 1263 Data truncated, out of range for column 'umedium' at row 1
-Warning 1263 Data truncated, out of range for column 'ulong' at row 1
-Warning 1264 Data truncated for column 'options' at row 1
-Warning 1264 Data truncated for column 'flags' 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 1264 Data truncated for column 'string' at row 1
-Warning 1263 Data truncated, out of range for column 'tiny' at row 1
-Warning 1263 Data truncated, out of range for column 'short' at row 1
-Warning 1263 Data truncated, out of range for column 'medium' at row 1
-Warning 1263 Data truncated, out of range for column 'long_int' at row 1
-Warning 1263 Data truncated, out of range for column 'utiny' at row 1
-Warning 1263 Data truncated, out of range for column 'ushort' at row 1
-Warning 1263 Data truncated, out of range for column 'umedium' at row 1
-Warning 1263 Data truncated, out of range for column 'ulong' at row 1
-Warning 1264 Data truncated for column 'options' at row 1
+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 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 1263 Data truncated, out of range for column 'tiny' at row 1
-Warning 1263 Data truncated, out of range for column 'short' at row 1
-Warning 1263 Data truncated, out of range for column 'medium' at row 1
-Warning 1263 Data truncated, out of range for column 'long_int' at row 1
-Warning 1263 Data truncated, out of range for column 'utiny' at row 1
-Warning 1263 Data truncated, out of range for column 'ushort' at row 1
-Warning 1263 Data truncated, out of range for column 'umedium' at row 1
-Warning 1264 Data truncated for column 'options' 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;
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
@@ -165,12 +165,12 @@ PRIMARY KEY (auto)
);
INSERT INTO t2 (string,mediumblob_col,new_field) SELECT string,mediumblob_col,new_field from t1 where auto > 10;
Warnings:
-Warning 1264 Data truncated for column 'new_field' at row 2
-Warning 1264 Data truncated for column 'new_field' at row 3
-Warning 1264 Data truncated for column 'new_field' at row 4
-Warning 1264 Data truncated for column 'new_field' at row 5
-Warning 1264 Data truncated for column 'new_field' at row 6
-Warning 1264 Data truncated for column 'new_field' at row 7
+Warning 1265 Data truncated for column 'new_field' at row 2
+Warning 1265 Data truncated for column 'new_field' at row 3
+Warning 1265 Data truncated for column 'new_field' at row 4
+Warning 1265 Data truncated for column 'new_field' at row 5
+Warning 1265 Data truncated for column 'new_field' at row 6
+Warning 1265 Data truncated for column 'new_field' at row 7
select * from t2;
auto string mediumblob_col new_field
1 2 2 ne
@@ -202,9 +202,9 @@ one one
drop table t2;
create table t2 select * from t1;
Warnings:
-Warning 1264 Data truncated for column 'options' at row 4
-Warning 1264 Data truncated for column 'options' at row 5
-Warning 1264 Data truncated for column 'options' at row 6
+Warning 1265 Data truncated for column 'options' at row 4
+Warning 1265 Data truncated for column 'options' at row 5
+Warning 1265 Data truncated for column 'options' at row 6
update t2 set string="changed" where auto=16;
show full columns from t1;
Field Type Collation Null Key Default Extra Privileges Comment
@@ -222,7 +222,7 @@ ushort smallint(5) unsigned zerofill NULL 00000 select,insert,update,referenc
umedium mediumint(8) unsigned NULL MUL 0 select,insert,update,references
ulong int(11) unsigned NULL MUL 0 select,insert,update,references
ulonglong bigint(13) unsigned NULL MUL 0 select,insert,update,references
-time_stamp timestamp NULL YES NULL select,insert,update,references
+time_stamp timestamp NULL YES CURRENT_TIMESTAMP select,insert,update,references
date_field varchar(10) latin1_swedish_ci YES NULL select,insert,update,references
time_field time NULL YES NULL select,insert,update,references
date_time datetime NULL YES NULL select,insert,update,references
@@ -248,7 +248,7 @@ ushort smallint(5) unsigned zerofill NULL 00000 select,insert,update,referenc
umedium mediumint(8) unsigned NULL 0 select,insert,update,references
ulong int(11) unsigned NULL 0 select,insert,update,references
ulonglong bigint(13) unsigned NULL 0 select,insert,update,references
-time_stamp timestamp NULL YES NULL select,insert,update,references
+time_stamp timestamp NULL YES 0000-00-00 00:00:00 select,insert,update,references
date_field varchar(10) latin1_swedish_ci YES NULL select,insert,update,references
time_field time NULL YES NULL select,insert,update,references
date_time datetime NULL YES NULL select,insert,update,references
diff --git a/mysql-test/r/type_time.result b/mysql-test/r/type_time.result
index 5666e865518..68b56802120 100644
--- a/mysql-test/r/type_time.result
+++ b/mysql-test/r/type_time.result
@@ -25,9 +25,11 @@ t
36:30:31
insert into t1 values("10.22.22"),(1234567),(123456789),(123456789.10),("10 22:22"),("12.45a");
Warnings:
-Warning 1263 Data truncated, out of range for column 't' at row 2
-Warning 1263 Data truncated, out of range for column 't' at row 3
-Warning 1263 Data truncated, out of range for column 't' at row 4
+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'
select * from t1;
t
10:22:33
diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result
index 172ccc440f4..976b3e72385 100644
--- a/mysql-test/r/type_timestamp.result
+++ b/mysql-test/r/type_timestamp.result
@@ -45,11 +45,11 @@ 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 1264 Data truncated for column 'ix' at row 10
-Warning 1264 Data truncated for column 'ix' at row 11
-Warning 1264 Data truncated for column 'ix' at row 12
-Warning 1264 Data truncated for column 'ix' at row 13
-Warning 1264 Data truncated for column 'ix' at row 14
+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
select ix+0 from t1;
ix+0
19991101000000
@@ -128,5 +128,206 @@ 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 (a timestamp default 1);
-ERROR 42000: Invalid default value for 'a'
+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
+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
+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
+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
+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
+create table t1 (t1 timestamp default '2003-01-01 00:00:00', t2 datetime, t3 timestamp);
+SET TIMESTAMP=1000000000;
+insert into t1 values ();
+SET TIMESTAMP=1000000001;
+update t1 set t2=now();
+SET TIMESTAMP=1000000002;
+insert into t1 (t1,t3) values (default, default);
+select * from t1;
+t1 t2 t3
+2003-01-01 00:00:00 2001-09-09 04:46:41 0000-00-00 00:00:00
+2003-01-01 00:00:00 NULL 0000-00-00 00:00:00
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `t1` timestamp NOT NULL default '2003-01-01 00:00:00',
+ `t2` datetime default NULL,
+ `t3` timestamp NOT NULL default '0000-00-00 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show columns from t1;
+Field Type Null Key Default Extra
+t1 timestamp YES 2003-01-01 00:00:00
+t2 datetime YES NULL
+t3 timestamp YES 0000-00-00 00:00:00
+drop table t1;
+create table t1 (t1 timestamp default now(), t2 datetime, t3 timestamp);
+SET TIMESTAMP=1000000002;
+insert into t1 values ();
+SET TIMESTAMP=1000000003;
+update t1 set t2=now();
+SET TIMESTAMP=1000000003;
+insert into t1 (t1,t3) values (default, default);
+select * from t1;
+t1 t2 t3
+2001-09-09 04:46:42 2001-09-09 04:46:43 0000-00-00 00:00:00
+2001-09-09 04:46:43 NULL 0000-00-00 00:00:00
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `t1` timestamp NOT NULL default CURRENT_TIMESTAMP,
+ `t2` datetime default NULL,
+ `t3` timestamp NOT NULL default '0000-00-00 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show columns from t1;
+Field Type Null Key Default Extra
+t1 timestamp YES CURRENT_TIMESTAMP
+t2 datetime YES NULL
+t3 timestamp YES 0000-00-00 00:00:00
+drop table t1;
+create table t1 (t1 timestamp default '2003-01-01 00:00:00' on update now(), t2 datetime);
+SET TIMESTAMP=1000000004;
+insert into t1 values ();
+select * from t1;
+t1 t2
+2003-01-01 00:00:00 NULL
+SET TIMESTAMP=1000000005;
+update t1 set t2=now();
+SET TIMESTAMP=1000000005;
+insert into t1 (t1) values (default);
+select * from t1;
+t1 t2
+2001-09-09 04:46:45 2001-09-09 04:46:45
+2003-01-01 00:00:00 NULL
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `t1` timestamp NOT NULL default '2003-01-01 00:00:00' on update CURRENT_TIMESTAMP,
+ `t2` datetime default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show columns from t1;
+Field Type Null Key Default Extra
+t1 timestamp YES 2003-01-01 00:00:00
+t2 datetime YES NULL
+drop table t1;
+create table t1 (t1 timestamp default now() on update now(), t2 datetime);
+SET TIMESTAMP=1000000006;
+insert into t1 values ();
+select * from t1;
+t1 t2
+2001-09-09 04:46:46 NULL
+SET TIMESTAMP=1000000007;
+update t1 set t2=now();
+SET TIMESTAMP=1000000007;
+insert into t1 (t1) values (default);
+select * from t1;
+t1 t2
+2001-09-09 04:46:47 2001-09-09 04:46:47
+2001-09-09 04:46:47 NULL
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `t1` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `t2` datetime default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show columns from t1;
+Field Type Null Key Default Extra
+t1 timestamp YES CURRENT_TIMESTAMP
+t2 datetime YES NULL
+drop table t1;
+create table t1 (t1 timestamp, t2 datetime, t3 timestamp);
+SET TIMESTAMP=1000000007;
+insert into t1 values ();
+select * from t1;
+t1 t2 t3
+2001-09-09 04:46:47 NULL 0000-00-00 00:00:00
+SET TIMESTAMP=1000000008;
+update t1 set t2=now();
+SET TIMESTAMP=1000000008;
+insert into t1 (t1,t3) values (default, default);
+select * from t1;
+t1 t2 t3
+2001-09-09 04:46:48 2001-09-09 04:46:48 0000-00-00 00:00:00
+2001-09-09 04:46:48 NULL 0000-00-00 00:00:00
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `t1` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `t2` datetime default NULL,
+ `t3` timestamp NOT NULL default '0000-00-00 00:00:00'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show columns from t1;
+Field Type Null Key Default Extra
+t1 timestamp YES CURRENT_TIMESTAMP
+t2 datetime YES NULL
+t3 timestamp YES 0000-00-00 00:00:00
+drop table t1;
+create table t1 (t1 timestamp default current_timestamp on update current_timestamp, t2 datetime);
+SET TIMESTAMP=1000000009;
+insert into t1 values ();
+select * from t1;
+t1 t2
+2001-09-09 04:46:49 NULL
+SET TIMESTAMP=1000000010;
+update t1 set t2=now();
+SET TIMESTAMP=1000000011;
+insert into t1 (t1) values (default);
+select * from t1;
+t1 t2
+2001-09-09 04:46:50 2001-09-09 04:46:50
+2001-09-09 04:46:51 NULL
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `t1` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+ `t2` datetime default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+show columns from t1;
+Field Type Null Key Default Extra
+t1 timestamp YES CURRENT_TIMESTAMP
+t2 datetime YES NULL
+delete from t1;
+insert into t1 values ('2004-04-01 00:00:00', '2004-04-01 00:00:00');
+SET TIMESTAMP=1000000012;
+update t1 set t1= '2004-04-02 00:00:00';
+select * from t1;
+t1 t2
+2004-04-02 00:00:00 2004-04-01 00:00:00
+update t1 as ta, t1 as tb set tb.t1= '2004-04-03 00:00:00';
+select * from t1;
+t1 t2
+2004-04-03 00:00:00 2004-04-01 00:00:00
+drop table t1;
+create table t1 (pk int primary key, t1 timestamp default current_timestamp on update current_timestamp, bulk int);
+insert into t1 values (1, '2004-04-01 00:00:00', 10);
+SET TIMESTAMP=1000000013;
+replace into t1 set pk = 1, bulk= 20;
+select * from t1;
+pk t1 bulk
+1 2001-09-09 04:46:53 20
+drop table t1;
+create table t1 (pk int primary key, t1 timestamp default '2003-01-01 00:00:00' on update current_timestamp, bulk int);
+insert into t1 values (1, '2004-04-01 00:00:00', 10);
+SET TIMESTAMP=1000000014;
+replace into t1 set pk = 1, bulk= 20;
+select * from t1;
+pk t1 bulk
+1 2003-01-01 00:00:00 20
+drop table t1;
+create table t1 (pk int primary key, t1 timestamp default current_timestamp, bulk int);
+insert into t1 values (1, '2004-04-01 00:00:00', 10);
+SET TIMESTAMP=1000000015;
+replace into t1 set pk = 1, bulk= 20;
+select * from t1;
+pk t1 bulk
+1 2001-09-09 04:46:55 20
+drop table t1;
+create table t1 (t1 timestamp default current_timestamp on update current_timestamp);
+insert into t1 values ('2004-04-01 00:00:00');
+SET TIMESTAMP=1000000016;
+alter table t1 add i int default 10;
+select * from t1;
+t1 i
+2004-04-01 00:00:00 10
+drop table t1;
diff --git a/mysql-test/r/type_uint.result b/mysql-test/r/type_uint.result
index d948ca47972..f312e9b7f64 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 1263 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/type_year.result b/mysql-test/r/type_year.result
index 25ddda88f48..84b688429db 100644
--- a/mysql-test/r/type_year.result
+++ b/mysql-test/r/type_year.result
@@ -26,3 +26,11 @@ y y2
2001 01
2069 69
drop table t1;
+create table t1 (y year);
+insert into t1 values (now());
+Warnings:
+Warning 1265 Data truncated for column 'y' at row 1
+select if(y = now(), 1, 0) from t1;
+if(y = now(), 1, 0)
+1
+drop table t1;
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index 4775dd5b9bb..7c02edb9c78 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -36,8 +36,6 @@ a b
1 a
2 b
3 c
-3 c
-3 c
4 d
5 f
6 e
@@ -48,8 +46,6 @@ select 0,'#' union select a,b from t1 union all select a,b from t2 union select
1 a
2 b
3 c
-3 c
-3 c
4 d
5 f
6 e
@@ -350,7 +346,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
+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
@@ -438,6 +434,8 @@ 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;
ERROR HY000: You can't specify target table 't1' for update in FROM clause
+select a from t1 union select a from t2 order by t2.a;
+ERROR 42S02: Unknown table 't2' in order clause
drop table t1,t2;
select length(version()) > 1 as `*` UNION select 2;
*
@@ -651,7 +649,7 @@ f
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `f` char(12) binary default NULL
+ `f` binary(12) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 SELECT y from t2 UNION select da from t2;
@@ -662,7 +660,7 @@ y
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `y` char(10) binary default NULL
+ `y` binary(10) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 SELECT y from t2 UNION select dt from t2;
@@ -673,7 +671,7 @@ y
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `y` char(19) binary default NULL
+ `y` binary(19) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 SELECT da from t2 UNION select dt from t2;
@@ -695,7 +693,7 @@ testc
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `dt` char(19) default NULL
+ `dt` binary(19) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 SELECT dt from t2 UNION select sv from t2;
@@ -706,7 +704,7 @@ testv
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `dt` char(19) default NULL
+ `dt` binary(19) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 SELECT sc from t2 UNION select sv from t2;
@@ -728,7 +726,7 @@ tetetetetest
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
- `dt` longblob
+ `dt` blob
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
create table t1 SELECT sv from t2 UNION select b from t2;
@@ -856,7 +854,7 @@ Variable_name Value
Slow_queries 1
select count(*) from t1 where b=13 union select count(*) from t1 where a=7;
count(*)
-0
+10
26
show status like 'Slow_queries';
Variable_name Value
@@ -869,3 +867,60 @@ show status like 'Slow_queries';
Variable_name Value
Slow_queries 3
drop table t1;
+create table t1 ( RID int(11) not null default '0', IID int(11) not null default '0', nada varchar(50) not null,NAME varchar(50) not null,PHONE varchar(50) not null) engine=MyISAM;
+insert into t1 ( RID,IID,nada,NAME,PHONE) values (1, 1, 'main', 'a', '111'), (2, 1, 'main', 'b', '222'), (3, 1, 'main', 'c', '333'), (4, 1, 'main', 'd', '444'), (5, 1, 'main', 'e', '555'), (6, 2, 'main', 'c', '333'), (7, 2, 'main', 'd', '454'), (8, 2, 'main', 'e', '555'), (9, 2, 'main', 'f', '666'), (10, 2, 'main', 'g', '777');
+select A.NAME, A.PHONE, B.NAME, B.PHONE from t1 A left join t1 B on A.NAME = B.NAME and B.IID = 2 where A.IID = 1 and (A.PHONE <> B.PHONE or B.NAME is null) union select A.NAME, A.PHONE, B.NAME, B.PHONE from t1 B left join t1 A on B.NAME = A.NAME and A.IID = 1 where B.IID = 2 and (A.PHONE <> B.PHONE or A.NAME is null);
+NAME PHONE NAME PHONE
+a 111 NULL NULL
+b 222 NULL NULL
+d 444 d 454
+NULL NULL f 666
+NULL NULL g 777
+drop table t1;
+create table t1 (col1 tinyint unsigned, col2 tinyint unsigned);
+insert into t1 values (1,2),(3,4),(5,6),(7,8),(9,10);
+select col1 n from t1 union select col2 n from t1 order by n;
+n
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+alter table t1 add index myindex (col2);
+select col1 n from t1 union select col2 n from t1 order by n;
+n
+1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+drop table t1;
+create table t1 (i int);
+insert into t1 values (1);
+select * from t1 UNION select * from t1;
+i
+1
+select * from t1 UNION ALL select * from t1;
+i
+1
+1
+select * from t1 UNION select * from t1 UNION ALL select * from t1;
+i
+1
+1
+drop table t1;
+select 1 as a union all select 1 union all select 2 union select 1 union all select 2;
+a
+1
+2
+2
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index 5394c3e1e45..963dd97d336 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -115,7 +115,7 @@ explain extended select @@IDENTITY,last_insert_id(), @@identity;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
-Note 1003 select high_priority no_cache 345 AS `@@IDENTITY`,345 AS `last_insert_id()`,345 AS `@@identity`
+Note 1003 select high_priority no_cache 345 AS `@@IDENTITY`,last_insert_id() AS `last_insert_id()`,345 AS `@@identity`
set big_tables=OFF, big_tables=ON, big_tables=0, big_tables=1, big_tables="OFF", big_tables="ON";
set global concurrent_insert=ON;
show variables like 'concurrent_insert';
@@ -255,18 +255,22 @@ set character_set_client=UNKNOWN_CHARACTER_SET;
ERROR 42000: Unknown character set: 'UNKNOWN_CHARACTER_SET'
set collation_connection=UNKNOWN_COLLATION;
ERROR HY000: Unknown collation: 'UNKNOWN_COLLATION'
+set character_set_client=NULL;
+ERROR 42000: Variable 'character_set_client' can't be set to the value of 'NULL'
+set collation_connection=NULL;
+ERROR 42000: Variable 'collation_connection' can't be set to the value of 'NULL'
set global autocommit=1;
-ERROR HY000: Variable 'autocommit' is a LOCAL variable and can't be used with SET GLOBAL
+ERROR HY000: Variable 'autocommit' is a SESSION variable and can't be used with SET GLOBAL
select @@global.timestamp;
-ERROR HY000: Variable 'timestamp' is a LOCAL variable and can't be used with SET GLOBAL
+ERROR HY000: Variable 'timestamp' is a SESSION variable
set @@version='';
ERROR HY000: Unknown system variable 'version'
set @@concurrent_insert=1;
ERROR HY000: Variable 'concurrent_insert' is a GLOBAL variable and should be set with SET GLOBAL
set @@global.sql_auto_is_null=1;
-ERROR HY000: Variable 'sql_auto_is_null' is a LOCAL variable and can't be used with SET GLOBAL
+ERROR HY000: Variable 'sql_auto_is_null' is a SESSION variable and can't be used with SET GLOBAL
select @@global.sql_auto_is_null;
-ERROR HY000: Variable 'sql_auto_is_null' is a LOCAL variable and can't be used with SET GLOBAL
+ERROR HY000: Variable 'sql_auto_is_null' is a SESSION variable
set myisam_max_sort_file_size=100;
ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL
set myisam_max_extra_sort_file_size=100;
@@ -404,6 +408,19 @@ ERROR HY000: Unknown system variable 'xxxxxxxxxx'
select 1;
1
1
+select @@session.key_buffer_size;
+ERROR HY000: Variable 'key_buffer_size' is a GLOBAL variable
+set ft_boolean_syntax = @@init_connect;
+ERROR HY000: Variable 'ft_boolean_syntax' is a GLOBAL variable and should be set with SET GLOBAL
+set global ft_boolean_syntax = @@init_connect;
+ERROR 42000: Variable 'ft_boolean_syntax' can't be set to the value of ''
+set init_connect = NULL;
+ERROR HY000: Variable 'init_connect' is a GLOBAL variable and should be set with SET GLOBAL
+set global init_connect = NULL;
+set ft_boolean_syntax = @@init_connect;
+ERROR HY000: Variable 'ft_boolean_syntax' is a GLOBAL variable and should be set with SET GLOBAL
+set global ft_boolean_syntax = @@init_connect;
+ERROR 42000: Variable 'ft_boolean_syntax' can't be set to the value of ''
select @@global.max_user_connections,@@local.max_join_size;
@@global.max_user_connections @@session.max_join_size
100 200
@@ -428,3 +445,13 @@ set @a=@b, @b=@a;
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
+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
+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
+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
+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
diff --git a/mysql-test/r/warnings.result b/mysql-test/r/warnings.result
index b675d189d30..19d44ab6fea 100644
--- a/mysql-test/r/warnings.result
+++ b/mysql-test/r/warnings.result
@@ -4,19 +4,19 @@ create table t1 (a int);
insert into t1 values (1);
insert into t1 values ("hej");
Warnings:
-Warning 1264 Data truncated for column 'a' at row 1
+Warning 1265 Data truncated for column 'a' at row 1
insert into t1 values ("hej"),("då");
Warnings:
-Warning 1264 Data truncated for column 'a' at row 1
-Warning 1264 Data truncated for column 'a' at row 2
+Warning 1265 Data truncated for column 'a' at row 1
+Warning 1265 Data truncated for column 'a' at row 2
set SQL_WARNINGS=1;
insert into t1 values ("hej");
Warnings:
-Warning 1264 Data truncated for column 'a' at row 1
+Warning 1265 Data truncated for column 'a' at row 1
insert into t1 values ("hej"),("då");
Warnings:
-Warning 1264 Data truncated for column 'a' at row 1
-Warning 1264 Data truncated for column 'a' at row 2
+Warning 1265 Data truncated for column 'a' at row 1
+Warning 1265 Data truncated for column 'a' at row 2
drop table t1;
set SQL_WARNINGS=0;
drop temporary table if exists not_exists;
@@ -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 1262 Data truncated, NULL supplied to NOT NULL column 'b' at row 2
-Warning 1264 Data truncated for column 'd' at row 3
-Warning 1264 Data truncated for column 'c' at row 4
-Warning 1260 Row 5 doesn't contain data for all columns
-Warning 1264 Data truncated for column 'b' at row 6
-Warning 1261 Row 7 was truncated; It contained more data than there where input columns
-Warning 1263 Data truncated, out of range for column 'a' at row 8
+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
select @@warning_count;
@@warning_count
7
@@ -57,44 +57,44 @@ 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 1262 Data truncated, NULL supplied to NOT NULL column 'a' at row 1
-Warning 1263 Data truncated, out of range for column 'b' at row 2
-Warning 1264 Data truncated for column 'c' at row 2
-Warning 1263 Data truncated, out of range for column 'a' at row 3
-Warning 1263 Data truncated, out of range for column 'b' at row 3
-Warning 1264 Data truncated for column 'c' at row 3
+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 1265 Data truncated for column 'c' at row 3
alter table t1 modify c char(4);
Warnings:
-Warning 1264 Data truncated for column 'c' at row 1
-Warning 1264 Data truncated for column 'c' at row 2
+Warning 1265 Data truncated for column 'c' at row 1
+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 1262 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 1264 Data truncated for column 'c' at row 4
+Warning 1265 Data truncated for column 'c' at row 4
update t1 set d=c;
Warnings:
-Warning 1264 Data truncated for column 'd' at row 1
-Warning 1264 Data truncated for column 'd' at row 2
-Warning 1264 Data truncated for column 'd' at row 3
-Warning 1264 Data truncated for column 'd' at row 4
+Warning 1265 Data truncated for column 'd' at row 1
+Warning 1265 Data truncated for column 'd' at row 2
+Warning 1265 Data truncated for column 'd' at row 3
+Warning 1265 Data truncated for column 'd' at row 4
create table t2(a tinyint NOT NULL, b char(3));
insert into t2 select b,c from t1;
Warnings:
-Warning 1264 Data truncated for column 'b' at row 1
-Warning 1264 Data truncated for column 'b' at row 2
-Warning 1264 Data truncated for column 'b' at row 3
-Warning 1262 Data truncated, NULL supplied to NOT NULL column 'a' at row 4
-Warning 1264 Data truncated for column 'b' at row 4
+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 1265 Data truncated for column 'b' at row 4
insert into t2(b) values('mysqlab');
Warnings:
-Warning 1264 Data truncated for column 'b' at row 1
+Warning 1265 Data truncated for column 'b' at row 1
set sql_warnings=1;
insert into t2(b) values('mysqlab');
Warnings:
-Warning 1264 Data truncated for column 'b' at row 1
+Warning 1265 Data truncated for column 'b' at row 1
set sql_warnings=0;
drop table t1, t2;
create table t1(a char(10));
@@ -102,34 +102,34 @@ alter table t1 add b char;
set max_error_count=10;
update t1 set b=a;
Warnings:
-Warning 1264 Data truncated for column 'b' at row 1
-Warning 1264 Data truncated for column 'b' at row 2
-Warning 1264 Data truncated for column 'b' at row 3
-Warning 1264 Data truncated for column 'b' at row 4
-Warning 1264 Data truncated for column 'b' at row 5
-Warning 1264 Data truncated for column 'b' at row 6
-Warning 1264 Data truncated for column 'b' at row 7
-Warning 1264 Data truncated for column 'b' at row 8
-Warning 1264 Data truncated for column 'b' at row 9
-Warning 1264 Data truncated for column 'b' at row 10
+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 1265 Data truncated for column 'b' at row 4
+Warning 1265 Data truncated for column 'b' at row 5
+Warning 1265 Data truncated for column 'b' at row 6
+Warning 1265 Data truncated for column 'b' at row 7
+Warning 1265 Data truncated for column 'b' at row 8
+Warning 1265 Data truncated for column 'b' at row 9
+Warning 1265 Data truncated for column 'b' at row 10
select @@warning_count;
@@warning_count
50
drop table t1;
create table t1 (id int) engine=isam;
Warnings:
-Warning 1265 Using storage engine MyISAM for table 't1'
+Warning 1266 Using storage engine MyISAM for table 't1'
alter table t1 engine=isam;
Warnings:
-Warning 1265 Using storage engine MyISAM for table 't1'
+Warning 1266 Using storage engine MyISAM for table 't1'
drop table t1;
create table t1 (id int) type=heap;
Warnings:
-Warning 1286 '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 1286 '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 1286 'table_type' is deprecated. Use 'storage_engine' instead.
+Warning 1287 'table_type' is deprecated, use 'storage_engine' instead
diff --git a/mysql-test/std_data/init_file.dat b/mysql-test/std_data/init_file.dat
new file mode 100644
index 00000000000..4236ada1142
--- /dev/null
+++ b/mysql-test/std_data/init_file.dat
@@ -0,0 +1 @@
+select * from mysql.user as t1, mysql.user as t2, mysql.user as t3, mysql.user as t4, mysql.user as t5, mysql.user as t6, mysql.user as t7, mysql.user as t8; \ No newline at end of file
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index c013b2251a9..32654bb0bc4 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -3,6 +3,7 @@
#
--disable_warnings
drop table if exists t1,t2;
+drop database if exists mysqltest;
--enable_warnings
create table t1 (
@@ -79,6 +80,53 @@ OPTIMIZE TABLE t1;
DROP TABLE t1;
#
+# Drop and add an auto_increment column
+#
+
+create table t1 (i int unsigned not null auto_increment primary key);
+insert into t1 values (null),(null),(null),(null);
+alter table t1 drop i,add i int unsigned not null auto_increment, drop primary key, add primary key (i);
+select * from t1;
+drop table t1;
+
+#
+# Bug #2628: 'alter table t1 rename mysqltest.t1' silently drops mysqltest.t1
+# if it exists
+#
+create table t1 (name char(15));
+insert into t1 (name) values ("current");
+create database mysqltest;
+create table mysqltest.t1 (name char(15));
+insert into mysqltest.t1 (name) values ("mysqltest");
+select * from t1;
+select * from mysqltest.t1;
+--error 1050
+alter table t1 rename mysqltest.t1;
+select * from t1;
+select * from mysqltest.t1;
+drop table t1;
+drop database mysqltest;
+
+#
+# Rights for renaming test (Bug #3270)
+#
+connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock);
+connection root;
+--disable_warnings
+create database mysqltest;
+--enable_warnings
+create table mysqltest.t1 (a int,b int,c int);
+grant all on mysqltest.t1 to mysqltest_1@localhost;
+connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,master.sock);
+connection user1;
+-- error 1142
+alter table t1 rename t2;
+connection root;
+revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
+delete from mysql.user where user='mysqltest_1';
+drop database mysqltest;
+
+#
# ALTER TABLE ... ENABLE/DISABLE KEYS
create table t1 (n1 int not null, n2 int, n3 int, n4 float,
@@ -101,16 +149,6 @@ show keys from t1;
drop table t1;
#
-# Drop and add an auto_increment column
-#
-
-create table t1 (i int unsigned not null auto_increment primary key);
-insert into t1 values (null),(null),(null),(null);
-alter table t1 drop i,add i int unsigned not null auto_increment, drop primary key, add primary key (i);
-select * from t1;
-drop table t1;
-
-#
# Alter table and rename
#
@@ -155,7 +193,7 @@ insert into t1 values ('ÔÅÓÔ');
select a,hex(a) from t1;
alter table t1 change a a char(10) character set cp1251;
select a,hex(a) from t1;
-alter table t1 change a a char(10) binary;
+alter table t1 change a a binary(10);
select a,hex(a) from t1;
alter table t1 change a a char(10) character set cp1251;
select a,hex(a) from t1;
@@ -176,7 +214,7 @@ select a,hex(a) from t1;
show create table t1;
alter table t1 DEFAULT CHARACTER SET latin1;
show create table t1;
-alter table t1 CHARACTER SET latin1;
+alter table t1 CONVERT TO CHARACTER SET latin1;
show create table t1;
alter table t1 DEFAULT CHARACTER SET cp1251;
show create table t1;
@@ -184,6 +222,17 @@ show create table t1;
drop table t1;
#
+# Bug#2821
+# Test that table CHARACTER SET does not affect blobs
+#
+create table t1 (myblob longblob,mytext longtext)
+default charset latin1 collate latin1_general_cs;
+show create table t1;
+alter table t1 character set latin2;
+show create table t1;
+drop table t1;
+
+#
# Test ALTER TABLE ENABLE/DISABLE keys when things are locked
#
@@ -246,7 +295,7 @@ SHOW INDEX FROM t1;
DROP TABLE t1;
#
-# Bug 2361
+# Bug 2361 (Don't drop UNIQUE with DROP PRIMARY KEY)
#
CREATE TABLE t1 (a int PRIMARY KEY, b INT UNIQUE);
diff --git a/mysql-test/t/bdb-crash.test b/mysql-test/t/bdb-crash.test
index fffed379e79..3cd78821000 100644
--- a/mysql-test/t/bdb-crash.test
+++ b/mysql-test/t/bdb-crash.test
@@ -36,3 +36,14 @@ INSERT INTO t1
VALUES(NULL,1,'2001-03-01',1,1,1,'New',NULL,NULL,'now');
select * from t1;
drop table t1;
+
+#
+# Test for bug #2342 "Running ANALYZE TABLE on bdb table
+# inside a transaction hangs server thread"
+
+create table t1 (a int) engine=bdb;
+
+set autocommit=0;
+insert into t1 values(1);
+analyze table t1;
+drop table t1;
diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test
index 12b81f27147..6823dd23b73 100644
--- a/mysql-test/t/bdb.test
+++ b/mysql-test/t/bdb.test
@@ -808,3 +808,17 @@ insert into t2 select * from t1;
delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
drop table t1,t2;
+
+#
+# Test index only read (Bug #2509)
+#
+create table t1 (a char(10), key(a), b int not null, key(b)) engine=bdb;
+insert into t1 values ('a',1),('A',2);
+explain select a from t1;
+select a from t1;
+explain select b from t1;
+select b from t1;
+alter table t1 modify a char(10) binary;
+explain select a from t1;
+select a from t1;
+drop table t1;
diff --git a/mysql-test/t/bigint.test b/mysql-test/t/bigint.test
index 5c977983087..c509a4113f4 100644
--- a/mysql-test/t/bigint.test
+++ b/mysql-test/t/bigint.test
@@ -68,3 +68,6 @@ insert into t1 values ('10000000000000000000');
select * from t1;
drop table t1;
+# atof() behaviour is different of different systems. to be fixed in 4.1
+SELECT '0x8000000000000001'+0;
+
diff --git a/mysql-test/t/binary.test b/mysql-test/t/binary.test
index 48912a390ed..20a047e0b26 100644
--- a/mysql-test/t/binary.test
+++ b/mysql-test/t/binary.test
@@ -51,3 +51,18 @@ select b from t1 where binary b like '';
select b from t1 group by binary b like '';
select b from t1 having binary b like '';
drop table t1;
+
+#
+# Test of binary and upper/lower
+#
+create table t1 (a char(15) binary, b binary(15));
+insert into t1 values ('aaa','bbb'),('AAA','BBB');
+select upper(a),upper(b) from t1;
+select lower(a),lower(b) from t1;
+select * from t1 where upper(a)='AAA';
+select * from t1 where lower(a)='aaa';
+select * from t1 where upper(b)='BBB';
+select * from t1 where lower(b)='bbb';
+select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1;
+select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1;
+drop table t1;
diff --git a/mysql-test/t/case.test b/mysql-test/t/case.test
index 9377c6c4aef..87e456baba7 100644
--- a/mysql-test/t/case.test
+++ b/mysql-test/t/case.test
@@ -63,14 +63,14 @@ CREATE TABLE t1 SELECT
SHOW CREATE TABLE t1;
DROP TABLE t1;
---error 1266
+--error 1267
SELECT CASE
WHEN 1
THEN _latin1'a' COLLATE latin1_danish_ci
ELSE _latin1'a' COLLATE latin1_swedish_ci
END;
---error 1269
+--error 1270
SELECT CASE _latin1'a' COLLATE latin1_general_ci
WHEN _latin1'a' COLLATE latin1_danish_ci THEN 1
WHEN _latin1'a' COLLATE latin1_swedish_ci THEN 2
@@ -93,9 +93,9 @@ CASE _latin1'a' WHEN _latin1'A' COLLATE latin1_bin THEN '1' ELSE 2 END
#
# Check COALESCE argument types aggregation
---error 1266
+--error 1267
CREATE TABLE t1 SELECT COALESCE(_latin1'a',_latin2'a');
---error 1266
+--error 1267
CREATE TABLE t1 SELECT COALESCE('a' COLLATE latin1_swedish_ci,'b' COLLATE latin1_bin);
CREATE TABLE t1 SELECT
COALESCE(1), COALESCE(1.0),COALESCE('a'),
diff --git a/mysql-test/t/cast.test b/mysql-test/t/cast.test
index fab35bb334a..e2deb792d47 100644
--- a/mysql-test/t/cast.test
+++ b/mysql-test/t/cast.test
@@ -19,8 +19,8 @@ select CONVERT("2004-01-22 21:45:33",DATE);
select CONVERT(DATE "2004-01-22 21:45:33" USING latin1);
select CONVERT(DATE "2004-01-22 21:45:33",CHAR);
select CONVERT(DATE "2004-01-22 21:45:33",CHAR(4));
-select CONVERT(DATE "2004-01-22 21:45:33",CHAR(4) BINARY);
-select CAST(DATE "2004-01-22 21:45:33" AS CHAR(4) BINARY);
+select CONVERT(DATE "2004-01-22 21:45:33",BINARY(4));
+select CAST(DATE "2004-01-22 21:45:33" AS BINARY(4));
#
# Character set convertion
diff --git a/mysql-test/t/compare.test b/mysql-test/t/compare.test
index e5a2e310866..b0cef48dd3f 100644
--- a/mysql-test/t/compare.test
+++ b/mysql-test/t/compare.test
@@ -13,3 +13,20 @@ select * from t1 where id=000000000001;
delete from t1 where id=000000000002;
select * from t1;
drop table t1;
+
+#
+# Check the following:
+# "a" == "a "
+# "a\0" < "a"
+# "a\0" < "a "
+
+SELECT 'a' = 'a ';
+SELECT 'a\0' < 'a';
+SELECT 'a\0' < 'a ';
+SELECT 'a\t' < 'a';
+SELECT 'a\t' < 'a ';
+
+CREATE TABLE t1 (a char(10) not null);
+INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a ');
+SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 64134fe9990..4bd92994530 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -49,6 +49,16 @@ create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
create table a (`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` int);
#
+# Some wrong defaults, so these creates should fail too
+#
+--error 1067
+create table test (a datetime default now());
+--error 1294
+create table test (a datetime on update now());
+--error 1067
+create table test (a int default 100 auto_increment);
+
+#
# test of dummy table names
#
@@ -74,7 +84,7 @@ create table `` (a int);
drop table if exists ``;
--error 1166
create table t1 (`` int);
---error 1279
+--error 1280
create table t1 (i int, index `` (i));
#
@@ -157,7 +167,7 @@ SELECT @@storage_engine;
CREATE TABLE t1 (a int not null);
show create table t1;
drop table t1;
---error 1285
+--error 1286
SET SESSION storage_engine="gemini";
SELECT @@storage_engine;
CREATE TABLE t1 (a int not null);
@@ -220,6 +230,18 @@ select * from t1;
drop table t1;
#
+# Test for Bug #2985
+# "Table truncated when creating another table name with Spaces"
+#
+
+--error 1103
+create table `t1 `(a int);
+--error 1102
+create database `db1 `;
+--error 1166;
+create table t1(`a ` int);
+
+#
# Test create with foreign keys
#
@@ -277,7 +299,7 @@ SELECT @@storage_engine;
CREATE TABLE t1 (a int not null);
show create table t1;
drop table t1;
---error 1285
+--error 1286
SET SESSION storage_engine="gemini";
SELECT @@storage_engine;
CREATE TABLE t1 (a int not null);
@@ -347,6 +369,15 @@ describe t2;
drop table t1, t2;
#
+# test for bug #1427 "enum allows duplicate values in the list"
+#
+
+create table t1(cenum enum('a'), cset set('b'));
+create table t2(cenum enum('a','a'), cset set('b','b'));
+create table t3(cenum enum('a','A','a','c','c'), cset set('b','B','b','d','d'));
+drop table t1, t2, t3;
+
+#
# Bug #1209
#
@@ -359,3 +390,47 @@ select database();
# Connect without a database
connect (user4,localhost,mysqltest_1,,*NO-ONE*);
select database();
+
+#
+# Test for Bug 856 'Naming a key "Primary" causes trouble'
+#
+
+use test;
+--error 1280
+create table t1 (a int, index `primary` (a));
+--error 1280
+create table t1 (a int, index `PRIMARY` (a));
+
+create table t1 (`primary` int, index(`primary`));
+show create table t1;
+create table t2 (`PRIMARY` int, index(`PRIMARY`));
+show create table t2;
+
+create table t3 (a int);
+--error 1280
+alter table t3 add index `primary` (a);
+--error 1280
+alter table t3 add index `PRIMARY` (a);
+
+create table t4 (`primary` int);
+alter table t4 add index(`primary`);
+show create table t4;
+create table t5 (`PRIMARY` int);
+alter table t5 add index(`PRIMARY`);
+show create table t5;
+
+drop table t1, t2, t3, t4, t5;
+
+#
+# bug #3266 TEXT in CREATE TABLE SELECT
+#
+
+CREATE TABLE t1(id varchar(10) NOT NULL PRIMARY KEY, dsc longtext);
+INSERT INTO t1 VALUES ('5000000001', NULL),('5000000003', 'Test'),('5000000004', NULL);
+CREATE TABLE t2(id varchar(15) NOT NULL, proc varchar(100) NOT NULL, runID varchar(16) NOT NULL, start datetime NOT NULL, PRIMARY KEY (id,proc,runID,start));
+
+INSERT INTO t2 VALUES ('5000000001', 'proc01', '20031029090650', '2003-10-29 13:38:40'),('5000000001', 'proc02', '20031029090650', '2003-10-29 13:38:51'),('5000000001', 'proc03', '20031029090650', '2003-10-29 13:38:11'),('5000000002', 'proc09', '20031024013310', '2003-10-24 01:33:11'),('5000000002', 'proc09', '20031024153537', '2003-10-24 15:36:04'),('5000000004', 'proc01', '20031024013641', '2003-10-24 01:37:29'),('5000000004', 'proc02', '20031024013641', '2003-10-24 01:37:39');
+
+CREATE TABLE t3 SELECT t1.dsc,COUNT(DISTINCT t2.id) AS countOfRuns FROM t1 LEFT JOIN t2 ON (t1.id=t2.id) GROUP BY t1.id;
+SELECT * FROM t3;
+drop table t1, t2, t3;
diff --git a/mysql-test/t/ctype_collate.test b/mysql-test/t/ctype_collate.test
index 5916e3da241..3599beeacc4 100644
--- a/mysql-test/t/ctype_collate.test
+++ b/mysql-test/t/ctype_collate.test
@@ -7,12 +7,12 @@ CREATE TABLE t1 (
latin1_f CHAR(32) CHARACTER SET latin1 NOT NULL
);
---error 1252
+--error 1253
CREATE TABLE t2 (
latin1_f CHAR(32) CHARACTER SET latin1 COLLATE koi8r_general_ci NOT NULL
);
---error 1272
+--error 1273
CREATE TABLE t2 (
latin1_f CHAR(32) CHARACTER SET latin1 COLLATE some_non_existing_col NOT NULL
);
@@ -66,7 +66,7 @@ SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_swedish_ci;
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_german2_ci;
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_general_ci;
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_bin;
---error 1252
+--error 1253
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r_general_ci;
--SELECT latin1_f COLLATE koi8r FROM t1 ;
@@ -76,7 +76,7 @@ SELECT latin1_f COLLATE latin1_swedish_ci AS latin1_f_as FROM t1 ORDER BY latin1
SELECT latin1_f COLLATE latin1_german2_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
SELECT latin1_f COLLATE latin1_general_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
SELECT latin1_f COLLATE latin1_bin AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
---error 1252
+--error 1253
SELECT latin1_f COLLATE koi8r_general_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
@@ -87,7 +87,7 @@ SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_swedish_ci;
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_german2_ci;
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_general_ci;
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_bin;
---error 1252
+--error 1253
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r_general_ci;
@@ -98,7 +98,7 @@ SELECT DISTINCT latin1_f COLLATE latin1_swedish_ci FROM t1;
SELECT DISTINCT latin1_f COLLATE latin1_german2_ci FROM t1;
SELECT DISTINCT latin1_f COLLATE latin1_general_ci FROM t1;
SELECT DISTINCT latin1_f COLLATE latin1_bin FROM t1;
---error 1272
+--error 1273
SELECT DISTINCT latin1_f COLLATE koi8r FROM t1;
@@ -153,7 +153,7 @@ DROP TABLE t1;
CREATE TABLE t1
(s1 CHAR(5) COLLATE latin1_german1_ci,
s2 CHAR(5) COLLATE latin1_swedish_ci);
---error 1266
+--error 1267
SELECT * FROM t1 WHERE s1 = s2;
DROP TABLE t1;
diff --git a/mysql-test/t/ctype_cp1251.test b/mysql-test/t/ctype_cp1251.test
index fffade35389..66a8a5aa909 100644
--- a/mysql-test/t/ctype_cp1251.test
+++ b/mysql-test/t/ctype_cp1251.test
@@ -4,6 +4,8 @@
drop table if exists t1;
--enable_warnings
+SET NAMES cp1251;
+
#
# Test problem with LEFT() (Bug #514)
#
@@ -15,3 +17,18 @@ select a, left(a,1) as b from t1;
select a, left(a,1) as b from t1 group by a;
SELECT DISTINCT RIGHT(a,1) from t1;
drop table t1;
+
+#
+# Test of binary and upper/lower
+#
+create table t1 (a char(15) binary, b binary(15));
+insert into t1 values ('aaa','bbb'),('AAA','BBB');
+select upper(a),upper(b) from t1;
+select lower(a),lower(b) from t1;
+select * from t1 where upper(a)='AAA';
+select * from t1 where lower(a)='aaa';
+select * from t1 where upper(b)='BBB';
+select * from t1 where lower(b)='bbb';
+select charset(a), charset(b), charset(binary 'ccc') from t1 limit 1;
+select collation(a), collation(b), collation(binary 'ccc') from t1 limit 1;
+drop table t1;
diff --git a/mysql-test/t/ctype_create.test b/mysql-test/t/ctype_create.test
index a4858898535..bd8c22bb4f6 100644
--- a/mysql-test/t/ctype_create.test
+++ b/mysql-test/t/ctype_create.test
@@ -34,6 +34,20 @@ DROP DATABASE db2;
USE db1;
CREATE TABLE t1 (a char(10));
SHOW CREATE TABLE t1;
+DROP TABLE t1;
+#
+# Bug#3255
+#
+CREATE TABLE t1 (a char(10)) DEFAULT CHARACTER SET latin1;
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+CREATE TABLE t1 (a char(10))
+DEFAULT CHARACTER SET latin1 COLLATE latin1_german1_ci;
+SHOW CREATE TABLE t1;
DROP TABLE t1;
+
+#
+#
+#
DROP DATABASE db1;
diff --git a/mysql-test/t/ctype_sjis.test b/mysql-test/t/ctype_sjis.test
new file mode 100644
index 00000000000..1dd363c4910
--- /dev/null
+++ b/mysql-test/t/ctype_sjis.test
@@ -0,0 +1,34 @@
+-- source include/have_sjis.inc
+
+#
+# Tests with the sjis character set
+#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+set names sjis;
+
+select 'a' like 'a';
+select 'A' like 'a';
+select 'A' like 'a' collate sjis_bin;
+
+set @sjis1= _sjis 0xa1a2a3a4a5a6a7a8a9aaabacadaeaf;
+set @sjis2= _sjis 0xb0b1b2b3b4b5b6b7b8b9babbbcbdbebf;
+set @sjis3= _sjis 0xc0c1c2c3c4c5c6c7c8c9cacbcccdcecf;
+set @sjis4= _sjis 0xd0d1d2d3d4d5d6d7d8d9dadbdcdddedf;
+
+set @utf81= CONVERT(@sjis1 USING utf8);
+set @utf82= CONVERT(@sjis2 USING utf8);
+set @utf83= CONVERT(@sjis3 USING utf8);
+set @utf84= CONVERT(@sjis4 USING utf8);
+
+select hex(@utf81);
+select hex(@utf82);
+select hex(@utf83);
+select hex(@utf84);
+
+select hex(CONVERT(@utf81 USING sjis));
+select hex(CONVERT(@utf82 USING sjis));
+select hex(CONVERT(@utf83 USING sjis));
+select hex(CONVERT(@utf84 USING sjis));
diff --git a/mysql-test/t/ctype_tis620-master.opt b/mysql-test/t/ctype_tis620-master.opt
new file mode 100644
index 00000000000..69d47c06e42
--- /dev/null
+++ b/mysql-test/t/ctype_tis620-master.opt
@@ -0,0 +1 @@
+--default-character-set=tis620
diff --git a/mysql-test/t/ctype_tis620.test b/mysql-test/t/ctype_tis620.test
index 82c660dfea0..9bffc2b7ab8 100644
--- a/mysql-test/t/ctype_tis620.test
+++ b/mysql-test/t/ctype_tis620.test
@@ -62,3 +62,57 @@ SELECT hex(convert(@uC USING tis620));
SELECT hex(convert(@uD USING tis620));
SELECT hex(convert(@uE USING tis620));
SELECT hex(convert(@uF USING tis620));
+
+SET NAMES tis620;
+
+CREATE TABLE t1 (
+ recid int(11) NOT NULL auto_increment,
+ dyninfo text,
+ PRIMARY KEY (recid)
+) ENGINE=MyISAM;
+
+show create table t1;
+
+INSERT INTO t1 VALUES (1,'color=\"STB,NPG\"\r\nengine=\"J30A13\"\r\nframe=\"MRHCG1640YP4\"\r\ngrade=\"V6\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CG164YEN\"\r\ntype=\"VT6\"\r\n');
+INSERT INTO t1 VALUES (2,'color=\"HTM,NPG,DEG,RGS\"\r\nengine=\"F23A5YP1\"\r\nframe=\"MRHCF8640YP3\"\r\ngrade=\"EXi AT\"\r\nmodel=\"ACCORD\"\r\nmodelcode=\"CF864YE\"\r\ntype=\"EXA\"\r\n');
+
+SELECT DISTINCT
+ (IF( LOCATE( 'year=\"', dyninfo ) = 1,
+ SUBSTRING( dyninfo, 6+1, LOCATE('\"\r',dyninfo) - 6 -1),
+ IF( LOCATE( '\nyear=\"', dyninfo ),
+ SUBSTRING( dyninfo, LOCATE( '\nyear=\"', dyninfo ) + 7,
+ LOCATE( '\"\r', SUBSTRING( dyninfo, LOCATE( '\nyear=\"', dyninfo ) +7 )) - 1), '' ))) AS year
+FROM t1
+HAVING year != '' ORDER BY year;
+
+DROP TABLE t1;
+
+
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1
+(
+ name varchar(50) NOT NULL default '',
+ excelorder int(11) NOT NULL default '0',
+ neworder int(11) NOT NULL default '0'
+) ENGINE=MyISAM DEFAULT CHARSET=tis620;
+
+INSERT INTO `t1` VALUES ('+45 BRETT',4,1),('+55 BRETT',5,2),('+56 BRETT',6,3),('-.55 BRETT',2,4),('-45 BRETT',8,5),('-55 BRETT',13,6),('.-55 BRETT',3,7),('.55 BRETT',1,8),('45 BRETT',7,9),('5 5 BRETT3',9,10),('5 5 BRETT2',10,11),('5 5 BRETT1',11,12),('5-5 BRETT',14,13),('55 BRETT',12,14),('55+ BRETT',17,15),('55- BRETT',15,16),('55. BRETT',16,17),('Ã.µË­Ô§ ¾Íã¨',1630,1630),('ÂÃç¤ì',1599,1599),('ÃÁÂì¨ÃÃÂì',1638,1638),('àÁà¨ÍÃìÍصÊÒË¡ÃÃÁä·Â (1989)',1583,1583),('àÁâ·ÃʻԹ¹Ôè§',1586,1586),('àÃÇѵ',1706,1706),('àÂ繨ԵÃ',1623,1623),('àÂ繨Եµì',1622,1622),('àÁÉÂÒ',1591,1591),('àÁÉÔ³Õ',1592,1592),('áÁé¹ÁÒµÃ',1595,1595),('àÂÒÇàÃÈ',1627,1627),('àÂÒÇÀÒ',1626,1626),('àÂÒÇÅѡɳì',1628,1628),('àÂÒÇ´Õ',1624,1624),('àÂÒǾÒ',1625,1625),('àÃÔ§ÃÐÇÕ',1708,1708),('àÃԧķ¸Ôì',1709,1709),('àÃÔ§·ÔÇÒ',1707,1707),('ÀÃÒ´Ã',1496,1496),('àâ­Ò',1702,1702),('âç§Ò¹àËÅç¡¡Ãا෾Ï',1712,1712),('âè¹ì»ÃÐàÊÃÔ°',1713,1713),('àóÙ',1703,1703),('àÁ´Ô¤ÃÒ¿·ì',1584,1584),('àÁµµÒ',1585,1585),('áÁ··ÕàÃÕÂÅ¡ÃØê» ¨Ó¡Ñ´',1594,1594),('àÁ¸Ò',1587,1587),('àÁ¸Õ',1590,1590),('àÁ¸ÒÇÕ',1588,1588),('â¸Թ',1629,1629),('àÁ¸Ô¹Õ',1589,1589),('Áâ¹',1553,1553),('Á⹪',1554,1554),('àþᾤ à·Ã´´Ôé§',1704,1704),('áþᾤ ¤Í¹ÊµÃѤªÑè¹',1711,1711),('àþᾤ¤Í¹ÊµÃѤªÑè¹',1705,1705),('àÃ×ͧÂÈ',1710,1710),('àÁ×ͧ·Í§',1593,1593),('ÁÂØÃÕ',1555,1555),('áÇÇÇÔÀÒ',1952,1952),('áÇÇÇ´Õ',1951,1951),('àÇèÂà©Ô¹ÍÔ¹´ÑÊàµÃÕ¹',1949,1949),('àÇÍÃìâ¡é ·ÃҹʻÍÃìµ',1950,1950),('ÀÇÔ¹',1497,1497),('Ãǧ·Í§',1639,1639),('ÁÐÅÔÇÑÅÂì',1560,1560),('ÃеÃÕ',1643,1643),('ÃоԹ·Ãì',1644,1644),('ÃоվÃ',1645,1645),('ÃоվÃó',1646,1646),('ÃоվÅ',1647,1647),('àËÁÇ´Õ',2452,2452),('âÊÃÊ',2438,2438),('àÈÃÉ°¸Ã',2050,2050),('àÈÃÉ°¾§Éì',2051,2051),('âÊÃѨ',2439,2439),('ÁËÀÑ®',1558,1558),('àÊÁÒ',2410,2410),('àÊÃÕ',2413,2413),('âÊÀÒ',2432,2432),('âÊÀÕ',2435,2435),('àÊÃÔÁÈÑ¡´Ôì',2412,2412),('àÊÃÔÁäªÂ¤éÒ¡ÃдÒÉ',2411,2411),('àËÃÕ­',2455,2455),('âÊÀÒ¾Ãó',2434,2434),('âÊÀÒ¾¨¹Õ',2433,2433),('âÊèԵ',2436,2436),('âÊÀ³',2431,2431),('âÈôÒ',2052,2052),('âÊôÒ',2437,2437),('àËÁ×͹¢ÇÑ­',2453,2453),('àËÁ×͹¾¹Í',2454,2454),('àÊÇÂ',2414,2414),('áÊǧ',2430,2430),('Áéǹáµé',1557,1557),('ÃÊÊؤ¹¸ì',1641,1641),('âÊÌÊ',2440,2440),('ÃÈÑ¡´Ôì',1640,1640),('ÁËÒÃÒª',1559,1559),('àÊÒÇÅѡɳì',2420,2420),('àÊÒǤ¹¸ì',2415,2415),('àÊÒdzÕ',2416,2416),('àÊÒdzÕÂì',2417,2417),('àÊÒǹÕÂì',2419,2419),('àÊÒǹԵÂì',2418,2418),('áËÅÁ·Í§ÊË¡ÒÃ',2456,2456),('àÊ¡ÊÃÃ',2405,2405),('àÊ¡ÊÃäì',2406,2406),('áʧÃÐÇÕ',2424,2424),('Âè§àΧÇѲ¹Ò¡ÒþÔÁ¾ì',1598,1598),('áʧà´×͹',2422,2422),('áʧªÑÂ',2421,2421),('áʧ·Í§',2423,2423),('àʶÕÂÃ',2407,2407),('áʹÃÑ¡',2428,2428),('áʹÂÒ¡Ã',2427,2427),('áʹÀ¾',2426,2426),('àʹËì',2408,2408),('áʹÊØ¢',2429,2429),('àʹÕÂì',2409,2409),('áʹ·ÇÕà·ç¡«ìä·Åì',2425,2425),('àÍ.à¨.¾ÅÒÊ·ì',2676,2676),('âÍàÃÕÂÅ·ÍÅ ¿Øé´',2716,2716),('áÍÃì«Õ à¿Ã· ¿ÍÃìàÇÔ´àµÍÃì',2712,2712),('áÍÃì¾Õà¾ÔÅÍÔ¹àµÍÃì๪Ñè¹á¹Å',2713,2713),('ÃÍÂÑÅàÍ繨Ôà¹ÕÂÃÔè§',1642,1642),('àÍàªÕÂàÊÃÔÁ¡Ô¨ÅÔÊ«Ôè§',2687,2687),('àÍçÁ .«Õ.¾ÕÅÔÊ«Ôè§',2690,2690),('àÍçÁ «Õ ÍÐâ¡Ãà¤ÁÕ¤ÍÅ',2691,2691),('àÍçÁ.àÍçÁ.«Õ.â»ÅÔàÁÍÃì',2693,2693),('àÍçÁ.«Õ.¾Õ. ÅÔÊ«Ôè§',2692,2692),('àÍçÁ«ÕÊÂÒÁ âŨÕʵԤÊì',2694,2694),('âÍÇÍÐËÅÑè¾ÒÃì·à«ç¹àµÍÃì',2717,2717),('àÍç¡«Õà«ÅàŹ¿ÍÃìÁ',2678,2678),('àÍçª àÍçÁ «Õ â»ÅÕàÁÍÃì',2684,2684),('àÍçª.àÍçÁ.«Õ.â»ÅÔàÁÍÃì',2685,2685),('àÍçª.àÍçÁ.«Õ.â»ÅÕàÁÍÃì (º¨¡.)',2686,2686),('àÍç¹ ´Õ ठ(»ÃÐà·Èä·Â)',2688,2688),('àÍÊ àÍÊ à¤ ¡Å¡ÒÃ',2697,2697),('àÍÊ à¨ ¾ÅÒÊ·ì á͹´ì ᾤ',2695,2695),('àÍÊ ¾Õ Ê᡹',2696,2696),('àÍÊ.àÍçÁ.ÇÕ ÊË¡ÒÃ',2701,2701),('àÍÊ.àÍÊ.ठ¡Å¡ÒÃ',2702,2702),('àÍÊ.àÍÊ.à¤.¡Å¡ÒÃ',2703,2703),('àÍÊ.àÍÊ.ÍÔ¹¡Íµ ÍÅÙÁÔà¹ÕÂÁ1999',2704,2704),('àÍÊ.à¤.ÍÕ.',2698,2698),('àÍÊ.«Õ.¾Õ.ᾤ',2699,2699),('àÍÊ.¾Õ.¹ÔµµÔé§',2700,2700),('áÍÊષ¾ÅÑÊ',2715,2715),('àÍÊÇÕ¹Ô··Ñ¹¾ÃÔ«ÔªÑè¹',2705,2705),('áÍÅ¿èÒ â»Ãà«Ê«Ôè§',2714,2714),('àÍ¡ÃÒª',2679,2679),('àÍ¡ÃÔ¹·Ãì',2680,2680),('àÍ¡ÊÔ·¸Ôì',2681,2681),('àÍ¡ÍÃö',2683,2683),('à͡͹ѹµì',2682,2682),('àÍ¡ªÑÂ',2677,2677),('àΧà¨ÃÔ­ªÑ ¡ÃØê» ÍÔ¹´ÑÊàµÃÕÂÅ',2725,2725),('ÂʹྪÃ',1600,1600),('á͹¹Ò',2709,2709),('á͹¹ÒÃÕ',2710,2710),('áͺºÕà¤ÃÊ·ì(»ÃÐà·Èä·Â)',2711,2711),('àÍ¿ ÍÕ «Ô¤ÅÔ¤ (¡Ãا෾)',2689,2689),('àÍ×éÍÁ¾Ã',2707,2707),('àÍ×éÍÍÒÃÕ',2708,2708),('àÍ×é;ѹ¸Øì',2706,2706),('ÃÑÈÁÕ',1674,1674),('ÃÑÈÁÕÀÑÊÊÃ',1675,1675),('ÀÑÊÇÃó',1511,1511),('ÀÑÊÅÔ¹',1510,1510),('ÁÑÅÅÔ¡Ò',1564,1564),('ÃÑ¡ÈÑ¡´Ôì',1649,1649),('ÃÑ¡ÉÔµÀÑ·Ã',1650,1650),('ÀÑ¡´Õ',1498,1498),('ÃÑ¡´Õ',1648,1648),('ÀѤ¨ÔÃÒ',1499,1499),('ÃѧÊÃäì',1651,1651),('ÃѧÊѹµì',1652,1652),('ÃѧÊÔÁÒ',1653,1653),('Áѧ¡Ãä·ÂʵÕźÒÃì',1561,1561),('ÃѪà¡ÅéÒ',1654,1654),('ÃѪ®Ò',1655,1655),('ÃѪ®Ò¾Ã',1656,1656),('ÃѪ´Ò',1657,1657),('ÃѪ¹Õ',1658,1658),('ÃѪ¹Õ¡Ã',1659,1659),('ÃѪ¹Õ¾Ã',1660,1660),('ÃÑ°ÊØ´Ò',1662,1662),('ÃÑ°¾§Éì',1661,1661),('Àѳ±ÔÃÒ',1500,1500),('Áѳ±¹Ò',1562,1562),('ÃѵÔÂÒ',1672,1672),('ÃѵÔÂÒÀóì',1673,1673),('Ãѵ³Ò',1663,1663),('ÃѵµÔÂÒ',1665,1665),('ÃѵµªÑÂ',1664,1664),('Ãѵ¹Àóì',1667,1667),('Ãѵ¹Á³Õ',1668,1668),('Ãѵ¹Ò',1669,1669),('Ãѵ¹ÒÀóì',1671,1671),('Ãѵ¹Ò¾Ã',1670,1670),('Ãѵ¹ªÑÂ',1666,1666),('ÀÑ·ÃÀÃ',1505,1505),('ÀÑ·ÃÃѧÊÕ',1506,1506),('ÀÑ·ÃÒÀóì',1508,1508),('ÀÑ·ÃÔ¹·Ãì',1509,1509),('ÀÑ·ÃÄ´Õ',1507,1507),('Àѷ÷ÔÃÒ',1501,1501),('ÀѷþÃ',1503,1503),('ÀѷþÅ',1504,1504),('Àѷþ§Èì',1502,1502),('ÁÑ·¹Ò',1563,1563),('Âѹ áÍÅ à¤âÂÊ',1601,1601),('ÃÒàÁÈÃì',1681,1681),('ÁÒÃÔÉÒ',1572,1572),('ÃÒÂÕ¹',1682,1682),('ÃÒહ',1678,1678),('ÀÒôÕ',1521,1521),('ÀÔôÕ',1531,1531),('ÁÒ⹪³ì',1570,1570),('ÁÒâ¹·',1571,1571),('ÀÒÇÔ³Õ',1524,1524),('ÀÒÇÔ¹',1525,1525),('ÀÒÇÔ¹Õ',1526,1526),('ÀÒǹÒ',1522,1522),('ÀÒǾѹ¸¹ì',1523,1523),('ÀÒÉÔµÒ',1527,1527),('ÂÔè§ÇÃó',1602,1602),('ÁÔÅàŹà¹ÕèÂÁ âÍ.àÍ 2000',1578,1578),('ÁÒÅÑÂ',1573,1573),('ÁÒÅÕ',1575,1575),('ÁÒÅÕÇÃó',1576,1576),('ÁÒÅÔ¹Õ',1574,1574),('ÀÒ¡Ã',1512,1512),('ÀÒ¤ÀÙÁÔ',1513,1513),('ÀÔ¨ÔµÃÒ',1528,1528),('ÁÒªÍÃì¡ÇÒ¹',1565,1565),('ÃҪѹÂì',1676,1676),('ÃÒªÒÍÙªÔâ¹',1677,1677),('ÀÔ­â­',1530,1530),('ÀÔ­­¾Ñ¡µÃì',1529,1529),('ÀÒ³Õ',1514,1514),('ÁÒ³Õ',1566,1566),('ÃÒ³Õ',1679,1679),('ÀÒ³Ø',1515,1515),('ÀÒ³ØÇÃó',1517,1517),('ÀҳؾÅ',1516,1516),('ÃÒµÃÕ',1680,1680),('ÁÔµ·ÔÃÒ',1577,1577),('ÁÒ¹Ð',1568,1568),('ÁÒ¹ÔµÂì',1569,1569),('ÁÒ¹¾',1567,1567),('ÀÒ¹ØÇѲ¹ì',1518,1518),('ÀÒ¹ØÇѵÃ',1519,1519),('ÀÒ¾Ã',1520,1520),('ÁÕ¾Å',1579,1579),('ÀÙÃÔÇÃò¡ì',1535,1535),('ÀÙÁÔ°Ò¹',1533,1533),('ÀÙÃÔ¾§Èì',1534,1534),('ÂÙà¹Õè¹á¡êÊá͹´ìàÅÁÔ¤ÑÅÊì',1621,1621),('ÀÙàºÈ',1532,1532),('ÃÙàºÕÂÍصÊÒË¡ÃÃÁ',1701,1701),('ÁÙËÐÁд×ÍàÃÐ',1582,1582),('ÀÙÉÔµ',1536,1536),('ÂÙ¹ÔÅÕàÇÍÃì ä·Â âÎÅ´Ôé§Êì',1618,1618),('ÂÙ¹ÔÅÕàÇÍÃìä·Â âÎÅ´Ôé§Êì',1619,1619),('ÂÙ¹Õ¤ ÍÍÃì¤Ô´',1620,1620),('âÅËСԨʵÕÅ',1744,1744),('àÅÍÊÃäì',1739,1739),('àÅÍÈÑ¡´Ôì',1738,1738),('àÅÍÊØ¢',1740,1740),('àÅͪÑÂ',1737,1737),('àÅÔÈÈÑ¡´Ôì',1742,1742),('àÅÔÈÊÒÁÒö â¸Ò',1743,1743),('àÅÔȪÑÂ',1741,1741),('ÁÅÄ´Õ',1556,1556),('â¡àÁÈ',206,206),('â¡àÇȹì',211,211),('à¡ÃÕ§§ÍÔ¹àµÍÃì๪Ñè¹á¹Å',179,179),('à¡ÃÕ§ÈÑ¡´Ôì',180,180),('à¡ÃÕ§ä¡Ã',177,177),('à¡ÃÕ§ªÑÂ',178,178),('à¡ÃÔ¡',174,174),('à¡ÃÔ¡ä¡Ã',175,175),('à¡ÃÔ¡¾§Éì',176,176),('Á¡Ãҹѹ·ì',1537,1537),('â¡Ážѹ¸ì',205,205),('â¡ÇÔ·',208,208),('â¡ÇÔ·Âì',209,209),('â¡ÇÔ¹',210,210),('à¡ç¨¾ÔÃس',170,170),('à¡ÉÁ',190,190),('à¡ÊÃ',196,195),('à¡ÉÁÊѹµì',191,191),('à¡ÊÃì',195,196),('à¡ÈÃÒ',182,182),('à¡ÉÃÒ',192,192),('à¡ÉÃÕ',193,193),('à¡ÈÃÔ¹·Ãì',183,183),('á¡éÇ',203,203),('á¡éÇã¨',204,204),('à¡ÈÇÅÕ',184,184),('à¡ÈÈÔÃÔ',185,185),('à¡ÈÊØ´Ò',186,186),('à¡ÉÕÂÃ',194,194),('à¡ÈÔ¹Õ',187,187),('â¡ÊÔ¹·Ãì',213,213),('â¡ÈÅ',212,212),('à¡È¡ØÅÀÒ',181,181),('à¡É³Õ',188,188),('à¡É´Ò',189,189),('à¡ÕÂõÔ',197,197),('à¡ÕÂõÔÊÇÑÊ´Ôì',201,201),('à¡ÕÂõÔÈÑ¡´Ôì',200,200),('à¡ÕÂõԻÀÒ',198,198),('à¡ÕÂõԾ§Éì',199,199),('â¡ÅºÍÅ ¤Í¹à¹ç¤ªÑè¹Êì',207,207),('ࡪÒ',171,171),('ࡳԡÒ',172,172),('ࡵØÁ³Õ',173,173),('à¡×éÍ¡ÙÅ',202,202),('á¢ä¢',235,235),('ठÊËÒÂÍÔÁà»ê¡«ì',262,262),('à¤.«Õ.¾Õ. áÁªªÕ¹à¹ÍÃÕè',263,263),('â¤Ãà¹Ê (ä·ÂᏴì)',270,270),('à¤Ã×ÍÇÑÅÂì',267,267),('á¤Ð¨éÍÂ',269,269),('षշÕÅÔÊ«Ôè§',264,264),('ह áÁç¡«ì (»ÃÐà·Èä·Â)',266,266),('ह áÁ¡«ì (»ÃÐà·Èä·Â)',265,265),('᤹¹Ù ÍÔ¹àµÍÃìà·Ã´',268,268),('â¦ÉÔµ',271,271),('§ÂØ·¸',1597,1597),('à§Ô¹·Ø¹à¡ÕÂõԹҤԹ',274,274),('Á§¡Ø®Ãѵ¹ì',1538,1538),('Á§¤Å',1539,1539),('Á§¤Å¡Òûѡ',1540,1540),('à¨ÃÕ§',409,409),('à¨ÃÔ­',407,407),('à¨ÃÔ­ªÑÂËÁéÍá»Å§ä¿¿éÒ',408,408),('á¨èÁ',414,414),('ã¨ÊÇÇäì',415,415),('à¨éÒ¾ÃÐÂÒÁÒÃì¤',411,411),('à¨É®Ò',410,410),('à¨ÕÂÁ¨Ôµ',413,413),('à¨ÔÁªÑÂ',412,412),('ਵ¹ì',401,401),('ਹ',402,402),('ਹà¹ÍÃÑÅ乫ì (»ÃÐà·Èä·Â)',405,405),('ਹÇÔ·Âì',406,406),('è¹Ò',1631,1631),('ਹ¨ÔÃÒ',403,403),('ਹµì³Ã§¤ì',404,404),('â©ÁÊØ´Ò',436,436),('â©ÁÅ´Ò',435,435),('à©Ô¹',434,434),('à©ÅÔÁ',428,428),('à©ÅÕÂÇ',433,433),('à©ÅÔÁ¢ÇÑ­',429,429),('à©ÅÔÁªÑÂ',430,430),('à©ÅÔÁªÒµÔ',431,431),('à©ÅÔÁ¾Ñ¹¸Øì',432,432),('àªÉ°Ò',555,555),('àªÍÃÔè§-¾ÅÒÇ á͹ÔÁÑÅ àÎéŪ',556,556),('àªÍÃÔè§-¾ÅÒÇá͹ÔÁÑÅàÎçŸ',557,557),('àªÕ§àΧ¡ÒêèÒ§',563,563),('àªÒÇÅÔµ',559,559),('àªÒǹҭ',558,558),('àªÕèÂǪҭ ÍÔ¹´ÑÊ·ÃÕè (1989)',564,564),('àªÕèÂǪҭÍÔ¹´ÑÊ·ÃÕ (1989)',565,565),('àªÕèÂǪҭÍÔ¹´ÑÊ·ÃÕè (1989)',566,566),('àªÕèÂǪҭÍÔ¹´ÑÊ·ÃÕè(1989)',567,567),('àªÔ´ÈÑ¡´Ôì',562,562),('àªÔ´¨Ôµµì',560,560),('àªÔ´ªÑÂ',561,561),('⪤',568,568),('⪤ªÑÂ',569,569),('ય°¡Ã',554,554),('⪵Ô',570,570),('⪵ÔÃÊ',571,571),('⪵ÔÇظ',572,572),('à«ÕÂÁà¡ÕÂÇ',589,589),('à«ÒÐ',588,588),('óç¤ì',1632,1632),('Á³à±ÕÂÃ',1546,1546),('Á³ÕÃѵ¹ì',1547,1547),('Á³°Ô´Ò',1541,1541),('Á³±Ò',1545,1545),('Á³±ÅÕ',1544,1544),('Á³±¹ì¡Ò­¨¹ì',1542,1542),('Á³±¹Ô¨',1543,1543),('â´Á',708,708),('à´ÍФÇÍÅÔµäÇÃì',705,705),('ôÒ',1633,1633),('à´ª',703,703),('à´ªÒ',704,704),('à´×͹à¾ç­',707,707),('à´×͹¹ÀÒ',706,706),('àµçÁà´ª',720,720),('ãµé à«é§ «Ñ¹',723,723),('àµ×͹ã¨',721,721),('àµ×͹µÒ',722,722),('à¶ÅÔ§ÈÑ¡´Ôì',734,734),('à·ÇÒ',802,802),('à·ÇÕ',803,803),('à·Ô´ä·',804,804),('à·¾',799,799),('෾ķ¸Ôì',801,801),('à·¾¾ÔºÙÅ',800,800),('Á¹ÑÊ',1550,1550),('Á¹ÑÊÇÕ',1551,1551),('à¹ÒÇÃѵ¹ì',1043,1043),('ùԮ°Ò',1634,1634),('Á¹Ù­',1552,1552),('Á¹µÃÕ',1549,1549),('๵ôÒÇ',1042,1042),('Á¹µìªÑÂ',1548,1548),('àºç­ÇÃó',1117,1117),('àºç·à·ÍÃì äÅ¿ì',1118,1118),('ອ¨ÁÒ',1114,1114),('ອ¨ÇÃó',1116,1116),('ອ¨ÅÑ¡É³ì ¾ÃÔé¹µÔé§',1115,1115),('ອ¨¾Ã',1113,1113),('à»ÃÁ',1265,1265),('à»ÃÁÈÃÕ',1268,1268),('à»ÃÁÊÔ·¸Ôì',1269,1269),('à»ÃÁÄ´Õ',1267,1267),('à»ÃÁ»ÃÐÀÒ',1266,1266),('à»à»ÍÃìÅÔ¿',1264,1264),('à»ÕèÂÁÊØ¢',1270,1270),('á»Å¹âÁ·Ô¿',1271,1271),('à¼Ô§',1291,1291),('༴ç¨',1290,1290),('á¾ÃÇ',1475,1475),('á¾ÃÇÒ',1476,1476),('à¾ÃÔÁàÁ¹¹Ôª ÍâÃáÁµÔê¡Êì ¾Õ·ÕÍÕ ÅÔÁÔàµç´',1468,1468),('à¾ç§ ¿Ù ËÅÔ¹',1456,1456),('à¾çªÃì',1457,1457),('à¾ç­ÈÃÕ',1467,1467),('à¾ç­¨Ñ¹·Ãì',1461,1461),('à¾ç­·Ô¾Âì',1462,1462),('à¾ç­¹ÀÒ',1463,1463),('à¾ç­»ÃÐÀÒ',1464,1464),('à¾ç­¼¡Ò',1465,1465),('à¾ç­¾ÔäÅ',1466,1466),('þÕÀÑ·Ã',1637,1637),('à¾Õ§¾Ã',1471,1471),('þվÃ',1635,1635),('þվѲ¹ì',1636,1636),('à¾ÅԹĴÕ',1470,1470),('à¾ÅÔ¹¨Ôµµì',1469,1469),('ྪÃÃѵ¹ì',1458,1458),('ྪÃÔ¹·Ãì',1460,1460),('ྪÃÅ´Ò',1459,1459),('á¾´´Ôé§ (ä·ÂᏴì)',1472,1472),('á¾´´Ôé§(ä·ÂᏴì)',1473,1473),('á¾¹´éÒ à»à»ÍÃì ¤ÒÃìµÑ¹Ê',1474,1474),('á¿ÃìàÇÂì ÍÔ¹àµÍÃì๪Ñè¹á¹Å',1495,1495),('á¿Ã§¤ì',1494,1494),('Ã×è¹ÇÃÒËì',1683,1683),('ÂØÀÒÀóì',1615,1615),('ÂØÀÒ¾Ã',1614,1614),('ÂØÇÃÕ',1617,1617),('ÂØÇ´Õ',1616,1616),('ÃØËйÒ',1700,1700),('ÃØé§',1684,1684),('ÃØè§âè¹ì',1693,1693),('ÃØè§âè¹ì¢¹Êè§',1694,1694),('ÃØè§àÃ×ͧ',1692,1692),('ÃØè§ÃÑÈÁÕ',1691,1691),('ÃØè§ÃѪ¹Õ',1689,1689),('ÃØè§Ãѵ¹ì',1690,1690),('ÃØè§à¾ªÃ',1688,1688),('ÃØè§ÇÔ·Âì',1696,1696),('ÃØè§ÍÃس',1697,1697),('ÃØé§ÅÒÇÃó',1695,1695),('ÃØ觷ÔÇÒ',1686,1686),('ÃØ觷ԾÂì',1685,1685),('ÃØ觹ÀÒ',1687,1687),('ÁØ¢',1580,1580),('ÂؤžÃ',1603,1603),('ÃبÒ',1698,1698),('ÃبÒÀÒ',1699,1699),('ÂØ´Ò',1604,1604),('ÁØ·ÔµÒ',1581,1581),('ÂØ·¸Â§',1607,1607),('ÂØ·¸¹Ò',1605,1605),('ÂØ·¸¹ÒÇÕ',1606,1606),('ÂظÒÁÒµÂì',1608,1608),('Âعâ¡Ð',1609,1609),('ÂؾÒ',1610,1610),('ÂؾÒÇ´Õ',1612,1612),('ÂؾԹ',1613,1613),('ÂؾҾÃ',1611,1611),('ÇÃÃѪ',1792,1792),('ÇÃÁÅ',1768,1768),('ÇÃóÀóì',1785,1785),('ÇÃóÀÒ',1786,1786),('ÇÃóÀ¾',1784,1784),('ÇÃóà¾ç­',1783,1783),('ÇÃóǴÕ',1787,1787),('ÇÃóÈÔÃÔ',1788,1788),('ÇÃóì´Õ',1773,1774),('ÇÃóÒ',1789,1789),('ÇÃóÕ',1790,1790),('ÇÃó¨Ôµ',1770,1770),('ÇÃóªÑÂ',1771,1771),('ÇÃó±¹Ò',1772,1772),('ÇÃó´Õ',1774,1773),('ÇÃó·¹Ò',1775,1775),('ÇÃó·¹Õ',1776,1776),('ÇÃó¸ÁÅ',1778,1778),('ÇÃó¸³Õ',1777,1777),('ÇÃó¹ÀÒ',1779,1779),('ÇÃó¹ÒÃÕ',1780,1780),('ÇÃó¾Ã',1781,1781),('ÇÃó¾Ò',1782,1782),('ÇÃà·¾',1762,1762),('ÇÃø¹Ò',1791,1791),('ÇÃÂØ·¸ì',1769,1769),('ÇÃÇÃó',1794,1794),('ÇÃÇÃø¹ì',1795,1795),('ÇÃÇѲ¹ì',1796,1796),('ÇÃÇÔÀÒ',1797,1797),('ÇÃÑ­¸Ã',1798,1798),('ÇÃÒ',1799,1799),('ÇÃÒÀóì',1803,1803),('ÇÃÒÃѵ¹ì',1804,1804),('ÇÃÔÁÒ',1810,1810),('ÇÃÕÇÃó',1812,1812),('ÇÃÒÇزÔ',1806,1806),('ÇÃÒÇظ',1807,1807),('ÇÃÔÈÃÒ',1811,1811),('ÇÃÒÅѡɳì',1805,1805),('ÇÃÒ§Ãѵ¹ì',1801,1801),('ÇÃÒ§¤³Ò',1800,1800),('ÇÃÔ¹·Ãì',1808,1808),('ÇÃÔ¹¸Ã',1809,1809),('ÇÃÒ¾Ã',1802,1802),('ÇÃÅѡɳì',1793,1793),('ÇáÒÃ',1758,1758),('ÇêÑÂ',1759,1759),('ÇêҵÔ',1760,1760),('ÇôÔÉ°ì',1761,1761),('ÇøѹÂì',1763,1763),('Çùت',1764,1764),('ÇþÅ',1767,1767),('Çþ§Éì',1765,1765),('Çþ¨¹ì',1766,1766),('ÇÃس',1813,1813),('Çèͧ',1819,1819),('ÇÊѹµì',1817,1817),('ÇÈÔ³Ò',1815,1815),('ÇÈÔ¹',1816,1816),('ÇÊØ',1818,1818),('CHEE KUNG FOOK',18,18),('CHEN CHIA YI',19,19),('CHI WAI DAVIT',20,20),('ÇÑʹÑÂ',1843,1843),('ÇÑȾÅ',1842,1842),('ÇÑÅÅÀ',1839,1839),('ÇÑÅÅÀÒ',1840,1840),('ÇÑÅÅÒÀÒ',1841,1841),('ÇѪÃÐ',1822,1822),('ÇѪÃÑ­­Ò',1823,1823),('ÇѪÃÕ',1825,1825),('ÇѪÃÔ¹·Ãì',1824,1824),('ÇѪáÃ',1820,1820),('ÇѪþÅ',1821,1821),('ÇѲ¹Ð',1826,1826),('ÇѲ¹Ò',1827,1827),('ÇѹÃѪ´Ò',1836,1836),('Çѹà©ÅÔÁ',1828,1828),('Çѹà¾ç­',1835,1835),('ÇѹÇÔÊÒ¢ì',1837,1837),('ÇѹʶÒ',1838,1838),('ÇѹªÑÂ',1829,1829),('ÇѹªÒµÔ',1830,1830),('Çѹ´Õ',1831,1831),('Çѹ·¹Ò',1832,1832),('Çѹ·¹Õ',1833,1833),('Çѹ·¹ÕÂì',1834,1834),('ÇÕ àÍÊ à¹à¹ÍÃÑÅ à¤Á',1916,1916),('ÇÔÃÁÅ',1886,1886),('ÇÔâè¹ì',1889,1889),('ÇÕÃ⪵Ô',1921,1921),('ÇÕÃà´ª',1922,1922),('ÇÕÃÂØ·Âì',1925,1925),('ÇÕÃÇÃó',1926,1926),('ÇÕÃÐ',1929,1929),('ÇÕÃÐà´ª',1933,1933),('ÇÕÃÐÂØ·¸ì',1936,1936),('ÇÕÃÐÇÃó',1937,1937),('ÇÕÃÐÇѲ¹ì',1938,1938),('ÇÕÃÐÈÑ¡´Ôì',1939,1939),('ÇÕÃЪÑÂ',1930,1930),('ÇÕÃЪÒÂ',1932,1932),('ÇÕÃЪҵÔ',1931,1931),('ÇÕÃоÅ',1935,1935),('ÇÕÃо§Éì',1934,1934),('ÇÕÃÈÑ¡´Ôì',1927,1927),('ÇÕÃÊÔ·¸Ôì',1928,1928),('ÇÔÃѪ',1887,1887),('ÇÔÃѵ¹ì',1888,1888),('ÇÒÃÕ',1849,1849),('ÇÔÀÒ',1875,1875),('ÇÕÃÒÀóì',1940,1940),('ÇÔÀÒÃѵ¹ì',1879,1879),('ÇÔÀÒÊ',1881,1881),('ÇÔÀÒɳÕÂì',1880,1880),('ÇÔÀҡóì',1876,1876),('ÇÔÀÒ¤',1877,1877),('ÇÒÃÔª',1848,1848),('ÇÔÀÒ¾Ãó',1878,1878),('ÇÔÀÙÉÔµ',1882,1882),('ÇÔÁÅ',1883,1883),('ÇÔÁÅÇÃó',1885,1885),('ÇÔÁžÃ',1884,1884),('ÇÔàªÉ°',1863,1863),('ÇÕêÑÂ',1920,1920),('ÇÔàªÕÂÃ',1864,1864),('ÇÕþÅ',1924,1924),('ÇÕþ§Èì',1923,1923),('ÇÒÃسÕ',1850,1850),('ÇÔÇ',1901,1901),('ÇÔÇÃø¹ì',1902,1902),('ÇÔÇѲ¹ì',1903,1903),('ÇÔÇѲ¹ìªÑÂ',1904,1904),('ÇÔÉÃب¹ì',1910,1910),('ÇÔÈÃص',1906,1906),('ÇÔÈÔÉ®ì',1908,1908),('ÇÔÈÔÉ°ì',1909,1909),('ÇÔÈÒÅ',1907,1907),('ÇÔÊÔ°ÈÑ¡´Ôì',1911,1911),('ÇÔÊÔ·¸Ôì',1912,1912),('ÇÔÊÙµ',1915,1915),('ÇÒʹÒ',1851,1851),('ÇÔȹÕ',1905,1905),('ÇÔÊØ·¸Ô',1914,1913),('ÇÔÊØ·¸Ôì',1913,1914),('ÇÔÅÇѳÂì',1890,1890),('ÇÔÅÒÇÃó',1891,1891),('ÇÔÅÒÇÑÅÂì',1893,1893),('ÇÔÅÒÇѳÂì',1892,1892),('ÇÔÅÒÊÔ¹Õ',1894,1894),('ÇÔÅÔµ',1895,1895),('ÇÔäÅ',1896,1896),('ÇÔäÅÃѵ¹ì',1898,1898),('ÇÔäÅÇÃó',1900,1900),('ÇÔäÅÅѡɳì',1899,1899),('ÇÔäžÃ',1897,1897),('ÇÔ¤Á',1853,1853),('ÇÔ¤µÍÃÕè â¾Ãà¡Ã·',1852,1852),('ÇÔ¨ÔÃÒ',1856,1856),('ÇÔ¨Òóì',1854,1854),('ÇÔ¨ÔµÃ',1855,1855),('ÇÔªÑÂ',1859,1859),('ÇÔªÒ­',1860,1860),('ÇÔªÔµ',1861,1861),('ÇÔªªÒ',1857,1857),('ÇÔª­ÐÃب',1858,1858),('ÇԪشÒ',1862,1862),('ÇÕ«èÒ (2000)',1917,1917),('ÇÔ­­Ø´Ò',1865,1865),('ÇÔ±ÙÅÂì',1866,1866),('ÇÒ³Õ',1844,1844),('ÇÕ³Ò',1918,1918),('ÇÔ·ÂÒ',1868,1868),('ÇÔ·ÇÑÊ',1869,1869),('ÇÒ·Ôµ',1845,1845),('ÇÒ·Ô¹',1846,1846),('ÇÒ·Ô¹ÕÂì',1847,1847),('ÇÔ·ÙÃ',1870,1870),('ÇÔ·¸ÇѪ',1867,1867),('ÇÔ¹ÊÃäì',1871,1871),('ÇÔ¹ÑÂ',1872,1872),('ÇÕ¹ÑÊ',1919,1919),('ÇÔ¹Ô¨',1873,1873),('ÇÔºÙÅÂì',1874,1874),('ÇÅѾÃ',1814,1814),('ǧà´×͹',1745,1745),('ǧÈìÇÒµ',1749,1749),('ǧÈìÊØÀÒ',1750,1750),('ǧÈìä¾±ÙÃÂì¡Ãç» º',1746,1746),('ǧÈìä¾±ÙÃÂì¡ÃÙê»',1748,1748),('ǧÈìä¾±ÙÃÂì¡ÃØê»',1747,1747),('ǨÕÃѵ¹ì',1751,1751),('ǪÔÃÒÀÒ',1752,1752),('ǹÑʹѹ·ì',1754,1754),('ǹѪ¾Ã',1753,1753),('ǹÒ',1755,1755),('ǹԪ',1756,1756),('ǹԴÒ',1757,1757),('ÇزÔÃѵ¹ì',1948,1948),('ÇزԡÃ',1941,1941),('ÇزԪÑÂ',1942,1942),('ÇزԹÑÂ',1944,1944),('ÇزԹѹ·ì',1943,1943),('ÇزԾÅ',1947,1947),('ÇزԾ§Èì',1945,1945),('ÇزԾ¨¹ì',1946,1946),('Ê ÍÒ´',2054,2054),('Ê.͹ѹµìàÍ繨Ôà¹ÕÂÃÔè§ á͹¤Í¹ÊµÃѤªÑè¹',2055,2055),('ÊÁ',2078,2078),('ÊÁÃ',2113,2113),('ÊÃÃàÊÃÔ°­',2142,2142),('ÊÁâÀª¹ì',2108,2108),('ÊÁâÁ·',2111,2111),('ÊÁÂÈ',2112,2112),('ÊÁÃÑ¡Éì',2114,2114),('ÊÁÁÒö',2109,2109),('ÊÁÁÒȹì',2110,2110),('ÊÁà¡ÕÂõÔ',2080,2080),('ÊÁã¨',2088,2088),('ÊÁ⪤',2093,2093),('ÊÁà´ª',2095,2095),('ÊÁÀ¾',2107,2107),('ÈÃÇÑÅÂì',1959,1959),('ÊÁǧÉì',2119,2119),('ÊÁÈÃÕ',2120,2120),('ÊÁËÁÒÂ',2126,2126),('ÊÁËÇѧ',2127,2127),('ÊÁÈÑ¡´Ôì',2121,2121),('ÊÁÈÔÃÔ',2122,2122),('ÊÁË­Ô§',2125,2125),('ÊÁÊØ¢',2123,2123),('ÊÁÊعÕÂì',2124,2124),('ÊÁÑÂ',2128,2128),('ÈÃÑ­­Ò',1960,1960),('ÊÃÑ­­Ò',2143,2143),('ÈÃѳÂì',1962,1962),('ÈÃѳ¾Ã',1961,1961),('ÊÂÒÁ',2133,2133),('ÊÂÒÁàÁ¦Õâ¾ÅÕàÁÍÃì',2139,2139),('ÊÂÒÁÂÙ¹Ôâ«Å',2140,2140),('ÈÃÕÃѵ¹ì',1977,1977),('ÈÃÕÀÒ',1976,1976),('ÈÃÒÁÒÈ',1963,1963),('ÈÂÒÁÅ',1957,1957),('ÊÂÒÁä´à¤ÕÂÇ',2136,2136),('ÊÂÒÁ¤Í¹àÇàÂÍÃì',2134,2134),('ÊÂÒÁªÑÂâ¾ÅÕàÁÍÃì',2135,2135),('ÊÂÒÁ¹ÔÊÊѹ ÍÍâµéâÁºÔÅ',2137,2137),('ÊÂÒÁ¾Ãà·Ã´à«ç¹àµÍÃì',2138,2138),('ÈÃÕà¾ç­',1975,1975),('ÊÃÒÂظ',2146,2146),('ÈÃÕÇѨ¹Ò',1978,1978),('ÈÃÕÇѲ¹Ò',1979,1979),('ÈÃÕÇÔ¡Ò',1980,1980),('ÈÃÒÇزÔ',1964,1964),('ÊÃÒÇزÔ',2147,2147),('ÈÃÒÇظ',1965,1965),('ÊÃÒÇظ',2148,2148),('ÈÃÕÊÁÃ\nÈÃÕÊÁÃ',1984,1983),('ÈÃÕÊÁÃ',1983,1984),('ÈÃÕÈÑ¡´Ôì',1981,1981),('ÈÃÕÊ¡ØÅ',1982,1982),('ÈÃÕÊØÇÃó¤Í¹àÇàÂÍÃìàºÅ·ì á͹´ì ÃѺàºÍÃì',1985,1985),('ÈÃÕÍÓ¾ÅÍصÊÒË¡ÃÃÁ',1987,1987),('ÈÃÕ͹§¤ì',1986,1986),('ÊÃÒ¡Ã',2144,2144),('ÈÃըѹ·Ãì',1967,1967),('ÈÃըѹ·ÃÒ',1968,1968),('ÊÃÒ­¨Ôµ',2145,2145),('ÈÃշͧà¹Áà¾Å·',1969,1969),('ÈÃշͧÍصÊÒË¡ÃÃÁ«Ñ¾¾ÅÒÂ',1970,1970),('ÊÁÔ·¸Ô',2131,2130),('ÊÁÔ·¸Ôì',2130,2131),('ÊÁÒ¹',2129,2129),('ËÃÔ¹',2446,2446),('ÊÃÔ¹ÃÒ',2149,2149),('ÈÃÕ¹ÇÅ',1971,1971),('ÈÃÔ¹·Ãì',1966,1966),('ÈÃÕ»ÃÐÀÒ',1973,1973),('ÈÃÕ»ÃÐä¾',1972,1972),('ÈÃÕ¾§Éì',1974,1974),('ÈÁÅÇÃó',1956,1956),('ÊÁÅѡɳì',2118,2118),('ÊàŤ·ì¿ÍÃìÁà¿ÍÃì¹Ôà¨ÍÃìáÅкصÃ',2152,2152),('ÊÁÄ´Õ',2115,2115),('ÊÁÄ·ÑÂ',2117,2117),('ÊÁÄ·¸Ôì',2116,2116),('ÊÁ¡ÁÅ',2079,2079),('ÊÁ¤ÇÃ',2081,2081),('ÊÁ¤Ô´',2082,2082),('ÊÁ¨Ôµ',2083,2083),('ÊÁ¨ÔµÃ',2086,2085),('ÊÁ¨ÔµÃì',2085,2086),('ÊÁ¨Ôµµì',2084,2084),('ÊÁ¨Ô¹µ¹Ò',2087,2087),('ÈêÑÂ',1958,1958),('ÊÁªÑÂ',2089,2089),('ÊÁªÒÂ',2092,2092),('ÊÁªÒ­',2090,2090),('ÊÁªÒµÔ',2091,2091),('ÊÁ´Õ',2094,2094),('Êáµ¹´ÒÃì´ ªÒÃìàµÍÃì (»ÃÐà·Èä·Â)',2066,2066),('ÊÁ·Ã§',2096,2096),('ÊÁ¹Ö¡',2097,2097),('ÊÁºÑµÔ',2098,2098),('ÊÁºÙóì',2100,2100),('ÊÁºØ­',2099,2099),('Êà»ç¤ à´ç¹ µÑÅ áź',2076,2076),('ÊÁ»Í§',2101,2101),('Ê໫¤ÍÁ',2077,2077),('ÊÁ¾Ã',2104,2104),('ÊÁ¾ÔÈ',2106,2106),('ÊÁ¾Å',2105,2105),('ÊÁ¾§Éì',2102,2102),('ÊÁ¾¨¹ì',2103,2103),('ÊÂØÁ¾Ã',2141,2141),('ÊÃب',2150,2150),('ÊÁتªÅ',2132,2132),('ÊÇÑÊ´Ôì',2154,2154),('ÊÇÕâè¹ì',2155,2155),('ÊÇÕÇÃó',2156,2156),('ËÇÒ¹',2448,2448),('ÊÇÅѡɳì',2153,2153),('Êзé͹',2161,2161),('ÈÈÁÅ',1989,1989),('ÊËà¡ÕÂõÔâÅËÐà¡ÕÂõÔ',2158,2158),('ÈÈÔ',1990,1990),('ÈÈÔÀÒ',1993,1993),('ÈÈÔÁÒ',1994,1994),('ÈÈÔÇÔÁÅ',1995,1995),('ÈÈÔÉÒ',1996,1996),('ÈÈÔ¸Ã',1991,1991),('ÈÈÔ¾Ã',1992,1992),('ÊÊԾѹ¸Øì',2157,2157),('Êè§àÊÃÔÁ',2062,2062),('Êè§ÈÃÕ',2061,2061),('Ê˾Å',2159,2159),('ËÍÁ¨Ñ¹·Ãì',2449,2449),('ÊÍÒ´',2160,2160),('ÊÑÁÄ·¸Ôì',2170,2170),('ÊÑÁ¾Ñ¹¸ì',2169,2169),('ËÑÊÂÒ',2451,2451),('ËÑʹÕ',2450,2450),('ÈÑ¡ÃÔ¹·Ãì',2003,2003),('ÈÑ¡´Ò',1997,1997),('ÈÑ¡´Ôì',1998,1998),('ÈÑ¡´ÔìàªÇ§',2000,2000),('ÈÑ¡´ÔìÇÔºÙÅÂì',2002,2002),('ÈÑ¡´ÔìªÑÂ',1999,1999),('ÈÑ¡´Ôì´Ò',2001,2001),('ÊѧÇÒÅÂì',2162,2162),('ÊѨ¾§Éì',2163,2163),('ÊÑ­ªÑÂ',2165,2165),('ÊÑ­ª¹Ò',2164,2164),('ÊÑ­­Ò',2166,2166),('ÈѹʹÕÂì',2004,2004),('ÊѹµÔ',2167,2167),('ÊѹµÔªÑÂ',2168,2168),('ÊÒÂã¨',2176,2176),('ÈÔâè¹ì',2030,2030),('ÊÒâè¹ì',2188,2188),('ÊÔâè¹ì',2228,2228),('ÊÒâê',2189,2189),('ÊÒ¹µì',2181,2181),('ÊÒÁÀ¾',2174,2174),('ÊÓÃÇÁ',2195,2195),('ÊÓÃÇÂ',2196,2196),('ÊÒÂÊÁÃ',2183,2183),('ÈÔÃÉÒ',2007,2007),('ÊÒÂÊسÕ',2184,2184),('ÊÒÂÊعÕÂì',2185,2185),('ÊÒÂѳ',2186,2186),('ÊÒÂѳËì',2187,2187),('ÈÔÃÔ',2009,2009),('ÈÔÃÔÃѨ¹ì',2024,2024),('ÈÔÃÔÃѵ¹ì',2025,2025),('ÊÔÃÔÃѵ¹ì',2223,2223),('ÈÔÁÒÃÕ',2006,2006),('ÈÔÃÔÁÒ',2023,2023),('ÊÔÃÔÁÒ',2222,2222),('ÈÔÃÔâ©Á',2012,2012),('ÊÔÃÔà´ª',2214,2214),('ÊÒÁÒö',2175,2175),('ÈÔÃÔà¾ç­',2022,2022),('ÈÔÃÔÇÃó',2027,2027),('ÊÔÃÔÇÃó',2225,2225),('ÊÔÃÔÇѲ¡ì',2226,2226),('ÈÔÃÔÇѲ¹ì',2028,2028),('ÊÔÃÔÇѲ¹Ò',2227,2227),('ÈÔÃÔÈÑ¡´Ôì',2029,2029),('ÈÔÃÔÅѡɳì',2026,2026),('ÊÔÃÔÅѡɳì',2224,2224),('ÈÔÃÔ¡ØÅ',2010,2010),('ÈÔÃԨѹ·Ãì',2011,2011),('ÈÔÃÔªÑÂ',2013,2013),('ÊÔÃÔªÑÂ',2213,2213),('ÊÓÃÒ­',2197,2197),('ÈÔÃÔ·Ñȹì',2014,2014),('ÈÔÃÔ¸Ã',2015,2015),('ÊÔÃÔ¹Ãѵ¹ì',2216,2216),('ÈÔÃÔ¹Òö',2017,2017),('ÈÔÃÔ¹­Ò',2016,2016),('ÊÔÃÔ¹¾Ã',2215,2215),('ÈÔÃԹت',2018,2018),('ÊÔÃÔ»ÃÐÀÒ',2217,2217),('ÈÔÃÒ¾Ã',2008,2008),('ÈÔÃÔ¾Ã',2020,2020),('ÊÔÃÔ¾Ã',2219,2219),('ÈÔÃÔ¾Ãó',2021,2021),('ÊÔÃÔ¾Ãó',2220,2220),('ÊÔÃԾѹ¸ì',2221,2221),('ÈÔÃÔ¾§Éì',2019,2019),('ÊÔÃÔ¾§Éì',2218,2218),('ÊÒÂÅÁ',2182,2182),('ÊÒÂä¿¿éÒä·Â-ÂÒ«Ò¡Ô',2180,2180),('ÊÒªÅ',2177,2177),('ÊÓà¹Õ§',2194,2194),('ÊÒ¹·Õ',2178,2178),('ÊÒ½¹',2179,2179),('ÈÔÇÒÀóì',2036,2036),('ÊÕÇÔ¡Ò',2231,2231),('ÊÒÇÔµÃÕ',2192,2192),('ÈÔÇÒ¾Ã',2035,2035),('ÊÔÇÅÕ',2229,2229),('ÈÔǾÃ',2033,2033),('ÈÔǾÅ',2034,2034),('ÈÔÅÒ',2032,2032),('ÊÒÅÕ',2190,2190),('ÊÓÅÕ',2199,2199),('ÊÒÅÕè',2191,2191),('ÈÔÅ»ªÑÂ',2031,2031),('ÊÓÄ·¸Ôì',2198,2198),('ÊÒ¤Ã',2171,2171),('ÊÔ§Ëì',2200,2200),('ÊÔ§Ëì¾Å',2201,2201),('ÊÔ§ËÒ',2202,2202),('ÊԵҹѹ',2203,2203),('ÊÔµÒ¾Ã',2204,2204),('ÊÔ·¸Ò',2205,2205),('ÊÔ·¸Ôà´ª',2208,2208),('ÊÔ·¸Ôì',2206,2206),('ÊÔ·¸ÔªÑÂ',2207,2207),('ÊÔ·¸Ô¾Ã',2209,2209),('ÊÔ·¸Ô¾Ãó',2210,2210),('ÊÔ·¸Ô¾Å',2211,2211),('ÊÒ¸Ôµ',2172,2172),('ÊÕ¹ÇÅ',2230,2230),('Êӹѡ¹âºÒÂáÅÐá¼¹¡Ãا෾ÁËÒ¹¤Ã',2193,2193),('ÊÒ¹ÔµÂì',2173,2173),('ÈÒ¹µÔᏴì',2005,2005),('ÊÔ¹·ÇÕ',2212,2212),('ÊÅÑ¡¨ÔµÃ',2151,2151),('ÈÅÔÉÒ',1988,1988),('ËÄ·Â',2447,2447),('Ê¡ÒÇÃѵ¹ì',2057,2057),('Ê¡ÅÃѵ¹ì',2056,2056),('È¡ÅÇÃó',1954,1954),('˧',2441,2441),('ʧǹ',2060,2060),('ʧèÒ',2064,2064),('ʧѴ',2063,2063),('ʧ¡ÃÒ¹µì',2059,2059),('ʧ¡Ã³ì',2058,2058),('ȨÕ',1955,1955),('ʴѺ¾Ô³',2065,2065),('ʶÔÃÂÒ',2068,2068),('ʶҾÃ',2067,2067),('Ë·ÑÂ',2442,2442),('Ë·ÑÂÃѵ¹ì',2444,2444),('Ë·Ñ·ԾÂì',2443,2443),('ʹã¨',2069,2069),('ʹͧ',2073,2073),('ʹÑè¹',2074,2074),('ʹԴÒ',2075,2075),('˹Öè§Ä·ÑÂ',2445,2445),('ʹ·ÂÒ',2070,2070),('ʹ¸ÂÒ',2072,2072),('ʹ¸¾',2071,2071),('ÈØÀÃ',2042,2042),('ÈØÀÃѵ¹ì',2043,2043),('ÈØÀÃÒÀóì',2044,2044),('ÊØÀÁÒÊ',2329,2329),('ÈØÀÁÔµÃ',2041,2041),('ÊØÃàªÉ°ì',2353,2353),('ÊØÀ⪤',2328,2328),('ÊØÃà´ª',2354,2354),('ÊØàÁ¸',2348,2348),('ÊØàÁ¸Õ¡ì',2349,2349),('ÉØÀÁ¹',2053,2053),('ÈØÀÇѲ¹ì',2046,2046),('ÈØÀÇÔ·Âì',2047,2047),('ÈØÀÈÑ¡´Ôì',2048,2048),('ÊØÃÈÑ¡´Ôì',2360,2360),('ÊØÃÊÔ·¸Ôì',2361,2361),('ÊØÀѤ',2330,2330),('ÊØÃѪ¹Õ¡Ã',2362,2362),('ÊØÀѵÃÒ',2331,2331),('ÊØÃѵÂÒ',2367,2367),('ÊØÃѵ¹Ç´Õ',2365,2364),('ÊØÃѵ¹ì',2363,2363),('ÊØÃѵ¹ìÇ´Õ',2364,2365),('ÊØÃѵ¹Ò',2366,2366),('ÊØÀÑ·ÃÒ',2332,2332),('ÊØÀÒ',2333,2333),('ÊØÀÒÀóì',2338,2338),('ÊØÃÕÂì',2381,2381),('ÊØÃÕÂì¾Ã',2382,2382),('ÊØÃÕÃѵ¹ì',2383,2383),('ÊØÃÔÂѹ',2375,2375),('ÊØÃÔÂѹµì',2376,2376),('ÊØÃÔÂÒ',2377,2377),('ÊØÃÕÁÒÈ',2380,2380),('ÊØÃÔ§Èì',2371,2371),('ÊØÀÒôÕ',2339,2339),('ÊØÃÔ¹',2372,2372),('ÊØÃÔ¹µì',2373,2373),('ÊØÃÔ¾§Èì',2374,2374),('ÊØÀÒÇ´Õ',2340,2340),('ÈØÀÔÊÃÒ',2049,2049),('ÊØÁÒÊÕ',2345,2345),('ÊØÁÒÅÕ',2344,2344),('ÊØÃÒ§¤¹Ò',2368,2368),('ÊØÃÔªÑÂ',2369,2369),('ÊØÀÔ­­Ò',2341,2341),('ÊØÀÒ³Õ',2334,2334),('ÊØÁÔµÃ',2346,2346),('ÊØÁÔµÃÒ',2347,2347),('ÊØÃÕ¸Ò¾Ã',2378,2378),('ÊØÃÔ¹·Ãì',2370,2370),('ÊØÀÒ¾',2335,2335),('ÊØÀÒ¾Ã',2336,2336),('ÊØÃÕ¾Ã',2379,2379),('ÊØÀÒ¾Ãó',2337,2337),('ÈØÀÅѡɳì',2045,2045),('ÈØÀ¡Ã',2037,2037),('ÈØÀ¡Ô¨',2038,2038),('ÊØÀ¡Ô¨',2326,2326),('ÊØáԨ',2350,2350),('ÈØÀªÑÂ',2039,2039),('ÊØêÑÂ',2351,2351),('ÊØÀªÒ',2327,2327),('ÊØêҵÔ',2352,2352),('ÊØ÷Թ',2355,2355),('ÊØà·¾',2289,2289),('ÊØÁ¹Ò',2343,2343),('ÊØ๵Ã',2307,2307),('ÊØÁ¹µì',2342,2342),('ÈØÀ¾Ã',2040,2040),('ÊØþѹ¸ì',2358,2358),('ÊØþѹ¸Øì',2359,2359),('ÊØþÅ',2357,2357),('ÊØþ§Éì',2356,2356),('ÊØÇÃó',2386,2386),('ÊØÇÃóÒ',2388,2388),('ÊØÇÃóÕ',2389,2389),('ÊØÇÃóÕÂì',2390,2390),('ÊØÇÃóªÑÂ',2387,2387),('ÊØÇÃѵ¹ì',2391,2391),('ÊØÇÀÑ·Ãì',2385,2385),('ÊØÇѲ¹ì',2392,2392),('ÊØÇѲ¹ìªÑÂ',2393,2393),('ÊØÇѲ¹Ò',2394,2394),('ÊØÇѵªÑÂ',2395,2395),('ÊØÇÔÃѪ',2402,2402),('ÊØÇÒÃÕ',2396,2396),('ÊØÇÔÁÅ',2401,2401),('ÊØÇÔªÑÂ',2397,2397),('ÊØÇÔªÒ',2398,2398),('ÊØÇÔ´Ò',2399,2399),('ÊØÇÔ·Âì',2400,2400),('ÊØËÑʪÒ',2404,2404),('ÊØÊÔÃÔ',2403,2403),('ÊØÅÑ´´Ò',2384,2384),('ÊØ¡ÃÕ',2232,2232),('ÊØ¡Ñ­­Ò',2233,2233),('ÊØ¡Ô¨',2235,2235),('ÊØ¡ÔµÔì',2236,2236),('ÊØ¡ÕµÔì',2237,2237),('ÊØ¡Ò¹´Ò',2234,2234),('ÊØ¡ØÁÒ',2238,2238),('ÊØ¢',2239,2239),('ÊØ¢ÊÇÑÊ´Ôì¡Å¡ÒÃ',2242,2242),('ÊØ¢Êѹµì',2243,2243),('ÊآĴÕ',2241,2241),('ÊØ¢ªÒÂ',2240,2240),('ÊØ¢ØÁ',2244,2244),('Êؤ¹¸ì',2245,2245),('Êؤ¹¸Ò',2246,2246),('ÊبÒÃÕ',2247,2247),('ÊبԵ',2248,2248),('ÊبԵÃÒ',2250,2250),('ÊبԵµÒ',2249,2249),('ÊبԹ´Ò',2251,2251),('ÊبԹµì',2252,2252),('ÊبԹµ¹ì',2253,2253),('ÊتÑÂ',2255,2255),('ÊتÒÂ',2258,2258),('ÊتÒÊÔ¹Õ',2259,2259),('ÊتҴÒ',2256,2256),('ÊتԵ',2260,2260),('ÊتҵÔ',2257,2257),('ÊتԹ',2261,2261),('ÊتÅ',2254,2254),('ÊرÒÁÒÈ',2262,2262),('ÊسÕ',2263,2263),('ÊØ´ÊÇÒ·',2265,2265),('Êشʧǹ',2264,2264),('ÊØ´Ò',2266,2266),('ÊØ´ÒÃѵ¹ì',2270,2270),('ÊØ´ÒÀÒ',2269,2269),('ÊØ´ÒÃÒ',2271,2271),('ÊØ´Õà¾é¹·ìà«ç¹àµÍÃì',2272,2272),('ÊØ´ÒªÅÕ',2267,2267),('ÊØ´Ò¾Ã',2268,2268),('ÊØ·ÃÕ',2282,2282),('ÊØ·ÑÈ',2283,2283),('ÊØ·Ñȹì',2284,2284),('ÊØ·ÔÈÒ',2288,2288),('ÊØ·ÔµÂì',2285,2285),('ÊØ·Ô¹',2286,2286),('ÊØ·Ô¾Ò',2287,2287),('ÊØ·¸ÔÇѲ¹ì',2280,2280),('ÊØ·¸ÔÈÑ¡´Ôì',2281,2281),('ÊØ·¸Ô쾧Éì',2278,2278),('ÊØ·¸Ô¡Ò¨',2274,2274),('ÊØ·¸ÔªÑÂ',2275,2275),('ÊØ·¸Ò·Ô¾Âì',2273,2273),('ÊØ·¸Ô¹Ñ¹·ì',2276,2276),('ÊØ·¸Ô¹Õ',2277,2277),('ÊØ·¸Ô¾Ãó',2279,2279),('ÊظÕ',2294,2294),('ÊظÕÃì',2295,2295),('ÊظÕÃÒ',2296,2296),('ÊظÔÈÑ¡´Ôì',2293,2293),('ÊظԴÒ',2292,2292),('ÊظҷԾÂì',2290,2290),('ÊظҹԸÔ',2291,2291),('Êعѷ·Õ',2299,2299),('Êعѹ·ì',2300,2300),('Êعѹ·Ò',2301,2301),('ÊعÕÂì',2306,2306),('ÊعÔÈÒ',2303,2303),('ÊعÔÉÒ',2304,2304),('ÊعÔÊÒ',2305,2305),('ÊعԵÒ',2302,2302),('Êع·Ã',2297,2297),('Êع·ÃÕ',2298,2298),('ÊØ»ÃÐÇÕ³ì',2309,2309),('ÊØ»ÃдÔÉ°ì',2308,2308),('ÊØ»ÃÕÃдÒ',2312,2312),('ÊØ»ÃÕÂÒ',2311,2311),('ÊØ»ÃÒ³Õ',2310,2310),('Êػѭ­Ò',2313,2313),('ÊؾÃ',2316,2316),('ÊؾÃÃÉÒ',2318,2318),('ÊؾÃóÕ',2317,2317),('ÊؾѲ¹ì',2320,2320),('ÊؾѵÃÒ',2321,2321),('ÊؾÕÃìªÑÂ',2325,2325),('ÊؾÔÈ',2324,2324),('ÊؾԪ­ìª­Ò',2322,2322),('ÊؾԹ',2323,2323),('ÊؾÅ',2319,2319),('Êؾ¨ÁÒÅÂì',2315,2315),('Êؾ¨¹ì',2314,2314),('GEORGE',21,21),('Í.à¨ÃÔ­ÎÒÃì´áÇÃì',2457,2457),('ÍÁÃÃѵ¹ì',2515,2515),('ÍÁÃà·¾',2514,2514),('ÍÁÃÈÑ¡´Ôì',2516,2516),('ÍÁÃÊÔÃÔ',2517,2517),('ÍÃÀÑ·Ãì',2534,2534),('ÍÁÃÒÅѡɳì',2518,2518),('ÍÃæÂì',2535,2535),('ÍÁêÑÂ',2513,2513),('ÍÃó¾',2536,2536),('ÍÃöÊÔ·¸Ôì',2540,2540),('ÍÃö¾Ã',2538,2538),('ÍÃö¾Å',2539,2539),('ÍÃö¾¹¸ì',2537,2537),('ÍÃ๵Ã',2530,2530),('ÍÃÇÃó',2542,2542),('ÍÃÇÔ· ÍÔ¹àµÍÃì๪Ñè¹á¹Å',2543,2543),('ÍÃÈÁ',2544,2544),('ÍÃÈÃÕ',2545,2545),('ÍÃÊÒ',2546,2546),('ÍÃèÒÁÈÃÕ',2551,2551),('ÍÃ͹§¤ì',2547,2547),('ÍÃÍØÁÒ',2548,2548),('ÍÃÑ­',2549,2549),('ÍÃÑ­­Ò',2550,2550),('ÍÀѹµÃÕÊì',2496,2496),('ÍÀÔÃÑ¡Éì',2507,2507),('ÍÃÔÂÒ',2555,2555),('ÍÃÔÂÒÀóì',2556,2556),('ÍÀÔÀÒ´Ò',2505,2505),('ÍÀÔવ',2501,2501),('ÍÀÔôÕ',2506,2506),('ÍÀÔà´ª',2503,2503),('ÍÀÔÇѲ¹ì',2508,2508),('ÍÀÔÇѹ·ì',2509,2509),('ÍÀÔÊÃ',2511,2511),('ÍÃÔÈÃÒ',2557,2557),('ÍÃÔÊÃÒ',2558,2558),('ÍÀÔÈÑ¡´Ôì',2510,2510),('ÍÃÔÊÒ',2559,2559),('ÍÀÔÊÔ·¸Ôì',2512,2512),('ÍÀÔªÑÂ',2497,2497),('ÍÃÔªÑÂ',2552,2552),('ÍÀÔªÒ µÔ',2498,2498),('ÍÀÔªÒµ',2499,2499),('ÍÀÔªÒµÔ',2500,2500),('ÍÀÔ­­Ò',2502,2502),('ÍÁÔµÒ',2519,2519),('ÍÀԹѹ·ì',2504,2504),('ÍÃÔ¹ª¹Ò',2553,2553),('ÍÁÔ¹µÒ',2520,2520),('ÍÃÔ¹·ÁÒ',2554,2554),('ÍÃÄ´Õ',2541,2541),('ÍèÔÃÒ',2522,2522),('ÍêÃ',2523,2523),('ÍêسËì',2524,2524),('Íóѭªì',2525,2525),('Íâ³·ÂÒ',2459,2459),('Í÷ÑÂ',2526,2526),('Í÷ԪÒ',2527,2527),('ÍùԵÂì',2528,2528),('Í⹪Ò',2495,2495),('Íùت',2529,2529),('ÍþÃó',2531,2531),('ÍþԹ',2532,2532),('ÍþԹ·Ãì',2533,2533),('ÍÃس',2560,2560),('ÍÃسÃѵ¹ì',2561,2561),('ÍÃسÃØè§',2562,2562),('ÍÃسÈÃÕ',2563,2563),('ÍÃسÕ',2564,2564),('ÍÂظÂѹ',2521,2521),('ÍǪÑÂ',2567,2567),('ÍÐÅÒ¹',2574,2574),('ÍФÙà·ç¤·ì',2573,2573),('ÍéÍ·ԾÂì',2571,2571),('ÍéÒÂÍÔé§',2612,2612),('ÍÍâµàÁªÑè¹à«ÍÃìÇÔÊ',2570,2570),('ÍÍÊ·ì ÍÍÂÊì',2572,2572),('ÎÍÊ·ì ÍÍÂÅì',2723,2723),('ÍͤµéÒ àÁÁâÁàÃÕÂÅ',2568,2568),('ÍͤµéÒàÁÁâÁàÃÕÂÅ',2569,2569),('ÍÑÁä¾ÇÃó',2594,2594),('ÍÑÁ¾Ã',2592,2592),('ÍÑÁ¾Ãó',2593,2593),('ÍѤÃà´ª',2575,2575),('ÍѤÃÇÔ·Âì',2578,2578),('ÍѤÃÇÔ¹·ì',2579,2579),('ÍѤÃÒ',2580,2580),('ÍѤþѨ¹ì',2577,2577),('ÍѤþ¹¸ì',2576,2576),('ÍѧʹÒ',2581,2581),('ÍѨ©ÃÒ',2582,2582),('ÍѪÂÒ',2583,2583),('ÍÑ­ªÅÕ',2587,2587),('ÍÑ­ª³Ò¾Ã',2584,2584),('ÍÑ­ª´Ò',2585,2585),('ÍÑ­ª¹Ò',2586,2586),('ÍÑ­ªØÅÕ',2588,2588),('ÍÑ®ÉÁÒ',2589,2589),('ÍѹÊÃÕÂì',2590,2590),('ÍÑ»ÊÃ',2591,2591),('ÍÒÃÂѹ',2616,2616),('ÍÒÃÂÒ',2617,2617),('ÍÔÁâ¡éá¾ç¤ ¤ÍÃì»ÍÃìàêÑè¹',2641,2641),('ÍÒÀóì',2606,2606),('ÍÒÃÁ³ì',2615,2615),('ÍÒÃì«Õ ¹ÔµáÇÃì',2613,2613),('ÍÒÃì«Ø»à»ÍÃì⫹Ԥ¾Ô¤ÍѾÊì',2614,2614),('ÍÒÃÑ¡Éì',2618,2618),('ÍÒÀÒ',2607,2607),('ÍÒÃÕ',2621,2621),('ÍÓÀÒ',2633,2633),('ÍÒÀÒÀóì',2611,2611),('ÍÒÃÕÂì',2622,2622),('ÍÒÃÕÂì àÊÁÒ©ÔÁ (ä·Âູ¡Ñ¹',2623,2623),('ÍÒÃÕÃѵ¹ì',2624,2624),('ÍÒÃÔÂÒ',2620,2620),('ÍÒÃÕÇÃó',2625,2625),('ÍÒÀÒ¡Ã',2608,2608),('ÍÒÀÒ³Õ',2609,2609),('ÍÒÀÒ¾Ã',2610,2610),('ÍÒÃÒ¾Ã',2619,2619),('ÍÔÈÃÒ',2642,2642),('ÍÔê¡«èÒ ÍÔ¹àµÍÃì๪Ñè¹á¹Åਹà¹ÃÑÅ à«ÅÅì',2634,2634),('ÍÓä¾',2632,2632),('ÍÒ¤Á',2595,2595),('Íԧ˷ÑÂ',2635,2635),('ÍÒ¨³Ã§¤ì',2596,2596),('ÍÒ«ÒÎÕ-ä·Â ÍÑÅÅÍÂ',2597,2597),('ÍҳѹÂì',2598,2598),('ÍÒ·Ô¡Ã',2599,2599),('ÍÕ·Õ«Õ',2643,2643),('ÍÒ·Ôµ',2600,2600),('ÍÔ·¸Ô¾Å',2636,2636),('ÍÔ¹àµÍÃìàÇç·(»ÃÐà·Èä·Â)',2638,2638),('ÍÓ¹ÇÂ',2626,2626),('ÍҹѴ',2603,2603),('ÍҹѹµÂÒ',2604,2604),('ÍÓ¹Ò¨',2627,2627),('ÍԹ䫷ìà¤Á',2637,2637),('ÍÔ¹·ÔÃÒ',2639,2639),('ÍÒ¹¹·ì',2601,2601),('ÍÒ¹¾',2602,2602),('ÍÒ¹ØÀÒ¾',2605,2605),('ÍÔ¾',2640,2640),('ÍÓ¾Ã',2628,2628),('ÍÓ¾Ãó',2629,2629),('ÍӾѹ¸ì',2631,2631),('ÍÓ¾Å',2630,2630),('ÎÙàÇÍÃìÍصÊÒË¡ÃÃÁ(»ÃÐà·Èä·Â)',2724,2724),('Íŧ¡Ã³ì',2566,2566),('Íŧ¡µ',2565,2565),('ͧÍÒ¨',2458,2458),('Í´Ôàá',2460,2460),('Í´ÔÈÃ',2461,2461),('Í´ÔÈÑ¡´Ôì',2462,2462),('Í´ØÅ',2463,2463),('Í´ØÅÂìà´ª',2465,2465),('Í´ØžѲ¹ì',2464,2464),('͵Թت',2466,2466),('͵ԾÃ',2467,2467),('ͶԪÒ',2468,2468),('͸Ի¾Å',2469,2469),('͹ÇѪ',2473,2473),('͹ѭ­Ò',2474,2474),('͹ѹµÈÑ¡´Ôì',2476,2476),('͹ѹµì',2475,2475),('͹§¤ìÇÃó',2471,2471),('͹§¤ì¹Ò®',2470,2470),('͹¹·ì',2472,2472),('͹ØÃÑÉì',2491,2491),('͹ØÃÑ¡Éì',2489,2489),('͹ØÃѵ¹ì',2490,2490),('͹ØÇѲ¹ì',2492,2492),('͹ØÊóì',2494,2494),('͹ØÈÑ¡´Ôì',2493,2493),('͹ءԵÔ',2477,2477),('͹ءÙÅ',2478,2478),('͹تÒ',2479,2479),('͹تԵ',2480,2480),('͹شÒ',2481,2481),('͹صÃ',2483,2483),('͹صµÃÒ',2482,2482),('͹طԵÒ',2484,2484),('͹ؾÃ',2487,2487),('͹ؾѹ¸ì',2488,2488),('͹ؾ§Èì',2485,2485),('͹ؾ§Éì',2486,2486),('ÍØÁÒ',2665,2665),('ÍØÃÕÂì',2667,2667),('ÍØÁÒ¾Ã',2666,2666),('ÍØà·¹·Ãì',2660,2660),('ÍØÉÒ',2673,2673),('ÍØÊÒËì',2674,2674),('ÍØè§á¤Ð',2644,2644),('ÍØɳÕ',2672,2672),('ÍØè¹ã¨',2661,2661),('ÍØÌÒÃ',2675,2675),('ÍØäÃ',2668,2668),('ÍØäÃÃѵ¹ì',2670,2670),('ÍØäÃÇÃó',2671,2671),('ÍØäþÃ',2669,2669),('ÍسÒÇ´Õ',2645,2645),('ÍØ´Á',2646,2646),('ÍØ´Ã',2654,2654),('ÍØ´ÁàÁ´Ô¤ÍÅ ÍÔ¤ÇÔ»àÁé¹',2650,2650),('ÍØ´ÁÇþѹ¸ì',2652,2652),('ÍØ´ÁÈÑ¡´Ôì',2653,2653),('ÍØ´ÁÅѡɳì',2651,2651),('ÍØ´Á¾Ã',2648,2648),('ÍØ´Á¾Ñ¹¸ì',2649,2649),('ÍØ´Á¾§Èì',2647,2647),('ÍصâÁ·Âì',2655,2655),('ÍصÊÒË¡ÃÃÁ¼éÒà¤Å×ͺ¾ÅÒʵԡä·Â',2656,2656),('ÍØ·ÑÂ',2657,2657),('ÍØ·ÑÂÇÃó',2658,2658),('ÍØ·ØÁ¾Ã',2659,2659),('ÍغÅ',2662,2662),('ÍغÅÇÃó',2664,2664),('ÍغžÃó',2663,2663),('KAWAIJIT',22,22),('KAWALJIT',23,23),('KOJI',24,24),('LOUIS',25,25),('PETER',26,26),('SHERMAN',27,27),('TAN',28,28),('Willem Arnold',29,29),('WONG',30,30),('WU',31,31),('ÅÐÁèÍÁ',1718,1718),('ÅÐàÍÕ´',1721,1721),('ÅÐÁÑÂ',1719,1719),('ÅÐÍͧ´ÒÇ',1720,1720),('ÅÑ¡ÉÁÕ',1724,1724),('ÅѡɳÒ',1723,1723),('ÅÑ¡¢³Ò',1722,1722),('ÅÑ­ª¹Ò',1725,1725),('ÅÑ´´Ò',1726,1726),('ÅÑ´´ÒÇÃó',1727,1727),('ÅÑ´´ÒÇÑÅÂì',1728,1728),('ÅÑ·¸ÈÑ¡´Ôì',1729,1729),('ÅÔÁ',1734,1734),('ÅÒÇѳÂì',1730,1730),('ÅÔÅÒÀóì',1735,1735),('ÅÓäÂ',1732,1732),('ÅÓä¾',1731,1731),('ÅÔ¹´ÒÇÃó',1733,1733),('ÅÅÔ´Ò',1716,1716),('ÅÅÔµÒ',1717,1717),('Å×ͪÑÂ',1736,1736),('äÁµÃÕ',1596,1596),('äÇ·Ô¹',1953,1953),('äÍ.àÍÊ.äÍ.ÍÔ¹àµÍÃì๪Ñè¹á¹Å',2721,2721),('äÍ.«Õ.«Õ.ÍÔ¹àµÍÃì๪Ñè¹á¹Å (ÁËÒª¹)',2718,2718),('äÍ.·Õ.áÍ´ìÇÒ¹« à·¤ ¨Ó¡Ñ´',2719,2719),('äÍ.·Õ.á͹´ìÇÒ¹« à·¤ ¨Ó¡Ñ´',2720,2720),('äÍÂàÃÈ',2722,2722),('ä¡Ãà·¾',215,215),('ä¡Ã¤Ó',214,214),('ä¡Ã¸ÇѪ',216,216),('äªÂÃѵ¹ì',575,575),('äªÂÁ§¤Å',574,574),('äªÂÒ',576,576),('äªÂ¹Ñ¹·¹ì',573,573),('ä´ÍСÅêÒÊ',709,709),('äµÃç¤ì',726,726),('äµÃà·¾',725,725),('äµÃ·È',724,724),('ä·Â',805,805),('ä·Â ¤Í¹Êì á͹´ì ºÔÅ´Ôé§',806,806),('ä·Â ´Õ à͹ ·Õ ྐྵ·ì',807,807),('ä·Â-àÍà«Õ ¾Õ.ÍÕ.ä¾é¾ì',824,808),('ä·ÂàÇŤ͹ÍصÊÒ¡ÃÃÁ',821,822),('ä·ÂÂÙà¹Õ¹¤ÇÍÅÅÔµÕé',820,821),('ä·Âà¡ÃÕ§ÊÔ觷Í',808,809),('ä·Âà¤ÁÕÀѳ±ì',810,811),('ä·Âà«çÅ·ÃÑÅà¤ÁÕ ª¹)',813,814),('ä·Âà«ç¹·ÃÑÅ à¤ÁÕ ª¹)',811,812),('ä·Âà«ç¹·ÃÑÅà¤ÁÕ',812,813),('ä·Âà¾ÔèÁ¾ÅÒʵԡ',819,820),('ä·ÂÍÔ¹àµÍÃì ÍÐâÃàÁµÔ¡Êì',823,824),('ä·ÂÍÔ¹àµÍÃì ¤ÍµµÍ¹¡Ò÷Í',822,823),('ä·Â¤Òà«ÎÔ¹',809,810),('ä·Â´Õà͹·Õྐྵ·ì',814,815),('ä·Âµ§¹ÔµµÔé§',815,816),('ä·Â¸Ò¹Õà¤ÁÕ',817,818),('ä·Â¸¹Ò¾Ò³ÔªÂì',816,817),('ä·Â¾ÃçÍ¡«ì',818,819),('Ä·¸Ôì',1714,1714),('Ä·¸ÔªÑÂ',1715,1715),('ä¼·',1292,1292),('ä¾àÃÒÐ',1485,1485),('ä¾âè¹ì',1486,1486),('ä¾ÃÊÔ·¸Ôì',1481,1481),('ä¾Ãʳ±ì',1480,1480),('ä¾ÃѪ',1482,1482),('ä¾Ãѵ¹ì',1483,1483),('ä¾ÃÔ¹·Ãì',1484,1484),('ä¾ÃÄ·¸Ôì',1479,1479),('ä¾ÇÑÅÂì',1488,1488),('ä¾ÈÔÃÔ',1490,1490),('ä¾ÈÒÅ',1489,1489),('ä¾ÊÔ°',1491,1491),('ä¾ÅÔ¹',1487,1487),('ä¾±ÙÃÂì',1477,1477),('侺ÙÅÂì',1478,1478),('¡.µÃÕ·Ô¾Âì ¤Í¹«ÑÅáµ¹·ì',32,32),('¡ÃíԡÒÃì',65,65),('¡ÃóԡÒ',66,66),('¡ÃóԡÒÃì',67,67),('¡ÃÇÔ·Âì',69,69),('¡ÃÇÅÑÂ',68,68),('¡ÃШ¡ä·ÂÍÒ«ÒÎÕ',72,72),('¡Ãͧá¡éÇ',70,70),('¡Ãͧ·Ô¾Âì',71,71),('¡ÃÕ±Ò',73,73),('¡ÁÅ',49,49),('¡ÁÅÃѪµì',55,55),('¡ÁÅÃѵ¹ì',56,56),('¡ÁÅÁÒÅÂì',54,54),('¡ÁÅÇÃó',57,57),('¡ÁũѵÃ',50,50),('¡ÁÅ·Ô¾Âì',51,51),('¡ÁžÃ',52,52),('¡ÁžÃó',53,53),('¡Ã¡ÁÅ',60,60),('¡Ã¡¹¡',58,58),('¡Ã¡¾Ã',59,59),('¡ÃªÑÂ',61,61),('¡Ã³ì',62,62),('¡Ã¹Ñ¹·ì',63,63),('¡Ã»ÃÕÂÒ',64,64),('¡Ãا෾¼ÅÔµàËÅç¡',74,74),('¡Ãاä·ÂÍØ»¡Ã³ì',76,76),('¡Ãاä·Â¤ÒÃìàÃé¹·ì ÍÔ¹àµÍÃì๪Ñè¹á¹Å',75,75),('¡ÃسÒ',77,77),('¡ÇÕ',93,93),('¡ÉÁÒ',94,94),('¡èÍà¡ÕÂõÔ',98,98),('¡ÊÔÇѹ',97,97),('¡ÉÔª­ì',95,95),('¡ÉÔ´ÔÈ',96,96),('¡Íºá¡éÇ',100,100),('¡ÍºÅÒÀ',102,102),('¡Íº¡ØÅ',99,99),('¡ÍººØ­',101,101),('¡Ñ ÅÂÒ',103,103),('¡ÑÁ»¹Ò¶',117,117),('¡ÑÁ»¹Ò·',118,118),('¡ÑÅÂÒ',119,119),('¡ÑÅÂÒÃѵ¹ì',121,121),('¡ÑÅÂÒ³Õ',120,120),('¡Ñ­ª¾Ã',104,104),('¡Ñ­­ÀѤ',105,105),('¡Ñ­­ìÇÃÒ',106,106),('¡Ñ­­ÒÁÒÈ',107,107),('¡Ñ­­ÒÇÕÃì',108,108),('¡Ñ³°Ô¡Ò',110,110),('¡Ñ³°ªÒ',109,109),('¡Ñ³·ÔÁÒ',111,111),('¡Ñ¹ÂÒÃѵ¹ì',116,116),('¡Ñ¹µì',112,112),('¡Ñ¹µÔ¡Ã',113,113),('¡Ñ¹¸ÔÁÒ',115,115),('¡Ñ¹¸ÔªÒ',114,114),('¡ÒÃÇÔÍÃ',128,128),('¡ÒÂÊÔ·¸Ôì',127,127),('¡Óá˧',134,134),('¡ÔÁÅÑé§',157,157),('¡ÕõÔ',158,158),('¡ÒÃسÕ',129,129),('¡ÒÈÔ',130,130),('¡Ô觡ҭ¨¹ì',135,135),('¡ÓäÃ',133,133),('¡Ô¨ÇÃó',137,137),('¡Ô¨µÔÂÒ',136,136),('¡Ò­¨¹ÇÃó',122,122),('¡Ò­¨¹Ò',123,123),('¡ÔµÔ¡Ã',153,153),('¡ÔµÔ¡Ã³ì',154,154),('¡ÔµÔ¡Ñ­­Ò',155,155),('¡ÔµÔªÒ­',156,156),('¡ÔµµÔ',138,138),('¡ÔµµÔÃѵ¹ì',150,150),('¡ÔµµÔÁÒ',148,148),('¡ÔµµÔÂÒ',149,149),('¡ÔµµÔÇѲ¹ì',151,151),('¡ÔµµÔÈÑ¡´Ôì',152,152),('¡ÔµµÔ¡Ñ¹µì',139,139),('¡ÔµµÔªÑÂ',140,140),('¡ÔµµÔ­Ò',141,141),('¡ÔµµÔ¹Ñ¹·ì',142,142),('¡ÔµµÔ¾Ñ²¹ì',146,146),('¡ÔµµÔ¾Ñ¹¸ì',147,147),('¡ÔµµÔ¾Å',145,145),('¡ÔµµÔ¾§Èì',143,143),('¡ÔµµÔ¾§Éì',144,144),('¡Ó¸Ã',131,131),('¡Ò¹´Ò',124,124),('¡Ò¹µì',125,125),('¡Ò¹µìÃÇÕ',126,126),('¡Ó¾Å',132,132),('¡Ùê´ÇÔÅ ÍÔ¹´ÑʵÃÕé',169,169),('¡ÄÉ®Ò',84,84),('¡ÄÉ®Õ',85,85),('¡ÄɮվÃ',86,86),('¡ÄɳÐ',89,89),('¡ÄɳÒ',90,90),('¡ÄɳÕ',91,91),('¡Äɳ¾Å',88,88),('¡Äɳ¾¨¹ì',87,87),('¡ÄÉ´Ò',92,92),('¡ÄȾÃó',83,83),('¡ÄªÇÃó',78,78),('¡ÄµÂÒ',80,80),('¡ÄµÔÂÒ',82,82),('¡ÄµÔ¡Ò¹·ì',81,81),('¡Äµº¾Ô¸',79,79),('¡ªÁÅ',35,35),('¡ª¡Ã',33,33),('¡ª¾Ã',34,34),('¡µÑ­­Ù',36,36),('¡¹ÔÉ°Ò',48,48),('¡¹¡',37,37),('¡¹¡Ãѵ¹ì',43,43),('¡¹¡ÇÃó',45,45),('¡¹¡ÈÃÕ',46,46),('¡¹¡Ò­¨¹ì',47,47),('¡¹¡Ä·¸Ôì',44,44),('¡¹¡¡Ò­¨¹ì',38,38),('¡¹¡ªÑÂ',39,39),('¡¹¡¹ÔÀÒ',40,40),('¡¹¡¹Øª',41,41),('¡¹¡¾Ã',42,42),('¡ØÁØ·¾Ñ¹¸ì',159,159),('¡ØéÂà«é§ ÍÔÁ»ÍÃìµ á͹´ì àÍç¡«ì»ÍÃìµ',160,160),('¡ØËÅÒº',168,168),('¡ØÊØÁÒ',167,167),('¡ØÅÂÒ',163,163),('¡ØÅÇ´Õ',165,165),('¡ØÅÈÔÃÔ',166,166),('¡ØÅÅ´Ò',164,164),('¡ØŹѹ·ì',161,161),('¡ØŹÒÃÕ',162,162),('¢ÇÑ­àÁ×èͧ',228,228),('¢ÇÑ­àÃ×͹',231,231),('¢ÇÑ­ã¨',223,223),('¢ÇÑ­à´×͹',225,225),('¢ÇÑ­à¾çªÃ',227,227),('¢ÇÑ­ÃØé§',230,230),('¢ÇÑ­ÂؾÒ',229,229),('¢ÇÑ­ªÑÂ',224,224),('¢ÇÑ­µÒ',226,226),('¢éÒÇÍÔèÁ·Ô¾Âì',233,233),('¢ÑµµÔÂÒ³Õ',232,232),('¢¨Ã',217,217),('¢¨Ãà¡ÕÂõÔ',218,218),('¢¨ÃÈÃÕ',219,219),('¢¨ÃÈÑ¡´Ôì',220,220),('¢¹ÔÉ°ì',221,221),('¢¹ÔÉ°Ò',222,222),('¢Ø¹·Í§',234,234),('¤Áà¾çªÃ',249,249),('¤ÃÒ¿·ìà´ÍÐàºÊ·ì',250,250),('¤Á¡ÃÔª',247,247),('¤Á¨Ñ¡Ã',248,248),('¤àª¹·Ãì',238,238),('¤à³È',244,244),('¤à¹Âì',246,246),('¤ÍÊÁÔ¤ ¤Í¹¤ÍÃì´ ¤ÍÃì»ÍàêÑè¹',251,251),('¤ÔÁ§¤ì',257,257),('¤Óá˧',256,256),('¤ÒÃìâ»Ãà¿ÊªÑè¹á¹Å',253,253),('¤Óó',255,255),('¤ÒÇÒ¤Ô¹',254,254),('¤Ò«ÙâÍÐ',252,252),('¤ÙèºØ­',260,260),('¤Ù»Ò¹Ò',261,261),('¤§à´ª',237,237),('¤§¡ÄÈ',236,236),('¤³ÒÇزÔ',240,240),('¤³ÔÈÃ',241,241),('¤³ÔÊÃ',242,242),('¤³Ò¡Ã',239,239),('¤³ØµÁì',243,243),('¤¸Ò',245,245),('¤Ø³Ò¡Ã',258,258),('¤Ø³Õ·Ã',259,259),('§ÒÁà¾ç­',273,273),('§ÒÁ¹Ô¨',272,272),('¨àÃ',298,298),('¨ÃÃÂÒ',285,285),('¨àÃÈÑ¡´Ôì',299,299),('¨ÃÇÃø¹ì',287,287),('¨ÃǾÃ',286,286),('¨ÃÑʪÑÂ',290,290),('¨ÃÑʾÅ',291,291),('¨ÃÑÅ',289,289),('¨ÃÑ­',288,288),('¨ÃÔÂÒ',294,294),('¨ÃÔÂÒÀóì',295,295),('¨ÃÔ¹·Ãì',292,292),('¨ÃÔ¹¸Ã',293,293),('¨ÃÙ­',297,297),('¨ÃظԴÒ',296,296),('¨ÍÁ¢ÇÑ­ã¨',300,300),('¨Ñ¡ÃÇÒÅ',304,304),('¨Ñ¡Ãѵ¹ì',305,305),('¨Ñ¡ÃÕ',307,307),('¨Ñ¡ÃÔ¹·Ãì',306,306),('¨Ñ¡Ã¡Äɳì',302,302),('¨Ñ¡Ã¡Äª',301,301),('¨Ñ¡Ã¾Ñ¹¸ì',303,303),('¨Ñ¡ÉÇѯ',308,308),('¨Ñ´ËÒ§Ò¹ÎÔÇáÁ¹àÍ繨Ôà¹ÕÂÃÔè§',309,309),('¨ÑµÃ´ÒÇ',310,310),('¨Ñ¹¨ÔÃÒ',311,311),('¨Ñ¹·Ã',314,314),('¨Ñ¹·ÃìÃѵ¹ì',321,321),('¨Ñ¹·Ãìà¨éÒ',315,315),('¨Ñ¹·Ãìà¾ç­',320,320),('¨Ñ¹·ÃìÇÔÁÅ',322,322),('¨Ñ¹·ÃìÇÔäÅ',323,323),('¨Ñ¹·ÃìÊØ´Ò',324,324),('¨Ñ¹·Ãì·Ô¾Âì',316,316),('¨Ñ¹·Ãì¸ÔÀÒ',317,317),('¨Ñ¹·Ãì¹ÀÒ',318,318),('¨Ñ¹·Ãì¾Ã',319,319),('¨Ñ¹·ÔÀÒ',326,326),('¨Ñ¹·ÔÁÒ',327,327),('¨Ñ¹·ÔÃÒ',329,329),('¨Ñ¹·ÔÁÒÀóì',328,328),('¨Ñ¹·Ô¡Ò',325,325),('¨Ñ¹··Õ',312,312),('¨Ñ¹·¹Ò',313,313),('¨ÔÃÀÑ·Ã',361,361),('¨ÔÃÀÒ',362,362),('¨ÓàÃÔ­',344,344),('¨ÔÃÇÃó',363,363),('¨ÔÃÇѲ¹ì',364,364),('¨ÔÃÐÀÒ',369,369),('¨ÕÃÐÇѲ¹ì',386,386),('¨ÔÃÐÈÑ¡´Ôì',370,370),('¨ÕÃйѹ·ì',385,385),('¨ÔÃоÃ',367,367),('¨ÔÃоÃó',368,368),('¨ÔÃÈÑ¡´Ôì',365,365),('¨ÕÃÈÑ¡´Ôì',384,384),('¨ÔÃÊØ´Ò',366,366),('¨ÕâÍà·¤¹Ô¤ (ä·ÂᏴì)',388,388),('¨ÓÃÑÊ',343,343),('¨ÔÃѪ´Ò',371,371),('¨ÔÃÑ°µÔì',372,372),('¨ÔÃÒÀóì',376,376),('¨ÒÃÕÃѵ¹ì',333,333),('¨ÔÃÒÀÒ',377,377),('¨ÔÃÒÂØ',378,378),('¨ÔÃÒÇÃó',379,379),('¨ÔÃÒÇÑÅÂì',380,380),('¨ÔÃÒÇزÔ',381,381),('¨ÔÃÒ¤Á',373,373),('¨ÔÃҹت',374,374),('¨ÔÃÒ¾Ã',375,375),('¨ÔþÃ',359,359),('¨ÕþÃó',383,383),('¨Ôþѹ¸ì',360,360),('¨ÒÃØÃѵ¹ì',338,338),('¨ÒÃØÇÃó',339,339),('¨ÒÃسÕ',334,334),('¨ÒÃسÕÂì',335,335),('¨ÒÃعѹ',336,336),('¨ÒÃغصÃ',337,337),('¨ÕÍÕ á¤»»ÔµÍÅ (»ÃÐà·Èä·Â)',387,387),('¨ÓÅͧ',345,345),('¨Ô³³ì',346,346),('¨ÔµÃÒ',354,354),('¨ÔµÃÒÀóì',355,355),('¨ÔµÃÅ´Ò',353,353),('¨ÔµµÁÒÊ',349,349),('¨Ôµµì',347,347),('¨Ôµµì¹ÔÉÒ',348,348),('¨ÔµµÒ',350,350),('¨ÔµµÔ',351,351),('¨ÔµµÔ¹¹Ñ¹·ì',352,352),('¨ÒµØç¤ì',331,331),('¨ÒµØùµì',332,332),('¨ÒµØ¾Ã',330,330),('¨Õ·Õ«Õ ·Ã§¾Ñ¹¸ì)',382,382),('¨Ó¹§',340,340),('¨Ó¹§¤ì',341,341),('¨Ô¹´Ò',356,356),('¨Ô¹µì¨Ø±Ò',357,357),('¨Ô¹µ¹Ò',358,358),('¨Ó»Õ',342,342),('¨§ÃÑ¡',277,277),('¨§ÃÑ¡Éì',278,278),('¨§Åѡɳì',279,279),('¨§¡Å',275,275),('¨§¡Å³Õ',276,276),('¨µØç¤ì',283,283),('¨µØÄ·¸Ôì',284,284),('¨µØ¾Ã',280,280),('¨µØ¾Ñ¹¸ì',282,282),('¨µØ¾Å',281,281),('¨ØÃÕÃѵ¹ì',395,395),('¨ØÌÒ',397,397),('¨ØÌÒÀóì',398,398),('¨ØÌÒÀÒ',399,399),('¨ØÌÒÅѡɳì',400,400),('¨ØÅÅ´Ò',396,396),('¨Ø±ÒÃѵ¹ì',393,393),('¨Ø±ÒÁÒÈ',391,391),('¨Ø±ÒÁÒÊ',392,392),('¨Ø±ÒÇÃó',394,394),('¨Ø±Ò·Ô¾Âì',389,389),('¨Ø±Ò¾Ñ¹¸ì',390,390),('©ÇÕÇÃó',419,419),('©Íé͹',420,420),('©ÑµÃÀóì',422,422),('©ÑµÃÈÔÃÔ',423,423),('©ÑµÃªÑÂ',421,421),('©Ñ¹·Ãѵ¹ì',425,425),('©Ñ¹·¹Ò',424,424),('©ÅÇÂ',416,416),('©Åͧ',417,417),('©ÅÒ´',418,418),('©×èÍ ¨Ôé¹ ÎÑéÇ',426,426),('©×èͨÔé¹ÎÑéÇ',427,427),('ª.ÊÂÒÁ¨Ñ¡ÃÂÒ¹à´ç¡àÅè¹',437,437),('ªÁ',450,450),('ªÁÀÑÊÊÃ',454,454),('ªÁÀٹت',455,455),('ªÁѾÃ',456,456),('ªÃÑÊÃÒ',463,463),('ªÃѪÊÃÒ',461,461),('ªÃѶ¨Ñ¹·Ãì',462,462),('ªÂÒÀóì',460,460),('ªÃÔ¹Ãѵ¹ì',465,465),('ªÃÔ¹·Ãì',464,464),('ªÂÒ¾Å',459,459),('ªÂ¹',458,458),('ªÁ¾Ù¹Øª',452,452),('ªÁ¾Ù¹Ø·',453,453),('ªÁ¾Å',451,451),('ªÇÔÈÒ',479,479),('ªÇÅÔµ',478,478),('ªÇ¹',475,475),('ªÇ¹ªÁ',476,476),('ªÇ¹¾ÔÈ',477,477),('ªÐÍé͹',485,485),('ªÐ¹ÔÅ',484,484),('ªèÍ',480,480),('ªèÍÍÑ­ªÑ­',483,483),('ªèͩѵÃ',481,481),('ªèÍ·Ô¾Âì',482,482),('ªÑÂÂÐ',509,509),('ªÑÂÂÈ',508,508),('ªÑÂÃѵ¹ì',511,511),('ªÑÂÀÑ·Ã',505,505),('ªÑÂÁ§¤Å',506,506),('ªÑ§³ì',507,507),('ªÑÂà¨ÃÔ­ãªèËÅÕʵÕÅ',496,496),('ªÑÂÂØ·¸',510,510),('ªÑÂÇѲ¹ì',512,512),('ªÑÂÊÔ·¸Ôì',513,513),('ªÑÂÊÔ¹¸Øì',514,514),('ªÑªҭ',498,498),('ªÑª¹Ð',497,497),('ªÑ³ç¤ì',499,499),('ªÑ¸ÇѲ¹ì',500,500),('ªÑ¹ѹ·ì',502,502),('ªÑ¹¤Ã',501,501),('ªÑ¾Ã',503,503),('ªÑ¾Å',504,504),('ªÑªÀÑÊÊÃ',489,489),('ªÑªÀ³',488,488),('ªÑªÁ³±ì',490,490),('ªÑªÁ¹±ì',491,491),('ªÑªÇÒÅÂì',493,492),('ªÑªÇÒÅìÂ',492,493),('ªÑªªÑÂ',486,486),('ªÑª®Ò',487,487),('ªÑ­ÉÒ',495,495),('ªÑ­­Ò',494,494),('ªÒÂ',524,524),('ªÒÇѳÂì',526,526),('ªÕÇÒ¾Ã',534,534),('ªÒÅÕ',525,525),('ªÒ­',515,515),('ªÒ­ÂØ·¸',518,518),('ªÒ­ÈÑ¡´Ôì',519,519),('ªÒ­ªÑÂ',516,516),('ªÒ­³Ã§¤ì',517,517),('ªÔ´ª¹¡',529,529),('ªÒµÃÕ',520,520),('ªÒµÔªÒÂ',521,521),('ªÒ¹',522,522),('ªÔ¹',530,530),('ªÔ¹Ãѵ¹ì',532,532),('ªÔ¹ÇѲ¹ì',533,533),('ªÓ¹Ô',528,528),('ªÓ¹Ò­',527,527),('ªÒ¹¹·ì',523,523),('ªÔ¹¾Ñ¹¸ì',531,531),('ªÙà¡ÉÁ',544,544),('ªÙà¡ÕÂõÔ',545,545),('ªÙÈÑ¡´Ôì',553,553),('ªÙ¨Ôµ',546,546),('ªÙ¨Ôµµì',547,547),('ªÙªÑÂ',548,548),('ªÙªÒµÔ',549,549),('ªÙªÕ¾',550,550),('ªÙ¾§Èì',551,551),('ªÙ¾§Éì',552,552),('ªÅÍ',468,468),('ªÅÍÁ',469,469),('ªÅÒ¡Ã',470,470),('ªÅÔ¡Ò',471,471),('ªÅÔ´Ò',472,472),('ªÅÔµ',473,473),('ªÅÔµÒ',474,474),('ªÅ¸Õ',467,467),('ªÅ¸ÔªÒ',466,466),('ªäÁ¾Ã',457,457),('ª®ÒÃѪ',438,438),('ª´Ò¡Ã',439,439),('ª¹ÁìÊØÇÃó',442,442),('ª¹Ð',443,443),('ª¹Ð⪵Ô',444,444),('ª¹Ñ­­Ò',445,445),('ª¹Ñ°',446,446),('ª¹Ñ¹Àóì',447,447),('ª¹ÒÀÒ',448,448),('ª¹Ô´Ò',449,449),('ª¹¹Ñ¹·ì',440,440),('ª¹¹ÔÈÒ',441,441),('ª×蹨Եµì',535,535),('ªØÁÊÒÂ',542,542),('ªØÁÈÔÃÔ',541,541),('ªØÁ¾Ã',539,539),('ªØÁ¾Å',540,540),('ªØÅÕ¾Ã',543,543),('ªØ´Ò¾Ã',536,536),('ªØµÔÁÒ',538,538),('ªØµÔ¡Ò­¨¹ì',537,537),('«è͹¡ÅÔè¹',577,577),('«Õ àÍç¹ äÍ',580,580),('«Õ ´Õ àÍçÁ àÍç¹àµÍÃìä¾ÃÊì',581,581),('«Õ.ÇÕ.àÍÊ.ÍÔ¹´ÑʵÃÕé',584,584),('«Õ.´Õ.ÍصÊÒË¡ÃÃÁ',582,582),('«Õ.·Õ.à·àŤÍÁ',583,583),('«ÕàÍç¹äÍàÍ繨Ôà¹ÕÂÃÔ觫Ѿ¾ÅÒÂ',586,586),('«Òâµéâ¤à¡ÕÂÇ ¡Ãا෾',578,578),('«Ô¡»éÒ (»ÃÐà·Èä·Â)',579,579),('«Õ´Õ ÍصÊÒË¡ÃÃÁ',585,585),('«Ù',587,587),('­Ò³ÀѤ',590,590),('­Õ¹ÀÒ',591,591),('¯Ç§¡ÁÅ',592,592),('°ÔµÔÃѪµì',605,605),('°ÔµÔÃѵ¹ì',606,606),('°ÔµÔÁÒ',604,604),('°ÔµÔà¸ÕÂÃ',600,600),('°ÔµÔ¡Ò¹µì',598,598),('°ÔµÔ³Ñ°',599,599),('°ÔµÔ¹Ñ¹·ì',601,601),('°ÔµÔ¾Ã',603,603),('°ÔµÔ¾§Èì',602,602),('°Ôµ¡Ò¹µì',597,597),('°Ò¹Ñ¹·ì',593,593),('°Ò¹ÔÊÃ',595,595),('°Ò¹ÔµÂì',594,594),('°Ò»¹ÇÔ·Âì',596,596),('±ÔÁÀì¹Øª',607,607),('³ÀÑ·Ã',609,609),('³Àѷáóì',610,610),('³Ã§ÃÑ¡Éì',617,617),('³Ã§ÈÑ¡´Ôì',619,619),('³Ã§Ä·¸Ôì',618,618),('³Ã§¤ì',611,611),('³Ã§¤ìÇÔ·Âì',615,615),('³Ã§¤ìÈÑ¡´Ôì',616,616),('³Ã§¤ìÄ·¸Ôì',614,614),('³Ã§¤ìªÑÂ',612,612),('³Ã§¤ì¾ÑªÃì',613,613),('³Ë·ÑÂ',620,620),('³ÑªªÒ',621,621),('³Ñ­­Ò',622,622),('³Ñ®°ÁÑÂ',623,623),('³Ñ®°ÇÃó',624,624),('³Ñ¯¾Å',625,625),('³Ñ°',626,626),('³Ñ°ÁÒ',645,645),('³Ñ°ÂÒ',646,646),('³Ñ°ÀÙÁÔ',643,643),('³Ñ°Á¹',644,644),('³Ñ°ÇÃÕÂì',647,647),('³Ñ°ÇѪÃì',648,648),('³Ñ°ÇѲ¹ì',649,649),('³Ñ°ÇѵÔ',650,650),('³Ñ°ÇزÔ',651,651),('³Ñ°ÊÃÑ­',653,653),('³Ñ°ÈÑ¡Âì',652,652),('³Ñ°Ë·ÑÂ',654,654),('³Ñ°Ô¡Ò',655,655),('³Ñ°¡Ã³ÔÈÒ',627,627),('³Ñ°¡Ò¹µì',629,629),('³Ñ°¡ÄµÒ',628,628),('³Ñ°¢¨Ã',630,630),('³Ñ°ªÒ',632,632),('³Ñ°ª¹Ñ­',631,631),('³Ñ°°Ò',633,633),('³Ñ°µÂÒ',634,634),('³Ñ°¹Ñ¹·ì',636,636),('³Ñ°¹¹·ì',635,635),('³Ñ°»¡Ã³ì',637,637),('³Ñ°¾Ã',641,641),('³Ñ°¾Å',642,642),('³Ñ°¾§Èì',638,638),('³Ñ°¾§Éì',639,639),('³Ñ°¾¨¹ì',640,640),('³Õç¤ì',657,657),('³ÔªÒ¡Ã',656,656),('³¸ÔµÒ',608,608),('³Øªª¹Ò',658,658),('´ÃÃ쪹Õ',661,661),('´ÃسÕ',662,662),('´Ç§Ãѵ¹ì',674,674),('´Ç§ã¨',667,667),('´Ç§à´×͹',669,669),('´Ç§Á¹·Ãì',673,673),('´Ç§Ë·ÑÂ',675,675),('´Ç§¡ÁÅ',665,665),('´Ç§¨Ñ¹·Ãì',666,666),('´Ç§´ÒÇ',668,668),('´Ç§¹ÀÒ',670,670),('´Ç§ºÅ',671,671),('´Ç§¾Ã',672,672),('´Í¡äÁé',676,676),('´Õ.ºÕ.ä´Á͹´ì (»ÃÐà·Èä·Â)',695,695),('´Ôàá',692,692),('´ÒÃÒÃѵ¹ì',680,680),('´ÒÃÒÇÃó',681,681),('´ÒÃÔ¡Ò',682,682),('´ÒÃÔ³Õ',683,683),('´ÒÃÔ¹',684,684),('´ÒÃÒ¹ÕÅì',679,679),('´Óç',689,689),('´Óç¤ì',690,690),('´ÒóÕ',677,677),('´ÒùÕÂì',678,678),('´Óà¹Ô¹',688,688),('´ÒÃسÕ',685,685),('´ÒÇÃÕ',687,687),('´ÒÇ»ÃСÒÂ',686,686),('´ÓËÃÔ',691,691),('´ÔÈ¡ØÅ',693,693),('´Ôʷѵ',694,694),('´ÅÄ´Õ',663,663),('´ÅÄ·ÑÂ',664,664),('´¹ÑÂ',659,659),('´¹Ø¾Å',660,660),('´ØÊÔµ',701,701),('´ØÊÔµà¤ÁÕÀѳ±ì',702,702),('´ØÉ®Õ',698,698),('´ØɳÕ',699,699),('´ØÉ´Õ',700,700),('´ØÅÂì¾Ñ²¹ì',697,697),('´ØžÅ',696,696),('µÐÇѹ',712,712),('µÐÅèÍÁÊÔ¹¾ÅÒʵԡ',711,711),('µèͨѡÃ',710,710),('µÑ觨Ñè§ËÅÍ´ä¿',713,713),('µÒà¿ç´',714,714),('µØê',715,715),('µØéÁ',717,717),('µØëÂ',718,718),('µØ꡵Ò',716,716),('µØÅÒÅѡɳì',719,719),('¶ÇÑÅ',729,729),('¶ÇÑÅÂì',730,730),('¶ÇÔÅ',731,731),('¶ÒÇÃ',733,733),('¶Ò³Ø¾§Èì',732,732),('¶¹ÍÁÈÑ¡´Ôì',727,727),('¶¹Ôµ¾Å',728,728),('·ÃÃȹÕÂì',745,745),('·ÃѾÂì¶ÒÇäéÒÇÑÊ´Ø',746,746),('·Ã§',737,737),('·Ã§ÇزÔ',741,741),('·Ã§ÈÃÕ',742,742),('·Ã§ÈÑ¡´Ôì',743,743),('·Ã§ÈÔÃÔ',744,744),('·Ã§ªÑ»Ñè¹·Í',738,738),('·Ã§¸ÃÃÁ',739,739),('·Ã§¾Å',740,740),('·ÇÕ',748,748),('·ÇÕÇѲ¹ì',752,752),('·ÇÕÈÃÕ',753,753),('·ÇÕÈÑ¡´Ôì',754,754),('·ÇÔª',747,747),('·ÇÕªÑÂ',749,749),('·ÇÕ»',750,750),('·ÇÕ¾Ã',751,751),('·èÒ·ÃÒÂá¨é§ÇѲ¹Ò',773,773),('·È¾Ã',755,755),('·È¾Å',756,756),('·Í§ãº',759,759),('·Í§ÊØ¢',763,763),('·Í§ÍÔ¹·Ãì',764,764),('·Í§¢ÒÇ',757,757),('·Í§¤Ó',758,758),('·Í§»Ò¹',760,760),('·Í§¾Ñ¹¸ì',761,761),('·Í§¾Ñ¹¸Øì',762,762),('·ÑÈÇÃó',772,772),('·ÑȹÇÃó',768,768),('·ÑȹÕÂì',770,770),('·ÑȹÕÂÒ',771,771),('·ÑȹվÃ',769,769),('·Ñ¡ÉÁ³¹ì',765,765),('·Ñ´´ÒÇ',766,766),('·Ñº·ÔÁ',767,767),('·Õ «Õ ¾Õ ÍÔ¹´ÑÊ·ÃÕé',791,791),('·Õ.àÍÊ.äÇÃì¤Ñ· á͹´ì áÁªªÕ¹¾ÒÃì·',794,794),('·Õ.äÍ.·Õ.ÍÔ¹àµÍÃì๪Ñè¹á¹Å',795,795),('·Õ.«Õ.«Õ.¾Ãç;à¾ÍÃìµÕé',792,792),('·Õ.«Õ.¾Õ.ÍÔ¹´ÑÊ·ÃÕé',793,793),('·ÕâÍàÍ â´¿à¤Á ÍÔ¹´ÃÑʵÕé',796,796),('·ÔÇÒ',789,789),('·ÔȾÅ',790,790),('·Ô¦ÑÁ¾Ã',774,774),('·Ô¹á¤¹ ÍÔ¹´ÑÊ·ÃÕ',775,775),('·Ô¾ÂìÇÃó',778,778),('·Ô¾ÂìÇÃس',779,779),('·Ô¾ÂìÇÑÅÂì',780,780),('·Ô¾ÂìÇÒÃÕ',781,781),('·Ô¾ÂìÇÔÁÅ',782,782),('·Ô¾ÂìÇ´Õ',777,777),('·Ô¾Âì¾Ò¾Ã',776,776),('·Ô¾ÇÃó',783,783),('·Ô¾ÇÑÅÂì',784,784),('·Ô¾ÇÔÁÅ',785,785),('·Ô¾ÊØ´Ò',786,786),('·Ô¾ÒÇÃó',788,788),('·Ô¾Ò¡Ã',787,787),('·ÙÃ',798,798),('·ÙÁÔ¹Ô·Êì ºÔ«Ôà¹Ê',797,797),('·¹§ÈÑ¡´Ôì',735,735),('·¹Ø',736,736),('¸ÃÃÁÈÒʵÃì',861,861),('¸ÃÃÁ¹Ù­',860,860),('¸à¹È',857,857),('¸à¹ÈÃì',858,858),('¸Á¹Ñ¹·ì',859,859),('¸ÇÑÅÃѵ¹ì',865,865),('¸ÇѪ',863,863),('¸ÇѪªÑÂ',864,864),('¸ÑªÇѲ¹ì',869,869),('¸ÑªÇ´Õ',868,868),('¸Ñª¡Ã',866,866),('¸Ñª¾Å',867,867),('¸Ñ­Ã´Ò',877,877),('¸Ñ­ª¹¡',870,870),('¸Ñ­­¸Ã',871,871),('¸Ñ­­¾Ñ²¹ì',872,872),('¸Ñ­³ÔªÒ',873,873),('¸Ñ­¹Ñ¹·ì',874,874),('¸Ñ­¾Ã',875,875),('¸Ñ­¾ÔÊÔ·¸Ôì',876,876),('¸ÕÃÀÑ·Ãì',896,896),('¸ÕÃÀÒ¾',897,897),('¸ÕÃÇѲ¹ì',898,898),('¸ÕÃÐ',901,901),('¸ÕÃÐÇѲ¹ì',904,904),('¸ÕÃЪÑÂ',902,902),('¸ÕÃоÅ',903,903),('¸ÕÃÈÑ¡´Ôì',899,899),('¸ÕÃÈÒ¹µÔ¾Ñ¹¸ì',900,900),('¸ÒÃÒ',883,883),('¸ÒÃÔ¹Õ',884,884),('¸ÓçÃѵ¹ì',886,886),('¸Óç¤ì',885,885),('¸ÕêÑÂ',890,890),('¸Ò÷ԾÂì',882,882),('¸Õùت',891,891),('¸ÕþѲ¹ì',895,895),('¸ÕþÅ',894,894),('¸Õþ§Èì',892,892),('¸Õþ§Éì',893,893),('¸Ò¡Ã',878,878),('¸Ò´Ò',879,879),('¸Ô´ÒÃѵ¹ì',887,887),('¸ÔµÔ¹Ñ¹·ì',888,888),('¸Ò¹Õ',881,881),('¸Ô¹Õ¡Ò­¨¹ì',889,889),('¸Ò¹Ô¹·Ãì',880,880),('¸Äµ',862,862),('¸§äªÂ',826,826),('¸§ªÑÂ',825,825),('¸³Ñ°',827,827),('¸¹âè¹ì',834,834),('¸¹ÃѪ',832,832),('¸¹Ãѵ¹ì',833,833),('¸¹ÇѲ¹ì',836,836),('¸¹Çѹ',837,837),('¸¹ÇÔµµ',838,838),('¸¹ÇÔ·Âì',839,839),('¸¹Ç´Õ',835,835),('¸¹ÐÃѪµì',841,841),('¸¹ÊÔ·¸Ôì',840,840),('¸¹ÑÊ',846,846),('¸¹Ñª¸Ô´Ò',842,842),('¸¹Ñ­­Ò',843,843),('¸¹Ñ¹µì',844,844),('¸¹Ñ¹·ì',845,845),('¸¹Ò',847,847),('¸¹ÒÀóì',850,850),('¸¹ÒÃÑ¡Éì',852,852),('¸¹ÒÀÒ',851,851),('¸¹ÒÇѪÃì',853,853),('¸¹ÔÉ°Ò',855,855),('¸¹Ò¤ÒÃÂÙâÍºÕ Ãѵ¹ÊÔ¹ ÊÒ¢ÒËÑÇËÁÒ¡',849,849),('¸¹Ò¤ÒáÃاÈÃÕÍÂظÂÒ º',848,848),('¸¹Ô´Ò',854,854),('¸¹Ù',856,856),('¸¹¡Ã',828,828),('¸¹¡Äµ',829,829),('¸¹¾Ã',830,830),('¸¹¾Å',831,831),('¹ à¿ÃÔÁàÁ¹¹Ôª ÍâÃáÁµÔê¡Êì ¾Õ·ÕÍÕ ÅÔÁÔàµç',906,906),('¹ ¾´Å',905,905),('¹àÃÈ',946,946),('¹ÃÀÑ·Ãì',939,939),('¹âõÁì',947,947),('¹ÀÇÃó',929,929),('¹ÀÑÊÊÃ',930,930),('¹ÀÑÊÊØÇÃó',931,931),('¹ÀÒ',932,932),('¹ÃÒ',940,940),('¹ÃÕ',945,945),('¹ÀÒÂØ·¸ì',934,934),('¹ÀÒÇÃó',935,935),('¹ÃÔÈ',943,943),('¹ÃÔÉ°',944,944),('¹ÀÔ¹·Ã',936,936),('¹ÃÔ¹·Ãì',941,941),('¹ÃÔ¹·Ãìà´ª',942,942),('¹ÀÒ¾Ã',933,933),('¹ÃªÑÂ',937,937),('¹À´Å',928,928),('¹Ã¾Å',938,938),('¹ÇÃѵ¹ì',956,956),('¹ÇÅÅÐÍÍ',960,960),('¹ÇŨѹ·Ãì',957,957),('¹ÇÅ©ÇÕ',958,958),('¹ÇžÃ',959,959),('¹Ç¡Ã³ì',954,954),('¹Ç¾Å',955,955),('¹éÓÁѹ¤ÒÅà·ê¡«ì',992,992),('¹éÓྪÃ',991,991),('¹éÓÍéÍÂ',994,994),('¹éÓ·Ô¾Âì',988,988),('¹éÓ½¹',989,989),('¹Ñ¹Ò',980,980),('¹Ñ­ªÅÒ',961,961),('¹Ñ¯¾Ã',962,962),('¹Ñ±¾Ã',963,963),('¹Ñ·ª¹¡',964,964),('¹Ñ·¸Á¹',965,965),('¹Ñ¹ªÑÂ',966,966),('¹Ñ¹·Ãѵ¹ì',973,973),('¹Ñ¹·ÁÒÊ',972,972),('¹Ñ¹·ÇÃó',975,975),('¹Ñ¹·Ç§Éì',974,974),('¹Ñ¹·ÈÑ¡´Ôì',976,976),('¹Ñ¹·Ò',977,977),('¹Ñ¹·ÔÂÒ',979,979),('¹Ñ¹·Ô¡Ò¹µì',978,978),('¹Ñ¹·ªÑÂ',967,967),('¹Ñ¹·¹ì',968,968),('¹Ñ¹·¹Ò',969,969),('¹Ñ¹·¾Ã',970,970),('¹Ñ¹·¾Å',971,971),('¹ÒÁ',983,983),('¹ÔÂÁ',1016,1016),('¹ÔÃÁÅ',1017,1017),('¹ÔÃѹ´Ã',1018,1018),('¹ÒÃÕ',985,985),('¹ÔÀÒ',1015,1015),('¹ÒÃÕÃѵ¹ì',986,986),('¹ÔÃÒÇÃóì',1019,1019),('¹ÒÃÔ¹·Ãì',984,984),('¹ÔâźÅ',1024,1024),('¹Ôà«Ð',998,998),('¹ÓÃØè§ä·Â ¡ÒÃìàÁ¹·ì',993,993),('¹ÔÃب¹ì',1020,1020),('¹ÔÃصµì',1021,1021),('¹ÔÇૹ¨ÙÃÕè¾ÃÔé¹µÔé§á͹´ì ᾤࡨ¨Ôé§',1025,1025),('¹ÔÇѲ¹ì',1026,1026),('¹ÔÇѵÃì',1027,1027),('¹ÔÇѵÔ',1028,1028),('¹ÔÇÒµ',1029,1029),('¹ÒÇÔ¹Õ',987,987),('¹ÔÈÃÒ',1030,1030),('¹ÔÊÒ',1033,1033),('¹ÔÈÒªÅ',1031,1031),('¹ÔÈÒ¾Ã',1032,1032),('¹ÔÅÀÒ',1022,1022),('¹ÔÅغÅ',1023,1023),('¹Ô¡Éì',995,995),('¹Ô¤Á',996,996),('¹ÔªÃªÕ¾',997,997),('¹Ò¯Êǧ',981,981),('¹Ô´',999,999),('¹Ô´Ò',1000,1000),('¹ÔµÂì',1001,1001),('¹ÒµÂÒ',982,982),('¹ÔµÂÒ',1002,1002),('¹ÔµÔ',1003,1003),('¹ÕµÔ',1034,1034),('¹ÔµÔÁÒ',1005,1005),('¹ÔµÔ¾§Éì',1004,1004),('¹Ô·ÃÒ',1006,1006),('¹Ô·Ñȹì',1007,1007),('¹Ô·ÑȹÕÂì',1008,1008),('¹Ô¸ÔÇ´Õ',1009,1009),('¹Ô»»Í¹à¾¹µì(»ÃÐà·Èä·Â)',1010,1010),('¹Ô¾Ñ·¸Ò',1013,1013),('¹Ô¾Ñ¹',1014,1014),('¹Ó¾Å',990,990),('¹Ô¾Å',1012,1012),('¹Ô¾¹¸ì',1011,1011),('¹Å¾Ãó',953,953),('¹ÄÁÒ³',952,952),('¹ÄÁÅ',951,951),('¹Ä³Õ',948,948),('¹Ä´Õ',949,949),('¹Ä·¸Ôì',950,950),('¹¤Ã',907,907),('¹¤Ã»°Á Î͹´éÒ¤ÒÃìÊì (1994)',908,908),('¹§Åѡɳì',911,911),('¹§ª¹¡',909,909),('¹§¹Øª',910,910),('¹·',912,912),('¹·Õ',914,914),('¹·Ô¹',913,913),('¹¹·ÈÑ¡´Ôì',915,915),('¹¾Ãѵ¹ì',924,924),('¹¾ÁÒÈ',923,923),('¹¾à¡éÒ',916,916),('¹¾ÇÃó',926,926),('¹¾Ò¾Ã',927,927),('¹¾ÄÔ·¸Ôì',925,925),('¹¾´Å',917,917),('¹¾´ÅÂì',918,918),('¹¾·Ñµ',919,919),('¹¾¾Ã',921,921),('¹¾¾Å',922,922),('¹¾¾§¤ì',920,920),('¹ØÈÃÒ',1039,1039),('¹ØÊÃÒ',1041,1041),('¹ØʺÒ',1040,1040),('¹ØªÂÒ',1037,1037),('¹ØªÃÕ',1038,1038),('¹Øª¨ÃÔ¹·Ãì',1035,1035),('¹Øª¹Ò¶',1036,1036),('ºÃç',1050,1050),('ºÃÃà¨Ô´',1049,1049),('ºÃÃÊÒÃ',1051,1051),('ºÃè§',1047,1047),('ºÃèº',1048,1048),('ºÃÔÇÃõ',1052,1052),('ºÇêÑÂ',1053,1053),('ºÑ§ÍÃ',1054,1054),('ºÑ­ªÒ',1055,1055),('ºÑ­­ÑµÔ',1056,1056),('ºÑ³±Ôµ',1057,1057),('ºÑ³±ÔµÂì',1058,1058),('ºÑµÃ¡ÃاÈÃÕÍÂظÂÒ',1060,1060),('ºÑµÃ¡Ãاä·Â',1059,1059),('ºÑ¹Å×ÍÈÑ¡´Ôì',1061,1061),('ºÕ á͹´ì «Õ ¾ÙÅÒÊ¡Õé',1067,1067),('ºÕ ÇÒ ¤ÍÃìâ¾àêÑè¹ ¨Ó¡Ñ´',1066,1066),('ºÕ.àÍç¹.ºÃÒà´ÍÃì',1068,1068),('ºÕ.àÍÊ.äÍ.àËÅç¡¡èÍÊÃéÒ§',1069,1069),('ºÓÃاä·Â',1064,1064),('ºÔǵÕéᾤ',1065,1065),('ºÒ§¡Í¡ªÕ·àÁç··ÑÅ',1062,1062),('ºÒ¹ªéÍÂ',1063,1063),('ºÙê·Êì (»ÃÐà·Èä·Â)',1111,1111),('ºÙê·ÊìáÁ¹Ùῤà¨ÍÃìÃÔè§ (»ÃÐà·Èä·Â)',1112,1112),('º§¡ª',1044,1044),('º§¡µÃѵ¹ì',1045,1045),('º«ì ÍÔ¹â¿Ãì à«ÍÃìÇÔÊ',1046,1046),('ºØÃÑ­ªÅÕ',1101,1101),('ºØÃÔ¹·Ãì',1102,1102),('ºØÈÃÒ',1103,1103),('ºØÉÂÒ',1108,1108),('ºØÉÃÒÀóì',1109,1109),('ºØÈÃÔ¹·Ãì',1105,1105),('ºØÈÃÒ¾Ã',1104,1104),('ºØËÅÑè¹',1110,1110),('ºØÉ¡Ã',1106,1106),('ºØɺÒ',1107,1107),('ºØ­àÂÕèÂÁ',1085,1085),('ºØ­ÃèÇÁ',1086,1086),('ºØ­áʧ',1098,1098),('ºØ­ÃÑ¡',1087,1087),('ºØ­Âѧ',1084,1084),('ºØ­ÁÕ',1083,1083),('ºØ­àÅÔÈ',1090,1090),('ºØ­à¡ÕÂõÔ',1070,1070),('ºØ­àªÔ´',1075,1075),('ºØ­ÈÃÕ',1091,1091),('ºØ­Êè§',1093,1093),('ºØ­ÈÔÃÔ ´ÕÇÔÅÍ»àÁ¹·ì',1092,1092),('ºØ­ÊÔ¹',1095,1095),('ºØ­Ê¹Í§',1094,1094),('ºØ­Ê׺',1096,1096),('ºØ­ÊØ¢',1097,1097),('ºØ­ÅѺ',1088,1088),('ºØ­Å×Í',1089,1089),('ºØ­¤§',1071,1071),('ºØ­ªèÇÂ',1072,1072),('ºØ­ªÑÂ',1073,1073),('ºØ­ªØº',1074,1074),('ºØ­«é͹',1076,1076),('ºØ­·ÃѾÂì',1077,1077),('ºØ­·ÇÕ',1078,1078),('ºØ­·Í§',1079,1079),('ºØ­¸ÃÃÁ',1080,1080),('ºØ­»ÃÐÊÔ·¸Ôì',1081,1081),('ºØ­¾§Éì',1082,1082),('ºØ³±Ôµ',1099,1099),('ºØ»¼Ò',1100,1100),('»ÃÐ⪹ì',1179,1179),('»ÃÐàÇÈ',1186,1186),('»ÃÐÁÇÅ',1171,1171),('»ÃÐàÊÃÔ°',1193,1193),('»ÃÐÁѾÃ',1172,1172),('»ÃÐÀÑÊ',1163,1163),('»ÃÐÀÑÊÃì',1164,1164),('»ÃÐÀÑÊÃÒ¾Ã',1165,1165),('»ÃÐÀÑÊÊÃ',1166,1166),('»ÃÐÀÒÀóì',1169,1169),('»ÃÐÀÒÊ',1170,1170),('»ÃÐÂÔ¹',1175,1175),('»ÃÐÀÒ¾Ã',1167,1167),('»ÃÐÀÒ¾Ãó',1168,1168),('»ÃÐÂÙÃ',1177,1177),('»ÃÐÂÙÃÈÃÕ',1178,1178),('»ÃÐÁÙÅ',1173,1173),('»ÃЧ¤ì',1174,1174),('»ÃÐà·×ͧ',1156,1156),('»ÃÐÂØ·¸',1176,1176),('»ÃÐÇѵÃ',1180,1180),('»ÃÐÇѵÔ',1181,1181),('»ÃÐÇÕ³Ò',1185,1185),('»ÃÐÇÔµÃ',1182,1182),('»ÃÐÇÔ·',1183,1183),('»ÃÐÇÔ·Âì',1184,1184),('»ÃÐÊÒÃ',1190,1190),('»ÃÐÊÒ·',1188,1188),('»ÃÐÊÔ·¸Ôì',1191,1191),('»ÃÐÊÒ¹',1189,1189),('»ÃÐʧ¤ì',1187,1187),('»ÃÐÊ׺',1192,1192),('»ÃÐä¾',1162,1162),('»ÃСͺ',1138,1138),('»ÃСÒÈ',1139,1139),('»ÃСÒÈÔµ',1140,1140),('»ÃСԨ',1141,1141),('»ÃСԵ',1142,1142),('»ÃФͧ',1143,1143),('»ÃШǺ',1145,1145),('»ÃШѡÉì',1146,1146),('»ÃШԵÃ',1147,1147),('»ÃШ§¨Ôµ',1144,1144),('»ÃЪÒ',1148,1148),('»ÃЪԵ',1149,1149),('»ÃЪØÁ¾Ã',1150,1150),('»Ãгµ',1151,1151),('»ÃдÔÉ°ì',1152,1152),('»ÃзѺã¨',1153,1153),('»Ãзջ',1154,1154),('»ÃзØÁ·Ô¾Âì',1155,1155),('»ÃоѲ¹ì',1160,1160),('»Ãоѹ¸ì',1161,1161),('»Ãоķ¸Ôì',1159,1159),('»Ãо¨¹ì',1157,1157),('»Ãо¹¸ì',1158,1158),('»ÀÑÊÊÃ',1132,1132),('»ÃѪ­Ò',1194,1194),('»ÃÒâÁ·Âì',1200,1200),('»ÃÕÂÒÀóì',1213,1213),('»ÃÔÂÒÇÃó',1208,1208),('»ÃÒö¹Ò',1201,1201),('»ÀÒÇÃÔ¹·ì',1135,1135),('»ÀÒÇÕ',1136,1136),('»ÀÒÇ´Õ',1134,1134),('»ÃÔȹÒ',1209,1209),('»ÃÔȹÕ',1210,1210),('»ÃÒ¡ÒÃ',1195,1195),('»ÃÒ§³Õ',1196,1196),('»ÃÕªÒ',1211,1211),('»ÃÒª­ì',1197,1197),('»ÃÕ­Ò',1212,1212),('»ÃÔ­­ì',1202,1202),('»ÃÔ­­Ò',1203,1203),('»ÃÔ­´Ò',1204,1204),('»ÃÒ³Õ',1198,1198),('»ÃÒ³ÕÂì',1199,1199),('»ÃÔ³´Ò',1205,1205),('»ÀÒ³Ø',1133,1133),('»ÃÔ·ÑÈ',1206,1206),('»ÃÔ¹´Ò',1207,1207),('»ÂصÒ',1137,1137),('»ÇÕ³ÃѪ',1214,1214),('»ÇÕ³Ò',1215,1215),('»Êѹµì',1216,1216),('»Êѹ¹ì',1217,1217),('»Í§À¾',1218,1218),('»Ñ­¨ÃÑÈÁÔì',1219,1219),('»Ñ­­Ò',1220,1220),('»Ñ­­Ò¾Ã',1221,1221),('»Ñ­­Ò¾Å',1222,1222),('»Ñ³ÃÊÕ',1223,1223),('»Ñ·Á',1224,1224),('»Ñ·ÁÒ',1225,1225),('»Ñ·ÁÒÇ´Õ',1226,1226),('»ÔÂÃѵ¹ì',1246,1246),('»ÔÂÁÒÀóì',1245,1245),('»ÔÂÇÃó',1247,1247),('»ÔÂÇѲ¹ì',1248,1248),('»ÔÂÐ',1250,1250),('»ÔÂÐÁÒÈ',1259,1259),('»ÔÂÐÈÑ¡´Ôì',1260,1260),('»ÔÂЪÑÂ',1251,1251),('»ÔÂйѹ·ì',1253,1253),('»ÔÂй¹·ì',1252,1252),('»ÔÂйت',1254,1254),('»ÔÂоÃ',1256,1256),('»ÔÂоѹ¸ì',1257,1257),('»ÔÂоѹ¸Øì',1258,1258),('»ÔÂо§Èì',1255,1255),('»ÔÂÈÑ¡´Ôì',1249,1249),('»ÒÃÔªÒµ',1230,1230),('»ÒÃÔªÒµÔ',1231,1231),('»ÒÃÕ³Ò',1233,1233),('»ÔÂÒ¾Ã',1261,1261),('»ÒÃԾѹ¸ì',1232,1232),('»Ô¡ҭ¨¹ì',1239,1239),('»Ô¹ѹ·ì',1240,1240),('»Ô¹ү',1241,1241),('»Ô¾Ã',1244,1244),('»Ô¾§Èì',1242,1242),('»Ô¾§Éì',1243,1243),('»Ôè¹ÁÒ⹪',1238,1238),('»Ôè¹Á³Õ',1237,1237),('»Ò˹ѹ',1234,1234),('»ÔÅѹ­Ò',1262,1262),('»Ò³ÔÊÃÒ',1227,1227),('»ÔµÔ',1235,1235),('»ÔµÔÇѪÃì',1236,1236),('»Ò¹',1228,1228),('»Ò¹à¾ªÃ',1229,1229),('»¡Ã³ì',1119,1119),('»®ÔÁÒ',1120,1120),('»¯ÔÁÒ',1123,1123),('»¯Ô­­Ò',1121,1121),('»¯Ô¾Å',1122,1122),('»°ÁÇѲ¹ì',1124,1124),('»³Ô´Ò',1126,1126),('»³ÔµÒ',1127,1127),('»³ªÑÂ',1125,1125),('»·ØÁ',1128,1128),('»·ØÁÒ',1130,1130),('»·ØÁ¾Ã',1129,1129),('»¹Ñ´´Ò',1131,1131),('»Ø³³ÂÒ',1263,1263),('¼à´ÔÁ',1277,1277),('¼èͧÈÃÕ',1279,1279),('¼èͧ¾Ãó',1278,1278),('¼è͹»ÃÐÀÒ',1280,1280),('¼èÒ¡ÒäÅѧ¡Í§¡ÅÒ§Êӹѡ»ÅÑ´¡Ãا෾ÁËÒ¹¤Ã',1285,1285),('¼éÒ¢¹Ë¹ÙªÔ¹àΧ',1281,1281),('¼éÒ¢¹Ë¹Ù«Ô¹àΧ',1282,1282),('¼éҢع˹٫ԹàΧ',1283,1283),('¼èÒ¹¿éÒ àÍ繨Ôà¹ÕÂÃÔè§',1284,1284),('¼ÒÊØ¢',1286,1286),('¼ÙéãË­èàÅç¡',1289,1289),('¼Ùé༴ç¨',1288,1288),('¼¡Ò¡Ãͧ',1272,1272),('¼¡Ò¾Ãó',1273,1273),('¼§',1274,1274),('¼¨§¨Ôµµì',1275,1275),('¼´Ø§ÈÑ¡´Ôì',1276,1276),('¼ØÊ´Õ',1287,1287),('½èÒ¡ÒäÅѧ¡Í§¡ÅÒ§ Êӹѡ»ÅÑ´¡Ãا෾ÁËÒ¹¤Ã',1293,1293),('¾Ã',1319,1319),('¾ÃÁ§¤Åà¿ÍÃì¹Ôà¨ÍÃì',1338,1338),('¾ÃóÃÒ³ì',1344,1344),('¾ÃóÊóì',1345,1345),('¾ÃóÕ',1347,1347),('¾ÃóԡÒ',1346,1346),('¾Ãó·ÔÀÒ',1339,1339),('¾Ãó¹ÔÀÒ',1340,1340),('¾Ãó»ÃÐä¾Ç´Õ',1341,1341),('¾Ãó¾ÃÃÉ',1342,1342),('¾Ãó¾ÔÁÅ',1343,1343),('¾Ãà·¾',1326,1326),('¾ÃøԴÒ',1348,1348),('¾Ãà¾ç­',1337,1337),('¾ÃÇÔÁÅ',1349,1349),('¾ÃÇÔäÅ',1350,1350),('¾ÃÐÃÒÁ 3 Î͹´éÒ¤ÒÃìÊì',1360,1360),('¾ÃÐÃÒÁ 3 ¤ÒÃìà«ç¹àµÍÃì',1359,1359),('¾ÃлÃÐá´§ Î͹´éÒ¤ÒÃìÊì',1357,1357),('¾ÃлÃÐá´§ Î͹´éÒ¤ÒÃìÊì ¨Ó¡Ñ´',1358,1358),('¾ÃÊÃǧ',1353,1353),('¾ÃËÁ¾Ñ²¹ì',1355,1355),('¾ÃÊÇÃäì',1354,1354),('¾ÃéÍÁªÑÂ',1356,1356),('¾ÃÈÑ¡´Ôì',1351,1351),('¾ÃÈÔÃÔ',1352,1352),('¾ÃÕàÁÕÂÃìà¤ÁÔ¤ÑÅ á͹´ì¾ÅÒʵԡ',1362,1362),('¾ÃÕàÁÕÂÃìÍÔ¹àµÍÃìÅÔ««Ôè§',1363,1363),('¾ÃÔéÁà¾ÃÒ',1361,1361),('¾Ã¡ÇÕ',1320,1320),('¾Ã¨Ôµµì',1321,1321),('¾ÃªÑÂ',1322,1322),('¾Ã·ÔÀÒ',1325,1325),('¾Ã·Ô¾Âì',1323,1323),('¾Ã·Ô¾Ò',1324,1324),('¾Ã¹ÀÒ',1328,1328),('¾Ã¹ÔµÔ¿ÔÅìÁá͹´ìÇÕ´ÕâÍ',1329,1329),('¾Â¹µì',1317,1317),('¾Ã¹·Õ',1327,1327),('¾Ã¾Ãó',1332,1332),('¾Ã¾ÔÁÅ',1335,1335),('¾Ã¾ÔäÅ',1336,1336),('¾Ã¾Å',1333,1333),('¾Ã¾ÅÒ§ÒÁ',1334,1334),('¾Ã¾§Éì',1330,1330),('¾Ã¾¹Ò',1331,1331),('¾Âا',1318,1318),('¾Ç§Ãѵ¹ì',1372,1372),('¾Ç§à¾ç­',1371,1371),('¾Ç§·Í§',1370,1370),('¾ÈÔ¹',1373,1373),('¾ÊØࡵÔì',1374,1374),('¾ÑʾÃ',1391,1391),('¾ÑÅÅÀ',1390,1390),('¾ÑªÃ',1376,1376),('¾ÑªÃÇäÅ',1377,1377),('¾ÑªÃÒ',1378,1378),('¾ÑªÃÕ',1382,1382),('¾ÑªÃÒÀóì',1379,1379),('¾ÑªÃÕÀóì',1384,1384),('¾ÑªÃÒÀÒ',1380,1380),('¾ÑªÃÔ¹·Ãì',1381,1381),('¾ÑªÃÕ¾Ã',1383,1383),('¾Ñª¹Õ',1375,1375),('¾Ñ²·ÇÕ',1385,1385),('¾Ñ²¹Ð',1387,1387),('¾Ñ²¹ªÑÂ',1386,1386),('¾Ñ²¾§Éì',1388,1388),('¾Ñ·¸ì¸ÕÃÒ',1389,1389),('¾Ô ÈÁÑÂ',1397,1397),('¾Õ.àÍÊ.¨Õ ÅÔÊ«Ôè§',1439,1439),('¾Õ.àÍÊ.¾ÅÒʵԡºÃÒà´ÍÃì á͹´ì«Ñ¹',1440,1440),('¾Õ.àÍÊ.¾ÅÒʵԡºÃÒà´ÍÃìá͹´ì«Ñ¹',1441,1441),('¾Õ.«Õ.àºÊ·ì ¤ÃÕàÍ·',1438,1438),('¾ÔÃÁÂì',1430,1430),('¾ÔÁÀÒ',1428,1428),('¾ÕÃÇزÔ',1446,1446),('¾ÕÃÐ',1448,1448),('¾ÕÃÐÈÑ¡´Ôì',1451,1451),('¾ÕÃоÅ',1450,1450),('¾ÕÃо§Èì',1449,1449),('¾ÕÃÈÔÅ»ì',1447,1447),('¾ÒÃҡ͹ÍÔ¹â¿à·¤',1396,1396),('¾ÔÁÅ',1429,1429),('¾ÔàªÉ°',1409,1408),('¾ÔàªÉ°ì',1408,1409),('¾Ôય',1406,1406),('¾Ôય°ì',1407,1407),('¾Òâµà¤ÁÕÍصÊÒË¡ÃÃÁ',1394,1394),('¾Õ÷ѵ',1444,1444),('¾Ôà·¾',1415,1415),('¾ÔÀ¾',1420,1420),('¾ÔÁ¾ìÀóì',1425,1425),('¾ÔÁ¾ìÀѤ',1426,1426),('¾ÔÁ¾ìã¨',1421,1421),('¾ÔÁ¾ìÇÔÁÅ',1427,1427),('¾ÔÁ¾ìª¹¡',1422,1422),('¾ÔÁ¾ì»ÃоÃó',1423,1423),('¾ÔÁ¾ì¾Ã',1424,1424),('¾ÕþѲ¹ì',1445,1445),('¾ÔÃس',1431,1431),('¾ÔÊÁÑÂ',1434,1434),('¾ÔÈÔÉ°ì',1432,1432),('¾ÔÊÔÉ°ì',1437,1437),('¾ÔÊÔ°',1435,1435),('¾ÔÊÔ·¸Ôì',1436,1436),('¾ÔɳØ',1433,1433),('¾Ô¨ÔµÃÒ',1398,1398),('¾ÔªÂÒ',1401,1401),('¾ÔªÑÂ',1402,1402),('¾ÔªÑÂÇѲ¹ì',1403,1403),('¾ÔªÔµ',1404,1404),('¾ÔªÔµ¾Å',1405,1405),('¾Ôª­ì',1399,1399),('¾Ôª´Ò',1400,1400),('¾Ô±ÙÃÂì',1410,1410),('¾Ò³Õ',1393,1393),('¾Ò³ÔªÂì',1392,1392),('¾Ô³ªØ´Ò',1411,1411),('¾Ô³¹ÀÒ',1412,1412),('¾Ô·ÂÒ',1413,1413),('¾Ô·Ñ¡Éì',1414,1414),('¾Ô¸Ò¹¡Ã',1416,1416),('¾Õ¹Ô¡«ì àÍç¡«ìà¾ÃÊ',1442,1442),('¾Õ¹Ô¡«ìàÍç¡«ìà¾ÃÊ',1443,1443),('¾Ò¹·Í§',1395,1395),('¾Ô¹¹ÔÀÒ',1417,1417),('¾ÔºÙÅÂì',1418,1418),('¾Ô¾Ñ²¹ì',1419,1419),('¾Ùŷͧ¾Ãç;à¾ÍÃìµÕé_',1454,1454),('¾ÙżÅ',1455,1455),('¾Ù¹ÈÑ¡´Ôì',1453,1453),('¾Ù¹¾Ñ¹¸ì',1452,1452),('¾Åà·¾',1366,1366),('¾ÅÊÔ·¸Ôì',1369,1369),('¾Å¡Äɳì',1364,1364),('¾ÅªÑÂ',1365,1365),('¾Å¾ÑªÃì',1367,1367),('¾Å¾Ñ²¹ì',1368,1368),('¾§ÈìÀѤ',1300,1300),('¾§Èìà¡ÕÂõÔ',1294,1294),('¾§Èìà·¾',1296,1296),('¾§Éìà·¾',1302,1302),('¾§ÉìÈÑ¡´Ôì',1304,1304),('¾§ÉìÊѹµì',1305,1305),('¾§ÈìÊØà¡ÉÁ',1301,1301),('¾§Éì͹ѹµì',1306,1306),('¾§ÈìªÒÂ',1295,1295),('¾§Éì¾Ã',1303,1303),('¾§Èì¾Ñ¹¸ì',1298,1298),('¾§Èì¾Ô¾Ñ²¹ì',1299,1299),('¾§È¸Ã',1297,1297),('¾¨ÁÒÅÂì',1312,1312),('¾¨ÁÒ¹',1311,1311),('¾¨¹ì',1307,1307),('¾¨¹Ò',1308,1308),('¾¨¹ÕÂì',1310,1310),('¾¨¹Òö',1309,1309),('¾¹Á',1313,1313),('¾¹ÁªÑÂ',1314,1314),('¾¹ÒÊѹ±ì',1315,1315),('¾¹Ô´Ò',1316,1316),('¿Õ¹Ô¡«ì àÍç¡«ìà¾ÃÊ',1493,1493),('¿ÅØÊÊÔ¡à¤Á',1492,1492);
+SELECT name FROM t1 ORDER BY name;
+DROP TABLE t1;
+
+#
+# Check the following:
+# "a" == "a "
+# "a\0" < "a"
+# "a\0" < "a "
+
+SELECT 'a' = 'a ';
+SELECT 'a\0' < 'a';
+SELECT 'a\0' < 'a ';
+SELECT 'a\t' < 'a';
+SELECT 'a\t' < 'a ';
+
+CREATE TABLE t1 (a char(10) not null);
+INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a ');
+SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/t/ctype_ujis.test b/mysql-test/t/ctype_ujis.test
index bcf6507b4c7..abfded5a6c2 100644
--- a/mysql-test/t/ctype_ujis.test
+++ b/mysql-test/t/ctype_ujis.test
@@ -41,3 +41,23 @@ select _ujis 0xa1a2a1a3 like concat(_ujis'%',_ujis 0xa2a1, _ujis'%') collate uji
select 'a' like 'a';
select 'A' like 'a';
select 'A' like 'a' collate ujis_bin;
+
+#
+# Bug 3290: Hald-width Katakana conversion problem.
+# Check ujis-utf8-ujis round trip.
+#
+set @ujis1= _ujis 0x8EA18EA28EA38EA48EA58EA68EA78EA88EA98EAA8EAB8EAC8EAD8EAE8EAF;
+set @ujis2= _ujis 0x8EB08EB18EB28EB38EB48EB58EB68EB78EB88EB98EBA8EBB8EBC8EBD8EBE8EBF;
+set @ujis3= _ujis 0x8EC08EC18EC28EC38EC48EC58EC68EC78EC88EC98ECA8ECB8ECC8ECD8ECE8ECF;
+set @ujis4= _ujis 0x8ED08ED18ED28ED38ED48ED58ED68ED78ED88ED98EDA8EDB8EDC8EDD8EDE8EDF;
+
+select hex(@utf81:= CONVERT(@ujis1 USING utf8));
+select hex(@utf82:= CONVERT(@ujis2 USING utf8));
+select hex(@utf83:= CONVERT(@ujis3 USING utf8));
+select hex(@utf84:= CONVERT(@ujis4 USING utf8));
+
+select @ujis1 = CONVERT(@utf81 USING ujis);
+select @ujis2 = CONVERT(@utf82 USING ujis);
+select @ujis3 = CONVERT(@utf83 USING ujis);
+select @ujis4 = CONVERT(@utf84 USING ujis);
+
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 49b1ed94757..4e68efeffc3 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -34,6 +34,23 @@ select 'A' like 'a' collate utf8_bin;
select _utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD0B1,_utf8 '%');
#
+# Check the following:
+# "a" == "a "
+# "a\0" < "a"
+# "a\0" < "a "
+
+SELECT 'a' = 'a ';
+SELECT 'a\0' < 'a';
+SELECT 'a\0' < 'a ';
+SELECT 'a\t' < 'a';
+SELECT 'a\t' < 'a ';
+
+CREATE TABLE t1 (a char(10) character set utf8 not null);
+INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a ');
+SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
+DROP TABLE t1;
+
+#
# Fix this, it should return 1:
#
#select _utf8 0xD0B0D0B1D0B2 like concat(_utf8'%',_utf8 0xD091,_utf8 '%');
@@ -54,7 +71,7 @@ select * from t1;
drop table t1;
#
-# Bug #2366 Wrong utf8 behaviour when data is trancated
+# Bug #2366 Wrong utf8 behaviour when data is truncated
#
set names koi8r;
create table t1 (s1 char(1) character set utf8);
@@ -101,7 +118,26 @@ drop table t1;
#
# Bug 2699
-# UTF8 breaks primary keys for cols > 85 characters
+# UTF8 breaks primary keys for cols > 333 characters
#
---error 1089
-create table t1 (a char(160) character set utf8, primary key(a));
+--error 1071
+create table t1 (a text character set utf8, primary key(a(360)));
+
+
+#
+# Bug 2959
+# UTF8 charset breaks joins with mixed column/string constant
+#
+CREATE TABLE t1 ( a varchar(10) ) CHARACTER SET utf8;
+INSERT INTO t1 VALUES ( 'test' );
+SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = b.a;
+SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = 'test' and b.a = 'test';
+SELECT a.a, b.a FROM t1 a, t1 b WHERE a.a = b.a and a.a = 'test';
+DROP TABLE t1;
+
+create table t1 (a char(255) character set utf8);
+insert into t1 values('b'),('b');
+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;
diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test
index 18af3dfb3db..1fc04cb907b 100644
--- a/mysql-test/t/date_formats.test
+++ b/mysql-test/t/date_formats.test
@@ -124,7 +124,7 @@ select str_to_date(concat('15-01-2001',' 2:59:58.999'),
create table t1 (date char(30), format char(30) not null);
insert into t1 values
('2003-01-02 10:11:12', '%Y-%m-%d %H:%i:%S'),
-('03-01-02 8:11:2.123456', '%y-%m-%d %H:%i:%S'),
+('03-01-02 8:11:2.123456', '%y-%m-%d %H:%i:%S.%#'),
('2003-01-02 10:11:12 PM', '%Y-%m-%d %h:%i:%S %p'),
('2003-01-02 01:11:12.12345AM', '%Y-%m-%d %h:%i:%S.%f%p'),
('2003-01-02 02:11:12.12345AM', '%Y-%m-%d %h:%i:%S.%f %p'),
@@ -209,3 +209,32 @@ create table t1 (d date);
insert into t1 values ('2004-07-14'),('2005-07-14');
select date_format(d,"%d") from t1 order by 1;
drop table t1;
+
+select str_to_date("2003-....01ABCD-02 10:11:12.0012", "%Y-%.%m%@-%d %H:%i:%S.%f") as a;
+
+
+create table t1 select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f") as f1,
+ str_to_date("10:11:12.0012", "%H:%i:%S.%f") as f2,
+ str_to_date("2003-01-02", "%Y-%m-%d") as f3,
+ str_to_date("02", "%d") as f4, str_to_date("02 10", "%d %H") as f5;
+describe t1;
+select * from t1;
+drop table t1;
+
+create table t1 select "02 10" as a, "%d %H" as b;
+select str_to_date(a,b) from t1;
+create table t2 select str_to_date(a,b) from t1;
+describe t2;
+select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f") as f1,
+ str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S") as f2,
+ str_to_date("2003-01-02", "%Y-%m-%d") as f3,
+ str_to_date("02 10:11:12", "%d %H:%i:%S.%f") as f4,
+ str_to_date("02 10:11:12", "%d %H:%i:%S") as f5,
+ str_to_date("02 10", "%d %f") as f6;
+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,
+ microsecond("1997-12-31 23:59:59.01XXXX") as f3;
+
+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;
diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test
index bd5d9e5c0d9..e370b545eff 100644
--- a/mysql-test/t/delete.test
+++ b/mysql-test/t/delete.test
@@ -84,7 +84,7 @@ insert into t2 values (1, 21),(2, 12),(3, 23);
select * from t11;
select * from t12;
select * from t2;
--- error 1241
+-- error 1242
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select b from t2 where t11.a < t2.a);
select * from t11;
select * from t12;
@@ -92,7 +92,7 @@ delete ignore t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b <> (select
select * from t11;
select * from t12;
insert into t11 values (2, 12);
--- error 1241
+-- error 1242
delete from t11 where t11.b <> (select b from t2 where t11.a < t2.a);
select * from t11;
delete ignore from t11 where t11.b <> (select b from t2 where t11.a < t2.a);
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test
index a9341ada416..f0d5a253bf4 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -116,7 +116,7 @@ select mail_id, if(folder.f_description!='', folder.f_description, folder.f_nam
#
create table t1 (a int);
insert into t1 values (1),(2),(3);
--- error 1287
+-- error 1288
update (select * from t1) as t1 set a = 5;
-- error 1064
delete from (select * from t1);
@@ -151,13 +151,14 @@ CREATE TABLE `t1` (
INSERT INTO `t1` (N, M) VALUES (1, 0),(1, 0),(1, 0),(2, 0),(2, 0),(3, 0);
UPDATE `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2;
select * from t1;
--- error 1287
+-- error 1288
UPDATE `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2, P2.N = 2;
-- error 1054
UPDATE `t1` AS P1 INNER JOIN (SELECT aaaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N SET P1.M = 2;
delete P1.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
select * from t1;
--- error 1287
+--replace_result P2 p2
+--error 1288
delete P1.*,P2.* from `t1` AS P1 INNER JOIN (SELECT N FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
-- error 1054
delete P1.* from `t1` AS P1 INNER JOIN (SELECT aaa FROM `t1` GROUP BY N HAVING Count(M) > 1) AS P2 ON P1.N = P2.N;
@@ -188,7 +189,6 @@ INSERT INTO t3 VALUES (1000,0.00),(1001,0.25),(1002,0.50),(1003,0.75),(1008,1.00
select 497, TMP.ID, NULL from (select 497 as ID, MAX(t3.DATA) as DATA from t1 join t2 on (t1.ObjectID = t2.ID) join t3 on (t1.ObjectID = t3.ID) group by t2.ParID order by DATA DESC) as TMP;
drop table t1, t2, t3;
-
#
# explain derived
#
@@ -206,3 +206,11 @@ insert into t2 values (1,7),(2,7);
explain select a from t2 where a>1;
explain select a from (select a from t2 where a>1) tt;
drop table t2;
+
+#
+# select list counter
+#
+CREATE TABLE `t1` ( `itemid` int(11) NOT NULL default '0', `grpid` varchar(15) NOT NULL default '', `vendor` int(11) NOT NULL default '0', `date_` date NOT NULL default '0000-00-00', `price` decimal(12,2) NOT NULL default '0.00', PRIMARY KEY (`itemid`,`grpid`,`vendor`,`date_`), KEY `itemid` (`itemid`,`vendor`), KEY `itemid_2` (`itemid`,`date_`));
+insert into t1 values (128, 'rozn', 2, now(), 10),(128, 'rozn', 1, now(), 10);
+SELECT MIN(price) min, MAX(price) max, AVG(price) avg FROM (SELECT SUBSTRING( MAX(concat(date_,";",price)), 12) price FROM t1 WHERE itemid=128 AND grpid='rozn' GROUP BY itemid, grpid, vendor) lastprices;
+DROP TABLE t1;
diff --git a/mysql-test/t/drop.test b/mysql-test/t/drop.test
index 43329a849f8..88c47803f48 100644
--- a/mysql-test/t/drop.test
+++ b/mysql-test/t/drop.test
@@ -24,7 +24,9 @@ create database mysqltest;
create table mysqltest.mysqltest (n int);
insert into mysqltest.mysqltest values (4);
select * from mysqltest.mysqltest;
+--enable_info
drop database if exists mysqltest;
+--disable_info
create database mysqltest;
drop database mysqltest;
diff --git a/mysql-test/t/endspace.test b/mysql-test/t/endspace.test
new file mode 100644
index 00000000000..a9933ff93b5
--- /dev/null
+++ b/mysql-test/t/endspace.test
@@ -0,0 +1,96 @@
+#
+# Test problem with characters < ' ' at end of strings (Bug #3152)
+#
+
+-- source include/have_innodb.inc
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+select 'a' = 'a', 'a' = 'a ', 'a ' = 'a';
+select 'a\0' = 'a', 'a\0' < 'a', 'a\0' > 'a';
+select 'a' = 'a\0', 'a' < 'a\0', 'a' > 'a\0';
+select 'a\0' = 'a ', 'a\0' < 'a ', 'a\0' > 'a ';
+select 'a ' = 'a\0', 'a ' < 'a\0', 'a ' > 'a\0';
+select 'a a' > 'a', 'a \0' < 'a';
+select binary 'a a' > 'a', binary 'a \0' > 'a', binary 'a\0' > 'a';
+
+#
+# Test MyISAM tables.
+#
+
+create table t1 (text1 varchar(32) not NULL, KEY key1 (text1));
+insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
+check table t1;
+select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%';
+select * from t1 where text1='teststring' or text1 like 'teststring_%';
+select * from t1 where text1='teststring' or text1 > 'teststring\t';
+select * from t1 order by text1;
+explain select * from t1 order by text1;
+
+alter table t1 modify text1 char(32) binary not null;
+check table t1;
+select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%';
+select * from t1 where text1='teststring' or text1 like 'teststring_%';
+select * from t1 where text1='teststring' or text1 > 'teststring\t';
+select text1, length(text1) from t1 order by text1;
+select text1, length(text1) from t1 order by binary text1;
+
+alter table t1 modify text1 blob not null, drop key key1, add key key1 (text1(20));
+insert into t1 values ('teststring ');
+select concat('|', text1, '|') from t1 order by text1;
+
+alter table t1 modify text1 text not null, pack_keys=1;
+select * from t1 where text1 like 'teststring_%';
+select * from t1 where text1='teststring' or text1 like 'teststring_%';
+select * from t1 where text1='teststring' or text1 > 'teststring\t';
+select concat('|', text1, '|') from t1 order by text1;
+drop table t1;
+
+create table t1 (text1 varchar(32) not NULL, KEY key1 (text1)) pack_keys=0;
+insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
+select * from t1 where text1='teststring' or text1 like 'teststring_%';
+select * from t1 where text1='teststring' or text1 >= 'teststring\t';
+drop table t1;
+
+# Test HEAP tables (with BTREE keys)
+
+create table t1 (text1 varchar(32) not NULL, KEY key1 using BTREE (text1)) engine=heap;
+insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
+select * from t1 ignore key (key1) where text1='teststring' or text1 like 'teststring_%';
+select * from t1 where text1='teststring' or text1 like 'teststring_%';
+select * from t1 where text1='teststring' or text1 >= 'teststring\t';
+select * from t1 order by text1;
+explain select * from t1 order by text1;
+
+alter table t1 modify text1 char(32) binary not null;
+select * from t1 order by text1;
+drop table t1;
+
+#
+# Test InnoDB tables
+#
+
+create table t1 (text1 varchar(32) not NULL, KEY key1 (text1)) engine=innodb;
+insert into t1 values ('teststring'), ('nothing'), ('teststring\t');
+check table t1;
+select * from t1 where text1='teststring' or text1 like 'teststring_%';
+select * from t1 where text1='teststring' or text1 > 'teststring\t';
+select * from t1 order by text1;
+explain select * from t1 order by text1;
+
+alter table t1 modify text1 char(32) binary not null;
+select * from t1 order by text1;
+
+alter table t1 modify text1 blob not null, drop key key1, add key key1 (text1(20));
+insert into t1 values ('teststring ');
+select concat('|', text1, '|') from t1 order by text1;
+
+alter table t1 modify text1 text not null, pack_keys=1;
+select * from t1 where text1 like 'teststring_%';
+
+# The following gives wrong result in InnoDB
+select text1, length(text1) from t1 where text1='teststring' or text1 like 'teststring_%';
+select text1, length(text1) from t1 where text1='teststring' or text1 >= 'teststring\t';
+select concat('|', text1, '|') from t1 order by text1;
+drop table t1;
diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test
index 02ada3dc8cb..50a3d522e3d 100644
--- a/mysql-test/t/fulltext.test
+++ b/mysql-test/t/fulltext.test
@@ -12,6 +12,7 @@ INSERT INTO t1 VALUES('MySQL has now support', 'for full-text search'),
('Only MyISAM tables','support collections'),
('Function MATCH ... AGAINST()','is used to do a search'),
('Full-text search in MySQL', 'implements vector space model');
+SHOW INDEX FROM t1;
# nl search
@@ -62,8 +63,15 @@ select * from t1 where MATCH a,b AGAINST ('"text search" "now support"' IN BOOL
select * from t1 where MATCH a,b AGAINST ('"text search" -"now support"' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('"text search" +"now support"' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('"text i"' IN BOOLEAN MODE);
+
+select * from t1 where MATCH a,b AGAINST ('+(support collections) +foobar*' IN BOOLEAN MODE);
+select * from t1 where MATCH a,b AGAINST ('+(+(support collections)) +foobar*' IN BOOLEAN MODE);
select * from t1 where MATCH a,b AGAINST ('"xt indexes"' IN BOOLEAN MODE);
+# bug#2708 crash
+
+select * from t1 where MATCH a,b AGAINST('"space model' IN BOOLEAN MODE);
+
# boolean w/o index:
select * from t1 where MATCH a AGAINST ("search" IN BOOLEAN MODE);
@@ -144,9 +152,9 @@ select * from t2 having MATCH inhalt AGAINST ('foobar');
# check of fulltext errors
#
---error 1282
+--error 1283
CREATE TABLE t3 (t int(11),i text,fulltext tix (t,i));
---error 1282
+--error 1283
CREATE TABLE t3 (t int(11),i text,
j varchar(200) CHARACTER SET latin2,
fulltext tix (i,j));
@@ -263,6 +271,7 @@ SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrück');
SET NAMES latin1;
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrück');
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrueck');
+SELECT t, collation(t),MATCH t AGAINST ('Osnabruck') FROM t1 WHERE MATCH t AGAINST ('Osnabruck');
#alter table t1 modify t text character set latin1 collate latin1_german2_ci not null;
alter table t1 modify t varchar(200) collate latin1_german2_ci not null;
SELECT t, collation(t) FROM t1 WHERE MATCH t AGAINST ('Osnabrück');
diff --git a/mysql-test/t/fulltext_var.test b/mysql-test/t/fulltext_var.test
index 71213d1195a..8cc8acf60a6 100644
--- a/mysql-test/t/fulltext_var.test
+++ b/mysql-test/t/fulltext_var.test
@@ -1,5 +1,27 @@
#
# Fulltext configurable parameters
#
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
show variables like "ft\_%";
+
+create table t1 (b text not null);
+insert t1 values ('aaaaaa bbbbbb cccccc');
+insert t1 values ('bbbbbb cccccc');
+insert t1 values ('aaaaaa cccccc');
+select * from t1 where match b against ('+aaaaaa bbbbbb' in boolean mode);
+-- error 1229
+set ft_boolean_syntax=' +-><()~*:""&|';
+set global ft_boolean_syntax=' +-><()~*:""&|';
+select * from t1 where match b against ('+aaaaaa bbbbbb' in boolean mode);
+set global ft_boolean_syntax='@ -><()~*:""&|';
+select * from t1 where match b against ('+aaaaaa bbbbbb' in boolean mode);
+select * from t1 where match b against ('+aaaaaa @bbbbbb' in boolean mode);
+-- error 1231
+set global ft_boolean_syntax='@ -><()~*:""@|';
+-- error 1231
+set global ft_boolean_syntax='+ -><()~*:""@!|';
+drop table t1;
+
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index d004c81f14e..9d99a57afe5 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -29,7 +29,8 @@ select grp,group_concat(c order by c) from t1 group by grp;
select grp,group_concat(c order by c desc) from t1 group by grp;
select grp,group_concat(d order by a) from t1 group by grp;
select grp,group_concat(d order by a desc) from t1 group by grp;
-select grp,group_concat(a order by a,d+c) from t1 group by grp;
+select grp,group_concat(a order by a,d+c-ascii(c)-a) from t1 group by grp;
+select grp,group_concat(a order by d+c-ascii(c),a) from t1 group by grp;
select grp,group_concat(c order by 1) from t1 group by grp;
select grp,group_concat(c order by "c") from t1 group by grp;
select grp,group_concat(distinct c order by c) from t1 group by grp;
@@ -50,22 +51,12 @@ select grp,group_concat(c order by grp desc) from t1 group by grp order by grp;
select grp, group_concat(a separator "")+0 from t1 group by grp;
select grp, group_concat(a separator "")+0.0 from t1 group by grp;
select grp, ROUND(group_concat(a separator "")) from t1 group by grp;
+drop table t1;
# Test NULL values
-drop table t1;
create table t1 (grp int, c char(10));
-insert into t1 values (1,NULL);
-insert into t1 values (2,"b");
-insert into t1 values (2,NULL);
-insert into t1 values (3,"E");
-insert into t1 values (3,NULL);
-insert into t1 values (3,"D");
-insert into t1 values (3,NULL);
-insert into t1 values (3,NULL);
-insert into t1 values (3,"D");
-insert into t1 values (4,"");
-insert into t1 values (5,NULL);
+insert into t1 values (1,NULL),(2,"b"),(2,NULL),(3,"E"),(3,NULL),(3,"D"),(3,NULL),(3,NULL),(3,"D"),(4,""),(5,NULL);
select grp,group_concat(c order by c) from t1 group by grp;
# Test warnings
@@ -118,8 +109,12 @@ drop table t2;
# check having
create table t1 (bar varchar(32));
-insert into t1 values('test'),('test2');
-select * from t1 having group_concat(bar)='';
+insert into t1 values('test1'),('test2');
+select group_concat(bar order by concat(bar,bar)) from t1;
+select group_concat(bar order by concat(bar,bar) desc) from t1;
+select bar from t1 having group_concat(bar)='';
+select bar from t1 having instr(group_concat(bar), "test") > 0;
+select bar from t1 having instr(group_concat(bar order by concat(bar,bar) desc), "test2,test1") > 0;
drop table t1;
# ORDER BY fix_fields()
@@ -129,4 +124,58 @@ insert into t1 values (0,"a"),(0,"b"),(1,"c");
insert into t2 values (1),(2),(3);
select group_concat(a1 order by (t1.a IN (select a0 from t2))) from t1;
select group_concat(a1 order by (t1.a)) from t1;
-drop table t1, t2; \ No newline at end of file
+drop table t1, t2;
+
+#
+# Problem with GROUP BY (Bug #2695)
+#
+
+CREATE TABLE t1 (id1 tinyint(4) NOT NULL, id2 tinyint(4) NOT NULL);
+INSERT INTO t1 VALUES (1, 1),(1, 2),(1, 3),(1, 4),(1, 5),(2, 1),(2, 2),(2, 3);
+CREATE TABLE t2 (id1 tinyint(4) NOT NULL);
+INSERT INTO t2 VALUES (1),(2),(3),(4),(5);
+SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 AND t1.id1=1 GROUP BY t1.id1;
+SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
+SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY t1.id2 DESC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
+SELECT t1.id1, GROUP_CONCAT(t1.id2 ORDER BY 6-t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
+
+# The following failed when it was run twice:
+SELECT t1.id1, GROUP_CONCAT(t1.id2,6-t1.id2 ORDER BY 6-t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
+SELECT t1.id1, GROUP_CONCAT(t1.id2,6-t1.id2 ORDER BY 6-t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
+
+SELECT t1.id1, GROUP_CONCAT(t1.id2,"/",6-t1.id2 ORDER BY 1+0,6-t1.id2,t1.id2 ASC) AS concat_id FROM t1, t2 WHERE t1.id1 = t2.id1 GROUP BY t1.id1;
+drop table t1,t2;
+
+#
+# Problem with distinct (Bug #3381)
+#
+
+create table t1 (s1 char(10), s2 int not null);
+insert into t1 values ('a',2),('b',2),('c',1),('a',3),('b',4),('c',4);
+select distinct s1 from t1 order by s2,s1;
+select group_concat(distinct s1) from t1;
+select group_concat(distinct s1 order by s2) from t1 where s2 < 4;
+# The following is wrong and needs to be fixed ASAP
+select group_concat(distinct s1 order by s2) from t1;
+drop table t1;
+
+#
+# Test with subqueries (Bug #3319)
+#
+
+create table t1 (a int, c int);
+insert into t1 values (1, 2), (2, 3), (2, 4), (3, 5);
+create table t2 (a int, c int);
+insert into t2 values (1, 5), (2, 4), (3, 3), (3,3);
+select group_concat(c) from t1;
+select group_concat(c order by (select c from t2 where t2.a=t1.a limit 1)) as grp from t1;
+
+select group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a)) as grp from t1;
+select group_concat(c order by (select mid(group_concat(c order by a),1,5) from t2 where t2.a=t1.a) desc) as grp from t1;
+
+# The following returns random results as we are sorting on blob addresses
+# select group_concat(c order by (select group_concat(c order by a) from t2 where t2.a=t1.a)) as grp from t1;
+# select group_concat(c order by (select group_concat(c) from t2 where a=t1.a)) as grp from t1;
+
+select a,c,(select group_concat(c order by a) from t2 where a=t1.a) as grp from t1 order by grp;
+drop table t1,t2;
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index ce89cbe1b22..2bd4838f934 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -134,7 +134,6 @@ select max(t2.a1) from t1 left outer join t2 on t1.a2=t2.a1 and 1=0 where t2.a1=
select max(t1.a2),max(t2.a1) from t1 left outer join t2 on t1.a1=10;
drop table t1,t2;
-
#
# Tests to check MIN/MAX query optimization
#
diff --git a/mysql-test/t/func_if.test b/mysql-test/t/func_if.test
index e44a7f6d6f9..36c3a38d2fe 100644
--- a/mysql-test/t/func_if.test
+++ b/mysql-test/t/func_if.test
@@ -30,6 +30,12 @@ explain extended select nullif(u=0, 'test') from t1;
drop table t1;
#
+# Bug 2629
+#
+select NULLIF(NULL,NULL), NULLIF(NULL,1), NULLIF(NULL,1.0), NULLIF(NULL,"test");
+select NULLIF(1,NULL), NULLIF(1.0, NULL), NULLIF("test", NULL);
+
+#
# Problem with IF()
#
diff --git a/mysql-test/t/func_in.test b/mysql-test/t/func_in.test
index 9ff768ec76b..855a7cbd28f 100644
--- a/mysql-test/t/func_in.test
+++ b/mysql-test/t/func_in.test
@@ -61,11 +61,11 @@ c char(1) character set latin1 collate latin1_danish_ci
);
insert into t1 values ('A','B','C');
insert into t1 values ('a','c','c');
---error 1266
+--error 1267
select * from t1 where a in (b);
---error 1269
-select * from t1 where a in (b,c);
--error 1270
+select * from t1 where a in (b,c);
+--error 1271
select * from t1 where 'a' in (a,b,c);
select * from t1 where 'a' in (a);
select * from t1 where a in ('a');
diff --git a/mysql-test/t/func_like.test b/mysql-test/t/func_like.test
index a05a2a3bdaa..91f55af48cc 100644
--- a/mysql-test/t/func_like.test
+++ b/mysql-test/t/func_like.test
@@ -25,6 +25,24 @@ select * from t1 where a like "%abc\d%";
drop table t1;
+#
+# 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';
+drop table t1;
+
+#
+# Bug #2885: like and datetime
+#
+
+create table t1 (a datetime);
+insert into t1 values ('2004-03-11 12:00:21');
+select * from t1 where a like '2004-03-11 12:00:21';
+drop table t1;
#
# Test like with non-default character set
diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test
index b6e2d3bd725..36ad2dfb0a2 100644
--- a/mysql-test/t/func_math.test
+++ b/mysql-test/t/func_math.test
@@ -29,4 +29,25 @@ explain extended select rand(999999),rand();
select pi(),sin(pi()/2),cos(pi()/2),abs(tan(pi())),cot(1),asin(1),acos(0),atan(1);
explain extended select pi(),sin(pi()/2),cos(pi()/2),abs(tan(pi())),cot(1),asin(1),acos(0),atan(1);
select degrees(pi()),radians(360);
+
+#
+# Bug #2338 Trignometric arithmatic problems
+#
+
+SELECT ACOS(1.0);
+SELECT ASIN(1.0);
+SELECT ACOS(0.2*5.0);
+SELECT ACOS(0.5*2.0);
+SELECT ASIN(0.8+0.2);
+SELECT ASIN(1.2-0.2);
+
+#
+# Bug #3051 FLOOR returns invalid
+#
+
+# This can't be tested as it's not portable
+#select floor(log(4)/log(2));
+#select floor(log(8)/log(2));
+#select floor(log(16)/log(2));
+
explain extended select degrees(pi()),radians(360);
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index 9759127b222..e73f2a1b26c 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -2,7 +2,7 @@
# Testing of misc functions
#
-select format(1.5555,0),format(123.5555,1),format(1234.5555,2),format(12345.5555,3),format(123456.5555,4),format(1234567.5555,5),format("12345.2399",2);
+select format(1.5555,0),format(123.5555,1),format(1234.5555,2),format(12345.55555,3),format(123456.5555,4),format(1234567.5555,5),format("12345.2399",2);
select inet_ntoa(inet_aton("255.255.255.255.255.255.255.255"));
select inet_aton("255.255.255.255.255"),inet_aton("255.255.1.255"),inet_aton("0.1.255");
@@ -12,6 +12,8 @@ select hex(inet_aton('127'));
select hex(inet_aton('127.1'));
select hex(inet_aton('127.1.1'));
+select length(uuid()), charset(uuid()), length(unhex(replace(uuid(),_utf8'-',_utf8'')));
+
#
# Test for core dump with nan
#
diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test
index ba64e13873d..93e57daad82 100644
--- a/mysql-test/t/func_sapdb.test
+++ b/mysql-test/t/func_sapdb.test
@@ -98,3 +98,9 @@ SELECT TIMEDIFF(t1, t4) As ttt, TIMEDIFF(t2, t3) As qqq,
TIMEDIFF(t3, t2) As eee, TIMEDIFF(t2, t4) As rrr from test;
drop table t1, test;
+
+select addtime("-01:01:01.01", "-23:59:59.1") as a;
+select microsecond("1997-12-31 23:59:59.01") as a;
+select microsecond(19971231235959.01) as a;
+select date_add("1997-12-31",INTERVAL "10.09" SECOND_MICROSECOND) as a;
+select str_to_date("2003-01-02 10:11:12.0012", "%Y-%m-%d %H:%i:%S.%f");
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 155ed459d1f..1c85f83baac 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -1,5 +1,3 @@
-# Version: 3.23.29
-#
# Description
# -----------
# Testing string functions
@@ -80,6 +78,9 @@ select quote(concat('abc\'', '\\cba'));
select quote(1/0), quote('\0\Z');
select length(quote(concat(char(0),"test")));
select hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235))));
+select unhex(hex("foobar")), hex(unhex("1234567890ABCDEF")), unhex("345678");
+select hex(unhex("1")), hex(unhex("12")), hex(unhex("123")), hex(unhex("1234")), hex(unhex("12345")), hex(unhex("123456"));
+select length(unhex(md5("abrakadabra")));
#
# Wrong usage of functions
@@ -141,6 +142,36 @@ INSERT INTO t1 VALUES (1, 'a545f661efdd1fb66fdee3aab79945bf');
SELECT 1 FROM t1 WHERE tmp=AES_DECRYPT(tmp,"password");
DROP TABLE t1;
+CREATE TABLE t1 (
+ wid int(10) unsigned NOT NULL auto_increment,
+ data_podp date default NULL,
+ status_wnio enum('nowy','podp','real','arch') NOT NULL default 'nowy',
+ PRIMARY KEY(wid),
+);
+
+INSERT INTO t1 VALUES (8,NULL,'real');
+INSERT INTO t1 VALUES (9,NULL,'nowy');
+SELECT elt(status_wnio,data_podp) FROM t1 GROUP BY wid;
+DROP TABLE t1;
+
+#
+# test for #739
+
+CREATE TABLE t1 (title text) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('Congress reconvenes in September to debate welfare and adult education');
+INSERT INTO t1 VALUES ('House passes the CAREERS bill');
+SELECT CONCAT("</a>",RPAD("",(55 - LENGTH(title)),".")) from t1;
+DROP TABLE t1;
+
+#
+# test for Bug #2290 "output truncated with ELT when using DISTINCT"
+#
+
+CREATE TABLE t1 (i int, j int);
+INSERT INTO t1 VALUES (1,1),(2,2);
+SELECT DISTINCT i, ELT(j, '345', '34') FROM t1;
+DROP TABLE t1;
+
#
# Test collation and coercibility
#
@@ -149,22 +180,23 @@ select 1=_latin1'1';
select _latin1'1'=1;
select _latin2'1'=1;
select 1=_latin2'1';
---error 1266
+--error 1267
select _latin1'1'=_latin2'1';
select row('a','b','c') = row('a','b','c');
select row('A','b','c') = row('a','b','c');
select row('A' COLLATE latin1_bin,'b','c') = row('a','b','c');
select row('A','b','c') = row('a' COLLATE latin1_bin,'b','c');
---error 1266
+--error 1267
select row('A' COLLATE latin1_general_ci,'b','c') = row('a' COLLATE latin1_bin,'b','c');
---error 1266
+--error 1267
select concat(_latin1'a',_latin2'a');
---error 1269
-select concat(_latin1'a',_latin2'a',_latin5'a');
--error 1270
+select concat(_latin1'a',_latin2'a',_latin5'a');
+--error 1271
select concat(_latin1'a',_latin2'a',_latin5'a',_latin7'a');
-
+--error 1267
+select concat_ws(_latin1'a',_latin2'a');
#
# Test FIELD() and collations
@@ -173,65 +205,64 @@ select FIELD('b','A','B');
select FIELD('B','A','B');
select FIELD('b' COLLATE latin1_bin,'A','B');
select FIELD('b','A' COLLATE latin1_bin,'B');
---error 1269
+--error 1270
select FIELD(_latin2'b','A','B');
---error 1269
+--error 1270
select FIELD('b',_latin2'A','B');
select FIELD('b',_latin2'A','B',1);
-
select POSITION(_latin1'B' IN _latin1'abcd');
select POSITION(_latin1'B' IN _latin1'abcd' COLLATE latin1_bin);
select POSITION(_latin1'B' COLLATE latin1_bin IN _latin1'abcd');
---error 1266
+--error 1267
select POSITION(_latin1'B' COLLATE latin1_general_ci IN _latin1'abcd' COLLATE latin1_bin);
---error 1266
+--error 1267
select POSITION(_latin1'B' IN _latin2'abcd');
select FIND_IN_SET(_latin1'B',_latin1'a,b,c,d');
--fix this:
--select FIND_IN_SET(_latin1'B',_latin1'a,b,c,d' COLLATE latin1_bin);
--select FIND_IN_SET(_latin1'B' COLLATE latin1_bin,_latin1'a,b,c,d');
---error 1266
+--error 1267
select FIND_IN_SET(_latin1'B' COLLATE latin1_general_ci,_latin1'a,b,c,d' COLLATE latin1_bin);
---error 1266
+--error 1267
select FIND_IN_SET(_latin1'B',_latin2'a,b,c,d');
select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd',2);
--fix this:
--select SUBSTRING_INDEX(_latin1'abcdabcdabcd' COLLATE latin1_bin,_latin1'd',2);
--select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd' COLLATE latin1_bin,2);
---error 1266
+--error 1267
select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin2'd',2);
---error 1266
+--error 1267
select SUBSTRING_INDEX(_latin1'abcdabcdabcd' COLLATE latin1_general_ci,_latin1'd' COLLATE latin1_bin,2);
select _latin1'B' between _latin1'a' and _latin1'c';
select _latin1'B' collate latin1_bin between _latin1'a' and _latin1'c';
select _latin1'B' between _latin1'a' collate latin1_bin and _latin1'c';
select _latin1'B' between _latin1'a' and _latin1'c' collate latin1_bin;
---error 1269
+--error 1270
select _latin2'B' between _latin1'a' and _latin1'b';
---error 1269
+--error 1270
select _latin1'B' between _latin2'a' and _latin1'b';
---error 1269
+--error 1270
select _latin1'B' between _latin1'a' and _latin2'b';
---error 1269
+--error 1270
select _latin1'B' collate latin1_general_ci between _latin1'a' collate latin1_bin and _latin1'b';
select _latin1'B' in (_latin1'a',_latin1'b');
select _latin1'B' collate latin1_bin in (_latin1'a',_latin1'b');
select _latin1'B' in (_latin1'a' collate latin1_bin,_latin1'b');
select _latin1'B' in (_latin1'a',_latin1'b' collate latin1_bin);
---error 1269
+--error 1270
select _latin2'B' in (_latin1'a',_latin1'b');
---error 1269
+--error 1270
select _latin1'B' in (_latin2'a',_latin1'b');
---error 1269
+--error 1270
select _latin1'B' in (_latin1'a',_latin2'b');
---error 1269
+--error 1270
select _latin1'B' COLLATE latin1_general_ci in (_latin1'a' COLLATE latin1_bin,_latin1'b');
---error 1269
+--error 1270
select _latin1'B' COLLATE latin1_general_ci in (_latin1'a',_latin1'b' COLLATE latin1_bin);
select collation(bin(130)), coercibility(bin(130));
@@ -317,38 +348,37 @@ select SUBSTR('abcdefg',1,-1) FROM DUAL;
# when an error on a lower level (in concat) has accured:
#
create table t7 (s1 char);
---error 1266
+--error 1267
select * from t7
where concat(s1 collate latin1_general_ci,s1 collate latin1_swedish_ci) = 'AA';
drop table t7;
-CREATE TABLE t1 (
- wid int(10) unsigned NOT NULL auto_increment,
- data_podp date default NULL,
- status_wnio enum('nowy','podp','real','arch') NOT NULL default 'nowy',
- PRIMARY KEY(wid),
-);
+select substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2),substring_index("1abcd;2abcd;3abcd;4abcd", ';', -2);
-INSERT INTO t1 VALUES (8,NULL,'real');
-INSERT INTO t1 VALUES (9,NULL,'nowy');
-SELECT elt(status_wnio,data_podp) FROM t1 GROUP BY wid;
-DROP TABLE t1;
+explain extended select md5('hello'), sha('abc'), sha1('abc'), soundex(''), 'mood' sounds like 'mud', aes_decrypt(aes_encrypt('abc','1'),'1'),concat('*',space(5),'*'), reverse('abc'), rpad('a',4,'1'), lpad('a',4,'1'), concat_ws(',','',NULL,'a'),make_set(255,_latin2'a',_latin2'b',_latin2'c'),elt(2,1),locate("a","b",2),format(130,10),char(0),conv(130,16,10),hex(130),binary 'HE', export_set(255,_latin2'y',_latin2'n',_latin2' '),FIELD('b' COLLATE latin1_bin,'A','B'),FIND_IN_SET(_latin1'B',_latin1'a,b,c,d'),collation(conv(130,16,10)), coercibility(conv(130,16,10)),length('\n\t\r\b\0\_\%\\'),bit_length('\n\t\r\b\0\_\%\\'),bit_length('\n\t\r\b\0\_\%\\'),concat('monty',' was here ','again'),length('hello'),char(ascii('h')),ord('h'),quote(1/0),crc32("123"),replace('aaaa','a','b'),insert('txs',2,1,'hi'),left(_latin2'a',1),right(_latin2'a',1),lcase(_latin2'a'),ucase(_latin2'a'),SUBSTR('abcdefg',3,2),substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2),trim(_latin2' a '),ltrim(_latin2' a '),rtrim(_latin2' a '), decode(encode(repeat("a",100000),"monty"),"monty");
#
-# test for #739
+# Bug #2182
+#
-CREATE TABLE t1 (title text) ENGINE=MyISAM;
-INSERT INTO t1 VALUES ('Congress reconvenes in September to debate welfare and adult education');
-INSERT INTO t1 VALUES ('House passes the CAREERS bill');
-SELECT CONCAT("</a>",RPAD("",(55 - LENGTH(title)),".")) from t1;
-DROP TABLE t1;
+SELECT lpad(12345, 5, "#");
+
+#
+# Bug #2972
+#
+
+SELECT conv(71, 10, 36), conv('1Z', 36, 10);
-select substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2),substring_index("1abcd;2abcd;3abcd;4abcd", ';', -2);
-explain extended select md5('hello'), sha('abc'), sha1('abc'), soundex(''), 'mood' sounds like 'mud', aes_decrypt(aes_encrypt('abc','1'),'1'),concat('*',space(5),'*'), reverse('abc'), rpad('a',4,'1'), lpad('a',4,'1'), concat_ws(',','',NULL,'a'),make_set(255,_latin2'a',_latin2'b',_latin2'c'),elt(2,1),locate("a","b",2),format(130,10),char(0),conv(130,16,10),hex(130),binary 'HE', export_set(255,_latin2'y',_latin2'n',_latin2' '),FIELD('b' COLLATE latin1_bin,'A','B'),FIND_IN_SET(_latin1'B',_latin1'a,b,c,d'),collation(conv(130,16,10)), coercibility(conv(130,16,10)),length('\n\t\r\b\0\_\%\\'),bit_length('\n\t\r\b\0\_\%\\'),bit_length('\n\t\r\b\0\_\%\\'),concat('monty',' was here ','again'),length('hello'),char(ascii('h')),ord('h'),quote(1/0),crc32("123"),replace('aaaa','a','b'),insert('txs',2,1,'hi'),left(_latin2'a',1),right(_latin2'a',1),lcase(_latin2'a'),ucase(_latin2'a'),SUBSTR('abcdefg',3,2),substring_index("1abcd;2abcd;3abcd;4abcd", ';', 2),trim(_latin2' a '),ltrim(_latin2' a '),rtrim(_latin2' a '), decode(encode(repeat("a",100000),"monty"),"monty");
#
-# Bug #2182
+# Bug #3089
#
-SELECT lpad(12345, 5, "#");
+create table t1 (id int(1), str varchar(10)) DEFAULT CHARSET=utf8;
+insert into t1 values (1,'aaaaaaaaaa'), (2,'bbbbbbbbbb');
+create table t2 (id int(1), str varchar(10)) DEFAULT CHARSET=utf8;
+insert into t2 values (1,'cccccccccc'), (2,'dddddddddd');
+select substring(concat(t1.str, t2.str), 1, 15) "name" from t1, t2
+where t2.id=t1.id order by name;
+drop table t1, t2;
diff --git a/mysql-test/t/func_test.test b/mysql-test/t/func_test.test
index 0d055549866..e7bcd81a15e 100644
--- a/mysql-test/t/func_test.test
+++ b/mysql-test/t/func_test.test
@@ -21,6 +21,7 @@ select -1.49 or -1.49,0.6 or 0.6;
select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1;
explain extended select 3 ^ 11, 1 ^ 1, 1 ^ 0, 1 ^ NULL, NULL ^ 1;
select 1 XOR 1, 1 XOR 0, 0 XOR 1, 0 XOR 0, NULL XOR 1, 1 XOR NULL, 0 XOR NULL;
+select 1 like 2 xor 2 like 1;
select 10 % 7, 10 mod 7, 10 div 3;
explain extended select 10 % 7, 10 mod 7, 10 div 3;
select (1 << 64)-1, ((1 << 64)-1) DIV 1, ((1 << 64)-1) DIV 2;
@@ -51,9 +52,9 @@ explain extended select _koi8r'a' = _koi8r'A' COLLATE koi8r_general_ci;
select _koi8r'a' = _koi8r'A' COLLATE koi8r_bin;
select _koi8r'a' COLLATE koi8r_general_ci = _koi8r'A';
select _koi8r'a' COLLATE koi8r_bin = _koi8r'A';
---error 1266
+--error 1267
select _koi8r'a' COLLATE koi8r_bin = _koi8r'A' COLLATE koi8r_general_ci;
---error 1266
+--error 1267
select _koi8r'a' = _latin1'A';
select strcmp(_koi8r'a', _koi8r'A');
@@ -61,9 +62,9 @@ select strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_general_ci);
select strcmp(_koi8r'a', _koi8r'A' COLLATE koi8r_bin);
select strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A');
select strcmp(_koi8r'a' COLLATE koi8r_bin, _koi8r'A');
---error 1266
+--error 1267
select strcmp(_koi8r'a' COLLATE koi8r_general_ci, _koi8r'A' COLLATE koi8r_bin);
---error 1266
+--error 1267
select strcmp(_koi8r'a', _latin1'A');
select _koi8r'a' LIKE _koi8r'A';
@@ -71,9 +72,9 @@ select _koi8r'a' LIKE _koi8r'A' COLLATE koi8r_general_ci;
select _koi8r'a' LIKE _koi8r'A' COLLATE koi8r_bin;
select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A';
select _koi8r'a' COLLATE koi8r_bin LIKE _koi8r'A';
---error 1266
+--error 1267
select _koi8r'a' COLLATE koi8r_general_ci LIKE _koi8r'A' COLLATE koi8r_bin;
---error 1266
+--error 1267
select _koi8r'a' LIKE _latin1'A';
#
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 7a6e2a815f4..5934e291dca 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -273,12 +273,18 @@ select last_day('2000-02-05') as f1, last_day('2002-12-31') as f2,
last_day('2001-01-01 01:01:01') as f5, last_day(NULL),
last_day('2001-02-12');
-create table t1 select last_day('2000-02-05') as a;
+create table t1 select last_day('2000-02-05') as a,
+ from_days(to_days("960101")) as b;
describe t1;
select * from t1;
drop table t1;
-select last_day('2000-02-05');
+select last_day('2000-02-05') as a,
+ from_days(to_days("960101")) as b;
+select date_add(last_day("1997-12-1"), INTERVAL 1 DAY);
+select length(last_day("1997-12-1"));
+select last_day("1997-12-1")+0;
+select last_day("1997-12-1")+0.0;
# Test SAPDB UTC_% functions. This part is TZ dependant (It is supposed that
# TZ variable set to GMT-3
@@ -291,5 +297,13 @@ select strcmp(concat(utc_date(),' ',utc_time()),utc_timestamp())=0;
explain extended select period_add("9602",-12),period_diff(199505,"9404"),from_days(to_days("960101")),dayofmonth("1997-01-02"), month("1997-01-02"), monthname("1972-03-04"),dayofyear("0000-00-00"),HOUR("1997-03-03 23:03:22"),MINUTE("23:03:22"),SECOND(230322),QUARTER(980303),WEEK("1998-03-03"),yearweek("2000-01-01",1),week(19950101,1),year("98-02-03"),weekday(curdate())-weekday(now()),dayname("1962-03-03"),unix_timestamp(),sec_to_time(time_to_sec("0:30:47")/6.21),curtime(),utc_time(),curdate(),utc_date(),utc_timestamp(),date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w"),from_unixtime(unix_timestamp("1994-03-02 10:11:12")),"1997-12-31 23:59:59" + INTERVAL 1 SECOND,"1998-01-01 00:00:00" - INTERVAL 1 SECOND,INTERVAL 1 DAY + "1997-12-31", extract(YEAR FROM "1999-01-02 10:11:12"),date_add("1997-12-31 23:59:59",INTERVAL 1 SECOND);
+SET @TMP=NOW();
+CREATE TABLE t1 (d DATETIME);
+INSERT INTO t1 VALUES (NOW());
+INSERT INTO t1 VALUES (NOW());
+INSERT INTO t1 VALUES (NOW());
+SELECT count(*) FROM t1 WHERE d>FROM_DAYS(TO_DAYS(@TMP)) AND d<=FROM_DAYS(TO_DAYS(@TMP)+1);
+DROP TABLE t1;
+
explain extended select timestampdiff(SQL_TSI_WEEK, '2001-02-01', '2001-05-01') as a1,
timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05-01 12:58:58.119999') as a2;
diff --git a/mysql-test/t/gis-rtree.test b/mysql-test/t/gis-rtree.test
index 08ba8329b48..629a07a4913 100644
--- a/mysql-test/t/gis-rtree.test
+++ b/mysql-test/t/gis-rtree.test
@@ -67,3 +67,39 @@ while ($1)
}
DROP TABLE t2;
+
+drop table if exists t1;
+CREATE TABLE t1 (a geometry NOT NULL, SPATIAL (a));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+INSERT INTO t1 VALUES (GeomFromText("LINESTRING(100 100, 200 200, 300 300)"));
+check table t1;
+analyze table t1;
+drop table t1;
+
diff --git a/mysql-test/t/gis.test b/mysql-test/t/gis.test
index c8f50e968ab..ea460d5f7b0 100644
--- a/mysql-test/t/gis.test
+++ b/mysql-test/t/gis.test
@@ -3,154 +3,155 @@
#
--disable_warnings
-DROP TABLE IF EXISTS pt, ls, p, mpt, mls, mp, gc, geo;
+DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
--enable_warnings
-CREATE TABLE pt (fid INTEGER NOT NULL PRIMARY KEY, g POINT);
-CREATE TABLE ls (fid INTEGER NOT NULL PRIMARY KEY, g LINESTRING);
-CREATE TABLE p (fid INTEGER NOT NULL PRIMARY KEY, g POLYGON);
-CREATE TABLE mpt (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOINT);
-CREATE TABLE mls (fid INTEGER NOT NULL PRIMARY KEY, g MULTILINESTRING);
-CREATE TABLE mp (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOLYGON);
-CREATE TABLE gc (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRYCOLLECTION);
-CREATE TABLE geo (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRY);
-
-SHOW FIELDS FROM pt;
-SHOW FIELDS FROM ls;
-SHOW FIELDS FROM p;
-SHOW FIELDS FROM mpt;
-SHOW FIELDS FROM mls;
-SHOW FIELDS FROM mp;
-SHOW FIELDS FROM gc;
-SHOW FIELDS FROM geo;
-
-
-INSERT INTO pt VALUES
+CREATE TABLE gis_point (fid INTEGER NOT NULL PRIMARY KEY, g POINT);
+CREATE TABLE gis_line (fid INTEGER NOT NULL PRIMARY KEY, g LINESTRING);
+CREATE TABLE gis_polygon (fid INTEGER NOT NULL PRIMARY KEY, g POLYGON);
+CREATE TABLE gis_multi_point (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOINT);
+CREATE TABLE gis_multi_line (fid INTEGER NOT NULL PRIMARY KEY, g MULTILINESTRING);
+CREATE TABLE gis_multi_polygon (fid INTEGER NOT NULL PRIMARY KEY, g MULTIPOLYGON);
+CREATE TABLE gis_geometrycollection (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRYCOLLECTION);
+CREATE TABLE gis_geometry (fid INTEGER NOT NULL PRIMARY KEY, g GEOMETRY);
+
+SHOW FIELDS FROM gis_point;
+SHOW FIELDS FROM gis_line;
+SHOW FIELDS FROM gis_polygon;
+SHOW FIELDS FROM gis_multi_point;
+SHOW FIELDS FROM gis_multi_line;
+SHOW FIELDS FROM gis_multi_polygon;
+SHOW FIELDS FROM gis_geometrycollection;
+SHOW FIELDS FROM gis_geometry;
+
+
+INSERT INTO gis_point VALUES
(101, PointFromText('POINT(10 10)')),
(102, PointFromText('POINT(20 10)')),
(103, PointFromText('POINT(20 20)')),
(104, PointFromWKB(AsWKB(PointFromText('POINT(10 20)'))));
-INSERT INTO ls VALUES
+INSERT INTO gis_line VALUES
(105, LineFromText('LINESTRING(0 0,0 10,10 0)')),
(106, LineStringFromText('LINESTRING(10 10,20 10,20 20,10 20,10 10)')),
(107, LineStringFromWKB(LineString(Point(10, 10), Point(40, 10))));
-INSERT INTO p VALUES
+INSERT INTO gis_polygon VALUES
(108, PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),
(109, PolyFromText('POLYGON((0 0,50 0,50 50,0 50,0 0), (10 10,20 10,20 20,10 20,10 10))')),
(110, PolyFromWKB(Polygon(LineString(Point(0, 0), Point(30, 0), Point(30, 30), Point(0, 0)))));
-INSERT INTO mpt VALUES
+INSERT INTO gis_multi_point VALUES
(111, MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')),
(112, MPointFromText('MULTIPOINT(1 1,11 11,11 21,21 21)')),
(113, MPointFromWKB(MultiPoint(Point(3, 6), Point(4, 10))));
-INSERT INTO mls VALUES
+INSERT INTO gis_multi_line VALUES
(114, MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')),
(115, MLineFromText('MULTILINESTRING((10 48,10 21,10 0))')),
(116, MLineFromWKB(MultiLineString(LineString(Point(1, 2), Point(3, 5)), LineString(Point(2, 5), Point(5, 8), Point(21, 7)))));
-INSERT INTO mp VALUES
+INSERT INTO gis_multi_polygon VALUES
(117, MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
(118, MPolyFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')),
(119, MPolyFromWKB(MultiPolygon(Polygon(LineString(Point(0, 3), Point(3, 3), Point(3, 0), Point(0, 3))))));
-INSERT INTO gc VALUES
+INSERT INTO gis_geometrycollection VALUES
(120, GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')),
(121, GeometryFromWKB(GeometryCollection(Point(44, 6), LineString(Point(3, 6), Point(7, 9)))));
-INSERT into geo SELECT * FROM pt;
-INSERT into geo SELECT * FROM ls;
-INSERT into geo SELECT * FROM p;
-INSERT into geo SELECT * FROM mpt;
-INSERT into geo SELECT * FROM mls;
-INSERT into geo SELECT * FROM mp;
-INSERT into geo SELECT * FROM gc;
-
-SELECT fid, AsText(g) FROM pt;
-SELECT fid, AsText(g) FROM ls;
-SELECT fid, AsText(g) FROM p;
-SELECT fid, AsText(g) FROM mpt;
-SELECT fid, AsText(g) FROM mls;
-SELECT fid, AsText(g) FROM mp;
-SELECT fid, AsText(g) FROM gc;
-SELECT fid, AsText(g) FROM geo;
-
-SELECT fid, Dimension(g) FROM geo;
-SELECT fid, GeometryType(g) FROM geo;
-SELECT fid, IsEmpty(g) FROM geo;
-SELECT fid, AsText(Envelope(g)) FROM geo;
-explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from geo;
-
-SELECT fid, X(g) FROM pt;
-SELECT fid, Y(g) FROM pt;
-explain extended select X(g),Y(g) FROM pt;
-
-SELECT fid, AsText(StartPoint(g)) FROM ls;
-SELECT fid, AsText(EndPoint(g)) FROM ls;
-SELECT fid, GLength(g) FROM ls;
-SELECT fid, NumPoints(g) FROM ls;
-SELECT fid, AsText(PointN(g, 2)) FROM ls;
-SELECT fid, IsClosed(g) FROM ls;
-explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM ls;
-
-SELECT fid, AsText(Centroid(g)) FROM p;
-SELECT fid, Area(g) FROM p;
-SELECT fid, AsText(ExteriorRing(g)) FROM p;
-SELECT fid, NumInteriorRings(g) FROM p;
-SELECT fid, AsText(InteriorRingN(g, 1)) FROM p;
-explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM p;
-
-SELECT fid, IsClosed(g) FROM mls;
-
-SELECT fid, AsText(Centroid(g)) FROM mp;
-SELECT fid, Area(g) FROM mp;
-
-SELECT fid, NumGeometries(g) from mpt;
-SELECT fid, NumGeometries(g) from mls;
-SELECT fid, NumGeometries(g) from mp;
-SELECT fid, NumGeometries(g) from gc;
-explain extended SELECT fid, NumGeometries(g) from mpt;
-
-SELECT fid, AsText(GeometryN(g, 2)) from mpt;
-SELECT fid, AsText(GeometryN(g, 2)) from mls;
-SELECT fid, AsText(GeometryN(g, 2)) from mp;
-SELECT fid, AsText(GeometryN(g, 2)) from gc;
-explain extended SELECT fid, AsText(GeometryN(g, 2)) from mpt;
+INSERT into gis_geometry SELECT * FROM gis_point;
+INSERT into gis_geometry SELECT * FROM gis_line;
+INSERT into gis_geometry SELECT * FROM gis_polygon;
+INSERT into gis_geometry SELECT * FROM gis_multi_point;
+INSERT into gis_geometry SELECT * FROM gis_multi_line;
+INSERT into gis_geometry SELECT * FROM gis_multi_polygon;
+INSERT into gis_geometry SELECT * FROM gis_geometrycollection;
+
+SELECT fid, AsText(g) FROM gis_point;
+SELECT fid, AsText(g) FROM gis_line;
+SELECT fid, AsText(g) FROM gis_polygon;
+SELECT fid, AsText(g) FROM gis_multi_point;
+SELECT fid, AsText(g) FROM gis_multi_line;
+SELECT fid, AsText(g) FROM gis_multi_polygon;
+SELECT fid, AsText(g) FROM gis_geometrycollection;
+SELECT fid, AsText(g) FROM gis_geometry;
+
+SELECT fid, Dimension(g) FROM gis_geometry;
+SELECT fid, GeometryType(g) FROM gis_geometry;
+SELECT fid, IsEmpty(g) FROM gis_geometry;
+SELECT fid, AsText(Envelope(g)) FROM gis_geometry;
+explain extended select Dimension(g), GeometryType(g), IsEmpty(g), AsText(Envelope(g)) from gis_geometry;
+
+SELECT fid, X(g) FROM gis_point;
+SELECT fid, Y(g) FROM gis_point;
+explain extended select X(g),Y(g) FROM gis_point;
+
+SELECT fid, AsText(StartPoint(g)) FROM gis_line;
+SELECT fid, AsText(EndPoint(g)) FROM gis_line;
+SELECT fid, GLength(g) FROM gis_line;
+SELECT fid, NumPoints(g) FROM gis_line;
+SELECT fid, AsText(PointN(g, 2)) FROM gis_line;
+SELECT fid, IsClosed(g) FROM gis_line;
+explain extended select AsText(StartPoint(g)),AsText(EndPoint(g)),GLength(g),NumPoints(g),AsText(PointN(g, 2)),IsClosed(g) FROM gis_line;
+
+SELECT fid, AsText(Centroid(g)) FROM gis_polygon;
+SELECT fid, Area(g) FROM gis_polygon;
+SELECT fid, AsText(ExteriorRing(g)) FROM gis_polygon;
+SELECT fid, NumInteriorRings(g) FROM gis_polygon;
+SELECT fid, AsText(InteriorRingN(g, 1)) FROM gis_polygon;
+explain extended select AsText(Centroid(g)),Area(g),AsText(ExteriorRing(g)),NumInteriorRings(g),AsText(InteriorRingN(g, 1)) FROM gis_polygon;
+
+SELECT fid, IsClosed(g) FROM gis_multi_line;
+
+SELECT fid, AsText(Centroid(g)) FROM gis_multi_polygon;
+SELECT fid, Area(g) FROM gis_multi_polygon;
+
+SELECT fid, NumGeometries(g) from gis_multi_point;
+SELECT fid, NumGeometries(g) from gis_multi_line;
+SELECT fid, NumGeometries(g) from gis_multi_polygon;
+SELECT fid, NumGeometries(g) from gis_geometrycollection;
+explain extended SELECT fid, NumGeometries(g) from gis_multi_point;
+
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_line;
+SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_polygon;
+SELECT fid, AsText(GeometryN(g, 2)) from gis_geometrycollection;
+SELECT fid, AsText(GeometryN(g, 1)) from gis_geometrycollection;
+explain extended SELECT fid, AsText(GeometryN(g, 2)) from gis_multi_point;
SELECT g1.fid as first, g2.fid as second,
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
-FROM gc g1, gc g2 ORDER BY first, second;
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
explain extended SELECT g1.fid as first, g2.fid as second,
Within(g1.g, g2.g) as w, Contains(g1.g, g2.g) as c, Overlaps(g1.g, g2.g) as o,
Equals(g1.g, g2.g) as e, Disjoint(g1.g, g2.g) as d, Touches(g1.g, g2.g) as t,
Intersects(g1.g, g2.g) as i, Crosses(g1.g, g2.g) as r
-FROM gc g1, gc g2 ORDER BY first, second;
+FROM gis_geometrycollection g1, gis_geometrycollection g2 ORDER BY first, second;
-DROP TABLE pt, ls, p, mpt, mls, mp, gc, geo;
+DROP TABLE gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry;
#
# Check that ALTER TABLE doesn't loose geometry type
#
-CREATE TABLE g1 (
- pt point,
+CREATE TABLE t1 (
+ gp point,
ln linestring,
pg polygon,
- mpt multipoint,
+ mp multipoint,
mln multilinestring,
mpg multipolygon,
gc geometrycollection,
gm geometry
);
-SHOW FIELDS FROM g1;
-ALTER TABLE g1 ADD fid INT NOT NULL;
-SHOW FIELDS FROM g1;
-DROP TABLE g1;
+SHOW FIELDS FROM t1;
+ALTER TABLE t1 ADD fid INT NOT NULL;
+SHOW FIELDS FROM t1;
+DROP TABLE t1;
SELECT AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))));
explain extended SELECT AsText(GeometryFromWKB(AsWKB(GeometryFromText('POINT(1 4)'))));
@@ -159,3 +160,13 @@ SELECT SRID(GeomFromText('LineString(1 1,2 2)',101));
explain extended SELECT SRID(GeomFromText('LineString(1 1,2 2)',101));
#select issimple(MultiPoint(Point(3, 6), Point(4, 10))), issimple(Point(3, 6)),issimple(PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')),issimple(GeometryFromText('POINT(1 4)')), issimple(AsWKB(GeometryFromText('POINT(1 4)')));
explain extended select issimple(MultiPoint(Point(3, 6), Point(4, 10))), issimple(Point(3, 6));
+
+create table t1 (a geometry not null);
+insert into t1 values (GeomFromText('Point(1 2)'));
+-- error 1105
+insert into t1 values ('Garbage');
+-- error 1105
+insert IGNORE into t1 values ('Garbage');
+alter table t1 add spatial index(a);
+
+drop table t1;
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 78221fa4e40..326759cb9ca 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -100,28 +100,49 @@ select 1; -- To test that the previous command didn't cause problems
create table t1 (a int);
grant ALL PRIVILEGES on *.* to drop_user2@localhost with GRANT OPTION;
show grants for drop_user2@localhost;
-revoke all privileges, grant from drop_user2@localhost;
+revoke all privileges, grant option from drop_user2@localhost;
drop user drop_user2@localhost;
grant ALL PRIVILEGES on *.* to drop_user@localhost with GRANT OPTION;
grant ALL PRIVILEGES on test.* to drop_user@localhost with GRANT OPTION;
grant select(a) on test.t1 to drop_user@localhost;
show grants for drop_user@localhost;
-revoke all privileges, grant from drop_user@localhost;
+
+#
+# Bug3086
+#
+set sql_mode=ansi_quotes;
+show grants for drop_user@localhost;
+set sql_mode=default;
+
+set sql_quote_show_create=0;
+show grants for drop_user@localhost;
+set sql_mode="ansi_quotes";
+show grants for drop_user@localhost;
+set sql_quote_show_create=1;
+show grants for drop_user@localhost;
+set sql_mode="";
+show grants for drop_user@localhost;
+
+revoke all privileges, grant option from drop_user@localhost;
show grants for drop_user@localhost;
drop user drop_user@localhost;
---error 1268
-revoke all privileges, grant from drop_user@localhost;
+--error 1269
+revoke all privileges, grant option from drop_user@localhost;
grant select(a) on test.t1 to drop_user1@localhost;
grant select on test.t1 to drop_user2@localhost;
grant select on test.* to drop_user3@localhost;
grant select on *.* to drop_user4@localhost;
---error 1267
+--error 1268
drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost,
drop_user4@localhost;
-revoke all privileges, grant from drop_user1@localhost, drop_user2@localhost,
+revoke all privileges, grant option from drop_user1@localhost, drop_user2@localhost,
drop_user3@localhost, drop_user4@localhost;
drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost,
drop_user4@localhost;
drop table t1;
+grant usage on *.* to mysqltest_1@localhost identified by "password";
+grant select, update, insert on test.* to mysqltest@localhost;
+show grants for mysqltest_1@localhost;
+drop user mysqltest_1@localhost;
diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test
index 148c4d3da21..1fc1ed78385 100644
--- a/mysql-test/t/grant2.test
+++ b/mysql-test/t/grant2.test
@@ -15,6 +15,7 @@ grant all privileges on `my\_%`.* to mysqltest_1@localhost with grant option;
connect (user1,localhost,mysqltest_1,,);
connection user1;
select current_user();
+select current_user;
grant all privileges on `my\_1`.* to mysqltest_2@localhost with grant option;
--error 1044
grant all privileges on `my_%`.* to mysqltest_3@localhost with grant option;
diff --git a/mysql-test/t/grant_cache.test b/mysql-test/t/grant_cache.test
index 9ba845d6baa..7806253124e 100644
--- a/mysql-test/t/grant_cache.test
+++ b/mysql-test/t/grant_cache.test
@@ -12,6 +12,8 @@ reset query cache;
flush status;
connect (root,localhost,root,,test,$MASTER_MYPORT,master.sock);
connection root;
+show grants for current_user;
+show grants;
--disable_warnings
create database if not exists mysqltest;
--enable_warnings
@@ -43,15 +45,32 @@ grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost;
# The following queries should be fetched from cache
connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,master.sock);
connection user1;
+show grants for current_user();
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_not_cached";
select "user1";
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_not_cached";
select * from t1;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_not_cached";
# The pre and end space are intentional
select a from t1 ;
+show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_not_cached";
select c from t1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_not_cached";
+connect (unkuser,localhost,,,,$MASTER_MYPORT,master.sock);
+connection unkuser;
+show grants for current_user();
+
# The following queries should be fetched from cache
connect (user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,master.sock);
connection user2;
@@ -92,6 +111,7 @@ show status like "Qcache_not_cached";
connect (user4,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,master.sock);
connection user4;
select "user4";
+show grants;
--error 1046
select a from t1;
# The following query is not cached before (different database)
diff --git a/mysql-test/t/handler.test b/mysql-test/t/handler.test
index d734882591a..72b6624509e 100644
--- a/mysql-test/t/handler.test
+++ b/mysql-test/t/handler.test
@@ -110,3 +110,19 @@ handler t1 read a=(W);
--error 1210
handler t1 read a=(a);
drop table t1;
+#
+# BUG#2304
+#
+create table t1 (a char(5));
+insert into t1 values ("Ok");
+handler t1 open as t;
+handler t read first;
+use mysql;
+handler t read first;
+handler t close;
+handler test.t1 open as t;
+handler t read first;
+handler t close;
+use test;
+drop table t1;
+
diff --git a/mysql-test/t/heap_btree.test b/mysql-test/t/heap_btree.test
index a520065a8b3..d156d059634 100644
--- a/mysql-test/t/heap_btree.test
+++ b/mysql-test/t/heap_btree.test
@@ -110,7 +110,14 @@ drop table t1;
create table t1 (btn char(10) not null, key using BTREE (btn)) engine=heap;
insert into t1 values ("hello"),("hello"),("hello"),("hello"),("hello"),("a"),("b"),("c"),("d"),("e"),("f"),("g"),("h"),("i");
-explain select * from t1 where btn like "q%";
+explain select * from t1 where btn like "i%";
+--replace_column 9 #
+explain select * from t1 where btn like "h%";
+explain select * from t1 where btn like "a%";
+explain select * from t1 where btn like "b%";
+# For the following the BTREE MAY notice that there is no possible matches
+select * from t1 where btn like "ff%";
+select * from t1 where btn like " %";
select * from t1 where btn like "q%";
alter table t1 add column new_col char(1) not null, add key using BTREE (btn,new_col), drop key btn;
update t1 set new_col=left(btn,1);
diff --git a/mysql-test/t/init_file-master.opt b/mysql-test/t/init_file-master.opt
new file mode 100644
index 00000000000..825311dabf2
--- /dev/null
+++ b/mysql-test/t/init_file-master.opt
@@ -0,0 +1 @@
+--init-file=$MYSQL_TEST_DIR/std_data/init_file.dat
diff --git a/mysql-test/t/init_file.test b/mysql-test/t/init_file.test
new file mode 100644
index 00000000000..604d0a01794
--- /dev/null
+++ b/mysql-test/t/init_file.test
@@ -0,0 +1,7 @@
+#
+# This is a regression test for bug #2526 "--init-file crashes MySQL if it
+# contains a large select"
+#
+# See mysql-test/std_data/init_file.dat and
+# mysql-test/t/init_file-master.opt for the actual test
+#
diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test
index b227614e7ae..e20be83b4b6 100644
--- a/mysql-test/t/innodb.test
+++ b/mysql-test/t/innodb.test
@@ -753,8 +753,7 @@ insert into t2 set id=1, t1_id=1;
delete t1,t2 from t1,t2 where t1.id=t2.t1_id;
select * from t1;
select * from t2;
-drop table t1,t2;
-DROP TABLE IF EXISTS t1,t2;
+drop table t2,t1;
CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) ENGINE=INNODB;
CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) ENGINE=INNODB;
INSERT INTO t1 VALUES(1);
@@ -934,6 +933,33 @@ SELECT * from t1;
drop table t1;
#
+# Test dictionary handling with spaceand quoting
+#
+
+CREATE TABLE t1 (`id 1` INT NOT NULL, PRIMARY KEY (`id 1`)) ENGINE=INNODB;
+CREATE TABLE t2 (id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id), FOREIGN KEY (`t1_id`) REFERENCES `t1`(`id 1`) ON DELETE CASCADE ) ENGINE=INNODB;
+#show create table t2;
+drop table t2,t1;
+
+#
+# Test of multi updated and foreign keys
+#
+
+create table `t1` (`id` int( 11 ) not null ,primary key ( `id` )) engine = innodb;
+insert into `t1`values ( 1 ) ;
+create table `t2` (`id` int( 11 ) not null default '0',unique key `id` ( `id` ) ,constraint `t1_id_fk` foreign key ( `id` ) references `t1` (`id` )) engine = innodb;
+insert into `t2`values ( 1 ) ;
+create table `t3` (`id` int( 11 ) not null default '0',key `id` ( `id` ) ,constraint `t2_id_fk` foreign key ( `id` ) references `t2` (`id` )) engine = innodb;
+insert into `t3`values ( 1 ) ;
+--error 1217
+delete t3,t2,t1 from t1,t2,t3 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+--error 1217
+update t1,t2,t3 set t3.id=5, t2.id=6, t1.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+--error 1109
+update t3 set t3.id=7 where t1.id =1 and t2.id = t1.id and t3.id = t2.id;
+drop table t3,t2,t1;
+
+#
# Test timestamps
#
@@ -1003,3 +1029,18 @@ checksum table t1, t2, t3, t4 extended;
#show table status;
drop table t1,t2,t3;
+#
+# Test problem with refering to different fields in same table in UNION
+# (Bug #2552)
+#
+create table t1 (id int, name char(10) not null, name2 char(10) not null) engine=innodb;
+insert into t1 values(1,'first','fff'),(2,'second','sss'),(3,'third','ttt');
+select name2 from t1 union all select name from t1 union all select id from t1;
+drop table t1;
+
+#
+# Bug2160
+#
+create table t1 (a int) engine=innodb;
+create table t2 like t1;
+drop table t1,t2;
diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
index b9b3a9192e6..dc47b3ba990 100644
--- a/mysql-test/t/insert.test
+++ b/mysql-test/t/insert.test
@@ -87,6 +87,58 @@ use mysqltest;
create table t1 (c int);
insert into mysqltest.t1 set mysqltest.t1.c = '1';
drop database mysqltest;
+
+#
+# Test of wrong values for float data (bug #2082)
+#
+
+use test;
+create table t1(number int auto_increment primary key, original_value varchar(50), f_double double, f_float float, f_double_7_2 double(7,2), f_float_4_3 float (4,3), f_double_u double unsigned, f_float_u float unsigned, f_double_15_1_u double(15,1) unsigned, f_float_3_1_u float (3,1) unsigned);
+
+set @value= "aa";
+insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
+--query_vertical select * from t1 where number =last_insert_id()
+
+set @value= "1aa";
+insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
+--query_vertical select * from t1 where number =last_insert_id()
+
+set @value= "aa1";
+insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
+--query_vertical select * from t1 where number =last_insert_id()
+
+set @value= "1e+1111111111a";
+insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
+--query_vertical select * from t1 where number =last_insert_id()
+
+set @value= "-1e+1111111111a";
+insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
+--query_vertical select * from t1 where number =last_insert_id()
+
+set @value= 1e+1111111111;
+insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
+--query_vertical select * from t1 where number =last_insert_id()
+
+set @value= -1e+1111111111;
+insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
+--query_vertical select * from t1 where number =last_insert_id()
+
+set @value= 1e+111;
+insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
+--query_vertical select * from t1 where number =last_insert_id()
+
+set @value= -1e+111;
+insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
+--query_vertical select * from t1 where number =last_insert_id()
+
+set @value= 1;
+insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
+--query_vertical select * from t1 where number =last_insert_id()
+
+set @value= -1;
+insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value);
+--query_vertical select * from t1 where number =last_insert_id()
+
use test;
--disable_warnings
drop table if exists t1,t2,t3;
diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test
index e39e470cf31..234a5ec0eef 100644
--- a/mysql-test/t/insert_select.test
+++ b/mysql-test/t/insert_select.test
@@ -135,3 +135,34 @@ CREATE TABLE t2 ( USID INTEGER UNSIGNED AUTO_INCREMENT, ServerID TINYINT UNSIGNE
INSERT INTO t1 VALUES (39,42,'Access-Granted','46','491721000045',2130706433,17690,NULL,NULL,'Localnet','491721000045','49172200000',754974766,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2003-07-18 00:11:21',NULL,NULL,20030718001121);
INSERT INTO t2 SELECT USID, ServerID, State, SessionID, User, NASAddr, NASPort, NASPortType, ConnectSpeed, CarrierType, CallingStationID, CalledStationID, AssignedAddr, SessionTime, PacketsIn, OctetsIn, PacketsOut, OctetsOut, TerminateCause, UnauthTime, AccessRequestTime, AcctStartTime, AcctLastTime, LastModification from t1 LIMIT 1;
drop table t1,t2;
+
+#
+# Another problem from Bug #2012
+#
+
+CREATE TABLE t1(
+ Month date NOT NULL,
+ Type tinyint(3) unsigned NOT NULL auto_increment,
+ Field int(10) unsigned NOT NULL,
+ Count int(10) unsigned NOT NULL,
+ UNIQUE KEY Month (Month,Type,Field)
+);
+
+insert into t1 Values
+(20030901, 1, 1, 100),
+(20030901, 1, 2, 100),
+(20030901, 2, 1, 100),
+(20030901, 2, 2, 100),
+(20030901, 3, 1, 100);
+
+select * from t1;
+
+Select null, Field, Count From t1 Where Month=20030901 and Type=2;
+
+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;
+
+select * from t2;
+
+drop table t1, t2;
diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test
index 550bce867cd..d2a70208022 100644
--- a/mysql-test/t/insert_update.test
+++ b/mysql-test/t/insert_update.test
@@ -26,3 +26,25 @@ SELECT *, VALUES(a) FROM t1;
explain extended SELECT *, VALUES(a) FROM t1;
explain extended select * from t1 where values(a);
DROP TABLE t1;
+
+#
+# test for Bug #2709 "Affected Rows for ON DUPL.KEY undocumented,
+# perhaps illogical"
+#
+create table t1(a int primary key, b int);
+insert into t1 values(1,1),(2,2),(3,3),(4,4),(5,5);
+select * from t1;
+
+enable_info;
+insert into t1 values(4,14),(5,15),(6,16),(7,17),(8,18)
+ on duplicate key update b=b+10;
+disable_info;
+
+select * from t1;
+
+enable_info;
+replace into t1 values(5,25),(6,26),(7,27),(8,28),(9,29);
+disable_info;
+
+select * from t1;
+drop table t1;
diff --git a/mysql-test/t/key.test b/mysql-test/t/key.test
index 109cbb91e2f..cdaf6062771 100644
--- a/mysql-test/t/key.test
+++ b/mysql-test/t/key.test
@@ -191,3 +191,16 @@ SELECT * FROM t1;
INSERT INTO t1 (c) VALUES ('a'),('a');
SELECT * FROM t1;
drop table t1;
+
+#
+# longer keys
+#
+create table t1 (i int, a char(200), b text, unique (a), unique (b(300))) charset utf8;
+insert t1 values (1, repeat('a',210), repeat('b', 310));
+insert t1 values (2, repeat(0xD0B1,215), repeat(0xD0B1, 310));
+select i, length(a), length(b), char_length(a), char_length(b) from t1;
+select i from t1 where a=repeat(_utf8 'a',200);
+select i from t1 where a=repeat(_utf8 0xD0B1,200);
+select i from t1 where b=repeat(_utf8 'b',310);
+drop table t1;
+
diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test
index d9a2200a636..2bf5cdbcf6f 100644
--- a/mysql-test/t/key_cache.test
+++ b/mysql-test/t/key_cache.test
@@ -41,7 +41,7 @@ SET @@global.key_buffer_size=@save_key_buffer;
--error 1064
SELECT @@default.key_buffer_size;
---error 1271
+--error 1272
SELECT @@skr.storage_engine="test";
select @@keycache1.key_cache_block_size;
@@ -99,7 +99,7 @@ explain select a from t2;
select a from t2;
# Test some error conditions
---error 1283
+--error 1284
cache index t1 in unknown_key_cache;
cache index t1 key (unknown_key) in keycache1;
diff --git a/mysql-test/t/lock.test b/mysql-test/t/lock.test
index 69c453bf60a..26fc4e32bda 100644
--- a/mysql-test/t/lock.test
+++ b/mysql-test/t/lock.test
@@ -53,5 +53,9 @@ check table t1;
# Check error message
lock tables t1 write;
check table t2;
+--error 1100
+insert into t1 select nr from t1;
unlock tables;
+lock tables t1 write, t1 as t1_alias read;
+insert into t1 select index1,nr from t1 as t1_alias;
drop table t1,t2;
diff --git a/mysql-test/t/lock_tables_lost_commit.test b/mysql-test/t/lock_tables_lost_commit.test
index 22b666cbc86..8c1ad97c0cc 100644
--- a/mysql-test/t/lock_tables_lost_commit.test
+++ b/mysql-test/t/lock_tables_lost_commit.test
@@ -1,5 +1,7 @@
# This is a test for bug 578
+-- source include/have_innodb.inc
+
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
diff --git a/mysql-test/t/lowercase_table.test b/mysql-test/t/lowercase_table.test
index 601f1734ac6..db46f3d432d 100644
--- a/mysql-test/t/lowercase_table.test
+++ b/mysql-test/t/lowercase_table.test
@@ -3,7 +3,7 @@
#
--disable_warnings
-drop table if exists t1,t2,t3,t4,T1;
+drop table if exists t1,t2,t3,t4;
--enable_warnings
create table T1 (id int primary key, Word varchar(40) not null, Index(Word));
@@ -30,3 +30,27 @@ select count(*) from t1;
select count(T1.a) from t1;
select count(bags.a) from t1 as Bags;
drop table t1;
+
+#
+# multiupdate/delete & --lower-case-table-names
+#
+create table t1 (a int);
+create table t2 (a int);
+delete p1.*,P2.* from t1 as p1, t2 as p2 where p1.a=P2.a;
+delete P1.*,p2.* from t1 as P1, t2 as P2 where P1.a=p2.a;
+update t1 as p1, t2 as p2 SET p1.a=1,P2.a=1 where p1.a=P2.a;
+update t1 as P1, t2 as P2 SET P1.a=1,p2.a=1 where P1.a=p2.a;
+drop table t1,t2;
+
+#
+# aliases case insensitive
+#
+create table t1 (a int);
+create table t2 (a int);
+-- error 1066
+select * from t1 c, t2 C;
+-- error 1066
+select C.a, c.a from t1 c, t2 C;
+drop table t1, t2;
+
+show tables;
diff --git a/mysql-test/t/lowercase_table2.test b/mysql-test/t/lowercase_table2.test
new file mode 100644
index 00000000000..8f542a7af78
--- /dev/null
+++ b/mysql-test/t/lowercase_table2.test
@@ -0,0 +1,91 @@
+#
+# Test of --lower-case-table-names=2
+# (User has case insensitive file system and want's to preserve case of
+# table names)
+#
+--source include/have_innodb.inc
+--require r/lowercase2.require
+disable_query_log;
+show variables like "lower_case_table_names";
+enable_query_log;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,t2,T1,T2,t3,T3;
+DROP DATABASE IF EXISTS `TEST_$1`;
+DROP DATABASE IF EXISTS `test_$1`;
+--enable_warnings
+
+CREATE TABLE T1 (a int);
+INSERT INTO T1 VALUES (1);
+SHOW TABLES LIKE "T1";
+SHOW TABLES LIKE "t1";
+SHOW CREATE TABLE T1;
+RENAME TABLE T1 TO T2;
+SHOW TABLES LIKE "T2";
+SELECT * FROM t2;
+RENAME TABLE T2 TO t3;
+SHOW TABLES LIKE "T3";
+RENAME TABLE T3 TO T1;
+SHOW TABLES LIKE "T1";
+ALTER TABLE T1 add b int;
+SHOW TABLES LIKE "T1";
+ALTER TABLE T1 RENAME T2;
+SHOW TABLES LIKE "T2";
+
+LOCK TABLE T2 WRITE;
+ALTER TABLE T2 drop b;
+SHOW TABLES LIKE "T2";
+UNLOCK TABLES;
+RENAME TABLE T2 TO T1;
+SHOW TABLES LIKE "T1";
+SELECT * from T1;
+DROP TABLE T1;
+
+#
+# Test database level
+#
+
+CREATE DATABASE `TEST_$1`;
+SHOW DATABASES LIKE "TEST%";
+DROP DATABASE `test_$1`;
+
+#
+# Test of innodb tables with lower_case_table_names=2
+#
+
+CREATE TABLE T1 (a int) engine=innodb;
+INSERT INTO T1 VALUES (1);
+SHOW TABLES LIKE "T1";
+SHOW TABLES LIKE "t1";
+SHOW CREATE TABLE T1;
+RENAME TABLE T1 TO T2;
+SHOW TABLES LIKE "T2";
+SELECT * FROM t2;
+RENAME TABLE T2 TO t3;
+SHOW TABLES LIKE "T3";
+RENAME TABLE T3 TO T1;
+SHOW TABLES LIKE "T1";
+ALTER TABLE T1 add b int;
+SHOW TABLES LIKE "T1";
+ALTER TABLE T1 RENAME T2;
+SHOW TABLES LIKE "T2";
+
+LOCK TABLE T2 WRITE;
+ALTER TABLE T2 drop b;
+SHOW TABLES LIKE "T2";
+UNLOCK TABLES;
+RENAME TABLE T2 TO T1;
+SHOW TABLES LIKE "T1";
+SELECT * from T1;
+DROP TABLE T1;
+
+#
+# Test problem with temporary tables (Bug #2858)
+#
+
+create table T1 (EVENT_ID int auto_increment primary key, LOCATION char(20));
+insert into T1 values (NULL,"Mic-4"),(NULL,"Mic-5"),(NULL,"Mic-6");
+SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3;
+SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3;
+SELECT LOCATION FROM T1 WHERE EVENT_ID=2 UNION ALL SELECT LOCATION FROM T1 WHERE EVENT_ID=3;
+drop table T1;
diff --git a/mysql-test/t/lowercase_table3-master.opt b/mysql-test/t/lowercase_table3-master.opt
new file mode 100644
index 00000000000..9b27aef9bf8
--- /dev/null
+++ b/mysql-test/t/lowercase_table3-master.opt
@@ -0,0 +1 @@
+--lower_case_table_names=0
diff --git a/mysql-test/t/lowercase_table3.test b/mysql-test/t/lowercase_table3.test
new file mode 100644
index 00000000000..735a0b390f9
--- /dev/null
+++ b/mysql-test/t/lowercase_table3.test
@@ -0,0 +1,37 @@
+#
+# Test of force of lower-case-table-names=0
+# (User has case insensitive file system and want's to preserve case of
+# table names)
+#
+
+--source include/have_innodb.inc
+--require r/lowercase0.require
+disable_query_log;
+show variables like "lower_case_%";
+--require r/true.require
+select @@version_compile_os NOT IN ("NT","WIN2000","Win95/Win98","XP") as "TRUE";
+enable_query_log;
+
+--disable_warnings
+DROP TABLE IF EXISTS t1,T1;
+--enable_warnings
+
+#
+# This is actually an error, but ok as the user has forced this
+# by using --lower-case-table-names=0
+
+CREATE TABLE t1 (a int);
+SELECT * from T1;
+drop table t1;
+flush tables;
+
+#
+# InnoDB should in this case be case sensitive
+# Note that this is not true on windows as no this OS, InnoDB is always
+# storing things in lower case.
+#
+
+CREATE TABLE t1 (a int) type=INNODB;
+--error 1016
+SELECT * from T1;
+drop table t1;
diff --git a/mysql-test/t/lowercase_table_qcache-master.opt b/mysql-test/t/lowercase_table_qcache-master.opt
new file mode 100644
index 00000000000..c718e2feb1b
--- /dev/null
+++ b/mysql-test/t/lowercase_table_qcache-master.opt
@@ -0,0 +1 @@
+--lower_case_table_names
diff --git a/mysql-test/t/lowercase_table_qcache.test b/mysql-test/t/lowercase_table_qcache.test
new file mode 100644
index 00000000000..7416de25e1d
--- /dev/null
+++ b/mysql-test/t/lowercase_table_qcache.test
@@ -0,0 +1,29 @@
+-- source include/have_query_cache.inc
+#
+# Test of query cache with --lower-case-table-names
+#
+set GLOBAL query_cache_size=1355776;
+
+--disable_warnings
+drop database if exists MySQLtesT;
+--enable_warnings
+
+create database MySQLtesT;
+create table MySQLtesT.t1 (a int);
+select * from MySQLtesT.t1;
+show status like "Qcache_queries_in_cache";
+drop database mysqltest;
+show status like "Qcache_queries_in_cache";
+
+use MySQL;
+disable_result_log;
+select * from db;
+enable_result_log;
+show status like "Qcache_queries_in_cache";
+use test;
+disable_result_log;
+select * from MySQL.db;
+enable_result_log;
+show status like "Qcache_queries_in_cache";
+
+set GLOBAL query_cache_size=0; \ No newline at end of file
diff --git a/mysql-test/t/metadata.test b/mysql-test/t/metadata.test
new file mode 100644
index 00000000000..c426ab9864b
--- /dev/null
+++ b/mysql-test/t/metadata.test
@@ -0,0 +1,35 @@
+#
+# Test metadata
+#
+
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+--enable_metadata
+
+#
+# First some simple tests
+#
+
+select 1, 1.0, -1, "hello", NULL;
+
+create table t1 (a tinyint, b smallint, c mediumint, d int, e bigint, f float(3,2), g double(4,3), h decimal(5,4), i year, j date, k timestamp, l datetime, m enum('a','b'), n set('a','b'), o char(10));
+select * from t1;
+select a b, b c from t1 as t2;
+drop table t1;
+
+#
+# Test metadata from ORDER BY (Bug #2654)
+#
+
+CREATE TABLE t1 (id tinyint(3) default NULL, data varchar(255) default NULL);
+INSERT INTO t1 VALUES (1,'male'),(2,'female');
+CREATE TABLE t2 (id tinyint(3) unsigned default NULL, data char(3) default '0');
+INSERT INTO t2 VALUES (1,'yes'),(2,'no');
+
+select t1.id, t1.data, t2.data from t1, t2 where t1.id = t2.id;
+select t1.id, t1.data, t2.data from t1, t2 where t1.id = t2.id order by t1.id;
+select t1.id from t1 union select t2.id from t2;
+drop table t1,t2;
+
+--disable_metadata
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index 84b9c816ee5..d0edebe2da3 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -310,7 +310,6 @@ delete t1, t2 from t2,t1
drop table t1,t2;
-
#
# Test for bug #1820.
#
@@ -347,6 +346,41 @@ select 't1 rows after big delete', count(*) from t1;
drop table t1,t2;
#
+# Test alias (this is not correct in 4.0)
+#
+
+CREATE TABLE t1 ( a int );
+CREATE TABLE t2 ( a int );
+DELETE t1 FROM t1, t2 AS t3;
+DELETE t4 FROM t1, t1 AS t4;
+DELETE t3 FROM t1 AS t3, t1 AS t4;
+--error 1066
+DELETE t1 FROM t1 AS t3, t2 AS t4;
+INSERT INTO t1 values (1),(2);
+INSERT INTO t2 values (1),(2);
+DELETE t1 FROM t1 AS t2, t2 AS t1 where t1.a=t2.a and t1.a=1;
+SELECT * from t1;
+SELECT * from t2;
+DELETE t2 FROM t1 AS t2, t2 AS t1 where t1.a=t2.a and t1.a=2;
+SELECT * from t1;
+SELECT * from t2;
+DROP TABLE t1,t2;
+
+#
+# Test update with const tables
+#
+
+create table `t1` (`p_id` int(10) unsigned NOT NULL auto_increment, `p_code` varchar(20) NOT NULL default '', `p_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`p_id`) );
+create table `t2` (`c2_id` int(10) unsigned NULL auto_increment, `c2_p_id` int(10) unsigned NOT NULL default '0', `c2_note` text NOT NULL, `c2_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`c2_id`), KEY `c2_p_id` (`c2_p_id`) );
+insert into t1 values (0,'A01-Comp',1);
+insert into t1 values (0,'B01-Comp',1);
+insert into t2 values (0,1,'A Note',1);
+update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2;
+select * from t1;
+select * from t2;
+drop table t1, t2;
+
+#
# Test for bug #1980.
#
set @ttype_save=@@storage_engine;
diff --git a/mysql-test/t/myisam-blob-master.opt b/mysql-test/t/myisam-blob-master.opt
new file mode 100644
index 00000000000..1a1076c7bad
--- /dev/null
+++ b/mysql-test/t/myisam-blob-master.opt
@@ -0,0 +1 @@
+--max-allowed-packet=24M --skip-innodb --key-buffer-size=1M
diff --git a/mysql-test/t/myisam-blob.test b/mysql-test/t/myisam-blob.test
new file mode 100644
index 00000000000..7af8c661c02
--- /dev/null
+++ b/mysql-test/t/myisam-blob.test
@@ -0,0 +1,41 @@
+#
+# Test bugs in the MyISAM code with blobs
+#
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+# Bug #2159 (Problem with update of blob to > 16M)
+
+CREATE TABLE t1 (data LONGBLOB) ENGINE=myisam;
+INSERT INTO t1 (data) VALUES (NULL);
+UPDATE t1 set data=repeat('a',18*1024*1024);
+select length(data) from t1;
+delete from t1 where left(data,1)='a';
+check table t1;
+truncate table t1;
+INSERT INTO t1 (data) VALUES (repeat('a',1*1024*1024));
+INSERT INTO t1 (data) VALUES (repeat('b',16*1024*1024-1024));
+delete from t1 where left(data,1)='b';
+check table t1;
+
+# now we have two blocks in the table, first is a 1M record and second is
+# a 16M delete block.
+
+UPDATE t1 set data=repeat('c',17*1024*1024);
+check table t1;
+delete from t1 where left(data,1)='c';
+check table t1;
+
+INSERT INTO t1 set data=repeat('a',18*1024*1024);
+select length(data) from t1;
+alter table t1 modify data blob;
+select length(data) from t1;
+drop table t1;
+
+CREATE TABLE t1 (data BLOB) ENGINE=myisam;
+INSERT INTO t1 (data) VALUES (NULL);
+UPDATE t1 set data=repeat('a',18*1024*1024);
+select length(data) from t1;
+drop table t1;
diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test
index 85e5c7a7751..95847ba1af7 100644
--- a/mysql-test/t/myisam.test
+++ b/mysql-test/t/myisam.test
@@ -337,10 +337,10 @@ drop table t1;
#
--error 1071
-CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), KEY t1 (a, b, c));
-CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255));
+CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255), KEY t1 (a, b, c, d, e));
+CREATE TABLE t1 (a varchar(255), b varchar(255), c varchar(255), d varchar(255), e varchar(255));
--error 1071
-ALTER TABLE t1 ADD INDEX t1 (a, b, c);
+ALTER TABLE t1 ADD INDEX t1 (a, b, c, d, e);
DROP TABLE t1;
#
@@ -399,6 +399,69 @@ check table t1;
drop table t1;
#
+# two bugs in myisam-space-stripping feature
+#
+create table t1 ( a text not null, key a (a(20)));
+insert into t1 values ('aaa '),('aaa'),('aa');
+check table t1;
+repair table t1;
+select concat(a,'.') from t1 where a='aaa';
+select concat(a,'.') from t1 where binary a='aaa';
+update t1 set a='bbb' where a='aaa';
+select concat(a,'.') from t1;
+drop table t1;
+
+#
+# Third bug in the same code (BUG#2295)
+#
+
+create table t1(a text not null, b text not null, c text not null, index (a(10),b(10),c(10)));
+insert into t1 values('807780', '477', '165');
+insert into t1 values('807780', '477', '162');
+insert into t1 values('807780', '472', '162');
+select * from t1 where a='807780' and b='477' and c='165';
+drop table t1;
+
+#
+# Verify blob handling
+#
+create table t1 (a blob);
+insert into t1 values('a '),('a');
+select concat(a,'.') from t1 where a='a';
+select concat(a,'.') from t1 where a='a ';
+alter table t1 add key(a(2));
+select concat(a,'.') from t1 where a='a';
+select concat(a,'.') from t1 where a='a ';
+drop table t1;
+
+#
+# Test text and unique
+#
+create table t1 (a int not null auto_increment primary key, b text not null, unique b (b(20)));
+insert into t1 (b) values ('a'),('a '),('a ');
+select concat(b,'.') from t1;
+update t1 set b='b ' where a=2;
+--error 1062
+update t1 set b='b ' where a > 1;
+delete from t1 where b='b';
+select a,concat(b,'.') from t1;
+drop table t1;
+
+#
+# Test keys with 0 segments. (Bug #3203)
+#
+create table t1 (a int not null);
+create table t2 (a int not null, primary key (a));
+insert into t1 values (1);
+insert into t2 values (1),(2);
+select sql_big_result distinct t1.a from t1,t2 order by t2.a;
+select distinct t1.a from t1,t2 order by t2.a;
+select sql_big_result distinct t1.a from t1,t2;
+explain select sql_big_result distinct t1.a from t1,t2 order by t2.a;
+explain select distinct t1.a from t1,t2 order by t2.a;
+drop table t1,t2;
+
+#
# Test RTREE index
#
--error 1235
diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test
index 183f62038fe..d15dac8c0bc 100644
--- a/mysql-test/t/mysqlbinlog.test
+++ b/mysql-test/t/mysqlbinlog.test
@@ -64,17 +64,12 @@ select "--- --position --" as "";
# These are tests for remote binlog.
# They should return the same as previous test.
-# But now they are not. V. Vagin should fix this.
-# We test all the same options second time since code for remote case is
-# essentially different. If code for both cases will be unified we'll be
-# able to throw out most of this.
--disable_query_log
select "--- Remote --" as "";
--enable_query_log
# This is broken now
-# By the way it seems that remote version fetches all events with name >= master-bin.000001
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
--exec $MYSQL_BINLOG --short-form --local-load=$MYSQL_TEST_DIR/var/tmp/ --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index dc0d45187b4..28992655bd2 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -71,3 +71,32 @@ DROP TABLE t1;
create table ```a` (i int);
--exec $MYSQL_DUMP --skip-comments test
drop table ```a`;
+
+#
+# Bug #2591 "mysqldump quotes names inconsistently"
+#
+
+create table t1(a int);
+--exec $MYSQL_DUMP --comments=0 test
+--exec $MYSQL_DUMP --comments=0 --compatible=ansi test
+set global sql_mode='ANSI_QUOTES';
+--exec $MYSQL_DUMP --comments=0 test
+--exec $MYSQL_DUMP --comments=0 --compatible=ansi test
+set global sql_mode='';
+drop table t1;
+
+#
+# Bug #2705 'mysqldump --tab extra output'
+#
+
+create table t1(a int);
+insert into t1 values (1),(2),(3);
+--exec $MYSQL_DUMP --skip-comments --tab=$MYSQL_TEST_DIR/var/tmp/ test
+--exec cat $MYSQL_TEST_DIR/var/tmp/t1.sql
+--exec cat $MYSQL_TEST_DIR/var/tmp/t1.txt
+--exec rm $MYSQL_TEST_DIR/var/tmp/t1.sql
+--exec rm $MYSQL_TEST_DIR/var/tmp/t1.txt
+--exec $MYSQL_DUMP --tab=$MYSQL_TEST_DIR/var/tmp/ test
+--exec rm $MYSQL_TEST_DIR/var/tmp/t1.sql
+--exec rm $MYSQL_TEST_DIR/var/tmp/t1.txt
+drop table t1;
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index bbb0046b47f..9ae9c1b5e12 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -347,6 +347,23 @@ SELECT * FROM t1 ORDER BY (a + b) DESC;
DROP TABLE t1;
#
+# Test of FORCE INDEX ... ORDER BY
+#
+
+create table t1(id int not null auto_increment primary key, t char(12));
+disable_query_log;
+let $1 = 1000;
+while ($1)
+ {
+ eval insert into t1(t) values ('$1');
+ dec $1;
+ }
+enable_query_log;
+explain select id,t from t1 order by id;
+explain select id,t from t1 force index (primary) order by id;
+drop table t1;
+
+#
# Test of test_if_subkey() function
#
CREATE TABLE t1 (
@@ -393,3 +410,28 @@ select * from t1 where b=1 or b is null order by a;
explain select * from t1 where b=2 or b is null order by a;
select * from t1 where b=2 or b is null order by a;
drop table t1;
+
+#
+# Bug #3155 - Strange results with index (x, y) ... WHERE ... ORDER BY pk
+#
+
+create table t1 (a int not null auto_increment, b int not null, c int not null, d int not null,
+key(a,b,d), key(c,b,a));
+create table t2 like t1;
+insert into t1 values (NULL, 1, 2, 0), (NULL, 2, 1, 1), (NULL, 3, 4, 2), (NULL, 4, 3, 3);
+insert into t2 select null, b, c, d from t1;
+insert into t1 select null, b, c, d from t2;
+insert into t2 select null, b, c, d from t1;
+insert into t1 select null, b, c, d from t2;
+insert into t2 select null, b, c, d from t1;
+insert into t1 select null, b, c, d from t2;
+insert into t2 select null, b, c, d from t1;
+insert into t1 select null, b, c, d from t2;
+insert into t2 select null, b, c, d from t1;
+insert into t1 select null, b, c, d from t2;
+optimize table t1;
+set @row=10;
+insert into t1 select 1, b, c + (@row:=@row - 1) * 10, d - @row from t2 limit 10;
+select * from t1 where a=1 and b in (1) order by c, b, a;
+select * from t1 where a=1 and b in (1);
+drop table t1, t2;
diff --git a/mysql-test/t/query_cache.test b/mysql-test/t/query_cache.test
index b46685505ef..e5dc69d21aa 100644
--- a/mysql-test/t/query_cache.test
+++ b/mysql-test/t/query_cache.test
@@ -544,10 +544,25 @@ select * from t3;
enable_result_log;
delete from t4 where a=1;
flush query cache;
-
drop table t1,t2,t3,t4;
#
+# WRITE LOCK & QC
+#
+set query_cache_wlock_invalidate=1;
+create table t1 (a int not null);
+create table t2 (a int not null);
+select * from t1;
+select * from t2;
+show status like "Qcache_queries_in_cache";
+lock table t1 write, t2 read;
+show status like "Qcache_queries_in_cache";
+unlock table;
+drop table t1,t2;
+set query_cache_wlock_invalidate=default;
+
+
+#
# Test character set related variables:
# character_set_result
# character_set_client
@@ -603,7 +618,12 @@ SELECT * FROM test.t1;
USE test;
DROP TABLE t1;
-
+#
+# charset with NULL
+#
+set character_set_results=null;
+select @@character_set_results;
+set character_set_results=default;
# comments before command
#
create table t1 (a int);
diff --git a/mysql-test/t/raid.test b/mysql-test/t/raid.test
index 0d6e851a153..457262a8d75 100644
--- a/mysql-test/t/raid.test
+++ b/mysql-test/t/raid.test
@@ -18,6 +18,7 @@ DROP DATABASE IF EXISTS test_$1;
create database test_$1;
create table test_$1.r1 (i int) raid_type=1;
+create table test_$1.r2 (i int) raid_type=1 raid_chunks=32;
drop database test_$1;
CREATE TABLE t1 (
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index f01d8d4eacf..51b1f34ee79 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -118,7 +118,7 @@ drop table t1;
CREATE TABLE t1 (
t1ID int(10) unsigned NOT NULL auto_increment,
- art char(1) binary NOT NULL default '',
+ art binary(1) NOT NULL default '',
KNR char(5) NOT NULL default '',
RECHNR char(6) NOT NULL default '',
POSNR char(2) NOT NULL default '',
@@ -229,7 +229,7 @@ SELECT * FROM t1 WHERE a IN(1,2) AND b=5;
DROP TABLE t1;
#
-# Test error with
+# Test problem with range optimzer and sub ranges
#
CREATE TABLE t1 (a int, b int, c int, INDEX (c,a,b));
@@ -240,6 +240,22 @@ SELECT COUNT(*) FROM t1 WHERE (c=0 and a=1) or (c=0 and b=1);
SELECT COUNT(*) FROM t1 WHERE (c=0 and b=1) or (c=0 and a=1);
DROP TABLE t1;
+#
+# Test problem with range optimization over overlapping ranges (#2448)
+#
+
+CREATE TABLE t1 ( a int not null, b int not null, INDEX ab(a,b) );
+INSERT INTO t1 VALUES (47,1), (70,1), (15,1), (15, 4);
+SELECT * FROM t1
+WHERE
+(
+ ( b =1 AND a BETWEEN 14 AND 21 ) OR
+ ( b =2 AND a BETWEEN 16 AND 18 ) OR
+ ( b =3 AND a BETWEEN 15 AND 19 ) OR
+ (a BETWEEN 19 AND 47)
+);
+DROP TABLE t1;
+
# test for a bug with in() and unique key
create table t1 (id int(10) primary key);
diff --git a/mysql-test/t/rename.test b/mysql-test/t/rename.test
index 48a9cb401d9..bea0641ad23 100644
--- a/mysql-test/t/rename.test
+++ b/mysql-test/t/rename.test
@@ -35,3 +35,27 @@ select * from t3;
# This should give a warning for t4
drop table if exists t1,t2,t3,t4;
+
+#
+# Test-case for Bug #2397 RENAME TABLES is not blocked by
+# FLUSH TABLES WITH READ LOCK
+#
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+
+connection con1;
+CREATE TABLE t1 (a int);
+CREATE TABLE t3 (a int);
+connection con2;
+FLUSH TABLES WITH READ LOCK;
+connection con1;
+send RENAME TABLE t1 TO t2, t3 to t4;
+connection con2;
+sleep 1;
+show tables;
+UNLOCK TABLES;
+sleep 1;
+show tables;
+
+drop table t2, t4;
diff --git a/mysql-test/t/repair_part1.test b/mysql-test/t/repair_part1.test
index e82edb64713..a2e186fd385 100644
--- a/mysql-test/t/repair_part1.test
+++ b/mysql-test/t/repair_part1.test
@@ -12,6 +12,18 @@ alter table t1 ENGINE=HEAP;
repair table t1 use_frm;
drop table t1;
+#
+# disabled keys during repair
+#
+create table t1(id int PRIMARY KEY, st varchar(10), KEY st_key(st));
+insert into t1 values(1, "One");
+alter table t1 disable keys;
+show keys from t1;
+repair table t1 extended;
+show keys from t1;
+drop table t1;
+
+
# non-existent table
repair table t1 use_frm;
diff --git a/mysql-test/t/row.test b/mysql-test/t/row.test
index ecb0c6adfc1..62e8eb7991c 100644
--- a/mysql-test/t/row.test
+++ b/mysql-test/t/row.test
@@ -15,7 +15,7 @@ select row('b',1.5,3) IN (row(3,NULL,3), row('a',1.5,3), row(1,3,3));
select row('b',1.5,3) IN (row('b',NULL,3), row('a',1.5,3), row(1,3,3));
select row('b',1.5,3) IN (row('b',NULL,4), row('a',1.5,3), row(1,3,3));
select (1,2,(3,4)) IN ((3,2,(3,4)), (1,2,(3,4)));
--- error 1240
+-- error 1241
select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,4));
select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL)));
explain extended select row(1,2,row(3,4)) IN (row(3,2,row(3,4)), row(1,2,row(3,NULL)));
@@ -37,12 +37,12 @@ SELECT ROW(NULL,2,3)=ROW(NULL,2,3);
SELECT ROW(NULL,2,3)<=>ROW(NULL,2,3);
SELECT ROW(1,2,ROW(3,4,5))=ROW(1,2,ROW(3,4,5));
SELECT ROW('test',2,3.33)=ROW('test',2,3.33);
--- error 1240
+-- error 1241
SELECT ROW('test',2,3.33)=ROW('test',2,3.33,4);
SELECT ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,33));
SELECT ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,3));
SELECT ROW('test',2,ROW(3,33))=ROW('test',2,ROW(3,NULL));
--- error 1240
+-- error 1241
SELECT ROW('test',2,ROW(3,33))=ROW('test',2,4);
create table t1 ( a int, b int, c int);
@@ -56,15 +56,15 @@ select ROW(a,b,c) IN(row(1,2,3), row(3,2,1)) from t1;
select ROW(1,2,3) IN(row(a,b,c), row(1,2,3)) from t1;
drop table t1;
--- error 1240
+-- error 1241
select ROW(1,1);
create table t1 (i int);
--- error 1240
+-- error 1241
select 1 from t1 where ROW(1,1);
--- error 1240
+-- error 1241
select count(*) from t1 order by ROW(1,1);
--- error 1240
+-- error 1241
select count(*) from t1 having (1,1) order by i;
drop table t1;
diff --git a/mysql-test/t/rpl000002.test b/mysql-test/t/rpl000002.test
index 803eb069b66..4fbb6a595a4 100644
--- a/mysql-test/t/rpl000002.test
+++ b/mysql-test/t/rpl000002.test
@@ -1,5 +1,7 @@
source include/master-slave.inc;
+# Test replication of auto_increment
+
create table t1 (n int auto_increment primary key);
set insert_id = 2000;
insert into t1 values (NULL),(NULL),(NULL);
@@ -12,15 +14,26 @@ drop table t1;
sync_slave_with_master;
stop slave;
connection master;
+
+# Test replication of timestamp
+
create table t2(id int auto_increment primary key, created datetime);
set timestamp=12345;
insert into t2 set created=now();
select * from t2;
+
+# Test replication of CREATE .. LIKE (Bug #2557)
+
+create table t3 like t2;
+create temporary table t4 like t2;
+create table t5 select * from t4;
save_master_pos;
connection slave;
start slave;
sync_with_master;
select * from t2;
+show create table t3;
+show create table t5;
connection master;
-drop table t2;
+drop table t2,t3,t5;
sync_slave_with_master;
diff --git a/mysql-test/t/rpl000009.test b/mysql-test/t/rpl000009.test
index cd318efa2b6..59451bc888d 100644
--- a/mysql-test/t/rpl000009.test
+++ b/mysql-test/t/rpl000009.test
@@ -118,6 +118,21 @@ connection slave;
sync_with_master;
select * from mysqltest.t1;
+# Check that LOAD DATA FROM MASTER is able to create master.info
+# if needed (if RESET SLAVE was used before), before writing to it (BUG#2922).
+
+stop slave;
+reset slave;
+load data from master;
+start slave;
+# see if replication coordinates were restored fine
+connection master;
+insert into mysqltest.t1 values (5, 'five bar');
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from mysqltest.t1;
+
# Check that LOAD DATA FROM MASTER reports the error if it can't drop a
# table to be overwritten.
# DISABLED FOR NOW AS chmod IS NOT PORTABLE ON NON-UNIX
diff --git a/mysql-test/t/rpl_error_ignored_table-slave.opt b/mysql-test/t/rpl_error_ignored_table-slave.opt
index 0d3485f9e25..cb49119bfcb 100644
--- a/mysql-test/t/rpl_error_ignored_table-slave.opt
+++ b/mysql-test/t/rpl_error_ignored_table-slave.opt
@@ -1 +1 @@
---replicate-ignore-table=test.t1
+--replicate-ignore-table=test.t1 --replicate-ignore-table=test.t2 --replicate-ignore-table=test.t3
diff --git a/mysql-test/t/rpl_error_ignored_table.test b/mysql-test/t/rpl_error_ignored_table.test
index 522d464c707..b7eec472375 100644
--- a/mysql-test/t/rpl_error_ignored_table.test
+++ b/mysql-test/t/rpl_error_ignored_table.test
@@ -24,3 +24,33 @@ drop table t1;
save_master_pos;
connection slave;
sync_with_master;
+
+# Now test that even critical errors (connection killed)
+# are ignored if rules allow it.
+# The "kill" idea was copied from rpl000001.test.
+
+connection master1;
+select get_lock('crash_lock%20C', 10);
+
+connection master;
+create table t2 (a int primary key);
+insert into t2 values(1);
+create table t3 (id int);
+insert into t3 values(connection_id());
+send update t2 set a = a + 1 + get_lock('crash_lock%20C', 10);
+
+connection master1;
+sleep 2;
+select (@id := id) - id from t3;
+kill @id;
+drop table t2,t3;
+connection master;
+--error 0,1053;
+reap;
+connection master1;
+show binlog events from 79;
+save_master_pos;
+connection slave;
+# SQL slave thread should not have stopped (because table of the killed
+# query is in the ignore list).
+sync_with_master;
diff --git a/mysql-test/t/rpl_heap.test b/mysql-test/t/rpl_heap.test
new file mode 100644
index 00000000000..15f61918034
--- /dev/null
+++ b/mysql-test/t/rpl_heap.test
@@ -0,0 +1,47 @@
+# You must run this test with --manager.
+
+require_manager;
+
+# Don't know why, but using TCP/IP connections makes this test fail
+# with "Lost connection to MySQL server during query" when we
+# issue a query after the server restart.
+# Maybe this is something awkward in mysqltest or in the manager?
+# So we use sockets.
+connect (master,localhost,root,,test,0,master.sock);
+connect (slave,localhost,root,,test,0,slave.sock);
+
+connection master;
+reset master;
+drop table if exists t1;
+create table t1 (a int) type=HEAP;
+insert into t1 values(10);
+save_master_pos;
+show binlog events from 79;
+connection slave;
+reset slave;
+start slave;
+sync_with_master;
+show create table t1;
+select * from t1; # should be one row
+
+server_stop master;
+server_start master;
+
+connection master;
+select * from t1;
+# to check that DELETE is not written twice
+# (the LIMIT is to not use the query cache)
+select * from t1 limit 10;
+save_master_pos;
+show binlog events in 'master-bin.002' from 79;
+
+connection slave;
+sync_with_master;
+select * from t1; # should be empty
+
+# clean up
+connection master;
+drop table t1;
+save_master_pos;
+connection slave;
+sync_with_master;
diff --git a/mysql-test/t/rpl_insert_id.test b/mysql-test/t/rpl_insert_id.test
index 8244c323a0d..4c27c03af60 100644
--- a/mysql-test/t/rpl_insert_id.test
+++ b/mysql-test/t/rpl_insert_id.test
@@ -41,8 +41,8 @@ connection master;
# check if INSERT SELECT in auto_increment is well replicated (bug #490)
-drop table t1;
drop table t2;
+drop table t1;
create table t1(a int auto_increment, key(a));
create table t2(b int auto_increment, c int, key(b));
insert into t1 values (10);
diff --git a/mysql-test/t/rpl_multi_delete-slave.opt b/mysql-test/t/rpl_multi_delete-slave.opt
new file mode 100644
index 00000000000..c98fe0b0a46
--- /dev/null
+++ b/mysql-test/t/rpl_multi_delete-slave.opt
@@ -0,0 +1 @@
+--replicate-wild-do-table=test.%
diff --git a/mysql-test/t/rpl_multi_delete.test b/mysql-test/t/rpl_multi_delete.test
new file mode 100644
index 00000000000..299cb720b62
--- /dev/null
+++ b/mysql-test/t/rpl_multi_delete.test
@@ -0,0 +1,23 @@
+source include/master-slave.inc;
+create table t1 (a int);
+create table t2 (a int);
+
+insert into t1 values (1);
+insert into t2 values (1);
+
+delete t1.* from t1, t2 where t1.a = t2.a;
+
+save_master_pos;
+select * from t1;
+select * from t2;
+
+connection slave;
+sync_with_master;
+select * from t1;
+select * from t2;
+
+connection master;
+drop table t1,t2;
+save_master_pos;
+connection slave;
+sync_with_master;
diff --git a/mysql-test/t/rpl_optimize.test b/mysql-test/t/rpl_optimize.test
new file mode 100644
index 00000000000..9f02b715885
--- /dev/null
+++ b/mysql-test/t/rpl_optimize.test
@@ -0,0 +1,43 @@
+# Test for BUG#1858 "OPTIMIZE TABLE done by a client
+# thread stops the slave SQL thread".
+# You can replace OPTIMIZE by REPAIR.
+
+source include/master-slave.inc;
+
+create table t1 (a int not null auto_increment primary key, b int, key(b));
+INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+INSERT INTO t1 (a) SELECT null FROM t1;
+save_master_pos;
+# a few updates to force OPTIMIZE to do something
+update t1 set b=(a/2*rand());
+delete from t1 order by b limit 10000;
+
+connection slave;
+sync_with_master;
+optimize table t1;
+connection master;
+save_master_pos;
+connection slave;
+# Bug was that when the INSERT terminated on slave,
+# the slave SQL thread got killed by OPTIMIZE.
+sync_with_master; # won't work if slave SQL thread stopped
+
+connection master; # cleanup
+drop table t1;
+connection slave;
+sync_with_master;
+
+# If the machine is so fast that slave syncs before OPTIMIZE
+# starts, this test wil demonstrate nothing but will pass.
diff --git a/mysql-test/t/rpl_relayrotate-master.opt b/mysql-test/t/rpl_relayrotate-master.opt
new file mode 100644
index 00000000000..4cb927540bf
--- /dev/null
+++ b/mysql-test/t/rpl_relayrotate-master.opt
@@ -0,0 +1 @@
+--binlog_cache_size=32768
diff --git a/mysql-test/t/rpl_relayrotate.test b/mysql-test/t/rpl_relayrotate.test
index 20a77ff8b64..d692140ddd9 100644
--- a/mysql-test/t/rpl_relayrotate.test
+++ b/mysql-test/t/rpl_relayrotate.test
@@ -60,6 +60,23 @@ select max(a) from t1;
--replace_column 1 # 8 # 9 # 23 # 33 #
--replace_result $MASTER_MYPORT MASTER_MYPORT
show slave status;
+connection master;
+
+# binlog_cache_use and binlog_cache_disk_use status vars test
+# This test uses the previous test. Namely, it needs the long
+# transaction that adds 8000 lines to the t1 table.
+
+show status like "binlog_cache_use";
+show status like "binlog_cache_disk_use";
+
+# transaction which should not be flushed to disk and so should not
+# increase binlog_cache_disk_use
+begin;
+delete from t1;
+commit;
+
+show status like "binlog_cache_use";
+show status like "binlog_cache_disk_use";
# The following DROP is a very important cleaning task:
# imagine the next test is run with --skip-innodb: it will do
@@ -71,3 +88,7 @@ show slave status;
# InnoDB: Error: table t1 already exists in InnoDB internal
# InnoDB: data dictionary. Have you deleted the .frm file etc
drop table t1;
+# wait until this drop is executed on slave
+save_master_pos;
+connection slave;
+sync_with_master;
diff --git a/mysql-test/t/rpl_temporary.test b/mysql-test/t/rpl_temporary.test
index 0df8ceb6377..f84c9b09aef 100644
--- a/mysql-test/t/rpl_temporary.test
+++ b/mysql-test/t/rpl_temporary.test
@@ -28,9 +28,22 @@ connect (con3,localhost,zedjzlcsjhd,,);
# check that it requires the SUPER privilege.
connection con3;
+SET @save_select_limit=@@session.sql_select_limit;
--error 1227
+SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100;
+SELECT @@session.sql_select_limit = @save_select_limit; #shouldn't have changed
+# While we are here we also test that SQL_LOG_BIN can't be set
+--error 1227
+SET @@session.sql_select_limit=10, @@session.sql_log_bin=0;
+SELECT @@session.sql_select_limit = @save_select_limit; #shouldn't have changed
+# Now as root, to be sure it works
+connection con2;
SET @@session.pseudo_thread_id=100;
+SET @@session.pseudo_thread_id=connection_id();
+SET @@session.sql_log_bin=0;
+SET @@session.sql_log_bin=1;
+connection con3;
let $VERSION=`select version()`;
--disable_warnings
diff --git a/mysql-test/t/rpl_until.test b/mysql-test/t/rpl_until.test
index 545b495938a..f7ca51ecabc 100644
--- a/mysql-test/t/rpl_until.test
+++ b/mysql-test/t/rpl_until.test
@@ -67,15 +67,15 @@ real_sleep 4
show slave status;
#testing various error conditions
---error 1276
+--error 1277
start slave until master_log_file='master-bin', master_log_pos=561;
---error 1276
+--error 1277
start slave until master_log_file='master-bin.000001', master_log_pos=561, relay_log_pos=12;
---error 1276
+--error 1277
start slave until master_log_file='master-bin.000001';
---error 1276
+--error 1277
start slave until relay_log_file='slave-relay-bin.000002';
---error 1276
+--error 1277
start slave until relay_log_file='slave-relay-bin.000002', master_log_pos=561;
start slave sql_thread;
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 446c8768146..0a3de178456 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -1862,3 +1862,19 @@ select * from t1 left join t2 on id1 = id2 left join t3 on id1 = id3
left join t4 on id3 = id4 where id2 = 1 or id4 = 1;
drop table t1,t2,t3,t4;
+#
+# Bug #2298
+#
+
+create table t1(s varchar(10) not null);
+create table t2(s varchar(10) not null primary key);
+create table t3(s varchar(10) not null primary key);
+insert into t1 values ('one\t'), ('two\t');
+insert into t2 values ('one\r'), ('two\t');
+insert into t3 values ('one '), ('two\t');
+select * from t1 where s = 'one';
+select * from t2 where s = 'one';
+select * from t3 where s = 'one';
+select * from t1,t2 where t1.s = t2.s;
+select * from t2,t3 where t2.s = t3.s;
+drop table t1, t2, t3;
diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test
index 3cf736cafb0..e63e894c1cf 100644
--- a/mysql-test/t/select_found.test
+++ b/mysql-test/t/select_found.test
@@ -109,3 +109,31 @@ select FOUND_ROWS();
select SQL_CALC_FOUND_ROWS * from t1 where id > 6 limit 0, 1;
select FOUND_ROWS();
drop table t1;
+
+#
+# Other bugs with range optimization
+#
+
+# bug #2448
+
+CREATE TABLE t1 ( a int not null, b int not null, KEY ab(a,b) );
+INSERT INTO t1 VALUES ( 47, 1 );
+INSERT INTO t1 VALUES ( 70, 1 );
+SELECT * FROM t1
+WHERE
+(
+ ( b =1 AND a BETWEEN 14 AND 21 ) OR
+ ( b =2 AND a BETWEEN 16 AND 18 ) OR
+ ( b =3 AND a BETWEEN 15 AND 19 )
+);
+DROP TABLE t1;
+
+# bug #2698
+
+CREATE TABLE t1 ( a integer, u varchar(15), r integer, key uao_idx( r, a, u));
+DELETE FROM t1
+WHERE ( r = 1 AND a IN ( 1, 2 ) AND ( u = 'w' OR u LIKE 'w/%' ) )
+ OR ( r = 1 AND a IN ( 3 ) AND ( u = 'w/U' OR u LIKE 'w/U/%' ) )
+ OR ( r = 1 AND a IN ( 1, 2, 3 ) AND ( u = 'w' ) );
+drop table t1;
+
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index 1d64cfd2105..b0307af19bb 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -54,8 +54,8 @@ create table t1 (
test_set set( 'val1', 'val2', 'val3' ) not null default '',
name char(20) default 'O''Brien' comment 'O''Brien as default',
c int not null comment 'int column',
- `c-b` int comment 'name with a space',
- `space ` int comment 'name with a space',
+ `c-b` int comment 'name with a minus',
+ `space 2` int comment 'name with a space',
) comment = 'it\'s a table' ;
show create table t1;
set sql_quote_show_create=0;
@@ -147,31 +147,43 @@ drop table t1;
# Test for Bug #2593 "SHOW CREATE TABLE doesn't properly double quotes"
#
-SET sql_mode='';
-SET sql_quote_show_create=OFF;
+SET @old_sql_mode= @@sql_mode, sql_mode= '';
+SET @old_sql_quote_show_create= @@sql_quote_show_create, sql_quote_show_create= OFF;
-CREATE TABLE ```ab``cd``` (i INT);
-SHOW CREATE TABLE ```ab``cd```;
-DROP TABLE ```ab``cd```;
+######### hook for WL#1324 #
+--error 1103
+CREATE TABLE `a/b` (i INT);
+# the above test should WORK when WL#1324 is done,
+# it should be removed and
+# the following part should be uncommented then
+#########################################################
+# begin of part that must be uncommented when WL#1324 is done
+#########################################################
+#CREATE TABLE ```ab``cd``` (i INT);
+#SHOW CREATE TABLE ```ab``cd```;
+#DROP TABLE ```ab``cd```;
-CREATE TABLE ```ab````cd``` (i INT);
-SHOW CREATE TABLE ```ab````cd```;
-DROP TABLE ```ab````cd```;
+#CREATE TABLE ```ab````cd``` (i INT);
+#SHOW CREATE TABLE ```ab````cd```;
+#DROP TABLE ```ab````cd```;
-CREATE TABLE ```a` (i INT);
-SHOW CREATE TABLE ```a`;
-DROP TABLE ```a`;
+#CREATE TABLE ```a` (i INT);
+#SHOW CREATE TABLE ```a`;
+#DROP TABLE ```a`;
-SET sql_mode='ANSI_QUOTES';
+SET sql_mode= 'ANSI_QUOTES';
-CREATE TABLE """a" (i INT);
-SHOW CREATE TABLE """a";
-DROP TABLE """a";
+#CREATE TABLE """a" (i INT);
+#SHOW CREATE TABLE """a";
+#DROP TABLE """a";
+#########################################################
+# end of part that must be uncommented when WL#1324 is done
+#########################################################
# to test quotes around keywords.. :
-SET sql_mode='';
-SET sql_quote_show_create=OFF;
+SET sql_mode= '';
+SET sql_quote_show_create= OFF;
CREATE TABLE t1 (i INT);
SHOW CREATE TABLE t1;
@@ -181,4 +193,114 @@ CREATE TABLE `table` (i INT);
SHOW CREATE TABLE `table`;
DROP TABLE `table`;
-SET sql_quote_show_create=ON;
+SET sql_quote_show_create= @old_sql_quote_show_create;
+SET sql_mode= @old_sql_mode;
+
+#
+# Test for bug #2719 "Heap tables status shows wrong or missing data."
+#
+
+select @@max_heap_table_size;
+
+CREATE TABLE t1 (
+ a int(11) default NULL,
+ KEY a TYPE BTREE (a)
+) ENGINE=HEAP;
+
+CREATE TABLE t2 (
+ b int(11) default NULL,
+ index(b)
+) ENGINE=HEAP;
+
+CREATE TABLE t3 (
+ a int(11) default NULL,
+ b int(11) default NULL,
+ KEY a TYPE BTREE (a),
+ index(b)
+) ENGINE=HEAP;
+
+insert into t1 values (1),(2);
+insert into t2 values (1),(2);
+insert into t3 values (1,1),(2,2);
+--replace_column 6 # 7 # 8 #
+show table status;
+insert into t1 values (3),(4);
+insert into t2 values (3),(4);
+insert into t3 values (3,3),(4,4);
+--replace_column 6 # 7 # 8 #
+show table status;
+insert into t1 values (5);
+insert into t2 values (5);
+insert into t3 values (5,5);
+--replace_column 6 # 7 # 8 #
+show table status;
+delete from t1 where a=3;
+delete from t2 where b=3;
+delete from t3 where a=3;
+--replace_column 6 # 7 # 8 #
+show table status;
+delete from t1;
+delete from t2;
+delete from t3;
+--replace_column 6 # 7 # 8 #
+show table status;
+insert into t1 values (5);
+insert into t2 values (5);
+insert into t3 values (5,5);
+--replace_column 6 # 7 # 8 #
+show table status;
+delete from t1 where a=5;
+delete from t2 where b=5;
+delete from t3 where a=5;
+--replace_column 6 # 7 # 8 #
+show table status;
+
+drop table t1, t2, t3;
+
+#
+# Test for bug #3342 SHOW CREATE DATABASE seems to require DROP privilege
+#
+
+create database test_$1;
+show create database test_$1;
+create table test_$1.t1(a int);
+insert into test_$1.t1 values(1);
+grant select on `test_$1`.* to mysqltest_1@localhost;
+grant usage on `test_$1`.* to mysqltest_2@localhost;
+grant drop on `test_$1`.* to mysqltest_3@localhost;
+
+connect (con1,localhost,mysqltest_1,,test_$1);
+connection con1;
+select * from t1;
+show create database test_$1;
+--error 1044
+drop table t1;
+--error 1044
+drop database test_$1;
+
+connect (con2,localhost,mysqltest_2,,test);
+connection con2;
+--error 1044
+select * from test_$1.t1;
+--error 1044
+show create database test_$1;
+--error 1044
+drop table test_$1.t1;
+--error 1044
+drop database test_$1;
+
+connect (con3,localhost,mysqltest_3,,test);
+connection con3;
+--error 1044
+select * from test_$1.t1;
+--error 1044
+show create database test_$1;
+drop table test_$1.t1;
+drop database test_$1;
+
+connection default;
+delete from mysql.user
+where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
+delete from mysql.db
+where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
+flush privileges;
diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test
index 2f05141ee31..40f182f50a1 100644
--- a/mysql-test/t/subselect.test
+++ b/mysql-test/t/subselect.test
@@ -9,12 +9,12 @@ SELECT (SELECT 1) UNION SELECT (SELECT 2);
explain extended SELECT (SELECT 1) UNION SELECT (SELECT 2);
SELECT (SELECT (SELECT 0 UNION SELECT 0));
explain extended SELECT (SELECT (SELECT 0 UNION SELECT 0));
--- error 1246
+-- error 1247
SELECT (SELECT 1 FROM (SELECT 1) as b HAVING a=1) as a;
--- error 1246
+-- error 1247
SELECT (SELECT 1 FROM (SELECT 1) as b HAVING b=1) as a,(SELECT 1 FROM (SELECT 1) as c HAVING a=1) as b;
SELECT (SELECT 1),MAX(1) FROM (SELECT 1) as a;
--- error 1246
+-- error 1247
SELECT (SELECT a) as a;
EXPLAIN EXTENDED SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1;
SELECT 1 FROM (SELECT 1 as a) as b HAVING (SELECT a)=1;
@@ -24,7 +24,7 @@ SELECT 1 as a FROM (SELECT 1) as b HAVING (SELECT a)=1;
-- error 1054
SELECT 1 FROM (SELECT (SELECT a) b) c;
SELECT * FROM (SELECT 1 as id) b WHERE id IN (SELECT * FROM (SELECT 1 as id) c ORDER BY id);
--- error 1240
+-- error 1241
SELECT * FROM (SELECT 1) a WHERE 1 IN (SELECT 1,1);
SELECT 1 IN (SELECT 1);
SELECT 1 FROM (SELECT 1 as a) b WHERE 1 IN (SELECT (SELECT a));
@@ -51,7 +51,7 @@ SELECT (SELECT 'b',2,'a') = ROW(1.5,2,'a');
SELECT (SELECT 1.5,2,'a') = ROW(1.5,'c','a');
SELECT (SELECT 1.5,'c','a') = ROW(1.5,2,'a');
--- error 1240
+-- error 1241
SELECT (SELECT * FROM (SELECT 'test' a,'test' b) a);
SELECT 1 as a,(SELECT a+a) b,(SELECT b);
@@ -63,7 +63,7 @@ create table t4 (a int not null, b int not null);
insert into t1 values (2);
insert into t2 values (1,7),(2,7);
insert into t4 values (4,8),(3,8),(5,9);
--- error 1246
+-- error 1247
select (select a from t1 where t1.a = a1) as a2, (select b from t2 where t2.b=a2) as a1;
select (select a from t1 where t1.a=t2.a), a from t2;
select (select a from t1 where t1.a=t2.b), a from t2;
@@ -103,9 +103,9 @@ select * from t3 where a >= any (select b from t2);
explain extended select * from t3 where a >= any (select b from t2);
select * from t3 where a >= all (select b from t2);
delete from t2 where a=100;
--- error 1240
+-- error 1241
select * from t3 where a in (select a,b from t2);
--- error 1240
+-- error 1241
select * from t3 where a in (select * from t2);
insert into t4 values (12,7),(1,7),(10,9),(9,6),(7,6),(3,9),(1,10);
-- empty set
@@ -121,7 +121,7 @@ select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a)
insert into t5 values (2);
select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
explain extended select (select a from t1 where t1.a=t2.a union select a from t5 where t5.a=t2.a), a from t2;
--- error 1241
+-- error 1242
select (select a from t1 where t1.a=t2.a union all select a from t5 where t5.a=t2.a), a from t2;
create table t6 (patient_uq int, clinic_uq int, index i1 (clinic_uq));
create table t7( uq int primary key, name char(25));
@@ -158,14 +158,14 @@ INSERT INTO t8 (pseudo,email) VALUES ('joce','test');
INSERT INTO t8 (pseudo,email) VALUES ('joce1','test1');
INSERT INTO t8 (pseudo,email) VALUES ('2joce1','2test1');
EXPLAIN EXTENDED SELECT pseudo,(SELECT email FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce')) FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce');
--- error 1240
+-- error 1241
SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo,email FROM
t8 WHERE pseudo='joce');
--- error 1240
+-- error 1241
SELECT pseudo FROM t8 WHERE pseudo=(SELECT * FROM t8 WHERE
pseudo='joce');
SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo='joce');
--- error 1241
+-- error 1242
SELECT pseudo FROM t8 WHERE pseudo=(SELECT pseudo FROM t8 WHERE pseudo LIKE '%joce%');
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8;
@@ -185,7 +185,7 @@ EXPLAIN EXTENDED SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03');
SELECT DISTINCT date FROM t1 WHERE date='2002-08-03';
SELECT (SELECT DISTINCT date FROM t1 WHERE date='2002-08-03');
SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION SELECT 1) UNION ALL SELECT 1;
--- error 1241
+-- error 1242
SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION ALL SELECT 1) UNION SELECT 1;
EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1=(SELECT 1 UNION SELECT 1);
drop table t1;
@@ -242,9 +242,9 @@ CREATE TABLE `t1` (
) ENGINE=MyISAM ROW_FORMAT=FIXED;
INSERT INTO t1 (numeropost,maxnumrep) VALUES (1,0),(2,1);
--- error 1241
+-- error 1242
select numeropost as a FROM t1 GROUP BY (SELECT 1 FROM t1 HAVING a=1);
--- error 1241
+-- error 1242
select numeropost as a FROM t1 ORDER BY (SELECT 1 FROM t1 HAVING a=1);
drop table t1;
@@ -256,7 +256,7 @@ drop table t1;
#iftest
CREATE TABLE t1 (field char(1) NOT NULL DEFAULT 'b');
INSERT INTO t1 VALUES ();
--- error 1241
+-- error 1242
SELECT field FROM t1 WHERE 1=(SELECT 1 UNION ALL SELECT 1 FROM (SELECT 1) a HAVING field='b');
drop table t1;
@@ -269,13 +269,13 @@ CREATE TABLE `t1` (
UNIQUE KEY `numreponse` (`numreponse`),
KEY `pseudo` (`pseudo`,`numeropost`)
) ENGINE=MyISAM;
--- error 1246
+-- error 1247
SELECT (SELECT numeropost FROM t1 HAVING numreponse=a),numreponse FROM (SELECT * FROM t1) as a;
-- error 1054
SELECT numreponse, (SELECT numeropost FROM t1 HAVING numreponse=a) FROM (SELECT * FROM t1) as a;
SELECT numreponse, (SELECT numeropost FROM t1 HAVING numreponse=1) FROM (SELECT * FROM t1) as a;
INSERT INTO t1 (numeropost,numreponse,pseudo) VALUES (1,1,'joce'),(1,2,'joce'),(1,3,'test');
--- error 1241
+-- error 1242
EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT 1 FROM t1 WHERE numeropost='1');
EXPLAIN EXTENDED SELECT MAX(numreponse) FROM t1 WHERE numeropost='1';
EXPLAIN EXTENDED SELECT numreponse FROM t1 WHERE numeropost='1' AND numreponse=(SELECT MAX(numreponse) FROM t1 WHERE numeropost='1');
@@ -294,7 +294,7 @@ insert into t2 values (1, 21),(2, 22),(3, 23);
select * from t1;
-- error 1093
update t1 set b= (select b from t1);
--- error 1241
+-- error 1242
update t1 set b= (select b from t2);
update t1 set b= (select b from t2 where t1.a = t2.a);
select * from t1;
@@ -309,7 +309,7 @@ select * from t1;
select * from t1 where b = (select b from t2 where t1.a = t2.a);
-- error 1093
delete from t1 where b = (select b from t1);
--- error 1241
+-- error 1242
delete from t1 where b = (select b from t2);
delete from t1 where b = (select b from t2 where t1.a = t2.a);
select * from t1;
@@ -327,7 +327,7 @@ select * from t11;
select * from t12;
-- error 1093
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t12 where t11.a = t12.a);
--- error 1241
+-- error 1242
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2);
delete t11.*, t12.* from t11,t12 where t11.a = t12.a and t11.b = (select b from t2 where t11.a = t2.a);
select * from t11;
@@ -342,7 +342,7 @@ insert into t2 values (1);
insert into t3 values (1),(2);
-- error 1093
INSERT INTO t1 (x) VALUES ((SELECT x FROM t1));
--- error 1241
+-- error 1242
INSERT INTO t1 (x) VALUES ((SELECT b FROM t3));
INSERT INTO t1 (x) VALUES ((SELECT a FROM t2));
select * from t1;
@@ -375,7 +375,7 @@ insert into t3 values (1),(2);
select * from t1;
-- error 1093
replace into t1 (x, y) VALUES ((SELECT x FROM t1), (SELECT a+1 FROM t2));
--- error 1241
+-- error 1242
replace into t1 (x, y) VALUES ((SELECT a FROM t3), (SELECT a+1 FROM t2));
replace into t1 (x, y) VALUES ((SELECT a FROM t2), (SELECT a+1 FROM t2));
select * from t1;
@@ -411,7 +411,7 @@ INSERT INTO t2 VALUES ((SELECT id FROM t2));
SELECT * FROM t2;
CREATE TABLE t1 (id int(11) default NULL, KEY id (id)) ENGINE=MyISAM CHARSET=latin1;
INSERT INTO t1 values (1),(1);
--- error 1241
+-- error 1242
UPDATE t2 SET id=(SELECT * FROM t1);
drop table t2, t1;
@@ -527,7 +527,7 @@ set @a:=(SELECT a from t1);
CREATE TABLE t1 (a int, KEY(a));
HANDLER t1 OPEN;
--- error 1149
+-- error 1064
HANDLER t1 READ a=((SELECT 1));
HANDLER t1 CLOSE;
drop table t1;
@@ -872,9 +872,9 @@ DROP TABLE t1, t2;
CREATE TABLE t1 (s1 CHAR(5) COLLATE latin1_german1_ci,
s2 CHAR(5) COLLATE latin1_swedish_ci);
INSERT INTO t1 VALUES ('z','?');
--- error 1266
+-- error 1267
select * from t1 where s1 > (select max(s2) from t1);
--- error 1266
+-- error 1267
select * from t1 where s1 > any (select max(s2) from t1);
drop table t1;
@@ -892,7 +892,7 @@ drop table t1, t2;
# row union
#
create table t1 (s1 char(5));
--- error 1240
+-- error 1241
select (select 'a','b' from t1 union select 'a','b' from t1) from t1;
insert into t1 values ('tttt');
select * from t1 where ('a','b')=(select 'a','b' from t1 union select 'a','b' from t1);
@@ -957,7 +957,7 @@ CREATE TABLE t1 (id int(11) default NULL) ENGINE=MyISAM CHARSET=latin1;
INSERT INTO t1 VALUES (1),(5);
CREATE TABLE t2 (id int(11) default NULL) ENGINE=MyISAM CHARSET=latin1;
INSERT INTO t2 VALUES (2),(6);
--- error 1240
+-- error 1241
select * from t1 where (1,2,6) in (select * from t2);
DROP TABLE t1,t2;
@@ -967,7 +967,7 @@ DROP TABLE t1,t2;
create table t1 (s1 int);
insert into t1 values (1);
insert into t1 values (2);
--- error 1241
+-- error 1242
set sort_buffer_size = (select s1 from t1);
do (select * from t1);
drop table t1;
@@ -1015,6 +1015,11 @@ INSERT INTO t2 VALUES (100, 200, 'C');
SELECT DISTINCT COLC FROM t1 WHERE COLA = (SELECT COLA FROM t2 WHERE COLB = 200 AND COLC ='C' LIMIT 1);
DROP TABLE t1, t2;
+CREATE TABLE t1 (a int(1));
+INSERT INTO t1 VALUES (1),(1),(1),(1),(1),(2),(3),(4),(5);
+SELECT DISTINCT (SELECT a) FROM t1 LIMIT 100;
+DROP TABLE t1;
+
#
# Bug 2198
#
@@ -1054,3 +1059,64 @@ INSERT INTO `t2` VALUES (16,1987),(50,1990),(51,1990);
SELECT cns.id, cns.max_anno_dep, cns.max_anno_dep = (SELECT s.anno_dep FROM t1 AS s WHERE s.id_cns = cns.id ORDER BY s.anno_dep DESC LIMIT 1) AS PIPPO FROM t2 AS cns;
DROP TABLE t1, t2;
+
+#
+# GLOBAL LIMIT
+#
+create table t1 (a int);
+insert into t1 values (1), (2), (3);
+SET SQL_SELECT_LIMIT=1;
+select sum(a) from (select * from t1) as a;
+select 2 in (select * from t1);
+SET SQL_SELECT_LIMIT=default;
+drop table t1;
+
+#
+# Bug #3118: subselect + order by
+#
+
+CREATE TABLE t1 (a int, b int, INDEX (a));
+INSERT INTO t1 VALUES (1, 1), (1, 2), (1, 3);
+SELECT * FROM t1 WHERE a = (SELECT MAX(a) FROM t1 WHERE a = 1) ORDER BY b;
+DROP TABLE t1;
+
+# Item_cond fix field
+#
+create table t1(val varchar(10));
+insert into t1 values ('aaa'), ('bbb'),('eee'),('mmm'),('ppp');
+select count(*) from t1 as w1 where w1.val in (select w2.val from t1 as w2 where w2.val like 'm%') and w1.val in (select w3.val from t1 as w3 where w3.val like 'e%');
+drop table t1;
+
+#
+# ref_or_null replacing with ref
+#
+create table t1 (id int not null, text varchar(20) not null default '', primary key (id));
+insert into t1 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text11'), (12, 'text12');
+select * from t1 where id not in (select id from t1 where id < 8);
+select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null);
+explain extended select * from t1 where id not in (select id from t1 where id < 8);
+explain extended select * from t1 as tt where not exists (select id from t1 where id < 8 and (id = tt.id or id is null) having id is not null);
+insert into t1 (id, text) values (1000, 'text1000'), (1001, 'text1001');
+create table t2 (id int not null, text varchar(20) not null default '', primary key (id));
+insert into t2 (id, text) values (1, 'text1'), (2, 'text2'), (3, 'text3'), (4, 'text4'), (5, 'text5'), (6, 'text6'), (7, 'text7'), (8, 'text8'), (9, 'text9'), (10, 'text10'), (11, 'text1'), (12, 'text2'), (13, 'text3'), (14, 'text4'), (15, 'text5'), (16, 'text6'), (17, 'text7'), (18, 'text8'), (19, 'text9'), (20, 'text10'),(21, 'text1'), (22, 'text2'), (23, 'text3'), (24, 'text4'), (25, 'text5'), (26, 'text6'), (27, 'text7'), (28, 'text8'), (29, 'text9'), (30, 'text10'), (31, 'text1'), (32, 'text2'), (33, 'text3'), (34, 'text4'), (35, 'text5'), (36, 'text6'), (37, 'text7'), (38, 'text8'), (39, 'text9'), (40, 'text10'), (41, 'text1'), (42, 'text2'), (43, 'text3'), (44, 'text4'), (45, 'text5'), (46, 'text6'), (47, 'text7'), (48, 'text8'), (49, 'text9'), (50, 'text10');
+select * from t1 a left join t2 b on (a.id=b.id or b.id is null) join t1 c on (if(isnull(b.id), 1000, b.id)=c.id);
+explain extended select * from t1 a left join t2 b on (a.id=b.id or b.id is null) join t1 c on (if(isnull(b.id), 1000, b.id)=c.id);
+drop table t1,t2;
+
+#
+# Static tables & rund() in subqueries
+#
+create table t1 (a int);
+insert into t1 values (1);
+explain select benchmark(1000, (select a from t1 where a=sha(rand())));
+drop table t1;
+
+#
+# bug 3188
+#
+create table t1(id int);
+create table t2(id int);
+create table t3(flag int);
+-- error 1064
+select (select * from t3 where id not null) from t1, t2;
+drop table t1,t2,t3;
diff --git a/mysql-test/t/subselect_innodb.test b/mysql-test/t/subselect_innodb.test
index 8e8d41f7653..47642832158 100644
--- a/mysql-test/t/subselect_innodb.test
+++ b/mysql-test/t/subselect_innodb.test
@@ -67,7 +67,7 @@ INSERT INTO t1 VALUES (1),(2),(3);
INSERT INTO t3 VALUES (1,1),(2,2),(3,3);
INSERT INTO t2 VALUES (1,1),(2,2),(3,3);
SELECT distinct p1.processor_id, (SELECT y.yod_id FROM t1 p2, t2 y WHERE p2.processor_id = p1.processor_id and p2.processor_id = y.processor_id) FROM t1 p1;
-drop table t1,t2,t3;
+drop table t2,t1,t3;
#
# innodb locking
diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test
index c0a9ce1bbcf..78c9b68fde5 100644
--- a/mysql-test/t/symlink.test
+++ b/mysql-test/t/symlink.test
@@ -98,7 +98,7 @@ drop database mysqltest;
# Test changing data dir (Bug #1662)
#
-create table t1 (a int not null) type=myisam;
+create table t1 (a int not null) engine=myisam;
disable_query_log;
eval alter table t1 data directory="$MYSQL_TEST_DIR/var/tmp";
enable_query_log;
diff --git a/mysql-test/t/synchronization.test b/mysql-test/t/synchronization.test
new file mode 100644
index 00000000000..7bdeaa8a740
--- /dev/null
+++ b/mysql-test/t/synchronization.test
@@ -0,0 +1,33 @@
+#
+# Test for Bug #2385 CREATE TABLE LIKE lacks locking on source and destination table
+#
+
+connect (con1,localhost,root,,);
+connect (con2,localhost,root,,);
+
+# locking of source:
+
+CREATE TABLE t1 (x1 int);
+let $1= 10;
+while ($1)
+{
+ connection con1;
+ send ALTER TABLE t1 CHANGE x1 x2 int;
+ connection con2;
+ CREATE TABLE t2 LIKE t1;
+ replace_result x1 xx x2 xx;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+ connection con1;
+ reap;
+ send ALTER TABLE t1 CHANGE x2 x1 int;
+ connection con2;
+ CREATE TABLE t2 LIKE t1;
+ replace_result x1 xx x2 xx;
+ SHOW CREATE TABLE t2;
+ DROP TABLE t2;
+ connection con1;
+ reap;
+ dec $1;
+}
+DROP TABLE t1;
diff --git a/mysql-test/t/system_mysql_db.test b/mysql-test/t/system_mysql_db.test
new file mode 100644
index 00000000000..bd69297b739
--- /dev/null
+++ b/mysql-test/t/system_mysql_db.test
@@ -0,0 +1,8 @@
+#
+# This test must examine integrity of system database "mysql"
+#
+
+-- disable_query_log
+use mysql;
+-- enable_query_log
+-- source include/system_db_struct.inc
diff --git a/mysql-test/t/system_mysql_db_fix-master.opt b/mysql-test/t/system_mysql_db_fix-master.opt
new file mode 100644
index 00000000000..7e4fa9a3ee8
--- /dev/null
+++ b/mysql-test/t/system_mysql_db_fix-master.opt
@@ -0,0 +1 @@
+--result-file=system_mysql_db
diff --git a/mysql-test/t/system_mysql_db_fix.test b/mysql-test/t/system_mysql_db_fix.test
new file mode 100644
index 00000000000..6f3979bf66e
--- /dev/null
+++ b/mysql-test/t/system_mysql_db_fix.test
@@ -0,0 +1,78 @@
+#
+# This is the test for mysql_fix_privilege_tables
+#
+
+-- disable_result_log
+-- disable_query_log
+
+use test;
+
+# create system tables as in mysql-3.20
+
+CREATE TABLE db (
+ Host char(60) binary DEFAULT '' NOT NULL,
+ Db char(32) binary DEFAULT '' NOT NULL,
+ User char(16) binary DEFAULT '' NOT NULL,
+ Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ PRIMARY KEY Host (Host,Db,User),
+ KEY User (User)
+)
+type=ISAM;
+
+INSERT INTO db VALUES ('%','test', '','Y','Y','Y','Y','Y','Y');
+INSERT INTO db VALUES ('%','test\_%','','Y','Y','Y','Y','Y','Y');
+
+CREATE TABLE host (
+ Host char(60) binary DEFAULT '' NOT NULL,
+ Db char(32) binary DEFAULT '' NOT NULL,
+ Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ PRIMARY KEY Host (Host,Db)
+)
+type=ISAM;
+
+CREATE TABLE user (
+ Host char(60) binary DEFAULT '' NOT NULL,
+ User char(16) binary DEFAULT '' NOT NULL,
+ Password char(16),
+ Select_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ Insert_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ Update_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ Delete_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ Create_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ Drop_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ Reload_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ Shutdown_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ Process_priv enum('N','Y') DEFAULT 'N' NOT NULL,
+ PRIMARY KEY Host (Host,User)
+)
+type=ISAM;
+
+INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y');
+INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','N');
+
+-- exec $MYSQL_FIX_SYSTEM_TABLES --database=test
+-- enable_query_log
+-- enable_result_log
+
+-- source include/system_db_struct.inc
+
+-- disable_query_log
+
+DROP TABLE db;
+DROP TABLE host;
+DROP TABLE user;
+DROP TABLE func;
+DROP TABLE tables_priv;
+DROP TABLE columns_priv;
+
+-- enable_query_log
diff --git a/mysql-test/t/system_mysql_db_refs.test b/mysql-test/t/system_mysql_db_refs.test
new file mode 100644
index 00000000000..62d6f3de944
--- /dev/null
+++ b/mysql-test/t/system_mysql_db_refs.test
@@ -0,0 +1,101 @@
+#
+# This test must examine integrity of current system database
+#
+
+set @name="This is a very long string, that mustn't find room in a system field like Table_name. Thus it should be cut by the actual size of the field. So we can use this string to find out the actual length of the field and to use it in any compare queries";
+
+#
+# If this part is wrong, most likely you've done wrong modification of system database "mysql"
+#
+
+create table test_db select * from mysql.db;
+delete from test_db;
+--disable_warnings
+insert into test_db (Host,Db,User) values (@name,@name,@name);
+--enable_warnings
+
+create table test_host select * from mysql.host;
+delete from test_host;
+--disable_warnings
+insert into test_host (Host,Db) values (@name,@name);
+--enable_warnings
+
+create table test_user select * from mysql.user;
+delete from test_user;
+--disable_warnings
+insert into test_user (Host,User) values (@name,@name);
+--enable_warnings
+
+create table test_func select * from mysql.func;
+delete from test_func;
+--disable_warnings
+insert into test_func (name) values (@name);
+--enable_warnings
+
+create table test_tables_priv select * from mysql.tables_priv;
+delete from test_tables_priv;
+--disable_warnings
+insert into test_tables_priv (Host,Db,User,Table_name) values (@name,@name,@name,@name);
+--enable_warnings
+
+create table test_columns_priv select * from mysql.columns_priv;
+delete from test_columns_priv;
+--disable_warnings
+insert into test_columns_priv (Host,Db,User,Table_name,Column_name) values (@name,@name,@name,@name,@name);
+--enable_warnings
+
+# 'Host' field must be the same for all the tables:
+
+select
+ if(isnull(test_db.Host),'WRONG!!!','ok') as test_db_Host,
+ if(isnull(test_host.Host),'WRONG!!!','ok') as test_host_Host,
+ if(isnull(test_user.Host),'WRONG!!!','ok') as test_user_Host,
+ if(isnull(test_tables_priv.Host),'WRONG!!!','ok') as test_tables_priv_Host,
+ if(isnull(test_columns_priv.Host),'WRONG!!!','ok') as test_columns_priv_Host
+
+from test_db
+left join test_host on test_db.Host=test_host.Host
+left join test_user on test_db.Host=test_user.Host
+left join test_tables_priv on test_db.Host=test_tables_priv.Host
+left join test_columns_priv on test_db.Host=test_columns_priv.Host;
+
+# 'Db' field must be the same for all the tables:
+
+select
+ if(isnull(test_db.Db),'WRONG!!!','ok') as test_db_Db,
+ if(isnull(test_host.Db),'WRONG!!!','ok') as test_host_Db,
+ if(isnull(test_tables_priv.Db),'WRONG!!!','ok') as test_tables_priv_Db,
+ if(isnull(test_columns_priv.Db),'WRONG!!!','ok') as est_columns_priv_Db
+
+from test_db
+left join test_host on test_db.Db=test_host.Db
+left join test_tables_priv on test_db.Db=test_tables_priv.Db
+left join test_columns_priv on test_db.Db=test_columns_priv.Db;
+
+# 'User' field must be the same for all the tables:
+
+select
+ if(isnull(test_db.User),'WRONG!!!','ok') as test_db_User,
+ if(isnull(test_user.User),'WRONG!!!','ok') as test_user_User,
+ if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
+ if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
+
+from test_db
+left join test_user on test_db.User=test_user.User
+left join test_tables_priv on test_db.User=test_tables_priv.User
+left join test_columns_priv on test_db.User=test_columns_priv.User;
+
+# 'Table_name' field must be the same for all the tables:
+
+select
+ if(isnull(test_tables_priv.User),'WRONG!!!','ok') as test_tables_priv_User,
+ if(isnull(test_columns_priv.User),'WRONG!!!','ok') as test_columns_priv_User
+from test_tables_priv
+left join test_columns_priv on test_tables_priv.Table_name=test_columns_priv.Table_name;
+
+drop table test_columns_priv;
+drop table test_tables_priv;
+drop table test_func;
+drop table test_host;
+drop table test_user;
+drop table test_db;
diff --git a/mysql-test/t/timezone.test b/mysql-test/t/timezone.test
index ab732c11a34..194602f376c 100644
--- a/mysql-test/t/timezone.test
+++ b/mysql-test/t/timezone.test
@@ -11,6 +11,8 @@ enable_query_log;
DROP TABLE IF EXISTS t1;
--enable_warnings
+# The following is because of daylight saving time
+--replace_result MEST MET
show variables like "timezone";
#
@@ -38,3 +40,10 @@ INSERT INTO t1 (ts) VALUES (Unix_timestamp('2003-03-30 04:00:01'));
SELECT ts,from_unixtime(ts) FROM t1;
DROP TABLE t1;
+#
+# Test for fix for Bug#2523
+#
+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'),
+ unix_timestamp('2038-01-01 01:00:00');
diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test
index 70fa2f9b172..8c6cabd997b 100644
--- a/mysql-test/t/type_blob.test
+++ b/mysql-test/t/type_blob.test
@@ -16,7 +16,7 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7;
CREATE TABLE t1 (a blob, b text, c blob(250), d text(70000), e text(70000000));
show columns from t1;
-CREATE TABLE t2 (a char(257), b varchar(70000) binary, c varchar(70000000));
+CREATE TABLE t2 (a char(257), b varbinary(70000), c varchar(70000000));
show columns from t2;
create table t3 (a long, b long byte);
show create TABLE t3;
@@ -62,7 +62,7 @@ drop table t1;
#
# test of blob, text, char and char binary
#
-create table t1 (t text,c char(10),b blob, d char(10) binary);
+create table t1 (t text,c char(10),b blob, d binary(10));
insert into t1 values (NULL,NULL,NULL,NULL);
insert into t1 values ("","","","");
insert into t1 values ("hello","hello","hello","hello");
@@ -121,8 +121,10 @@ select c,count(*) from t1 group by c;
select d,count(*) from t1 group by d;
drop table t1;
-!$1089 create table t1 (a text, key (a(300))); # should give an error
-create table t1 (a text, key (a(255)));
+-- error 1071
+create table t1 (a text, unique (a(2100))); # should give an error
+create table t1 (a text, key (a(2100))); # key is auto-truncated
+show create table t1;
drop table t1;
#
@@ -357,3 +359,9 @@ select * from t1 where txt <= 'Chevy';
select * from t1 where txt > 'Chevy';
select * from t1 where txt >= 'Chevy';
drop table t1;
+CREATE TABLE t1 ( i int(11) NOT NULL default '0', c text NOT NULL, PRIMARY KEY (i), KEY (c(1),c(1)));
+INSERT t1 VALUES (1,''),(2,''),(3,'asdfh'),(4,'');
+select max(i) from t1 where c = '';
+drop table t1;
+
+
diff --git a/mysql-test/t/type_timestamp.test b/mysql-test/t/type_timestamp.test
index fc7cd019171..72633f9ef7d 100644
--- a/mysql-test/t/type_timestamp.test
+++ b/mysql-test/t/type_timestamp.test
@@ -76,8 +76,146 @@ select * from t1;
drop table t1;
#
-# Bug #1885
+# Test for TIMESTAMP column with default now() and on update now() clauses
#
---error 1067
-create table t1 (a timestamp default 1);
+# These statements should fail.
+--error 1293
+create table t1 (t1 timestamp, t2 timestamp default now());
+--error 1293
+create table t1 (t1 timestamp, t2 timestamp on update now());
+--error 1293
+create table t1 (t1 timestamp, t2 timestamp default now() on update now());
+--error 1293
+create table t1 (t1 timestamp default now(), t2 timestamp on update now());
+--error 1293
+create table t1 (t1 timestamp on update now(), t2 timestamp default now() on update now());
+
+# Let us test TIMESTAMP auto-update behaviour
+# Also we will test behaviour of TIMESTAMP field in SHOW CREATE TABLE and
+# behaviour of DEFAULT literal for such fields
+create table t1 (t1 timestamp default '2003-01-01 00:00:00', t2 datetime, t3 timestamp);
+SET TIMESTAMP=1000000000;
+insert into t1 values ();
+SET TIMESTAMP=1000000001;
+update t1 set t2=now();
+SET TIMESTAMP=1000000002;
+insert into t1 (t1,t3) values (default, default);
+select * from t1;
+show create table t1;
+show columns from t1;
+drop table t1;
+
+create table t1 (t1 timestamp default now(), t2 datetime, t3 timestamp);
+SET TIMESTAMP=1000000002;
+insert into t1 values ();
+SET TIMESTAMP=1000000003;
+update t1 set t2=now();
+SET TIMESTAMP=1000000003;
+insert into t1 (t1,t3) values (default, default);
+select * from t1;
+show create table t1;
+show columns from t1;
+drop table t1;
+
+create table t1 (t1 timestamp default '2003-01-01 00:00:00' on update now(), t2 datetime);
+SET TIMESTAMP=1000000004;
+insert into t1 values ();
+select * from t1;
+SET TIMESTAMP=1000000005;
+update t1 set t2=now();
+SET TIMESTAMP=1000000005;
+insert into t1 (t1) values (default);
+select * from t1;
+show create table t1;
+show columns from t1;
+drop table t1;
+
+create table t1 (t1 timestamp default now() on update now(), t2 datetime);
+SET TIMESTAMP=1000000006;
+insert into t1 values ();
+select * from t1;
+SET TIMESTAMP=1000000007;
+update t1 set t2=now();
+SET TIMESTAMP=1000000007;
+insert into t1 (t1) values (default);
+select * from t1;
+show create table t1;
+show columns from t1;
+drop table t1;
+
+create table t1 (t1 timestamp, t2 datetime, t3 timestamp);
+SET TIMESTAMP=1000000007;
+insert into t1 values ();
+select * from t1;
+SET TIMESTAMP=1000000008;
+update t1 set t2=now();
+SET TIMESTAMP=1000000008;
+insert into t1 (t1,t3) values (default, default);
+select * from t1;
+show create table t1;
+show columns from t1;
+drop table t1;
+
+# Let us test if CURRENT_TIMESTAMP also works well as default value
+# (Of course NOW and CURRENT_TIMESTAMP are same for parser but still just
+# for demonstartion.)
+create table t1 (t1 timestamp default current_timestamp on update current_timestamp, t2 datetime);
+SET TIMESTAMP=1000000009;
+insert into t1 values ();
+select * from t1;
+SET TIMESTAMP=1000000010;
+update t1 set t2=now();
+SET TIMESTAMP=1000000011;
+insert into t1 (t1) values (default);
+select * from t1;
+show create table t1;
+show columns from t1;
+delete from t1;
+
+#
+# Let us test some cases when auto-set should be disabled or influence
+# on server behavior in some other way.
+#
+
+# Update statement that explicitly sets field should not auto-set it.
+insert into t1 values ('2004-04-01 00:00:00', '2004-04-01 00:00:00');
+SET TIMESTAMP=1000000012;
+update t1 set t1= '2004-04-02 00:00:00';
+select * from t1;
+# The same for multi updates
+update t1 as ta, t1 as tb set tb.t1= '2004-04-03 00:00:00';
+select * from t1;
+drop table t1;
+
+# Now let us test replace it should behave exactly like delete+insert
+# Case where optimization is possible DEFAULT = ON UPDATE
+create table t1 (pk int primary key, t1 timestamp default current_timestamp on update current_timestamp, bulk int);
+insert into t1 values (1, '2004-04-01 00:00:00', 10);
+SET TIMESTAMP=1000000013;
+replace into t1 set pk = 1, bulk= 20;
+select * from t1;
+drop table t1;
+# Case in which there should not be optimisation
+create table t1 (pk int primary key, t1 timestamp default '2003-01-01 00:00:00' on update current_timestamp, bulk int);
+insert into t1 values (1, '2004-04-01 00:00:00', 10);
+SET TIMESTAMP=1000000014;
+replace into t1 set pk = 1, bulk= 20;
+select * from t1;
+drop table t1;
+# Other similar case
+create table t1 (pk int primary key, t1 timestamp default current_timestamp, bulk int);
+insert into t1 values (1, '2004-04-01 00:00:00', 10);
+SET TIMESTAMP=1000000015;
+replace into t1 set pk = 1, bulk= 20;
+select * from t1;
+drop table t1;
+
+# Let us test alter now
+create table t1 (t1 timestamp default current_timestamp on update current_timestamp);
+insert into t1 values ('2004-04-01 00:00:00');
+SET TIMESTAMP=1000000016;
+alter table t1 add i int default 10;
+select * from t1;
+drop table t1;
+
diff --git a/mysql-test/t/type_year.test b/mysql-test/t/type_year.test
index 9922df447fc..c67b8447494 100644
--- a/mysql-test/t/type_year.test
+++ b/mysql-test/t/type_year.test
@@ -11,3 +11,12 @@ select * from t1;
select * from t1 order by y;
select * from t1 order by y2;
drop table t1;
+
+#
+# Bug 2335
+#
+
+create table t1 (y year);
+insert into t1 values (now());
+select if(y = now(), 1, 0) from t1;
+drop table t1;
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index 8ce4aa997fc..9866b867427 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -23,7 +23,7 @@ select 't1',b,count(*) from t1 group by b UNION select 't2',b,count(*) from t2 g
(select a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 4;
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1);
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by b desc;
---error 1249
+--error 1250
(select a,b from t1 limit 2) union all (select a,b from t2 order by a limit 1) order by t1.b;
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;
(select sql_calc_found_rows a,b from t1 limit 2) union all (select a,b from t2 order by a) limit 2;
@@ -213,7 +213,7 @@ select found_rows();
(SELECT SQL_CALC_FOUND_ROWS * FROM t1) UNION all (SELECT * FROM t2 LIMIT 1);
select found_rows();
# This used to work in 4.0 but not anymore in 4.1
---error 1149
+--error 1064
(SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 1) UNION SELECT * FROM t2 LIMIT 1;
#select found_rows();
@@ -251,6 +251,8 @@ create temporary table t1 select a from t1 union select a from t2;
drop temporary table t1;
--error 1093
create table t1 select a from t1 union select a from t2;
+--error 1109
+select a from t1 union select a from t2 order by t2.a;
drop table t1,t2;
#
@@ -420,7 +422,7 @@ create table t1 select 1 union select -1;
select * from t1;
show create table t1;
drop table t1;
--- error 1266
+-- error 1267
create table t1 select _latin1"test" union select _latin2"testt" ;
create table t1 select _latin2"test" union select _latin2"testt" ;
show create table t1;
@@ -465,3 +467,35 @@ show status like 'Slow_queries';
select count(*) from t1 where a=7 union select count(*) from t1 where b=13;
show status like 'Slow_queries';
drop table t1;
+
+#
+# bug #2508
+#
+create table t1 ( RID int(11) not null default '0', IID int(11) not null default '0', nada varchar(50) not null,NAME varchar(50) not null,PHONE varchar(50) not null) engine=MyISAM;
+insert into t1 ( RID,IID,nada,NAME,PHONE) values (1, 1, 'main', 'a', '111'), (2, 1, 'main', 'b', '222'), (3, 1, 'main', 'c', '333'), (4, 1, 'main', 'd', '444'), (5, 1, 'main', 'e', '555'), (6, 2, 'main', 'c', '333'), (7, 2, 'main', 'd', '454'), (8, 2, 'main', 'e', '555'), (9, 2, 'main', 'f', '666'), (10, 2, 'main', 'g', '777');
+select A.NAME, A.PHONE, B.NAME, B.PHONE from t1 A left join t1 B on A.NAME = B.NAME and B.IID = 2 where A.IID = 1 and (A.PHONE <> B.PHONE or B.NAME is null) union select A.NAME, A.PHONE, B.NAME, B.PHONE from t1 B left join t1 A on B.NAME = A.NAME and A.IID = 1 where B.IID = 2 and (A.PHONE <> B.PHONE or A.NAME is null);
+drop table t1;
+#
+# Bug #2809 (UNION fails on MyIsam tables when index on second column from
+# same table)
+#
+create table t1 (col1 tinyint unsigned, col2 tinyint unsigned);
+insert into t1 values (1,2),(3,4),(5,6),(7,8),(9,10);
+select col1 n from t1 union select col2 n from t1 order by n;
+alter table t1 add index myindex (col2);
+select col1 n from t1 union select col2 n from t1 order by n;
+drop table t1;
+
+#
+# Bug #1428, incorrect handling of UNION ALL
+# NOTE: The current result is wrong, needs to be fixed!
+#
+
+create table t1 (i int);
+insert into t1 values (1);
+select * from t1 UNION select * from t1;
+select * from t1 UNION ALL select * from t1;
+select * from t1 UNION select * from t1 UNION ALL select * from t1;
+drop table t1;
+select 1 as a union all select 1 union all select 2 union select 1 union all select 2;
+
diff --git a/mysql-test/t/update.test b/mysql-test/t/update.test
index 3406dfd6158..6ca75cf0c26 100644
--- a/mysql-test/t/update.test
+++ b/mysql-test/t/update.test
@@ -125,7 +125,6 @@ insert into t1 (F1,F2,F3,cnt,groupid) values ('0','0','0',1,6),
('0','1','2',1,5), ('0','2','0',1,3), ('1','0','1',1,2),
('1','2','1',1,1), ('1','2','2',1,1), ('2','0','1',2,4),
('2','2','0',1,7);
-
delete from m1 using t1 m1,t1 m2 where m1.groupid=m2.groupid and (m1.cnt < m2.cnt or m1.cnt=m2.cnt and m1.F3>m2.F3);
select * from t1;
drop table t1;
diff --git a/mysql-test/t/user_var.test b/mysql-test/t/user_var.test
index 32ed6fe33db..a28b327cf58 100644
--- a/mysql-test/t/user_var.test
+++ b/mysql-test/t/user_var.test
@@ -84,7 +84,7 @@ select @a=_latin2'TEST' collate latin2_bin;
set @a=_latin2'test' collate latin2_general_ci;
select charset(@a),collation(@a),coercibility(@a);
select @a=_latin2'TEST';
---error 1266
+--error 1267
select @a=_latin2'TEST' collate latin2_bin;
#
@@ -97,5 +97,5 @@ select collation(@a:=_latin2'test' collate latin2_bin);
select coercibility(@a:=_latin2'test' collate latin2_bin);
select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST';
select charset(@a),collation(@a),coercibility(@a);
---error 1266
+--error 1267
select (@a:=_latin2'test' collate latin2_bin) = _latin2'TEST' collate latin2_general_ci;
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 2fb2a663549..a82aa87558a 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -136,7 +136,7 @@ set big_tables="OFFF";
set unknown_variable=1;
--error 1232
set max_join_size="hello";
---error 1285
+--error 1286
set storage_engine=UNKNOWN_TABLE_TYPE;
--error 1231
set storage_engine=INNODB, big_tables=2;
@@ -147,11 +147,15 @@ set SESSION query_cache_size=10000;
set GLOBAL storage_engine=DEFAULT;
--error 1115
set character_set_client=UNKNOWN_CHARACTER_SET;
---error 1272
+--error 1273
set collation_connection=UNKNOWN_COLLATION;
+--error 1231
+set character_set_client=NULL;
+--error 1231
+set collation_connection=NULL;
--error 1228
set global autocommit=1;
---error 1228
+--error 1238
select @@global.timestamp;
--error 1193
set @@version='';
@@ -159,7 +163,7 @@ set @@version='';
set @@concurrent_insert=1;
--error 1228
set @@global.sql_auto_is_null=1;
---error 1228
+--error 1238
select @@global.sql_auto_is_null;
--error 1229
set myisam_max_sort_file_size=100;
@@ -279,6 +283,21 @@ drop table t1,t2;
select @@xxxxxxxxxx;
select 1;
+--error 1238
+select @@session.key_buffer_size;
+
+--error 1229
+set ft_boolean_syntax = @@init_connect;
+--error 1231
+set global ft_boolean_syntax = @@init_connect;
+--error 1229
+set init_connect = NULL;
+set global init_connect = NULL;
+--error 1229
+set ft_boolean_syntax = @@init_connect;
+--error 1231
+set global ft_boolean_syntax = @@init_connect;
+
#
# swap
#
@@ -295,3 +314,16 @@ set @a=1, @b=2;
set @a=@b, @b=@a;
select @a, @b;
+#
+# Bug#2586:Disallow global/session/local as structured var. instance names
+#
+--error 1064
+set @@global.global.key_buffer_size= 1;
+--error 1064
+set GLOBAL global.key_buffer_size= 1;
+--error 1064
+SELECT @@global.global.key_buffer_size;
+--error 1064
+SELECT @@global.session.key_buffer_size;
+--error 1064
+SELECT @@global.local.key_buffer_size;
diff --git a/mysys/COPYING.LIB b/mysys/COPYING.LIB
deleted file mode 100644
index eb685a5ec98..00000000000
--- a/mysys/COPYING.LIB
+++ /dev/null
@@ -1,481 +0,0 @@
- GNU LIBRARY GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1991 Free Software Foundation, Inc.
- 675 Mass Ave, Cambridge, MA 02139, USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the library GPL. It is
- numbered 2 because it goes with version 2 of the ordinary GPL.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Library General Public License, applies to some
-specially designated Free Software Foundation software, and to any
-other libraries whose authors decide to use it. You can use it for
-your libraries, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if
-you distribute copies of the library, or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link a program with the library, you must provide
-complete object files to the recipients so that they can relink them
-with the library, after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- Our method of protecting your rights has two steps: (1) copyright
-the library, and (2) offer you this license which gives you legal
-permission to copy, distribute and/or modify the library.
-
- Also, for each distributor's protection, we want to make certain
-that everyone understands that there is no warranty for this free
-library. If the library is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original
-version, so that any problems introduced by others will not reflect on
-the original authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that companies distributing free
-software will individually obtain patent licenses, thus in effect
-transforming the program into proprietary software. To prevent this,
-we have made it clear that any patent must be licensed for everyone's
-free use or not licensed at all.
-
- Most GNU software, including some libraries, is covered by the ordinary
-GNU General Public License, which was designed for utility programs. This
-license, the GNU Library General Public License, applies to certain
-designated libraries. This license is quite different from the ordinary
-one; be sure to read it in full, and don't assume that anything in it is
-the same as in the ordinary license.
-
- The reason we have a separate public license for some libraries is that
-they blur the distinction we usually make between modifying or adding to a
-program and simply using it. Linking a program with a library, without
-changing the library, is in some sense simply using the library, and is
-analogous to running a utility program or application program. However, in
-a textual and legal sense, the linked executable is a combined work, a
-derivative of the original library, and the ordinary General Public License
-treats it as such.
-
- Because of this blurred distinction, using the ordinary General
-Public License for libraries did not effectively promote software
-sharing, because most developers did not use the libraries. We
-concluded that weaker conditions might promote sharing better.
-
- However, unrestricted linking of non-free programs would deprive the
-users of those programs of all benefit from the free status of the
-libraries themselves. This Library General Public License is intended to
-permit developers of non-free programs to use free libraries, while
-preserving your freedom as a user of such programs to change the free
-libraries that are incorporated in them. (We have not seen how to achieve
-this as regards changes in header files, but we have achieved it as regards
-changes in the actual functions of the Library.) The hope is that this
-will lead to faster development of free libraries.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, while the latter only
-works together with the library.
-
- Note that it is possible for a library to be covered by the ordinary
-General Public License rather than by this special one.
-
- GNU LIBRARY GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library which
-contains a notice placed by the copyright holder or other authorized
-party saying it may be distributed under the terms of this Library
-General Public License (also called "this License"). Each licensee is
-addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also compile or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- c) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- d) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the source code distributed need not include anything that is normally
-distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Library General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- Appendix: How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with this library; if not, write to the Free
- Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
diff --git a/mysys/Makefile.am b/mysys/Makefile.am
index bd508b8de12..d4290bbc49b 100644
--- a/mysys/Makefile.am
+++ b/mysys/Makefile.am
@@ -25,8 +25,8 @@ noinst_HEADERS = mysys_priv.h my_static.h \
my_os2cond.c my_os2dirsrch.c my_os2dirsrch.h \
my_os2dlfcn.c my_os2file64.c my_os2mutex.c \
my_os2thread.c my_os2tls.c
-libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c\
- mf_path.c mf_loadpath.c\
+libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c \
+ mf_path.c mf_loadpath.c my_file.c \
my_open.c my_create.c my_dup.c my_seek.c my_read.c \
my_pread.c my_write.c \
mf_keycache.c mf_keycaches.c my_crc32.c \
@@ -34,12 +34,12 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c\
mf_tempdir.c my_lock.c mf_brkhant.c my_alarm.c \
my_malloc.c my_realloc.c my_once.c mulalloc.c \
my_alloc.c safemalloc.c my_new.cc \
- my_fopen.c my_fstream.c \
+ my_fopen.c my_fstream.c my_getsystime.c \
my_error.c errors.c my_div.c my_messnc.c \
mf_format.c mf_same.c mf_dirname.c mf_fn_ext.c \
my_symlink.c my_symlink2.c \
mf_pack.c mf_unixpath.c mf_strip.c \
- mf_wcomp.c mf_wfile.c \
+ mf_wcomp.c mf_wfile.c my_gethwaddr.c \
mf_qsort.c mf_qsort2.c mf_sort.c \
ptr_cmp.c mf_radix.c queues.c \
tree.c list.c hash.c array.c string.c typelib.c \
@@ -110,5 +110,10 @@ charset2html$(EXEEXT): charset2html.c $(LIBRARIES)
testhash$(EXEEXT): testhash.c $(LIBRARIES)
$(LINK) $(FLAGS) -DMAIN $(srcdir)/testhash.c $(LDADD) $(LIBS)
+test_gethwaddr$(EXEEXT): my_gethwaddr.c $(LIBRARIES)
+ $(CP) $(srcdir)/my_gethwaddr.c ./test_gethwaddr.c
+ $(LINK) $(FLAGS) -DMAIN ./test_gethwaddr.c $(LDADD) $(LIBS)
+ $(RM) -f ./test_gethwaddr.c
+
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/mysys/charset-def.c b/mysys/charset-def.c
index 650431eaf76..a89cf866933 100644
--- a/mysys/charset-def.c
+++ b/mysys/charset-def.c
@@ -73,6 +73,7 @@ my_bool init_compiled_charsets(myf flags __attribute__((unused)))
#ifdef HAVE_CHARSET_ucs2
add_compiled_collation(&my_charset_ucs2_general_ci);
add_compiled_collation(&my_charset_ucs2_bin);
+ add_compiled_collation(&my_charset_ucs2_general_uca);
#endif
#ifdef HAVE_CHARSET_ujis
diff --git a/mysys/charset.c b/mysys/charset.c
index 5bf0ea972a5..80f62b06a3e 100644
--- a/mysys/charset.c
+++ b/mysys/charset.c
@@ -62,7 +62,7 @@ static void set_max_sort_char(CHARSET_INFO *cs)
if ((uchar) cs->sort_order[i] > max_char)
{
max_char=(uchar) cs->sort_order[i];
- cs->max_sort_char= (char) i;
+ cs->max_sort_char= i;
}
}
}
@@ -459,7 +459,9 @@ static my_bool init_available_charsets(myf myflags)
init_compiled_charsets(myflags);
/* Copy compiled charsets */
- for (cs=all_charsets; cs < all_charsets+255 ; cs++)
+ for (cs=all_charsets;
+ cs < all_charsets+array_elements(all_charsets)-1 ;
+ cs++)
{
if (*cs)
{
@@ -486,10 +488,11 @@ void free_charsets(void)
uint get_collation_number(const char *name)
{
CHARSET_INFO **cs;
- if (init_available_charsets(MYF(0))) /* If it isn't initialized */
- return 0;
+ init_available_charsets(MYF(0));
- for (cs= all_charsets; cs < all_charsets+255; ++cs)
+ for (cs= all_charsets;
+ cs < all_charsets+array_elements(all_charsets)-1 ;
+ cs++)
{
if ( cs[0] && cs[0]->name &&
!my_strcasecmp(&my_charset_latin1, cs[0]->name, name))
@@ -498,13 +501,15 @@ uint get_collation_number(const char *name)
return 0; /* this mimics find_type() */
}
+
uint get_charset_number(const char *charset_name, uint cs_flags)
{
CHARSET_INFO **cs;
- if (init_available_charsets(MYF(0))) /* If it isn't initialized */
- return 0;
+ init_available_charsets(MYF(0));
- for (cs= all_charsets; cs < all_charsets+255; ++cs)
+ for (cs= all_charsets;
+ cs < all_charsets+array_elements(all_charsets)-1 ;
+ cs++)
{
if ( cs[0] && cs[0]->csname && (cs[0]->state & cs_flags) &&
!my_strcasecmp(&my_charset_latin1, cs[0]->csname, charset_name))
@@ -517,8 +522,7 @@ uint get_charset_number(const char *charset_name, uint cs_flags)
const char *get_charset_name(uint charset_number)
{
CHARSET_INFO *cs;
- if (init_available_charsets(MYF(0))) /* If it isn't initialized */
- return "?";
+ init_available_charsets(MYF(0));
cs=all_charsets[charset_number];
if (cs && (cs->number == charset_number) && cs->name )
@@ -554,9 +558,12 @@ static CHARSET_INFO *get_internal_charset(uint cs_number, myf flags)
CHARSET_INFO *get_charset(uint cs_number, myf flags)
{
CHARSET_INFO *cs;
+ if (cs_number == default_charset_info->number)
+ return default_charset_info;
+
(void) init_available_charsets(MYF(0)); /* If it isn't initialized */
- if (!cs_number)
+ if (!cs_number || cs_number >= array_elements(all_charsets)-1)
return NULL;
cs=get_internal_charset(cs_number, flags);
diff --git a/mysys/charset2html.c b/mysys/charset2html.c
index 64021689bea..96862ff16a1 100644
--- a/mysys/charset2html.c
+++ b/mysys/charset2html.c
@@ -84,18 +84,30 @@ static void print_cs(CHARSET_INFO *cs)
printf("<TD>%02X",ch[i].srt);
printf("<TD>%s%s%s%s%s%s%s%s",
- ch[i].ctp & _U ? "U" : "",
- ch[i].ctp & _L ? "L" : "",
- ch[i].ctp & _NMR ? "N" : "",
- ch[i].ctp & _SPC ? "S" : "",
- ch[i].ctp & _PNT ? "P" : "",
- ch[i].ctp & _CTR ? "C" : "",
- ch[i].ctp & _B ? "B" : "",
- ch[i].ctp & _X ? "X" : "");
+ ch[i].ctp & _MY_U ? "U" : "",
+ ch[i].ctp & _MY_L ? "L" : "",
+ ch[i].ctp & _MY_NMR ? "N" : "",
+ ch[i].ctp & _MY_SPC ? "S" : "",
+ ch[i].ctp & _MY_PNT ? "P" : "",
+ ch[i].ctp & _MY_CTR ? "C" : "",
+ ch[i].ctp & _MY_B ? "B" : "",
+ ch[i].ctp & _MY_X ? "X" : "");
- printf("<TD>&#%d;",ch[i].uni);
- printf("<TD>&#%d;",ch[i].low);
- printf("<TD>&#%d;",ch[i].upp);
+ if ((ch[i].uni >= 0x80) && (ch[i].uni <= 0x9F))
+ {
+ /*
+ Control characters 0x0080..0x009F are dysplayed by some
+ browers as if they were letters. Don't print them to
+ avoid confusion.
+ */
+ printf("<TD>ctrl<TD>ctrl<TD>ctrl");
+ }
+ else
+ {
+ printf("<TD>&#%d;",ch[i].uni);
+ printf("<TD>&#%d;",ch[i].low);
+ printf("<TD>&#%d;",ch[i].upp);
+ }
printf("</TR>\n");
srt=ch[i].srt;
}
diff --git a/mysys/default.c b/mysys/default.c
index a01ed4dd39f..d09b0dd97af 100644
--- a/mysys/default.c
+++ b/mysys/default.c
@@ -450,23 +450,25 @@ static int search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
static char *remove_end_comment(char *ptr)
{
- char quote= 0;
+ char quote= 0; /* we are inside quote marks */
+ char escape= 0; /* symbol is protected by escape chagacter */
for (; *ptr; ptr++)
{
- if (*ptr == '\'' || *ptr == '\"')
+ if ((*ptr == '\'' || *ptr == '\"') && !escape)
{
if (!quote)
quote= *ptr;
else if (quote == *ptr)
quote= 0;
}
- /* We are not inside a comment */
+ /* We are not inside a string */
if (!quote && *ptr == '#')
{
*ptr= 0;
return ptr;
}
+ escape= (quote && *ptr == '\\' && !escape);
}
return ptr;
}
diff --git a/mysys/hash.c b/mysys/hash.c
index 4ef8847363f..b7be41a9058 100644
--- a/mysys/hash.c
+++ b/mysys/hash.c
@@ -122,7 +122,7 @@ static uint hash_rec_mask(HASH *hash,HASH_LINK *pos,uint buffmax,
-#ifndef __SUNPRO_C /* SUNPRO can't handle this */
+#if !defined(__SUNPRO_C) && !defined(__USLC__) /* broken compilers */
inline
#endif
unsigned int rec_hashnr(HASH *hash,const byte *record)
@@ -215,9 +215,9 @@ static int hashcmp(HASH *hash,HASH_LINK *pos,const byte *key,uint length)
{
uint rec_keylength;
byte *rec_key= (byte*) hash_key(hash,pos->data,&rec_keylength,1);
- return (length && length != rec_keylength) ||
- my_strnncoll(hash->charset, (uchar*) rec_key, rec_keylength,
- (uchar*) key, length);
+ return ((length && length != rec_keylength) ||
+ my_strnncoll(hash->charset, (uchar*) rec_key, rec_keylength,
+ (uchar*) key, length));
}
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index f64dc5abf2d..530721a79ad 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -152,6 +152,7 @@ int init_io_cache(IO_CACHE *info, File file, uint cachesize,
info->alloced_buffer = 0;
info->buffer=0;
info->seek_not_done= test(file >= 0);
+ info->disk_writes= 0;
#ifdef THREAD
info->share=0;
#endif
@@ -506,7 +507,8 @@ static int lock_io_cache(IO_CACHE *info, my_off_t pos)
while (!s->active || s->active->pos_in_file < pos)
pthread_cond_wait(&s->cond, &s->mutex);
- if (s->total < total)
+ if (s->total < total &&
+ (!s->active || s->active->pos_in_file < pos))
return 1;
pthread_mutex_unlock(&s->mutex);
@@ -987,7 +989,7 @@ int my_b_append(register IO_CACHE *info, const byte *Buffer, uint Count)
Buffer+=rest_length;
Count-=rest_length;
info->write_pos+=rest_length;
- if (_flush_io_cache(info,0))
+ if (my_b_flush_io_cache(info,0))
{
unlock_append_buffer(info);
return 1;
@@ -1094,12 +1096,12 @@ int my_block_write(register IO_CACHE *info, const byte *Buffer, uint Count,
#endif
-int _flush_io_cache(IO_CACHE *info, int need_append_buffer_lock)
+int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock)
{
uint length;
my_bool append_cache;
my_off_t pos_in_file;
- DBUG_ENTER("_flush_io_cache");
+ DBUG_ENTER("my_b_flush_io_cache");
if (!(append_cache = (info->type == SEQ_READ_APPEND)))
need_append_buffer_lock=0;
@@ -1152,6 +1154,7 @@ int _flush_io_cache(IO_CACHE *info, int need_append_buffer_lock)
}
info->append_read_pos=info->write_pos=info->write_buffer;
+ ++info->disk_writes;
UNLOCK_APPEND_BUFFER;
DBUG_RETURN(info->error);
}
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 08737221fb2..689391537f8 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -627,7 +627,7 @@ writes: %ld r_requests: %ld reads: %ld",
a pointer to the last element.
*/
-static inline void link_into_queue(KEYCACHE_WQUEUE *wqueue,
+static void link_into_queue(KEYCACHE_WQUEUE *wqueue,
struct st_my_thread_var *thread)
{
struct st_my_thread_var *last;
@@ -662,7 +662,7 @@ static inline void link_into_queue(KEYCACHE_WQUEUE *wqueue,
See NOTES for link_into_queue
*/
-static inline void unlink_from_queue(KEYCACHE_WQUEUE *wqueue,
+static void unlink_from_queue(KEYCACHE_WQUEUE *wqueue,
struct st_my_thread_var *thread)
{
KEYCACHE_DBUG_PRINT("unlink_from_queue", ("thread %ld", thread->id));
@@ -1961,7 +1961,7 @@ int key_cache_write(KEY_CACHE *keycache,
else if (! (block->status & BLOCK_CHANGED))
link_to_changed_list(keycache, block);
- set_if_smaller(block->offset, offset)
+ set_if_smaller(block->offset, offset);
set_if_bigger(block->length, read_length+offset);
if (! (block->status & BLOCK_ERROR))
diff --git a/mysys/mf_pack.c b/mysys/mf_pack.c
index 638bbaf7baf..2d0a5ea282b 100644
--- a/mysys/mf_pack.c
+++ b/mysys/mf_pack.c
@@ -347,11 +347,25 @@ static my_string NEAR_F expand_tilde(my_string *path)
return (my_string) 0;
}
- /* fix filename so it can be used by open, create .. */
- /* to may be == from */
- /* Returns to */
-my_string unpack_filename(my_string to, const char *from)
+/*
+ Fix filename so it can be used by open, create
+
+ SYNOPSIS
+ unpack_filename()
+ to Store result here. Must be at least of size FN_REFLEN.
+ from Filename in unix format (with ~)
+
+ RETURN
+ # length of to
+
+ NOTES
+ to may be == from
+ ~ will only be expanded if total length < FN_REFLEN
+*/
+
+
+uint unpack_filename(my_string to, const char *from)
{
uint length,n_length;
char buff[FN_REFLEN];
@@ -362,17 +376,17 @@ my_string unpack_filename(my_string to, const char *from)
if (n_length+strlen(from+length) < FN_REFLEN)
{
(void) strmov(buff+n_length,from+length);
- (void) system_filename(to,buff); /* Fix to usably filename */
+ length= system_filename(to,buff); /* Fix to usably filename */
}
else
- (void) system_filename(to,from); /* Fix to usably filename */
- DBUG_RETURN(to);
+ length= system_filename(to,from); /* Fix to usably filename */
+ DBUG_RETURN(length);
} /* unpack_filename */
/* Convert filename (unix standard) to system standard */
/* Used before system command's like open(), create() .. */
- /* Returns to */
+ /* Returns length of to */
uint system_filename(my_string to, const char *from)
{
diff --git a/mysys/mf_soundex.c b/mysys/mf_soundex.c
index 459e304dfd7..75d9270c5af 100644
--- a/mysys/mf_soundex.c
+++ b/mysys/mf_soundex.c
@@ -28,6 +28,10 @@
* *
* As an extension if remove_garbage is set then all non- *
* alpha characters are skipped *
+* *
+* Note, that this implementation corresponds to the *
+* original version of the algorithm, not to the more *
+* popular "enhanced" version, described by Knuth. *
****************************************************************/
#include "mysys_priv.h"
diff --git a/mysys/mf_tempdir.c b/mysys/mf_tempdir.c
index 1ae034af67d..4d244aa7d74 100644
--- a/mysys/mf_tempdir.c
+++ b/mysys/mf_tempdir.c
@@ -17,7 +17,7 @@
#include "mysys_priv.h"
#include <m_string.h>
-#if defined( __WIN__) || defined(OS2)
+#if defined( __WIN__) || defined(OS2) || defined(__NETWARE__)
#define DELIM ';'
#else
#define DELIM ':'
@@ -35,7 +35,7 @@ my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist)
{
/* Get default temporary directory */
pathlist=getenv("TMPDIR"); /* Use this if possible */
-#if defined( __WIN__) || defined(OS2)
+#if defined( __WIN__) || defined(OS2) || defined(__NETWARE__)
if (!pathlist)
pathlist=getenv("TEMP");
if (!pathlist)
diff --git a/mysys/mf_tempfile.c b/mysys/mf_tempfile.c
index cca80dcd552..14b8fdc430c 100644
--- a/mysys/mf_tempfile.c
+++ b/mysys/mf_tempfile.c
@@ -123,12 +123,13 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
}
#ifdef OS2
/* changing environ variable doesn't work with VACPP */
- char buffer[256];
- sprintf( buffer, "TMP=%s", dir);
+ char buffer[256], *end;
+ buffer[sizeof[buffer)-1]= 0;
+ end= strxnmov(buffer, sizeof(buffer)-1, (char*) "TMP=", dir, NullS);
/* remove ending backslash */
- if (buffer[strlen(buffer)-1] == '\\')
- buffer[strlen(buffer)-1] = '\0';
- putenv( buffer);
+ if (end[-1] == '\\')
+ end[-1]= 0;
+ putenv(buffer);
#elif !defined(__NETWARE__)
old_env= (char**) environ;
if (dir)
@@ -138,7 +139,7 @@ File create_temp_file(char *to, const char *dir, const char *prefix,
}
#endif
if ((res=tempnam((char*) dir, (char*) prefix)))
- {
+ {
strmake(to,res,FN_REFLEN-1);
(*free)(res);
file=my_create(to,0,
diff --git a/mysys/my_alloc.c b/mysys/my_alloc.c
index abd51369f95..34a03391bc4 100644
--- a/mysys/my_alloc.c
+++ b/mysys/my_alloc.c
@@ -50,6 +50,72 @@ void init_alloc_root(MEM_ROOT *mem_root, uint block_size,
DBUG_VOID_RETURN;
}
+/*
+ SYNOPSIS
+ reset_root_defaults()
+ mem_root memory root to change defaults of
+ block_size new value of block size. Must be
+ greater than ~68 bytes (the exact value depends on
+ platform and compilation flags)
+ pre_alloc_size new size of preallocated block. If not zero,
+ must be equal to or greater than block size,
+ otherwise means 'no prealloc'.
+ DESCRIPTION
+ Function aligns and assigns new value to block size; then it tries to
+ reuse one of existing blocks as prealloc block, or malloc new one of
+ requested size. If no blocks can be reused, all unused blocks are freed
+ before allocation.
+ */
+
+void reset_root_defaults(MEM_ROOT *mem_root, uint block_size,
+ uint pre_alloc_size __attribute__((unused)))
+{
+ mem_root->block_size= block_size-MALLOC_OVERHEAD-sizeof(USED_MEM)-8;
+#if !(defined(HAVE_purify) && defined(EXTRA_DEBUG))
+ if (pre_alloc_size)
+ {
+ uint size= pre_alloc_size + ALIGN_SIZE(sizeof(USED_MEM));
+ if (!mem_root->pre_alloc || mem_root->pre_alloc->size != size)
+ {
+ USED_MEM *mem, **prev= &mem_root->free;
+ /*
+ Free unused blocks, so that consequent calls
+ to reset_root_defaults won't eat away memory.
+ */
+ while (*prev)
+ {
+ mem= *prev;
+ if (mem->size == size)
+ {
+ /* We found a suitable block, no need to do anything else */
+ mem_root->pre_alloc= mem;
+ return;
+ }
+ if (mem->left + ALIGN_SIZE(sizeof(USED_MEM)) == mem->size)
+ {
+ /* remove block from the list and free it */
+ *prev= mem->next;
+ my_free((gptr) mem, MYF(0));
+ }
+ else
+ prev= &mem->next;
+ }
+ /* Allocate new prealloc block and add it to the end of free list */
+ if ((mem= (USED_MEM *) my_malloc(size, MYF(0))))
+ {
+ mem->size= size;
+ mem->left= pre_alloc_size;
+ mem->next= *prev;
+ *prev= mem_root->pre_alloc= mem;
+ }
+ }
+ }
+ else
+#endif
+ mem_root->pre_alloc= 0;
+}
+
+
gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size)
{
#if defined(HAVE_purify) && defined(EXTRA_DEBUG)
diff --git a/mysys/my_div.c b/mysys/my_div.c
index 777ffe403d7..9141ff4fcc5 100644
--- a/mysys/my_div.c
+++ b/mysys/my_div.c
@@ -27,7 +27,7 @@
my_string my_filename(File fd)
{
DBUG_ENTER("my_filename");
- if (fd >= MY_NFILE)
+ if ((uint) fd >= (uint) my_file_limit)
DBUG_RETURN((char*) "UNKNOWN");
if (fd >= 0 && my_file_info[fd].type != UNOPEN)
{
diff --git a/mysys/my_dup.c b/mysys/my_dup.c
index df298780e3e..4b7434e29ea 100644
--- a/mysys/my_dup.c
+++ b/mysys/my_dup.c
@@ -32,7 +32,7 @@ File my_dup(File file, myf MyFlags)
DBUG_ENTER("my_dup");
DBUG_PRINT("my",("file: %d MyFlags: %d", MyFlags));
fd = dup(file);
- filename= (((int) file < MY_NFILE) ?
+ filename= (((uint) file < my_file_limit) ?
my_file_info[(int) file].name : "Unknown");
DBUG_RETURN(my_register_filename(fd, filename, FILE_BY_DUP,
EE_FILENOTFOUND, MyFlags));
diff --git a/mysys/my_file.c b/mysys/my_file.c
new file mode 100644
index 00000000000..6a9d39cf944
--- /dev/null
+++ b/mysys/my_file.c
@@ -0,0 +1,147 @@
+/* Copyright (C) 2000 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 "mysys_priv.h"
+#include "my_static.h"
+#include <m_string.h>
+
+/*
+ set how many open files we want to be able to handle
+
+ SYNOPSIS
+ set_maximum_open_files()
+ max_file_limit Files to open
+
+ NOTES
+ The request may not fulfilled becasue of system limitations
+
+ RETURN
+ Files available to open.
+ May be more or less than max_file_limit!
+*/
+
+#if defined(HAVE_GETRLIMIT) && defined(RLIMIT_NOFILE) && !defined(HAVE_mit_thread)
+
+#ifndef RLIM_INFINITY
+#define RLIM_INFINITY ((uint) 0xffffffff)
+#endif
+
+static uint set_max_open_files(uint max_file_limit)
+{
+ struct rlimit rlimit;
+ uint old_cur;
+ DBUG_ENTER("set_max_open_files");
+ DBUG_PRINT("enter",("files: %u", max_file_limit));
+
+ if (!getrlimit(RLIMIT_NOFILE,&rlimit))
+ {
+ old_cur= (uint) rlimit.rlim_cur;
+ DBUG_PRINT("info", ("rlim_cur: %u rlim_max: %u",
+ (uint) rlimit.rlim_cur,
+ (uint) rlimit.rlim_max));
+ if (rlimit.rlim_cur == RLIM_INFINITY)
+ rlimit.rlim_cur = max_file_limit;
+ if (rlimit.rlim_cur >= max_file_limit)
+ DBUG_RETURN(rlimit.rlim_cur); /* purecov: inspected */
+ rlimit.rlim_cur= rlimit.rlim_max= max_file_limit;
+ if (setrlimit(RLIMIT_NOFILE, &rlimit))
+ max_file_limit= old_cur; /* Use original value */
+ else
+ {
+ rlimit.rlim_cur= 0; /* Safety if next call fails */
+ (void) getrlimit(RLIMIT_NOFILE,&rlimit);
+ DBUG_PRINT("info", ("rlim_cur: %u", (uint) rlimit.rlim_cur));
+ if (rlimit.rlim_cur) /* If call didn't fail */
+ max_file_limit= (uint) rlimit.rlim_cur;
+ }
+ }
+ DBUG_PRINT("exit",("max_file_limit: %u", max_file_limit));
+ DBUG_RETURN(max_file_limit);
+}
+
+#elif defined (OS2)
+
+static uint set_max_open_files(uint max_file_limit)
+{
+ LONG cbReqCount;
+ ULONG cbCurMaxFH0;
+ APIRET ulrc;
+ DBUG_ENTER("set_max_open_files");
+
+ /* get current limit */
+ cbReqCount = 0;
+ DosSetRelMaxFH( &cbReqCount, &cbCurMaxFH0);
+
+ /* set new limit */
+ if ((cbReqCount = max_file_limit - cbCurMaxFH0) > 0)
+ ulrc = DosSetRelMaxFH( &cbReqCount, &cbCurMaxFH);
+ DBUG_RETURN(cbCurMaxFH0);
+}
+
+#else
+static int set_max_open_files(uint max_file_limit)
+{
+ /* We don't know the limit. Return best guess */
+ return min(max_file_limit, OS_FILE_LIMIT);
+}
+#endif
+
+
+/*
+ Change number of open files
+
+ SYNOPSIS:
+ my_set_max_open_files()
+ files Number of requested files
+
+ RETURN
+ number of files available for open
+*/
+
+uint my_set_max_open_files(uint files)
+{
+ struct st_my_file_info *tmp;
+ DBUG_ENTER("my_set_max_open_files");
+ DBUG_PRINT("enter",("files: %u my_file_limit: %u", files, my_file_limit));
+
+ files= set_max_open_files(min(files, OS_FILE_LIMIT));
+ if (files <= MY_NFILE)
+ DBUG_RETURN(files);
+
+ if (!(tmp= (struct st_my_file_info*) my_malloc(sizeof(*tmp) * files,
+ MYF(MY_WME))))
+ DBUG_RETURN(MY_NFILE);
+
+ /* Copy any initialized files */
+ memcpy((char*) tmp, (char*) my_file_info, sizeof(*tmp) * my_file_limit);
+ my_free_open_file_info(); /* Free if already allocated */
+ my_file_info= tmp;
+ my_file_limit= files;
+ DBUG_PRINT("exit",("files: %u", files));
+ DBUG_RETURN(files);
+}
+
+
+void my_free_open_file_info()
+{
+ DBUG_ENTER("my_free_file_info");
+ if (my_file_info != my_file_info_default)
+ {
+ my_free((char*) my_file_info, MYF(0));
+ my_file_info= my_file_info_default;
+ }
+ DBUG_VOID_RETURN;
+}
diff --git a/mysys/my_fopen.c b/mysys/my_fopen.c
index d3b0b90f9c5..8906a288b11 100644
--- a/mysys/my_fopen.c
+++ b/mysys/my_fopen.c
@@ -42,7 +42,7 @@ FILE *my_fopen(const char *FileName, int Flags, myf MyFlags)
on some OS (SUNOS). Actually the filename save isn't that important
so we can ignore if this doesn't work.
*/
- if ((uint) fileno(fd) >= MY_NFILE)
+ if ((uint) fileno(fd) >= my_file_limit)
{
thread_safe_increment(my_stream_opened,&THR_LOCK_open);
DBUG_RETURN(fd); /* safeguard */
@@ -91,7 +91,7 @@ int my_fclose(FILE *fd, myf MyFlags)
}
else
my_stream_opened--;
- if ((uint) file < MY_NFILE && my_file_info[file].type != UNOPEN)
+ if ((uint) file < my_file_limit && my_file_info[file].type != UNOPEN)
{
my_file_info[file].type = UNOPEN;
my_free(my_file_info[file].name, MYF(MY_ALLOW_ZERO_PTR));
@@ -123,11 +123,11 @@ FILE *my_fdopen(File Filedes, const char *name, int Flags, myf MyFlags)
{
pthread_mutex_lock(&THR_LOCK_open);
my_stream_opened++;
- if (Filedes < MY_NFILE)
+ if ((uint) Filedes < (uint) my_file_limit)
{
if (my_file_info[Filedes].type != UNOPEN)
{
- my_file_opened--; /* File is opened with my_open ! */
+ my_file_opened--; /* File is opened with my_open ! */
}
else
{
diff --git a/mysys/my_gethwaddr.c b/mysys/my_gethwaddr.c
new file mode 100644
index 00000000000..72f1cb975c4
--- /dev/null
+++ b/mysys/my_gethwaddr.c
@@ -0,0 +1,130 @@
+/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ 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 */
+
+/* get hardware address for an interface */
+/* if there are many available, any non-zero one can be used */
+
+#include "mysys_priv.h"
+#include <m_string.h>
+
+#ifndef MAIN
+static my_bool memcpy_and_test(uchar *to, uchar *from, uint len)
+{
+ uint i, res=1;
+
+ for (i=0; i < len; i++)
+ if ((*to++= *from++))
+ res=0;
+ return res;
+}
+
+#ifdef __FreeBSD__
+
+#include <net/ethernet.h>
+#include <sys/sysctl.h>
+#include <net/route.h>
+#include <net/if.h>
+#include <net/if_dl.h>
+
+my_bool my_gethwaddr(uchar *to)
+{
+ size_t len;
+ uchar *buf, *next, *end, *addr;
+ struct if_msghdr *ifm;
+ struct sockaddr_dl *sdl;
+ int i, res=1, mib[6]={CTL_NET, AF_ROUTE, 0, AF_LINK, NET_RT_IFLIST, 0};
+
+ if (sysctl(mib, 6, NULL, &len, NULL, 0) == -1)
+ goto err;
+ if (!(buf = alloca(len)))
+ goto err;
+ if (sysctl(mib, 6, buf, &len, NULL, 0) < 0)
+ goto err;
+
+ end = buf + len;
+
+ for (next = buf ; res && next < end ; next += ifm->ifm_msglen)
+ {
+ ifm = (struct if_msghdr *)next;
+ if (ifm->ifm_type == RTM_IFINFO)
+ {
+ sdl = (struct sockaddr_dl *)(ifm + 1);
+ addr=LLADDR(sdl);
+ res=memcpy_and_test(to, addr, ETHER_ADDR_LEN);
+ }
+ }
+
+err:
+ return res;
+}
+
+#elif __linux__
+
+#include <net/if.h>
+#include <sys/ioctl.h>
+#include <net/ethernet.h>
+
+my_bool my_gethwaddr(uchar *to)
+{
+ int fd, res=1;
+ struct ifreq ifr;
+
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (fd < 0)
+ goto err;
+
+ bzero(&ifr, sizeof(ifr));
+ strnmov(ifr.ifr_name, "eth0", sizeof(ifr.ifr_name) - 1);
+
+ do {
+ if (ioctl(fd, SIOCGIFHWADDR, &ifr) >= 0)
+ res=memcpy_and_test(to, (uchar *)&ifr.ifr_hwaddr.sa_data, ETHER_ADDR_LEN);
+ } while (res && (errno == 0 || errno == ENODEV) && ifr.ifr_name[3]++ < '6');
+
+ close(fd);
+err:
+ return res;
+}
+
+#else
+/* just fail */
+my_bool my_gethwaddr(uchar *to __attribute__((unused)))
+{
+ return 1;
+}
+#endif
+
+#else MAIN
+int main(int argc __attribute__((unused)),char **argv)
+{
+ uchar mac[6];
+ uint i;
+ MY_INIT(argv[0]);
+ if (my_gethwaddr(mac))
+ {
+ printf("my_gethwaddr failed with errno %d\n", errno);
+ exit(1);
+ }
+ for (i=0; i < sizeof(mac); i++)
+ {
+ if (i) printf(":");
+ printf("%02x", mac[i]);
+ }
+ printf("\n");
+ return 0;
+}
+#endif
+
diff --git a/mysys/my_getopt.c b/mysys/my_getopt.c
index b278eaa36e1..8a1f6db6f8a 100644
--- a/mysys/my_getopt.c
+++ b/mysys/my_getopt.c
@@ -324,9 +324,11 @@ int handle_options(int *argc, char ***argv,
--enable-'option-name'.
*optend was set to '0' if one used --disable-option
*/
- *((my_bool*) value)= (my_bool) (!optend || *optend == '1');
- (*argc)--;
- get_one_option(optp->id, optp, argument);
+ my_bool tmp= (my_bool) (!optend || *optend == '1');
+ *((my_bool*) value)= tmp;
+ (*argc)--;
+ get_one_option(optp->id, optp,
+ tmp ? (char*) "1" : disabled_my_option);
continue;
}
argument= optend;
@@ -655,18 +657,15 @@ static longlong eval_num_suffix (char *argument, int *error, char *option_name)
static longlong getopt_ll(char *arg, const struct my_option *optp, int *err)
{
longlong num;
+ ulonglong block_size= (optp->block_size ? (ulonglong) optp->block_size : 1L);
num= eval_num_suffix(arg, err, (char*) optp->name);
- if (num < (longlong) optp->min_value)
- num= (longlong) optp->min_value;
- else if (num > 0 && (ulonglong) num > (ulonglong) (ulong) optp->max_value
- && optp->max_value) /* if max value is not set -> no upper limit */
+ if (num > 0 && (ulonglong) num > (ulonglong) (ulong) optp->max_value &&
+ optp->max_value) /* if max value is not set -> no upper limit */
num= (longlong) (ulong) optp->max_value;
- num= ((num - (longlong) optp->sub_size) / (optp->block_size ?
- (ulonglong) optp->block_size :
- 1L));
- return (longlong) (num * (optp->block_size ? (ulonglong) optp->block_size :
- 1L));
+ num= ((num - (longlong) optp->sub_size) / block_size);
+ num= (longlong) (num * block_size);
+ return max(num, optp->min_value);
}
/*
diff --git a/mysys/my_getsystime.c b/mysys/my_getsystime.c
new file mode 100644
index 00000000000..bdaa232d560
--- /dev/null
+++ b/mysys/my_getsystime.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ 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 */
+
+/* get time since epoc in 100 nanosec units */
+/* thus to get the current time we should use the system function
+ with the highest possible resolution */
+
+#ifdef __NETWARE__
+#include <nks/time.h>
+#endif
+
+#include "mysys_priv.h"
+ulonglong my_getsystime()
+{
+#ifdef HAVE_CLOCK_GETTIME
+ struct timespec tp;
+ clock_gettime(CLOCK_REALTIME, &tp);
+ return (ulonglong)tp.tv_sec*10000000+(ulonglong)tp.tv_nsec/100;
+#elif defined(__WIN__)
+ /* TODO: use GetSystemTimeAsFileTime here or
+ QueryPerformanceCounter/QueryPerformanceFrequency */
+ struct _timeb tb;
+ _ftime(&tb);
+ return (ulonglong)tb.time*10000000+(ulonglong)tb.millitm*10000;
+#elif defined(__NETWARE__)
+ NXTime_t tm;
+ NXGetTime(NX_SINCE_1970, NX_NSECONDS, &tm);
+ return (ulonglong)tm/100;
+#else
+ /* TODO: check for other possibilities for hi-res timestamping */
+ struct timeval tv;
+ gettimeofday(&tv,NULL);
+ return (ulonglong)tv.tv_sec*10000000+(ulonglong)tv.tv_usec*10;
+#endif
+}
diff --git a/mysys/my_handler.c b/mysys/my_handler.c
index 6ee6167d3c1..35f620ccbcb 100644
--- a/mysys/my_handler.c
+++ b/mysys/my_handler.c
@@ -9,7 +9,7 @@
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
-
+
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
@@ -18,15 +18,21 @@
#include "my_handler.h"
int mi_compare_text(CHARSET_INFO *charset_info, uchar *a, uint a_length,
- uchar *b, uint b_length, my_bool part_key)
+ uchar *b, uint b_length, my_bool part_key,
+ my_bool skip_end_space)
{
if (part_key && b_length < a_length)
a_length=b_length;
- return my_strnncoll(charset_info, a, a_length, b, b_length);
+ if (skip_end_space)
+ return charset_info->coll->strnncollsp(charset_info, a, a_length,
+ b, b_length);
+ return charset_info->coll->strnncoll(charset_info, a, a_length,
+ b, b_length);
}
+
static int compare_bin(uchar *a, uint a_length, uchar *b, uint b_length,
- my_bool part_key)
+ my_bool part_key, my_bool skip_end_space)
{
uint length= min(a_length,b_length);
uchar *end= a+ length;
@@ -37,6 +43,31 @@ static int compare_bin(uchar *a, uint a_length, uchar *b, uint b_length,
return flag;
if (part_key && b_length < a_length)
return 0;
+ if (skip_end_space && a_length != b_length)
+ {
+ int swap= 0;
+ /*
+ We are using space compression. We have to check if longer key
+ has next character < ' ', in which case it's less than the shorter
+ key that has an implicite space afterwards.
+
+ This code is identical to the one in
+ strings/ctype-simple.c:my_strnncollsp_simple
+ */
+ if (a_length < b_length)
+ {
+ /* put shorter key in a */
+ a_length= b_length;
+ a= b;
+ swap= -1; /* swap sign of result */
+ }
+ for (end= a + a_length-length; a < end ; a++)
+ {
+ if (*a != ' ')
+ return ((int) *a - (int) ' ') ^ swap;
+ }
+ return 0;
+ }
return (int) (a_length-b_length);
}
@@ -128,7 +159,8 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
if (piks &&
(flag=mi_compare_text(keyseg->charset,a,a_length,b,b_length,
(my_bool) ((nextflag & SEARCH_PREFIX) &&
- next_key_length <= 0))))
+ next_key_length <= 0),
+ !(nextflag & SEARCH_PREFIX))))
return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
a+=a_length;
b+=b_length;
@@ -137,17 +169,11 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
else
{
uint length=(uint) (end-a), a_length=length, b_length=length;
- if (!(nextflag & SEARCH_PREFIX))
- {
- while (a_length && a[a_length-1] == ' ')
- a_length--;
- while (b_length && b[b_length-1] == ' ')
- b_length--;
- }
if (piks &&
(flag= mi_compare_text(keyseg->charset, a, a_length, b, b_length,
(my_bool) ((nextflag & SEARCH_PREFIX) &&
- next_key_length <= 0))))
+ next_key_length <= 0),
+ !(nextflag & SEARCH_PREFIX))))
return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
a=end;
b+=length;
@@ -164,7 +190,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
if (piks &&
(flag=compare_bin(a,a_length,b,b_length,
(my_bool) ((nextflag & SEARCH_PREFIX) &&
- next_key_length <= 0))))
+ next_key_length <= 0),1)))
return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
a+=a_length;
b+=b_length;
@@ -176,7 +202,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
if (piks &&
(flag=compare_bin(a,length,b,length,
(my_bool) ((nextflag & SEARCH_PREFIX) &&
- next_key_length <= 0))))
+ next_key_length <= 0),0)))
return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
a+=length;
b+=length;
@@ -184,26 +210,23 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
break;
case HA_KEYTYPE_VARTEXT:
{
- int a_length,b_length,pack_length;
+ int a_length,full_a_length,b_length,full_b_length,pack_length;
get_key_length(a_length,a);
get_key_pack_length(b_length,pack_length,b);
+ full_a_length= a_length;
+ full_b_length= b_length;
next_key_length=key_length-b_length-pack_length;
- if (!(nextflag & (SEARCH_PREFIX | SEARCH_UPDATE)))
- {
- while (a_length && a[a_length-1] == ' ')
- a_length--;
- while (b_length && b[b_length-1] == ' ')
- b_length--;
- }
-
if (piks &&
(flag= mi_compare_text(keyseg->charset,a,a_length,b,b_length,
(my_bool) ((nextflag & SEARCH_PREFIX) &&
- next_key_length <= 0))))
+ next_key_length <= 0),
+ (my_bool) ((nextflag & (SEARCH_FIND |
+ SEARCH_UPDATE)) ==
+ SEARCH_FIND))))
return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
- a+=a_length;
- b+=b_length;
+ a+= full_a_length;
+ b+= full_b_length;
break;
}
break;
@@ -217,7 +240,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
if (piks &&
(flag=compare_bin(a,a_length,b,b_length,
(my_bool) ((nextflag & SEARCH_PREFIX) &&
- next_key_length <= 0))))
+ next_key_length <= 0), 0)))
return ((keyseg->flag & HA_REVERSE_SORT) ? -flag : flag);
a+=a_length;
b+=b_length;
@@ -308,7 +331,7 @@ int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
if (keyseg->flag & HA_REVERSE_SORT)
{
- swap(uchar*,a,b);
+ swap(uchar*,a,b);
swap_flag=1; /* Remember swap of a & b */
end= a+ (int) (end-b);
}
diff --git a/mysys/my_init.c b/mysys/my_init.c
index d68af1400c5..fc178b0308b 100644
--- a/mysys/my_init.c
+++ b/mysys/my_init.c
@@ -19,10 +19,6 @@
#include "mysys_err.h"
#include <m_string.h>
#include <m_ctype.h>
-#ifdef HAVE_GETRUSAGE
-#include <sys/resource.h>
-/* extern int getrusage(int, struct rusage *); */
-#endif
#include <signal.h>
#ifdef VMS
#include <my_static.c>
@@ -242,8 +238,13 @@ static void my_win_init(void)
setlocale(LC_CTYPE, ""); /* To get right sortorder */
- /* Clear the OS system variable TZ and avoid the 100% CPU usage */
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+ /*
+ Clear the OS system variable TZ and avoid the 100% CPU usage
+ Only for old versions of Visual C++
+ */
_putenv( "TZ=" );
+#endif
_tzset();
/* apre la chiave HKEY_LOCAL_MACHINES\software\MySQL */
diff --git a/mysys/my_new.cc b/mysys/my_new.cc
index ec27502d8aa..14423c3afd5 100644
--- a/mysys/my_new.cc
+++ b/mysys/my_new.cc
@@ -19,10 +19,10 @@
with gcc 3.0.x to avoid including libstdc++
*/
-#ifdef USE_MYSYS_NEW
-
#include "mysys_priv.h"
+#ifdef USE_MYSYS_NEW
+
void *operator new (size_t sz)
{
return (void *) malloc (sz ? sz : 1);
diff --git a/mysys/my_open.c b/mysys/my_open.c
index 97f21724e1c..ca5c0d8683f 100644
--- a/mysys/my_open.c
+++ b/mysys/my_open.c
@@ -86,7 +86,7 @@ int my_close(File fd, myf MyFlags)
if (MyFlags & (MY_FAE | MY_WME))
my_error(EE_BADCLOSE, MYF(ME_BELL+ME_WAITTANG),my_filename(fd),errno);
}
- if ((uint) fd < MY_NFILE && my_file_info[fd].type != UNOPEN)
+ if ((uint) fd < my_file_limit && my_file_info[fd].type != UNOPEN)
{
my_free(my_file_info[fd].name, MYF(0));
#if defined(THREAD) && !defined(HAVE_PREAD)
@@ -115,7 +115,7 @@ File my_register_filename(File fd, const char *FileName, enum file_type
{
if ((int) fd >= 0)
{
- if ((int) fd >= MY_NFILE)
+ if ((uint) fd >= my_file_limit)
{
#if defined(THREAD) && !defined(HAVE_PREAD)
(void) my_close(fd,MyFlags);
diff --git a/mysys/my_static.c b/mysys/my_static.c
index b24ef28b7b1..5f034555156 100644
--- a/mysys/my_static.c
+++ b/mysys/my_static.c
@@ -34,7 +34,9 @@ int NEAR my_umask=0664, NEAR my_umask_dir=0777;
#ifndef THREAD
int NEAR my_errno=0;
#endif
-struct my_file_info my_file_info[MY_NFILE]= {{0,UNOPEN}};
+struct st_my_file_info my_file_info_default[MY_NFILE]= {{0,UNOPEN}};
+uint my_file_limit= MY_NFILE;
+struct st_my_file_info *my_file_info= my_file_info_default;
/* From mf_brkhant */
int NEAR my_dont_interrupt=0;
diff --git a/mysys/my_static.h b/mysys/my_static.h
index 08d1a93692f..bb408aa808d 100644
--- a/mysys/my_static.h
+++ b/mysys/my_static.h
@@ -68,6 +68,8 @@ extern byte *sf_min_adress,*sf_max_adress;
extern uint sf_malloc_count;
extern struct st_irem *sf_malloc_root;
+extern struct st_my_file_info my_file_info_default[MY_NFILE];
+
#if defined(THREAD) && !defined(__WIN__)
extern sigset_t my_signals; /* signals blocked by mf_brkhant */
#endif
diff --git a/mysys/my_tempnam.c b/mysys/my_tempnam.c
index d079b9f66a5..b4f76727ee0 100644
--- a/mysys/my_tempnam.c
+++ b/mysys/my_tempnam.c
@@ -105,12 +105,13 @@ my_string my_tempnam(const char *dir, const char *pfx,
}
#ifdef OS2
/* changing environ variable doesn't work with VACPP */
- char buffer[256];
- sprintf( buffer, "TMP=%s", dir);
+ char buffer[256], *end;
+ buffer[sizeof[buffer)-1]= 0;
+ end= strxnmov(buffer, sizeof(buffer)-1, (char*) "TMP=", dir, NullS);
/* remove ending backslash */
- if (buffer[strlen(buffer)-1] == '\\')
- buffer[strlen(buffer)-1] = '\0';
- putenv( buffer);
+ if (end[-1] == '\\')
+ end[-1]= 0;
+ putenv(buffer);
#elif !defined(__NETWARE__)
old_env=(char**)environ;
if (dir)
diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c
index 237eeefa325..445cef0cd6f 100644
--- a/mysys/my_thr_init.c
+++ b/mysys/my_thr_init.c
@@ -104,7 +104,7 @@ void my_thread_global_end(void)
#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
pthread_mutexattr_destroy(&my_fast_mutexattr);
#endif
-#ifdef PPTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+#ifdef PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
pthread_mutexattr_destroy(&my_errchk_mutexattr);
#endif
pthread_mutex_destroy(&THR_LOCK_malloc);
diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h
index f79431a0b0b..6abadd48aeb 100644
--- a/mysys/mysys_priv.h
+++ b/mysys/mysys_priv.h
@@ -21,6 +21,10 @@
#include "system_wrappers.h"
#endif
+#ifdef HAVE_GETRUSAGE
+#include <sys/resource.h>
+#endif
+
#ifdef THREAD
#include <my_pthread.h>
extern pthread_mutex_t THR_LOCK_malloc, THR_LOCK_open, THR_LOCK_keycache;
@@ -29,3 +33,4 @@ extern pthread_mutex_t THR_LOCK_charset;
#else
#include <my_no_pthread.h>
#endif
+
diff --git a/mysys/test_fn.c b/mysys/test_fn.c
index 5a0546392ab..d0fb9f59fd6 100644
--- a/mysys/test_fn.c
+++ b/mysys/test_fn.c
@@ -59,7 +59,8 @@ int main(int argc __attribute__((unused)), char **argv)
printf("org : '%s'\n",*pos);
printf("pack: '%s'\n",fn_format(buff,*pos,"","",8));
printf("unpack: '%s'\n",fn_format(buff2,*pos,"","",4));
- if (strcmp(unpack_filename(buff,buff),buff2) != 0)
+ unpack_filename(buff,buff);
+ if (strcmp(buff,buff2) != 0)
{
printf("error on cmp: '%s' != '%s'\n",buff,buff2);
}
diff --git a/mysys/tree.c b/mysys/tree.c
index 42c58131100..063c8739e58 100644
--- a/mysys/tree.c
+++ b/mysys/tree.c
@@ -170,8 +170,8 @@ void delete_tree(TREE* tree)
void reset_tree(TREE* tree)
{
+ /* do not free mem_root, just mark blocks as free */
free_tree(tree, MYF(MY_MARK_BLOCKS_FREE));
- /* do not my_free() mem_root if applicable, just mark blocks as free */
}
@@ -188,10 +188,14 @@ static void delete_tree_element(TREE *tree, TREE_ELEMENT *element)
}
}
- /* Code for insert, search and delete of elements */
- /* parent[0] = & parent[-1][0]->left ||
- parent[0] = & parent[-1][0]->right */
+/*
+ insert, search and delete of elements
+
+ The following should be true:
+ parent[0] = & parent[-1][0]->left ||
+ parent[0] = & parent[-1][0]->right
+*/
TREE_ELEMENT *tree_insert(TREE *tree, void *key, uint key_size,
void* custom_arg)
@@ -232,8 +236,7 @@ TREE_ELEMENT *tree_insert(TREE *tree, void *key, uint key_size,
if (tree->with_delete)
element=(TREE_ELEMENT *) my_malloc(alloc_size, MYF(MY_WME));
else
- element=(TREE_ELEMENT *)
- alloc_root(&tree->mem_root,alloc_size);
+ element=(TREE_ELEMENT *) alloc_root(&tree->mem_root,alloc_size);
if (!element)
return(NULL);
**parent=element;
@@ -251,9 +254,9 @@ TREE_ELEMENT *tree_insert(TREE *tree, void *key, uint key_size,
}
else
memcpy((byte*) element+tree->offset_to_key,key,(size_t) key_size);
- element->count=1; /* May give warning in purify */
+ element->count=1; /* May give warning in purify */
tree->elements_in_tree++;
- rb_insert(tree,parent,element); /* rebalance tree */
+ rb_insert(tree,parent,element); /* rebalance tree */
}
else
{
@@ -320,6 +323,8 @@ int tree_delete(TREE *tree, void *key, void *custom_arg)
rb_delete_fixup(tree,parent);
if (tree->free)
(*tree->free)(ELEMENT_KEY(tree,element), free_free, tree->custom_arg);
+ /* This doesn't include key_size, but better than nothing */
+ tree->allocated-= sizeof(TREE_ELEMENT)+tree->size_of_element;
my_free((gptr) element,MYF(0));
tree->elements_in_tree--;
return 0;
@@ -476,7 +481,6 @@ ha_rows tree_record_pos(TREE *tree, const void *key,
TREE_ELEMENT *element= tree->root;
double left= 1;
double right= tree->elements_in_tree;
- ha_rows last_equal_pos= HA_POS_ERROR;
while (element != &tree->null_element)
{
@@ -485,9 +489,6 @@ ha_rows tree_record_pos(TREE *tree, const void *key,
{
switch (flag) {
case HA_READ_KEY_EXACT:
- last_equal_pos= (ha_rows) ((left + right) / 2);
- cmp= 1;
- break;
case HA_READ_BEFORE_KEY:
cmp= 1;
break;
@@ -511,7 +512,6 @@ ha_rows tree_record_pos(TREE *tree, const void *key,
}
switch (flag) {
case HA_READ_KEY_EXACT:
- return last_equal_pos;
case HA_READ_BEFORE_KEY:
return (ha_rows) right;
case HA_READ_AFTER_KEY:
diff --git a/mytest-old.c b/mytest-old.c
deleted file mode 100644
index 8b4029f5e1e..00000000000
--- a/mytest-old.c
+++ /dev/null
@@ -1,169 +0,0 @@
-/*C4*/
-/****************************************************************/
-/* Author: Jethro Wright, III TS : 3/ 4/1998 9:15 */
-/* Date: 02/18/1998 */
-/* mytest.c : do some testing of the libmySQL.DLL.... */
-/* */
-/* History: */
-/* 02/18/1998 jw3 also sprach zarathustra.... */
-/****************************************************************/
-
-
-#include <windows.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <mysql.h>
-
-#define DEFALT_SQL_STMT "SELECT * FROM db"
-#ifndef offsetof
-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
-#endif
-
-
-/********************************************************
-**
-** main :-
-**
-********************************************************/
-
-int
-main( int argc, char * argv[] )
-{
-
- char szSQL[ 200 ], aszFlds[ 25 ][ 25 ], * pszT, szDB[ 50 ] ;
- int i, j, k, l, x ;
- MYSQL * myData ;
- MYSQL_RES * res ;
- MYSQL_FIELD * fd ;
- MYSQL_ROW row ;
-
- //....just curious....
- printf( "sizeof( MYSQL ) == %d\n", sizeof( MYSQL ) ) ;
- if ( argc == 2 )
- {
- strcpy( szDB, argv[ 1 ] ) ;
- strcpy( szSQL, DEFALT_SQL_STMT ) ;
- if (!strcmp(szDB,"--debug"))
- {
- strcpy( szDB, "mysql" ) ;
- printf("Some mysql struct information (size and offset):\n");
- printf("net:\t%3d %3d\n",sizeof(myData->net),offsetof(MYSQL,net));
- printf("host:\t%3d %3d\n",sizeof(myData->host),offsetof(MYSQL,host));
- printf("port:\t%3d %3d\n",sizeof(myData->port),offsetof(MYSQL,port));
- printf("protocol_version:\t%3d %3d\n",sizeof(myData->protocol_version),
- offsetof(MYSQL,protocol_version));
- printf("thread_id:\t%3d %3d\n",sizeof(myData->thread_id),
- offsetof(MYSQL,thread_id));
- printf("affected_rows:\t%3d %3d\n",sizeof(myData->affected_rows),
- offsetof(MYSQL,affected_rows));
- printf("packet_length:\t%3d %3d\n",sizeof(myData->packet_length),
- offsetof(MYSQL,packet_length));
- printf("status:\t%3d %3d\n",sizeof(myData->status),
- offsetof(MYSQL,status));
- printf("fields:\t%3d %3d\n",sizeof(myData->fields),
- offsetof(MYSQL,fields));
- printf("field_alloc:\t%3d %3d\n",sizeof(myData->field_alloc),
- offsetof(MYSQL,field_alloc));
- printf("free_me:\t%3d %3d\n",sizeof(myData->free_me),
- offsetof(MYSQL,free_me));
- printf("options:\t%3d %3d\n",sizeof(myData->options),
- offsetof(MYSQL,options));
- puts("");
- }
- }
- else if ( argc > 2 ) {
- strcpy( szDB, argv[ 1 ] ) ;
- strcpy( szSQL, argv[ 2 ] ) ;
- }
- else {
- strcpy( szDB, "mysql" ) ;
- strcpy( szSQL, DEFALT_SQL_STMT ) ;
- }
- //....
-
- if ( (myData = mysql_init((MYSQL*) 0)) &&
- mysql_real_connect( myData, NULL, NULL, NULL, NULL, MYSQL_PORT,
- NULL, 0 ) )
- {
- if ( mysql_select_db( myData, szDB ) < 0 ) {
- printf( "Can't select the %s database !\n", szDB ) ;
- mysql_close( myData ) ;
- return 2 ;
- }
- }
- else {
- printf( "Can't connect to the mysql server on port %d !\n",
- MYSQL_PORT ) ;
- mysql_close( myData ) ;
- return 1 ;
- }
- //....
- if ( ! mysql_query( myData, szSQL ) ) {
- res = mysql_store_result( myData ) ;
- i = (int) mysql_num_rows( res ) ; l = 1 ;
- printf( "Query: %s\nNumber of records found: %ld\n", szSQL, i ) ;
- //....we can get the field-specific characteristics here....
- for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
- strcpy( aszFlds[ x ], fd->name ) ;
- //....
- while ( row = mysql_fetch_row( res ) ) {
- j = mysql_num_fields( res ) ;
- printf( "Record #%ld:-\n", l++ ) ;
- for ( k = 0 ; k < j ; k++ )
- printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
- (((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
- puts( "==============================\n" ) ;
- }
- mysql_free_result( res ) ;
- }
- else printf( "Couldn't execute %s on the server !\n", szSQL ) ;
- //....
- puts( "==== Diagnostic info ====" ) ;
- pszT = mysql_get_client_info() ;
- printf( "Client info: %s\n", pszT ) ;
- //....
- pszT = mysql_get_host_info( myData ) ;
- printf( "Host info: %s\n", pszT ) ;
- //....
- pszT = mysql_get_server_info( myData ) ;
- printf( "Server info: %s\n", pszT ) ;
- //....
- res = mysql_list_processes( myData ) ; l = 1 ;
- if (res)
- {
- for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
- strcpy( aszFlds[ x ], fd->name ) ;
- while ( row = mysql_fetch_row( res ) ) {
- j = mysql_num_fields( res ) ;
- printf( "Process #%ld:-\n", l++ ) ;
- for ( k = 0 ; k < j ; k++ )
- printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
- (((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
- puts( "==============================\n" ) ;
- }
- }
- else
- {
- printf("Got error %s when retreiving processlist\n",mysql_error(myData));
- }
- //....
- res = mysql_list_tables( myData, "%" ) ; l = 1 ;
- for ( x = 0 ; fd = mysql_fetch_field( res ) ; x++ )
- strcpy( aszFlds[ x ], fd->name ) ;
- while ( row = mysql_fetch_row( res ) ) {
- j = mysql_num_fields( res ) ;
- printf( "Table #%ld:-\n", l++ ) ;
- for ( k = 0 ; k < j ; k++ )
- printf( " Fld #%d (%s): %s\n", k + 1, aszFlds[ k ],
- (((row[k]==NULL)||(!strlen(row[k])))?"NULL":row[k])) ;
- puts( "==============================\n" ) ;
- }
- //....
- pszT = mysql_stat( myData ) ;
- puts( pszT ) ;
- //....
- mysql_close( myData ) ;
- return 0 ;
-
-}
diff --git a/netware/BUILD/compile-linux-tools b/netware/BUILD/compile-linux-tools
index 3590a900338..886f866d674 100755
--- a/netware/BUILD/compile-linux-tools
+++ b/netware/BUILD/compile-linux-tools
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/sh
# debug
#set -x
@@ -46,6 +46,9 @@ make clean config.h
(cd sql; make gen_lex_hash)
(cd strings; make conf_to_src)
+# so the file will be linked
+(cd sql; make sql_yacc.cc)
+
# copying required linux tools
cp extra/comp_err extra/comp_err.linux
cp libmysql/conf_to_src libmysql/conf_to_src.linux
diff --git a/netware/BUILD/compile-netware-END b/netware/BUILD/compile-netware-END
index 19d24ff8c6f..2bd59f97114 100755
--- a/netware/BUILD/compile-netware-END
+++ b/netware/BUILD/compile-netware-END
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/sh
# debug
#set -x
diff --git a/netware/BUILD/mwenv b/netware/BUILD/mwenv
index 4445bc5b2e5..e4e6d509100 100755
--- a/netware/BUILD/mwenv
+++ b/netware/BUILD/mwenv
@@ -6,9 +6,9 @@
# the default is "F:/mydev"
export MYDEV="WINE_BUILD_DIR"
-export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV/zlib-1.1.4"
-export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/mysql-VERSION/netware/BUILD;$MYDEV/zlib-1.1.4"
-export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;knetware.imp;libz.a"
+export MWCNWx86Includes="$MYDEV/libc/include;$MYDEV;$MYDEV/zlib-1.1.4""
+export MWNWx86Libraries="$MYDEV/libc/imports;$MYDEV/mw/lib;$MYDEV/zlib-1.1.4;$MYDEV/mysql-VERSION/netware/BUILD"
+export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;libz.a;knetware.imp"
export WINEPATH="$MYDEV/mw/bin"
@@ -23,7 +23,7 @@ export CFLAGS='-align 8 -proc 686 -relax_pointers -dialect c'
export CXX='mwccnlm -gccincludes'
export CXXFLAGS='-align 8 -proc 686 -relax_pointers -dialect c++ -bool on -wchar_t on -D_WCHAR_T'
export LD='mwldnlm'
-export LDFLAGS='-entry _LibCPrelude -exit _LibCPostlude -flags pseudopreemption'
+export LDFLAGS='-entry _LibCPrelude -exit _LibCPostlude -map -flags pseudopreemption'
export RANLIB=:
export STRIP=:
diff --git a/netware/BUILD/nwbootstrap b/netware/BUILD/nwbootstrap
index 43b61d5254d..f54775bf054 100755
--- a/netware/BUILD/nwbootstrap
+++ b/netware/BUILD/nwbootstrap
@@ -11,7 +11,7 @@ path=`dirname $0`
# repository direcotry
repo_dir=`pwd`
-# build direcotry
+# build directory
build_dir="$HOME/mydev"
wine_build_dir="F:/mydev"
@@ -160,15 +160,15 @@ sed -e "s;WINE_BUILD_DIR;$wine_build_dir;g" \
-e "s;VERSION;$version;g" $mwenv.org > $mwenv
chmod +rwx $mwenv
-#edit the def file versions
+# edit the def file versions
echo "updating *.def file versions..."
nlm_version=`echo "$version" | sed -e "s;\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*;\1, \2, \3;"`
for file in ./netware/*.def
do
-mv -f $file $file.org
-sed -e "s;VERSION.*;VERSION $nlm_version;g" $file.org > $file
-rm $file.org
+ mv -f $file $file.org
+ sed -e "s;VERSION.*;VERSION $nlm_version;g" $file.org > $file
+ rm $file.org
done
# build linux tools
diff --git a/netware/Makefile.am b/netware/Makefile.am
index 5cc0e21f989..881dafe883e 100644
--- a/netware/Makefile.am
+++ b/netware/Makefile.am
@@ -11,37 +11,38 @@
# 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
+# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-INCLUDES= -I$(srcdir)/../include -I../include -I..
-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
-mysql_test_run_SOURCES= mysql_test_run.c my_manage.c
-libmysql_SOURCES= libmysqlmain.c
-libmysql_LDADD= ../libmysql/.libs/libmysqlclient.a
+INCLUDES = -I$(srcdir)/../include -I../include -I..
+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
+mysql_test_run_SOURCES= mysql_test_run.c my_manage.c
+libmysql_SOURCES= libmysqlmain.c
+libmysql_LDADD = ../libmysql/.libs/libmysqlclient.a @openssl_libs@
+
+netware_build_files = client/mysql.def client/mysqladmin.def \
+ client/mysqlbinlog.def client/mysqlcheck.def \
+ client/mysqldump.def client/mysqlimport.def \
+ client/mysqlshow.def client/mysqltest.def \
+ extra/mysql_install.def extra/my_print_defaults.def \
+ extra/perror.def extra/replace.def \
+ extra/resolveip.def extra/comp_err.def \
+ isam/isamchk.def \
+ isam/isamlog.def isam/pack_isam.def \
+ libmysqld/libmysqld.def myisam/myisamchk.def \
+ myisam/myisamlog.def myisam/myisampack.def \
+ sql/mysqld.def
-netware_build_files = client/mysql.def client/mysqladmin.def \
- client/mysqlbinlog.def client/mysqlcheck.def \
- client/mysqldump.def client/mysqlimport.def \
- client/mysqlshow.def client/mysqltest.def \
- extra/mysql_install.def extra/my_print_defaults.def \
- extra/perror.def extra/replace.def \
- extra/resolveip.def extra/comp_err.def \
- isam/isamchk.def \
- isam/isamlog.def isam/pack_isam.def \
- libmysqld/libmysqld.def myisam/myisamchk.def \
- myisam/myisamlog.def myisam/myisampack.def \
- sql/mysqld.def
-
link_sources:
- set -x; \
- for f in $(netware_build_files); do \
- rm -f $(srcdir)/../$$f; \
- org=`echo $$f | sed -e 's/.*\/\(.*\)/\1/g'`; \
- @LN_CP_F@ $(srcdir)/$$org $(srcdir)/../$$f; \
- done;
+ set -x; \
+ for f in $(netware_build_files); do \
+ rm -f $(srcdir)/../$$f; \
+ org=`echo $$f | sed -e 's/.*\/\(.*\)/\1/g'`; \
+ @LN_CP_F@ $(srcdir)/$$org $(srcdir)/../$$f; \
+ done;
+
# Don't update the files from bitkeeper
%::SCCS/s.%
diff --git a/netware/isamchk.def b/netware/isamchk.def
index 8d756466609..69e8ac0405b 100644
--- a/netware/isamchk.def
+++ b/netware/isamchk.def
@@ -2,6 +2,7 @@
# ISAM Check
#------------------------------------------------------------------------------
MODULE libc.nlm
+SCREENNAME "MySQL ISAM Table Check Tool"
COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL ISAM Table Check Tool"
VERSION 4, 0
diff --git a/netware/my_manage.c b/netware/my_manage.c
index f5889766726..1c1e75990b4 100644
--- a/netware/my_manage.c
+++ b/netware/my_manage.c
@@ -1,104 +1,90 @@
/*
- Copyright (c) 2003 MySQL AB
- Copyright (c) 2003 Novell, Inc.
+ 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 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 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
-*/
-
-/*****************************************************************************
-** Utility functions for support programs
-*****************************************************************************/
-
-/* MySQL library headers */
-#include <my_global.h>
-#include <my_sys.h>
-#include <my_dir.h>
-#include <m_string.h>
-
-/* These 'should' be POSIX or ANSI */
-#include <assert.h> /* ASSERT */
-#include <stdarg.h> /* vsprintf, va_* */
-#include <sys/types.h> /* pid_t */
-#ifndef __WIN__
-#include <unistd.h> /* fork, rmdir, execve */
-#endif
-#include <stdio.h> /* freopen */
-#include <stdlib.h> /* FILE */
-#ifndef __WIN__
-#include <dirent.h> /* opendir, readdir */
-#endif
-
-#if !defined(__NETWARE__) && !defined(__WIN__)
-#include <sys/wait.h>
-#endif
-
-#if !defined(__NETWARE__)
-#include <signal.h>
-#endif
-
-/* For ASSERT -- Not totally sure about this one: */
-#if !defined(ASSERT)
-#define ASSERT(A) assert(A)
-#endif
+*/
+
+#include <stdio.h>
+#include <errno.h>
+#include <dirent.h>
+#include <string.h>
+#include <screen.h>
+#include <proc.h>
+#include <ctype.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <assert.h>
#include "my_manage.h"
-#define __STDC__ 1
-#include "process.h"
+
+/******************************************************************************
+
+ macros
+
+******************************************************************************/
+
/******************************************************************************
- init_args()
+ global variables
+
+******************************************************************************/
- Init an argument list.
+/******************************************************************************
+
+ functions
+
+******************************************************************************/
+
+/******************************************************************************
+
+ init_args()
+
+ Init an argument list.
******************************************************************************/
void init_args(arg_list_t *al)
{
-#ifndef __WIN__
ASSERT(al != NULL);
-
+
al->argc = 0;
al->size = ARG_BUF;
- al->argv = (char **)my_malloc(al->size * sizeof(char *), MYF(MY_WME));
+ al->argv = malloc(al->size * sizeof(char *));
ASSERT(al->argv != NULL);
-#else
- win_args[0]= '\0';
- skip_first_param= TRUE;
-#endif
+
return;
}
/******************************************************************************
- add_arg()
-
- Add an argument to a list.
+ add_arg()
+
+ Add an argument to a list.
******************************************************************************/
-void add_arg(arg_list_t *al, const char *format, ...)
+void add_arg(arg_list_t *al, char *format, ...)
{
-#ifndef __WIN__
va_list ap;
char temp[PATH_MAX];
ASSERT(al != NULL);
- /* increase size */
- if (al->argc >= (int)al->size)
+ // increase size
+ if (al->argc >= al->size)
{
al->size += ARG_BUF;
- al->argv = (char **)my_realloc((char *)al->argv, al->size * sizeof(char *), MYF(MY_WME));
+ al->argv = realloc(al->argv, al->size * sizeof(char *));
ASSERT(al->argv != NULL);
}
@@ -108,7 +94,7 @@ void add_arg(arg_list_t *al, const char *format, ...)
vsprintf(temp, format, ap);
va_end(ap);
- al->argv[al->argc] = my_malloc(strlen(temp)+1, MYF(MY_WME));
+ al->argv[al->argc] = malloc(strlen(temp)+1);
ASSERT(al->argv[al->argc] != NULL);
strcpy(al->argv[al->argc], temp);
@@ -118,36 +104,19 @@ void add_arg(arg_list_t *al, const char *format, ...)
{
al->argv[al->argc] = NULL;
}
-#else
- va_list ap;
- char param[PATH_MAX];
- if (!skip_first_param)
- {
- va_start(ap, format);
- vsprintf(&param, format, ap);
- va_end(ap);
- strcat(win_args," ");
- strcat(win_args,param);
- }
- else
- {
- skip_first_param= FALSE;
- }
-#endif
return;
}
/******************************************************************************
- free_args()
-
- Free an argument list.
+ free_args()
+
+ Free an argument list.
******************************************************************************/
void free_args(arg_list_t *al)
{
-#ifndef __WIN__
int i;
ASSERT(al != NULL);
@@ -155,110 +124,74 @@ void free_args(arg_list_t *al)
for(i = 0; i < al->argc; i++)
{
ASSERT(al->argv[i] != NULL);
- my_free(al->argv[i], MYF(MY_WME));
+ free(al->argv[i]);
al->argv[i] = NULL;
}
- my_free((char *)al->argv, MYF(MY_WME));
+ free(al->argv);
al->argc = 0;
al->argv = NULL;
-#endif
+
return;
}
/******************************************************************************
- sleep_until_file_deleted()
-
- Sleep until the given file is no longer found.
+ sleep_until_file_deleted()
+
+ Sleep until the given file is no longer found.
******************************************************************************/
int sleep_until_file_deleted(char *pid_file)
{
- MY_STAT stat_info;
- int i, err = 0;
-#ifndef __WIN__
- for(i = 0; i < TRY_MAX; i++)
- {
- if (my_stat(pid_file, &stat_info, MYF(0)) == (MY_STAT *) NULL)
- {
- err = errno;
- break;
- }
- my_sleep(1);
- }
-#else
- switch (pid_mode)
- {
- case MASTER_PID:
- err= (WaitForSingleObject(master_server, TRY_MAX*1000) == WAIT_TIMEOUT);
- pid_mode= 0;
- break;
- case SLAVE_PID:
- err= (WaitForSingleObject(slave_server, TRY_MAX*1000) == WAIT_TIMEOUT);
- pid_mode= 0;
- break;
- };
-#endif
- return err;
+ struct stat buf;
+ int i, err;
+
+ for(i = 0; (i < TRY_MAX) && (err = !stat(pid_file, &buf)); i++) sleep(1);
+
+ if (err != 0) err = errno;
+
+ return err;
}
/******************************************************************************
- sleep_until_file_exists()
+ sleep_until_file_exists()
- Sleep until the given file exists.
+ Sleep until the given file exists.
******************************************************************************/
int sleep_until_file_exists(char *pid_file)
{
- MY_STAT stat_info;
- int i, err = 0;
-
-#ifndef __WIN__
- for(i = 0; i < TRY_MAX; i++)
- {
- if (my_stat(pid_file, &stat_info, MYF(0)) == (MY_STAT *) NULL)
- {
- err = errno;
- break;
- }
- my_sleep(1);
- }
-#else
- switch (pid_mode)
- {
- case MASTER_PID:
- WaitForSingleObject(master_server, TRY_MAX*1000);
- pid_mode= 0;
- break;
- case SLAVE_PID:
- WaitForSingleObject(slave_server, TRY_MAX*1000);
- pid_mode= 0;
- break;
- };
-#endif
-
- return err;
+ struct stat buf;
+ int i, err;
+
+ for(i = 0; (i < TRY_MAX) && (err = stat(pid_file, &buf)); i++) sleep(1);
+
+ if (err != 0) err = errno;
+
+ return err;
}
/******************************************************************************
- wait_for_server_start()
-
- Wait for the server on the given port to start.
+ wait_for_server_start()
+
+ Wait for the server on the given port to start.
******************************************************************************/
int wait_for_server_start(char *bin_dir, char *user, char *password, int port)
{
arg_list_t al;
- int err = 0, i;
+ int err, i;
+ char mysqladmin_file[PATH_MAX];
char trash[PATH_MAX];
- /* mysqladmin file */
- my_snprintf(trash, PATH_MAX, "/tmp/trash.out");
-
- /* args */
+ // mysqladmin file
+ snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir);
+ snprintf(trash, PATH_MAX, "/tmp/trash.out");
+
+ // args
init_args(&al);
add_arg(&al, "%s", mysqladmin_file);
add_arg(&al, "--no-defaults");
@@ -266,19 +199,23 @@ int wait_for_server_start(char *bin_dir, char *user, char *password, int port)
add_arg(&al, "--user=%s", user);
add_arg(&al, "--password=%s", password);
add_arg(&al, "--silent");
+
+ /** Not supported on NetWare
add_arg(&al, "-O");
add_arg(&al, "connect_timeout=10");
add_arg(&al, "-w");
+ **/
+
add_arg(&al, "--host=localhost");
add_arg(&al, "ping");
- /* NetWare does not support the connect timeout in the TCP/IP stack
- -- we will try the ping multiple times */
- for(i = 0; (i < TRY_MAX)
- && (err = spawn(mysqladmin_file, &al, TRUE, NULL,
- trash, NULL, NOT_NEED_PID)); i++) sleep(1);
-
- /* free args */
+ // NetWare does not support the connect timeout in the TCP/IP stack
+ // -- we will try the ping multiple times
+ for(i = 0; (i < TRY_MAX)
+ && (err = spawn(mysqladmin_file, &al, TRUE, NULL,
+ trash, NULL)); i++) sleep(1);
+
+ // free args
free_args(&al);
return err;
@@ -286,23 +223,20 @@ int wait_for_server_start(char *bin_dir, char *user, char *password, int port)
/******************************************************************************
- spawn()
-
- Spawn the executable at the given path with the given arguments.
+ spawn()
+
+ Spawn the given path with the given arguments.
******************************************************************************/
-
-#ifdef __NETWARE__
-
int spawn(char *path, arg_list_t *al, int join, char *input,
char *output, char *error)
{
- pid_t pid;
+ pid_t pid;
int result = 0;
wiring_t wiring = { FD_UNUSED, FD_UNUSED, FD_UNUSED };
unsigned long flags = PROC_CURRENT_SPACE | PROC_INHERIT_CWD;
- /* open wiring */
+ // open wiring
if (input)
wiring.infd = open(input, O_RDONLY);
@@ -312,14 +246,14 @@ int spawn(char *path, arg_list_t *al, int join, char *input,
if (error)
wiring.errfd = open(error, O_WRONLY | O_CREAT | O_TRUNC);
- /* procve requires a NULL */
+ // procve requires a NULL
add_arg(al, NULL);
- /* go */
+ // go
pid = procve(path, flags, NULL, &wiring, NULL, NULL, 0,
NULL, (const char **)al->argv);
- if (pid == -1)
+ if (pid == -1)
{
result = -1;
}
@@ -327,8 +261,8 @@ int spawn(char *path, arg_list_t *al, int join, char *input,
{
waitpid(pid, &result, 0);
}
-
- /* close wiring */
+
+ // close wiring
if (wiring.infd != -1)
close(wiring.infd);
@@ -338,411 +272,207 @@ int spawn(char *path, arg_list_t *al, int join, char *input,
if (wiring.errfd != -1)
close(wiring.errfd);
- return result;
+ return result;
}
-#else /* NOT __NETWARE__ */
-
-#ifdef __WIN__
-
-int my_vsnprintf_(char *to, size_t n, const char* value, ...)
-{
- char *start=to, *end=to+n-1;
- uint length, num_state, pre_zero;
- reg2 char *par;// = value;
- va_list args;
- va_start(args,value);
-
- par = va_arg(args, char *);
- while (par != NULL)
- {
- uint plen,left_len = (uint)(end-to)+1;
- if (!par) par = (char*)"(null)";
- plen = (uint) strlen(par);
- if (left_len <= plen)
- plen = left_len - 1;
- to=strnmov(to+strlen(to),par,plen);
- par = va_arg(args, char *);
- }
- va_end(args);
- DBUG_ASSERT(to <= end);
- *to='\0';
- return (uint) (to - start);
-}
-
-int spawn(char *path, arg_list_t *al, int join, char *input,
- char *output, char *error)
-{
- char *cl;
- char *arg;
- intptr_t result;
- int j;
- int err;
- STARTUPINFO startup_info;
- PROCESS_INFORMATION process_information;
- ULONG dosretval;
- int retval;
- DWORD exit_code;
- SECURITY_ATTRIBUTES process_attributes, thread_attributes;
- char command_line[1024]= "";
-
-
- memset(&startup_info,0,sizeof(STARTUPINFO));
- startup_info.cb = sizeof(STARTUPINFO);
-
- if (input)
- freopen(input, "rb", stdin);
-
- if (output)
- freopen(output, "wb", stdout);
-
- if (error)
- freopen(error, "wb", stderr);
-
- result= CreateProcess(
- path,
- &win_args,
- NULL,
- NULL,
- TRUE,
- 0,
- NULL,
- NULL,
- &startup_info,
- &process_information
- );
-
- if (process_information.hProcess)
- {
- if (join)
- {
- if (WaitForSingleObject(process_information.hProcess, mysqld_timeout) == WAIT_TIMEOUT)
- {
- exit_code= -1;
- }
- else
- {
- GetExitCodeProcess(process_information.hProcess, &exit_code);
- }
- CloseHandle(process_information.hProcess);
- }
- else
- {
- exit_code= 0;
- }
- if (run_server)
- {
- switch (pid_mode)
- {
- case MASTER_PID:
- master_server= process_information.hProcess;
- break;
- case SLAVE_PID:
- slave_server= process_information.hProcess;
- break;
- };
- pid_mode= 0;
- run_server= FALSE;
- };
- }
- else
- {
- exit_code= -1;
- }
- if (input)
- freopen("CONIN$","rb",stdin);
- if (output)
- freopen("CONOUT$","wb",stdout);
- if (error)
- freopen("CONOUT$","wb",stderr);
-
- return exit_code;
-}
-
-#else /* NOT __NETWARE__, NOT __WIN__ */
-
-/* This assumes full POSIX.1 compliance */
-int spawn(char *path, arg_list_t *al, int join, char *input,
- char *output, char *error)
-{
- int result = 0;
- pid_t pid;
-
- if ((pid = fork()))
- {
- /* Remains in parent process */
- if (join && (pid != -1))
- waitpid(pid, &result, 0);
- }
- else
- {
- /* Child process */
-
- /* Reassign streams */
- if (input)
- freopen(input, "r", stdin);
-
- if (output)
- freopen(output, "w", stdout);
-
- if (error)
- freopen(error, "w", stderr);
-
- /* Spawn the process */
- execve(path, al->argv, environ);
- }
-
- return result;
-}
-
-#endif /* __WIN__ */
-
-#endif /* __NETWARE__ */
-
/******************************************************************************
- stop_server()
-
- Stop the server with the given port and pid file.
+ stop_server()
+
+ Stop the server with the given port and pid file.
******************************************************************************/
int stop_server(char *bin_dir, char *user, char *password, int port,
char *pid_file)
{
- arg_list_t al;
- int err;
+ arg_list_t al;
+ int err, i, argc = 0;
+ char mysqladmin_file[PATH_MAX];
char trash[PATH_MAX];
- my_snprintf(trash, PATH_MAX, "/tmp/trash.out");
-
- /* args */
+ // mysqladmin file
+ snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir);
+ snprintf(trash, PATH_MAX, "/tmp/trash.out");
+
+ // args
init_args(&al);
- add_arg(&al, "%s", mysqladmin_file);
- add_arg(&al, "--no-defaults");
- add_arg(&al, "--port=%u", port);
- add_arg(&al, "--user=%s", user);
- add_arg(&al, "--password=%s", password);
- add_arg(&al, "-O");
- add_arg(&al, "shutdown_timeout=20");
- add_arg(&al, "shutdown");
-
- /* spawn */
- if ((err = spawn(mysqladmin_file, &al, TRUE, NULL,
- trash, NULL)) == 0)
- {
- sleep_until_file_deleted(pid_file);
- }
- else
- {
+ add_arg(&al, "%s", mysqladmin_file);
+ add_arg(&al, "--no-defaults");
+ add_arg(&al, "--port=%u", port);
+ add_arg(&al, "--user=%s", user);
+ add_arg(&al, "--password=%s", password);
+ add_arg(&al, "-O");
+ add_arg(&al, "shutdown_timeout=20");
+ add_arg(&al, "shutdown");
+
+ // spawn
+ if ((err = spawn(mysqladmin_file, &al, TRUE, NULL,
+ trash, NULL)) == 0)
+ {
+ sleep_until_file_deleted(pid_file);
+ }
+ else
+ {
pid_t pid = get_server_pid(pid_file);
+
+ // shutdown failed - kill server
+ kill_server(pid);
+
+ sleep(TRY_MAX);
- /* shutdown failed - kill server */
- kill_server(pid);
-
- sleep(TRY_MAX);
-
- /* remove pid file if possible */
- err = my_delete(pid_file, MYF(MY_WME));
+ // remove pid file if possible
+ err = remove(pid_file);
}
- /* free args */
+ // free args
free_args(&al);
- return err;
+ return err;
}
/******************************************************************************
- get_server_pid()
-
- Get the VM id with the given pid file.
+ get_server_pid()
+
+ Get the VM id with the given pid file.
******************************************************************************/
pid_t get_server_pid(char *pid_file)
{
- char buf[PATH_MAX];
- int err;
- File fd;
- char *p;
- pid_t id = 0;
-
- /* discover id */
- fd = my_open(pid_file, O_RDONLY, MYF(MY_WME));
-
- err = my_read(fd, buf, PATH_MAX, MYF(MY_WME));
-
- my_close(fd, MYF(MY_WME));
-
- if (err > 0)
- {
- /* terminate string */
- if ((p = strchr(buf, '\n')) != NULL)
- {
- *p = '\0';
-
- /* check for a '\r' */
- if ((p = strchr(buf, '\r')) != NULL)
- {
- *p = '\0';
- }
- }
- else
- {
- buf[err] = '\0';
- }
+ char buf[PATH_MAX];
+ int fd, err;
+ char *p;
+ pid_t id;
+
+ // discover id
+ fd = open(pid_file, O_RDONLY);
+
+ err = read(fd, buf, PATH_MAX);
+
+ close(fd);
+
+ if (err > 0)
+ {
+ // terminate string
+ if ((p = strchr(buf, '\n')) != NULL)
+ {
+ *p = NULL;
+
+ // check for a '\r'
+ if ((p = strchr(buf, '\r')) != NULL)
+ {
+ *p = NULL;
+ }
+ }
+ else
+ {
+ buf[err] = NULL;
+ }
+
+ id = strtol(buf, NULL, 0);
+ }
- id = strtol(buf, NULL, 0);
- }
-
return id;
}
+
/******************************************************************************
- kill_server()
-
- Force a kill of the server with the given pid.
+ kill_server()
+
+ Force a kill of the server with the given pid.
******************************************************************************/
void kill_server(pid_t pid)
{
if (pid > 0)
{
-
-#if !defined(__NETWARE__)
- /* Send SIGTERM to pid */
- kill(pid, SIGTERM);
-#else /* __NETWARE__ */
- /* destroy vm */
+ // destroy vm
NXVmDestroy(pid);
-
-#endif
-
}
}
/******************************************************************************
- del_tree()
-
- Delete the directory and subdirectories.
+ del_tree()
+
+ Delete the directory and subdirectories.
******************************************************************************/
void del_tree(char *dir)
{
- MY_DIR *current;
- uint i;
- char temp[PATH_MAX];
-
- current = my_dir(dir, MYF(MY_WME | MY_WANT_STAT));
-
- /* current is NULL if dir does not exist */
- if (current == NULL)
- return;
-
- for (i = 0; i < current->number_off_files; i++)
- {
- /* create long name */
- my_snprintf(temp, PATH_MAX, "%s/%s", dir, current->dir_entry[i].name);
-
- if (current->dir_entry[i].name[0] == '.')
- {
- /* Skip */
- }
- else if (MY_S_ISDIR(current->dir_entry[i].mystat.st_mode))
- {
- /* delete subdirectory */
- del_tree(temp);
- }
- else
- {
- /* remove file */
- my_delete(temp, MYF(MY_WME));
- }
- }
-
- my_dirend(current);
-
- /* remove directory */
- rmdir(dir);
+ DIR *parent = opendir(dir);
+ DIR *entry;
+ char temp[PATH_MAX];
+
+ if (parent == NULL)
+ {
+ return;
+ }
+
+ while((entry = readdir(parent)) != NULL)
+ {
+ // create long name
+ snprintf(temp, PATH_MAX, "%s/%s", dir, entry->d_name);
+
+ if (entry->d_name[0] == '.')
+ {
+ // Skip
+ }
+ else if (S_ISDIR(entry->d_type))
+ {
+ // delete subdirectory
+ del_tree(temp);
+ }
+ else
+ {
+ // remove file
+ remove(temp);
+ }
+ }
+
+ // remove directory
+ rmdir(dir);
}
/******************************************************************************
- removef()
-
+ removef()
+
******************************************************************************/
-int removef(const char *format, ...)
+int removef(char *format, ...)
{
- va_list ap;
+ va_list ap;
char path[PATH_MAX];
+
+ va_start(ap, format);
- va_start(ap, format);
-
- my_vsnprintf(path, PATH_MAX, format, ap);
+ vsnprintf(path, PATH_MAX, format, ap);
+
+ va_end(ap);
- va_end(ap);
-#ifdef __WIN__
- {
- MY_DIR *current;
- uint i;
- struct _finddata_t find;
- char temp[PATH_MAX];
-#ifdef _WIN64
- __int64 handle;
-#else
- long handle;
-#endif
- char *p;
-
- p= strrchr(path,'\\');
- if (p == NULL)
- {
- p= strrchr(path,'/');
- if (p == NULL)
- p= &path;
- else
- p++;
- }
- else
- p++;
-
- if ((handle=_findfirst(path,&find)) == -1L)
- return 0;
- do
- {
- strcpy(p,find.name);
- my_delete(path, MYF(MY_WME));
- } while (!_findnext(handle,&find));
- _findclose(handle);
- }
-#else
- return my_delete(path, MYF(MY_WME));
-#endif
+ return remove(path);
}
/******************************************************************************
- get_basedir()
-
+ get_basedir()
+
******************************************************************************/
void get_basedir(char *argv0, char *basedir)
{
- char temp[PATH_MAX];
- char *p;
-
- ASSERT(argv0 != NULL);
+ char temp[PATH_MAX];
+ char *p;
+
+ ASSERT(argv0 != NULL);
ASSERT(basedir != NULL);
- strcpy(temp, argv0);
-#ifndef __WIN__
- casedn_str(temp);
-#endif
- while((p = strchr(temp, '\\')) != NULL) *p = '/';
-
- if ((p = strstr(temp, "/bin/")) != NullS)
- {
- *p = '\0';
- strcpy(basedir, temp);
- }
+ strcpy(temp, strlwr(argv0));
+ while((p = strchr(temp, '\\')) != NULL) *p = '/';
+
+ if ((p = strindex(temp, "/bin/")) != NULL)
+ {
+ *p = NULL;
+ strcpy(basedir, temp);
+ }
}
diff --git a/netware/myisamchk.def b/netware/myisamchk.def
index 2222a1317e1..cdfe186058f 100644
--- a/netware/myisamchk.def
+++ b/netware/myisamchk.def
@@ -2,6 +2,7 @@
# MyISAM Check
#------------------------------------------------------------------------------
MODULE libc.nlm
+SCREENNAME "MySQL MyISAM Table Check Tool"
COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL MyISAM Table Check Tool"
VERSION 4, 0
diff --git a/netware/myisamlog.def b/netware/myisamlog.def
index bfa673e12be..5c4cbb23361 100644
--- a/netware/myisamlog.def
+++ b/netware/myisamlog.def
@@ -2,6 +2,7 @@
# MyISAM Log
#------------------------------------------------------------------------------
MODULE libc.nlm
+SCREENNAME "MySQL MyISAM Table Log Tool"
COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL MyISAM Table Log Tool"
VERSION 4, 0
diff --git a/netware/myisampack.def b/netware/myisampack.def
index 72403d2591e..9111538c2c0 100644
--- a/netware/myisampack.def
+++ b/netware/myisampack.def
@@ -2,6 +2,7 @@
# MyISAM Pack
#------------------------------------------------------------------------------
MODULE libc.nlm
+SCREENNAME "MySQL MyISAM Table Pack Tool"
COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL MyISAM Table Pack Tool"
VERSION 4, 0
diff --git a/netware/mysql_test_run.c b/netware/mysql_test_run.c
index fb914c355e4..e1a07baca6c 100644
--- a/netware/mysql_test_run.c
+++ b/netware/mysql_test_run.c
@@ -7,7 +7,7 @@
(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
+ 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.
@@ -16,29 +16,22 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
-/* MySQL library headers */
-#include <my_global.h>
-#include <my_sys.h>
-#include <my_dir.h>
-#include <m_string.h>
-
-/* These 'should' be POSIX or ANSI */
+#include <stdlib.h>
#include <stdio.h>
-#include <stdarg.h>
-
-#ifdef __NETWARE__
+#include <errno.h>
+#include <dirent.h>
+#include <string.h>
#include <screen.h>
-#endif
+#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"
-#ifdef __WIN__
-#include <Shlwapi.h>
-#endif
-
-
/******************************************************************************
macros
@@ -50,16 +43,16 @@
#define NW_TEST_SUFFIX ".nw-test"
#define NW_RESULT_SUFFIX ".nw-result"
-#define TEST_SUFFIX ".test"
-#define RESULT_SUFFIX ".result"
-#define REJECT_SUFFIX ".reject"
-#define OUT_SUFFIX ".out"
-#define ERR_SUFFIX ".err"
+#define TEST_SUFFIX ".test"
+#define RESULT_SUFFIX ".result"
+#define REJECT_SUFFIX ".reject"
+#define OUT_SUFFIX ".out"
+#define ERR_SUFFIX ".err"
-#define TEST_PASS "[ pass ]"
-#define TEST_SKIP "[ skip ]"
-#define TEST_FAIL "[ fail ]"
-#define TEST_BAD "[ bad ]"
+#define TEST_PASS "[ pass ]"
+#define TEST_SKIP "[ skip ]"
+#define TEST_FAIL "[ fail ]"
+#define TEST_BAD "[ bad ]"
/******************************************************************************
@@ -67,7 +60,7 @@
******************************************************************************/
-char base_dir[PATH_MAX] = "/mysql";
+char base_dir[PATH_MAX] = "sys:/mysql";
char db[PATH_MAX] = "test";
char user[PATH_MAX] = "root";
char password[PATH_MAX] = "";
@@ -75,7 +68,7 @@ char password[PATH_MAX] = "";
int master_port = 9306;
int slave_port = 9307;
-/* comma delimited list of tests to skip or empty string */
+// comma delimited list of tests to skip or empty string
char skip_test[PATH_MAX] = "";
char bin_dir[PATH_MAX];
@@ -88,6 +81,7 @@ char slave_dir[PATH_MAX];
char lang_dir[PATH_MAX];
char char_dir[PATH_MAX];
+char mysqladmin_file[PATH_MAX];
char mysqld_file[PATH_MAX];
char mysqltest_file[PATH_MAX];
char master_pid[PATH_MAX];
@@ -101,6 +95,13 @@ char slave_master_info[PATH_MAX] = "";
char master_init_script[PATH_MAX] = "";
char slave_init_script[PATH_MAX] = "";
+// OpenSSL
+char ca_cert[PATH_MAX];
+char server_cert[PATH_MAX];
+char server_key[PATH_MAX];
+char client_cert[PATH_MAX];
+char client_key[PATH_MAX];
+
int total_skip = 0;
int total_pass = 0;
int total_fail = 0;
@@ -108,6 +109,7 @@ int total_test = 0;
double total_time = 0;
+int use_openssl = FALSE;
int master_running = FALSE;
int slave_running = FALSE;
int skip_slave = TRUE;
@@ -116,30 +118,17 @@ int single_test = TRUE;
int restarts = 0;
FILE *log_fd = NULL;
-// WAX
-#include <my_getopt.h>
-
-const char* mysqld = "mysqld", *opt_exedir="client_debug";
-
-static struct my_option my_long_options[] =
-{
- {"mysqld", 'M', "Type of mysqld (without extention of file)- mysqld, mysql-nt, mysql-nt-max, mysqld-max.",
- (gptr*) &mysqld, (gptr*) &mysqld, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
- {"exefiledir", 'e', "Directory of .exe files (client_debug or client_release).", (gptr*) &opt_exedir,
- (gptr*) &opt_exedir, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-};
-
/******************************************************************************
functions
-
+
******************************************************************************/
/******************************************************************************
prototypes
-
+
******************************************************************************/
void report_stats();
@@ -155,17 +144,17 @@ void mysql_restart();
int read_option(char *, char *);
void run_test(char *);
void setup(char *);
-void vlog(const char *, va_list);
-void mtr_log(const char *, ...);
-void mtr_log_info(const char *, ...);
-void mtr_log_error(const char *, ...);
-void mtr_log_errno(const char *, ...);
-void die(const char *);
+void vlog(char *, va_list);
+void log(char *, ...);
+void log_info(char *, ...);
+void log_error(char *, ...);
+void log_errno(char *, ...);
+void die(char *);
/******************************************************************************
report_stats()
-
+
Report the gathered statistics.
******************************************************************************/
@@ -173,55 +162,55 @@ void report_stats()
{
if (total_fail == 0)
{
- mtr_log("\nAll %d test(s) were successful.\n", total_test);
+ log("\nAll %d test(s) were successful.\n", total_test);
}
else
{
double percent = ((double)total_pass / total_test) * 100;
-
- mtr_log("\nFailed %u/%u test(s), %.02f%% successful.\n",
+
+ log("\nFailed %u/%u test(s), %.02f%% successful.\n",
total_fail, total_test, percent);
- mtr_log("\nThe .out and .err files in %s may give you some\n", result_dir);
- mtr_log("hint of what when wrong.\n");
- mtr_log("\nIf you want to report this error, please first read the documentation\n");
- mtr_log("at: http://www.mysql.com/doc/M/y/MySQL_test_suite.html\n");
+ log("\nThe .out and .err files in %s may give you some\n", result_dir);
+ log("hint of what when wrong.\n");
+ log("\nIf you want to report this error, please first read the documentation\n");
+ log("at: http://www.mysql.com/doc/M/y/MySQL_test_suite.html\n");
}
- mtr_log("\n%.02f total minutes elapsed in the test cases\n\n", total_time / 60);
+ log("\n%.02f total minutes elapsed in the test cases\n\n", total_time / 60);
}
/******************************************************************************
install_db()
-
+
Install the a database.
******************************************************************************/
void install_db(char *datadir)
{
arg_list_t al;
- int err;
+ int err, i;
char input[PATH_MAX];
char output[PATH_MAX];
char error[PATH_MAX];
-
+
// input file
- my_snprintf(input, PATH_MAX, "%s/bin/init_db.sql", base_dir);
- my_snprintf(output, PATH_MAX, "%s/install.out", datadir);
- my_snprintf(error, PATH_MAX, "%s/install.err", datadir);
+ snprintf(input, PATH_MAX, "%s/bin/init_db.sql", base_dir);
+ snprintf(output, PATH_MAX, "%s/install.out", datadir);
+ snprintf(error, PATH_MAX, "%s/install.err", datadir);
// args
init_args(&al);
add_arg(&al, mysqld_file);
+ add_arg(&al, "--no-defaults");
add_arg(&al, "--bootstrap");
add_arg(&al, "--skip-grant-tables");
add_arg(&al, "--basedir=%s", base_dir);
add_arg(&al, "--datadir=%s", datadir);
add_arg(&al, "--skip-innodb");
add_arg(&al, "--skip-bdb");
-
- // spawn
+ // spawn
if ((err = spawn(mysqld_file, &al, TRUE, input, output, error)) != 0)
{
die("Unable to create database.");
@@ -242,34 +231,34 @@ void mysql_install_db()
{
char temp[PATH_MAX];
- /* var directory */
- my_snprintf(temp, PATH_MAX, "%s/var", mysql_test_dir);
+ // var directory
+ snprintf(temp, PATH_MAX, "%s/var", mysql_test_dir);
- /* clean up old directory */
+ // clean up old direcotry
del_tree(temp);
- /* create var directory */
- my_mkdir(temp, 0700, MYF(MY_WME));
-
- /* create subdirectories */
- my_snprintf(temp, PATH_MAX, "%s/var/run", mysql_test_dir);
- my_mkdir(temp, 0700, MYF(MY_WME));
- my_snprintf(temp, PATH_MAX, "%s/var/tmp", mysql_test_dir);
- my_mkdir(temp, 0700, MYF(MY_WME));
- my_snprintf(temp, PATH_MAX, "%s/var/master-data", mysql_test_dir);
- my_mkdir(temp, 0700, MYF(MY_WME));
- my_snprintf(temp, PATH_MAX, "%s/var/master-data/mysql", mysql_test_dir);
- my_mkdir(temp, 0700, MYF(MY_WME));
- my_snprintf(temp, PATH_MAX, "%s/var/master-data/test", mysql_test_dir);
- my_mkdir(temp, 0700, MYF(MY_WME));
- my_snprintf(temp, PATH_MAX, "%s/var/slave-data", mysql_test_dir);
- my_mkdir(temp, 0700, MYF(MY_WME));
- my_snprintf(temp, PATH_MAX, "%s/var/slave-data/mysql", mysql_test_dir);
- my_mkdir(temp, 0700, MYF(MY_WME));
- my_snprintf(temp, PATH_MAX, "%s/var/slave-data/test", mysql_test_dir);
- my_mkdir(temp, 0700, MYF(MY_WME));
-
- /* install databases */
+ // create var directory
+ mkdir(temp, S_IRWXU);
+
+ // create subdirectories
+ snprintf(temp, PATH_MAX, "%s/var/run", mysql_test_dir);
+ mkdir(temp, S_IRWXU);
+ snprintf(temp, PATH_MAX, "%s/var/tmp", mysql_test_dir);
+ mkdir(temp, S_IRWXU);
+ snprintf(temp, PATH_MAX, "%s/var/master-data", mysql_test_dir);
+ mkdir(temp, S_IRWXU);
+ snprintf(temp, PATH_MAX, "%s/var/master-data/mysql", mysql_test_dir);
+ mkdir(temp, S_IRWXU);
+ snprintf(temp, PATH_MAX, "%s/var/master-data/test", mysql_test_dir);
+ mkdir(temp, S_IRWXU);
+ snprintf(temp, PATH_MAX, "%s/var/slave-data", mysql_test_dir);
+ mkdir(temp, S_IRWXU);
+ snprintf(temp, PATH_MAX, "%s/var/slave-data/mysql", mysql_test_dir);
+ mkdir(temp, S_IRWXU);
+ snprintf(temp, PATH_MAX, "%s/var/slave-data/test", mysql_test_dir);
+ mkdir(temp, S_IRWXU);
+
+ // install databases
install_db(master_dir);
install_db(slave_dir);
}
@@ -284,39 +273,66 @@ void mysql_install_db()
void start_master()
{
arg_list_t al;
- int err;
+ int err, i;
char master_out[PATH_MAX];
char master_err[PATH_MAX];
-
- /* remove old berkeley db log files that can confuse the server */
+ char temp[PATH_MAX], temp2[PATH_MAX];
+
+ // remove old berkeley db log files that can confuse the server
removef("%s/log.*", master_dir);
- /* remove stale binary logs */
- removef("%s/*-bin.*", master_dir);
+ // remove stale binary logs
+ removef("%s/var/log/*-bin.*", mysql_test_dir);
- /* remove stale binary logs */
- removef("%s/*.index", master_dir);
+ // remove stale binary logs
+ removef("%s/var/log/*.index", mysql_test_dir);
- /* remove master.info file */
+ // remove master.info file
removef("%s/master.info", master_dir);
- /* remove relay files */
+ // remove relay files
removef("%s/var/log/*relay*", mysql_test_dir);
- /* remove relay-log.info file */
+ // remove relay-log.info file
removef("%s/relay-log.info", master_dir);
-
- /* redirection files */
- my_snprintf(master_out, PATH_MAX, "%s/var/run/master%u.out",
+
+ // init script
+ if (master_init_script[0] != NULL)
+ {
+ // run_init_script(master_init_script);
+
+ // TODO: use the scripts
+ if (strindex(master_init_script, "repair_part2-master.sh") != NULL)
+ {
+ FILE *fp;
+
+ // create an empty index file
+ snprintf(temp, PATH_MAX, "%s/test/t1.MYI", master_dir);
+ fp = fopen(temp, "wb+");
+
+ fputs("1", fp);
+
+ fclose(fp);
+ }
+
+ }
+
+ // redirection files
+ snprintf(master_out, PATH_MAX, "%s/var/run/master%u.out",
mysql_test_dir, restarts);
- my_snprintf(master_err, PATH_MAX, "%s/var/run/master%u.err",
+ snprintf(master_err, PATH_MAX, "%s/var/run/master%u.err",
mysql_test_dir, restarts);
-
- /* args */
+
+ snprintf(temp2,PATH_MAX,"%s/var",mysql_test_dir);
+ mkdir(temp2,0);
+ snprintf(temp2,PATH_MAX,"%s/var/log",mysql_test_dir);
+ mkdir(temp2,0);
+
+ // args
init_args(&al);
add_arg(&al, "%s", mysqld_file);
add_arg(&al, "--no-defaults");
- add_arg(&al, "--log-bin=master-bin");
+ add_arg(&al, "--log-bin=%s/var/log/master-bin",mysql_test_dir);
add_arg(&al, "--server-id=1");
add_arg(&al, "--basedir=%s", base_dir);
add_arg(&al, "--port=%u", master_port);
@@ -327,12 +343,19 @@ void start_master()
add_arg(&al, "--character-sets-dir=%s", char_dir);
add_arg(&al, "--tmpdir=%s", mysql_tmp_dir);
add_arg(&al, "--language=%s", lang_dir);
-
- /* $MASTER_40_ARGS */
+
+ if (use_openssl)
+ {
+ add_arg(&al, "--ssl-ca=%s", ca_cert);
+ add_arg(&al, "--ssl-cert=%s", server_cert);
+ add_arg(&al, "--ssl-key=%s", server_key);
+ }
+
+ // $MASTER_40_ARGS
add_arg(&al, "--rpl-recovery-rank=1");
add_arg(&al, "--init-rpl-role=master");
-
- /* $SMALL_SERVER */
+
+ // $SMALL_SERVER
add_arg(&al, "-O");
add_arg(&al, "key_buffer_size=1M");
add_arg(&al, "-O");
@@ -340,49 +363,51 @@ void start_master()
add_arg(&al, "-O");
add_arg(&al, "max_heap_table_size=1M");
- /* $EXTRA_MASTER_OPT */
- if (master_opt[0] != '\0')
+ // $EXTRA_MASTER_OPT
+ if (master_opt[0] != NULL)
{
char *p;
+ char *temp;
p = (char *)strtok(master_opt, " \t");
- while(p)
+ if ((temp = strstr(p, "timezone")) == NULL)
{
- add_arg(&al, "%s", p);
-
- p = (char *)strtok(NULL, " \t");
+ while(p)
+ {
+ add_arg(&al, "%s", p);
+ p = (char *)strtok(NULL, " \t");
+ }
+ }
+ else
+ {
+ //do nothing
}
}
-
- /* remove the pid file if it exists */
-#ifndef __WIN__
- my_delete(master_pid, MYF(MY_WME));
-#else
- pid_mode= MASTER_PID;
- run_server= TRUE;
-#endif
-
- /* spawn */
+
+ // remove the pid file if it exists
+ remove(master_pid);
+
+ // spawn
if ((err = spawn(mysqld_file, &al, FALSE, NULL, master_out, master_err)) == 0)
{
sleep_until_file_exists(master_pid);
-
- if ((err = wait_for_server_start(bin_dir, user, password, master_port)) == 0)
+
+ if ((err = wait_for_server_start(bin_dir, user, password, master_port)) == 0)
{
master_running = TRUE;
}
else
{
- mtr_log_error("The master server went down early.");
+ log_error("The master server went down early.");
}
}
else
{
- mtr_log_error("Unable to start master server.");
+ log_error("Unable to start master server.");
}
-
- /* free_args */
+
+ // free_args
free_args(&al);
}
@@ -396,48 +421,48 @@ void start_master()
void start_slave()
{
arg_list_t al;
- int err;
+ int err, i;
char slave_out[PATH_MAX];
char slave_err[PATH_MAX];
char temp[PATH_MAX];
- /* skip? */
+ // skip?
if (skip_slave) return;
- /* remove stale binary logs */
+ // remove stale binary logs
removef("%s/*-bin.*", slave_dir);
- /* remove stale binary logs */
+ // remove stale binary logs
removef("%s/*.index", slave_dir);
- /* remove master.info file */
+ // remove master.info file
removef("%s/master.info", slave_dir);
- /* remove relay files */
+ // remove relay files
removef("%s/var/log/*relay*", mysql_test_dir);
- /* remove relay-log.info file */
+ // remove relay-log.info file
removef("%s/relay-log.info", slave_dir);
- /* init script */
- if (slave_init_script[0] != '\0')
+ // init script
+ if (slave_init_script[0] != NULL)
{
- /* run_init_script(slave_init_script); */
+ // run_init_script(slave_init_script);
- /* TODO: use the scripts */
- if (strstr(slave_init_script, "rpl000016-slave.sh") != NULL)
+ // TODO: use the scripts
+ if (strindex(slave_init_script, "rpl000016-slave.sh") != NULL)
{
- /* create empty master.info file */
- my_snprintf(temp, PATH_MAX, "%s/master.info", slave_dir);
- my_close(my_open(temp, O_WRONLY | O_CREAT, MYF(0)), MYF(0));
+ // create empty master.info file
+ snprintf(temp, PATH_MAX, "%s/master.info", slave_dir);
+ close(open(temp, O_WRONLY | O_CREAT,S_IRWXU|S_IRWXG|S_IRWXO));
}
- else if (strstr(slave_init_script, "rpl000017-slave.sh") != NullS)
+ else if (strindex(slave_init_script, "rpl000017-slave.sh") != NULL)
{
FILE *fp;
- /* create a master.info file */
- my_snprintf(temp, PATH_MAX, "%s/master.info", slave_dir);
- fp = my_fopen(temp, (int)(O_WRONLY | O_BINARY | O_CREAT), MYF(MY_WME));
+ // create a master.info file
+ snprintf(temp, PATH_MAX, "%s/master.info", slave_dir);
+ fp = fopen(temp, "wb+");
fputs("master-bin.001\n", fp);
fputs("4\n", fp);
@@ -448,20 +473,20 @@ void start_slave()
fputs("1\n", fp);
fputs("0\n", fp);
- my_fclose(fp, MYF(MY_WME));
+ fclose(fp);
}
- else if (strstr(slave_init_script, "rpl_rotate_logs-slave.sh") != NullS)
+ else if (strindex(slave_init_script, "rpl_rotate_logs-slave.sh") != NULL)
{
- /* create empty master.info file */
- my_snprintf(temp, PATH_MAX, "%s/master.info", slave_dir);
- my_close(my_open(temp, O_WRONLY | O_CREAT, MYF(0)), MYF(0));
+ // create empty master.info file
+ snprintf(temp, PATH_MAX, "%s/master.info", slave_dir);
+ close(open(temp, O_WRONLY | O_CREAT,S_IRWXU|S_IRWXG|S_IRWXO));
}
}
- /* redirection files */
- my_snprintf(slave_out, PATH_MAX, "%s/var/run/slave%u.out",
+ // redirection files
+ snprintf(slave_out, PATH_MAX, "%s/var/run/slave%u.out",
mysql_test_dir, restarts);
- my_snprintf(slave_err, PATH_MAX, "%s/var/run/slave%u.err",
+ snprintf(slave_err, PATH_MAX, "%s/var/run/slave%u.err",
mysql_test_dir, restarts);
// args
@@ -478,7 +503,7 @@ void start_slave()
add_arg(&al, "--core");
add_arg(&al, "--tmpdir=%s", mysql_tmp_dir);
add_arg(&al, "--language=%s", lang_dir);
-
+
add_arg(&al, "--exit-info=256");
add_arg(&al, "--log-slave-updates");
add_arg(&al, "--init-rpl-role=slave");
@@ -487,15 +512,22 @@ void start_slave()
add_arg(&al, "--slave-load-tmpdir=../../var/tmp");
add_arg(&al, "--report-user=%s", user);
- add_arg(&al, "--report-host=127.0.0.1");
+ add_arg(&al, "--report-host=127.0.0.1");
add_arg(&al, "--report-port=%u", slave_port);
add_arg(&al, "--master-retry-count=10");
add_arg(&al, "-O");
add_arg(&al, "slave_net_timeout=10");
- /* slave master info */
- if (slave_master_info[0] != '\0')
+ if (use_openssl)
+ {
+ add_arg(&al, "--ssl-ca=%s", ca_cert);
+ add_arg(&al, "--ssl-cert=%s", server_cert);
+ add_arg(&al, "--ssl-key=%s", server_key);
+ }
+
+ // slave master info
+ if (slave_master_info[0] != NULL)
{
char *p;
@@ -519,7 +551,7 @@ void start_slave()
add_arg(&al, "--rpl-recovery-rank=2");
}
- /* small server */
+ // small server
add_arg(&al, "-O");
add_arg(&al, "key_buffer_size=1M");
add_arg(&al, "-O");
@@ -527,8 +559,8 @@ void start_slave()
add_arg(&al, "-O");
add_arg(&al, "max_heap_table_size=1M");
- /* opt args */
- if (slave_opt[0] != '\0')
+ // opt args
+ if (slave_opt[0] != NULL)
{
char *p;
@@ -541,14 +573,9 @@ void start_slave()
p = (char *)strtok(NULL, " \t");
}
}
-
- /* remove the pid file if it exists */
-#ifndef __WIN__
- my_delete(slave_pid, MYF(MY_WME));
-#else
- pid_mode= SLAVE_PID;
- run_server= TRUE;
-#endif
+
+ // remove the pid file if it exists
+ remove(slave_pid);
// spawn
if ((err = spawn(mysqld_file, &al, FALSE, NULL, slave_out, slave_err)) == 0)
@@ -561,12 +588,12 @@ void start_slave()
}
else
{
- mtr_log_error("The slave server went down early.");
+ log_error("The slave server went down early.");
}
}
else
{
- mtr_log_error("Unable to start slave server.");
+ log_error("Unable to start slave server.");
}
// free args
@@ -582,99 +609,91 @@ void start_slave()
******************************************************************************/
void mysql_start()
{
+ log_info("Starting the MySQL server(s): %u", ++restarts);
start_master();
start_slave();
-
-#ifdef __NETWARE__
+
// activate the test screen
ActivateScreen(getscreenhandle());
-#endif
}
/******************************************************************************
stop_slave()
-
+
Stop the slave server.
******************************************************************************/
void stop_slave()
{
int err;
-
- /* running? */
+
+ // running?
if (!slave_running) return;
-#ifdef __WIN__
- pid_mode= SLAVE_PID;
-#endif
-
- /* stop */
+
+ // stop
if ((err = stop_server(bin_dir, user, password, slave_port, slave_pid)) == 0)
{
slave_running = FALSE;
}
else
{
- mtr_log_error("Unable to stop slave server.");
+ log_error("Unable to stop slave server.");
}
}
/******************************************************************************
stop_master()
-
+
Stop the master server.
******************************************************************************/
void stop_master()
{
int err;
-
- /* running? */
+
+ // running?
if (!master_running) return;
-#ifdef __WIN__
- pid_mode= MASTER_PID;
-#endif
+
if ((err = stop_server(bin_dir, user, password, master_port, master_pid)) == 0)
{
master_running = FALSE;
}
else
{
- mtr_log_error("Unable to stop master server.");
+ log_error("Unable to stop master server.");
}
}
/******************************************************************************
mysql_stop()
-
+
Stop the mysql servers.
******************************************************************************/
void mysql_stop()
{
+ log_info("Stopping the MySQL server(s)...");
stop_master();
stop_slave();
-
-#ifdef __NETWARE__
+
// activate the test screen
ActivateScreen(getscreenhandle());
-#endif
}
/******************************************************************************
mysql_restart()
-
+
Restart the mysql servers.
******************************************************************************/
void mysql_restart()
{
- mtr_log_info("Restarting the MySQL server(s): %u", ++restarts);
mysql_stop();
@@ -684,56 +703,51 @@ void mysql_restart()
/******************************************************************************
read_option()
-
+
Read the option file.
******************************************************************************/
int read_option(char *opt_file, char *opt)
{
- File fd;
- int err;
+ int fd, err;
+ int result;
char *p;
char buf[PATH_MAX];
-
- /* copy current option */
+
+ // copy current option
strncpy(buf, opt, PATH_MAX);
-
-#ifdef __WIN__
- if (PathFileExistsA(opt_file))
- {
-#endif
- /* open options file */
- fd = my_open(opt_file, O_RDONLY, MYF(MY_WME));
+ // open options file
+ fd = open(opt_file, O_RDONLY);
- err = my_read(fd, opt, PATH_MAX, MYF(MY_WME));
+ err = read(fd, opt, PATH_MAX);
- my_close(fd, MYF(MY_WME));
+ close(fd);
if (err > 0)
{
- /* terminate string */
+ // terminate string
if ((p = strchr(opt, '\n')) != NULL)
{
- *p = '\0';
+ *p = NULL;
- /* check for a '\r' */
+ // check for a '\r'
if ((p = strchr(opt, '\r')) != NULL)
{
- *p = '\0';
+ *p = NULL;
}
}
else
{
- opt[err] = '\0';
+ opt[err] = NULL;
}
- /* check for $MYSQL_TEST_DIR */
- if ((p = strstr(opt, "$MYSQL_TEST_DIR")) != NullS)
+ // check for $MYSQL_TEST_DIR
+ if ((p = strstr(opt, "$MYSQL_TEST_DIR")) != NULL)
{
char temp[PATH_MAX];
- *p = '\0';
+ *p = NULL;
strcpy(temp, p + strlen("$MYSQL_TEST_DIR"));
@@ -744,14 +758,11 @@ int read_option(char *opt_file, char *opt)
}
else
{
- /* clear option */
- *opt = '\0';
- }
-#ifdef __WIN__
+ // clear option
+ *opt = NULL;
}
-#endif
- /* compare current option with previous */
+ // compare current option with previous
return strcmp(opt, buf);
}
@@ -766,20 +777,21 @@ void run_test(char *test)
{
char temp[PATH_MAX];
char *rstr;
+ double elapsed = 0;
int skip = FALSE;
int restart = FALSE;
int flag = FALSE;
struct stat info;
-
- /* single test? */
+
+ // single test?
if (!single_test)
{
// skip tests in the skip list
- my_snprintf(temp, PATH_MAX, " %s ", test);
- skip = strinstr(skip_test, temp);
+ snprintf(temp, PATH_MAX, " %s ", test);
+ skip = (strindex(skip_test, temp) != NULL);
}
- /* skip test? */
+ // skip test?
if (!skip)
{
char test_file[PATH_MAX];
@@ -792,6 +804,7 @@ void run_test(char *test)
char err_file[PATH_MAX];
int err;
arg_list_t al;
+ NXTime_t start, stop;
// skip slave?
flag = skip_slave;
@@ -799,36 +812,41 @@ void run_test(char *test)
if (flag != skip_slave) restart = TRUE;
// create files
- my_snprintf(master_opt_file, PATH_MAX, "%s/%s-master.opt", test_dir, test);
- my_snprintf(slave_opt_file, PATH_MAX, "%s/%s-slave.opt", test_dir, test);
- my_snprintf(slave_master_info_file, PATH_MAX, "%s/%s.slave-mi", test_dir, test);
- my_snprintf(reject_file, PATH_MAX, "%s/%s%s", result_dir, test, REJECT_SUFFIX);
- my_snprintf(out_file, PATH_MAX, "%s/%s%s", result_dir, test, OUT_SUFFIX);
- my_snprintf(err_file, PATH_MAX, "%s/%s%s", result_dir, test, ERR_SUFFIX);
+ snprintf(master_opt_file, PATH_MAX, "%s/%s-master.opt", test_dir, test);
+ snprintf(slave_opt_file, PATH_MAX, "%s/%s-slave.opt", test_dir, test);
+ snprintf(slave_master_info_file, PATH_MAX, "%s/%s.slave-mi", test_dir, test);
+ snprintf(reject_file, PATH_MAX, "%s/%s%s", result_dir, test, REJECT_SUFFIX);
+ snprintf(out_file, PATH_MAX, "%s/%s%s", result_dir, test, OUT_SUFFIX);
+ snprintf(err_file, PATH_MAX, "%s/%s%s", result_dir, test, ERR_SUFFIX);
// netware specific files
- my_snprintf(test_file, PATH_MAX, "%s/%s%s", test_dir, test, NW_TEST_SUFFIX);
+ snprintf(test_file, PATH_MAX, "%s/%s%s", test_dir, test, NW_TEST_SUFFIX);
if (stat(test_file, &info))
{
- my_snprintf(test_file, PATH_MAX, "%s/%s%s", test_dir, test, TEST_SUFFIX);
+ snprintf(test_file, PATH_MAX, "%s/%s%s", test_dir, test, TEST_SUFFIX);
+ if(access(test_file,0))
+ {
+ printf("Invalid test name %s, %s file not found\n",test,test_file);
+ return;
+ }
}
-
- my_snprintf(result_file, PATH_MAX, "%s/%s%s", result_dir, test, NW_RESULT_SUFFIX);
+
+ snprintf(result_file, PATH_MAX, "%s/%s%s", result_dir, test, NW_RESULT_SUFFIX);
if (stat(result_file, &info))
{
- my_snprintf(result_file, PATH_MAX, "%s/%s%s", result_dir, test, RESULT_SUFFIX);
+ snprintf(result_file, PATH_MAX, "%s/%s%s", result_dir, test, RESULT_SUFFIX);
}
-
+
// init scripts
- my_snprintf(master_init_script, PATH_MAX, "%s/%s-master.sh", test_dir, test);
+ snprintf(master_init_script, PATH_MAX, "%s/%s-master.sh", test_dir, test);
if (stat(master_init_script, &info))
- master_init_script[0] = '\0';
+ master_init_script[0] = NULL;
else
restart = TRUE;
- my_snprintf(slave_init_script, PATH_MAX, "%s/%s-slave.sh", test_dir, test);
+ snprintf(slave_init_script, PATH_MAX, "%s/%s-slave.sh", test_dir, test);
if (stat(slave_init_script, &info))
- slave_init_script[0] = '\0';
+ slave_init_script[0] = NULL;
else
restart = TRUE;
@@ -850,7 +868,7 @@ void run_test(char *test)
sleep(1);
// show test
- mtr_log("%-46s ", test);
+ log("%-46s ", test);
// args
init_args(&al);
@@ -866,17 +884,34 @@ void run_test(char *test)
add_arg(&al, "-v");
add_arg(&al, "-R");
add_arg(&al, "%s", result_file);
+
+ if (use_openssl)
+ {
+ add_arg(&al, "--ssl-ca=%s", ca_cert);
+ add_arg(&al, "--ssl-cert=%s", client_cert);
+ add_arg(&al, "--ssl-key=%s", client_key);
+ }
+
+ // start timer
+ NXGetTime(NX_SINCE_BOOT, NX_USECONDS, &start);
// spawn
err = spawn(mysqltest_file, &al, TRUE, test_file, out_file, err_file);
-
+
+ // stop timer
+ NXGetTime(NX_SINCE_BOOT, NX_USECONDS, &stop);
+
+ // calculate
+ elapsed = ((double)(stop - start)) / NX_USECONDS;
+ total_time += elapsed;
+
// free args
free_args(&al);
if (err == 0)
{
// pass
- rstr = (char *)TEST_PASS;
+ rstr = TEST_PASS;
++total_pass;
// increment total
@@ -885,13 +920,13 @@ void run_test(char *test)
else if (err == 2)
{
// skip
- rstr = (char *)TEST_SKIP;
+ rstr = TEST_SKIP;
++total_skip;
}
else if (err == 1)
{
// fail
- rstr = (char *)TEST_FAIL;
+ rstr = TEST_FAIL;
++total_fail;
// increment total
@@ -899,21 +934,21 @@ void run_test(char *test)
}
else
{
- rstr = (char *)TEST_BAD;
+ rstr = TEST_BAD;
}
}
else // early skips
{
// show test
- mtr_log("%-46s ", test);
+ log("%-46s ", test);
// skip
- rstr = (char *)TEST_SKIP;
+ rstr = TEST_SKIP;
++total_skip;
}
// result
- mtr_log(" %-14s\n", rstr);
+ log("%10.06f %-14s\n", elapsed, rstr);
}
/******************************************************************************
@@ -923,7 +958,7 @@ void run_test(char *test)
Log the message.
******************************************************************************/
-void vlog(const char *format, va_list ap)
+void vlog(char *format, va_list ap)
{
vfprintf(stdout, format, ap);
fflush(stdout);
@@ -937,15 +972,15 @@ void vlog(const char *format, va_list ap)
/******************************************************************************
- mtr_log()
+ log()
Log the message.
******************************************************************************/
-void mtr_log(const char *format, ...)
+void log(char *format, ...)
{
va_list ap;
-
+
va_start(ap, format);
vlog(format, ap);
@@ -955,60 +990,60 @@ void mtr_log(const char *format, ...)
/******************************************************************************
- mtr_log_info()
+ log_info()
Log the given information.
******************************************************************************/
-void mtr_log_info(const char *format, ...)
+void log_info(char *format, ...)
{
va_list ap;
va_start(ap, format);
- mtr_log("-- INFO : ");
+ log("-- INFO : ");
vlog(format, ap);
- mtr_log("\n");
+ log("\n");
va_end(ap);
}
/******************************************************************************
- mtr_log_error()
+ log_error()
Log the given error.
******************************************************************************/
-void mtr_log_error(const char *format, ...)
+void log_error(char *format, ...)
{
va_list ap;
va_start(ap, format);
- mtr_log("-- ERROR: ");
+ log("-- ERROR: ");
vlog(format, ap);
- mtr_log("\n");
+ log("\n");
va_end(ap);
}
/******************************************************************************
- mtr_log_errno()
+ log_errno()
Log the given error and errno.
******************************************************************************/
-void mtr_log_errno(const char *format, ...)
+void log_errno(char *format, ...)
{
va_list ap;
va_start(ap, format);
- mtr_log("-- ERROR: (%003u) ", errno);
+ log("-- ERROR: (%003u) ", errno);
vlog(format, ap);
- mtr_log("\n");
+ log("\n");
va_end(ap);
}
@@ -1020,13 +1055,11 @@ void mtr_log_errno(const char *format, ...)
Exit the application.
******************************************************************************/
-void die(const char *msg)
+void die(char *msg)
{
- mtr_log_error(msg);
+ log_error(msg);
-#ifdef __NETWARE__
pressanykey();
-#endif
exit(-1);
}
@@ -1041,86 +1074,71 @@ void die(const char *msg)
void setup(char *file)
{
char temp[PATH_MAX];
+ char mysqldump_load[PATH_MAX*2],mysqlbinlog_load[PATH_MAX*2];
+
char *p;
-
+
// set the timezone for the timestamp test
-#ifdef __WIN__
- _putenv( "TZ=GMT-3" );
-#else
setenv("TZ", "GMT-3", TRUE);
-#endif
// find base dir
- strcpy(temp, file);
-#ifndef __WIN__
- casedn_str(temp);
-#endif
+ strcpy(temp, strlwr(file));
while((p = strchr(temp, '\\')) != NULL) *p = '/';
- if ((p = strstr(temp, "/mysql-test/")))
+ if ((p = strindex(temp, "/mysql-test/")) != NULL)
{
- *p = '\0';
- strcpy(base_dir, (const char *)temp);
+ *p = NULL;
+ strcpy(base_dir, temp);
}
-
+
// setup paths
-#ifdef __WIN__
- my_snprintf(bin_dir, PATH_MAX, "%s/%s", base_dir,opt_exedir);
-#else
- my_snprintf(bin_dir, PATH_MAX, "%s/bin", base_dir);
-#endif
- my_snprintf(mysql_test_dir, PATH_MAX, "%s/mysql-test", base_dir);
- my_snprintf(test_dir, PATH_MAX, "%s/t", mysql_test_dir);
- my_snprintf(mysql_tmp_dir, PATH_MAX, "%s/var/tmp", mysql_test_dir);
- my_snprintf(result_dir, PATH_MAX, "%s/r", mysql_test_dir);
- my_snprintf(master_dir, PATH_MAX, "%s/var/master-data", mysql_test_dir);
- my_snprintf(slave_dir, PATH_MAX, "%s/var/slave-data", mysql_test_dir);
- my_snprintf(lang_dir, PATH_MAX, "%s/share/english", base_dir);
- my_snprintf(char_dir, PATH_MAX, "%s/share/charsets", base_dir);
-
+ snprintf(bin_dir, PATH_MAX, "%s/bin", base_dir);
+ snprintf(mysql_test_dir, PATH_MAX, "%s/mysql-test", base_dir);
+ snprintf(test_dir, PATH_MAX, "%s/t", mysql_test_dir);
+ snprintf(mysql_tmp_dir, PATH_MAX, "%s/var/tmp", mysql_test_dir);
+ snprintf(result_dir, PATH_MAX, "%s/r", mysql_test_dir);
+ snprintf(master_dir, PATH_MAX, "%s/var/master-data", mysql_test_dir);
+ snprintf(slave_dir, PATH_MAX, "%s/var/slave-data", mysql_test_dir);
+ snprintf(lang_dir, PATH_MAX, "%s/share/english", base_dir);
+ snprintf(char_dir, PATH_MAX, "%s/share/charsets", base_dir);
+
+#ifdef HAVE_OPENSSL
+ use_openssl = TRUE;
+#endif // HAVE_OPENSSL
+
+ // OpenSSL paths
+ snprintf(ca_cert, PATH_MAX, "%s/SSL/cacert.pem", base_dir);
+ snprintf(server_cert, PATH_MAX, "%s/SSL/server-cert.pem", base_dir);
+ snprintf(server_key, PATH_MAX, "%s/SSL/server-key.pem", base_dir);
+ snprintf(client_cert, PATH_MAX, "%s/SSL/client-cert.pem", base_dir);
+ snprintf(client_key, PATH_MAX, "%s/SSL/client-key.pem", base_dir);
+
// setup files
-#ifdef __WIN__
- my_snprintf(mysqld_file, PATH_MAX, "%s/%s.exe", bin_dir, mysqld);
- my_snprintf(mysqltest_file, PATH_MAX, "%s/mysqltest.exe", bin_dir);
- my_snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin.exe", bin_dir);
- pid_mode= NOT_NEED_PID;
-#else
- my_snprintf(mysqld_file, PATH_MAX, "%s/mysqld", bin_dir);
- my_snprintf(mysqltest_file, PATH_MAX, "%s/mysqltest", bin_dir);
- my_snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir);
-#endif
- my_snprintf(master_pid, PATH_MAX, "%s/var/run/master.pid", mysql_test_dir);
- my_snprintf(slave_pid, PATH_MAX, "%s/var/run/slave.pid", mysql_test_dir);
+ snprintf(mysqld_file, PATH_MAX, "%s/mysqld", bin_dir);
+ snprintf(mysqltest_file, PATH_MAX, "%s/mysqltest", bin_dir);
+ snprintf(mysqladmin_file, PATH_MAX, "%s/mysqladmin", bin_dir);
+ snprintf(master_pid, PATH_MAX, "%s/var/run/master.pid", mysql_test_dir);
+ snprintf(slave_pid, PATH_MAX, "%s/var/run/slave.pid", mysql_test_dir);
// create log file
- my_snprintf(temp, PATH_MAX, "%s/mysql-test-run.log", mysql_test_dir);
+ snprintf(temp, PATH_MAX, "%s/mysql-test-run.log", mysql_test_dir);
if ((log_fd = fopen(temp, "w+")) == NULL)
{
- mtr_log_errno("Unable to create log file.");
+ log_errno("Unable to create log file.");
}
-
+
// prepare skip test list
while((p = strchr(skip_test, ',')) != NULL) *p = ' ';
- strcpy(temp, skip_test);
-#ifndef __WIN__
- casedn_str(temp);
-#endif
- my_snprintf(skip_test, PATH_MAX, " %s ", temp);
-
- // enviornment
-#ifdef __WIN__
- my_snprintf(temp, PATH_MAX, "MYSQL_TEST_DIR=%s", mysql_test_dir);
- _putenv(temp);
-#else
- setenv("MYSQL_TEST_DIR", mysql_test_dir, 1);
-#endif
-}
-
-static my_bool
-get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
- char *argument)
-{
- return(0);
+ strcpy(temp, strlwr(skip_test));
+ snprintf(skip_test, PATH_MAX, " %s ", temp);
+
+ snprintf(mysqlbinlog_load,PATH_MAX*2,"%s/mysqlbinlog --no-defaults --local-load=%s",bin_dir,mysql_tmp_dir);
+ snprintf(mysqldump_load,PATH_MAX*2,"%s/mysqldump --no-defaults -uroot --port=%d",bin_dir,master_port);
+ // environment
+ setenv("MYSQL_TEST_DIR", mysql_test_dir, 1);
+ setenv("MYSQL_DUMP", mysqldump_load, 1);
+ setenv("MYSQL_BINLOG", mysqlbinlog_load, 1);
+ setenv("MASTER_MYPORT", "9306", 1);
}
/******************************************************************************
@@ -1130,59 +1148,31 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
******************************************************************************/
int main(int argc, char **argv)
{
- int i;
- uint ui;
-
-
-#ifdef __WIN__
- int ho_error;
- DWORD len= PATH_MAX;
- char current_dir[PATH_MAX] = ".";
-
- if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
- exit(1);
- if (len= GetCurrentDirectory(&len,current_dir))
- {
- current_dir[len]= '\\';
- current_dir[len+1]='\0';
- };
- MY_INIT(current_dir);
-#endif
// setup
-#ifdef __WIN__
- setup(current_dir);
-#else
setup(argv[0]);
-#endif
+
// header
- mtr_log("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE);
+ log("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE);
- mtr_log("Initializing Tests...\n");
+ log("Initializing Tests...\n");
// install test databases
mysql_install_db();
- mtr_log("Starting Tests...\n");
+ log("Starting Tests...\n");
- mtr_log("\n");
- mtr_log(HEADER);
- mtr_log(DASH);
+ log("\n");
+ log(HEADER);
+ log(DASH);
-#ifdef __WIN__
- if (argc > 0)
-#else
if (argc > 1)
-#endif
{
+ int i;
// single test
- single_test = TRUE;
+ single_test = TRUE;
-#ifdef __WIN__
- for (i = 0; i < argc; i++)
-#else
for (i = 1; i < argc; i++)
-#endif
{
// run given test
run_test(argv[i]);
@@ -1191,7 +1181,8 @@ int main(int argc, char **argv)
else
{
// run all tests
- MY_DIR *dir = my_dir(test_dir, MYF(MY_WME | MY_WANT_STAT));
+ DIR *dir = opendir(test_dir);
+ DIR *entry;
char test[NAME_MAX];
char *p;
@@ -1203,16 +1194,14 @@ int main(int argc, char **argv)
die("Unable to open tests directory.");
}
- for (ui = 0; ui < dir->number_off_files; ui++)
+ while((entry = readdir(dir)) != NULL)
{
- if (!MY_S_ISDIR(dir->dir_entry[ui].mystat.st_mode))
+ if (!S_ISDIR(entry->d_type))
{
- strcpy(test, dir->dir_entry[ui].name);
-#ifndef __WIN__
- casedn_str(test);
-#endif
+ strcpy(test, strlwr(entry->d_name));
+
// find the test suffix
- if ((p = strstr(test, TEST_SUFFIX)))
+ if ((p = strindex(test, TEST_SUFFIX)) != NULL)
{
// null terminate at the suffix
*p = '\0';
@@ -1222,28 +1211,26 @@ int main(int argc, char **argv)
}
}
}
-
- my_dirend(dir);
+
+ closedir(dir);
}
-
- mtr_log(DASH);
- mtr_log("\n");
-
- mtr_log("Ending Tests...\n");
// stop server
mysql_stop();
+ log(DASH);
+ log("\n");
+
+ log("Ending Tests...\n");
+
// report stats
report_stats();
-
+
// close log
if (log_fd) fclose(log_fd);
-
-#ifdef __NETWARE__
+
// keep results up
pressanykey();
-#endif
return 0;
}
diff --git a/netware/mysqlbinlog.def b/netware/mysqlbinlog.def
index 74d8e168b00..89677b4a353 100644
--- a/netware/mysqlbinlog.def
+++ b/netware/mysqlbinlog.def
@@ -2,6 +2,7 @@
# MySQL Binary Log
#------------------------------------------------------------------------------
MODULE libc.nlm
+SCREENNAME "MySQL Binary Log Dump Tool"
COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Binary Log Dump Tool"
VERSION 4, 0
diff --git a/netware/mysqlcheck.def b/netware/mysqlcheck.def
index 6e476556ffe..8820e9aae8e 100644
--- a/netware/mysqlcheck.def
+++ b/netware/mysqlcheck.def
@@ -2,6 +2,7 @@
# MySQL Client
#------------------------------------------------------------------------------
MODULE libc.nlm
+SCREENNAME "MySQL Check Tool"
COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Check Tool"
VERSION 4, 0
diff --git a/netware/mysqld_safe.c b/netware/mysqld_safe.c
index 845797e0022..a815497ac0f 100644
--- a/netware/mysqld_safe.c
+++ b/netware/mysqld_safe.c
@@ -456,10 +456,10 @@ void check_data_vol()
// retrieve information
netware_vol_info_from_name(&vol, buff);
-
+
if ((vol.flags & VOL_NSS_PRESENT) == 0)
{
- log("Error: The data directory is not on an NSS volume!\n\n");
+ log("Error: Either the data directory does not exist or is not on an NSS volume!\n\n");
exit(-1);
}
}
diff --git a/netware/mysqldump.def b/netware/mysqldump.def
index f267b60ff77..901c9b262dc 100644
--- a/netware/mysqldump.def
+++ b/netware/mysqldump.def
@@ -2,6 +2,7 @@
# MySQL Admin
#------------------------------------------------------------------------------
MODULE libc.nlm
+SCREENNAME "MySQL Dump Tool"
COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Dump Tool"
VERSION 4, 0
diff --git a/netware/mysqlimport.def b/netware/mysqlimport.def
index 69e9f6eada5..d6f7fcb6bbd 100644
--- a/netware/mysqlimport.def
+++ b/netware/mysqlimport.def
@@ -2,6 +2,7 @@
# MySQL Client
#------------------------------------------------------------------------------
MODULE libc.nlm
+SCREENNAME "MySQL Import"
COPYRIGHT "(c) 2003 Novell, Inc. Portions (c) 2003 MySQL AB. All Rights Reserved."
DESCRIPTION "MySQL Import Tool"
VERSION 4, 0
diff --git a/pstack/bucomm.h b/pstack/bucomm.h
index 7712a70f5a2..6b3633d8d63 100644
--- a/pstack/bucomm.h
+++ b/pstack/bucomm.h
@@ -50,6 +50,12 @@ void *alloca ();
# endif /* HAVE_ALLOCA_H */
#endif
+#ifndef BFD_TRUE_FALSE
+#define boolean bfd_boolean
+#define true TRUE
+#define false FALSE
+#endif
+
/* bucomm.c */
void bfd_nonfatal PARAMS ((CONST char *));
diff --git a/pstack/budbg.h b/pstack/budbg.h
index d8ee8895e76..9f0203ad5e7 100644
--- a/pstack/budbg.h
+++ b/pstack/budbg.h
@@ -24,6 +24,12 @@
#include <stdio.h>
+#ifndef BFD_TRUE_FALSE
+#define boolean bfd_boolean
+#define true TRUE
+#define false FALSE
+#endif
+
/* Routine used to read generic debugging information. */
extern PTR read_debugging_info PARAMS ((bfd *, asymbol **, long));
diff --git a/pstack/pstack.c b/pstack/pstack.c
index 48280d4aedb..75869686e35 100644
--- a/pstack/pstack.c
+++ b/pstack/pstack.c
@@ -2667,7 +2667,8 @@ pstack_install_segv_action( const char* path_format_)
if ((abfd = load_bfd(pid))==0)
fprintf(stderr, "BFD load failed..\n");
else {
- long storage_needed = bfd_get_symtab_upper_bound (abfd);
+ long storage_needed= (bfd_get_file_flags(abfd) & HAS_SYMS) ?
+ bfd_get_symtab_upper_bound (abfd) : 0;
long i;
(void)i;
diff --git a/regex/regcomp.c b/regex/regcomp.c
index 6af99456c28..b939429e16e 100644
--- a/regex/regcomp.c
+++ b/regex/regcomp.c
@@ -36,18 +36,18 @@ struct parse {
static char nuls[10]; /* place to point scanner in event of error */
struct cclass cclasses[CCLASS_LAST+1]= {
- { "alnum", "","", _U | _L | _NMR},
- { "alpha", "","", _U | _L },
- { "blank", "","", _B },
- { "cntrl", "","", _CTR },
- { "digit", "","", _NMR },
- { "graph", "","", _PNT | _U | _L | _NMR},
- { "lower", "","", _L },
- { "print", "","", _PNT | _U | _L | _NMR | _B },
- { "punct", "","", _PNT },
- { "space", "","", _SPC },
- { "upper", "","", _U },
- { "xdigit", "","", _X },
+ { "alnum", "","", _MY_U | _MY_L | _MY_NMR},
+ { "alpha", "","", _MY_U | _MY_L },
+ { "blank", "","", _MY_B },
+ { "cntrl", "","", _MY_CTR },
+ { "digit", "","", _MY_NMR },
+ { "graph", "","", _MY_PNT | _MY_U | _MY_L | _MY_NMR},
+ { "lower", "","", _MY_L },
+ { "print", "","", _MY_PNT | _MY_U | _MY_L | _MY_NMR | _MY_B },
+ { "punct", "","", _MY_PNT },
+ { "space", "","", _MY_SPC },
+ { "upper", "","", _MY_U },
+ { "xdigit", "","", _MY_X },
{ NULL,NULL,NULL, 0 }
};
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 037adc64d39..d4da77d0387 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -34,11 +34,13 @@ bin_SCRIPTS = @server_scripts@ \
mysql_tableinfo \
mysqld_multi \
make_win_src_distribution \
+ make_win_binary_distribution \
mysql_create_system_tables
EXTRA_SCRIPTS = make_binary_distribution.sh \
make_sharedlib_distribution.sh \
make_win_src_distribution.sh \
+ make_win_binary_distribution.sh \
msql2mysql.sh \
mysql_config.sh \
mysql_fix_privilege_tables.sh \
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index 9510eef5469..c7cd56b3430 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -117,6 +117,7 @@ BIN_FILES="extra/comp_err$BS extra/replace$BS extra/perror$BS \
extra/resolve_stack_dump$BS extra/mysql_waitpid$BS \
isam/isamchk$BS isam/pack_isam$BS \
myisam/myisamchk$BS myisam/myisampack$BS myisam/myisamlog$BS \
+ myisam/myisam_ftdump$BS \
sql/mysqld$BS \
client/mysql$BS client/mysqlshow$BS client/mysqladmin$BS \
client/mysqldump$BS client/mysqlimport$BS \
@@ -208,7 +209,7 @@ if [ $BASE_SYSTEM != "netware" ] ; then
fi
$CP support-files/* $BASE/support-files
-$CP scripts/fill_help_tables.sql $BASE/support-files
+$CP scripts/*.sql $BASE/share
if [ $BASE_SYSTEM = "netware" ] ; then
rm -f $BASE/support-files/magic \
@@ -246,6 +247,7 @@ if [ $BASE_SYSTEM != "netware" ] ; then
chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/support-files/mysql.server $BASE/configure
$CP -r sql-bench/* $BASE/sql-bench
rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la
+ rm -f $BASE/bin/*.sql
fi
rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh
diff --git a/scripts/make_win_binary_distribution.sh b/scripts/make_win_binary_distribution.sh
new file mode 100644
index 00000000000..e5893c1eb1e
--- /dev/null
+++ b/scripts/make_win_binary_distribution.sh
@@ -0,0 +1,178 @@
+#!/bin/sh
+
+#
+# Script to create a Windows binary package
+#
+# This is intended to be used under Cygwin, and will generate
+# an archive named in the form mysql<suffix>-<version>-noinstall.zip
+
+version=@VERSION@
+
+DEBUG=0
+SUFFIX=""
+DIRNAME=""
+EXTRA=""
+
+#
+# This script must run from MySQL top directory
+#
+
+if [ ! -f scripts/make_win_binary_distribution ]; then
+ echo "ERROR : You must run this script from the MySQL top-level directory"
+ exit 1
+fi
+
+#
+# Debug print of the status
+#
+
+print_debug()
+{
+ for statement
+ do
+ if [ "$DEBUG" = "1" ] ; then
+ echo $statement
+ fi
+ done
+}
+
+#
+# Usage of the script
+#
+
+show_usage()
+{
+ echo "MySQL utility script to create a Windows binary package"
+ echo ""
+ echo "This is intended to be used under Cygwin, and will generate"
+ echo "an archive named in the form mysql<suffix>-<version>-noinstall.zip"
+ echo "Takes the following arguments:"
+ echo ""
+ echo " --dirname Directory to use for copying files"
+ echo " --extra Directory to get extra files from"
+ echo " --suffix Name to append to 'mysql' for this binary"
+ echo " --help Show this help message"
+ exit 0
+}
+
+#
+# Parse the input arguments
+#
+
+parse_arguments() {
+ for arg do
+ case "$arg" in
+ --debug) DEBUG=1;;
+ --extra=*) EXTRA=`echo "$arg" | sed -e "s;--extra=;;"` ;;
+ --suffix=*) SUFFIX=`echo "$arg" | sed -e "s;--suffix=;;"` ;;
+ --dirname=*) DIRNAME=`echo "$arg" | sed -e "s;--dirname=;;"` ;;
+ --help) show_usage ;;
+ *)
+ echo "Unknown argument '$arg'"
+ exit 1
+ ;;
+ esac
+ done
+}
+
+parse_arguments "$@"
+
+if [ -z "$DIRNAME" ]; then
+ $DIRNAME="dist"
+fi
+
+print_debug "Making directories"
+mkdir $DIRNAME
+$DIRNAME="$DIRNAME/mysql-$version"
+mkdir $DIRNAME
+
+for dir in bin lib lib/opt lib/debug Embedded Embedded/DLL Embedded/DLL/debug Embedded/DLL/release Embedded/static Embedded/static/release examples examples/libmysqltest
+do
+ mkdir $DIRNAME/$dir
+done
+
+if [ $EXTRA ]; then
+ print_debug "Copying extra files"
+ cp -fr $EXTRA/* $DIRNAME
+fi
+
+# Dirs to be copied as-is
+for dir in data Docs include scripts share
+do
+ print_debug "Copying $dir to $DIRNAME/"
+ cp -fr $dir $DIRNAME
+done
+
+print_debug "Copying tests to $DIRNAME/examples/"
+cp -fr tests $DIRNAME/examples
+
+print_debug "Copying sql-bench to $DIRNAME/bench"
+mkdir $DIRNAME/bench
+cp -fr sql-bench/* $DIRNAME/bench
+
+# Files for bin
+for i in client_release/* client_debug/mysqld.exe lib_release/libmySQL.dll
+do
+ print_debug "Copying $i to $DIRNAME/bin"
+ cp $i $DIRNAME/bin
+done
+
+# Files for include
+for i in libmysql/libmysql.def libmysqld/libmysqld.def
+do
+ print_debug "Copying $i to $DIRNAME/include"
+ cp $i $DIRNAME/include
+done
+
+# Windows users are used to having dbug.h
+cp include/my_dbug.h $DIRNAME/include/dbug.h
+
+# Libraries found in lib_release and lib_debug
+for i in libmySQL.dll libmysql.lib zlib.lib mysqlclient.lib mysys.lib regex.lib strings.lib
+do
+ print_debug "Copying lib_release/$i to $DIRNAME/lib/opt"
+ cp lib_release/$i $DIRNAME/lib/opt
+ print_debug "Copying lib_debug/$i to $DIRNAME/lib/debug"
+ cp lib_debug/$i $DIRNAME/lib/debug
+done
+
+print_debug "Copying lib_release/mysys-max.lib to $DIRNAME/lib/opt"
+cp lib_release/mysys-max.lib $DIRNAME/lib/opt
+
+# Embedded server
+for i in libmysqld.dll libmysqld.lib libmysqld.exp
+do
+ print_debug "Copying lib_release/$i to $DIRNAME/Embedded/DLL/release"
+ cp lib_release/$i $DIRNAME/Embedded/DLL/release
+ print_debug "Copying lib_debug/$i to $DIRNAME/Embedded/DLL/debug"
+ cp lib_debug/$i $DIRNAME/Embedded/DLL/debug
+done
+
+# Static embedded
+print_debug "Copying lib_release/mysqlserver.lib to $DIRNAME/Embedded/static/release"
+cp lib_release/mysqlserver.lib $DIRNAME/Embedded/static/release
+
+# libmysqltest
+for i in mytest.c mytest.dsp mytest.dsw mytest.exe
+do
+ print_debug "Copying libmysqltest/release/$i to $DIRNAME/examples/libmysqltest"
+ cp libmysqltest/release/$i $DIRNAME/examples/libmysqltest
+done
+
+print_debug "Copying README.txt"
+cp README.txt $DIRNAME
+
+if [ -f MySQLEULA.txt ]; then
+ print_debug "Commercial version: copying MySQLEULA.txt"
+ cp MySQLEULA.txt $DIRNAME
+ rm $DIRNAME/Docs/COPYING
+else
+ print_debug "GPL version: copying COPYING"
+ cp Docs/COPYING $DIRNAME
+fi
+
+print_debug "Invoking zip to package the binary"
+zip -r mysql$SUFFIX-$version-win-noinstall.zip $DIRNAME
+
+print_debug "Deleting intermediate directory"
+rm -rf $DIRNAME
diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh
index 051f3fa9c14..aa7af1cb2c6 100644
--- a/scripts/mysql_config.sh
+++ b/scripts/mysql_config.sh
@@ -84,20 +84,25 @@ port='@MYSQL_TCP_PORT@'
ldflags='@LDFLAGS@'
client_libs='@CLIENT_LIBS@'
-# Create options, without end space
+# Create options
libs="$ldflags -L$pkglibdir -lmysqlclient $client_libs"
libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @LIBS@ @openssl_libs@"
libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
-cflags="-I$pkgincludedir @CFLAGS@"
+cflags="-I$pkgincludedir @CFLAGS@ " #note: end space!
include="-I$pkgincludedir"
embedded_libs="$ldflags -L$pkglibdir -lmysqld @LIBS@ @WRAPLIBS@ @innodb_system_libs@"
embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'`
# Remove some options that a client doesn't have to care about
-
-cflags=`echo "$cflags " | sed -e 's;\(-DDBUG_OFF\|-DSAFEMALLOC\|-USAFEMALLOC\|-DSAFE_MUTEX\|-DPEDANTIC_SAFEMALLOC\|-DUNIV_MUST_NOT_INLINE\|-DFORCE_INIT_OF_VARS\|-DEXTRA_DEBUG\|-DHAVE_purify\|-O[0-9]\|-W[-A-Za-z]*\) *;;g' | sed -e 's; *\$;;'`
+for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \
+ DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \
+ DEXTRA_DEBUG DHAVE_purify 'O[0-9]' 'W[-A-Za-z]*'
+do
+ cflags=`echo "$cflags"|sed -e "s/-$remove *//g"`
+done
+cflags=`echo "$cflags"|sed -e 's/ *\$//'`
usage () {
cat <<EOF
diff --git a/scripts/mysql_create_system_tables.sh b/scripts/mysql_create_system_tables.sh
index 06999b81ca1..287e1cf11dc 100644
--- a/scripts/mysql_create_system_tables.sh
+++ b/scripts/mysql_create_system_tables.sh
@@ -189,7 +189,7 @@ then
c_t="$c_t Host char(60) binary DEFAULT '' NOT NULL,"
c_t="$c_t Db char(64) binary DEFAULT '' NOT NULL,"
c_t="$c_t User char(16) binary DEFAULT '' NOT NULL,"
- c_t="$c_t Table_name char(60) binary DEFAULT '' NOT NULL,"
+ c_t="$c_t Table_name char(64) binary DEFAULT '' NOT NULL,"
c_t="$c_t Grantor char(77) DEFAULT '' NOT NULL,"
c_t="$c_t Timestamp timestamp(14),"
c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL,"
diff --git a/scripts/mysql_fix_privilege_tables.sh b/scripts/mysql_fix_privilege_tables.sh
index bf7f082203d..69bf2bebaa8 100644
--- a/scripts/mysql_fix_privilege_tables.sh
+++ b/scripts/mysql_fix_privilege_tables.sh
@@ -10,6 +10,10 @@ sql_only=0
basedir=""
verbose=0
args=""
+port=""
+socket=""
+database="mysql"
+bindir=""
file=mysql_fix_privilege_tables.sql
@@ -34,6 +38,10 @@ parse_arguments() {
--host=*) host=`echo "$arg" | sed -e 's/^[^=]*=//'` ;;
--sql|--sql-only) sql_only=1;;
--verbose) verbose=1 ;;
+ --port=*) port=`echo "$arg" | sed -e "s;--port=;;"` ;;
+ --socket=*) socket=`echo "$arg" | sed -e "s;--socket=;;"` ;;
+ --database=*) database=`echo "$arg" | sed -e "s;--database=;;"` ;;
+ --bindir=*) bindir=`echo "$arg" | sed -e "s;--bindir=;;"` ;;
*)
if test -n "$pick_args"
then
@@ -48,21 +56,15 @@ parse_arguments() {
# Get first arguments from the my.cfg file, groups [mysqld] and
# [mysql_install_db], and then merge with the command line arguments
-if test -x ./bin/my_print_defaults
-then
- print_defaults="./bin/my_print_defaults"
-elif test -x @bindr@/my_print_defaults
-then
- print_defaults="@bindir@/my_print_defaults"
-elif test -x @bindir@/mysql_print_defaults
-then
- print_defaults="@bindir@/mysql_print_defaults"
-elif test -x extra/my_print_defaults
-then
- print_defaults="extra/my_print_defaults"
-else
- print_defaults="my_print_defaults"
-fi
+
+for dir in ./bin @bindir@ @bindir@ extra $bindir/../bin $bindir/../extra
+do
+ if test -x $dir/my_print_defaults
+ then
+ print_defaults="$dir/my_print_defaults"
+ break
+ fi
+done
parse_arguments `$print_defaults $defaults mysql_install_db mysql_fix_privilege_tables`
parse_arguments PICK-ARGS-FROM-ARGV "$@"
@@ -70,11 +72,17 @@ parse_arguments PICK-ARGS-FROM-ARGV "$@"
if test -z "$basedir"
then
basedir=@prefix@
- bindir=@bindir@
+ if test -z "$bindir"
+ then
+ bindir=@bindir@
+ fi
execdir=@libexecdir@
pkgdatadir=@pkgdatadir@
else
- bindir="$basedir/bin"
+ if test -z "$bindir"
+ then
+ bindir="$basedir/bin"
+ fi
if test -x "$basedir/libexec/mysqld"
then
execdir="$basedir/libexec"
@@ -93,11 +101,18 @@ then
password=`echo $args | sed -e 's/ *//g'`
fi
+cmd="$bindir/mysql -f --user=$user --host=$host"
if test -z "$password" ; then
- cmd="$bindir/mysql -f --user=$user --host=$host mysql"
-else
- cmd="$bindir/mysql -f --user=$user --password=$password --host=$host mysql"
+ cmd="$cmd --password=$password"
+fi
+if test ! -z "$port"; then
+ cmd="$cmd --port=$port"
fi
+if test ! -z "$socket"; then
+ cmd="$cmd --socket=$socket"
+fi
+cmd="$cmd --database=$database"
+
if test $sql_only = 1
then
cmd="cat"
diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql
index e64bf59353f..0feab0ac7d0 100644
--- a/scripts/mysql_fix_privilege_tables.sql
+++ b/scripts/mysql_fix_privilege_tables.sql
@@ -7,19 +7,18 @@
-- On unix, you should use the mysql_fix_privilege_tables script to execute
-- this sql script.
--- On windows you should do 'mysql --force < mysql_fix_privilege_tables.sql'
+-- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql'
-USE mysql;
ALTER TABLE user type=MyISAM;
ALTER TABLE db type=MyISAM;
ALTER TABLE host type=MyISAM;
ALTER TABLE func type=MyISAM;
ALTER TABLE columns_priv type=MyISAM;
ALTER TABLE tables_priv type=MyISAM;
-ALTER TABLE user change Password Password char(41) not null;
+ALTER TABLE user change Password Password char(41) binary not null;
ALTER TABLE user add File_priv enum('N','Y') NOT NULL;
CREATE TABLE IF NOT EXISTS func (
- name char(64) DEFAULT '' NOT NULL,
+ name char(64) binary DEFAULT '' NOT NULL,
ret tinyint(1) DEFAULT '0' NOT NULL,
dl char(128) DEFAULT '' NOT NULL,
type enum ('function','aggregate') NOT NULL,
@@ -39,6 +38,10 @@ UPDATE user SET Grant_priv=File_priv,References_priv=Create_priv,Index_priv=Crea
UPDATE db SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0;
UPDATE host SET References_priv=Create_priv,Index_priv=Create_priv,Alter_priv=Create_priv WHERE @hadGrantPriv = 0;
+--
+-- The second alter changes ssl_type to new 4.0.2 format
+-- Adding columns needed by GRANT .. REQUIRE (openssl)"
+
ALTER TABLE user
ADD ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL,
ADD ssl_cipher BLOB NOT NULL,
@@ -46,11 +49,15 @@ ADD x509_issuer BLOB NOT NULL,
ADD x509_subject BLOB NOT NULL;
ALTER TABLE user MODIFY ssl_type enum('','ANY','X509', 'SPECIFIED') NOT NULL;
+--
+-- Create tables_priv and columns_priv if they don't exists
+--
+
CREATE TABLE IF NOT EXISTS tables_priv (
- Host char(60) DEFAULT '' NOT NULL,
- Db char(60) DEFAULT '' NOT NULL,
- User char(16) DEFAULT '' NOT NULL,
- Table_name char(60) DEFAULT '' NOT NULL,
+ Host char(60) binary DEFAULT '' NOT NULL,
+ Db char(64) binary DEFAULT '' NOT NULL,
+ User char(16) binary DEFAULT '' NOT NULL,
+ Table_name char(64) binary DEFAULT '' NOT NULL,
Grantor char(77) DEFAULT '' NOT NULL,
Timestamp timestamp(14),
Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') DEFAULT '' NOT NULL,
@@ -69,16 +76,29 @@ CREATE TABLE IF NOT EXISTS columns_priv (
PRIMARY KEY (Host,Db,User,Table_name,Column_name)
);
+
+--
+-- Name change of Type -> Column_priv from MySQL 3.22.12
+--
+
ALTER TABLE columns_priv change Type Column_priv set('Select','Insert','Update','References') DEFAULT '' NOT NULL;
+--
+-- Add the new 'type' column to the func table.
+--
+
ALTER TABLE func add type enum ('function','aggregate') NOT NULL;
+--
+-- Change the user,db and host tables to MySQL 4.0 format
+--
+
# Detect whether we had Show_db_priv
SET @hadShowDbPriv:=0;
SELECT @hadShowDbPriv:=1 FROM user WHERE Show_db_priv LIKE '%';
ALTER TABLE user
-ADD Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER alter_priv,
+ADD Show_db_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Alter_priv,
ADD Super_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Show_db_priv,
ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Super_priv,
ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Create_tmp_table_priv,
@@ -86,13 +106,24 @@ ADD Execute_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Lock_tables_priv,
ADD Repl_slave_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Execute_priv,
ADD Repl_client_priv enum('N','Y') DEFAULT 'N' NOT NULL AFTER Repl_slave_priv;
-UPDATE user SET show_db_priv= select_priv, super_priv=process_priv, execute_priv=process_priv, create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=file_priv where user<>"" AND @hadShowDbPriv = 0;
+-- Convert privileges so that users have similar privileges as before
+
+UPDATE user SET Show_db_priv= Select_priv, Super_priv=Process_priv, Execute_priv=Process_priv, Create_tmp_table_priv='Y', Lock_tables_priv='Y', Repl_slave_priv=file_priv, Repl_client_priv=File_priv where user<>"" AND @hadShowDbPriv = 0;
+
+
+-- Add fields that can be used to limit number of questions and connections
+-- for some users.
ALTER TABLE user
ADD max_questions int(11) NOT NULL AFTER x509_subject,
ADD max_updates int(11) unsigned NOT NULL AFTER max_questions,
ADD max_connections int(11) unsigned NOT NULL AFTER max_updates;
+
+--
+-- Add Create_tmp_table_priv and Lock_tables_priv to db and host
+--
+
ALTER TABLE db
ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,
ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL;
@@ -100,6 +131,20 @@ ALTER TABLE host
ADD Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL,
ADD Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL;
+alter table db change Db Db char(64) binary DEFAULT '' NOT NULL;
+alter table host change Db Db char(64) binary DEFAULT '' NOT NULL;
+alter table user change max_questions max_questions int(11) unsigned DEFAULT 0 NOT NULL;
+alter table tables_priv change Db Db char(64) binary DEFAULT '' NOT NULL, change Host Host char(60) binary DEFAULT '' NOT NULL, change User User char(16) binary DEFAULT '' NOT NULL, change Table_name Table_name char(64) binary DEFAULT '' NOT NULL;
+alter table tables_priv add KEY Grantor (Grantor);
+alter table columns_priv change Db Db char(64) binary DEFAULT '' NOT NULL, change Host Host char(60) binary DEFAULT '' NOT NULL, change User User char(16) binary DEFAULT '' NOT NULL, change Table_name Table_name char(64) binary DEFAULT '' NOT NULL, change Column_name Column_name char(64) binary DEFAULT '' NOT NULL;
+
+alter table db comment='Database privileges';
+alter table host comment='Host privileges; Merged with database privileges';
+alter table user comment='Users and global privileges';
+alter table func comment='User defined functions';
+alter table tables_priv comment='Table privileges';
+alter table columns_priv comment='Column privileges';
+
#
# Create some possible missing tables
#
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index fcb1f2a4ef1..1861e8c52f8 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -151,7 +151,7 @@ then
if [ $? -ne 0 ]
then
resolved=`$bindir/resolveip localhost 2>&1`
- if [ $? -eq 0 ]
+ if [ $? -ne 0 ]
then
echo "Neither host '$hostname' and 'localhost' could not be looked up with"
echo "$bindir/resolveip"
@@ -219,7 +219,7 @@ then
if test "$windows" -eq 0
then
echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !"
- echo "This is done with:"
+ echo "To do so, start the server, then issue the following commands:"
echo "$bindir/mysqladmin -u root password 'new-password'"
echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'"
echo "See the manual for more instructions."
diff --git a/scripts/mysql_zap.sh b/scripts/mysql_zap.sh
index f485d164282..89823c1373b 100644
--- a/scripts/mysql_zap.sh
+++ b/scripts/mysql_zap.sh
@@ -111,10 +111,10 @@ Usage: $0 [-signal] [-?Ift] [--help] pattern
Options: -I or -? "info" -f "force" -t "test".
Version 1.0
-Kill processes with matches pattern.
+Kill processes that match the pattern.
If -f isn't given, ask user for confirmation for each process to kill.
-If signal isn't given, try first with signal 15 and after that with signal 9.
-If -t is given the processes is only shown on stdout.
+If signal isn't given, try first with signal 15, then with signal 9.
+If -t is given, the processes are only shown on stdout.
EOF
exit(1);
}
diff --git a/scripts/mysqlaccess.sh b/scripts/mysqlaccess.sh
index 75ef63ecdd0..9fd1f63f67a 100644
--- a/scripts/mysqlaccess.sh
+++ b/scripts/mysqlaccess.sh
@@ -414,7 +414,6 @@ _HOWTO
use Getopt::Long;
use Sys::Hostname;
use IPC::Open3;
-#use CGI; #moved to use of CGI by monty
# ****************************
@@ -527,7 +526,7 @@ if ($MySQLaccess::CMD) { #command-line version
}
}
if ($MySQLaccess::CGI) { #CGI-version
- use CGI;
+ require CGI;
$Q = new CGI;
$Param{'help'} = $Q->param('help') ;
$Param{'host'} = $Q->param('host') || $Q->param('h') || $Param{'host'};
diff --git a/scripts/mysqlbug.sh b/scripts/mysqlbug.sh
index 49ac08d0013..6aed140b79d 100644
--- a/scripts/mysqlbug.sh
+++ b/scripts/mysqlbug.sh
@@ -254,9 +254,9 @@ eval $EDIT $TEMP
if cmp -s $TEMP $TEMP.x
then
echo "File not changed, no bug report submitted."
- cp $TEMP /tmp/failed-mysql-bugreport
+ mv -f $TEMP /tmp/failed-mysql-bugreport
echo "The raw bug report exists in /tmp/failed-mysql-bugreport"
- echo "If you use this remember that the first lines of the report now is a lie.."
+ echo "If you use this remember that the first lines of the report are now a lie.."
exit 1
fi
diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh
index 3165a01362c..a4f2b18fda8 100644
--- a/scripts/mysqld_multi.sh
+++ b/scripts/mysqld_multi.sh
@@ -4,12 +4,12 @@ use Getopt::Long;
use POSIX qw(strftime);
$|=1;
-$VER="2.5";
+$VER="2.6";
$opt_config_file = undef();
$opt_example = 0;
$opt_help = 0;
-$opt_log = "/tmp/mysqld_multi.log";
+$opt_log = "";
$opt_mysqladmin = "@bindir@/mysqladmin";
$opt_mysqld = "@libexecdir@/mysqld";
$opt_no_log = 0;
@@ -18,6 +18,9 @@ $opt_tcp_ip = 0;
$opt_user = "root";
$opt_version = 0;
+my $my_print_defaults_exists= 1;
+my $logdir= undef();
+
my ($mysqld, $mysqladmin, $groupids, $homedir, $my_progname);
$homedir = $ENV{HOME};
@@ -42,7 +45,9 @@ sub main
print "Please make sure you have this command available and\n";
print "in your path. The command is available from the latest\n";
print "MySQL distribution.\n";
+ $my_print_defaults_exists= 0;
}
+ init_log();
my @defops = `my_print_defaults mysqld_multi`;
chop @defops;
splice @ARGV, 0, 0, @defops;
@@ -113,6 +118,56 @@ sub main
}
####
+#### Init log file. Check for appropriate place for log file, in the following
+#### order my_print_defaults mysqld datadir, @datadir@, /var/log, /tmp
+####
+
+sub init_log
+{
+ if ($my_print_defaults_exists)
+ {
+ @mysqld_opts= `my_print_defaults mysqld`;
+ chomp @mysqld_opts;
+ foreach my $opt (@mysqld_opts)
+ {
+ if ($opt =~ m/^\-\-datadir[=](.*)/)
+ {
+ if (-d "$1" && -w "$1")
+ {
+ $logdir= $1;
+ }
+ }
+ }
+ }
+ if (!defined($logdir))
+ {
+ $logdir= "@datadir@" if (-d "@datadir@" && -w "@datadir@");
+ }
+ if (!defined($logdir))
+ {
+ $logdir= "/var/log" if (-d "/var/log" && -w "/var/log");
+ }
+ if (!defined($logdir))
+ {
+ if (-d "/tmp" && -w "/tmp" && ! -e "/tmp/mysqld_multi.log")
+ {
+ $logdir= "/tmp";
+ }
+ }
+ if (!defined($logdir))
+ {
+ # We still couldn't get a default log file in place. Log file
+ # will be disabled unless user sets it with an option
+
+ $opt_no_log= 1;
+ }
+ else
+ {
+ $opt_log= "$logdir/mysqld_multi.log";
+ }
+}
+
+####
#### Report living and not running MySQL servers
####
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index ece4ba098f4..0f415ccd5f0 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -46,8 +46,9 @@ parse_arguments() {
--user=*)
if test $SET_USER -eq 0
then
- user=`echo "$arg" | sed -e "s;--[^=]*=;;"` ; SET_USER=1
+ user=`echo "$arg" | sed -e "s;--[^=]*=;;"`
fi
+ SET_USER=1
;;
# these two might have been set in a [mysqld_safe] section of my.cnf
@@ -114,7 +115,6 @@ else
ledir=@libexecdir@
fi
-safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}}
user=@MYSQLD_USER@
niceness=0
@@ -129,7 +129,6 @@ fi
# these rely on $DATADIR by default, so we'll set them later on
pid_file=
err_log=
-SET_USER=0
# Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe]
# and then merge with the command line arguments
@@ -147,8 +146,15 @@ else
fi
args=
-parse_arguments `$print_defaults --loose-verbose $defaults mysqld server mysqld_safe safe_mysqld`
+SET_USER=2
+parse_arguments `$print_defaults --loose-verbose $defaults mysqld server`
+if test $SET_USER -eq 2
+then
+ SET_USER=0
+fi
+parse_arguments `$print_defaults --loose-verbose $defaults mysqld_safe safe_mysqld`
parse_arguments PICK-ARGS-FROM-ARGV "$@"
+safe_mysql_unix_port=${mysql_unix_port:-${MYSQL_UNIX_PORT:-@MYSQL_UNIX_ADDR@}}
if test ! -x $ledir/$MYSQLD
then
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh
index 654e5466e12..ab06215c3ac 100644
--- a/scripts/mysqlhotcopy.sh
+++ b/scripts/mysqlhotcopy.sh
@@ -37,7 +37,7 @@ WARNING: THIS PROGRAM IS STILL IN BETA. Comments/patches welcome.
# Documentation continued at end of file
-my $VERSION = "1.20";
+my $VERSION = "1.21";
my $opt_tmpdir = $ENV{TMPDIR} || "/tmp";
@@ -73,6 +73,7 @@ Usage: $0 db_name[./table_regex/] [new_db_name | directory]
--resetslave reset the master.info once all tables are locked
--tmpdir=# temporary directory (instead of $opt_tmpdir)
--record_log_pos=# record slave and master status in specified db.table
+ --chroot=# base directory of chroot jail in which mysqld operates
Try \'perldoc $0 for more complete documentation\'
_OPTIONS
@@ -117,6 +118,7 @@ GetOptions( \%opt,
"resetslave",
"tmpdir|t=s",
"dryrun|n",
+ "chroot=s",
) or usage("Invalid option");
# @db_desc
@@ -210,6 +212,7 @@ while ( my ($var,$value) = $sth_vars->fetchrow_array ) {
}
my $datadir = $mysqld_vars{'datadir'}
|| die "datadir not in mysqld variables";
+ $datadir= $opt{chroot}.$datadir if ($opt{chroot});
$datadir =~ s:/$::;
diff --git a/sql-bench/crash-me.sh b/sql-bench/crash-me.sh
index 00989fc0bc8..be24e015553 100644
--- a/sql-bench/crash-me.sh
+++ b/sql-bench/crash-me.sh
@@ -407,7 +407,7 @@ if ($dbh->do("create table crash_q (a integer, b integer,c1 CHAR(10))") &&
["with constraint and restrict/cascade",
"alter table crash_q drop constraint u1 restrict"],
["with drop key",
- "alter table crash_q drop key c1"]);
+ "alter table crash_q drop key u1"]);
try_and_report("Alter table add primary key",'alter_add_primary_key',
["with constraint",
"alter table crash_q1 add constraint p1 primary key(c1)"],
diff --git a/sql-bench/limits/mysql-4.0.cfg b/sql-bench/limits/mysql-4.0.cfg
new file mode 100644
index 00000000000..feaa79e43e9
--- /dev/null
+++ b/sql-bench/limits/mysql-4.0.cfg
@@ -0,0 +1,7050 @@
+#This file is automaticly generated by crash-me 1.61
+
+NEG=yes # update of column= -column
+ ###< create table crash_q (a integer)
+ ###> OK
+ ###< insert into crash_q values(10)
+ ###> OK
+ ###< update crash_q set a=-a
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+Need_cast_for_null=no # Need to cast NULL for arithmetic
+ ### Check if numeric_null (NULL) is 'NULL'
+alter_add_col=yes # Alter table add column
+ ###< alter table crash_q add d integer
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+alter_add_constraint=yes # Alter table add constraint
+ ###< alter table crash_q add constraint c2 check(a > b)
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+alter_add_foreign_key=no # Alter table add foreign key
+ ###< alter table crash_q add constraint f1 foreign key(c1)
+ ###> execute error: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
+ ###< references crash_q1(c1)
+ ###> execute error: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 'references crash_q1(c1)' at line 1
+ ###
+ ###As far as some queries didnt return OK, result is NO
+alter_add_multi_col=yes # Alter table add many columns
+ ###< alter table crash_q add (f integer,g integer)
+ ###> OK
+alter_add_primary_key=with constraint # Alter table add primary key
+ ###< alter table crash_q1 add constraint p1 primary key(c1)
+ ###> OK
+alter_add_unique=yes # Alter table add unique
+ ###< alter table crash_q add constraint u1 unique(c1)
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+alter_alter_col=yes # Alter table alter column default
+ ###< alter table crash_q alter b set default 10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+alter_change_col=yes # Alter table change column
+ ###< alter table crash_q change a e char(50)
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+alter_drop_col=yes # Alter table drop column
+ ###< alter table crash_q drop column b
+ ###> OK
+alter_drop_constraint=no # Alter table drop constraint
+ ###< alter table crash_q drop constraint c2
+ ###> execute error: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 'constraint c2' at line 1
+ ###
+ ###< alter table crash_q drop constraint c2 restrict
+ ###> execute error: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 'constraint c2 restrict' at line 1
+alter_drop_foreign_key=with drop foreign key # Alter table drop foreign key
+ ###< alter table crash_q drop constraint f1
+ ###> execute error: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 'constraint f1' at line 1
+ ###
+ ###< alter table crash_q drop constraint f1 restrict
+ ###> execute error: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 'constraint f1 restrict' at line 1
+ ###
+ ###< alter table crash_q drop foreign key f1
+ ###> OK
+alter_drop_primary_key=drop primary key # Alter table drop primary key
+ ###< alter table crash_q1 drop constraint p1 restrict
+ ###> execute error: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 'constraint p1 restrict' at line 1
+ ###
+ ###< alter table crash_q1 drop primary key
+ ###> OK
+alter_drop_unique=with drop key # Alter table drop unique
+ ###< alter table crash_q drop constraint u1
+ ###> execute error: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 'constraint u1' at line 1
+ ###
+ ###< alter table crash_q drop constraint u1 restrict
+ ###> execute error: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 'constraint u1 restrict' at line 1
+ ###
+ ###< alter table crash_q drop key c1
+ ###> OK
+alter_modify_col=yes # Alter table modify column
+ ###< alter table crash_q modify c1 CHAR(20)
+ ###> OK
+alter_rename_table=yes # Alter table rename table
+ ###< alter table crash_q rename to crash_q1
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+atomic_updates=no # atomic updates
+ ###< create table crash_q (a integer not null,primary key (a))
+ ###> OK
+ ###< insert into crash_q values (2)
+ ###> OK
+ ###< insert into crash_q values (3)
+ ###> OK
+ ###< insert into crash_q values (1)
+ ###> OK
+ ###< update crash_q set a=a+1
+ ###> execute error:Duplicate entry '3' for key 1
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as some queries didnt return OK, result is NO
+automatic_rowid=_rowid # Automatic row id
+ ###< create table crash_q (a int not null, primary key(a))
+ ###> OK
+ ###< insert into crash_q values (1)
+ ###> OK
+ ###< select _rowid from crash_q
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+binary_numbers=no # binary numbers (0b1001)
+ ###< select 0b1001
+ ###> execute error:Unknown column '0b1001' in 'field list'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+binary_strings=no # binary strings (b'0110')
+ ###< select b'0110'
+ ###> execute error:Unknown column 'b' in 'field list'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+case_insensitive_strings=yes # Case insensitive compare
+ ###
+ ###<select b from crash_me where b = 'A'
+ ###>a
+char_is_space_filled=no # char are space filled
+ ###
+ ###<select concat(b,b) from crash_me where b = 'a '
+ ###>aa
+ ###We expected 'a a ' but got 'aa'
+column_alias=yes # Column alias
+ ###< select a as ab from crash_me
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+columns_in_group_by=+64 # number of columns in group by
+ ###We are trying (example with N=5):
+ ###create table crash_q (q1 integer,q2 integer,q3 integer,q4 integer,q5 integer)
+ ###insert into crash_q values(1,1,1,1,1)
+ ###insert into crash_q values(1,1,1,1,1)
+ ###select q1,q2,q3,q4,q5 from crash_q group by q1,q2,q3,q4,q5
+columns_in_order_by=+64 # number of columns in order by
+ ###We are trying (example with N=5):
+ ###create table crash_q (q1 integer,q2 integer,q3 integer,q4 integer,q5 integer)
+ ###insert into crash_q values(1,1,1,1,1)
+ ###insert into crash_q values(1,1,1,1,1)
+ ###select * from crash_q order by q1,q2,q3,q4,q5
+comment_#=yes # # as comment
+ ###< select * from crash_me # Testing of comments
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+comment_--=yes # -- as comment (ANSI)
+ ###< select * from crash_me -- Testing of comments
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+comment_/**/=yes # /* */ as comment
+ ###< select * from crash_me /* Testing of comments */
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+comment_//=no # // as comment
+ ###< select * from crash_me // Testing of comments
+ ###> execute error: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 '// Testing of comments' at line 1
+ ###
+ ###As far as some queries didnt return OK, result is NO
+compute=no # Compute
+ ###< select a from crash_me order by a compute sum(a) by a
+ ###> execute error: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 'compute sum(a) by a' at line 1
+ ###
+ ###As far as some queries didnt return OK, result is NO
+connections=101 # Simultaneous connections (installation default)
+constraint_check=syntax only # Column constraints
+ ###< create table crash_q (a int check (a>0))
+ ###> OK
+ ###
+ ###< insert into crash_q values(0)
+ ###> OK
+ ###
+ ###< drop table crash_q
+ ###> OK
+constraint_check_named=syntax only # Named constraints
+ ###< create table crash_q (a int ,b int, constraint abc check (a>b))
+ ###> OK
+ ###
+ ###< insert into crash_q values(0,0)
+ ###> OK
+ ###
+ ###< drop table crash_q
+ ###> OK
+constraint_check_table=syntax only # Table constraints
+ ###< create table crash_q (a int ,b int, check (a>b))
+ ###> OK
+ ###
+ ###< insert into crash_q values(0,0)
+ ###> OK
+ ###
+ ###< drop table crash_q
+ ###> OK
+constraint_null=yes # NULL constraint (SyBase style)
+ ###< create table crash_q (a int null)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+crash_me_safe=yes # crash me safe
+crash_me_version=1.61 # crash me version
+create_default=yes # default value for column
+ ###< create table crash_q (q integer default 10 not null)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+create_default_func=no # default value function for column
+ ###< create table crash_q (q integer not null,q1 integer default (1+1))
+ ###> execute error: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
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+create_if_not_exists=yes # create table if not exists
+ ###< create table crash_q (q integer)
+ ###> OK
+ ###< create table if not exists crash_q (q integer)
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+create_index=yes # create index
+ ###< create index crash_q on crash_me (a)
+ ###> OK
+create_schema=no # Create SCHEMA
+ ###< create schema crash_schema create table crash_q (a int) create table crash_q2(b int)
+ ###> execute error: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 'schema crash_schema create table crash_q (a int) create table c
+ ###< drop schema crash_schema cascade
+ ###> execute error: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 'schema crash_schema cascade' at line 1
+ ###
+ ###As far as some queries didnt return OK, result is NO
+create_table_select=yes # create table from select
+ ###< create table crash_q SELECT * from crash_me
+ ###> OK
+cross_join=yes # cross join (same as from a,b)
+ ###< select crash_me.a from crash_me cross join crash_me3
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+date_as_string=yes # String functions on date columns
+ ###< create table crash_me2 (a date not null)
+ ###> OK
+ ###< insert into crash_me2 values ('1998-03-03')
+ ###> OK
+ ###
+ ###<select left(a,4) from crash_me2
+ ###>1998
+ ###
+ ###< drop table crash_me2
+ ###> OK
+date_format_EUR=error # Supports DD.MM.YYYY (EUR) format
+ ###< insert into crash_me_d(a) values ('16.08.1963')
+ ###> OK
+ ###
+ ###<select a from crash_me_d
+ ###>0000-00-00
+ ###We expected '1963-08-16' but got '0000-00-00'
+ ###
+ ###< delete from crash_me_d
+ ###> OK
+date_format_EUR_with_date=error # Supports DATE 'DD.MM.YYYY' (EUR) format
+ ###< insert into crash_me_d(a) values (DATE '16.08.1963')
+ ###> OK
+ ###
+ ###<select a from crash_me_d
+ ###>0000-00-00
+ ###We expected '1963-08-16' but got '0000-00-00'
+ ###
+ ###< delete from crash_me_d
+ ###> OK
+date_format_ISO=yes # Supports YYYY-MM-DD (ISO) format
+ ###< insert into crash_me_d(a) values ('1963-08-16')
+ ###> OK
+ ###
+ ###<select a from crash_me_d
+ ###>1963-08-16
+ ###
+ ###< delete from crash_me_d
+ ###> OK
+date_format_ISO_with_date=yes # Supports DATE 'YYYY-MM-DD' (ISO) format
+ ###< insert into crash_me_d(a) values (DATE '1963-08-16')
+ ###> OK
+ ###
+ ###<select a from crash_me_d
+ ###>1963-08-16
+ ###
+ ###< delete from crash_me_d
+ ###> OK
+date_format_USA=error # Supports MM/DD/YYYY format
+ ###< insert into crash_me_d(a) values ('08/16/1963')
+ ###> OK
+ ###
+ ###<select a from crash_me_d
+ ###>0000-00-00
+ ###We expected '1963-08-16' but got '0000-00-00'
+ ###
+ ###< delete from crash_me_d
+ ###> OK
+date_format_USA_with_date=error # Supports DATE 'MM/DD/YYYY' format
+ ###< insert into crash_me_d(a) values (DATE '08/16/1963')
+ ###> OK
+ ###
+ ###<select a from crash_me_d
+ ###>0000-00-00
+ ###We expected '1963-08-16' but got '0000-00-00'
+ ###
+ ###< delete from crash_me_d
+ ###> OK
+date_format_YYYYMMDD=yes # Supports YYYYMMDD format
+ ###< insert into crash_me_d(a) values ('19630816')
+ ###> OK
+ ###
+ ###<select a from crash_me_d
+ ###>1963-08-16
+ ###
+ ###< delete from crash_me_d
+ ###> OK
+date_format_YYYYMMDD_with_date=yes # Supports DATE 'YYYYMMDD' format
+ ###< insert into crash_me_d(a) values (DATE '19630816')
+ ###> OK
+ ###
+ ###<select a from crash_me_d
+ ###>1963-08-16
+ ###
+ ###< delete from crash_me_d
+ ###> OK
+date_format_inresult=iso # Date format in result
+ ###< insert into crash_me_d values( sysdate() )
+ ###> OK
+ ###
+ ###< select a from crash_me_d
+ ###> 2003-08-27
+ ###< delete from crash_me_d
+ ###> OK
+date_infinity=error # Supports 'infinity dates
+ ###< create table crash_me2 (a date not null)
+ ###> OK
+ ###< insert into crash_me2 values ('infinity')
+ ###> OK
+ ###
+ ###<select a from crash_me2
+ ###>0000-00-00
+ ###We expected 'infinity' but got '0000-00-00'
+ ###
+ ###< drop table crash_me2
+ ###> OK
+date_last=yes # Supports 9999-12-31 dates
+ ###< create table crash_me2 (a date not null)
+ ###> OK
+ ###< insert into crash_me2 values ('9999-12-31')
+ ###> OK
+ ###
+ ###<select a from crash_me2
+ ###>9999-12-31
+ ###
+ ###< drop table crash_me2
+ ###> OK
+date_one=yes # Supports 0001-01-01 dates
+ ###< create table crash_me2 (a date not null)
+ ###> OK
+ ###< insert into crash_me2 values ('0001-01-01')
+ ###> OK
+ ###
+ ###<select a from crash_me2
+ ###>0001-01-01
+ ###
+ ###< drop table crash_me2
+ ###> OK
+date_with_YY=yes # Supports YY-MM-DD 2000 compilant dates
+ ###< create table crash_me2 (a date not null)
+ ###> OK
+ ###< insert into crash_me2 values ('98-03-03')
+ ###> OK
+ ###
+ ###<select a from crash_me2
+ ###>1998-03-03
+ ###
+ ###< drop table crash_me2
+ ###> OK
+ ###
+ ###< create table crash_me2 (a date not null)
+ ###> OK
+ ###< insert into crash_me2 values ('10-03-03')
+ ###> OK
+ ###
+ ###<select a from crash_me2
+ ###>2010-03-03
+ ###
+ ###< drop table crash_me2
+ ###> OK
+date_zero=yes # Supports 0000-00-00 dates
+ ###< create table crash_me2 (a date not null)
+ ###> OK
+ ###< insert into crash_me2 values ('0000-00-00')
+ ###> OK
+ ###
+ ###<select a from crash_me2
+ ###>0000-00-00
+ ###
+ ###< drop table crash_me2
+ ###> OK
+domains=no # Domains (ANSI SQL)
+ ###< create domain crash_d as varchar(10) default 'Empty' check (value <> 'abcd')
+ ###> execute error: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 'domain crash_d as varchar(10) default 'Empty' check (value <> '
+ ###< create table crash_q(a crash_d, b int)
+ ###> execute error: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 'crash_d, b int)' at line 1
+ ###< insert into crash_q(a,b) values('xyz',10)
+ ###> execute error:Table 'test.crash_q' doesn't exist
+ ###< insert into crash_q(b) values(10)
+ ###> execute error:Table 'test.crash_q' doesn't exist
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###< drop domain crash_d
+ ###> execute error: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 'domain crash_d' at line 1
+ ###
+ ###As far as some queries didnt return OK, result is NO
+dont_require_cast_to_float=yes # No need to cast from integer to float
+ ###< select exp(1)
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+double_quotes=yes # Double '' as ' in strings
+ ###
+ ###<select 'Walker''s'
+ ###>Walker's
+drop_if_exists=yes # drop table if exists
+ ###< create table crash_q (q integer)
+ ###> OK
+ ###< drop table if exists crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+drop_index=with 'ON' # drop index
+ ###< drop index crash_q
+ ###> execute error: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
+ ###
+ ###< drop index crash_q from crash_me
+ ###> execute error: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 crash_me' at line 1
+ ###
+ ###< drop index crash_q on crash_me
+ ###> OK
+drop_requires_cascade=no # drop table require cascade/restrict
+ ###< create table crash_me (a integer not null)
+ ###> OK
+ ###< drop table crash_me
+ ###> OK
+drop_restrict=yes # drop table with cascade/restrict
+ ###< create table crash_q (a int)
+ ###> OK
+ ###< drop table crash_q restrict
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+end_colon=yes # allows end ';'
+ ###< select * from crash_me;
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+except=no # except
+ ###< select * from crash_me except select * from crash_me3
+ ###> execute error: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 crash_me3' at line 1
+ ###
+ ###As far as some queries didnt return OK, result is NO
+except_all=no # except all
+ ###< select * from crash_me except all select * from crash_me3
+ ###> execute error: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 'all select * from crash_me3' at line 1
+ ###
+ ###As far as some queries didnt return OK, result is NO
+except_all_incompat=no # except all (incompatible lists)
+ ###< select * from crash_me except all select * from crash_me2
+ ###> execute error: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 'all select * from crash_me2' at line 1
+ ###
+ ###As far as some queries didnt return OK, result is NO
+except_incompat=no # except (incompatible lists)
+ ###< select * from crash_me except select * from crash_me2
+ ###> execute error: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 crash_me2' at line 1
+ ###
+ ###As far as some queries didnt return OK, result is NO
+field_name_case=yes # case independent field names
+ ###< create table crash_q (q integer)
+ ###> OK
+ ###< insert into crash_q(Q) values (1)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+float_int_expr=yes # mixing of integer and float in expression
+ ###< select 1+1.0
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+foreign_key=syntax only # foreign keys
+ ###< create table crash_me_qf (a integer not null,primary key (a))
+ ###> OK
+ ###
+ ###< create table crash_me_qf2 (a integer not null,foreign key (a) references crash_me_qf (a))
+ ###> OK
+ ###
+ ###< insert into crash_me_qf values (1)
+ ###> OK
+ ###
+ ###< insert into crash_me_qf2 values (2)
+ ###> OK
+ ###
+ ###< drop table crash_me_qf2
+ ###> OK
+ ###
+ ###< drop table crash_me_qf
+ ###> OK
+full_outer_join=no # full outer join
+ ###< select crash_me.a from crash_me full join crash_me2 ON
+ ### crash_me.a=crash_me2.a
+ ###> execute error:Unknown table 'crash_me' in field list
+ ###
+ ###As far as some queries didnt return OK, result is NO
+func_extra_!=yes # Function NOT as '!' in SELECT
+ ###
+ ###<select ! 1
+ ###>0
+func_extra_%=yes # Function MOD as %
+ ###
+ ###<select 10%7
+ ###>3
+func_extra_&=yes # Function & (bitwise and)
+ ###
+ ###<select 5 & 3
+ ###>1
+func_extra_&&=yes # Function AND as '&&'
+ ###
+ ###<select 1=1 && 2=2
+ ###>1
+func_extra_<>=yes # Function <> in SELECT
+ ###
+ ###<select 1<>1
+ ###>0
+func_extra_==yes # Function =
+ ###
+ ###<select (1=1)
+ ###>1
+func_extra_add_months=no # Function ADD_MONTHS
+ ###
+ ###<select add_months('1997-01-01',1) from crash_me_d
+ ###> execute failed: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 '('1997-01-01',1) from crash_me_d' at line 1
+func_extra_adddate=no # Function ADDDATE
+ ###
+ ###<select ADDDATE('2002-12-01',3) from crash_me_d
+ ###> execute failed: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 '3) from crash_me_d' at line 1
+func_extra_addtime=no # Function ADDTIME
+ ###
+ ###<select ADDTIME('20:02:12','00:00:03')
+ ###> execute failed: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 '('20:02:12','00:00:03')' at line 1
+func_extra_alpha=no # Function ALPHA
+ ###
+ ###<select alpha('Aâ',2)
+ ###> execute failed: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 '('Aâ',2)' at line 1
+func_extra_and_or=yes # Function AND and OR in SELECT
+ ###
+ ###<select 1=1 AND 2=2
+ ###>1
+func_extra_ascii_char=no # Function ASCII_CHAR
+ ###
+ ###<select ASCII_CHAR(65)
+ ###> execute failed: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 '(65)' at line 1
+func_extra_ascii_code=no # Function ASCII_CODE
+ ###
+ ###<select ASCII_CODE('A')
+ ###> execute failed: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 '('A')' at line 1
+func_extra_ascii_string=error # Function ASCII in string cast
+ ###
+ ###<select ascii('a')
+ ###>97
+ ###We expected 'a' but got '97'
+func_extra_atn2=no # Function ATN2
+ ###
+ ###<select atn2(1,0)
+ ###> execute failed: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
+func_extra_auto_num2string=yes # Function automatic num->string convert
+ ###
+ ###<select concat('a',2)
+ ###>a2
+func_extra_auto_string2num=yes # Function automatic string->num convert
+ ###
+ ###<select '1'+2
+ ###>3
+func_extra_between=yes # Function BETWEEN in SELECT
+ ###
+ ###<select 5 between 4 and 6
+ ###>1
+func_extra_binary_shifts=yes # Function << and >> (bitwise shifts)
+ ###
+ ###<select (1 << 4) >> 2
+ ###>4
+func_extra_bit_count=yes # Function BIT_COUNT
+ ###
+ ###<select bit_count(5)
+ ###>2
+func_extra_ceil=yes # Function CEIL
+ ###
+ ###<select ceil(-4.5)
+ ###>-4
+func_extra_char_date=no # Function CHAR (conversation date)
+ ###
+ ###<select CHAR(a,EUR) from crash_me_d
+ ###> execute failed:Unknown column 'EUR' in 'field list'
+func_extra_charindex=no # Function CHARINDEX
+ ###
+ ###<select charindex('a','crash')
+ ###> execute failed: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 '('a','crash')' at line 1
+func_extra_chr=no # Function CHR
+ ###
+ ###<select CHR(65)
+ ###> execute failed: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 '(65)' at line 1
+func_extra_chr_str=no # Function CHR (any type to string)
+ ###
+ ###<select CHR(67)
+ ###> execute failed: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 '(67)' at line 1
+func_extra_concat_as_+=error # Function concatenation with +
+ ###
+ ###<select 'abc' + 'def'
+ ###>0
+ ###We expected 'abcdef' but got '0'
+func_extra_concat_list=yes # Function CONCAT(list)
+ ###
+ ###<select concat('a','b','c','d')
+ ###>abcd
+func_extra_convert=no # Function CONVERT
+ ###
+ ###<select convert(CHAR,5)
+ ###> execute failed: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 '5)' at line 1
+func_extra_cosh=no # Function COSH
+ ###
+ ###<select cosh(0)
+ ###> execute failed: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 '(0)' at line 1
+func_extra_date=no # Function DATE
+ ###
+ ###<select date('1963-08-16') from crash_me_d
+ ###> execute failed: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 '('1963-08-16') from crash_me_d' at line 1
+func_extra_date_format=yes # Function DATE_FORMAT
+ ###
+ ###<select date_format('1997-01-02 03:04:05','M W D Y y m d h i s w') from crash_me_d
+ ###>M W D Y y m d h i s w
+func_extra_dateadd=no # Function DATEADD
+ ###
+ ###<select dateadd(day,3,'1997-11-30') from crash_me_d
+ ###> execute failed: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 '(day,3,'1997-11-30') from crash_me_d' at line 1
+func_extra_datediff=no # Function DATEDIFF
+ ###
+ ###<select datediff(month,'Oct 21 1997','Nov 30 1997') from crash_me_d
+ ###> execute failed: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 '(month,'Oct 21 1997','Nov 30 1997') from crash_me_d' at line 1
+func_extra_datediff2arg=no # Function DATEDIFF (2 arg)
+ ###
+ ###<select DATEDIFF('2002-12-04','2002-12-01') from crash_me_d
+ ###> execute failed: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 '('2002-12-04','2002-12-01') from crash_me_d' at line 1
+func_extra_datename=no # Function DATENAME
+ ###
+ ###<select datename(month,'Nov 30 1997') from crash_me_d
+ ###> execute failed: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 '(month,'Nov 30 1997') from crash_me_d' at line 1
+func_extra_datepart=no # Function DATEPART
+ ###
+ ###<select datepart(month,'July 20 1997') from crash_me_d
+ ###> execute failed: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 '(month,'July 20 1997') from crash_me_d' at line 1
+func_extra_day=no # Function DAY
+ ###
+ ###<select DAY('2002-12-01') from crash_me_d
+ ###> execute failed: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 '('2002-12-01') from crash_me_d' at line 1
+func_extra_decode=no # Function DECODE
+ ###
+ ###<select DECODE('S-103','T72',1,'S-103',2,'Leopard',3)
+ ###> execute failed: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,'S-103',2,'Leopard',3)' at line 1
+func_extra_ebcdic_string=no # Function EBCDIC in string cast
+ ###
+ ###<select ebcdic('a')
+ ###> execute failed: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 '('a')' at line 1
+func_extra_elt=yes # Function ELT
+ ###
+ ###<select elt(2,'ONE','TWO','THREE')
+ ###>TWO
+func_extra_encrypt=yes # Function ENCRYPT
+ ###
+ ###<select encrypt('hello')
+ ###>tHrzZO8Aq1FG6
+func_extra_expand2arg=no # Function EXPAND
+ ###
+ ###<select expand('abcd',6)
+ ###> execute failed: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 '('abcd',6)' at line 1
+func_extra_field=yes # Function FIELD
+ ###
+ ###<select field('IBM','NCA','ICL','SUN','IBM','DIGITAL')
+ ###>4
+func_extra_fixed=no # Function FIXED
+ ###
+ ###<select fixed(222.6666,10,2)
+ ###> execute failed: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 '(222.6666,10,2)' at line 1
+func_extra_float=no # Function FLOAT
+ ###
+ ###<select float(6666.66,4)
+ ###> execute failed: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 'float(6666.66,4)' at line 1
+func_extra_format=yes # Function FORMAT
+ ###
+ ###<select format(1234.5555,2)
+ ###>1,234.56
+func_extra_from_days=yes # Function FROM_DAYS
+ ###
+ ###<select from_days(729024) from crash_me_d
+ ###>1996-01-01
+func_extra_from_unixtime=yes # Function FROM_UNIXTIME
+ ###
+ ###<select from_unixtime(0) from crash_me_d
+ ###>1970-01-01 02:00:00
+func_extra_getdate=no # Function GETDATE
+ ###
+ ###<select getdate()
+ ###> execute failed: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
+func_extra_greatest=yes # Function GREATEST
+ ###
+ ###<select greatest('HARRY','HARRIOT','HAROLD')
+ ###>HARRY
+func_extra_hex=yes # Function HEX
+ ###
+ ###<select HEX('A')
+ ###>41
+func_extra_if=yes # Function IF
+ ###
+ ###<select if(5,6,7)
+ ###>6
+func_extra_in_num=yes # Function IN on numbers in SELECT
+ ###
+ ###<select 2 in (3,2,5,9,5,1)
+ ###>1
+func_extra_in_str=yes # Function IN on strings in SELECT
+ ###
+ ###<select 'monty' in ('david','monty','allan')
+ ###>1
+func_extra_index=no # Function INDEX
+ ###
+ ###<select index('abcdefg','cd',1,1)
+ ###> execute failed: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 'index('abcdefg','cd',1,1)' at line 1
+func_extra_initcap=no # Function INITCAP
+ ###
+ ###<select initcap('the soap')
+ ###> execute failed: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 '('the soap')' at line 1
+func_extra_instr=yes # Function LOCATE as INSTR
+ ###
+ ###<select instr('hello','ll')
+ ###>3
+func_extra_instr_oracle=no # Function INSTR (Oracle syntax)
+ ###
+ ###<select INSTR('CORPORATE FLOOR','OR',3,2)
+ ###> execute failed: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 '3,2)' at line 1
+func_extra_instrb=no # Function INSTRB
+ ###
+ ###<select INSTRB('CORPORATE FLOOR','OR',5,2)
+ ###> execute failed: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 '('CORPORATE FLOOR','OR',5,2)' at line 1
+func_extra_interval=yes # Function INTERVAL
+ ###
+ ###<select interval(55,10,20,30,40,50,60,70,80,90,100)
+ ###>5
+func_extra_last_day=no # Function LAST_DAY
+ ###
+ ###<select last_day('1997-04-01') from crash_me_d
+ ###> execute failed: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 '('1997-04-01') from crash_me_d' at line 1
+func_extra_last_insert_id=yes # Function LAST_INSERT_ID
+ ###
+ ###<select last_insert_id()
+ ###>0
+func_extra_least=yes # Function LEAST
+ ###
+ ###<select least('HARRY','HARRIOT','HAROLD')
+ ###>HAROLD
+func_extra_length=error # Function LENGTH
+ ###
+ ###<select length(1)
+ ###>1
+ ###We expected '2' but got '1'
+func_extra_lengthb=no # Function LENGTHB
+ ###
+ ###<select lengthb('CANDIDE')
+ ###> execute failed: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 '('CANDIDE')' at line 1
+func_extra_lfill3arg=no # Function LFILL (3 arg)
+ ###
+ ###<select lfill('abcd','.',6)
+ ###> execute failed: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 '('abcd','.',6)' at line 1
+func_extra_like=yes # Function LIKE in SELECT
+ ###
+ ###<select 'a' like 'a%'
+ ###>1
+func_extra_like_escape=yes # Function LIKE ESCAPE in SELECT
+ ###
+ ###<select '%' like 'a%' escape 'a'
+ ###>1
+func_extra_ln=yes # Function LN
+ ###
+ ###<select ln(95)
+ ###>4.553877
+func_extra_log(m_n)=yes # Function LOG(m,n)
+ ###
+ ###<select log(10,100)
+ ###>2.000000
+func_extra_logn=no # Function LOGN
+ ###
+ ###<select logn(2)
+ ###> execute failed: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)' at line 1
+func_extra_lpad=yes # Function LPAD
+ ###
+ ###<select lpad('hi',4,'??')
+ ###>??hi
+func_extra_ltrim2arg=no # Function LTRIM (2 arg)
+ ###
+ ###<select ltrim('..abcd..','.')
+ ###> execute failed: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
+func_extra_makedate=no # Function MAKEDATE
+ ###
+ ###<select MAKEDATE(1963,228) from crash_me_d
+ ###> execute failed: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 '(1963,228) from crash_me_d' at line 1
+func_extra_maketime=no # Function MAKETIME
+ ###
+ ###<select MAKETIME(20,02,12)
+ ###> execute failed: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 '(20,02,12)' at line 1
+func_extra_mapchar=no # Function MAPCHAR
+ ###
+ ###<select mapchar('Aâ')
+ ###> execute failed: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 '('Aâ')' at line 1
+func_extra_mdy=no # Function MDY
+ ###
+ ###<select mdy(7,1,1998) from crash_me_d
+ ###> execute failed: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 '(7,1,1998) from crash_me_d' at line 1
+func_extra_microsecond=no # Function MICROSECOND
+ ###
+ ###<select MICROSECOND('19630816200212111111')
+ ###> execute failed: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 '('19630816200212111111')' at line 1
+func_extra_mid=yes # Function SUBSTRING as MID
+ ###
+ ###<select mid('hello',3,2)
+ ###>ll
+func_extra_months_between=no # Function MONTHS_BETWEEN
+ ###
+ ###<select months_between('1997-02-02','1997-01-01') from crash_me_d
+ ###> execute failed: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 '('1997-02-02','1997-01-01') from crash_me_d' at line 1
+func_extra_noround=no # Function NOROUND
+ ###< select noround(22.6)
+ ###> execute error: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 '(22.6)' at line 1
+func_extra_not=yes # Function NOT in SELECT
+ ###
+ ###<select not 0
+ ###>1
+func_extra_not_between=yes # Function NOT BETWEEN in SELECT
+ ###
+ ###<select 5 not between 4 and 6
+ ###>0
+func_extra_not_like=yes # Function NOT LIKE in SELECT
+ ###
+ ###<select 'a' not like 'a%'
+ ###>0
+func_extra_num=no # Function NUM
+ ###
+ ###<select NUM('2123')
+ ###> execute failed: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 '('2123')' at line 1
+func_extra_odbc_convert=no # Function ODBC CONVERT
+ ###
+ ###<select convert(5,SQL_CHAR)
+ ###> execute failed: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 'SQL_CHAR)' at line 1
+func_extra_password=yes # Function PASSWORD
+ ###
+ ###<select password('hello')
+ ###>70de51425df9d787
+func_extra_paste=no # Function PASTE
+ ###
+ ###<select paste('ABCDEFG',3,2,'1234')
+ ###> execute failed: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 '('ABCDEFG',3,2,'1234')' at line 1
+func_extra_patindex=no # Function PATINDEX
+ ###
+ ###<select patindex('%a%','crash')
+ ###> execute failed: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 '('%a%','crash')' at line 1
+func_extra_period_add=yes # Function PERIOD_ADD
+ ###
+ ###<select period_add(9602,-12) from crash_me_d
+ ###>199502
+func_extra_period_diff=yes # Function PERIOD_DIFF
+ ###
+ ###<select period_diff(199505,199404) from crash_me_d
+ ###>13
+func_extra_pow=yes # Function POW
+ ###
+ ###<select pow(3,2)
+ ###>9.000000
+func_extra_range=no # Function RANGE
+ ###
+ ###<select range(a)
+ ###> execute failed: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 '(a)' at line 1
+func_extra_regexp=yes # Function REGEXP in SELECT
+ ###
+ ###<select 'a' regexp '^(a|b)*$'
+ ###>1
+func_extra_replace2arg=no # Function REPLACE (2 arg)
+ ###
+ ###<select replace('AbCd','bC')
+ ###> execute failed: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
+func_extra_replicate=no # Function REPLICATE
+ ###
+ ###<select replicate('a',5)
+ ###> execute failed: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 '('a',5)' at line 1
+func_extra_reverse=yes # Function REVERSE
+ ###
+ ###<select reverse('abcd')
+ ###>dcba
+func_extra_rfill3arg=no # Function RFILL (3 arg)
+ ###
+ ###<select rfill('abcd','.',6)
+ ###> execute failed: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 '('abcd','.',6)' at line 1
+func_extra_root=no # Function ROOT
+ ###
+ ###<select root(4)
+ ###> execute failed: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 '(4)' at line 1
+func_extra_round1=yes # Function ROUND(1 arg)
+ ###
+ ###<select round(5.63)
+ ###>6
+func_extra_rpad=yes # Function RPAD
+ ###
+ ###<select rpad('hi',4,'??')
+ ###>hi??
+func_extra_rpad4arg=no # Function RPAD (4 arg)
+ ###
+ ###<select rpad('abcd',2,'+-',8)
+ ###> execute failed: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 '8)' at line 1
+func_extra_rtrim2arg=no # Function RTRIM (2 arg)
+ ###
+ ###<select rtrim('..abcd..','.')
+ ###> execute failed: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
+func_extra_sec_to_time=yes # Function SEC_TO_TIME
+ ###
+ ###<select sec_to_time(5001)
+ ###>01:23:21
+func_extra_sinh=no # Function SINH
+ ###
+ ###<select sinh(1)
+ ###> execute failed: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)' at line 1
+func_extra_str=no # Function STR
+ ###
+ ###<select str(123.45,5,1)
+ ###> execute failed: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.45,5,1)' at line 1
+func_extra_strcmp=yes # Function STRCMP
+ ###
+ ###<select strcmp('abc','adc')
+ ###>-1
+func_extra_stuff=no # Function STUFF
+ ###
+ ###<select stuff('abc',2,3,'xyz')
+ ###> execute failed: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 '('abc',2,3,'xyz')' at line 1
+func_extra_subdate=no # Function SUBDATE
+ ###
+ ###<select SUBDATE('2002-12-04',3) from crash_me_d
+ ###> execute failed: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 '3) from crash_me_d' at line 1
+func_extra_substr2arg=no # Function SUBSTR (2 arg)
+ ###
+ ###<select substr('abcd',2)
+ ###> execute failed: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 '('abcd',2)' at line 1
+func_extra_substr3arg=no # Function SUBSTR (3 arg)
+ ###
+ ###<select substr('abcd',2,2)
+ ###> execute failed: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 '('abcd',2,2)' at line 1
+func_extra_substrb=no # Function SUBSTRB
+ ###
+ ###<select SUBSTRB('ABCDEFG',5,4.2)
+ ###> execute failed: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 '('ABCDEFG',5,4.2)' at line 1
+func_extra_substring_index=yes # Function SUBSTRING_INDEX
+ ###
+ ###<select substring_index('www.tcx.se','.',-2)
+ ###>tcx.se
+func_extra_subtime=no # Function SUBTIME
+ ###
+ ###<select SUBTIME('20:02:15','00:00:03')
+ ###> execute failed: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 '('20:02:15','00:00:03')' at line 1
+func_extra_sysdate=yes # Function SYSDATE
+ ###
+ ###<select sysdate()
+ ###>2003-08-27 19:55:21
+func_extra_tail=no # Function TAIL
+ ###
+ ###<select tail('ABCDEFG',3)
+ ###> execute failed: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 '('ABCDEFG',3)' at line 1
+func_extra_tanh=no # Function TANH
+ ###
+ ###<select tanh(1)
+ ###> execute failed: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)' at line 1
+func_extra_time=no # Function TIME
+ ###
+ ###<select time('20:02:12')
+ ###> execute failed: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 '('20:02:12')' at line 1
+func_extra_time_to_sec=yes # Function TIME_TO_SEC
+ ###
+ ###<select time_to_sec('01:23:21')
+ ###>5001
+func_extra_timediff=no # Function TIMEDIFF
+ ###
+ ###<select TIMEDIFF('20:02:15','20:02:12')
+ ###> execute failed: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 '('20:02:15','20:02:12')' at line 1
+func_extra_timestamp=no # Function TIMESTAMP
+ ###
+ ###<select timestamp('19630816','00200212')
+ ###> execute failed: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 '('19630816','00200212')' at line 1
+func_extra_to_days=yes # Function TO_DAYS
+ ###
+ ###<select to_days('1996-01-01') from crash_me_d
+ ###>729024
+func_extra_translate=no # Function TRANSLATE
+ ###
+ ###<select translate('abc','bc','de')
+ ###> execute failed: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 '('abc','bc','de')' at line 1
+func_extra_trim1arg=yes # Function TRIM (1 arg)
+ ###
+ ###<select trim(' abcd ')
+ ###>abcd
+func_extra_trim2arg=no # Function TRIM (2 arg)
+ ###
+ ###<select trim('..abcd..','.')
+ ###> execute failed: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
+func_extra_trim_many_char=error # Function TRIM; Many char extension
+ ###
+ ###<select trim(':!' FROM ':abc!')
+ ###>:abc!
+ ###We expected 'abc' but got ':abc!'
+func_extra_trim_substring=yes # Function TRIM; Substring extension
+ ###
+ ###<select trim('cb' FROM 'abccb')
+ ###>abc
+func_extra_trunc=no # Function TRUNC
+ ###
+ ###<select trunc(18.18,-1)
+ ###> execute failed: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 '(18.18,-1)' at line 1
+func_extra_trunc1arg=no # Function TRUNC (1 arg)
+ ###
+ ###<select trunc(222.6)
+ ###> execute failed: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 '(222.6)' at line 1
+func_extra_uid=no # Function UID
+ ###
+ ###<select uid
+ ###> execute failed:Unknown column 'uid' in 'field list'
+func_extra_unix_timestamp=yes # Function UNIX_TIMESTAMP
+ ###
+ ###<select unix_timestamp()
+ ###>1062003321
+func_extra_userenv=no # Function USERENV
+ ###
+ ###<select userenv
+ ###> execute failed:Unknown column 'userenv' in 'field list'
+func_extra_value=no # Function VALUE
+ ###
+ ###<select value(NULL,'WALRUS')
+ ###> execute failed: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,'WALRUS')' at line 1
+func_extra_version=yes # Function VERSION
+ ###
+ ###<select version()
+ ###>4.0.15-debug-log
+func_extra_weekday=yes # Function WEEKDAY
+ ###
+ ###<select weekday('1997-11-29') from crash_me_d
+ ###>5
+func_extra_weekofyear=no # Function WEEKOFYEAR
+ ###
+ ###<select WEEKOFYEAR('1963-08-16') from crash_me_d
+ ###> execute failed: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 '('1963-08-16') from crash_me_d' at line 1
+func_extra_|=yes # Function | (bitwise or)
+ ###
+ ###<select 1 | 2
+ ###>3
+func_extra_||=yes # Function OR as '||'
+ ###
+ ###<select 1=0 || 1=1
+ ###>1
+func_extra_~*=no # Function ~* (case insensitive compare)
+ ###
+ ###<select 'hi' ~* 'HI'
+ ###> execute failed: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 '~* 'HI'' at line 1
+func_odbc_abs=yes # Function ABS
+ ###
+ ###<select abs(-5)
+ ###>5
+func_odbc_acos=yes # Function ACOS
+ ###
+ ###<select acos(0)
+ ###>1.570796
+func_odbc_ascii=yes # Function ASCII
+ ###
+ ###<select ASCII('A')
+ ###>65
+func_odbc_asin=yes # Function ASIN
+ ###
+ ###<select asin(1)
+ ###>1.570796
+func_odbc_atan=yes # Function ATAN
+ ###
+ ###<select atan(1)
+ ###>0.785398
+func_odbc_atan2=yes # Function ATAN2
+ ###
+ ###<select atan2(1,0)
+ ###>1.570796
+func_odbc_ceiling=yes # Function CEILING
+ ###
+ ###<select ceiling(-4.5)
+ ###>-4
+func_odbc_char=yes # Function CHAR
+ ###
+ ###<select CHAR(65)
+ ###>A
+func_odbc_concat=yes # Function CONCAT(2 arg)
+ ###
+ ###<select concat('a','b')
+ ###>ab
+func_odbc_cos=yes # Function COS
+ ###
+ ###<select cos(0)
+ ###>1.000000
+func_odbc_cot=yes # Function COT
+ ###
+ ###<select cot(1)
+ ###>0.64209262
+func_odbc_curdate=yes # Function CURDATE
+ ###
+ ###<select curdate()
+ ###>2003-08-27
+func_odbc_curtime=yes # Function CURTIME
+ ###
+ ###<select curtime()
+ ###>19:55:21
+func_odbc_database=yes # Function DATABASE
+ ###
+ ###<select database()
+ ###>test
+func_odbc_dayname=yes # Function DAYNAME
+ ###< insert into crash_me_d values('1997-02-01')
+ ###
+ ###<select dayname(a) from crash_me_d
+ ###>Saturday
+func_odbc_dayofmonth=yes # Function DAYOFMONTH
+ ###< insert into crash_me_d values('1997-02-01')
+ ###
+ ###<select dayofmonth(a) from crash_me_d
+ ###>1
+func_odbc_dayofweek=yes # Function DAYOFWEEK
+ ###< insert into crash_me_d values('1997-02-01')
+ ###
+ ###<select dayofweek(a) from crash_me_d
+ ###>7
+func_odbc_dayofyear=yes # Function DAYOFYEAR
+ ###< insert into crash_me_d values('1997-02-01')
+ ###
+ ###<select dayofyear(a) from crash_me_d
+ ###>32
+func_odbc_degrees=yes # Function DEGREES
+ ###
+ ###<select degrees(6.283185)
+ ###>359.99998239991
+func_odbc_difference=no # Function DIFFERENCE()
+ ###
+ ###<select difference('abc','abe')
+ ###> execute failed: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 '('abc','abe')' at line 1
+ ###
+ ###<select {fn difference('abc','abe') }
+ ###> execute failed: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 '('abc','abe') }' at line 1
+func_odbc_exp=yes # Function EXP
+ ###
+ ###<select exp(1.0)
+ ###>2.718282
+func_odbc_floor=yes # Function FLOOR
+ ###
+ ###<select floor(2.5)
+ ###>2
+func_odbc_fn_left=yes # Function ODBC syntax LEFT & RIGHT
+ ###
+ ###<select { fn LEFT( { fn RIGHT('abcd',2) },1) }
+ ###>c
+func_odbc_hour=yes # Function HOUR
+ ###< insert into crash_me_t values(20:08:16)
+ ###
+ ###<select hour('12:13:14')
+ ###>12
+func_odbc_hour_time=yes # Function ANSI HOUR
+ ###< insert into crash_me_t values(20:08:16)
+ ###
+ ###<select hour(TIME '12:13:14')
+ ###>12
+func_odbc_ifnull=yes # Function IFNULL
+ ###
+ ###<select ifnull(2,3)
+ ###>2
+func_odbc_insert=yes # Function INSERT
+ ###
+ ###<select insert('abcd',2,2,'ef')
+ ###>aefd
+func_odbc_lcase=yes # Function LCASE
+ ###
+ ###<select lcase('ABC')
+ ###>abc
+func_odbc_left=yes # Function LEFT
+ ###
+ ###<select left('abcd',2)
+ ###>ab
+func_odbc_length=yes # Function REAL LENGTH
+ ###
+ ###<select length('abcd ')
+ ###>5
+func_odbc_length_without_space=error # Function ODBC LENGTH
+ ###
+ ###<select length('abcd ')
+ ###>5
+ ###We expected '4' but got '5'
+ ###
+ ###<select {fn length('abcd ') }
+ ###>5
+ ###We expected '4' but got '5'
+func_odbc_locate_2=yes # Function LOCATE(2 arg)
+ ###
+ ###<select locate('bcd','abcd')
+ ###>2
+func_odbc_locate_3=yes # Function LOCATE(3 arg)
+ ###
+ ###<select locate('bcd','abcd',3)
+ ###>0
+func_odbc_log=yes # Function LOG
+ ###
+ ###<select log(2)
+ ###>0.693147
+func_odbc_log10=yes # Function LOG10
+ ###
+ ###<select log10(10)
+ ###>1.000000
+func_odbc_ltrim=yes # Function LTRIM
+ ###
+ ###<select ltrim(' abcd')
+ ###>abcd
+func_odbc_minute=yes # Function MINUTE
+ ###< insert into crash_me_t values(20:08:16)
+ ###
+ ###<select minute('12:13:14')
+ ###>13
+func_odbc_mod=yes # Function MOD
+ ###
+ ###<select mod(11,7)
+ ###>4
+func_odbc_month=yes # Function MONTH
+ ###< insert into crash_me_d values('1997-02-01')
+ ###
+ ###<select month(a) from crash_me_d
+ ###>2
+func_odbc_monthname=yes # Function MONTHNAME
+ ###< insert into crash_me_d values('1997-02-01')
+ ###
+ ###<select monthname(a) from crash_me_d
+ ###>February
+func_odbc_now=yes # Function NOW
+ ###
+ ###<select now()
+ ###>2003-08-27 19:55:21
+func_odbc_pi=yes # Function PI
+ ###
+ ###<select pi()
+ ###>3.141593
+func_odbc_power=yes # Function POWER
+ ###
+ ###<select power(2,4)
+ ###>16.000000
+func_odbc_quarter=yes # Function QUARTER
+ ###< insert into crash_me_d values('1997-02-01')
+ ###
+ ###<select quarter(a) from crash_me_d
+ ###>1
+func_odbc_radians=yes # Function RADIANS
+ ###
+ ###<select radians(360)
+ ###>6.2831853071796
+func_odbc_rand=yes # Function RAND
+ ###
+ ###<select rand(1)
+ ###>0.40540353712198
+func_odbc_repeat=yes # Function REPEAT
+ ###
+ ###<select repeat('ab',3)
+ ###>ababab
+func_odbc_replace=yes # Function REPLACE
+ ###
+ ###<select replace('abbaab','ab','ba')
+ ###>bababa
+func_odbc_right=yes # Function RIGHT
+ ###
+ ###<select right('abcd',2)
+ ###>cd
+func_odbc_round=yes # Function ROUND(2 arg)
+ ###
+ ###<select round(5.63,2)
+ ###>5.63
+func_odbc_rtrim=yes # Function RTRIM
+ ###
+ ###<select rtrim(' abcd ')
+ ###> abcd
+func_odbc_second=yes # Function SECOND
+ ###< insert into crash_me_t values(20:08:16)
+ ###
+ ###<select second('12:13:14')
+ ###>14
+func_odbc_sign=yes # Function SIGN
+ ###
+ ###<select sign(-5)
+ ###>-1
+func_odbc_sin=yes # Function SIN
+ ###
+ ###<select sin(1)
+ ###>0.841471
+func_odbc_soundex=yes # Function SOUNDEX
+ ###
+ ###<select soundex('hello')
+ ###>H400
+func_odbc_space=yes # Function SPACE
+ ###
+ ###<select space(5)
+ ###>
+func_odbc_sqrt=yes # Function SQRT
+ ###
+ ###<select sqrt(4)
+ ###>2.000000
+func_odbc_substring=yes # Function ODBC SUBSTRING
+ ###
+ ###<select substring('abcd',3,2)
+ ###>cd
+func_odbc_tan=yes # Function TAN
+ ###
+ ###<select tan(1)
+ ###>1.557408
+func_odbc_timestampadd=no # Function TIMESTAMPADD
+ ###
+ ###<select timestampadd(SQL_TSI_SECOND,1,'1997-01-01 00:00:00')
+ ###> execute failed: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 '(SQL_TSI_SECOND,1,'1997-01-01 00:00:00')' at line 1
+ ###
+ ###<select {fn timestampadd(SQL_TSI_SECOND,1,{ts '1997-01-01 00:00:00'}) }
+ ###> execute failed: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 '(SQL_TSI_SECOND,1,{ts '1997-01-01 00:00:00'}) }' at line 1
+func_odbc_timestampdiff=no # Function TIMESTAMPDIFF
+ ###
+ ###<select timestampdiff(SQL_TSI_SECOND,'1997-01-01 00:00:02', '1997-01-01 00:00:01')
+ ###> execute failed: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 '(SQL_TSI_SECOND,'1997-01-01 00:00:02', '1997-01-01 00:00:01')'
+ ###
+ ###<select {fn timestampdiff(SQL_TSI_SECOND,{ts '1997-01-01 00:00:02'}, {ts '1997-01-01 00:00:01'}) }
+ ###> execute failed: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 '(SQL_TSI_SECOND,{ts '1997-01-01 00:00:02'}, {ts '1997-01-01 00:
+func_odbc_truncate=yes # Function TRUNCATE
+ ###
+ ###<select truncate(18.18,-1)
+ ###>10
+func_odbc_ucase=yes # Function UCASE
+ ###
+ ###<select ucase('abc')
+ ###>ABC
+func_odbc_user()=yes # Function USER()
+ ###
+ ###<select user()
+ ###>monty@localhost
+func_odbc_week=USA # WEEK
+ ###<select week('1997-02-01')
+ ###>4
+ ###We expected '5' but got '4'
+func_odbc_year=yes # Function YEAR
+ ###< insert into crash_me_d values('1997-02-01')
+ ###
+ ###<select year(a) from crash_me_d
+ ###>1997
+func_sql_+=yes # Function +, -, * and /
+ ###
+ ###<select 5*3-4/2+1
+ ###>14.00
+func_sql_bit_length=yes # Function BIT_LENGTH
+ ###
+ ###<select bit_length('abc')
+ ###>24
+func_sql_cast=yes # Function CAST
+ ###
+ ###<select CAST(1 as CHAR)
+ ###>1
+func_sql_char_length=error # Function CHAR_LENGTH
+ ###
+ ###<select char_length(b) from crash_me
+ ###>1
+ ###We expected '10' but got '1'
+func_sql_char_length(constant)=yes # Function CHAR_LENGTH(constant)
+ ###
+ ###<select char_length('abcd')
+ ###>4
+func_sql_character_length=yes # Function CHARACTER_LENGTH
+ ###
+ ###<select character_length('abcd')
+ ###>4
+func_sql_coalesce=yes # Function COALESCE
+ ###
+ ###<select coalesce(NULL,'bcd','qwe')
+ ###>bcd
+func_sql_concat_as_||=error # Function concatenation with ||
+ ###
+ ###<select 'abc' || 'def'
+ ###>0
+ ###We expected 'abcdef' but got '0'
+func_sql_current_date=yes # Function CURRENT_DATE
+ ###
+ ###<select current_date
+ ###>2003-08-27
+func_sql_current_time=yes # Function CURRENT_TIME
+ ###
+ ###<select current_time
+ ###>19:55:21
+func_sql_current_timestamp=yes # Function CURRENT_TIMESTAMP
+ ###
+ ###<select current_timestamp
+ ###>2003-08-27 19:55:21
+func_sql_current_user=with_parenthesis # CURRENT_USER
+ ###< select CURRENT_USER
+ ###> execute error:Unknown column 'CURRENT_USER' in 'field list'
+ ###
+ ###< select CURRENT_USER()
+ ###> OK
+func_sql_extract_sql=yes # Function EXTRACT
+ ###
+ ###<select extract(minute from timestamp '2000-02-23 18:43:12.987')
+ ###>43
+func_sql_localtime=yes # Function LOCALTIME
+ ###
+ ###<select localtime
+ ###>2003-08-27 19:55:21
+func_sql_localtimestamp=yes # Function LOCALTIMESTAMP
+ ###
+ ###<select localtimestamp
+ ###>2003-08-27 19:55:21
+func_sql_lower=yes # Function LOWER
+ ###
+ ###<select LOWER('ABC')
+ ###>abc
+func_sql_nullif_num=yes # Function NULLIF with numbers
+ ###
+ ###<select NULLIF(NULLIF(1,2),1)
+ ###>
+func_sql_nullif_string=yes # Function NULLIF with strings
+ ###
+ ###<select NULLIF(NULLIF('first','second'),'first')
+ ###>
+func_sql_octet_length=yes # Function OCTET_LENGTH
+ ###
+ ###<select octet_length('abc')
+ ###>3
+func_sql_position=yes # Function POSITION
+ ###
+ ###<select position('ll' in 'hello')
+ ###>3
+func_sql_searched_case=yes # Function searched CASE
+ ###
+ ###<select case when 1 > 2 then 'false' when 2 > 1 then 'true' end
+ ###>true
+func_sql_session_user=with_parenthesis # SESSION_USER
+ ###< select SESSION_USER
+ ###> execute error:Unknown column 'SESSION_USER' in 'field list'
+ ###
+ ###< select SESSION_USER()
+ ###> OK
+func_sql_simple_case=yes # Function simple CASE
+ ###
+ ###<select case 2 when 1 then 'false' when 2 then 'true' end
+ ###>true
+func_sql_substring=yes # Function ANSI SQL SUBSTRING
+ ###
+ ###<select substring('abcd' from 2 for 2)
+ ###>bc
+func_sql_system_user=with_parenthesis # SYSTEM_USER
+ ###< select SYSTEM_USER
+ ###> execute error:Unknown column 'SYSTEM_USER' in 'field list'
+ ###
+ ###< select SYSTEM_USER()
+ ###> OK
+func_sql_trim=yes # Function TRIM
+ ###
+ ###<select trim(trailing from trim(LEADING FROM ' abc '))
+ ###>abc
+func_sql_upper=yes # Function UPPER
+ ###
+ ###<select UPPER('abc')
+ ###>ABC
+func_sql_user=with_parenthesis # USER
+ ###< select USER
+ ###> execute error:Unknown column 'USER' in 'field list'
+ ###
+ ###< select USER()
+ ###> OK
+func_where_between=yes # Function BETWEEN
+ ###
+ ###<select a from crash_me where 5 between 4 and 6
+ ###>1
+func_where_eq_all=no # Function = ALL
+ ###
+ ###<select a from crash_me where b =all (select b from crash_me)
+ ###> execute failed: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 'all (select b from crash_me)' at line 1
+func_where_eq_any=no # Function = ANY
+ ###
+ ###<select a from crash_me where b =any (select b from crash_me)
+ ###> execute failed: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 b from crash_me)' at line 1
+func_where_eq_some=no # Function = SOME
+ ###
+ ###<select a from crash_me where b =some (select b from crash_me)
+ ###> execute failed: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 b from crash_me)' at line 1
+func_where_exists=no # Function EXISTS
+ ###
+ ###<select a from crash_me where exists (select * from crash_me)
+ ###> execute failed: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 'exists (select * from crash_me)' at line 1
+func_where_in_num=yes # Function IN on numbers
+ ###
+ ###<select a from crash_me where 2 in (3,2,5,9,5,1)
+ ###>1
+func_where_like=yes # Function LIKE
+ ###
+ ###<select a from crash_me where b like 'a%'
+ ###>1
+func_where_like_escape=yes # Function LIKE ESCAPE
+ ###
+ ###<select a from crash_me where b like '%' escape 'a'
+ ###>1
+func_where_match=no # Function MATCH
+ ###
+ ###<select a from crash_me where 1 match (select a from crash_me)
+ ###> execute failed: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 'match (select a from crash_me)' at line 1
+func_where_match_unique=no # Function MATCH UNIQUE
+ ###
+ ###<select a from crash_me where 1 match unique (select a from crash_me)
+ ###> execute failed: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 'match unique (select a from crash_me)' at line 1
+func_where_matches=no # Function MATCHES
+ ###
+ ###<select a from crash_me where b matcjhes 'a*'
+ ###> execute failed: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 'matcjhes 'a*'' at line 1
+func_where_not_between=yes # Function NOT BETWEEN
+ ###
+ ###<select a from crash_me where 7 not between 4 and 6
+ ###>1
+func_where_not_exists=no # Function NOT EXISTS
+ ###
+ ###<select a from crash_me where not exists (select * from crash_me where a = 2)
+ ###> execute failed: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 'exists (select * from crash_me where a = 2)' at line 1
+func_where_not_like=yes # Function NOT LIKE
+ ###
+ ###<select a from crash_me where b not like 'b%'
+ ###>1
+func_where_not_unique=no # Function NOT UNIQUE
+ ###
+ ###<select a from crash_me where not unique (select * from crash_me where a = 2)
+ ###> execute failed: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 'unique (select * from crash_me where a = 2)' at line 1
+func_where_unique=no # Function UNIQUE
+ ###
+ ###<select a from crash_me where unique (select * from crash_me)
+ ###> execute failed: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 'unique (select * from crash_me)' at line 1
+functions=yes # Functions
+ ###< select 1+1
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+group_by=yes # Group by
+ ###< select a from crash_me group by a
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+group_by_alias=yes # Group by alias
+ ###< select a as ab from crash_me group by ab
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+group_by_null=yes # Group on column with null values
+ ###< create table crash_q (s char(10))
+ ###> OK
+ ###< insert into crash_q values(null)
+ ###> OK
+ ###< insert into crash_q values(null)
+ ###> OK
+ ###
+ ###<select count(*),s from crash_q group by s
+ ###>2
+ ###
+ ###< drop table crash_q
+ ###> OK
+group_by_position=yes # Group by position
+ ###< select a from crash_me group by 1
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+group_distinct_functions=yes # Group functions with distinct
+ ###< select count(distinct a) from crash_me
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+group_func_extra_bit_and=yes # Group function BIT_AND
+ ###
+ ###<select bit_and(a),a from crash_me group by a
+ ###>1
+group_func_extra_bit_or=yes # Group function BIT_OR
+ ###
+ ###<select bit_or(a),a from crash_me group by a
+ ###>1
+group_func_extra_count_distinct_list=yes # Group function COUNT(DISTINCT expr,expr,...)
+ ###
+ ###<select count(distinct a,b),a from crash_me group by a
+ ###>1
+group_func_extra_std=yes # Group function STD
+ ###
+ ###<select std(a),a from crash_me group by a
+ ###>0.0000
+group_func_extra_stddev=yes # Group function STDDEV
+ ###
+ ###<select stddev(a),a from crash_me group by a
+ ###>0.0000
+group_func_extra_variance=no # Group function VARIANCE
+ ###
+ ###<select variance(a),a from crash_me group by a
+ ###> execute failed: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 '(a),a from crash_me group by a' at line 1
+group_func_sql_any=no # Group function ANY
+ ###
+ ###<select any(a),a from crash_me group by a
+ ###> execute failed: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 '(a),a from crash_me group by a' at line 1
+group_func_sql_avg=yes # Group function AVG
+ ###
+ ###<select avg(a),a from crash_me group by a
+ ###>1.0000
+group_func_sql_count_*=yes # Group function COUNT (*)
+ ###
+ ###<select count(*),a from crash_me group by a
+ ###>1
+group_func_sql_count_column=yes # Group function COUNT column name
+ ###
+ ###<select count(a),a from crash_me group by a
+ ###>1
+group_func_sql_count_distinct=yes # Group function COUNT(DISTINCT expr)
+ ###
+ ###<select count(distinct a),a from crash_me group by a
+ ###>1
+group_func_sql_every=no # Group function EVERY
+ ###
+ ###<select every(a),a from crash_me group by a
+ ###> execute failed: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 '(a),a from crash_me group by a' at line 1
+group_func_sql_max=yes # Group function MAX on numbers
+ ###
+ ###<select max(a),a from crash_me group by a
+ ###>1
+group_func_sql_max_str=yes # Group function MAX on strings
+ ###
+ ###<select max(b),a from crash_me group by a
+ ###>a
+group_func_sql_min=yes # Group function MIN on numbers
+ ###
+ ###<select min(a),a from crash_me group by a
+ ###>1
+group_func_sql_min_str=yes # Group function MIN on strings
+ ###
+ ###<select min(b),a from crash_me group by a
+ ###>a
+group_func_sql_some=no # Group function SOME
+ ###
+ ###<select some(a),a from crash_me group by a
+ ###> execute failed: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 '(a),a from crash_me group by a' at line 1
+group_func_sql_sum=yes # Group function SUM
+ ###
+ ###<select sum(a),a from crash_me group by a
+ ###>1
+group_functions=yes # Group functions
+ ###< select count(*) from crash_me
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+group_many_distinct_functions=yes # Group functions with several distinct
+ ###< select count(distinct a), count(distinct b) from crash_me
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+group_on_unused=yes # Group on unused column
+ ###< select count(*) from crash_me group by a
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+has_true_false=no # TRUE and FALSE
+ ###< select (1=1)=true
+ ###> execute error:Unknown column 'true' in 'field list'
+having=yes # Having
+ ###<select a from crash_me group by a having a > 0
+ ###>1
+ ###
+ ###<select a from crash_me group by a having a < 0
+ ###> didn't return any result:
+having_with_alias=yes # Having on alias
+ ###< select a as ab from crash_me group by a having ab > 0
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+having_with_group=yes # Having with group function
+ ###< select a from crash_me group by a having count(*) = 1
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+hex_numbers=yes # hex numbers (0x41)
+ ###< select 0x41
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+hex_strings=yes # hex strings (x'1ace')
+ ###< select x'1ace'
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+ignore_end_space=yes # Ignore end space in compare
+ ###
+ ###<select b from crash_me where b = 'a '
+ ###>a
+index_in_create=yes # index in create table
+ ###< create table crash_q (q integer not null,index (q))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+index_namespace=yes # different namespace for index
+ ###< create index crash_me on crash_me (b)
+ ###> OK
+ ###< drop index crash_me on crash_me
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+index_parts=yes # index on column part (extension)
+ ###< create index crash_q on crash_me (b(5))
+ ###> OK
+ ###< drop index crash_q on crash_me
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+inner_join=yes # inner join
+ ###< select crash_me.a from crash_me inner join crash_me2 ON crash_me.a=crash_me2.a
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+insert_default_values=no # INSERT DEFAULT VALUES
+ ###< create table crash_me_q (a int)
+ ###> OK
+ ###< insert into crash_me_q DEFAULT VALUES
+ ###> execute error: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 VALUES' at line 1
+ ###< drop table crash_me_q
+ ###> OK
+ ###
+ ###As far as some queries didnt return OK, result is NO
+insert_empty_string=yes # insert empty string
+ ###< create table crash_q (a char(10) not null,b char(10))
+ ###> OK
+ ###< insert into crash_q values ('','')
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+insert_multi_value=yes # INSERT with Value lists
+ ###< create table crash_q (s char(10))
+ ###> OK
+ ###< insert into crash_q values ('a'),('b')
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+insert_select=yes # insert INTO ... SELECT ...
+ ###< create table crash_q (a int)
+ ###> OK
+ ###< insert into crash_q (a) SELECT crash_me.a from crash_me
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+insert_with_default=yes # INSERT with DEFAULT
+ ###< create table crash_me_q (a int)
+ ###> OK
+ ###< insert into crash_me_q (a) values (DEFAULT)
+ ###> OK
+ ###< drop table crash_me_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+insert_with_empty_value_list=no # INSERT with empty value list
+ ###< create table crash_me_q (a int)
+ ###> OK
+ ###< insert into crash_me_q (a) values ()
+ ###> execute error:Column count doesn't match value count at row 1
+ ###< drop table crash_me_q
+ ###> OK
+ ###
+ ###As far as some queries didnt return OK, result is NO
+insert_with_set=yes # INSERT with set syntax
+ ###< create table crash_q (a integer)
+ ###> OK
+ ###< insert into crash_q SET a=1
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+intersect=no # intersect
+ ###< select * from crash_me intersect select * from crash_me3
+ ###> execute error: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 crash_me3' at line 1
+ ###
+ ###As far as some queries didnt return OK, result is NO
+intersect_all=no # intersect all
+ ###< select * from crash_me intersect all select * from crash_me3
+ ###> execute error: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 'all select * from crash_me3' at line 1
+ ###
+ ###As far as some queries didnt return OK, result is NO
+intersect_all_incompat=no # intersect all (incompatible lists)
+ ###< select * from crash_me intersect all select * from crash_me2
+ ###> execute error: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 'all select * from crash_me2' at line 1
+ ###
+ ###As far as some queries didnt return OK, result is NO
+intersect_incompat=no # intersect (incompatible lists)
+ ###< select * from crash_me intersect select * from crash_me2
+ ###> execute error: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 crash_me2' at line 1
+ ###
+ ###As far as some queries didnt return OK, result is NO
+join_tables=31 # tables in join
+ ###We are trying (example with N=5):
+ ###select crash_me.a,t0.a,t1.a,t2.a,t3.a,t4.a from crash_me,crash_me t0,crash_me t1,crash_me t2,crash_me t3,crash_me t4
+ ### 32:FAIL 7:OK 19:OK 25:OK 28:OK 30:OK 31:FAIL
+left_outer_join=yes # left outer join
+ ###< select crash_me.a from crash_me left join crash_me2 ON crash_me.a=crash_me2.a
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+left_outer_join_using=yes # left outer join using
+ ###< select c1 from crash_me left join crash_me2 using (a)
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+length_of_varchar_field=actual length # CHARACTER_LENGTH(varchar_field)
+ ###< CREATE TABLE crash_me1 (S1 VARCHAR(100))
+ ###> OK
+ ###< INSERT INTO crash_me1 VALUES ('X')
+ ###> OK
+ ###
+ ###< SELECT CHARACTER_LENGTH(S1) FROM crash_me1
+ ### > 1
+ ###< drop table crash_me1
+ ###> OK
+like_with_column=yes # column LIKE column
+ ###< create table crash_q (a char(10),b char(10))
+ ###> OK
+ ###< insert into crash_q values('abc','abc')
+ ###> OK
+ ###< select * from crash_q where a like b
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+like_with_number=yes # LIKE on numbers
+ ###< create table crash_q (a int,b int)
+ ###> OK
+ ###< insert into crash_q values(10,10)
+ ###> OK
+ ###< select * from crash_q where a like '10'
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+lock_tables=yes # lock table
+ ###< lock table crash_me READ
+ ###> OK
+ ###< unlock tables
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+logical_value=1 # Value of logical operation (1=1)
+ ###<select (1=1)
+ ###>1
+max_big_expressions=10 # big expressions
+ ###We are trying (example with N=5):
+ ###select 0+(1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+...(14308)
+ ### 50:FAIL 10:OK 30:FAIL 14:FAIL 11:FAIL
+max_char_size=255 # max char() size
+ ###We are trying (example with N=5):
+ ###create table crash_q (q char(5))
+ ###insert into crash_q values ('aaaaa')
+ ###select * from crash_q
+ ### 524287:FAIL 104858:FAIL 20972:FAIL 4195:FAIL 839:FAIL 168:OK 503:FAIL 235:OK 369:FAIL 262:FAIL 241:OK 251:OK 256:FAIL 252:OK 254:OK 255:OK
+max_column_name=64 # column name length
+ ###We are trying (example with N=5):
+ ###create table crash_q (qaaaaa integer)
+ ###insert into crash_q (qaaaaa) values(1)
+ ###select qaaaaa from crash_q
+ ### 256:FAIL 51:OK 153:FAIL 72:FAIL 55:OK 63:OK 67:FAIL 64:FAIL
+max_columns=3398 # Columns in table
+ ###We are trying (example with N=5):
+ ###create table crash_q (a integer ,a0 integer,a1 integer,a2 integer,a3 integer,a4 integer)
+ ### 4096:FAIL 819:OK 2457:OK 3276:OK 3686:FAIL 3358:OK 3522:FAIL 3391:OK 3456:FAIL 3404:FAIL 3394:OK 3399:FAIL 3395:OK 3397:OK 3398:FAIL
+max_conditions=85660 # OR and AND in WHERE
+ ###We are trying (example with N=5):
+ ###select a from crash_me where a=1 and b='a' or a=0 and b='0' or a=1 and b='1' or a=2 and b='2' or a=3 and b='3' or a=4 and b='4'
+ ### 27592:OK 41389:OK 48287:FAIL 42769:OK 45528:FAIL 43321:FAIL 42880:FAIL 42791:OK 42835:FAIL 42800:OK 42817:OK 42826:OK 42830:OK 42832:FAIL 42831:FAIL
+max_expressions=1450 # simple expressions
+ ###We are trying (example with N=5):
+ ###select 1+1+1+1+1+1
+ ### 5000:FAIL 1000:OK 3000:FAIL 1400:OK 2200:FAIL 1560:FAIL 1432:OK 1496:FAIL 1445:OK 1470:FAIL 1450:OK 1460:FAIL 1452:FAIL 1451:FAIL
+max_index=32 # max index
+ ### max_unique_index=32 ,so max_index must be same
+max_index_length=500 # index length
+ ###We are trying (example with N=5):
+ ###create table crash_q (q0 char(5) not null,unique (q0))
+ ###insert into crash_q values('aaaaa')
+ ### 4096:FAIL 819:FAIL 164:OK 491:OK 655:FAIL 524:FAIL 498:OK 511:FAIL 501:FAIL 499:OK 500:OK
+max_index_name=64 # index name length
+ ###We are trying (example with N=5):
+ ###create index crash_qaaaaa on crash_me (a)
+ ### 256:FAIL 51:OK 153:FAIL 72:FAIL 55:OK 63:FAIL 57:OK 60:FAIL 58:FAIL
+max_index_part_length=255 # max index part length
+ ###We are trying (example with N=5):
+ ###create table crash_q (q char(5) not null,unique(q))
+ ###insert into crash_q (q) values ('aaaaa')
+ ###select q from crash_q
+max_index_parts=16 # index parts
+ ###We are trying (example with N=5):
+ ###create table crash_q (q0 integer not null,q1 integer not null,q2 integer not null,q3 integer not null,q4 integer not nul...(1263)
+ ###insert into crash_q (q0,q1,q2,q3,q4,q5,q6,q7,q8,q9,q10,q11,q12,q13,q14,q15,q16,q17,q18,q19,q20,q21,q22,q23,q24,q25,q26,q...(284)
+ ###select q0 from crash_q
+ ### 32:FAIL 7:OK 19:FAIL 10:OK 14:OK 16:FAIL 15:OK
+max_index_varchar_part_length=255 # index varchar part length
+ ###We are trying (example with N=5):
+ ###create table crash_q (q varchar(5) not null,unique(q))
+ ###insert into crash_q (q) values ('aaaaa')
+ ###select q from crash_q
+max_row_length=65534 # max table row length (without blobs)
+ ###We are trying (example with N=5):
+ ###create table crash_q (q0 char(5) not null)
+ ###insert into crash_q values ('aaaaa')
+ ### 433245:FAIL 86649:FAIL 17330:OK 51989:OK 69319:FAIL 55455:OK 62387:OK 65853:FAIL 63080:OK 64466:OK 65159:OK 65506:OK 65679:FAIL 65541:FAIL 65513:OK 65527:OK 65534:OK 65537:FAIL 65535:FAIL
+max_row_length_with_null=65502 # table row length with nulls (without blobs)
+ ###We are trying (example with N=5):
+ ###create table crash_q (q0 char(5) )
+ ###insert into crash_q values ('aaaaa')
+ ### 65534:FAIL 13107:OK 39320:OK 52427:OK 58980:OK 62257:OK 63895:OK 64714:OK 65124:OK 65329:OK 65431:OK 65482:OK 65508:FAIL 65487:OK 65497:OK 65502:OK 65505:FAIL 65503:FAIL
+max_select_alias_name=+512 # select alias name length
+ ###We are trying (example with N=5):
+ ###select b as aaaaa from crash_me
+max_stack_expression=1450 # stacked expressions
+ ###We are trying (example with N=5):
+ ###select 1+(1+(1+(1+(1+(1)))))
+ ### 1000:OK 1500:FAIL 1100:OK 1300:OK 1400:OK 1450:OK 1475:FAIL 1455:FAIL 1451:FAIL
+max_table_alias_name=+512 # table alias name length
+ ###We are trying (example with N=5):
+ ###select aaaaa.b from crash_me aaaaa
+max_table_name=64 # table name length
+ ###We are trying (example with N=5):
+ ###create table crash_qaaaaa (q integer)
+ ###insert into crash_qaaaaa values(1)
+ ###select * from crash_qaaaaa
+ ### 256:FAIL 51:OK 153:FAIL 72:FAIL 55:OK 63:FAIL 57:OK 60:FAIL 58:FAIL
+max_text_size=1048543 # max text or blob size
+ ###We are trying (example with N=5):
+ ###create table crash_q (q mediumtext)
+ ###insert into crash_q values ('aaaaa')
+ ###select * from crash_q
+ ### 524272:OK 786408:OK 917476:OK 983010:OK 1015777:OK 1032161:OK 1040353:OK 1044449:OK 1046497:OK 1047521:OK 1048033:OK 1048289:OK 1048417:OK 1048481:OK 1048513:OK 1048529:OK 1048537:OK 1048541:OK 1048543:OK 1048544:FAIL
+max_unique_index=32 # unique indexes
+ ###We are trying (example with N=5):
+ ###create table crash_q (q integer,q1 integer not null,unique (q1),q2 integer not null,unique (q2),q3 integer not null,uniq...(72)
+ ###insert into crash_q (q,q1,q2,q3,q4,q5) values (1,1,1,1,1,1)
+ ###select q from crash_q
+ ### 32:OK 48:FAIL 35:FAIL 33:FAIL
+max_varchar_size=255 # max varchar() size
+ ###We are trying (example with N=5):
+ ###create table crash_q (q varchar(5))
+ ###insert into crash_q values ('aaaaa')
+ ###select * from crash_q
+ ### 524287:FAIL 104858:FAIL 20972:FAIL 4195:FAIL 839:FAIL 168:OK 503:FAIL 235:OK 369:FAIL 262:FAIL 241:OK 251:OK 256:FAIL 252:OK 254:OK 255:OK
+minus=no # minus
+ ###< select * from crash_me minus select * from crash_me3
+ ###> execute error: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 crash_me3' at line 1
+ ###
+ ###As far as some queries didnt return OK, result is NO
+minus_incompat=no # minus (incompatible lists)
+ ###< select * from crash_me minus select * from crash_me2
+ ###> execute error: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 crash_me2' at line 1
+ ###
+ ###As far as some queries didnt return OK, result is NO
+minus_neg=yes # Calculate 1--1
+ ###
+ ###<select a--1 from crash_me
+ ###>2
+multi_drop=yes # many tables to drop table
+ ###< create table crash_q (a int)
+ ###> OK
+ ###< create table crash_q2 (a int)
+ ###> OK
+ ###< drop table crash_q,crash_q2
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+multi_null_in_unique=yes # null in unique index
+ ###< create table crash_q (q integer, x integer,unique (q))
+ ###> OK
+ ###< insert into crash_q(x) values(1)
+ ###> OK
+ ###< insert into crash_q(x) values(2)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+multi_strings=yes # Multiple line strings
+ ###
+ ###<select a from crash_me where b < 'a'
+ ###'b'
+ ###>1
+multi_table_delete=yes # DELETE FROM table1,table2...
+ ###< create table crash_q (a integer,b char(10))
+ ###> OK
+ ###< insert into crash_q values(1,'c')
+ ###> OK
+ ###< delete crash_q.* from crash_q,crash_me where crash_q.a=crash_me.a
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+multi_table_update=yes # Update with many tables
+ ###< create table crash_q (a integer,b char(10))
+ ###> OK
+ ###< insert into crash_q values(1,'c')
+ ###> OK
+ ###< update crash_q left join crash_me on crash_q.a=crash_me.a set crash_q.b=crash_me.b
+ ###> OK
+ ###
+ ###<select b from crash_q
+ ###>a
+ ###
+ ###< drop table crash_q
+ ###> OK
+natural_join=yes # natural join
+ ###< select * from crash_me natural join crash_me3
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+natural_join_incompat=yes # natural join (incompatible lists)
+ ###< select c1 from crash_me natural join crash_me2
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+natural_left_outer_join=yes # natural left outer join
+ ###< select c1 from crash_me natural left join crash_me2
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+no_primary_key=yes # Tables without primary key
+ ###< create table crash_me (a integer not null,b char(10) not null)
+ ###> OK
+ ###< insert into crash_me (a,b) values (1,'a')
+ ###> OK
+not_id_between=no # NOT ID BETWEEN interprets as ID NOT BETWEEN
+ ###< create table crash_me_b (i int)
+ ###> OK
+ ###< insert into crash_me_b values(2)
+ ###> OK
+ ###< insert into crash_me_b values(5)
+ ###> OK
+ ###
+ ###<select i from crash_me_b where not i between 1 and 3
+ ###> didn't return any result:
+ ###
+ ###< drop table crash_me_b
+ ###> OK
+null_concat_expr=yes # Is concat('a',NULL) = NULL
+ ###
+ ###<select concat('a',NULL)
+ ###>
+null_in_index=yes # null in index
+ ###< create table crash_q (a char(10),index (a))
+ ###> OK
+ ###< insert into crash_q values (NULL)
+ ###> OK
+ ###
+ ###<select * from crash_q
+ ###>
+ ###
+ ###< drop table crash_q
+ ###> OK
+null_in_unique=yes # null in unique index
+ ###< create table crash_q (q integer,unique (q))
+ ###> OK
+ ###< insert into crash_q (q) values(NULL)
+ ###> OK
+ ###< insert into crash_q (q) values(NULL)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+null_num_expr=yes # Is 1+NULL = NULL
+ ###
+ ###<select 1+NULL
+ ###>
+nulls_in_unique=yes # null combination in unique index
+ ###< create table crash_q (q integer,q1 integer,unique (q,q1))
+ ###> OK
+ ###< insert into crash_q (q,q1) values(1,NULL)
+ ###> OK
+ ###< insert into crash_q (q,q1) values(1,NULL)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+odbc_left_outer_join=yes # left outer join odbc style
+ ###< select crash_me.a from { oj crash_me left outer join crash_me2 ON crash_me.a=crash_me2.a }
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+operating_system=Linux 2.4.20-64GB-SMP i686 # crash-me tested on
+order_by=yes # Order by
+ ###< select a from crash_me order by a
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+order_by_alias=yes # Order by alias
+ ###< select a as ab from crash_me order by ab
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+order_by_function=yes # Order by function
+ ###< select a from crash_me order by a+1
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+order_by_position=yes # Order by position
+ ###< select a from crash_me order by 1
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+order_on_unused=yes # Order by on unused column
+ ###< select b from crash_me order by a
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+position_of_null=first # Where is null values in sorted recordset
+ ###< insert into crash_me_n (i) values(1)
+ ###> OK
+ ###< insert into crash_me_n values(2,2)
+ ###> OK
+ ###< insert into crash_me_n values(3,3)
+ ###> OK
+ ###< insert into crash_me_n values(4,4)
+ ###> OK
+ ###< insert into crash_me_n (i) values(5)
+ ###> OK
+ ###
+ ###< select r from crash_me_n order by r
+ ###>
+ ###>
+ ###> 2
+ ###> 3
+ ###> 4
+position_of_null_desc=last # Where is null values in sorted recordset (DESC)
+ ###< select r from crash_me_n order by r desc
+ ###> 4
+ ###> 3
+ ###> 2
+ ###>
+ ###>
+primary_key_in_create=yes # primary key in create table
+ ###< create table crash_q (q integer not null,primary key (q))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+psm_functions=no # PSM functions (ANSI SQL)
+ ###< create table crash_q (a int)
+ ###> OK
+ ###< create function crash_func(in a1 int, in b1 int) returns int language sql deterministic contains sql begin return a1 * b1; end
+ ###> execute error: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 '(in a1 int, in b1 int) returns int language sql deterministic c
+ ###< insert into crash_q values(crash_func(2,4))
+ ###> execute error: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,4))' at line 1
+ ###< select a,crash_func(a,2) from crash_q
+ ###> execute error: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 '(a,2) from crash_q' at line 1
+ ###< drop function crash_func cascade
+ ###> execute error: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 'cascade' at line 1
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as some queries didnt return OK, result is NO
+psm_modules=no # PSM modules (ANSI SQL)
+ ###< create table crash_q (a int,b int)
+ ###> OK
+ ###< create module crash_m declare procedure crash_proc(in a1 int, in b1 int) language sql modifies sql data begin declare c1 int; set c1 = a1 + b1; insert into crash_q(a,b) values (a1,c1); end; declare procedure crash_proc2(INOUT a int, in b int) contains sql set a = b + 10; end module
+ ###> execute error: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 'module crash_m declare procedure crash_proc(in a1 int, in b1 in
+ ###< call crash_proc(1,10)
+ ###> execute error: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 'call crash_proc(1,10)' at line 1
+ ###< drop module crash_m cascade
+ ###> execute error: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 'module crash_m cascade' at line 1
+ ###< drop table crash_q cascade
+ ###> OK
+ ###
+ ###As far as some queries didnt return OK, result is NO
+psm_procedures=no # PSM procedures (ANSI SQL)
+ ###< create table crash_q (a int,b int)
+ ###> OK
+ ###< create procedure crash_proc(in a1 int, in b1 int) language sql modifies sql data begin declare c1 int; set c1 = a1 + b1; insert into crash_q(a,b) values (a1,c1); end
+ ###> execute error: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 'procedure crash_proc(in a1 int, in b1 int) language sql modifie
+ ###< call crash_proc(1,10)
+ ###> execute error: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 'call crash_proc(1,10)' at line 1
+ ###< drop procedure crash_proc
+ ###> execute error: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 'procedure crash_proc' at line 1
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as some queries didnt return OK, result is NO
+psm_trigger=no # Triggers (ANSI SQL)
+ ###< create table crash_q (a int ,b int)
+ ###> OK
+ ###< create trigger crash_trigger after insert on crash_q referencing new table as new_a when (localtime > time '18:00:00') begin atomic end
+ ###> execute error: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 'trigger crash_trigger after insert on crash_q referencing new t
+ ###< insert into crash_q values(1,2)
+ ###> OK
+ ###< drop trigger crash_trigger
+ ###> execute error: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 'trigger crash_trigger' at line 1
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as some queries didnt return OK, result is NO
+query_size=1048574 # query size
+quote_ident_with_"=error # " as identifier quote (ANSI SQL)
+ ###
+ ###<select "A" from crash_me
+ ###>A
+ ###We expected '1' but got 'A'
+quote_ident_with_[=no # [] as identifier quote
+ ###
+ ###<select [A] from crash_me
+ ###> execute failed: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 '[A] from crash_me' at line 1
+quote_ident_with_`=yes # ` as identifier quote
+ ###
+ ###<select `A` from crash_me
+ ###>1
+quote_ident_with_dbl_"=no # Double "" in identifiers as "
+ ###< create table crash_me1 ("abc""d" integer)
+ ###> execute error: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 '"abc""d" integer)' at line 1
+ ###< drop table crash_me1
+ ###> execute error:Unknown table 'crash_me1'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+quote_with_"=yes # Allows ' and " as string markers
+ ###< select a from crash_me where b<"c"
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+remember_end_space=no # Remembers end space in char()
+ ###< create table crash_q (a char(10))
+ ###> OK
+ ###< insert into crash_q values('hello ')
+ ###> OK
+ ###
+ ###<select a from crash_q where a = 'hello '
+ ###>hello
+ ###We expected 'hello ' but got 'hello'
+ ###
+ ###< drop table crash_q
+ ###> OK
+remember_end_space_varchar=no # Remembers end space in varchar()
+ ###< create table crash_q (a varchar(10))
+ ###> OK
+ ###< insert into crash_q values('hello ')
+ ###> OK
+ ###
+ ###<select a from crash_q where a = 'hello '
+ ###>hello
+ ###We expected 'hello ' but got 'hello'
+ ###
+ ###< drop table crash_q
+ ###> OK
+rename_table=yes # rename table
+ ###< create table crash_q (a integer, b integer,c1 CHAR(10))
+ ###> OK
+ ###< rename table crash_q to crash_q1
+ ###> OK
+ ###< drop table crash_q1
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+repeat_string_size=1047552 # return string size from function
+ ###We are trying (example with N=5):
+ ###select repeat('a',5)
+ ### 4000000:FAIL 800000:OK 2400000:FAIL 1120000:FAIL 864000:OK 992000:OK 1056000:FAIL 1004800:OK 1030400:OK 1043200:OK 1049600:FAIL 1044480:OK 1047040:OK 1048320:FAIL 1047296:OK 1047808:FAIL 1047399:OK 1047603:FAIL 1047440:OK 1047521:OK 1047562:FAIL 1047529:OK 1047545:OK 1047553:FAIL 1047547:OK 1047550:OK 1047551:OK 1047552:OK
+reserved_word_ansi-92/99_absolute=no # Keyword ABSOLUTE
+ ###< create table crash_me10 (ABSOLUTE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_action=no # Keyword ACTION
+ ###< create table crash_me10 (ACTION int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_add=yes # Keyword ADD
+ ###< create table crash_me10 (ADD int not null)
+ ###> execute error: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 'ADD int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_after=no # Keyword AFTER
+ ###< create table crash_me10 (AFTER int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_alias=no # Keyword ALIAS
+ ###< create table crash_me10 (ALIAS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_all=yes # Keyword ALL
+ ###< create table crash_me10 (ALL int not null)
+ ###> execute error: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 'ALL int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_allocate=no # Keyword ALLOCATE
+ ###< create table crash_me10 (ALLOCATE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_alter=yes # Keyword ALTER
+ ###< create table crash_me10 (ALTER int not null)
+ ###> execute error: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 'ALTER int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_and=yes # Keyword AND
+ ###< create table crash_me10 (AND int not null)
+ ###> execute error: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 'AND int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_any=no # Keyword ANY
+ ###< create table crash_me10 (ANY int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_are=no # Keyword ARE
+ ###< create table crash_me10 (ARE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_as=yes # Keyword AS
+ ###< create table crash_me10 (AS int not null)
+ ###> execute error: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 'AS int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_asc=yes # Keyword ASC
+ ###< create table crash_me10 (ASC int not null)
+ ###> execute error: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 'ASC int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_assertion=no # Keyword ASSERTION
+ ###< create table crash_me10 (ASSERTION int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_at=no # Keyword AT
+ ###< create table crash_me10 (AT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_authorization=no # Keyword AUTHORIZATION
+ ###< create table crash_me10 (AUTHORIZATION int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_before=no # Keyword BEFORE
+ ###< create table crash_me10 (BEFORE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_begin=no # Keyword BEGIN
+ ###< create table crash_me10 (BEGIN int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_bit=no # Keyword BIT
+ ###< create table crash_me10 (BIT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_boolean=no # Keyword BOOLEAN
+ ###< create table crash_me10 (BOOLEAN int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_both=yes # Keyword BOTH
+ ###< create table crash_me10 (BOTH int not null)
+ ###> execute error: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 'BOTH int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_breadth=no # Keyword BREADTH
+ ###< create table crash_me10 (BREADTH int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_by=yes # Keyword BY
+ ###< create table crash_me10 (BY int not null)
+ ###> execute error: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 'BY int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_call=no # Keyword CALL
+ ###< create table crash_me10 (CALL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_cascade=yes # Keyword CASCADE
+ ###< create table crash_me10 (CASCADE int not null)
+ ###> execute error: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 'CASCADE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_cascaded=no # Keyword CASCADED
+ ###< create table crash_me10 (CASCADED int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_case=yes # Keyword CASE
+ ###< create table crash_me10 (CASE int not null)
+ ###> execute error: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 'CASE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_cast=no # Keyword CAST
+ ###< create table crash_me10 (CAST int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_catalog=no # Keyword CATALOG
+ ###< create table crash_me10 (CATALOG int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_char=yes # Keyword CHAR
+ ###< create table crash_me10 (CHAR int not null)
+ ###> execute error: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 'CHAR int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_character=yes # Keyword CHARACTER
+ ###< create table crash_me10 (CHARACTER int not null)
+ ###> execute error: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 'CHARACTER int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_check=yes # Keyword CHECK
+ ###< create table crash_me10 (CHECK int not null)
+ ###> execute error: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 'int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_close=no # Keyword CLOSE
+ ###< create table crash_me10 (CLOSE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_collate=no # Keyword COLLATE
+ ###< create table crash_me10 (COLLATE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_collation=no # Keyword COLLATION
+ ###< create table crash_me10 (COLLATION int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_column=yes # Keyword COLUMN
+ ###< create table crash_me10 (COLUMN int not null)
+ ###> execute error: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 'COLUMN int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_commit=no # Keyword COMMIT
+ ###< create table crash_me10 (COMMIT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_completion=no # Keyword COMPLETION
+ ###< create table crash_me10 (COMPLETION int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_connect=no # Keyword CONNECT
+ ###< create table crash_me10 (CONNECT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_connection=no # Keyword CONNECTION
+ ###< create table crash_me10 (CONNECTION int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_constraint=yes # Keyword CONSTRAINT
+ ###< create table crash_me10 (CONSTRAINT int not null)
+ ###> execute error: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 'int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_constraints=no # Keyword CONSTRAINTS
+ ###< create table crash_me10 (CONSTRAINTS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_continue=no # Keyword CONTINUE
+ ###< create table crash_me10 (CONTINUE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_corresponding=no # Keyword CORRESPONDING
+ ###< create table crash_me10 (CORRESPONDING int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_create=yes # Keyword CREATE
+ ###< create table crash_me10 (CREATE int not null)
+ ###> execute error: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 'CREATE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_cross=yes # Keyword CROSS
+ ###< create table crash_me10 (CROSS int not null)
+ ###> execute error: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 'CROSS int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_current=no # Keyword CURRENT
+ ###< create table crash_me10 (CURRENT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_current_date=yes # Keyword CURRENT_DATE
+ ###< create table crash_me10 (CURRENT_DATE int not null)
+ ###> execute error: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 'CURRENT_DATE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_current_time=yes # Keyword CURRENT_TIME
+ ###< create table crash_me10 (CURRENT_TIME int not null)
+ ###> execute error: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 'CURRENT_TIME int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_current_timestamp=yes # Keyword CURRENT_TIMESTAMP
+ ###< create table crash_me10 (CURRENT_TIMESTAMP int not null)
+ ###> execute error: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 'CURRENT_TIMESTAMP int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_current_user=no # Keyword CURRENT_USER
+ ###< create table crash_me10 (CURRENT_USER int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_cursor=no # Keyword CURSOR
+ ###< create table crash_me10 (CURSOR int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_cycle=no # Keyword CYCLE
+ ###< create table crash_me10 (CYCLE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_data=no # Keyword DATA
+ ###< create table crash_me10 (DATA int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_date=no # Keyword DATE
+ ###< create table crash_me10 (DATE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_day=no # Keyword DAY
+ ###< create table crash_me10 (DAY int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_deallocate=no # Keyword DEALLOCATE
+ ###< create table crash_me10 (DEALLOCATE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_dec=yes # Keyword DEC
+ ###< create table crash_me10 (DEC int not null)
+ ###> execute error: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 'DEC int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_decimal=yes # Keyword DECIMAL
+ ###< create table crash_me10 (DECIMAL int not null)
+ ###> execute error: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 'DECIMAL int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_declare=no # Keyword DECLARE
+ ###< create table crash_me10 (DECLARE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_default=yes # Keyword DEFAULT
+ ###< create table crash_me10 (DEFAULT int not null)
+ ###> execute error: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 int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_deferrable=no # Keyword DEFERRABLE
+ ###< create table crash_me10 (DEFERRABLE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_deferred=no # Keyword DEFERRED
+ ###< create table crash_me10 (DEFERRED int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_delete=yes # Keyword DELETE
+ ###< create table crash_me10 (DELETE int not null)
+ ###> execute error: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 'DELETE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_depth=no # Keyword DEPTH
+ ###< create table crash_me10 (DEPTH int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_desc=yes # Keyword DESC
+ ###< create table crash_me10 (DESC int not null)
+ ###> execute error: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 'DESC int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_describe=yes # Keyword DESCRIBE
+ ###< create table crash_me10 (DESCRIBE int not null)
+ ###> execute error: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 'DESCRIBE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_descriptor=no # Keyword DESCRIPTOR
+ ###< create table crash_me10 (DESCRIPTOR int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_diagnostics=no # Keyword DIAGNOSTICS
+ ###< create table crash_me10 (DIAGNOSTICS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_dictionary=no # Keyword DICTIONARY
+ ###< create table crash_me10 (DICTIONARY int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_disconnect=no # Keyword DISCONNECT
+ ###< create table crash_me10 (DISCONNECT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_distinct=yes # Keyword DISTINCT
+ ###< create table crash_me10 (DISTINCT int not null)
+ ###> execute error: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 'DISTINCT int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_domain=no # Keyword DOMAIN
+ ###< create table crash_me10 (DOMAIN int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_double=yes # Keyword DOUBLE
+ ###< create table crash_me10 (DOUBLE int not null)
+ ###> execute error: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 'DOUBLE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_drop=yes # Keyword DROP
+ ###< create table crash_me10 (DROP int not null)
+ ###> execute error: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 'DROP int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_each=no # Keyword EACH
+ ###< create table crash_me10 (EACH int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_else=yes # Keyword ELSE
+ ###< create table crash_me10 (ELSE int not null)
+ ###> execute error: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 'ELSE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_elseif=no # Keyword ELSEIF
+ ###< create table crash_me10 (ELSEIF int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_end=no # Keyword END
+ ###< create table crash_me10 (END int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_end-exec=yes # Keyword END-EXEC
+ ###< create table crash_me10 (END-EXEC int not null)
+ ###> execute error: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 '-EXEC int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_equals=no # Keyword EQUALS
+ ###< create table crash_me10 (EQUALS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_escape=no # Keyword ESCAPE
+ ###< create table crash_me10 (ESCAPE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_except=no # Keyword EXCEPT
+ ###< create table crash_me10 (EXCEPT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_exception=no # Keyword EXCEPTION
+ ###< create table crash_me10 (EXCEPTION int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_exec=no # Keyword EXEC
+ ###< create table crash_me10 (EXEC int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_execute=no # Keyword EXECUTE
+ ###< create table crash_me10 (EXECUTE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_external=no # Keyword EXTERNAL
+ ###< create table crash_me10 (EXTERNAL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_false=no # Keyword FALSE
+ ###< create table crash_me10 (FALSE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_fetch=no # Keyword FETCH
+ ###< create table crash_me10 (FETCH int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_first=no # Keyword FIRST
+ ###< create table crash_me10 (FIRST int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_float=yes # Keyword FLOAT
+ ###< create table crash_me10 (FLOAT int not null)
+ ###> execute error: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 'FLOAT int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_for=yes # Keyword FOR
+ ###< create table crash_me10 (FOR int not null)
+ ###> execute error: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 'FOR int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_foreign=yes # Keyword FOREIGN
+ ###< create table crash_me10 (FOREIGN int not null)
+ ###> execute error: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 'int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_found=no # Keyword FOUND
+ ###< create table crash_me10 (FOUND int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_from=yes # Keyword FROM
+ ###< create table crash_me10 (FROM int not null)
+ ###> execute error: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 int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_full=no # Keyword FULL
+ ###< create table crash_me10 (FULL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_general=no # Keyword GENERAL
+ ###< create table crash_me10 (GENERAL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_get=no # Keyword GET
+ ###< create table crash_me10 (GET int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_global=no # Keyword GLOBAL
+ ###< create table crash_me10 (GLOBAL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_go=no # Keyword GO
+ ###< create table crash_me10 (GO int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_goto=no # Keyword GOTO
+ ###< create table crash_me10 (GOTO int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_grant=yes # Keyword GRANT
+ ###< create table crash_me10 (GRANT int not null)
+ ###> execute error: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 'GRANT int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_group=yes # Keyword GROUP
+ ###< create table crash_me10 (GROUP int not null)
+ ###> execute error: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 'GROUP int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_having=yes # Keyword HAVING
+ ###< create table crash_me10 (HAVING int not null)
+ ###> execute error: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 'HAVING int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_hour=no # Keyword HOUR
+ ###< create table crash_me10 (HOUR int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_identity=no # Keyword IDENTITY
+ ###< create table crash_me10 (IDENTITY int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_if=yes # Keyword IF
+ ###< create table crash_me10 (IF int not null)
+ ###> execute error: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 'IF int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_ignore=yes # Keyword IGNORE
+ ###< create table crash_me10 (IGNORE int not null)
+ ###> execute error: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 'IGNORE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_immediate=no # Keyword IMMEDIATE
+ ###< create table crash_me10 (IMMEDIATE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_in=yes # Keyword IN
+ ###< create table crash_me10 (IN int not null)
+ ###> execute error: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 'IN int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_indicator=no # Keyword INDICATOR
+ ###< create table crash_me10 (INDICATOR int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_initially=no # Keyword INITIALLY
+ ###< create table crash_me10 (INITIALLY int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_inner=yes # Keyword INNER
+ ###< create table crash_me10 (INNER int not null)
+ ###> execute error: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 'INNER int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_input=no # Keyword INPUT
+ ###< create table crash_me10 (INPUT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_insert=yes # Keyword INSERT
+ ###< create table crash_me10 (INSERT int not null)
+ ###> execute error: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 'INSERT int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_int=yes # Keyword INT
+ ###< create table crash_me10 (INT int not null)
+ ###> execute error: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 'INT int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_integer=yes # Keyword INTEGER
+ ###< create table crash_me10 (INTEGER int not null)
+ ###> execute error: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 'INTEGER int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_intersect=no # Keyword INTERSECT
+ ###< create table crash_me10 (INTERSECT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_interval=yes # Keyword INTERVAL
+ ###< create table crash_me10 (INTERVAL int not null)
+ ###> execute error: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 'INTERVAL int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_into=yes # Keyword INTO
+ ###< create table crash_me10 (INTO int not null)
+ ###> execute error: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 'INTO int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_is=yes # Keyword IS
+ ###< create table crash_me10 (IS int not null)
+ ###> execute error: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 'IS int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_isolation=no # Keyword ISOLATION
+ ###< create table crash_me10 (ISOLATION int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_join=yes # Keyword JOIN
+ ###< create table crash_me10 (JOIN int not null)
+ ###> execute error: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 'JOIN int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_key=yes # Keyword KEY
+ ###< create table crash_me10 (KEY int not null)
+ ###> execute error: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 'int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_language=no # Keyword LANGUAGE
+ ###< create table crash_me10 (LANGUAGE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_last=no # Keyword LAST
+ ###< create table crash_me10 (LAST int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_leading=yes # Keyword LEADING
+ ###< create table crash_me10 (LEADING int not null)
+ ###> execute error: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 'LEADING int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_leave=no # Keyword LEAVE
+ ###< create table crash_me10 (LEAVE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_left=yes # Keyword LEFT
+ ###< create table crash_me10 (LEFT int not null)
+ ###> execute error: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 'LEFT int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_less=no # Keyword LESS
+ ###< create table crash_me10 (LESS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_level=no # Keyword LEVEL
+ ###< create table crash_me10 (LEVEL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_like=yes # Keyword LIKE
+ ###< create table crash_me10 (LIKE int not null)
+ ###> execute error: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 'LIKE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_limit=yes # Keyword LIMIT
+ ###< create table crash_me10 (LIMIT int not null)
+ ###> execute error: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 'LIMIT int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_local=no # Keyword LOCAL
+ ###< create table crash_me10 (LOCAL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_loop=no # Keyword LOOP
+ ###< create table crash_me10 (LOOP int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_match=yes # Keyword MATCH
+ ###< create table crash_me10 (MATCH int not null)
+ ###> execute error: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 'MATCH int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_minute=no # Keyword MINUTE
+ ###< create table crash_me10 (MINUTE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_modify=no # Keyword MODIFY
+ ###< create table crash_me10 (MODIFY int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_module=no # Keyword MODULE
+ ###< create table crash_me10 (MODULE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_month=no # Keyword MONTH
+ ###< create table crash_me10 (MONTH int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_names=no # Keyword NAMES
+ ###< create table crash_me10 (NAMES int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_national=no # Keyword NATIONAL
+ ###< create table crash_me10 (NATIONAL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_natural=yes # Keyword NATURAL
+ ###< create table crash_me10 (NATURAL int not null)
+ ###> execute error: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 'NATURAL int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_nchar=no # Keyword NCHAR
+ ###< create table crash_me10 (NCHAR int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_new=no # Keyword NEW
+ ###< create table crash_me10 (NEW int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_next=no # Keyword NEXT
+ ###< create table crash_me10 (NEXT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_no=no # Keyword NO
+ ###< create table crash_me10 (NO int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_none=no # Keyword NONE
+ ###< create table crash_me10 (NONE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_not=yes # Keyword NOT
+ ###< create table crash_me10 (NOT int not null)
+ ###> execute error: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 'NOT int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_null=yes # Keyword NULL
+ ###< create table crash_me10 (NULL int not null)
+ ###> execute error: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 int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_numeric=yes # Keyword NUMERIC
+ ###< create table crash_me10 (NUMERIC int not null)
+ ###> execute error: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 'NUMERIC int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_object=no # Keyword OBJECT
+ ###< create table crash_me10 (OBJECT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_of=no # Keyword OF
+ ###< create table crash_me10 (OF int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_off=no # Keyword OFF
+ ###< create table crash_me10 (OFF int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_old=no # Keyword OLD
+ ###< create table crash_me10 (OLD int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_on=yes # Keyword ON
+ ###< create table crash_me10 (ON int not null)
+ ###> execute error: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 'ON int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_only=no # Keyword ONLY
+ ###< create table crash_me10 (ONLY int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_open=no # Keyword OPEN
+ ###< create table crash_me10 (OPEN int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_operation=no # Keyword OPERATION
+ ###< create table crash_me10 (OPERATION int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_option=yes # Keyword OPTION
+ ###< create table crash_me10 (OPTION int not null)
+ ###> execute error: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 'OPTION int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_or=yes # Keyword OR
+ ###< create table crash_me10 (OR int not null)
+ ###> execute error: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 'OR int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_order=yes # Keyword ORDER
+ ###< create table crash_me10 (ORDER int not null)
+ ###> execute error: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 'ORDER int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_outer=yes # Keyword OUTER
+ ###< create table crash_me10 (OUTER int not null)
+ ###> execute error: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 'OUTER int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_output=no # Keyword OUTPUT
+ ###< create table crash_me10 (OUTPUT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_pad=no # Keyword PAD
+ ###< create table crash_me10 (PAD int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_parameters=no # Keyword PARAMETERS
+ ###< create table crash_me10 (PARAMETERS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_partial=yes # Keyword PARTIAL
+ ###< create table crash_me10 (PARTIAL int not null)
+ ###> execute error: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 'PARTIAL int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_precision=yes # Keyword PRECISION
+ ###< create table crash_me10 (PRECISION int not null)
+ ###> execute error: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 'PRECISION int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_preorder=no # Keyword PREORDER
+ ###< create table crash_me10 (PREORDER int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_prepare=no # Keyword PREPARE
+ ###< create table crash_me10 (PREPARE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_preserve=no # Keyword PRESERVE
+ ###< create table crash_me10 (PRESERVE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_primary=yes # Keyword PRIMARY
+ ###< create table crash_me10 (PRIMARY int not null)
+ ###> execute error: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 'int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_prior=no # Keyword PRIOR
+ ###< create table crash_me10 (PRIOR int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_privileges=yes # Keyword PRIVILEGES
+ ###< create table crash_me10 (PRIVILEGES int not null)
+ ###> execute error: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 'PRIVILEGES int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_procedure=yes # Keyword PROCEDURE
+ ###< create table crash_me10 (PROCEDURE int not null)
+ ###> execute error: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 'PROCEDURE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_public=no # Keyword PUBLIC
+ ###< create table crash_me10 (PUBLIC int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_read=yes # Keyword READ
+ ###< create table crash_me10 (READ int not null)
+ ###> execute error: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 'READ int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_real=yes # Keyword REAL
+ ###< create table crash_me10 (REAL int not null)
+ ###> execute error: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 'REAL int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_recursive=no # Keyword RECURSIVE
+ ###< create table crash_me10 (RECURSIVE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_ref=no # Keyword REF
+ ###< create table crash_me10 (REF int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_references=yes # Keyword REFERENCES
+ ###< create table crash_me10 (REFERENCES int not null)
+ ###> execute error: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 'REFERENCES int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_referencing=no # Keyword REFERENCING
+ ###< create table crash_me10 (REFERENCING int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_relative=no # Keyword RELATIVE
+ ###< create table crash_me10 (RELATIVE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_resignal=no # Keyword RESIGNAL
+ ###< create table crash_me10 (RESIGNAL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_restrict=yes # Keyword RESTRICT
+ ###< create table crash_me10 (RESTRICT int not null)
+ ###> execute error: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 'RESTRICT int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_return=no # Keyword RETURN
+ ###< create table crash_me10 (RETURN int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_returns=yes # Keyword RETURNS
+ ###< create table crash_me10 (RETURNS int not null)
+ ###> execute error: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 'RETURNS int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_revoke=yes # Keyword REVOKE
+ ###< create table crash_me10 (REVOKE int not null)
+ ###> execute error: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 'REVOKE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_right=yes # Keyword RIGHT
+ ###< create table crash_me10 (RIGHT int not null)
+ ###> execute error: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 'RIGHT int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_role=no # Keyword ROLE
+ ###< create table crash_me10 (ROLE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_rollback=no # Keyword ROLLBACK
+ ###< create table crash_me10 (ROLLBACK int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_routine=no # Keyword ROUTINE
+ ###< create table crash_me10 (ROUTINE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_row=no # Keyword ROW
+ ###< create table crash_me10 (ROW int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_rows=no # Keyword ROWS
+ ###< create table crash_me10 (ROWS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_savepoint=no # Keyword SAVEPOINT
+ ###< create table crash_me10 (SAVEPOINT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_schema=no # Keyword SCHEMA
+ ###< create table crash_me10 (SCHEMA int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_scroll=no # Keyword SCROLL
+ ###< create table crash_me10 (SCROLL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_search=no # Keyword SEARCH
+ ###< create table crash_me10 (SEARCH int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_second=no # Keyword SECOND
+ ###< create table crash_me10 (SECOND int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_section=no # Keyword SECTION
+ ###< create table crash_me10 (SECTION int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_select=yes # Keyword SELECT
+ ###< create table crash_me10 (SELECT int not null)
+ ###> execute error: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 'int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_sequence=no # Keyword SEQUENCE
+ ###< create table crash_me10 (SEQUENCE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_session=no # Keyword SESSION
+ ###< create table crash_me10 (SESSION int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_session_user=no # Keyword SESSION_USER
+ ###< create table crash_me10 (SESSION_USER int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_set=yes # Keyword SET
+ ###< create table crash_me10 (SET int not null)
+ ###> execute error: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 'SET int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_signal=no # Keyword SIGNAL
+ ###< create table crash_me10 (SIGNAL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_size=no # Keyword SIZE
+ ###< create table crash_me10 (SIZE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_smallint=yes # Keyword SMALLINT
+ ###< create table crash_me10 (SMALLINT int not null)
+ ###> execute error: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 'SMALLINT int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_some=no # Keyword SOME
+ ###< create table crash_me10 (SOME int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_space=no # Keyword SPACE
+ ###< create table crash_me10 (SPACE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_sql=no # Keyword SQL
+ ###< create table crash_me10 (SQL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_sqlexception=no # Keyword SQLEXCEPTION
+ ###< create table crash_me10 (SQLEXCEPTION int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_sqlstate=no # Keyword SQLSTATE
+ ###< create table crash_me10 (SQLSTATE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_sqlwarning=no # Keyword SQLWARNING
+ ###< create table crash_me10 (SQLWARNING int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_structure=no # Keyword STRUCTURE
+ ###< create table crash_me10 (STRUCTURE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_system_user=no # Keyword SYSTEM_USER
+ ###< create table crash_me10 (SYSTEM_USER int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_table=yes # Keyword TABLE
+ ###< create table crash_me10 (TABLE int not null)
+ ###> execute error: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 'TABLE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_temporary=no # Keyword TEMPORARY
+ ###< create table crash_me10 (TEMPORARY int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_then=yes # Keyword THEN
+ ###< create table crash_me10 (THEN int not null)
+ ###> execute error: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 'THEN int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_time=no # Keyword TIME
+ ###< create table crash_me10 (TIME int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_timestamp=no # Keyword TIMESTAMP
+ ###< create table crash_me10 (TIMESTAMP int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_timezone_hour=no # Keyword TIMEZONE_HOUR
+ ###< create table crash_me10 (TIMEZONE_HOUR int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_timezone_minute=no # Keyword TIMEZONE_MINUTE
+ ###< create table crash_me10 (TIMEZONE_MINUTE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_to=yes # Keyword TO
+ ###< create table crash_me10 (TO int not null)
+ ###> execute error: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 'TO int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_trailing=yes # Keyword TRAILING
+ ###< create table crash_me10 (TRAILING int not null)
+ ###> execute error: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 'TRAILING int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_transaction=no # Keyword TRANSACTION
+ ###< create table crash_me10 (TRANSACTION int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_translation=no # Keyword TRANSLATION
+ ###< create table crash_me10 (TRANSLATION int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_trigger=no # Keyword TRIGGER
+ ###< create table crash_me10 (TRIGGER int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_true=no # Keyword TRUE
+ ###< create table crash_me10 (TRUE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_under=no # Keyword UNDER
+ ###< create table crash_me10 (UNDER int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_union=yes # Keyword UNION
+ ###< create table crash_me10 (UNION int not null)
+ ###> execute error: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 'UNION int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_unique=yes # Keyword UNIQUE
+ ###< create table crash_me10 (UNIQUE int not null)
+ ###> execute error: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 'int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_unknown=no # Keyword UNKNOWN
+ ###< create table crash_me10 (UNKNOWN int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_update=yes # Keyword UPDATE
+ ###< create table crash_me10 (UPDATE int not null)
+ ###> execute error: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 'UPDATE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_usage=yes # Keyword USAGE
+ ###< create table crash_me10 (USAGE int not null)
+ ###> execute error: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 'USAGE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_user=no # Keyword USER
+ ###< create table crash_me10 (USER int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_using=yes # Keyword USING
+ ###< create table crash_me10 (USING int not null)
+ ###> execute error: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 'USING int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_value=no # Keyword VALUE
+ ###< create table crash_me10 (VALUE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_values=yes # Keyword VALUES
+ ###< create table crash_me10 (VALUES int not null)
+ ###> execute error: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 'VALUES int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_varchar=yes # Keyword VARCHAR
+ ###< create table crash_me10 (VARCHAR int not null)
+ ###> execute error: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 'VARCHAR int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_variable=no # Keyword VARIABLE
+ ###< create table crash_me10 (VARIABLE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_varying=yes # Keyword VARYING
+ ###< create table crash_me10 (VARYING int not null)
+ ###> execute error: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 'VARYING int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_view=no # Keyword VIEW
+ ###< create table crash_me10 (VIEW int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_when=yes # Keyword WHEN
+ ###< create table crash_me10 (WHEN int not null)
+ ###> execute error: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 'WHEN int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_whenever=no # Keyword WHENEVER
+ ###< create table crash_me10 (WHENEVER int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_where=yes # Keyword WHERE
+ ###< create table crash_me10 (WHERE int not null)
+ ###> execute error: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 'WHERE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_while=no # Keyword WHILE
+ ###< create table crash_me10 (WHILE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_with=yes # Keyword WITH
+ ###< create table crash_me10 (WITH int not null)
+ ###> execute error: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 'WITH int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_without=no # Keyword WITHOUT
+ ###< create table crash_me10 (WITHOUT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_work=no # Keyword WORK
+ ###< create table crash_me10 (WORK int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_write=yes # Keyword WRITE
+ ###< create table crash_me10 (WRITE int not null)
+ ###> execute error: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 'WRITE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi-92/99_year=no # Keyword YEAR
+ ###< create table crash_me10 (YEAR int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi-92/99_zone=no # Keyword ZONE
+ ###< create table crash_me10 (ZONE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_async=no # Keyword ASYNC
+ ###< create table crash_me10 (ASYNC int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_avg=no # Keyword AVG
+ ###< create table crash_me10 (AVG int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_between=yes # Keyword BETWEEN
+ ###< create table crash_me10 (BETWEEN int not null)
+ ###> execute error: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 'BETWEEN int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi92_bit_length=no # Keyword BIT_LENGTH
+ ###< create table crash_me10 (BIT_LENGTH int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_char_length=no # Keyword CHAR_LENGTH
+ ###< create table crash_me10 (CHAR_LENGTH int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_character_length=no # Keyword CHARACTER_LENGTH
+ ###< create table crash_me10 (CHARACTER_LENGTH int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_coalesce=no # Keyword COALESCE
+ ###< create table crash_me10 (COALESCE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_convert=no # Keyword CONVERT
+ ###< create table crash_me10 (CONVERT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_count=no # Keyword COUNT
+ ###< create table crash_me10 (COUNT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_exists=yes # Keyword EXISTS
+ ###< create table crash_me10 (EXISTS int not null)
+ ###> execute error: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 'EXISTS int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi92_extract=no # Keyword EXTRACT
+ ###< create table crash_me10 (EXTRACT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_insensitive=no # Keyword INSENSITIVE
+ ###< create table crash_me10 (INSENSITIVE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_lower=no # Keyword LOWER
+ ###< create table crash_me10 (LOWER int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_max=no # Keyword MAX
+ ###< create table crash_me10 (MAX int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_min=no # Keyword MIN
+ ###< create table crash_me10 (MIN int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_nullif=no # Keyword NULLIF
+ ###< create table crash_me10 (NULLIF int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_octet_length=no # Keyword OCTET_LENGTH
+ ###< create table crash_me10 (OCTET_LENGTH int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_oid=no # Keyword OID
+ ###< create table crash_me10 (OID int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_operators=no # Keyword OPERATORS
+ ###< create table crash_me10 (OPERATORS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_others=no # Keyword OTHERS
+ ###< create table crash_me10 (OTHERS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_overlaps=no # Keyword OVERLAPS
+ ###< create table crash_me10 (OVERLAPS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_pendant=no # Keyword PENDANT
+ ###< create table crash_me10 (PENDANT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_position=no # Keyword POSITION
+ ###< create table crash_me10 (POSITION int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_private=no # Keyword PRIVATE
+ ###< create table crash_me10 (PRIVATE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_protected=no # Keyword PROTECTED
+ ###< create table crash_me10 (PROTECTED int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_replace=yes # Keyword REPLACE
+ ###< create table crash_me10 (REPLACE int not null)
+ ###> execute error: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 'REPLACE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi92_sensitive=no # Keyword SENSITIVE
+ ###< create table crash_me10 (SENSITIVE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_similar=no # Keyword SIMILAR
+ ###< create table crash_me10 (SIMILAR int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_sqlcode=no # Keyword SQLCODE
+ ###< create table crash_me10 (SQLCODE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_sqlerror=no # Keyword SQLERROR
+ ###< create table crash_me10 (SQLERROR int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_substring=no # Keyword SUBSTRING
+ ###< create table crash_me10 (SUBSTRING int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_sum=no # Keyword SUM
+ ###< create table crash_me10 (SUM int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_test=no # Keyword TEST
+ ###< create table crash_me10 (TEST int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_there=no # Keyword THERE
+ ###< create table crash_me10 (THERE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_translate=no # Keyword TRANSLATE
+ ###< create table crash_me10 (TRANSLATE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_trim=no # Keyword TRIM
+ ###< create table crash_me10 (TRIM int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_type=no # Keyword TYPE
+ ###< create table crash_me10 (TYPE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_upper=no # Keyword UPPER
+ ###< create table crash_me10 (UPPER int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_virtual=no # Keyword VIRTUAL
+ ###< create table crash_me10 (VIRTUAL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_visible=no # Keyword VISIBLE
+ ###< create table crash_me10 (VISIBLE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi92_wait=no # Keyword WAIT
+ ###< create table crash_me10 (WAIT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_admin=no # Keyword ADMIN
+ ###< create table crash_me10 (ADMIN int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_aggregate=no # Keyword AGGREGATE
+ ###< create table crash_me10 (AGGREGATE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_array=no # Keyword ARRAY
+ ###< create table crash_me10 (ARRAY int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_binary=yes # Keyword BINARY
+ ###< create table crash_me10 (BINARY int not null)
+ ###> execute error: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 'BINARY int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi99_blob=yes # Keyword BLOB
+ ###< create table crash_me10 (BLOB int not null)
+ ###> execute error: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 'BLOB int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi99_class=no # Keyword CLASS
+ ###< create table crash_me10 (CLASS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_clob=no # Keyword CLOB
+ ###< create table crash_me10 (CLOB int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_condition=no # Keyword CONDITION
+ ###< create table crash_me10 (CONDITION int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_constructor=no # Keyword CONSTRUCTOR
+ ###< create table crash_me10 (CONSTRUCTOR int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_contains=no # Keyword CONTAINS
+ ###< create table crash_me10 (CONTAINS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_cube=no # Keyword CUBE
+ ###< create table crash_me10 (CUBE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_current_path=no # Keyword CURRENT_PATH
+ ###< create table crash_me10 (CURRENT_PATH int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_current_role=no # Keyword CURRENT_ROLE
+ ###< create table crash_me10 (CURRENT_ROLE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_datalink=no # Keyword DATALINK
+ ###< create table crash_me10 (DATALINK int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_deref=no # Keyword DEREF
+ ###< create table crash_me10 (DEREF int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_destroy=no # Keyword DESTROY
+ ###< create table crash_me10 (DESTROY int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_destructor=no # Keyword DESTRUCTOR
+ ###< create table crash_me10 (DESTRUCTOR int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_deterministic=no # Keyword DETERMINISTIC
+ ###< create table crash_me10 (DETERMINISTIC int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_do=no # Keyword DO
+ ###< create table crash_me10 (DO int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_dynamic=no # Keyword DYNAMIC
+ ###< create table crash_me10 (DYNAMIC int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_every=no # Keyword EVERY
+ ###< create table crash_me10 (EVERY int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_exit=no # Keyword EXIT
+ ###< create table crash_me10 (EXIT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_expand=no # Keyword EXPAND
+ ###< create table crash_me10 (EXPAND int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_expanding=no # Keyword EXPANDING
+ ###< create table crash_me10 (EXPANDING int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_free=no # Keyword FREE
+ ###< create table crash_me10 (FREE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_function=no # Keyword FUNCTION
+ ###< create table crash_me10 (FUNCTION int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_grouping=no # Keyword GROUPING
+ ###< create table crash_me10 (GROUPING int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_handler=no # Keyword HANDLER
+ ###< create table crash_me10 (HANDLER int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_hast=no # Keyword HAST
+ ###< create table crash_me10 (HAST int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_host=no # Keyword HOST
+ ###< create table crash_me10 (HOST int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_initialize=no # Keyword INITIALIZE
+ ###< create table crash_me10 (INITIALIZE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_inout=no # Keyword INOUT
+ ###< create table crash_me10 (INOUT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_iterate=no # Keyword ITERATE
+ ###< create table crash_me10 (ITERATE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_large=no # Keyword LARGE
+ ###< create table crash_me10 (LARGE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_lateral=no # Keyword LATERAL
+ ###< create table crash_me10 (LATERAL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_localtime=yes # Keyword LOCALTIME
+ ###< create table crash_me10 (LOCALTIME int not null)
+ ###> execute error: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 'LOCALTIME int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi99_localtimestamp=yes # Keyword LOCALTIMESTAMP
+ ###< create table crash_me10 (LOCALTIMESTAMP int not null)
+ ###> execute error: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 'LOCALTIMESTAMP int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_ansi99_locator=no # Keyword LOCATOR
+ ###< create table crash_me10 (LOCATOR int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_meets=no # Keyword MEETS
+ ###< create table crash_me10 (MEETS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_modifies=no # Keyword MODIFIES
+ ###< create table crash_me10 (MODIFIES int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_nclob=no # Keyword NCLOB
+ ###< create table crash_me10 (NCLOB int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_normalize=no # Keyword NORMALIZE
+ ###< create table crash_me10 (NORMALIZE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_ordinality=no # Keyword ORDINALITY
+ ###< create table crash_me10 (ORDINALITY int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_out=no # Keyword OUT
+ ###< create table crash_me10 (OUT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_parameter=no # Keyword PARAMETER
+ ###< create table crash_me10 (PARAMETER int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_path=no # Keyword PATH
+ ###< create table crash_me10 (PATH int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_period=no # Keyword PERIOD
+ ###< create table crash_me10 (PERIOD int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_postfix=no # Keyword POSTFIX
+ ###< create table crash_me10 (POSTFIX int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_precedes=no # Keyword PRECEDES
+ ###< create table crash_me10 (PRECEDES int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_prefix=no # Keyword PREFIX
+ ###< create table crash_me10 (PREFIX int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_reads=no # Keyword READS
+ ###< create table crash_me10 (READS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_redo=no # Keyword REDO
+ ###< create table crash_me10 (REDO int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_repeat=no # Keyword REPEAT
+ ###< create table crash_me10 (REPEAT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_result=no # Keyword RESULT
+ ###< create table crash_me10 (RESULT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_rollup=no # Keyword ROLLUP
+ ###< create table crash_me10 (ROLLUP int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_sets=no # Keyword SETS
+ ###< create table crash_me10 (SETS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_specific=no # Keyword SPECIFIC
+ ###< create table crash_me10 (SPECIFIC int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_specifictype=no # Keyword SPECIFICTYPE
+ ###< create table crash_me10 (SPECIFICTYPE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_start=no # Keyword START
+ ###< create table crash_me10 (START int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_state=no # Keyword STATE
+ ###< create table crash_me10 (STATE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_static=no # Keyword STATIC
+ ###< create table crash_me10 (STATIC int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_succeeds=no # Keyword SUCCEEDS
+ ###< create table crash_me10 (SUCCEEDS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_terminate=no # Keyword TERMINATE
+ ###< create table crash_me10 (TERMINATE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_than=no # Keyword THAN
+ ###< create table crash_me10 (THAN int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_treat=no # Keyword TREAT
+ ###< create table crash_me10 (TREAT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_undo=no # Keyword UNDO
+ ###< create table crash_me10 (UNDO int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_ansi99_until=no # Keyword UNTIL
+ ###< create table crash_me10 (UNTIL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_access=no # Keyword ACCESS
+ ###< create table crash_me10 (ACCESS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_analyze=yes # Keyword ANALYZE
+ ###< create table crash_me10 (ANALYZE int not null)
+ ###> execute error: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 'ANALYZE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_audit=no # Keyword AUDIT
+ ###< create table crash_me10 (AUDIT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_auto_increment=no # Keyword AUTO_INCREMENT
+ ###< create table crash_me10 (AUTO_INCREMENT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_backup=no # Keyword BACKUP
+ ###< create table crash_me10 (BACKUP int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_bdb=no # Keyword BDB
+ ###< create table crash_me10 (BDB int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_berkeleydb=no # Keyword BERKELEYDB
+ ###< create table crash_me10 (BERKELEYDB int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_bigint=yes # Keyword BIGINT
+ ###< create table crash_me10 (BIGINT int not null)
+ ###> execute error: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 'BIGINT int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_break=no # Keyword BREAK
+ ###< create table crash_me10 (BREAK int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_browse=no # Keyword BROWSE
+ ###< create table crash_me10 (BROWSE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_btree=no # Keyword BTREE
+ ###< create table crash_me10 (BTREE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_bulk=no # Keyword BULK
+ ###< create table crash_me10 (BULK int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_change=yes # Keyword CHANGE
+ ###< create table crash_me10 (CHANGE int not null)
+ ###> execute error: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 'CHANGE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_checkpoint=no # Keyword CHECKPOINT
+ ###< create table crash_me10 (CHECKPOINT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_cluster=no # Keyword CLUSTER
+ ###< create table crash_me10 (CLUSTER int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_clustered=no # Keyword CLUSTERED
+ ###< create table crash_me10 (CLUSTERED int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_columns=yes # Keyword COLUMNS
+ ###< create table crash_me10 (COLUMNS int not null)
+ ###> execute error: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 'COLUMNS int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_comment=no # Keyword COMMENT
+ ###< create table crash_me10 (COMMENT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_compress=no # Keyword COMPRESS
+ ###< create table crash_me10 (COMPRESS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_compute=no # Keyword COMPUTE
+ ###< create table crash_me10 (COMPUTE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_containstable=no # Keyword CONTAINSTABLE
+ ###< create table crash_me10 (CONTAINSTABLE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_database=yes # Keyword DATABASE
+ ###< create table crash_me10 (DATABASE int not null)
+ ###> execute error: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 'DATABASE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_databases=yes # Keyword DATABASES
+ ###< create table crash_me10 (DATABASES int not null)
+ ###> execute error: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 'DATABASES int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_day_hour=yes # Keyword DAY_HOUR
+ ###< create table crash_me10 (DAY_HOUR int not null)
+ ###> execute error: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 'DAY_HOUR int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_day_minute=yes # Keyword DAY_MINUTE
+ ###< create table crash_me10 (DAY_MINUTE int not null)
+ ###> execute error: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 'DAY_MINUTE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_day_second=yes # Keyword DAY_SECOND
+ ###< create table crash_me10 (DAY_SECOND int not null)
+ ###> execute error: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 'DAY_SECOND int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_dbcc=no # Keyword DBCC
+ ###< create table crash_me10 (DBCC int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_delayed=yes # Keyword DELAYED
+ ###< create table crash_me10 (DELAYED int not null)
+ ###> execute error: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 'DELAYED int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_deny=no # Keyword DENY
+ ###< create table crash_me10 (DENY int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_disk=no # Keyword DISK
+ ###< create table crash_me10 (DISK int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_distinctrow=yes # Keyword DISTINCTROW
+ ###< create table crash_me10 (DISTINCTROW int not null)
+ ###> execute error: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 'DISTINCTROW int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_distributed=no # Keyword DISTRIBUTED
+ ###< create table crash_me10 (DISTRIBUTED int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_dummy=no # Keyword DUMMY
+ ###< create table crash_me10 (DUMMY int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_dump=no # Keyword DUMP
+ ###< create table crash_me10 (DUMP int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_enclosed=yes # Keyword ENCLOSED
+ ###< create table crash_me10 (ENCLOSED int not null)
+ ###> execute error: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 'ENCLOSED int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_errlvl=no # Keyword ERRLVL
+ ###< create table crash_me10 (ERRLVL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_errors=no # Keyword ERRORS
+ ###< create table crash_me10 (ERRORS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_escaped=yes # Keyword ESCAPED
+ ###< create table crash_me10 (ESCAPED int not null)
+ ###> execute error: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 'ESCAPED int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_exclusive=no # Keyword EXCLUSIVE
+ ###< create table crash_me10 (EXCLUSIVE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_explain=yes # Keyword EXPLAIN
+ ###< create table crash_me10 (EXPLAIN int not null)
+ ###> execute error: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 'EXPLAIN int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_fields=yes # Keyword FIELDS
+ ###< create table crash_me10 (FIELDS int not null)
+ ###> execute error: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 'FIELDS int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_file=no # Keyword FILE
+ ###< create table crash_me10 (FILE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_fillfactor=no # Keyword FILLFACTOR
+ ###< create table crash_me10 (FILLFACTOR int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_freetext=no # Keyword FREETEXT
+ ###< create table crash_me10 (FREETEXT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_freetexttable=no # Keyword FREETEXTTABLE
+ ###< create table crash_me10 (FREETEXTTABLE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_fulltext=yes # Keyword FULLTEXT
+ ###< create table crash_me10 (FULLTEXT int not null)
+ ###> execute error: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 'int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_geometry=no # Keyword GEOMETRY
+ ###< create table crash_me10 (GEOMETRY int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_hash=no # Keyword HASH
+ ###< create table crash_me10 (HASH int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_high_priority=yes # Keyword HIGH_PRIORITY
+ ###< create table crash_me10 (HIGH_PRIORITY int not null)
+ ###> execute error: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 'HIGH_PRIORITY int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_holdlock=no # Keyword HOLDLOCK
+ ###< create table crash_me10 (HOLDLOCK int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_hour_minute=yes # Keyword HOUR_MINUTE
+ ###< create table crash_me10 (HOUR_MINUTE int not null)
+ ###> execute error: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 'HOUR_MINUTE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_hour_second=yes # Keyword HOUR_SECOND
+ ###< create table crash_me10 (HOUR_SECOND int not null)
+ ###> execute error: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 'HOUR_SECOND int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_identified=no # Keyword IDENTIFIED
+ ###< create table crash_me10 (IDENTIFIED int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_identity_insert=no # Keyword IDENTITY_INSERT
+ ###< create table crash_me10 (IDENTITY_INSERT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_identitycol=no # Keyword IDENTITYCOL
+ ###< create table crash_me10 (IDENTITYCOL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_increment=no # Keyword INCREMENT
+ ###< create table crash_me10 (INCREMENT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_index=yes # Keyword INDEX
+ ###< create table crash_me10 (INDEX int not null)
+ ###> execute error: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 'int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_infile=yes # Keyword INFILE
+ ###< create table crash_me10 (INFILE int not null)
+ ###> execute error: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 'INFILE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_initial=no # Keyword INITIAL
+ ###< create table crash_me10 (INITIAL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_innodb=no # Keyword INNODB
+ ###< create table crash_me10 (INNODB int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_keys=yes # Keyword KEYS
+ ###< create table crash_me10 (KEYS int not null)
+ ###> execute error: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 'KEYS int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_kill=yes # Keyword KILL
+ ###< create table crash_me10 (KILL int not null)
+ ###> execute error: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 'KILL int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_lineno=no # Keyword LINENO
+ ###< create table crash_me10 (LINENO int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_lines=yes # Keyword LINES
+ ###< create table crash_me10 (LINES int not null)
+ ###> execute error: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 'LINES int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_load=yes # Keyword LOAD
+ ###< create table crash_me10 (LOAD int not null)
+ ###> execute error: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 'LOAD int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_lock=yes # Keyword LOCK
+ ###< create table crash_me10 (LOCK int not null)
+ ###> execute error: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 'LOCK int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_long=yes # Keyword LONG
+ ###< create table crash_me10 (LONG int not null)
+ ###> execute error: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 'LONG int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_longblob=yes # Keyword LONGBLOB
+ ###< create table crash_me10 (LONGBLOB int not null)
+ ###> execute error: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 'LONGBLOB int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_longtext=yes # Keyword LONGTEXT
+ ###< create table crash_me10 (LONGTEXT int not null)
+ ###> execute error: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 'LONGTEXT int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_low_priority=yes # Keyword LOW_PRIORITY
+ ###< create table crash_me10 (LOW_PRIORITY int not null)
+ ###> execute error: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 'LOW_PRIORITY int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_master_server_id=yes # Keyword MASTER_SERVER_ID
+ ###< create table crash_me10 (MASTER_SERVER_ID int not null)
+ ###> execute error: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 'MASTER_SERVER_ID int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_maxextents=no # Keyword MAXEXTENTS
+ ###< create table crash_me10 (MAXEXTENTS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_mediumblob=yes # Keyword MEDIUMBLOB
+ ###< create table crash_me10 (MEDIUMBLOB int not null)
+ ###> execute error: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 'MEDIUMBLOB int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_mediumint=yes # Keyword MEDIUMINT
+ ###< create table crash_me10 (MEDIUMINT int not null)
+ ###> execute error: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 'MEDIUMINT int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_mediumtext=yes # Keyword MEDIUMTEXT
+ ###< create table crash_me10 (MEDIUMTEXT int not null)
+ ###> execute error: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 'MEDIUMTEXT int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_middleint=yes # Keyword MIDDLEINT
+ ###< create table crash_me10 (MIDDLEINT int not null)
+ ###> execute error: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 'MIDDLEINT int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_minus=no # Keyword MINUS
+ ###< create table crash_me10 (MINUS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_minute_second=yes # Keyword MINUTE_SECOND
+ ###< create table crash_me10 (MINUTE_SECOND int not null)
+ ###> execute error: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 'MINUTE_SECOND int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_mlslabel=no # Keyword MLSLABEL
+ ###< create table crash_me10 (MLSLABEL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_mode=no # Keyword MODE
+ ###< create table crash_me10 (MODE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_mrg_myisam=no # Keyword MRG_MYISAM
+ ###< create table crash_me10 (MRG_MYISAM int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_noaudit=no # Keyword NOAUDIT
+ ###< create table crash_me10 (NOAUDIT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_nocheck=no # Keyword NOCHECK
+ ###< create table crash_me10 (NOCHECK int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_nocompress=no # Keyword NOCOMPRESS
+ ###< create table crash_me10 (NOCOMPRESS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_nonclustered=no # Keyword NONCLUSTERED
+ ###< create table crash_me10 (NONCLUSTERED int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_nowait=no # Keyword NOWAIT
+ ###< create table crash_me10 (NOWAIT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_number=no # Keyword NUMBER
+ ###< create table crash_me10 (NUMBER int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_offline=no # Keyword OFFLINE
+ ###< create table crash_me10 (OFFLINE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_offsets=no # Keyword OFFSETS
+ ###< create table crash_me10 (OFFSETS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_online=no # Keyword ONLINE
+ ###< create table crash_me10 (ONLINE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_opendatasource=no # Keyword OPENDATASOURCE
+ ###< create table crash_me10 (OPENDATASOURCE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_openquery=no # Keyword OPENQUERY
+ ###< create table crash_me10 (OPENQUERY int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_openrowset=no # Keyword OPENROWSET
+ ###< create table crash_me10 (OPENROWSET int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_openxml=no # Keyword OPENXML
+ ###< create table crash_me10 (OPENXML int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_optimize=yes # Keyword OPTIMIZE
+ ###< create table crash_me10 (OPTIMIZE int not null)
+ ###> execute error: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 'OPTIMIZE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_optionally=yes # Keyword OPTIONALLY
+ ###< create table crash_me10 (OPTIONALLY int not null)
+ ###> execute error: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 'OPTIONALLY int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_outfile=yes # Keyword OUTFILE
+ ###< create table crash_me10 (OUTFILE int not null)
+ ###> execute error: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 'OUTFILE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_over=no # Keyword OVER
+ ###< create table crash_me10 (OVER int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_pctfree=no # Keyword PCTFREE
+ ###< create table crash_me10 (PCTFREE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_percent=no # Keyword PERCENT
+ ###< create table crash_me10 (PERCENT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_plan=no # Keyword PLAN
+ ###< create table crash_me10 (PLAN int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_print=no # Keyword PRINT
+ ###< create table crash_me10 (PRINT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_proc=no # Keyword PROC
+ ###< create table crash_me10 (PROC int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_purge=yes # Keyword PURGE
+ ###< create table crash_me10 (PURGE int not null)
+ ###> execute error: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 'PURGE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_raiserror=no # Keyword RAISERROR
+ ###< create table crash_me10 (RAISERROR int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_raw=no # Keyword RAW
+ ###< create table crash_me10 (RAW int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_readtext=no # Keyword READTEXT
+ ###< create table crash_me10 (READTEXT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_reconfigure=no # Keyword RECONFIGURE
+ ###< create table crash_me10 (RECONFIGURE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_regexp=yes # Keyword REGEXP
+ ###< create table crash_me10 (REGEXP int not null)
+ ###> execute error: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 'REGEXP int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_rename=yes # Keyword RENAME
+ ###< create table crash_me10 (RENAME int not null)
+ ###> execute error: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 'RENAME int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_replication=no # Keyword REPLICATION
+ ###< create table crash_me10 (REPLICATION int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_require=yes # Keyword REQUIRE
+ ###< create table crash_me10 (REQUIRE int not null)
+ ###> execute error: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 'REQUIRE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_resource=no # Keyword RESOURCE
+ ###< create table crash_me10 (RESOURCE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_restore=no # Keyword RESTORE
+ ###< create table crash_me10 (RESTORE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_rlike=yes # Keyword RLIKE
+ ###< create table crash_me10 (RLIKE int not null)
+ ###> execute error: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 'RLIKE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_rowcount=no # Keyword ROWCOUNT
+ ###< create table crash_me10 (ROWCOUNT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_rowguidcol=no # Keyword ROWGUIDCOL
+ ###< create table crash_me10 (ROWGUIDCOL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_rowid=no # Keyword ROWID
+ ###< create table crash_me10 (ROWID int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_rownum=no # Keyword ROWNUM
+ ###< create table crash_me10 (ROWNUM int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_rtree=no # Keyword RTREE
+ ###< create table crash_me10 (RTREE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_rule=no # Keyword RULE
+ ###< create table crash_me10 (RULE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_save=no # Keyword SAVE
+ ###< create table crash_me10 (SAVE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_setuser=no # Keyword SETUSER
+ ###< create table crash_me10 (SETUSER int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_share=no # Keyword SHARE
+ ###< create table crash_me10 (SHARE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_show=yes # Keyword SHOW
+ ###< create table crash_me10 (SHOW int not null)
+ ###> execute error: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 'SHOW int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_shutdown=no # Keyword SHUTDOWN
+ ###< create table crash_me10 (SHUTDOWN int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_soname=yes # Keyword SONAME
+ ###< create table crash_me10 (SONAME int not null)
+ ###> execute error: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 'SONAME int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_spatial=no # Keyword SPATIAL
+ ###< create table crash_me10 (SPATIAL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_sql_big_result=yes # Keyword SQL_BIG_RESULT
+ ###< create table crash_me10 (SQL_BIG_RESULT int not null)
+ ###> execute error: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 'SQL_BIG_RESULT int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_sql_calc_found_rows=yes # Keyword SQL_CALC_FOUND_ROWS
+ ###< create table crash_me10 (SQL_CALC_FOUND_ROWS int not null)
+ ###> execute error: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 'SQL_CALC_FOUND_ROWS int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_sql_small_result=yes # Keyword SQL_SMALL_RESULT
+ ###< create table crash_me10 (SQL_SMALL_RESULT int not null)
+ ###> execute error: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 'SQL_SMALL_RESULT int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_ssl=yes # Keyword SSL
+ ###< create table crash_me10 (SSL int not null)
+ ###> execute error: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 'SSL int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_starting=yes # Keyword STARTING
+ ###< create table crash_me10 (STARTING int not null)
+ ###> execute error: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 'STARTING int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_statistics=no # Keyword STATISTICS
+ ###< create table crash_me10 (STATISTICS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_straight_join=yes # Keyword STRAIGHT_JOIN
+ ###< create table crash_me10 (STRAIGHT_JOIN int not null)
+ ###> execute error: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 'STRAIGHT_JOIN int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_striped=no # Keyword STRIPED
+ ###< create table crash_me10 (STRIPED int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_successful=no # Keyword SUCCESSFUL
+ ###< create table crash_me10 (SUCCESSFUL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_synonym=no # Keyword SYNONYM
+ ###< create table crash_me10 (SYNONYM int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_sysdate=no # Keyword SYSDATE
+ ###< create table crash_me10 (SYSDATE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_tables=yes # Keyword TABLES
+ ###< create table crash_me10 (TABLES int not null)
+ ###> execute error: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 'TABLES int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_terminated=yes # Keyword TERMINATED
+ ###< create table crash_me10 (TERMINATED int not null)
+ ###> execute error: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 'TERMINATED int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_textsize=no # Keyword TEXTSIZE
+ ###< create table crash_me10 (TEXTSIZE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_tinyblob=yes # Keyword TINYBLOB
+ ###< create table crash_me10 (TINYBLOB int not null)
+ ###> execute error: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 'TINYBLOB int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_tinyint=yes # Keyword TINYINT
+ ###< create table crash_me10 (TINYINT int not null)
+ ###> execute error: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 'TINYINT int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_tinytext=yes # Keyword TINYTEXT
+ ###< create table crash_me10 (TINYTEXT int not null)
+ ###> execute error: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 'TINYTEXT int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_top=no # Keyword TOP
+ ###< create table crash_me10 (TOP int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_tran=no # Keyword TRAN
+ ###< create table crash_me10 (TRAN int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_truncate=no # Keyword TRUNCATE
+ ###< create table crash_me10 (TRUNCATE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_tsequal=no # Keyword TSEQUAL
+ ###< create table crash_me10 (TSEQUAL int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_types=no # Keyword TYPES
+ ###< create table crash_me10 (TYPES int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_uid=no # Keyword UID
+ ###< create table crash_me10 (UID int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_unlock=yes # Keyword UNLOCK
+ ###< create table crash_me10 (UNLOCK int not null)
+ ###> execute error: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 'UNLOCK int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_unsigned=yes # Keyword UNSIGNED
+ ###< create table crash_me10 (UNSIGNED int not null)
+ ###> execute error: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 'UNSIGNED int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_updatetext=no # Keyword UPDATETEXT
+ ###< create table crash_me10 (UPDATETEXT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_use=yes # Keyword USE
+ ###< create table crash_me10 (USE int not null)
+ ###> execute error: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 'USE int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_user_resources=no # Keyword USER_RESOURCES
+ ###< create table crash_me10 (USER_RESOURCES int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_validate=no # Keyword VALIDATE
+ ###< create table crash_me10 (VALIDATE int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_varbinary=yes # Keyword VARBINARY
+ ###< create table crash_me10 (VARBINARY int not null)
+ ###> execute error: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 'VARBINARY int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_varchar2=no # Keyword VARCHAR2
+ ###< create table crash_me10 (VARCHAR2 int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_waitfor=no # Keyword WAITFOR
+ ###< create table crash_me10 (WAITFOR int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_warnings=no # Keyword WARNINGS
+ ###< create table crash_me10 (WARNINGS int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_writetext=no # Keyword WRITETEXT
+ ###< create table crash_me10 (WRITETEXT int not null)
+ ###> OK
+ ###< drop table crash_me10
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is NO
+reserved_word_extra_xor=yes # Keyword XOR
+ ###< create table crash_me10 (XOR int not null)
+ ###> execute error: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 'XOR int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_year_month=yes # Keyword YEAR_MONTH
+ ###< create table crash_me10 (YEAR_MONTH int not null)
+ ###> execute error: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 'YEAR_MONTH int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+reserved_word_extra_zerofill=yes # Keyword ZEROFILL
+ ###< create table crash_me10 (ZEROFILL int not null)
+ ###> execute error: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 'ZEROFILL int not null)' at line 1
+ ###< drop table crash_me10
+ ###> execute error:Unknown table 'crash_me10'
+ ###
+ ###As far as some queries didnt return OK, result is YES
+right_outer_join=yes # right outer join
+ ###< select crash_me.a from crash_me right join crash_me2 ON crash_me.a=crash_me2.a
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+rollback_metadata=no # rollback_metadata
+ ###< create table crash_q (a integer not null)
+ ###> OK
+ ###
+ ###< insert into crash_q values (1)
+ ###> OK
+rowid=auto_increment # Type for row id
+ ###< create table crash_q (a rowid)
+ ###> execute error: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 'rowid)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###< create table crash_q (a int not null auto_increment, primary key(a))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+safe_decimal_arithmetic=no # safe decimal arithmetic
+ ###< create table crash_me_a (a decimal(10,2),b decimal(10,2))
+ ###> OK
+ ###
+ ###< insert into crash_me_a (a,b) values (11.4,18.9)
+ ###> OK
+ ###
+ ###<select count(*) from crash_me_a where a+b=30.3
+ ###>0
+ ###We expected '1' but got '0'
+select_constants=yes # Select constants
+ ###< select 1
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+select_limit=with LIMIT # LIMIT number of rows
+ ###< select * from crash_me limit 1
+ ###> OK
+select_limit2=yes # SELECT with LIMIT #,#
+ ###< select * from crash_me limit 1,1
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+select_limit3=yes # SELECT with LIMIT # OFFSET #
+ ###< select * from crash_me limit 1 offset 1
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+select_string_size=1048565 # constant string size in SELECT
+ ###We are trying (example with N=5):
+ ###select 'aaaaa'
+select_table_update=no # Update with sub select
+ ###< create table crash_q (a integer,b char(10))
+ ###> OK
+ ###< insert into crash_q values(1,'c')
+ ###> OK
+ ###< update crash_q set b= (select b from crash_me where crash_q.a = crash_me.a)
+ ###> execute error: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 b from crash_me where crash_q.a = crash_me.a)' at line 1
+ ###
+ ###< drop table crash_q
+ ###> OK
+select_without_from=yes # SELECT without FROM
+ ###< select 1
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+server_version=MySQL 4.0.15 debug log/ # server version
+simple_joins=yes # ANSI SQL simple joins
+ ###< select crash_me.a from crash_me, crash_me t0
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+sorted_group_by=yes # Group by always sorted
+ ###< create table crash_me_t1 (a int not null, b int not null)
+ ###> OK
+ ###< insert into crash_me_t1 values (1,1)
+ ###> OK
+ ###< insert into crash_me_t1 values (1,2)
+ ###> OK
+ ###< insert into crash_me_t1 values (3,1)
+ ###> OK
+ ###< insert into crash_me_t1 values (3,2)
+ ###> OK
+ ###< insert into crash_me_t1 values (2,2)
+ ###> OK
+ ###< insert into crash_me_t1 values (2,1)
+ ###> OK
+ ###< create table crash_me_t2 (a int not null, b int not null)
+ ###> OK
+ ###< create index crash_me_t2_ind on crash_me_t2 (a)
+ ###> OK
+ ###< insert into crash_me_t2 values (1,3)
+ ###> OK
+ ###< insert into crash_me_t2 values (3,1)
+ ###> OK
+ ###< insert into crash_me_t2 values (2,2)
+ ###> OK
+ ###< insert into crash_me_t2 values (1,1)
+ ###> OK
+ ###
+ ###< select crash_me_t1.a,crash_me_t2.b from crash_me_t1,crash_me_t2 where crash_me_t1.a=crash_me_t2.a group by crash_me_t1.a,crash_me_t2.b
+ ### > 1,1
+ ### > 1,3
+ ### > 2,2
+ ### > 3,1
+ ###
+ ### Check recordset:
+ ### 1,1 expected: 1,1
+ ### 1,3 expected: 1,3
+ ### 2,2 expected: 2,2
+ ### 3,1 expected: 3,1
+ ### Recordset corresponds with template
+ ###< drop table crash_me_t1
+ ###> OK
+ ###< drop table crash_me_t2
+ ###> OK
+storage_of_float=round # Storage of float values
+ ###< create table crash_q (q1 float(4,1))
+ ###> OK
+ ###< insert into crash_q values(1.14)
+ ###> OK
+ ###
+ ###<select q1 from crash_q
+ ###>1.1
+ ###
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###< create table crash_q (q1 float(4,1))
+ ###> OK
+ ###< insert into crash_q values(1.16)
+ ###> OK
+ ###
+ ###<select q1 from crash_q
+ ###>1.2
+ ###We expected '1.1' but got '1.2'
+ ###
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###< create table crash_q (q1 float(4,1))
+ ###> OK
+ ###< insert into crash_q values(1.14)
+ ###> OK
+ ###
+ ###<select q1 from crash_q
+ ###>1.1
+ ###
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###< create table crash_q (q1 float(4,1))
+ ###> OK
+ ###< insert into crash_q values(1.16)
+ ###> OK
+ ###
+ ###<select q1 from crash_q
+ ###>1.2
+ ###
+ ###< drop table crash_q
+ ###> OK
+subqueries=no # subqueries
+ ###< select a from crash_me where crash_me.a in (select max(a) from crash_me)
+ ###> execute error: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 max(a) from crash_me)' at line 1
+ ###
+ ###As far as some queries didnt return OK, result is NO
+table_alias=yes # Table alias
+ ###< select b.a from crash_me as b
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+table_name_case=no # case independent table names
+ ###< create table crash_q (q integer)
+ ###> OK
+ ###< drop table CRASH_Q
+ ###> execute error:Unknown table 'CRASH_Q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+table_wildcard=yes # Select table_name.*
+ ###< select crash_me.* from crash_me
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+temporary_table=yes # temporary tables
+ ###< create temporary table crash_q (q integer not null)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+time_format_EUR=error # Supports HH.MM.SS (EUR) time format
+ ###< insert into crash_me_t(a) values ('20.08.16')
+ ###> OK
+ ###
+ ###<select a from crash_me_t
+ ###>00:00:20
+ ###We expected '20:08:16' but got '00:00:20'
+ ###
+ ###< delete from crash_me_t
+ ###> OK
+time_format_HHHHMMSS=yes # Supports HHHHmmSS time format
+ ###< insert into crash_me_t(a) values ('00200816')
+ ###> OK
+ ###
+ ###<select a from crash_me_t
+ ###>20:08:16
+ ###
+ ###< delete from crash_me_t
+ ###> OK
+time_format_ISO=yes # Supports HH:MM:SS (ISO) time format
+ ###< insert into crash_me_t(a) values ('20:08:16')
+ ###> OK
+ ###
+ ###<select a from crash_me_t
+ ###>20:08:16
+ ###
+ ###< delete from crash_me_t
+ ###> OK
+time_format_USA=error # Supports HH:MM:SS (AM|PM) time format
+ ###< insert into crash_me_t(a) values ('08:08:16 PM')
+ ###> OK
+ ###
+ ###<select a from crash_me_t
+ ###>08:08:16
+ ###We expected '20:08:16' but got '08:08:16'
+ ###
+ ###< delete from crash_me_t
+ ###> OK
+time_format_inresult=iso # Time format in result
+ ###< insert into crash_me_t values(CURRENT_TIME)
+ ###> OK
+ ###
+ ###< select a from crash_me_t
+ ###> 19:55:21
+ ###< delete from crash_me_t
+ ###> OK
+transactions=yes # transactions
+ ###<select * from crash_q
+ ###>1
+ ###We expected '' but got '1'
+truncate_table=yes # truncate
+ ###< create table crash_q (a integer, b integer,c1 CHAR(10))
+ ###> OK
+ ###< truncate table crash_q
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_abstime=no # Type abstime
+ ###< create table crash_q (q abstime)
+ ###> execute error: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 'abstime)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_bfile=no # Type bfile
+ ###< create table crash_q (q bfile)
+ ###> execute error: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 'bfile)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_blob=yes # Type blob
+ ###< create table crash_q (q blob)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_bool=yes # Type bool
+ ###< create table crash_q (q bool)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_box=no # Type box
+ ###< create table crash_q (q box)
+ ###> execute error: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 'box)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_byte=no # Type byte
+ ###< create table crash_q (q byte)
+ ###> execute error: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 'byte)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_char(1_arg)_binary=yes # Type char(1 arg) binary
+ ###< create table crash_q (q char(10) binary)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_cidr=no # Type cidr
+ ###< create table crash_q (q cidr)
+ ###> execute error: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 'cidr)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_circle=no # Type circle
+ ###< create table crash_q (q circle)
+ ###> execute error: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 'circle)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_clob=no # Type clob
+ ###< create table crash_q (q clob)
+ ###> execute error: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 'clob)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_datetime=yes # Type datetime
+ ###< create table crash_q (q datetime)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_double=yes # Type double
+ ###< create table crash_q (q double)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_enum(1_arg)=yes # Type enum(1 arg)
+ ###< create table crash_q (q enum('red'))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_float(2_arg)=yes # Type float(2 arg)
+ ###< create table crash_q (q float(6,2))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_float4=yes # Type float4
+ ###< create table crash_q (q float4)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_float8=yes # Type float8
+ ###< create table crash_q (q float8)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_image=no # Type image
+ ###< create table crash_q (q image)
+ ###> execute error: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 'image)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_inet=no # Type inet
+ ###< create table crash_q (q inet)
+ ###> execute error: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 'inet)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_int(1_arg)_zerofill=yes # Type int(1 arg) zerofill
+ ###< create table crash_q (q int(5) zerofill)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_int1=yes # Type int1
+ ###< create table crash_q (q int1)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_int2=yes # Type int2
+ ###< create table crash_q (q int2)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_int3=yes # Type int3
+ ###< create table crash_q (q int3)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_int4=yes # Type int4
+ ###< create table crash_q (q int4)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_int8=yes # Type int8
+ ###< create table crash_q (q int8)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_int_auto_increment=yes # Type int not null auto_increment
+ ###< create table crash_q (q int not null auto_increment,unique(q))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_int_identity=no # Type int not null identity
+ ###< create table crash_q (q int not null identity,unique(q))
+ ###> execute error: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 'identity,unique(q))' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_int_unsigned=yes # Type int unsigned
+ ###< create table crash_q (q int unsigned)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_interval=no # Type interval
+ ###< create table crash_q (q interval)
+ ###> execute error: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 'interval)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_line=no # Type line
+ ###< create table crash_q (q line)
+ ###> execute error: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 'line)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_long=no # Type long
+ ###< create table crash_q (q long)
+ ###> execute error: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
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_long_raw=no # Type long raw
+ ###< create table crash_q (q long raw)
+ ###> execute error: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 'raw)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_long_varbinary=yes # Type long varbinary
+ ###< create table crash_q (q long varbinary)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_long_varchar(1_arg)=no # Type long varchar(1 arg)
+ ###< create table crash_q (q long varchar(1))
+ ###> execute error: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))' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_lseg=no # Type lseg
+ ###< create table crash_q (q lseg)
+ ###> execute error: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 'lseg)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_macaddr=no # Type macaddr
+ ###< create table crash_q (q macaddr)
+ ###> execute error: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 'macaddr)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_mediumint=yes # Type mediumint
+ ###< create table crash_q (q mediumint)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_mediumtext=yes # Type mediumtext
+ ###< create table crash_q (q mediumtext)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_middleint=yes # Type middleint
+ ###< create table crash_q (q middleint)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_mlslabel=no # Type mlslabel
+ ###< create table crash_q (q mlslabel)
+ ###> execute error: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 'mlslabel)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_money=no # Type money
+ ###< create table crash_q (q money)
+ ###> execute error: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 'money)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_nclob=no # Type nclob
+ ###< create table crash_q (q nclob)
+ ###> execute error: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 'nclob)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_number=no # Type number
+ ###< create table crash_q (q number)
+ ###> execute error: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 'number)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_number(1_arg)=no # Type number(1 arg)
+ ###< create table crash_q (q number(9))
+ ###> execute error: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 'number(9))' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_number(2_arg)=no # Type number(2 arg)
+ ###< create table crash_q (q number(9,2))
+ ###> execute error: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 'number(9,2))' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_nvarchar2(1_arg)=no # Type nvarchar2(1 arg)
+ ###< create table crash_q (q nvarchar2(16))
+ ###> execute error: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 'nvarchar2(16))' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_path=no # Type path
+ ###< create table crash_q (q path)
+ ###> execute error: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 'path)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_point=no # Type point
+ ###< create table crash_q (q point)
+ ###> execute error: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 'point)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_polygon=no # Type polygon
+ ###< create table crash_q (q polygon)
+ ###> execute error: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 'polygon)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_raw(1_arg)=no # Type raw(1 arg)
+ ###< create table crash_q (q raw(16))
+ ###> execute error: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 'raw(16))' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_reltime=no # Type reltime
+ ###< create table crash_q (q reltime)
+ ###> execute error: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 'reltime)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_rowid=no # Type rowid
+ ###< create table crash_q (q rowid)
+ ###> execute error: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 'rowid)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_serial=no # Type serial
+ ###< create table crash_q (q serial)
+ ###> execute error: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 'serial)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_set(1_arg)=yes # Type set(1 arg)
+ ###< create table crash_q (q set('red'))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_smalldatetime=no # Type smalldatetime
+ ###< create table crash_q (q smalldatetime)
+ ###> execute error: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 'smalldatetime)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_smallfloat=no # Type smallfloat
+ ###< create table crash_q (q smallfloat)
+ ###> execute error: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 'smallfloat)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_smallmoney=no # Type smallmoney
+ ###< create table crash_q (q smallmoney)
+ ###> execute error: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 'smallmoney)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_text=yes # Type text
+ ###< create table crash_q (q text)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_extra_text(1_arg)=no # Type text(1 arg)
+ ###< create table crash_q (q text(10))
+ ###> execute error: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 '(10))' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_timespan=no # Type timespan
+ ###< create table crash_q (q timespan)
+ ###> execute error: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 'timespan)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_uint=no # Type uint
+ ###< create table crash_q (q uint)
+ ###> execute error: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 'uint)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_varchar2(1_arg)=no # Type varchar2(1 arg)
+ ###< create table crash_q (q varchar2(257))
+ ###> execute error: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 'varchar2(257))' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_extra_year=yes # Type year
+ ###< create table crash_q (q year)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_odbc_bigint=yes # Type bigint
+ ###< create table crash_q (q bigint)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_odbc_binary(1_arg)=yes # Type binary(1 arg)
+ ###< create table crash_q (q binary(1))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_odbc_datetime=yes # Type datetime
+ ###< create table crash_q (q datetime)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_odbc_tinyint=yes # Type tinyint
+ ###< create table crash_q (q tinyint)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_odbc_varbinary(1_arg)=yes # Type varbinary(1 arg)
+ ###< create table crash_q (q varbinary(1))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_bit=yes # Type bit
+ ###< create table crash_q (q bit)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_bit(1_arg)=yes # Type bit(1 arg)
+ ###< create table crash_q (q bit(2))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_bit_varying(1_arg)=no # Type bit varying(1 arg)
+ ###< create table crash_q (q bit varying(2))
+ ###> execute error: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 'varying(2))' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_sql_boolean=no # Type boolean
+ ###< create table crash_q (q boolean)
+ ###> execute error: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 'boolean)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_sql_char(1_arg)=yes # Type char(1 arg)
+ ###< create table crash_q (q char(1))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_char_varying(1_arg)=yes # Type char varying(1 arg)
+ ###< create table crash_q (q char varying(1))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_character(1_arg)=yes # Type character(1 arg)
+ ###< create table crash_q (q character(1))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_character_varying(1_arg)=yes # Type character varying(1 arg)
+ ###< create table crash_q (q character varying(1))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_date=yes # Type date
+ ###< create table crash_q (q date)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_dec(2_arg)=yes # Type dec(2 arg)
+ ###< create table crash_q (q dec(6,2))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_decimal(2_arg)=yes # Type decimal(2 arg)
+ ###< create table crash_q (q decimal(6,2))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_double_precision=yes # Type double precision
+ ###< create table crash_q (q double precision)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_float=yes # Type float
+ ###< create table crash_q (q float)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_float(1_arg)=yes # Type float(1 arg)
+ ###< create table crash_q (q float(8))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_int=yes # Type int
+ ###< create table crash_q (q int)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_integer=yes # Type integer
+ ###< create table crash_q (q integer)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_interval_day=no # Type interval day
+ ###< create table crash_q (q interval day)
+ ###> execute error: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 'interval day)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_sql_interval_day_to_hour=no # Type interval day to hour
+ ###< create table crash_q (q interval day to hour)
+ ###> execute error: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 'interval day to hour)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_sql_interval_day_to_minute=no # Type interval day to minute
+ ###< create table crash_q (q interval day to minute)
+ ###> execute error: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 'interval day to minute)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_sql_interval_day_to_second=no # Type interval day to second
+ ###< create table crash_q (q interval day to second)
+ ###> execute error: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 'interval day to second)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_sql_interval_hour=no # Type interval hour
+ ###< create table crash_q (q interval hour)
+ ###> execute error: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 'interval hour)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_sql_interval_hour_to_minute=no # Type interval hour to minute
+ ###< create table crash_q (q interval hour to minute)
+ ###> execute error: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 'interval hour to minute)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_sql_interval_hour_to_second=no # Type interval hour to second
+ ###< create table crash_q (q interval hour to second)
+ ###> execute error: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 'interval hour to second)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_sql_interval_minute=no # Type interval minute
+ ###< create table crash_q (q interval minute)
+ ###> execute error: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 'interval minute)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_sql_interval_minute_to_second=no # Type interval minute to second
+ ###< create table crash_q (q interval minute to second)
+ ###> execute error: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 'interval minute to second)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_sql_interval_month=no # Type interval month
+ ###< create table crash_q (q interval month)
+ ###> execute error: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 'interval month)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_sql_interval_second=no # Type interval second
+ ###< create table crash_q (q interval second)
+ ###> execute error: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 'interval second)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_sql_interval_year=no # Type interval year
+ ###< create table crash_q (q interval year)
+ ###> execute error: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 'interval year)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_sql_interval_year_to_month=no # Type interval year to month
+ ###< create table crash_q (q interval year to month)
+ ###> execute error: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 'interval year to month)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_sql_national_char_varying(1_arg)=yes # Type national char varying(1 arg)
+ ###< create table crash_q (q national char varying(20))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_national_character(1_arg)=yes # Type national character(1 arg)
+ ###< create table crash_q (q national character(20))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_national_character_varying(1_arg)=yes # Type national character varying(1 arg)
+ ###< create table crash_q (q national character varying(20))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_nchar(1_arg)=yes # Type nchar(1 arg)
+ ###< create table crash_q (q nchar(1))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_nchar_varying(1_arg)=yes # Type nchar varying(1 arg)
+ ###< create table crash_q (q nchar varying(20))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_numeric(2_arg)=yes # Type numeric(2 arg)
+ ###< create table crash_q (q numeric(9,2))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_real=yes # Type real
+ ###< create table crash_q (q real)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_smallint=yes # Type smallint
+ ###< create table crash_q (q smallint)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_time=yes # Type time
+ ###< create table crash_q (q time)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_timestamp=yes # Type timestamp
+ ###< create table crash_q (q timestamp)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+type_sql_timestamp_with_time_zone=no # Type timestamp with time zone
+ ###< create table crash_q (q timestamp with time zone)
+ ###> execute error: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 'with time zone)' at line 1
+ ###< drop table crash_q
+ ###> execute error:Unknown table 'crash_q'
+ ###
+ ###As far as some queries didnt return OK, result is NO
+type_sql_varchar(1_arg)=yes # Type varchar(1 arg)
+ ###< create table crash_q (q varchar(1))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+union=yes # union
+ ###< select * from crash_me union select a,b from crash_me3
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+union_all=yes # union all
+ ###< select * from crash_me union all select a,b from crash_me3
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+union_all_incompat=yes # union all (incompatible lists)
+ ###< select * from crash_me union all select a,b from crash_me2
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+union_incompat=yes # union (incompatible lists)
+ ###< select * from crash_me union select a,b from crash_me2
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+unique_in_create=yes # unique in create table
+ ###< create table crash_q (q integer not null,unique (q))
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+unique_null_in_create=yes # unique null in create
+ ###< create table crash_q (q integer,unique (q))
+ ###> OK
+ ###< insert into crash_q (q) values (NULL)
+ ###> OK
+ ###< insert into crash_q (q) values (NULL)
+ ###> OK
+ ###< insert into crash_q (q) values (1)
+ ###> OK
+ ###< drop table crash_q
+ ###> OK
+ ###
+ ###As far as all queries returned OK, result is YES
+value_of_false=not supported # Value of FALSE
+ ###<select FALSE
+ ###> execute failed:Unknown column 'FALSE' in 'field list'
+value_of_true=not supported # Value of TRUE
+ ###<select TRUE
+ ###> execute failed:Unknown column 'TRUE' in 'field list'
+views=no # views
+ ###< create view crash_q as select a from crash_me
+ ###> execute error: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 'view crash_q as select a from crash_me' at line 1
+ ###< drop view crash_q
+ ###> execute error: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 'view crash_q' at line 1
+ ###
+ ###As far as some queries didnt return OK, result is NO
+where_string_size=1048539 # constant string size in where
+ ###We are trying (example with N=5):
+ ###select a from crash_me where b >='11111'
diff --git a/sql-bench/limits/mysql.cfg b/sql-bench/limits/mysql.cfg
index feaa79e43e9..64f91f07363 100644
--- a/sql-bench/limits/mysql.cfg
+++ b/sql-bench/limits/mysql.cfg
@@ -82,7 +82,7 @@ alter_drop_unique=with drop key # Alter table drop unique
###< alter table crash_q drop constraint u1 restrict
###> execute error: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 'constraint u1 restrict' at line 1
###
- ###< alter table crash_q drop key c1
+ ###< alter table crash_q drop key u1
###> OK
alter_modify_col=yes # Alter table modify column
###< alter table crash_q modify c1 CHAR(20)
@@ -345,7 +345,7 @@ date_format_inresult=iso # Date format in result
###> OK
###
###< select a from crash_me_d
- ###> 2003-08-27
+ ###> 2004-04-06
###< delete from crash_me_d
###> OK
date_infinity=error # Supports 'infinity dates
@@ -558,14 +558,14 @@ func_extra_add_months=no # Function ADD_MONTHS
###
###<select add_months('1997-01-01',1) from crash_me_d
###> execute failed: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 '('1997-01-01',1) from crash_me_d' at line 1
-func_extra_adddate=no # Function ADDDATE
+func_extra_adddate=yes # Function ADDDATE
###
###<select ADDDATE('2002-12-01',3) from crash_me_d
- ###> execute failed: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 '3) from crash_me_d' at line 1
-func_extra_addtime=no # Function ADDTIME
+ ###>2002-12-04
+func_extra_addtime=yes # Function ADDTIME
###
###<select ADDTIME('20:02:12','00:00:03')
- ###> execute failed: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 '('20:02:12','00:00:03')' at line 1
+ ###>20:02:15
func_extra_alpha=no # Function ALPHA
###
###<select alpha('Aâ',2)
@@ -648,10 +648,10 @@ func_extra_cosh=no # Function COSH
###
###<select cosh(0)
###> execute failed: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 '(0)' at line 1
-func_extra_date=no # Function DATE
+func_extra_date=yes # Function DATE
###
###<select date('1963-08-16') from crash_me_d
- ###> execute failed: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 '('1963-08-16') from crash_me_d' at line 1
+ ###>1963-08-16
func_extra_date_format=yes # Function DATE_FORMAT
###
###<select date_format('1997-01-02 03:04:05','M W D Y y m d h i s w') from crash_me_d
@@ -663,11 +663,11 @@ func_extra_dateadd=no # Function DATEADD
func_extra_datediff=no # Function DATEDIFF
###
###<select datediff(month,'Oct 21 1997','Nov 30 1997') from crash_me_d
- ###> execute failed: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 '(month,'Oct 21 1997','Nov 30 1997') from crash_me_d' at line 1
-func_extra_datediff2arg=no # Function DATEDIFF (2 arg)
+ ###> execute failed: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 ''Nov 30 1997') from crash_me_d' at line 1
+func_extra_datediff2arg=yes # Function DATEDIFF (2 arg)
###
###<select DATEDIFF('2002-12-04','2002-12-01') from crash_me_d
- ###> execute failed: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 '('2002-12-04','2002-12-01') from crash_me_d' at line 1
+ ###>3
func_extra_datename=no # Function DATENAME
###
###<select datename(month,'Nov 30 1997') from crash_me_d
@@ -676,10 +676,10 @@ func_extra_datepart=no # Function DATEPART
###
###<select datepart(month,'July 20 1997') from crash_me_d
###> execute failed: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 '(month,'July 20 1997') from crash_me_d' at line 1
-func_extra_day=no # Function DAY
+func_extra_day=yes # Function DAY
###
###<select DAY('2002-12-01') from crash_me_d
- ###> execute failed: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 '('2002-12-01') from crash_me_d' at line 1
+ ###>1
func_extra_decode=no # Function DECODE
###
###<select DECODE('S-103','T72',1,'S-103',2,'Leopard',3)
@@ -695,7 +695,7 @@ func_extra_elt=yes # Function ELT
func_extra_encrypt=yes # Function ENCRYPT
###
###<select encrypt('hello')
- ###>tHrzZO8Aq1FG6
+ ###>VNeu3dE4DbVJY
func_extra_expand2arg=no # Function EXPAND
###
###<select expand('abcd',6)
@@ -772,10 +772,10 @@ func_extra_interval=yes # Function INTERVAL
###
###<select interval(55,10,20,30,40,50,60,70,80,90,100)
###>5
-func_extra_last_day=no # Function LAST_DAY
+func_extra_last_day=yes # Function LAST_DAY
###
###<select last_day('1997-04-01') from crash_me_d
- ###> execute failed: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 '('1997-04-01') from crash_me_d' at line 1
+ ###>1997-04-30
func_extra_last_insert_id=yes # Function LAST_INSERT_ID
###
###<select last_insert_id()
@@ -825,14 +825,14 @@ func_extra_ltrim2arg=no # Function LTRIM (2 arg)
###
###<select ltrim('..abcd..','.')
###> execute failed: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
-func_extra_makedate=no # Function MAKEDATE
+func_extra_makedate=yes # Function MAKEDATE
###
###<select MAKEDATE(1963,228) from crash_me_d
- ###> execute failed: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 '(1963,228) from crash_me_d' at line 1
-func_extra_maketime=no # Function MAKETIME
+ ###>1963-08-16
+func_extra_maketime=yes # Function MAKETIME
###
###<select MAKETIME(20,02,12)
- ###> execute failed: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 '(20,02,12)' at line 1
+ ###>20:02:12
func_extra_mapchar=no # Function MAPCHAR
###
###<select mapchar('Aâ')
@@ -841,10 +841,10 @@ func_extra_mdy=no # Function MDY
###
###<select mdy(7,1,1998) from crash_me_d
###> execute failed: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 '(7,1,1998) from crash_me_d' at line 1
-func_extra_microsecond=no # Function MICROSECOND
+func_extra_microsecond=yes # Function MICROSECOND
###
###<select MICROSECOND('19630816200212111111')
- ###> execute failed: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 '('19630816200212111111')' at line 1
+ ###>110000
func_extra_mid=yes # Function SUBSTRING as MID
###
###<select mid('hello',3,2)
@@ -858,7 +858,7 @@ func_extra_noround=no # Function NOROUND
###> execute error: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 '(22.6)' at line 1
func_extra_not=yes # Function NOT in SELECT
###
- ###<select not 0
+ ###<select not false
###>1
func_extra_not_between=yes # Function NOT BETWEEN in SELECT
###
@@ -879,7 +879,7 @@ func_extra_odbc_convert=no # Function ODBC CONVERT
func_extra_password=yes # Function PASSWORD
###
###<select password('hello')
- ###>70de51425df9d787
+ ###>*6B4F89A54E2D27ECD7E8DA05B4AB8FD9D1D8B119
func_extra_paste=no # Function PASTE
###
###<select paste('ABCDEFG',3,2,'1234')
@@ -964,18 +964,18 @@ func_extra_stuff=no # Function STUFF
###
###<select stuff('abc',2,3,'xyz')
###> execute failed: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 '('abc',2,3,'xyz')' at line 1
-func_extra_subdate=no # Function SUBDATE
+func_extra_subdate=yes # Function SUBDATE
###
###<select SUBDATE('2002-12-04',3) from crash_me_d
- ###> execute failed: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 '3) from crash_me_d' at line 1
-func_extra_substr2arg=no # Function SUBSTR (2 arg)
+ ###>2002-12-01
+func_extra_substr2arg=yes # Function SUBSTR (2 arg)
###
###<select substr('abcd',2)
- ###> execute failed: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 '('abcd',2)' at line 1
-func_extra_substr3arg=no # Function SUBSTR (3 arg)
+ ###>bcd
+func_extra_substr3arg=yes # Function SUBSTR (3 arg)
###
###<select substr('abcd',2,2)
- ###> execute failed: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 '('abcd',2,2)' at line 1
+ ###>bc
func_extra_substrb=no # Function SUBSTRB
###
###<select SUBSTRB('ABCDEFG',5,4.2)
@@ -984,14 +984,14 @@ func_extra_substring_index=yes # Function SUBSTRING_INDEX
###
###<select substring_index('www.tcx.se','.',-2)
###>tcx.se
-func_extra_subtime=no # Function SUBTIME
+func_extra_subtime=yes # Function SUBTIME
###
###<select SUBTIME('20:02:15','00:00:03')
- ###> execute failed: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 '('20:02:15','00:00:03')' at line 1
+ ###>20:02:12
func_extra_sysdate=yes # Function SYSDATE
###
###<select sysdate()
- ###>2003-08-27 19:55:21
+ ###>2004-04-06 13:49:05
func_extra_tail=no # Function TAIL
###
###<select tail('ABCDEFG',3)
@@ -1000,22 +1000,23 @@ func_extra_tanh=no # Function TANH
###
###<select tanh(1)
###> execute failed: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)' at line 1
-func_extra_time=no # Function TIME
+func_extra_time=yes # Function TIME
###
###<select time('20:02:12')
- ###> execute failed: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 '('20:02:12')' at line 1
+ ###>20:02:12
func_extra_time_to_sec=yes # Function TIME_TO_SEC
###
###<select time_to_sec('01:23:21')
###>5001
-func_extra_timediff=no # Function TIMEDIFF
+func_extra_timediff=yes # Function TIMEDIFF
###
###<select TIMEDIFF('20:02:15','20:02:12')
- ###> execute failed: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 '('20:02:15','20:02:12')' at line 1
-func_extra_timestamp=no # Function TIMESTAMP
+ ###>00:00:03
+func_extra_timestamp=error # Function TIMESTAMP
###
###<select timestamp('19630816','00200212')
- ###> execute failed: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 '('19630816','00200212')' at line 1
+ ###>1963-08-16 20:02:12
+ ###We expected '19630816200212000000' but got '1963-08-16 20:02:12'
func_extra_to_days=yes # Function TO_DAYS
###
###<select to_days('1996-01-01') from crash_me_d
@@ -1056,7 +1057,7 @@ func_extra_uid=no # Function UID
func_extra_unix_timestamp=yes # Function UNIX_TIMESTAMP
###
###<select unix_timestamp()
- ###>1062003321
+ ###>1081248545
func_extra_userenv=no # Function USERENV
###
###<select userenv
@@ -1068,15 +1069,15 @@ func_extra_value=no # Function VALUE
func_extra_version=yes # Function VERSION
###
###<select version()
- ###>4.0.15-debug-log
+ ###>4.1.2-alpha
func_extra_weekday=yes # Function WEEKDAY
###
###<select weekday('1997-11-29') from crash_me_d
###>5
-func_extra_weekofyear=no # Function WEEKOFYEAR
+func_extra_weekofyear=yes # Function WEEKOFYEAR
###
###<select WEEKOFYEAR('1963-08-16') from crash_me_d
- ###> execute failed: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 '('1963-08-16') from crash_me_d' at line 1
+ ###>33
func_extra_|=yes # Function | (bitwise or)
###
###<select 1 | 2
@@ -1136,11 +1137,11 @@ func_odbc_cot=yes # Function COT
func_odbc_curdate=yes # Function CURDATE
###
###<select curdate()
- ###>2003-08-27
+ ###>2004-04-06
func_odbc_curtime=yes # Function CURTIME
###
###<select curtime()
- ###>19:55:21
+ ###>13:49:04
func_odbc_database=yes # Function DATABASE
###
###<select database()
@@ -1269,7 +1270,7 @@ func_odbc_monthname=yes # Function MONTHNAME
func_odbc_now=yes # Function NOW
###
###<select now()
- ###>2003-08-27 19:55:21
+ ###>2004-04-06 13:49:04
func_odbc_pi=yes # Function PI
###
###<select pi()
@@ -1416,20 +1417,17 @@ func_sql_concat_as_||=error # Function concatenation with ||
func_sql_current_date=yes # Function CURRENT_DATE
###
###<select current_date
- ###>2003-08-27
+ ###>2004-04-06
func_sql_current_time=yes # Function CURRENT_TIME
###
###<select current_time
- ###>19:55:21
+ ###>13:49:04
func_sql_current_timestamp=yes # Function CURRENT_TIMESTAMP
###
###<select current_timestamp
- ###>2003-08-27 19:55:21
-func_sql_current_user=with_parenthesis # CURRENT_USER
+ ###>2004-04-06 13:49:04
+func_sql_current_user=yes # CURRENT_USER
###< select CURRENT_USER
- ###> execute error:Unknown column 'CURRENT_USER' in 'field list'
- ###
- ###< select CURRENT_USER()
###> OK
func_sql_extract_sql=yes # Function EXTRACT
###
@@ -1438,11 +1436,11 @@ func_sql_extract_sql=yes # Function EXTRACT
func_sql_localtime=yes # Function LOCALTIME
###
###<select localtime
- ###>2003-08-27 19:55:21
+ ###>2004-04-06 13:49:04
func_sql_localtimestamp=yes # Function LOCALTIMESTAMP
###
###<select localtimestamp
- ###>2003-08-27 19:55:21
+ ###>2004-04-06 13:49:04
func_sql_lower=yes # Function LOWER
###
###<select LOWER('ABC')
@@ -1505,22 +1503,22 @@ func_where_between=yes # Function BETWEEN
###
###<select a from crash_me where 5 between 4 and 6
###>1
-func_where_eq_all=no # Function = ALL
+func_where_eq_all=yes # Function = ALL
###
###<select a from crash_me where b =all (select b from crash_me)
- ###> execute failed: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 'all (select b from crash_me)' at line 1
-func_where_eq_any=no # Function = ANY
+ ###>1
+func_where_eq_any=yes # Function = ANY
###
###<select a from crash_me where b =any (select b from crash_me)
- ###> execute failed: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 b from crash_me)' at line 1
-func_where_eq_some=no # Function = SOME
+ ###>1
+func_where_eq_some=yes # Function = SOME
###
###<select a from crash_me where b =some (select b from crash_me)
- ###> execute failed: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 b from crash_me)' at line 1
-func_where_exists=no # Function EXISTS
+ ###>1
+func_where_exists=yes # Function EXISTS
###
###<select a from crash_me where exists (select * from crash_me)
- ###> execute failed: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 'exists (select * from crash_me)' at line 1
+ ###>1
func_where_in_num=yes # Function IN on numbers
###
###<select a from crash_me where 2 in (3,2,5,9,5,1)
@@ -1549,10 +1547,10 @@ func_where_not_between=yes # Function NOT BETWEEN
###
###<select a from crash_me where 7 not between 4 and 6
###>1
-func_where_not_exists=no # Function NOT EXISTS
+func_where_not_exists=yes # Function NOT EXISTS
###
###<select a from crash_me where not exists (select * from crash_me where a = 2)
- ###> execute failed: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 'exists (select * from crash_me where a = 2)' at line 1
+ ###>1
func_where_not_like=yes # Function NOT LIKE
###
###<select a from crash_me where b not like 'b%'
@@ -1623,10 +1621,10 @@ group_func_extra_stddev=yes # Group function STDDEV
###
###<select stddev(a),a from crash_me group by a
###>0.0000
-group_func_extra_variance=no # Group function VARIANCE
+group_func_extra_variance=yes # Group function VARIANCE
###
###<select variance(a),a from crash_me group by a
- ###> execute failed: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 '(a),a from crash_me group by a' at line 1
+ ###>0.0000
group_func_sql_any=no # Group function ANY
###
###<select any(a),a from crash_me group by a
@@ -1690,9 +1688,9 @@ group_on_unused=yes # Group on unused column
###> OK
###
###As far as all queries returned OK, result is YES
-has_true_false=no # TRUE and FALSE
+has_true_false=yes # TRUE and FALSE
###< select (1=1)=true
- ###> execute error:Unknown column 'true' in 'field list'
+ ###> OK
having=yes # Having
###<select a from crash_me group by a having a > 0
###>1
@@ -1832,10 +1830,10 @@ intersect_incompat=no # intersect (incompatible lists)
###> execute error: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 crash_me2' at line 1
###
###As far as some queries didnt return OK, result is NO
-join_tables=31 # tables in join
+join_tables=61 # tables in join
###We are trying (example with N=5):
###select crash_me.a,t0.a,t1.a,t2.a,t3.a,t4.a from crash_me,crash_me t0,crash_me t1,crash_me t2,crash_me t3,crash_me t4
- ### 32:FAIL 7:OK 19:OK 25:OK 28:OK 30:OK 31:FAIL
+ ### 32:OK 48:OK 56:OK 60:OK 62:FAIL 61:FAIL
left_outer_join=yes # left outer join
###< select crash_me.a from crash_me left join crash_me2 ON crash_me.a=crash_me2.a
###> OK
@@ -1890,39 +1888,39 @@ logical_value=1 # Value of logical operation (1=1)
###>1
max_big_expressions=10 # big expressions
###We are trying (example with N=5):
- ###select 0+(1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+...(14308)
+ ###select 0+(1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+...(8168)
### 50:FAIL 10:OK 30:FAIL 14:FAIL 11:FAIL
-max_char_size=255 # max char() size
+max_char_size=1048543 # max char() size
###We are trying (example with N=5):
###create table crash_q (q char(5))
###insert into crash_q values ('aaaaa')
###select * from crash_q
- ### 524287:FAIL 104858:FAIL 20972:FAIL 4195:FAIL 839:FAIL 168:OK 503:FAIL 235:OK 369:FAIL 262:FAIL 241:OK 251:OK 256:FAIL 252:OK 254:OK 255:OK
+ ### 524287:OK 786431:OK 917503:OK 983039:OK 1015807:OK 1032191:OK 1040383:OK 1044479:OK 1046527:OK 1047551:OK 1048063:OK 1048319:OK 1048447:OK 1048511:OK 1048543:OK 1048559:FAIL 1048546:FAIL 1048544:FAIL
max_column_name=64 # column name length
###We are trying (example with N=5):
###create table crash_q (qaaaaa integer)
###insert into crash_q (qaaaaa) values(1)
###select qaaaaa from crash_q
### 256:FAIL 51:OK 153:FAIL 72:FAIL 55:OK 63:OK 67:FAIL 64:FAIL
-max_columns=3398 # Columns in table
+max_columns=2599 # Columns in table
###We are trying (example with N=5):
###create table crash_q (a integer ,a0 integer,a1 integer,a2 integer,a3 integer,a4 integer)
- ### 4096:FAIL 819:OK 2457:OK 3276:OK 3686:FAIL 3358:OK 3522:FAIL 3391:OK 3456:FAIL 3404:FAIL 3394:OK 3399:FAIL 3395:OK 3397:OK 3398:FAIL
+ ### 4096:FAIL 819:OK 2457:OK 3276:FAIL 2621:FAIL 2490:OK 2555:OK 2588:OK 2604:FAIL 2591:OK 2597:OK 2600:FAIL 2598:OK 2599:FAIL
max_conditions=85660 # OR and AND in WHERE
###We are trying (example with N=5):
###select a from crash_me where a=1 and b='a' or a=0 and b='0' or a=1 and b='1' or a=2 and b='2' or a=3 and b='3' or a=4 and b='4'
### 27592:OK 41389:OK 48287:FAIL 42769:OK 45528:FAIL 43321:FAIL 42880:FAIL 42791:OK 42835:FAIL 42800:OK 42817:OK 42826:OK 42830:OK 42832:FAIL 42831:FAIL
-max_expressions=1450 # simple expressions
+max_expressions=836 # simple expressions
###We are trying (example with N=5):
###select 1+1+1+1+1+1
- ### 5000:FAIL 1000:OK 3000:FAIL 1400:OK 2200:FAIL 1560:FAIL 1432:OK 1496:FAIL 1445:OK 1470:FAIL 1450:OK 1460:FAIL 1452:FAIL 1451:FAIL
+ ### 5000:FAIL 1000:FAIL 200:OK 600:OK 800:OK 900:FAIL 820:OK 860:FAIL 828:OK 844:FAIL 831:OK 837:FAIL 832:OK 834:OK 835:OK 836:OK
max_index=32 # max index
### max_unique_index=32 ,so max_index must be same
-max_index_length=500 # index length
+max_index_length=1000 # index length
###We are trying (example with N=5):
###create table crash_q (q0 char(5) not null,unique (q0))
###insert into crash_q values('aaaaa')
- ### 4096:FAIL 819:FAIL 164:OK 491:OK 655:FAIL 524:FAIL 498:OK 511:FAIL 501:FAIL 499:OK 500:OK
+ ### 4096:FAIL 819:OK 2457:FAIL 1147:FAIL 885:OK 1016:FAIL 911:OK 963:OK 989:OK 1002:FAIL 992:OK 997:OK 999:OK 1000:OK 1001:FAIL
max_index_name=64 # index name length
###We are trying (example with N=5):
###create index crash_qaaaaa on crash_me (a)
@@ -1932,6 +1930,7 @@ max_index_part_length=255 # max index part length
###create table crash_q (q char(5) not null,unique(q))
###insert into crash_q (q) values ('aaaaa')
###select q from crash_q
+ ### 524271:FAIL 104854:FAIL 20971:FAIL 4194:FAIL 839:FAIL 168:OK 503:FAIL 235:OK 369:FAIL 262:FAIL 241:OK 251:OK 256:FAIL 252:OK 254:OK 255:OK
max_index_parts=16 # index parts
###We are trying (example with N=5):
###create table crash_q (q0 integer not null,q1 integer not null,q2 integer not null,q3 integer not null,q4 integer not nul...(1263)
@@ -1943,11 +1942,12 @@ max_index_varchar_part_length=255 # index varchar part length
###create table crash_q (q varchar(5) not null,unique(q))
###insert into crash_q (q) values ('aaaaa')
###select q from crash_q
+ ### 524271:FAIL 104854:FAIL 20971:FAIL 4194:FAIL 839:FAIL 168:OK 503:FAIL 235:OK 369:FAIL 262:FAIL 241:OK 251:OK 256:FAIL 252:OK 254:OK 255:OK
max_row_length=65534 # max table row length (without blobs)
###We are trying (example with N=5):
###create table crash_q (q0 char(5) not null)
###insert into crash_q values ('aaaaa')
- ### 433245:FAIL 86649:FAIL 17330:OK 51989:OK 69319:FAIL 55455:OK 62387:OK 65853:FAIL 63080:OK 64466:OK 65159:OK 65506:OK 65679:FAIL 65541:FAIL 65513:OK 65527:OK 65534:OK 65537:FAIL 65535:FAIL
+ ### 331372:FAIL 66275:FAIL 13255:OK 39765:OK 53020:OK 59647:OK 62961:OK 64618:OK 65446:OK 65860:FAIL 65529:OK 65694:FAIL 65562:FAIL 65536:FAIL 65531:OK 65533:OK 65534:OK 65535:FAIL
max_row_length_with_null=65502 # table row length with nulls (without blobs)
###We are trying (example with N=5):
###create table crash_q (q0 char(5) )
@@ -1956,10 +1956,10 @@ max_row_length_with_null=65502 # table row length with nulls (without blobs)
max_select_alias_name=+512 # select alias name length
###We are trying (example with N=5):
###select b as aaaaa from crash_me
-max_stack_expression=1450 # stacked expressions
+max_stack_expression=836 # stacked expressions
###We are trying (example with N=5):
###select 1+(1+(1+(1+(1+(1)))))
- ### 1000:OK 1500:FAIL 1100:OK 1300:OK 1400:OK 1450:OK 1475:FAIL 1455:FAIL 1451:FAIL
+ ### 1000:FAIL 200:OK 600:OK 800:OK 900:FAIL 820:OK 860:FAIL 828:OK 844:FAIL 831:OK 837:FAIL 832:OK 834:OK 835:OK 836:OK
max_table_alias_name=+512 # table alias name length
###We are trying (example with N=5):
###select aaaaa.b from crash_me aaaaa
@@ -1981,12 +1981,12 @@ max_unique_index=32 # unique indexes
###insert into crash_q (q,q1,q2,q3,q4,q5) values (1,1,1,1,1,1)
###select q from crash_q
### 32:OK 48:FAIL 35:FAIL 33:FAIL
-max_varchar_size=255 # max varchar() size
+max_varchar_size=1048543 # max varchar() size
###We are trying (example with N=5):
###create table crash_q (q varchar(5))
###insert into crash_q values ('aaaaa')
###select * from crash_q
- ### 524287:FAIL 104858:FAIL 20972:FAIL 4195:FAIL 839:FAIL 168:OK 503:FAIL 235:OK 369:FAIL 262:FAIL 241:OK 251:OK 256:FAIL 252:OK 254:OK 255:OK
+ ### 524287:OK 786431:OK 917503:OK 983039:OK 1015807:OK 1032191:OK 1040383:OK 1044479:OK 1046527:OK 1047551:OK 1048063:OK 1048319:OK 1048447:OK 1048511:OK 1048543:OK 1048559:FAIL 1048546:FAIL 1048544:FAIL
minus=no # minus
###< select * from crash_me minus select * from crash_me3
###> execute error: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 crash_me3' at line 1
@@ -2129,7 +2129,7 @@ odbc_left_outer_join=yes # left outer join odbc style
###> OK
###
###As far as all queries returned OK, result is YES
-operating_system=Linux 2.4.20-64GB-SMP i686 # crash-me tested on
+operating_system=Linux 2.4.21-199-smp4G i686 # crash-me tested on
order_by=yes # Order by
###< select a from crash_me order by a
###> OK
@@ -2267,6 +2267,9 @@ quote_with_"=yes # Allows ' and " as string markers
###> OK
###
###As far as all queries returned OK, result is YES
+recursive_subqueries=+64 # recursive subqueries
+ ###We are trying (example with N=5):
+ ###select a from crash_me where a in (select a from crash_me where a in (select a from crash_me where a in (select a from c...(82)
remember_end_space=no # Remembers end space in char()
###< create table crash_q (a char(10))
###> OK
@@ -2300,10 +2303,10 @@ rename_table=yes # rename table
###> OK
###
###As far as all queries returned OK, result is YES
-repeat_string_size=1047552 # return string size from function
+repeat_string_size=1048576 # return string size from function
###We are trying (example with N=5):
###select repeat('a',5)
- ### 4000000:FAIL 800000:OK 2400000:FAIL 1120000:FAIL 864000:OK 992000:OK 1056000:FAIL 1004800:OK 1030400:OK 1043200:OK 1049600:FAIL 1044480:OK 1047040:OK 1048320:FAIL 1047296:OK 1047808:FAIL 1047399:OK 1047603:FAIL 1047440:OK 1047521:OK 1047562:FAIL 1047529:OK 1047545:OK 1047553:FAIL 1047547:OK 1047550:OK 1047551:OK 1047552:OK
+ ### 4000000:FAIL 800000:OK 2400000:FAIL 1120000:FAIL 864000:OK 992000:OK 1056000:FAIL 1004800:OK 1030400:OK 1043200:OK 1049600:FAIL 1044480:OK 1047040:OK 1048320:OK 1048960:FAIL 1048448:OK 1048704:FAIL 1048499:OK 1048601:FAIL 1048520:OK 1048560:OK 1048580:FAIL 1048564:OK 1048572:OK 1048576:OK 1048578:FAIL 1048577:FAIL
reserved_word_ansi-92/99_absolute=no # Keyword ABSOLUTE
###< create table crash_me10 (ABSOLUTE int not null)
###> OK
@@ -2416,13 +2419,13 @@ reserved_word_ansi-92/99_authorization=no # Keyword AUTHORIZATION
###> OK
###
###As far as all queries returned OK, result is NO
-reserved_word_ansi-92/99_before=no # Keyword BEFORE
+reserved_word_ansi-92/99_before=yes # Keyword BEFORE
###< create table crash_me10 (BEFORE int not null)
- ###> OK
+ ###> execute error: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 'BEFORE int not null)' at line 1
###< drop table crash_me10
- ###> OK
+ ###> execute error:Unknown table 'crash_me10'
###
- ###As far as all queries returned OK, result is NO
+ ###As far as some queries didnt return OK, result is YES
reserved_word_ansi-92/99_begin=no # Keyword BEGIN
###< create table crash_me10 (BEGIN int not null)
###> OK
@@ -2535,13 +2538,13 @@ reserved_word_ansi-92/99_close=no # Keyword CLOSE
###> OK
###
###As far as all queries returned OK, result is NO
-reserved_word_ansi-92/99_collate=no # Keyword COLLATE
+reserved_word_ansi-92/99_collate=yes # Keyword COLLATE
###< create table crash_me10 (COLLATE int not null)
- ###> OK
+ ###> execute error: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 'COLLATE int not null)' at line 1
###< drop table crash_me10
- ###> OK
+ ###> execute error:Unknown table 'crash_me10'
###
- ###As far as all queries returned OK, result is NO
+ ###As far as some queries didnt return OK, result is YES
reserved_word_ansi-92/99_collation=no # Keyword COLLATION
###< create table crash_me10 (COLLATION int not null)
###> OK
@@ -2913,13 +2916,13 @@ reserved_word_ansi-92/99_external=no # Keyword EXTERNAL
###> OK
###
###As far as all queries returned OK, result is NO
-reserved_word_ansi-92/99_false=no # Keyword FALSE
+reserved_word_ansi-92/99_false=yes # Keyword FALSE
###< create table crash_me10 (FALSE int not null)
- ###> OK
+ ###> execute error: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 'FALSE int not null)' at line 1
###< drop table crash_me10
- ###> OK
+ ###> execute error:Unknown table 'crash_me10'
###
- ###As far as all queries returned OK, result is NO
+ ###As far as some queries didnt return OK, result is YES
reserved_word_ansi-92/99_fetch=no # Keyword FETCH
###< create table crash_me10 (FETCH int not null)
###> OK
@@ -3223,7 +3226,7 @@ reserved_word_ansi-92/99_level=no # Keyword LEVEL
###As far as all queries returned OK, result is NO
reserved_word_ansi-92/99_like=yes # Keyword LIKE
###< create table crash_me10 (LIKE int not null)
- ###> execute error: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 'LIKE int not null)' at line 1
+ ###> execute error: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 'int not null)' at line 1
###< drop table crash_me10
###> execute error:Unknown table 'crash_me10'
###
@@ -3466,13 +3469,13 @@ reserved_word_ansi-92/99_parameters=no # Keyword PARAMETERS
###> OK
###
###As far as all queries returned OK, result is NO
-reserved_word_ansi-92/99_partial=yes # Keyword PARTIAL
+reserved_word_ansi-92/99_partial=no # Keyword PARTIAL
###< create table crash_me10 (PARTIAL int not null)
- ###> execute error: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 'PARTIAL int not null)' at line 1
+ ###> OK
###< drop table crash_me10
- ###> execute error:Unknown table 'crash_me10'
+ ###> OK
###
- ###As far as some queries didnt return OK, result is YES
+ ###As far as all queries returned OK, result is NO
reserved_word_ansi-92/99_precision=yes # Keyword PRECISION
###< create table crash_me10 (PRECISION int not null)
###> execute error: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 'PRECISION int not null)' at line 1
@@ -3900,13 +3903,13 @@ reserved_word_ansi-92/99_trigger=no # Keyword TRIGGER
###> OK
###
###As far as all queries returned OK, result is NO
-reserved_word_ansi-92/99_true=no # Keyword TRUE
+reserved_word_ansi-92/99_true=yes # Keyword TRUE
###< create table crash_me10 (TRUE int not null)
- ###> OK
+ ###> execute error: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 'TRUE int not null)' at line 1
###< drop table crash_me10
- ###> OK
+ ###> execute error:Unknown table 'crash_me10'
###
- ###As far as all queries returned OK, result is NO
+ ###As far as some queries didnt return OK, result is YES
reserved_word_ansi-92/99_under=no # Keyword UNDER
###< create table crash_me10 (UNDER int not null)
###> OK
@@ -4124,13 +4127,13 @@ reserved_word_ansi92_coalesce=no # Keyword COALESCE
###> OK
###
###As far as all queries returned OK, result is NO
-reserved_word_ansi92_convert=no # Keyword CONVERT
+reserved_word_ansi92_convert=yes # Keyword CONVERT
###< create table crash_me10 (CONVERT int not null)
- ###> OK
+ ###> execute error: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 'CONVERT int not null)' at line 1
###< drop table crash_me10
- ###> OK
+ ###> execute error:Unknown table 'crash_me10'
###
- ###As far as all queries returned OK, result is NO
+ ###As far as some queries didnt return OK, result is YES
reserved_word_ansi92_count=no # Keyword COUNT
###< create table crash_me10 (COUNT int not null)
###> OK
@@ -5321,13 +5324,13 @@ reserved_word_extra_low_priority=yes # Keyword LOW_PRIORITY
###> execute error:Unknown table 'crash_me10'
###
###As far as some queries didnt return OK, result is YES
-reserved_word_extra_master_server_id=yes # Keyword MASTER_SERVER_ID
+reserved_word_extra_master_server_id=no # Keyword MASTER_SERVER_ID
###< create table crash_me10 (MASTER_SERVER_ID int not null)
- ###> execute error: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 'MASTER_SERVER_ID int not null)' at line 1
+ ###> OK
###< drop table crash_me10
- ###> execute error:Unknown table 'crash_me10'
+ ###> OK
###
- ###As far as some queries didnt return OK, result is YES
+ ###As far as all queries returned OK, result is NO
reserved_word_extra_maxextents=no # Keyword MAXEXTENTS
###< create table crash_me10 (MAXEXTENTS int not null)
###> OK
@@ -5720,13 +5723,13 @@ reserved_word_extra_soname=yes # Keyword SONAME
###> execute error:Unknown table 'crash_me10'
###
###As far as some queries didnt return OK, result is YES
-reserved_word_extra_spatial=no # Keyword SPATIAL
+reserved_word_extra_spatial=yes # Keyword SPATIAL
###< create table crash_me10 (SPATIAL int not null)
- ###> OK
+ ###> execute error: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 'int not null)' at line 1
###< drop table crash_me10
- ###> OK
+ ###> execute error:Unknown table 'crash_me10'
###
- ###As far as all queries returned OK, result is NO
+ ###As far as some queries didnt return OK, result is YES
reserved_word_extra_sql_big_result=yes # Keyword SQL_BIG_RESULT
###< create table crash_me10 (SQL_BIG_RESULT int not null)
###> execute error: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 'SQL_BIG_RESULT int not null)' at line 1
@@ -6038,13 +6041,16 @@ select_limit3=yes # SELECT with LIMIT # OFFSET #
select_string_size=1048565 # constant string size in SELECT
###We are trying (example with N=5):
###select 'aaaaa'
-select_table_update=no # Update with sub select
+select_table_update=yes # Update with sub select
###< create table crash_q (a integer,b char(10))
###> OK
###< insert into crash_q values(1,'c')
###> OK
###< update crash_q set b= (select b from crash_me where crash_q.a = crash_me.a)
- ###> execute error: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 b from crash_me where crash_q.a = crash_me.a)' at line 1
+ ###> OK
+ ###
+ ###<select b from crash_q
+ ###>a
###
###< drop table crash_q
###> OK
@@ -6053,7 +6059,7 @@ select_without_from=yes # SELECT without FROM
###> OK
###
###As far as all queries returned OK, result is YES
-server_version=MySQL 4.0.15 debug log/ # server version
+server_version=MySQL 4.1.2 alpha # server version
simple_joins=yes # ANSI SQL simple joins
###< select crash_me.a from crash_me, crash_me t0
###> OK
@@ -6148,11 +6154,11 @@ storage_of_float=round # Storage of float values
###
###< drop table crash_q
###> OK
-subqueries=no # subqueries
+subqueries=yes # subqueries
###< select a from crash_me where crash_me.a in (select max(a) from crash_me)
- ###> execute error: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 max(a) from crash_me)' at line 1
+ ###> OK
###
- ###As far as some queries didnt return OK, result is NO
+ ###As far as all queries returned OK, result is YES
table_alias=yes # Table alias
###< select b.a from crash_me as b
###> OK
@@ -6220,7 +6226,7 @@ time_format_inresult=iso # Time format in result
###> OK
###
###< select a from crash_me_t
- ###> 19:55:21
+ ###> 13:49:05
###< delete from crash_me_t
###> OK
transactions=yes # transactions
@@ -6439,13 +6445,13 @@ type_extra_line=no # Type line
###> execute error:Unknown table 'crash_q'
###
###As far as some queries didnt return OK, result is NO
-type_extra_long=no # Type long
+type_extra_long=yes # Type long
###< create table crash_q (q long)
- ###> execute error: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
+ ###> OK
###< drop table crash_q
- ###> execute error:Unknown table 'crash_q'
+ ###> OK
###
- ###As far as some queries didnt return OK, result is NO
+ ###As far as all queries returned OK, result is YES
type_extra_long_raw=no # Type long raw
###< create table crash_q (q long raw)
###> execute error: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 'raw)' at line 1
@@ -6558,20 +6564,20 @@ type_extra_path=no # Type path
###> execute error:Unknown table 'crash_q'
###
###As far as some queries didnt return OK, result is NO
-type_extra_point=no # Type point
+type_extra_point=yes # Type point
###< create table crash_q (q point)
- ###> execute error: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 'point)' at line 1
+ ###> OK
###< drop table crash_q
- ###> execute error:Unknown table 'crash_q'
+ ###> OK
###
- ###As far as some queries didnt return OK, result is NO
-type_extra_polygon=no # Type polygon
+ ###As far as all queries returned OK, result is YES
+type_extra_polygon=yes # Type polygon
###< create table crash_q (q polygon)
- ###> execute error: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 'polygon)' at line 1
+ ###> OK
###< drop table crash_q
- ###> execute error:Unknown table 'crash_q'
+ ###> OK
###
- ###As far as some queries didnt return OK, result is NO
+ ###As far as all queries returned OK, result is YES
type_extra_raw(1_arg)=no # Type raw(1 arg)
###< create table crash_q (q raw(16))
###> execute error: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 'raw(16))' at line 1
@@ -6593,13 +6599,13 @@ type_extra_rowid=no # Type rowid
###> execute error:Unknown table 'crash_q'
###
###As far as some queries didnt return OK, result is NO
-type_extra_serial=no # Type serial
+type_extra_serial=yes # Type serial
###< create table crash_q (q serial)
- ###> execute error: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 'serial)' at line 1
+ ###> OK
###< drop table crash_q
- ###> execute error:Unknown table 'crash_q'
+ ###> OK
###
- ###As far as some queries didnt return OK, result is NO
+ ###As far as all queries returned OK, result is YES
type_extra_set(1_arg)=yes # Type set(1 arg)
###< create table crash_q (q set('red'))
###> OK
@@ -6635,13 +6641,13 @@ type_extra_text=yes # Type text
###> OK
###
###As far as all queries returned OK, result is YES
-type_extra_text(1_arg)=no # Type text(1 arg)
+type_extra_text(1_arg)=yes # Type text(1 arg)
###< create table crash_q (q text(10))
- ###> execute error: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 '(10))' at line 1
+ ###> OK
###< drop table crash_q
- ###> execute error:Unknown table 'crash_q'
+ ###> OK
###
- ###As far as some queries didnt return OK, result is NO
+ ###As far as all queries returned OK, result is YES
type_extra_timespan=no # Type timespan
###< create table crash_q (q timespan)
###> execute error: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 'timespan)' at line 1
@@ -6726,13 +6732,13 @@ type_sql_bit_varying(1_arg)=no # Type bit varying(1 arg)
###> execute error:Unknown table 'crash_q'
###
###As far as some queries didnt return OK, result is NO
-type_sql_boolean=no # Type boolean
+type_sql_boolean=yes # Type boolean
###< create table crash_q (q boolean)
- ###> execute error: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 'boolean)' at line 1
+ ###> OK
###< drop table crash_q
- ###> execute error:Unknown table 'crash_q'
+ ###> OK
###
- ###As far as some queries didnt return OK, result is NO
+ ###As far as all queries returned OK, result is YES
type_sql_char(1_arg)=yes # Type char(1 arg)
###< create table crash_q (q char(1))
###> OK
@@ -7032,12 +7038,12 @@ unique_null_in_create=yes # unique null in create
###> OK
###
###As far as all queries returned OK, result is YES
-value_of_false=not supported # Value of FALSE
+value_of_false=0 # Value of FALSE
###<select FALSE
- ###> execute failed:Unknown column 'FALSE' in 'field list'
-value_of_true=not supported # Value of TRUE
+ ###>0
+value_of_true=1 # Value of TRUE
###<select TRUE
- ###> execute failed:Unknown column 'TRUE' in 'field list'
+ ###>1
views=no # views
###< create view crash_q as select a from crash_me
###> execute error: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 'view crash_q as select a from crash_me' at line 1
diff --git a/sql-common/client.c b/sql-common/client.c
index af64bb2b210..02fb1964eaa 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -286,7 +286,7 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host,
char **arg_unix_socket)
{
HANDLE hPipe=INVALID_HANDLE_VALUE;
- char szPipeName [ 257 ];
+ char pipe_name[1024];
DWORD dwMode;
int i;
my_bool testing_named_pipes=0;
@@ -297,13 +297,15 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host,
if (!host || !strcmp(host,LOCAL_HOST))
host=LOCAL_HOST_NAMEDPIPE;
- sprintf( szPipeName, "\\\\%s\\pipe\\%s", host, unix_socket);
- DBUG_PRINT("info",("Server name: '%s'. Named Pipe: %s",
- host, unix_socket));
+
+ pipe_name[sizeof(pipe_name)-1]= 0; /* Safety if too long string */
+ strxnmov(pipe_name, sizeof(pipe_name)-1, "\\\\", host, "\\pipe\\",
+ unix_socket, NullS);
+ DBUG_PRINT("info",("Server name: '%s'. Named Pipe: %s", host, unix_socket));
for (i=0 ; i < 100 ; i++) /* Don't retry forever */
{
- if ((hPipe = CreateFile(szPipeName,
+ if ((hPipe = CreateFile(pipe_name,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
@@ -320,7 +322,7 @@ HANDLE create_named_pipe(NET *net, uint connect_timeout, char **arg_host,
return INVALID_HANDLE_VALUE;
}
/* wait for for an other instance */
- if (! WaitNamedPipe(szPipeName, connect_timeout*1000) )
+ if (! WaitNamedPipe(pipe_name, connect_timeout*1000) )
{
net->last_errno=CR_NAMEDPIPEWAIT_ERROR;
strmov(net->sqlstate, unknown_sqlstate);
@@ -583,11 +585,8 @@ net_safe_read(MYSQL *mysql)
return (packet_error);
#endif /*MYSQL_SERVER*/
end_server(mysql);
- net->last_errno=(net->last_errno == ER_NET_PACKET_TOO_LARGE ?
- CR_NET_PACKET_TOO_LARGE:
- CR_SERVER_LOST);
- strmov(net->last_error,ER(net->last_errno));
- strmov(net->sqlstate, unknown_sqlstate);
+ set_mysql_error(mysql, net->last_errno == ER_NET_PACKET_TOO_LARGE ?
+ CR_NET_PACKET_TOO_LARGE: CR_SERVER_LOST, unknown_sqlstate);
return (packet_error);
}
if (net->read_pos[0] == 255)
@@ -607,11 +606,8 @@ net_safe_read(MYSQL *mysql)
min((uint) len,(uint) sizeof(net->last_error)-1));
}
else
- {
- net->last_errno=CR_UNKNOWN_ERROR;
- strmov(net->sqlstate, unknown_sqlstate);
- strmov(net->last_error,ER(net->last_errno));
- }
+ set_mysql_error(mysql, CR_UNKNOWN_ERROR, unknown_sqlstate);
+
DBUG_PRINT("error",("Got error: %d/%s (%s)",
net->last_errno, net->sqlstate, net->last_error));
return(packet_error);
@@ -647,8 +643,7 @@ cli_advanced_command(MYSQL *mysql, enum enum_server_command command,
}
if (mysql->status != MYSQL_STATUS_READY)
{
- strmov(net->last_error,ER(mysql->net.last_errno=CR_COMMANDS_OUT_OF_SYNC));
- strmov(net->sqlstate, unknown_sqlstate);
+ set_mysql_error(mysql, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate);
return 1;
}
@@ -702,6 +697,52 @@ void free_old_query(MYSQL *mysql)
DBUG_VOID_RETURN;
}
+/*
+ Set the internal error message to mysql handler
+*/
+
+void set_mysql_error(MYSQL *mysql, int errcode, const char *sqlstate)
+{
+ NET *net;
+ DBUG_ENTER("set_mysql_error");
+ DBUG_PRINT("enter", ("error :%d '%s'", errcode, ER(errcode)));
+ DBUG_ASSERT(mysql != 0);
+
+ net= &mysql->net;
+ net->last_errno= errcode;
+ strmov(net->last_error, ER(errcode));
+ strmov(net->sqlstate, sqlstate);
+
+ DBUG_VOID_RETURN;
+}
+
+/*
+ Flush result set sent from server
+*/
+
+void flush_use_result(MYSQL *mysql)
+{
+ /* Clear the current execution status */
+ DBUG_PRINT("warning",("Not all packets read, clearing them"));
+ for (;;)
+ {
+ ulong pkt_len;
+ if ((pkt_len=net_safe_read(mysql)) == packet_error)
+ break;
+ if (pkt_len <= 8 && mysql->net.read_pos[0] == 254)
+ {
+ if (protocol_41(mysql))
+ {
+ char *pos= (char*) mysql->net.read_pos;
+ mysql->warning_count=uint2korr(pos); pos+=2;
+ mysql->server_status=uint2korr(pos); pos+=2;
+ }
+ break; /* End of data */
+ }
+ }
+}
+
+
#ifdef __WIN__
static my_bool is_NT(void)
{
@@ -739,26 +780,16 @@ mysql_free_result(MYSQL_RES *result)
DBUG_PRINT("enter",("mysql_res: %lx",result));
if (result)
{
- if (result->handle && result->handle->status == MYSQL_STATUS_USE_RESULT)
+ MYSQL *mysql= result->handle;
+ if (mysql)
{
- DBUG_PRINT("warning",("Not all rows in set where read; Ignoring rows"));
- for (;;)
+ if (mysql->unbuffered_fetch_owner == &result->unbuffered_fetch_cancelled)
+ mysql->unbuffered_fetch_owner= 0;
+ if (mysql->status == MYSQL_STATUS_USE_RESULT)
{
- ulong pkt_len;
- if ((pkt_len=net_safe_read(result->handle)) == packet_error)
- break;
- if (pkt_len <= 8 && result->handle->net.read_pos[0] == 254)
- {
- if (protocol_41(result->handle))
- {
- char *pos= (char*) result->handle->net.read_pos;
- result->handle->warning_count=uint2korr(pos); pos+=2;
- result->handle->server_status=uint2korr(pos); pos+=2;
- }
- break; /* End of data */
- }
+ flush_use_result(mysql);
+ mysql->status=MYSQL_STATUS_READY;
}
- result->handle->status=MYSQL_STATUS_READY;
}
free_rows(result->data);
if (result->fields)
@@ -1162,9 +1193,7 @@ MYSQL_DATA *cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
if (!(result=(MYSQL_DATA*) my_malloc(sizeof(MYSQL_DATA),
MYF(MY_WME | MY_ZEROFILL))))
{
- net->last_errno=CR_OUT_OF_MEMORY;
- strmov(net->sqlstate, unknown_sqlstate);
- strmov(net->last_error,ER(net->last_errno));
+ set_mysql_error(mysql, CR_OUT_OF_MEMORY, unknown_sqlstate);
DBUG_RETURN(0);
}
init_alloc_root(&result->alloc,8192,0); /* Assume rowlength < 8192 */
@@ -1191,9 +1220,7 @@ MYSQL_DATA *cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
(fields+1)*sizeof(char *)+pkt_len))))
{
free_rows(result);
- net->last_errno=CR_OUT_OF_MEMORY;
- strmov(net->sqlstate, unknown_sqlstate);
- strmov(net->last_error,ER(net->last_errno));
+ set_mysql_error(mysql, CR_OUT_OF_MEMORY, unknown_sqlstate);
DBUG_RETURN(0);
}
*prev_ptr=cur;
@@ -1212,9 +1239,7 @@ MYSQL_DATA *cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
if (len > (ulong) (end_to - to))
{
free_rows(result);
- net->last_errno=CR_MALFORMED_PACKET;
- strmov(net->sqlstate, unknown_sqlstate);
- strmov(net->last_error,ER(net->last_errno));
+ set_mysql_error(mysql, CR_MALFORMED_PACKET, unknown_sqlstate);
DBUG_RETURN(0);
}
memcpy(to,(char*) cp,len); to[len]=0;
@@ -1285,9 +1310,7 @@ read_one_row(MYSQL *mysql,uint fields,MYSQL_ROW row, ulong *lengths)
{
if (len > (ulong) (end_pos - pos))
{
- net->last_errno=CR_UNKNOWN_ERROR;
- strmov(net->last_error,ER(net->last_errno));
- strmov(net->sqlstate, unknown_sqlstate);
+ set_mysql_error(mysql, CR_UNKNOWN_ERROR, unknown_sqlstate);
return -1;
}
row[field] = (char*) pos;
@@ -1335,12 +1358,15 @@ mysql_init(MYSQL *mysql)
Only enable LOAD DATA INFILE by default if configured with
--enable-local-infile
*/
+
#if defined(ENABLED_LOCAL_INFILE) && !defined(MYSQL_SERVER)
mysql->options.client_flag|= CLIENT_LOCAL_FILES;
#endif
+
#ifdef HAVE_SMEM
mysql->options.shared_memory_base_name= (char*) def_shared_memory_base_name;
#endif
+
mysql->options.methods_to_use= MYSQL_OPT_GUESS_CONNECTION;
return mysql;
}
@@ -1420,8 +1446,9 @@ static MYSQL_METHODS client_methods=
cli_read_binary_rows,
cli_unbuffered_fetch,
NULL,
- cli_read_statistic,
- cli_read_query_result
+ cli_read_statistics,
+ cli_read_query_result,
+ cli_read_change_user_result
#endif
};
@@ -1672,9 +1699,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
if (!net->vio)
{
DBUG_PRINT("error",("Unknow protocol %d ",mysql->options.protocol));
- strmov(net->sqlstate, unknown_sqlstate);
- net->last_errno= CR_CONN_UNKNOW_PROTOCOL;
- strmov(net->last_error, ER(CR_CONN_UNKNOW_PROTOCOL));
+ set_mysql_error(mysql, CR_CONN_UNKNOW_PROTOCOL, unknown_sqlstate);
goto error;
}
@@ -1682,9 +1707,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
{
vio_delete(net->vio);
net->vio = 0;
- net->last_errno=CR_OUT_OF_MEMORY;
- strmov(net->sqlstate, unknown_sqlstate);
- strmov(net->last_error,ER(net->last_errno));
+ set_mysql_error(mysql, CR_OUT_OF_MEMORY, unknown_sqlstate);
goto error;
}
vio_keepalive(net->vio,TRUE);
@@ -1701,9 +1724,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
if (mysql->options.connect_timeout &&
vio_poll_read(net->vio, mysql->options.connect_timeout))
{
- net->last_errno= CR_SERVER_LOST;
- strmov(net->sqlstate, unknown_sqlstate);
- strmov(net->last_error,ER(net->last_errno));
+ set_mysql_error(mysql, CR_SERVER_LOST, unknown_sqlstate);
goto error;
}
@@ -1757,8 +1778,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
if (mysql->options.secure_auth && passwd[0] &&
!(mysql->server_capabilities & CLIENT_SECURE_CONNECTION))
{
- strmov(net->sqlstate, unknown_sqlstate);
- strmov(net->last_error, ER(net->last_errno=CR_SECURE_AUTH));
+ set_mysql_error(mysql, CR_SECURE_AUTH, unknown_sqlstate);
goto error;
}
@@ -1812,8 +1832,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
!(mysql->user=my_strdup(user,MYF(0))) ||
!(mysql->passwd=my_strdup(passwd,MYF(0))))
{
- strmov(net->sqlstate, unknown_sqlstate);
- strmov(net->last_error, ER(net->last_errno=CR_OUT_OF_MEMORY));
+ set_mysql_error(mysql, CR_OUT_OF_MEMORY, unknown_sqlstate);
goto error;
}
strmov(mysql->host_info,host_info);
@@ -1880,9 +1899,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
struct st_mysql_options *options= &mysql->options;
if (my_net_write(net,buff,(uint) (end-buff)) || net_flush(net))
{
- strmov(net->sqlstate, unknown_sqlstate);
- net->last_errno= CR_SERVER_LOST;
- strmov(net->last_error,ER(net->last_errno));
+ set_mysql_error(mysql, CR_SERVER_LOST, unknown_sqlstate);
goto error;
}
/* Do the SSL layering. */
@@ -1893,18 +1910,14 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
options->ssl_capath,
options->ssl_cipher)))
{
- strmov(net->sqlstate, unknown_sqlstate);
- net->last_errno= CR_SSL_CONNECTION_ERROR;
- strmov(net->last_error,ER(net->last_errno));
+ set_mysql_error(mysql, CR_SSL_CONNECTION_ERROR, unknown_sqlstate);
goto error;
}
DBUG_PRINT("info", ("IO layer change in progress..."));
if (sslconnect((struct st_VioSSLConnectorFd*)(mysql->connector_fd),
mysql->net.vio, (long) (mysql->options.connect_timeout)))
{
- strmov(net->sqlstate, unknown_sqlstate);
- net->last_errno= CR_SSL_CONNECTION_ERROR;
- strmov(net->last_error,ER(net->last_errno));
+ set_mysql_error(mysql, CR_SSL_CONNECTION_ERROR, unknown_sqlstate);
goto error;
}
DBUG_PRINT("info", ("IO layer change done!"));
@@ -1953,9 +1966,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
/* Write authentication package */
if (my_net_write(net,buff,(ulong) (end-buff)) || net_flush(net))
{
- strmov(net->sqlstate, unknown_sqlstate);
- net->last_errno= CR_SERVER_LOST;
- strmov(net->last_error,ER(net->last_errno));
+ set_mysql_error(mysql, CR_SERVER_LOST, unknown_sqlstate);
goto error;
}
@@ -1977,9 +1988,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
scramble_323(buff, mysql->scramble, passwd);
if (my_net_write(net, buff, SCRAMBLE_LENGTH_323 + 1) || net_flush(net))
{
- net->last_errno= CR_SERVER_LOST;
- strmov(net->sqlstate, unknown_sqlstate);
- strmov(net->last_error,ER(net->last_errno));
+ set_mysql_error(mysql, CR_SERVER_LOST, unknown_sqlstate);
goto error;
}
/* Read what server thinks about out new auth message report */
@@ -2035,7 +2044,7 @@ error:
/* Free alloced memory */
end_server(mysql);
mysql_close_free(mysql);
- if (!(client_flag & CLIENT_REMEMBER_OPTIONS))
+ if (!(((ulong) client_flag) & CLIENT_REMEMBER_OPTIONS))
mysql_close_free_options(mysql);
}
DBUG_RETURN(0);
@@ -2074,9 +2083,7 @@ my_bool mysql_reconnect(MYSQL *mysql)
{
/* Allow reconnect next time */
mysql->server_status&= ~SERVER_STATUS_IN_TRANS;
- strmov(mysql->net.sqlstate, unknown_sqlstate);
- mysql->net.last_errno=CR_SERVER_GONE_ERROR;
- strmov(mysql->net.last_error,ER(mysql->net.last_errno));
+ set_mysql_error(mysql, CR_SERVER_GONE_ERROR, unknown_sqlstate);
DBUG_RETURN(1);
}
mysql_init(&tmp_mysql);
@@ -2191,12 +2198,13 @@ void STDCALL mysql_close(MYSQL *mysql)
#ifdef MYSQL_CLIENT
if (mysql->stmts)
{
- /* Free any open prepared statements */
- LIST *element, *next_element;
- for (element= mysql->stmts; element; element= next_element)
+ /* Reset connection handle in all prepared statements. */
+ LIST *element;
+ for (element= mysql->stmts; element; element= element->next)
{
- next_element= element->next;
- stmt_close((MYSQL_STMT *)element->data, 0);
+ MYSQL_STMT *stmt= (MYSQL_STMT *) element->data;
+ stmt->mysql= 0;
+ /* No need to call list_delete for statement here */
}
mysql->stmts= 0;
}
@@ -2228,6 +2236,7 @@ void STDCALL mysql_close(MYSQL *mysql)
DBUG_VOID_RETURN;
}
+
static my_bool cli_read_query_result(MYSQL *mysql)
{
uchar *pos;
@@ -2276,7 +2285,7 @@ get_info:
#ifdef MYSQL_CLIENT
if (field_count == NULL_LENGTH) /* LOAD DATA LOCAL INFILE */
{
- int error=send_file_to_server(mysql,(char*) pos);
+ int error=handle_local_infile(mysql,(char*) pos);
if ((length=net_safe_read(mysql)) == packet_error || error)
DBUG_RETURN(1);
goto get_info; /* Get info packet */
@@ -2360,9 +2369,7 @@ MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql)
DBUG_RETURN(0);
if (mysql->status != MYSQL_STATUS_GET_RESULT)
{
- strmov(mysql->net.sqlstate, unknown_sqlstate);
- strmov(mysql->net.last_error,
- ER(mysql->net.last_errno=CR_COMMANDS_OUT_OF_SYNC));
+ set_mysql_error(mysql, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate);
DBUG_RETURN(0);
}
mysql->status=MYSQL_STATUS_READY; /* server is ready */
@@ -2371,9 +2378,7 @@ MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql)
mysql->field_count),
MYF(MY_WME | MY_ZEROFILL))))
{
- strmov(mysql->net.sqlstate, unknown_sqlstate);
- mysql->net.last_errno=CR_OUT_OF_MEMORY;
- strmov(mysql->net.last_error, ER(mysql->net.last_errno));
+ set_mysql_error(mysql, CR_OUT_OF_MEMORY, unknown_sqlstate);
DBUG_RETURN(0);
}
result->methods= mysql->methods;
@@ -2390,9 +2395,10 @@ MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql)
result->fields= mysql->fields;
result->field_alloc= mysql->field_alloc;
result->field_count= mysql->field_count;
- result->current_field=0;
- result->current_row=0; /* Must do a fetch first */
+ /* The rest of result members is bzeroed in malloc */
mysql->fields=0; /* fields is now in result */
+ /* just in case this was mistakenly called after mysql_stmt_execute() */
+ mysql->unbuffered_fetch_owner= 0;
DBUG_RETURN(result); /* Data fetched */
}
@@ -2418,9 +2424,7 @@ static MYSQL_RES * cli_use_result(MYSQL *mysql)
DBUG_RETURN(0);
if (mysql->status != MYSQL_STATUS_GET_RESULT)
{
- strmov(mysql->net.sqlstate, unknown_sqlstate);
- strmov(mysql->net.last_error,
- ER(mysql->net.last_errno=CR_COMMANDS_OUT_OF_SYNC));
+ set_mysql_error(mysql, CR_COMMANDS_OUT_OF_SYNC, unknown_sqlstate);
DBUG_RETURN(0);
}
if (!(result=(MYSQL_RES*) my_malloc(sizeof(*result)+
@@ -2443,6 +2447,7 @@ static MYSQL_RES * cli_use_result(MYSQL *mysql)
result->current_row= 0;
mysql->fields=0; /* fields is now in result */
mysql->status=MYSQL_STATUS_USE_RESULT;
+ mysql->unbuffered_fetch_owner= &result->unbuffered_fetch_cancelled;
DBUG_RETURN(result); /* Data is read to be fetched */
}
@@ -2459,19 +2464,30 @@ mysql_fetch_row(MYSQL_RES *res)
{ /* Unbufferred fetch */
if (!res->eof)
{
- if (!(read_one_row(res->handle,res->field_count,res->row, res->lengths)))
+ MYSQL *mysql= res->handle;
+ if (mysql->status != MYSQL_STATUS_USE_RESULT)
{
- res->row_count++;
- DBUG_RETURN(res->current_row=res->row);
+ set_mysql_error(mysql,
+ res->unbuffered_fetch_cancelled ?
+ CR_FETCH_CANCELLED : CR_COMMANDS_OUT_OF_SYNC,
+ unknown_sqlstate);
}
- else
+ else if (!(read_one_row(mysql, res->field_count, res->row, res->lengths)))
{
- DBUG_PRINT("info",("end of data"));
- res->eof=1;
- res->handle->status=MYSQL_STATUS_READY;
- /* Don't clear handle in mysql_free_results */
- res->handle=0;
+ res->row_count++;
+ DBUG_RETURN(res->current_row=res->row);
}
+ DBUG_PRINT("info",("end of data"));
+ res->eof=1;
+ mysql->status=MYSQL_STATUS_READY;
+ /*
+ Reset only if owner points to us: there is a chance that somebody
+ started new query after mysql_stmt_close():
+ */
+ if (mysql->unbuffered_fetch_owner == &res->unbuffered_fetch_cancelled)
+ mysql->unbuffered_fetch_owner= 0;
+ /* Don't clear handle in mysql_free_result */
+ res->handle=0;
}
DBUG_RETURN((MYSQL_ROW) NULL);
}
@@ -2589,3 +2605,4 @@ const char * STDCALL mysql_error(MYSQL *mysql)
{
return mysql->net.last_error;
}
+
diff --git a/sql/derror.cc b/sql/derror.cc
index 53d0dc5b7e5..09f43d20044 100644
--- a/sql/derror.cc
+++ b/sql/derror.cc
@@ -50,7 +50,7 @@ static bool read_texts(const char *file_name,const char ***point,
char name[FN_REFLEN];
const char *buff;
uchar head[32],*pos;
- CHARSET_INFO *cset;
+ CHARSET_INFO *cset; // For future
DBUG_ENTER("read_texts");
*point=0; // If something goes wrong
@@ -137,7 +137,7 @@ err1:
if (file != FERR)
VOID(my_close(file,MYF(MY_WME)));
unireg_abort(1);
- DBUG_RETURN(1); // Impossible
+ DBUG_RETURN(1); // keep compiler happy
} /* read_texts */
diff --git a/sql/field.cc b/sql/field.cc
index d26534b5ac7..d099da2d959 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -107,7 +107,7 @@ bool test_if_int(const char *str, int length, const char *int_end,
return 1;
}
-
+#ifdef NOT_USED
static bool test_if_real(const char *str,int length, CHARSET_INFO *cs)
{
cs= system_charset_info; // QQ move test_if_real into CHARSET_INFO struct
@@ -159,16 +159,9 @@ static bool test_if_real(const char *str,int length, CHARSET_INFO *cs)
}
return 1;
}
+#endif
-static inline uint field_length_without_space(const char *ptr, uint length)
-{
- const char *end= ptr+length;
- while (end > ptr && end[-1] == ' ')
- end--;
- return (uint) (end-ptr);
-}
-
/*
Tables of filed type compatibility.
@@ -301,11 +294,12 @@ Field::Field(char *ptr_arg,uint32 length_arg,uchar *null_ptr_arg,
utype unireg_check_arg, const char *field_name_arg,
struct st_table *table_arg)
:ptr(ptr_arg),null_ptr(null_ptr_arg),
- table(table_arg),table_name(table_arg ? table_arg->table_name : 0),
+ table(table_arg),orig_table(table_arg),
+ table_name(table_arg ? table_arg->table_name : 0),
field_name(field_name_arg),
query_id(0), key_start(0), part_of_key(0), part_of_sortkey(0),
unireg_check(unireg_check_arg),
- field_length(length_arg),null_bit(null_bit_arg),abs_offset(0)
+ field_length(length_arg),null_bit(null_bit_arg)
{
flags=null_ptr ? 0: NOT_NULL_FLAG;
comment.str= (char*) "";
@@ -349,9 +343,10 @@ void Field_num::add_zerofill_and_unsigned(String &res) const
void Field_num::make_field(Send_field *field)
{
/* table_cache_key is not set for temp tables */
- field->db_name=table->table_cache_key ? table->table_cache_key : "";
- field->org_table_name=table->real_name;
- field->table_name=table_name;
+ field->db_name= (orig_table->table_cache_key ? orig_table->table_cache_key :
+ "");
+ field->org_table_name= orig_table->real_name;
+ field->table_name= orig_table->table_name;
field->col_name=field->org_col_name=field_name;
field->charsetnr= charset()->number;
field->length=field_length;
@@ -364,9 +359,10 @@ void Field_num::make_field(Send_field *field)
void Field_str::make_field(Send_field *field)
{
/* table_cache_key is not set for temp tables */
- field->db_name=table->table_cache_key ? table->table_cache_key : "";
- field->org_table_name=table->real_name;
- field->table_name=table_name;
+ field->db_name= (orig_table->table_cache_key ? orig_table->table_cache_key :
+ "");
+ field->org_table_name= orig_table->real_name;
+ field->table_name= orig_table->table_name;
field->col_name=field->org_col_name=field_name;
field->charsetnr= charset()->number;
field->length=field_length;
@@ -2264,20 +2260,23 @@ void Field_longlong::sql_type(String &res) const
add_zerofill_and_unsigned(res);
}
+
/****************************************************************************
-** single precision float
+ single precision float
****************************************************************************/
int Field_float::store(const char *from,uint len,CHARSET_INFO *cs)
{
- int err;
- Field_float::store(my_strntod(cs,(char*) from,len,(char**)NULL,&err));
- if (err || current_thd->count_cuted_fields && !test_if_real(from,len,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))
{
+ error= 1;
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED);
- return 1;
}
- return (err) ? 1 : 0;
+ Field_float::store(nr);
+ return error;
}
@@ -2285,28 +2284,48 @@ int Field_float::store(double nr)
{
float j;
int error= 0;
- if (dec < NOT_FIXED_DEC)
- nr=floor(nr*log_10[dec]+0.5)/log_10[dec]; // To fixed point
- if (unsigned_flag && nr < 0)
+
+ if (isnan(nr))
{
+ j= 0;
+ set_null();
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE);
- nr=0;
error= 1;
}
- if (nr < -FLT_MAX)
+ else if (unsigned_flag && nr < 0)
{
- j= -FLT_MAX;
+ j= 0;
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE);
error= 1;
}
- else if (nr > FLT_MAX)
+ else
{
- j=FLT_MAX;
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE);
- error= 1;
+ double max_value;
+ if (dec >= NOT_FIXED_DEC)
+ {
+ max_value= FLT_MAX;
+ }
+ else
+ {
+ max_value= (log_10[field_length]-1)/log_10[dec];
+ nr= floor(nr*log_10[dec]+0.5)/log_10[dec];
+ }
+ if (nr < -max_value)
+ {
+ j= (float)-max_value;
+ set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE);
+ error= 1;
+ }
+ else if (nr > max_value)
+ {
+ j= (float)max_value;
+ set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE);
+ error= 1;
+ }
+ else
+ j= (float) nr;
}
- else
- j= (float) nr;
+
#ifdef WORDS_BIGENDIAN
if (table->db_low_byte_first)
{
@@ -2537,48 +2556,69 @@ void Field_float::sql_type(String &res) const
add_zerofill_and_unsigned(res);
}
+
/****************************************************************************
-** double precision floating point numbers
+ double precision floating point numbers
****************************************************************************/
int Field_double::store(const char *from,uint len,CHARSET_INFO *cs)
{
- int err;
- double j= my_strntod(cs,(char*) from,len,(char**)0,&err);
- if (err || current_thd->count_cuted_fields && !test_if_real(from,len,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))
{
+ error= 1;
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED);
- err= 1;
}
- if (unsigned_flag && j < 0)
- {
- set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE);
- j=0;
- err= 1;
- }
-#ifdef WORDS_BIGENDIAN
- if (table->db_low_byte_first)
- {
- float8store(ptr,j);
- }
- else
-#endif
- doublestore(ptr,j);
- return err;
+ Field_double::store(nr);
+ return error;
}
int Field_double::store(double nr)
{
int error= 0;
- if (dec < NOT_FIXED_DEC)
- nr=floor(nr*log_10[dec]+0.5)/log_10[dec]; // To fixed point
- if (unsigned_flag && nr < 0)
+
+ if (isnan(nr))
{
+ nr= 0;
+ set_null();
+ set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE);
+ error= 1;
+ }
+ else if (unsigned_flag && nr < 0)
+ {
+ nr= 0;
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE);
- nr=0;
error= 1;
}
+ else
+ {
+ double max_value;
+ if (dec >= NOT_FIXED_DEC)
+ {
+ max_value= DBL_MAX;
+ }
+ else
+ {
+ max_value= (log_10[field_length]-1)/log_10[dec];
+ nr= floor(nr*log_10[dec]+0.5)/log_10[dec];
+ }
+ if (nr < -max_value)
+ {
+ nr= -max_value;
+ set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE);
+ error= 1;
+ }
+ else if (nr > max_value)
+ {
+ nr= max_value;
+ set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE);
+ error= 1;
+ }
+ }
+
#ifdef WORDS_BIGENDIAN
if (table->db_low_byte_first)
{
@@ -2742,14 +2782,8 @@ int Field_double::cmp(const char *a_ptr, const char *b_ptr)
else
#endif
{
-/* could this ALWAYS be 2 calls to doubleget() ?? */
-#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
doubleget(a, a_ptr);
doubleget(b, b_ptr);
-#else
- memcpy_fixed(&a,a_ptr,sizeof(double));
- memcpy_fixed(&b,b_ptr,sizeof(double));
-#endif
}
return (a < b) ? -1 : (a > b) ? 1 : 0;
}
@@ -2769,12 +2803,7 @@ void Field_double::sort_string(char *to,uint length __attribute__((unused)))
}
else
#endif
-/* could this ALWAYS be 2 calls to doubleget() ?? */
-#if defined(__FLOAT_WORD_ORDER) && (__FLOAT_WORD_ORDER == __BIG_ENDIAN)
doubleget(nr,ptr);
-#else
- memcpy_fixed(&nr,ptr,sizeof(nr));
-#endif
change_double_for_sort(nr, (byte*) to);
}
@@ -2795,11 +2824,50 @@ void Field_double::sql_type(String &res) const
}
-/****************************************************************************
-** timestamp
-** The first timestamp in the table is automaticly updated
-** by handler.cc. The form->timestamp points at the automatic timestamp.
-****************************************************************************/
+/*
+ TIMESTAMP type.
+ Holds datetime values in range from 1970-01-01 00:00:01 UTC to
+ 2038-01-01 00:00:00 UTC stored as number of seconds since Unix
+ Epoch in UTC.
+
+ Up to one of timestamps columns in the table can be automatically
+ set on row update and/or have NOW() as default value.
+ TABLE::timestamp_field points to Field object for such timestamp with
+ auto-set-on-update. TABLE::time_stamp holds offset in record + 1 for this
+ field, and is used by handler code which performs updates required.
+
+ Actually SQL-99 says that we should allow niladic functions (like NOW())
+ as defaults for any field. Current limitations (only NOW() and only
+ for one TIMESTAMP field) are because of restricted binary .frm format
+ and should go away in the future.
+
+ Also because of this limitation of binary .frm format we use 5 different
+ unireg_check values with TIMESTAMP field to distinguish various cases of
+ DEFAULT or ON UPDATE values. These values are:
+
+ TIMESTAMP_OLD_FIELD - old timestamp, if there was not any fields with
+ auto-set-on-update (or now() as default) in this table before, then this
+ field has NOW() as default and is updated when row changes, else it is
+ field which has 0 as default value and is not automaitcally updated.
+ TIMESTAMP_DN_FIELD - field with NOW() as default but not set on update
+ automatically (TIMESTAMP DEFAULT NOW())
+ TIMESTAMP_UN_FIELD - field which is set on update automatically but has not
+ NOW() as default (but it may has 0 or some other const timestamp as
+ default) (TIMESTAMP ON UPDATE NOW()).
+ TIMESTAMP_DNUN_FIELD - field which has now() as default and is auto-set on
+ update. (TIMESTAMP DEFAULT NOW() ON UPDATE NOW())
+ NONE - field which is not auto-set on update with some other than NOW()
+ default value (TIMESTAMP DEFAULT 0).
+
+ Note that TIMESTAMP_OLD_FIELD's are never created explicitly now, they are
+ left only for preserving ability to read old tables. Such fields replaced
+ with their newer analogs in CREATE TABLE and in SHOW CREATE TABLE. This is
+ because we want to prefer NONE unireg_check before TIMESTAMP_OLD_FIELD for
+ "TIMESTAMP DEFAULT 'Const'" field. (Old timestamps allowed such
+ specification too but ignored default value for first timestamp, which of
+ course is non-standard.) In most cases user won't notice any change, only
+ exception is different behavior of old/new timestamps during ALTER TABLE.
+ */
Field_timestamp::Field_timestamp(char *ptr_arg, uint32 len_arg,
enum utype unireg_check_arg,
@@ -2810,15 +2878,37 @@ Field_timestamp::Field_timestamp(char *ptr_arg, uint32 len_arg,
unireg_check_arg, field_name_arg, table_arg, cs)
{
flags|=ZEROFILL_FLAG; /* 4.0 MYD compatibility */
- if (table && !table->timestamp_field)
+ if (table && !table->timestamp_field &&
+ unireg_check != NONE)
{
- table->timestamp_field= this; // Automatic timestamp
- table->time_stamp=(ulong) (ptr_arg - (char*) table->record[0])+1;
+ /* This timestamp has auto-update */
+ table->timestamp_field= this;
flags|=TIMESTAMP_FLAG;
}
}
+/*
+ Sets TABLE::timestamp_default_now and TABLE::timestamp_on_update_now
+ members according to unireg type of this TIMESTAMP field.
+
+ SYNOPSIS
+ Field_timestamp::set_timestamp_offsets()
+
+*/
+void Field_timestamp::set_timestamp_offsets()
+{
+ ulong timestamp= (ulong) (ptr - (char*) table->record[0]) + 1;
+
+ DBUG_ASSERT(table->timestamp_field == this && unireg_check != NONE);
+
+ table->timestamp_default_now=
+ (unireg_check == TIMESTAMP_UN_FIELD)? 0 : timestamp;
+ table->timestamp_on_update_now=
+ (unireg_check == TIMESTAMP_DN_FIELD)? 0 : timestamp;
+}
+
+
int Field_timestamp::store(const char *from,uint len,CHARSET_INFO *cs)
{
long tmp=(long) str_to_timestamp(from,len);
@@ -2933,10 +3023,10 @@ int Field_timestamp::store(longlong nr)
{
long not_used;
- if (l_time.year >= TIMESTAMP_MAX_YEAR || l_time.year < 1900+YY_PART_YEAR-1)
+ if (!(timestamp= my_gmt_sec(&l_time, &not_used)))
goto err;
- timestamp= my_gmt_sec(&l_time, &not_used);
}
+
#ifdef WORDS_BIGENDIAN
if (table->db_low_byte_first)
{
@@ -4075,10 +4165,10 @@ int Field_string::store(const char *from,uint length,CHARSET_INFO *cs)
Make sure we don't break a multibyte sequence
as well as don't copy a malformed data.
*/
- copy_length= field_charset->cset->wellformedlen(field_charset,
- from,from+length,
- field_length/
- field_charset->mbmaxlen);
+ copy_length= field_charset->cset->well_formed_len(field_charset,
+ from,from+length,
+ field_length/
+ field_charset->mbmaxlen);
memcpy(ptr,from,copy_length);
if (copy_length < field_length) // Append spaces if shorter
field_charset->cset->fill(field_charset,ptr+copy_length,
@@ -4165,10 +4255,10 @@ int Field_string::cmp(const char *a_ptr, const char *b_ptr)
void Field_string::sort_string(char *to,uint length)
{
uint tmp=my_strnxfrm(field_charset,
- (unsigned char *)to, length,
- (unsigned char *) ptr, field_length);
+ (unsigned char *) to, length,
+ (unsigned char *) ptr, field_length);
if (tmp < length)
- bzero(to + tmp, length - tmp);
+ field_charset->cset->fill(field_charset, to + tmp, length - tmp, ' ');
}
@@ -4180,7 +4270,8 @@ void Field_string::sql_type(String &res) const
(field_length > 3 &&
(table->db_options_in_use &
HA_OPTION_PACK_RECORD) ?
- "varchar" : "char"),
+ (has_charset() ? "varchar" : "varbinary") :
+ (has_charset() ? "char" : "binary")),
(int) field_length / charset()->mbmaxlen);
res.length(length);
}
@@ -4340,7 +4431,8 @@ void Field_varstring::sort_string(char *to,uint length)
(unsigned char *) to, length,
(unsigned char *)ptr+2, tot_length);
if (tot_length < length)
- bzero(to+tot_length,length-tot_length);
+ field_charset->cset->fill(field_charset, to+tot_length,length-tot_length,
+ binary() ? (char) 0 : ' ');
}
@@ -4571,11 +4663,15 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
}
copy_length= max_data_length();
- if (copy_length > length)
- copy_length= length;
- copy_length= field_charset->cset->wellformedlen(field_charset,
- from,from+copy_length,
- field_length);
+ /*
+ copy_length is ok as last argument to well_formed_len as this is never
+ used to limit the length of the data. The cut of long data is done with
+ the 'min()' call below.
+ */
+ copy_length= field_charset->cset->well_formed_len(field_charset,
+ from,from +
+ min(length, copy_length),
+ copy_length);
if (copy_length < length)
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED);
@@ -4711,18 +4807,28 @@ void Field_blob::get_key_image(char *buff,uint length,
#ifdef HAVE_SPATIAL
if (type == itMBR)
{
- if (!blob_length)
+ const char *dummy;
+ MBR mbr;
+ Geometry_buffer buffer;
+ Geometry *gobj;
+
+ if (blob_length < SRID_SIZE)
+ {
+ bzero(buff, SIZEOF_STORED_DOUBLE*4);
return;
+ }
get_ptr(&blob);
-
- MBR mbr;
- Geometry gobj;
- gobj.create_from_wkb(blob + SRID_SIZE, blob_length - SRID_SIZE);
- gobj.get_mbr(&mbr);
- float8store(buff, mbr.xmin);
- float8store(buff+8, mbr.xmax);
- float8store(buff+16, mbr.ymin);
- float8store(buff+24, mbr.ymax);
+ gobj= Geometry::create_from_wkb(&buffer,
+ blob + SRID_SIZE, blob_length - SRID_SIZE);
+ if (gobj->get_mbr(&mbr, &dummy))
+ bzero(buff, SIZEOF_STORED_DOUBLE*4);
+ else
+ {
+ float8store(buff, mbr.xmin);
+ float8store(buff+8, mbr.xmax);
+ float8store(buff+16, mbr.ymin);
+ float8store(buff+24, mbr.ymax);
+ }
return;
}
#endif /*HAVE_SPATIAL*/
@@ -4780,7 +4886,9 @@ void Field_blob::sort_string(char *to,uint length)
(unsigned char *)to, length,
(unsigned char *)blob, blob_length);
if (blob_length < length)
- bzero(to+blob_length, length-blob_length);
+ field_charset->cset->fill(field_charset, to+blob_length,
+ length-blob_length,
+ binary() ? (char) 0 : ' ');
}
}
@@ -4935,6 +5043,7 @@ uint Field_blob::max_packed_col_length(uint max_length)
return (max_length > 255 ? 2 : 1)+max_length;
}
+
#ifdef HAVE_SPATIAL
void Field_geom::get_key_image(char *buff, uint length, CHARSET_INFO *cs,
@@ -4943,17 +5052,28 @@ void Field_geom::get_key_image(char *buff, uint length, CHARSET_INFO *cs,
length-= HA_KEY_BLOB_LENGTH;
ulong blob_length= get_length(ptr);
char *blob;
- get_ptr(&blob);
-
+ const char *dummy;
MBR mbr;
- Geometry gobj;
- gobj.create_from_wkb(blob + SRID_SIZE, blob_length - SRID_SIZE);
- gobj.get_mbr(&mbr);
- float8store(buff, mbr.xmin);
- float8store(buff + 8, mbr.xmax);
- float8store(buff + 16, mbr.ymin);
- float8store(buff + 24, mbr.ymax);
- return;
+
+ if (blob_length < SRID_SIZE)
+ {
+ bzero(buff, SIZEOF_STORED_DOUBLE*4);
+ return;
+ }
+ get_ptr(&blob);
+ Geometry_buffer buffer;
+ Geometry *gobj;
+ gobj= Geometry::create_from_wkb(&buffer,
+ blob + SRID_SIZE, blob_length - SRID_SIZE);
+ if (gobj->get_mbr(&mbr, &dummy))
+ bzero(buff, SIZEOF_STORED_DOUBLE*4);
+ else
+ {
+ float8store(buff, mbr.xmin);
+ float8store(buff + 8, mbr.xmax);
+ float8store(buff + 16, mbr.ymin);
+ float8store(buff + 24, mbr.ymax);
+ }
}
@@ -4997,17 +5117,17 @@ void Field_geom::sql_type(String &res) const
int Field_geom::store(const char *from, uint length, CHARSET_INFO *cs)
{
if (!length)
- {
bzero(ptr, Field_blob::pack_length());
- }
else
{
- // Should check given WKB
- if (length < 4 + 1 + 4 + 8 + 8) // SRID + WKB_HEADER + X + Y
- return 1;
- uint32 wkb_type= uint4korr(from + 5);
- if (wkb_type < 1 || wkb_type > 7)
- return 1;
+ // Check given WKB
+ uint32 wkb_type;
+ if (length < SRID_SIZE + WKB_HEADER_SIZE + SIZEOF_STORED_DOUBLE*2)
+ goto err;
+ wkb_type= uint4korr(from + WKB_HEADER_SIZE);
+ if (wkb_type < (uint32) Geometry::wkb_point ||
+ wkb_type > (uint32) Geometry::wkb_end)
+ return -1;
Field_blob::store_length(length);
if (table->copy_blobs || length <= MAX_FIELD_WIDTH)
{ // Must make a copy
@@ -5017,6 +5137,10 @@ int Field_geom::store(const char *from, uint length, CHARSET_INFO *cs)
bmove(ptr + packlength, (char*) &from, sizeof(char*));
}
return 0;
+
+err:
+ bzero(ptr, Field_blob::pack_length());
+ return -1;
}
#endif /*HAVE_SPATIAL*/
@@ -5455,7 +5579,7 @@ uint32 calc_pack_length(enum_field_types type,uint32 length)
case FIELD_TYPE_ENUM: abort(); return 0; // This shouldn't happen
default: return 0;
}
- return 0; // This shouldn't happen
+ return 0; // Keep compiler happy
}
@@ -5488,6 +5612,18 @@ Field *make_field(char *ptr, uint32 field_length,
null_pos=0;
null_bit=0;
}
+
+ switch (field_type)
+ {
+ case FIELD_TYPE_DATE:
+ case FIELD_TYPE_NEWDATE:
+ case FIELD_TYPE_TIME:
+ case FIELD_TYPE_DATETIME:
+ case FIELD_TYPE_TIMESTAMP:
+ field_charset= &my_charset_bin;
+ default: break;
+ }
+
if (f_is_alpha(pack_flag))
{
if (!f_is_packed(pack_flag))
@@ -5644,8 +5780,7 @@ create_field::create_field(Field *old_field,Field *orig_field)
interval=0;
def=0;
if (!old_field->is_real_null() && ! (flags & BLOB_FLAG) &&
- old_field->type() != FIELD_TYPE_TIMESTAMP && old_field->ptr &&
- orig_field)
+ old_field->ptr && orig_field)
{
char buff[MAX_FIELD_WIDTH],*pos;
String tmp(buff,sizeof(buff), charset);
@@ -5660,7 +5795,7 @@ create_field::create_field(Field *old_field,Field *orig_field)
{
pos= (char*) sql_memdup(tmp.ptr(),tmp.length()+1);
pos[tmp.length()]=0;
- def=new Item_string(pos,tmp.length(), charset);
+ def= new Item_string(pos, tmp.length(), charset);
}
}
#ifdef HAVE_SPATIAL
diff --git a/sql/field.h b/sql/field.h
index b62b7a7859e..75bb96f2f6d 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -46,14 +46,24 @@ public:
char *ptr; // Position to field in record
uchar *null_ptr; // Byte where null_bit is
struct st_table *table; // Pointer for table
+ struct st_table *orig_table; // Pointer to original table
const char *table_name,*field_name;
LEX_STRING comment;
ulong query_id; // For quick test of used fields
/* Field is part of the following keys */
key_map key_start,part_of_key,part_of_sortkey;
+ /*
+ We use three additional unireg types for TIMESTAMP to overcome limitation
+ of current binary format of .frm file. We'd like to be able to support
+ NOW() as default and on update value for such fields but unable to hold
+ this info anywhere except unireg_check field. This issue will be resolved
+ in more clean way with transition to new text based .frm format.
+ See also comment for Field_timestamp::Field_timestamp().
+ */
enum utype { NONE,DATE,SHIELD,NOEMPTY,CASEUP,PNR,BGNR,PGNR,YES,NO,REL,
CHECK,EMPTY,UNKNOWN_FIELD,CASEDN,NEXT_NUMBER,INTERVAL_FIELD,
- BIT_FIELD, TIMESTAMP_FIELD,CAPITALIZE,BLOB_FIELD};
+ BIT_FIELD, TIMESTAMP_OLD_FIELD, CAPITALIZE, BLOB_FIELD,
+ TIMESTAMP_DN_FIELD, TIMESTAMP_UN_FIELD, TIMESTAMP_DNUN_FIELD};
enum geometry_type
{
GEOM_GEOMETRY = 0, GEOM_POINT = 1, GEOM_LINESTRING = 2, GEOM_POLYGON = 3,
@@ -77,7 +87,6 @@ public:
uint32 field_length; // Length of field
uint16 flags;
uchar null_bit; // Bit used to test null bit
- uint abs_offset; // use only in group_concat
Field(char *ptr_arg,uint32 length_arg,uchar *null_ptr_arg,uchar null_bit_arg,
utype unireg_check_arg, const char *field_name_arg,
@@ -643,7 +652,11 @@ public:
void set_time();
virtual void set_default()
{
- set_time();
+ if (table->timestamp_field == this &&
+ unireg_check != TIMESTAMP_UN_FIELD)
+ set_time();
+ else
+ Field::set_default();
}
inline long get_timestamp()
{
@@ -658,6 +671,7 @@ public:
bool get_date(TIME *ltime,uint fuzzydate);
bool get_time(TIME *ltime);
field_cast_enum field_cast_type() { return FIELD_CAST_TIMESTAMP; }
+ void set_timestamp_offsets();
};
@@ -679,6 +693,7 @@ public:
String *val_str(String*,String *);
bool send_binary(Protocol *protocol);
void sql_type(String &str) const;
+ bool store_for_compare() { return 1; }
field_cast_enum field_cast_type() { return FIELD_CAST_YEAR; }
};
@@ -860,7 +875,8 @@ public:
uint max_packed_col_length(uint max_length);
uint size_of() const { return sizeof(*this); }
enum_field_types real_type() const { return FIELD_TYPE_STRING; }
- bool has_charset(void) const { return TRUE; }
+ bool has_charset(void) const
+ { return charset() == &my_charset_bin ? FALSE : TRUE; }
field_cast_enum field_cast_type() { return FIELD_CAST_STRING; }
};
@@ -907,7 +923,8 @@ public:
uint max_packed_col_length(uint max_length);
uint size_of() const { return sizeof(*this); }
enum_field_types real_type() const { return FIELD_TYPE_VAR_STRING; }
- bool has_charset(void) const { return TRUE; }
+ bool has_charset(void) const
+ { return charset() == &my_charset_bin ? FALSE : TRUE; }
field_cast_enum field_cast_type() { return FIELD_CAST_VARSTRING; }
};
@@ -949,14 +966,9 @@ public:
void sort_string(char *buff,uint length);
uint32 pack_length() const
{ return (uint32) (packlength+table->blob_ptr_size); }
- uint32 max_data_length() const
+ inline uint32 max_data_length() const
{
- switch (packlength) {
- case 1: return 255;
- case 2: return (uint32) 0xFFFFL;
- case 3: return (uint32) 0xFFFFFF;
- default: return (uint32) 0xFFFFFFFF;
- }
+ return (uint32) (((ulonglong) 1 << (packlength*8)) -1);
}
void reset(void) { bzero(ptr, packlength+sizeof(char*)); }
void reset_fields() { bzero((char*) &value,sizeof(value)); }
@@ -1185,8 +1197,8 @@ Field *make_field(char *ptr, uint32 field_length,
struct st_table *table);
uint pack_length_to_packflag(uint type);
uint32 calc_pack_length(enum_field_types type,uint32 length);
-bool set_field_to_null(Field *field);
-bool set_field_to_null_with_conversions(Field *field, bool no_conversions);
+int set_field_to_null(Field *field);
+int set_field_to_null_with_conversions(Field *field, bool no_conversions);
bool test_if_int(const char *str, int length, const char *int_end,
CHARSET_INFO *cs);
diff --git a/sql/field_conv.cc b/sql/field_conv.cc
index 67905d35e0d..5632c63c521 100644
--- a/sql/field_conv.cc
+++ b/sql/field_conv.cc
@@ -109,7 +109,7 @@ static void do_outer_field_to_null_str(Copy_field *copy)
}
-bool
+int
set_field_to_null(Field *field)
{
if (field->real_maybe_null())
@@ -127,7 +127,7 @@ set_field_to_null(Field *field)
if (!current_thd->no_errors)
my_printf_error(ER_BAD_NULL_ERROR,ER(ER_BAD_NULL_ERROR),MYF(0),
field->field_name);
- return 1;
+ return -1;
}
@@ -145,11 +145,11 @@ set_field_to_null(Field *field)
RETURN VALUES
0 Field could take 0 or an automatic conversion was used
- 1 Field could not take NULL and no conversion was used.
+ -1 Field could not take NULL and no conversion was used.
If no_conversion was not set, an error message is printed
*/
-bool
+int
set_field_to_null_with_conversions(Field *field, bool no_conversions)
{
if (field->real_maybe_null())
@@ -159,7 +159,7 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions)
return 0;
}
if (no_conversions)
- return 1;
+ return -1;
/*
Check if this is a special type, which will get a special walue
@@ -173,7 +173,7 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions)
field->reset();
if (field == field->table->next_number_field)
{
- field->table->auto_increment_field_not_null= false;
+ field->table->auto_increment_field_not_null= FALSE;
return 0; // field is set in handler.cc
}
if (current_thd->count_cuted_fields == CHECK_FIELD_WARN)
@@ -184,7 +184,7 @@ set_field_to_null_with_conversions(Field *field, bool no_conversions)
if (!current_thd->no_errors)
my_printf_error(ER_BAD_NULL_ERROR,ER(ER_BAD_NULL_ERROR),MYF(0),
field->field_name);
- return 1;
+ return -1;
}
diff --git a/sql/filesort.cc b/sql/filesort.cc
index d09b8936d42..1a1547a9d67 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -57,17 +57,38 @@ static SORT_ADDON_FIELD *get_addon_fields(THD *thd, Field **ptabfield,
static void unpack_addon_fields(struct st_sort_addon_field *addon_field,
byte *buff);
- /*
- Creates a set of pointers that can be used to read the rows
- in sorted order. This should be done with the functions
- in records.cc
+/*
+ Sort a table
+
+ SYNOPSIS
+ filesort()
+ table Table to sort
+ sortorder How to sort the table
+ s_length Number of elements in sortorder
+ select condition to apply to the rows
+ special Not used.
+ (This could be used to sort the rows pointed on by
+ select->file)
+ examined_rows Store number of examined rows here
+
+ IMPLEMENTATION
+ Creates a set of pointers that can be used to read the rows
+ in sorted order. This should be done with the functions
+ in records.cc
+
+ REQUIREMENTS
+ Before calling filesort, one must have done
+ table->file->info(HA_STATUS_VARIABLE)
- Before calling filesort, one must have done
- table->file->info(HA_STATUS_VARIABLE)
+ RETURN
+ HA_POS_ERROR Error
+ # Number of rows
+
+ examined_rows will be set to number of examined rows
- The result set is stored in table->io_cache or
- table->record_pointers
- */
+ The result set is stored in table->io_cache or
+ table->record_pointers
+*/
ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
SQL_SELECT *select, ha_rows max_rows, ha_rows *examined_rows)
@@ -543,6 +564,8 @@ static void make_sortkey(register SORTPARAM *param,
case STRING_RESULT:
{
CHARSET_INFO *cs=item->collation.collation;
+ char fill_char= ((cs->state & MY_CS_BINSORT) ? (char) 0 : ' ');
+
if ((maybe_null=item->maybe_null))
*to++=1;
/* All item->str() to use some extra byte for end null.. */
@@ -579,14 +602,16 @@ static void make_sortkey(register SORTPARAM *param,
uint tmp_length=my_strnxfrm(cs,to,sort_field->length,
(unsigned char *) from, length);
if (tmp_length < sort_field->length)
- bzero((char*) to+tmp_length,sort_field->length-tmp_length);
+ cs->cset->fill(cs, (char*) to+tmp_length,
+ sort_field->length-tmp_length,
+ fill_char);
}
else
{
my_strnxfrm(cs,(uchar*)to,length,(const uchar*)res->ptr(),length);
- bzero((char *)to+length,diff);
+ cs->cset->fill(cs, (char *)to+length,diff,fill_char);
}
- break;
+ break;
}
case INT_RESULT:
{
@@ -674,9 +699,22 @@ static void make_sortkey(register SORTPARAM *param,
for ( ; (field= addonf->field) ; addonf++)
{
if (addonf->null_bit && field->is_null())
+ {
nulls[addonf->null_offset]|= addonf->null_bit;
+#ifdef HAVE_purify
+ bzero(to, addonf->length);
+#endif
+ }
else
- field->pack((char *) to, field->ptr);
+ {
+ uchar *end= (uchar*) field->pack((char *) to, field->ptr);
+#ifdef HAVE_purify
+ uint length= (uint) ((to + addonf->length) - end);
+ DBUG_ASSERT((int) length >= 0);
+ if (length)
+ bzero(end, length);
+#endif
+ }
to+= addonf->length;
}
}
@@ -863,7 +901,8 @@ int merge_buffers(SORTPARAM *param, IO_CACHE *from_file,
strpos+= (uint) (error= (int) read_to_buffer(from_file, buffpek,
rec_length));
if (error == -1)
- goto err; /* purecov: inspected */
+ goto err; /* purecov: inspected */
+ buffpek->max_keys= buffpek->mem_count; // If less data in buffers than expected
queue_insert(&queue, (byte*) buffpek);
}
diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc
index 6df7d867a4d..5dc7c50e04c 100644
--- a/sql/gen_lex_hash.cc
+++ b/sql/gen_lex_hash.cc
@@ -81,7 +81,6 @@ TODO:
#endif
#include <my_getopt.h>
#include "mysql_version.h"
-#include "mysql_priv.h"
#include "lex.h"
struct my_option my_long_options[] =
diff --git a/sql/gstream.cc b/sql/gstream.cc
index a97ed9cae03..f7d11d76b0c 100644
--- a/sql/gstream.cc
+++ b/sql/gstream.cc
@@ -1,139 +1,120 @@
+/* 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 */
+
+/*
+ Functions to read and parse geometrical data.
+ NOTE: These functions assumes that the string is end \0 terminated!
+*/
+
#include "mysql_priv.h"
-int GTextReadStream::get_next_toc_type() const
+enum Gis_read_stream::enum_tok_types Gis_read_stream::get_next_toc_type()
{
- const char *cur = m_cur;
- while ((*cur)&&(strchr(" \t\r\n",*cur)))
- {
- cur++;
- }
- if (!(*cur))
- {
+ skip_space();
+ if (m_cur >= m_limit)
return eostream;
- }
-
- if (((*cur>='a') && (*cur<='z')) || ((*cur>='A') && (*cur<='Z')) ||
- (*cur=='_'))
- {
+ if (my_isvar_start(&my_charset_bin, *m_cur))
return word;
- }
-
- if (((*cur>='0') && (*cur<='9')) || (*cur=='-') || (*cur=='+') ||
- (*cur=='.'))
- {
+ if ((*m_cur >= '0' && *m_cur <= '9') || *m_cur == '-' || *m_cur == '+')
return numeric;
- }
-
- if (*cur == '(')
- {
+ if (*m_cur == '(')
return l_bra;
- }
-
- if (*cur == ')')
- {
+ if (*m_cur == ')')
return r_bra;
- }
-
- if (*cur == ',')
- {
+ if (*m_cur == ',')
return comma;
- }
-
return unknown;
}
-const char *GTextReadStream::get_next_word(int *word_len)
-{
- const char *cur = m_cur;
- while ((*cur)&&(strchr(" \t\r\n",*cur)))
- {
- cur++;
- }
- m_last_text_position = cur;
-
- if (!(*cur))
- {
- return 0;
- }
- const char *wd_start = cur;
-
- if (((*cur<'a') || (*cur>'z')) && ((*cur<'A') || (*cur>'Z')) && (*cur!='_'))
- {
- return NULL;
- }
+bool Gis_read_stream::get_next_word(LEX_STRING *res)
+{
+ skip_space();
+ res->str= (char*) m_cur;
+ /* The following will also test for \0 */
+ if (!my_isvar_start(&my_charset_bin, *m_cur))
+ return 1;
- ++cur;
+ /*
+ We can't combine the following increment with my_isvar() because
+ my_isvar() is a macro that would cause side effects
+ */
+ m_cur++;
+ while ((m_cur < m_limit) && my_isvar(&my_charset_bin, *m_cur))
+ m_cur++;
- while (((*cur>='a') && (*cur<='z')) || ((*cur>='A') && (*cur<='Z')) ||
- (*cur=='_') || ((*cur>='0') && (*cur<='9')))
- {
- ++cur;
- }
+ res->length= (uint32) (m_cur - res->str);
+ return 0;
+}
- *word_len = cur - wd_start;
- m_cur = cur;
+/*
+ Read a floating point number
- return wd_start;
-}
+ NOTE: Number must start with a digit or sign. It can't start with a decimal
+ point
+*/
-int GTextReadStream::get_next_number(double *d)
+bool Gis_read_stream::get_next_number(double *d)
{
- const char *cur = m_cur;
- while ((*cur)&&(strchr(" \t\r\n",*cur)))
- {
- cur++;
- }
+ char *endptr;
+ int err;
- m_last_text_position = cur;
- if (!(*cur))
- {
- set_error_msg("Numeric constant expected");
- return 1;
- }
+ skip_space();
- if (((*cur<'0') || (*cur>'9')) && (*cur!='-') && (*cur!='+') && (*cur!='.'))
+ if ((m_cur >= m_limit) ||
+ (*m_cur < '0' || *m_cur > '9') && *m_cur != '-' && *m_cur != '+')
{
set_error_msg("Numeric constant expected");
return 1;
}
- char *endptr;
-
- *d = strtod(cur, &endptr);
-
+ *d = my_strntod(m_charset, (char *)m_cur,
+ m_limit-m_cur, &endptr, &err);
+ if (err)
+ return 1;
if (endptr)
- {
m_cur = endptr;
- }
-
return 0;
}
-char GTextReadStream::get_next_symbol()
+
+bool Gis_read_stream::check_next_symbol(char symbol)
{
- const char *cur = m_cur;
- while ((*cur)&&(strchr(" \t\r\n",*cur)))
+ skip_space();
+ if ((m_cur >= m_limit) || (*m_cur != symbol))
{
- cur++;
- }
- if (!(*cur))
- {
- return 0;
+ char buff[32];
+ strmov(buff, "'?' expected");
+ buff[2]= symbol;
+ set_error_msg(buff);
+ return 1;
}
+ m_cur++;
+ return 0;
+}
- m_cur = cur + 1;
- m_last_text_position = cur;
- return *cur;
-}
+/*
+ Remember error message.
+*/
-void GTextReadStream::set_error_msg(const char *msg)
+void Gis_read_stream::set_error_msg(const char *msg)
{
- size_t len = strlen(msg);
- m_err_msg = (char *)my_realloc(m_err_msg, len + 1, MYF(MY_ALLOW_ZERO_PTR));
+ size_t len= strlen(msg); // ok in this context
+ m_err_msg= (char *) my_realloc(m_err_msg, len + 1, MYF(MY_ALLOW_ZERO_PTR));
memcpy(m_err_msg, msg, len + 1);
}
-
-
diff --git a/sql/gstream.h b/sql/gstream.h
index a3914a534dd..bfbf28851ce 100644
--- a/sql/gstream.h
+++ b/sql/gstream.h
@@ -15,10 +15,10 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-class GTextReadStream
+class Gis_read_stream
{
public:
- enum TokTypes
+ enum enum_tok_types
{
unknown,
eostream,
@@ -29,41 +29,48 @@ public:
comma
};
- GTextReadStream(const char *buffer, int size)
- :m_cur(buffer), m_limit(buffer + size), m_last_text_position(buffer),
- m_err_msg(NULL)
+ Gis_read_stream(CHARSET_INFO *charset, const char *buffer, int size)
+ :m_cur(buffer), m_limit(buffer + size), m_err_msg(NULL), m_charset(charset)
{}
- GTextReadStream(): m_cur(NULL), m_limit(NULL), m_err_msg(NULL)
+ Gis_read_stream(): m_cur(NullS), m_limit(NullS), m_err_msg(NullS)
{}
-
- ~GTextReadStream()
+ ~Gis_read_stream()
{
my_free(m_err_msg, MYF(MY_ALLOW_ZERO_PTR));
}
- int get_next_toc_type() const;
- const char *get_next_word(int *word_len);
- int get_next_number(double *d);
- char get_next_symbol();
+ enum enum_tok_types get_next_toc_type();
+ bool get_next_word(LEX_STRING *);
+ bool get_next_number(double *);
+ bool check_next_symbol(char);
- const char *get_last_text_position() const
+ inline void skip_space()
{
- return m_last_text_position;
+ while ((m_cur < m_limit) && my_isspace(&my_charset_latin1, *m_cur))
+ m_cur++;
+ }
+ /* Skip next character, if match. Return 1 if no match */
+ inline bool skip_char(char skip)
+ {
+ skip_space();
+ if ((m_cur >= m_limit) || *m_cur != skip)
+ return 1; /* Didn't find char */
+ m_cur++;
+ return 0;
}
-
void set_error_msg(const char *msg);
// caller should free this pointer
char *get_error_msg()
{
char *err_msg = m_err_msg;
- m_err_msg = NULL;
+ m_err_msg= NullS;
return err_msg;
}
protected:
const char *m_cur;
const char *m_limit;
- const char *m_last_text_position;
char *m_err_msg;
+ CHARSET_INFO *m_charset;
};
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc
index c4735403267..87eced3d149 100644
--- a/sql/ha_berkeley.cc
+++ b/sql/ha_berkeley.cc
@@ -72,7 +72,7 @@
#define STATUS_BDB_ANALYZE 4
const char *ha_berkeley_ext=".db";
-bool berkeley_skip=0,berkeley_shared_data=0;
+bool berkeley_shared_data=0;
u_int32_t berkeley_init_flags= DB_PRIVATE | DB_RECOVER, berkeley_env_flags=0,
berkeley_lock_type=DB_LOCK_DEFAULT;
ulong berkeley_cache_size, berkeley_log_buffer_size, berkeley_log_file_size=0;
@@ -547,7 +547,10 @@ int ha_berkeley::open(const char *name, int mode, uint test_if_locked)
(*ptr)->set_bt_compare(*ptr, berkeley_cmp_packed_key);
(*ptr)->app_private= (void*) (table->key_info+i);
if (!(table->key_info[i].flags & HA_NOSAME))
+ {
+ DBUG_PRINT("bdb",("Setting DB_DUP for key %u", i));
(*ptr)->set_flags(*ptr, DB_DUP);
+ }
if ((error= txn_begin(db_env, 0, (DB_TXN**) &transaction, 0)) ||
(error=((*ptr)->open(*ptr, transaction, name_buff, part, DB_BTREE,
open_mode, 0))) ||
@@ -823,8 +826,8 @@ int ha_berkeley::write_row(byte * record)
DBUG_ENTER("write_row");
statistic_increment(ha_write_count,&LOCK_status);
- if (table->time_stamp)
- update_timestamp(record+table->time_stamp-1);
+ if (table->timestamp_default_now)
+ update_timestamp(record+table->timestamp_default_now-1);
if (table->next_number_field && record == table->record[0])
update_auto_increment();
if ((error=pack_row(&row, record,1)))
@@ -1070,8 +1073,8 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row)
LINT_INIT(error);
statistic_increment(ha_update_count,&LOCK_status);
- if (table->time_stamp)
- update_timestamp(new_row+table->time_stamp-1);
+ if (table->timestamp_on_update_now)
+ update_timestamp(new_row+table->timestamp_on_update_now-1);
if (hidden_primary_key)
{
@@ -1340,7 +1343,7 @@ int ha_berkeley::index_init(uint keynr)
int ha_berkeley::index_end()
{
int error=0;
- DBUG_ENTER("index_end");
+ DBUG_ENTER("ha_berkely::index_end");
if (cursor)
{
DBUG_PRINT("enter",("table: '%s'", table->real_name));
@@ -1661,8 +1664,9 @@ void ha_berkeley::info(uint flag)
share->rec_per_key[i];
}
}
- else if (flag & HA_STATUS_ERRKEY)
- errkey=last_dup_key;
+ /* Don't return key if we got an error for the internal primary key */
+ if (flag & HA_STATUS_ERRKEY && last_dup_key < table->keys)
+ errkey= last_dup_key;
DBUG_VOID_RETURN;
}
@@ -1860,7 +1864,7 @@ static int create_sub_table(const char *table_name, const char *sub_name,
int error;
DB *file;
DBUG_ENTER("create_sub_table");
- DBUG_PRINT("enter",("sub_name: %s",sub_name));
+ DBUG_PRINT("enter",("sub_name: %s flags: %d",sub_name, flags));
if (!(error=db_create(&file, db_env, 0)))
{
@@ -1892,14 +1896,14 @@ int ha_berkeley::create(const char *name, register TABLE *form,
char name_buff[FN_REFLEN];
char part[7];
uint index=1;
- int error=1;
+ int error;
DBUG_ENTER("ha_berkeley::create");
fn_format(name_buff,name,"", ha_berkeley_ext,2 | 4);
/* Create the main table that will hold the real rows */
- if (create_sub_table(name_buff,"main",DB_BTREE,0))
- DBUG_RETURN(1); /* purecov: inspected */
+ if ((error= create_sub_table(name_buff,"main",DB_BTREE,0)))
+ DBUG_RETURN(error); /* purecov: inspected */
primary_key=table->primary_key;
/* Create the keys */
@@ -1908,10 +1912,10 @@ int ha_berkeley::create(const char *name, register TABLE *form,
if (i != primary_key)
{
sprintf(part,"key%02d",index++);
- if (create_sub_table(name_buff, part, DB_BTREE,
- (table->key_info[i].flags & HA_NOSAME) ? 0 :
- DB_DUP))
- DBUG_RETURN(1); /* purecov: inspected */
+ if ((error= create_sub_table(name_buff, part, DB_BTREE,
+ (table->key_info[i].flags & HA_NOSAME) ? 0 :
+ DB_DUP)))
+ DBUG_RETURN(error); /* purecov: inspected */
}
}
@@ -1919,16 +1923,15 @@ int ha_berkeley::create(const char *name, register TABLE *form,
/* Is DB_BTREE the best option here ? (QUEUE can't be used in sub tables) */
DB *status_block;
- if (!db_create(&status_block, db_env, 0))
+ if (!(error=(db_create(&status_block, db_env, 0))))
{
- if (!status_block->open(status_block, NULL, name_buff,
- "status", DB_BTREE, DB_CREATE, 0))
+ if (!(error=(status_block->open(status_block, NULL, name_buff,
+ "status", DB_BTREE, DB_CREATE, 0))))
{
char rec_buff[4+MAX_KEY*4];
uint length= 4+ table->keys*4;
bzero(rec_buff, length);
- if (!write_status(status_block, rec_buff, length))
- error=0;
+ error= write_status(status_block, rec_buff, length);
status_block->close(status_block,0);
}
}
@@ -1936,6 +1939,7 @@ int ha_berkeley::create(const char *name, register TABLE *form,
}
+
int ha_berkeley::delete_table(const char *name)
{
int error;
@@ -2119,8 +2123,46 @@ static void print_msg(THD *thd, const char *table_name, const char *op_name,
int ha_berkeley::analyze(THD* thd, HA_CHECK_OPT* check_opt)
{
- DB_BTREE_STAT *stat=0;
uint i;
+ DB_BTREE_STAT *stat=0;
+ DB_TXN_STAT *txn_stat_ptr= 0;
+
+ /*
+ Original bdb documentation says:
+ "The DB->stat method cannot be transaction-protected.
+ For this reason, it should be called in a thread of
+ control that has no open cursors or active transactions."
+ So, let's check if there are any changes have been done since
+ the beginning of the transaction..
+ */
+
+ if (!db_env->txn_stat(db_env, &txn_stat_ptr, 0) &&
+ txn_stat_ptr && txn_stat_ptr->st_nactive>=2)
+ {
+ DB_TXN_ACTIVE *atxn_stmt= 0, *atxn_all= 0;
+
+ DB_TXN *txn_all= (DB_TXN*) thd->transaction.all.bdb_tid;
+ u_int32_t all_id= txn_all->id(txn_all);
+
+ DB_TXN *txn_stmt= (DB_TXN*) thd->transaction.stmt.bdb_tid;
+ u_int32_t stmt_id= txn_stmt->id(txn_stmt);
+
+ DB_TXN_ACTIVE *cur= txn_stat_ptr->st_txnarray;
+ DB_TXN_ACTIVE *end= cur + txn_stat_ptr->st_nactive;
+ for (; cur!=end && (!atxn_stmt || !atxn_all); cur++)
+ {
+ if (cur->txnid==all_id) atxn_all= cur;
+ if (cur->txnid==stmt_id) atxn_stmt= cur;
+ }
+
+ if (atxn_stmt && atxn_all &&
+ log_compare(&atxn_stmt->lsn,&atxn_all->lsn))
+ {
+ free(txn_stat_ptr);
+ return HA_ADMIN_REJECT;
+ }
+ free(txn_stat_ptr);
+ }
for (i=0 ; i < table->keys ; i++)
{
diff --git a/sql/ha_berkeley.h b/sql/ha_berkeley.h
index f225c24eaf7..d25a9bbab69 100644
--- a/sql/ha_berkeley.h
+++ b/sql/ha_berkeley.h
@@ -88,10 +88,11 @@ class ha_berkeley: public handler
public:
ha_berkeley(TABLE *table): handler(table), alloc_ptr(0),rec_buff(0), file(0),
int_table_flags(HA_REC_NOT_IN_SEQ |
- HA_KEYPOS_TO_RNDPOS | HA_LASTKEY_ORDER |
- HA_NULL_KEY | HA_BLOB_KEY | HA_NOT_EXACT_COUNT |
- HA_PRIMARY_KEY_IN_READ_INDEX | HA_DROP_BEFORE_CREATE |
- HA_AUTO_PART_KEY | HA_TABLE_SCAN_ON_INDEX),
+ HA_KEYPOS_TO_RNDPOS | HA_LASTKEY_ORDER |
+ HA_NULL_KEY | HA_BLOB_KEY | HA_NOT_EXACT_COUNT |
+ HA_PRIMARY_KEY_IN_READ_INDEX | HA_DROP_BEFORE_CREATE |
+ HA_AUTO_PART_KEY | HA_TABLE_SCAN_ON_INDEX |
+ HA_KEY_READ_WRONG_STR | HA_FILE_BASED),
changed_rows(0),last_dup_key((uint) -1),version(0),using_ignore(0)
{
}
@@ -170,7 +171,7 @@ class ha_berkeley: public handler
bool primary_key_is_clustered() { return true; }
};
-extern bool berkeley_skip, berkeley_shared_data;
+extern bool berkeley_shared_data;
extern u_int32_t berkeley_init_flags,berkeley_env_flags, berkeley_lock_type,
berkeley_lock_types[];
extern ulong berkeley_cache_size, berkeley_max_lock, berkeley_log_buffer_size;
diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc
index c1228cbd319..94105fb9409 100644
--- a/sql/ha_heap.cc
+++ b/sql/ha_heap.cc
@@ -38,9 +38,22 @@ int ha_heap::open(const char *name, int mode, uint test_if_locked)
HA_CREATE_INFO create_info;
bzero(&create_info, sizeof(create_info));
if (!create(name, table, &create_info))
+ {
file= heap_open(name, mode);
+ implicit_emptied= 1;
+ }
}
ref_length= sizeof(HEAP_PTR);
+ if (file)
+ {
+ /* Initialize variables for the opened table */
+ btree_keys.clear_all();
+ for (uint i= 0 ; i < table->keys ; i++)
+ {
+ if (table->key_info[i].algorithm == HA_KEY_ALG_BTREE)
+ btree_keys.set_bit(i);
+ }
+ }
return (file ? 0 : 1);
}
@@ -52,8 +65,8 @@ int ha_heap::close(void)
int ha_heap::write_row(byte * buf)
{
statistic_increment(ha_write_count,&LOCK_status);
- if (table->time_stamp)
- update_timestamp(buf+table->time_stamp-1);
+ if (table->timestamp_default_now)
+ update_timestamp(buf+table->timestamp_default_now-1);
if (table->next_number_field && buf == table->record[0])
update_auto_increment();
return heap_write(file,buf);
@@ -62,8 +75,8 @@ int ha_heap::write_row(byte * buf)
int ha_heap::update_row(const byte * old_data, byte * new_data)
{
statistic_increment(ha_update_count,&LOCK_status);
- if (table->time_stamp)
- update_timestamp(new_data+table->time_stamp-1);
+ if (table->timestamp_on_update_now)
+ update_timestamp(new_data+table->timestamp_on_update_now-1);
return heap_update(file,old_data,new_data);
}
diff --git a/sql/ha_heap.h b/sql/ha_heap.h
index c369c7029b4..feadc0c3c0f 100644
--- a/sql/ha_heap.h
+++ b/sql/ha_heap.h
@@ -26,6 +26,7 @@
class ha_heap: public handler
{
HP_INFO *file;
+ key_map btree_keys;
public:
ha_heap(TABLE *table): handler(table), file(0) {}
@@ -49,6 +50,7 @@ class ha_heap: public handler
(HA_ONLY_WHOLE_INDEX | HA_WRONG_ASCII_ORDER |
HA_NOT_READ_PREFIX_LAST));
}
+ const key_map *keys_to_use_for_scanning() { return &btree_keys; }
uint max_record_length() const { return HA_MAX_REC_LENGTH; }
uint max_keys() const { return MAX_KEY; }
uint max_key_parts() const { return MAX_REF_PARTS; }
diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc
index 8bd43ea92cd..31b7fb807f3 100644
--- a/sql/ha_innodb.cc
+++ b/sql/ha_innodb.cc
@@ -80,7 +80,6 @@ extern "C" {
#define HA_INNOBASE_ROWS_IN_TABLE 10000 /* to get optimization right */
#define HA_INNOBASE_RANGE_COUNT 100
-bool innodb_skip = 0;
uint innobase_init_flags = 0;
ulong innobase_cache_size = 0;
@@ -135,7 +134,6 @@ static mysql_byte* innobase_get_key(INNOBASE_SHARE *share,uint *length,
my_bool not_used __attribute__((unused)));
static INNOBASE_SHARE *get_share(const char *table_name);
static void free_share(INNOBASE_SHARE *share);
-static void innobase_print_error(const char* db_errpfx, char* buffer);
/* General functions */
@@ -290,7 +288,7 @@ convert_error_code_to_mysql(
} else if (error == (int) DB_CANNOT_DROP_CONSTRAINT) {
- return(HA_WRONG_CREATE_OPTION);
+ return(HA_ERR_ROW_IS_REFERENCED);
} else if (error == (int) DB_COL_APPEARS_TWICE_IN_INDEX) {
@@ -552,7 +550,7 @@ innobase_query_caching_of_table_permitted(
if (thd->variables.tx_isolation == ISO_SERIALIZABLE) {
/* In the SERIALIZABLE mode we add LOCK IN SHARE MODE to every
- plain SELECT */
+ plain SELECT if AUTOCOMMIT is not on. */
return((my_bool)FALSE);
}
@@ -703,7 +701,7 @@ ha_innobase::init_table_handle_for_HANDLER(void)
/* Always fetch all columns in the index record */
- prebuilt->hint_no_need_to_fetch_extra_cols = FALSE;
+ prebuilt->hint_need_to_fetch_extra_cols = ROW_RETRIEVE_ALL_COLS;
/* We want always to fetch all columns in the whole row? Or do
we???? */
@@ -755,7 +753,7 @@ innobase_init(void)
srv_set_thread_priorities = TRUE;
srv_query_thread_priority = QUERY_PRIOR;
}
-
+
/* Set InnoDB initialization parameters according to the values
read from MySQL .cnf file */
@@ -870,16 +868,22 @@ innobase_init(void)
srv_print_verbose_log = mysql_embedded ? 0 : 1;
- if (strcmp(default_charset_info->name, "latin1") == 0) {
+ /* Store the default charset-collation number of this MySQL
+ installation */
- /* Store the character ordering table to InnoDB.
- For non-latin1 charsets we use the MySQL comparison
- functions, and consequently we do not need to know
- the ordering internally in InnoDB. */
+ data_mysql_default_charset_coll = (ulint)default_charset_info->number;
- memcpy(srv_latin1_ordering,
- default_charset_info->sort_order, 256);
- }
+ data_mysql_latin1_swedish_charset_coll =
+ (ulint)my_charset_latin1.number;
+
+ /* Store the latin1_swedish_ci character ordering table to InnoDB. For
+ non-latin1_swedish_ci charsets we use the MySQL comparison functions,
+ and consequently we do not need to know the ordering internally in
+ InnoDB. */
+
+ ut_a(0 == strcmp((char*)my_charset_latin1.name,
+ (char*)"latin1_swedish_ci"));
+ memcpy(srv_latin1_ordering, my_charset_latin1.sort_order, 256);
/* Since we in this module access directly the fields of a trx
struct, and due to different headers and flags it might happen that
@@ -976,28 +980,13 @@ innobase_commit_low(
}
#ifdef HAVE_REPLICATION
- /* TODO: Guilhem should check if master_log_name, pending
- etc. are right if the master log gets rotated! Possible bug here.
- Comment by Heikki March 4, 2003. */
-
if (current_thd->slave_thread) {
/* Update the replication position info inside InnoDB */
trx->mysql_master_log_file_name
= active_mi->rli.group_master_log_name;
- /*
- Guilhem to Heikki: in 5.0 we don't need to do a computation
- (old_pos+len) to get the end_pos, because we already have the
- end_pos under hand in the replication code
- (Query_log_event::exec_event()).
- I tested the code change below (simulated a crash with kill
- -9) and got the good (binlog, position) displayed by InnoDB at
- crash recovery, so this code change is ok.
- */
- trx->mysql_master_log_pos = ((ib_longlong)
- (active_mi->rli.future_group_master_log_pos
- ));
-
+ trx->mysql_master_log_pos= ((ib_longlong)
+ active_mi->rli.future_group_master_log_pos);
}
#endif /* HAVE_REPLICATION */
@@ -1302,18 +1291,6 @@ innobase_close_connection(
return(0);
}
-/**********************************************************************
-Prints an error message. */
-static
-void
-innobase_print_error(
-/*=================*/
- const char* db_errpfx, /* in: error prefix text */
- char* buffer) /* in: error text */
-{
- sql_print_error("%s: %s", db_errpfx, buffer);
-}
-
/*****************************************************************************
** InnoDB database tables
@@ -1670,10 +1647,10 @@ reset_null_bits(
extern "C" {
/*****************************************************************
-InnoDB uses this function is to compare two data fields for which the
-data type is such that we must use MySQL code to compare them. NOTE that the
-prototype of this function is in rem0cmp.c in InnoDB source code!
-If you change this function, remember to update the prototype there! */
+InnoDB uses this function to compare two data fields for which the data type
+is such that we must use MySQL code to compare them. NOTE that the prototype
+of this function is in rem0cmp.c in InnoDB source code! If you change this
+function, remember to update the prototype there! */
int
innobase_mysql_cmp(
@@ -1681,6 +1658,7 @@ innobase_mysql_cmp(
/* out: 1, 0, -1, if a is greater,
equal, less than b, respectively */
int mysql_type, /* in: MySQL type */
+ uint charset_number, /* in: number of the charset */
unsigned char* a, /* in: data field */
unsigned int a_length, /* in: data field length,
not UNIV_SQL_NULL */
@@ -1688,6 +1666,7 @@ innobase_mysql_cmp(
unsigned int b_length) /* in: data field length,
not UNIV_SQL_NULL */
{
+ CHARSET_INFO* charset;
enum_field_types mysql_tp;
int ret;
@@ -1704,9 +1683,27 @@ innobase_mysql_cmp(
case FIELD_TYPE_MEDIUM_BLOB:
case FIELD_TYPE_BLOB:
case FIELD_TYPE_LONG_BLOB:
- // BAR TODO: Discuss with heikki.tuuri@innodb.com
- // so that he sends CHARSET_INFO for the field to this function.
- ret = my_strnncoll(default_charset_info,
+ /* Use the charset number to pick the right charset struct for
+ the comparison. Since the MySQL function get_charset may be
+ slow before Bar removes the mutex operation there, we first
+ look at 2 common charsets directly. */
+
+ if (charset_number == default_charset_info->number) {
+ charset = default_charset_info;
+ } else if (charset_number == my_charset_latin1.number) {
+ charset = &my_charset_latin1;
+ } else {
+ charset = get_charset(charset_number, MYF(MY_WME));
+
+ if (charset == NULL) {
+ fprintf(stderr,
+"InnoDB: fatal error: InnoDB needs charset %lu for doing a comparison,\n"
+"InnoDB: but MySQL cannot find that charset.\n", (ulong)charset_number);
+ ut_a(0);
+ }
+ }
+
+ ret = my_strnncoll(charset,
a, a_length,
b, b_length);
if (ret < 0) {
@@ -1733,9 +1730,9 @@ get_innobase_type_from_mysql_type(
/* out: DATA_BINARY, DATA_VARCHAR, ... */
Field* field) /* in: MySQL field */
{
- /* The following asserts check that the MySQL type code fits in
- 8 bits: this is used in ibuf and also when DATA_NOT_NULL is
- ORed to the type */
+ /* The following asserts try to check that the MySQL type code fits in
+ 8 bits: this is used in ibuf and also when DATA_NOT_NULL is ORed to
+ the type */
DBUG_ASSERT((ulint)FIELD_TYPE_STRING < 256);
DBUG_ASSERT((ulint)FIELD_TYPE_VAR_STRING < 256);
@@ -1750,8 +1747,8 @@ get_innobase_type_from_mysql_type(
return(DATA_BINARY);
} else if (strcmp(
- default_charset_info->name,
- "latin1") == 0) {
+ field->charset()->name,
+ "latin1_swedish_ci") == 0) {
return(DATA_VARCHAR);
} else {
return(DATA_VARMYSQL);
@@ -1760,8 +1757,8 @@ get_innobase_type_from_mysql_type(
return(DATA_FIXBINARY);
} else if (strcmp(
- default_charset_info->name,
- "latin1") == 0) {
+ field->charset()->name,
+ "latin1_swedish_ci") == 0) {
return(DATA_CHAR);
} else {
return(DATA_MYSQL);
@@ -1935,6 +1932,7 @@ build_template(
ulint n_fields;
ulint n_requested_fields = 0;
ibool fetch_all_in_key = FALSE;
+ ibool fetch_primary_key_cols = FALSE;
ulint i;
if (prebuilt->select_lock_type == LOCK_X) {
@@ -1945,8 +1943,9 @@ build_template(
templ_type = ROW_MYSQL_WHOLE_ROW;
}
- if (templ_type == ROW_MYSQL_REC_FIELDS
- && !prebuilt->hint_no_need_to_fetch_extra_cols) {
+ if (templ_type == ROW_MYSQL_REC_FIELDS) {
+ if (prebuilt->hint_need_to_fetch_extra_cols
+ == ROW_RETRIEVE_ALL_COLS) {
/* We know we must at least fetch all columns in the key, or
all columns in the table */
@@ -1961,15 +1960,18 @@ build_template(
fetch_all_in_key = TRUE;
} else {
- /* We are building a temporary table: fetch all
- columns; the reason is that MySQL may use the
- clustered index key to store rows, but the mechanism
- we use below to detect required columns does not
- reveal that. Actually, it might be enough to
- fetch only all in the key also in this case! */
-
templ_type = ROW_MYSQL_WHOLE_ROW;
}
+ } else if (prebuilt->hint_need_to_fetch_extra_cols
+ == ROW_RETRIEVE_PRIMARY_KEY) {
+ /* We must at least fetch all primary key cols. Note that if
+ the clustered index was internally generated by InnoDB on the
+ row id (no primary key was defined), then
+ row_search_for_mysql() will always retrieve the row id to a
+ special buffer in the prebuilt struct. */
+
+ fetch_primary_key_cols = TRUE;
+ }
}
clust_index = dict_table_get_first_index_noninline(prebuilt->table);
@@ -1988,7 +1990,7 @@ build_template(
the clustered index */
}
- n_fields = (ulint)table->fields;
+ n_fields = (ulint)table->fields; /* number of columns */
if (!prebuilt->mysql_template) {
prebuilt->mysql_template = (mysql_row_templ_t*)
@@ -2001,6 +2003,8 @@ build_template(
prebuilt->templ_contains_blob = FALSE;
+ /* Note that in InnoDB, i is the column number. MySQL calls columns
+ 'fields'. */
for (i = 0; i < n_fields; i++) {
templ = prebuilt->mysql_template + n_requested_fields;
field = table->field[i];
@@ -2016,7 +2020,9 @@ build_template(
if (templ_type == ROW_MYSQL_REC_FIELDS &&
((prebuilt->read_just_key && !index_contains_field) ||
(!(fetch_all_in_key && index_contains_field)
- && thd->query_id != field->query_id))) {
+ !(fetch_primary_key_cols &&
+ dict_table_col_in_clustered_key(index->table, i) &&
+ thd->query_id != field->query_id))) {
/* This field is not needed in the query, skip it */
@@ -2097,14 +2103,32 @@ ha_innobase::write_row(
DBUG_ENTER("ha_innobase::write_row");
- ut_ad(prebuilt->trx ==
- (trx_t*) current_thd->transaction.all.innobase_tid);
+ if (prebuilt->trx !=
+ (trx_t*) current_thd->transaction.all.innobase_tid) {
+ char err_buf[2000];
+
+ fprintf(stderr,
+"InnoDB: Error: the transaction object for the table handle is at\n"
+"InnoDB: %lx, but for the current thread it is at %lx\n",
+ (ulong)prebuilt->trx,
+ (ulong)current_thd->transaction.all.innobase_tid);
+
+ ut_sprintf_buf(err_buf, ((byte*)prebuilt) - 100, 200);
+ fprintf(stderr,
+"InnoDB: Dump of 200 bytes around prebuilt: %.1000s\n", err_buf);
+
+ ut_sprintf_buf(err_buf,
+ ((byte*)(&(current_thd->transaction.all))) - 100, 200);
+ fprintf(stderr,
+"InnoDB: Dump of 200 bytes around transaction.all: %.1000s\n", err_buf);
+
+ ut_a(0);
+ }
statistic_increment(ha_write_count, &LOCK_status);
- if (table->time_stamp) {
- update_timestamp(record + table->time_stamp - 1);
- }
+ if (table->timestamp_default_now)
+ update_timestamp(record + table->timestamp_default_now - 1);
if (last_query_id != user_thd->query_id) {
prebuilt->sql_stat_start = TRUE;
@@ -2475,9 +2499,8 @@ ha_innobase::update_row(
ut_ad(prebuilt->trx ==
(trx_t*) current_thd->transaction.all.innobase_tid);
- if (table->time_stamp) {
- update_timestamp(new_row + table->time_stamp - 1);
- }
+ if (table->timestamp_on_update_now)
+ update_timestamp(new_row + table->timestamp_on_update_now - 1);
if (last_query_id != user_thd->query_id) {
prebuilt->sql_stat_start = TRUE;
@@ -3249,7 +3272,7 @@ create_table_def(
ulint nulls_allowed;
ulint unsigned_type;
ulint binary_type;
- ulint nonlatin1_type;
+ ulint charset_no;
ulint i;
DBUG_ENTER("create_table_def");
@@ -3278,24 +3301,28 @@ create_table_def(
unsigned_type = 0;
}
- if (col_type == DATA_BLOB
- && strcmp(default_charset_info->name, "latin1") != 0) {
- nonlatin1_type = DATA_NONLATIN1;
- } else {
- nonlatin1_type = 0;
- }
-
if (field->binary()) {
binary_type = DATA_BINARY_TYPE;
- nonlatin1_type = 0;
} else {
binary_type = 0;
}
+ charset_no = 0;
+
+ if (dtype_is_string_type(col_type)) {
+
+ charset_no = (ulint)field->charset()->number;
+
+ ut_a(charset_no < 256); /* in ut0type.h we assume that
+ the number fits in one byte */
+ }
+
dict_mem_table_add_col(table, (char*) field->field_name,
- col_type, (ulint)field->type()
+ col_type, dtype_form_prtype(
+ (ulint)field->type()
| nulls_allowed | unsigned_type
- | nonlatin1_type | binary_type,
+ | binary_type,
+ + charset_no),
field->pack_length(), 0);
}
@@ -3479,7 +3506,7 @@ ha_innobase::create(
/* The limit probably should be REC_MAX_N_FIELDS - 3 = 1020,
but we play safe here */
- return(HA_ERR_TO_BIG_ROW);
+ DBUG_RETURN(HA_ERR_TO_BIG_ROW);
}
/* Get the transaction associated with the current thd, or create one
@@ -3693,6 +3720,7 @@ ha_innobase::delete_table(
int error;
trx_t* parent_trx;
trx_t* trx;
+ THD *thd= current_thd;
char norm_name[1000];
DBUG_ENTER("ha_innobase::delete_table");
@@ -3718,6 +3746,14 @@ ha_innobase::delete_table(
trx->mysql_thd = current_thd;
trx->mysql_query_str = &((*current_thd).query);
+ if (thd->options & OPTION_NO_FOREIGN_KEY_CHECKS) {
+ trx->check_foreigns = FALSE;
+ }
+
+ if (thd->options & OPTION_RELAXED_UNIQUE_CHECKS) {
+ trx->check_unique_secondary = FALSE;
+ }
+
name_len = strlen(name);
assert(name_len < 1000);
@@ -3799,6 +3835,10 @@ innobase_drop_database(
trx->mysql_thd = current_thd;
trx->mysql_query_str = &((*current_thd).query);
+ if (current_thd->options & OPTION_NO_FOREIGN_KEY_CHECKS) {
+ trx->check_foreigns = FALSE;
+ }
+
error = row_drop_database_for_mysql(namebuf, trx);
/* Flush the log to reduce probability that the .frm files and
@@ -4414,6 +4454,27 @@ ha_innobase::get_foreign_key_create_info(void)
}
/***********************************************************************
+Checks if a table is referenced by a foreign key. The MySQL manual states that
+a REPLACE is either equivalent to an INSERT, or DELETE(s) + INSERT. Only a
+delete is then allowed internally to resolve a duplicate key conflict in
+REPLACE, not an update. */
+
+uint
+ha_innobase::referenced_by_foreign_key(void)
+/*========================================*/
+ /* out: > 0 if referenced by a FOREIGN KEY */
+{
+ row_prebuilt_t* prebuilt = (row_prebuilt_t*)innobase_prebuilt;
+
+ if (dict_table_referenced_by_foreign_key(prebuilt->table)) {
+
+ return(1);
+ }
+
+ return(0);
+}
+
+/***********************************************************************
Frees the foreign key create info for a table stored in InnoDB, if it is
non-NULL. */
@@ -4463,7 +4524,14 @@ ha_innobase::extra(
prebuilt->read_just_key = 0;
break;
case HA_EXTRA_RETRIEVE_ALL_COLS:
- prebuilt->hint_no_need_to_fetch_extra_cols = FALSE;
+ prebuilt->hint_need_to_fetch_extra_cols
+ = ROW_RETRIEVE_ALL_COLS;
+ break;
+ case HA_EXTRA_RETRIEVE_PRIMARY_KEY:
+ if (prebuilt->hint_need_to_fetch_extra_cols == 0) {
+ prebuilt->hint_need_to_fetch_extra_cols
+ = ROW_RETRIEVE_PRIMARY_KEY;
+ }
break;
case HA_EXTRA_KEYREAD:
prebuilt->read_just_key = 1;
@@ -4524,7 +4592,7 @@ ha_innobase::start_stmt(
auto_inc_counter_for_this_stat = 0;
prebuilt->sql_stat_start = TRUE;
- prebuilt->hint_no_need_to_fetch_extra_cols = TRUE;
+ prebuilt->hint_need_to_fetch_extra_cols = 0;
prebuilt->read_just_key = 0;
if (!prebuilt->mysql_has_locked) {
@@ -4601,7 +4669,7 @@ ha_innobase::external_lock(
trx = prebuilt->trx;
prebuilt->sql_stat_start = TRUE;
- prebuilt->hint_no_need_to_fetch_extra_cols = TRUE;
+ prebuilt->hint_need_to_fetch_extra_cols = 0;
prebuilt->read_just_key = 0;
@@ -4629,11 +4697,17 @@ ha_innobase::external_lock(
}
if (trx->isolation_level == TRX_ISO_SERIALIZABLE
- && prebuilt->select_lock_type == LOCK_NONE) {
-
- /* To get serializable execution we let InnoDB
- conceptually add 'LOCK IN SHARE MODE' to all SELECTs
- which otherwise would have been consistent reads */
+ && prebuilt->select_lock_type == LOCK_NONE
+ && (thd->options
+ & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) {
+
+ /* To get serializable execution, we let InnoDB
+ conceptually add 'LOCK IN SHARE MODE' to all SELECTs
+ which otherwise would have been consistent reads. An
+ exception is consistent reads in the AUTOCOMMIT=1 mode:
+ we know that they are read-only transactions, and they
+ can be serialized also if performed as consistent
+ reads. */
prebuilt->select_lock_type = LOCK_S;
}
@@ -4700,7 +4774,7 @@ innodb_show_status(
DBUG_ENTER("innodb_show_status");
- if (innodb_skip) {
+ if (have_innodb != SHOW_OPTION_YES) {
my_message(ER_NOT_SUPPORTED_YET,
"Cannot call SHOW INNODB STATUS because skip-innodb is defined",
MYF(0));
@@ -4939,7 +5013,7 @@ ha_innobase::innobase_read_and_init_auto_inc(
/* Play safe and also give in another way the hint to fetch
all columns in the key: */
- prebuilt->hint_no_need_to_fetch_extra_cols = FALSE;
+ prebuilt->hint_need_to_fetch_extra_cols = ROW_RETRIEVE_ALL_COLS;
prebuilt->trx->mysql_n_tables_locked += 1;
diff --git a/sql/ha_innodb.h b/sql/ha_innodb.h
index c305a019fcd..c1a1b57472a 100644
--- a/sql/ha_innodb.h
+++ b/sql/ha_innodb.h
@@ -95,7 +95,6 @@ class ha_innobase: public handler
HA_NOT_EXACT_COUNT |
HA_NO_WRITE_DELAYED |
HA_PRIMARY_KEY_IN_READ_INDEX |
- HA_DROP_BEFORE_CREATE |
HA_TABLE_SCAN_ON_INDEX),
last_dup_key((uint) -1),
start_of_scan(0)
@@ -181,6 +180,7 @@ class ha_innobase: public handler
int check(THD* thd, HA_CHECK_OPT* check_opt);
char* update_table_comment(const char* comment);
char* get_foreign_key_create_info();
+ uint referenced_by_foreign_key();
void free_foreign_key_create_info(char* str);
THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to,
enum thr_lock_type lock_type);
@@ -190,7 +190,6 @@ class ha_innobase: public handler
bool primary_key_is_clustered() { return true; }
};
-extern bool innodb_skip;
extern uint innobase_init_flags, innobase_lock_type;
extern uint innobase_flush_log_at_trx_commit;
extern ulong innobase_cache_size;
diff --git a/sql/ha_isam.cc b/sql/ha_isam.cc
index 8025e5169c8..52fea2f7a15 100644
--- a/sql/ha_isam.cc
+++ b/sql/ha_isam.cc
@@ -34,7 +34,6 @@
** isam tables
*****************************************************************************/
-bool isam_skip;
const char **ha_isam::bas_ext() const
{ static const char *ext[]= { ".ISM",".ISD", NullS }; return ext; }
@@ -71,8 +70,8 @@ uint ha_isam::min_record_length(uint options) const
int ha_isam::write_row(byte * buf)
{
statistic_increment(ha_write_count,&LOCK_status);
- if (table->time_stamp)
- update_timestamp(buf+table->time_stamp-1);
+ if (table->timestamp_default_now)
+ update_timestamp(buf+table->timestamp_default_now-1);
if (table->next_number_field && buf == table->record[0])
update_auto_increment();
return !nisam_write(file,buf) ? 0 : my_errno ? my_errno : -1;
@@ -81,8 +80,8 @@ int ha_isam::write_row(byte * buf)
int ha_isam::update_row(const byte * old_data, byte * new_data)
{
statistic_increment(ha_update_count,&LOCK_status);
- if (table->time_stamp)
- update_timestamp(new_data+table->time_stamp-1);
+ if (table->timestamp_on_update_now)
+ update_timestamp(new_data+table->timestamp_on_update_now-1);
return !nisam_update(file,old_data,new_data) ? 0 : my_errno ? my_errno : -1;
}
@@ -279,7 +278,7 @@ int ha_isam::create(const char *name, register TABLE *form,
type=HA_KEYTYPE_BINARY; // Keep compiler happy
if (!(recinfo= (N_RECINFO*) my_malloc((form->fields*2+2)*sizeof(N_RECINFO),
MYF(MY_WME))))
- DBUG_RETURN(1);
+ DBUG_RETURN(HA_ERR_OUT_OF_MEM);
pos=form->key_info;
for (i=0; i < form->keys ; i++, pos++)
diff --git a/sql/ha_isam.h b/sql/ha_isam.h
index 3cea79da3ea..129777e68e5 100644
--- a/sql/ha_isam.h
+++ b/sql/ha_isam.h
@@ -34,7 +34,7 @@ class ha_isam: public handler
:handler(table), file(0),
int_table_flags(HA_READ_RND_SAME | HA_KEYPOS_TO_RNDPOS | HA_LASTKEY_ORDER |
HA_KEY_READ_WRONG_STR | HA_DUPP_POS |
- HA_NOT_DELETE_WITH_CACHE)
+ HA_NOT_DELETE_WITH_CACHE | HA_FILE_BASED)
{}
~ha_isam() {}
const char *table_type() const { return "ISAM"; }
@@ -82,4 +82,3 @@ class ha_isam: public handler
enum thr_lock_type lock_type);
};
-extern bool isam_skip;
diff --git a/sql/ha_isammrg.cc b/sql/ha_isammrg.cc
index 9915c182e26..8f7056a15fa 100644
--- a/sql/ha_isammrg.cc
+++ b/sql/ha_isammrg.cc
@@ -78,8 +78,8 @@ int ha_isammrg::write_row(byte * buf)
int ha_isammrg::update_row(const byte * old_data, byte * new_data)
{
statistic_increment(ha_update_count,&LOCK_status);
- if (table->time_stamp)
- update_timestamp(new_data+table->time_stamp-1);
+ if (table->timestamp_on_update_now)
+ update_timestamp(new_data+table->timestamp_on_update_now-1);
return !mrg_update(file,old_data,new_data) ? 0 : my_errno ? my_errno : -1;
}
diff --git a/sql/ha_isammrg.h b/sql/ha_isammrg.h
index c936a15164a..e5846d20212 100644
--- a/sql/ha_isammrg.h
+++ b/sql/ha_isammrg.h
@@ -33,7 +33,7 @@ class ha_isammrg: public handler
const char *table_type() const { return "MRG_ISAM"; }
const char **bas_ext() const;
ulong table_flags() const { return (HA_READ_RND_SAME | HA_KEYPOS_TO_RNDPOS |
- HA_REC_NOT_IN_SEQ); }
+ HA_REC_NOT_IN_SEQ | HA_FILE_BASED); }
ulong index_flags(uint idx) const { return HA_NOT_READ_PREFIX_LAST; }
uint max_record_length() const { return HA_MAX_REC_LENGTH; }
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 1a597415ff3..c992e92edb8 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -253,9 +253,8 @@ int ha_myisam::write_row(byte * buf)
statistic_increment(ha_write_count,&LOCK_status);
/* If we have a timestamp column, update it to the current time */
-
- if (table->time_stamp)
- update_timestamp(buf+table->time_stamp-1);
+ if (table->timestamp_default_now)
+ update_timestamp(buf+table->timestamp_default_now-1);
/*
If we have an auto_increment column and we are writing a changed row
@@ -818,26 +817,19 @@ int ha_myisam::preload_keys(THD* thd, HA_CHECK_OPT *check_opt)
deactivate_non_unique_index()
rows Rows to be inserted
0 if we don't know
- HA_POS_ERROR if we want to disable all keys
+ HA_POS_ERROR if we want to force disabling
+ and make it permanent (save on disk)
*/
void ha_myisam::deactivate_non_unique_index(ha_rows rows)
{
MYISAM_SHARE* share = file->s;
- bool do_warning=0;
if (share->state.key_map == ((ulonglong) 1L << share->base.keys)-1)
{
if (!(specialflag & SPECIAL_SAFE_MODE))
{
- if (rows == HA_POS_ERROR)
- {
- uint orig_update= file->update;
- file->update ^= HA_STATE_CHANGED;
- uint check_update= file->update;
+ if (rows == HA_POS_ERROR) // force disable and save it on disk!
mi_extra(file, HA_EXTRA_NO_KEYS, 0);
- do_warning= (file->update == check_update) && file->state->records;
- file->update= orig_update;
- }
else
{
/*
@@ -847,15 +839,13 @@ void ha_myisam::deactivate_non_unique_index(ha_rows rows)
we don't want to update the key statistics based of only a few rows.
*/
if (file->state->records == 0 &&
- (!rows || rows >= MI_MIN_ROWS_TO_USE_BULK_INSERT))
+ (!rows || rows >= MI_MIN_ROWS_TO_DISABLE_INDEXES))
mi_disable_non_unique_index(file,rows);
- else
- {
+ else if (!file->bulk_insert &&
+ (!rows || rows >= MI_MIN_ROWS_TO_USE_BULK_INSERT))
mi_init_bulk_insert(file,
- current_thd->variables.bulk_insert_buff_size,
- rows);
- table->bulk_insert= 1;
- }
+ current_thd->variables.bulk_insert_buff_size,
+ rows);
}
}
enable_activate_all_index=1;
@@ -863,10 +853,6 @@ void ha_myisam::deactivate_non_unique_index(ha_rows rows)
}
else
enable_activate_all_index=0;
- if (do_warning)
- push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
- ER_ILLEGAL_HA,
- ER(ER_ILLEGAL_HA), table->table_name);
}
@@ -878,7 +864,6 @@ bool ha_myisam::activate_all_index(THD *thd)
DBUG_ENTER("activate_all_index");
mi_end_bulk_insert(file);
- table->bulk_insert= 0;
if (enable_activate_all_index &&
share->state.key_map != set_bits(ulonglong, share->base.keys))
{
@@ -937,8 +922,8 @@ bool ha_myisam::is_crashed() const
int ha_myisam::update_row(const byte * old_data, byte * new_data)
{
statistic_increment(ha_update_count,&LOCK_status);
- if (table->time_stamp)
- update_timestamp(new_data+table->time_stamp-1);
+ if (table->timestamp_on_update_now)
+ update_timestamp(new_data+table->timestamp_on_update_now-1);
return mi_update(file,old_data,new_data);
}
@@ -1205,7 +1190,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
((table_arg->key_parts + table_arg->keys) *
sizeof(HA_KEYSEG)),
NullS)))
- DBUG_RETURN(1);
+ DBUG_RETURN(HA_ERR_OUT_OF_MEM);
pos=table_arg->key_info;
for (i=0; i < table_arg->keys ; i++, pos++)
@@ -1362,6 +1347,7 @@ int ha_myisam::create(const char *name, register TABLE *table_arg,
create_info.data_file_name= info->data_file_name;
create_info.index_file_name=info->index_file_name;
+ /* TODO: Check that the following fn_format is really needed */
error=mi_create(fn_format(buff,name,"","",2+4),
table_arg->keys,keydef,
(uint) (recinfo_pos-recinfo), recinfo,
@@ -1392,8 +1378,8 @@ longlong ha_myisam::get_auto_increment()
return auto_increment_value;
}
- if (table->bulk_insert)
- mi_flush_bulk_insert(file, table->next_number_index);
+ /* it's safe to call the following if bulk_insert isn't on */
+ mi_flush_bulk_insert(file, table->next_number_index);
longlong nr;
int error;
diff --git a/sql/ha_myisam.h b/sql/ha_myisam.h
index e6297373fea..4d66639690d 100644
--- a/sql/ha_myisam.h
+++ b/sql/ha_myisam.h
@@ -37,7 +37,7 @@ extern ulong myisam_recover_options;
class ha_myisam: public handler
{
MI_INFO *file;
- uint int_table_flags;
+ ulong int_table_flags;
char *data_file_name, *index_file_name;
bool enable_activate_all_index;
int repair(THD *thd, MI_CHECK &param, bool optimize);
@@ -46,7 +46,8 @@ class ha_myisam: public handler
ha_myisam(TABLE *table): handler(table), file(0),
int_table_flags(HA_READ_RND_SAME | HA_KEYPOS_TO_RNDPOS | HA_LASTKEY_ORDER |
HA_NULL_KEY | HA_CAN_FULLTEXT | HA_CAN_SQL_HANDLER |
- HA_DUPP_POS | HA_BLOB_KEY | HA_AUTO_PART_KEY | HA_HAS_GEOMETRY),
+ HA_DUPP_POS | HA_BLOB_KEY | HA_AUTO_PART_KEY |
+ HA_FILE_BASED | HA_HAS_GEOMETRY),
enable_activate_all_index(1)
{}
~ha_myisam() {}
@@ -64,6 +65,7 @@ class ha_myisam: public handler
uint max_keys() const { return MI_MAX_KEY; }
uint max_key_parts() const { return MAX_REF_PARTS; }
uint max_key_length() const { return MI_MAX_KEY_LENGTH; }
+ uint max_key_part_length() { return MI_MAX_KEY_LENGTH; }
uint checksum() const;
int open(const char *name, int mode, uint test_if_locked);
diff --git a/sql/ha_myisammrg.cc b/sql/ha_myisammrg.cc
index 3cd5d96d5f3..7c36f6c6e0e 100644
--- a/sql/ha_myisammrg.cc
+++ b/sql/ha_myisammrg.cc
@@ -82,8 +82,8 @@ int ha_myisammrg::close(void)
int ha_myisammrg::write_row(byte * buf)
{
statistic_increment(ha_write_count,&LOCK_status);
- if (table->time_stamp)
- update_timestamp(buf+table->time_stamp-1);
+ if (table->timestamp_default_now)
+ update_timestamp(buf+table->timestamp_default_now-1);
if (table->next_number_field && buf == table->record[0])
update_auto_increment();
return myrg_write(file,buf);
@@ -92,8 +92,8 @@ int ha_myisammrg::write_row(byte * buf)
int ha_myisammrg::update_row(const byte * old_data, byte * new_data)
{
statistic_increment(ha_update_count,&LOCK_status);
- if (table->time_stamp)
- update_timestamp(new_data+table->time_stamp-1);
+ if (table->timestamp_on_update_now)
+ update_timestamp(new_data+table->timestamp_on_update_now);
return myrg_update(file,old_data,new_data);
}
@@ -386,7 +386,7 @@ int ha_myisammrg::create(const char *name, register TABLE *form,
if (!(table_names= (char**) thd->alloc((create_info->merge_list.elements+1)*
sizeof(char*))))
- DBUG_RETURN(1);
+ DBUG_RETURN(HA_ERR_OUT_OF_MEM);
for (pos=table_names ; tables ; tables=tables->next)
{
char *table_name;
@@ -399,7 +399,7 @@ int ha_myisammrg::create(const char *name, register TABLE *form,
mysql_real_data_home,
tables->db, tables->real_name);
if (!(table_name= thd->strmake(buff, length)))
- DBUG_RETURN(1);
+ DBUG_RETURN(HA_ERR_OUT_OF_MEM);
}
else
table_name=(*tbl)->path;
diff --git a/sql/ha_myisammrg.h b/sql/ha_myisammrg.h
index 008f5339caf..ea53b40739d 100644
--- a/sql/ha_myisammrg.h
+++ b/sql/ha_myisammrg.h
@@ -36,7 +36,7 @@ class ha_myisammrg: public handler
{
return (HA_REC_NOT_IN_SEQ | HA_READ_RND_SAME | HA_AUTO_PART_KEY |
HA_KEYPOS_TO_RNDPOS | HA_LASTKEY_ORDER |
- HA_NULL_KEY | HA_BLOB_KEY);
+ HA_NULL_KEY | HA_BLOB_KEY | HA_FILE_BASED);
}
ulong index_flags(uint inx) const
{
diff --git a/sql/handler.cc b/sql/handler.cc
index 0191a7139cd..f9be90c9379 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -120,34 +120,21 @@ const char *ha_get_storage_engine(enum db_type db_type)
enum db_type ha_checktype(enum db_type database_type)
{
+ show_table_type_st *types;
+ for (types= sys_table_types; types->type; types++)
+ {
+ if ((database_type == types->db_type) &&
+ (*types->value == SHOW_OPTION_YES))
+ return database_type;
+ }
+
switch (database_type) {
-#ifdef HAVE_BERKELEY_DB
- case DB_TYPE_BERKELEY_DB:
- if (berkeley_skip) break;
- return (database_type);
-#endif
-#ifdef HAVE_INNOBASE_DB
- case DB_TYPE_INNODB:
- if (innodb_skip) break;
- return (database_type);
-#endif
#ifndef NO_HASH
case DB_TYPE_HASH:
-#endif
-#ifdef HAVE_ISAM
- case DB_TYPE_ISAM:
- if (isam_skip) break;
return (database_type);
- case DB_TYPE_MRG_ISAM:
- return (isam_skip ? DB_TYPE_MRG_MYISAM : database_type);
-#else
+#endif
case DB_TYPE_MRG_ISAM:
return (DB_TYPE_MRG_MYISAM);
-#endif
- case DB_TYPE_HEAP:
- case DB_TYPE_MYISAM:
- case DB_TYPE_MRG_MYISAM:
- return (database_type); /* Database exists on system */
default:
break;
}
@@ -165,7 +152,8 @@ handler *get_new_handler(TABLE *table, enum db_type db_type)
{
switch (db_type) {
#ifndef NO_HASH
- return new ha_hash(table);
+ case DB_TYPE_HASH:
+ return new ha_hash(table);
#endif
#ifdef HAVE_ISAM
case DB_TYPE_MRG_ISAM:
@@ -203,30 +191,32 @@ handler *get_new_handler(TABLE *table, enum db_type db_type)
int ha_init()
{
+ int error= 0;
#ifdef HAVE_BERKELEY_DB
- if (!berkeley_skip)
+ if (have_berkeley_db == SHOW_OPTION_YES)
{
- int error;
- if ((error=berkeley_init()))
- return error;
- if (!berkeley_skip) // If we couldn't use handler
- opt_using_transactions=1;
+ if (berkeley_init())
+ {
+ have_berkeley_db= SHOW_OPTION_DISABLED; // If we couldn't use handler
+ error= 1;
+ }
else
- have_berkeley_db=SHOW_OPTION_DISABLED;
+ opt_using_transactions=1;
}
#endif
#ifdef HAVE_INNOBASE_DB
- if (!innodb_skip)
+ if (have_innodb == SHOW_OPTION_YES)
{
if (innobase_init())
- return -1;
- if (!innodb_skip) // If we couldn't use handler
- opt_using_transactions=1;
+ {
+ have_innodb= SHOW_OPTION_DISABLED; // If we couldn't use handler
+ error= 1;
+ }
else
- have_innodb=SHOW_OPTION_DISABLED;
+ opt_using_transactions=1;
}
#endif
- return 0;
+ return error;
}
/* close, flush or restart databases */
@@ -246,11 +236,11 @@ int ha_panic(enum ha_panic_function flag)
error|=mi_panic(flag);
error|=myrg_panic(flag);
#ifdef HAVE_BERKELEY_DB
- if (!berkeley_skip)
+ if (have_berkeley_db == SHOW_OPTION_YES)
error|=berkeley_end();
#endif
#ifdef HAVE_INNOBASE_DB
- if (!innodb_skip)
+ if (have_innodb == SHOW_OPTION_YES)
error|=innobase_end();
#endif
return error;
@@ -259,7 +249,7 @@ int ha_panic(enum ha_panic_function flag)
void ha_drop_database(char* path)
{
#ifdef HAVE_INNOBASE_DB
- if (!innodb_skip)
+ if (have_innodb == SHOW_OPTION_YES)
innobase_drop_database(path);
#endif
}
@@ -267,7 +257,7 @@ void ha_drop_database(char* path)
void ha_close_connection(THD* thd)
{
#ifdef HAVE_INNOBASE_DB
- if (!innodb_skip)
+ if (have_innodb == SHOW_OPTION_YES)
innobase_close_connection(thd);
#endif
}
@@ -415,6 +405,16 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
my_b_tell(&thd->transaction.trans_log))
{
mysql_bin_log.write(thd, &thd->transaction.trans_log, 1);
+ statistic_increment(binlog_cache_use, &LOCK_status);
+ if (thd->transaction.trans_log.disk_writes != 0)
+ {
+ /*
+ We have to do this after addition of trans_log to main binlog since
+ this operation can cause flushing of end of trans_log to disk.
+ */
+ statistic_increment(binlog_cache_disk_use, &LOCK_status);
+ thd->transaction.trans_log.disk_writes= 0;
+ }
reinit_io_cache(&thd->transaction.trans_log,
WRITE_CACHE, (my_off_t) 0, 0, 1);
thd->transaction.trans_log.end_of_file= max_binlog_cache_size;
@@ -496,17 +496,29 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans)
operation_done=1;
}
#endif
- if (trans == &thd->transaction.all)
+ if ((trans == &thd->transaction.all) && mysql_bin_log.is_open())
{
/*
Update the binary log with a BEGIN/ROLLBACK block if we have cached some
queries and we updated some non-transactional table. Such cases should
be rare (updating a non-transactional table inside a transaction...).
+ Count disk writes to trans_log in any case.
*/
- if (unlikely((thd->options & OPTION_STATUS_NO_TRANS_UPDATE) &&
- mysql_bin_log.is_open() &&
- my_b_tell(&thd->transaction.trans_log)))
- mysql_bin_log.write(thd, &thd->transaction.trans_log, 0);
+ if (my_b_tell(&thd->transaction.trans_log))
+ {
+ if (unlikely(thd->options & OPTION_STATUS_NO_TRANS_UPDATE))
+ mysql_bin_log.write(thd, &thd->transaction.trans_log, 0);
+ statistic_increment(binlog_cache_use, &LOCK_status);
+ if (thd->transaction.trans_log.disk_writes != 0)
+ {
+ /*
+ We have to do this after addition of trans_log to main binlog since
+ this operation can cause flushing of end of trans_log to disk.
+ */
+ statistic_increment(binlog_cache_disk_use, &LOCK_status);
+ thd->transaction.trans_log.disk_writes= 0;
+ }
+ }
/* Flushed or not, empty the binlog cache */
reinit_io_cache(&thd->transaction.trans_log,
WRITE_CACHE, (my_off_t) 0, 0, 1);
@@ -569,7 +581,7 @@ int ha_rollback_to_savepoint(THD *thd, char *savepoint_name)
my_error(ER_ERROR_DURING_ROLLBACK, MYF(0), error);
error=1;
}
- else
+ else if (mysql_bin_log.is_open())
{
/*
Write ROLLBACK TO SAVEPOINT to the binlog cache if we have updated some
@@ -577,7 +589,6 @@ int ha_rollback_to_savepoint(THD *thd, char *savepoint_name)
from the SAVEPOINT command.
*/
if (unlikely((thd->options & OPTION_STATUS_NO_TRANS_UPDATE) &&
- mysql_bin_log.is_open() &&
my_b_tell(&thd->transaction.trans_log)))
{
Query_log_event qinfo(thd, thd->query, thd->query_length, TRUE);
@@ -606,23 +617,26 @@ Return value: always 0, that is, succeeds always
int ha_savepoint(THD *thd, char *savepoint_name)
{
- my_off_t binlog_cache_pos=0;
int error=0;
DBUG_ENTER("ha_savepoint");
#ifdef USING_TRANSACTIONS
if (opt_using_transactions)
{
- binlog_cache_pos=my_b_tell(&thd->transaction.trans_log);
-#ifdef HAVE_INNOBASE_DB
- innobase_savepoint(thd,savepoint_name, binlog_cache_pos);
-#endif
- /* Write it to the binary log (see comments of ha_rollback_to_savepoint). */
+ /* Write it to the binary log (see comments of ha_rollback_to_savepoint) */
if (mysql_bin_log.is_open())
{
+#ifdef HAVE_INNOBASE_DB
+ innobase_savepoint(thd,savepoint_name,
+ my_b_tell(&thd->transaction.trans_log));
+#endif
Query_log_event qinfo(thd, thd->query, thd->query_length, TRUE);
if (mysql_bin_log.write(&qinfo))
error= 1;
}
+#ifdef HAVE_INNOBASE_DB
+ else
+ innobase_savepoint(thd,savepoint_name,0);
+#endif
}
#endif /* USING_TRANSACTIONS */
DBUG_RETURN(error);
@@ -632,11 +646,13 @@ bool ha_flush_logs()
{
bool result=0;
#ifdef HAVE_BERKELEY_DB
- if (!berkeley_skip && berkeley_flush_logs())
+ if ((have_berkeley_db == SHOW_OPTION_YES) &&
+ berkeley_flush_logs())
result=1;
#endif
#ifdef HAVE_INNOBASE_DB
- if (!innodb_skip && innobase_flush_logs())
+ if ((have_innodb == SHOW_OPTION_YES) &&
+ innobase_flush_logs())
result=1;
#endif
return result;
@@ -649,14 +665,23 @@ bool ha_flush_logs()
int ha_delete_table(enum db_type table_type, const char *path)
{
+ char tmp_path[FN_REFLEN];
handler *file=get_new_handler((TABLE*) 0, table_type);
if (!file)
return ENOENT;
+ if (lower_case_table_names == 2 && !(file->table_flags() & HA_FILE_BASED))
+ {
+ /* Ensure that table handler get path in lower case */
+ strmov(tmp_path, path);
+ my_casedn_str(system_charset_info, tmp_path);
+ path= tmp_path;
+ }
int error=file->delete_table(path);
delete file;
return error;
}
+
void ha_store_ptr(byte *buff, uint pack_length, my_off_t pos)
{
switch (pack_length) {
@@ -877,11 +902,11 @@ void handler::update_auto_increment()
table->auto_increment_field_not_null &&
current_thd->variables.sql_mode & MODE_NO_AUTO_VALUE_ON_ZERO)
{
- table->auto_increment_field_not_null= false;
+ table->auto_increment_field_not_null= FALSE;
auto_increment_column_changed=0;
DBUG_VOID_RETURN;
}
- table->auto_increment_field_not_null= false;
+ table->auto_increment_field_not_null= FALSE;
thd=current_thd;
if ((nr=thd->next_insert_id))
thd->next_insert_id=0; // Clear after use
@@ -1136,6 +1161,7 @@ int ha_create_table(const char *name, HA_CREATE_INFO *create_info,
{
int error;
TABLE table;
+ char name_buff[FN_REFLEN];
DBUG_ENTER("ha_create_table");
if (openfrm(name,"",0,(uint) READ_ALL, 0, &table))
@@ -1146,19 +1172,19 @@ int ha_create_table(const char *name, HA_CREATE_INFO *create_info,
if (table.file->table_flags() & HA_DROP_BEFORE_CREATE)
table.file->delete_table(name); // Needed for BDB tables
}
+ if (lower_case_table_names == 2 &&
+ !(table.file->table_flags() & HA_FILE_BASED))
+ {
+ /* Ensure that handler gets name in lower case */
+ strmov(name_buff, name);
+ my_casedn_str(system_charset_info, name_buff);
+ name= name_buff;
+ }
+
error=table.file->create(name,&table,create_info);
VOID(closefrm(&table));
if (error)
- {
- if (table.db_type == DB_TYPE_INNODB)
- {
- /* Creation of InnoDB table cannot fail because of an OS error:
- put error as the number */
- my_error(ER_CANT_CREATE_TABLE,MYF(ME_BELL+ME_WAITTANG),name,error);
- }
- else
- my_error(ER_CANT_CREATE_TABLE,MYF(ME_BELL+ME_WAITTANG),name,my_errno);
- }
+ my_error(ER_CANT_CREATE_TABLE,MYF(ME_BELL+ME_WAITTANG),name,error);
DBUG_RETURN(error != 0);
}
diff --git a/sql/handler.h b/sql/handler.h
index 4a8abf5f131..182f84e523f 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -41,6 +41,7 @@
#define HA_ADMIN_CORRUPT -3
#define HA_ADMIN_INTERNAL_ERROR -4
#define HA_ADMIN_INVALID -5
+#define HA_ADMIN_REJECT -6
/* Bits in table_flags() to show what database can do */
#define HA_READ_RND_SAME 1 /* Read RND-record to KEY-record
@@ -70,12 +71,14 @@
#define HA_CAN_SQL_HANDLER (1 << 22)
#define HA_NO_AUTO_INCREMENT (1 << 23)
#define HA_HAS_CHECKSUM (1 << 24)
-
/*
Next record gives next record according last record read (even
if database is updated after read). Not used at this point.
*/
-#define HA_LASTKEY_ORDER (1 << 25)
+#define HA_LASTKEY_ORDER (1 << 25)
+/* Table data are stored in separate files */
+#define HA_FILE_BASED (1 << 26)
+
/* bits in index_flags(index_number) for what you can do with index */
@@ -167,8 +170,9 @@ enum enum_tx_isolation { ISO_READ_UNCOMMITTED, ISO_READ_COMMITTED,
typedef struct st_ha_create_information
{
CHARSET_INFO *table_charset, *default_table_charset;
- char *comment,*password;
- char *data_file_name, *index_file_name;
+ const char *comment,*password;
+ const char *data_file_name, *index_file_name;
+ const char *alias;
ulonglong max_rows,min_rows;
ulonglong auto_increment_value;
ulong table_options;
@@ -230,6 +234,7 @@ public:
uint raid_type,raid_chunks;
FT_INFO *ft_handler;
bool auto_increment_column_changed;
+ bool implicit_emptied; /* Can be !=0 only if HEAP */
handler(TABLE *table_arg) :table(table_arg),
ref(0), data_file_length(0), max_data_file_length(0), index_file_length(0),
@@ -238,7 +243,7 @@ public:
create_time(0), check_time(0), update_time(0),
key_used_on_scan(MAX_KEY), active_index(MAX_REF_PARTS),
ref_length(sizeof(my_off_t)), block_size(0),
- raid_type(0), ft_handler(0)
+ raid_type(0), ft_handler(0), implicit_emptied(0)
{}
virtual ~handler(void) {}
int ha_open(const char *name, int mode, int test_if_locked);
@@ -337,6 +342,8 @@ public:
virtual void append_create_info(String *packet) {}
virtual char* get_foreign_key_create_info()
{ return(NULL);} /* gets foreign key create string from InnoDB */
+ /* used in REPLACE; is > 0 if table is referred by a FOREIGN KEY */
+ virtual uint referenced_by_foreign_key() { return 0;}
virtual void init_table_handle_for_HANDLER()
{ return; } /* prepare InnoDB for HANDLER */
virtual void free_foreign_key_create_info(char* str) {}
diff --git a/sql/hostname.cc b/sql/hostname.cc
index c9cb2a43963..c74d230bbcb 100644
--- a/sql/hostname.cc
+++ b/sql/hostname.cc
@@ -27,9 +27,6 @@
extern "C" { // Because of SCO 3.2V4.2
#endif
#if !defined( __WIN__) && !defined(OS2)
-#if !defined(__NETWARE__)
-#include <sys/resource.h>
-#endif /* __NETWARE__ */
#ifdef HAVE_SYS_UN_H
#include <sys/un.h>
#endif
diff --git a/sql/init.cc b/sql/init.cc
index 033dfd72843..4beb8db0c6f 100644
--- a/sql/init.cc
+++ b/sql/init.cc
@@ -34,9 +34,6 @@ void unireg_init(ulong options)
current_pid=(ulong) getpid(); /* Save for later ref */
init_time(); /* Init time-functions (read zone) */
-#ifdef USE_MY_ATOF
- init_my_atof(); /* use our atof */
-#endif
#ifndef EMBEDDED_LIBRARY
my_abort_hook=unireg_abort; /* Abort with close of databases */
#endif
@@ -49,7 +46,5 @@ void unireg_init(ulong options)
log_10[i]= nr ; nr*= 10.0;
}
specialflag|=options; /* Set options from argv */
-
- thread_stack_min=thread_stack - STACK_MIN_SIZE;
DBUG_VOID_RETURN;
}
diff --git a/sql/item.cc b/sql/item.cc
index d0502b30d88..5f31f3fa6ec 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -104,21 +104,49 @@ void Item::print_item_w_name(String *str)
Item_ident::Item_ident(const char *db_name_par,const char *table_name_par,
const char *field_name_par)
- :db_name(db_name_par),table_name(table_name_par),field_name(field_name_par),
- depended_from(0)
+ :orig_db_name(db_name_par), orig_table_name(table_name_par),
+ orig_field_name(field_name_par), changed_during_fix_field(0),
+ db_name(db_name_par), table_name(table_name_par),
+ field_name(field_name_par), cached_field_index(NO_CACHED_FIELD_INDEX),
+ cached_table(0), depended_from(0)
{
name = (char*) field_name_par;
}
// Constructor used by Item_field & Item_ref (see Item comment)
-Item_ident::Item_ident(THD *thd, Item_ident *item):
- Item(thd, item),
- db_name(item->db_name),
- table_name(item->table_name),
- field_name(item->field_name),
- depended_from(item->depended_from)
+Item_ident::Item_ident(THD *thd, Item_ident *item)
+ :Item(thd, item),
+ orig_db_name(item->orig_db_name),
+ orig_table_name(item->orig_table_name),
+ orig_field_name(item->orig_field_name),
+ changed_during_fix_field(0),
+ db_name(item->db_name),
+ table_name(item->table_name),
+ field_name(item->field_name),
+ cached_field_index(item->cached_field_index),
+ cached_table(item->cached_table),
+ depended_from(item->depended_from)
{}
+void Item_ident::cleanup()
+{
+ DBUG_ENTER("Item_ident::cleanup");
+ DBUG_PRINT("enter", ("b:%s(%s), t:%s(%s), f:%s(%s)",
+ db_name, orig_db_name,
+ table_name, orig_table_name,
+ field_name, orig_field_name));
+ Item::cleanup();
+ if (changed_during_fix_field)
+ {
+ *changed_during_fix_field= this;
+ changed_during_fix_field= 0;
+ }
+ db_name= orig_db_name;
+ table_name= orig_table_name;
+ field_name= orig_field_name;
+ DBUG_VOID_RETURN;
+}
+
bool Item_ident::remove_dependence_processor(byte * arg)
{
DBUG_ENTER("Item_ident::remove_dependence_processor");
@@ -177,12 +205,13 @@ bool Item::eq(const Item *item, bool binary_cmp) const
!my_strcasecmp(system_charset_info,name,item->name);
}
+
bool Item_string::eq(const Item *item, bool binary_cmp) const
{
if (type() == item->type())
{
if (binary_cmp)
- return !sortcmp(&str_value, &item->str_value, &my_charset_bin);
+ return !stringcmp(&str_value, &item->str_value);
return !sortcmp(&str_value, &item->str_value, collation.collation);
}
return 0;
@@ -318,11 +347,21 @@ bool DTCollation::aggregate(DTCollation &dt)
return 0;
}
-Item_field::Item_field(Field *f) :Item_ident(NullS,f->table_name,f->field_name)
+Item_field::Item_field(Field *f)
+ :Item_ident(NullS, f->table_name, f->field_name)
{
set_field(f);
collation.set(DERIVATION_IMPLICIT);
- fixed= 1; // This item is not needed in fix_fields
+ fixed= 1;
+}
+
+Item_field::Item_field(THD *thd, Field *f)
+ :Item_ident(NullS, thd->strdup(f->table_name),
+ thd->strdup(f->field_name))
+{
+ set_field(f);
+ collation.set(DERIVATION_IMPLICIT);
+ fixed= 1;
}
// Constructor need to process subselect with temporary tables (see Item)
@@ -370,6 +409,7 @@ const char *Item_ident::full_name() const
/* ARGSUSED */
String *Item_field::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
if ((null_value=field->is_null()))
return 0;
str->set_charset(str_value.charset());
@@ -378,6 +418,7 @@ String *Item_field::val_str(String *str)
double Item_field::val()
{
+ DBUG_ASSERT(fixed == 1);
if ((null_value=field->is_null()))
return 0.0;
return field->val_real();
@@ -385,6 +426,7 @@ double Item_field::val()
longlong Item_field::val_int()
{
+ DBUG_ASSERT(fixed == 1);
if ((null_value=field->is_null()))
return 0;
return field->val_int();
@@ -469,9 +511,8 @@ bool Item_field::eq(const Item *item, bool binary_cmp) const
(!my_strcasecmp(table_alias_charset, item_field->table_name,
table_name) &&
(!item_field->db_name ||
- (item_field->db_name && !my_strcasecmp(table_alias_charset,
- item_field->db_name,
- db_name))))));
+ (item_field->db_name && !strcmp(item_field->db_name,
+ db_name))))));
}
@@ -494,6 +535,8 @@ Item *Item_field::get_tmp_table_item(THD *thd)
String *Item_int::val_str(String *str)
{
+ // following assert is redundant, because fixed=1 assigned in constructor
+ DBUG_ASSERT(fixed == 1);
str->set(value, &my_charset_bin);
return str;
}
@@ -508,6 +551,8 @@ void Item_int::print(String *str)
String *Item_uint::val_str(String *str)
{
+ // following assert is redundant, because fixed=1 assigned in constructor
+ DBUG_ASSERT(fixed == 1);
str->set((ulonglong) value, &my_charset_bin);
return str;
}
@@ -523,6 +568,8 @@ void Item_uint::print(String *str)
String *Item_real::val_str(String *str)
{
+ // following assert is redundant, because fixed=1 assigned in constructor
+ DBUG_ASSERT(fixed == 1);
str->set(value,decimals,&my_charset_bin);
return str;
}
@@ -539,14 +586,57 @@ void Item_string::print(String *str)
bool Item_null::eq(const Item *item, bool binary_cmp) const
{ return item->type() == type(); }
-double Item_null::val() { null_value=1; return 0.0; }
-longlong Item_null::val_int() { null_value=1; return 0; }
+double Item_null::val()
+{
+ // following assert is redundant, because fixed=1 assigned in constructor
+ DBUG_ASSERT(fixed == 1);
+ null_value=1;
+ return 0.0;
+}
+longlong Item_null::val_int()
+{
+ // following assert is redundant, because fixed=1 assigned in constructor
+ DBUG_ASSERT(fixed == 1);
+ null_value=1;
+ return 0;
+}
/* ARGSUSED */
String *Item_null::val_str(String *str)
-{ null_value=1; return 0;}
+{
+ // following assert is redundant, because fixed=1 assigned in constructor
+ DBUG_ASSERT(fixed == 1);
+ null_value=1;
+ return 0;
+}
+
+
+/*********************** Item_param related ******************************/
+
+/*
+ Default function of Item_param::set_param_func, so in case
+ of malformed packet the server won't SIGSEGV
+*/
+
+static void
+default_set_param_func(Item_param *param,
+ uchar **pos __attribute__((unused)),
+ ulong len __attribute__((unused)))
+{
+ param->set_null();
+}
+Item_param::Item_param(unsigned position) :
+ value_is_set(FALSE),
+ item_result_type(STRING_RESULT),
+ item_type(STRING_ITEM),
+ item_is_time(FALSE),
+ long_data_supplied(FALSE),
+ pos_in_query(position),
+ set_param_func(default_set_param_func)
+{
+ name= (char*) "?";
+}
-/* Item_param related */
void Item_param::set_null()
{
DBUG_ENTER("Item_param::set_null");
@@ -602,7 +692,7 @@ void Item_param::set_time(TIME *tm, timestamp_type type)
ltime.time_type= type;
- item_is_time= true;
+ item_is_time= TRUE;
item_type= STRING_ITEM;
value_is_set= 1;
}
@@ -642,7 +732,7 @@ int Item_param::save_in_field(Field *field, bool no_conversions)
return 0;
}
String *result=val_str(&str_value);
- return (field->store(result->ptr(),result->length(),field->charset())) ? -1 : 0;
+ return field->store(result->ptr(),result->length(),field->charset());
}
bool Item_param::get_time(TIME *res)
@@ -653,6 +743,7 @@ bool Item_param::get_time(TIME *res)
double Item_param::val()
{
+ DBUG_ASSERT(value_is_set == 1);
int err;
switch (item_result_type) {
case STRING_RESULT:
@@ -668,8 +759,9 @@ double Item_param::val()
longlong Item_param::val_int()
{
- int err;
- switch (item_result_type) {
+ DBUG_ASSERT(value_is_set == 1);
+ int err;
+ switch (item_result_type) {
case STRING_RESULT:
return my_strntoll(str_value.charset(),
str_value.ptr(),str_value.length(),10,
@@ -684,6 +776,7 @@ longlong Item_param::val_int()
String *Item_param::val_str(String* str)
{
+ DBUG_ASSERT(value_is_set == 1);
switch (item_result_type) {
case INT_RESULT:
str->set(int_value, &my_charset_bin);
@@ -702,12 +795,12 @@ String *Item_param::val_str(String* str)
*/
String *Item_param::query_val_str(String* str)
-{
+{
+ DBUG_ASSERT(value_is_set == 1);
switch (item_result_type) {
case INT_RESULT:
case REAL_RESULT:
return val_str(str);
- break;
default:
str->set("'", 1, default_charset());
@@ -775,11 +868,22 @@ void Item_copy_string::copy()
/* ARGSUSED */
String *Item_copy_string::val_str(String *str)
{
+ // Item_copy_string is used without fix_fields call
if (null_value)
return (String*) 0;
return &str_value;
}
+
+int Item_copy_string::save_in_field(Field *field, bool no_conversions)
+{
+ if (null_value)
+ return set_field_to_null(field);
+ field->set_notnull();
+ return field->store(str_value.ptr(),str_value.length(),
+ collation.collation);
+}
+
/*
Functions to convert item to field (for send_fields)
*/
@@ -789,28 +893,40 @@ bool Item::fix_fields(THD *thd,
struct st_table_list *list,
Item ** ref)
{
+
+ // We do not check fields which are fixed during construction
+ DBUG_ASSERT(fixed == 0 || basic_const_item());
fixed= 1;
return 0;
}
double Item_ref_null_helper::val()
{
+ DBUG_ASSERT(fixed == 1);
double tmp= (*ref)->val_result();
owner->was_null|= null_value= (*ref)->null_value;
return tmp;
}
+
+
longlong Item_ref_null_helper::val_int()
{
+ DBUG_ASSERT(fixed == 1);
longlong tmp= (*ref)->val_int_result();
owner->was_null|= null_value= (*ref)->null_value;
return tmp;
}
+
+
String* Item_ref_null_helper::val_str(String* s)
{
+ DBUG_ASSERT(fixed == 1);
String* tmp= (*ref)->str_result(s);
owner->was_null|= null_value= (*ref)->null_value;
return tmp;
}
+
+
bool Item_ref_null_helper::get_date(TIME *ltime, uint fuzzydate)
{
return (owner->was_null|= null_value= (*ref)->get_date(ltime, fuzzydate));
@@ -850,6 +966,7 @@ static void mark_as_dependent(THD *thd, SELECT_LEX *last, SELECT_LEX *current,
bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
{
+ DBUG_ASSERT(fixed == 0);
if (!field) // If field is not checked
{
TABLE_LIST *where= 0;
@@ -896,6 +1013,8 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
table_list, &where,
0)) != not_found_field)
{
+ if (!tmp)
+ return -1;
prev_subselect_item->used_tables_cache|= tmp->table->map;
prev_subselect_item->const_item_cache= 0;
break;
@@ -955,8 +1074,13 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
ref,
(char *)table_name,
(char *)field_name);
+ register_item_tree_changing(ref);
if (!rf)
return 1;
+ /*
+ rf is Item_ref => never substitute other items (in this case)
+ during fix_fields() => we can use rf after fix_fields()
+ */
if (rf->fix_fields(thd, tables, ref) || rf->check_cols(1))
return 1;
@@ -975,6 +1099,10 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
(char *)field_name);
if (!rf)
return 1;
+ /*
+ rf is Item_ref => never substitute other items (in this case)
+ during fix_fields() => we can use rf after fix_fields()
+ */
return rf->fix_fields(thd, tables, ref) || rf->check_cols(1);
}
}
@@ -998,8 +1126,15 @@ bool Item_field::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
void Item_field::cleanup()
{
+ DBUG_ENTER("Item_field::cleanup");
Item_ident::cleanup();
+ /*
+ Even if this object was created by direct link to field in setup_wild()
+ it will be linked correctly next tyme by name of field and table alias.
+ I.e. we can drop 'field'.
+ */
field= result_field= 0;
+ DBUG_VOID_RETURN;
}
void Item::init_make_field(Send_field *tmp_field,
@@ -1213,7 +1348,7 @@ int Item::save_in_field(Field *field, bool no_conversions)
String *result;
CHARSET_INFO *cs= collation.collation;
char buff[MAX_FIELD_WIDTH]; // Alloc buffer for small columns
- str_value.set_quick(buff,sizeof(buff),cs);
+ str_value.set_quick(buff, sizeof(buff), cs);
result=val_str(&str_value);
if (null_value)
return set_field_to_null_with_conversions(field, no_conversions);
@@ -1237,7 +1372,7 @@ int Item::save_in_field(Field *field, bool no_conversions)
field->set_notnull();
error=field->store(nr);
}
- return (error) ? -1 : 0;
+ return error;
}
@@ -1248,8 +1383,7 @@ int Item_string::save_in_field(Field *field, bool no_conversions)
if (null_value)
return set_field_to_null(field);
field->set_notnull();
- return (field->store(result->ptr(),result->length(),collation.collation)) ?
- -1 : 0;
+ return field->store(result->ptr(),result->length(),collation.collation);
}
int Item_uint::save_in_field(Field *field, bool no_conversions)
@@ -1268,9 +1402,13 @@ int Item_int::save_in_field(Field *field, bool no_conversions)
if (null_value)
return set_field_to_null(field);
field->set_notnull();
- return (field->store(nr)) ? -1 : 0;
+ return field->store(nr);
}
+Item_num *Item_uint::neg()
+{
+ return new Item_real(name, - ((double) value), 0, max_length);
+}
int Item_real::save_in_field(Field *field, bool no_conversions)
{
@@ -1278,7 +1416,7 @@ int Item_real::save_in_field(Field *field, bool no_conversions)
if (null_value)
return set_field_to_null(field);
field->set_notnull();
- return (field->store(nr)) ? -1 : 0;
+ return field->store(nr);
}
/****************************************************************************
@@ -1313,10 +1451,13 @@ Item_varbinary::Item_varbinary(const char *str, uint str_length)
}
*ptr=0; // Keep purify happy
collation.set(&my_charset_bin, DERIVATION_COERCIBLE);
+ fixed= 1;
}
longlong Item_varbinary::val_int()
{
+ // following assert is redundant, because fixed=1 assigned in constructor
+ DBUG_ASSERT(fixed == 1);
char *end=(char*) str_value.ptr()+str_value.length(),
*ptr=end-min(str_value.length(),sizeof(longlong));
@@ -1340,7 +1481,7 @@ int Item_varbinary::save_in_field(Field *field, bool no_conversions)
longlong nr=val_int();
error=field->store(nr);
}
- return (error) ? -1 : 0;
+ return error;
}
@@ -1473,6 +1614,7 @@ bool Item_field::send(Protocol *protocol, String *buffer)
bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference)
{
+ DBUG_ASSERT(fixed == 0);
uint counter;
if (!ref)
{
@@ -1578,6 +1720,7 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference)
Item_field* fld;
if (!((*reference)= fld= new Item_field(tmp)))
return 1;
+ register_item_tree_changing(reference);
mark_as_dependent(thd, last, thd->lex->current_select, fld);
return 0;
}
@@ -1642,9 +1785,11 @@ bool Item_ref::fix_fields(THD *thd,TABLE_LIST *tables, Item **reference)
void Item_ref::cleanup()
{
+ DBUG_ENTER("Item_ref::cleanup");
Item_ident::cleanup();
if (hook_ptr)
*hook_ptr= orig_item;
+ DBUG_VOID_RETURN;
}
@@ -1683,16 +1828,19 @@ bool Item_default_value::eq(const Item *item, bool binary_cmp) const
}
-bool Item_default_value::fix_fields(THD *thd, struct st_table_list *table_list, Item **items)
+bool Item_default_value::fix_fields(THD *thd,
+ struct st_table_list *table_list,
+ Item **items)
{
+ DBUG_ASSERT(fixed == 0);
if (!arg)
- return false;
- bool res= arg->fix_fields(thd, table_list, items);
- if (res)
- return res;
- /* arg->type() can be only REF_ITEM or FIELD_ITEM for it defined as
- simple_ident in sql_yacc.yy
- */
+ {
+ fixed= 1;
+ return 0;
+ }
+ if (arg->fix_fields(thd, table_list, &arg))
+ return 1;
+
if (arg->type() == REF_ITEM)
{
Item_ref *ref= (Item_ref *)arg;
@@ -1710,6 +1858,7 @@ bool Item_default_value::fix_fields(THD *thd, struct st_table_list *table_list,
def_field->move_field(def_field->table->default_values -
def_field->table->record[0]);
set_field(def_field);
+ fixed= 1;
return 0;
}
@@ -1736,13 +1885,10 @@ bool Item_insert_value::fix_fields(THD *thd,
struct st_table_list *table_list,
Item **items)
{
- bool res= arg->fix_fields(thd, table_list, items);
- if (res)
- return res;
- /*
- arg->type() can be only REF_ITEM or FIELD_ITEM as arg is
- a simple_ident in sql_yacc.yy
- */
+ DBUG_ASSERT(fixed == 0);
+ if (arg->fix_fields(thd, table_list, &arg))
+ return 1;
+
if (arg->type() == REF_ITEM)
{
Item_ref *ref= (Item_ref *)arg;
@@ -1770,6 +1916,7 @@ bool Item_insert_value::fix_fields(THD *thd,
set_field(new Field_null(0, 0, Field::NONE, tmp_field->field_name,
tmp_field->table, &my_charset_bin));
}
+ fixed= 1;
return 0;
}
@@ -1855,7 +2002,7 @@ bool field_is_equal_to_item(Field *field,Item *item)
if (item->null_value)
return 1; // This must be true
field->val_str(&field_tmp,&field_tmp);
- return !sortcmp(&field_tmp,item_result,&my_charset_bin);
+ return !stringcmp(&field_tmp,item_result);
}
if (res_type == INT_RESULT)
return 1; // Both where of type int
@@ -1933,7 +2080,8 @@ void Item_cache_str::store(Item *item)
double Item_cache_str::val()
-{
+{
+ DBUG_ASSERT(fixed == 1);
int err;
if (value)
return my_strntod(value->charset(), (char*) value->ptr(),
@@ -1945,6 +2093,7 @@ double Item_cache_str::val()
longlong Item_cache_str::val_int()
{
+ DBUG_ASSERT(fixed == 1);
int err;
if (value)
return my_strntoll(value->charset(), value->ptr(),
diff --git a/sql/item.h b/sql/item.h
index c08c17ea602..9f6aa5a9a32 100644
--- a/sql/item.h
+++ b/sql/item.h
@@ -102,7 +102,11 @@ public:
enum cond_result { COND_UNDEF,COND_OK,COND_TRUE,COND_FALSE };
- String str_value; /* used to store value */
+ /*
+ str_values's main purpose is to be used to cache the value in
+ save_in_field
+ */
+ String str_value;
my_string name; /* Name from select */
Item *next;
uint32 max_length;
@@ -129,9 +133,20 @@ public:
virtual ~Item() { name=0; } /*lint -e1509 */
void set_name(const char *str,uint length, CHARSET_INFO *cs);
void init_make_field(Send_field *tmp_field,enum enum_field_types type);
- virtual void cleanup() { fixed=0; }
+ virtual void cleanup()
+ {
+ DBUG_ENTER("Item::cleanup");
+ DBUG_PRINT("info", ("Type: %d", (int)type()));
+ fixed=0;
+ DBUG_VOID_RETURN;
+ }
virtual void make_field(Send_field *field);
virtual bool fix_fields(THD *, struct st_table_list *, Item **);
+ /*
+ should be used in case where we are sure that we do not need
+ complete fix_fields() procedure.
+ */
+ inline void quick_fix_field() { fixed= 1; }
virtual int save_in_field(Field *field, bool no_conversions);
virtual void save_org_in_field(Field *field)
{ (void) save_in_field(field, 1); }
@@ -231,7 +246,7 @@ public:
Field *tmp_table_field_from_field_type(TABLE *table);
/* Used in sql_select.cc:eliminate_not_funcs() */
- virtual Item *neg_transformer() { return NULL; }
+ virtual Item *neg_transformer(THD *thd) { return NULL; }
void delete_self()
{
cleanup();
@@ -335,19 +350,51 @@ public:
};
+class Item_num: public Item
+{
+public:
+ virtual Item_num *neg()= 0;
+};
+
+#define NO_CACHED_FIELD_INDEX ((uint)(-1))
+
class st_select_lex;
class Item_ident :public Item
{
+ /*
+ We have to store initial values of db_name, table_name and field_name
+ to be able to restore them during cleanup() because they can be
+ updated during fix_fields() to values from Field object and life-time
+ of those is shorter than life-time of Item_field.
+ */
+ const char *orig_db_name;
+ const char *orig_table_name;
+ const char *orig_field_name;
+ Item **changed_during_fix_field;
public:
const char *db_name;
const char *table_name;
const char *field_name;
+ /*
+ Cached value of index for this field in table->field array, used by prep.
+ stmts for speeding up their re-execution. Holds NO_CACHED_FIELD_INDEX
+ if index value is not known.
+ */
+ uint cached_field_index;
+ /*
+ Cached pointer to table which contains this field, used for the same reason
+ by prep. stmt. too in case then we have not-fully qualified field.
+ 0 - means no cached value.
+ */
+ TABLE_LIST *cached_table;
st_select_lex *depended_from;
Item_ident(const char *db_name_par,const char *table_name_par,
const char *field_name_par);
Item_ident(THD *thd, Item_ident *item);
const char *full_name() const;
-
+ void cleanup();
+ void register_item_tree_changing(Item **ref)
+ { changed_during_fix_field= ref; }
bool remove_dependence_processor(byte * arg);
};
@@ -357,14 +404,25 @@ class Item_field :public Item_ident
void set_field(Field *field);
public:
Field *field,*result_field;
- // Item_field() {}
+#ifndef DBUG_OFF
+ bool double_fix;
+#endif
Item_field(const char *db_par,const char *table_name_par,
const char *field_name_par)
- :Item_ident(db_par,table_name_par,field_name_par),field(0),result_field(0)
+ :Item_ident(db_par,table_name_par,field_name_par),
+ field(0), result_field(0)
+#ifndef DBUG_OFF
+ ,double_fix(0)
+#endif
{ collation.set(DERIVATION_IMPLICIT); }
// Constructor need to process subselect with temporary tables (see Item)
Item_field(THD *thd, Item_field *item);
+ /*
+ Constructor used inside setup_wild(), ensures that field and table
+ names will live as long as Item_field (important in prep. stmt.)
+ */
+ Item_field(THD *thd, Field *field);
Item_field(Field *field);
enum Type type() const { return FIELD_ITEM; }
bool eq(const Item *item, bool binary_cmp) const;
@@ -398,13 +456,19 @@ public:
void cleanup();
friend class Item_default_value;
friend class Item_insert_value;
+ friend class st_select_lex_unit;
};
class Item_null :public Item
{
public:
Item_null(char *name_par=0)
- { maybe_null=null_value=TRUE; name= name_par ? name_par : (char*) "NULL";}
+ {
+ maybe_null= null_value= TRUE;
+ max_length= 0;
+ name= name_par ? name_par : (char*) "NULL";
+ fixed= 1;
+ }
enum Type type() const { return NULL_ITEM; }
bool eq(const Item *item, bool binary_cmp) const;
double val();
@@ -415,12 +479,8 @@ public:
bool send(Protocol *protocol, String *str);
enum Item_result result_type () const { return STRING_RESULT; }
enum_field_types field_type() const { return MYSQL_TYPE_NULL; }
- bool fix_fields(THD *thd, struct st_table_list *list, Item **item)
- {
- bool res= Item::fix_fields(thd, list, item);
- max_length=0;
- return res;
- }
+ // to prevent drop fixed flag (no need parent cleanup call)
+ void cleanup() {}
bool basic_const_item() const { return 1; }
Item *new_item() { return new Item_null(name); }
bool is_null() { return 1; }
@@ -441,16 +501,7 @@ public:
bool long_data_supplied;
uint pos_in_query;
- Item_param(uint position)
- {
- name= (char*) "?";
- pos_in_query= position;
- item_type= STRING_ITEM;
- item_result_type = STRING_RESULT;
- item_is_time= false;
- long_data_supplied= false;
- value_is_set= 0;
- }
+ Item_param(uint position);
enum Type type() const { return item_type; }
double val();
longlong val_int();
@@ -467,11 +518,14 @@ public:
void set_time(TIME *tm, timestamp_type type);
bool get_time(TIME *tm);
void reset() {}
-#ifndef EMBEDDED_LIBRARY
- void (*setup_param_func)(Item_param *param, uchar **pos);
-#else
- void (*setup_param_func)(Item_param *param, uchar **pos, ulong data_len);
-#endif
+ /*
+ Assign placeholder value from bind data.
+ Note, that 'len' has different semantics in embedded library (as we
+ don't need to check that packet is not broken there). See
+ sql_prepare.cc for details.
+ */
+ void (*set_param_func)(Item_param *param, uchar **pos, ulong len);
+
enum Item_result result_type () const
{ return item_result_type; }
String *query_val_str(String *str);
@@ -487,10 +541,10 @@ public:
void print(String *str) { str->append('?'); }
};
-class Item_int :public Item
+class Item_int :public Item_num
{
public:
- const longlong value;
+ longlong value;
Item_int(int32 i,uint length=11) :value((longlong) i)
{ max_length=length; fixed= 1; }
#ifdef HAVE_LONG_LONG
@@ -506,13 +560,16 @@ public:
enum Type type() const { return INT_ITEM; }
enum Item_result result_type () const { return INT_RESULT; }
enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; }
- longlong val_int() { return value; }
- double val() { return (double) value; }
+ longlong val_int() { DBUG_ASSERT(fixed == 1); return value; }
+ double val() { DBUG_ASSERT(fixed == 1); return (double) value; }
String *val_str(String*);
int save_in_field(Field *field, bool no_conversions);
bool basic_const_item() const { return 1; }
Item *new_item() { return new Item_int(name,value,max_length); }
+ // to prevent drop fixed flag (no need parent cleanup call)
+ void cleanup() {}
void print(String *str);
+ Item_num *neg() { value= -value; return this; }
};
@@ -520,32 +577,31 @@ class Item_uint :public Item_int
{
public:
Item_uint(const char *str_arg, uint length) :
- Item_int(str_arg, (longlong) strtoull(str_arg,(char**) 0,10), length) {}
- Item_uint(uint32 i) :Item_int((longlong) i, 10) {}
- double val() { return ulonglong2double((ulonglong)value); }
+ Item_int(str_arg, (longlong) strtoull(str_arg, (char**) 0,10), length)
+ { unsigned_flag= 1; }
+ Item_uint(uint32 i) :Item_int((longlong) i, 10)
+ { unsigned_flag= 1; }
+ double val()
+ { DBUG_ASSERT(fixed == 1); return ulonglong2double((ulonglong)value); }
String *val_str(String*);
Item *new_item() { return new Item_uint(name,max_length); }
int save_in_field(Field *field, bool no_conversions);
- bool fix_fields(THD *thd, struct st_table_list *list, Item **item)
- {
- bool res= Item::fix_fields(thd, list, item);
- unsigned_flag= 1;
- return res;
- }
void print(String *str);
+ Item_num *neg ();
};
-class Item_real :public Item
+class Item_real :public Item_num
{
public:
- const double value;
+ double value;
// Item_real() :value(0) {}
- Item_real(const char *str_arg,uint length) :value(atof(str_arg))
+ Item_real(const char *str_arg, uint length) :value(my_atof(str_arg))
{
name=(char*) str_arg;
decimals=(uint8) nr_of_decimals(str_arg);
max_length=length;
+ fixed= 1;
}
Item_real(const char *str,double val_arg,uint decimal_par,uint length)
:value(val_arg)
@@ -553,16 +609,24 @@ public:
name=(char*) str;
decimals=(uint8) decimal_par;
max_length=length;
+ fixed= 1;
}
- Item_real(double value_par) :value(value_par) {}
+ Item_real(double value_par) :value(value_par) { fixed= 1; }
int save_in_field(Field *field, bool no_conversions);
enum Type type() const { return REAL_ITEM; }
enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; }
- double val() { return value; }
- longlong val_int() { return (longlong) (value+(value > 0 ? 0.5 : -0.5));}
+ double val() { DBUG_ASSERT(fixed == 1); return value; }
+ longlong val_int()
+ {
+ DBUG_ASSERT(fixed == 1);
+ return (longlong) (value+(value > 0 ? 0.5 : -0.5));
+ }
String *val_str(String*);
bool basic_const_item() const { return 1; }
+ // to prevent drop fixed flag (no need parent cleanup call)
+ void cleanup() {}
Item *new_item() { return new Item_real(name,value,decimals,max_length); }
+ Item_num *neg() { value= -value; return this; }
};
@@ -594,6 +658,8 @@ public:
max_length= str_value.numchars()*cs->mbmaxlen;
set_name(str, length, cs);
decimals=NOT_FIXED_DEC;
+ // it is constant => can be used without fix_fields (and frequently used)
+ fixed= 1;
}
Item_string(const char *name_par, const char *str, uint length,
CHARSET_INFO *cs, Derivation dv= DERIVATION_COERCIBLE)
@@ -603,21 +669,29 @@ public:
max_length= str_value.numchars()*cs->mbmaxlen;
set_name(name_par,0,cs);
decimals=NOT_FIXED_DEC;
+ // it is constant => can be used without fix_fields (and frequently used)
+ fixed= 1;
}
enum Type type() const { return STRING_ITEM; }
double val()
- {
+ {
+ DBUG_ASSERT(fixed == 1);
int err;
return my_strntod(str_value.charset(), (char*) str_value.ptr(),
str_value.length(), (char**) 0, &err);
}
longlong val_int()
{
+ DBUG_ASSERT(fixed == 1);
int err;
return my_strntoll(str_value.charset(), str_value.ptr(),
str_value.length(), 10, (char**) 0, &err);
}
- String *val_str(String*) { return (String*) &str_value; }
+ String *val_str(String*)
+ {
+ DBUG_ASSERT(fixed == 1);
+ return (String*) &str_value;
+ }
int save_in_field(Field *field, bool no_conversions);
enum Item_result result_type () const { return STRING_RESULT; }
enum_field_types field_type() const { return MYSQL_TYPE_STRING; }
@@ -625,11 +699,14 @@ public:
bool eq(const Item *item, bool binary_cmp) const;
Item *new_item()
{
- return new Item_string(name, str_value.ptr(), max_length, &my_charset_bin);
+ return new Item_string(name, str_value.ptr(),
+ str_value.length(), &my_charset_bin);
}
String *const_string() { return &str_value; }
inline void append(char *str, uint length) { str_value.append(str, length); }
void print(String *str);
+ // to prevent drop fixed flag (no need parent cleanup call)
+ void cleanup() {}
};
/* for show tables */
@@ -671,12 +748,16 @@ class Item_varbinary :public Item
public:
Item_varbinary(const char *str,uint str_length);
enum Type type() const { return VARBIN_ITEM; }
- double val() { return (double) Item_varbinary::val_int(); }
+ double val()
+ { DBUG_ASSERT(fixed == 1); return (double) Item_varbinary::val_int(); }
longlong val_int();
- String *val_str(String*) { return &str_value; }
+ bool basic_const_item() const { return 1; }
+ String *val_str(String*) { DBUG_ASSERT(fixed == 1); return &str_value; }
int save_in_field(Field *field, bool no_conversions);
enum Item_result result_type () const { return STRING_RESULT; }
enum_field_types field_type() const { return MYSQL_TYPE_STRING; }
+ // to prevent drop fixed flag (no need parent cleanup call)
+ void cleanup() {}
};
@@ -862,6 +943,7 @@ public:
String *val_str(String*);
void make_field(Send_field *field) { item->make_field(field); }
void copy();
+ int save_in_field(Field *field, bool no_conversions);
table_map used_tables() const { return (table_map) 1L; }
bool const_item() const { return 0; }
bool is_null() { return null_value; }
@@ -934,7 +1016,6 @@ public:
bool eq(const Item *item, bool binary_cmp) const;
bool fix_fields(THD *, struct st_table_list *, Item **);
void print(String *str);
- virtual bool basic_const_item() const { return true; }
int save_in_field(Field *field_arg, bool no_conversions)
{
if (!arg)
@@ -962,7 +1043,6 @@ public:
bool eq(const Item *item, bool binary_cmp) const;
bool fix_fields(THD *, struct st_table_list *, Item **);
void print(String *str);
- virtual bool basic_const_item() const { return true; }
int save_in_field(Field *field_arg, bool no_conversions)
{
return Item_field::save_in_field(field_arg, no_conversions);
@@ -986,7 +1066,7 @@ public:
void set_used_tables(table_map map) { used_table_map= map; }
- virtual bool allocate(uint i) { return 0; };
+ virtual bool allocate(uint i) { return 0; }
virtual bool setup(Item *item)
{
example= item;
@@ -999,6 +1079,9 @@ public:
enum Type type() const { return CACHE_ITEM; }
static Item_cache* get_cache(Item_result type);
table_map used_tables() const { return used_table_map; }
+ virtual void keep_array() {}
+ // to prevent drop fixed flag (no need parent cleanup call)
+ void cleanup() {}
void print(String *str);
};
@@ -1009,9 +1092,14 @@ public:
Item_cache_int(): Item_cache() {}
void store(Item *item);
- double val() { return (double) value; }
- longlong val_int() { return value; }
- String* val_str(String *str) { str->set(value, default_charset()); return str; }
+ double val() { DBUG_ASSERT(fixed == 1); return (double) value; }
+ longlong val_int() { DBUG_ASSERT(fixed == 1); return value; }
+ String* val_str(String *str)
+ {
+ DBUG_ASSERT(fixed == 1);
+ str->set(value, default_charset());
+ return str;
+ }
enum Item_result result_type() const { return INT_RESULT; }
};
@@ -1022,8 +1110,12 @@ public:
Item_cache_real(): Item_cache() {}
void store(Item *item);
- double val() { return value; }
- longlong val_int() { return (longlong) (value+(value > 0 ? 0.5 : -0.5)); }
+ double val() { DBUG_ASSERT(fixed == 1); return value; }
+ longlong val_int()
+ {
+ DBUG_ASSERT(fixed == 1);
+ return (longlong) (value+(value > 0 ? 0.5 : -0.5));
+ }
String* val_str(String *str)
{
str->set(value, decimals, default_charset());
@@ -1042,7 +1134,7 @@ public:
void store(Item *item);
double val();
longlong val_int();
- String* val_str(String *) { return value; }
+ String* val_str(String *) { DBUG_ASSERT(fixed == 1); return value; }
enum Item_result result_type() const { return STRING_RESULT; }
CHARSET_INFO *charset() const { return value->charset(); };
};
@@ -1051,8 +1143,10 @@ class Item_cache_row: public Item_cache
{
Item_cache **values;
uint item_count;
+ bool save_array;
public:
- Item_cache_row(): Item_cache(), values(0), item_count(2) {}
+ Item_cache_row()
+ :Item_cache(), values(0), item_count(2), save_array(0) {}
/*
'allocate' used only in row transformer, to preallocate space for row
@@ -1093,10 +1187,16 @@ public:
bool check_cols(uint c);
bool null_inside();
void bring_value();
+ void keep_array() { save_array= 1; }
void cleanup()
{
+ DBUG_ENTER("Item_cache_row::cleanup");
Item_cache::cleanup();
- values= 0;
+ if (save_array)
+ bzero(values, item_count*sizeof(Item**));
+ else
+ values= 0;
+ DBUG_VOID_RETURN;
}
};
@@ -1122,8 +1222,10 @@ public:
Field *example() { return field_example; }
void cleanup()
{
+ DBUG_ENTER("Item_type_holder::cleanup");
Item::cleanup();
item_type= orig_type;
+ DBUG_VOID_RETURN;
}
};
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 4046a4d6414..ae6658c8e35 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -103,6 +103,7 @@ Item_bool_func2* Le_creator::create(Item *a, Item *b) const
longlong Item_func_not::val_int()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val();
null_value=args[0]->null_value;
return !null_value && value == 0 ? 1 : 0;
@@ -113,7 +114,8 @@ longlong Item_func_not::val_int()
*/
longlong Item_func_not_all::val_int()
-{
+{
+ DBUG_ASSERT(fixed == 1);
double value= args[0]->val();
if (abort_on_null)
{
@@ -225,6 +227,13 @@ void Item_bool_func2::fix_length_and_dec()
}
// Make a special case of compare with fields to get nicer DATE comparisons
+
+ if (functype() == LIKE_FUNC) // Disable conversion in case of LIKE function.
+ {
+ set_cmp_func();
+ return;
+ }
+
if (args[0]->type() == FIELD_ITEM)
{
Field *field=((Item_field*) args[0])->field;
@@ -293,6 +302,17 @@ int Arg_comparator::set_compare_func(Item_bool_func2 *item, Item_result type)
my_coll_agg_error((*a)->collation, (*b)->collation, owner->func_name());
return 1;
}
+ if (my_binary_compare(cmp_collation.collation))
+ {
+ /*
+ We are using binary collation, change to compare byte by byte,
+ without removing end space
+ */
+ if (func == &Arg_comparator::compare_string)
+ func= &Arg_comparator::compare_binary_string;
+ else if (func == &Arg_comparator::compare_e_string)
+ func= &Arg_comparator::compare_e_binary_string;
+ }
}
return 0;
}
@@ -313,6 +333,39 @@ int Arg_comparator::compare_string()
return -1;
}
+
+/*
+ Compare strings byte by byte. End spaces are also compared.
+
+ RETURN
+ < 0 *a < *b
+ 0 *b == *b
+ > 0 *a > *b
+*/
+
+int Arg_comparator::compare_binary_string()
+{
+ String *res1,*res2;
+ if ((res1= (*a)->val_str(&owner->tmp_value1)))
+ {
+ if ((res2= (*b)->val_str(&owner->tmp_value2)))
+ {
+ owner->null_value= 0;
+ uint res1_length= res1->length();
+ uint res2_length= res2->length();
+ int cmp= memcmp(res1->ptr(), res2->ptr(), min(res1_length,res2_length));
+ return cmp ? cmp : (int) (res1_length - res2_length);
+ }
+ }
+ owner->null_value= 1;
+ return -1;
+}
+
+
+/*
+ Compare strings, but take into account that NULL == NULL
+*/
+
int Arg_comparator::compare_e_string()
{
String *res1,*res2;
@@ -324,6 +377,17 @@ int Arg_comparator::compare_e_string()
}
+int Arg_comparator::compare_e_binary_string()
+{
+ String *res1,*res2;
+ res1= (*a)->val_str(&owner->tmp_value1);
+ res2= (*b)->val_str(&owner->tmp_value2);
+ if (!res1 || !res2)
+ return test(res1 == res2);
+ return test(stringcmp(res1, res2) == 0);
+}
+
+
int Arg_comparator::compare_real()
{
double val1= (*a)->val();
@@ -440,16 +504,15 @@ bool Item_in_optimizer::fix_left(THD *thd,
not_null_tables_cache= args[0]->not_null_tables();
with_sum_func= args[0]->with_sum_func;
const_item_cache= args[0]->const_item();
- fixed= 1;
return 0;
}
-
bool Item_in_optimizer::fix_fields(THD *thd, struct st_table_list *tables,
Item ** ref)
{
- if (fix_left(thd, tables, ref))
+ DBUG_ASSERT(fixed == 0);
+ if (!args[0]->fixed && fix_left(thd, tables, ref))
return 1;
if (args[0]->maybe_null)
maybe_null=1;
@@ -468,11 +531,14 @@ bool Item_in_optimizer::fix_fields(THD *thd, struct st_table_list *tables,
used_tables_cache|= args[1]->used_tables();
not_null_tables_cache|= args[1]->not_null_tables();
const_item_cache&= args[1]->const_item();
+ fixed= 1;
return 0;
}
+
longlong Item_in_optimizer::val_int()
{
+ DBUG_ASSERT(fixed == 1);
cache->store(args[0]);
if (cache->null_value)
{
@@ -484,18 +550,39 @@ longlong Item_in_optimizer::val_int()
return tmp;
}
+
+void Item_in_optimizer::keep_top_level_cache()
+{
+ cache->keep_array();
+ save_cache= 1;
+}
+
+
+void Item_in_optimizer::cleanup()
+{
+ DBUG_ENTER("Item_in_optimizer::cleanup");
+ Item_bool_func::cleanup();
+ if (!save_cache)
+ cache= 0;
+ DBUG_VOID_RETURN;
+}
+
+
bool Item_in_optimizer::is_null()
{
cache->store(args[0]);
return (null_value= (cache->null_value || args[1]->is_null()));
}
+
longlong Item_func_eq::val_int()
{
+ DBUG_ASSERT(fixed == 1);
int value= cmp.compare();
return value == 0 ? 1 : 0;
}
+
/* Same as Item_func_eq, but NULL = NULL */
void Item_func_equal::fix_length_and_dec()
@@ -506,11 +593,13 @@ void Item_func_equal::fix_length_and_dec()
longlong Item_func_equal::val_int()
{
+ DBUG_ASSERT(fixed == 1);
return cmp.compare();
}
longlong Item_func_ne::val_int()
{
+ DBUG_ASSERT(fixed == 1);
int value= cmp.compare();
return value != 0 && !null_value ? 1 : 0;
}
@@ -518,6 +607,7 @@ longlong Item_func_ne::val_int()
longlong Item_func_ge::val_int()
{
+ DBUG_ASSERT(fixed == 1);
int value= cmp.compare();
return value >= 0 ? 1 : 0;
}
@@ -525,12 +615,14 @@ longlong Item_func_ge::val_int()
longlong Item_func_gt::val_int()
{
+ DBUG_ASSERT(fixed == 1);
int value= cmp.compare();
return value > 0 ? 1 : 0;
}
longlong Item_func_le::val_int()
{
+ DBUG_ASSERT(fixed == 1);
int value= cmp.compare();
return value <= 0 && !null_value ? 1 : 0;
}
@@ -538,6 +630,7 @@ longlong Item_func_le::val_int()
longlong Item_func_lt::val_int()
{
+ DBUG_ASSERT(fixed == 1);
int value= cmp.compare();
return value < 0 && !null_value ? 1 : 0;
}
@@ -545,6 +638,7 @@ longlong Item_func_lt::val_int()
longlong Item_func_strcmp::val_int()
{
+ DBUG_ASSERT(fixed == 1);
String *a=args[0]->val_str(&tmp_value1);
String *b=args[1]->val_str(&tmp_value2);
if (!a || !b)
@@ -594,6 +688,7 @@ void Item_func_interval::fix_length_and_dec()
longlong Item_func_interval::val_int()
{
+ DBUG_ASSERT(fixed == 1);
double value= row->el(0)->val();
uint i;
@@ -659,6 +754,7 @@ void Item_func_between::fix_length_and_dec()
longlong Item_func_between::val_int()
{ // ANSI BETWEEN
+ DBUG_ASSERT(fixed == 1);
if (cmp_type == STRING_RESULT)
{
String *value,*a,*b;
@@ -674,11 +770,13 @@ longlong Item_func_between::val_int()
null_value=1;
else if (args[1]->null_value)
{
- null_value= sortcmp(value,b,cmp_collation.collation) <= 0; // not null if false range.
+ // Set to not null if false range.
+ null_value= sortcmp(value,b,cmp_collation.collation) <= 0;
}
else
{
- null_value= sortcmp(value,a,cmp_collation.collation) >= 0; // not null if false range.
+ // Set to not null if false range.
+ null_value= sortcmp(value,a,cmp_collation.collation) >= 0;
}
}
else if (cmp_type == INT_RESULT)
@@ -766,6 +864,7 @@ Field *Item_func_ifnull::tmp_table_field(TABLE *table)
double
Item_func_ifnull::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val();
if (!args[0]->null_value)
{
@@ -781,6 +880,7 @@ Item_func_ifnull::val()
longlong
Item_func_ifnull::val_int()
{
+ DBUG_ASSERT(fixed == 1);
longlong value=args[0]->val_int();
if (!args[0]->null_value)
{
@@ -796,6 +896,7 @@ Item_func_ifnull::val_int()
String *
Item_func_ifnull::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res =args[0]->val_str(str);
if (!args[0]->null_value)
{
@@ -851,6 +952,7 @@ Item_func_if::fix_length_and_dec()
double
Item_func_if::val()
{
+ DBUG_ASSERT(fixed == 1);
Item *arg= args[0]->val_int() ? args[1] : args[2];
double value=arg->val();
null_value=arg->null_value;
@@ -860,6 +962,7 @@ Item_func_if::val()
longlong
Item_func_if::val_int()
{
+ DBUG_ASSERT(fixed == 1);
Item *arg= args[0]->val_int() ? args[1] : args[2];
longlong value=arg->val_int();
null_value=arg->null_value;
@@ -869,6 +972,7 @@ Item_func_if::val_int()
String *
Item_func_if::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
Item *arg= args[0]->val_int() ? args[1] : args[2];
String *res=arg->val_str(str);
if (res)
@@ -901,8 +1005,9 @@ Item_func_nullif::fix_length_and_dec()
double
Item_func_nullif::val()
{
+ DBUG_ASSERT(fixed == 1);
double value;
- if (!cmp.compare() || null_value)
+ if (!cmp.compare())
{
null_value=1;
return 0.0;
@@ -915,8 +1020,9 @@ Item_func_nullif::val()
longlong
Item_func_nullif::val_int()
{
+ DBUG_ASSERT(fixed == 1);
longlong value;
- if (!cmp.compare() || null_value)
+ if (!cmp.compare())
{
null_value=1;
return 0;
@@ -929,8 +1035,9 @@ Item_func_nullif::val_int()
String *
Item_func_nullif::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res;
- if (!cmp.compare() || null_value)
+ if (!cmp.compare())
{
null_value=1;
return 0;
@@ -1022,6 +1129,7 @@ Item *Item_func_case::find_item(String *str)
String *Item_func_case::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res;
Item *item=find_item(str);
@@ -1039,6 +1147,7 @@ String *Item_func_case::val_str(String *str)
longlong Item_func_case::val_int()
{
+ DBUG_ASSERT(fixed == 1);
char buff[MAX_FIELD_WIDTH];
String dummy_str(buff,sizeof(buff),default_charset());
Item *item=find_item(&dummy_str);
@@ -1056,6 +1165,7 @@ longlong Item_func_case::val_int()
double Item_func_case::val()
{
+ DBUG_ASSERT(fixed == 1);
char buff[MAX_FIELD_WIDTH];
String dummy_str(buff,sizeof(buff),default_charset());
Item *item=find_item(&dummy_str);
@@ -1161,6 +1271,7 @@ void Item_func_case::print(String *str)
String *Item_func_coalesce::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
null_value=0;
for (uint i=0 ; i < arg_count ; i++)
{
@@ -1174,6 +1285,7 @@ String *Item_func_coalesce::val_str(String *str)
longlong Item_func_coalesce::val_int()
{
+ DBUG_ASSERT(fixed == 1);
null_value=0;
for (uint i=0 ; i < arg_count ; i++)
{
@@ -1187,6 +1299,7 @@ longlong Item_func_coalesce::val_int()
double Item_func_coalesce::val()
{
+ DBUG_ASSERT(fixed == 1);
null_value=0;
for (uint i=0 ; i < arg_count ; i++)
{
@@ -1359,16 +1472,12 @@ cmp_item* cmp_item::get_comparator(Item *item)
switch (item->result_type()) {
case STRING_RESULT:
return new cmp_item_sort_string(item->collation.collation);
- break;
case INT_RESULT:
return new cmp_item_int;
- break;
case REAL_RESULT:
return new cmp_item_real;
- break;
case ROW_RESULT:
return new cmp_item_row;
- break;
default:
DBUG_ASSERT(0);
break;
@@ -1593,6 +1702,7 @@ void Item_func_in::print(String *str)
longlong Item_func_in::val_int()
{
+ DBUG_ASSERT(fixed == 1);
if (array)
{
int tmp=array->find(args[0]);
@@ -1616,6 +1726,7 @@ longlong Item_func_in::val_int()
longlong Item_func_bit_or::val_int()
{
+ DBUG_ASSERT(fixed == 1);
ulonglong arg1= (ulonglong) args[0]->val_int();
if (args[0]->null_value)
{
@@ -1635,6 +1746,7 @@ longlong Item_func_bit_or::val_int()
longlong Item_func_bit_and::val_int()
{
+ DBUG_ASSERT(fixed == 1);
ulonglong arg1= (ulonglong) args[0]->val_int();
if (args[0]->null_value)
{
@@ -1673,6 +1785,7 @@ void Item_cond::copy_andor_arguments(THD *thd, Item_cond *item)
bool
Item_cond::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
{
+ DBUG_ASSERT(fixed == 0);
List_iterator<Item> li(list);
Item *item;
#ifndef EMBEDDED_LIBRARY
@@ -1700,8 +1813,11 @@ Item_cond::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
}
if (abort_on_null)
item->top_level_item();
+
+ // item can be substituted in fix_fields
if ((!item->fixed &&
- item->fix_fields(thd, tables, li.ref())) || item->check_cols(1))
+ item->fix_fields(thd, tables, li.ref())) ||
+ (item= *li.ref())->check_cols(1))
return 1; /* purecov: inspected */
used_tables_cache|= item->used_tables();
tmp_table_map= item->not_null_tables();
@@ -1793,14 +1909,28 @@ void Item_cond::print(String *str)
}
-void Item_cond::neg_arguments()
+void Item_cond::neg_arguments(THD *thd)
{
List_iterator<Item> li(list);
Item *item;
while ((item= li++)) /* Apply not transformation to the arguments */
{
- Item *new_item= item->neg_transformer();
- VOID(li.replace(new_item ? new_item : new Item_func_not(item)));
+ Item *new_item= item->neg_transformer(thd);
+ if (!new_item)
+ {
+ if (!(new_item= new Item_func_not(item)))
+ return; // Fatal OEM error
+ /*
+ We can use 0 as tables list because Item_func_not do not use it
+ on fix_fields and its arguments are already fixed.
+
+ We do not check results of fix_fields, because there are not way
+ to return error in this functions interface, thd->net.report_error
+ will be checked on upper level call.
+ */
+ new_item->fix_fields(thd, 0, &new_item);
+ }
+ VOID(li.replace(new_item));
}
}
@@ -1825,6 +1955,7 @@ void Item_cond::neg_arguments()
longlong Item_cond_and::val_int()
{
+ DBUG_ASSERT(fixed == 1);
List_iterator_fast<Item> li(list);
Item *item;
null_value= 0;
@@ -1842,6 +1973,7 @@ longlong Item_cond_and::val_int()
longlong Item_cond_or::val_int()
{
+ DBUG_ASSERT(fixed == 1);
List_iterator_fast<Item> li(list);
Item *item;
null_value=0;
@@ -1903,6 +2035,7 @@ Item *and_expressions(Item *a, Item *b, Item **org_item)
longlong Item_func_isnull::val_int()
{
+ DBUG_ASSERT(fixed == 1);
/*
Handle optimization if the argument can't be null
This has to be here because of the test in update_used_tables().
@@ -1914,6 +2047,7 @@ longlong Item_func_isnull::val_int()
longlong Item_is_not_null_test::val_int()
{
+ DBUG_ASSERT(fixed == 1);
DBUG_ENTER("Item_is_not_null_test::val_int");
if (!used_tables_cache)
{
@@ -1953,6 +2087,7 @@ void Item_is_not_null_test::update_used_tables()
longlong Item_func_isnotnull::val_int()
{
+ DBUG_ASSERT(fixed == 1);
return args[0]->is_null() ? 0 : 1;
}
@@ -1967,6 +2102,7 @@ void Item_func_isnotnull::print(String *str)
longlong Item_func_like::val_int()
{
+ DBUG_ASSERT(fixed == 1);
String* res = args[0]->val_str(&tmp_value1);
if (args[0]->null_value)
{
@@ -2012,6 +2148,7 @@ 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))
return 1;
@@ -2065,6 +2202,7 @@ bool Item_func_like::fix_fields(THD *thd, TABLE_LIST *tlist, Item ** ref)
bool
Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
{
+ DBUG_ASSERT(fixed == 0);
if (args[0]->fix_fields(thd, tables, args) || args[0]->check_cols(1) ||
args[1]->fix_fields(thd,tables, args + 1) || args[1]->check_cols(1))
return 1; /* purecov: inspected */
@@ -2112,6 +2250,7 @@ Item_func_regex::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
longlong Item_func_regex::val_int()
{
+ DBUG_ASSERT(fixed == 1);
char buff[MAX_FIELD_WIDTH];
String *res, tmp(buff,sizeof(buff),&my_charset_bin);
@@ -2132,7 +2271,7 @@ longlong Item_func_regex::val_int()
null_value=1;
return 0;
}
- if (!regex_compiled || sortcmp(res2,&prev_regexp,&my_charset_bin))
+ if (!regex_compiled || stringcmp(res2,&prev_regexp))
{
prev_regexp.copy(*res2);
if (regex_compiled)
@@ -2412,6 +2551,7 @@ bool Item_func_like::turboBM_matches(const char* text, int text_len) const
longlong Item_cond_xor::val_int()
{
+ DBUG_ASSERT(fixed == 1);
List_iterator<Item> li(list);
Item *item;
int result=0;
@@ -2433,6 +2573,7 @@ longlong Item_cond_xor::val_int()
SYNPOSIS
neg_transformer()
+ thd thread handler
DESCRIPTION
Transform the item using next rules:
@@ -2456,62 +2597,116 @@ longlong Item_cond_xor::val_int()
NULL if we cannot apply NOT transformation (see Item::neg_transformer()).
*/
-Item *Item_func_not::neg_transformer() /* NOT(x) -> x */
+Item *Item_func_not::neg_transformer(THD *thd) /* NOT(x) -> x */
{
- /* We should apply negation elimination to the argument of the NOT function */
- return eliminate_not_funcs(args[0]);
+ // We should apply negation elimination to the argument of the NOT function
+ return eliminate_not_funcs(thd, args[0]);
}
-Item *Item_func_eq::neg_transformer() /* a = b -> a != b */
+
+Item *Item_bool_rowready_func2::neg_transformer(THD *thd)
{
- return new Item_func_ne(args[0], args[1]);
+ Item *item= negated_item();
+ if (item)
+ {
+ /*
+ We can use 0 as tables list because Item_func* family do not use it
+ on fix_fields and its arguments are already fixed.
+
+ We do not check results of fix_fields, because there are not way
+ to return error in this functions interface, thd->net.report_error
+ will be checked on upper level call.
+ */
+ item->fix_fields(thd, 0, &item);
+ }
+ return item;
}
-Item *Item_func_ne::neg_transformer() /* a != b -> a = b */
+
+/* a IS NULL -> a IS NOT NULL */
+Item *Item_func_isnull::neg_transformer(THD *thd)
{
- return new Item_func_eq(args[0], args[1]);
+ Item *item= new Item_func_isnotnull(args[0]);
+ // see comment before fix_fields in Item_bool_rowready_func2::neg_transformer
+ if (item)
+ item->fix_fields(thd, 0, &item);
+ return item;
}
-Item *Item_func_lt::neg_transformer() /* a < b -> a >= b */
+
+/* a IS NOT NULL -> a IS NULL */
+Item *Item_func_isnotnull::neg_transformer(THD *thd)
{
- return new Item_func_ge(args[0], args[1]);
+ Item *item= new Item_func_isnull(args[0]);
+ // see comment before fix_fields in Item_bool_rowready_func2::neg_transformer
+ if (item)
+ item->fix_fields(thd, 0, &item);
+ return item;
}
-Item *Item_func_ge::neg_transformer() /* a >= b -> a < b */
+
+Item *Item_cond_and::neg_transformer(THD *thd) /* NOT(a AND b AND ...) -> */
+ /* NOT a OR NOT b OR ... */
{
- return new Item_func_lt(args[0], args[1]);
+ neg_arguments(thd);
+ Item *item= new Item_cond_or(list);
+ // see comment before fix_fields in Item_bool_rowready_func2::neg_transformer
+ if (item)
+ item->fix_fields(thd, 0, &item);
+ return item;
}
-Item *Item_func_gt::neg_transformer() /* a > b -> a <= b */
+
+Item *Item_cond_or::neg_transformer(THD *thd) /* NOT(a OR b OR ...) -> */
+ /* NOT a AND NOT b AND ... */
{
- return new Item_func_le(args[0], args[1]);
+ neg_arguments(thd);
+ Item *item= new Item_cond_and(list);
+ // see comment before fix_fields in Item_bool_rowready_func2::neg_transformer
+ if (item)
+ item->fix_fields(thd, 0, &item);
+ return item;
}
-Item *Item_func_le::neg_transformer() /* a <= b -> a > b */
+
+Item *Item_func_eq::negated_item() /* a = b -> a != b */
{
- return new Item_func_gt(args[0], args[1]);
+ return new Item_func_ne(args[0], args[1]);
}
-Item *Item_func_isnull::neg_transformer() /* a IS NULL -> a IS NOT NULL */
+
+Item *Item_func_ne::negated_item() /* a != b -> a = b */
{
- return new Item_func_isnotnull(args[0]);
+ return new Item_func_eq(args[0], args[1]);
}
-Item *Item_func_isnotnull::neg_transformer() /* a IS NOT NULL -> a IS NULL */
+
+Item *Item_func_lt::negated_item() /* a < b -> a >= b */
{
- return new Item_func_isnull(args[0]);
+ return new Item_func_ge(args[0], args[1]);
}
-Item *Item_cond_and::neg_transformer() /* NOT(a AND b AND ...) -> */
- /* NOT a OR NOT b OR ... */
+
+Item *Item_func_ge::negated_item() /* a >= b -> a < b */
+{
+ return new Item_func_lt(args[0], args[1]);
+}
+
+
+Item *Item_func_gt::negated_item() /* a > b -> a <= b */
{
- neg_arguments();
- return new Item_cond_or(list);
+ return new Item_func_le(args[0], args[1]);
}
-Item *Item_cond_or::neg_transformer() /* NOT(a OR b OR ...) -> */
- /* NOT a AND NOT b AND ... */
+
+Item *Item_func_le::negated_item() /* a <= b -> a > b */
+{
+ return new Item_func_gt(args[0], args[1]);
+}
+
+// just fake method, should never be called
+Item *Item_bool_rowready_func2::negated_item()
{
- neg_arguments();
- return new Item_cond_and(list);
+ DBUG_ASSERT(0);
+ return 0;
}
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 7e1749ef7a0..d654bec4f4e 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -63,10 +63,12 @@ public:
inline int compare() { return (this->*func)(); }
int compare_string(); // compare args[0] & args[1]
+ int compare_binary_string(); // compare args[0] & args[1]
int compare_real(); // compare args[0] & args[1]
int compare_int(); // compare args[0] & args[1]
int compare_row(); // compare args[0] & args[1]
int compare_e_string(); // compare args[0] & args[1]
+ int compare_e_binary_string(); // compare args[0] & args[1]
int compare_e_real(); // compare args[0] & args[1]
int compare_e_int(); // compare args[0] & args[1]
int compare_e_row(); // compare args[0] & args[1]
@@ -91,9 +93,10 @@ class Item_in_optimizer: public Item_bool_func
{
protected:
Item_cache *cache;
+ bool save_cache;
public:
Item_in_optimizer(Item *a, Item_in_subselect *b):
- Item_bool_func(a, (Item *)b), cache(0) {}
+ Item_bool_func(a, (Item *)b), cache(0), save_cache(0) {}
bool fix_fields(THD *, struct st_table_list *, Item **);
bool fix_left(THD *thd, struct st_table_list *tables, Item **ref);
bool is_null();
@@ -105,8 +108,10 @@ public:
Item_in_optimizer return NULL, else it evaluate Item_in_subselect.
*/
longlong val_int();
+ void cleanup();
const char *func_name() const { return "<in_optimizer>"; }
Item_cache **get_cache() { return &cache; }
+ void keep_top_level_cache();
};
class Comp_creator
@@ -207,10 +212,14 @@ public:
}
void cleanup()
{
+ DBUG_ENTER("Item_bool_rowready_func2::cleanup");
Item_bool_func2::cleanup();
tmp_arg[0]= orig_a;
tmp_arg[1]= orig_b;
+ DBUG_VOID_RETURN;
}
+ Item *neg_transformer(THD *thd);
+ virtual Item *negated_item();
};
class Item_func_not :public Item_bool_func
@@ -220,7 +229,7 @@ public:
longlong val_int();
enum Functype functype() const { return NOT_FUNC; }
const char *func_name() const { return "not"; }
- Item *neg_transformer();
+ Item *neg_transformer(THD *thd);
};
class Item_func_not_all :public Item_func_not
@@ -247,7 +256,7 @@ public:
enum Functype rev_functype() const { return EQ_FUNC; }
cond_result eq_cmp_result() const { return COND_TRUE; }
const char *func_name() const { return "="; }
- Item *neg_transformer();
+ Item *negated_item();
};
class Item_func_equal :public Item_bool_rowready_func2
@@ -260,6 +269,7 @@ public:
enum Functype rev_functype() const { return EQUAL_FUNC; }
cond_result eq_cmp_result() const { return COND_TRUE; }
const char *func_name() const { return "<=>"; }
+ Item* neg_transformer(THD *thd) { return 0; }
};
@@ -272,7 +282,7 @@ public:
enum Functype rev_functype() const { return LE_FUNC; }
cond_result eq_cmp_result() const { return COND_TRUE; }
const char *func_name() const { return ">="; }
- Item *neg_transformer();
+ Item *negated_item();
};
@@ -285,7 +295,7 @@ public:
enum Functype rev_functype() const { return LT_FUNC; }
cond_result eq_cmp_result() const { return COND_FALSE; }
const char *func_name() const { return ">"; }
- Item *neg_transformer();
+ Item *negated_item();
};
@@ -298,7 +308,7 @@ public:
enum Functype rev_functype() const { return GE_FUNC; }
cond_result eq_cmp_result() const { return COND_TRUE; }
const char *func_name() const { return "<="; }
- Item *neg_transformer();
+ Item *negated_item();
};
@@ -311,7 +321,7 @@ public:
enum Functype rev_functype() const { return GT_FUNC; }
cond_result eq_cmp_result() const { return COND_FALSE; }
const char *func_name() const { return "<"; }
- Item *neg_transformer();
+ Item *negated_item();
};
@@ -324,7 +334,7 @@ public:
cond_result eq_cmp_result() const { return COND_FALSE; }
optimize_type select_optimize() const { return OPTIMIZE_KEY; }
const char *func_name() const { return "<>"; }
- Item *neg_transformer();
+ Item *negated_item();
};
@@ -402,6 +412,7 @@ public:
enum Item_result result_type () const { return cached_result_type; }
bool fix_fields(THD *thd,struct st_table_list *tlist, Item **ref)
{
+ DBUG_ASSERT(fixed == 0);
args[0]->top_level_item();
return Item_func::fix_fields(thd, tlist, ref);
}
@@ -718,10 +729,13 @@ class Item_func_in :public Item_int_func
void fix_length_and_dec();
void cleanup()
{
+ DBUG_ENTER("Item_func_in::cleanup");
+ Item_int_func::cleanup();
delete array;
delete in_item;
array= 0;
in_item= 0;
+ DBUG_VOID_RETURN;
}
optimize_type select_optimize() const
{ return array ? OPTIMIZE_KEY : OPTIMIZE_NONE; }
@@ -769,7 +783,7 @@ public:
}
table_map not_null_tables() const { return 0; }
optimize_type select_optimize() const { return OPTIMIZE_NULL; }
- Item *neg_transformer();
+ Item *neg_transformer(THD *thd);
CHARSET_INFO *compare_collation() { return args[0]->collation.collation; }
};
@@ -803,7 +817,7 @@ public:
const char *func_name() const { return "isnotnull"; }
optimize_type select_optimize() const { return OPTIMIZE_NULL; }
table_map not_null_tables() const { return 0; }
- Item *neg_transformer();
+ Item *neg_transformer(THD *thd);
void print(String *str);
CHARSET_INFO *compare_collation() { return args[0]->collation.collation; }
};
@@ -811,8 +825,6 @@ public:
class Item_func_like :public Item_bool_func2
{
- char escape;
-
// Turbo Boyer-Moore data
bool canDoTurboBM; // pattern is '%abcd%' case
const char* pattern;
@@ -829,10 +841,11 @@ class Item_func_like :public Item_bool_func2
enum { alphabet_size = 256 };
public:
+ char escape;
+
Item_func_like(Item *a,Item *b, char* escape_arg)
- :Item_bool_func2(a,b), escape(*escape_arg), canDoTurboBM(false),
- pattern(0), pattern_len(0), bmGs(0), bmBc(0)
- {}
+ :Item_bool_func2(a,b), canDoTurboBM(false), pattern(0), pattern_len(0),
+ bmGs(0), bmBc(0), escape(*escape_arg) {}
longlong val_int();
enum Functype functype() const { return LIKE_FUNC; }
optimize_type select_optimize() const;
@@ -912,7 +925,7 @@ public:
void top_level_item() { abort_on_null=1; }
void copy_andor_arguments(THD *thd, Item_cond *item);
bool walk(Item_processor processor, byte *arg);
- void neg_arguments();
+ void neg_arguments(THD *thd);
};
@@ -933,7 +946,7 @@ public:
item->copy_andor_arguments(thd, this);
return item;
}
- Item *neg_transformer();
+ Item *neg_transformer(THD *thd);
};
class Item_cond_or :public Item_cond
@@ -954,7 +967,7 @@ public:
item->copy_andor_arguments(thd, this);
return item;
}
- Item *neg_transformer();
+ Item *neg_transformer(THD *thd);
};
@@ -978,14 +991,11 @@ public:
/* Some usefull inline functions */
-inline Item *and_conds(Item *a,Item *b)
+inline Item *and_conds(Item *a, Item *b)
{
if (!b) return a;
if (!a) return b;
- Item *cond=new Item_cond_and(a,b);
- if (cond)
- cond->update_used_tables();
- return cond;
+ return new Item_cond_and(a, b);
}
Item *and_expressions(Item *a, Item *b, Item **org_item);
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 6519e242465..e314bfc3e2c 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -30,14 +30,14 @@ Item *create_func_acos(Item* a)
Item *create_func_aes_encrypt(Item* a, Item* b)
{
- return new Item_func_aes_encrypt(a, b);
+ return new Item_func_aes_encrypt(a, b);
}
-
+
Item *create_func_aes_decrypt(Item* a, Item* b)
{
return new Item_func_aes_decrypt(a, b);
}
-
+
Item *create_func_ascii(Item* a)
{
return new Item_func_ascii(a);
@@ -417,6 +417,16 @@ Item *create_func_ucase(Item* a)
return new Item_func_ucase(a);
}
+Item *create_func_unhex(Item* a)
+{
+ return new Item_func_unhex(a);
+}
+
+Item *create_func_uuid(void)
+{
+ return new Item_func_uuid();
+}
+
Item *create_func_version(void)
{
return new Item_string(NullS,server_version,
@@ -446,6 +456,7 @@ Item *create_func_cast(Item *a, Cast_target cast_type, int len,
{
Item *res;
LINT_INIT(res);
+
switch (cast_type) {
case ITEM_CAST_BINARY: res= new Item_func_binary(a); break;
case ITEM_CAST_SIGNED_INT: res= new Item_func_signed(a); break;
diff --git a/sql/item_create.h b/sql/item_create.h
index 5dc53fb04b8..d48aed5284a 100644
--- a/sql/item_create.h
+++ b/sql/item_create.h
@@ -91,6 +91,8 @@ Item *create_func_time_format(Item *a, Item *b);
Item *create_func_time_to_sec(Item* a);
Item *create_func_to_days(Item* a);
Item *create_func_ucase(Item* a);
+Item *create_func_unhex(Item* a);
+Item *create_func_uuid(void);
Item *create_func_version(void);
Item *create_func_weekday(Item* a);
Item *create_load_file(Item* a);
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 2a74f2801c0..c648b34efae 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -32,6 +32,16 @@
#include "sp_rcontext.h"
#include "sp.h"
+bool check_reserved_words(LEX_STRING *name)
+{
+ if (!my_strcasecmp(system_charset_info, name->str, "GLOBAL") ||
+ !my_strcasecmp(system_charset_info, name->str, "LOCAL") ||
+ !my_strcasecmp(system_charset_info, name->str, "SESSION"))
+ return TRUE;
+ return FALSE;
+}
+
+
static void my_coll_agg_error(DTCollation &c1, DTCollation &c2,
const char *fname)
{
@@ -192,6 +202,7 @@ Item_func::Item_func(THD *thd, Item_func *item)
bool
Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
{
+ DBUG_ASSERT(fixed == 0);
Item **arg,**arg_end;
#ifndef EMBEDDED_LIBRARY // Avoid compiler warning
char buff[STACK_BUFF_ALLOC]; // Max argument in function
@@ -207,8 +218,11 @@ Item_func::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
for (arg=args, arg_end=args+arg_count; arg != arg_end ; arg++)
{
Item *item;
- /* We can't yet set item to *arg as fix_fields may change *arg */
- if ((*arg)->fix_fields(thd, tables, arg) ||
+ /*
+ We can't yet set item to *arg as fix_fields may change *arg
+ We shouldn't call fix_fields() twice, so check 'fixed' field first
+ */
+ if ((!(*arg)->fixed && (*arg)->fix_fields(thd, tables, arg)) ||
(*arg)->check_cols(allowed_arg_cols))
return 1; /* purecov: inspected */
item= *arg;
@@ -373,6 +387,7 @@ Field *Item_func::tmp_table_field(TABLE *t_arg)
String *Item_real_func::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
double nr=val();
if (null_value)
return 0; /* purecov: inspected */
@@ -383,6 +398,7 @@ String *Item_real_func::val_str(String *str)
String *Item_num_func::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
if (hybrid_type == INT_RESULT)
{
longlong nr=val_int();
@@ -421,6 +437,7 @@ Item *Item_func::get_tmp_table_item(THD *thd)
String *Item_int_func::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
longlong nr=val_int();
if (null_value)
return 0;
@@ -448,6 +465,7 @@ void Item_num_op::find_num_type(void)
String *Item_num_op::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
if (hybrid_type == INT_RESULT)
{
longlong nr=val_int();
@@ -489,6 +507,7 @@ void Item_func_unsigned::print(String *str)
double Item_func_plus::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val()+args[1]->val();
if ((null_value=args[0]->null_value || args[1]->null_value))
return 0.0;
@@ -497,6 +516,7 @@ double Item_func_plus::val()
longlong Item_func_plus::val_int()
{
+ DBUG_ASSERT(fixed == 1);
if (hybrid_type == INT_RESULT)
{
longlong value=args[0]->val_int()+args[1]->val_int();
@@ -524,6 +544,7 @@ void Item_func_minus::fix_length_and_dec()
double Item_func_minus::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val() - args[1]->val();
if ((null_value=args[0]->null_value || args[1]->null_value))
return 0.0;
@@ -532,6 +553,7 @@ double Item_func_minus::val()
longlong Item_func_minus::val_int()
{
+ DBUG_ASSERT(fixed == 1);
if (hybrid_type == INT_RESULT)
{
longlong value=args[0]->val_int() - args[1]->val_int();
@@ -545,6 +567,7 @@ longlong Item_func_minus::val_int()
double Item_func_mul::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val()*args[1]->val();
if ((null_value=args[0]->null_value || args[1]->null_value))
return 0.0; /* purecov: inspected */
@@ -553,6 +576,7 @@ double Item_func_mul::val()
longlong Item_func_mul::val_int()
{
+ DBUG_ASSERT(fixed == 1);
if (hybrid_type == INT_RESULT)
{
longlong value=args[0]->val_int()*args[1]->val_int();
@@ -566,6 +590,7 @@ longlong Item_func_mul::val_int()
double Item_func_div::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val();
double val2=args[1]->val();
if ((null_value= val2 == 0.0 || args[0]->null_value || args[1]->null_value))
@@ -575,6 +600,7 @@ double Item_func_div::val()
longlong Item_func_div::val_int()
{
+ DBUG_ASSERT(fixed == 1);
if (hybrid_type == INT_RESULT)
{
longlong value=args[0]->val_int();
@@ -599,6 +625,7 @@ void Item_func_div::fix_length_and_dec()
/* Integer division */
longlong Item_func_int_div::val_int()
{
+ DBUG_ASSERT(fixed == 1);
longlong value=args[0]->val_int();
longlong val2=args[1]->val_int();
if ((null_value= val2 == 0 || args[0]->null_value || args[1]->null_value))
@@ -619,6 +646,7 @@ void Item_func_int_div::fix_length_and_dec()
double Item_func_mod::val()
{
+ DBUG_ASSERT(fixed == 1);
double value= floor(args[0]->val()+0.5);
double val2=floor(args[1]->val()+0.5);
if ((null_value=val2 == 0.0 || args[0]->null_value || args[1]->null_value))
@@ -628,6 +656,7 @@ double Item_func_mod::val()
longlong Item_func_mod::val_int()
{
+ DBUG_ASSERT(fixed == 1);
longlong value= args[0]->val_int();
longlong val2= args[1]->val_int();
if ((null_value=val2 == 0 || args[0]->null_value || args[1]->null_value))
@@ -646,6 +675,7 @@ void Item_func_mod::fix_length_and_dec()
double Item_func_neg::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val();
null_value=args[0]->null_value;
return -value;
@@ -654,6 +684,7 @@ double Item_func_neg::val()
longlong Item_func_neg::val_int()
{
+ DBUG_ASSERT(fixed == 1);
longlong value=args[0]->val_int();
null_value=args[0]->null_value;
return -value;
@@ -687,6 +718,7 @@ void Item_func_neg::fix_length_and_dec()
double Item_func_abs::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val();
null_value=args[0]->null_value;
return fabs(value);
@@ -695,6 +727,7 @@ double Item_func_abs::val()
longlong Item_func_abs::val_int()
{
+ DBUG_ASSERT(fixed == 1);
longlong value=args[0]->val_int();
null_value=args[0]->null_value;
return value >= 0 ? value : -value;
@@ -717,6 +750,7 @@ void Item_func_abs::fix_length_and_dec()
/* Gateway to natural LOG function */
double Item_func_ln::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val();
if ((null_value=(args[0]->null_value || value <= 0.0)))
return 0.0;
@@ -730,6 +764,7 @@ double Item_func_ln::val()
*/
double Item_func_log::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val();
if ((null_value=(args[0]->null_value || value <= 0.0)))
return 0.0;
@@ -745,6 +780,7 @@ double Item_func_log::val()
double Item_func_log2::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val();
if ((null_value=(args[0]->null_value || value <= 0.0)))
return 0.0;
@@ -753,6 +789,7 @@ double Item_func_log2::val()
double Item_func_log10::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val();
if ((null_value=(args[0]->null_value || value <= 0.0)))
return 0.0; /* purecov: inspected */
@@ -761,6 +798,7 @@ double Item_func_log10::val()
double Item_func_exp::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val();
if ((null_value=args[0]->null_value))
return 0.0; /* purecov: inspected */
@@ -769,6 +807,7 @@ double Item_func_exp::val()
double Item_func_sqrt::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val();
if ((null_value=(args[0]->null_value || value < 0)))
return 0.0; /* purecov: inspected */
@@ -777,6 +816,7 @@ double Item_func_sqrt::val()
double Item_func_pow::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val();
double val2=args[1]->val();
if ((null_value=(args[0]->null_value || args[1]->null_value)))
@@ -788,7 +828,9 @@ double Item_func_pow::val()
double Item_func_acos::val()
{
- double value=args[0]->val();
+ DBUG_ASSERT(fixed == 1);
+ // the volatile's for BUG #2338 to calm optimizer down (because of gcc's bug)
+ volatile double value=args[0]->val();
if ((null_value=(args[0]->null_value || (value < -1.0 || value > 1.0))))
return 0.0;
return fix_result(acos(value));
@@ -796,7 +838,9 @@ double Item_func_acos::val()
double Item_func_asin::val()
{
- double value=args[0]->val();
+ DBUG_ASSERT(fixed == 1);
+ // the volatile's for BUG #2338 to calm optimizer down (because of gcc's bug)
+ volatile double value=args[0]->val();
if ((null_value=(args[0]->null_value || (value < -1.0 || value > 1.0))))
return 0.0;
return fix_result(asin(value));
@@ -804,6 +848,7 @@ double Item_func_asin::val()
double Item_func_atan::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val();
if ((null_value=args[0]->null_value))
return 0.0;
@@ -819,6 +864,7 @@ double Item_func_atan::val()
double Item_func_cos::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val();
if ((null_value=args[0]->null_value))
return 0.0;
@@ -827,6 +873,7 @@ double Item_func_cos::val()
double Item_func_sin::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val();
if ((null_value=args[0]->null_value))
return 0.0;
@@ -835,6 +882,7 @@ double Item_func_sin::val()
double Item_func_tan::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val();
if ((null_value=args[0]->null_value))
return 0.0;
@@ -847,6 +895,7 @@ double Item_func_tan::val()
longlong Item_func_shift_left::val_int()
{
+ DBUG_ASSERT(fixed == 1);
uint shift;
ulonglong res= ((ulonglong) args[0]->val_int() <<
(shift=(uint) args[1]->val_int()));
@@ -861,6 +910,7 @@ longlong Item_func_shift_left::val_int()
longlong Item_func_shift_right::val_int()
{
+ DBUG_ASSERT(fixed == 1);
uint shift;
ulonglong res= (ulonglong) args[0]->val_int() >>
(shift=(uint) args[1]->val_int());
@@ -876,6 +926,7 @@ longlong Item_func_shift_right::val_int()
longlong Item_func_bit_neg::val_int()
{
+ DBUG_ASSERT(fixed == 1);
ulonglong res= (ulonglong) args[0]->val_int();
if ((null_value=args[0]->null_value))
return 0;
@@ -895,6 +946,7 @@ void Item_func_integer::fix_length_and_dec()
longlong Item_func_ceiling::val_int()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val();
null_value=args[0]->null_value;
return (longlong) ceil(value);
@@ -902,7 +954,9 @@ longlong Item_func_ceiling::val_int()
longlong Item_func_floor::val_int()
{
- double value=args[0]->val();
+ DBUG_ASSERT(fixed == 1);
+ // the volatile's for BUG #3051 to calm optimizer down (because of gcc's bug)
+ volatile double value=args[0]->val();
null_value=args[0]->null_value;
return (longlong) floor(value);
}
@@ -923,6 +977,7 @@ void Item_func_round::fix_length_and_dec()
double Item_func_round::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val();
int dec=(int) args[1]->val_int();
uint abs_dec=abs(dec);
@@ -955,6 +1010,7 @@ void Item_func_rand::fix_length_and_dec()
{
decimals=NOT_FIXED_DEC;
max_length=float_length(decimals);
+ used_tables_cache|= RAND_TABLE_BIT;
if (arg_count)
{ // Only use argument once in query
uint32 tmp= (uint32) (args[0]->val_int());
@@ -980,14 +1036,22 @@ void Item_func_rand::fix_length_and_dec()
}
}
+void Item_func_rand::update_used_tables()
+{
+ Item_real_func::update_used_tables();
+ used_tables_cache|= RAND_TABLE_BIT;
+}
+
double Item_func_rand::val()
{
+ DBUG_ASSERT(fixed == 1);
return my_rnd(rand);
}
longlong Item_func_sign::val_int()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val();
null_value=args[0]->null_value;
return value < 0.0 ? -1 : (value > 0 ? 1 : 0);
@@ -996,6 +1060,7 @@ longlong Item_func_sign::val_int()
double Item_func_units::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=args[0]->val();
if ((null_value=args[0]->null_value))
return 0;
@@ -1027,6 +1092,7 @@ void Item_func_min_max::fix_length_and_dec()
String *Item_func_min_max::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
switch (cmp_type) {
case INT_RESULT:
{
@@ -1080,7 +1146,6 @@ String *Item_func_min_max::val_str(String *str)
// This case should never be choosen
DBUG_ASSERT(0);
return 0;
-
}
return 0; // Keep compiler happy
}
@@ -1088,6 +1153,7 @@ String *Item_func_min_max::val_str(String *str)
double Item_func_min_max::val()
{
+ DBUG_ASSERT(fixed == 1);
double value=0.0;
null_value=1;
for (uint i=0; i < arg_count ; i++)
@@ -1110,6 +1176,7 @@ double Item_func_min_max::val()
longlong Item_func_min_max::val_int()
{
+ DBUG_ASSERT(fixed == 1);
longlong value=0;
null_value=1;
for (uint i=0; i < arg_count ; i++)
@@ -1131,6 +1198,7 @@ longlong Item_func_min_max::val_int()
longlong Item_func_length::val_int()
{
+ DBUG_ASSERT(fixed == 1);
String *res=args[0]->val_str(&value);
if (!res)
{
@@ -1144,6 +1212,7 @@ longlong Item_func_length::val_int()
longlong Item_func_char_length::val_int()
{
+ DBUG_ASSERT(fixed == 1);
String *res=args[0]->val_str(&value);
if (!res)
{
@@ -1157,6 +1226,7 @@ longlong Item_func_char_length::val_int()
longlong Item_func_coercibility::val_int()
{
+ DBUG_ASSERT(fixed == 1);
if (args[0]->null_value)
{
null_value= 1;
@@ -1176,6 +1246,7 @@ void Item_func_locate::fix_length_and_dec()
longlong Item_func_locate::val_int()
{
+ DBUG_ASSERT(fixed == 1);
String *a=args[0]->val_str(&value1);
String *b=args[1]->val_str(&value2);
if (!a || !b)
@@ -1226,6 +1297,7 @@ void Item_func_locate::print(String *str)
longlong Item_func_field::val_int()
{
+ DBUG_ASSERT(fixed == 1);
if (cmp_type == STRING_RESULT)
{
String *field;
@@ -1273,6 +1345,7 @@ void Item_func_field::fix_length_and_dec()
longlong Item_func_ascii::val_int()
{
+ DBUG_ASSERT(fixed == 1);
String *res=args[0]->val_str(&value);
if (!res)
{
@@ -1285,6 +1358,7 @@ longlong Item_func_ascii::val_int()
longlong Item_func_ord::val_int()
{
+ DBUG_ASSERT(fixed == 1);
String *res=args[0]->val_str(&value);
if (!res)
{
@@ -1339,6 +1413,7 @@ static const char separator=',';
longlong Item_func_find_in_set::val_int()
{
+ DBUG_ASSERT(fixed == 1);
if (enum_value)
{
ulonglong tmp=(ulonglong) args[1]->val_int();
@@ -1392,6 +1467,7 @@ longlong Item_func_find_in_set::val_int()
longlong Item_func_bit_count::val_int()
{
+ DBUG_ASSERT(fixed == 1);
ulonglong value= (ulonglong) args[0]->val_int();
if (args[0]->null_value)
{
@@ -1470,9 +1546,12 @@ udf_handler::fix_fields(THD *thd, TABLE_LIST *tables, Item_result_field *func,
arg != arg_end ;
arg++,i++)
{
+ if ((*arg)->fix_fields(thd, tables, arg))
+ DBUG_RETURN(1);
+ // we can't assign 'item' before, because fix_fields() can change arg
Item *item= *arg;
- if (item->fix_fields(thd, tables, arg) || item->check_cols(1))
- return 1;
+ if (item->check_cols(1))
+ DBUG_RETURN(1);
/*
TODO: We should think about this. It is not always
right way just to set an UDF result to return my_charset_bin
@@ -1668,6 +1747,7 @@ String *udf_handler::val_str(String *str,String *save_str)
double Item_func_udf_float::val()
{
+ DBUG_ASSERT(fixed == 1);
DBUG_ENTER("Item_func_udf_float::val");
DBUG_PRINT("info",("result_type: %d arg_count: %d",
args[0]->result_type(), arg_count));
@@ -1677,6 +1757,7 @@ double Item_func_udf_float::val()
String *Item_func_udf_float::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
double nr=val();
if (null_value)
return 0; /* purecov: inspected */
@@ -1687,6 +1768,7 @@ String *Item_func_udf_float::val_str(String *str)
longlong Item_func_udf_int::val_int()
{
+ DBUG_ASSERT(fixed == 1);
DBUG_ENTER("Item_func_udf_int::val_int");
DBUG_PRINT("info",("result_type: %d arg_count: %d",
args[0]->result_type(), arg_count));
@@ -1697,6 +1779,7 @@ longlong Item_func_udf_int::val_int()
String *Item_func_udf_int::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
longlong nr=val_int();
if (null_value)
return 0;
@@ -1720,6 +1803,7 @@ void Item_func_udf_str::fix_length_and_dec()
String *Item_func_udf_str::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res=udf.val_str(str,&str_value);
null_value = !res;
return res;
@@ -1736,7 +1820,7 @@ bool udf_handler::get_arguments() { return 0; }
pthread_mutex_t LOCK_user_locks;
static HASH hash_user_locks;
-class ULL
+class User_level_lock
{
char *key;
uint key_length;
@@ -1748,7 +1832,7 @@ public:
pthread_t thread;
ulong thread_id;
- ULL(const char *key_arg,uint length, ulong id)
+ User_level_lock(const char *key_arg,uint length, ulong id)
:key_length(length),count(1),locked(1), thread_id(id)
{
key=(char*) my_memdup((byte*) key_arg,length,MYF(0));
@@ -1762,7 +1846,7 @@ public:
}
}
}
- ~ULL()
+ ~User_level_lock()
{
if (key)
{
@@ -1772,11 +1856,12 @@ public:
pthread_cond_destroy(&cond);
}
inline bool initialized() { return key != 0; }
- friend void item_user_lock_release(ULL *ull);
- friend char *ull_get_key(const ULL *ull,uint *length,my_bool not_used);
+ friend void item_user_lock_release(User_level_lock *ull);
+ friend char *ull_get_key(const User_level_lock *ull, uint *length,
+ my_bool not_used);
};
-char *ull_get_key(const ULL *ull,uint *length,
+char *ull_get_key(const User_level_lock *ull, uint *length,
my_bool not_used __attribute__((unused)))
{
*length=(uint) ull->key_length;
@@ -1804,7 +1889,7 @@ void item_user_lock_free(void)
}
}
-void item_user_lock_release(ULL *ull)
+void item_user_lock_release(User_level_lock *ull)
{
ull->locked=0;
if (mysql_bin_log.is_open())
@@ -1832,6 +1917,7 @@ void item_user_lock_release(ULL *ull)
longlong Item_master_pos_wait::val_int()
{
+ DBUG_ASSERT(fixed == 1);
THD* thd = current_thd;
String *log_name = args[0]->val_str(&value);
int event_count= 0;
@@ -1845,13 +1931,11 @@ longlong Item_master_pos_wait::val_int()
longlong pos = (ulong)args[1]->val_int();
longlong timeout = (arg_count==3) ? args[2]->val_int() : 0 ;
#ifdef HAVE_REPLICATION
- LOCK_ACTIVE_MI;
- if ((event_count = active_mi->rli.wait_for_pos(thd, log_name, pos, timeout)) == -2)
- {
+ if ((event_count = active_mi->rli.wait_for_pos(thd, log_name, pos, timeout)) == -2)
+ {
null_value = 1;
event_count=0;
}
- UNLOCK_ACTIVE_MI;
#endif
return event_count;
}
@@ -1860,7 +1944,7 @@ longlong Item_master_pos_wait::val_int()
void debug_sync_point(const char* lock_name, uint lock_timeout)
{
THD* thd=current_thd;
- ULL* ull;
+ User_level_lock* ull;
struct timespec abstime;
int lock_name_len,error=0;
lock_name_len=strlen(lock_name);
@@ -1878,7 +1962,7 @@ void debug_sync_point(const char* lock_name, uint lock_timeout)
this case, we will not be waiting, but rather, just waste CPU and
memory on the whole deal
*/
- if (!(ull= ((ULL*) hash_search(&hash_user_locks,lock_name,
+ if (!(ull= ((User_level_lock*) hash_search(&hash_user_locks, lock_name,
lock_name_len))))
{
pthread_mutex_unlock(&LOCK_user_locks);
@@ -1935,11 +2019,12 @@ void debug_sync_point(const char* lock_name, uint lock_timeout)
longlong Item_func_get_lock::val_int()
{
+ DBUG_ASSERT(fixed == 1);
String *res=args[0]->val_str(&value);
longlong timeout=args[1]->val_int();
struct timespec abstime;
THD *thd=current_thd;
- ULL *ull;
+ User_level_lock *ull;
int error=0;
pthread_mutex_lock(&LOCK_user_locks);
@@ -1958,10 +2043,11 @@ longlong Item_func_get_lock::val_int()
thd->ull=0;
}
- if (!(ull= ((ULL*) hash_search(&hash_user_locks,(byte*) res->ptr(),
- res->length()))))
+ if (!(ull= ((User_level_lock *) hash_search(&hash_user_locks,
+ (byte*) res->ptr(),
+ res->length()))))
{
- ull=new ULL(res->ptr(),res->length(), thd->thread_id);
+ ull=new User_level_lock(res->ptr(),res->length(), thd->thread_id);
if (!ull || !ull->initialized())
{
delete ull;
@@ -2029,8 +2115,9 @@ longlong Item_func_get_lock::val_int()
longlong Item_func_release_lock::val_int()
{
+ DBUG_ASSERT(fixed == 1);
String *res=args[0]->val_str(&value);
- ULL *ull;
+ User_level_lock *ull;
longlong result;
if (!res || !res->length())
{
@@ -2041,8 +2128,9 @@ longlong Item_func_release_lock::val_int()
result=0;
pthread_mutex_lock(&LOCK_user_locks);
- if (!(ull= ((ULL*) hash_search(&hash_user_locks,(const byte*) res->ptr(),
- res->length()))))
+ if (!(ull= ((User_level_lock*) hash_search(&hash_user_locks,
+ (const byte*) res->ptr(),
+ res->length()))))
{
null_value=1;
}
@@ -2060,18 +2148,29 @@ longlong Item_func_release_lock::val_int()
}
-longlong Item_func_set_last_insert_id::val_int()
+longlong Item_func_last_insert_id::val_int()
{
- longlong value=args[0]->val_int();
- current_thd->insert_id(value);
- null_value=args[0]->null_value;
- return value;
+ DBUG_ASSERT(fixed == 1);
+ if (arg_count)
+ {
+ longlong value=args[0]->val_int();
+ current_thd->insert_id(value);
+ null_value=args[0]->null_value;
+ return value;
+ }
+ else
+ {
+ Item *it= get_system_var(current_thd, OPT_SESSION, "last_insert_id", 14,
+ "last_insert_id()");
+ return it->val_int();
+ }
}
/* This function is just used to test speed of different functions */
longlong Item_func_benchmark::val_int()
{
+ DBUG_ASSERT(fixed == 1);
char buff[MAX_FIELD_WIDTH];
String tmp(buff,sizeof(buff), &my_charset_bin);
THD *thd=current_thd;
@@ -2164,6 +2263,7 @@ static user_var_entry *get_variable(HASH *hash, LEX_STRING &name,
bool Item_func_set_user_var::fix_fields(THD *thd, TABLE_LIST *tables,
Item **ref)
{
+ DBUG_ASSERT(fixed == 0);
/* fix_fields will call Item_func_set_user_var::fix_length_and_dec */
if (Item_func::fix_fields(thd, tables, ref) ||
!(entry= get_variable(&thd->user_vars, name, 1)))
@@ -2264,7 +2364,7 @@ double user_var_entry::val(my_bool *null_value)
case INT_RESULT:
return (double) *(longlong*) value;
case STRING_RESULT:
- return atof(value); // This is null terminated
+ return my_atof(value); // This is null terminated
case ROW_RESULT:
DBUG_ASSERT(1); // Impossible
break;
@@ -2351,7 +2451,6 @@ Item_func_set_user_var::check()
save_result.vint= args[0]->val_int();
break;
}
- break;
case STRING_RESULT:
{
save_result.vstr= args[0]->val_str(&value);
@@ -2403,7 +2502,6 @@ Item_func_set_user_var::update()
INT_RESULT, &my_charset_bin, DERIVATION_NONE);
break;
}
- break;
case STRING_RESULT:
{
if (!save_result.vstr) // Null value
@@ -2428,6 +2526,7 @@ Item_func_set_user_var::update()
double Item_func_set_user_var::val()
{
+ DBUG_ASSERT(fixed == 1);
check();
update(); // Store expression
return entry->val(&null_value);
@@ -2435,6 +2534,7 @@ double Item_func_set_user_var::val()
longlong Item_func_set_user_var::val_int()
{
+ DBUG_ASSERT(fixed == 1);
check();
update(); // Store expression
return entry->val_int(&null_value);
@@ -2442,6 +2542,7 @@ longlong Item_func_set_user_var::val_int()
String *Item_func_set_user_var::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
check();
update(); // Store expression
return entry->val_str(&null_value, str, decimals);
@@ -2461,6 +2562,7 @@ void Item_func_set_user_var::print(String *str)
String *
Item_func_get_user_var::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
DBUG_ENTER("Item_func_get_user_var::val_str");
if (!var_entry)
DBUG_RETURN((String*) 0); // No such variable
@@ -2470,6 +2572,7 @@ Item_func_get_user_var::val_str(String *str)
double Item_func_get_user_var::val()
{
+ DBUG_ASSERT(fixed == 1);
if (!var_entry)
return 0.0; // No such variable
return (var_entry->val(&null_value));
@@ -2478,6 +2581,7 @@ double Item_func_get_user_var::val()
longlong Item_func_get_user_var::val_int()
{
+ DBUG_ASSERT(fixed == 1);
if (!var_entry)
return LL(0); // No such variable
return (var_entry->val_int(&null_value));
@@ -2624,6 +2728,7 @@ bool Item_func_get_user_var::eq(const Item *item, bool binary_cmp) const
longlong Item_func_inet_aton::val_int()
{
+ DBUG_ASSERT(fixed == 1);
uint byte_result = 0;
ulonglong result = 0; // We are ready for 64 bit addresses
const char *p,* end;
@@ -2691,6 +2796,13 @@ void Item_func_match::init_search(bool no_order)
fields.push_back(args[i]);
concat=new Item_func_concat_ws(new Item_string(" ",1,
cmp_collation.collation), fields);
+ /*
+ Above function used only to get value and do not need fix_fields for it:
+ Item_string - basic constant
+ fields - fix_fields() was already called for this arguments
+ Item_func_concat_ws - do not need fix_fields() to produce value
+ */
+ concat->quick_fix_field();
}
if (master)
@@ -2733,6 +2845,7 @@ void Item_func_match::init_search(bool no_order)
bool Item_func_match::fix_fields(THD *thd, TABLE_LIST *tlist, Item **ref)
{
+ DBUG_ASSERT(fixed == 0);
Item *item;
LINT_INIT(item); // Safe as arg_count is > 1
@@ -2877,6 +2990,7 @@ bool Item_func_match::eq(const Item *item, bool binary_cmp) const
double Item_func_match::val()
{
+ DBUG_ASSERT(fixed == 1);
DBUG_ENTER("Item_func_match::val");
if (ft_handler == NULL)
DBUG_RETURN(-1.0);
@@ -2919,6 +3033,7 @@ void Item_func_match::print(String *str)
longlong Item_func_bit_xor::val_int()
{
+ DBUG_ASSERT(fixed == 1);
ulonglong arg1= (ulonglong) args[0]->val_int();
ulonglong arg2= (ulonglong) args[1]->val_int();
if ((null_value= (args[0]->null_value || args[1]->null_value)))
@@ -3047,9 +3162,10 @@ Item *get_system_var(THD *thd, enum_var_type var_type, const char *var_name,
longlong Item_func_is_free_lock::val_int()
{
+ DBUG_ASSERT(fixed == 1);
String *res=args[0]->val_str(&value);
THD *thd=current_thd;
- ULL *ull;
+ User_level_lock *ull;
null_value=0;
if (!res || !res->length())
@@ -3059,7 +3175,7 @@ longlong Item_func_is_free_lock::val_int()
}
pthread_mutex_lock(&LOCK_user_locks);
- ull= (ULL*) hash_search(&hash_user_locks,(byte*) res->ptr(),
+ ull= (User_level_lock *) hash_search(&hash_user_locks, (byte*) res->ptr(),
res->length());
pthread_mutex_unlock(&LOCK_user_locks);
if (!ull || !ull->locked)
@@ -3069,16 +3185,17 @@ longlong Item_func_is_free_lock::val_int()
longlong Item_func_is_used_lock::val_int()
{
+ DBUG_ASSERT(fixed == 1);
String *res=args[0]->val_str(&value);
THD *thd=current_thd;
- ULL *ull;
+ User_level_lock *ull;
null_value=1;
if (!res || !res->length())
return 0;
pthread_mutex_lock(&LOCK_user_locks);
- ull= (ULL*) hash_search(&hash_user_locks,(byte*) res->ptr(),
+ ull= (User_level_lock *) hash_search(&hash_user_locks, (byte*) res->ptr(),
res->length());
pthread_mutex_unlock(&LOCK_user_locks);
if (!ull || !ull->locked)
diff --git a/sql/item_func.h b/sql/item_func.h
index 6d313a8ea66..435615531b2 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -47,7 +47,7 @@ public:
SP_CONTAINS_FUNC,SP_OVERLAPS_FUNC,
SP_STARTPOINT,SP_ENDPOINT,SP_EXTERIORRING,
SP_POINTN,SP_GEOMETRYN,SP_INTERIORRINGN,
- NOT_FUNC, NOT_ALL_FUNC,
+ NOT_FUNC, NOT_ALL_FUNC, NOW_FUNC,
GUSERVAR_FUNC};
enum optimize_type { OPTIMIZE_NONE,OPTIMIZE_KEY,OPTIMIZE_OP, OPTIMIZE_NULL };
enum Type type() const { return FUNC_ITEM; }
@@ -156,7 +156,7 @@ public:
Item_real_func(Item *a,Item *b) :Item_func(a,b) {}
Item_real_func(List<Item> &list) :Item_func(list) {}
String *val_str(String*str);
- longlong val_int() { return (longlong) val(); }
+ longlong val_int() { DBUG_ASSERT(fixed == 1); return (longlong) val(); }
enum Item_result result_type () const { return REAL_RESULT; }
void fix_length_and_dec() { decimals=NOT_FIXED_DEC; max_length=float_length(decimals); }
};
@@ -170,7 +170,7 @@ public:
Item_num_func(Item *a) :Item_func(a),hybrid_type(REAL_RESULT) {}
Item_num_func(Item *a,Item *b) :Item_func(a,b),hybrid_type(REAL_RESULT) {}
String *val_str(String*str);
- longlong val_int() { return (longlong) val(); }
+ longlong val_int() { DBUG_ASSERT(fixed == 1); return (longlong) val(); }
enum Item_result result_type () const { return hybrid_type; }
void fix_length_and_dec() { fix_num_length_and_dec(); }
bool is_null() { (void) val(); return null_value; }
@@ -201,7 +201,7 @@ public:
Item_int_func(Item *a,Item *b,Item *c) :Item_func(a,b,c) { max_length=21; }
Item_int_func(List<Item> &list) :Item_func(list) { max_length=21; }
Item_int_func(THD *thd, Item_int_func *item) :Item_func(thd, item) {}
- double val() { return (double) val_int(); }
+ double val() { DBUG_ASSERT(fixed == 1); return (double) val_int(); }
String *val_str(String*str);
enum Item_result result_type () const { return INT_RESULT; }
void fix_length_and_dec() {}
@@ -286,7 +286,7 @@ class Item_func_int_div :public Item_num_op
public:
Item_func_int_div(Item *a,Item *b) :Item_num_op(a,b)
{ hybrid_type=INT_RESULT; }
- double val() { return (double) val_int(); }
+ double val() { DBUG_ASSERT(fixed == 1); return (double) val_int(); }
longlong val_int();
const char *func_name() const { return "DIV"; }
void fix_length_and_dec();
@@ -513,7 +513,7 @@ public:
double val();
const char *func_name() const { return "rand"; }
bool const_item() const { return 0; }
- table_map used_tables() const { return RAND_TABLE_BIT; }
+ void update_used_tables();
void fix_length_and_dec();
};
@@ -585,7 +585,8 @@ class Item_func_bit_length :public Item_func_length
{
public:
Item_func_bit_length(Item *a) :Item_func_length(a) {}
- longlong val_int() { return Item_func_length::val_int()*8; }
+ longlong val_int()
+ { DBUG_ASSERT(fixed == 1); return Item_func_length::val_int()*8; }
const char *func_name() const { return "bit_length"; }
};
@@ -729,13 +730,14 @@ public:
};
-class Item_func_set_last_insert_id :public Item_int_func
+class Item_func_last_insert_id :public Item_int_func
{
public:
- Item_func_set_last_insert_id(Item *a) :Item_int_func(a) {}
+ Item_func_last_insert_id() :Item_int_func() {}
+ Item_func_last_insert_id(Item *a) :Item_int_func(a) {}
longlong val_int();
const char *func_name() const { return "last_insert_id"; }
- void fix_length_and_dec() { max_length=args[0]->max_length; }
+ void fix_length_and_dec() { if (arg_count) max_length= args[0]->max_length; }
};
class Item_func_benchmark :public Item_int_func
@@ -766,6 +768,7 @@ public:
const char *func_name() const { return udf.name(); }
bool fix_fields(THD *thd, struct st_table_list *tables, Item **ref)
{
+ DBUG_ASSERT(fixed == 0);
bool res= udf.fix_fields(thd, tables, this, arg_count, args);
used_tables_cache= udf.used_tables_cache;
const_item_cache= udf.const_item_cache;
@@ -783,7 +786,8 @@ class Item_func_udf_float :public Item_udf_func
Item_func_udf_float(udf_func *udf_arg) :Item_udf_func(udf_arg) {}
Item_func_udf_float(udf_func *udf_arg, List<Item> &list)
:Item_udf_func(udf_arg,list) {}
- longlong val_int() { return (longlong) Item_func_udf_float::val(); }
+ longlong val_int()
+ { DBUG_ASSERT(fixed == 1); return (longlong) Item_func_udf_float::val(); }
double val();
String *val_str(String *str);
void fix_length_and_dec() { fix_num_length_and_dec(); }
@@ -834,7 +838,7 @@ class Item_func_udf_float :public Item_real_func
public:
Item_func_udf_float(udf_func *udf_arg) :Item_real_func() {}
Item_func_udf_float(udf_func *udf_arg, List<Item> &list) :Item_real_func(list) {}
- double val() { return 0.0; }
+ double val() { DBUG_ASSERT(fixed == 1); return 0.0; }
};
@@ -843,7 +847,7 @@ class Item_func_udf_int :public Item_int_func
public:
Item_func_udf_int(udf_func *udf_arg) :Item_int_func() {}
Item_func_udf_int(udf_func *udf_arg, List<Item> &list) :Item_int_func(list) {}
- longlong val_int() { return 0; }
+ longlong val_int() { DBUG_ASSERT(fixed == 1); return 0; }
};
@@ -852,9 +856,10 @@ class Item_func_udf_str :public Item_func
public:
Item_func_udf_str(udf_func *udf_arg) :Item_func() {}
Item_func_udf_str(udf_func *udf_arg, List<Item> &list) :Item_func(list) {}
- String *val_str(String *) { null_value=1; return 0; }
- double val() { null_value=1; return 0.0; }
- longlong val_int() { null_value=1; return 0; }
+ String *val_str(String *)
+ { DBUG_ASSERT(fixed == 1); null_value=1; return 0; }
+ double val() { DBUG_ASSERT(fixed == 1); null_value=1; return 0.0; }
+ longlong val_int() { DBUG_ASSERT(fixed == 1); null_value=1; return 0; }
enum Item_result result_type () const { return STRING_RESULT; }
void fix_length_and_dec() { maybe_null=1; max_length=0; }
};
@@ -865,9 +870,9 @@ public:
** User level locks
*/
-class ULL;
+class User_level_lock;
void item_user_lock_init(void);
-void item_user_lock_release(ULL *ull);
+void item_user_lock_release(User_level_lock *ull);
void item_user_lock_free(void);
class Item_func_get_lock :public Item_int_func
@@ -1002,6 +1007,8 @@ public:
join_key(0), ft_handler(0), table(0), master(0), concat(0) { }
void cleanup()
{
+ DBUG_ENTER("Item_func_match");
+ Item_real_func::cleanup();
if (!master && ft_handler)
{
ft_handler->please->close_search(ft_handler);
@@ -1011,7 +1018,11 @@ public:
table->fulltext_searched=0;
}
if (concat)
+ {
delete concat;
+ concat= 0;
+ }
+ DBUG_VOID_RETURN;
}
enum Functype functype() const { return FT_FUNC; }
const char *func_name() const { return "match"; }
@@ -1019,7 +1030,7 @@ public:
table_map not_null_tables() const { return 0; }
bool fix_fields(THD *thd, struct st_table_list *tlist, Item **ref);
bool eq(const Item *, bool binary_cmp) const;
- longlong val_int() { return val()!=0.0; }
+ longlong val_int() { DBUG_ASSERT(fixed == 1); return val()!=0.0; }
double val();
void print(String *str);
diff --git a/sql/item_geofunc.cc b/sql/item_geofunc.cc
index 6934ad9d3b0..555c1a74eaf 100644
--- a/sql/item_geofunc.cc
+++ b/sql/item_geofunc.cc
@@ -27,24 +27,28 @@
#include "sql_acl.h"
#include <m_ctype.h>
+
String *Item_func_geometry_from_text::val_str(String *str)
{
- Geometry geom;
+ DBUG_ASSERT(fixed == 1);
+ Geometry_buffer buffer;
String arg_val;
String *wkt= args[0]->val_str(&arg_val);
- GTextReadStream trs(wkt->ptr(), wkt->length());
- uint32 srid;
+
+ if ((null_value= args[0]->null_value))
+ return 0;
+
+ Gis_read_stream trs(wkt->charset(), wkt->ptr(), wkt->length());
+ uint32 srid= 0;
if ((arg_count == 2) && !args[1]->null_value)
srid= (uint32)args[1]->val_int();
- else
- srid= 0;
if (str->reserve(SRID_SIZE, 512))
return 0;
str->length(0);
str->q_append(srid);
- if ((null_value=(args[0]->null_value || geom.create_from_wkt(&trs, str, 0))))
+ if ((null_value= !Geometry::create_from_wkt(&buffer, &trs, str, 0)))
return 0;
return str;
}
@@ -58,25 +62,24 @@ void Item_func_geometry_from_text::fix_length_and_dec()
String *Item_func_geometry_from_wkb::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String arg_val;
String *wkb= args[0]->val_str(&arg_val);
- Geometry geom;
- uint32 srid;
+ Geometry_buffer buffer;
+ uint32 srid= 0;
if ((arg_count == 2) && !args[1]->null_value)
srid= (uint32)args[1]->val_int();
- else
- srid= 0;
if (str->reserve(SRID_SIZE, 512))
return 0;
str->length(0);
str->q_append(srid);
- if ((null_value= (args[0]->null_value ||
- geom.create_from_wkb(wkb->ptr(), wkb->length()))))
+ if ((null_value=
+ (args[0]->null_value ||
+ !Geometry::create_from_wkb(&buffer, wkb->ptr(), wkb->length()) ||
+ str->append(*wkb))))
return 0;
-
- str->append(*wkb);
return str;
}
@@ -89,37 +92,44 @@ void Item_func_geometry_from_wkb::fix_length_and_dec()
String *Item_func_as_wkt::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String arg_val;
String *swkb= args[0]->val_str(&arg_val);
- Geometry geom;
-
- if ((null_value= (args[0]->null_value ||
- geom.create_from_wkb(swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE))))
+ Geometry_buffer buffer;
+ Geometry *geom= NULL;
+ const char *dummy;
+
+ if ((null_value=
+ (args[0]->null_value ||
+ !(geom= Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE,
+ swkb->length() - SRID_SIZE)))))
return 0;
str->length(0);
-
- if ((null_value= geom.as_wkt(str)))
+ if ((null_value= geom->as_wkt(str, &dummy)))
return 0;
return str;
}
+
void Item_func_as_wkt::fix_length_and_dec()
{
max_length=MAX_BLOB_WIDTH;
}
+
String *Item_func_as_wkb::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String arg_val;
String *swkb= args[0]->val_str(&arg_val);
- Geometry geom;
+ Geometry_buffer buffer;
- if ((null_value= (args[0]->null_value ||
- geom.create_from_wkb(swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE))))
+ if ((null_value=
+ (args[0]->null_value ||
+ !(Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE,
+ swkb->length() - SRID_SIZE)))))
return 0;
str->copy(swkb->ptr() + SRID_SIZE, swkb->length() - SRID_SIZE,
@@ -127,66 +137,78 @@ String *Item_func_as_wkb::val_str(String *str)
return str;
}
+
void Item_func_as_wkb::fix_length_and_dec()
{
max_length= MAX_BLOB_WIDTH;
}
+
String *Item_func_geometry_type::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *swkb= args[0]->val_str(str);
- Geometry geom;
+ Geometry_buffer buffer;
+ Geometry *geom= NULL;
- if ((null_value= (args[0]->null_value ||
- geom.create_from_wkb(swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE))))
+ if ((null_value=
+ (args[0]->null_value ||
+ !(geom= Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE,
+ swkb->length() - SRID_SIZE)))))
return 0;
- str->copy(geom.get_class_info()->m_name,
- strlen(geom.get_class_info()->m_name),
- default_charset());
+ /* String will not move */
+ str->set(geom->get_class_info()->m_name.str,
+ geom->get_class_info()->m_name.length,
+ default_charset());
return str;
}
String *Item_func_envelope::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String arg_val;
String *swkb= args[0]->val_str(&arg_val);
- Geometry geom;
+ Geometry_buffer buffer;
+ Geometry *geom= NULL;
+ uint32 srid;
- if ((null_value= args[0]->null_value ||
- geom.create_from_wkb(swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE)))
+ if ((null_value=
+ args[0]->null_value ||
+ !(geom= Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE,
+ swkb->length() - SRID_SIZE))))
return 0;
- uint32 srid= uint4korr(swkb->ptr());
+ srid= uint4korr(swkb->ptr());
str->length(0);
if (str->reserve(SRID_SIZE, 512))
return 0;
str->q_append(srid);
- return (null_value= geom.envelope(str)) ? 0 : str;
+ return (null_value= geom->envelope(str)) ? 0 : str;
}
String *Item_func_centroid::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String arg_val;
String *swkb= args[0]->val_str(&arg_val);
- Geometry geom;
+ Geometry_buffer buffer;
+ Geometry *geom= NULL;
+ uint32 srid;
if ((null_value= args[0]->null_value ||
- geom.create_from_wkb(swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE) ||
- !GEOM_METHOD_PRESENT(geom, centroid)))
+ !(geom= Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE,
+ swkb->length() - SRID_SIZE))))
return 0;
if (str->reserve(SRID_SIZE, 512))
return 0;
str->length(0);
- uint32 srid= uint4korr(swkb->ptr());
+ srid= uint4korr(swkb->ptr());
str->q_append(srid);
- return (null_value= geom.centroid(str)) ? 0 : str;
+ return (null_value= test(geom->centroid(str))) ? 0 : str;
}
@@ -196,91 +218,97 @@ String *Item_func_centroid::val_str(String *str)
String *Item_func_spatial_decomp::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String arg_val;
String *swkb= args[0]->val_str(&arg_val);
- Geometry geom;
+ Geometry_buffer buffer;
+ Geometry *geom= NULL;
+ uint32 srid;
- if ((null_value= (args[0]->null_value ||
- geom.create_from_wkb(swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE))))
+ if ((null_value=
+ (args[0]->null_value ||
+ !(geom= Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE,
+ swkb->length() - SRID_SIZE)))))
return 0;
- null_value= 1;
+ srid= uint4korr(swkb->ptr());
if (str->reserve(SRID_SIZE, 512))
- return 0;
+ goto err;
str->length(0);
- uint32 srid= uint4korr(swkb->ptr());
str->q_append(srid);
- switch(decomp_func)
- {
+ switch (decomp_func) {
case SP_STARTPOINT:
- if (!GEOM_METHOD_PRESENT(geom,start_point) || geom.start_point(str))
- goto ret;
+ if (geom->start_point(str))
+ goto err;
break;
case SP_ENDPOINT:
- if (!GEOM_METHOD_PRESENT(geom,end_point) || geom.end_point(str))
- goto ret;
+ if (geom->end_point(str))
+ goto err;
break;
case SP_EXTERIORRING:
- if (!GEOM_METHOD_PRESENT(geom,exterior_ring) || geom.exterior_ring(str))
- goto ret;
+ if (geom->exterior_ring(str))
+ goto err;
break;
default:
- goto ret;
+ goto err;
}
- null_value= 0;
+ return str;
-ret:
- return null_value ? 0 : str;
+err:
+ null_value= 1;
+ return 0;
}
String *Item_func_spatial_decomp_n::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String arg_val;
String *swkb= args[0]->val_str(&arg_val);
long n= (long) args[1]->val_int();
- Geometry geom;
+ Geometry_buffer buffer;
+ Geometry *geom= NULL;
+ uint32 srid;
- if ((null_value= (args[0]->null_value || args[1]->null_value ||
- geom.create_from_wkb(swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE))))
+ if ((null_value=
+ (args[0]->null_value || args[1]->null_value ||
+ !(geom= Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE,
+ swkb->length() - SRID_SIZE)))))
return 0;
- null_value= 1;
if (str->reserve(SRID_SIZE, 512))
- return 0;
+ goto err;
+ srid= uint4korr(swkb->ptr());
str->length(0);
- uint32 srid= uint4korr(swkb->ptr());
str->q_append(srid);
- switch(decomp_func_n)
+ switch (decomp_func_n)
{
case SP_POINTN:
- if (!GEOM_METHOD_PRESENT(geom,point_n) || geom.point_n(n,str))
- goto ret;
+ if (geom->point_n(n,str))
+ goto err;
break;
case SP_GEOMETRYN:
- if (!GEOM_METHOD_PRESENT(geom,geometry_n) || geom.geometry_n(n,str))
- goto ret;
+ if (geom->geometry_n(n,str))
+ goto err;
break;
case SP_INTERIORRINGN:
- if (!GEOM_METHOD_PRESENT(geom,interior_ring_n) ||
- geom.interior_ring_n(n,str))
- goto ret;
+ if (geom->interior_ring_n(n,str))
+ goto err;
break;
default:
- goto ret;
+ goto err;
}
- null_value= 0;
+ return str;
-ret:
- return null_value ? 0 : str;
+err:
+ null_value=1;
+ return 0;
}
@@ -296,17 +324,18 @@ ret:
String *Item_func_point::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
double x= args[0]->val();
double y= args[1]->val();
- if ( (null_value= (args[0]->null_value ||
- args[1]->null_value ||
- str->realloc(1 + 4 + 8 + 8))))
+ if ((null_value= (args[0]->null_value ||
+ args[1]->null_value ||
+ str->realloc(1 + 4 + SIZEOF_STORED_DOUBLE*2))))
return 0;
str->length(0);
- str->q_append((char)Geometry::wkbNDR);
- str->q_append((uint32)Geometry::wkbPoint);
+ str->q_append((char)Geometry::wkb_ndr);
+ str->q_append((uint32)Geometry::wkb_point);
str->q_append(x);
str->q_append(y);
return str;
@@ -325,16 +354,15 @@ String *Item_func_point::val_str(String *str)
String *Item_func_spatial_collection::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String arg_value;
uint i;
- null_value= 1;
-
str->length(0);
if (str->reserve(1 + 4 + 4, 512))
- return 0;
+ goto err;
- str->q_append((char) Geometry::wkbNDR);
+ str->q_append((char) Geometry::wkb_ndr);
str->q_append((uint32) coll_type);
str->q_append((uint32) arg_count);
@@ -342,19 +370,16 @@ String *Item_func_spatial_collection::val_str(String *str)
{
String *res= args[i]->val_str(&arg_value);
if (args[i]->null_value)
- goto ret;
+ goto err;
- if ( coll_type == Geometry::wkbGeometryCollection )
+ if (coll_type == Geometry::wkb_geometrycollection)
{
/*
- In the case of GeometryCollection we don't need
- any checkings for item types, so just copy them
- into target collection
+ In the case of GeometryCollection we don't need any checkings
+ for item types, so just copy them into target collection
*/
- if ((null_value= str->reserve(res->length(), 512)))
- goto ret;
-
- str->q_append(res->ptr(), res->length());
+ if (str->append(res->ptr(), res->length(), (uint32) 512))
+ goto err;
}
else
{
@@ -363,109 +388,101 @@ String *Item_func_spatial_collection::val_str(String *str)
const char *data= res->ptr() + 1;
/*
- In the case of named collection we must to
- check that items are of specific type, let's
- do this checking now
+ In the case of named collection we must to check that items
+ are of specific type, let's do this checking now
*/
if (len < 5)
- goto ret;
+ goto err;
wkb_type= (Geometry::wkbType) uint4korr(data);
data+= 4;
len-= 5;
if (wkb_type != item_type)
- goto ret;
+ goto err;
switch (coll_type) {
- case Geometry::wkbMultiPoint:
- case Geometry::wkbMultiLineString:
- case Geometry::wkbMultiPolygon:
- if (len < WKB_HEADER_SIZE)
- goto ret;
-
- data-= WKB_HEADER_SIZE;
- len+= WKB_HEADER_SIZE;
- if (str->reserve(len, 512))
- goto ret;
- str->q_append(data, len);
+ case Geometry::wkb_multipoint:
+ case Geometry::wkb_multilinestring:
+ case Geometry::wkb_multipolygon:
+ if (len < WKB_HEADER_SIZE ||
+ str->append(data-WKB_HEADER_SIZE, len+WKB_HEADER_SIZE, 512))
+ goto err;
break;
- case Geometry::wkbLineString:
- if (str->reserve(POINT_DATA_SIZE, 512))
- goto ret;
- str->q_append(data, POINT_DATA_SIZE);
+ case Geometry::wkb_linestring:
+ if (str->append(data, POINT_DATA_SIZE, 512))
+ goto err;
break;
-
- case Geometry::wkbPolygon:
+ case Geometry::wkb_polygon:
{
uint32 n_points;
double x1, y1, x2, y2;
+ const char *org_data= data;
if (len < 4 + 2 * POINT_DATA_SIZE)
- goto ret;
-
- uint32 llen= len;
- const char *ldata= data;
+ goto err;
n_points= uint4korr(data);
data+= 4;
float8get(x1, data);
- data+= 8;
+ data+= SIZEOF_STORED_DOUBLE;
float8get(y1, data);
- data+= 8;
+ data+= SIZEOF_STORED_DOUBLE;
data+= (n_points - 2) * POINT_DATA_SIZE;
float8get(x2, data);
- float8get(y2, data + 8);
-
- if ((x1 != x2) || (y1 != y2))
- goto ret;
+ float8get(y2, data + SIZEOF_STORED_DOUBLE);
- if (str->reserve(llen, 512))
- goto ret;
- str->q_append(ldata, llen);
+ if ((x1 != x2) || (y1 != y2) ||
+ str->append(org_data, len, 512))
+ goto err;
}
break;
default:
- goto ret;
+ goto err;
}
}
}
-
if (str->length() > current_thd->variables.max_allowed_packet)
- goto ret;
+ goto err;
null_value = 0;
+ return str;
-ret:
- return null_value ? 0 : str;
+err:
+ null_value= 1;
+ return 0;
}
+
/*
Functions for spatial relations
*/
longlong Item_func_spatial_rel::val_int()
{
+ DBUG_ASSERT(fixed == 1);
String *res1= args[0]->val_str(&tmp_value1);
String *res2= args[1]->val_str(&tmp_value2);
- Geometry g1, g2;
+ Geometry_buffer buffer1, buffer2;
+ Geometry *g1, *g2;
MBR mbr1, mbr2;
-
- if ((null_value= (args[0]->null_value ||
- args[1]->null_value ||
- g1.create_from_wkb(res1->ptr() + SRID_SIZE,
- res1->length() - SRID_SIZE) ||
- g2.create_from_wkb(res2->ptr() + SRID_SIZE,
- res2->length() - SRID_SIZE) ||
- g1.get_mbr(&mbr1) ||
- g2.get_mbr(&mbr2))))
+ const char *dummy;
+
+ if ((null_value=
+ (args[0]->null_value ||
+ args[1]->null_value ||
+ !(g1= Geometry::create_from_wkb(&buffer1, res1->ptr() + SRID_SIZE,
+ res1->length() - SRID_SIZE)) ||
+ !(g2= Geometry::create_from_wkb(&buffer2, res2->ptr() + SRID_SIZE,
+ res2->length() - SRID_SIZE)) ||
+ g1->get_mbr(&mbr1, &dummy) ||
+ g2->get_mbr(&mbr2, &dummy))))
return 0;
- switch (spatial_rel)
- {
+ switch (spatial_rel) {
case SP_CONTAINS_FUNC:
return mbr1.contains(&mbr2);
case SP_WITHIN_FUNC:
@@ -490,37 +507,44 @@ longlong Item_func_spatial_rel::val_int()
return 0;
}
+
longlong Item_func_isempty::val_int()
{
+ DBUG_ASSERT(fixed == 1);
String tmp;
null_value=0;
return args[0]->null_value ? 1 : 0;
}
+
longlong Item_func_issimple::val_int()
{
+ DBUG_ASSERT(fixed == 1);
String tmp;
String *wkb=args[0]->val_str(&tmp);
- if ((null_value= (!wkb || args[0]->null_value )))
+ if ((null_value= (!wkb || args[0]->null_value)))
return 0;
/* TODO: Ramil or Holyfoot, add real IsSimple calculation */
return 0;
}
+
longlong Item_func_isclosed::val_int()
{
+ DBUG_ASSERT(fixed == 1);
String tmp;
String *swkb= args[0]->val_str(&tmp);
- Geometry geom;
- int isclosed;
+ Geometry_buffer buffer;
+ Geometry *geom;
+ int isclosed= 0; // In case of error
null_value= (!swkb ||
args[0]->null_value ||
- geom.create_from_wkb(swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE) ||
- !GEOM_METHOD_PRESENT(geom,is_closed) ||
- geom.is_closed(&isclosed));
+ !(geom=
+ Geometry::create_from_wkb(&buffer, swkb->ptr() + SRID_SIZE,
+ swkb->length() - SRID_SIZE)) ||
+ geom->is_closed(&isclosed));
return (longlong) isclosed;
}
@@ -529,129 +553,160 @@ longlong Item_func_isclosed::val_int()
Numerical functions
*/
+
longlong Item_func_dimension::val_int()
{
- uint32 dim;
+ DBUG_ASSERT(fixed == 1);
+ uint32 dim= 0; // In case of error
String *swkb= args[0]->val_str(&value);
- Geometry geom;
+ Geometry_buffer buffer;
+ Geometry *geom;
+ const char *dummy;
null_value= (!swkb ||
args[0]->null_value ||
- geom.create_from_wkb(swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE) ||
- geom.dimension(&dim));
+ !(geom= Geometry::create_from_wkb(&buffer,
+ swkb->ptr() + SRID_SIZE,
+ swkb->length() - SRID_SIZE)) ||
+ geom->dimension(&dim, &dummy));
return (longlong) dim;
}
+
longlong Item_func_numinteriorring::val_int()
{
- uint32 num;
+ DBUG_ASSERT(fixed == 1);
+ uint32 num= 0; // In case of error
String *swkb= args[0]->val_str(&value);
- Geometry geom;
+ Geometry_buffer buffer;
+ Geometry *geom;
null_value= (!swkb ||
- geom.create_from_wkb(swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE) ||
- !GEOM_METHOD_PRESENT(geom, num_interior_ring) ||
- geom.num_interior_ring(&num));
+ !(geom= Geometry::create_from_wkb(&buffer,
+ swkb->ptr() + SRID_SIZE,
+ swkb->length() - SRID_SIZE)) ||
+ geom->num_interior_ring(&num));
return (longlong) num;
}
+
longlong Item_func_numgeometries::val_int()
{
- uint32 num= 0;
+ DBUG_ASSERT(fixed == 1);
+ uint32 num= 0; // In case of errors
String *swkb= args[0]->val_str(&value);
- Geometry geom;
+ Geometry_buffer buffer;
+ Geometry *geom;
null_value= (!swkb ||
- geom.create_from_wkb(swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE) ||
- !GEOM_METHOD_PRESENT(geom, num_geometries) ||
- geom.num_geometries(&num));
+ !(geom= Geometry::create_from_wkb(&buffer,
+ swkb->ptr() + SRID_SIZE,
+ swkb->length() - SRID_SIZE)) ||
+ geom->num_geometries(&num));
return (longlong) num;
}
+
longlong Item_func_numpoints::val_int()
{
- uint32 num;
+ DBUG_ASSERT(fixed == 1);
+ uint32 num= 0; // In case of errors
String *swkb= args[0]->val_str(&value);
- Geometry geom;
+ Geometry_buffer buffer;
+ Geometry *geom;
null_value= (!swkb ||
args[0]->null_value ||
- geom.create_from_wkb(swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE) ||
- !GEOM_METHOD_PRESENT(geom, num_points) ||
- geom.num_points(&num));
+ !(geom= Geometry::create_from_wkb(&buffer,
+ swkb->ptr() + SRID_SIZE,
+ swkb->length() - SRID_SIZE)) ||
+ geom->num_points(&num));
return (longlong) num;
}
+
double Item_func_x::val()
{
- double res;
+ DBUG_ASSERT(fixed == 1);
+ double res= 0.0; // In case of errors
String *swkb= args[0]->val_str(&value);
- Geometry geom;
+ Geometry_buffer buffer;
+ Geometry *geom;
null_value= (!swkb ||
- geom.create_from_wkb(swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE) ||
- !GEOM_METHOD_PRESENT(geom, get_x) ||
- geom.get_x(&res));
+ !(geom= Geometry::create_from_wkb(&buffer,
+ swkb->ptr() + SRID_SIZE,
+ swkb->length() - SRID_SIZE)) ||
+ geom->get_x(&res));
return res;
}
+
double Item_func_y::val()
{
- double res;
+ DBUG_ASSERT(fixed == 1);
+ double res= 0; // In case of errors
String *swkb= args[0]->val_str(&value);
- Geometry geom;
+ Geometry_buffer buffer;
+ Geometry *geom;
null_value= (!swkb ||
- geom.create_from_wkb(swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE) ||
- !GEOM_METHOD_PRESENT(geom, get_y) ||
- geom.get_y(&res));
+ !(geom= Geometry::create_from_wkb(&buffer,
+ swkb->ptr() + SRID_SIZE,
+ swkb->length() - SRID_SIZE)) ||
+ geom->get_y(&res));
return res;
}
+
double Item_func_area::val()
{
- double res;
+ DBUG_ASSERT(fixed == 1);
+ double res= 0; // In case of errors
String *swkb= args[0]->val_str(&value);
- Geometry geom;
+ Geometry_buffer buffer;
+ Geometry *geom;
+ const char *dummy;
null_value= (!swkb ||
- geom.create_from_wkb(swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE) ||
- !GEOM_METHOD_PRESENT(geom, area) ||
- geom.area(&res));
+ !(geom= Geometry::create_from_wkb(&buffer,
+ swkb->ptr() + SRID_SIZE,
+ swkb->length() - SRID_SIZE)) ||
+ geom->area(&res, &dummy));
return res;
}
double Item_func_glength::val()
{
- double res;
+ DBUG_ASSERT(fixed == 1);
+ double res= 0; // In case of errors
String *swkb= args[0]->val_str(&value);
- Geometry geom;
+ Geometry_buffer buffer;
+ Geometry *geom;
null_value= (!swkb ||
- geom.create_from_wkb(swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE) ||
- !GEOM_METHOD_PRESENT(geom, length) ||
- geom.length(&res));
+ !(geom= Geometry::create_from_wkb(&buffer,
+ swkb->ptr() + SRID_SIZE,
+ swkb->length() - SRID_SIZE)) ||
+ geom->length(&res));
return res;
}
longlong Item_func_srid::val_int()
{
+ DBUG_ASSERT(fixed == 1);
String *swkb= args[0]->val_str(&value);
- Geometry geom;
+ Geometry_buffer buffer;
+ Geometry *geom;
null_value= (!swkb ||
- geom.create_from_wkb(swkb->ptr() + SRID_SIZE,
- swkb->length() - SRID_SIZE));
- uint32 res= uint4korr(swkb->ptr());
- return (longlong) res;
+ !Geometry::create_from_wkb(&buffer,
+ swkb->ptr() + SRID_SIZE,
+ swkb->length() - SRID_SIZE));
+ if (null_value)
+ return 0;
+
+ return (longlong) (uint4korr(swkb->ptr()));
}
#endif /*HAVE_SPATIAL*/
diff --git a/sql/item_geofunc.h b/sql/item_geofunc.h
index 545052807ec..a1f36130152 100644
--- a/sql/item_geofunc.h
+++ b/sql/item_geofunc.h
@@ -23,8 +23,6 @@
#pragma interface /* gcc class implementation */
#endif
-#define SRID_SIZE sizeof(uint32)
-
class Item_func_geometry_from_text: public Item_str_func
{
public:
diff --git a/sql/item_row.cc b/sql/item_row.cc
index 7f847bd1d4e..c7e4bc0acf4 100644
--- a/sql/item_row.cc
+++ b/sql/item_row.cc
@@ -55,6 +55,7 @@ void Item_row::illegal_method_call(const char *method)
bool Item_row::fix_fields(THD *thd, TABLE_LIST *tabl, Item **ref)
{
+ DBUG_ASSERT(fixed == 0);
null_value= 0;
maybe_null= 0;
Item **arg, **arg_end;
@@ -62,20 +63,23 @@ bool Item_row::fix_fields(THD *thd, TABLE_LIST *tabl, Item **ref)
{
if ((*arg)->fix_fields(thd, tabl, arg))
return 1;
- used_tables_cache |= (*arg)->used_tables();
- if (const_item_cache&= (*arg)->const_item() && !with_null)
+ // we can't assign 'item' before, because fix_fields() can change arg
+ Item *item= *arg;
+ used_tables_cache |= item->used_tables();
+ if (const_item_cache&= item->const_item() && !with_null)
{
- if ((*arg)->cols() > 1)
- with_null|= (*arg)->null_inside();
+ if (item->cols() > 1)
+ with_null|= item->null_inside();
else
{
- (*arg)->val_int();
- with_null|= (*arg)->null_value;
+ item->val_int();
+ with_null|= item->null_value;
}
}
- maybe_null|= (*arg)->maybe_null;
- with_sum_func= with_sum_func || (*arg)->with_sum_func;
+ maybe_null|= item->maybe_null;
+ with_sum_func= with_sum_func || item->with_sum_func;
}
+ fixed= 1;
return 0;
}
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index ed6e44262c7..933995c1d22 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -60,6 +60,7 @@ uint nr_of_decimals(const char *str)
double Item_str_func::val()
{
+ DBUG_ASSERT(fixed == 1);
int err;
String *res;
res=val_str(&str_value);
@@ -69,15 +70,20 @@ double Item_str_func::val()
longlong Item_str_func::val_int()
{
+ DBUG_ASSERT(fixed == 1);
int err;
String *res;
res=val_str(&str_value);
- return res ? my_strntoll(res->charset(),res->ptr(),res->length(),10,NULL,&err) : (longlong) 0;
+ return (res ?
+ my_strntoll(res->charset(), res->ptr(), res->length(), 10, NULL,
+ &err) :
+ (longlong) 0);
}
String *Item_func_md5::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String * sptr= args[0]->val_str(str);
if (sptr)
{
@@ -115,6 +121,7 @@ void Item_func_md5::fix_length_and_dec()
String *Item_func_sha::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String * sptr= args[0]->val_str(str);
if (sptr) /* If we got value different from NULL */
{
@@ -155,6 +162,7 @@ void Item_func_sha::fix_length_and_dec()
String *Item_func_aes_encrypt::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
char key_buff[80];
String tmp_key_value(key_buff, sizeof(key_buff), system_charset_info);
String *sptr= args[0]->val_str(str); // String to encrypt
@@ -190,6 +198,7 @@ void Item_func_aes_encrypt::fix_length_and_dec()
String *Item_func_aes_decrypt::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
char key_buff[80];
String tmp_key_value(key_buff, sizeof(key_buff), system_charset_info);
String *sptr, *key;
@@ -234,6 +243,7 @@ void Item_func_aes_decrypt::fix_length_and_dec()
String *Item_func_concat::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res,*res2,*use_as_buff;
uint i;
@@ -350,6 +360,7 @@ void Item_func_concat::fix_length_and_dec()
String *Item_func_des_encrypt::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
#ifdef HAVE_OPENSSL
DES_cblock ivec;
struct st_des_keyblock keyblock;
@@ -432,6 +443,7 @@ error:
String *Item_func_des_decrypt::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
#ifdef HAVE_OPENSSL
DES_key_schedule ks1, ks2, ks3;
DES_cblock ivec;
@@ -503,6 +515,7 @@ error:
String *Item_func_concat_ws::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
char tmp_str_buff[10];
String tmp_sep_str(tmp_str_buff, sizeof(tmp_str_buff),default_charset_info),
*sep_str, *res, *res2,*use_as_buff;
@@ -628,9 +641,11 @@ void Item_func_concat_ws::fix_length_and_dec()
max_length=separator->max_length*(arg_count-1);
for (uint i=0 ; i < arg_count ; i++)
{
+ DTCollation tmp(collation.collation, collation.derivation);
max_length+=args[i]->max_length;
if (collation.aggregate(args[i]->collation))
{
+ collation.set(tmp); // Restore the previous value
my_coll_agg_error(collation, args[i]->collation, func_name());
break;
}
@@ -668,6 +683,7 @@ void Item_func_concat_ws::print(String *str)
String *Item_func_reverse::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res = args[0]->val_str(str);
char *ptr,*end;
@@ -725,6 +741,7 @@ void Item_func_reverse::fix_length_and_dec()
String *Item_func_replace::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res,*res2,*res3;
int offset;
uint from_length,to_length;
@@ -845,6 +862,7 @@ void Item_func_replace::fix_length_and_dec()
String *Item_func_insert::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res,*res2;
uint start,length;
@@ -892,6 +910,7 @@ void Item_func_insert::fix_length_and_dec()
String *Item_func_lcase::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res;
if (!(res=args[0]->val_str(str)))
{
@@ -907,6 +926,7 @@ String *Item_func_lcase::val_str(String *str)
String *Item_func_ucase::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res;
if (!(res=args[0]->val_str(str)))
{
@@ -922,6 +942,7 @@ String *Item_func_ucase::val_str(String *str)
String *Item_func_left::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res =args[0]->val_str(str);
long length =(long) args[1]->val_int();
@@ -966,6 +987,7 @@ void Item_func_left::fix_length_and_dec()
String *Item_func_right::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res =args[0]->val_str(str);
long length =(long) args[1]->val_int();
@@ -994,6 +1016,7 @@ void Item_func_right::fix_length_and_dec()
String *Item_func_substr::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res = args[0]->val_str(str);
int32 start = (int32) args[1]->val_int();
int32 length = arg_count == 3 ? (int32) args[2]->val_int() : INT_MAX32;
@@ -1033,7 +1056,7 @@ void Item_func_substr::fix_length_and_dec()
}
if (arg_count == 3 && args[2]->const_item())
{
- int32 length= (int32) args[2]->val_int() * default_charset_info->mbmaxlen;
+ int32 length= (int32) args[2]->val_int() * collation.collation->mbmaxlen;
if (length <= 0)
max_length=0; /* purecov: inspected */
else
@@ -1053,6 +1076,7 @@ void Item_func_substr_index::fix_length_and_dec()
String *Item_func_substr_index::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res =args[0]->val_str(str);
String *delimeter =args[1]->val_str(&tmp_value);
int32 count = (int32) args[2]->val_int();
@@ -1164,6 +1188,7 @@ String *Item_func_substr_index::val_str(String *str)
String *Item_func_ltrim::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res =args[0]->val_str(str);
if ((null_value=args[0]->null_value))
return 0; /* purecov: inspected */
@@ -1202,6 +1227,7 @@ String *Item_func_ltrim::val_str(String *str)
String *Item_func_rtrim::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res =args[0]->val_str(str);
if ((null_value=args[0]->null_value))
return 0; /* purecov: inspected */
@@ -1274,6 +1300,7 @@ String *Item_func_rtrim::val_str(String *str)
String *Item_func_trim::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res =args[0]->val_str(str);
if ((null_value=args[0]->null_value))
return 0; /* purecov: inspected */
@@ -1346,6 +1373,7 @@ void Item_func_trim::fix_length_and_dec()
String *Item_func_password::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res= args[0]->val_str(str);
if ((null_value=args[0]->null_value))
return 0;
@@ -1368,6 +1396,7 @@ char *Item_func_password::alloc(THD *thd, const char *password)
String *Item_func_old_password::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res= args[0]->val_str(str);
if ((null_value=args[0]->null_value))
return 0;
@@ -1391,6 +1420,7 @@ char *Item_func_old_password::alloc(THD *thd, const char *password)
String *Item_func_encrypt::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res =args[0]->val_str(str);
#ifdef HAVE_CRYPT
@@ -1435,6 +1465,7 @@ void Item_func_encode::fix_length_and_dec()
String *Item_func_encode::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res;
if (!(res=args[0]->val_str(str)))
{
@@ -1450,6 +1481,7 @@ String *Item_func_encode::val_str(String *str)
String *Item_func_decode::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res;
if (!(res=args[0]->val_str(str)))
{
@@ -1466,6 +1498,7 @@ String *Item_func_decode::val_str(String *str)
String *Item_func_database::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
THD *thd= current_thd;
if (!thd->db)
{
@@ -1481,6 +1514,7 @@ String *Item_func_database::val_str(String *str)
String *Item_func_user::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
THD *thd=current_thd;
CHARSET_INFO *cs= system_charset_info;
const char *host= thd->host_or_ip;
@@ -1531,6 +1565,7 @@ static char get_scode(CHARSET_INFO *cs,char *ptr)
String *Item_func_soundex::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res =args[0]->val_str(str);
char last_ch,ch;
CHARSET_INFO *cs= collation.collation;
@@ -1591,6 +1626,7 @@ Item_func_format::Item_func_format(Item *org,int dec) :Item_str_func(org)
String *Item_func_format::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
double nr =args[0]->val();
uint32 diff,length,str_length;
uint dec;
@@ -1599,10 +1635,8 @@ String *Item_func_format::val_str(String *str)
dec= decimals ? decimals+1 : 0;
/* Here default_charset() is right as this is not an automatic conversion */
str->set(nr,decimals, default_charset());
-#ifdef HAVE_ISNAN
if (isnan(nr))
return str;
-#endif
str_length=str->length();
if (nr < 0)
str_length--; // Don't count sign
@@ -1663,6 +1697,7 @@ void Item_func_elt::fix_length_and_dec()
double Item_func_elt::val()
{
+ DBUG_ASSERT(fixed == 1);
uint tmp;
null_value=1;
if ((tmp=(uint) args[0]->val_int()) == 0 || tmp >= arg_count)
@@ -1675,6 +1710,7 @@ double Item_func_elt::val()
longlong Item_func_elt::val_int()
{
+ DBUG_ASSERT(fixed == 1);
uint tmp;
null_value=1;
if ((tmp=(uint) args[0]->val_int()) == 0 || tmp >= arg_count)
@@ -1688,6 +1724,7 @@ longlong Item_func_elt::val_int()
String *Item_func_elt::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
uint tmp;
null_value=1;
if ((tmp=(uint) args[0]->val_int()) == 0 || tmp >= arg_count)
@@ -1745,6 +1782,7 @@ void Item_func_make_set::update_used_tables()
String *Item_func_make_set::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
ulonglong bits;
bool first_found=0;
Item **ptr=args;
@@ -1810,6 +1848,7 @@ void Item_func_make_set::print(String *str)
String *Item_func_char::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
str->length(0);
for (uint i=0 ; i < arg_count ; i++)
{
@@ -1884,6 +1923,7 @@ void Item_func_repeat::fix_length_and_dec()
String *Item_func_repeat::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
uint length,tot_length;
char *to;
long count= (long) args[1]->val_int();
@@ -1946,6 +1986,7 @@ void Item_func_rpad::fix_length_and_dec()
String *Item_func_rpad::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
uint32 res_byte_length,res_char_length,pad_char_length,pad_byte_length;
char *to;
const char *ptr_pad;
@@ -2022,6 +2063,7 @@ void Item_func_lpad::fix_length_and_dec()
String *Item_func_lpad::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
uint32 res_char_length,pad_char_length;
ulong count= (long) args[1]->val_int(), byte_count;
String *res= args[0]->val_str(&tmp_value);
@@ -2071,6 +2113,7 @@ err:
String *Item_func_conv::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res= args[0]->val_str(str);
char *endptr,ans[65],*ptr;
longlong dec;
@@ -2099,6 +2142,7 @@ String *Item_func_conv::val_str(String *str)
String *Item_func_conv_charset::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *arg= args[0]->val_str(str);
if (!arg)
{
@@ -2126,6 +2170,7 @@ void Item_func_conv_charset::print(String *str)
String *Item_func_set_collation::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
str=args[0]->val_str(str);
if ((null_value=args[0]->null_value))
return 0;
@@ -2185,6 +2230,7 @@ bool Item_func_set_collation::eq(const Item *item, bool binary_cmp) const
String *Item_func_charset::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res = args[0]->val_str(str);
if ((null_value=(args[0]->null_value || !res->charset())))
@@ -2196,6 +2242,7 @@ String *Item_func_charset::val_str(String *str)
String *Item_func_collation::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res = args[0]->val_str(str);
if ((null_value=(args[0]->null_value || !res->charset())))
@@ -2208,6 +2255,7 @@ String *Item_func_collation::val_str(String *str)
String *Item_func_hex::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
if (args[0]->result_type() != STRING_RESULT)
{
/* Return hex of unsigned longlong value */
@@ -2233,7 +2281,7 @@ String *Item_func_hex::val_str(String *str)
null_value=0;
tmp_value.length(res->length()*2);
for (from=res->ptr(), end=from+res->length(), to= (char*) tmp_value.ptr();
- from != end ;
+ from < end ;
from++, to+=2)
{
uint tmp=(uint) (uchar) *from;
@@ -2243,6 +2291,49 @@ String *Item_func_hex::val_str(String *str)
return &tmp_value;
}
+inline int hexchar_to_int(char c)
+{
+ if (c <= '9' && c >= '0')
+ return c-'0';
+ c|=32;
+ if (c <= 'f' && c >= 'a')
+ return c-'a'+10;
+ return -1;
+}
+
+String *Item_func_unhex::val_str(String *str)
+{
+ DBUG_ASSERT(fixed == 1);
+ /* Convert given hex string to a binary string */
+ String *res= args[0]->val_str(str);
+ const char *from=res->ptr(), *end;
+ char *to;
+ int r;
+ if (!res || tmp_value.alloc((1+res->length())/2))
+ {
+ null_value=1;
+ return 0;
+ }
+ null_value=0;
+ tmp_value.length((1+res->length())/2);
+ to= (char*) tmp_value.ptr();
+ if (res->length() % 2)
+ {
+ *to++= r= hexchar_to_int(*from++);
+ if ((null_value= (r == -1)))
+ return 0;
+ }
+ for (end=res->ptr()+res->length(); from < end ; from+=2, to++)
+ {
+ *to= (r= hexchar_to_int(from[0])) << 4;
+ if ((null_value= (r == -1)))
+ return 0;
+ *to|= r= hexchar_to_int(from[1]);
+ if ((null_value= (r == -1)))
+ return 0;
+ }
+ return &tmp_value;
+}
void Item_func_binary::print(String *str)
{
@@ -2256,6 +2347,7 @@ void Item_func_binary::print(String *str)
String *Item_load_file::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *file_name;
File file;
MY_STAT stat_info;
@@ -2299,6 +2391,7 @@ err:
String* Item_func_export_set::val_str(String* str)
{
+ DBUG_ASSERT(fixed == 1);
ulonglong the_set = (ulonglong) args[0]->val_int();
String yes_buf, *yes;
yes = args[1]->val_str(&yes_buf);
@@ -2368,6 +2461,7 @@ void Item_func_export_set::fix_length_and_dec()
String* Item_func_inet_ntoa::val_str(String* str)
{
+ DBUG_ASSERT(fixed == 1);
uchar buf[8], *p;
ulonglong n = (ulonglong) args[0]->val_int();
char num[4];
@@ -2427,6 +2521,7 @@ String* Item_func_inet_ntoa::val_str(String* str)
String *Item_func_quote::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
/*
Bit mask that has 1 for set for the position of the following characters:
0, \, ' and ^Z
@@ -2501,6 +2596,7 @@ null:
longlong Item_func_uncompressed_length::val_int()
{
+ DBUG_ASSERT(fixed == 1);
String *res= args[0]->val_str(&value);
if (!res)
{
@@ -2522,6 +2618,7 @@ longlong Item_func_uncompressed_length::val_int()
longlong Item_func_crc32::val_int()
{
+ DBUG_ASSERT(fixed == 1);
String *res=args[0]->val_str(&value);
if (!res)
{
@@ -2537,6 +2634,7 @@ longlong Item_func_crc32::val_int()
String *Item_func_compress::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res= args[0]->val_str(str);
if (!res)
{
@@ -2556,7 +2654,7 @@ String *Item_func_compress::val_str(String *str)
size of the destination buffer, which must be at least 0.1% larger than
sourceLen plus 12 bytes.
- Proportion 120/100 founded by Sinica with help of procedure
+ Proportion 120/100 founded by Sinisa with help of procedure
compress(compress(compress(...)))
I.e. zlib give number 'at least'..
*/
@@ -2594,6 +2692,7 @@ String *Item_func_compress::val_str(String *str)
String *Item_func_uncompress::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res= args[0]->val_str(str);
ulong new_size;
int err;
@@ -2632,3 +2731,113 @@ err:
return 0;
}
#endif
+
+/*
+ UUID, as in
+ DCE 1.1: Remote Procedure Call,
+ Open Group Technical Standard Document Number C706, October 1997,
+ (supersedes C309 DCE: Remote Procedure Call 8/1994,
+ which was basis for ISO/IEC 11578:1996 specification)
+*/
+
+static struct rand_struct uuid_rand;
+static uint nanoseq;
+static ulonglong uuid_time=0;
+static char clock_seq_and_node_str[]="-0000-000000000000";
+
+/* we cannot use _dig_vec[] as letters should be lowercase */
+static const char hex[] = "0123456789abcdef";
+
+/* number of 100-nanosecond intervals between
+ 1582-10-15 00:00:00.00 and 1970-01-01 00:00:00.00 */
+#define UUID_TIME_OFFSET ((ulonglong) 141427 * 24 * 60 * 60 * 1000 * 10 )
+
+#define UUID_VERSION 0x1000
+#define UUID_VARIANT 0x8000
+
+static void tohex(char *to, uint from, uint len)
+{
+ to+= len;
+ while (len--)
+ {
+ *--to= hex[from & 15];
+ from >>= 4;
+ }
+}
+
+static void set_clock_seq_str()
+{
+ uint16 clock_seq= ((uint)(my_rnd(&uuid_rand)*16383)) | UUID_VARIANT;
+ tohex(clock_seq_and_node_str+1, clock_seq, 4);
+ nanoseq= 0;
+}
+
+String *Item_func_uuid::val_str(String *str)
+{
+ DBUG_ASSERT(fixed == 1);
+ char *s;
+ pthread_mutex_lock(&LOCK_uuid_generator);
+ if (! uuid_time) /* first UUID() call. initializing data */
+ {
+ ulong tmp=sql_rnd_with_mutex();
+ uchar mac[6];
+ int i;
+ if (my_gethwaddr(mac))
+ {
+ /*
+ generating random "hardware addr"
+ and because specs explicitly specify that it should NOT correlate
+ with a clock_seq value (initialized random below), we use a separate
+ randominit() here
+ */
+ randominit(&uuid_rand, tmp + (ulong)current_thd, tmp + query_id);
+ for (i=0; i < (int)sizeof(mac); i++)
+ mac[i]=(uchar)(my_rnd(&uuid_rand)*255);
+ }
+ s=clock_seq_and_node_str+sizeof(clock_seq_and_node_str)-1;
+ for (i=sizeof(mac)-1 ; i>=0 ; i--)
+ {
+ *--s=hex[mac[i] & 15];
+ *--s=hex[mac[i] >> 4];
+ }
+ randominit(&uuid_rand, tmp + (ulong)start_time, tmp + bytes_sent);
+ set_clock_seq_str();
+ }
+
+ ulonglong tv=my_getsystime() + UUID_TIME_OFFSET + nanoseq;
+ if (unlikely(tv < uuid_time))
+ set_clock_seq_str();
+ else
+ if (unlikely(tv == uuid_time))
+ { /* special protection from low-res system clocks */
+ nanoseq++;
+ tv++;
+ }
+ else
+ {
+ if (nanoseq)
+ {
+ tv-=nanoseq;
+ nanoseq=0;
+ }
+ DBUG_ASSERT(tv > uuid_time);
+ }
+ uuid_time=tv;
+ pthread_mutex_unlock(&LOCK_uuid_generator);
+
+ uint32 time_low= tv & 0xFFFFFFFF;
+ uint16 time_mid= (tv >> 32) & 0xFFFF;
+ uint16 time_hi_and_version= (tv >> 48) | UUID_VERSION;
+
+ str->realloc(UUID_LENGTH+1);
+ str->length(UUID_LENGTH);
+ str->set_charset(system_charset_info);
+ s=(char *) str->ptr();
+ s[8]=s[13]='-';
+ tohex(s, time_low, 8);
+ tohex(s+9, time_mid, 4);
+ tohex(s+14, time_hi_and_version, 4);
+ strmov(s+18, clock_seq_and_node_str);
+ return str;
+}
+
diff --git a/sql/item_strfunc.h b/sql/item_strfunc.h
index 4832ddbd1b1..22134733393 100644
--- a/sql/item_strfunc.h
+++ b/sql/item_strfunc.h
@@ -100,6 +100,7 @@ public:
void update_used_tables();
bool fix_fields(THD *thd, TABLE_LIST *tlist, Item **ref)
{
+ DBUG_ASSERT(fixed == 0);
return (separator->fix_fields(thd, tlist, &separator) ||
separator->check_cols(1) ||
Item_func::fix_fields(thd, tlist, ref));
@@ -153,7 +154,7 @@ class Item_str_conv :public Item_str_func
public:
Item_str_conv(Item *item) :Item_str_func(item) {}
void fix_length_and_dec()
- {
+ {
collation.set(args[0]->collation);
max_length = args[0]->max_length;
}
@@ -411,6 +412,7 @@ public:
String *val_str(String *str);
bool fix_fields(THD *thd, TABLE_LIST *tlist, Item **ref)
{
+ DBUG_ASSERT(fixed == 0);
return (item->fix_fields(thd, tlist, &item) ||
item->check_cols(1) ||
Item_func::fix_fields(thd, tlist, ref));
@@ -500,10 +502,10 @@ public:
Item_func_conv(Item *a,Item *b,Item *c) :Item_str_func(a,b,c) {}
const char *func_name() const { return "conv"; }
String *val_str(String *);
- void fix_length_and_dec()
- {
+ void fix_length_and_dec()
+ {
collation.set(default_charset());
- decimals=0; max_length=64;
+ decimals=0; max_length=64;
}
};
@@ -515,14 +517,29 @@ public:
Item_func_hex(Item *a) :Item_str_func(a) {}
const char *func_name() const { return "hex"; }
String *val_str(String *);
- void fix_length_and_dec()
- {
+ void fix_length_and_dec()
+ {
collation.set(default_charset());
decimals=0;
max_length=args[0]->max_length*2*collation.collation->mbmaxlen;
}
};
+class Item_func_unhex :public Item_str_func
+{
+ String tmp_value;
+public:
+ Item_func_unhex(Item *a) :Item_str_func(a) {}
+ const char *func_name() const { return "unhex"; }
+ String *val_str(String *);
+ void fix_length_and_dec()
+ {
+ collation.set(&my_charset_bin);
+ decimals=0;
+ max_length=(1+args[0]->max_length)/2;
+ }
+};
+
class Item_func_binary :public Item_str_func
{
@@ -530,16 +547,17 @@ public:
Item_func_binary(Item *a) :Item_str_func(a) {}
String *val_str(String *a)
{
+ DBUG_ASSERT(fixed == 1);
String *tmp=args[0]->val_str(a);
null_value=args[0]->null_value;
if (tmp)
tmp->set_charset(&my_charset_bin);
return tmp;
}
- void fix_length_and_dec()
- {
- collation.set(&my_charset_bin);
- max_length=args[0]->max_length;
+ void fix_length_and_dec()
+ {
+ collation.set(&my_charset_bin);
+ max_length=args[0]->max_length;
}
void print(String *str);
};
@@ -553,7 +571,7 @@ public:
String *val_str(String *);
const char *func_name() const { return "load_file"; }
void fix_length_and_dec()
- {
+ {
collation.set(&my_charset_bin, DERIVATION_COERCIBLE);
maybe_null=1;
max_length=MAX_BLOB_WIDTH;
@@ -589,10 +607,10 @@ public:
Item_func_quote(Item *a) :Item_str_func(a) {}
const char *func_name() const { return "quote"; }
String *val_str(String *);
- void fix_length_and_dec()
- {
+ void fix_length_and_dec()
+ {
collation.set(args[0]->collation);
- max_length= args[0]->max_length * 2 + 2;
+ max_length= args[0]->max_length * 2 + 2;
}
};
@@ -600,7 +618,7 @@ class Item_func_conv_charset :public Item_str_func
{
CHARSET_INFO *conv_charset;
public:
- Item_func_conv_charset(Item *a, CHARSET_INFO *cs) :Item_str_func(a)
+ Item_func_conv_charset(Item *a, CHARSET_INFO *cs) :Item_str_func(a)
{ conv_charset=cs; }
String *val_str(String *);
void fix_length_and_dec();
@@ -625,7 +643,7 @@ public:
Item_func_charset(Item *a) :Item_str_func(a) {}
String *val_str(String *);
const char *func_name() const { return "charset"; }
- void fix_length_and_dec()
+ void fix_length_and_dec()
{
collation.set(system_charset_info);
max_length= 64 * collation.collation->mbmaxlen; // should be enough
@@ -691,3 +709,16 @@ public:
String *val_str(String *) ZLIB_DEPENDED_FUNCTION
};
+#define UUID_LENGTH (8+1+4+1+4+1+4+1+12)
+class Item_func_uuid: public Item_str_func
+{
+public:
+ Item_func_uuid(): Item_str_func() {}
+ void fix_length_and_dec() {
+ collation.set(system_charset_info);
+ max_length= UUID_LENGTH;
+ }
+ const char *func_name() const{ return "uuid"; }
+ String *val_str(String *);
+};
+
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index d4d9f832a3d..390c734a87a 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -35,9 +35,9 @@ inline Item * and_items(Item* cond, Item *item)
}
Item_subselect::Item_subselect():
- Item_result_field(), value_assigned(0), substitution(0),
- engine(0), used_tables_cache(0), have_to_be_excluded(0),
- const_item_cache(1), engine_changed(0)
+ Item_result_field(), value_assigned(0), thd(0), substitution(0),
+ engine(0), old_engine(0), used_tables_cache(0), have_to_be_excluded(0),
+ const_item_cache(1), engine_changed(0), changed(0)
{
reset();
/*
@@ -54,10 +54,10 @@ void Item_subselect::init(st_select_lex *select_lex,
DBUG_ENTER("Item_subselect::init");
DBUG_PRINT("subs", ("select_lex 0x%xl", (ulong) select_lex));
+ unit= select_lex->master_unit();
if (select_lex->next_select())
- engine= new subselect_union_engine(select_lex->master_unit(), result,
- this);
+ engine= new subselect_union_engine(unit, result, this);
else
engine= new subselect_single_select_engine(select_lex, result, this);
DBUG_VOID_RETURN;
@@ -65,8 +65,26 @@ void Item_subselect::init(st_select_lex *select_lex,
void Item_subselect::cleanup()
{
+ DBUG_ENTER("Item_subselect::cleanup");
Item_result_field::cleanup();
- engine->cleanup();
+ if (old_engine)
+ {
+ engine->cleanup();
+ engine= old_engine;
+ old_engine= 0;
+ }
+ engine->cleanup();
+ reset();
+ value_assigned= 0;
+ DBUG_VOID_RETURN;
+}
+
+void Item_singlerow_subselect::cleanup()
+{
+ DBUG_ENTER("Item_singlerow_subselect::cleanup");
+ value= 0; row= 0;
+ Item_subselect::cleanup();
+ DBUG_VOID_RETURN;
}
Item_subselect::~Item_subselect()
@@ -84,22 +102,35 @@ Item_subselect::select_transformer(JOIN *join)
bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref)
{
+ DBUG_ASSERT(fixed == 0);
engine->set_thd((thd= thd_param));
+ stmt= thd->current_statement;
char const *save_where= thd->where;
int res= engine->prepare();
+
+ // all transformetion is done (used by prepared statements)
+ changed= 1;
+
if (!res)
{
if (substitution)
{
+ int ret= 0;
+
+ // did we changed top item of WHERE condition
+ if (unit->outer_select()->where == (*ref))
+ unit->outer_select()->where= substitution; // correct WHERE for PS
+
(*ref)= substitution;
substitution->name= name;
if (have_to_be_excluded)
engine->exclude();
substitution= 0;
fixed= 1;
- thd->where= "checking transformed subquery";
- int ret= (*ref)->fix_fields(thd, tables, ref);
+ thd->where= "checking transformed subquery";
+ if (!(*ref)->fixed)
+ ret= (*ref)->fix_fields(thd, tables, ref);
// We can't substitute aggregate functions (like (SELECT (max(i)))
if ((*ref)->with_sum_func)
{
@@ -171,6 +202,12 @@ bool Item_subselect::const_item() const
return const_item_cache;
}
+Item *Item_subselect::get_tmp_table_item(THD *thd)
+{
+ if (!with_sum_func && !const_item())
+ return new Item_field(result_field);
+ return copy_or_same(thd);
+}
void Item_subselect::update_used_tables()
{
@@ -240,8 +277,12 @@ void Item_singlerow_subselect::reset()
Item_subselect::trans_res
Item_singlerow_subselect::select_transformer(JOIN *join)
{
+ if (changed)
+ return RES_OK;
+
SELECT_LEX *select_lex= join->select_lex;
-
+ Statement backup;
+
if (!select_lex->master_unit()->first_select()->next_select() &&
!select_lex->table_list.elements &&
select_lex->item_list.elements == 1 &&
@@ -275,20 +316,30 @@ Item_singlerow_subselect::select_transformer(JOIN *join)
if (join->conds || join->having)
{
Item *cond;
+ if (stmt)
+ thd->set_n_backup_item_arena(stmt, &backup);
+
if (!join->having)
cond= join->conds;
else if (!join->conds)
cond= join->having;
else
if (!(cond= new Item_cond_and(join->conds, join->having)))
- return RES_ERROR;
+ goto err;
if (!(substitution= new Item_func_if(cond, substitution,
new Item_null())))
- return RES_ERROR;
+ goto err;
}
+ if (stmt)
+ thd->restore_backup_item_arena(stmt, &backup);
return RES_REDUCE;
}
return RES_OK;
+
+err:
+ if (stmt)
+ thd->restore_backup_item_arena(stmt, &backup);
+ return RES_ERROR;
}
void Item_singlerow_subselect::store(uint i, Item *item)
@@ -349,6 +400,7 @@ void Item_singlerow_subselect::bring_value()
double Item_singlerow_subselect::val()
{
+ DBUG_ASSERT(fixed == 1);
if (!exec() && !value->null_value)
{
null_value= 0;
@@ -363,6 +415,7 @@ double Item_singlerow_subselect::val()
longlong Item_singlerow_subselect::val_int()
{
+ DBUG_ASSERT(fixed == 1);
if (!exec() && !value->null_value)
{
null_value= 0;
@@ -471,6 +524,7 @@ void Item_exists_subselect::fix_length_and_dec()
double Item_exists_subselect::val()
{
+ DBUG_ASSERT(fixed == 1);
if (exec())
{
reset();
@@ -481,6 +535,7 @@ double Item_exists_subselect::val()
longlong Item_exists_subselect::val_int()
{
+ DBUG_ASSERT(fixed == 1);
if (exec())
{
reset();
@@ -491,6 +546,7 @@ longlong Item_exists_subselect::val_int()
String *Item_exists_subselect::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
if (exec())
{
reset();
@@ -502,6 +558,7 @@ String *Item_exists_subselect::val_str(String *str)
double Item_in_subselect::val()
{
+ DBUG_ASSERT(fixed == 1);
if (exec())
{
reset();
@@ -515,6 +572,7 @@ double Item_in_subselect::val()
longlong Item_in_subselect::val_int()
{
+ DBUG_ASSERT(fixed == 1);
if (exec())
{
reset();
@@ -528,6 +586,7 @@ longlong Item_in_subselect::val_int()
String *Item_in_subselect::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
if (exec())
{
reset();
@@ -550,15 +609,22 @@ Item_in_subselect::single_value_transformer(JOIN *join,
{
DBUG_ENTER("Item_in_subselect::single_value_transformer");
+ if (changed)
+ {
+ DBUG_RETURN(RES_OK);
+ }
+
SELECT_LEX *select_lex= join->select_lex;
+ Statement backup;
- THD *thd_tmp= join->thd;
- thd_tmp->where= "scalar IN/ALL/ANY subquery";
+ thd->where= "scalar IN/ALL/ANY subquery";
+ if (stmt)
+ thd->set_n_backup_item_arena(stmt, &backup);
if (select_lex->item_list.elements > 1)
{
my_error(ER_OPERAND_COLUMNS, MYF(0), 1);
- DBUG_RETURN(RES_ERROR);
+ goto err;
}
if ((abort_on_null || (upper_not && upper_not->top_level())) &&
@@ -567,7 +633,7 @@ Item_in_subselect::single_value_transformer(JOIN *join,
if (substitution)
{
// It is second (third, ...) SELECT of UNION => All is done
- DBUG_RETURN(RES_OK);
+ goto ok;
}
Item *subs;
@@ -596,11 +662,9 @@ Item_in_subselect::single_value_transformer(JOIN *join,
*select_lex->ref_pointer_array= item;
select_lex->item_list.empty();
select_lex->item_list.push_back(item);
-
- if (item->fix_fields(thd_tmp, join->tables_list, &item))
- {
- DBUG_RETURN(RES_ERROR);
- }
+
+ // fix_fields call for 'item' will be made during new subquery fix_fields
+
subs= new Item_singlerow_subselect(select_lex);
}
else
@@ -611,16 +675,16 @@ Item_in_subselect::single_value_transformer(JOIN *join,
subs= new Item_maxmin_subselect(this, select_lex, func->l_op());
}
// left expression belong to outer select
- SELECT_LEX *current= thd_tmp->lex->current_select, *up;
- thd_tmp->lex->current_select= up= current->return_after_parsing();
- if (left_expr->fix_fields(thd_tmp, up->get_table_list(), &left_expr))
+ SELECT_LEX *current= thd->lex->current_select, *up;
+ thd->lex->current_select= up= current->return_after_parsing();
+ if (left_expr->fix_fields(thd, up->get_table_list(), &left_expr))
{
- thd_tmp->lex->current_select= current;
- DBUG_RETURN(RES_ERROR);
+ thd->lex->current_select= current;
+ goto err;
}
- thd_tmp->lex->current_select= current;
+ thd->lex->current_select= current;
substitution= func->create(left_expr, subs);
- DBUG_RETURN(RES_OK);
+ goto ok;
}
if (!substitution)
@@ -629,16 +693,16 @@ Item_in_subselect::single_value_transformer(JOIN *join,
SELECT_LEX_UNIT *unit= select_lex->master_unit();
substitution= optimizer= new Item_in_optimizer(left_expr, this);
- SELECT_LEX *current= thd_tmp->lex->current_select, *up;
+ SELECT_LEX *current= thd->lex->current_select, *up;
- thd_tmp->lex->current_select= up= current->return_after_parsing();
+ thd->lex->current_select= up= current->return_after_parsing();
//optimizer never use Item **ref => we can pass 0 as parameter
- if (!optimizer || optimizer->fix_left(thd_tmp, up->get_table_list(), 0))
+ if (!optimizer || optimizer->fix_left(thd, up->get_table_list(), 0))
{
- thd_tmp->lex->current_select= current;
- DBUG_RETURN(RES_ERROR);
+ thd->lex->current_select= current;
+ goto err;
}
- thd_tmp->lex->current_select= current;
+ thd->lex->current_select= current;
/*
As far as Item_ref_in_optimizer do not substitude itself on fix_fields
@@ -665,12 +729,17 @@ Item_in_subselect::single_value_transformer(JOIN *join,
select_lex->ref_pointer_array,
(char *)"<ref>",
this->full_name()));
- join->having= and_items(join->having, item);
+ /*
+ AND and comparison functions can't be changed during fix_fields()
+ we can assign select_lex->having here, and pass 0 as last
+ argument (reference) to fix_fields()
+ */
+ select_lex->having= join->having= and_items(join->having, item);
select_lex->having_fix_field= 1;
- if (join->having->fix_fields(thd_tmp, join->tables_list, &join->having))
+ if (join->having->fix_fields(thd, join->tables_list, 0))
{
select_lex->having_fix_field= 0;
- DBUG_RETURN(RES_ERROR);
+ goto err;
}
select_lex->having_fix_field= 0;
}
@@ -682,44 +751,61 @@ Item_in_subselect::single_value_transformer(JOIN *join,
select_lex->ref_pointer_array[0]= select_lex->item_list.head();
if (select_lex->table_list.elements)
{
- Item *having= item, *isnull= item;
+ Item *having= item, *orig_item= item;
item= func->create(expr, item);
- if (!abort_on_null)
+ if (!abort_on_null && orig_item->maybe_null)
{
having= new Item_is_not_null_test(this, having);
- join->having= (join->having ?
- new Item_cond_and(having, join->having) :
- having);
+ /*
+ Item_is_not_null_test can't be changed during fix_fields()
+ we can assign select_lex->having here, and pass 0 as last
+ argument (reference) to fix_fields()
+ */
+ select_lex->having=
+ join->having= (join->having ?
+ new Item_cond_and(having, join->having) :
+ having);
select_lex->having_fix_field= 1;
- if (join->having->fix_fields(thd_tmp, join->tables_list,
- &join->having))
+ if (join->having->fix_fields(thd, join->tables_list, 0))
{
select_lex->having_fix_field= 0;
- DBUG_RETURN(RES_ERROR);
+ goto err;
}
select_lex->having_fix_field= 0;
item= new Item_cond_or(item,
- new Item_func_isnull(isnull));
+ new Item_func_isnull(orig_item));
}
item->name= (char *)in_additional_cond;
- join->conds= and_items(join->conds, item);
- if (join->conds->fix_fields(thd_tmp, join->tables_list, &join->conds))
- DBUG_RETURN(RES_ERROR);
+ /*
+ AND can't be changed during fix_fields()
+ we can assign select_lex->having here, and pass 0 as last
+ argument (reference) to fix_fields()
+ */
+ select_lex->where= join->conds= and_items(join->conds, item);
+ if (join->conds->fix_fields(thd, join->tables_list, 0))
+ goto err;
}
else
{
if (select_lex->master_unit()->first_select()->next_select())
{
- join->having= func->create(expr,
- new Item_null_helper(this, item,
- (char *)"<no matter>",
- (char *)"<result>"));
+ /*
+ comparison functions can't be changed during fix_fields()
+ we can assign select_lex->having here, and pass 0 as last
+ argument (reference) to fix_fields()
+ */
+ select_lex->having=
+ join->having=
+ func->create(expr,
+ new Item_null_helper(this, item,
+ (char *)"<no matter>",
+ (char *)"<result>"));
select_lex->having_fix_field= 1;
- if (join->having->fix_fields(thd_tmp, join->tables_list,
- &join->having))
+ if (join->having->fix_fields(thd, join->tables_list,
+ 0))
{
select_lex->having_fix_field= 0;
- DBUG_RETURN(RES_ERROR);
+ goto err;
}
select_lex->having_fix_field= 0;
}
@@ -730,18 +816,29 @@ Item_in_subselect::single_value_transformer(JOIN *join,
// fix_field of item will be done in time of substituting
substitution= item;
have_to_be_excluded= 1;
- if (thd_tmp->lex->describe)
+ if (thd->lex->describe)
{
char warn_buff[MYSQL_ERRMSG_SIZE];
sprintf(warn_buff, ER(ER_SELECT_REDUCED), select_lex->select_number);
- push_warning(thd_tmp, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_SELECT_REDUCED, warn_buff);
}
+ if (stmt)
+ thd->restore_backup_item_arena(stmt, &backup);
DBUG_RETURN(RES_REDUCE);
}
}
}
+
+ok:
+ if (stmt)
+ thd->restore_backup_item_arena(stmt, &backup);
DBUG_RETURN(RES_OK);
+
+err:
+ if (stmt)
+ thd->restore_backup_item_arena(stmt, &backup);
+ DBUG_RETURN(RES_ERROR);
}
@@ -750,15 +847,23 @@ Item_in_subselect::row_value_transformer(JOIN *join)
{
DBUG_ENTER("Item_in_subselect::row_value_transformer");
- THD *thd_tmp= join->thd;
- thd_tmp->where= "row IN/ALL/ANY subquery";
+ if (changed)
+ {
+ DBUG_RETURN(RES_OK);
+ }
+ Statement backup;
+ Item *item= 0;
+
+ thd->where= "row IN/ALL/ANY subquery";
+ if (stmt)
+ thd->set_n_backup_item_arena(stmt, &backup);
SELECT_LEX *select_lex= join->select_lex;
if (select_lex->item_list.elements != left_expr->cols())
{
my_error(ER_OPERAND_COLUMNS, MYF(0), left_expr->cols());
- DBUG_RETURN(RES_ERROR);
+ goto err;
}
if (!substitution)
@@ -767,62 +872,82 @@ Item_in_subselect::row_value_transformer(JOIN *join)
SELECT_LEX_UNIT *unit= select_lex->master_unit();
substitution= optimizer= new Item_in_optimizer(left_expr, this);
- SELECT_LEX *current= thd_tmp->lex->current_select, *up;
- thd_tmp->lex->current_select= up= current->return_after_parsing();
+ SELECT_LEX *current= thd->lex->current_select, *up;
+ thd->lex->current_select= up= current->return_after_parsing();
//optimizer never use Item **ref => we can pass 0 as parameter
- if (!optimizer || optimizer->fix_left(thd_tmp, up->get_table_list(), 0))
+ if (!optimizer || optimizer->fix_left(thd, up->get_table_list(), 0))
{
- thd_tmp->lex->current_select= current;
- DBUG_RETURN(RES_ERROR);
+ thd->lex->current_select= current;
+ goto err;
}
- thd_tmp->lex->current_select= current;
+
+ // we will refer to apper level cache array => we have to save it in PS
+ optimizer->keep_top_level_cache();
+
+ thd->lex->current_select= current;
unit->uncacheable|= UNCACHEABLE_DEPENDENT;
}
- uint n= left_expr->cols();
-
select_lex->uncacheable|= UNCACHEABLE_DEPENDENT;
- select_lex->setup_ref_array(thd_tmp,
+ select_lex->setup_ref_array(thd,
select_lex->order_list.elements +
select_lex->group_list.elements);
- Item *item= 0;
- List_iterator_fast<Item> li(select_lex->item_list);
- for (uint i= 0; i < n; i++)
{
- Item *func= new Item_ref_null_helper(this,
- select_lex->ref_pointer_array+i,
- (char *) "<no matter>",
- (char *) "<list ref>");
- func=
- eq_creator.create(new Item_ref((*optimizer->get_cache())->
- addr(i),
- NULL,
- (char *)"<no matter>",
+ uint n= left_expr->cols();
+ List_iterator_fast<Item> li(select_lex->item_list);
+ for (uint i= 0; i < n; i++)
+ {
+ Item *func= new Item_ref_null_helper(this,
+ select_lex->ref_pointer_array+i,
+ (char *) "<no matter>",
+ (char *) "<list ref>");
+ func=
+ eq_creator.create(new Item_ref((*optimizer->get_cache())->
+ addr(i),
+ NULL,
+ (char *)"<no matter>",
(char *)in_left_expr_name),
- func);
- item= and_items(item, func);
+ func);
+ item= and_items(item, func);
+ }
}
-
if (join->having || select_lex->with_sum_func ||
select_lex->group_list.first ||
!select_lex->table_list.elements)
{
- join->having= and_items(join->having, item);
+ /*
+ AND can't be changed during fix_fields()
+ we can assign select_lex->having here, and pass 0 as last
+ argument (reference) to fix_fields()
+ */
+ select_lex->having= join->having= and_items(join->having, item);
select_lex->having_fix_field= 1;
- if (join->having->fix_fields(thd_tmp, join->tables_list, &join->having))
+ if (join->having->fix_fields(thd, join->tables_list, 0))
{
select_lex->having_fix_field= 0;
- DBUG_RETURN(RES_ERROR);
+ goto err;
}
select_lex->having_fix_field= 0;
}
else
{
- join->conds= and_items(join->conds, item);
- if (join->conds->fix_fields(thd_tmp, join->tables_list, &join->having))
- DBUG_RETURN(RES_ERROR);
+ /*
+ AND can't be changed during fix_fields()
+ we can assign select_lex->having here, and pass 0 as last
+ argument (reference) to fix_fields()
+ */
+ select_lex->where= join->conds= and_items(join->conds, item);
+ if (join->conds->fix_fields(thd, join->tables_list, 0))
+ goto err;
}
+ if (stmt)
+ thd->restore_backup_item_arena(stmt, &backup);
DBUG_RETURN(RES_OK);
+
+err:
+ if (stmt)
+ thd->restore_backup_item_arena(stmt, &backup);
+ DBUG_RETURN(RES_ERROR);
}
@@ -888,13 +1013,31 @@ subselect_single_select_engine(st_select_lex *select,
this->select_lex= select_lex;
}
+
void subselect_single_select_engine::cleanup()
{
- prepared= 0;
- optimized= 0;
- executed= 0;
+ DBUG_ENTER("subselect_single_select_engine::cleanup");
+ prepared= optimized= executed= 0;
+ join= 0;
+ DBUG_VOID_RETURN;
}
+
+void subselect_union_engine::cleanup()
+{
+ DBUG_ENTER("subselect_union_engine::cleanup");
+ unit->reinit_exec_mechanism();
+ DBUG_VOID_RETURN;
+}
+
+
+void subselect_uniquesubquery_engine::cleanup()
+{
+ DBUG_ENTER("subselect_uniquesubquery_engine::cleanup");
+ DBUG_VOID_RETURN;
+}
+
+
subselect_union_engine::subselect_union_engine(st_select_lex_unit *u,
select_subselect *result_arg,
Item_subselect *item_arg)
diff --git a/sql/item_subselect.h b/sql/item_subselect.h
index dc3d07540da..e68c882ba3e 100644
--- a/sql/item_subselect.h
+++ b/sql/item_subselect.h
@@ -26,6 +26,7 @@ class JOIN;
class select_subselect;
class subselect_engine;
class Item_bool_func2;
+class Statement;
/* base class for subselects */
@@ -35,22 +36,30 @@ class Item_subselect :public Item_result_field
protected:
/* thread handler, will be assigned in fix_fields only */
THD *thd;
+ /* prepared statement, or 0 */
+ Statement *stmt;
/* substitution instead of subselect in case of optimization */
Item *substitution;
+ /* unit of subquery */
+ st_select_lex_unit *unit;
/* engine that perform execution of subselect (single select or union) */
subselect_engine *engine;
+ /* old engine if engine was changed */
+ subselect_engine *old_engine;
/* cache of used external tables */
table_map used_tables_cache;
/* allowed number of columns (1 for single value subqueries) */
uint max_columns;
/* work with 'substitution' */
bool have_to_be_excluded;
- /* cache of constante state */
+ /* cache of constant state */
bool const_item_cache;
public:
/* changed engine indicator */
bool engine_changed;
+ /* subquery is transformed */
+ bool changed;
enum trans_res {RES_OK, RES_REDUCE, RES_ERROR};
enum subs_type {UNKNOWN_SUBS, SINGLEROW_SUBS,
@@ -90,10 +99,12 @@ public:
bool const_item() const;
inline table_map get_used_tables_cache() { return used_tables_cache; }
inline bool get_const_item_cache() { return const_item_cache; }
+ Item *get_tmp_table_item(THD *thd);
void update_used_tables();
void print(String *str);
bool change_engine(subselect_engine *eng)
{
+ old_engine= engine;
engine= eng;
engine_changed= 1;
return eng == 0;
@@ -116,6 +127,7 @@ public:
Item_singlerow_subselect(st_select_lex *select_lex);
Item_singlerow_subselect() :Item_subselect(), value(0), row (0) {}
+ void cleanup();
subs_type substype() { return SINGLEROW_SUBS; }
void reset();
@@ -200,13 +212,6 @@ public:
{}
- void cleanup()
- {
- Item_exists_subselect::cleanup();
- abort_on_null= 0;
- transformed= 0;
- upper_not= 0;
- }
subs_type substype() { return IN_SUBS; }
void reset()
{
@@ -269,7 +274,7 @@ public:
maybe_null= 0;
}
virtual ~subselect_engine() {}; // to satisfy compiler
- virtual void cleanup() {}
+ virtual void cleanup()= 0;
// set_thd should be called before prepare()
void set_thd(THD *thd_arg) { thd= thd_arg; }
@@ -318,6 +323,7 @@ public:
subselect_union_engine(st_select_lex_unit *u,
select_subselect *result,
Item_subselect *item);
+ void cleanup();
int prepare();
void fix_length_and_dec(Item_cache** row);
int exec();
@@ -345,6 +351,7 @@ public:
set_thd(thd_arg);
}
~subselect_uniquesubquery_engine();
+ void cleanup();
int prepare();
void fix_length_and_dec(Item_cache** row);
int exec();
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index 6507e826b7e..7b2b00b18c6 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -24,8 +24,8 @@
#include "mysql_priv.h"
Item_sum::Item_sum(List<Item> &list)
+ :args_copy(0), arg_count(list.elements)
{
- arg_count=list.elements;
if ((args=(Item**) sql_alloc(sizeof(Item*)*arg_count)))
{
uint i=0;
@@ -41,20 +41,57 @@ Item_sum::Item_sum(List<Item> &list)
list.empty(); // Fields are used
}
-// Constructor used in processing select with temporary tebles
+
+/*
+ Constructor used in processing select with temporary tebles
+*/
+
Item_sum::Item_sum(THD *thd, Item_sum *item):
- Item_result_field(thd, item), quick_group(item->quick_group)
+ Item_result_field(thd, item), arg_count(item->arg_count),
+ quick_group(item->quick_group)
{
- arg_count= item->arg_count;
if (arg_count <= 2)
args=tmp_args;
else
- if (!(args=(Item**) sql_alloc(sizeof(Item*)*arg_count)))
+ if (!(args= (Item**) thd->alloc(sizeof(Item*)*arg_count)))
return;
- for (uint i= 0; i < arg_count; i++)
- args[i]= item->args[i];
+ memcpy(args, item->args, sizeof(Item*)*arg_count);
+ if (item->args_copy != 0)
+ save_args(thd);
+ else
+ args_copy= 0;
}
+
+/*
+ Save copy of arguments if we are prepare prepared statement
+ (arguments can be rewritten in get_tmp_table_item())
+
+ SYNOPSIS
+ Item_sum::save_args_for_prepared_statements()
+ thd - thread handler
+
+ RETURN
+ 0 - OK
+ 1 - Error
+*/
+bool Item_sum::save_args_for_prepared_statements(THD *thd)
+{
+ if (thd->current_statement)
+ return save_args(thd->current_statement);
+ return 0;
+}
+
+
+bool Item_sum::save_args(Statement* stmt)
+{
+ if (!(args_copy= (Item**) stmt->alloc(sizeof(Item*)*arg_count)))
+ return 1;
+ memcpy(args_copy, args, sizeof(Item*)*arg_count);
+ return 0;
+}
+
+
void Item_sum::mark_as_sum_func()
{
current_thd->lex->current_select->with_sum_func= 1;
@@ -62,6 +99,17 @@ void Item_sum::mark_as_sum_func()
}
+void Item_sum::cleanup()
+{
+ DBUG_ENTER("Item_sum::cleanup");
+ Item_result_field::cleanup();
+ if (args_copy != 0)
+ memcpy(args, args_copy, sizeof(Item*)*arg_count);
+ result_field=0;
+ DBUG_VOID_RETURN;
+}
+
+
void Item_sum::make_field(Send_field *tmp_field)
{
if (args[0]->type() == Item::FIELD_ITEM && keep_field_type())
@@ -137,6 +185,7 @@ bool Item_sum::walk (Item_processor processor, byte *argument)
String *
Item_sum_num::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
double nr=val();
if (null_value)
return 0;
@@ -148,6 +197,7 @@ Item_sum_num::val_str(String *str)
String *
Item_sum_int::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
longlong nr= val_int();
if (null_value)
return 0;
@@ -162,6 +212,11 @@ Item_sum_int::val_str(String *str)
bool
Item_sum_num::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
{
+ DBUG_ASSERT(fixed == 0);
+
+ if (save_args_for_prepared_statements(thd))
+ return 1;
+
if (!thd->allow_sum_func)
{
my_error(ER_INVALID_GROUP_FUNC_USE,MYF(0));
@@ -191,17 +246,26 @@ Item_sum_num::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
bool
Item_sum_hybrid::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
{
- Item *item=args[0];
+ DBUG_ASSERT(fixed == 0);
+
+ if (save_args_for_prepared_statements(thd))
+ return 1;
+
+ Item *item= args[0];
if (!thd->allow_sum_func)
{
my_error(ER_INVALID_GROUP_FUNC_USE,MYF(0));
return 1;
}
thd->allow_sum_func=0; // No included group funcs
+
+ // 'item' can be changed during fix_fields
if (!item->fixed &&
- item->fix_fields(thd, tables, args) || item->check_cols(1))
+ item->fix_fields(thd, tables, args) ||
+ (item= args[0])->check_cols(1))
return 1;
- hybrid_type=item->result_type();
+
+ hybrid_type= item->result_type();
if (hybrid_type == INT_RESULT)
{
cmp_charset= &my_charset_bin;
@@ -261,6 +325,7 @@ bool Item_sum_sum::add()
double Item_sum_sum::val()
{
+ DBUG_ASSERT(fixed == 1);
return sum;
}
@@ -408,6 +473,7 @@ bool Item_sum_count::add()
longlong Item_sum_count::val_int()
{
+ DBUG_ASSERT(fixed == 1);
return (longlong) count;
}
@@ -440,6 +506,7 @@ bool Item_sum_avg::add()
double Item_sum_avg::val()
{
+ DBUG_ASSERT(fixed == 1);
if (!count)
{
null_value=1;
@@ -456,6 +523,7 @@ double Item_sum_avg::val()
double Item_sum_std::val()
{
+ DBUG_ASSERT(fixed == 1);
double tmp= Item_sum_variance::val();
return tmp <= 0.0 ? 0.0 : sqrt(tmp);
}
@@ -496,6 +564,7 @@ bool Item_sum_variance::add()
double Item_sum_variance::val()
{
+ DBUG_ASSERT(fixed == 1);
if (!count)
{
null_value=1;
@@ -551,6 +620,7 @@ void Item_sum_variance::update_field()
double Item_sum_hybrid::val()
{
+ DBUG_ASSERT(fixed == 1);
int err;
if (null_value)
return 0.0;
@@ -576,6 +646,7 @@ double Item_sum_hybrid::val()
longlong Item_sum_hybrid::val_int()
{
+ DBUG_ASSERT(fixed == 1);
if (null_value)
return 0;
if (hybrid_type == INT_RESULT)
@@ -587,6 +658,7 @@ longlong Item_sum_hybrid::val_int()
String *
Item_sum_hybrid::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
if (null_value)
return 0;
switch (hybrid_type) {
@@ -721,6 +793,7 @@ bool Item_sum_max::add()
longlong Item_sum_bit::val_int()
{
+ DBUG_ASSERT(fixed == 1);
return (longlong) bits;
}
@@ -1054,6 +1127,7 @@ Item_avg_field::Item_avg_field(Item_sum_avg *item)
double Item_avg_field::val()
{
+ // fix_fields() never calls for this Item
double nr;
longlong count;
float8get(nr,field->ptr);
@@ -1071,6 +1145,7 @@ double Item_avg_field::val()
String *Item_avg_field::val_str(String *str)
{
+ // fix_fields() never calls for this Item
double nr=Item_avg_field::val();
if (null_value)
return 0;
@@ -1085,6 +1160,7 @@ Item_std_field::Item_std_field(Item_sum_std *item)
double Item_std_field::val()
{
+ // fix_fields() never calls for this Item
double tmp= Item_variance_field::val();
return tmp <= 0.0 ? 0.0 : sqrt(tmp);
}
@@ -1100,6 +1176,7 @@ Item_variance_field::Item_variance_field(Item_sum_variance *item)
double Item_variance_field::val()
{
+ // fix_fields() never calls for this Item
double sum,sum_sqr;
longlong count;
float8get(sum,field->ptr);
@@ -1119,6 +1196,7 @@ double Item_variance_field::val()
String *Item_variance_field::val_str(String *str)
{
+ // fix_fields() never calls for this Item
double nr=val();
if (null_value)
return 0;
@@ -1195,6 +1273,7 @@ int dump_leaf(byte* key, uint32 count __attribute__((unused)),
void Item_sum_count_distinct::cleanup()
{
+ DBUG_ENTER("Item_sum_count_distinct::cleanup");
Item_sum_int::cleanup();
/*
Free table and tree if they belong to this item (if item have not pointer
@@ -1215,17 +1294,10 @@ void Item_sum_count_distinct::cleanup()
use_tree= 0;
}
}
+ DBUG_VOID_RETURN;
}
-bool Item_sum_count_distinct::fix_fields(THD *thd, TABLE_LIST *tables,
- Item **ref)
-{
- if (Item_sum_num::fix_fields(thd, tables, ref))
- return 1;
- return 0;
-}
-
/* This is used by rollup to create a separate usable copy of the function */
void Item_sum_count_distinct::make_unique()
@@ -1458,6 +1530,7 @@ bool Item_sum_count_distinct::add()
longlong Item_sum_count_distinct::val_int()
{
+ DBUG_ASSERT(fixed == 1);
if (!table) // Empty query
return LL(0);
if (use_tree)
@@ -1504,6 +1577,7 @@ Item *Item_sum_udf_float::copy_or_same(THD* thd)
double Item_sum_udf_float::val()
{
+ DBUG_ASSERT(fixed == 1);
DBUG_ENTER("Item_sum_udf_float::val");
DBUG_PRINT("info",("result_type: %d arg_count: %d",
args[0]->result_type(), arg_count));
@@ -1512,6 +1586,7 @@ double Item_sum_udf_float::val()
String *Item_sum_udf_float::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
double nr=val();
if (null_value)
return 0; /* purecov: inspected */
@@ -1528,6 +1603,7 @@ Item *Item_sum_udf_int::copy_or_same(THD* thd)
longlong Item_sum_udf_int::val_int()
{
+ DBUG_ASSERT(fixed == 1);
DBUG_ENTER("Item_sum_udf_int::val_int");
DBUG_PRINT("info",("result_type: %d arg_count: %d",
args[0]->result_type(), arg_count));
@@ -1537,6 +1613,7 @@ longlong Item_sum_udf_int::val_int()
String *Item_sum_udf_int::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
longlong nr=val_int();
if (null_value)
return 0;
@@ -1564,6 +1641,7 @@ Item *Item_sum_udf_str::copy_or_same(THD* thd)
String *Item_sum_udf_str::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
DBUG_ENTER("Item_sum_udf_str::str");
String *res=udf.val_str(str,&str_value);
null_value = !res;
@@ -1575,10 +1653,17 @@ String *Item_sum_udf_str::val_str(String *str)
/*****************************************************************************
GROUP_CONCAT function
- Syntax:
- GROUP_CONCAT([DISTINCT] expr,... [ORDER BY col [ASC|DESC],...]
- [SEPARATOR str_const])
+
+ SQL SYNTAX:
+ GROUP_CONCAT([DISTINCT] expr,... [ORDER BY col [ASC|DESC],...]
+ [SEPARATOR str_const])
+
concat of values from "group by" operation
+
+ BUGS
+ DISTINCT and ORDER BY only works if ORDER BY uses all fields and only fields
+ in expression list
+ Blobs doesn't work with DISTINCT or ORDER BY
*****************************************************************************/
/*
@@ -1589,25 +1674,28 @@ String *Item_sum_udf_str::val_str(String *str)
int group_concat_key_cmp_with_distinct(void* arg, byte* key1,
byte* key2)
{
- Item_func_group_concat* item= (Item_func_group_concat*)arg;
+ Item_func_group_concat* grp_item= (Item_func_group_concat*)arg;
+ Item **field_item, **end;
+ char *record= (char*) grp_item->table->record[0];
- for (uint i= 0; i < item->arg_count_field; i++)
+ for (field_item= grp_item->args, end= field_item + grp_item->arg_count_field;
+ field_item < end;
+ field_item++)
{
- Item *field_item= item->args[i];
- Field *field= field_item->real_item()->get_tmp_table_field();
+ /*
+ We have to use get_tmp_table_field() instead of
+ real_item()->get_tmp_table_field() because we want the field in
+ the temporary table, not the original field
+ */
+ Field *field= (*field_item)->get_tmp_table_field();
if (field)
{
- uint offset= field->abs_offset;
-
- int res= field->key_cmp(key1 + offset, key2 + offset);
- /*
- if key1 and key2 is not equal than field->key_cmp return offset. This
- function must return value 1 for this case.
- */
- if (res)
- return 1;
+ int res;
+ uint offset= (uint) (field->ptr - record);
+ if ((res= field->key_cmp(key1 + offset, key2 + offset)))
+ return res;
}
- }
+ }
return 0;
}
@@ -1619,26 +1707,34 @@ int group_concat_key_cmp_with_distinct(void* arg, byte* key1,
int group_concat_key_cmp_with_order(void* arg, byte* key1, byte* key2)
{
- Item_func_group_concat* item= (Item_func_group_concat*)arg;
+ Item_func_group_concat* grp_item= (Item_func_group_concat*) arg;
+ ORDER **order_item, **end;
+ char *record= (char*) grp_item->table->record[0];
- for (uint i=0; i < item->arg_count_order; i++)
+ for (order_item= grp_item->order, end=order_item+ grp_item->arg_count_order;
+ order_item < end;
+ order_item++)
{
- ORDER *order_item= item->order[i];
- Item *item= *order_item->item;
- Field *field= item->real_item()->get_tmp_table_field();
+ Item *item= *(*order_item)->item;
+ /*
+ We have to use get_tmp_table_field() instead of
+ real_item()->get_tmp_table_field() because we want the field in
+ the temporary table, not the original field
+ */
+ Field *field= item->get_tmp_table_field();
if (field)
{
- uint offset= field->abs_offset;
-
- bool dir= order_item->asc;
- int res= field->key_cmp(key1 + offset, key2 + offset);
- if (res)
- return dir ? res : -res;
+ int res;
+ uint offset= (uint) (field->ptr - record);
+ if ((res= field->key_cmp(key1 + offset, key2 + offset)))
+ return (*order_item)->asc ? res : -res;
}
- }
+ }
/*
- We can't return 0 because tree class remove this item as double value.
- */
+ We can't return 0 because in that case the tree class would remove this
+ item as double value. This would cause problems for case-changes and
+ if the the returned values are not the same we do the sort on.
+ */
return 1;
}
@@ -1646,6 +1742,11 @@ int group_concat_key_cmp_with_order(void* arg, byte* key1, byte* key2)
/*
function of sort for syntax:
GROUP_CONCAT(DISTINCT expr,... ORDER BY col,... )
+
+ BUG:
+ This doesn't work in the case when the order by contains data that
+ is not part of the field list because tree-insert will not notice
+ the duplicated values when inserting things sorted by ORDER BY
*/
int group_concat_key_cmp_with_distinct_and_order(void* arg,byte* key1,
@@ -1658,58 +1759,61 @@ int group_concat_key_cmp_with_distinct_and_order(void* arg,byte* key1,
/*
- create result
- item is pointer to Item_func_group_concat
+ Append data from current leaf to item->result
*/
int dump_leaf_key(byte* key, uint32 count __attribute__((unused)),
- Item_func_group_concat *group_concat_item)
+ Item_func_group_concat *item)
{
char buff[MAX_FIELD_WIDTH];
- String tmp((char *)&buff,sizeof(buff),default_charset_info);
- String tmp2((char *)&buff,sizeof(buff),default_charset_info);
-
+ String tmp((char*) &buff, sizeof(buff), default_charset_info);
+ String tmp2((char *) &buff, sizeof(buff), default_charset_info);
+ char *record= (char*) item->table->record[0];
+
tmp.length(0);
- for (uint i= 0; i < group_concat_item->arg_show_fields; i++)
+ for (uint i= 0; i < item->arg_count_field; i++)
{
- Item *show_item= group_concat_item->args[i];
+ Item *show_item= item->args[i];
if (!show_item->const_item())
{
- Field *f= show_item->real_item()->get_tmp_table_field();
- char *sv= f->ptr;
- f->ptr= (char *)key + f->abs_offset;
- String *res= f->val_str(&tmp,&tmp2);
- group_concat_item->result.append(*res);
- f->ptr= sv;
+ /*
+ We have to use get_tmp_table_field() instead of
+ real_item()->get_tmp_table_field() because we want the field in
+ the temporary table, not the original field
+ */
+ Field *field= show_item->get_tmp_table_field();
+ String *res;
+ char *save_ptr= field->ptr;
+ uint offset= (uint) (save_ptr - record);
+ DBUG_ASSERT(offset < item->table->reclength);
+ field->ptr= (char *) key + offset;
+ res= field->val_str(&tmp,&tmp2);
+ item->result.append(*res);
+ field->ptr= save_ptr;
}
else
{
String *res= show_item->val_str(&tmp);
if (res)
- group_concat_item->result.append(*res);
+ item->result.append(*res);
}
}
- if (group_concat_item->tree_mode) // Last item of tree
+ if (item->tree_mode) // Last item of tree
{
- group_concat_item->show_elements++;
- if (group_concat_item->show_elements <
- group_concat_item->tree->elements_in_tree)
- group_concat_item->result.append(*group_concat_item->separator);
+ 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)
{
- group_concat_item->result.append(*group_concat_item->separator);
- }
- /*
- if length of result more than group_concat_max_len - stop !
- */
- if (group_concat_item->result.length() >
- group_concat_item->group_concat_max_len)
- {
- group_concat_item->count_cut_values++;
- group_concat_item->result.length(group_concat_item->group_concat_max_len);
- group_concat_item->warning_for_row= TRUE;
+ item->count_cut_values++;
+ item->result.length(item->group_concat_max_len);
+ item->warning_for_row= TRUE;
return 1;
}
return 0;
@@ -1729,60 +1833,97 @@ Item_func_group_concat::Item_func_group_concat(bool is_distinct,
SQL_LIST *is_order,
String *is_separator)
:Item_sum(), tmp_table_param(0), max_elements_in_tree(0), warning(0),
- warning_available(0), key_length(0), rec_offset(0),
+ warning_available(0), key_length(0),
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_show_fields(0), count_cut_values(0)
-
+ count_cut_values(0)
{
+ Item *item_select;
+ Item **arg_ptr;
+
original= 0;
quick_group= 0;
mark_as_sum_func();
order= 0;
group_concat_max_len= current_thd->variables.group_concat_max_len;
-
- arg_show_fields= arg_count_field= is_select->elements;
+ arg_count_field= is_select->elements;
arg_count_order= is_order ? is_order->elements : 0;
- arg_count= arg_count_field;
+ arg_count= arg_count_field + arg_count_order;
/*
We need to allocate:
- args - arg_count+arg_count_order (for possible order items in temporare
- tables)
+ args - arg_count_field+arg_count_order
+ (for possible order items in temporare tables)
order - arg_count_order
*/
- args= (Item**) sql_alloc(sizeof(Item*)*(arg_count+arg_count_order)+
- sizeof(ORDER*)*arg_count_order);
- if (!args)
+ if (!(args= (Item**) sql_alloc(sizeof(Item*) * arg_count +
+ sizeof(ORDER*)*arg_count_order)))
return;
+ order= (ORDER**)(args + arg_count);
+
/* fill args items of show and sort */
- int i= 0;
List_iterator_fast<Item> li(*is_select);
- Item *item_select;
- for ( ; (item_select= li++) ; i++)
- args[i]= item_select;
+ for (arg_ptr=args ; (item_select= li++) ; arg_ptr++)
+ *arg_ptr= item_select;
if (arg_count_order)
{
- i= 0;
- order= (ORDER**)(args + arg_count + arg_count_order);
+ ORDER **order_ptr= order;
for (ORDER *order_item= (ORDER*) is_order->first;
- order_item != NULL;
- order_item= order_item->next)
+ order_item != NULL;
+ order_item= order_item->next)
{
- order[i++]= order_item;
+ (*order_ptr++)= order_item;
+ *arg_ptr= *order_item->item;
+ order_item->item= arg_ptr++;
}
}
}
+
+
+Item_func_group_concat::Item_func_group_concat(THD *thd,
+ Item_func_group_concat *item)
+ :Item_sum(thd, item),item_thd(thd),
+ tmp_table_param(item->tmp_table_param),
+ max_elements_in_tree(item->max_elements_in_tree),
+ warning(item->warning),
+ warning_available(item->warning_available),
+ key_length(item->key_length),
+ tree_mode(item->tree_mode),
+ distinct(item->distinct),
+ warning_for_row(item->warning_for_row),
+ separator(item->separator),
+ tree(item->tree),
+ table(item->table),
+ 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),
+ count_cut_values(item->count_cut_values),
+ original(item)
+{
+ quick_group= item->quick_group;
+}
+
void Item_func_group_concat::cleanup()
{
+ DBUG_ENTER("Item_func_group_concat::cleanup");
+ Item_sum::cleanup();
+
+ /* fix order list */
+ for (uint i= 0; i < arg_count_order ; i++)
+ order[i]->item= &order[i]->item_ptr;
+
/*
Free table and tree if they belong to this item (if item have not pointer
to original item from which was made copy => it own its objects )
@@ -1803,6 +1944,7 @@ void Item_func_group_concat::cleanup()
delete_tree(tree);
}
}
+ DBUG_VOID_RETURN;
}
@@ -1814,12 +1956,11 @@ Item_func_group_concat::~Item_func_group_concat()
*/
if (!original)
{
- THD *thd= current_thd;
if (warning_available)
{
char warn_buff[MYSQL_ERRMSG_SIZE];
sprintf(warn_buff, ER(ER_CUT_VALUE_GROUP_CONCAT), count_cut_values);
- warning->set_msg(thd, warn_buff);
+ warning->set_msg(current_thd, warn_buff);
}
}
}
@@ -1836,7 +1977,7 @@ void Item_func_group_concat::clear()
result.length(0);
result.copy();
null_value= TRUE;
- warning_for_row= false;
+ warning_for_row= FALSE;
if (table)
{
table->file->extra(HA_EXTRA_NO_CACHE);
@@ -1855,33 +1996,31 @@ bool Item_func_group_concat::add()
copy_fields(tmp_table_param);
copy_funcs(tmp_table_param->items_to_copy);
- bool record_is_null= TRUE;
- for (uint i= 0; i < arg_show_fields; i++)
+ for (uint i= 0; i < arg_count_field; i++)
{
Item *show_item= args[i];
if (!show_item->const_item())
{
+ /*
+ Here we use real_item as we want the original field data that should
+ be written to table->record[0]
+ */
Field *f= show_item->real_item()->get_tmp_table_field();
- if (!f->is_null())
- {
- record_is_null= FALSE;
- break;
- }
+ if (f->is_null())
+ return 0; // Skip row if it contains null
}
}
- if (record_is_null)
- return 0;
+
null_value= FALSE;
if (tree_mode)
{
- if (!tree_insert(tree, table->record[0] + rec_offset, 0, tree->custom_arg))
+ if (!tree_insert(tree, table->record[0], 0, tree->custom_arg))
return 1;
}
else
{
if (result.length() <= group_concat_max_len && !warning_for_row)
- dump_leaf_key(table->record[0] + rec_offset, 1,
- (Item_func_group_concat*)this);
+ dump_leaf_key(table->record[0], 1, this);
}
return 0;
}
@@ -1897,6 +2036,11 @@ void Item_func_group_concat::reset_field()
bool
Item_func_group_concat::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
{
+ DBUG_ASSERT(fixed == 0);
+
+ if (save_args_for_prepared_statements(thd))
+ return 1;
+
uint i; /* for loop variable */
if (!thd->allow_sum_func)
@@ -1908,24 +2052,19 @@ Item_func_group_concat::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
thd->allow_sum_func= 0;
maybe_null= 0;
item_thd= thd;
- for (i= 0 ; i < arg_count ; i++)
- {
- if (args[i]->fix_fields(thd, tables, args + i) || args[i]->check_cols(1))
- return 1;
- maybe_null |= args[i]->maybe_null;
- }
+
/*
- Fix fields for order clause in function:
- GROUP_CONCAT(expr,... ORDER BY col,... )
+ Fix fields for select list and ORDER clause
*/
- for (i= 0 ; i < arg_count_order ; i++)
+
+ for (i= 0 ; i < arg_count ; i++)
{
- // order_item->item can be changed by fix_fields() call
- ORDER *order_item= order[i];
- if ((*order_item->item)->fix_fields(thd, tables, order_item->item) ||
- (*order_item->item)->check_cols(1))
+ if (args[i]->fix_fields(thd, tables, args + i) || args[i]->check_cols(1))
return 1;
+ if (i < arg_count_field && args[i]->maybe_null)
+ maybe_null= 0;
}
+
result_field= 0;
null_value= 1;
max_length= group_concat_max_len;
@@ -1940,23 +2079,29 @@ Item_func_group_concat::fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
bool Item_func_group_concat::setup(THD *thd)
{
- DBUG_ENTER("Item_func_group_concat::setup");
List<Item> list;
SELECT_LEX *select_lex= thd->lex->current_select;
+ uint const_fields;
+ byte *record;
+ qsort_cmp2 compare_key;
+ DBUG_ENTER("Item_func_group_concat::setup");
if (select_lex->linkage == GLOBAL_OPTIONS_TYPE)
DBUG_RETURN(1);
+
/*
push all not constant fields to list and create temp table
*/
+ const_fields= 0;
always_null= 0;
- for (uint i= 0; i < arg_count; i++)
+ for (uint i= 0; i < arg_count_field; i++)
{
Item *item= args[i];
if (list.push_back(item))
DBUG_RETURN(1);
if (item->const_item())
{
+ const_fields++;
(void) item->val_int();
if (item->null_value)
always_null= 1;
@@ -1976,12 +2121,19 @@ bool Item_func_group_concat::setup(THD *thd)
count_field_types(tmp_table_param,all_fields,0);
if (table)
{
+ /*
+ We come here when we are getting the result from a temporary table,
+ not the original tables used in the query
+ */
free_tmp_table(thd, table);
tmp_table_param->cleanup();
}
/*
- We have to create a temporary table for that we get descriptions of fields
+ We have to create a temporary table to get descriptions of fields
(types, sizes and so on).
+
+ Note that in the table, we first have the ORDER BY fields, then the
+ field list.
*/
if (!(table=create_tmp_table(thd, tmp_table_param, all_fields, 0,
0, 0, 0,select_lex->options | thd->options,
@@ -1990,27 +2142,17 @@ bool Item_func_group_concat::setup(THD *thd)
table->file->extra(HA_EXTRA_NO_ROWS);
table->no_rows= 1;
+ key_length= table->reclength;
+ record= table->record[0];
- Field** field, **field_end;
- field_end = (field = table->field) + table->fields;
- uint offset = 0;
- for (key_length = 0; field < field_end; ++field)
- {
- uint32 length= (*field)->pack_length();
- (*field)->abs_offset= offset;
- offset+= length;
- key_length += length;
- }
- rec_offset = table->reclength - key_length;
-
+ /* Offset to first result field in table */
+ field_list_offset= table->fields - (list.elements - const_fields);
if (tree_mode)
delete_tree(tree);
- /*
- choise function of sort
- */
+
+ /* choose function of sort */
tree_mode= distinct || arg_count_order;
- qsort_cmp2 compare_key;
if (tree_mode)
{
if (arg_count_order)
@@ -2022,21 +2164,20 @@ bool Item_func_group_concat::setup(THD *thd)
}
else
{
+ compare_key= NULL;
if (distinct)
compare_key= (qsort_cmp2) group_concat_key_cmp_with_distinct;
- else
- compare_key= NULL;
}
/*
- Create a tree of sort. Tree is used for a sort and a remove dubl
- values (according with syntax of the function). If function does't
+ Create a tree of sort. Tree is used for a sort and a remove double
+ values (according with syntax of the function). If function doesn't
contain DISTINCT and ORDER BY clauses, we don't create this tree.
*/
init_tree(tree, min(thd->variables.max_heap_table_size,
- thd->variables.sortbuff_size/16), 0,
+ thd->variables.sortbuff_size/16), 0,
key_length, compare_key, 0, NULL, (void*) this);
- max_elements_in_tree= ((key_length) ?
- thd->variables.max_heap_table_size/key_length : 1);
+ max_elements_in_tree= (key_length ?
+ thd->variables.max_heap_table_size/key_length : 1);
};
/*
@@ -2051,6 +2192,7 @@ bool Item_func_group_concat::setup(THD *thd)
DBUG_RETURN(0);
}
+
/* This is used by rollup to create a separate usable copy of the function */
void Item_func_group_concat::make_unique()
@@ -2064,6 +2206,7 @@ void Item_func_group_concat::make_unique()
String* Item_func_group_concat::val_str(String* str)
{
+ DBUG_ASSERT(fixed == 1);
if (null_value)
return 0;
if (tree_mode)
@@ -2092,7 +2235,7 @@ void Item_func_group_concat::print(String *str)
str->append("group_concat(", 13);
if (distinct)
str->append("distinct ", 9);
- for (uint i= 0; i < arg_count; i++)
+ for (uint i= 0; i < arg_count_field; i++)
{
if (i)
str->append(',');
diff --git a/sql/item_sum.h b/sql/item_sum.h
index 1957f652afe..170a142545e 100644
--- a/sql/item_sum.h
+++ b/sql/item_sum.h
@@ -32,38 +32,32 @@ public:
SUM_BIT_FUNC, UDF_SUM_FUNC, GROUP_CONCAT_FUNC
};
- Item **args,*tmp_args[2];
+ Item **args, *tmp_args[2];
+ Item **args_copy; /* copy of arguments for PS */
uint arg_count;
bool quick_group; /* If incremental update of fields */
void mark_as_sum_func();
- Item_sum() : arg_count(0),quick_group(1)
+ Item_sum() :args_copy(0), arg_count(0), quick_group(1)
{
mark_as_sum_func();
}
- Item_sum(Item *a) :quick_group(1)
+ Item_sum(Item *a)
+ :args(tmp_args), args_copy(0), arg_count(1), quick_group(1)
{
- arg_count=1;
- args=tmp_args;
args[0]=a;
mark_as_sum_func();
}
- Item_sum( Item *a, Item *b ) :quick_group(1)
+ Item_sum( Item *a, Item *b )
+ :args(tmp_args), args_copy(0), arg_count(2), quick_group(1)
{
- arg_count=2;
- args=tmp_args;
args[0]=a; args[1]=b;
mark_as_sum_func();
}
Item_sum(List<Item> &list);
//Copy constructor, need to perform subselects with temporary tables
Item_sum(THD *thd, Item_sum *item);
- void cleanup()
- {
- Item_result_field::cleanup();
- result_field=0;
- }
-
+ void cleanup();
enum Type type() const { return SUM_FUNC_ITEM; }
virtual enum Sumfunctype sum_func () const=0;
inline bool reset() { clear(); return add(); };
@@ -86,7 +80,7 @@ public:
virtual void fix_length_and_dec() { maybe_null=1; null_value=1; }
virtual const char *func_name() const { return "?"; }
virtual Item *result_item(Field *field)
- { return new Item_field(field);}
+ { return new Item_field(field);}
table_map used_tables() const { return ~(table_map) 0; } /* Not used */
bool const_item() const { return 0; }
bool is_null() { return null_value; }
@@ -98,6 +92,8 @@ public:
virtual bool setup(THD *thd) {return 0;}
virtual void make_unique() {}
Item *get_tmp_table_item(THD *thd);
+ bool save_args_for_prepared_statements(THD *);
+ bool save_args(Statement* stmt);
bool walk (Item_processor processor, byte *argument);
};
@@ -112,7 +108,8 @@ public:
Item_sum_num(List<Item> &list) :Item_sum(list) {}
Item_sum_num(THD *thd, Item_sum_num *item) :Item_sum(thd, item) {}
bool fix_fields(THD *, TABLE_LIST *, Item **);
- longlong val_int() { return (longlong) val(); } /* Real as default */
+ longlong val_int()
+ { DBUG_ASSERT(fixed == 1); return (longlong) val(); } /* Real as default */
String *val_str(String*str);
void reset_field();
};
@@ -124,7 +121,7 @@ public:
Item_sum_int(Item *item_par) :Item_sum_num(item_par) {}
Item_sum_int(List<Item> &list) :Item_sum_num(list) {}
Item_sum_int(THD *thd, Item_sum_int *item) :Item_sum_num(thd, item) {}
- double val() { return (double) val_int(); }
+ double val() { DBUG_ASSERT(fixed == 1); return (double) val_int(); }
String *val_str(String*str);
enum Item_result result_type () const { return INT_RESULT; }
void fix_length_and_dec()
@@ -220,7 +217,6 @@ class Item_sum_count_distinct :public Item_sum_int
{
TABLE *table;
table_map used_table_cache;
- bool fix_fields(THD *thd, TABLE_LIST *tables, Item **ref);
uint32 *field_lengths;
TMP_TABLE_PARAM *tmp_table_param;
TREE tree_base;
@@ -234,18 +230,24 @@ class Item_sum_count_distinct :public Item_sum_int
uint key_length;
CHARSET_INFO *key_charset;
- // calculated based on max_heap_table_size. If reached,
- // walk the tree and dump it into MyISAM table
+ /*
+ Calculated based on max_heap_table_size. If reached,
+ walk the tree and dump it into MyISAM table
+ */
uint max_elements_in_tree;
- // the first few bytes of record ( at least one)
- // are just markers for deleted and NULLs. We want to skip them since
- // they will just bloat the tree without providing any valuable info
+ /*
+ The first few bytes of record ( at least one)
+ are just markers for deleted and NULLs. We want to skip them since
+ they will just bloat the tree without providing any valuable info
+ */
int rec_offset;
- // If there are no blobs, we can use a tree, which
- // is faster than heap table. In that case, we still use the table
- // to help get things set up, but we insert nothing in it
+ /*
+ If there are no blobs, we can use a tree, which
+ is faster than heap table. In that case, we still use the table
+ to help get things set up, but we insert nothing in it
+ */
bool use_tree;
bool always_null; // Set to 1 if the result is always NULL
@@ -266,7 +268,8 @@ class Item_sum_count_distinct :public Item_sum_int
Item_sum_count_distinct(THD *thd, Item_sum_count_distinct *item)
:Item_sum_int(thd, item), table(item->table),
used_table_cache(item->used_table_cache),
- field_lengths(item->field_lengths), tmp_table_param(item->tmp_table_param),
+ field_lengths(item->field_lengths),
+ tmp_table_param(item->tmp_table_param),
tree(item->tree), original(item), key_length(item->key_length),
max_elements_in_tree(item->max_elements_in_tree),
rec_offset(item->rec_offset), use_tree(item->use_tree),
@@ -301,7 +304,7 @@ public:
Item_avg_field(Item_sum_avg *item);
enum Type type() const { return FIELD_AVG_ITEM; }
double val();
- longlong val_int() { return (longlong) val(); }
+ longlong val_int() { /* can't be fix_fields()ed */ return (longlong) val(); }
bool is_null() { (void) val_int(); return null_value; }
String *val_str(String*);
enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; }
@@ -317,7 +320,7 @@ class Item_sum_avg :public Item_sum_num
ulonglong count;
public:
- Item_sum_avg(Item *item_par) :Item_sum_num(item_par),count(0) {}
+ Item_sum_avg(Item *item_par) :Item_sum_num(item_par), sum(0.0), count(0) {}
Item_sum_avg(THD *thd, Item_sum_avg *item)
:Item_sum_num(thd, item), sum(item->sum), count(item->count) {}
enum Sumfunctype sum_func () const {return AVG_FUNC;}
@@ -341,25 +344,24 @@ public:
Item_variance_field(Item_sum_variance *item);
enum Type type() const {return FIELD_VARIANCE_ITEM; }
double val();
- longlong val_int() { return (longlong) val(); }
+ longlong val_int() { /* can't be fix_fields()ed */ return (longlong) val(); }
String *val_str(String*);
bool is_null() { (void) val_int(); return null_value; }
enum_field_types field_type() const { return MYSQL_TYPE_DOUBLE; }
void fix_length_and_dec() {}
};
-/*
-
-variance(a) =
-
-= sum (ai - avg(a))^2 / count(a) )
-= sum (ai^2 - 2*ai*avg(a) + avg(a)^2) / count(a)
-= (sum(ai^2) - sum(2*ai*avg(a)) + sum(avg(a)^2))/count(a) =
-= (sum(ai^2) - 2*avg(a)*sum(a) + count(a)*avg(a)^2)/count(a) =
-= (sum(ai^2) - 2*sum(a)*sum(a)/count(a) + count(a)*sum(a)^2/count(a)^2 )/count(a) =
-= (sum(ai^2) - 2*sum(a)^2/count(a) + sum(a)^2/count(a) )/count(a) =
-= (sum(ai^2) - sum(a)^2/count(a))/count(a)
+/*
+ variance(a) =
+
+ = sum (ai - avg(a))^2 / count(a) )
+ = sum (ai^2 - 2*ai*avg(a) + avg(a)^2) / count(a)
+ = (sum(ai^2) - sum(2*ai*avg(a)) + sum(avg(a)^2))/count(a) =
+ = (sum(ai^2) - 2*avg(a)*sum(a) + count(a)*avg(a)^2)/count(a) =
+ = (sum(ai^2) - 2*sum(a)*sum(a)/count(a) + count(a)*sum(a)^2/count(a)^2 )/count(a) =
+ = (sum(ai^2) - 2*sum(a)^2/count(a) + sum(a)^2/count(a) )/count(a) =
+ = (sum(ai^2) - sum(a)^2/count(a))/count(a)
*/
class Item_sum_variance : public Item_sum_num
@@ -545,8 +547,9 @@ class Item_sum_xor :public Item_sum_bit
/*
-** user defined aggregates
+ User defined aggregates
*/
+
#ifdef HAVE_DLOPEN
class Item_udf_sum : public Item_sum
@@ -564,6 +567,7 @@ public:
const char *func_name() const { return udf.name(); }
bool fix_fields(THD *thd, TABLE_LIST *tables, Item **ref)
{
+ DBUG_ASSERT(fixed == 0);
fixed= 1;
return udf.fix_fields(thd,tables,this,this->arg_count,this->args);
}
@@ -585,7 +589,8 @@ class Item_sum_udf_float :public Item_udf_sum
:Item_udf_sum(udf_arg,list) {}
Item_sum_udf_float(THD *thd, Item_sum_udf_float *item)
:Item_udf_sum(thd, item) {}
- longlong val_int() { return (longlong) Item_sum_udf_float::val(); }
+ longlong val_int()
+ { DBUG_ASSERT(fixed == 1); return (longlong) Item_sum_udf_float::val(); }
double val();
String *val_str(String*str);
void fix_length_and_dec() { fix_num_length_and_dec(); }
@@ -602,7 +607,8 @@ public:
Item_sum_udf_int(THD *thd, Item_sum_udf_int *item)
:Item_udf_sum(thd, item) {}
longlong val_int();
- double val() { return (double) Item_sum_udf_int::val_int(); }
+ double val()
+ { DBUG_ASSERT(fixed == 1); return (double) Item_sum_udf_int::val_int(); }
String *val_str(String*str);
enum Item_result result_type () const { return INT_RESULT; }
void fix_length_and_dec() { decimals=0; max_length=21; }
@@ -647,7 +653,7 @@ class Item_sum_udf_float :public Item_sum_num
Item_sum_udf_float(THD *thd, Item_sum_udf_float *item)
:Item_sum_num(thd, item) {}
enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; }
- double val() { return 0.0; }
+ double val() { DBUG_ASSERT(fixed == 1); return 0.0; }
void clear() {}
bool add() { return 0; }
void update_field() {}
@@ -662,8 +668,8 @@ public:
Item_sum_udf_int(THD *thd, Item_sum_udf_int *item)
:Item_sum_num(thd, item) {}
enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; }
- longlong val_int() { return 0; }
- double val() { return 0; }
+ longlong val_int() { DBUG_ASSERT(fixed == 1); return 0; }
+ double val() { DBUG_ASSERT(fixed == 1); return 0; }
void clear() {}
bool add() { return 0; }
void update_field() {}
@@ -677,9 +683,10 @@ public:
Item_sum_udf_str(udf_func *udf_arg, List<Item> &list) :Item_sum_num() {}
Item_sum_udf_str(THD *thd, Item_sum_udf_str *item)
:Item_sum_num(thd, item) {}
- String *val_str(String *) { null_value=1; return 0; }
- double val() { null_value=1; return 0.0; }
- longlong val_int() { null_value=1; return 0; }
+ String *val_str(String *)
+ { DBUG_ASSERT(fixed == 1); null_value=1; return 0; }
+ double val() { DBUG_ASSERT(fixed == 1); null_value=1; return 0.0; }
+ longlong val_int() { DBUG_ASSERT(fixed == 1); null_value=1; return 0; }
enum Item_result result_type () const { return STRING_RESULT; }
void fix_length_and_dec() { maybe_null=1; max_length=0; }
enum Sumfunctype sum_func () const { return UDF_SUM_FUNC; }
@@ -700,7 +707,6 @@ class Item_func_group_concat : public Item_sum
MYSQL_ERROR *warning;
bool warning_available;
uint key_length;
- int rec_offset;
bool tree_mode;
bool distinct;
bool warning_for_row;
@@ -708,12 +714,13 @@ class Item_func_group_concat : public Item_sum
friend int group_concat_key_cmp_with_distinct(void* arg, byte* key1,
byte* key2);
- friend int group_concat_key_cmp_with_order(void* arg, byte* key1, byte* key2);
+ friend int group_concat_key_cmp_with_order(void* arg, byte* key1,
+ byte* key2);
friend int group_concat_key_cmp_with_distinct_and_order(void* arg,
byte* key1,
byte* key2);
friend int dump_leaf_key(byte* key, uint32 count __attribute__((unused)),
- Item_func_group_concat *group_concat_item);
+ Item_func_group_concat *group_concat_item);
public:
String result;
@@ -727,7 +734,7 @@ class Item_func_group_concat : public Item_sum
uint show_elements;
uint arg_count_order;
uint arg_count_field;
- uint arg_show_fields;
+ uint field_list_offset;
uint count_cut_values;
/*
Following is 0 normal object and pointer to original one for copy
@@ -738,38 +745,12 @@ class Item_func_group_concat : public Item_sum
Item_func_group_concat(bool is_distinct,List<Item> *is_select,
SQL_LIST *is_order,String *is_separator);
- Item_func_group_concat(THD *thd, Item_func_group_concat *item)
- :Item_sum(thd, item),item_thd(thd),
- tmp_table_param(item->tmp_table_param),
- max_elements_in_tree(item->max_elements_in_tree),
- warning(item->warning),
- warning_available(item->warning_available),
- key_length(item->key_length),
- rec_offset(item->rec_offset),
- tree_mode(item->tree_mode),
- distinct(item->distinct),
- warning_for_row(item->warning_for_row),
- separator(item->separator),
- tree(item->tree),
- table(item->table),
- 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),
- arg_show_fields(item->arg_show_fields),
- count_cut_values(item->count_cut_values),
- original(item)
- {
- quick_group= item->quick_group;
- };
+ Item_func_group_concat(THD *thd, Item_func_group_concat *item);
~Item_func_group_concat();
void cleanup();
enum Sumfunctype sum_func () const {return GROUP_CONCAT_FUNC;}
const char *func_name() const { return "group_concat"; }
- enum Type type() const { return SUM_FUNC_ITEM; }
virtual Item_result result_type () const { return STRING_RESULT; }
void clear();
bool add();
@@ -781,7 +762,7 @@ class Item_func_group_concat : public Item_sum
double val()
{
String *res; res=val_str(&str_value);
- return res ? atof(res->c_ptr()) : 0.0;
+ return res ? my_atof(res->c_ptr()) : 0.0;
}
longlong val_int()
{
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index e49f2287f4b..ffa00832778 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -48,11 +48,6 @@ TYPELIB day_names_typelib=
{ array_elements(day_names)-1,"", day_names};
-enum date_time_format_types
-{
- TIME_ONLY= 0, TIME_MICROSECOND, DATE_ONLY, DATE_TIME, DATE_TIME_MICROSECOND
-};
-
/*
OPTIMIZATION TODO:
- Replace the switch with a function that should be called for each
@@ -128,6 +123,9 @@ static bool make_datetime(date_time_format_types format, TIME *ltime,
val String to decode
length Length of string
l_time Store result here
+ cached_timestamp_type
+ It uses to get an appropriate warning
+ in the case when the value is truncated.
RETURN
0 ok
@@ -135,7 +133,8 @@ static bool make_datetime(date_time_format_types format, TIME *ltime,
*/
static bool extract_date_time(DATE_TIME_FORMAT *format,
- const char *val, uint length, TIME *l_time)
+ const char *val, uint length, TIME *l_time,
+ timestamp_type cached_timestamp_type)
{
int weekday= 0, yearday= 0, daypart= 0;
int week_number= -1;
@@ -143,9 +142,11 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
int error= 0;
bool usa_time= 0;
bool sunday_first= 0;
+ int frac_part;
+ const char *val_begin= val;
const char *val_end= val + length;
const char *ptr= format->format.str;
- const char *end= ptr+ format->format.length;
+ const char *end= ptr + format->format.length;
DBUG_ENTER("extract_date_time");
bzero((char*) l_time, sizeof(*l_time));
@@ -235,7 +236,12 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
/* Second part */
case 'f':
tmp= (char*) val_end;
+ if (tmp - val > 6)
+ tmp= (char*) val + 6;
l_time->second_part= (int) my_strtoll10(val, &tmp, &error);
+ frac_part= 6 - (tmp - val);
+ if (frac_part > 0)
+ l_time->second_part*= (ulong) log_10_int[frac_part];
val= tmp;
break;
@@ -251,6 +257,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
(const uchar *) val, 2,
(const uchar *) "AM", 2))
goto err;
+ val+= 2;
break;
/* Exotic things */
@@ -281,6 +288,18 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
val= tmp;
break;
+ case '.':
+ while (my_ispunct(cs, *val) && val != val_end)
+ val++;
+ break;
+ case '@':
+ while (my_isalpha(cs, *val) && val != val_end)
+ val++;
+ break;
+ case '#':
+ while (my_isdigit(cs, *val) && val != val_end)
+ val++;
+ break;
default:
goto err;
}
@@ -348,6 +367,18 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
l_time->minute > 59 || l_time->second > 59)
goto err;
+ if (val != val_end)
+ {
+ do
+ {
+ if (!my_isspace(&my_charset_latin1,*val))
+ {
+ make_truncated_value_warning(current_thd, val_begin, length,
+ cached_timestamp_type);
+ break;
+ }
+ } while (++val != val_end);
+ }
DBUG_RETURN(0);
err:
@@ -584,16 +615,27 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time,
/*
-** Get a array of positive numbers from a string object.
-** Each number is separated by 1 non digit character
-** Return error if there is too many numbers.
-** If there is too few numbers, assume that the numbers are left out
-** from the high end. This allows one to give:
-** DAY_TO_SECOND as "D MM:HH:SS", "MM:HH:SS" "HH:SS" or as seconds.
+ Get a array of positive numbers from a string object.
+ Each number is separated by 1 non digit character
+ Return error if there is too many numbers.
+ If there is too few numbers, assume that the numbers are left out
+ from the high end. This allows one to give:
+ DAY_TO_SECOND as "D MM:HH:SS", "MM:HH:SS" "HH:SS" or as seconds.
+
+ SYNOPSIS
+ str: string value
+ length: length of str
+ cs: charset of str
+ values: array of results
+ count: count of elements in result array
+ transform_msec: if value is true we suppose
+ that the last part of string value is microseconds
+ and we should transform value to six digit value.
+ For example, '1.1' -> '1.100000'
*/
bool get_interval_info(const char *str,uint length,CHARSET_INFO *cs,
- uint count, long *values)
+ uint count, long *values, bool transform_msec)
{
const char *end=str+length;
uint i;
@@ -603,8 +645,15 @@ bool get_interval_info(const char *str,uint length,CHARSET_INFO *cs,
for (i=0 ; i < count ; i++)
{
long value;
+ const char *start= str;
for (value=0; str != end && my_isdigit(cs,*str) ; str++)
value=value*10L + (long) (*str - '0');
+ if (transform_msec && i == count - 1) // microseconds always last
+ {
+ long msec_length= 6 - (str - start);
+ if (msec_length > 0)
+ value*= (long) log_10_int[msec_length];
+ }
values[i]= value;
while (str != end && !my_isdigit(cs,*str))
str++;
@@ -623,6 +672,7 @@ bool get_interval_info(const char *str,uint length,CHARSET_INFO *cs,
longlong Item_func_period_add::val_int()
{
+ DBUG_ASSERT(fixed == 1);
ulong period=(ulong) args[0]->val_int();
int months=(int) args[1]->val_int();
@@ -637,6 +687,7 @@ longlong Item_func_period_add::val_int()
longlong Item_func_period_diff::val_int()
{
+ DBUG_ASSERT(fixed == 1);
ulong period1=(ulong) args[0]->val_int();
ulong period2=(ulong) args[1]->val_int();
@@ -650,6 +701,7 @@ longlong Item_func_period_diff::val_int()
longlong Item_func_to_days::val_int()
{
+ DBUG_ASSERT(fixed == 1);
TIME ltime;
if (get_arg0_date(&ltime,0))
return 0;
@@ -658,6 +710,7 @@ longlong Item_func_to_days::val_int()
longlong Item_func_dayofyear::val_int()
{
+ DBUG_ASSERT(fixed == 1);
TIME ltime;
if (get_arg0_date(&ltime,0))
return 0;
@@ -667,6 +720,7 @@ longlong Item_func_dayofyear::val_int()
longlong Item_func_dayofmonth::val_int()
{
+ DBUG_ASSERT(fixed == 1);
TIME ltime;
(void) get_arg0_date(&ltime,1);
return (longlong) ltime.day;
@@ -674,6 +728,7 @@ longlong Item_func_dayofmonth::val_int()
longlong Item_func_month::val_int()
{
+ DBUG_ASSERT(fixed == 1);
TIME ltime;
(void) get_arg0_date(&ltime,1);
return (longlong) ltime.month;
@@ -682,6 +737,7 @@ longlong Item_func_month::val_int()
String* Item_func_monthname::val_str(String* str)
{
+ DBUG_ASSERT(fixed == 1);
const char *month_name;
uint month=(uint) Item_func_month::val_int();
@@ -701,6 +757,7 @@ String* Item_func_monthname::val_str(String* str)
longlong Item_func_quarter::val_int()
{
+ DBUG_ASSERT(fixed == 1);
TIME ltime;
(void) get_arg0_date(&ltime,1);
return (longlong) ((ltime.month+2)/3);
@@ -708,6 +765,7 @@ longlong Item_func_quarter::val_int()
longlong Item_func_hour::val_int()
{
+ DBUG_ASSERT(fixed == 1);
TIME ltime;
(void) get_arg0_time(&ltime);
return ltime.hour;
@@ -715,6 +773,7 @@ longlong Item_func_hour::val_int()
longlong Item_func_minute::val_int()
{
+ DBUG_ASSERT(fixed == 1);
TIME ltime;
(void) get_arg0_time(&ltime);
return ltime.minute;
@@ -723,6 +782,7 @@ longlong Item_func_minute::val_int()
longlong Item_func_second::val_int()
{
+ DBUG_ASSERT(fixed == 1);
TIME ltime;
(void) get_arg0_time(&ltime);
return ltime.second;
@@ -768,6 +828,7 @@ uint week_mode(uint mode)
longlong Item_func_week::val_int()
{
+ DBUG_ASSERT(fixed == 1);
uint year;
TIME ltime;
if (get_arg0_date(&ltime,0))
@@ -780,6 +841,7 @@ longlong Item_func_week::val_int()
longlong Item_func_yearweek::val_int()
{
+ DBUG_ASSERT(fixed == 1);
uint year,week;
TIME ltime;
if (get_arg0_date(&ltime,0))
@@ -795,6 +857,7 @@ longlong Item_func_yearweek::val_int()
longlong Item_func_weekday::val_int()
{
+ DBUG_ASSERT(fixed == 1);
ulong tmp_value=(ulong) args[0]->val_int();
if ((null_value=(args[0]->null_value || !tmp_value)))
return 0; /* purecov: inspected */
@@ -805,6 +868,7 @@ longlong Item_func_weekday::val_int()
String* Item_func_dayname::val_str(String* str)
{
+ DBUG_ASSERT(fixed == 1);
uint weekday=(uint) val_int(); // Always Item_func_daynr()
const char *name;
@@ -819,6 +883,7 @@ String* Item_func_dayname::val_str(String* str)
longlong Item_func_year::val_int()
{
+ DBUG_ASSERT(fixed == 1);
TIME ltime;
(void) get_arg0_date(&ltime,1);
return (longlong) ltime.year;
@@ -827,6 +892,7 @@ longlong Item_func_year::val_int()
longlong Item_func_unix_timestamp::val_int()
{
+ DBUG_ASSERT(fixed == 1);
if (arg_count == 0)
return (longlong) current_thd->query_start();
if (args[0]->type() == FIELD_ITEM)
@@ -846,6 +912,7 @@ longlong Item_func_unix_timestamp::val_int()
longlong Item_func_time_to_sec::val_int()
{
+ DBUG_ASSERT(fixed == 1);
TIME ltime;
longlong seconds;
(void) get_arg0_time(&ltime);
@@ -931,19 +998,19 @@ static bool get_interval_value(Item *args,interval_type int_type,
interval->second=value;
break;
case INTERVAL_YEAR_MONTH: // Allow YEAR-MONTH YYYYYMM
- if (get_interval_info(str,length,cs,2,array))
+ if (get_interval_info(str,length,cs,2,array,0))
return (1);
interval->year=array[0];
interval->month=array[1];
break;
case INTERVAL_DAY_HOUR:
- if (get_interval_info(str,length,cs,2,array))
+ if (get_interval_info(str,length,cs,2,array,0))
return (1);
interval->day=array[0];
interval->hour=array[1];
break;
case INTERVAL_DAY_MICROSECOND:
- if (get_interval_info(str,length,cs,5,array))
+ if (get_interval_info(str,length,cs,5,array,1))
return (1);
interval->day=array[0];
interval->hour=array[1];
@@ -952,14 +1019,14 @@ static bool get_interval_value(Item *args,interval_type int_type,
interval->second_part=array[4];
break;
case INTERVAL_DAY_MINUTE:
- if (get_interval_info(str,length,cs,3,array))
+ if (get_interval_info(str,length,cs,3,array,0))
return (1);
interval->day=array[0];
interval->hour=array[1];
interval->minute=array[2];
break;
case INTERVAL_DAY_SECOND:
- if (get_interval_info(str,length,cs,4,array))
+ if (get_interval_info(str,length,cs,4,array,0))
return (1);
interval->day=array[0];
interval->hour=array[1];
@@ -967,7 +1034,7 @@ static bool get_interval_value(Item *args,interval_type int_type,
interval->second=array[3];
break;
case INTERVAL_HOUR_MICROSECOND:
- if (get_interval_info(str,length,cs,4,array))
+ if (get_interval_info(str,length,cs,4,array,1))
return (1);
interval->hour=array[0];
interval->minute=array[1];
@@ -975,33 +1042,33 @@ static bool get_interval_value(Item *args,interval_type int_type,
interval->second_part=array[3];
break;
case INTERVAL_HOUR_MINUTE:
- if (get_interval_info(str,length,cs,2,array))
+ if (get_interval_info(str,length,cs,2,array,0))
return (1);
interval->hour=array[0];
interval->minute=array[1];
break;
case INTERVAL_HOUR_SECOND:
- if (get_interval_info(str,length,cs,3,array))
+ if (get_interval_info(str,length,cs,3,array,0))
return (1);
interval->hour=array[0];
interval->minute=array[1];
interval->second=array[2];
break;
case INTERVAL_MINUTE_MICROSECOND:
- if (get_interval_info(str,length,cs,3,array))
+ if (get_interval_info(str,length,cs,3,array,1))
return (1);
interval->minute=array[0];
interval->second=array[1];
interval->second_part=array[2];
break;
case INTERVAL_MINUTE_SECOND:
- if (get_interval_info(str,length,cs,2,array))
+ if (get_interval_info(str,length,cs,2,array,0))
return (1);
interval->minute=array[0];
interval->second=array[1];
break;
case INTERVAL_SECOND_MICROSECOND:
- if (get_interval_info(str,length,cs,2,array))
+ if (get_interval_info(str,length,cs,2,array,1))
return (1);
interval->second=array[0];
interval->second_part=array[1];
@@ -1013,23 +1080,15 @@ static bool get_interval_value(Item *args,interval_type int_type,
String *Item_date::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
TIME ltime;
- ulong value=(ulong) val_int();
- if (null_value)
- return (String*) 0;
-
+ if (get_date(&ltime, TIME_FUZZY_DATE))
+ return (String *) 0;
if (str->alloc(11))
{
null_value= 1;
return (String *) 0;
}
-
- ltime.year= (value/10000L) % 10000;
- ltime.month= (value/100)%100;
- ltime.day= (value%100);
- ltime.neg= 0;
- ltime.time_type=TIMESTAMP_DATE;
-
make_date((DATE_TIME_FORMAT *) 0, &ltime, str);
return str;
}
@@ -1038,28 +1097,33 @@ String *Item_date::val_str(String *str)
int Item_date::save_in_field(Field *field, bool no_conversions)
{
TIME ltime;
- timestamp_type t_type=TIMESTAMP_DATETIME;
if (get_date(&ltime, TIME_FUZZY_DATE))
- {
- if (null_value)
- return set_field_to_null(field);
- t_type=TIMESTAMP_NONE; // Error
- }
+ return set_field_to_null(field);
field->set_notnull();
- field->store_time(&ltime,t_type);
+ field->store_time(&ltime, TIMESTAMP_DATE);
return 0;
}
-longlong Item_func_from_days::val_int()
+longlong Item_date::val_int()
+{
+ DBUG_ASSERT(fixed == 1);
+ TIME ltime;
+ if (get_date(&ltime, TIME_FUZZY_DATE))
+ return 0;
+ return (longlong) (ltime.year*10000L+ltime.month*100+ltime.day);
+}
+
+
+bool Item_func_from_days::get_date(TIME *ltime, uint fuzzy_date)
{
longlong value=args[0]->val_int();
if ((null_value=args[0]->null_value))
- return 0; /* purecov: inspected */
-
- uint year,month,day;
- get_date_from_daynr((long) value,&year,&month,&day);
- return (longlong) (year*10000L+month*100+day);
+ return 1;
+ bzero(ltime, sizeof(TIME));
+ get_date_from_daynr((long) value, &ltime->year, &ltime->month, &ltime->day);
+ ltime->time_type= TIMESTAMP_DATE;
+ return 0;
}
@@ -1088,6 +1152,17 @@ void Item_func_curdate::fix_length_and_dec()
ltime.time_type=TIMESTAMP_DATE;
}
+String *Item_func_curdate::val_str(String *str)
+{
+ DBUG_ASSERT(fixed == 1);
+ if (str->alloc(11))
+ {
+ null_value= 1;
+ return (String *) 0;
+ }
+ make_date((DATE_TIME_FORMAT *) 0, &ltime, str);
+ return str;
+}
bool Item_func_curdate::get_date(TIME *res,
uint fuzzy_date __attribute__((unused)))
@@ -1118,7 +1193,8 @@ void Item_func_curdate_utc::store_now_in_tm(time_t now, struct tm *now_tm)
String *Item_func_curtime::val_str(String *str)
-{
+{
+ DBUG_ASSERT(fixed == 1);
str_value.set(buff, buff_length, &my_charset_bin);
return &str_value;
}
@@ -1168,6 +1244,7 @@ void Item_func_curtime_utc::store_now_in_tm(time_t now, struct tm *now_tm)
String *Item_func_now::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
str_value.set(buff,buff_length, &my_charset_bin);
return &str_value;
}
@@ -1243,6 +1320,7 @@ void Item_func_now_utc::store_now_in_tm(time_t now, struct tm *now_tm)
String *Item_func_sec_to_time::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
longlong seconds=(longlong) args[0]->val_int();
uint sec;
TIME ltime;
@@ -1273,6 +1351,7 @@ String *Item_func_sec_to_time::val_str(String *str)
longlong Item_func_sec_to_time::val_int()
{
+ DBUG_ASSERT(fixed == 1);
longlong seconds=args[0]->val_int();
longlong sign=1;
if ((null_value=args[0]->null_value))
@@ -1381,6 +1460,7 @@ uint Item_func_date_format::format_length(const String *format)
String *Item_func_date_format::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *format;
TIME l_time;
uint size;
@@ -1430,6 +1510,7 @@ null_date:
String *Item_func_from_unixtime::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
struct tm tm_tmp,*start;
time_t tmp=(time_t) args[0]->val_int();
TIME ltime;
@@ -1462,6 +1543,7 @@ null_date:
longlong Item_func_from_unixtime::val_int()
{
+ DBUG_ASSERT(fixed == 1);
time_t tmp=(time_t) (ulong) args[0]->val_int();
if ((null_value=args[0]->null_value))
return 0;
@@ -1640,6 +1722,7 @@ bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date)
String *Item_date_add_interval::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
TIME ltime;
enum date_time_format_types format;
@@ -1663,6 +1746,7 @@ String *Item_date_add_interval::val_str(String *str)
longlong Item_date_add_interval::val_int()
{
+ DBUG_ASSERT(fixed == 1);
TIME ltime;
longlong date;
if (Item_date_add_interval::get_date(&ltime,0))
@@ -1735,6 +1819,7 @@ void Item_extract::fix_length_and_dec()
longlong Item_extract::val_int()
{
+ DBUG_ASSERT(fixed == 1);
TIME ltime;
uint year;
ulong week_format;
@@ -1854,6 +1939,7 @@ void Item_char_typecast::print(String *str)
String *Item_char_typecast::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
String *res, *res1;
uint32 length;
@@ -1910,6 +1996,7 @@ void Item_char_typecast::fix_length_and_dec()
String *Item_datetime_typecast::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
TIME ltime;
if (!get_arg0_date(&ltime,1) &&
!make_datetime(ltime.second_part ? DATE_TIME_MICROSECOND : DATE_TIME,
@@ -1931,6 +2018,7 @@ bool Item_time_typecast::get_time(TIME *ltime)
String *Item_time_typecast::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
TIME ltime;
if (!get_arg0_time(&ltime) &&
@@ -1953,6 +2041,7 @@ bool Item_date_typecast::get_date(TIME *ltime, uint fuzzy_date)
String *Item_date_typecast::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
TIME ltime;
if (!get_arg0_date(&ltime,1) && !str->alloc(11))
@@ -1973,6 +2062,7 @@ String *Item_date_typecast::val_str(String *str)
String *Item_func_makedate::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
TIME l_time;
long daynr= (long) args[1]->val_int();
long yearnr= (long) args[0]->val_int();
@@ -2038,6 +2128,7 @@ void Item_func_add_time::fix_length_and_dec()
String *Item_func_add_time::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
TIME l_time1, l_time2, l_time3;
bool is_time= 0;
long microseconds, seconds, days= 0;
@@ -2232,6 +2323,7 @@ bool calc_time_diff(TIME *l_time1,TIME *l_time2, int l_sign,
String *Item_func_timediff::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
longlong seconds;
long microseconds;
int l_sign= 1;
@@ -2277,6 +2369,7 @@ null_date:
String *Item_func_maketime::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
TIME ltime;
long hour= (long) args[0]->val_int();
@@ -2315,6 +2408,7 @@ String *Item_func_maketime::val_str(String *str)
longlong Item_func_microsecond::val_int()
{
+ DBUG_ASSERT(fixed == 1);
TIME ltime;
if (!get_arg0_time(&ltime))
return ltime.second_part;
@@ -2484,6 +2578,7 @@ void Item_func_timestamp_diff::print(String *str)
String *Item_func_get_format::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
const char *format_name;
KNOWN_DATE_TIME_FORMAT *format;
String *val= args[0]->val_str(str);
@@ -2538,6 +2633,103 @@ void Item_func_get_format::print(String *str)
}
+/*
+ check_result_type(s, l) returns DATE/TIME type
+ according to format string
+
+ s: DATE/TIME format string
+ l: length of s
+ Result: date_time_format_types value:
+ DATE_TIME_MICROSECOND, DATE_TIME,
+ TIME_MICROSECOND, TIME_ONLY
+
+ We don't process day format's characters('D', 'd', 'e')
+ because day may be a member of all date/time types.
+ If only day format's character and no time part present
+ the result type is MYSQL_TYPE_DATE
+*/
+
+date_time_format_types check_result_type(const char *format, uint length)
+{
+ const char *time_part_frms= "HISThiklrs";
+ const char *date_part_frms= "MUYWabcjmuyw";
+ bool date_part_used= 0, time_part_used= 0, frac_second_used= 0;
+
+ const char *val= format;
+ const char *end= format + length;
+
+ for (; val != end && val != end; val++)
+ {
+ if (*val == '%' && val+1 != end)
+ {
+ val++;
+ if ((frac_second_used= (*val == 'f')) ||
+ (!time_part_used && strchr(time_part_frms, *val)))
+ time_part_used= 1;
+ else if (!date_part_used && strchr(date_part_frms, *val))
+ date_part_used= 1;
+ if (time_part_used && date_part_used && frac_second_used)
+ return DATE_TIME_MICROSECOND;
+ }
+ }
+
+ if (time_part_used)
+ {
+ if (date_part_used)
+ return DATE_TIME;
+ if (frac_second_used)
+ return TIME_MICROSECOND;
+ return TIME_ONLY;
+ }
+ return DATE_ONLY;
+}
+
+
+Field *Item_func_str_to_date::tmp_table_field(TABLE *t_arg)
+{
+ if (cached_field_type == MYSQL_TYPE_TIME)
+ return (new Field_time(maybe_null, name, t_arg, &my_charset_bin));
+ if (cached_field_type == MYSQL_TYPE_DATE)
+ return (new Field_date(maybe_null, name, t_arg, &my_charset_bin));
+ if (cached_field_type == MYSQL_TYPE_DATETIME)
+ return (new Field_datetime(maybe_null, name, t_arg, &my_charset_bin));
+ return (new Field_string(max_length, maybe_null, name, t_arg, &my_charset_bin));
+}
+
+
+void Item_func_str_to_date::fix_length_and_dec()
+{
+ char format_buff[64];
+ String format_str(format_buff, sizeof(format_buff), &my_charset_bin), *format;
+ maybe_null= 1;
+ decimals=0;
+ cached_field_type= MYSQL_TYPE_STRING;
+ max_length= MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
+ cached_timestamp_type= TIMESTAMP_NONE;
+ if ((const_item= args[1]->const_item()))
+ {
+ format= args[1]->val_str(&format_str);
+ cached_format_type= check_result_type(format->ptr(), format->length());
+ switch (cached_format_type) {
+ case DATE_ONLY:
+ cached_timestamp_type= TIMESTAMP_DATE;
+ cached_field_type= MYSQL_TYPE_DATE;
+ max_length= MAX_DATE_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
+ break;
+ case TIME_ONLY:
+ case TIME_MICROSECOND:
+ cached_timestamp_type= TIMESTAMP_TIME;
+ cached_field_type= MYSQL_TYPE_TIME;
+ max_length= MAX_TIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
+ break;
+ default:
+ cached_timestamp_type= TIMESTAMP_DATETIME;
+ cached_field_type= MYSQL_TYPE_DATETIME;
+ break;
+ }
+ }
+}
+
bool Item_func_str_to_date::get_date(TIME *ltime, uint fuzzy_date)
{
DATE_TIME_FORMAT date_time_format;
@@ -2555,8 +2747,18 @@ bool Item_func_str_to_date::get_date(TIME *ltime, uint fuzzy_date)
date_time_format.format.str= (char*) format->ptr();
date_time_format.format.length= format->length();
if (extract_date_time(&date_time_format, val->ptr(), val->length(),
- ltime))
+ ltime, cached_timestamp_type))
goto null_date;
+ if (cached_timestamp_type == TIMESTAMP_TIME && ltime->day)
+ {
+ /*
+ Day part for time type can be nonzero value and so
+ we should add hours from day part to hour part to
+ keep valid time value.
+ */
+ ltime->hour+= ltime->day*24;
+ ltime->day= 0;
+ }
return 0;
null_date:
@@ -2566,34 +2768,28 @@ null_date:
String *Item_func_str_to_date::val_str(String *str)
{
+ DBUG_ASSERT(fixed == 1);
TIME ltime;
if (Item_func_str_to_date::get_date(&ltime, TIME_FUZZY_DATE))
return 0;
- /*
- The following DATE_TIME should be done dynamicly based on the
- format string (wen it's a constant). For example, we should only return
- microseconds if there was an %f in the format
- */
- if (!make_datetime(ltime.second_part ? DATE_TIME_MICROSECOND : DATE_TIME,
+ if (!make_datetime((const_item ? cached_format_type :
+ (ltime.second_part ? DATE_TIME_MICROSECOND : DATE_TIME)),
&ltime, str))
return str;
return 0;
}
-String *Item_func_last_day::val_str(String *str)
+bool Item_func_last_day::get_date(TIME *ltime, uint fuzzy_date)
{
- TIME ltime;
- if (!get_arg0_date(&ltime,0))
- {
- uint month_idx= ltime.month-1;
- ltime.day= days_in_month[month_idx];
- if ( month_idx == 1 && calc_days_in_year(ltime.year) == 366)
- ltime.day+= 1;
- if (!make_datetime(DATE_ONLY, &ltime, str))
- return str;
- }
+ if (get_arg0_date(ltime,fuzzy_date))
+ return 1;
+ uint month_idx= ltime->month-1;
+ ltime->day= days_in_month[month_idx];
+ if ( month_idx == 1 && calc_days_in_year(ltime->year) == 366)
+ ltime->day= 29;
+ ltime->time_type= TIMESTAMP_DATE;
return 0;
}
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index 9f1d7dbd85a..263969cd26b 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -21,6 +21,11 @@
#pragma interface /* gcc class implementation */
#endif
+enum date_time_format_types
+{
+ TIME_ONLY= 0, TIME_MICROSECOND, DATE_ONLY, DATE_TIME, DATE_TIME_MICROSECOND
+};
+
class Item_func_period_add :public Item_int_func
{
public:
@@ -83,7 +88,8 @@ class Item_func_month :public Item_func
public:
Item_func_month(Item *a) :Item_func(a) {}
longlong val_int();
- double val() { return (double) Item_func_month::val_int(); }
+ double val()
+ { DBUG_ASSERT(fixed == 1); return (double) Item_func_month::val_int(); }
String *val_str(String *str)
{
str->set(val_int(), &my_charset_bin);
@@ -244,9 +250,10 @@ public:
Item_func_weekday(Item *a,bool type_arg)
:Item_func(a), odbc_type(type_arg) {}
longlong val_int();
- double val() { return (double) val_int(); }
+ double val() { DBUG_ASSERT(fixed == 1); return (double) val_int(); }
String *val_str(String *str)
- {
+ {
+ DBUG_ASSERT(fixed == 1);
str->set(val_int(), &my_charset_bin);
return null_value ? 0 : str;
}
@@ -318,7 +325,8 @@ public:
enum Item_result result_type () const { return STRING_RESULT; }
enum_field_types field_type() const { return MYSQL_TYPE_DATE; }
String *val_str(String *str);
- double val() { return (double) val_int(); }
+ longlong val_int();
+ double val() { DBUG_ASSERT(fixed == 1); return (double) val_int(); }
const char *func_name() const { return "date"; }
void fix_length_and_dec()
{
@@ -360,8 +368,8 @@ public:
Item_func_curtime(Item *a) :Item_func(a) {}
enum Item_result result_type () const { return STRING_RESULT; }
enum_field_types field_type() const { return MYSQL_TYPE_TIME; }
- double val() { return (double) value; }
- longlong val_int() { return value; }
+ double val() { DBUG_ASSERT(fixed == 1); return (double) value; }
+ longlong val_int() { DBUG_ASSERT(fixed == 1); return value; }
String *val_str(String *str);
void fix_length_and_dec();
Field *tmp_table_field(TABLE *t_arg)
@@ -406,7 +414,8 @@ class Item_func_curdate :public Item_date
public:
Item_func_curdate() :Item_date() {}
void set_result_from_tm(struct tm *now);
- longlong val_int() { return (value) ; }
+ 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;
@@ -443,8 +452,8 @@ public:
Item_func_now() :Item_date_func() {}
Item_func_now(Item *a) :Item_date_func(a) {}
enum Item_result result_type () const { return STRING_RESULT; }
- double val() { return (double) value; }
- longlong val_int() { return value; }
+ double val() { DBUG_ASSERT(fixed == 1); return (double) value; }
+ longlong val_int() { DBUG_ASSERT(fixed == 1); return value; }
int save_in_field(Field *to, bool no_conversions);
String *val_str(String *str);
void fix_length_and_dec();
@@ -460,6 +469,7 @@ public:
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 enum Functype functype() const { return NOW_FUNC; }
};
@@ -477,8 +487,8 @@ class Item_func_from_days :public Item_date
{
public:
Item_func_from_days(Item *a) :Item_date(a) {}
- longlong val_int();
const char *func_name() const { return "from_days"; }
+ bool get_date(TIME *res, uint fuzzy_date);
};
@@ -501,7 +511,11 @@ class Item_func_from_unixtime :public Item_date_func
{
public:
Item_func_from_unixtime(Item *a) :Item_date_func(a) {}
- double val() { return (double) Item_func_from_unixtime::val_int(); }
+ double val()
+ {
+ DBUG_ASSERT(fixed == 1);
+ return (double) Item_func_from_unixtime::val_int();
+ }
longlong val_int();
String *val_str(String *str);
const char *func_name() const { return "from_unixtime"; }
@@ -519,7 +533,11 @@ class Item_func_sec_to_time :public Item_str_func
{
public:
Item_func_sec_to_time(Item *item) :Item_str_func(item) {}
- double val() { return (double) Item_func_sec_to_time::val_int(); }
+ double val()
+ {
+ DBUG_ASSERT(fixed == 1);
+ return (double) Item_func_sec_to_time::val_int();
+ }
longlong val_int();
String *val_str(String *);
void fix_length_and_dec()
@@ -565,7 +583,7 @@ public:
const char *func_name() const { return "date_add_interval"; }
void fix_length_and_dec();
enum_field_types field_type() const { return cached_field_type; }
- double val() { return (double) val_int(); }
+ double val() { DBUG_ASSERT(fixed == 1); return (double) val_int(); }
longlong val_int();
bool get_date(TIME *res, uint fuzzy_date);
void print(String *str);
@@ -594,6 +612,7 @@ public:
Item_typecast(Item *a) :Item_str_func(a) {}
String *val_str(String *a)
{
+ DBUG_ASSERT(fixed == 1);
String *tmp=args[0]->val_str(a);
null_value=args[0]->null_value;
if (tmp)
@@ -610,6 +629,19 @@ public:
};
+class Item_typecast_maybe_null :public Item_typecast
+{
+public:
+ Item_typecast_maybe_null(Item *a) :Item_typecast(a) {}
+ void fix_length_and_dec()
+ {
+ collation.set(&my_charset_bin);
+ max_length=args[0]->max_length;
+ maybe_null= 1;
+ }
+};
+
+
class Item_char_typecast :public Item_typecast
{
int cast_length;
@@ -626,10 +658,10 @@ public:
};
-class Item_date_typecast :public Item_typecast
+class Item_date_typecast :public Item_typecast_maybe_null
{
public:
- Item_date_typecast(Item *a) :Item_typecast(a) {}
+ Item_date_typecast(Item *a) :Item_typecast_maybe_null(a) {}
String *val_str(String *str);
bool get_date(TIME *ltime, uint fuzzy_date);
const char *cast_type() const { return "date"; }
@@ -641,10 +673,10 @@ public:
};
-class Item_time_typecast :public Item_typecast
+class Item_time_typecast :public Item_typecast_maybe_null
{
public:
- Item_time_typecast(Item *a) :Item_typecast(a) {}
+ Item_time_typecast(Item *a) :Item_typecast_maybe_null(a) {}
String *val_str(String *str);
bool get_time(TIME *ltime);
const char *cast_type() const { return "time"; }
@@ -656,10 +688,10 @@ public:
};
-class Item_datetime_typecast :public Item_typecast
+class Item_datetime_typecast :public Item_typecast_maybe_null
{
public:
- Item_datetime_typecast(Item *a) :Item_typecast(a) {}
+ Item_datetime_typecast(Item *a) :Item_typecast_maybe_null(a) {}
String *val_str(String *str);
const char *cast_type() const { return "datetime"; }
enum_field_types field_type() const { return MYSQL_TYPE_DATETIME; }
@@ -810,37 +842,29 @@ public:
};
-class Item_func_str_to_date :public Item_date_func
+class Item_func_str_to_date :public Item_str_func
{
+ enum_field_types cached_field_type;
+ date_time_format_types cached_format_type;
+ timestamp_type cached_timestamp_type;
+ bool const_item;
public:
Item_func_str_to_date(Item *a, Item *b)
- :Item_date_func(a, b)
+ :Item_str_func(a, b)
{}
String *val_str(String *str);
bool get_date(TIME *ltime, uint fuzzy_date);
const char *func_name() const { return "str_to_date"; }
- void fix_length_and_dec()
- {
- maybe_null= 1;
- decimals=0;
- max_length=MAX_DATETIME_FULL_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
- }
+ enum_field_types field_type() const { return cached_field_type; }
+ void fix_length_and_dec();
+ Field *tmp_table_field(TABLE *t_arg);
};
-class Item_func_last_day :public Item_str_func
+
+class Item_func_last_day :public Item_date
{
public:
- Item_func_last_day(Item *a) :Item_str_func(a) {}
- String *val_str(String *str);
+ Item_func_last_day(Item *a) :Item_date(a) {}
const char *func_name() const { return "last_day"; }
- enum_field_types field_type() const { return MYSQL_TYPE_DATE; }
- void fix_length_and_dec()
- {
- decimals=0;
- max_length=MAX_DATE_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
- }
- Field *tmp_table_field(TABLE *t_arg)
- {
- return (new Field_date(maybe_null, name, t_arg, &my_charset_bin));
- }
+ bool get_date(TIME *res, uint fuzzy_date);
};
diff --git a/sql/item_uniq.h b/sql/item_uniq.h
index 47f967b52c6..5582537bdbb 100644
--- a/sql/item_uniq.h
+++ b/sql/item_uniq.h
@@ -27,7 +27,7 @@ class Item_func_unique_users :public Item_real_func
public:
Item_func_unique_users(Item *name_arg,int start,int end,List<Item> &list)
:Item_real_func(list) {}
- double val() { return 0.0; }
+ double val() { DBUG_ASSERT(fixed == 1); return 0.0; }
void fix_length_and_dec() { decimals=0; max_length=6; }
void print(String *str) { str->append("0.0", 3); }
};
@@ -40,7 +40,7 @@ public:
:Item_sum_num(item_arg) {}
Item_sum_unique_users(THD *thd, Item_sum_unique_users *item)
:Item_sum_num(thd, item) {}
- double val() { return 0.0; }
+ double val() { DBUG_ASSERT(fixed == 1); return 0.0; }
enum Sumfunctype sum_func () const {return UNIQUE_USERS_FUNC;}
void clear() {}
bool add() { return 0; }
@@ -48,6 +48,7 @@ public:
void update_field() {}
bool fix_fields(THD *thd, TABLE_LIST *tlist, Item **ref)
{
+ DBUG_ASSERT(fixed == 0);
fixed= 1;
return 0;
}
diff --git a/sql/key.cc b/sql/key.cc
index 639b1e535a6..d4499573e8e 100644
--- a/sql/key.cc
+++ b/sql/key.cc
@@ -182,9 +182,9 @@ int key_cmp(TABLE *table,const byte *key,uint idx,uint key_length)
}
if (key_part->key_part_flag & (HA_BLOB_PART | HA_VAR_LENGTH))
{
- if (key_part->field->key_cmp(key, key_part->length+2))
+ if (key_part->field->key_cmp(key, key_part->length+ HA_KEY_BLOB_LENGTH))
return 1;
- length=key_part->length+2;
+ length=key_part->length+HA_KEY_BLOB_LENGTH;
}
else
{
diff --git a/sql/lex.h b/sql/lex.h
index 72888f7d89e..32552172a01 100644
--- a/sql/lex.h
+++ b/sql/lex.h
@@ -120,12 +120,14 @@ static SYMBOL symbols[] = {
{ "CONNECTION", SYM(CONNECTION_SYM)},
{ "CONSTRAINT", SYM(CONSTRAINT)},
{ "CONTINUE", SYM(CONTINUE_SYM)},
+ { "CONVERT", SYM(CONVERT_SYM)},
{ "CREATE", SYM(CREATE)},
{ "CROSS", SYM(CROSS)},
{ "CUBE", SYM(CUBE_SYM)},
{ "CURRENT_DATE", SYM(CURDATE)},
{ "CURRENT_TIME", SYM(CURTIME)},
{ "CURRENT_TIMESTAMP", SYM(NOW_SYM)},
+ { "CURRENT_USER", SYM(CURRENT_USER)},
{ "CURSOR", SYM(CURSOR_SYM)},
{ "DATA", SYM(DATA_SYM)},
{ "DATABASE", SYM(DATABASE)},
@@ -527,7 +529,6 @@ static SYMBOL sql_functions[] = {
{ "CAST", SYM(CAST_SYM)},
{ "CEIL", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ceiling)},
{ "CEILING", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ceiling)},
- { "CURRENT_USER", F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_current_user)},
{ "BIT_LENGTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_bit_length)},
{ "CENTROID", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_centroid)},
{ "CHAR_LENGTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_char_length)},
@@ -540,7 +541,6 @@ 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", SYM(CONVERT_SYM)},
{ "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)},
@@ -699,7 +699,7 @@ static SYMBOL sql_functions[] = {
{ "STDDEV", SYM(STD_SYM)},
{ "STR_TO_DATE", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_str_to_date)},
{ "STRCMP", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_strcmp)},
- { "SUBSTR", SYM(SUBSTRING)},
+ { "SUBSTR", SYM(SUBSTRING)},
{ "SUBSTRING", SYM(SUBSTRING)},
{ "SUBSTRING_INDEX", SYM(SUBSTRING_INDEX)},
{ "SUBTIME", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_subtime)},
@@ -716,9 +716,11 @@ static SYMBOL sql_functions[] = {
{ "UCASE", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ucase)},
{ "UNCOMPRESS", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_uncompress)},
{ "UNCOMPRESSED_LENGTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_uncompressed_length)},
+ { "UNHEX", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_unhex)},
{ "UNIQUE_USERS", SYM(UNIQUE_USERS)},
{ "UNIX_TIMESTAMP", SYM(UNIX_TIMESTAMP)},
{ "UPPER", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ucase)},
+ { "UUID", F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_uuid)},
{ "VARIANCE", SYM(VARIANCE_SYM)},
{ "VERSION", F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_version)},
{ "WEEKDAY", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_weekday)},
diff --git a/sql/lex_symbol.h b/sql/lex_symbol.h
index d1d30a73669..3074a489b6a 100644
--- a/sql/lex_symbol.h
+++ b/sql/lex_symbol.h
@@ -37,4 +37,13 @@ typedef struct st_lex_symbol
uint length;
} LEX_SYMBOL;
+typedef struct st_sym_group {
+ const char *name;
+ const char *needed_define;
+} SYM_GROUP;
+
+extern SYM_GROUP sym_group_common;
+extern SYM_GROUP sym_group_geom;
+extern SYM_GROUP sym_group_rtree;
+
#endif /* _lex_symbol_h */
diff --git a/sql/lock.cc b/sql/lock.cc
index 0a2f91812a7..6d9deb8e4c6 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -445,14 +445,27 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count,
return sql_lock;
}
+
/*****************************************************************************
-** Lock table based on the name.
-** This is used when we need total access to a closed, not open table
+ Lock table based on the name.
+ This is used when we need total access to a closed, not open table
*****************************************************************************/
/*
Lock and wait for the named lock.
- Returns 0 on ok
+
+ SYNOPSIS
+ lock_and_wait_for_table_name()
+ thd Thread handler
+ table_list Lock first table in this list
+
+
+ NOTES
+ Works together with global read lock.
+
+ RETURN
+ 0 ok
+ 1 error
*/
int lock_and_wait_for_table_name(THD *thd, TABLE_LIST *table_list)
@@ -482,27 +495,45 @@ end:
/*
Put a not open table with an old refresh version in the table cache.
- This will force any other threads that uses the table to release it
- as soon as possible.
- One must have a lock on LOCK_open !
- Return values:
- < 0 error
- == 0 table locked
- > 0 table locked, but someone is using it
+
+ SYNPOSIS
+ lock_table_name()
+ thd Thread handler
+ table_list Lock first table in this list
+
+ WARNING
+ If you are going to update the table, you should use
+ lock_and_wait_for_table_name instead of this function as this works
+ together with 'FLUSH TABLES WITH READ LOCK'
+
+ NOTES
+ This will force any other threads that uses the table to release it
+ as soon as possible.
+
+ REQUIREMENTS
+ One must have a lock on LOCK_open !
+
+ RETURN:
+ < 0 error
+ == 0 table locked
+ > 0 table locked, but someone is using it
*/
int lock_table_name(THD *thd, TABLE_LIST *table_list)
{
TABLE *table;
char key[MAX_DBKEY_LENGTH];
- char *db= table_list->db ? table_list->db : (thd->db ? thd->db : (char*) "");
+ char *db= table_list->db;
uint key_length;
DBUG_ENTER("lock_table_name");
+ DBUG_PRINT("enter",("db: %s name: %s", db, table_list->real_name));
+
safe_mutex_assert_owner(&LOCK_open);
key_length=(uint) (strmov(strmov(key,db)+1,table_list->real_name)
-key)+ 1;
+
/* Only insert the table if we haven't insert it already */
for (table=(TABLE*) hash_search(&open_cache,(byte*) key,key_length) ;
table ;
@@ -534,6 +565,7 @@ int lock_table_name(THD *thd, TABLE_LIST *table_list)
DBUG_RETURN(0);
}
+
void unlock_table_name(THD *thd, TABLE_LIST *table_list)
{
if (table_list->table)
@@ -543,6 +575,7 @@ void unlock_table_name(THD *thd, TABLE_LIST *table_list)
}
}
+
static bool locked_named_table(THD *thd, TABLE_LIST *table_list)
{
for (; table_list ; table_list=table_list->next)
@@ -583,6 +616,10 @@ bool wait_for_locked_table_names(THD *thd, TABLE_LIST *table_list)
table_list Names of tables to lock
NOTES
+ If you are just locking one table, you should use
+ lock_and_wait_for_table_name().
+
+ REQUIREMENTS
One must have a lock on LOCK_open when calling this
RETURN
diff --git a/sql/log.cc b/sql/log.cc
index da20bfdb9fa..b18a01b2e56 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -207,7 +207,7 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
open_flags |= O_RDWR;
else
open_flags |= O_WRONLY;
-
+
db[0]=0;
open_count++;
if ((file=my_open(log_file_name,open_flags,
@@ -220,14 +220,19 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
case LOG_NORMAL:
{
char *end;
+ int len=my_snprintf(buff, sizeof(buff), "%s, Version: %s. "
#ifdef EMBEDDED_LIBRARY
- sprintf(buff, "%s, Version: %s, embedded library\n", my_progname, server_version);
+ "embedded library\n", my_progname, server_version
#elif __NT__
- sprintf(buff, "%s, Version: %s, started with:\nTCP Port: %d, Named Pipe: %s\n", my_progname, server_version, mysqld_port, mysqld_unix_port);
+ "started with:\nTCP Port: %d, Named Pipe: %s\n",
+ my_progname, server_version, mysqld_port, mysqld_unix_port
#else
- sprintf(buff, "%s, Version: %s, started with:\nTcp port: %d Unix socket: %s\n", my_progname,server_version,mysqld_port,mysqld_unix_port);
+ "started with:\nTcp port: %d Unix socket: %s\n",
+ my_progname,server_version,mysqld_port,mysqld_unix_port
#endif
- end=strmov(strend(buff),"Time Id Command Argument\n");
+ );
+ end=strnmov(buff+len,"Time Id Command Argument\n",
+ sizeof(buff)-len);
if (my_b_write(&log_file, (byte*) buff,(uint) (end-buff)) ||
flush_io_cache(&log_file))
goto err;
@@ -235,21 +240,21 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
}
case LOG_NEW:
{
+ uint len;
time_t skr=time(NULL);
struct tm tm_tmp;
+
localtime_r(&skr,&tm_tmp);
- ulong length;
- length= my_sprintf(buff,
- (buff,
- "# %s, Version: %s at %02d%02d%02d %2d:%02d:%02d\n",
- my_progname,server_version,
- tm_tmp.tm_year % 100,
- tm_tmp.tm_mon+1,
- tm_tmp.tm_mday,
- tm_tmp.tm_hour,
- tm_tmp.tm_min,
- tm_tmp.tm_sec));
- if (my_b_write(&log_file, (byte*) buff, length) ||
+ len= my_snprintf(buff,sizeof(buff),
+ "# %s, Version: %s at %02d%02d%02d %2d:%02d:%02d\n",
+ my_progname,server_version,
+ tm_tmp.tm_year % 100,
+ tm_tmp.tm_mon+1,
+ tm_tmp.tm_mday,
+ tm_tmp.tm_hour,
+ tm_tmp.tm_min,
+ tm_tmp.tm_sec);
+ if (my_b_write(&log_file, (byte*) buff, len) ||
flush_io_cache(&log_file))
goto err;
break;
@@ -264,7 +269,7 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg,
index_file_name_arg= name; // Use same basename for index file
opt= MY_UNPACK_FILENAME | MY_REPLACE_EXT;
}
-
+
if (!my_b_filelength(&log_file))
{
/*
@@ -547,7 +552,6 @@ int MYSQL_LOG::find_log_pos(LOG_INFO *linfo, const char *log_name,
RETURN VALUES
0 ok
LOG_INFO_EOF End of log-index-file found
- LOG_INFO_SEEK Could not allocate IO cache
LOG_INFO_IO Got IO error while reading file
*/
@@ -1257,8 +1261,7 @@ bool MYSQL_LOG::write(Log_event* event_info)
"do the involved tables match (to be implemented)
binlog_[wild_]{do|ignore}_table?" (WL#1049)"
*/
- if ((thd && !(thd->options & OPTION_BIN_LOG) &&
- (thd->master_access & SUPER_ACL)) ||
+ if ((thd && !(thd->options & OPTION_BIN_LOG)) ||
(local_db && !db_ok(local_db, binlog_do_db, binlog_ignore_db)))
{
VOID(pthread_mutex_unlock(&LOCK_log));
diff --git a/sql/log_event.h b/sql/log_event.h
index 7f161267add..ec23aad1717 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -751,17 +751,19 @@ public:
const char* fname;
uint32 skip_lines;
sql_ex_info sql_ex;
+ bool local_fname;
/* fname doesn't point to memory inside Log_event::temp_buf */
void set_fname_outside_temp_buf(const char *afname, uint alen)
{
fname= afname;
fname_len= alen;
+ local_fname= true;
}
/* fname doesn't point to memory inside Log_event::temp_buf */
int check_fname_outside_temp_buf()
{
- return fname < temp_buf || fname > temp_buf+ cached_event_len;
+ return local_fname;
}
#ifndef MYSQL_CLIENT
@@ -1146,6 +1148,7 @@ protected:
bool fake_base;
public:
char* block;
+ const char *event_buf;
uint block_len;
uint file_id;
bool inited_from_old;
@@ -1168,7 +1171,10 @@ public:
Create_file_log_event(const char* buf, uint event_len,
const Format_description_log_event* description_event);
- ~Create_file_log_event() {}
+ ~Create_file_log_event()
+ {
+ my_free((char*) event_buf, MYF(MY_ALLOW_ZERO_PTR));
+ }
Log_event_type get_type_code()
{
diff --git a/sql/mf_iocache.cc b/sql/mf_iocache.cc
index b7e2a803e42..71c8d588de7 100644
--- a/sql/mf_iocache.cc
+++ b/sql/mf_iocache.cc
@@ -30,14 +30,8 @@
flush_io_cache().
*/
-#define MAP_TO_USE_RAID
#include "mysql_priv.h"
#ifdef HAVE_REPLICATION
-#ifdef HAVE_AIOWAIT
-#include <mysys_err.h>
-#include <errno.h>
-static void my_aiowait(my_aio_result *result);
-#endif
extern "C" {
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index e17847ebe24..697b5146b7d 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -73,14 +73,6 @@ char* query_table_status(THD *thd,const char *db,const char *table_name);
#define PREV_BITS(type,A) ((type) (((type) 1 << (A)) -1))
#define all_bits_set(A,B) ((A) & (B) != (B))
-#ifndef LL
-#ifdef HAVE_LONG_LONG
-#define LL(A) A ## LL
-#else
-#define LL(A) A ## L
-#endif
-#endif
-
extern CHARSET_INFO *system_charset_info, *files_charset_info ;
extern CHARSET_INFO *national_charset_info, *table_alias_charset;
@@ -164,6 +156,9 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset;
/* Time handling defaults */
#define TIMESTAMP_MAX_YEAR 2038
#define YY_PART_YEAR 70
+#define TIMESTAMP_MIN_YEAR (1900 + YY_PART_YEAR - 1)
+#define TIMESTAMP_MAX_VALUE 2145916799
+#define TIMESTAMP_MIN_VALUE 1
#define PRECISION_FOR_DOUBLE 53
#define PRECISION_FOR_FLOAT 24
@@ -205,7 +200,8 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset;
#define TEST_CORE_ON_SIGNAL 256 /* Give core if signal */
#define TEST_NO_STACKTRACE 512
#define TEST_SIGINT 1024 /* Allow sigint on threads */
-
+#define TEST_SYNCHRONIZATION 2048 /* get server to do sleep in some
+ places */
#endif
/*
@@ -255,9 +251,6 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset;
/* The rest of the file is included in the server only */
#ifndef MYSQL_CLIENT
-/* options for UNION set by the yacc parser (stored in unit->union_option) */
-#define UNION_ALL 1
-
/* Bits for different SQL modes modes (including ANSI mode) */
#define MODE_REAL_AS_FLOAT 1
#define MODE_PIPES_AS_CONCAT 2
@@ -333,6 +326,7 @@ void debug_sync_point(const char* lock_name, uint lock_timeout);
struct st_table;
class THD;
+class Statement;
/* Struct to handle simple linked lists */
@@ -387,6 +381,11 @@ inline THD *_current_thd(void)
#include "sql_udf.h"
#include "item.h"
typedef Comp_creator* (*chooser_compare_func_creator)(bool invert);
+/* sql_parse.cc */
+void free_items(Item *item);
+void cleanup_items(Item *item);
+class THD;
+void close_thread_tables(THD *thd, bool locked=0, bool skip_derived=0);
#include "sql_class.h"
#include "opt_range.h"
@@ -447,8 +446,8 @@ int quick_rm_table(enum db_type base,const char *db,
bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list);
bool mysql_change_db(THD *thd,const char *name);
void mysql_parse(THD *thd,char *inBuf,uint length);
+bool mysql_test_parse_for_slave(THD *thd,char *inBuf,uint length);
bool is_update_query(enum enum_sql_command command);
-void free_items(Item *item);
bool alloc_query(THD *thd, char *packet, ulong packet_length);
void mysql_init_select(LEX *lex);
void mysql_init_query(THD *thd, bool lexonly=0);
@@ -467,13 +466,8 @@ bool do_command(THD *thd);
bool dispatch_command(enum enum_server_command command, THD *thd,
char* packet, uint packet_length);
bool check_dup(const char *db, const char *name, TABLE_LIST *tables);
-#ifndef EMBEDDED_LIBRARY
-bool check_stack_overrun(THD *thd,char *dummy);
-#else
-#define check_stack_overrun(A, B) 0
-#endif
-void table_cache_init(void);
+bool table_cache_init(void);
void table_cache_free(void);
uint cached_tables(void);
void kill_mysql(void);
@@ -577,7 +571,6 @@ int mysql_multi_update(THD *thd, TABLE_LIST *table_list,
int mysql_insert(THD *thd,TABLE_LIST *table,List<Item> &fields,
List<List_item> &values, List<Item> &update_fields,
List<Item> &update_values, enum_duplicates flag);
-void kill_delayed_threads(void);
int mysql_delete(THD *thd, TABLE_LIST *table, COND *conds, SQL_LIST *order,
ha_rows rows, ulong options);
int mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok=0);
@@ -601,7 +594,8 @@ extern const Field *not_found_field;
Field *find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
TABLE_LIST **where, bool report_error);
Field *find_field_in_table(THD *thd,TABLE *table,const char *name,uint length,
- bool check_grant,bool allow_rowid);
+ bool check_grant,bool allow_rowid,
+ uint *cached_field_index_ptr);
#ifdef HAVE_OPENSSL
#include <openssl/des.h>
struct st_des_keyblock
@@ -653,14 +647,13 @@ int mysqld_show_column_types(THD *thd);
int mysqld_help (THD *thd, const char *text);
/* sql_prepare.cc */
-bool mysql_stmt_prepare(THD *thd, char *packet, uint packet_length);
-void mysql_stmt_execute(THD *thd, char *packet);
+void mysql_stmt_prepare(THD *thd, char *packet, uint packet_length);
+void mysql_stmt_execute(THD *thd, char *packet, uint packet_length);
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);
int check_insert_fields(THD *thd,TABLE *table,List<Item> &fields,
List<Item> &values, ulong counter);
-void setup_param_functions(Item_param *param, uchar param_type);
/* sql_error.cc */
MYSQL_ERROR *push_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, uint code,
@@ -682,7 +675,7 @@ void set_item_name(Item *item,char *pos,uint length);
bool add_field_to_list(THD *thd, char *field_name, enum enum_field_types type,
char *length, char *decimal,
uint type_modifier,
- Item *default_value,
+ Item *default_value, Item *on_update_value,
LEX_STRING *comment,
char *change, TYPELIB *interval,CHARSET_INFO *cs,
uint uint_geom_type);
@@ -705,7 +698,7 @@ bool get_key_map_from_key_list(key_map *map, TABLE *table,
bool insert_fields(THD *thd,TABLE_LIST *tables,
const char *db_name, const char *table_name,
List_iterator<Item> *it);
-bool setup_tables(TABLE_LIST *tables, my_bool reinit);
+bool setup_tables(TABLE_LIST *tables);
int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields,
List<Item> *sum_func_list, uint wild_num);
int setup_fields(THD *thd, Item** ref_pointer_array, TABLE_LIST *tables,
@@ -725,7 +718,6 @@ bool rm_temporary_table(enum db_type base, char *path);
void free_io_cache(TABLE *entry);
void intern_close_table(TABLE *entry);
bool close_thread_table(THD *thd, TABLE **table_ptr);
-void close_thread_tables(THD *thd, bool locked=0, bool skip_derived=0);
void close_temporary_tables(THD *thd);
TABLE_LIST * find_table_in_list(TABLE_LIST *table,
const char *db_name, const char *table_name);
@@ -794,6 +786,9 @@ bool open_log(MYSQL_LOG *log, const char *hostname,
/* mysqld.cc */
extern void yyerror(const char*);
+/* item_func.cc */
+extern bool check_reserved_words(LEX_STRING *name);
+
/* strfunc.cc */
ulonglong find_set(TYPELIB *typelib,const char *x, uint length,
char **err_pos, uint *err_len, bool *set_warning);
@@ -803,9 +798,6 @@ uint check_word(TYPELIB *lib, const char *val, const char *end,
bool is_keyword(const char *name, uint len);
-/* sql_parse.cc */
-void free_items(Item *item);
-void cleanup_items(Item *item);
#define MY_DB_OPT_FILE "db.opt"
bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create);
@@ -816,7 +808,8 @@ bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create);
extern time_t start_time;
extern char *mysql_data_home,server_version[SERVER_VERSION_LENGTH],
- mysql_real_data_home[], *opt_mysql_tmpdir, mysql_charsets_dir[];
+ mysql_real_data_home[], *opt_mysql_tmpdir, mysql_charsets_dir[],
+ opt_ft_boolean_syntax[sizeof(ft_boolean_syntax)];
#define mysql_tmpdir (my_tmpdir(&mysql_tmpdir_list))
extern MY_TMPDIR mysql_tmpdir_list;
extern const char *command_name[];
@@ -836,9 +829,11 @@ extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN];
extern char pidfile_name[FN_REFLEN], time_zone[30], *opt_init_file;
extern char log_error_file[FN_REFLEN];
extern double log_10[32];
+extern ulonglong log_10_int[20];
extern ulonglong keybuff_size;
extern ulong refresh_version,flush_version, thread_id,query_id,opened_tables;
-extern ulong created_tmp_tables, created_tmp_disk_tables;
+extern ulong created_tmp_tables, created_tmp_disk_tables, bytes_sent;
+extern ulong binlog_cache_use, binlog_cache_disk_use;
extern ulong aborted_threads,aborted_connects;
extern ulong delayed_insert_timeout;
extern ulong delayed_insert_limit, delayed_queue_size;
@@ -859,7 +854,7 @@ extern ulong ha_read_rnd_count, ha_read_rnd_next_count;
extern ulong ha_commit_count, ha_rollback_count,table_cache_size;
extern ulong max_connections,max_connect_errors, connect_timeout;
extern ulong slave_net_timeout;
-extern ulong max_insert_delayed_threads, max_user_connections;
+extern ulong max_user_connections;
extern ulong long_query_count, what_to_log,flush_time;
extern ulong query_buff_size, thread_stack,thread_stack_min;
extern ulong binlog_cache_size, max_binlog_cache_size, open_files_limit;
@@ -871,7 +866,7 @@ extern ulong expire_logs_days;
extern my_bool relay_log_purge;
extern uint test_flags,select_errors,ha_open_options;
extern uint protocol_version, mysqld_port, dropping_tables;
-extern uint delay_key_write_options;
+extern uint delay_key_write_options, lower_case_table_names;
extern bool opt_endinfo, using_udf_functions, locked_in_memory;
extern bool opt_using_transactions, mysql_embedded;
extern bool using_update_log, opt_large_files;
@@ -880,10 +875,10 @@ extern bool opt_disable_networking, opt_skip_show_db;
extern bool volatile abort_loop, shutdown_in_progress, grant_option;
extern uint volatile thread_count, thread_running, global_read_lock;
extern my_bool opt_sql_bin_update, opt_safe_user_create, opt_no_mix_types;
-extern my_bool opt_safe_show_db, opt_local_infile, lower_case_table_names;
+extern my_bool opt_safe_show_db, opt_local_infile;
extern my_bool opt_slave_compressed_protocol, use_temp_pool;
-extern my_bool opt_readonly;
-extern my_bool opt_enable_named_pipe;
+extern my_bool opt_readonly, lower_case_file_system;
+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;
@@ -893,7 +888,7 @@ extern FILE *bootstrap_file;
extern pthread_key(MEM_ROOT*,THR_MALLOC);
extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open,
LOCK_thread_count,LOCK_mapped_file,LOCK_user_locks, LOCK_status,
- LOCK_error_log, LOCK_delayed_insert,
+ LOCK_error_log, LOCK_delayed_insert, LOCK_uuid_generator,
LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone,
LOCK_slave_list, LOCK_active_mi, LOCK_manager,
LOCK_global_system_variables, LOCK_user_conn;
@@ -995,6 +990,8 @@ timestamp_type str_to_TIME(const char *str, uint length, TIME *l_time,
void localtime_to_TIME(TIME *to, struct tm *from);
void calc_time_from_sec(TIME *to, long seconds, long microseconds);
+void make_truncated_value_warning(THD *thd, const char *str_val,
+ uint str_length, timestamp_type time_type);
extern DATE_TIME_FORMAT *date_time_format_make(timestamp_type format_type,
const char *format_str,
uint format_length);
@@ -1010,11 +1007,6 @@ void make_datetime(DATE_TIME_FORMAT *format, TIME *l_time, String *str);
int test_if_number(char *str,int *res,bool allow_wildcards);
void change_byte(byte *,uint,char,char);
-#ifndef EMBEDDED_LIBRARY
-extern "C" void unireg_abort(int exit_code);
-#else
-#define unireg_abort(exit_code) DBUG_RETURN(exit_code)
-#endif
void init_read_record(READ_RECORD *info, THD *thd, TABLE *reg_form,
SQL_SELECT *select,
int use_record_cache, bool print_errors);
@@ -1116,6 +1108,19 @@ inline void table_case_convert(char * name, uint length)
my_casedn(files_charset_info, name, length);
}
+inline const char *table_case_name(HA_CREATE_INFO *info, const char *name)
+{
+ return ((lower_case_table_names == 2 && info->alias) ? info->alias : name);
+}
+
+inline ulong sql_rnd_with_mutex()
+{
+ pthread_mutex_lock(&LOCK_thread_count);
+ ulong tmp=(ulong) (my_rnd(&sql_rand) * 0xffffffff); /* make all bits random */
+ pthread_mutex_unlock(&LOCK_thread_count);
+ return tmp;
+}
+
Comp_creator *comp_eq_creator(bool invert);
Comp_creator *comp_ge_creator(bool invert);
Comp_creator *comp_gt_creator(bool invert);
@@ -1151,13 +1156,20 @@ inline void setup_table_map(TABLE *table, TABLE_LIST *table_list, uint tablenr)
table->force_index= table_list->force_index;
}
-typedef struct st_sym_group {
- const char *name;
- const char *needed_define;
-} SYM_GROUP;
-extern SYM_GROUP sym_group_common;
-extern SYM_GROUP sym_group_geom;
-extern SYM_GROUP sym_group_rtree;
+/*
+ Some functions that are different in the embedded library and the normal
+ server
+*/
+
+#ifndef EMBEDDED_LIBRARY
+extern "C" void unireg_abort(int exit_code);
+void kill_delayed_threads(void);
+bool check_stack_overrun(THD *thd,char *dummy);
+#else
+#define unireg_abort(exit_code) DBUG_RETURN(exit_code)
+inline void kill_delayed_threads(void) {}
+#define check_stack_overrun(A, B) 0
+#endif
#endif /* MYSQL_CLIENT */
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 0a05da7491b..d242a54f141 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -152,7 +152,7 @@ int initgroups(const char *,unsigned int);
typedef fp_except fp_except_t;
#endif
- /* We can't handle floating point expections with threads, so disable
+ /* We can't handle floating point exceptions with threads, so disable
this on freebsd
*/
@@ -186,15 +186,11 @@ inline void reset_floating_point_exceptions()
#else
#include <my_pthread.h> // For thr_setconcurency()
#endif
-#if defined(HAVE_GETRLIMIT) && defined(RLIMIT_NOFILE) && !defined(HAVE_mit_thread)
-#define SET_RLIMIT_NOFILE
-#endif
#ifdef SOLARIS
extern "C" int gethostname(char *name, int namelen);
#endif
-
/* Set prefix for windows binary */
#ifdef __WIN__
#undef MYSQL_SERVER_SUFFIX
@@ -254,6 +250,7 @@ arg_cmp_func Arg_comparator::comparator_matrix[4][2] =
bool opt_log, opt_update_log, opt_bin_log, opt_slow_log;
bool opt_error_log= IF_WIN(1,0);
bool opt_disable_networking=0, opt_skip_show_db=0;
+bool lower_case_table_names_used= 0;
bool server_id_supplied = 0;
bool opt_endinfo,using_udf_functions, locked_in_memory;
bool opt_using_transactions, using_update_log;
@@ -265,18 +262,20 @@ my_bool opt_reckless_slave = 0;
my_bool opt_enable_named_pipe= 0, opt_debugging= 0;
my_bool opt_local_infile, opt_external_locking, opt_slave_compressed_protocol;
my_bool opt_safe_user_create = 0, opt_no_mix_types = 0;
-my_bool lower_case_table_names, opt_old_rpl_compat;
my_bool opt_show_slave_auth_info, opt_sql_bin_update = 0;
my_bool opt_log_slave_updates= 0;
my_bool opt_console= 0, opt_bdb, opt_innodb, opt_isam;
my_bool opt_readonly, use_temp_pool, relay_log_purge;
+my_bool opt_sync_bdb_logs, opt_sync_frm;
my_bool opt_secure_auth= 0;
my_bool opt_short_log_format= 0;
my_bool opt_log_queries_not_using_indexes= 0;
+my_bool lower_case_file_system= 0;
volatile bool mqh_used = 0;
uint mysqld_port, test_flags, select_errors, dropping_tables, ha_open_options;
uint delay_key_write_options, protocol_version;
+uint lower_case_table_names;
uint volatile thread_count, thread_running, kill_cached_threads, wake_thread;
ulong back_log, connect_timeout, concurrency;
@@ -301,7 +300,8 @@ ulong select_range_check_count, select_range_count, select_scan_count;
ulong select_full_range_join_count,select_full_join_count;
ulong specialflag=0,opened_tables=0,created_tmp_tables=0,
created_tmp_disk_tables=0;
-ulong max_connections,max_insert_delayed_threads,max_used_connections,
+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;
@@ -311,6 +311,14 @@ ulong my_bind_addr; /* the address we bind to */
volatile ulong cached_thread_count= 0;
double log_10[32]; /* 10 potences */
+ulonglong log_10_int[20]=
+{
+ 1, 10, 100, 1000, 10000UL, 100000UL, 1000000UL, 10000000UL,
+ ULL(100000000), ULL(1000000000), ULL(10000000000), ULL(100000000000),
+ ULL(1000000000000), ULL(10000000000000), ULL(100000000000000),
+ ULL(1000000000000000), ULL(10000000000000000), ULL(100000000000000000),
+ ULL(1000000000000000000), ULL(10000000000000000000)
+};
time_t start_time;
@@ -320,7 +328,8 @@ 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,
- *opt_init_connect, *opt_init_slave;
+ *opt_init_connect, *opt_init_slave,
+ opt_ft_boolean_syntax[sizeof(ft_boolean_syntax)];
const char *opt_date_time_formats[3];
@@ -374,7 +383,7 @@ pthread_key(MEM_ROOT*,THR_MALLOC);
pthread_key(THD*, THR_THD);
pthread_mutex_t LOCK_mysql_create_db, LOCK_Acl, LOCK_open, LOCK_thread_count,
LOCK_mapped_file, LOCK_status,
- LOCK_error_log,
+ LOCK_error_log, LOCK_uuid_generator,
LOCK_delayed_insert, LOCK_delayed_status, LOCK_delayed_create,
LOCK_crypt, LOCK_bytes_sent, LOCK_bytes_received,
LOCK_global_system_variables,
@@ -434,7 +443,7 @@ static NTService Service; // Service object for WinNT
#endif /* __WIN__ */
#ifdef __NT__
-static char szPipeName [ 257 ];
+static char pipe_name[512];
static SECURITY_ATTRIBUTES saPipeSecurity;
static SECURITY_DESCRIPTOR sdPipeDescriptor;
static HANDLE hPipe = INVALID_HANDLE_VALUE;
@@ -494,9 +503,6 @@ extern "C" pthread_handler_decl(handle_connections_namedpipes,arg);
static pthread_handler_decl(handle_connections_shared_memory,arg);
#endif
extern "C" pthread_handler_decl(handle_slave,arg);
-#ifdef SET_RLIMIT_NOFILE
-static uint set_maximum_open_files(uint max_file_limit);
-#endif
static ulong find_bit_type(const char *x, TYPELIB *bit_lib);
static void clean_up(bool print_message);
static void clean_up_mutexes(void);
@@ -580,7 +586,7 @@ static void close_connections(void)
DBUG_PRINT( "quit", ("Closing named pipes") );
/* Create connection to the handle named pipe handler to break the loop */
- if ((temp = CreateFile(szPipeName,
+ if ((temp = CreateFile(pipe_name,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
@@ -588,7 +594,7 @@ static void close_connections(void)
0,
NULL )) != INVALID_HANDLE_VALUE)
{
- WaitNamedPipe(szPipeName, 1000);
+ WaitNamedPipe(pipe_name, 1000);
DWORD dwMode = PIPE_READMODE_BYTE | PIPE_WAIT;
SetNamedPipeHandleState(temp, &dwMode, NULL, NULL);
CancelIo(temp);
@@ -921,6 +927,7 @@ void clean_up(bool print_message)
#ifdef USE_RAID
end_raid();
#endif
+ my_free_open_file_info();
my_free((char*) global_system_variables.date_format,
MYF(MY_ALLOW_ZERO_PTR));
my_free((char*) global_system_variables.time_format,
@@ -1056,8 +1063,8 @@ static void set_user(const char *user)
{
/* Don't give a warning, if real user is same as given with --user */
struct passwd *user_info= getpwnam(user);
-
- if (!user_info || user_id != user_info->pw_uid)
+ if ((!user_info || user_id != user_info->pw_uid) &&
+ global_system_variables.log_warnings)
fprintf(stderr,
"Warning: One can only use the --user switch if running as root\n");
}
@@ -1191,11 +1198,14 @@ static void server_init(void)
if (Service.IsNT() && mysqld_unix_port[0] && !opt_bootstrap &&
opt_enable_named_pipe)
{
- sprintf(szPipeName, "\\\\.\\pipe\\%s", mysqld_unix_port );
- ZeroMemory( &saPipeSecurity, sizeof(saPipeSecurity) );
- ZeroMemory( &sdPipeDescriptor, sizeof(sdPipeDescriptor) );
- if ( !InitializeSecurityDescriptor(&sdPipeDescriptor,
- SECURITY_DESCRIPTOR_REVISION) )
+
+ pipe_name[sizeof(pipe_name)-1]= 0; /* Safety if too long string */
+ strxnmov(pipe_name, sizeof(pipe_name)-1, "\\\\.\\pipe\\",
+ mysqld_unix_port, NullS);
+ bzero((char*) &saPipeSecurity, sizeof(saPipeSecurity));
+ bzero((char*) &sdPipeDescriptor, sizeof(sdPipeDescriptor));
+ if (!InitializeSecurityDescriptor(&sdPipeDescriptor,
+ SECURITY_DESCRIPTOR_REVISION))
{
sql_perror("Can't start server : Initialize security descriptor");
unireg_abort(1);
@@ -1208,16 +1218,16 @@ static void server_init(void)
saPipeSecurity.nLength = sizeof( SECURITY_ATTRIBUTES );
saPipeSecurity.lpSecurityDescriptor = &sdPipeDescriptor;
saPipeSecurity.bInheritHandle = FALSE;
- if ((hPipe = CreateNamedPipe(szPipeName,
- PIPE_ACCESS_DUPLEX,
- PIPE_TYPE_BYTE |
- PIPE_READMODE_BYTE |
- PIPE_WAIT,
- PIPE_UNLIMITED_INSTANCES,
- (int) global_system_variables.net_buffer_length,
- (int) global_system_variables.net_buffer_length,
- NMPWAIT_USE_DEFAULT_WAIT,
- &saPipeSecurity )) == INVALID_HANDLE_VALUE)
+ if ((hPipe= CreateNamedPipe(pipe_name,
+ PIPE_ACCESS_DUPLEX,
+ PIPE_TYPE_BYTE |
+ PIPE_READMODE_BYTE |
+ PIPE_WAIT,
+ PIPE_UNLIMITED_INSTANCES,
+ (int) global_system_variables.net_buffer_length,
+ (int) global_system_variables.net_buffer_length,
+ NMPWAIT_USE_DEFAULT_WAIT,
+ &saPipeSecurity)) == INVALID_HANDLE_VALUE)
{
LPVOID lpMsgBuf;
int error=GetLastError();
@@ -1715,7 +1725,7 @@ static void start_signal_handler(void)
(void) pthread_attr_setdetachstate(&thr_attr,PTHREAD_CREATE_DETACHED);
if (!(opt_specialflag & SPECIAL_NO_PRIOR))
my_pthread_attr_setprio(&thr_attr,INTERRUPT_PRIOR);
- pthread_attr_setstacksize(&thr_attr, 129*1024);
+ pthread_attr_setstacksize(&thr_attr,thread_stack);
#endif
(void) pthread_mutex_lock(&LOCK_thread_count);
@@ -1749,7 +1759,8 @@ extern "C" void *signal_hand(void *arg __attribute__((unused)))
This should actually be '+ max_number_of_slaves' instead of +10,
but the +10 should be quite safe.
*/
- init_thr_alarm(max_connections+max_insert_delayed_threads+10);
+ init_thr_alarm(max_connections +
+ global_system_variables.max_insert_delayed_threads + 10);
#if SIGINT != THR_KILL_SIGNAL
if (test_flags & TEST_SIGINT)
{
@@ -2100,10 +2111,11 @@ static int init_common_variables(const char *conf_file_name, int argc,
strmov(fn_ext(pidfile_name),".pid"); // Add proper extension
#ifndef DBUG_OFF
- strxmov(strend(server_version),MYSQL_SERVER_SUFFIX,"-debug",NullS);
-#else
- strmov(strend(server_version),MYSQL_SERVER_SUFFIX);
+ if (!*(MYSQL_SERVER_SUFFIX))
+ strmov(strend(server_version),"-debug");
+ else
#endif
+ strmov(strend(server_version),MYSQL_SERVER_SUFFIX);
load_defaults(conf_file_name, groups, &argc, &argv);
defaults_argv=argv;
@@ -2113,28 +2125,33 @@ static int init_common_variables(const char *conf_file_name, int argc,
DBUG_PRINT("info",("%s Ver %s for %s on %s\n",my_progname,
server_version, SYSTEM_TYPE,MACHINE_TYPE));
-#if defined( SET_RLIMIT_NOFILE) || defined( OS2)
/* connections and databases needs lots of files */
{
- uint wanted_files=10+(uint) max(max_connections*5,
- max_connections+table_cache_size*2);
+ uint files, wanted_files;
+
+ wanted_files= 10+(uint) max(max_connections*5,
+ max_connections+table_cache_size*2);
set_if_bigger(wanted_files, open_files_limit);
- // Note that some system returns 0 if we succeed here:
- uint files=set_maximum_open_files(wanted_files);
- if (files && files < wanted_files && ! open_files_limit)
+ files= my_set_max_open_files(wanted_files);
+
+ if (files < wanted_files)
{
- max_connections= (ulong) min((files-10),max_connections);
- table_cache_size= (ulong) max((files-10-max_connections)/2,64);
- DBUG_PRINT("warning",
- ("Changed limits: max_connections: %ld table_cache: %ld",
- max_connections,table_cache_size));
- sql_print_error("Warning: Changed limits: max_connections: %ld table_cache: %ld",max_connections,table_cache_size);
+ if (!open_files_limit)
+ {
+ max_connections= (ulong) min((files-10),max_connections);
+ table_cache_size= (ulong) max((files-10-max_connections)/2,64);
+ DBUG_PRINT("warning",
+ ("Changed limits: max_open_files: %u max_connections: %ld table_cache: %ld",
+ files, max_connections, table_cache_size));
+ if (global_system_variables.log_warnings)
+ sql_print_error("Warning: Changed limits: max_open_files: %u max_connections: %ld table_cache: %ld",
+ files, max_connections, table_cache_size);
+ }
+ else if (global_system_variables.log_warnings)
+ sql_print_error("Warning: Could not increase number of max_open_files to more than %u (request: %u)", files, wanted_files);
}
open_files_limit= files;
}
-#else
- open_files_limit= 0; /* Can't set or detect limit */
-#endif
unireg_init(opt_specialflag); /* Set up extern variabels */
if (init_errmessage()) /* Read error messages from file */
return 1;
@@ -2179,10 +2196,14 @@ static int init_common_variables(const char *conf_file_name, int argc,
sys_init_connect.value_length= 0;
if ((sys_init_connect.value= opt_init_connect))
sys_init_connect.value_length= strlen(opt_init_connect);
+ else
+ sys_init_connect.value=my_strdup("",MYF(0));
sys_init_slave.value_length= 0;
if ((sys_init_slave.value= opt_init_slave))
sys_init_slave.value_length= strlen(opt_init_slave);
+ else
+ sys_init_slave.value=my_strdup("",MYF(0));
if (use_temp_pool && bitmap_init(&temp_pool,0,1024,1))
return 1;
@@ -2209,6 +2230,7 @@ static int init_thread_environment()
(void) pthread_mutex_init(&LOCK_user_conn, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_active_mi, MY_MUTEX_INIT_FAST);
(void) pthread_mutex_init(&LOCK_global_system_variables, MY_MUTEX_INIT_FAST);
+ (void) pthread_mutex_init(&LOCK_uuid_generator, MY_MUTEX_INIT_FAST);
(void) my_rwlock_init(&LOCK_sys_init_connect, NULL);
(void) my_rwlock_init(&LOCK_sys_init_slave, NULL);
(void) my_rwlock_init(&LOCK_grant, NULL);
@@ -2262,8 +2284,9 @@ static void init_ssl()
static int init_server_components()
{
DBUG_ENTER("init_server_components");
- table_cache_init();
- hostname_cache_init();
+ if (table_cache_init() || hostname_cache_init())
+ unireg_abort(1);
+
query_cache_result_size_limit(query_cache_limit);
query_cache_set_min_res_unit(query_cache_min_res_unit);
query_cache_resize(query_cache_size);
@@ -2390,10 +2413,10 @@ Now disabling --log-slave-updates.");
{
if (mlockall(MCL_CURRENT))
{
- sql_print_error("Warning: Failed to lock memory. Errno: %d\n",errno);
+ if (global_system_variables.log_warnings)
+ sql_print_error("Warning: Failed to lock memory. Errno: %d\n",errno);
+ locked_in_memory= 0;
}
- else
- locked_in_memory=1;
}
#else
locked_in_memory=0;
@@ -2411,7 +2434,7 @@ static void create_maintenance_thread()
{
if (
#ifdef HAVE_BERKELEY_DB
- !berkeley_skip ||
+ (have_berkeley_db == SHOW_OPTION_YES) ||
#endif
(flush_time && flush_time != ~(ulong) 0L))
{
@@ -2557,8 +2580,38 @@ int main(int argc, char **argv)
}
}
#endif
+ thread_stack_min=thread_stack - STACK_MIN_SIZE;
+
(void) thr_setconcurrency(concurrency); // 10 by default
+ /*
+ Ensure that lower_case_table_names is set on system where we have case
+ insensitive names. If this is not done the users MyISAM tables will
+ get corrupted if accesses with names of different case.
+ */
+ DBUG_PRINT("info", ("lower_case_table_names: %d", lower_case_table_names));
+ if (!lower_case_table_names &&
+ (lower_case_file_system=
+ (test_if_case_insensitive(mysql_real_data_home) == 1)))
+ {
+ if (lower_case_table_names_used)
+ {
+ if (global_system_variables.log_warnings)
+ sql_print_error("\
+Warning: You have forced lower_case_table_names to 0 through a command-line \
+option, even though your file system '%s' is case insensitive. This means \
+that you can corrupt a MyISAM table by accessing it with different cases. \
+You should consider changing lower_case_table_names to 1 or 2",
+ mysql_real_data_home);
+ }
+ else
+ {
+ if (global_system_variables.log_warnings)
+ sql_print_error("Warning: Setting lower_case_table_names=2 because file system for %s is case insensitive", mysql_real_data_home);
+ lower_case_table_names= 2;
+ }
+ }
+
select_thread=pthread_self();
select_thread_in_use=1;
init_ssl();
@@ -2988,8 +3041,6 @@ static void create_new_thread(THD *thd)
DBUG_VOID_RETURN;
}
pthread_mutex_lock(&LOCK_thread_count);
- if (thread_count-delayed_insert_threads > max_used_connections)
- max_used_connections=thread_count-delayed_insert_threads;
thd->thread_id=thread_id++;
thd->real_id=pthread_self(); // Keep purify happy
@@ -3018,6 +3069,8 @@ static void create_new_thread(THD *thd)
thread_count++;
thread_created++;
threads.append(thd);
+ if (thread_count-delayed_insert_threads > max_used_connections)
+ max_used_connections=thread_count-delayed_insert_threads;
DBUG_PRINT("info",(("creating thread %d"), thd->thread_id));
thd->connect_time = time(NULL);
if ((error=pthread_create(&thd->real_id,&connection_attrib,
@@ -3310,7 +3363,7 @@ extern "C" pthread_handler_decl(handle_connections_namedpipes,arg)
if (!fConnected)
{
CloseHandle( hPipe );
- if ((hPipe = CreateNamedPipe(szPipeName,
+ if ((hPipe = CreateNamedPipe(pipe_name,
PIPE_ACCESS_DUPLEX,
PIPE_TYPE_BYTE |
PIPE_READMODE_BYTE |
@@ -3328,7 +3381,7 @@ extern "C" pthread_handler_decl(handle_connections_namedpipes,arg)
}
hConnectedPipe = hPipe;
/* create new pipe for new connection */
- if ((hPipe = CreateNamedPipe(szPipeName,
+ if ((hPipe = CreateNamedPipe(pipe_name,
PIPE_ACCESS_DUPLEX,
PIPE_TYPE_BYTE |
PIPE_READMODE_BYTE |
@@ -3593,7 +3646,7 @@ enum options_mysqld
OPT_DELAY_KEY_WRITE_ALL, OPT_SLOW_QUERY_LOG,
OPT_DELAY_KEY_WRITE, OPT_CHARSETS_DIR,
OPT_BDB_HOME, OPT_BDB_LOG,
- OPT_BDB_TMP, OPT_BDB_NOSYNC,
+ OPT_BDB_TMP, OPT_BDB_SYNC,
OPT_BDB_LOCK, OPT_BDB,
OPT_BDB_NO_RECOVER, OPT_BDB_SHARED,
OPT_MASTER_HOST, OPT_MASTER_USER,
@@ -3633,7 +3686,7 @@ enum options_mysqld
OPT_HAVE_NAMED_PIPE,
OPT_DO_PSTACK, OPT_REPORT_HOST,
OPT_REPORT_USER, OPT_REPORT_PASSWORD, OPT_REPORT_PORT,
- OPT_SHOW_SLAVE_AUTH_INFO, OPT_OLD_RPL_COMPAT,
+ OPT_SHOW_SLAVE_AUTH_INFO,
OPT_SLAVE_LOAD_TMPDIR, OPT_NO_MIX_TYPE,
OPT_RPL_RECOVERY_RANK,OPT_INIT_RPL_ROLE,
OPT_RELAY_LOG, OPT_RELAY_LOG_INDEX, OPT_RELAY_LOG_INFO_FILE,
@@ -3643,7 +3696,7 @@ enum options_mysqld
OPT_BACK_LOG, OPT_BINLOG_CACHE_SIZE,
OPT_CONNECT_TIMEOUT, OPT_DELAYED_INSERT_TIMEOUT,
OPT_DELAYED_INSERT_LIMIT, OPT_DELAYED_QUEUE_SIZE,
- OPT_FLUSH_TIME, OPT_FT_MIN_WORD_LEN,
+ OPT_FLUSH_TIME, OPT_FT_MIN_WORD_LEN, OPT_FT_BOOLEAN_SYNTAX,
OPT_FT_MAX_WORD_LEN, OPT_FT_QUERY_EXPANSION_LIMIT, OPT_FT_STOPWORD_FILE,
OPT_INTERACTIVE_TIMEOUT, OPT_JOIN_BUFF_SIZE,
OPT_KEY_BUFFER_SIZE, OPT_KEY_CACHE_BLOCK_SIZE,
@@ -3665,7 +3718,7 @@ enum options_mysqld
OPT_OPEN_FILES_LIMIT,
OPT_PRELOAD_BUFFER_SIZE,
OPT_QUERY_CACHE_LIMIT, OPT_QUERY_CACHE_MIN_RES_UNIT, OPT_QUERY_CACHE_SIZE,
- OPT_QUERY_CACHE_TYPE, OPT_RECORD_BUFFER,
+ OPT_QUERY_CACHE_TYPE, OPT_QUERY_CACHE_WLOCK_INVALIDATE, OPT_RECORD_BUFFER,
OPT_RECORD_RND_BUFFER, OPT_RELAY_LOG_SPACE_LIMIT, OPT_RELAY_LOG_PURGE,
OPT_SLAVE_NET_TIMEOUT, OPT_SLAVE_COMPRESSED_PROTOCOL, OPT_SLOW_LAUNCH_TIME,
OPT_READONLY, OPT_DEBUGGING,
@@ -3694,6 +3747,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_ENABLE_SHARED_MEMORY,
OPT_SHARED_MEMORY_BASE_NAME,
OPT_OLD_PASSWORDS,
@@ -3732,8 +3786,14 @@ struct my_option my_long_options[] =
{"bdb-no-recover", OPT_BDB_NO_RECOVER,
"Don't try to recover Berkeley DB tables on start.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
- {"bdb-no-sync", OPT_BDB_NOSYNC, "Don't synchronously flush logs.", 0, 0, 0,
- GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"bdb-no-sync", OPT_BDB_NOSYNC,
+ "Disable synchronously flushing logs. This option is deprecated, use --skip-sync-bdb-logs or sync-bdb-logs=0 instead",
+ // (gptr*) &opt_sync_bdb_logs, (gptr*) &opt_sync_bdb_logs, 0, GET_BOOL,
+ 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
+ {"sync-bdb-logs", OPT_BDB_SYNC,
+ "Synchronously flush logs. Enabled by default",
+ (gptr*) &opt_sync_bdb_logs, (gptr*) &opt_sync_bdb_logs, 0, GET_BOOL,
+ NO_ARG, 1, 0, 0, 0, 0, 0},
{"bdb-shared-data", OPT_BDB_SHARED,
"Start Berkeley DB in multi-process mode.", 0, 0, 0, GET_NO_ARG, NO_ARG, 0,
0, 0, 0, 0, 0},
@@ -3741,6 +3801,9 @@ struct my_option my_long_options[] =
(gptr*) &berkeley_tmpdir, (gptr*) &berkeley_tmpdir, 0, GET_STR,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif /* HAVE_BERKELEY_DB */
+ {"sync-frm", OPT_SYNC_FRM, "Sync .frm to disk on create. Enabled by default",
+ (gptr*) &opt_sync_frm, (gptr*) &opt_sync_frm, 0, GET_BOOL, NO_ARG, 1, 0,
+ 0, 0, 0, 0},
{"bdb", OPT_BDB, "Enable Berkeley DB (if this version of MySQL supports it). \
Disable with --skip-bdb (will save memory).",
(gptr*) &opt_bdb, (gptr*) &opt_bdb, 0, GET_BOOL, NO_ARG, 1, 0, 0,
@@ -3957,7 +4020,8 @@ log and this option justs turns on --log-bin instead.",
0, 0, 0, 0},
{"master-password", OPT_MASTER_PASSWORD,
"The password the slave thread will authenticate with when connecting to the master. If not set, an empty password is assumed.The value in master.info will take precedence if it can be read.",
- 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (gptr*)&master_password, (gptr*)&master_password, 0,
+ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"master-port", OPT_MASTER_PORT,
"The port the master is listening on. If not set, the compiled setting of MYSQL_PORT is assumed. If you have not tinkered with configure options, this should be 3306. The value in master.info will take precedence if it can be read.",
(gptr*) &master_port, (gptr*) &master_port, 0, GET_UINT, REQUIRED_ARG,
@@ -4042,10 +4106,6 @@ master-ssl",
(gptr*) &global_system_variables.old_passwords,
(gptr*) &max_system_variables.old_passwords, 0, GET_BOOL, NO_ARG,
0, 0, 0, 0, 0, 0},
- {"old-rpl-compat", OPT_OLD_RPL_COMPAT,
- "Use old LOAD DATA format in the binary log (don't save data in file).",
- (gptr*) &opt_old_rpl_compat, (gptr*) &opt_old_rpl_compat, 0, GET_BOOL,
- NO_ARG, 0, 0, 0, 0, 0, 0},
#ifdef ONE_THREAD
{"one-thread", OPT_ONE_THREAD,
"Only use one thread (for debugging under Linux).", 0, 0, 0, GET_NO_ARG,
@@ -4214,7 +4274,7 @@ log and this option does nothing anymore.",
0, 0, 0, 0, 0},
{"tmpdir", 't',
"Path for temporary files. Several paths may be specified, separated by a "
-#if defined( __WIN__) || defined(OS2)
+#if defined( __WIN__) || defined(OS2) || defined(__NETWARE__)
"semicolon (;)"
#else
"colon (:)"
@@ -4240,11 +4300,11 @@ log and this option does nothing anymore.",
NO_ARG, 0, 0, 0, 0, 0, 0},
{"log-warnings", 'W', "Log some not critical warnings to the log file.",
(gptr*) &global_system_variables.log_warnings,
- (gptr*) &max_system_variables.log_warnings, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ (gptr*) &max_system_variables.log_warnings, 0, GET_BOOL, NO_ARG, 1, 0, 0,
0, 0, 0},
{"warnings", 'W', "Deprecated ; Use --log-warnings instead.",
(gptr*) &global_system_variables.log_warnings,
- (gptr*) &max_system_variables.log_warnings, 0, GET_BOOL, NO_ARG, 0, 0, 0,
+ (gptr*) &max_system_variables.log_warnings, 0, GET_BOOL, NO_ARG, 1, 0, 0,
0, 0, 0},
{ "back_log", OPT_BACK_LOG,
"The number of outstanding connection requests MySQL can have. This comes into play when the main MySQL thread gets very many connection requests in a very short time.",
@@ -4292,6 +4352,10 @@ log and this option does nothing anymore.",
"A dedicated thread is created to flush all tables at the given interval.",
(gptr*) &flush_time, (gptr*) &flush_time, 0, GET_ULONG, REQUIRED_ARG,
FLUSH_TIME, 0, LONG_TIMEOUT, 0, 1, 0},
+ { "ft_boolean_syntax", OPT_FT_BOOLEAN_SYNTAX,
+ "List of operators for MATCH ... AGAINST ( ... IN BOOLEAN MODE)",
+ 0, 0, 0, GET_STR,
+ REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{ "ft_min_word_len", OPT_FT_MIN_WORD_LEN,
"The minimum length of the word to be included in a FULLTEXT index. Note: FULLTEXT indexes must be rebuilt after changing this variable.",
(gptr*) &ft_min_word_len, (gptr*) &ft_min_word_len, 0, GET_ULONG,
@@ -4402,15 +4466,15 @@ log and this option does nothing anymore.",
(gptr*) &max_system_variables.long_query_time, 0, GET_ULONG,
REQUIRED_ARG, 10, 1, LONG_TIMEOUT, 0, 1, 0},
{"lower_case_table_names", OPT_LOWER_CASE_TABLE_NAMES,
- "If set to 1 table names are stored in lowercase on disk and table names will be case-insensitive.",
+ "If set to 1 table names are stored in lowercase on disk and table names will be case-insensitive. Should be set to 2 if you are using a case insensitive file system",
(gptr*) &lower_case_table_names,
- (gptr*) &lower_case_table_names, 0, GET_BOOL, NO_ARG,
+ (gptr*) &lower_case_table_names, 0, GET_UINT, OPT_ARG,
#ifdef FN_NO_CASE_SENCE
1
#else
0
#endif
- , 0, 1, 0, 1, 0},
+ , 0, 2, 0, 1, 0},
{"max_allowed_packet", OPT_MAX_ALLOWED_PACKET,
"Max packetlength to send/receive from to server.",
(gptr*) &global_system_variables.max_allowed_packet,
@@ -4436,7 +4500,8 @@ The minimum value for this variable is 4096.",
REQUIRED_ARG, MAX_CONNECT_ERRORS, 1, ~0L, 0, 1, 0},
{"max_delayed_threads", OPT_MAX_DELAYED_THREADS,
"Don't start more than this number of threads to handle INSERT DELAYED statements. If set to zero, which means INSERT DELAYED is not used.",
- (gptr*) &max_insert_delayed_threads, (gptr*) &max_insert_delayed_threads,
+ (gptr*) &global_system_variables.max_insert_delayed_threads,
+ (gptr*) &max_system_variables.max_insert_delayed_threads,
0, GET_ULONG, REQUIRED_ARG, 20, 0, 16384, 0, 1, 0},
{"max_error_count", OPT_MAX_ERROR_COUNT,
"Max number of errors/warnings to store for a statement.",
@@ -4541,7 +4606,7 @@ The minimum value for this variable is 4096.",
{"open_files_limit", OPT_OPEN_FILES_LIMIT,
"If this is not 0, then mysqld will use this value to reserve file descriptors to use with setrlimit(). If this value is 0 then mysqld will reserve max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of files.",
(gptr*) &open_files_limit, (gptr*) &open_files_limit, 0, GET_ULONG,
- REQUIRED_ARG, 0, 0, 65535, 0, 1, 0},
+ REQUIRED_ARG, 0, 0, OS_FILE_LIMIT, 0, 1, 0},
{"preload_buffer_size", OPT_PRELOAD_BUFFER_SIZE,
"The size of the buffer that is allocated when preloading indexes",
(gptr*) &global_system_variables.preload_buff_size,
@@ -4573,12 +4638,17 @@ The minimum value for this variable is 4096.",
(gptr*) &global_system_variables.query_cache_type,
(gptr*) &max_system_variables.query_cache_type,
0, GET_ULONG, REQUIRED_ARG, 1, 0, 2, 0, 1, 0},
+ {"query_cache_wlock_invalidate", OPT_QUERY_CACHE_WLOCK_INVALIDATE,
+ "Invalidate queries in query cache on LOCK for write",
+ (gptr*) &global_system_variables.query_cache_wlock_invalidate,
+ (gptr*) &max_system_variables.query_cache_wlock_invalidate,
+ 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
+#endif /*HAVE_QUERY_CACHE*/
{"query_prealloc_size", OPT_QUERY_PREALLOC_SIZE,
"Persistent buffer for query parsing and execution",
(gptr*) &global_system_variables.query_prealloc_size,
(gptr*) &max_system_variables.query_prealloc_size, 0, GET_ULONG,
REQUIRED_ARG, QUERY_ALLOC_PREALLOC_SIZE, 1024, ~0L, 0, 1024, 0},
-#endif /*HAVE_QUERY_CACHE*/
{"read_buffer_size", OPT_RECORD_BUFFER,
"Each thread that does a sequential scan allocates a buffer of this size for each table it scans. If you do many sequential scans, you may want to increase this value.",
(gptr*) &global_system_variables.read_buff_size,
@@ -4622,7 +4692,7 @@ The minimum value for this variable is 4096.",
(gptr*) &max_system_variables.range_alloc_block_size, 0, GET_ULONG,
REQUIRED_ARG, RANGE_ALLOC_BLOCK_SIZE, 1024, ~0L, 0, 1024, 0},
{"read-only", OPT_READONLY,
- "Make all tables readonly, with the expections for replications (slave) threads and users with the SUPER privilege.",
+ "Make all tables readonly, with the exception for replication (slave) threads and users with the SUPER privilege",
(gptr*) &opt_readonly,
(gptr*) &opt_readonly,
0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 1, 0},
@@ -4638,8 +4708,8 @@ The minimum value for this variable is 4096.",
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, ~0L, 0, 1,
- 0},
+ (gptr*) &table_cache_size, 0, GET_ULONG, REQUIRED_ARG, 64, 1, 512*1024L,
+ 0, 1, 0},
{"thread_concurrency", OPT_THREAD_CONCURRENCY,
"Permits the application to give the threads system a hint for the desired number of threads that should be run at the same time.",
(gptr*) &concurrency, (gptr*) &concurrency, 0, GET_ULONG, REQUIRED_ARG,
@@ -4671,7 +4741,8 @@ The minimum value for this variable is 4096.",
"The number of seconds the server waits for activity on a connection before closing it.",
(gptr*) &global_system_variables.net_wait_timeout,
(gptr*) &max_system_variables.net_wait_timeout, 0, GET_ULONG,
- REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, LONG_TIMEOUT, 0, 1, 0},
+ REQUIRED_ARG, NET_WAIT_TIMEOUT, 1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT),
+ 0, 1, 0},
{"expire_logs_days", OPT_EXPIRE_LOGS_DAYS,
"Binary logs will be rotated after expire-log-days days ",
(gptr*) &expire_logs_days,
@@ -4704,6 +4775,8 @@ The minimum value for this variable is 4096.",
struct show_var_st status_vars[]= {
{"Aborted_clients", (char*) &aborted_threads, SHOW_LONG},
{"Aborted_connects", (char*) &aborted_connects, SHOW_LONG},
+ {"Binlog_cache_disk_use", (char*) &binlog_cache_disk_use, SHOW_LONG},
+ {"Binlog_cache_use", (char*) &binlog_cache_use, SHOW_LONG},
{"Bytes_received", (char*) &bytes_received, SHOW_LONG},
{"Bytes_sent", (char*) &bytes_sent, SHOW_LONG},
{"Com_admin_commands", (char*) &com_other, SHOW_LONG},
@@ -4758,13 +4831,13 @@ struct show_var_st status_vars[]= {
{"Com_savepoint", (char*) (com_stat+(uint) SQLCOM_SAVEPOINT),SHOW_LONG},
{"Com_select", (char*) (com_stat+(uint) SQLCOM_SELECT),SHOW_LONG},
{"Com_set_option", (char*) (com_stat+(uint) SQLCOM_SET_OPTION),SHOW_LONG},
- {"Com_show_binlogs", (char*) (com_stat+(uint) SQLCOM_SHOW_BINLOGS),SHOW_LONG},
{"Com_show_binlog_events", (char*) (com_stat+(uint) SQLCOM_SHOW_BINLOG_EVENTS),SHOW_LONG},
+ {"Com_show_binlogs", (char*) (com_stat+(uint) SQLCOM_SHOW_BINLOGS),SHOW_LONG},
{"Com_show_charsets", (char*) (com_stat+(uint) SQLCOM_SHOW_CHARSETS),SHOW_LONG},
{"Com_show_collations", (char*) (com_stat+(uint) SQLCOM_SHOW_COLLATIONS),SHOW_LONG},
{"Com_show_column_types", (char*) (com_stat+(uint) SQLCOM_SHOW_COLUMN_TYPES),SHOW_LONG},
- {"Com_show_create_table", (char*) (com_stat+(uint) SQLCOM_SHOW_CREATE),SHOW_LONG},
{"Com_show_create_db", (char*) (com_stat+(uint) SQLCOM_SHOW_CREATE_DB),SHOW_LONG},
+ {"Com_show_create_table", (char*) (com_stat+(uint) SQLCOM_SHOW_CREATE),SHOW_LONG},
{"Com_show_databases", (char*) (com_stat+(uint) SQLCOM_SHOW_DATABASES),SHOW_LONG},
{"Com_show_errors", (char*) (com_stat+(uint) SQLCOM_SHOW_ERRORS),SHOW_LONG},
{"Com_show_fields", (char*) (com_stat+(uint) SQLCOM_SHOW_FIELDS),SHOW_LONG},
@@ -4792,11 +4865,11 @@ struct show_var_st status_vars[]= {
{"Com_update_multi", (char*) (com_stat+(uint) SQLCOM_UPDATE_MULTI),SHOW_LONG},
{"Connections", (char*) &thread_id, SHOW_LONG_CONST},
{"Created_tmp_disk_tables", (char*) &created_tmp_disk_tables,SHOW_LONG},
- {"Created_tmp_tables", (char*) &created_tmp_tables, SHOW_LONG},
{"Created_tmp_files", (char*) &my_tmp_file_created, SHOW_LONG},
+ {"Created_tmp_tables", (char*) &created_tmp_tables, SHOW_LONG},
+ {"Delayed_errors", (char*) &delayed_insert_errors, SHOW_LONG},
{"Delayed_insert_threads", (char*) &delayed_insert_threads, SHOW_LONG_CONST},
{"Delayed_writes", (char*) &delayed_insert_writes, SHOW_LONG},
- {"Delayed_errors", (char*) &delayed_insert_errors, SHOW_LONG},
{"Flush_commands", (char*) &refresh_version, SHOW_LONG_CONST},
{"Handler_commit", (char*) &ha_commit_count, SHOW_LONG},
{"Handler_delete", (char*) &ha_delete_count, SHOW_LONG},
@@ -4823,24 +4896,24 @@ struct show_var_st status_vars[]= {
SHOW_KEY_CACHE_LONG},
{"Max_used_connections", (char*) &max_used_connections, SHOW_LONG},
{"Not_flushed_delayed_rows", (char*) &delayed_rows_in_use, SHOW_LONG_CONST},
- {"Open_tables", (char*) 0, SHOW_OPENTABLES},
{"Open_files", (char*) &my_file_opened, SHOW_LONG_CONST},
{"Open_streams", (char*) &my_stream_opened, SHOW_LONG_CONST},
+ {"Open_tables", (char*) 0, SHOW_OPENTABLES},
{"Opened_tables", (char*) &opened_tables, SHOW_LONG},
- {"Questions", (char*) 0, SHOW_QUESTION},
#ifdef HAVE_QUERY_CACHE
- {"Qcache_queries_in_cache", (char*) &query_cache.queries_in_cache, SHOW_LONG_CONST},
- {"Qcache_inserts", (char*) &query_cache.inserts, SHOW_LONG},
+ {"Qcache_free_blocks", (char*) &query_cache.free_memory_blocks,
+ SHOW_LONG_CONST},
+ {"Qcache_free_memory", (char*) &query_cache.free_memory,
+ SHOW_LONG_CONST},
{"Qcache_hits", (char*) &query_cache.hits, SHOW_LONG},
+ {"Qcache_inserts", (char*) &query_cache.inserts, SHOW_LONG},
{"Qcache_lowmem_prunes", (char*) &query_cache.lowmem_prunes, SHOW_LONG},
{"Qcache_not_cached", (char*) &query_cache.refused, SHOW_LONG},
- {"Qcache_free_memory", (char*) &query_cache.free_memory,
- SHOW_LONG_CONST},
- {"Qcache_free_blocks", (char*) &query_cache.free_memory_blocks,
- SHOW_LONG_CONST},
+ {"Qcache_queries_in_cache", (char*) &query_cache.queries_in_cache, SHOW_LONG_CONST},
{"Qcache_total_blocks", (char*) &query_cache.total_blocks,
SHOW_LONG_CONST},
#endif /*HAVE_QUERY_CACHE*/
+ {"Questions", (char*) 0, SHOW_QUESTION},
{"Rpl_status", (char*) 0, SHOW_RPL_STATUS},
{"Select_full_join", (char*) &select_full_join_count, SHOW_LONG},
{"Select_full_range_join", (char*) &select_full_range_join_count, SHOW_LONG},
@@ -4856,35 +4929,35 @@ struct show_var_st status_vars[]= {
{"Sort_rows", (char*) &filesort_rows, SHOW_LONG},
{"Sort_scan", (char*) &filesort_scan_count, SHOW_LONG},
#ifdef HAVE_OPENSSL
+ {"Ssl_accept_renegotiates", (char*) 0, SHOW_SSL_CTX_SESS_ACCEPT_RENEGOTIATE},
{"Ssl_accepts", (char*) 0, SHOW_SSL_CTX_SESS_ACCEPT},
+ {"Ssl_callback_cache_hits", (char*) 0, SHOW_SSL_CTX_SESS_CB_HITS},
+ {"Ssl_cipher", (char*) 0, SHOW_SSL_GET_CIPHER},
+ {"Ssl_cipher_list", (char*) 0, SHOW_SSL_GET_CIPHER_LIST},
+ {"Ssl_client_connects", (char*) 0, SHOW_SSL_CTX_SESS_CONNECT},
+ {"Ssl_connect_renegotiates", (char*) 0, SHOW_SSL_CTX_SESS_CONNECT_RENEGOTIATE},
+ {"Ssl_ctx_verify_depth", (char*) 0, SHOW_SSL_CTX_GET_VERIFY_DEPTH},
+ {"Ssl_ctx_verify_mode", (char*) 0, SHOW_SSL_CTX_GET_VERIFY_MODE},
+ {"Ssl_default_timeout", (char*) 0, SHOW_SSL_GET_DEFAULT_TIMEOUT},
{"Ssl_finished_accepts", (char*) 0, SHOW_SSL_CTX_SESS_ACCEPT_GOOD},
{"Ssl_finished_connects", (char*) 0, SHOW_SSL_CTX_SESS_CONNECT_GOOD},
- {"Ssl_accept_renegotiates", (char*) 0, SHOW_SSL_CTX_SESS_ACCEPT_RENEGOTIATE},
- {"Ssl_connect_renegotiates", (char*) 0, SHOW_SSL_CTX_SESS_CONNECT_RENEGOTIATE},
- {"Ssl_callback_cache_hits", (char*) 0, SHOW_SSL_CTX_SESS_CB_HITS},
{"Ssl_session_cache_hits", (char*) 0, SHOW_SSL_CTX_SESS_HITS},
{"Ssl_session_cache_misses", (char*) 0, SHOW_SSL_CTX_SESS_MISSES},
- {"Ssl_session_cache_timeouts", (char*) 0, SHOW_SSL_CTX_SESS_TIMEOUTS},
- {"Ssl_used_session_cache_entries",(char*) 0, SHOW_SSL_CTX_SESS_NUMBER},
- {"Ssl_client_connects", (char*) 0, SHOW_SSL_CTX_SESS_CONNECT},
+ {"Ssl_session_cache_mode", (char*) 0, SHOW_SSL_CTX_GET_SESSION_CACHE_MODE},
{"Ssl_session_cache_overflows", (char*) 0, SHOW_SSL_CTX_SESS_CACHE_FULL},
{"Ssl_session_cache_size", (char*) 0, SHOW_SSL_CTX_SESS_GET_CACHE_SIZE},
- {"Ssl_session_cache_mode", (char*) 0, SHOW_SSL_CTX_GET_SESSION_CACHE_MODE},
+ {"Ssl_session_cache_timeouts", (char*) 0, SHOW_SSL_CTX_SESS_TIMEOUTS},
{"Ssl_sessions_reused", (char*) 0, SHOW_SSL_SESSION_REUSED},
- {"Ssl_ctx_verify_mode", (char*) 0, SHOW_SSL_CTX_GET_VERIFY_MODE},
- {"Ssl_ctx_verify_depth", (char*) 0, SHOW_SSL_CTX_GET_VERIFY_DEPTH},
- {"Ssl_verify_mode", (char*) 0, SHOW_SSL_GET_VERIFY_MODE},
+ {"Ssl_used_session_cache_entries",(char*) 0, SHOW_SSL_CTX_SESS_NUMBER},
{"Ssl_verify_depth", (char*) 0, SHOW_SSL_GET_VERIFY_DEPTH},
+ {"Ssl_verify_mode", (char*) 0, SHOW_SSL_GET_VERIFY_MODE},
{"Ssl_version", (char*) 0, SHOW_SSL_GET_VERSION},
- {"Ssl_cipher", (char*) 0, SHOW_SSL_GET_CIPHER},
- {"Ssl_cipher_list", (char*) 0, SHOW_SSL_GET_CIPHER_LIST},
- {"Ssl_default_timeout", (char*) 0, SHOW_SSL_GET_DEFAULT_TIMEOUT},
#endif /* HAVE_OPENSSL */
{"Table_locks_immediate", (char*) &locks_immediate, SHOW_LONG},
{"Table_locks_waited", (char*) &locks_waited, SHOW_LONG},
{"Threads_cached", (char*) &cached_thread_count, SHOW_LONG_CONST},
- {"Threads_created", (char*) &thread_created, SHOW_LONG_CONST},
{"Threads_connected", (char*) &thread_count, SHOW_INT_CONST},
+ {"Threads_created", (char*) &thread_created, SHOW_LONG_CONST},
{"Threads_running", (char*) &thread_running, SHOW_INT_CONST},
{"Uptime", (char*) 0, SHOW_STARTTIME},
{NullS, NullS, SHOW_LONG}
@@ -4998,6 +5071,7 @@ static void mysql_init_variables(void)
filesort_merge_passes= select_range_check_count= select_range_count= 0;
select_scan_count= select_full_range_join_count= select_full_join_count= 0;
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;
@@ -5469,8 +5543,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case OPT_STORAGE_ENGINE:
{
- if ((enum db_type)((global_system_variables.table_type=
- ha_resolve_by_name(argument, strlen(argument)))) == DB_TYPE_UNKNOWN)
+ if ((enum db_type)((global_system_variables.table_type=
+ ha_resolve_by_name(argument, strlen(argument)))) == DB_TYPE_UNKNOWN)
{
fprintf(stderr,"Unknown table type: %s\n",argument);
exit(1);
@@ -5517,7 +5591,14 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
}
#ifdef HAVE_BERKELEY_DB
case OPT_BDB_NOSYNC:
- berkeley_env_flags|=DB_TXN_NOSYNC;
+ /* Deprecated option */
+ opt_sync_bdb_logs= 0;
+ /* Fall through */
+ case OPT_BDB_SYNC:
+ if (!opt_sync_bdb_logs)
+ berkeley_env_flags|= DB_TXN_NOSYNC;
+ else
+ berkeley_env_flags&= ~DB_TXN_NOSYNC;
break;
case OPT_BDB_NO_RECOVER:
berkeley_init_flags&= ~(DB_RECOVER);
@@ -5551,43 +5632,25 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
case OPT_BDB:
#ifdef HAVE_BERKELEY_DB
if (opt_bdb)
- {
- berkeley_skip=0;
have_berkeley_db=SHOW_OPTION_YES;
- }
else
- {
- berkeley_skip=1;
have_berkeley_db=SHOW_OPTION_DISABLED;
- }
#endif
break;
case OPT_ISAM:
#ifdef HAVE_ISAM
if (opt_isam)
- {
- isam_skip=0;
have_isam= SHOW_OPTION_YES;
- }
else
- {
- isam_skip=1;
have_isam= SHOW_OPTION_DISABLED;
- }
#endif
break;
case OPT_INNODB:
#ifdef HAVE_INNOBASE_DB
if (opt_innodb)
- {
- innodb_skip=0;
have_innodb=SHOW_OPTION_YES;
- }
else
- {
- innodb_skip=1;
have_innodb=SHOW_OPTION_DISABLED;
- }
#endif
break;
case OPT_INNODB_DATA_FILE_PATH:
@@ -5634,15 +5697,25 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
}
global_system_variables.sql_mode= fix_sql_mode(global_system_variables.
sql_mode);
+ break;
}
- case OPT_MASTER_PASSWORD:
- master_password=argument;
+ case OPT_FT_BOOLEAN_SYNTAX:
+ if (ft_boolean_check_syntax_string((byte*) argument))
+ {
+ fprintf(stderr, "Invalid ft-boolean-syntax string: %s\n", argument);
+ exit(1);
+ }
+ strmake(opt_ft_boolean_syntax, argument, sizeof(ft_boolean_syntax)-1);
break;
case OPT_SKIP_SAFEMALLOC:
#ifdef SAFEMALLOC
sf_malloc_quick=1;
#endif
break;
+ case OPT_LOWER_CASE_TABLE_NAMES:
+ lower_case_table_names= argument ? atoi(argument) : 1;
+ lower_case_table_names_used= 1;
+ break;
}
return 0;
}
@@ -5682,6 +5755,8 @@ static void get_options(int argc,char **argv)
int ho_error;
my_getopt_register_get_addr(mysql_getopt_value);
+ strmake(opt_ft_boolean_syntax, ft_boolean_syntax,
+ sizeof(ft_boolean_syntax)-1);
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
exit(ho_error);
if (argc > 0)
@@ -5737,6 +5812,9 @@ static void get_options(int argc,char **argv)
table_alias_charset= (lower_case_table_names ?
files_charset_info :
&my_charset_bin);
+ strmake(ft_boolean_syntax, opt_ft_boolean_syntax,
+ sizeof(ft_boolean_syntax)-1);
+
if (opt_short_log_format)
opt_specialflag|= SPECIAL_SHORT_LOG_FORMAT;
if (opt_log_queries_not_using_indexes)
@@ -5833,108 +5911,7 @@ static void fix_paths(void)
exit(1);
}
#endif /* HAVE_REPLICATION */
-
- /*
- Ensure that lower_case_table_names is set on system where we have case
- insensitive names. If this is not done the users MyISAM tables will
- get corrupted if accesses with names of different case.
- */
- if (!lower_case_table_names &&
- test_if_case_insensitive(mysql_real_data_home) == 1)
- {
- sql_print_error("Warning: Setting lower_case_table_names=1 becasue file system %s is case insensitive", mysql_real_data_home);
- lower_case_table_names= 1;
- }
-}
-
-
-/*
- set how many open files we want to be able to handle
-
- SYNOPSIS
- set_maximum_open_files()
- max_file_limit Files to open
-
- NOTES
- The request may not fulfilled becasue of system limitations
-
- RETURN
- Files available to open
-*/
-
-#ifdef SET_RLIMIT_NOFILE
-
-#ifndef RLIM_INFINITY
-#define RLIM_INFINITY ((uint) 0xffffffff)
-#endif
-
-static uint set_maximum_open_files(uint max_file_limit)
-{
- struct rlimit rlimit;
- uint old_cur;
- DBUG_ENTER("set_maximum_open_files");
- DBUG_PRINT("enter",("files: %u", max_file_limit));
-
- if (!getrlimit(RLIMIT_NOFILE,&rlimit))
- {
- old_cur= (uint) rlimit.rlim_cur;
- DBUG_PRINT("info", ("rlim_cur: %u rlim_max: %u",
- (uint) rlimit.rlim_cur,
- (uint) rlimit.rlim_max));
- if (rlimit.rlim_cur >= max_file_limit ||
- rlimit.rlim_cur == RLIM_INFINITY)
- DBUG_RETURN(rlimit.rlim_cur); /* purecov: inspected */
- rlimit.rlim_cur= rlimit.rlim_max= max_file_limit;
- if (setrlimit(RLIMIT_NOFILE,&rlimit))
- {
- if (global_system_variables.log_warnings)
- sql_print_error("Warning: setrlimit couldn't increase number of open files to more than %u (request: %u)",
- old_cur, max_file_limit); /* purecov: inspected */
- max_file_limit= old_cur;
- }
- else
- {
- rlimit.rlim_cur= 0; // Safety if next call fails
- (void) getrlimit(RLIMIT_NOFILE,&rlimit);
- DBUG_PRINT("info", ("rlim_cur: %u", (uint) rlimit.rlim_cur));
- if ((uint) rlimit.rlim_cur < max_file_limit &&
- global_system_variables.log_warnings)
- sql_print_error("Warning: setrlimit returned ok, but didn't change limits. Max open files is %u (request: %u)",
- (uint) rlimit.rlim_cur,
- max_file_limit); /* purecov: inspected */
- max_file_limit= (uint) rlimit.rlim_cur;
- }
- }
- DBUG_PRINT("exit",("max_file_limit: %u", max_file_limit));
- DBUG_RETURN(max_file_limit);
-}
-#endif
-
-
-#ifdef OS2
-static uint set_maximum_open_files(uint max_file_limit)
-{
- LONG cbReqCount;
- ULONG cbCurMaxFH, cbCurMaxFH0;
- APIRET ulrc;
- DBUG_ENTER("set_maximum_open_files");
-
- // get current limit
- cbReqCount = 0;
- DosSetRelMaxFH( &cbReqCount, &cbCurMaxFH0);
-
- // set new limit
- cbReqCount = max_file_limit - cbCurMaxFH0;
- ulrc = DosSetRelMaxFH( &cbReqCount, &cbCurMaxFH);
- if (ulrc) {
- sql_print_error("Warning: DosSetRelMaxFH couldn't increase number of open files to more than %d",
- cbCurMaxFH0);
- cbCurMaxFH = cbCurMaxFH0;
- }
-
- DBUG_RETURN(cbCurMaxFH);
}
-#endif
/*
@@ -6017,6 +5994,7 @@ static int test_if_case_insensitive(const char *dir_name)
File file;
char buff[FN_REFLEN], buff2[FN_REFLEN];
MY_STAT stat_info;
+ DBUG_ENTER("test_if_case_insensitive");
fn_format(buff, glob_hostname, dir_name, ".lower-test",
MY_UNPACK_FILENAME | MY_REPLACE_EXT | MY_REPLACE_DIR);
@@ -6026,13 +6004,14 @@ static int test_if_case_insensitive(const char *dir_name)
if ((file= my_create(buff, 0666, O_RDWR, MYF(0))) < 0)
{
sql_print_error("Warning: Can't create test file %s", buff);
- return -1;
+ DBUG_RETURN(-1);
}
my_close(file, MYF(0));
if (my_stat(buff2, &stat_info, MYF(0)))
result= 1; // Can access file
(void) my_delete(buff, MYF(MY_WME));
- return result;
+ DBUG_PRINT("exit", ("result: %d", result));
+ DBUG_RETURN(result);
}
diff --git a/sql/nt_servc.cc b/sql/nt_servc.cc
index 3e9d68d5fdb..a04f284a3de 100644
--- a/sql/nt_servc.cc
+++ b/sql/nt_servc.cc
@@ -498,7 +498,7 @@ BOOL NTService::IsService(LPCSTR ServiceName)
if ((scm= OpenSCManager(0, 0,SC_MANAGER_ENUMERATE_SERVICE)))
{
- if ((service = OpenService(scm,ServiceName, SERVICE_QUERY_STATUS )))
+ if ((service = OpenService(scm,ServiceName, SERVICE_QUERY_STATUS)))
{
ret_value=TRUE;
CloseServiceHandle(service);
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index be1e764ddba..3907ba866fe 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -296,6 +296,7 @@ typedef struct st_qsel_param {
char min_key[MAX_KEY_LENGTH+MAX_FIELD_WIDTH],
max_key[MAX_KEY_LENGTH+MAX_FIELD_WIDTH];
bool quick; // Don't calulate possible keys
+ COND *cond;
uint *imerge_cost_buff; /* buffer for index_merge cost estimates */
uint imerge_cost_buff_size; /* size of the buffer */
@@ -807,6 +808,7 @@ SEL_ARG *SEL_ARG::clone(SEL_ARG *new_parent,SEL_ARG **next_arg)
return 0; // OOM
}
increment_use_count(1);
+ tmp->color= color;
return tmp;
}
@@ -969,7 +971,6 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
param.keys=0;
param.mem_root= &alloc;
param.imerge_cost_buff_size= 0;
-
thd->no_errors=1; // Don't warn about NULL
init_sql_alloc(&alloc, thd->variables.range_alloc_block_size, 0);
if (!(param.key_parts = (KEY_PART*) alloc_root(&alloc,
@@ -1570,6 +1571,8 @@ static SEL_TREE *get_mm_tree(PARAM *param,COND *cond)
if (cond_func->select_optimize() == Item_func::OPTIMIZE_NONE)
DBUG_RETURN(0); // Can't be calculated
+ param->cond= cond;
+
if (cond_func->functype() == Item_func::BETWEEN)
{
if (cond_func->arguments()[0]->type() == Item::FIELD_ITEM)
@@ -1794,14 +1797,15 @@ get_mm_leaf(PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part,
max_str[0]= min_str[0]=0;
like_error= my_like_range(field->charset(),
- res->ptr(),res->length(),
- wild_prefix,wild_one,wild_many,
- field_length,
- min_str+offset, max_str+offset,
- &min_length,&max_length);
-
+ res->ptr(), res->length(),
+ ((Item_func_like*)(param->cond))->escape,
+ wild_one, wild_many,
+ field_length,
+ min_str+offset, max_str+offset,
+ &min_length, &max_length);
if (like_error) // Can't optimize with LIKE
DBUG_RETURN(0);
+
if (offset != maybe_null) // Blob
{
int2store(min_str+maybe_null,min_length);
@@ -1824,7 +1828,7 @@ get_mm_leaf(PARAM *param, COND *conf_func, Field *field, KEY_PART *key_part,
field->cmp_type() != value->result_type())
DBUG_RETURN(0);
- if (value->save_in_field(field, 1) > 0)
+ if (value->save_in_field(field, 1) < 0)
{
/* This happens when we try to insert a NULL field in a not null column */
DBUG_RETURN(&null_element); // cmp with NULL is never true
@@ -2536,6 +2540,8 @@ key_or(SEL_ARG *key1,SEL_ARG *key2)
return 0; // OOM
tmp->copy_max_to_min(&key);
tmp->increment_use_count(key1->use_count+1);
+ /* Increment key count as it may be used for next loop */
+ key.increment_use_count(1);
new_arg->next_key_part=key_or(tmp->next_key_part,key.next_key_part);
key1=key1->insert(new_arg);
break;
@@ -2967,6 +2973,7 @@ static ulong count_key_part_usage(SEL_ARG *root, SEL_ARG *key)
void SEL_ARG::test_use_count(SEL_ARG *root)
{
+ uint e_count=0;
if (this == root && use_count != 1)
{
sql_print_error("Note: Use_count: Wrong count %lu for root",use_count);
@@ -2974,7 +2981,6 @@ void SEL_ARG::test_use_count(SEL_ARG *root)
}
if (this->type != SEL_ARG::KEY_RANGE)
return;
- uint e_count=0;
for (SEL_ARG *pos=first(); pos ; pos=pos->next)
{
e_count++;
@@ -2991,8 +2997,8 @@ void SEL_ARG::test_use_count(SEL_ARG *root)
}
}
if (e_count != elements)
- sql_print_error("Warning: Wrong use count: %u for tree at %lx", e_count,
- (gptr) this);
+ sql_print_error("Warning: Wrong use count: %u (should be %u) for tree at %lx",
+ e_count, elements, (gptr) this);
}
#endif
@@ -3260,9 +3266,9 @@ get_quick_keys(PARAM *param,QUICK_RANGE_SELECT *quick,KEY_PART *key,
}
/* Get range for retrieving rows in QUICK_SELECT::get_next */
- if (!(range= new QUICK_RANGE(param->min_key,
+ if (!(range= new QUICK_RANGE((const char *) param->min_key,
(uint) (tmp_min_key - param->min_key),
- param->max_key,
+ (const char *) param->max_key,
(uint) (tmp_max_key - param->max_key),
flag)))
return 1; // out of memory
@@ -3383,8 +3389,8 @@ QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
QUICK_RANGE *null_range;
*ref->null_ref_key= 1; // Set null byte then create a range
- if (!(null_range= new QUICK_RANGE(ref->key_buff, ref->key_length,
- ref->key_buff, ref->key_length,
+ if (!(null_range= new QUICK_RANGE((char*)ref->key_buff, ref->key_length,
+ (char*)ref->key_buff, ref->key_length,
EQ_RANGE)))
goto err;
*ref->null_ref_key= 0; // Clear null byte
@@ -3791,15 +3797,17 @@ int QUICK_SELECT_DESC::get_next()
((range->flag & NEAR_MAX) ?
HA_READ_BEFORE_KEY : HA_READ_PREFIX_LAST_OR_PREV));
#else
- /* Heikki changed Sept 11, 2002: since InnoDB does not store the cursor
- position if READ_KEY_EXACT is used to a primary key with all
- key columns specified, we must use below HA_READ_KEY_OR_NEXT,
- so that InnoDB stores the cursor position and is able to move
- the cursor one step backward after the search. */
-
- /* Note: even if max_key is only a prefix, HA_READ_AFTER_KEY will
- * do the right thing - go past all keys which match the prefix */
-
+ /*
+ Heikki changed Sept 11, 2002: since InnoDB does not store the cursor
+ position if READ_KEY_EXACT is used to a primary key with all
+ key columns specified, we must use below HA_READ_KEY_OR_NEXT,
+ so that InnoDB stores the cursor position and is able to move
+ the cursor one step backward after the search.
+ */
+ /*
+ Note: even if max_key is only a prefix, HA_READ_AFTER_KEY will
+ do the right thing - go past all keys which match the prefix
+ */
result=file->index_read(record, (byte*) range->max_key,
range->max_length,
((range->flag & NEAR_MAX) ?
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 4be74c74134..dafcabe9e3a 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -175,10 +175,10 @@ net_printf(THD *thd, uint errcode, ...)
const char *format;
#ifndef EMBEDDED_LIBRARY
const char *text_pos;
+ int head_length= NET_HEADER_SIZE;
#else
char text_pos[1024];
#endif
- int head_length= NET_HEADER_SIZE;
NET *net= &thd->net;
DBUG_ENTER("net_printf");
@@ -543,7 +543,10 @@ bool Protocol::send_fields(List<Item> *list, uint flag)
/* Store fixed length fields */
pos= (char*) local_packet->ptr()+local_packet->length();
*pos++= 12; // Length of packed fields
- int2store(pos, field.charsetnr);
+ if (item->collation.collation == &my_charset_bin || thd_charset == NULL)
+ int2store(pos, field.charsetnr);
+ else
+ int2store(pos, thd_charset->number);
int4store(pos+2, field.length);
pos[6]= field.type;
int2store(pos+7,field.flags);
diff --git a/sql/protocol.h b/sql/protocol.h
index d2ec08c3cf4..52b78a749b3 100644
--- a/sql/protocol.h
+++ b/sql/protocol.h
@@ -176,8 +176,3 @@ char *net_store_data(char *to,const char *from, uint length);
char *net_store_data(char *to,int32 from);
char *net_store_data(char *to,longlong from);
-#ifdef EMBEDDED_LIBRARY
-bool setup_params_data(struct st_prep_stmt *stmt);
-bool setup_params_data_withlog(struct st_prep_stmt *stmt);
-#endif
-
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc
index d125c95e839..f254ffb3df3 100644
--- a/sql/repl_failsafe.cc
+++ b/sql/repl_failsafe.cc
@@ -736,6 +736,7 @@ static int fetch_db_tables(THD *thd, MYSQL *mysql, const char *db,
table.db= (char*) db;
table.real_name= (char*) table_name;
table.updating= 1;
+
if (!tables_ok(thd, &table))
continue;
}
@@ -768,7 +769,7 @@ int load_master_data(THD* thd)
We do not want anyone messing with the slave at all for the entire
duration of the data load.
*/
- LOCK_ACTIVE_MI;
+ pthread_mutex_lock(&LOCK_active_mi);
lock_slave_threads(active_mi);
init_thread_mask(&restart_thread_mask,active_mi,0 /*not inverse*/);
if (restart_thread_mask &&
@@ -777,7 +778,7 @@ int load_master_data(THD* thd)
{
send_error(thd,error);
unlock_slave_threads(active_mi);
- UNLOCK_ACTIVE_MI;
+ pthread_mutex_unlock(&LOCK_active_mi);
return 1;
}
@@ -895,7 +896,7 @@ int load_master_data(THD* thd)
cleanup_mysql_results(db_res, cur_table_res - 1, table_res);
- // adjust position in the master
+ // adjust replication coordinates from the master
if (master_status_res)
{
MYSQL_ROW row = mysql_fetch_row(master_status_res);
@@ -908,10 +909,19 @@ int load_master_data(THD* thd)
*/
if (row && row[0] && row[1])
{
+ /*
+ If the slave's master info is not inited, we init it, then we write
+ the new coordinates to it. Must call init_master_info() *before*
+ setting active_mi, because init_master_info() sets active_mi with
+ defaults.
+ */
+ if (init_master_info(active_mi, master_info_file, relay_log_info_file,
+ 0))
+ send_error(thd, ER_MASTER_INFO);
strmake(active_mi->master_log_name, row[0],
sizeof(active_mi->master_log_name));
active_mi->master_log_pos = strtoull(row[1], (char**) 0, 10);
- // don't hit the magic number
+ /* at least in recent versions, the condition below should be false */
if (active_mi->master_log_pos < BIN_LOG_HEADER_SIZE)
active_mi->master_log_pos = BIN_LOG_HEADER_SIZE;
/*
@@ -938,7 +948,7 @@ int load_master_data(THD* thd)
{
send_error(thd, 0, "Failed purging old relay logs");
unlock_slave_threads(active_mi);
- UNLOCK_ACTIVE_MI;
+ pthread_mutex_unlock(&LOCK_active_mi);
return 1;
}
pthread_mutex_lock(&active_mi->rli.data_lock);
@@ -969,7 +979,7 @@ int load_master_data(THD* thd)
err:
unlock_slave_threads(active_mi);
- UNLOCK_ACTIVE_MI;
+ pthread_mutex_unlock(&LOCK_active_mi);
thd->proc_info = 0;
mysql_close(&mysql); // safe to call since we always do mysql_init()
diff --git a/sql/set_var.h b/sql/set_var.h
index 85871c90ebb..1cac2953a21 100644
--- a/sql/set_var.h
+++ b/sql/set_var.h
@@ -35,7 +35,7 @@ enum enum_var_type
OPT_DEFAULT, OPT_SESSION, OPT_GLOBAL
};
-typedef bool (*sys_check_func)(THD *, set_var *);
+typedef int (*sys_check_func)(THD *, set_var *);
typedef bool (*sys_update_func)(THD *, set_var *);
typedef void (*sys_after_update_func)(THD *,enum_var_type);
typedef void (*sys_set_default_func)(THD *, enum_var_type);
@@ -139,14 +139,12 @@ public:
sys_var_str(const char *name_arg,
sys_check_func check_func_arg,
sys_update_func update_func_arg,
- sys_set_default_func set_default_func_arg)
- :sys_var(name_arg), check_func(check_func_arg),
+ sys_set_default_func set_default_func_arg,
+ char *value_arg)
+ :sys_var(name_arg), value(value_arg), check_func(check_func_arg),
update_func(update_func_arg),set_default_func(set_default_func_arg)
{}
- bool check(THD *thd, set_var *var)
- {
- return check_func ? (*check_func)(thd, var) : 0;
- }
+ bool check(THD *thd, set_var *var);
bool update(THD *thd, set_var *var)
{
return (*update_func)(thd, var);
@@ -166,6 +164,34 @@ public:
};
+class sys_var_const_str :public sys_var
+{
+public:
+ char *value; // Pointer to const value
+ sys_var_const_str(const char *name_arg, const char *value_arg)
+ :sys_var(name_arg), value((char*) value_arg)
+ {}
+ bool check(THD *thd, set_var *var)
+ {
+ return 1;
+ }
+ bool update(THD *thd, set_var *var)
+ {
+ return 1;
+ }
+ SHOW_TYPE type() { return SHOW_CHAR; }
+ byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base)
+ {
+ return (byte*) value;
+ }
+ bool check_update_type(Item_result type)
+ {
+ return 1;
+ }
+ bool check_default(enum_var_type type) { return 1; }
+};
+
+
class sys_var_enum :public sys_var
{
uint *value;
@@ -205,30 +231,23 @@ public:
class sys_var_thd_ulong :public sys_var_thd
{
+ sys_check_func check_func;
public:
ulong SV::*offset;
sys_var_thd_ulong(const char *name_arg, ulong SV::*offset_arg)
- :sys_var_thd(name_arg), offset(offset_arg)
+ :sys_var_thd(name_arg), check_func(0), offset(offset_arg)
{}
sys_var_thd_ulong(const char *name_arg, ulong SV::*offset_arg,
- sys_after_update_func func)
- :sys_var_thd(name_arg,func), offset(offset_arg)
+ sys_check_func c_func, sys_after_update_func au_func)
+ :sys_var_thd(name_arg,au_func), check_func(c_func), offset(offset_arg)
{}
+ bool check(THD *thd, set_var *var);
bool update(THD *thd, set_var *var);
void set_default(THD *thd, enum_var_type type);
SHOW_TYPE type() { return SHOW_LONG; }
byte *value_ptr(THD *thd, enum_var_type type, LEX_STRING *base);
};
-class sys_var_pseudo_thread_id :public sys_var_thd_ulong
-{
-public:
- sys_var_pseudo_thread_id(const char *name_arg, ulong SV::*offset_arg)
- :sys_var_thd_ulong(name_arg, offset_arg)
- {}
- bool check(THD *thd, set_var *var);
-};
-
class sys_var_thd_ha_rows :public sys_var_thd
{
@@ -376,19 +395,18 @@ public:
class sys_var_thd_bit :public sys_var_thd
{
+ sys_check_func check_func;
sys_update_func update_func;
public:
ulong bit_flag;
bool reverse;
- sys_var_thd_bit(const char *name_arg, sys_update_func func, ulong bit,
- bool reverse_arg=0)
- :sys_var_thd(name_arg), update_func(func), bit_flag(bit),
- reverse(reverse_arg)
+ sys_var_thd_bit(const char *name_arg,
+ sys_check_func c_func, sys_update_func u_func,
+ ulong bit, bool reverse_arg=0)
+ :sys_var_thd(name_arg), check_func(c_func), update_func(u_func),
+ bit_flag(bit), reverse(reverse_arg)
{}
- bool check(THD *thd, set_var *var)
- {
- return check_enum(thd, var, &bool_typelib);
- }
+ bool check(THD *thd, set_var *var);
bool update(THD *thd, set_var *var);
bool check_update_type(Item_result type) { return 0; }
bool check_type(enum_var_type type) { return type == OPT_GLOBAL; }
@@ -487,7 +505,7 @@ public:
sys_var_character_set(const char *name_arg) :sys_var_thd(name_arg)
{ nullable= 0; }
bool check(THD *thd, set_var *var);
-SHOW_TYPE type() { return SHOW_CHAR; }
+ SHOW_TYPE type() { return SHOW_CHAR; }
bool check_update_type(Item_result type)
{
return type != STRING_RESULT; /* Only accept strings */
diff --git a/sql/share/charsets/Index.xml b/sql/share/charsets/Index.xml
index f21e03de8b2..bb4b6bd24af 100644
--- a/sql/share/charsets/Index.xml
+++ b/sql/share/charsets/Index.xml
@@ -464,9 +464,6 @@ To make maintaining easier please:
<order>Sorbian</order>
</collation>
<collation name="macce_bin" id="43" order="Binary" flag="binary"/>
- <!--collation name="macce_ci_ai" id="44"/-->
- <!--collation name="macce_ci" id="45"/-->
- <!--collation name="macce_cs" id="46"/-->
</charset>
<charset name="macroman">
diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt
index dd3ea82790a..423c3090b8a 100644
--- a/sql/share/czech/errmsg.txt
+++ b/sql/share/czech/errmsg.txt
@@ -240,7 +240,7 @@ character-set=latin2
"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",
-"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"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'",
@@ -250,6 +250,7 @@ character-set=latin2
"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",
"Operand should contain %d column(s)",
@@ -273,7 +274,7 @@ character-set=latin2
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input 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 for column '%s' at row %ld",
@@ -285,8 +286,8 @@ character-set=latin2
"Illegal mix of collations for operation '%s'",
"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.",
-"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",
+"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",
+"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",
@@ -298,10 +299,14 @@ character-set=latin2
"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",
"Unknown table engine '%s'",
-"'%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' define to have it working"
-"MySQL is started in --skip-grant-tables mode. You can't use this command"
+"'%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 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",
"Can't create a %s from within another stored routine"
"%s %s already exists"
"%s %s does not exist"
diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt
index c1471c78c7e..05c34236d03 100644
--- a/sql/share/danish/errmsg.txt
+++ b/sql/share/danish/errmsg.txt
@@ -207,7 +207,7 @@ character-set=latin1
"Denne handling kunne ikke udføres med kørende slave, brug først kommandoen STOP SLAVE",
"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",
-"Kunne ikke initialisere master info-struktur. Check om rettigheder i master.info",
+"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",
"Brugeren %-.64s har allerede mere end 'max_user_connections' aktive forbindelser",
"Du må kun bruge konstantudtryk med SET",
@@ -234,7 +234,7 @@ character-set=latin1
"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",
-"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"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'",
@@ -244,6 +244,7 @@ character-set=latin1
"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",
"Operand should contain %d column(s)",
@@ -267,6 +268,39 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(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 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'",
+"Can't drop one or more of the requested users",
+"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)",
+"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",
+"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",
+"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",
+"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",
+"Unknown table engine '%s'",
+"'%s' is deprecated, use '%s' instead",
+"The target table %-.100s of the %s is not updateable",
+"The '%s' feature was 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",
"Row %ld was truncated; It contained more data than there where 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",
diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt
index 0f1f9f65e99..03174c83657 100644
--- a/sql/share/dutch/errmsg.txt
+++ b/sql/share/dutch/errmsg.txt
@@ -215,7 +215,7 @@ character-set=latin1
"Deze operatie kan niet worden uitgevoerd met een actieve slave, doe eerst STOP SLAVE",
"Deze operatie vereist een actieve slave, configureer slave en doe dan START SLAVE",
"De server is niet geconfigureerd als slave, fix in configuratie bestand of met CHANGE MASTER TO",
-"Kon master info structuur niet initialiseren, controleer permissies in master.info",
+"Could not initialize master info structure, more error messages can be found in the MySQL error log",
"Kon slave thread niet aanmaken, controleer systeem resources",
"Gebruiker %-.64s heeft reeds meer dan 'max_user_connections' actieve verbindingen",
"U mag alleen constante expressies gebruiken bij SET",
@@ -242,7 +242,7 @@ character-set=latin1
"Optie '%s' tweemaal gebruikt in opdracht",
"Gebruiker '%-.64s' heeft het maximale gebruik van de '%s' faciliteit overschreden (huidige waarde: %ld)",
"Toegang geweigerd. U moet het %-.128s privilege hebben voor deze operatie",
-"Variabele '%-.64s' is LOCAL en kan niet worden gebruikt met SET GLOBAL",
+"Variabele '%-.64s' is SESSION en kan niet worden gebruikt met SET GLOBAL",
"Variabele '%-.64s' is GLOBAL en dient te worden gewijzigd met SET GLOBAL",
"Variabele '%-.64s' heeft geen standaard waarde",
"Variabele '%-.64s' kan niet worden gewijzigd naar de waarde '%-.64s'",
@@ -252,6 +252,7 @@ character-set=latin1
"Deze versie van MySQL ondersteunt nog geen '%s'",
"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",
"Operand should contain %d column(s)",
@@ -275,6 +276,39 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(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 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'",
+"Can't drop one or more of the requested users",
+"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)",
+"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",
+"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",
+"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",
+"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",
+"Unknown table engine '%s'",
+"'%s' is deprecated, use '%s' instead",
+"The target table %-.100s of the %s is not updateable",
+"The '%s' feature was 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",
"Row %ld was truncated; It contained more data than there where 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",
diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt
index 2d5757977a4..f475d270a54 100644
--- a/sql/share/english/errmsg.txt
+++ b/sql/share/english/errmsg.txt
@@ -72,9 +72,9 @@ character-set=latin1
"Not unique table/alias: '%-.64s'",
"Invalid default value for '%-.64s'",
"Multiple primary key defined",
-"Too many keys specified. Max %d keys allowed",
+"Too many keys specified; max %d keys allowed",
"Too many key parts specified. Max %d parts allowed",
-"Specified key was too long. Max key length is %d",
+"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",
@@ -231,7 +231,7 @@ character-set=latin1
"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",
-"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"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'",
@@ -241,6 +241,7 @@ character-set=latin1
"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",
"Operand should contain %d column(s)",
@@ -259,6 +260,44 @@ character-set=latin1
"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)",
+"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()",
+"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 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'",
+"Can't drop one or more of the requested users",
+"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)",
+"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",
+"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",
+"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",
+"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",
+"Unknown table engine '%s'",
+"'%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 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",
"ZLIB: Not enough memory available for zlib",
"ZLIB: Not enough room in the output buffer for zlib (probably, length of uncompressed data was corrupted)",
"ZLIB: Input data was corrupted for zlib",
diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt
index e610121e278..161e2c6863d 100644
--- a/sql/share/estonian/errmsg.txt
+++ b/sql/share/estonian/errmsg.txt
@@ -236,7 +236,7 @@ character-set=latin7
"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",
-"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"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'",
@@ -246,6 +246,7 @@ character-set=latin7
"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",
"Operand should contain %d column(s)",
@@ -269,6 +270,39 @@ character-set=latin7
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(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 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'",
+"Can't drop one or more of the requested users",
+"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)",
+"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",
+"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",
+"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",
+"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",
+"Unknown table engine '%s'",
+"'%s' is deprecated, use '%s' instead",
+"The target table %-.100s of the %s is not updateable",
+"The '%s' feature was 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",
"Row %ld was truncated; It contained more data than there where 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",
diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt
index 04310561c90..2fb86fbf917 100644
--- a/sql/share/french/errmsg.txt
+++ b/sql/share/french/errmsg.txt
@@ -231,7 +231,7 @@ character-set=latin1
"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",
-"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"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'",
@@ -241,6 +241,7 @@ character-set=latin1
"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",
"Operand should contain %d column(s)",
@@ -264,7 +265,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input 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 for column '%s' at row %ld",
@@ -276,8 +277,8 @@ character-set=latin1
"Illegal mix of collations for operation '%s'",
"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.",
-"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",
+"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",
+"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",
@@ -289,10 +290,14 @@ character-set=latin1
"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",
"Unknown table engine '%s'",
-"'%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' define to have it working"
-"MySQL is started in --skip-grant-tables mode. You can't use this command"
+"'%s' is deprecated, use '%s' instead",
+"The target table %-.100s of the %s is not updateable",
+"The '%s' feature was 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",
"Can't create a %s from within another stored routine"
"%s %s already exists"
"%s %s does not exist"
diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt
index ccbb0ced3d3..3e4eaa445f8 100644
--- a/sql/share/german/errmsg.txt
+++ b/sql/share/german/errmsg.txt
@@ -216,7 +216,7 @@ character-set=latin1
"Diese Operation kann nicht bei einem aktiven Slave durchgeführt werden. Bitte zuerst STOP SLAVE ausführen",
"Diese Operation benötigt einen aktiven Slave. Bitte Slave konfigurieren und mittels START SLAVE aktivieren",
"Der Server ist nicht als Slave konfiguriert. Bitte in der Konfigurationsdatei oder mittels CHANGE MASTER TO beheben",
-"Konnte Master-Info-Struktur nicht initialisieren. Bitte Berechtigungen von master.info prüfen",
+"Could not initialize master info structure, more error messages can be found in the MySQL error log",
"Konnte keinen Slave-Thread starten. Bitte System-Ressourcen überprüfen",
"Benutzer '%-.64s' hat mehr als max_user_connections aktive Verbindungen",
"Bei SET dürfen nur konstante Ausdrücke verwendet werden",
@@ -253,6 +253,7 @@ character-set=latin1
"Diese MySQL-Version unterstützt '%s' nicht",
"Schwerer Fehler %d: '%-.128s vom Master beim Lesen des binären Logs aufgetreten",
"Slave-SQL-Thread hat die Abfrage aufgrund von replicate-*-table-Regeln ignoriert",
+"Variable '%-.64s' is a %s variable",
"Falsche Fremdschlüssel-Definition für '%-64s': %s",
"Schlüssel- und Tabellenverweis passen nicht zusammen",
"Operand solle %d Spalte(n) enthalten",
@@ -289,7 +290,7 @@ character-set=latin1
"Variable '%-.64s' ist keine Variablen-Komponenten (kann nicht als XXXX.variablen_name verwendet werden)",
"Unbekannte Kollation: '%-.64s'",
"SSL-Parameter in CHANGE MASTER werden ignoriert, weil dieser MySQL-Slave ohne SSL-Unterstützung kompiliert wurde. Sie können aber später verwendet werden, wenn der MySQL-Slave mit SSL gestartet wird",
-"Server läuft im Modus --secure-auth, aber '%s@%s' hat ein Passwort im alten Format. Bitte Passwort ins neue Format ändern",
+"Server läuft im Modus --secure-auth, aber '%s'@'%s' hat ein Passwort im alten Format. Bitte Passwort ins neue Format ändern",
"Feld oder Verweis '%-.64s%s%-.64s%s%-.64s' im SELECT-Befehl Nr. %d wurde im SELECT-Befehl Nr. %d aufgelöst",
"Falscher Parameter oder falsche Kombination von Parametern für START SLAVE UNTIL",
"Es wird empfohlen, mit --skip-slave-start zu starten, wenn mit START SLAVE UNTIL eine Schritt-für-Schritt-Replikation ausgeführt wird. Ansonsten gibt es Probleme, wenn der Slave-Server unerwartet neu startet",
@@ -301,10 +302,14 @@ character-set=latin1
"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",
"Unknown table engine '%s'",
-"'%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' define to have it working"
-"MySQL is started in --skip-grant-tables mode. You can't use this command"
+"'%s' is deprecated, use '%s' instead",
+"The target table %-.100s of the %s is not updateable",
+"The '%s' feature was 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",
"Can't create a %s from within another stored routine"
"%s %s already exists"
"%s %s does not exist"
diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt
index f7294fc0697..c287c5fdc9d 100644
--- a/sql/share/greek/errmsg.txt
+++ b/sql/share/greek/errmsg.txt
@@ -231,7 +231,7 @@ character-set=greek
"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",
-"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"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'",
@@ -241,6 +241,7 @@ character-set=greek
"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",
"Operand should contain %d column(s)",
@@ -264,7 +265,7 @@ character-set=greek
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input 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 for column '%s' at row %ld",
@@ -276,8 +277,8 @@ character-set=greek
"Illegal mix of collations for operation '%s'",
"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.",
-"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",
+"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",
+"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",
@@ -289,10 +290,14 @@ character-set=greek
"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",
"Unknown table engine '%s'",
-"'%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' define to have it working"
-"MySQL is started in --skip-grant-tables mode. You can't use this command"
+"'%s' is deprecated, use '%s' instead",
+"The target table %-.100s of the %s is not updateable",
+"The '%s' feature was 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",
"Can't create a %s from within another stored routine"
"%s %s already exists"
"%s %s does not exist"
diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt
index a127f35584d..80e84c2da72 100644
--- a/sql/share/hungarian/errmsg.txt
+++ b/sql/share/hungarian/errmsg.txt
@@ -233,7 +233,7 @@ character-set=latin2
"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",
-"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"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'",
@@ -243,6 +243,7 @@ character-set=latin2
"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",
"Operand should contain %d column(s)",
@@ -266,7 +267,7 @@ character-set=latin2
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input 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 for column '%s' at row %ld",
@@ -278,8 +279,8 @@ character-set=latin2
"Illegal mix of collations for operation '%s'",
"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.",
-"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",
+"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",
+"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",
@@ -291,10 +292,14 @@ character-set=latin2
"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",
"Unknown table engine '%s'",
-"'%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' define to have it working"
-"MySQL is started in --skip-grant-tables mode. You can't use this command"
+"'%s' is deprecated, use '%s' instead",
+"The target table %-.100s of the %s is not updateable",
+"The '%s' feature was 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",
"Can't create a %s from within another stored routine"
"%s %s already exists"
"%s %s does not exist"
diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt
index e8225c6ba48..ef41c493622 100644
--- a/sql/share/italian/errmsg.txt
+++ b/sql/share/italian/errmsg.txt
@@ -204,7 +204,7 @@ character-set=latin1
"Questa operazione non puo' essere eseguita con un database 'slave' che gira, lanciare prima STOP SLAVE",
"Questa operaione richiede un database 'slave', configurarlo ed eseguire START SLAVE",
"Il server non e' configurato come 'slave', correggere il file di configurazione cambiando CHANGE MASTER TO",
-"Impossibile inizializzare la struttura 'master info', controllare i permessi sul file master.info",
+"Could not initialize master info structure, more error messages can be found in the MySQL error log",
"Impossibile creare il thread 'slave', controllare le risorse di sistema",
"L'utente %-.64s ha gia' piu' di 'max_user_connections' connessioni attive",
"Si possono usare solo espressioni costanti con SET",
@@ -231,7 +231,7 @@ character-set=latin1
"L'opzione '%s' e' stata usata due volte nel comando",
"L'utente '%-.64s' ha ecceduto la risorsa '%s' (valore corrente: %ld)",
"Accesso non consentito. Serve il privilegio %-.128s per questa operazione",
-"La variabile '%-.64s' e' una variabile locale ( LOCAL ) e non puo' essere cambiata usando SET GLOBAL",
+"La variabile '%-.64s' e' una variabile locale ( SESSION ) e non puo' essere cambiata usando SET GLOBAL",
"La variabile '%-.64s' e' una variabile globale ( GLOBAL ) e deve essere cambiata usando SET GLOBAL",
"La variabile '%-.64s' non ha un valore di default",
"Alla variabile '%-.64s' non puo' essere assegato il valore '%-.64s'",
@@ -241,6 +241,7 @@ character-set=latin1
"Questa versione di MySQL non supporta ancora '%s'",
"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",
"Operand should contain %d column(s)",
@@ -264,7 +265,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input 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 for column '%s' at row %ld",
@@ -276,8 +277,8 @@ character-set=latin1
"Illegal mix of collations for operation '%s'",
"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.",
-"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",
+"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",
+"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",
@@ -289,10 +290,14 @@ character-set=latin1
"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",
"Unknown table engine '%s'",
-"'%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' define to have it working"
-"MySQL is started in --skip-grant-tables mode. You can't use this command"
+"'%s' is deprecated, use '%s' instead",
+"The target table %-.100s of the %s is not updateable",
+"The '%s' feature was 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",
"Can't create a %s from within another stored routine"
"%s %s already exists"
"%s %s does not exist"
diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt
index af4e626a1fd..60e390b02ff 100644
--- a/sql/share/japanese/errmsg.txt
+++ b/sql/share/japanese/errmsg.txt
@@ -233,7 +233,7 @@ character-set=ujis
"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",
-"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"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'",
@@ -243,6 +243,7 @@ character-set=ujis
"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",
"Operand should contain %d column(s)",
@@ -266,7 +267,7 @@ character-set=ujis
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input 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 for column '%s' at row %ld",
@@ -278,8 +279,8 @@ character-set=ujis
"Illegal mix of collations for operation '%s'",
"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.",
-"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",
+"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",
+"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",
@@ -291,10 +292,14 @@ character-set=ujis
"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",
"Unknown table engine '%s'",
-"'%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' define to have it working"
-"MySQL is started in --skip-grant-tables mode. You can't use this command"
+"'%s' is deprecated, use '%s' instead",
+"The target table %-.100s of the %s is not updateable",
+"The '%s' feature was 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",
"Can't create a %s from within another stored routine"
"%s %s already exists"
"%s %s does not exist"
diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt
index dd67927adef..1797a7c8e2a 100644
--- a/sql/share/korean/errmsg.txt
+++ b/sql/share/korean/errmsg.txt
@@ -231,7 +231,7 @@ character-set=euckr
"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",
-"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"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'",
@@ -241,6 +241,7 @@ character-set=euckr
"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",
"Operand should contain %d column(s)",
@@ -264,7 +265,7 @@ character-set=euckr
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input 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 for column '%s' at row %ld",
@@ -276,8 +277,8 @@ character-set=euckr
"Illegal mix of collations for operation '%s'",
"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.",
-"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",
+"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",
+"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",
@@ -289,10 +290,14 @@ character-set=euckr
"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",
"Unknown table engine '%s'",
-"'%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' define to have it working"
-"MySQL is started in --skip-grant-tables mode. You can't use this command"
+"'%s' is deprecated, use '%s' instead",
+"The target table %-.100s of the %s is not updateable",
+"The '%s' feature was 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",
"Can't create a %s from within another stored routine"
"%s %s already exists"
"%s %s does not exist"
diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt
index 06c26a06e99..498b65715b8 100644
--- a/sql/share/norwegian-ny/errmsg.txt
+++ b/sql/share/norwegian-ny/errmsg.txt
@@ -233,7 +233,7 @@ character-set=latin1
"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",
-"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"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'",
@@ -243,6 +243,7 @@ character-set=latin1
"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",
"Operand should contain %d column(s)",
@@ -266,7 +267,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input 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 for column '%s' at row %ld",
@@ -278,8 +279,8 @@ character-set=latin1
"Illegal mix of collations for operation '%s'",
"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.",
-"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",
+"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",
+"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",
@@ -291,10 +292,14 @@ character-set=latin1
"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",
"Unknown table engine '%s'",
-"'%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' define to have it working"
-"MySQL is started in --skip-grant-tables mode. You can't use this command"
+"'%s' is deprecated, use '%s' instead",
+"The target table %-.100s of the %s is not updateable",
+"The '%s' feature was 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",
"Can't create a %s from within another stored routine"
"%s %s already exists"
"%s %s does not exist"
diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt
index 08358db4b3a..74f4acd43f0 100644
--- a/sql/share/norwegian/errmsg.txt
+++ b/sql/share/norwegian/errmsg.txt
@@ -233,7 +233,7 @@ character-set=latin1
"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",
-"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"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'",
@@ -243,6 +243,7 @@ character-set=latin1
"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",
"Operand should contain %d column(s)",
@@ -266,7 +267,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input 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 for column '%s' at row %ld",
@@ -278,8 +279,8 @@ character-set=latin1
"Illegal mix of collations for operation '%s'",
"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.",
-"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",
+"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",
+"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",
@@ -291,10 +292,14 @@ character-set=latin1
"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",
"Unknown table engine '%s'",
-"'%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' define to have it working"
-"MySQL is started in --skip-grant-tables mode. You can't use this command"
+"'%s' is deprecated, use '%s' instead",
+"The target table %-.100s of the %s is not updateable",
+"The '%s' feature was 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",
"Can't create a %s from within another stored routine"
"%s %s already exists"
"%s %s does not exist"
diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt
index 9aa6cf0d453..e9f6e6a349e 100644
--- a/sql/share/polish/errmsg.txt
+++ b/sql/share/polish/errmsg.txt
@@ -235,7 +235,7 @@ character-set=latin2
"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",
-"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"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'",
@@ -245,6 +245,7 @@ character-set=latin2
"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",
"Operand should contain %d column(s)",
@@ -268,7 +269,7 @@ character-set=latin2
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input 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 for column '%s' at row %ld",
@@ -280,8 +281,8 @@ character-set=latin2
"Illegal mix of collations for operation '%s'",
"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.",
-"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",
+"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",
+"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",
@@ -293,10 +294,14 @@ character-set=latin2
"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",
"Unknown table engine '%s'",
-"'%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' define to have it working"
-"MySQL is started in --skip-grant-tables mode. You can't use this command"
+"'%s' is deprecated, use '%s' instead",
+"The target table %-.100s of the %s is not updateable",
+"The '%s' feature was 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",
"Can't create a %s from within another stored routine"
"%s %s already exists"
"%s %s does not exist"
diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt
index 49ccf308634..7056a5bb169 100644
--- a/sql/share/portuguese/errmsg.txt
+++ b/sql/share/portuguese/errmsg.txt
@@ -205,7 +205,7 @@ character-set=latin1
"Esta operação não pode ser realizada com um 'slave' em execução. Execute STOP SLAVE primeiro",
"Esta operação requer um 'slave' em execução. Configure o 'slave' e execute START SLAVE",
"O servidor não está configurado como 'slave'. Acerte o arquivo de configuração ou use CHANGE MASTER TO",
-"Não pode inicializar a estrutura de informação do 'master'. Verifique as permissões em 'master.info'",
+"Could not initialize master info structure, more error messages can be found in the MySQL error log",
"Não conseguiu criar 'thread' de 'slave'. Verifique os recursos do sistema",
"Usuário '%-.64s' já possui mais que o valor máximo de conexões (max_user_connections) ativas",
"Você pode usar apenas expressões constantes com SET",
@@ -232,7 +232,7 @@ character-set=latin1
"Opção '%s' usada duas vezes no comando",
"Usuário '%-.64s' tem excedido o '%s' recurso (atual valor: %ld)",
"Acesso negado. Você precisa o privilégio %-.128s para essa operação",
-"Variável '%-.64s' é uma LOCAL variável e não pode ser usada com SET GLOBAL",
+"Variável '%-.64s' é uma SESSION variável e não pode ser usada com SET GLOBAL",
"Variável '%-.64s' é uma GLOBAL variável e deve ser configurada com SET GLOBAL",
"Variável '%-.64s' não tem um valor padrão",
"Variável '%-.64s' não pode ser configurada para o valor de '%-.64s'",
@@ -242,6 +242,7 @@ character-set=latin1
"Esta versão de MySQL não suporta ainda '%s'",
"Obteve fatal erro %d: '%-.128s' do master quando lendo dados do binary log",
"Slave SQL thread ignorado a consulta devido às normas de replicação-*-tabela",
+"Variable '%-.64s' is a %s variable",
"Definição errada da chave estrangeira para '%-.64s': %s",
"Referência da chave e referência da tabela não coincidem",
"Operand should contain %d column(s)",
@@ -278,7 +279,7 @@ character-set=latin1
"Variável '%-.64s' não é uma variável componente (Não pode ser usada como XXXX.variável_nome)",
"Collation desconhecida: '%-.64s'",
"SSL parâmetros em CHANGE MASTER são ignorados porque este escravo MySQL foi compilado sem o SSL suporte. Os mesmos podem ser usados mais tarde quando o escravo MySQL com SSL seja iniciado.",
-"Servidor está rodando em --secure-auth modo, porêm '%s@%s' tem senha no formato antigo; por favor troque a senha para o novo formato",
+"Servidor está rodando em --secure-auth modo, porêm '%s'@'%s' tem senha no formato antigo; por favor troque a senha para o novo formato",
"Campo ou referência '%-.64s%s%-.64s%s%-.64s' de SELECT #%d foi resolvido em SELECT #%d",
"Parâmetro ou combinação de parâmetros errado para START SLAVE UNTIL",
"É recomendado para rodar com --skip-slave-start quando fazendo replicação passo-por-passo com START SLAVE UNTIL, de outra forma você não está seguro em caso de inesperada reinicialição do mysqld escravo",
@@ -290,10 +291,14 @@ character-set=latin1
"Key cache desconhecida '%-.100s'",
"MySQL foi inicializado em modo --skip-name-resolve. Você necesita reincializá-lo sem esta opção para este grant funcionar",
"Motor de tabela desconhecido '%s'",
-"'%s' é desatualizado. Use '%s' em seu lugar.",
-"The target table %-.100s of the %s is not updatable.",
-"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
-"MySQL is started in --skip-grant-tables mode. You can't use this command"
+"'%s' é desatualizado. Use '%s' em seu lugar",
+"A tabela destino %-.100s do %s não é atualizável",
+"O recurso '%s' foi desativado; você necessita MySQL construído com '%s' para ter isto funcionando",
+"O servidor MySQL está rodando com a opção %s razão pela qual não pode executar esse commando",
+"Coluna '%-.100s' tem valor duplicado '%-.64s' em %s"
+"Truncado errado %-.32s valor: '%-.128s'"
+"Incorreta definição de tabela; Pode ter somente uma coluna TIMESTAMP com CURRENT_TIMESTAMP em DEFAULT ou ON UPDATE cláusula"
+"Inválida cláusula ON UPDATE para campo '%-.64s'",
"Can't create a %s from within another stored routine"
"%s %s already exists"
"%s %s does not exist"
diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt
index b79926cb7e4..c1f7cbf9914 100644
--- a/sql/share/romanian/errmsg.txt
+++ b/sql/share/romanian/errmsg.txt
@@ -235,7 +235,7 @@ character-set=latin2
"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",
-"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"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'",
@@ -245,6 +245,7 @@ character-set=latin2
"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",
"Operand should contain %d column(s)",
@@ -268,7 +269,7 @@ character-set=latin2
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input 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 for column '%s' at row %ld",
@@ -280,8 +281,8 @@ character-set=latin2
"Illegal mix of collations for operation '%s'",
"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.",
-"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",
+"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",
+"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",
@@ -293,10 +294,14 @@ character-set=latin2
"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",
"Unknown table engine '%s'",
-"'%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' define to have it working"
-"MySQL is started in --skip-grant-tables mode. You can't use this command"
+"'%s' is deprecated, use '%s' instead",
+"The target table %-.100s of the %s is not updateable",
+"The '%s' feature was 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",
"Can't create a %s from within another stored routine"
"%s %s already exists"
"%s %s does not exist"
diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt
index be92447d43e..86a4424b8f1 100644
--- a/sql/share/russian/errmsg.txt
+++ b/sql/share/russian/errmsg.txt
@@ -76,7 +76,7 @@ character-set=koi8r
"õËÁÚÁÎÏ ÎÅÓËÏÌØËÏ ÐÅÒ×ÉÞÎÙÈ ËÌÀÞÅÊ",
"õËÁÚÁÎÏ ÓÌÉÛËÏÍ ÍÎÏÇÏ ËÌÀÞÅÊ. òÁÚÒÅÛÁÅÔÓÑ ÕËÁÚÙ×ÁÔØ ÎÅ ÂÏÌÅÅ %d ËÌÀÞÅÊ",
"õËÁÚÁÎÏ ÓÌÉÛËÏÍ ÍÎÏÇÏ ÞÁÓÔÅÊ ÓÏÓÔÁ×ÎÏÇÏ ËÌÀÞÁ. òÁÚÒÅÛÁÅÔÓÑ ÕËÁÚÙ×ÁÔØ ÎÅ ÂÏÌÅÅ %d ÞÁÓÔÅÊ",
-"õËÁÚÁÎ ÓÌÉÛËÏÍ ÄÌÉÎÎÙÊ ËÌÀÞ. íÁËÓÉÍÁÌØÎÁÑ ÄÌÉÎÁ ËÌÀÞÁ ÓÏÓÔÁ×ÌÑÅÔ %d",
+"õËÁÚÁÎ ÓÌÉÛËÏÍ ÄÌÉÎÎÙÊ ËÌÀÞ. íÁËÓÉÍÁÌØÎÁÑ ÄÌÉÎÁ ËÌÀÞÁ ÓÏÓÔÁ×ÌÑÅÔ %d ÂÁÊÔ",
"ëÌÀÞÅ×ÏÊ ÓÔÏÌÂÅà '%-.64s' × ÔÁÂÌÉÃÅ ÎÅ ÓÕÝÅÓÔ×ÕÅÔ",
"óÔÏÌÂÅà ÔÉÐÁ BLOB '%-.64s' ÎÅ ÍÏÖÅÔ ÂÙÔØ ÉÓÐÏÌØÚÏ×ÁÎ ËÁË ÚÎÁÞÅÎÉÅ ËÌÀÞÁ × ÔÁÂÌÉÃÅ ÔÁËÏÇÏ ÔÉÐÁ",
"óÌÉÛËÏÍ ÂÏÌØÛÁÑ ÄÌÉÎÁ ÓÔÏÌÂÃÁ '%-.64s' (ÍÁËÓÉÍÕÍ = %d). éÓÐÏÌØÚÕÊÔÅ ÔÉÐ BLOB ×ÍÅÓÔÏ ÔÅËÕÝÅÇÏ",
@@ -89,7 +89,7 @@ character-set=koi8r
"îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ IP-ÓÏËÅÔ",
"÷ ÔÁÂÌÉÃÅ '%-.64s' ÎÅÔ ÔÁËÏÇÏ ÉÎÄÅËÓÁ, ËÁË × CREATE INDEX. óÏÚÄÁÊÔÅ ÔÁÂÌÉÃÕ ÚÁÎÏ×Ï",
"áÒÇÕÍÅÎÔ ÒÁÚÄÅÌÉÔÅÌÑ ÐÏÌÅÊ - ÎÅ ÔÏÔ, ËÏÔÏÒÙÊ ÏÖÉÄÁÌÓÑ. ïÂÒÁÝÁÊÔÅÓØ Ë ÄÏËÕÍÅÎÔÁÃÉÉ",
-"æÉËÓÉÒÏ×ÁÎÎÙÊ ÒÁÚÍÅÒ ÚÁÐÉÓÉ Ó ÐÏÌÑÍÉ ÔÉÐÁ BLOB ÉÓÐÏÌØÚÏ×ÁÔØ ÎÅÌØÚÑ. ðÒÉÍÅÎÑÊÔÅ 'fields terminated by'.",
+"æÉËÓÉÒÏ×ÁÎÎÙÊ ÒÁÚÍÅÒ ÚÁÐÉÓÉ Ó ÐÏÌÑÍÉ ÔÉÐÁ BLOB ÉÓÐÏÌØÚÏ×ÁÔØ ÎÅÌØÚÑ, ÐÒÉÍÅÎÑÊÔÅ 'fields terminated by'",
"æÁÊÌ '%-.64s' ÄÏÌÖÅÎ ÎÁÈÏÄÉÔØÓÑ × ÔÏÍ ÖÅ ËÁÔÁÌÏÇÅ, ÞÔÏ É ÂÁÚÁ ÄÁÎÎÙÈ, ÉÌÉ ÂÙÔØ ÏÂÝÅÄÏÓÔÕÐÎÙÍ ÄÌÑ ÞÔÅÎÉÑ",
"æÁÊÌ '%-.80s' ÕÖÅ ÓÕÝÅÓÔ×ÕÅÔ",
"úÁÐÉÓÅÊ: %ld õÄÁÌÅÎÏ: %ld ðÒÏÐÕÝÅÎÏ: %ld ðÒÅÄÕÐÒÅÖÄÅÎÉÊ: %ld",
@@ -206,7 +206,7 @@ character-set=koi8r
"üÔÕ ÏÐÅÒÁÃÉÀ ÎÅ×ÏÚÍÏÖÎÏ ×ÙÐÏÌÎÉÔØ ÐÒÉ ÒÁÂÏÔÁÀÝÅÍ ÐÏÔÏËÅ ÐÏÄÞÉÎÅÎÎÏÇÏ ÓÅÒ×ÅÒÁ. óÎÁÞÁÌÁ ×ÙÐÏÌÎÉÔÅ STOP SLAVE",
"äÌÑ ÜÔÏÊ ÏÐÅÒÁÃÉÉ ÔÒÅÂÕÅÔÓÑ ÒÁÂÏÔÁÀÝÉÊ ÐÏÄÞÉÎÅÎÎÙÊ ÓÅÒ×ÅÒ. óÎÁÞÁÌÁ ×ÙÐÏÌÎÉÔÅ START SLAVE",
"üÔÏÔ ÓÅÒ×ÅÒ ÎÅ ÎÁÓÔÒÏÅÎ ËÁË ÐÏÄÞÉÎÅÎÎÙÊ. ÷ÎÅÓÉÔÅ ÉÓÐÒÁ×ÌÅÎÉÑ × ËÏÎÆÉÇÕÒÁÃÉÏÎÎÏÍ ÆÁÊÌÅ ÉÌÉ Ó ÐÏÍÏÝØÀ CHANGE MASTER TO",
-"îÅ×ÏÚÍÏÖÎÏ ÉÎÉÃÉÁÌÉÚÉÒÏ×ÁÔØ ÓÔÒÕËÔÕÒÕ ÄÌÑ ÉÎÆÏÒÍÁÃÉÉ Ï ÇÏÌÏ×ÎÏÍ ÓÅÒ×ÅÒÅ. ðÒÏ×ÅÒØÔÅ ÐÒÁ×Á ÎÁ ÆÁÊÌ master.info",
+"Could not initialize master info structure, more error messages can be found in the MySQL error log",
"îÅ×ÏÚÍÏÖÎÏ ÓÏÚÄÁÔØ ÐÏÔÏË ÐÏÄÞÉÎÅÎÎÏÇÏ ÓÅÒ×ÅÒÁ. ðÒÏ×ÅÒØÔÅ ÓÉÓÔÅÍÎÙÅ ÒÅÓÕÒÓÙ",
"õ ÐÏÌØÚÏ×ÁÔÅÌÑ %-.64s ÕÖÅ ÂÏÌØÛÅ ÞÅÍ 'max_user_connections' ÁËÔÉ×ÎÙÈ ÓÏÅÄÉÎÅÎÉÊ",
"÷Ù ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ × SET ÔÏÌØËÏ ËÏÎÓÔÁÎÔÎÙÅ ×ÙÒÁÖÅÎÉÑ",
@@ -233,7 +233,7 @@ character-set=koi8r
"ïÐÃÉÑ '%s' Ä×ÁÖÄÙ ÉÓÐÏÌØÚÏ×ÁÎÁ × ×ÙÒÁÖÅÎÉÉ",
"ðÏÌØÚÏ×ÁÔÅÌØ '%-.64s' ÐÒÅ×ÙÓÉÌ ÉÓÐÏÌØÚÏ×ÁÎÉÅ ÒÅÓÕÒÓÁ '%s' (ÔÅËÕÝÅÅ ÚÎÁÞÅÎÉÅ: %ld)",
"÷ ÄÏÓÔÕÐÅ ÏÔËÁÚÁÎÏ. ÷ÁÍ ÎÕÖÎÙ ÐÒÉ×ÉÌÅÇÉÉ %-.128s ÄÌÑ ÜÔÏÊ ÏÐÅÒÁÃÉÉ",
-"ðÅÒÅÍÅÎÎÁÑ '%-.64s' Ñ×ÌÑÅÔÓÑ ÐÏÔÏËÏ×ÏÊ (LOCAL) ÐÅÒÅÍÅÎÎÏÊ É ÎÅ ÍÏÖÅÔ ÂÙÔØ ÉÚÍÅÎÅÎÁ Ó ÐÏÍÏÝØÀ SET GLOBAL",
+"ðÅÒÅÍÅÎÎÁÑ '%-.64s' Ñ×ÌÑÅÔÓÑ ÐÏÔÏËÏ×ÏÊ (SESSION) ÐÅÒÅÍÅÎÎÏÊ É ÎÅ ÍÏÖÅÔ ÂÙÔØ ÉÚÍÅÎÅÎÁ Ó ÐÏÍÏÝØÀ SET GLOBAL",
"ðÅÒÅÍÅÎÎÁÑ '%-.64s' Ñ×ÌÑÅÔÓÑ ÇÌÏÂÁÌØÎÏÊ (GLOBAL) ÐÅÒÅÍÅÎÎÏÊ, É ÅÅ ÓÌÅÄÕÅÔ ÉÚÍÅÎÑÔØ Ó ÐÏÍÏÝØÀ SET GLOBAL",
"ðÅÒÅÍÅÎÎÁÑ '%-.64s' ÎÅ ÉÍÅÅÔ ÚÎÁÞÅÎÉÑ ÐÏ ÕÍÏÌÞÁÎÉÀ",
"ðÅÒÅÍÅÎÎÁÑ '%-.64s' ÎÅ ÍÏÖÅÔ ÂÙÔØ ÕÓÔÁÎÏ×ÌÅÎÁ × ÚÎÁÞÅÎÉÅ '%-.64s'",
@@ -243,6 +243,7 @@ character-set=koi8r
"üÔÁ ×ÅÒÓÉÑ MySQL ÐÏËÁ ÅÝÅ ÎÅ ÐÏÄÄÅÒÖÉ×ÁÅÔ '%s'",
"ðÏÌÕÞÅÎÁ ÎÅÉÓÐÒÁ×ÉÍÁÑ ÏÛÉÂËÁ %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",
"ïÐÅÒÁÎÄ ÄÏÌÖÅÎ ÓÏÄÅÒÖÁÔØ %d ËÏÌÏÎÏË",
@@ -266,7 +267,7 @@ character-set=koi8r
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input 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 for column '%s' at row %ld",
@@ -278,8 +279,8 @@ character-set=koi8r
"Illegal mix of collations for operation '%s'",
"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.",
-"óÅÒ×ÅÒ ÚÁÐÕÝÅÎ × ÒÅÖÉÍÅ --secure-auth (ÂÅÚÏÐÁÓÎÏÊ Á×ÔÏÒÉÚÁÃÉÉ), ÎÏ ÄÌÑ ÐÏÌØÚÏ×ÁÔÅÌÑ '%s@%s' ÐÁÒÏÌØ ÓÏÈÒÁÎ£Î × ÓÔÁÒÏÍ ÆÏÒÍÁÔÅ; ÎÅÏÂÈÏÄÉÍÏ ÏÂÎÏ×ÉÔØ ÆÏÒÍÁÔ ÐÁÒÏÌÑ",
+"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",
+"óÅÒ×ÅÒ ÚÁÐÕÝÅÎ × ÒÅÖÉÍÅ --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",
@@ -291,10 +292,14 @@ character-set=koi8r
"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",
"Unknown table engine '%s'",
-"'%s' is deprecated. Use '%s' instead.",
-"ôÁÂÌÉÃÁ %-.100s × %s ÎÅ ÍÏÖÅÔ ÉÚÍÅÎÑÔÓÑ.",
-"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
-"MySQL is started in --skip-grant-tables mode. You can't use this command"
+"'%s' is deprecated, use '%s' instead",
+"ôÁÂÌÉÃÁ %-.100s × %s ÎÅ ÍÏÖÅÔ ÉÚÍÅÎÑÔÓÑ",
+"The '%s' feature was 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",
"Can't create a %s from within another stored routine"
"%s %s already exists"
"%s %s does not exist"
diff --git a/sql/share/serbian/errmsg.txt b/sql/share/serbian/errmsg.txt
index 92710650f50..957c7650a87 100644
--- a/sql/share/serbian/errmsg.txt
+++ b/sql/share/serbian/errmsg.txt
@@ -259,7 +259,7 @@ character-set=cp1250
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input 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 for column '%s' at row %ld",
@@ -271,8 +271,8 @@ character-set=cp1250
"Illegal mix of collations for operation '%s'",
"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.",
-"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",
+"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",
+"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",
@@ -284,10 +284,14 @@ character-set=cp1250
"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",
"Unknown table engine '%s'",
-"'%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' define to have it working"
-"MySQL is started in --skip-grant-tables mode. You can't use this command"
+"'%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 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",
"Can't create a %s from within another stored routine"
"%s %s already exists"
"%s %s does not exist"
diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt
index c81d74075ad..feddd50b585 100644
--- a/sql/share/slovak/errmsg.txt
+++ b/sql/share/slovak/errmsg.txt
@@ -239,7 +239,7 @@ character-set=latin2
"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",
-"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"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'",
@@ -249,6 +249,7 @@ character-set=latin2
"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",
"Operand should contain %d column(s)",
@@ -272,7 +273,7 @@ character-set=latin2
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input 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 for column '%s' at row %ld",
@@ -284,8 +285,8 @@ character-set=latin2
"Illegal mix of collations for operation '%s'",
"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.",
-"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",
+"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",
+"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",
@@ -297,10 +298,14 @@ character-set=latin2
"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",
"Unknown table engine '%s'",
-"'%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' define to have it working"
-"MySQL is started in --skip-grant-tables mode. You can't use this command"
+"'%s' is deprecated, use '%s' instead",
+"The target table %-.100s of the %s is not updateable",
+"The '%s' feature was 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",
"Can't create a %s from within another stored routine"
"%s %s already exists"
"%s %s does not exist"
diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt
index e79af2de398..f309b8108bb 100644
--- a/sql/share/spanish/errmsg.txt
+++ b/sql/share/spanish/errmsg.txt
@@ -206,7 +206,7 @@ character-set=latin1
"Esta operación no puede ser hecha con el esclavo funcionando, primero use STOP SLAVE",
"Esta operación necesita el esclavo funcionando, configure esclavo y haga el START SLAVE",
"El servidor no está configurado como esclavo, edite el archivo config file o con CHANGE MASTER TO",
-"No puedo inicializar la estructura info del master, verifique permisiones en el master.info",
+"Could not initialize master info structure, more error messages can be found in the MySQL error log",
"No puedo crear el thread esclavo, verifique recursos del sistema",
"Usario %-.64s ya tiene mas que 'max_user_connections' conexiones activas",
"Tu solo debes usar expresiones constantes con SET",
@@ -233,7 +233,7 @@ character-set=latin1
"Opción '%s' usada dos veces en el comando",
"Usuario '%-.64s' ha excedido el recurso '%s' (actual valor: %ld)",
"Acceso negado. Usted necesita el privilegio %-.128s para esta operación",
-"Variable '%-.64s' es una LOCAL variable y no puede ser usada con SET GLOBAL",
+"Variable '%-.64s' es una SESSION variable y no puede ser usada con SET GLOBAL",
"Variable '%-.64s' es una GLOBAL variable y no puede ser configurada con SET GLOBAL",
"Variable '%-.64s' no tiene un valor patrón",
"Variable '%-.64s' no puede ser configurada para el valor de '%-.64s'",
@@ -243,58 +243,63 @@ character-set=latin1
"Esta versión de MySQL no soporta todavia '%s'",
"Recibió fatal error %d: '%-.128s' del master cuando leyendo datos del binary log",
"Slave SQL thread ignorado el query debido a las reglas de replicación-*-tabla",
-"Wrong foreign key definition for '%-.64s': %s",
-"Key reference and table reference doesn't match",
-"Operand should contain %d column(s)",
-"Subquery returns more than 1 row",
-"Unknown prepared statement handler (%ld) 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",
-"Client does not support authentication protocol requested by server; consider upgrading MySQL client",
-"All parts of a SPATIAL KEY 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()",
-"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where 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'",
-"Can't drop one or more of the requested users",
-"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)",
-"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.",
-"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",
-"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",
-"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",
-"Unknown table engine '%s'",
-"'%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' define to have it working"
-"MySQL is started in --skip-grant-tables mode. You can't use this command"
+"Variable '%-.64s' es una %s variable",
+"Equivocada definición de llave extranjera para '%-.64s': %s",
+"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",
+"Base de datos Help está corrupto o no existe",
+"Cíclica referencia en subconsultas",
+"Convirtiendo columna '%s' de %s para %s",
+"Referencia '%-.64s' no soportada (%s)",
+"Cada tabla derivada debe tener su propio alias",
+"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",
+"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()",
+"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",
+"Datos truncados, fuera de gama para columna '%s' en la línea %ld",
+"Datos truncados para columna '%s' en la línea %ld",
+"Usando motor de almacenamiento %s para tabla '%s'",
+"Ilegal mezcla de collations (%s,%s) y (%s,%s) para operación '%s'",
+"No puede remover uno o mas de los usuarios solicitados",
+"No puede revocar todos los privilegios, derecho para uno o mas de los usuarios solicitados",
+"Ilegal mezcla de collations (%s,%s), (%s,%s), (%s,%s) para operación '%s'",
+"Ilegal mezcla de collations para operación '%s'",
+"Variable '%-.64s' no es una variable componente (No puede ser usada como XXXX.variable_name)",
+"Collation desconocida: '%-.64s'",
+"Parametros SSL en CHANGE MASTER son ignorados porque este slave MySQL fue compilado sin soporte SSL; pueden ser usados despues cuando el slave MySQL con SSL sea inicializado",
+"Servidor está rodando en modo --secure-auth, pero '%s'@'%s' tiene clave en el antiguo formato; por favor cambie la clave para el nuevo formato",
+"Campo o referencia '%-.64s%s%-.64s%s%-.64s' de SELECT #%d fue resolvido en SELECT #%d",
+"Parametro equivocado o combinación de parametros para START SLAVE UNTIL",
+"Es recomendado rodar con --skip-slave-start cuando haciendo replicación step-by-step con START SLAVE UNTIL, a menos que usted no esté seguro en caso de inesperada reinicialización del mysqld slave",
+"SQL thread no es inicializado tal que opciones UNTIL son ignoradas",
+"Nombre de índice incorrecto '%-.100s'",
+"Nombre de catalog incorrecto '%-.100s'",
+"Query cache fallada para configurar tamaño %lu, nuevo tamaño de query cache es %lu",
+"Columna '%-.64s' no puede ser parte de FULLTEXT index",
+"Desconocida key cache '%-.100s'",
+"MySQL esta inicializado en modo --skip-name-resolve. Usted necesita reinicializarlo sin esta opción para este derecho funcionar",
+"Desconocido motor de tabla '%s'",
+"'%s' está desaprobado, use '%s' en su lugar",
+"La tabla destino %-.100s del %s no es actualizable",
+"El recurso '%s' fue deshabilitado; usted necesita construir MySQL con '%s' para tener eso funcionando",
+"El servidor MySQL está rodando con la opción %s tal que no puede ejecutar este comando",
+"Columna '%-.100s' tiene valor doblado '%-.64s' en %s"
+"Equivocado truncado %-.32s valor: '%-.128s'"
+"Incorrecta definición de tabla; Solamente debe haber una columna TIMESTAMP con CURRENT_TIMESTAMP en DEFAULT o ON UPDATE cláusula"
+"Inválido ON UPDATE cláusula para campo '%-.64s'",
"Can't create a %s from within another stored routine"
"%s %s already exists"
"%s %s does not exist"
diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt
index 28314a7367a..4761a6c15c1 100644
--- a/sql/share/swedish/errmsg.txt
+++ b/sql/share/swedish/errmsg.txt
@@ -204,7 +204,7 @@ character-set=latin1
"Denna operation kan inte göras under replikering; Gör STOP SLAVE först",
"Denna operation kan endast göras under replikering; Konfigurera slaven och gör START SLAVE",
"Servern är inte konfigurerade som en replikationsslav. Ändra konfigurationsfilen eller gör CHANGE MASTER TO",
-"Kunde inte initialisera replikationsstrukturerna. Kontrollera privilegerna för 'master.info'",
+"Kunde inte initialisera replikationsstrukturerna. See MySQL fel fil för mera information",
"Kunde inte starta en tråd för replikering",
"Användare '%-.64s' har redan 'max_user_connections' aktiva inloggningar",
"Man kan endast använda konstantuttryck med SET",
@@ -231,7 +231,7 @@ character-set=latin1
"Option '%s' användes två gånger",
"Användare '%-.64s' har överskridit '%s' (nuvarande värde: %ld)",
"Du har inte privlegiet '%-.128s' som behövs för denna operation",
-"Variabel '%-.64s' är en LOCAL variabel och kan inte ändrad med SET GLOBAL",
+"Variabel '%-.64s' är en SESSION variabel och kan inte ändrad med SET GLOBAL",
"Variabel '%-.64s' är en GLOBAL variabel och bör sättas med SET GLOBAL",
"Variabel '%-.64s' har inte ett DEFAULT-värde",
"Variabel '%-.64s' kan inte sättas till '%-.64s'",
@@ -241,6 +241,7 @@ character-set=latin1
"Denna version av MySQL kan ännu inte utföra '%s'",
"Fick fatalt fel %d: '%-.128s' från master vid läsning av binärloggen",
"Slav SQL tråden ignorerade frågan pga en replicate-*-table regel",
+"Variabel '%-.64s' är av typ %s",
"Felaktig FOREIGN KEY-definition för '%-.64s': %s",
"Nyckelreferensen och tabellreferensen stämmer inte överens",
"Operand should contain %d column(s)",
@@ -264,7 +265,7 @@ character-set=latin1
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%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 where input 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 for column '%s' at row %ld",
@@ -276,23 +277,27 @@ character-set=latin1
"Illegal mix of collations for operation '%s'",
"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.",
-"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",
+"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",
+"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",
"SQL thread is not to be started so UNTIL options are ignored",
-"Incorrect index name '%-.100s'",
-"Incorrect catalog name '%-.100s'",
+"Felaktigt index namn '%-.100s'",
+"Felaktigt katalog namn '%-.100s'",
"Storleken av "Query cache" kunde inte sättas till %lu, ny storlek är %lu",
"Kolumn '%-.64s' kan inte vara del av ett FULLTEXT index",
-"Unknown key cache '%-.100s'",
+"Okänd nyckel cache '%-.100s'",
"MySQL is started in --skip-name-resolve mode. You need to restart it without this switch for this grant to work",
"Unknown table engine '%s'",
-"'%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' define to have it working"
-"MySQL is started in --skip-grant-tables mode. You can't use this command"
+"'%s' is deprecated, use '%s' instead",
+"Tabel %-.100s använd med '%s' är inte uppdateringsbar",
+"'%s' är inte aktiverad; För att aktivera detta måste du bygga om MySQL med '%s' definerad",
+"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",
"Can't create a %s from within another stored routine"
"%s %s already exists"
"%s %s does not exist"
diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt
index 9263ee89400..2495c2676be 100644
--- a/sql/share/ukrainian/errmsg.txt
+++ b/sql/share/ukrainian/errmsg.txt
@@ -79,7 +79,7 @@ character-set=koi8u
"ðÅÒ×ÉÎÎÏÇÏ ËÌÀÞÁ ×ÉÚÎÁÞÅÎÏ ÎÅÏÄÎÏÒÁÚÏ×Ï",
"úÁÂÁÇÁÔÏ ËÌÀÞ¦× ÚÁÚÎÁÞÅÎÏ. äÏÚ×ÏÌÅÎÏ ÎŠ¦ÌØÛÅ %d ËÌÀÞ¦×",
"úÁÂÁÇÁÔÏ ÞÁÓÔÉÎ ËÌÀÞÁ ÚÁÚÎÁÞÅÎÏ. äÏÚ×ÏÌÅÎÏ ÎŠ¦ÌØÛÅ %d ÞÁÓÔÉÎ",
-"úÁÚÎÁÞÅÎÉÊ ËÌÀÞ ÚÁÄÏ×ÇÉÊ. îÁʦÌØÛÁ ÄÏ×ÖÉÎÁ ËÌÀÞÁ %d",
+"úÁÚÎÁÞÅÎÉÊ ËÌÀÞ ÚÁÄÏ×ÇÉÊ. îÁʦÌØÛÁ ÄÏ×ÖÉÎÁ ËÌÀÞÁ %d ÂÁÊÔ¦×",
"ëÌÀÞÏ×ÉÊ ÓÔÏ×ÂÅÃØ '%-.64s' ÎÅ ¦ÓÎÕ¤ Õ ÔÁÂÌÉæ",
"BLOB ÓÔÏ×ÂÅÃØ '%-.64s' ÎÅ ÍÏÖÅ ÂÕÔÉ ×ÉËÏÒÉÓÔÁÎÉÊ Õ ×ÉÚÎÁÞÅÎΦ ËÌÀÞÁ × ÃØÏÍÕ ÔÉЦ ÔÁÂÌÉæ",
"úÁÄÏ×ÇÁ ÄÏ×ÖÉÎÁ ÓÔÏ×ÂÃÑ '%-.64s' (max = %d). ÷ÉËÏÒÉÓÔÁÊÔÅ ÔÉÐ BLOB",
@@ -152,7 +152,7 @@ character-set=koi8u
"ðÏ×ÎÏ×ÁÖÅÎØ ÎÅ ×ÉÚÎÁÞÅÎÏ ÄÌÑ ËÏÒÉÓÔÕ×ÁÞÁ '%-.32s' Ú ÈÏÓÔÕ '%-.64s'",
"%-.16s ËÏÍÁÎÄÁ ÚÁÂÏÒÏÎÅÎÁ ËÏÒÉÓÔÕ×ÁÞÕ: '%-.32s'@'%-.64s' Õ ÔÁÂÌÉæ '%-.64s'",
"%-.16s ËÏÍÁÎÄÁ ÚÁÂÏÒÏÎÅÎÁ ËÏÒÉÓÔÕ×ÁÞÕ: '%-.32s'@'%-.64s' ÄÌÑ ÓÔÏ×ÂÃÑ '%-.64s' Õ ÔÁÂÌÉæ '%-.64s'",
-"èÉÂÎÁ GRANT/REVOKE ËÏÍÁÎÄÁ. ðÒÏÞÉÔÁÊÔÅ ÄÏËÕÍÅÎÔÁæÀ ÓÔÏÓÏ×ÎÏ ÔÏÇÏ, Ñ˦ ÐÒÁ×Á ÍÏÖÎÁ ×ÉËÏÒÉÓÔÏ×Õ×ÁÔÉ.",
+"èÉÂÎÁ GRANT/REVOKE ËÏÍÁÎÄÁ; ÐÒÏÞÉÔÁÊÔÅ ÄÏËÕÍÅÎÔÁæÀ ÓÔÏÓÏ×ÎÏ ÔÏÇÏ, Ñ˦ ÐÒÁ×Á ÍÏÖÎÁ ×ÉËÏÒÉÓÔÏ×Õ×ÁÔÉ",
"áÒÇÕÍÅÎÔ host ÁÂÏ user ÄÌÑ GRANT ÚÁÄÏ×ÇÉÊ",
"ôÁÂÌÉÃÑ '%-.64s.%-.64s' ÎÅ ¦ÓÎÕ¤",
"ðÏ×ÎÏ×ÁÖÅÎØ ÎÅ ×ÉÚÎÁÞÅÎÏ ÄÌÑ ËÏÒÉÓÔÕ×ÁÞÁ '%-.32s' Ú ÈÏÓÔÕ '%-.64s' ÄÌÑ ÔÁÂÌÉæ '%-.64s'",
@@ -209,7 +209,7 @@ character-set=koi8u
"ïÐÅÒÁÃ¦Ñ ÎÅ ÍÏÖÅ ÂÕÔÉ ×ÉËÏÎÁÎÁ Ú ÚÁÐÕÝÅÎÉÍ Ð¦ÄÌÅÇÌÉÍ, ÓÐÏÞÁÔËÕ ×ÉËÏÎÁÊÔÅ STOP SLAVE",
"ïÐÅÒÁÃ¦Ñ ×ÉÍÁÇÁ¤ ÚÁÐÕÝÅÎÏÇÏ Ð¦ÄÌÅÇÌÏÇÏ, ÚËÏÎƦÇÕÒÕÊÔŠЦÄÌÅÇÌÏÇÏ ÔÁ ×ÉËÏÎÁÊÔÅ START SLAVE",
"óÅÒ×ÅÒ ÎÅ ÚËÏÎƦÇÕÒÏ×ÁÎÏ ÑË Ð¦ÄÌÅÇÌÉÊ, ×ÉÐÒÁ×ÔÅ ÃÅ Õ ÆÁÊ̦ ËÏÎƦÇÕÒÁæ§ ÁÂÏ Ú CHANGE MASTER TO",
-"îÅ ÍÏÖÕ ¦Î¦Ã¦Á̦ÚÕ×ÁÔÉ ÓÔÒÕËÔÕÒÕ ÉÎÆÏÒÍÁæ§ ÇÏÌÏ×ÎÏÇÏ, ÐÅÒÅצÒÔÅ ÐÒÁ×Á ÄÏÓÔÕÐÕ ÎÁ master.info",
+"Could not initialize master info structure, more error messages can be found in the MySQL error log",
"îÅ ÍÏÖÕ ÓÔ×ÏÒÉÔÉ Ð¦ÄÌÅÇÌÕ Ç¦ÌËÕ, ÐÅÒÅצÒÔÅ ÓÉÓÔÅÍΦ ÒÅÓÕÒÓÉ",
"ëÏÒÉÓÔÕ×ÁÞ %-.64s ×ÖÅ ÍÁ¤ ¦ÌØÛÅ Î¦Ö 'max_user_connections' ÁËÔÉ×ÎÉÈ Ú'¤ÄÎÁÎØ",
"íÏÖÎÁ ×ÉËÏÒÉÓÔÏ×Õ×ÁÔÉ ÌÉÛÅ ×ÉÒÁÚÉ Ú¦ ÓÔÁÌÉÍÉ Õ SET",
@@ -236,7 +236,7 @@ character-set=koi8u
"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",
-"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL",
+"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'",
@@ -246,6 +246,7 @@ character-set=koi8u
"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",
"ïÐÅÒÁÎÄ ÍÁ¤ ÓËÌÁÄÁÔÉÓÑ Ú %d ÓÔÏ×Âæ×",
@@ -269,7 +270,7 @@ character-set=koi8u
"Z_DATA_ERROR: Input data was corrupted for zlib",
"%d line(s) was(were) cut by group_concat()",
"Row %ld doesn't contain data for all columns",
-"Row %ld was truncated; It contained more data than there where input 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 for column '%s' at row %ld",
@@ -281,8 +282,8 @@ character-set=koi8u
"Illegal mix of collations for operation '%s'",
"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.",
-"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",
+"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",
+"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",
@@ -294,10 +295,14 @@ character-set=koi8u
"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",
"Unknown table engine '%s'",
-"'%s' is deprecated. Use '%s' instead.",
-"ôÁÂÌÉÃÑ %-.100s Õ %s ÎÅ ÍÏÖÅ ÏÎÏ×ÌÀ×ÁÔÉÓØ.",
-"The '%s' feature was disabled. You need MySQL built with '%s' define to have it working"
-"MySQL is started in --skip-grant-tables mode. You can't use this command"
+"'%s' is deprecated, use '%s' instead",
+"ôÁÂÌÉÃÑ %-.100s Õ %s ÎÅ ÍÏÖÅ ÏÎÏ×ÌÀ×ÁÔÉÓØ",
+"The '%s' feature was 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",
"Can't create a %s from within another stored routine"
"%s %s already exists"
"%s %s does not exist"
diff --git a/sql/slave.cc b/sql/slave.cc
index e3d9e0dab58..ad4cc820409 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -35,7 +35,6 @@ typedef bool (*CHECK_KILLED_FUNC)(THD*,void*);
volatile bool slave_sql_running = 0, slave_io_running = 0;
char* slave_load_tmpdir = 0;
MASTER_INFO *active_mi;
-volatile int active_mi_in_use = 0;
HASH replicate_do_table, replicate_ignore_table;
DYNAMIC_ARRAY replicate_wild_do_table, replicate_wild_ignore_table;
bool do_table_inited = 0, ignore_table_inited = 0;
@@ -136,8 +135,12 @@ int init_slave()
{
DBUG_ENTER("init_slave");
- /* This is called when mysqld starts */
-
+ /*
+ This is called when mysqld starts. Before client connections are
+ accepted. However bootstrap may conflict with us if it does START SLAVE.
+ So it's safer to take the lock.
+ */
+ pthread_mutex_lock(&LOCK_active_mi);
/*
TODO: re-write this to interate through the list of files
for multi-master
@@ -182,9 +185,11 @@ int init_slave()
goto err;
}
}
+ pthread_mutex_unlock(&LOCK_active_mi);
DBUG_RETURN(0);
err:
+ pthread_mutex_unlock(&LOCK_active_mi);
DBUG_RETURN(1);
}
@@ -972,7 +977,14 @@ static int end_slave_on_walk(MASTER_INFO* mi, gptr /*unused*/)
void end_slave()
{
- /* This is called when the server terminates, in close_connections(). */
+ /*
+ This is called when the server terminates, in close_connections().
+ It terminates slave threads. However, some CHANGE MASTER etc may still be
+ running presently. If a START SLAVE was in progress, the mutex lock below
+ will make us wait until slave threads have started, and START SLAVE
+ returns, then we terminate them here.
+ */
+ pthread_mutex_lock(&LOCK_active_mi);
if (active_mi)
{
/*
@@ -993,6 +1005,7 @@ void end_slave()
delete active_mi;
active_mi= 0;
}
+ pthread_mutex_unlock(&LOCK_active_mi);
}
@@ -1369,6 +1382,7 @@ static int create_table_from_dump(THD* thd, MYSQL *mysql, const char* db,
bzero((char*) &tables,sizeof(tables));
tables.db = (char*)db;
tables.alias= tables.real_name= (char*)table_name;
+
/* Drop the table if 'overwrite' is true */
if (overwrite && mysql_rm_table(thd,&tables,1,0)) /* drop if exists */
{
@@ -1835,7 +1849,18 @@ int init_master_info(MASTER_INFO* mi, const char* master_info_fname,
DBUG_ENTER("init_master_info");
if (mi->inited)
+ {
+ /*
+ We have to reset read position of relay-log-bin as we may have
+ already been reading from 'hotlog' when the slave was stopped
+ last time. If this case pos_in_file would be set and we would
+ get a crash when trying to read the signature for the binary
+ relay log.
+ */
+ my_b_seek(mi->rli.cur_log, (my_off_t) 0);
DBUG_RETURN(0);
+ }
+
mi->mysql=0;
mi->file_id=1;
fn_format(fname, master_info_fname, mysql_data_home, "", 4+32);
@@ -1997,9 +2022,9 @@ file '%s')", fname);
mi->master_log_name,
(ulong) mi->master_log_pos));
+ mi->rli.mi = mi;
if (init_relay_log_info(&mi->rli, slave_info_fname))
goto err;
- mi->rli.mi = mi;
mi->inited = 1;
// now change cache READ -> WRITE - must do this before flush_master_info
@@ -2236,10 +2261,29 @@ int show_master_info(THD* thd, MASTER_INFO* mi)
protocol->store(mi->ssl_key, &my_charset_bin);
if (mi->rli.last_master_timestamp)
- protocol->store((ulonglong)
- (long)((time_t)time((time_t*) 0)
- - mi->rli.last_master_timestamp)
- - mi->clock_diff_with_master);
+ {
+ long tmp= (long)((time_t)time((time_t*) 0)
+ - mi->rli.last_master_timestamp)
+ - mi->clock_diff_with_master;
+ /*
+ Apparently on some systems tmp can be <0. Here are possible reasons
+ related to MySQL:
+ - the master is itself a slave of another master whose time is ahead.
+ - somebody used an explicit SET TIMESTAMP on the master.
+ Possible reason related to granularity-to-second of time functions
+ (nothing to do with MySQL), which can explain a value of -1:
+ assume the master's and slave's time are perfectly synchronized, and
+ that at slave's connection time, when the master's timestamp is read,
+ it is at the very end of second 1, and (a very short time later) when
+ the slave's timestamp is read it is at the very beginning of second
+ 2. Then the recorded value for master is 1 and the recorded value for
+ slave is 2. At SHOW SLAVE STATUS time, assume that the difference
+ between timestamp of slave and rli->last_master_timestamp is 0
+ (i.e. they are in the same second), then we get 0-(2-1)=-1 as a result.
+ This confuses users, so we don't go below 0.
+ */
+ protocol->store((longlong)(max(0, tmp)));
+ }
else
protocol->store_null();
@@ -2749,13 +2793,6 @@ int check_expected_error(THD* thd, RELAY_LOG_INFO* rli, int expected_error)
case ER_NET_ERROR_ON_WRITE:
case ER_SERVER_SHUTDOWN:
case ER_NEW_ABORTING_CONNECTION:
- slave_print_error(rli,expected_error,
- "query '%s' partially completed on the master \
-and was aborted. There is a chance that your master is inconsistent at this \
-point. If you are sure that your master is ok, run this query manually on the\
- slave and then restart the slave with SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;\
- SLAVE START; .", thd->query);
- thd->query_error= 1;
return 1;
default:
return 0;
@@ -2840,7 +2877,7 @@ bool st_relay_log_info::is_until_satisfied()
/* Probably error so we aborting */
sql_print_error("Slave SQL thread is stopped because UNTIL "
"condition is bad.");
- return true;
+ return TRUE;
}
}
else
@@ -3417,7 +3454,7 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME,
llstr(rli->group_relay_log_pos,llbuff1));
/* execute init_slave variable */
- if (sys_init_slave.value)
+ if (sys_init_slave.value_length)
{
execute_init_command(thd, &sys_init_slave, &LOCK_sys_init_slave);
if (thd->query_error)
@@ -3560,6 +3597,14 @@ static int process_io_create_file(MASTER_INFO* mi, Create_file_log_event* cev)
if (unlikely(!num_bytes)) /* eof */
{
net_write_command(net, 0, "", 0, "", 0);/* 3.23 master wants it */
+ /*
+ If we wrote Create_file_log_event, then we need to write
+ Execute_load_log_event. If we did not write Create_file_log_event,
+ then this is an empty file and we can just do as if the LOAD DATA
+ INFILE had not existed, i.e. write nothing.
+ */
+ if (unlikely(cev_not_written))
+ break;
Execute_load_log_event xev(thd,0,0);
xev.log_pos = cev->log_pos;
if (unlikely(mi->rli.relay_log.append(&xev)))
@@ -3988,7 +4033,9 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
mi->master_log_pos+= inc_pos;
DBUG_PRINT("info", ("master_log_pos: %d, event originating from the same server, ignored", (ulong) mi->master_log_pos));
}
- else /* write the event to the relay log */
+ else
+ {
+ /* write the event to the relay log */
if (likely(!(rli->relay_log.appendv(buf,event_len,0))))
{
mi->master_log_pos+= inc_pos;
@@ -3997,6 +4044,7 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
}
else
error=3;
+ }
err:
pthread_mutex_unlock(&mi->data_lock);
@@ -4223,6 +4271,7 @@ bool flush_relay_log_info(RELAY_LOG_INFO* rli)
error=1;
if (flush_io_cache(file))
error=1;
+ /* Flushing the relay log is done by the slave I/O thread */
return error;
}
@@ -4478,8 +4527,9 @@ Log_event* next_event(RELAY_LOG_INFO* rli)
if (rli->relay_log.is_active(rli->linfo.log_file_name))
{
#ifdef EXTRA_DEBUG
- sql_print_error("next log '%s' is currently active",
- rli->linfo.log_file_name);
+ if (global_system_variables.log_warnings)
+ sql_print_error("next log '%s' is currently active",
+ rli->linfo.log_file_name);
#endif
rli->cur_log= cur_log= rli->relay_log.get_log_file();
rli->cur_log_old_open_count= rli->relay_log.get_open_count();
@@ -4507,8 +4557,9 @@ Log_event* next_event(RELAY_LOG_INFO* rli)
from hot to cold, but not from cold to hot). No need for LOCK_log.
*/
#ifdef EXTRA_DEBUG
- sql_print_error("next log '%s' is not active",
- rli->linfo.log_file_name);
+ if (global_system_variables.log_warnings)
+ sql_print_error("next log '%s' is not active",
+ rli->linfo.log_file_name);
#endif
// open_binlog() will check the magic header
if ((rli->cur_log_fd=open_binlog(cur_log,rli->linfo.log_file_name,
diff --git a/sql/slave.h b/sql/slave.h
index 016944534f7..f4080f3ca8d 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -35,12 +35,19 @@
/*
MUTEXES in replication:
- LOCK_active_mi: this is meant for multimaster, when we can switch from a
- master to another. It protects active_mi. We don't care of it for the moment,
- as active_mi never moves (it's created at startup and deleted at shutdown,
- and not changed: it always points to the same MASTER_INFO struct), because we
- don't have multimaster. So for the moment, mi does not move, and mi->rli does
- not either.
+ LOCK_active_mi: [note: this was originally meant for multimaster, to switch
+ from a master to another, to protect active_mi] It is used to SERIALIZE ALL
+ administrative commands of replication: START SLAVE, STOP SLAVE, CHANGE
+ MASTER, RESET SLAVE, end_slave() (when mysqld stops) [init_slave() does not
+ need it it's called early]. Any of these commands holds the mutex from the
+ start till the end. This thus protects us against a handful of deadlocks
+ (consider start_slave_thread() which, when starting the I/O thread, releases
+ mi->run_lock, keeps rli->run_lock, and tries to re-acquire mi->run_lock).
+
+ Currently active_mi never moves (it's created at startup and deleted at
+ shutdown, and not changed: it always points to the same MASTER_INFO struct),
+ because we don't have multimaster. So for the moment, mi does not move, and
+ mi->rli does not either.
In MASTER_INFO: run_lock, data_lock
run_lock protects all information about the run state: slave_running, and the
@@ -51,6 +58,9 @@
In RELAY_LOG_INFO: run_lock, data_lock
see MASTER_INFO
+ Order of acquisition: if you want to have LOCK_active_mi and a run_lock, you
+ must acquire LOCK_active_mi first.
+
In MYSQL_LOG: LOCK_log, LOCK_index of the binlog and the relay log
LOCK_log: when you write to it. LOCK_index: when you create/delete a binlog
(so that you have to update the .index file).
@@ -67,20 +77,7 @@ extern my_bool opt_log_slave_updates;
extern ulonglong relay_log_space_limit;
struct st_master_info;
-/*
- TODO: this needs to be redone, but for now it does not matter since
- we do not have multi-master yet.
-*/
-
-#define LOCK_ACTIVE_MI { pthread_mutex_lock(&LOCK_active_mi); \
- ++active_mi_in_use; \
- pthread_mutex_unlock(&LOCK_active_mi);}
-
-#define UNLOCK_ACTIVE_MI { pthread_mutex_lock(&LOCK_active_mi); \
- --active_mi_in_use; \
- pthread_mutex_unlock(&LOCK_active_mi); }
-
-/*****************************************************************************
+/****************************************************************************
Replication SQL Thread
@@ -203,14 +200,16 @@ typedef struct st_relay_log_info
bool ignore_log_space_limit;
/*
- InnoDB internally stores the master log position it has processed
- so far; when the InnoDB code to store this position is called, we have not
- updated rli->group_master_log_pos yet. So the position is the event's
- log_pos (the position of the end of the event); we save it in the variable
- below. It's the *coming* group_master_log_pos (the one which will be
- group_master_log_pos in the coming milliseconds).
+ When it commits, InnoDB internally stores the master log position it has
+ processed so far; the position to store is the one of the end of the
+ committing event (the COMMIT query event, or the event if in autocommit
+ mode).
*/
+#if MYSQL_VERSION_ID < 40100
+ ulonglong future_master_log_pos;
+#else
ulonglong future_group_master_log_pos;
+#endif
time_t last_master_timestamp;
@@ -574,7 +573,6 @@ extern "C" pthread_handler_decl(handle_slave_io,arg);
extern "C" pthread_handler_decl(handle_slave_sql,arg);
extern bool volatile abort_loop;
extern MASTER_INFO main_mi, *active_mi; /* active_mi for multi-master */
-extern volatile int active_mi_in_use;
extern LIST master_list;
extern HASH replicate_do_table, replicate_ignore_table;
extern DYNAMIC_ARRAY replicate_wild_do_table, replicate_wild_ignore_table;
diff --git a/sql/spatial.cc b/sql/spatial.cc
index d19429fdd9c..ab415d9af10 100644
--- a/sql/spatial.cc
+++ b/sql/spatial.cc
@@ -1,145 +1,183 @@
-#include "mysql_priv.h"
+/* 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 */
+#include "mysql_priv.h"
#define MAX_DIGITS_IN_DOUBLE 16
-/***************************** GClassInfo *******************************/
-
-#define IMPLEMENT_GEOM(class_name, type_id, name) \
-{ \
- (GF_InitFromText) &class_name::init_from_wkt, \
- (GF_GetDataAsText) &class_name::get_data_as_wkt, \
- (GF_GetDataSize) &class_name::get_data_size, \
- (GF_GetMBR) &class_name::get_mbr, \
- (GF_GetD) &class_name::get_x, \
- (GF_GetD) &class_name::get_y, \
- (GF_GetD) &class_name::length, \
- (GF_GetD) &class_name::area, \
- (GF_GetI) &class_name::is_closed, \
- (GF_GetUI) &class_name::num_interior_ring, \
- (GF_GetUI) &class_name::num_points, \
- (GF_GetUI) &class_name::num_geometries, \
- (GF_GetUI) &class_name::dimension, \
- (GF_GetWS) &class_name::start_point, \
- (GF_GetWS) &class_name::end_point, \
- (GF_GetWS) &class_name::exterior_ring, \
- (GF_GetWS) &class_name::centroid, \
- (GF_GetUIWS) &class_name::point_n, \
- (GF_GetUIWS) &class_name::interior_ring_n, \
- (GF_GetUIWS) &class_name::geometry_n, \
- class_name::type_id, \
- name, \
- NULL \
-},
-
-
-static Geometry::GClassInfo ci_collection[] =
-{
- IMPLEMENT_GEOM(GPoint, wkbPoint, "POINT")
- IMPLEMENT_GEOM(GLineString, wkbLineString, "LINESTRING")
- IMPLEMENT_GEOM(GPolygon, wkbPolygon, "POLYGON")
- IMPLEMENT_GEOM(GMultiPoint, wkbMultiPoint, "MULTIPOINT")
- IMPLEMENT_GEOM(GMultiLineString, wkbMultiLineString, "MULTILINESTRING")
- IMPLEMENT_GEOM(GMultiPolygon, wkbMultiPolygon, "MULTIPOLYGON")
- IMPLEMENT_GEOM(GGeometryCollection, wkbGeometryCollection, "GEOMETRYCOLLECTION")
+/***************************** Gis_class_info *******************************/
+
+Geometry::Class_info *Geometry::ci_collection[Geometry::wkb_end+1]=
+{
+ NULL, NULL, NULL, NULL, NULL, NULL, NULL
};
-static Geometry::GClassInfo *ci_collection_end = ci_collection + sizeof(ci_collection)/sizeof(ci_collection[0]);
+static Geometry::Class_info **ci_collection_end=
+ Geometry::ci_collection+Geometry::wkb_end + 1;
-/***************************** Geometry *******************************/
+Geometry::Class_info::Class_info(const char *name, int type_id,
+ void(*create_func)(void *)):
+ m_name(name, strlen(name)), m_type_id(type_id), m_create_func(create_func)
+{
+ ci_collection[type_id]= this;
+}
-Geometry::GClassInfo *Geometry::find_class(int type_id)
+static void create_point(void *buffer)
{
- for (GClassInfo *cur_rt = ci_collection; cur_rt < ci_collection_end; ++cur_rt)
- {
- if (cur_rt->m_type_id == type_id)
- {
- return cur_rt;
- }
- }
- return NULL;
+ new(buffer) Gis_point;
}
-
-Geometry::GClassInfo *Geometry::find_class(const char *name, size_t len)
+
+static void create_linestring(void *buffer)
+{
+ new(buffer) Gis_line_string;
+}
+
+static void create_polygon(void *buffer)
{
- for (GClassInfo *cur_rt = ci_collection;
- cur_rt < ci_collection_end; ++cur_rt)
+ new(buffer) Gis_polygon;
+}
+
+static void create_multipoint(void *buffer)
+{
+ new(buffer) Gis_multi_point;
+}
+
+static void create_multipolygon(void *buffer)
+{
+ new(buffer) Gis_multi_polygon;
+}
+
+static void create_multilinestring(void *buffer)
+{
+ new(buffer) Gis_multi_line_string;
+}
+
+static void create_geometrycollection(void *buffer)
+{
+ new(buffer) Gis_geometry_collection;
+}
+
+
+
+static Geometry::Class_info point_class("POINT",
+ Geometry::wkb_point, create_point);
+
+static Geometry::Class_info linestring_class("LINESTRING",
+ Geometry::wkb_linestring,
+ create_linestring);
+static Geometry::Class_info polygon_class("POLYGON",
+ Geometry::wkb_polygon,
+ create_polygon);
+static Geometry::Class_info multipoint_class("MULTIPOINT",
+ Geometry::wkb_multipoint,
+ create_multipoint);
+static Geometry::Class_info
+multilinestring_class("MULTILINESTRING",
+ Geometry::wkb_multilinestring, create_multilinestring);
+static Geometry::Class_info multipolygon_class("MULTIPOLYGON",
+ Geometry::wkb_multipolygon,
+ create_multipolygon);
+static Geometry::Class_info
+geometrycollection_class("GEOMETRYCOLLECTION",Geometry::wkb_geometrycollection,
+ create_geometrycollection);
+
+/***************************** Geometry *******************************/
+
+Geometry::Class_info *Geometry::find_class(const char *name, uint32 len)
+{
+ for (Class_info **cur_rt= ci_collection;
+ cur_rt < ci_collection_end; cur_rt++)
{
- if ((cur_rt->m_name[len] == 0) &&
- (my_strnncoll(&my_charset_latin1, (const uchar*)cur_rt->m_name, len,
- (const uchar*)name, len) == 0))
- {
- return cur_rt;
- }
+ if (*cur_rt &&
+ ((*cur_rt)->m_name.length == len) &&
+ (my_strnncoll(&my_charset_latin1,
+ (const uchar*) (*cur_rt)->m_name.str, len,
+ (const uchar*) name, len) == 0))
+ return *cur_rt;
}
- return NULL;
+ return 0;
}
-int Geometry::create_from_wkb(const char *data, uint32 data_len)
+Geometry *Geometry::create_from_wkb(Geometry_buffer *buffer,
+ const char *data, uint32 data_len)
{
uint32 geom_type;
+ Geometry *result;
if (data_len < 1 + 4)
- return 1;
+ return NULL;
data++;
-//FIXME: check byte ordering
+ /*
+ FIXME: check byte ordering
+ Also check if we could replace this with one byte
+ */
geom_type= uint4korr(data);
data+= 4;
- m_vmt= find_class(geom_type);
- if (!m_vmt)
- return -1;
- m_data= data;
- m_data_end= data + data_len;
- return 0;
+ if (!(result= create_by_typeid(buffer, (int) geom_type)))
+ return NULL;
+ result->m_data= data;
+ result->m_data_end= data + data_len;
+ return result;
}
-int Geometry::create_from_wkt(GTextReadStream *trs, String *wkt, int init_stream)
+
+Geometry *Geometry::create_from_wkt(Geometry_buffer *buffer,
+ Gis_read_stream *trs, String *wkt,
+ bool init_stream)
{
- int name_len;
- const char *name = trs->get_next_word(&name_len);
- if (!name)
+ LEX_STRING name;
+ Class_info *ci;
+
+ if (trs->get_next_word(&name))
{
trs->set_error_msg("Geometry name expected");
- return -1;
+ return NULL;
}
- if (!(m_vmt = find_class(name, name_len)))
- return -1;
- if (wkt->reserve(1 + 4, 512))
- return 1;
- wkt->q_append((char)wkbNDR);
- wkt->q_append((uint32)get_class_info()->m_type_id);
- if (trs->get_next_symbol() != '(')
- {
- trs->set_error_msg("'(' expected");
- return -1;
- }
- if (init_from_wkt(trs, wkt)) return 1;
- if (trs->get_next_symbol() != ')')
- {
- trs->set_error_msg("')' expected");
- return -1;
- }
+ if (!(ci= find_class(name.str, name.length)) ||
+ wkt->reserve(1 + 4, 512))
+ return NULL;
+ (*ci->m_create_func)((void *)buffer);
+ Geometry *result= (Geometry *)buffer;
+
+ wkt->q_append((char) wkb_ndr);
+ wkt->q_append((uint32) result->get_class_info()->m_type_id);
+ if (trs->check_next_symbol('(') ||
+ result->init_from_wkt(trs, wkt) ||
+ trs->check_next_symbol(')'))
+ return NULL;
if (init_stream)
{
- init_from_wkb(wkt->ptr(), wkt->length());
- shift_wkb_header();
+ result->init_from_wkb(wkt->ptr(), wkt->length());
+ result->shift_wkb_header();
}
- return 0;
+ return result;
}
-int Geometry::envelope(String *result) const
+
+bool Geometry::envelope(String *result) const
{
MBR mbr;
+ const char *end;
- get_mbr(&mbr);
-
- if (result->reserve(1+4*3+sizeof(double)*10))
+ if (get_mbr(&mbr, &end) || result->reserve(1+4*3+SIZEOF_STORED_DOUBLE*10))
return 1;
- result->q_append((char)wkbNDR);
- result->q_append((uint32)wkbPolygon);
- result->q_append((uint32)1);
- result->q_append((uint32)5);
+ result->q_append((char) wkb_ndr);
+ result->q_append((uint32) wkb_polygon);
+ result->q_append((uint32) 1);
+ result->q_append((uint32) 5);
result->q_append(mbr.xmin);
result->q_append(mbr.ymin);
result->q_append(mbr.xmax);
@@ -154,29 +192,151 @@ int Geometry::envelope(String *result) const
return 0;
}
+
+/*
+ Create a point from data.
+
+ SYNPOSIS
+ create_point()
+ result Put result here
+ data Data for point is here.
+
+ RETURN
+ 0 ok
+ 1 Can't reallocate 'result'
+*/
+
+bool Geometry::create_point(String *result, const char *data) const
+{
+ if (no_data(data, SIZEOF_STORED_DOUBLE * 2) ||
+ result->reserve(1 + 4 + SIZEOF_STORED_DOUBLE * 2))
+ return 1;
+ result->q_append((char) wkb_ndr);
+ result->q_append((uint32) wkb_point);
+ /* Copy two double in same format */
+ result->q_append(data, SIZEOF_STORED_DOUBLE*2);
+ return 0;
+}
+
+/*
+ Create a point from coordinates.
+
+ SYNPOSIS
+ create_point()
+ result Put result here
+ x x coordinate for point
+ y y coordinate for point
+
+ RETURN
+ 0 ok
+ 1 Can't reallocate 'result'
+*/
+
+bool Geometry::create_point(String *result, double x, double y) const
+{
+ if (result->reserve(1 + 4 + SIZEOF_STORED_DOUBLE * 2))
+ return 1;
+
+ result->q_append((char) wkb_ndr);
+ result->q_append((uint32) wkb_point);
+ result->q_append(x);
+ result->q_append(y);
+ return 0;
+}
+
+/*
+ Append N points from packed format to text
+
+ SYNOPSIS
+ append_points()
+ txt Append points here
+ n_points Number of points
+ data Packed data
+ offset Offset between points
+
+ RETURN
+ # end of data
+*/
+
+const char *Geometry::append_points(String *txt, uint32 n_points,
+ const char *data, uint32 offset) const
+{
+ while (n_points--)
+ {
+ double d;
+ data+= offset;
+ float8get(d, data);
+ txt->qs_append(d);
+ txt->qs_append(' ');
+ float8get(d, data + SIZEOF_STORED_DOUBLE);
+ data+= SIZEOF_STORED_DOUBLE * 2;
+ txt->qs_append(d);
+ txt->qs_append(',');
+ }
+ return data;
+}
+
+
+/*
+ Get most bounding rectangle (mbr) for X points
+
+ SYNOPSIS
+ get_mbr_for_points()
+ mbr MBR (store rectangle here)
+ points Number of points
+ data Packed data
+ offset Offset between points
+
+ RETURN
+ 0 Wrong data
+ # end of data
+*/
+
+const char *Geometry::get_mbr_for_points(MBR *mbr, const char *data,
+ uint offset) const
+{
+ uint32 points;
+ /* read number of points */
+ if (no_data(data, 4))
+ return 0;
+ points= uint4korr(data);
+ data+= 4;
+
+ if (no_data(data, (SIZEOF_STORED_DOUBLE * 2 + offset) * points))
+ return 0;
+
+ /* Calculate MBR for points */
+ while (points--)
+ {
+ data+= offset;
+ mbr->add_xy(data, data + SIZEOF_STORED_DOUBLE);
+ data+= SIZEOF_STORED_DOUBLE * 2;
+ }
+ return data;
+}
+
+
/***************************** Point *******************************/
-size_t GPoint::get_data_size() const
+uint32 Gis_point::get_data_size() const
{
return POINT_DATA_SIZE;
}
-int GPoint::init_from_wkt(GTextReadStream *trs, String *wkb)
+
+bool Gis_point::init_from_wkt(Gis_read_stream *trs, String *wkb)
{
double x, y;
- if (wkb->reserve(sizeof(double)*2))
- return 1;
- if (trs->get_next_number(&x))
- return 1;
- if (trs->get_next_number(&y))
+ if (trs->get_next_number(&x) || trs->get_next_number(&y) ||
+ wkb->reserve(SIZEOF_STORED_DOUBLE * 2))
return 1;
wkb->q_append(x);
wkb->q_append(y);
-
return 0;
}
-int GPoint::get_data_as_wkt(String *txt) const
+
+bool Gis_point::get_data_as_wkt(String *txt, const char **end) const
{
double x, y;
if (get_xy(&x, &y))
@@ -186,324 +346,260 @@ int GPoint::get_data_as_wkt(String *txt) const
txt->qs_append(x);
txt->qs_append(' ');
txt->qs_append(y);
+ *end= m_data+ POINT_DATA_SIZE;
return 0;
}
-int GPoint::get_mbr(MBR *mbr) const
+
+bool Gis_point::get_mbr(MBR *mbr, const char **end) const
{
double x, y;
if (get_xy(&x, &y))
return 1;
mbr->add_xy(x, y);
+ *end= m_data+ POINT_DATA_SIZE;
return 0;
}
+const Geometry::Class_info *Gis_point::get_class_info() const
+{
+ return &point_class;
+}
+
+
/***************************** LineString *******************************/
-size_t GLineString::get_data_size() const
+uint32 Gis_line_string::get_data_size() const
{
- uint32 n_points = uint4korr(m_data);
-
- return 4 + n_points*POINT_DATA_SIZE;
+ if (no_data(m_data, 4))
+ return GET_SIZE_ERROR;
+ return 4 + uint4korr(m_data) * POINT_DATA_SIZE;
}
-int GLineString::init_from_wkt(GTextReadStream *trs, String *wkb)
+
+bool Gis_line_string::init_from_wkt(Gis_read_stream *trs, String *wkb)
{
- uint32 n_points = 0;
- int np_pos = wkb->length();
- GPoint p;
+ uint32 n_points= 0;
+ uint32 np_pos= wkb->length();
+ Gis_point p;
if (wkb->reserve(4, 512))
return 1;
-
- wkb->q_append((uint32)n_points);
+ wkb->length(wkb->length()+4); // Reserve space for points
for (;;)
{
if (p.init_from_wkt(trs, wkb))
return 1;
- ++n_points;
- if (trs->get_next_toc_type() == GTextReadStream::comma)
- trs->get_next_symbol();
- else break;
+ n_points++;
+ if (trs->skip_char(',')) // Didn't find ','
+ break;
}
-
- if (n_points<2)
+ if (n_points < 2)
{
trs->set_error_msg("Too few points in LINESTRING");
return 1;
}
-
- wkb->WriteAtPosition(np_pos, n_points);
-
+ wkb->write_at_position(np_pos, n_points);
return 0;
}
-int GLineString::get_data_as_wkt(String *txt) const
+
+bool Gis_line_string::get_data_as_wkt(String *txt, const char **end) const
{
uint32 n_points;
- const char *data = m_data;
+ const char *data= m_data;
if (no_data(data, 4))
return 1;
-
- n_points = uint4korr(data);
+ n_points= uint4korr(data);
data += 4;
- if (no_data(data, sizeof(double) * 2 * n_points))
+ if (n_points < 1 ||
+ no_data(data, SIZEOF_STORED_DOUBLE * 2 * n_points) ||
+ txt->reserve(((MAX_DIGITS_IN_DOUBLE + 1)*2 + 1) * n_points))
return 1;
- if (txt->reserve(((MAX_DIGITS_IN_DOUBLE + 1)*2 + 1) * n_points))
- return 1;
- for (; n_points>0; --n_points)
+ while (n_points--)
{
double x, y;
float8get(x, data);
- data += sizeof(double);
- float8get(y, data);
- data += sizeof(double);
+ float8get(y, data + SIZEOF_STORED_DOUBLE);
+ data+= SIZEOF_STORED_DOUBLE * 2;
txt->qs_append(x);
txt->qs_append(' ');
txt->qs_append(y);
txt->qs_append(',');
}
- txt->length(txt->length() - 1);
+ txt->length(txt->length() - 1); // Remove end ','
+ *end= data;
return 0;
}
-int GLineString::get_mbr(MBR *mbr) const
-{
- uint32 n_points;
- const char *data = m_data;
-
- if (no_data(data, 4))
- return 1;
-
- n_points = uint4korr(data);
- data += 4;
- if (no_data(data, sizeof(double) * 2 * n_points))
- return 1;
- for (; n_points>0; --n_points)
- {
- mbr->add_xy(data, data + 8);
- data += 8+8;
- }
-
- return 0;
+bool Gis_line_string::get_mbr(MBR *mbr, const char **end) const
+{
+ return (*end=get_mbr_for_points(mbr, m_data, 0)) == 0;
}
-int GLineString::length(double *len) const
+
+int Gis_line_string::length(double *len) const
{
uint32 n_points;
double prev_x, prev_y;
- const char *data = m_data;
+ const char *data= m_data;
- *len=0;
+ *len= 0; // In case of errors
if (no_data(data, 4))
return 1;
- n_points = uint4korr(data);
- data += 4;
-
- if (no_data(data, sizeof(double) * 2 * n_points))
+ n_points= uint4korr(data);
+ data+= 4;
+ if (n_points < 1 || no_data(data, SIZEOF_STORED_DOUBLE * 2 * n_points))
return 1;
- --n_points;
float8get(prev_x, data);
- data += 8;
- float8get(prev_y, data);
- data += 8;
+ float8get(prev_y, data + SIZEOF_STORED_DOUBLE);
+ data+= SIZEOF_STORED_DOUBLE*2;
- for (; n_points>0; --n_points)
+ while (--n_points)
{
double x, y;
float8get(x, data);
- data += 8;
- float8get(y, data);
- data += 8;
- *len+=sqrt(pow(prev_x-x,2)+pow(prev_y-y,2));
- prev_x=x;
- prev_y=y;
+ float8get(y, data + SIZEOF_STORED_DOUBLE);
+ data+= SIZEOF_STORED_DOUBLE * 2;
+ *len+= sqrt(pow(prev_x-x,2)+pow(prev_y-y,2));
+ prev_x= x;
+ prev_y= y;
}
return 0;
}
-int GLineString::is_closed(int *closed) const
+int Gis_line_string::is_closed(int *closed) const
{
uint32 n_points;
double x1, y1, x2, y2;
-
- const char *data = m_data;
+ const char *data= m_data;
if (no_data(data, 4))
return 1;
- n_points = uint4korr(data);
- data += 4;
- if (no_data(data, (8+8) * n_points))
+ n_points= uint4korr(data);
+ data+= 4;
+ if (no_data(data, SIZEOF_STORED_DOUBLE * 2 * n_points))
return 1;
+
+ /* Get first point */
float8get(x1, data);
- data += 8;
- float8get(y1, data);
- data += 8 + (n_points-2)*POINT_DATA_SIZE;
- float8get(x2, data);
- data += 8;
- float8get(y2, data);
+ float8get(y1, data + SIZEOF_STORED_DOUBLE);
- *closed=(x1==x2)&&(y1==y2);
+ /* get last point */
+ data+= SIZEOF_STORED_DOUBLE*2 + (n_points-2)*POINT_DATA_SIZE;
+ float8get(x2, data);
+ float8get(y2, data + SIZEOF_STORED_DOUBLE);
+ *closed= (x1==x2) && (y1==y2);
return 0;
}
-int GLineString::num_points(uint32 *n_points) const
+
+int Gis_line_string::num_points(uint32 *n_points) const
{
- *n_points = uint4korr(m_data);
+ *n_points= uint4korr(m_data);
return 0;
}
-int GLineString::start_point(String *result) const
-{
- const char *data= m_data + 4;
- if (no_data(data, 8 + 8))
- return 1;
-
- if (result->reserve(1 + 4 + sizeof(double) * 2))
- return 1;
-
- result->q_append((char) wkbNDR);
- result->q_append((uint32) wkbPoint);
- double d;
- float8get(d, data);
- result->q_append(d);
- float8get(d, data + 8);
- result->q_append(d);
- return 0;
+int Gis_line_string::start_point(String *result) const
+{
+ /* +4 is for skipping over number of points */
+ return create_point(result, m_data + 4);
}
-int GLineString::end_point(String *result) const
+
+int Gis_line_string::end_point(String *result) const
{
- const char *data= m_data;
uint32 n_points;
-
- if (no_data(data, 4))
+ if (no_data(m_data, 4))
return 1;
- n_points= uint4korr(data);
-
- data+= 4 + (n_points - 1) * POINT_DATA_SIZE;
-
- if (no_data(data, 8 + 8))
- return 1;
-
- if (result->reserve(1 + 4 + sizeof(double) * 2))
- return 1;
- result->q_append((char) wkbNDR);
- result->q_append((uint32) wkbPoint);
- double d;
- float8get(d, data);
- result->q_append(d);
- float8get(d, data + 8);
- result->q_append(d);
-
- return 0;
+ n_points= uint4korr(m_data);
+ return create_point(result, m_data + 4 + (n_points - 1) * POINT_DATA_SIZE);
}
-int GLineString::point_n(uint32 num, String *result) const
+int Gis_line_string::point_n(uint32 num, String *result) const
{
- const char *data= m_data;
uint32 n_points;
-
- if (no_data(data, 4))
+ if (no_data(m_data, 4))
return 1;
- n_points= uint4korr(data);
-
+ n_points= uint4korr(m_data);
if ((uint32) (num - 1) >= n_points) // means (num > n_points || num < 1)
return 1;
- data+= 4 + (num - 1) * POINT_DATA_SIZE;
-
- if (no_data(data, 8 + 8))
- return 1;
- if (result->reserve(1 + 4 + sizeof(double) * 2))
- return 1;
-
- result->q_append((char) wkbNDR);
- result->q_append((uint32) wkbPoint);
- double d;
- float8get(d, data);
- result->q_append(d);
- float8get(d, data + 8);
- result->q_append(d);
+ return create_point(result, m_data + 4 + (num - 1) * POINT_DATA_SIZE);
+}
- return 0;
+const Geometry::Class_info *Gis_line_string::get_class_info() const
+{
+ return &linestring_class;
}
+
/***************************** Polygon *******************************/
-size_t GPolygon::get_data_size() const
+uint32 Gis_polygon::get_data_size() const
{
- uint32 n_linear_rings = 0;
- const char *data = m_data;
+ uint32 n_linear_rings;
+ const char *data= m_data;
+
if (no_data(data, 4))
- return 1;
+ return GET_SIZE_ERROR;
+ n_linear_rings= uint4korr(data);
+ data+= 4;
- n_linear_rings = uint4korr(data);
- data += 4;
- for (; n_linear_rings>0; --n_linear_rings)
+ while (n_linear_rings--)
{
if (no_data(data, 4))
- return 1;
- data += 4 + uint4korr(data)*POINT_DATA_SIZE;
+ return GET_SIZE_ERROR;
+ data+= 4 + uint4korr(data)*POINT_DATA_SIZE;
}
- return data - m_data;
+ return (uint32) (data - m_data);
}
-int GPolygon::init_from_wkt(GTextReadStream *trs, String *wkb)
+
+bool Gis_polygon::init_from_wkt(Gis_read_stream *trs, String *wkb)
{
- uint32 n_linear_rings = 0;
- int lr_pos = wkb->length();
+ uint32 n_linear_rings= 0;
+ uint32 lr_pos= wkb->length();
+ int closed;
if (wkb->reserve(4, 512))
return 1;
-
- wkb->q_append((uint32)n_linear_rings);
-
+ wkb->length(wkb->length()+4); // Reserve space for points
for (;;)
{
- GLineString ls;
- size_t ls_pos=wkb->length();
- if (trs->get_next_symbol() != '(')
- {
- trs->set_error_msg("'(' expected");
+ Gis_line_string ls;
+ uint32 ls_pos=wkb->length();
+ if (trs->check_next_symbol('(') ||
+ ls.init_from_wkt(trs, wkb) ||
+ trs->check_next_symbol(')'))
return 1;
- }
- if (ls.init_from_wkt(trs, wkb))
- return 1;
- if (trs->get_next_symbol() != ')')
- {
- trs->set_error_msg("')' expected");
- return 1;
- }
+
ls.init_from_wkb(wkb->ptr()+ls_pos, wkb->length()-ls_pos);
- int closed;
- ls.is_closed(&closed);
- if (!closed)
+ if (ls.is_closed(&closed) || !closed)
{
trs->set_error_msg("POLYGON's linear ring isn't closed");
return 1;
}
- ++n_linear_rings;
- if (trs->get_next_toc_type() == GTextReadStream::comma)
- trs->get_next_symbol();
- else
+ n_linear_rings++;
+ if (trs->skip_char(',')) // Didn't find ','
break;
}
- wkb->WriteAtPosition(lr_pos, n_linear_rings);
+ wkb->write_at_position(lr_pos, n_linear_rings);
return 0;
}
-int GPolygon::get_data_as_wkt(String *txt) const
+
+bool Gis_polygon::get_data_as_wkt(String *txt, const char **end) const
{
uint32 n_linear_rings;
const char *data= m_data;
@@ -514,1059 +610,1045 @@ int GPolygon::get_data_as_wkt(String *txt) const
n_linear_rings= uint4korr(data);
data+= 4;
- for (; n_linear_rings > 0; --n_linear_rings)
+ while (n_linear_rings--)
{
+ uint32 n_points;
if (no_data(data, 4))
return 1;
- uint32 n_points= uint4korr(data);
+ n_points= uint4korr(data);
data+= 4;
- if (no_data(data, (8 + 8) * n_points))
- return 1;
-
- if (txt->reserve(2 + ((MAX_DIGITS_IN_DOUBLE + 1) * 2 + 1) * n_points))
+ if (no_data(data, (SIZEOF_STORED_DOUBLE*2) * n_points) ||
+ txt->reserve(2 + ((MAX_DIGITS_IN_DOUBLE + 1) * 2 + 1) * n_points))
return 1;
txt->qs_append('(');
- for (; n_points>0; --n_points)
- {
- double d;
- float8get(d, data);
- txt->qs_append(d);
- txt->qs_append(' ');
- float8get(d, data + 8);
- txt->qs_append(d);
- txt->qs_append(',');
-
- data+= 8 + 8;
- }
- (*txt) [txt->length() - 1]= ')';
+ data= append_points(txt, n_points, data, 0);
+ (*txt) [txt->length() - 1]= ')'; // Replace end ','
txt->qs_append(',');
}
- txt->length(txt->length() - 1);
+ txt->length(txt->length() - 1); // Remove end ','
+ *end= data;
return 0;
}
-int GPolygon::get_mbr(MBR *mbr) const
+
+bool Gis_polygon::get_mbr(MBR *mbr, const char **end) const
{
uint32 n_linear_rings;
+ const char *data= m_data;
- const char *data = m_data;
if (no_data(data, 4))
return 1;
- n_linear_rings = uint4korr(data);
- data += 4;
- for (; n_linear_rings>0; --n_linear_rings)
+ n_linear_rings= uint4korr(data);
+ data+= 4;
+
+ while (n_linear_rings--)
{
- if (no_data(data, 4))
- return 1;
- uint32 n_points = uint4korr(data);
- data += 4;
- if (no_data(data, (8+8) * n_points))
+ if (!(data= get_mbr_for_points(mbr, data, 0)))
return 1;
- for (; n_points>0; --n_points)
- {
- mbr->add_xy(data, data + 8);
- data += 8+8;
- }
}
+ *end= data;
return 0;
}
-int GPolygon::area(double *ar) const
+
+int Gis_polygon::area(double *ar, const char **end_of_data) const
{
uint32 n_linear_rings;
- double result = -1.0;
+ double result= -1.0;
+ const char *data= m_data;
- const char *data = m_data;
if (no_data(data, 4))
return 1;
- n_linear_rings = uint4korr(data);
- data += 4;
- for (; n_linear_rings>0; --n_linear_rings)
+ n_linear_rings= uint4korr(data);
+ data+= 4;
+
+ while (n_linear_rings--)
{
double prev_x, prev_y;
- double lr_area=0;
+ double lr_area= 0;
+ uint32 n_points;
+
if (no_data(data, 4))
return 1;
- uint32 n_points = uint4korr(data);
- if (no_data(data, (8+8) * n_points))
+ n_points= uint4korr(data);
+ if (no_data(data, (SIZEOF_STORED_DOUBLE*2) * n_points))
return 1;
float8get(prev_x, data+4);
- float8get(prev_y, data+(4+8));
- data += (4+8+8);
+ float8get(prev_y, data+(4+SIZEOF_STORED_DOUBLE));
+ data+= (4+SIZEOF_STORED_DOUBLE*2);
- --n_points;
- for (; n_points>0; --n_points)
+ while (--n_points) // One point is already read
{
double x, y;
float8get(x, data);
- float8get(y, data + 8);
- lr_area+=(prev_x+x)*(prev_y-y);
- prev_x=x;
- prev_y=y;
- data += (8+8);
+ float8get(y, data + SIZEOF_STORED_DOUBLE);
+ data+= (SIZEOF_STORED_DOUBLE*2);
+ /* QQ: Is the following prev_x+x right ? */
+ lr_area+= (prev_x + x)* (prev_y - y);
+ prev_x= x;
+ prev_y= y;
}
- lr_area=fabs(lr_area)/2;
- if (result==-1) result=lr_area;
- else result-=lr_area;
+ lr_area= fabs(lr_area)/2;
+ if (result == -1.0)
+ result= lr_area;
+ else
+ result-= lr_area;
}
- *ar=fabs(result);
+ *ar= fabs(result);
+ *end_of_data= data;
return 0;
}
-int GPolygon::exterior_ring(String *result) const
+int Gis_polygon::exterior_ring(String *result) const
{
- uint32 n_points;
- const char *data = m_data + 4; // skip n_linerings
+ uint32 n_points, length;
+ const char *data= m_data + 4; // skip n_linerings
if (no_data(data, 4))
return 1;
- n_points = uint4korr(data);
- data += 4;
- if (no_data(data, n_points * POINT_DATA_SIZE))
- return 1;
-
- if (result->reserve(1+4+4+ n_points * POINT_DATA_SIZE))
+ n_points= uint4korr(data);
+ data+= 4;
+ length= n_points * POINT_DATA_SIZE;
+ if (no_data(data, length) || result->reserve(1+4+4+ length))
return 1;
- result->q_append((char)wkbNDR);
- result->q_append((uint32)wkbLineString);
+ result->q_append((char) wkb_ndr);
+ result->q_append((uint32) wkb_linestring);
result->q_append(n_points);
result->q_append(data, n_points * POINT_DATA_SIZE);
-
return 0;
}
-int GPolygon::num_interior_ring(uint32 *n_int_rings) const
+
+int Gis_polygon::num_interior_ring(uint32 *n_int_rings) const
{
- const char *data = m_data;
- if (no_data(data, 4))
+ if (no_data(m_data, 4))
return 1;
- *n_int_rings = uint4korr(data);
- --(*n_int_rings);
-
+ *n_int_rings= uint4korr(m_data)-1;
return 0;
}
-int GPolygon::interior_ring_n(uint32 num, String *result) const
+
+int Gis_polygon::interior_ring_n(uint32 num, String *result) const
{
- const char *data = m_data;
+ const char *data= m_data;
uint32 n_linear_rings;
uint32 n_points;
+ uint32 points_size;
if (no_data(data, 4))
return 1;
+ n_linear_rings= uint4korr(data);
+ data+= 4;
- n_linear_rings = uint4korr(data);
- data += 4;
- if ((num >= n_linear_rings) || (num < 1))
- return -1;
+ if (num >= n_linear_rings || num < 1)
+ return 1;
- for (; num > 0; --num)
+ while (num--)
{
if (no_data(data, 4))
return 1;
- data += 4 + uint4korr(data) * POINT_DATA_SIZE;
+ data+= 4 + uint4korr(data) * POINT_DATA_SIZE;
}
if (no_data(data, 4))
return 1;
- n_points = uint4korr(data);
- int points_size = n_points * POINT_DATA_SIZE;
- data += 4;
- if (no_data(data, points_size))
- return 1;
-
- if (result->reserve(1+4+4+ points_size))
+ n_points= uint4korr(data);
+ points_size= n_points * POINT_DATA_SIZE;
+ data+= 4;
+ if (no_data(data, points_size) || result->reserve(1+4+4+ points_size))
return 1;
- result->q_append((char)wkbNDR);
- result->q_append((uint32)wkbLineString);
+ result->q_append((char) wkb_ndr);
+ result->q_append((uint32) wkb_linestring);
result->q_append(n_points);
result->q_append(data, points_size);
return 0;
}
-int GPolygon::centroid_xy(double *x, double *y) const
+
+int Gis_polygon::centroid_xy(double *x, double *y) const
{
uint32 n_linear_rings;
- uint32 i;
double res_area, res_cx, res_cy;
- const char *data = m_data;
+ const char *data= m_data;
+ bool first_loop= 1;
LINT_INIT(res_area);
LINT_INIT(res_cx);
LINT_INIT(res_cy);
if (no_data(data, 4))
return 1;
- n_linear_rings = uint4korr(data);
- data += 4;
+ n_linear_rings= uint4korr(data);
+ data+= 4;
- for (i = 0; i < n_linear_rings; ++i)
+ while (n_linear_rings--)
{
- if (no_data(data, 4))
- return 1;
- uint32 n_points = uint4korr(data);
+ uint32 n_points, org_n_points;
double prev_x, prev_y;
- double cur_area = 0;
- double cur_cx = 0;
- double cur_cy = 0;
+ double cur_area= 0;
+ double cur_cx= 0;
+ double cur_cy= 0;
- data += 4;
- if (no_data(data, (8+8) * n_points))
+ if (no_data(data, 4))
+ return 1;
+ org_n_points= n_points= uint4korr(data);
+ data+= 4;
+ if (no_data(data, (SIZEOF_STORED_DOUBLE*2) * n_points))
return 1;
float8get(prev_x, data);
- float8get(prev_y, data+8);
- data += (8+8);
+ float8get(prev_y, data+SIZEOF_STORED_DOUBLE);
+ data+= (SIZEOF_STORED_DOUBLE*2);
- uint32 n = n_points - 1;
- for (; n > 0; --n)
+ while (--n_points) // One point is already read
{
double x, y;
float8get(x, data);
- float8get(y, data + 8);
-
- cur_area += (prev_x + x) * (prev_y - y);
- cur_cx += x;
- cur_cy += y;
- prev_x = x;
- prev_y = y;
- data += (8+8);
+ float8get(y, data + SIZEOF_STORED_DOUBLE);
+ data+= (SIZEOF_STORED_DOUBLE*2);
+ /* QQ: Is the following prev_x+x right ? */
+ cur_area+= (prev_x + x) * (prev_y - y);
+ cur_cx+= x;
+ cur_cy+= y;
+ prev_x= x;
+ prev_y= y;
}
- cur_area = fabs(cur_area) / 2;
- cur_cx = cur_cx / (n_points - 1);
- cur_cy = cur_cy / (n_points - 1);
+ cur_area= fabs(cur_area) / 2;
+ cur_cx= cur_cx / (org_n_points - 1);
+ cur_cy= cur_cy / (org_n_points - 1);
- if (i)
+ if (!first_loop)
{
- double d_area = res_area - cur_area;
+ double d_area= res_area - cur_area;
if (d_area <= 0)
return 1;
- res_cx = (res_area * res_cx - cur_area * cur_cx) / d_area;
- res_cy = (res_area * res_cy - cur_area * cur_cy) / d_area;
+ res_cx= (res_area * res_cx - cur_area * cur_cx) / d_area;
+ res_cy= (res_area * res_cy - cur_area * cur_cy) / d_area;
}
else
{
- res_area = cur_area;
- res_cx = cur_cx;
- res_cy = cur_cy;
+ first_loop= 0;
+ res_area= cur_area;
+ res_cx= cur_cx;
+ res_cy= cur_cy;
}
}
- *x = res_cx;
- *y = res_cy;
-
+ *x= res_cx;
+ *y= res_cy;
return 0;
}
-int GPolygon::centroid(String *result) const
+
+int Gis_polygon::centroid(String *result) const
{
double x, y;
-
- this->centroid_xy(&x, &y);
- if (result->reserve(1 + 4 + sizeof(double) * 2))
+ if (centroid_xy(&x, &y))
return 1;
+ return create_point(result, x, y);
+}
- result->q_append((char)wkbNDR);
- result->q_append((uint32)wkbPoint);
- result->q_append(x);
- result->q_append(y);
-
- return 0;
+const Geometry::Class_info *Gis_polygon::get_class_info() const
+{
+ return &polygon_class;
}
/***************************** MultiPoint *******************************/
-size_t GMultiPoint::get_data_size() const
+uint32 Gis_multi_point::get_data_size() const
{
+ if (no_data(m_data, 4))
+ return GET_SIZE_ERROR;
return 4 + uint4korr(m_data)*(POINT_DATA_SIZE + WKB_HEADER_SIZE);
}
-int GMultiPoint::init_from_wkt(GTextReadStream *trs, String *wkb)
+
+bool Gis_multi_point::init_from_wkt(Gis_read_stream *trs, String *wkb)
{
- uint32 n_points = 0;
- int np_pos = wkb->length();
- GPoint p;
+ uint32 n_points= 0;
+ uint32 np_pos= wkb->length();
+ Gis_point p;
if (wkb->reserve(4, 512))
return 1;
- wkb->q_append((uint32)n_points);
+ wkb->length(wkb->length()+4); // Reserve space for points
for (;;)
{
if (wkb->reserve(1+4, 512))
return 1;
- wkb->q_append((char)wkbNDR);
- wkb->q_append((uint32)wkbPoint);
+ wkb->q_append((char) wkb_ndr);
+ wkb->q_append((uint32) wkb_point);
if (p.init_from_wkt(trs, wkb))
return 1;
- ++n_points;
- if (trs->get_next_toc_type() == GTextReadStream::comma)
- trs->get_next_symbol();
- else
+ n_points++;
+ if (trs->skip_char(',')) // Didn't find ','
break;
}
- wkb->WriteAtPosition(np_pos, n_points);
-
+ wkb->write_at_position(np_pos, n_points); // Store number of found points
return 0;
}
-int GMultiPoint::get_data_as_wkt(String *txt) const
+
+bool Gis_multi_point::get_data_as_wkt(String *txt, const char **end) const
{
uint32 n_points;
- const char *data= m_data;
- if (no_data(data, 4))
- return 1;
-
- n_points= uint4korr(data);
- data+= 4;
- if (no_data(data, n_points * (8 + 8 + WKB_HEADER_SIZE)))
+ if (no_data(m_data, 4))
return 1;
- if (txt->reserve(((MAX_DIGITS_IN_DOUBLE + 1) * 2 + 1) * n_points))
+ n_points= uint4korr(m_data);
+ if (no_data(m_data+4,
+ n_points * (SIZEOF_STORED_DOUBLE * 2 + WKB_HEADER_SIZE)) ||
+ txt->reserve(((MAX_DIGITS_IN_DOUBLE + 1) * 2 + 1) * n_points))
return 1;
-
- for (; n_points>0; --n_points)
- {
- double d;
- float8get(d, data + WKB_HEADER_SIZE);
- txt->qs_append(d);
- txt->qs_append(' ');
- float8get(d, data + WKB_HEADER_SIZE + 8);
- txt->qs_append(d);
- txt->qs_append(',');
- data+= WKB_HEADER_SIZE + 8 + 8;
- }
- txt->length(txt->length()-1);
+ *end= append_points(txt, n_points, m_data+4, WKB_HEADER_SIZE);
+ txt->length(txt->length()-1); // Remove end ','
return 0;
}
-int GMultiPoint::get_mbr(MBR *mbr) const
+
+bool Gis_multi_point::get_mbr(MBR *mbr, const char **end) const
{
- uint32 n_points;
- const char *data = m_data;
- if (no_data(data, 4))
- return 1;
- n_points = uint4korr(data);
- data += 4;
- if (no_data(data, n_points * (8+8+WKB_HEADER_SIZE)))
- return 1;
- for (; n_points>0; --n_points)
- {
- mbr->add_xy(data + WKB_HEADER_SIZE, data + 8 + WKB_HEADER_SIZE);
- data += (8+8+WKB_HEADER_SIZE);
- }
- return 0;
+ return (*end= get_mbr_for_points(mbr, m_data, WKB_HEADER_SIZE)) == 0;
}
-int GMultiPoint::num_geometries(uint32 *num) const
+
+int Gis_multi_point::num_geometries(uint32 *num) const
{
- *num = uint4korr(m_data);
+ *num= uint4korr(m_data);
return 0;
}
-int GMultiPoint::geometry_n(uint32 num, String *result) const
+
+int Gis_multi_point::geometry_n(uint32 num, String *result) const
{
const char *data= m_data;
uint32 n_points;
+
if (no_data(data, 4))
return 1;
n_points= uint4korr(data);
- data+= 4;
- if ((num > n_points) || (num < 1))
- return -1;
- data+= (num - 1) * (WKB_HEADER_SIZE + POINT_DATA_SIZE);
- if (result->reserve(WKB_HEADER_SIZE + POINT_DATA_SIZE))
+ data+= 4+ (num - 1) * (WKB_HEADER_SIZE + POINT_DATA_SIZE);
+
+ if (num > n_points || num < 1 ||
+ no_data(data, WKB_HEADER_SIZE + POINT_DATA_SIZE) ||
+ result->reserve(WKB_HEADER_SIZE + POINT_DATA_SIZE))
return 1;
- result->q_append(data, WKB_HEADER_SIZE + POINT_DATA_SIZE);
+ result->q_append(data, WKB_HEADER_SIZE + POINT_DATA_SIZE);
return 0;
}
+const Geometry::Class_info *Gis_multi_point::get_class_info() const
+{
+ return &multipoint_class;
+}
+
+
/***************************** MultiLineString *******************************/
-size_t GMultiLineString::get_data_size() const
+uint32 Gis_multi_line_string::get_data_size() const
{
- uint32 n_line_strings = 0;
- const char *data = m_data;
+ uint32 n_line_strings;
+ const char *data= m_data;
+
if (no_data(data, 4))
- return 1;
- n_line_strings = uint4korr(data);
- data += 4;
+ return GET_SIZE_ERROR;
+ n_line_strings= uint4korr(data);
+ data+= 4;
- for (; n_line_strings>0; --n_line_strings)
+ while (n_line_strings--)
{
if (no_data(data, WKB_HEADER_SIZE + 4))
- return 1;
- data += WKB_HEADER_SIZE + 4 + uint4korr(data + WKB_HEADER_SIZE) * POINT_DATA_SIZE;
+ return GET_SIZE_ERROR;
+ data+= (WKB_HEADER_SIZE + 4 + uint4korr(data + WKB_HEADER_SIZE) *
+ POINT_DATA_SIZE);
}
- return data - m_data;
+ return (uint32) (data - m_data);
}
-int GMultiLineString::init_from_wkt(GTextReadStream *trs, String *wkb)
+
+bool Gis_multi_line_string::init_from_wkt(Gis_read_stream *trs, String *wkb)
{
- uint32 n_line_strings = 0;
- int ls_pos = wkb->length();
+ uint32 n_line_strings= 0;
+ uint32 ls_pos= wkb->length();
if (wkb->reserve(4, 512))
return 1;
-
- wkb->q_append((uint32)n_line_strings);
+ wkb->length(wkb->length()+4); // Reserve space for points
for (;;)
{
- GLineString ls;
+ Gis_line_string ls;
if (wkb->reserve(1+4, 512))
return 1;
- wkb->q_append((char)wkbNDR);
- wkb->q_append((uint32)wkbLineString);
-
- if (trs->get_next_symbol() != '(')
- {
- trs->set_error_msg("'(' expected");
- return 1;
- }
- if (ls.init_from_wkt(trs, wkb))
- return 1;
+ wkb->q_append((char) wkb_ndr);
+ wkb->q_append((uint32) wkb_linestring);
- if (trs->get_next_symbol() != ')')
- {
- trs->set_error_msg("')' expected");
+ if (trs->check_next_symbol('(') ||
+ ls.init_from_wkt(trs, wkb) ||
+ trs->check_next_symbol(')'))
return 1;
- }
- ++n_line_strings;
- if (trs->get_next_toc_type() == GTextReadStream::comma)
- trs->get_next_symbol();
- else
+ n_line_strings++;
+ if (trs->skip_char(',')) // Didn't find ','
break;
}
- wkb->WriteAtPosition(ls_pos, n_line_strings);
-
+ wkb->write_at_position(ls_pos, n_line_strings);
return 0;
}
-int GMultiLineString::get_data_as_wkt(String *txt) const
+
+bool Gis_multi_line_string::get_data_as_wkt(String *txt,
+ const char **end) const
{
uint32 n_line_strings;
const char *data= m_data;
+
if (no_data(data, 4))
return 1;
n_line_strings= uint4korr(data);
data+= 4;
- for (; n_line_strings > 0; --n_line_strings)
+
+ while (n_line_strings--)
{
+ uint32 n_points;
if (no_data(data, (WKB_HEADER_SIZE + 4)))
return 1;
- uint32 n_points= uint4korr(data + WKB_HEADER_SIZE);
+ n_points= uint4korr(data + WKB_HEADER_SIZE);
data+= WKB_HEADER_SIZE + 4;
- if (no_data(data, n_points * (8 + 8)))
- return 1;
-
- if (txt->reserve(2 + ((MAX_DIGITS_IN_DOUBLE + 1) * 2 + 1) * n_points))
+ if (no_data(data, n_points * (SIZEOF_STORED_DOUBLE*2)) ||
+ txt->reserve(2 + ((MAX_DIGITS_IN_DOUBLE + 1) * 2 + 1) * n_points))
return 1;
txt->qs_append('(');
- for (; n_points>0; --n_points)
- {
- double d;
- float8get(d, data);
- txt->qs_append(d);
- txt->qs_append(' ');
- float8get(d, data + 8);
- txt->qs_append(d);
- txt->qs_append(',');
- data+= 8 + 8;
- }
- (*txt) [txt->length() - 1] = ')';
+ data= append_points(txt, n_points, data, 0);
+ (*txt) [txt->length() - 1]= ')';
txt->qs_append(',');
}
txt->length(txt->length() - 1);
+ *end= data;
return 0;
}
-int GMultiLineString::get_mbr(MBR *mbr) const
+
+bool Gis_multi_line_string::get_mbr(MBR *mbr, const char **end) const
{
uint32 n_line_strings;
- const char *data = m_data;
+ const char *data= m_data;
+
if (no_data(data, 4))
return 1;
- n_line_strings = uint4korr(data);
- data += 4;
+ n_line_strings= uint4korr(data);
+ data+= 4;
- for (; n_line_strings>0; --n_line_strings)
+ while (n_line_strings--)
{
- if (no_data(data, WKB_HEADER_SIZE + 4))
- return 1;
- uint32 n_points = uint4korr(data + WKB_HEADER_SIZE);
- data += 4+WKB_HEADER_SIZE;
- if (no_data(data, (8+8)*n_points))
+ data+= WKB_HEADER_SIZE;
+ if (!(data= get_mbr_for_points(mbr, data, 0)))
return 1;
-
- for (; n_points>0; --n_points)
- {
- mbr->add_xy(data, data + 8);
- data += 8+8;
- }
}
+ *end= data;
return 0;
}
-int GMultiLineString::num_geometries(uint32 *num) const
+
+int Gis_multi_line_string::num_geometries(uint32 *num) const
{
- *num = uint4korr(m_data);
+ *num= uint4korr(m_data);
return 0;
}
-int GMultiLineString::geometry_n(uint32 num, String *result) const
+
+int Gis_multi_line_string::geometry_n(uint32 num, String *result) const
{
- uint32 n_line_strings;
+ uint32 n_line_strings, n_points, length;
const char *data= m_data;
+
if (no_data(data, 4))
return 1;
n_line_strings= uint4korr(data);
data+= 4;
if ((num > n_line_strings) || (num < 1))
- return -1;
+ return 1;
- for (; num > 0; --num)
+ for (;;)
{
if (no_data(data, WKB_HEADER_SIZE + 4))
return 1;
- uint32 n_points= uint4korr(data + WKB_HEADER_SIZE);
- if (num == 1)
- {
- if (result->reserve(WKB_HEADER_SIZE + 4 + POINT_DATA_SIZE * n_points))
- return 1;
- result->q_append(data, WKB_HEADER_SIZE + 4 + POINT_DATA_SIZE *n_points);
+ n_points= uint4korr(data + WKB_HEADER_SIZE);
+ length= WKB_HEADER_SIZE + 4+ POINT_DATA_SIZE * n_points;
+ if (no_data(data, length))
+ return 1;
+ if (!--num)
break;
- }
- else
- {
- data+= WKB_HEADER_SIZE + 4 + POINT_DATA_SIZE * n_points;
- }
+ data+= length;
}
- return 0;
+ return result->append(data, length, (uint32) 0);
}
-int GMultiLineString::length(double *len) const
+
+int Gis_multi_line_string::length(double *len) const
{
uint32 n_line_strings;
- const char *data = m_data;
+ const char *data= m_data;
+
if (no_data(data, 4))
return 1;
- n_line_strings = uint4korr(data);
- data += 4;
+ n_line_strings= uint4korr(data);
+ data+= 4;
+
*len=0;
- for (; n_line_strings>0; --n_line_strings)
+ while (n_line_strings--)
{
double ls_len;
- GLineString ls;
- data += WKB_HEADER_SIZE;
- ls.init_from_wkb(data, m_data_end - data);
+ Gis_line_string ls;
+ data+= WKB_HEADER_SIZE;
+ ls.init_from_wkb(data, (uint32) (m_data_end - data));
if (ls.length(&ls_len))
return 1;
- *len+=ls_len;
- data += ls.get_data_size();
+ *len+= ls_len;
+ /*
+ We know here that ls was ok, so we can call the trivial function
+ Gis_line_string::get_data_size without error checking
+ */
+ data+= ls.get_data_size();
}
return 0;
}
-int GMultiLineString::is_closed(int *closed) const
+
+int Gis_multi_line_string::is_closed(int *closed) const
{
uint32 n_line_strings;
- const char *data = m_data;
- if (no_data(data, 1))
+ const char *data= m_data;
+
+ if (no_data(data, 4 + WKB_HEADER_SIZE))
return 1;
- n_line_strings = uint4korr(data);
- data += 4 + WKB_HEADER_SIZE;
- for (; n_line_strings>0; --n_line_strings)
+ n_line_strings= uint4korr(data);
+ data+= 4 + WKB_HEADER_SIZE;
+
+ while (n_line_strings--)
{
- GLineString ls;
- ls.init_from_wkb(data, m_data_end - data);
+ Gis_line_string ls;
+ if (no_data(data, 0))
+ return 1;
+ ls.init_from_wkb(data, (uint32) (m_data_end - data));
if (ls.is_closed(closed))
return 1;
if (!*closed)
return 0;
- data += ls.get_data_size() + WKB_HEADER_SIZE;
+ /*
+ We know here that ls was ok, so we can call the trivial function
+ Gis_line_string::get_data_size without error checking
+ */
+ data+= ls.get_data_size() + WKB_HEADER_SIZE;
}
return 0;
}
+const Geometry::Class_info *Gis_multi_line_string::get_class_info() const
+{
+ return &multilinestring_class;
+}
+
+
/***************************** MultiPolygon *******************************/
-size_t GMultiPolygon::get_data_size() const
+uint32 Gis_multi_polygon::get_data_size() const
{
uint32 n_polygons;
- const char *data = m_data;
+ const char *data= m_data;
+
if (no_data(data, 4))
- return 1;
- n_polygons = uint4korr(data);
- data += 4;
+ return GET_SIZE_ERROR;
+ n_polygons= uint4korr(data);
+ data+= 4;
- for (; n_polygons>0; --n_polygons)
+ while (n_polygons--)
{
+ uint32 n_linear_rings;
if (no_data(data, 4 + WKB_HEADER_SIZE))
- return 1;
- uint32 n_linear_rings = uint4korr(data + WKB_HEADER_SIZE);
- data += 4 + WKB_HEADER_SIZE;
+ return GET_SIZE_ERROR;
+
+ n_linear_rings= uint4korr(data + WKB_HEADER_SIZE);
+ data+= 4 + WKB_HEADER_SIZE;
- for (; n_linear_rings > 0; --n_linear_rings)
+ while (n_linear_rings--)
{
- data += 4 + uint4korr(data) * POINT_DATA_SIZE;
+ if (no_data(data, 4))
+ return GET_SIZE_ERROR;
+ data+= 4 + uint4korr(data) * POINT_DATA_SIZE;
}
}
- return data - m_data;
+ return (uint32) (data - m_data);
}
-int GMultiPolygon::init_from_wkt(GTextReadStream *trs, String *wkb)
+
+bool Gis_multi_polygon::init_from_wkt(Gis_read_stream *trs, String *wkb)
{
- uint32 n_polygons = 0;
- int np_pos = wkb->length();
- GPolygon p;
+ uint32 n_polygons= 0;
+ int np_pos= wkb->length();
+ Gis_polygon p;
if (wkb->reserve(4, 512))
return 1;
-
- wkb->q_append((uint32)n_polygons);
+ wkb->length(wkb->length()+4); // Reserve space for points
for (;;)
{
if (wkb->reserve(1+4, 512))
return 1;
- wkb->q_append((char)wkbNDR);
- wkb->q_append((uint32)wkbPolygon);
+ wkb->q_append((char) wkb_ndr);
+ wkb->q_append((uint32) wkb_polygon);
- if (trs->get_next_symbol() != '(')
- {
- trs->set_error_msg("'(' expected");
- return 1;
- }
- if (p.init_from_wkt(trs, wkb))
- return 1;
- if (trs->get_next_symbol() != ')')
- {
- trs->set_error_msg("')' expected");
+ if (trs->check_next_symbol('(') ||
+ p.init_from_wkt(trs, wkb) ||
+ trs->check_next_symbol(')'))
return 1;
- }
- ++n_polygons;
- if (trs->get_next_toc_type() == GTextReadStream::comma)
- trs->get_next_symbol();
- else
+ n_polygons++;
+ if (trs->skip_char(',')) // Didn't find ','
break;
}
- wkb->WriteAtPosition(np_pos, n_polygons);
+ wkb->write_at_position(np_pos, n_polygons);
return 0;
}
-int GMultiPolygon::get_data_as_wkt(String *txt) const
+
+bool Gis_multi_polygon::get_data_as_wkt(String *txt, const char **end) const
{
uint32 n_polygons;
const char *data= m_data;
+
if (no_data(data, 4))
return 1;
n_polygons= uint4korr(data);
data+= 4;
- for (; n_polygons>0; --n_polygons)
+ while (n_polygons--)
{
- if (no_data(data, 4 + WKB_HEADER_SIZE))
- return 1;
- data+= WKB_HEADER_SIZE;
- uint32 n_linear_rings= uint4korr(data);
- data+= 4;
-
- if (txt->reserve(1, 512))
+ uint32 n_linear_rings;
+ if (no_data(data, 4 + WKB_HEADER_SIZE) ||
+ txt->reserve(1, 512))
return 1;
+ n_linear_rings= uint4korr(data+WKB_HEADER_SIZE);
+ data+= 4 + WKB_HEADER_SIZE;
txt->q_append('(');
- for (; n_linear_rings>0; --n_linear_rings)
+
+ while (n_linear_rings--)
{
if (no_data(data, 4))
return 1;
uint32 n_points= uint4korr(data);
data+= 4;
- if (no_data(data, (8 + 8) * n_points)) return 1;
-
- if (txt->reserve(2 + ((MAX_DIGITS_IN_DOUBLE + 1) * 2 + 1) * n_points,
- 512)) return 1;
+ if (no_data(data, (SIZEOF_STORED_DOUBLE * 2) * n_points) ||
+ txt->reserve(2 + ((MAX_DIGITS_IN_DOUBLE + 1) * 2 + 1) * n_points,
+ 512))
+ return 1;
txt->qs_append('(');
- for (; n_points>0; --n_points)
- {
- double d;
- float8get(d, data);
- txt->qs_append(d);
- txt->qs_append(' ');
- float8get(d, data + 8);
- txt->qs_append(d);
- txt->qs_append(',');
- data+= 8 + 8;
- }
- (*txt) [txt->length() - 1] = ')';
+ data= append_points(txt, n_points, data, 0);
+ (*txt) [txt->length() - 1]= ')';
txt->qs_append(',');
}
- (*txt) [txt->length() - 1] = ')';
+ (*txt) [txt->length() - 1]= ')';
txt->qs_append(',');
}
txt->length(txt->length() - 1);
+ *end= data;
return 0;
}
-int GMultiPolygon::get_mbr(MBR *mbr) const
+
+bool Gis_multi_polygon::get_mbr(MBR *mbr, const char **end) const
{
uint32 n_polygons;
- const char *data = m_data;
+ const char *data= m_data;
+
if (no_data(data, 4))
return 1;
- n_polygons = uint4korr(data);
- data += 4;
+ n_polygons= uint4korr(data);
+ data+= 4;
- for (; n_polygons>0; --n_polygons)
+ while (n_polygons--)
{
+ uint32 n_linear_rings;
if (no_data(data, 4+WKB_HEADER_SIZE))
return 1;
- uint32 n_linear_rings = uint4korr(data + WKB_HEADER_SIZE);
- data += WKB_HEADER_SIZE + 4;
+ n_linear_rings= uint4korr(data + WKB_HEADER_SIZE);
+ data+= WKB_HEADER_SIZE + 4;
- for (; n_linear_rings>0; --n_linear_rings)
+ while (n_linear_rings--)
{
- if (no_data(data, 4))
- return 1;
- uint32 n_points = uint4korr(data);
- data += 4;
- if (no_data(data, (8+8)*n_points))
- return 1;
-
- for (; n_points>0; --n_points)
- {
- mbr->add_xy(data, data + 8);
- data += 8+8;
- }
+ if (!(data= get_mbr_for_points(mbr, data, 0)))
+ return 1;
}
}
+ *end= data;
return 0;
}
-int GMultiPolygon::num_geometries(uint32 *num) const
+
+int Gis_multi_polygon::num_geometries(uint32 *num) const
{
- *num = uint4korr(m_data);
+ *num= uint4korr(m_data);
return 0;
}
-int GMultiPolygon::geometry_n(uint32 num, String *result) const
+
+int Gis_multi_polygon::geometry_n(uint32 num, String *result) const
{
uint32 n_polygons;
- const char *data= m_data, *polygon_n;
- LINT_INIT(polygon_n);
+ const char *data= m_data, *start_of_polygon;
if (no_data(data, 4))
return 1;
n_polygons= uint4korr(data);
data+= 4;
- if ((num > n_polygons) || (num < 1))
+ if (num > n_polygons || num < 1)
return -1;
- for (; num > 0; --num)
+ do
{
+ uint32 n_linear_rings;
+ start_of_polygon= data;
+
if (no_data(data, WKB_HEADER_SIZE + 4))
return 1;
- uint32 n_linear_rings= uint4korr(data + WKB_HEADER_SIZE);
-
- if (num == 1)
- polygon_n= data;
+ n_linear_rings= uint4korr(data + WKB_HEADER_SIZE);
data+= WKB_HEADER_SIZE + 4;
- for (; n_linear_rings > 0; --n_linear_rings)
+
+ while (n_linear_rings--)
{
+ uint32 n_points;
if (no_data(data, 4))
return 1;
- uint32 n_points= uint4korr(data);
+ n_points= uint4korr(data);
data+= 4 + POINT_DATA_SIZE * n_points;
}
- if (num == 1)
- {
- if (result->reserve(data - polygon_n))
- return -1;
- result->q_append(polygon_n, data - polygon_n);
- break;
- }
- }
- return 0;
+ } while (--num);
+ if (no_data(data, 0)) // We must check last segment
+ return 1;
+ return result->append(start_of_polygon, (uint32) (data - start_of_polygon),
+ (uint32) 0);
}
-int GMultiPolygon::area(double *ar) const
+
+int Gis_multi_polygon::area(double *ar, const char **end_of_data) const
{
uint32 n_polygons;
- const char *data = m_data;
- double result = 0;
+ const char *data= m_data;
+ double result= 0;
+
if (no_data(data, 4))
return 1;
- n_polygons = uint4korr(data);
- data += 4;
+ n_polygons= uint4korr(data);
+ data+= 4;
- for (; n_polygons>0; --n_polygons)
+ while (n_polygons--)
{
double p_area;
+ Gis_polygon p;
- GPolygon p;
- data += WKB_HEADER_SIZE;
- p.init_from_wkb(data, m_data_end - data);
- if (p.area(&p_area))
+ data+= WKB_HEADER_SIZE;
+ p.init_from_wkb(data, (uint32) (m_data_end - data));
+ if (p.area(&p_area, &data))
return 1;
- result += p_area;
- data += p.get_data_size();
+ result+= p_area;
}
- *ar = result;
+ *ar= result;
+ *end_of_data= data;
return 0;
}
-int GMultiPolygon::centroid(String *result) const
+
+int Gis_multi_polygon::centroid(String *result) const
{
uint32 n_polygons;
- uint i;
- GPolygon p;
+ bool first_loop= 1;
+ Gis_polygon p;
double res_area, res_cx, res_cy;
double cur_area, cur_cx, cur_cy;
+ const char *data= m_data;
LINT_INIT(res_area);
LINT_INIT(res_cx);
LINT_INIT(res_cy);
- const char *data = m_data;
if (no_data(data, 4))
return 1;
- n_polygons = uint4korr(data);
- data += 4;
+ n_polygons= uint4korr(data);
+ data+= 4;
- for (i = 0; i < n_polygons; ++i)
+ while (n_polygons--)
{
- data += WKB_HEADER_SIZE;
- p.init_from_wkb(data, m_data_end - data);
- if (p.area(&cur_area))
- return 1;
-
- if (p.centroid_xy(&cur_cx, &cur_cy))
+ data+= WKB_HEADER_SIZE;
+ p.init_from_wkb(data, (uint32) (m_data_end - data));
+ if (p.area(&cur_area, &data) ||
+ p.centroid_xy(&cur_cx, &cur_cy))
return 1;
- if (i)
+ if (!first_loop)
{
- double sum_area = res_area + cur_area;
- res_cx = (res_area * res_cx + cur_area * cur_cx) / sum_area;
- res_cy = (res_area * res_cy + cur_area * cur_cy) / sum_area;
+ double sum_area= res_area + cur_area;
+ res_cx= (res_area * res_cx + cur_area * cur_cx) / sum_area;
+ res_cy= (res_area * res_cy + cur_area * cur_cy) / sum_area;
}
else
{
- res_area = cur_area;
- res_cx = cur_cx;
- res_cy = cur_cy;
+ first_loop= 0;
+ res_area= cur_area;
+ res_cx= cur_cx;
+ res_cy= cur_cy;
}
-
- data += p.get_data_size();
}
- if (result->reserve(1 + 4 + sizeof(double) * 2))
- return 1;
- result->q_append((char)wkbNDR);
- result->q_append((uint32)wkbPoint);
- result->q_append(res_cx);
- result->q_append(res_cy);
+ return create_point(result, res_cx, res_cy);
+}
- return 0;
+const Geometry::Class_info *Gis_multi_polygon::get_class_info() const
+{
+ return &multipolygon_class;
}
-/***************************** GeometryCollection *******************************/
-size_t GGeometryCollection::get_data_size() const
+/************************* GeometryCollection ****************************/
+
+uint32 Gis_geometry_collection::get_data_size() const
{
uint32 n_objects;
- const char *data = m_data;
+ const char *data= m_data;
+ Geometry_buffer buffer;
+ Geometry *geom;
+
if (no_data(data, 4))
- return 1;
- n_objects = uint4korr(data);
- data += 4;
+ return GET_SIZE_ERROR;
+ n_objects= uint4korr(data);
+ data+= 4;
- for (; n_objects>0; --n_objects)
+ while (n_objects--)
{
- if (no_data(data, WKB_HEADER_SIZE))
- return 1;
- uint32 wkb_type = uint4korr(data + sizeof(char));
- data += WKB_HEADER_SIZE;
-
- Geometry geom;
+ uint32 wkb_type,object_size;
- if (geom.init(wkb_type))
- return 0;
+ if (no_data(data, WKB_HEADER_SIZE))
+ return GET_SIZE_ERROR;
+ wkb_type= uint4korr(data + 1);
+ data+= WKB_HEADER_SIZE;
- geom.init_from_wkb(data, m_data_end - data);
- size_t object_size=geom.get_data_size();
- data += object_size;
+ if (!(geom= create_by_typeid(&buffer, wkb_type)))
+ return GET_SIZE_ERROR;
+ geom->init_from_wkb(data, (uint) (m_data_end - data));
+ if ((object_size= geom->get_data_size()) == GET_SIZE_ERROR)
+ return GET_SIZE_ERROR;
+ data+= object_size;
}
- return data - m_data;
+ return (uint32) (data - m_data);
}
-int GGeometryCollection::init_from_wkt(GTextReadStream *trs, String *wkb)
+
+bool Gis_geometry_collection::init_from_wkt(Gis_read_stream *trs, String *wkb)
{
- uint32 n_objects = 0;
- int no_pos = wkb->length();
- Geometry g;
+ uint32 n_objects= 0;
+ uint32 no_pos= wkb->length();
+ Geometry_buffer buffer;
+ Geometry *g;
if (wkb->reserve(4, 512))
return 1;
- wkb->q_append((uint32)n_objects);
+ wkb->length(wkb->length()+4); // Reserve space for points
for (;;)
{
- if (g.create_from_wkt(trs, wkb))
+ if (!(g= create_from_wkt(&buffer, trs, wkb)))
return 1;
- if (g.get_class_info()->m_type_id==wkbGeometryCollection)
+ if (g->get_class_info()->m_type_id == wkb_geometrycollection)
{
trs->set_error_msg("Unexpected GEOMETRYCOLLECTION");
return 1;
}
- ++n_objects;
- if (trs->get_next_toc_type() == GTextReadStream::comma)
- trs->get_next_symbol();
- else break;
+ n_objects++;
+ if (trs->skip_char(',')) // Didn't find ','
+ break;
}
- wkb->WriteAtPosition(no_pos, n_objects);
+ wkb->write_at_position(no_pos, n_objects);
return 0;
}
-int GGeometryCollection::get_data_as_wkt(String *txt) const
+
+bool Gis_geometry_collection::get_data_as_wkt(String *txt,
+ const char **end) const
{
uint32 n_objects;
- const char *data = m_data;
- Geometry geom;
+ Geometry_buffer buffer;
+ Geometry *geom;
+ const char *data= m_data;
+
if (no_data(data, 4))
return 1;
- n_objects = uint4korr(data);
- data += 4;
+ n_objects= uint4korr(data);
+ data+= 4;
- for (; n_objects>0; --n_objects)
+ while (n_objects--)
{
+ uint32 wkb_type;
+
if (no_data(data, WKB_HEADER_SIZE))
return 1;
- uint32 wkb_type = uint4korr(data + sizeof(char));
- data += WKB_HEADER_SIZE;
+ wkb_type= uint4korr(data + 1);
+ data+= WKB_HEADER_SIZE;
- if (geom.init(wkb_type))
+ if (!(geom= create_by_typeid(&buffer, wkb_type)))
return 1;
- geom.init_from_wkb(data, m_data_end - data);
- if (geom.as_wkt(txt))
+ geom->init_from_wkb(data, (uint) (m_data_end - data));
+ if (geom->as_wkt(txt, &data))
+ return 1;
+ if (txt->append(",", 1, 512))
return 1;
- data += geom.get_data_size();
- txt->reserve(1, 512);
- txt->q_append(',');
}
txt->length(txt->length() - 1);
+ *end= data;
return 0;
}
-int GGeometryCollection::get_mbr(MBR *mbr) const
+
+bool Gis_geometry_collection::get_mbr(MBR *mbr, const char **end) const
{
uint32 n_objects;
- const char *data = m_data;
+ const char *data= m_data;
+ Geometry_buffer buffer;
+ Geometry *geom;
+
if (no_data(data, 4))
return 1;
- n_objects = uint4korr(data);
- data += 4;
- for (; n_objects>0; --n_objects)
+ n_objects= uint4korr(data);
+ data+= 4;
+
+ while (n_objects--)
{
+ uint32 wkb_type;
+
if (no_data(data, WKB_HEADER_SIZE))
return 1;
- uint32 wkb_type = uint4korr(data + sizeof(char));
- data += WKB_HEADER_SIZE;
- Geometry geom;
+ wkb_type= uint4korr(data + 1);
+ data+= WKB_HEADER_SIZE;
- if (geom.init(wkb_type))
+ if (!(geom= create_by_typeid(&buffer, wkb_type)))
+ return 1;
+ geom->init_from_wkb(data, (uint32) (m_data_end - data));
+ if (geom->get_mbr(mbr, &data))
return 1;
- geom.init_from_wkb(data, m_data_end - data);
- geom.get_mbr(mbr);
- data += geom.get_data_size();
}
+ *end= data;
return 0;
}
-int GGeometryCollection::num_geometries(uint32 *num) const
+
+int Gis_geometry_collection::num_geometries(uint32 *num) const
{
- *num = uint4korr(m_data);
+ if (no_data(m_data, 4))
+ return 1;
+ *num= uint4korr(m_data);
return 0;
}
-int GGeometryCollection::geometry_n(uint32 num, String *result) const
+
+int Gis_geometry_collection::geometry_n(uint32 num, String *result) const
{
- const char *data = m_data;
- uint32 n_objects;
+ uint32 n_objects, wkb_type, length;
+ const char *data= m_data;
+ Geometry_buffer buffer;
+ Geometry *geom;
+
if (no_data(data, 4))
return 1;
- n_objects = uint4korr(data);
- data += 4;
+ n_objects= uint4korr(data);
+ data+= 4;
+ if (num > n_objects || num < 1)
+ return 1;
- if ((num > n_objects) || (num < 1))
- {
- return -1;
- }
- for (; num > 0; --num)
+ do
{
if (no_data(data, WKB_HEADER_SIZE))
return 1;
- uint32 wkb_type = uint4korr(data + sizeof(char));
- data += WKB_HEADER_SIZE;
+ wkb_type= uint4korr(data + 1);
+ data+= WKB_HEADER_SIZE;
- Geometry geom;
- if (geom.init(wkb_type))
+ if (!(geom= create_by_typeid(&buffer, wkb_type)))
return 1;
- geom.init_from_wkb(data, m_data_end - data);
- if (num == 1)
- {
- if (result->reserve(1+4+geom.get_data_size()))
- return 1;
- result->q_append((char)wkbNDR);
- result->q_append((uint32)wkb_type);
- result->q_append(data, geom.get_data_size());
- break;
- }
- else
- {
- data += geom.get_data_size();
- }
- }
+ geom->init_from_wkb(data, (uint) (m_data_end - data));
+ if ((length= geom->get_data_size()) == GET_SIZE_ERROR)
+ return 1;
+ data+= length;
+ } while (--num);
+
+ /* Copy found object to result */
+ if (result->reserve(1+4+length))
+ return 1;
+ result->q_append((char) wkb_ndr);
+ result->q_append((uint32) wkb_type);
+ result->q_append(data-length, length); // data-length = start_of_data
return 0;
}
-int GGeometryCollection::dimension(uint32 *dim) const
+
+/*
+ Return dimension for object
+
+ SYNOPSIS
+ dimension()
+ res_dim Result dimension
+ end End of object will be stored here. May be 0 for
+ simple objects!
+ RETURN
+ 0 ok
+ 1 error
+*/
+
+bool Gis_geometry_collection::dimension(uint32 *res_dim, const char **end) const
{
uint32 n_objects;
- *dim = 0;
- const char *data = m_data;
+ const char *data= m_data;
+ Geometry_buffer buffer;
+ Geometry *geom;
+
if (no_data(data, 4))
return 1;
- n_objects = uint4korr(data);
- data += 4;
+ n_objects= uint4korr(data);
+ data+= 4;
- for (; n_objects > 0; --n_objects)
+ *res_dim= 0;
+ while (n_objects--)
{
+ uint32 wkb_type, length, dim;
+ const char *end_data;
+
if (no_data(data, WKB_HEADER_SIZE))
return 1;
- uint32 wkb_type = uint4korr(data + sizeof(char));
- data += WKB_HEADER_SIZE;
-
- uint32 d;
-
- Geometry geom;
- if (geom.init(wkb_type))
+ wkb_type= uint4korr(data + 1);
+ data+= WKB_HEADER_SIZE;
+ if (!(geom= create_by_typeid(&buffer, wkb_type)))
return 1;
- geom.init_from_wkb(data, m_data_end - data);
- if (geom.dimension(&d))
+ geom->init_from_wkb(data, (uint32) (m_data_end - data));
+ if (geom->dimension(&dim, &end_data))
return 1;
-
- if (d > *dim)
- *dim = d;
- data += geom.get_data_size();
+ set_if_bigger(*res_dim, dim);
+ if (end_data) // Complex object
+ data= end_data;
+ else if ((length= geom->get_data_size()) == GET_SIZE_ERROR)
+ return 1;
+ else
+ data+= length;
}
+ *end= data;
return 0;
}
-/***************************** /objects *******************************/
+const Geometry::Class_info *Gis_geometry_collection::get_class_info() const
+{
+ return &geometrycollection_class;
+}
+
diff --git a/sql/spatial.h b/sql/spatial.h
index 5fda257f1b1..cf07b364bb3 100644
--- a/sql/spatial.h
+++ b/sql/spatial.h
@@ -17,118 +17,80 @@
#ifndef _spatial_h
#define _spatial_h
-const uint POINT_DATA_SIZE = 8+8;
-const uint WKB_HEADER_SIZE = 1+4;
+const uint SRID_SIZE= 4;
+const uint SIZEOF_STORED_DOUBLE= 8;
+const uint POINT_DATA_SIZE= SIZEOF_STORED_DOUBLE*2;
+const uint WKB_HEADER_SIZE= 1+4;
+const uint32 GET_SIZE_ERROR= ((uint32) -1);
-struct stPoint2D
+struct st_point_2d
{
double x;
double y;
};
-struct stLinearRing
+struct st_linear_ring
{
- size_t n_points;
- stPoint2D points;
+ uint32 n_points;
+ st_point_2d points;
};
/***************************** MBR *******************************/
+
+/*
+ It's ok that a lot of the functions are inline as these are only used once
+ in MySQL
+*/
+
struct MBR
{
+ double xmin, ymin, xmax, ymax;
+
MBR()
{
- xmin=DBL_MAX;
- ymin=DBL_MAX;
- xmax=-DBL_MAX;
- ymax=-DBL_MAX;
+ xmin= ymin= DBL_MAX;
+ xmax= ymax= -DBL_MAX;
}
- MBR(const double &_xmin, const double &_ymin,
- const double &_xmax, const double &_ymax)
- {
- xmin=_xmin;
- ymin=_ymin;
- xmax=_xmax;
- ymax=_ymax;
- }
+ MBR(const double xmin_arg, const double ymin_arg,
+ const double xmax_arg, const double ymax_arg)
+ :xmin(xmin_arg), ymin(ymin_arg), xmax(xmax_arg), ymax(ymax_arg)
+ {}
- MBR(const stPoint2D &min, const stPoint2D &max)
- {
- xmin=min.x;
- ymin=min.y;
- xmax=max.x;
- ymax=max.y;
- }
-
- double xmin;
- double ymin;
- double xmax;
- double ymax;
-
- void add_xy(double x, double y)
+ MBR(const st_point_2d &min, const st_point_2d &max)
+ :xmin(min.x), ymin(min.y), xmax(max.x), ymax(max.y)
+ {}
+
+ inline void add_xy(double x, double y)
{
/* Not using "else" for proper one point MBR calculation */
- if (x<xmin)
- {
- xmin=x;
- }
- if (x>xmax)
- {
- xmax=x;
- }
- if (y<ymin)
- {
- ymin=y;
- }
- if (y>ymax)
- {
- ymax=y;
- }
+ if (x < xmin)
+ xmin= x;
+ if (x > xmax)
+ xmax= x;
+ if (y < ymin)
+ ymin= y;
+ if (y > ymax)
+ ymax= y;
}
-
void add_xy(const char *px, const char *py)
{
double x, y;
float8get(x, px);
float8get(y, py);
- /* Not using "else" for proper one point MBR calculation */
- if (x<xmin)
- {
- xmin=x;
- }
- if (x>xmax)
- {
- xmax=x;
- }
- if (y<ymin)
- {
- ymin=y;
- }
- if (y>ymax)
- {
- ymax=y;
- }
+ add_xy(x,y);
}
-
void add_mbr(const MBR *mbr)
{
- if (mbr->xmin<xmin)
- {
- xmin=mbr->xmin;
- }
- if (mbr->xmax>xmax)
- {
- xmax=mbr->xmax;
- }
- if (mbr->ymin<ymin)
- {
- ymin=mbr->ymin;
- }
- if (mbr->ymax>ymax)
- {
- ymax=mbr->ymax;
- }
+ if (mbr->xmin < xmin)
+ xmin= mbr->xmin;
+ if (mbr->xmax > xmax)
+ xmax= mbr->xmax;
+ if (mbr->ymin < ymin)
+ ymin= mbr->ymin;
+ if (mbr->ymax > ymax)
+ ymax= mbr->ymax;
}
int equals(const MBR *mbr)
@@ -177,12 +139,12 @@ struct MBR
int overlaps(const MBR *mbr)
{
- int lb = mbr->inner_point(xmin, ymin);
- int rb = mbr->inner_point(xmax, ymin);
- int rt = mbr->inner_point(xmax, ymax);
- int lt = mbr->inner_point(xmin, ymax);
+ int lb= mbr->inner_point(xmin, ymin);
+ int rb= mbr->inner_point(xmax, ymin);
+ int rt= mbr->inner_point(xmax, ymax);
+ int lt= mbr->inner_point(xmin, ymax);
- int a = lb+rb+rt+lt;
+ int a = lb+rb+rt+lt;
return (a>0) && (a<4) && (!within(mbr));
}
};
@@ -190,188 +152,144 @@ struct MBR
/***************************** Geometry *******************************/
-class Geometry;
-
-typedef int (Geometry::*GF_InitFromText)(GTextReadStream *, String *);
-typedef int (Geometry::*GF_GetDataAsText)(String *) const;
-typedef size_t (Geometry::*GF_GetDataSize)() const;
-typedef int (Geometry::*GF_GetMBR)(MBR *) const;
-
-typedef int (Geometry::*GF_GetD)(double *) const;
-typedef int (Geometry::*GF_GetI)(int *) const;
-typedef int (Geometry::*GF_GetUI)(uint32 *) const;
-typedef int (Geometry::*GF_GetWS)(String *) const;
-typedef int (Geometry::*GF_GetUIWS)(uint32, String *) const;
-
-#define GEOM_METHOD_PRESENT(geom_obj, method)\
- (geom_obj.m_vmt->method != &Geometry::method)
+struct Geometry_buffer;
class Geometry
{
public:
+ static void *operator new(size_t size, void *buffer)
+ {
+ return buffer;
+ }
+
enum wkbType
{
- wkbPoint = 1,
- wkbLineString = 2,
- wkbPolygon = 3,
- wkbMultiPoint = 4,
- wkbMultiLineString = 5,
- wkbMultiPolygon = 6,
- wkbGeometryCollection = 7
+ wkb_point= 1,
+ wkb_linestring= 2,
+ wkb_polygon= 3,
+ wkb_multipoint= 4,
+ wkb_multilinestring= 5,
+ wkb_multipolygon= 6,
+ wkb_geometrycollection= 7,
+ wkb_end=7
};
enum wkbByteOrder
{
- wkbXDR = 0, /* Big Endian */
- wkbNDR = 1 /* Little Endian */
+ wkb_xdr= 0, /* Big Endian */
+ wkb_ndr= 1 /* Little Endian */
};
- class GClassInfo
+ class Class_info
{
public:
- GF_InitFromText init_from_wkt;
- GF_GetDataAsText get_data_as_wkt;
- GF_GetDataSize get_data_size;
- GF_GetMBR get_mbr;
- GF_GetD get_x;
- GF_GetD get_y;
- GF_GetD length;
- GF_GetD area;
-
- GF_GetI is_closed;
-
- GF_GetUI num_interior_ring;
- GF_GetUI num_points;
- GF_GetUI num_geometries;
- GF_GetUI dimension;
-
- GF_GetWS start_point;
- GF_GetWS end_point;
- GF_GetWS exterior_ring;
- GF_GetWS centroid;
-
- GF_GetUIWS point_n;
- GF_GetUIWS interior_ring_n;
- GF_GetUIWS geometry_n;
-
+ LEX_STRING_WITH_INIT m_name;
int m_type_id;
- const char *m_name;
- GClassInfo *m_next_rt;
+ void (*m_create_func)(void *);
+ Class_info(const char *name, int type_id, void(*create_func)(void *));
};
- GClassInfo *m_vmt;
- const GClassInfo *get_class_info() const { return m_vmt; }
- size_t get_data_size() const { return (this->*m_vmt->get_data_size)(); }
-
- int init_from_wkt(GTextReadStream *trs, String *wkb)
- { return (this->*m_vmt->init_from_wkt)(trs, wkb); }
-
- int get_data_as_wkt(String *txt) const
- { return (this->*m_vmt->get_data_as_wkt)(txt); }
-
- int get_mbr(MBR *mbr) const { return (this->*m_vmt->get_mbr)(mbr); }
- int dimension(uint32 *dim) const
- { return (this->*m_vmt->dimension)(dim); }
-
- int get_x(double *x) const { return (this->*m_vmt->get_x)(x); }
- int get_y(double *y) const { return (this->*m_vmt->get_y)(y); }
- int length(double *len) const { return (this->*m_vmt->length)(len); }
- int area(double *ar) const { return (this->*m_vmt->area)(ar); }
-
- int is_closed(int *closed) const
- { return (this->*m_vmt->is_closed)(closed); }
-
- int num_interior_ring(uint32 *n_int_rings) const
- { return (this->*m_vmt->num_interior_ring)(n_int_rings); }
- int num_points(uint32 *n_points) const
- { return (this->*m_vmt->num_points)(n_points); }
-
- int num_geometries(uint32 *num) const
- { return (this->*m_vmt->num_geometries)(num); }
-
- int start_point(String *point) const
- { return (this->*m_vmt->start_point)(point); }
- int end_point(String *point) const
- { return (this->*m_vmt->end_point)(point); }
- int exterior_ring(String *ring) const
- { return (this->*m_vmt->exterior_ring)(ring); }
- int centroid(String *point) const
- { return (this->*m_vmt->centroid)(point); }
-
- int point_n(uint32 num, String *result) const
- { return (this->*m_vmt->point_n)(num, result); }
- int interior_ring_n(uint32 num, String *result) const
- { return (this->*m_vmt->interior_ring_n)(num, result); }
- int geometry_n(uint32 num, String *result) const
- { return (this->*m_vmt->geometry_n)(num, result); }
+ virtual const Class_info *get_class_info() const=0;
+ virtual uint32 get_data_size() const=0;
+ virtual bool init_from_wkt(Gis_read_stream *trs, String *wkb)=0;
+ virtual bool get_data_as_wkt(String *txt, const char **end) const=0;
+ virtual bool get_mbr(MBR *mbr, const char **end) const=0;
+ virtual bool dimension(uint32 *dim, const char **end) const=0;
+ virtual int get_x(double *x) const { return -1; }
+ virtual int get_y(double *y) const { return -1; }
+ virtual int length(double *len) const { return -1; }
+ virtual int area(double *ar, const char **end) const { return -1;}
+ virtual int is_closed(int *closed) const { return -1; }
+ virtual int num_interior_ring(uint32 *n_int_rings) const { return -1; }
+ virtual int num_points(uint32 *n_points) const { return -1; }
+ virtual int num_geometries(uint32 *num) const { return -1; }
+ virtual int start_point(String *point) const { return -1; }
+ virtual int end_point(String *point) const { return -1; }
+ virtual int exterior_ring(String *ring) const { return -1; }
+ virtual int centroid(String *point) const { return -1; }
+ virtual int point_n(uint32 num, String *result) const { return -1; }
+ virtual int interior_ring_n(uint32 num, String *result) const { return -1; }
+ virtual int geometry_n(uint32 num, String *result) const { return -1; }
public:
- int create_from_wkb(const char *data, uint32 data_len);
- int create_from_wkt(GTextReadStream *trs, String *wkt, int init_stream=1);
- int init(int type_id)
- {
- m_vmt = find_class(type_id);
- return !m_vmt;
- }
- int new_geometry(const char *name, size_t len)
+ static Geometry *create_by_typeid(Geometry_buffer *buffer, int type_id)
{
- m_vmt = find_class(name, len);
- return !m_vmt;
+ Class_info *ci;
+ if (!(ci= find_class((int) type_id)))
+ return NULL;
+ (*ci->m_create_func)((void *)buffer);
+ return (Geometry *)buffer;
}
- int as_wkt(String *wkt) const
+ static Geometry *create_from_wkb(Geometry_buffer *buffer,
+ const char *data, uint32 data_len);
+ static Geometry *create_from_wkt(Geometry_buffer *buffer,
+ Gis_read_stream *trs, String *wkt,
+ bool init_stream=1);
+ int as_wkt(String *wkt, const char **end)
{
- if (wkt->reserve(strlen(get_class_info()->m_name) + 2, 512))
+ uint32 len= get_class_info()->m_name.length;
+ if (wkt->reserve(len + 2, 512))
return 1;
- wkt->qs_append(get_class_info()->m_name);
+ wkt->qs_append(get_class_info()->m_name.str, len);
wkt->qs_append('(');
- if (get_data_as_wkt(wkt))
+ if (get_data_as_wkt(wkt, end))
return 1;
wkt->qs_append(')');
return 0;
}
- void init_from_wkb(const char *data, uint32 data_len)
+ inline void init_from_wkb(const char *data, uint32 data_len)
{
- m_data = data;
- m_data_end = data + data_len;
+ m_data= data;
+ m_data_end= data + data_len;
}
- void shift_wkb_header()
+ inline void shift_wkb_header()
{
- m_data += WKB_HEADER_SIZE;
+ m_data+= WKB_HEADER_SIZE;
}
- int envelope(String *result) const;
+ bool envelope(String *result) const;
+ static Class_info *ci_collection[wkb_end+1];
protected:
- static GClassInfo *find_class(int type_id);
- static GClassInfo *find_class(const char *name, size_t len);
-
- bool no_data(const char *cur_data, uint32 data_amount) const
+ static Class_info *find_class(int type_id)
+ {
+ return ((type_id < wkb_point) || (type_id > wkb_end)) ?
+ NULL : ci_collection[type_id];
+ }
+ static Class_info *find_class(const char *name, uint32 len);
+ const char *append_points(String *txt, uint32 n_points,
+ const char *data, uint32 offset) const;
+ bool create_point(String *result, const char *data) const;
+ bool create_point(String *result, double x, double y) const;
+ const char *get_mbr_for_points(MBR *mbr, const char *data, uint offset)
+ const;
+
+ inline bool no_data(const char *cur_data, uint32 data_amount) const
{
return (cur_data + data_amount > m_data_end);
}
-
const char *m_data;
const char *m_data_end;
};
-#define SIZEOF_STORED_DOUBLE 8
/***************************** Point *******************************/
-class GPoint: public Geometry
+class Gis_point: public Geometry
{
public:
- size_t get_data_size() const;
- int init_from_wkt(GTextReadStream *trs, String *wkb);
- int get_data_as_wkt(String *txt) const;
- int get_mbr(MBR *mbr) const;
+ uint32 get_data_size() const;
+ bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ bool get_data_as_wkt(String *txt, const char **end) const;
+ bool get_mbr(MBR *mbr, const char **end) const;
int get_xy(double *x, double *y) const
{
- const char *data = m_data;
- if (no_data(data, SIZEOF_STORED_DOUBLE * 2)) return 1;
+ const char *data= m_data;
+ if (no_data(data, SIZEOF_STORED_DOUBLE * 2))
+ return 1;
float8get(*x, data);
float8get(*y, data + SIZEOF_STORED_DOUBLE);
return 0;
@@ -379,122 +297,166 @@ public:
int get_x(double *x) const
{
- if (no_data(m_data, SIZEOF_STORED_DOUBLE)) return 1;
+ if (no_data(m_data, SIZEOF_STORED_DOUBLE))
+ return 1;
float8get(*x, m_data);
return 0;
}
int get_y(double *y) const
{
- const char *data = m_data;
+ const char *data= m_data;
if (no_data(data, SIZEOF_STORED_DOUBLE * 2)) return 1;
float8get(*y, data + SIZEOF_STORED_DOUBLE);
return 0;
}
- int dimension(uint32 *dim) const { *dim = 0; return 0; }
+ bool dimension(uint32 *dim, const char **end) const
+ {
+ *dim= 0;
+ *end= 0; /* No default end */
+ return 0;
+ }
+ const Class_info *get_class_info() const;
};
+
/***************************** LineString *******************************/
-class GLineString: public Geometry
+class Gis_line_string: public Geometry
{
public:
- size_t get_data_size() const;
- int init_from_wkt(GTextReadStream *trs, String *wkb);
- int get_data_as_wkt(String *txt) const;
- int get_mbr(MBR *mbr) const;
-
+ uint32 get_data_size() const;
+ bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ bool get_data_as_wkt(String *txt, const char **end) const;
+ bool get_mbr(MBR *mbr, const char **end) const;
int length(double *len) const;
int is_closed(int *closed) const;
int num_points(uint32 *n_points) const;
int start_point(String *point) const;
int end_point(String *point) const;
int point_n(uint32 n, String *result) const;
- int dimension(uint32 *dim) const { *dim = 1; return 0; }
+ bool dimension(uint32 *dim, const char **end) const
+ {
+ *dim= 1;
+ *end= 0; /* No default end */
+ return 0;
+ }
+ const Class_info *get_class_info() const;
};
+
/***************************** Polygon *******************************/
-class GPolygon: public Geometry
+class Gis_polygon: public Geometry
{
public:
- size_t get_data_size() const;
- int init_from_wkt(GTextReadStream *trs, String *wkb);
- int get_data_as_wkt(String *txt) const;
- int get_mbr(MBR *mbr) const;
-
- int area(double *ar) const;
+ uint32 get_data_size() const;
+ bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ bool get_data_as_wkt(String *txt, const char **end) const;
+ bool get_mbr(MBR *mbr, const char **end) const;
+ int area(double *ar, const char **end) const;
int exterior_ring(String *result) const;
int num_interior_ring(uint32 *n_int_rings) const;
int interior_ring_n(uint32 num, String *result) const;
int centroid_xy(double *x, double *y) const;
int centroid(String *result) const;
- int dimension(uint32 *dim) const { *dim = 2; return 0; }
+ bool dimension(uint32 *dim, const char **end) const
+ {
+ *dim= 2;
+ *end= 0; /* No default end */
+ return 0;
+ }
+ const Class_info *get_class_info() const;
};
+
/***************************** MultiPoint *******************************/
-class GMultiPoint: public Geometry
+class Gis_multi_point: public Geometry
{
public:
- size_t get_data_size() const;
- int init_from_wkt(GTextReadStream *trs, String *wkb);
- int get_data_as_wkt(String *txt) const;
- int get_mbr(MBR *mbr) const;
-
+ uint32 get_data_size() const;
+ bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ bool get_data_as_wkt(String *txt, const char **end) const;
+ bool get_mbr(MBR *mbr, const char **end) const;
int num_geometries(uint32 *num) const;
int geometry_n(uint32 num, String *result) const;
- int dimension(uint32 *dim) const { *dim = 0; return 0; }
+ bool dimension(uint32 *dim, const char **end) const
+ {
+ *dim= 0;
+ *end= 0; /* No default end */
+ return 0;
+ }
+ const Class_info *get_class_info() const;
};
+
/***************************** MultiLineString *******************************/
-class GMultiLineString: public Geometry
+class Gis_multi_line_string: public Geometry
{
public:
- size_t get_data_size() const;
- int init_from_wkt(GTextReadStream *trs, String *wkb);
- int get_data_as_wkt(String *txt) const;
- int get_mbr(MBR *mbr) const;
-
+ uint32 get_data_size() const;
+ bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ bool get_data_as_wkt(String *txt, const char **end) const;
+ bool get_mbr(MBR *mbr, const char **end) const;
int num_geometries(uint32 *num) const;
int geometry_n(uint32 num, String *result) const;
int length(double *len) const;
int is_closed(int *closed) const;
- int dimension(uint32 *dim) const { *dim = 1; return 0; }
+ bool dimension(uint32 *dim, const char **end) const
+ {
+ *dim= 1;
+ *end= 0; /* No default end */
+ return 0;
+ }
+ const Class_info *get_class_info() const;
};
+
/***************************** MultiPolygon *******************************/
-class GMultiPolygon: public Geometry
+class Gis_multi_polygon: public Geometry
{
public:
- size_t get_data_size() const;
- int init_from_wkt(GTextReadStream *trs, String *wkb);
- int get_data_as_wkt(String *txt) const;
- int get_mbr(MBR *mbr) const;
-
+ uint32 get_data_size() const;
+ bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ bool get_data_as_wkt(String *txt, const char **end) const;
+ bool get_mbr(MBR *mbr, const char **end) const;
int num_geometries(uint32 *num) const;
int geometry_n(uint32 num, String *result) const;
- int area(double *ar) const;
+ int area(double *ar, const char **end) const;
int centroid(String *result) const;
- int dimension(uint32 *dim) const { *dim = 2; return 0; }
+ bool dimension(uint32 *dim, const char **end) const
+ {
+ *dim= 2;
+ *end= 0; /* No default end */
+ return 0;
+ }
+ const Class_info *get_class_info() const;
};
-/***************************** GeometryCollection *******************************/
-class GGeometryCollection: public Geometry
+/*********************** GeometryCollection *******************************/
+
+class Gis_geometry_collection: public Geometry
{
public:
- size_t get_data_size() const;
- int init_from_wkt(GTextReadStream *trs, String *wkb);
- int get_data_as_wkt(String *txt) const;
- int get_mbr(MBR *mbr) const;
-
+ uint32 get_data_size() const;
+ bool init_from_wkt(Gis_read_stream *trs, String *wkb);
+ bool get_data_as_wkt(String *txt, const char **end) const;
+ bool get_mbr(MBR *mbr, const char **end) const;
int num_geometries(uint32 *num) const;
int geometry_n(uint32 num, String *result) const;
- int dimension(uint32 *dim) const;
+ bool dimension(uint32 *dim, const char **end) const;
+ const Class_info *get_class_info() const;
+};
+
+const int geometry_buffer_size= sizeof(Gis_point);
+struct Geometry_buffer
+{
+ void *arr[(geometry_buffer_size - 1)/sizeof(void *) + 1];
};
#endif
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index d294055ff8a..ef55eaf8ec6 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -909,8 +909,8 @@ static void acl_update_user(const char *user, const char *host,
acl_user->x509_subject= (x509_subject ?
strdup_root(&mem,x509_subject) : 0);
}
-
- set_user_salt(acl_user, password, password_len);
+ if (password)
+ set_user_salt(acl_user, password, password_len);
/* search complete: */
break;
}
@@ -1195,7 +1195,8 @@ bool check_change_password(THD *thd, const char *host, const char *user)
{
if (!initialized)
{
- send_error(thd, ER_SKIP_GRANT_TABLES); /* purecov: inspected */
+ net_printf(thd,ER_OPTION_PREVENTS_STATEMENT,
+ "--skip-grant-tables"); /* purecov: inspected */
return(1); /* purecov: inspected */
}
if (!thd->slave_thread &&
@@ -1371,20 +1372,20 @@ bool hostname_requires_resolving(const char *hostname)
{
char cur;
if (!hostname)
- return false;
+ return FALSE;
int namelen= strlen(hostname);
int lhlen= strlen(my_localhost);
if ((namelen == lhlen) &&
!my_strnncoll(&my_charset_latin1, (const uchar *)hostname, namelen,
(const uchar *)my_localhost, strlen(my_localhost)))
- return false;
+ return FALSE;
for (; (cur=*hostname); hostname++)
{
if ((cur != '%') && (cur != '_') && (cur != '.') &&
((cur < '0') || (cur > '9')))
- return true;
+ return TRUE;
}
- return false;
+ return FALSE;
}
/*
@@ -1403,6 +1404,7 @@ static bool update_user_table(THD *thd, const char *host, const char *user,
bzero((char*) &tables,sizeof(tables));
tables.alias=tables.real_name=(char*) "user";
tables.db=(char*) "mysql";
+
#ifdef HAVE_REPLICATION
/*
GRANT and REVOKE are applied the slave in/exclusion rules as they are
@@ -1460,6 +1462,7 @@ static bool test_if_create_new_users(THD *thd)
bzero((char*) &tl,sizeof(tl));
tl.db= (char*) "mysql";
tl.real_name= (char*) "user";
+
db_access=acl_get(thd->host, thd->ip,
thd->priv_user, tl.db, 0);
if (!(db_access & INSERT_ACL))
@@ -1512,13 +1515,10 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
if (!create_user)
{
if (what == 'N')
- my_printf_error(ER_NONEXISTING_GRANT,ER(ER_NONEXISTING_GRANT),
- MYF(0),combo.user.str,combo.host.str);
+ my_error(ER_NONEXISTING_GRANT, MYF(0), combo.user.str, combo.host.str);
else
- my_printf_error(ER_NO_PERMISSION_TO_CREATE_USER,
- ER(ER_NO_PERMISSION_TO_CREATE_USER),
- MYF(0),thd->user,
- thd->host_or_ip);
+ my_error(ER_NO_PERMISSION_TO_CREATE_USER, MYF(0),
+ thd->user, thd->host_or_ip);
error= -1;
goto end;
}
@@ -1537,6 +1537,11 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo,
store_record(table,record[1]); // Save copy for update
if (combo.password.str) // If password given
table->field[2]->store(password, password_len, &my_charset_latin1);
+ else if (!rights && !revoke_grant && thd->lex->ssl_type == SSL_TYPE_NOT_SPECIFIED &&
+ !thd->lex->mqh.bits)
+ {
+ DBUG_RETURN(0);
+ }
}
/* Update table columns with new privileges */
@@ -1672,7 +1677,7 @@ static int replace_db_table(TABLE *table, const char *db,
if (!initialized)
{
- my_error(ER_SKIP_GRANT_TABLES, MYF(0));
+ my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables");
DBUG_RETURN(-1);
}
@@ -1692,8 +1697,7 @@ static int replace_db_table(TABLE *table, const char *db,
{
if (what == 'N')
{ // no row, no revoke
- my_printf_error(ER_NONEXISTING_GRANT,ER(ER_NONEXISTING_GRANT),MYF(0),
- combo.user.str,combo.host.str);
+ my_error(ER_NONEXISTING_GRANT, MYF(0), combo.user.str, combo.host.str);
goto abort;
}
old_row_exists = 0;
@@ -1982,9 +1986,8 @@ static int replace_column_table(GRANT_TABLE *g_t,
{
if (revoke_grant)
{
- my_printf_error(ER_NONEXISTING_TABLE_GRANT,
- ER(ER_NONEXISTING_TABLE_GRANT),MYF(0),
- combo.user.str, combo.host.str,table_name); /* purecov: inspected */
+ my_error(ER_NONEXISTING_TABLE_GRANT, MYF(0),
+ combo.user.str, combo.host.str, table_name); /* purecov: inspected */
result= -1; /* purecov: inspected */
continue; /* purecov: inspected */
}
@@ -2150,10 +2153,9 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table,
*/
if (revoke_grant)
{ // no row, no revoke
- my_printf_error(ER_NONEXISTING_TABLE_GRANT,
- ER(ER_NONEXISTING_TABLE_GRANT),MYF(0),
- combo.user.str,combo.host.str,
- table_name); /* purecov: deadcode */
+ my_error(ER_NONEXISTING_TABLE_GRANT, MYF(0),
+ combo.user.str, combo.host.str,
+ table_name); /* purecov: deadcode */
DBUG_RETURN(-1); /* purecov: deadcode */
}
old_row_exists = 0;
@@ -2253,8 +2255,9 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
if (!initialized)
{
- send_error(thd, ER_SKIP_GRANT_TABLES); /* purecov: inspected */
- DBUG_RETURN(1); /* purecov: inspected */
+ my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0),
+ "--skip-grant-tables"); /* purecov: inspected */
+ DBUG_RETURN(-1); /* purecov: inspected */
}
if (rights & ~TABLE_ACLS)
{
@@ -2272,11 +2275,13 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
DBUG_RETURN(-1);
while ((column = column_iter++))
{
+ uint unused_field_idx= NO_CACHED_FIELD_INDEX;
if (!find_field_in_table(thd,table,column->column.ptr(),
- column->column.length(),0,0))
+ column->column.length(),0,0,
+ &unused_field_idx))
{
- my_printf_error(ER_BAD_FIELD_ERROR,ER(ER_BAD_FIELD_ERROR),MYF(0),
- column->column.c_ptr(), table_list->alias);
+ my_error(ER_BAD_FIELD_ERROR, MYF(0),
+ column->column.c_ptr(), table_list->alias);
DBUG_RETURN(-1);
}
column_priv|= column->rights;
@@ -2291,7 +2296,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
fn_format(buf,buf,"","",4+16+32);
if (access(buf,F_OK))
{
- my_error(ER_NO_SUCH_TABLE,MYF(0),table_list->db, table_list->alias);
+ my_error(ER_NO_SUCH_TABLE, MYF(0), table_list->db, table_list->alias);
DBUG_RETURN(-1);
}
}
@@ -2370,9 +2375,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list,
{
if (revoke_grant)
{
- my_printf_error(ER_NONEXISTING_TABLE_GRANT,
- ER(ER_NONEXISTING_TABLE_GRANT),MYF(0),
- Str->user.str, Str->host.str, table_list->real_name);
+ my_error(ER_NONEXISTING_TABLE_GRANT, MYF(0),
+ Str->user.str, Str->host.str, table_list->real_name);
result= -1;
continue;
}
@@ -2463,7 +2467,8 @@ int mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
DBUG_ENTER("mysql_grant");
if (!initialized)
{
- my_error(ER_SKIP_GRANT_TABLES, MYF(0)); /* purecov: tested */
+ my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0),
+ "--skip-grant-tables"); /* purecov: tested */
DBUG_RETURN(-1); /* purecov: tested */
}
@@ -2542,8 +2547,7 @@ int mysql_grant(THD *thd, const char *db, List <LEX_USER> &list,
}
else
{
- my_printf_error(ER_WRONG_USAGE, ER(ER_WRONG_USAGE), MYF(0),
- "DB GRANT","GLOBAL PRIVILEGES");
+ my_error(ER_WRONG_USAGE, MYF(0), "DB GRANT", "GLOBAL PRIVILEGES");
result= -1;
}
}
@@ -2630,7 +2634,7 @@ my_bool grant_init(THD *org_thd)
do
{
GRANT_TABLE *mem_check;
- if (!(mem_check=new GRANT_TABLE(t_table,c_table)) || !mem_check->ok())
+ if (!(mem_check=new GRANT_TABLE(t_table,c_table)))
{
/* This could only happen if we are out memory */
grant_option= FALSE; /* purecov: deadcode */
@@ -2649,7 +2653,7 @@ my_bool grant_init(THD *org_thd)
}
}
- if (my_hash_insert(&column_priv_hash,(byte*) mem_check))
+ if (mem_check->ok() && my_hash_insert(&column_priv_hash,(byte*) mem_check))
{
grant_option= FALSE;
goto end_unlock;
@@ -2721,7 +2725,7 @@ void grant_reload(THD *thd)
/****************************************************************************
Check grants
- All errors are written directly to the client if command name is given !
+ All errors are written directly to the client if no_errors is given !
****************************************************************************/
bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables,
@@ -3069,8 +3073,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
LINT_INIT(acl_user);
if (!initialized)
{
- send_error(thd, ER_SKIP_GRANT_TABLES);
- DBUG_RETURN(1);
+ my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables");
+ DBUG_RETURN(-1);
}
if (lex_user->host.length > HOSTNAME_LENGTH ||
lex_user->user.length > USERNAME_LENGTH)
@@ -3093,8 +3097,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
}
if (counter == acl_users.elements)
{
- my_printf_error(ER_NONEXISTING_GRANT,ER(ER_NONEXISTING_GRANT),
- MYF(0),lex_user->user.str,lex_user->host.str);
+ my_error(ER_NONEXISTING_GRANT, MYF(0),
+ lex_user->user.str, lex_user->host.str);
DBUG_RETURN(-1);
}
@@ -3249,9 +3253,9 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
}
}
}
- db.append (" ON `",5);
- db.append(acl_db->db);
- db.append ("`.* TO '",8);
+ db.append (" ON ",4);
+ append_identifier(thd, &db, acl_db->db, strlen(acl_db->db));
+ db.append (".* TO '",7);
db.append(lex_user->user.str,lex_user->user.length);
db.append ("'@'",3);
db.append(lex_user->host.str, lex_user->host.length);
@@ -3349,11 +3353,13 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
}
}
}
- global.append(" ON `",5);
- global.append(grant_table->db);
- global.append("`.`",3);
- global.append(grant_table->tname);
- global.append("` TO '",6);
+ global.append(" ON ",4);
+ append_identifier(thd, &global, grant_table->db,
+ strlen(grant_table->db));
+ global.append('.');
+ append_identifier(thd, &global, grant_table->tname,
+ strlen(grant_table->tname));
+ global.append(" TO '",5);
global.append(lex_user->user.str,lex_user->user.length);
global.append("'@'",3);
global.append(lex_user->host.str,lex_user->host.length);
@@ -3422,7 +3428,7 @@ int open_grant_tables(THD *thd, TABLE_LIST *tables)
if (!initialized)
{
- send_error(thd, ER_SKIP_GRANT_TABLES);
+ net_printf(thd,ER_OPTION_PREVENTS_STATEMENT, "--skip-grant-tables");
DBUG_RETURN(-1);
}
diff --git a/sql/sql_acl.h b/sql/sql_acl.h
index f17c9781e8c..d2dd5b23f0d 100644
--- a/sql/sql_acl.h
+++ b/sql/sql_acl.h
@@ -36,6 +36,12 @@
#define REPL_SLAVE_ACL (1L << 19)
#define REPL_CLIENT_ACL (1L << 20)
+/*
+ don't forget to update
+ static struct show_privileges_st sys_privileges[]
+ in sql_show.cc when adding new privileges!
+*/
+
#define DB_ACLS \
(UPDATE_ACL | SELECT_ACL | INSERT_ACL | DELETE_ACL | CREATE_ACL | DROP_ACL | \
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index 9e73e06d9c6..3c9563165fe 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -225,7 +225,7 @@ bool test_if_number(NUM_INFO *info, const char *str, uint str_len)
info->decimals++;
if (str == end)
{
- info->dval = atod(begin);
+ info->dval = my_atof(begin);
return 1;
}
}
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 8f319ee645d..8e96ccad586 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -46,12 +46,12 @@ extern "C" byte *table_cache_key(const byte *record,uint *length,
return (byte*) entry->table_cache_key;
}
-void table_cache_init(void)
+bool table_cache_init(void)
{
- VOID(hash_init(&open_cache,&my_charset_bin,
- table_cache_size+16,0,0,table_cache_key,
- (hash_free_key) free_cache_entry,0));
mysql_rm_tmp_tables();
+ return hash_init(&open_cache, &my_charset_bin, table_cache_size+16,
+ 0, 0,table_cache_key,
+ (hash_free_key) free_cache_entry, 0) != 0;
}
void table_cache_free(void)
@@ -156,6 +156,7 @@ OPEN_TABLE_LIST *list_open_tables(THD *thd, const char *wild)
table_list.db= (char*) entry->table_cache_key;
table_list.real_name= entry->real_name;
table_list.grant.privilege=0;
+
if (check_table_access(thd,SELECT_ACL | EXTRA_ACL,&table_list,1))
continue;
/* need to check if we haven't already listed it */
@@ -284,8 +285,10 @@ bool close_cached_tables(THD *thd, bool if_wait_for_refresh,
if (!found)
if_wait_for_refresh=0; // Nothing to wait for
}
+#ifndef EMBEDDED_LIBRARY
if (!tables)
kill_delayed_threads();
+#endif
if (if_wait_for_refresh)
{
/*
@@ -485,13 +488,19 @@ void close_temporary_tables(THD *thd)
return;
LINT_INIT(end);
- query_buf_size= 50; // Enough for DROP ... TABLE
+ query_buf_size= 50; // Enough for DROP ... TABLE IF EXISTS
for (table=thd->temporary_tables ; table ; table=table->next)
+ /*
+ We are going to add 4 ` around the db/table names, so 1 does not look
+ enough; indeed it is enough, because table->key_length is greater (by 8,
+ because of server_id and thread_id) than db||table.
+ */
query_buf_size+= table->key_length+1;
if ((query = alloc_root(&thd->mem_root, query_buf_size)))
- end=strmov(query, "DROP /*!40005 TEMPORARY */ TABLE ");
+ // Better add "if exists", in case a RESET MASTER has been done
+ end=strmov(query, "DROP /*!40005 TEMPORARY */ TABLE IF EXISTS ");
for (table=thd->temporary_tables ; table ; table=next)
{
@@ -504,8 +513,8 @@ void close_temporary_tables(THD *thd)
Here we assume table_cache_key always starts
with \0 terminated db name
*/
- end = strxmov(end,"`",table->table_cache_key,"`",
- ".`",table->real_name,"`,", NullS);
+ end = strxmov(end,"`",table->table_cache_key,"`.`",
+ table->real_name,"`,", NullS);
}
next=table->next;
close_temporary(table);
@@ -515,6 +524,16 @@ void close_temporary_tables(THD *thd)
/* The -1 is to remove last ',' */
thd->clear_error();
Query_log_event qinfo(thd, query, (ulong)(end-query)-1, 0);
+ /*
+ Imagine the thread had created a temp table, then was doing a SELECT, and
+ the SELECT was killed. Then it's not clever to mark the statement above as
+ "killed", because it's not really a statement updating data, and there
+ are 99.99% chances it will succeed on slave.
+ If a real update (one updating a persistent table) was killed on the
+ master, then this real update will be logged with error_code=killed,
+ rightfully causing the slave to stop.
+ */
+ qinfo.error_code= 0;
mysql_bin_log.write(&qinfo);
}
thd->temporary_tables=0;
@@ -549,7 +568,7 @@ TABLE_LIST * find_table_in_list(TABLE_LIST *table,
Find real table in given list.
SYNOPSIS
- find_table_in_list()
+ find_real_table_in_list()
table - pointer to table list
db_name - data base name
table_name - table name
@@ -808,8 +827,12 @@ TABLE *open_table(THD *thd,const char *db,const char *table_name,
{
if (table->key_length == key_length &&
!memcmp(table->table_cache_key,key,key_length) &&
- !my_strcasecmp(system_charset_info,table->table_name,alias))
+ !my_strcasecmp(system_charset_info, table->table_name, alias) &&
+ table->query_id != thd->query_id)
+ {
+ table->query_id=thd->query_id;
goto reset;
+ }
}
my_printf_error(ER_TABLE_NOT_LOCKED,ER(ER_TABLE_NOT_LOCKED),MYF(0),alias);
DBUG_RETURN(0);
@@ -917,6 +940,8 @@ TABLE *open_table(THD *thd,const char *db,const char *table_name,
table->status=STATUS_NO_RECORD;
table->keys_in_use_for_query= table->keys_in_use;
table->used_keys= table->keys_for_keyread;
+ if (table->timestamp_field)
+ table->timestamp_field->set_timestamp_offsets();
DBUG_ASSERT(table->key_read == 0);
DBUG_RETURN(table);
}
@@ -1308,6 +1333,7 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
bzero((char*) &table_list, sizeof(table_list)); // just for safe
table_list.db=(char*) db;
table_list.real_name=(char*) name;
+
safe_mutex_assert_owner(&LOCK_open);
if ((error=lock_table_name(thd,&table_list)))
@@ -1342,15 +1368,47 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
error=1;
}
else
- {
thd->clear_error(); // Clear error message
- }
pthread_mutex_lock(&LOCK_open);
unlock_table_name(thd,&table_list);
if (error)
goto err;
}
+ /*
+ If we are here, there was no fatal error (but error may be still
+ unitialized).
+ */
+ if (unlikely(entry->file->implicit_emptied))
+ {
+ entry->file->implicit_emptied= 0;
+ if (mysql_bin_log.is_open())
+ {
+ char *query, *end;
+ uint query_buf_size= 20 + 2*NAME_LEN + 1;
+ if ((query= (char*)my_malloc(query_buf_size,MYF(MY_WME))))
+ {
+ end = strxmov(strmov(query, "DELETE FROM `"),
+ db,"`.`",name,"`", NullS);
+ Query_log_event qinfo(thd, query, (ulong)(end-query), 0);
+ mysql_bin_log.write(&qinfo);
+ my_free(query, MYF(0));
+ }
+ else
+ {
+ /*
+ As replication is maybe going to be corrupted, we need to warn the
+ DBA on top of warning the client (which will automatically be done
+ because of MYF(MY_WME) in my_malloc() above).
+ */
+ sql_print_error("Error: when opening HEAP table, could not allocate \
+memory to write 'DELETE FROM `%s`.`%s`' to the binary log",db,name);
+ if (entry->file)
+ closefrm(entry);
+ goto err;
+ }
+ }
+ }
DBUG_RETURN(0);
err:
DBUG_RETURN(1);
@@ -1376,10 +1434,10 @@ int open_tables(THD *thd, TABLE_LIST *start, uint *counter)
bool refresh;
int result=0;
DBUG_ENTER("open_tables");
- *counter= 0;
thd->current_tablenr= 0;
restart:
+ *counter= 0;
thd->proc_info="Opening tables";
for (tables=start ; tables ; tables=tables->next)
{
@@ -1721,7 +1779,11 @@ bool rm_temporary_table(enum db_type base, char *path)
*fn_ext(path)='\0'; // remove extension
handler *file=get_new_handler((TABLE*) 0, base);
if (file && file->delete_table(path))
+ {
error=1;
+ sql_print_error("Warning: Could not remove tmp table: '%s', error: %d",
+ path, my_errno);
+ }
delete file;
DBUG_RETURN(error);
}
@@ -1735,33 +1797,42 @@ bool rm_temporary_table(enum db_type base, char *path)
#define WRONG_GRANT (Field*) -1
Field *find_field_in_table(THD *thd,TABLE *table,const char *name,uint length,
- bool check_grants, bool allow_rowid)
+ bool check_grants, bool allow_rowid,
+ uint *cached_field_index_ptr)
{
- Field *field;
- if (table->name_hash.records)
+ Field **field_ptr, *field;
+ uint cached_field_index= *cached_field_index_ptr;
+
+ /* We assume here that table->field < NO_CACHED_FIELD_INDEX = UINT_MAX */
+ if (cached_field_index < table->fields &&
+ !my_strcasecmp(system_charset_info,
+ table->field[cached_field_index]->field_name, name))
+ field_ptr= table->field + cached_field_index;
+ else if (table->name_hash.records)
+ field_ptr= (Field**)hash_search(&table->name_hash,(byte*) name,
+ length);
+ else
{
- if ((field=(Field*) hash_search(&table->name_hash,(byte*) name,
- length)))
- goto found;
+ if (!(field_ptr= table->field))
+ return (Field *)0;
+ for (; *field_ptr; ++field_ptr)
+ if (!my_strcasecmp(system_charset_info, (*field_ptr)->field_name, name))
+ break;
+ }
+
+ if (field_ptr && *field_ptr)
+ {
+ *cached_field_index_ptr= field_ptr - table->field;
+ field= *field_ptr;
}
else
{
- Field **ptr;
- if (!(ptr=table->field))
- return (Field *)0;
- while ((field = *ptr++))
- {
- if (!my_strcasecmp(system_charset_info, field->field_name, name))
- goto found;
- }
+ if (!allow_rowid ||
+ my_strcasecmp(system_charset_info, name, "_rowid") ||
+ !(field=table->rowid_field))
+ return (Field*) 0;
}
- if (allow_rowid &&
- !my_strcasecmp(system_charset_info, name, "_rowid") &&
- (field=table->rowid_field))
- goto found;
- return (Field*) 0;
- found:
if (thd->set_query_id)
{
if (field->query_id != thd->query_id)
@@ -1788,7 +1859,7 @@ Field *find_field_in_table(THD *thd,TABLE *table,const char *name,uint length,
find_field_in_tables()
thd Pointer to current thread structure
item Field item that should be found
- tables Tables for scaning
+ tables Tables for scanning
where Table where field found will be returned via
this parameter
report_error If FALSE then do not report error if item not found
@@ -1816,6 +1887,32 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
uint length=(uint) strlen(name);
char name_buff[NAME_LEN+1];
+
+ if (item->cached_table)
+ {
+ /*
+ This shortcut is used by prepared statements. We assuming that
+ TABLE_LIST *tables is not changed during query execution (which
+ is true for all queries except RENAME but luckily RENAME doesn't
+ use fields...) so we can rely on reusing pointer to its member.
+ With this optimisation we also miss case when addition of one more
+ field makes some prepared query ambiguous and so erronous, but we
+ accept this trade off.
+ */
+ found= find_field_in_table(thd, item->cached_table->table, name, length,
+ test(item->cached_table->
+ table->grant.want_privilege),
+ 1, &(item->cached_field_index));
+
+ if (found)
+ {
+ (*where)= tables;
+ if (found == WRONG_GRANT)
+ return (Field*) 0;
+ return found;
+ }
+ }
+
if (db && lower_case_table_names)
{
/*
@@ -1840,10 +1937,12 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
Field *find=find_field_in_table(thd,tables->table,name,length,
test(tables->table->grant.
want_privilege),
- 1);
+ 1, &(item->cached_field_index));
if (find)
{
- (*where)= tables;
+ (*where)= item->cached_table= tables;
+ if (!tables->cacheable_table)
+ item->cached_table= 0;
if (find == WRONG_GRANT)
return (Field*) 0;
if (db || !thd->where)
@@ -1897,12 +1996,14 @@ find_field_in_tables(THD *thd, Item_ident *item, TABLE_LIST *tables,
Field *field=find_field_in_table(thd,tables->table,name,length,
test(tables->table->grant.want_privilege),
- allow_rowid);
+ allow_rowid, &(item->cached_field_index));
if (field)
{
if (field == WRONG_GRANT)
return (Field*) 0;
- (*where)= tables;
+ (*where)= item->cached_table= tables;
+ if (!tables->cacheable_table)
+ item->cached_table= 0;
if (found)
{
if (!thd->where) // Returns first found
@@ -1997,7 +2098,7 @@ find_item_in_list(Item *find, List<Item> &items, uint *counter,
{
if (!strcmp(item_field->table_name,table_name) &&
(!db_name || (db_name && item_field->db_name &&
- !strcmp(item_field->table_name,table_name))))
+ !strcmp(item_field->db_name, db_name))))
{
found= li.ref();
*counter= i;
@@ -2039,6 +2140,14 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields,
{
if (!wild_num)
return 0;
+ Statement *stmt= thd->current_statement, backup;
+
+ /*
+ If we are in preparing prepared statement phase then we have change
+ temporary mem_root to statement mem root to save changes of SELECT list
+ */
+ if (stmt)
+ thd->set_n_backup_item_arena(stmt, &backup);
reg2 Item *item;
List_iterator<Item> it(fields);
while ( wild_num && (item= it++))
@@ -2050,7 +2159,11 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields,
uint elem= fields.elements;
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);
return (-1);
+ }
if (sum_func_list)
{
/*
@@ -2063,6 +2176,8 @@ int setup_wild(THD *thd, TABLE_LIST *tables, List<Item> &fields,
wild_num--;
}
}
+ if (stmt)
+ thd->restore_backup_item_arena(stmt, &backup);
return 0;
}
@@ -2085,10 +2200,9 @@ int setup_fields(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
Item **ref= ref_pointer_array;
while ((item= it++))
{
- if (item->fix_fields(thd, tables, it.ref()) ||
- item->check_cols(1))
+ if (!item->fixed && item->fix_fields(thd, tables, it.ref()) ||
+ (item= *(it.ref()))->check_cols(1))
DBUG_RETURN(-1); /* purecov: inspected */
- item= *(it.ref()); //Item can be changed in fix fields
if (ref)
*(ref++)= item;
if (item->with_sum_func && item->type() != Item::SUM_FUNC_ITEM &&
@@ -2106,8 +2220,6 @@ int setup_fields(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
SYNOPSIS
setup_tables()
tables - tables list
- reinit - true if called for table reinitialization before
- subquery reexecuting
RETURN
0 ok; In this case *map will includes the choosed index
@@ -2122,7 +2234,7 @@ int setup_fields(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
table->map is not set and all Item_field will be regarded as const items.
*/
-bool setup_tables(TABLE_LIST *tables, my_bool reinit)
+bool setup_tables(TABLE_LIST *tables)
{
DBUG_ENTER("setup_tables");
uint tablenr=0;
@@ -2149,13 +2261,6 @@ bool setup_tables(TABLE_LIST *tables, my_bool reinit)
table->keys_in_use_for_query.subtract(map);
}
table->used_keys.intersect(table->keys_in_use_for_query);
- if ((table_list->shared || table->clear_query_id) && !reinit)
- {
- table->clear_query_id= 0;
- /* Clear query_id that may have been set by previous select */
- for (Field **ptr=table->field ; *ptr ; ptr++)
- (*ptr)->query_id=0;
- }
}
if (tablenr > MAX_TABLES)
{
@@ -2231,14 +2336,29 @@ insert_fields(THD *thd,TABLE_LIST *tables, const char *db_name,
DBUG_RETURN(-1);
#endif
Field **ptr=table->field,*field;
+ TABLE *natural_join_table= 0;
+
thd->used_tables|=table->map;
+ if (!table->outer_join &&
+ tables->natural_join &&
+ !tables->natural_join->table->outer_join)
+ natural_join_table= tables->natural_join->table;
+
while ((field = *ptr++))
{
- Item_field *item= new Item_field(field);
- if (!found++)
- (void) it->replace(item); // Replace '*'
- else
- it->after(item);
+ uint not_used_field_index= NO_CACHED_FIELD_INDEX;
+ /* Skip duplicate field names if NATURAL JOIN is used */
+ if (!natural_join_table ||
+ !find_field_in_table(thd, natural_join_table, field->field_name,
+ strlen(field->field_name), 0, 0,
+ &not_used_field_index))
+ {
+ Item_field *item= new Item_field(thd, field);
+ if (!found++)
+ (void) it->replace(item); // Replace '*'
+ else
+ it->after(item);
+ }
/*
Mark if field used before in this select.
Used by 'insert' to verify if a field name is used twice
@@ -2270,6 +2390,8 @@ insert_fields(THD *thd,TABLE_LIST *tables, const char *db_name,
int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
{
table_map not_null_tables= 0;
+ Statement *stmt= thd->current_statement, backup;
+
DBUG_ENTER("setup_conds");
thd->set_query_id=1;
@@ -2277,11 +2399,13 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
if (*conds)
{
thd->where="where clause";
- if ((*conds)->fix_fields(thd, tables, conds) || (*conds)->check_cols(1))
+ if (!(*conds)->fixed && (*conds)->fix_fields(thd, tables, conds) ||
+ (*conds)->check_cols(1))
DBUG_RETURN(1);
not_null_tables= (*conds)->not_null_tables();
}
+
/* Check if we are using outer joins */
for (TABLE_LIST *table=tables ; table ; table=table->next)
{
@@ -2289,7 +2413,9 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
{
/* Make a join an a expression */
thd->where="on clause";
- if (table->on_expr->fix_fields(thd, tables, &table->on_expr) ||
+
+ if (!table->on_expr->fixed &&
+ table->on_expr->fix_fields(thd, tables, &table->on_expr) ||
table->on_expr->check_cols(1))
DBUG_RETURN(1);
thd->lex->current_select->cond_count++;
@@ -2303,58 +2429,98 @@ int setup_conds(THD *thd,TABLE_LIST *tables,COND **conds)
!(specialflag & SPECIAL_NO_NEW_FUNC)))
{
table->outer_join= 0;
- if (!(*conds=and_conds(*conds, table->on_expr)))
- DBUG_RETURN(1);
+ if (stmt)
+ thd->set_n_backup_item_arena(stmt, &backup);
+ *conds= and_conds(*conds, table->on_expr);
table->on_expr=0;
+ if (stmt)
+ thd->restore_backup_item_arena(stmt, &backup);
+ if ((*conds) && !(*conds)->fixed &&
+ (*conds)->fix_fields(thd, tables, conds))
+ DBUG_RETURN(1);
}
}
if (table->natural_join)
{
+ if (stmt)
+ thd->set_n_backup_item_arena(stmt, &backup);
/* Make a join of all fields with have the same name */
- TABLE *t1=table->table;
- TABLE *t2=table->natural_join->table;
- Item_cond_and *cond_and=new Item_cond_and();
+ TABLE *t1= table->table;
+ TABLE *t2= table->natural_join->table;
+ Item_cond_and *cond_and= new Item_cond_and();
if (!cond_and) // If not out of memory
- DBUG_RETURN(1);
+ goto err;
cond_and->top_level_item();
- uint i,j;
- for (i=0 ; i < t1->fields ; i++)
+ Field **t1_field, *t2_field;
+ for (t1_field= t1->field; (*t1_field); t1_field++)
{
- // TODO: This could be optimized to use hashed names if t2 had a hash
- for (j=0 ; j < t2->fields ; j++)
- {
- if (!my_strcasecmp(system_charset_info,
- t1->field[i]->field_name,
- t2->field[j]->field_name))
- {
- Item_func_eq *tmp=new Item_func_eq(new Item_field(t1->field[i]),
- new Item_field(t2->field[j]));
- if (!tmp)
- DBUG_RETURN(1);
- tmp->fix_length_and_dec(); // Update cmp_type
- tmp->const_item_cache=0;
- /* Mark field used for table cache */
- t1->field[i]->query_id=t2->field[j]->query_id=thd->query_id;
- cond_and->list.push_back(tmp);
- t1->used_keys.intersect(t1->field[i]->part_of_key);
- t2->used_keys.intersect(t2->field[j]->part_of_key);
- break;
- }
- }
+ const char *t1_field_name= (*t1_field)->field_name;
+ uint not_used_field_index= NO_CACHED_FIELD_INDEX;
+
+ if ((t2_field= find_field_in_table(thd, t2, t1_field_name,
+ strlen(t1_field_name), 0, 0,
+ &not_used_field_index)))
+ {
+ Item_func_eq *tmp=new Item_func_eq(new Item_field(*t1_field),
+ new Item_field(t2_field));
+ if (!tmp)
+ goto err;
+ /* Mark field used for table cache */
+ (*t1_field)->query_id= t2_field->query_id= thd->query_id;
+ cond_and->list.push_back(tmp);
+ t1->used_keys.intersect((*t1_field)->part_of_key);
+ t2->used_keys.intersect(t2_field->part_of_key);
+ }
}
- cond_and->used_tables_cache= t1->map | t2->map;
thd->lex->current_select->cond_count+= cond_and->list.elements;
+
+ // to prevent natural join processing during PS re-execution
+ table->natural_join= 0;
+
if (!table->outer_join) // Not left join
{
- if (!(*conds=and_conds(*conds, cond_and)))
- DBUG_RETURN(1);
+ *conds= and_conds(*conds, cond_and);
+ // fix_fields() should be made with temporary memory pool
+ if (stmt)
+ thd->restore_backup_item_arena(stmt, &backup);
+ if (*conds && !(*conds)->fixed)
+ {
+ if ((*conds)->fix_fields(thd, tables, conds))
+ DBUG_RETURN(1);
+ }
}
else
- table->on_expr=and_conds(table->on_expr,cond_and);
+ {
+ table->on_expr= and_conds(table->on_expr, cond_and);
+ // fix_fields() should be made with temporary memory pool
+ if (stmt)
+ thd->restore_backup_item_arena(stmt, &backup);
+ if (table->on_expr && !table->on_expr->fixed)
+ {
+ if (table->on_expr->fix_fields(thd, tables, &table->on_expr))
+ DBUG_RETURN(1);
+ }
+ }
}
}
+
+ if (stmt)
+ {
+ /*
+ We are in prepared statement preparation code => we should store
+ WHERE clause changing for next executions.
+
+ We do this ON -> WHERE transformation only once per PS statement.
+ */
+ thd->lex->current_select->where= *conds;
+ }
DBUG_RETURN(test(thd->net.report_error));
+
+err:
+ if (stmt)
+ thd->restore_backup_item_arena(stmt, &backup);
+ DBUG_RETURN(1);
}
@@ -2378,7 +2544,7 @@ fill_record(List<Item> &fields,List<Item> &values, bool ignore_errors)
TABLE *table= rfield->table;
if (rfield == table->next_number_field)
table->auto_increment_field_not_null= true;
- if (value->save_in_field(rfield, 0) > 0 && !ignore_errors)
+ if ((value->save_in_field(rfield, 0) < 0) && !ignore_errors)
DBUG_RETURN(1);
}
DBUG_RETURN(0);
@@ -2399,7 +2565,7 @@ fill_record(Field **ptr,List<Item> &values, bool ignore_errors)
TABLE *table= field->table;
if (field == table->next_number_field)
table->auto_increment_field_not_null= true;
- if (value->save_in_field(field, 0) == 1 && !ignore_errors)
+ if ((value->save_in_field(field, 0) < 0) && !ignore_errors)
DBUG_RETURN(1);
}
DBUG_RETURN(0);
@@ -2550,7 +2716,8 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name,
if (table->db_stat)
result=1;
/* Kill delayed insert threads */
- if (in_use->system_thread && ! in_use->killed)
+ if ((in_use->system_thread & SYSTEM_THREAD_DELAYED_INSERT) &&
+ ! in_use->killed)
{
in_use->killed= THD::KILL_CONNECTION;
pthread_mutex_lock(&in_use->mysys_var->mutex);
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index fd5c339a6ff..cc3d6fec9ae 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -601,7 +601,6 @@ void query_cache_insert(NET *net, const char *packet, ulong length)
if (!query_cache.append_result_data(&result, length, (gptr) packet,
query_block))
{
- query_cache.refused++;
DBUG_PRINT("warning", ("Can't append data"));
header->result(result);
DBUG_PRINT("qcache", ("free query 0x%lx", (ulong) query_block));
@@ -781,7 +780,9 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used)
flags.character_set_client_num=
thd->variables.character_set_client->number;
flags.character_set_results_num=
- thd->variables.character_set_results->number;
+ (thd->variables.character_set_results ?
+ thd->variables.character_set_results->number :
+ UINT_MAX);
flags.collation_connection_num=
thd->variables.collation_connection->number;
flags.limit= thd->variables.select_limit;
@@ -796,6 +797,7 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used)
if (ask_handler_allowance(thd, tables_used))
{
+ refused++;
STRUCT_UNLOCK(&structure_guard_mutex);
DBUG_VOID_RETURN;
}
@@ -884,7 +886,7 @@ void Query_cache::store_query(THD *thd, TABLE_LIST *tables_used)
DBUG_PRINT("qcache", ("Another thread process same query"));
}
}
- else
+ else if (thd->lex->sql_command == SQLCOM_SELECT)
statistic_increment(refused, &structure_guard_mutex);
end:
@@ -970,7 +972,9 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
1 : 0);
flags.character_set_client_num= thd->variables.character_set_client->number;
flags.character_set_results_num=
- thd->variables.character_set_results->number;
+ (thd->variables.character_set_results ?
+ thd->variables.character_set_results->number :
+ UINT_MAX);
flags.collation_connection_num= thd->variables.collation_connection->number;
flags.limit= thd->variables.select_limit;
memcpy((void *)(sql + (tot_length - QUERY_CACHE_FLAGS_SIZE)),
@@ -1029,7 +1033,6 @@ Query_cache::send_result_to_client(THD *thd, char *sql, uint query_length)
DBUG_PRINT("qcache",
("probably no SELECT access to %s.%s => return to normal processing",
table_list.db, table_list.alias));
- refused++; // This is actually a hit
STRUCT_UNLOCK(&structure_guard_mutex);
thd->lex->safe_to_cache_query=0; // Don't try to cache this
BLOCK_UNLOCK_RD(query_block);
@@ -1163,6 +1166,37 @@ void Query_cache::invalidate(CHANGED_TABLE_LIST *tables_used)
DBUG_VOID_RETURN;
}
+
+/*
+ Invalidate locked for write
+
+ SYNOPSIS
+ Query_cache::invalidate_locked_for_write()
+ tables_used - table list
+
+ NOTE
+ can be used only for opened tables
+*/
+void Query_cache::invalidate_locked_for_write(TABLE_LIST *tables_used)
+{
+ DBUG_ENTER("Query_cache::invalidate (changed table list)");
+ if (query_cache_size > 0 && tables_used)
+ {
+ STRUCT_LOCK(&structure_guard_mutex);
+ if (query_cache_size > 0)
+ {
+ DUMP(this);
+ for (; tables_used; tables_used= tables_used->next)
+ {
+ if (tables_used->lock_type & (TL_WRITE_LOW_PRIORITY | TL_WRITE))
+ invalidate_table(tables_used->table);
+ }
+ }
+ STRUCT_UNLOCK(&structure_guard_mutex);
+ }
+ DBUG_VOID_RETURN;
+}
+
/*
Remove all cached queries that uses the given table
*/
@@ -1654,6 +1688,12 @@ void Query_cache::free_query(Query_cache_block *query_block)
*/
if (result_block != 0)
{
+ if (result_block->type != Query_cache_block::RESULT)
+ {
+ // removing unfinished query
+ refused++;
+ inserts--;
+ }
Query_cache_block *block = result_block;
do
{
@@ -1662,6 +1702,12 @@ void Query_cache::free_query(Query_cache_block *query_block)
free_memory_block(current);
} while (block != result_block);
}
+ else
+ {
+ // removing unfinished query
+ refused++;
+ inserts--;
+ }
query->unlock_n_destroy();
free_memory_block(query_block);
@@ -1819,11 +1865,11 @@ my_bool Query_cache::write_result_data(Query_cache_block **result_block,
{
// It is success (nobody can prevent us write data)
STRUCT_UNLOCK(&structure_guard_mutex);
- byte *rest = (byte*) data;
- Query_cache_block *block = *result_block;
uint headers_len = (ALIGN_SIZE(sizeof(Query_cache_block)) +
ALIGN_SIZE(sizeof(Query_cache_result)));
#ifndef EMBEDDED_LIBRARY
+ Query_cache_block *block= *result_block;
+ byte *rest= (byte*) data;
// Now fill list of blocks that created by allocate_data_chain
do
{
@@ -2567,20 +2613,15 @@ TABLE_COUNTER_TYPE Query_cache::is_cacheable(THD *thd, uint32 query_len,
tables_used->db, tables_used->table->db_type));
*tables_type|= tables_used->table->file->table_cache_type();
+ /*
+ table_alias_charset used here because it depends of
+ lower_case_table_names variable
+ */
if (tables_used->table->db_type == DB_TYPE_MRG_ISAM ||
tables_used->table->tmp_table != NO_TMP_TABLE ||
(tables_used->db_length == 5 &&
-#ifdef FN_NO_CASE_SENCE
- my_strnncoll(system_charset_info, (uchar*)tables_used->db, 6,
- (uchar*)"mysql",6) == 0
-#else
- tables_used->db[0]=='m' &&
- tables_used->db[1]=='y' &&
- tables_used->db[2]=='s' &&
- tables_used->db[3]=='q' &&
- tables_used->db[4]=='l'
-#endif
- ))
+ my_strnncoll(table_alias_charset, (uchar*)tables_used->db, 6,
+ (uchar*)"mysql",6) == 0))
{
DBUG_PRINT("qcache",
("select not cacheable: used MRG_ISAM, temporary or system table(s)"));
diff --git a/sql/sql_cache.h b/sql/sql_cache.h
index ac4f465bf79..432c7659aa5 100644
--- a/sql/sql_cache.h
+++ b/sql/sql_cache.h
@@ -375,6 +375,7 @@ protected:
void invalidate(THD* thd, TABLE_LIST *tables_used,
my_bool using_transactions);
void invalidate(CHANGED_TABLE_LIST *tables_used);
+ void invalidate_locked_for_write(TABLE_LIST *tables_used);
void invalidate(THD* thd, TABLE *table, my_bool using_transactions);
void invalidate(THD *thd, const char *key, uint32 key_length,
my_bool using_transactions);
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 635e6807516..f8b2efe911c 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -86,7 +86,7 @@ extern "C" void free_user_var(user_var_entry *entry)
** Thread specific functions
****************************************************************************/
-THD::THD():user_time(0), is_fatal_error(0),
+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), spcont(NULL)
@@ -150,6 +150,7 @@ THD::THD():user_time(0), is_fatal_error(0),
init();
/* Initialize sub structures */
+ clear_alloc_root(&transaction.mem_root);
init_alloc_root(&warn_root, WARN_ALLOC_BLOCK_SIZE, WARN_ALLOC_PREALLOC_SIZE);
user_connect=(USER_CONN *)0;
hash_init(&user_vars, system_charset_info, USER_VARS_HASH_SIZE, 0, 0,
@@ -176,7 +177,11 @@ THD::THD():user_time(0), is_fatal_error(0),
tablespace_op=FALSE;
#ifdef USING_TRANSACTIONS
bzero((char*) &transaction,sizeof(transaction));
- if (opt_using_transactions)
+ /*
+ Binlog is always open (if needed) before a THD is created (including
+ bootstrap).
+ */
+ if (opt_using_transactions && mysql_bin_log.is_open())
{
if (open_cached_file(&transaction.trans_log,
mysql_tmpdir, LOG_PREFIX, binlog_cache_size,
@@ -185,14 +190,8 @@ THD::THD():user_time(0), is_fatal_error(0),
transaction.trans_log.end_of_file= max_binlog_cache_size;
}
#endif
- /*
- We need good random number initialization for new thread
- Just coping global one will not work
- */
{
- pthread_mutex_lock(&LOCK_thread_count);
- ulong tmp=(ulong) (my_rnd(&sql_rand) * 0xffffffff); /* make all bits random */
- pthread_mutex_unlock(&LOCK_thread_count);
+ ulong tmp=sql_rnd_with_mutex();
randominit(&rand, tmp + (ulong) &rand, tmp + (ulong) ::query_id);
}
}
@@ -351,7 +350,7 @@ THD::~THD()
dbug_sentry= THD_SENTRY_GONE;
#endif
/* Reset stmt_backup.mem_root to not double-free memory from thd.mem_root */
- init_alloc_root(&stmt_backup.mem_root, 0, 0);
+ clear_alloc_root(&stmt_backup.mem_root);
DBUG_VOID_RETURN;
}
@@ -661,6 +660,8 @@ bool select_send::send_data(List<Item> &items)
}
}
thd->sent_row_count++;
+ if (!thd->net.vio)
+ DBUG_RETURN(0);
if (!thd->net.report_error)
DBUG_RETURN(protocol->write());
DBUG_RETURN(1);
@@ -1195,8 +1196,12 @@ int select_dumpvar::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
else
{
Item_func_set_user_var *xx = new Item_func_set_user_var(mv->s, item);
+ /*
+ Item_func_set_user_var can't substitute something else on its place =>
+ 0 can be passed as last argument (reference on item)
+ */
xx->fix_fields(thd, (TABLE_LIST*) thd->lex->select_lex.table_list.first,
- &item);
+ 0);
xx->fix_length_and_dec();
vars.push_back(xx);
}
@@ -1211,10 +1216,8 @@ int select_dumpvar::prepare(List<Item> &list, SELECT_LEX_UNIT *u)
Statement::Statement(THD *thd)
:id(++thd->statement_id_counter),
- query_id(thd->query_id),
set_query_id(1),
allow_sum_func(0),
- command(thd->command),
lex(&main_lex),
query(0),
query_length(0),
@@ -1233,10 +1236,8 @@ Statement::Statement(THD *thd)
Statement::Statement()
:id(0),
- query_id(0), /* initialized later */
set_query_id(1),
allow_sum_func(0), /* initialized later */
- command(COM_SLEEP), /* initialized later */
lex(&main_lex),
query(0), /* these two are set */
query_length(0), /* in alloc_query() */
@@ -1255,18 +1256,35 @@ Statement::Type Statement::type() const
void Statement::set_statement(Statement *stmt)
{
id= stmt->id;
- query_id= stmt->query_id;
set_query_id= stmt->set_query_id;
allow_sum_func= stmt->allow_sum_func;
- command= stmt->command;
lex= stmt->lex;
query= stmt->query;
query_length= stmt->query_length;
- free_list= stmt->free_list;
- mem_root= stmt->mem_root;
}
+void Statement::set_n_backup_item_arena(Statement *set, Statement *backup)
+{
+ backup->set_item_arena(this);
+ set_item_arena(set);
+}
+
+
+void Statement::restore_backup_item_arena(Statement *set, Statement *backup)
+{
+ set->set_item_arena(this);
+ set_item_arena(backup);
+ // reset backup mem_root to avoid its freeing
+ init_alloc_root(&backup->mem_root, 0, 0);
+}
+
+void Statement::set_item_arena(Statement *set)
+{
+ mem_root= set->mem_root;
+ free_list= set->free_list;
+}
+
Statement::~Statement()
{
free_root(&mem_root, MYF(0));
diff --git a/sql/sql_class.h b/sql/sql_class.h
index b7ef30b4e79..fd1ebca9d9e 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -217,6 +217,7 @@ public:
typedef struct st_copy_info {
ha_rows records;
ha_rows deleted;
+ ha_rows updated;
ha_rows copied;
ha_rows error_count;
enum enum_duplicates handle_duplicates;
@@ -374,6 +375,7 @@ struct system_variables
ulong max_length_for_sort_data;
ulong max_sort_length;
ulong max_tmp_tables;
+ ulong max_insert_delayed_threads;
ulong myisam_repair_threads;
ulong myisam_sort_buff_size;
ulong net_buffer_length;
@@ -409,6 +411,7 @@ struct system_variables
my_bool log_warnings;
my_bool low_priority_updates;
my_bool new_mode;
+ my_bool query_cache_wlock_invalidate;
my_bool old_passwords;
/* Only charset part of these variables is sensible */
@@ -450,7 +453,7 @@ class Statement
public:
/* FIXME: must be private */
LEX main_lex;
-public:
+
/*
Uniquely identifies each statement object in thread scope; change during
statement lifetime. FIXME: must be const
@@ -458,15 +461,6 @@ public:
ulong id;
/*
- Id of current query. Statement can be reused to execute several queries
- query_id is global in context of the whole MySQL server.
- ID is automatically generated from mutex-protected counter.
- It's used in handler code for various purposes: to check which columns
- from table are necessary for this select, to check if it's necessary to
- update auto-updatable fields (like auto_increment and timestamp).
- */
- ulong query_id;
- /*
- if set_query_id=1, we set field->query_id for all fields. In that case
field list can not contain duplicates.
*/
@@ -484,11 +478,6 @@ public:
See item_sum.cc for details.
*/
bool allow_sum_func;
- /*
- Type of current query: COM_PREPARE, COM_QUERY, etc. Set from
- first byte of the packet in do_command()
- */
- enum enum_server_command command;
LEX *lex; // parse tree descriptor
/*
@@ -499,7 +488,7 @@ public:
char *query;
uint32 query_length; // current query length
/*
- List of items created in the parser for this query. Every item puts
+ List of items created in the parser for this query. Every item puts
itself to the list on creation (see Item::Item() for details))
*/
Item *free_list;
@@ -526,6 +515,32 @@ public:
void set_statement(Statement *stmt);
/* return class type */
virtual Type type() const;
+
+ inline gptr alloc(unsigned int size) { return alloc_root(&mem_root,size); }
+ inline gptr calloc(unsigned int size)
+ {
+ gptr ptr;
+ if ((ptr=alloc_root(&mem_root,size)))
+ bzero((char*) ptr,size);
+ return ptr;
+ }
+ inline char *strdup(const char *str)
+ { return strdup_root(&mem_root,str); }
+ inline char *strmake(const char *str, uint size)
+ { return strmake_root(&mem_root,str,size); }
+ inline char *memdup(const char *str, uint size)
+ { return memdup_root(&mem_root,str,size); }
+ inline char *memdup_w_gap(const char *str, uint size, uint gap)
+ {
+ gptr ptr;
+ if ((ptr=alloc_root(&mem_root,size+gap)))
+ memcpy(ptr,str,size);
+ return ptr;
+ }
+
+ void set_n_backup_item_arena(Statement *set, Statement *backup);
+ void restore_backup_item_arena(Statement *set, Statement *backup);
+ void set_item_arena(Statement *set);
};
@@ -676,11 +691,16 @@ public:
points to a lock object if the lock is present. See item_func.cc and
chapter 'Miscellaneous functions', for functions GET_LOCK, RELEASE_LOCK.
*/
- ULL *ull;
+ User_level_lock *ull;
#ifndef DBUG_OFF
uint dbug_sentry; // watch out for memory corruption
#endif
struct st_my_thread_var *mysys_var;
+ /*
+ Type of current query: COM_PREPARE, COM_QUERY, etc. Set from
+ first byte of the packet in do_command()
+ */
+ enum enum_server_command command;
uint32 server_id;
uint32 file_id; // for LOAD DATA INFILE
/*
@@ -695,7 +715,7 @@ public:
delayed_insert *di;
my_bool tablespace_op; /* This is TRUE in DISCARD/IMPORT TABLESPACE */
struct st_transactions {
- IO_CACHE trans_log;
+ IO_CACHE trans_log; // Inited ONLY if binlog is open !
THD_TRANS all; // Trans since BEGIN WORK
THD_TRANS stmt; // Trans for current statement
uint bdb_lock_count;
@@ -721,6 +741,10 @@ public:
Vio* active_vio;
#endif
/*
+ Current prepared Statement if there one, or 0
+ */
+ Statement *current_statement;
+ /*
next_insert_id is set on SET INSERT_ID= #. This is used as the next
generated auto_increment value in handler.cc
*/
@@ -752,6 +776,15 @@ public:
List <MYSQL_ERROR> warn_list;
uint warn_count[(uint) MYSQL_ERROR::WARN_LEVEL_END];
uint total_warn_count;
+ /*
+ Id of current query. Statement can be reused to execute several queries
+ query_id is global in context of the whole MySQL server.
+ ID is automatically generated from mutex-protected counter.
+ It's used in handler code for various purposes: to check which columns
+ from table are necessary for this select, to check if it's necessary to
+ update auto-updatable fields (like auto_increment and timestamp).
+ */
+ ulong query_id;
ulong warn_id, version, options, thread_id, col_access;
/* Statement id is thread-wide. This counter is used to generate ids */
@@ -896,34 +929,14 @@ public:
return 0;
#endif
}
- inline gptr alloc(unsigned int size) { return alloc_root(&mem_root,size); }
- inline gptr calloc(unsigned int size)
- {
- gptr ptr;
- if ((ptr=alloc_root(&mem_root,size)))
- bzero((char*) ptr,size);
- return ptr;
- }
- inline char *strdup(const char *str)
- { return strdup_root(&mem_root,str); }
- inline char *strmake(const char *str, uint size)
- { return strmake_root(&mem_root,str,size); }
- inline char *memdup(const char *str, uint size)
- { return memdup_root(&mem_root,str,size); }
- inline char *memdup_w_gap(const char *str, uint size, uint gap)
- {
- gptr ptr;
- if ((ptr=alloc_root(&mem_root,size+gap)))
- memcpy(ptr,str,size);
- return ptr;
- }
- bool convert_string(LEX_STRING *to, CHARSET_INFO *to_cs,
- const char *from, uint from_length,
- CHARSET_INFO *from_cs);
inline gptr trans_alloc(unsigned int size)
{
return alloc_root(&transaction.mem_root,size);
}
+
+ bool convert_string(LEX_STRING *to, CHARSET_INFO *to_cs,
+ const char *from, uint from_length,
+ CHARSET_INFO *from_cs);
void add_changed_table(TABLE *table);
void add_changed_table(const char *key, long key_length);
CHANGED_TABLE_LIST * changed_table_dup(const char *key, long key_length);
@@ -946,6 +959,33 @@ public:
}
inline CHARSET_INFO *charset() { return variables.character_set_client; }
void update_charset();
+
+ inline void allocate_temporary_memory_pool_for_ps_preparing()
+ {
+ DBUG_ASSERT(current_statement!=0);
+ /*
+ We do not want to have in PS memory all that junk,
+ which will be created by preparation => substitute memory
+ from original thread pool.
+
+ We know that PS memory pool is now copied to THD, we move it back
+ to allow some code use it.
+ */
+ current_statement->set_item_arena(this);
+ init_sql_alloc(&mem_root,
+ variables.query_alloc_block_size,
+ variables.query_prealloc_size);
+ free_list= 0;
+ }
+ inline void free_temporary_memory_pool_for_ps_preparing()
+ {
+ DBUG_ASSERT(current_statement!=0);
+ cleanup_items(current_statement->free_list);
+ free_items(free_list);
+ close_thread_tables(this); // to close derived tables
+ free_root(&mem_root, MYF(0));
+ set_item_arena(current_statement);
+ }
};
/* Flags for the THD::system_thread (bitmap) variable */
@@ -1055,8 +1095,9 @@ class select_insert :public select_result {
ulonglong last_insert_id;
COPY_INFO info;
- select_insert(TABLE *table_par,List<Item> *fields_par,enum_duplicates duplic)
- :table(table_par),fields(fields_par), last_insert_id(0)
+ select_insert(TABLE *table_par, List<Item> *fields_par,
+ enum_duplicates duplic)
+ :table(table_par), fields(fields_par), last_insert_id(0)
{
bzero((char*) &info,sizeof(info));
info.handle_duplicates=duplic;
@@ -1081,11 +1122,11 @@ class select_create: public select_insert {
MYSQL_LOCK *lock;
Field **field;
public:
- select_create (const char *db_name, const char *table_name,
- HA_CREATE_INFO *create_info_par,
- List<create_field> &fields_par,
- List<Key> &keys_par,
- List<Item> &select_fields,enum_duplicates duplic)
+ select_create(const char *db_name, const char *table_name,
+ HA_CREATE_INFO *create_info_par,
+ List<create_field> &fields_par,
+ List<Key> &keys_par,
+ List<Item> &select_fields,enum_duplicates duplic)
:select_insert (NULL, &select_fields, duplic), db(db_name),
name(table_name), extra_fields(&fields_par),keys(&keys_par),
create_info(create_info_par), lock(0)
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 54265b58bd4..ce92fa7ff90 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -59,9 +59,9 @@ static bool write_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create)
if ((file=my_create(path, CREATE_MODE,O_RDWR | O_TRUNC,MYF(MY_WME))) >= 0)
{
ulong length;
- CHARSET_INFO *cs= (create && create->default_table_charset) ?
- create->default_table_charset :
- thd->variables.collation_server;
+ CHARSET_INFO *cs= ((create && create->default_table_charset) ?
+ create->default_table_charset :
+ thd->variables.collation_server);
length= my_sprintf(buf,(buf,
"default-character-set=%s\ndefault-collation=%s\n",
cs->csname,cs->name));
@@ -117,10 +117,12 @@ bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create)
{
if (!strncmp(buf,"default-character-set", (pos-buf)))
{
- if (!(create->default_table_charset= get_charset_by_csname(pos+1,
- MY_CS_PRIMARY,
- MYF(0))))
+ if (!(create->default_table_charset=
+ get_charset_by_csname(pos+1,
+ MY_CS_PRIMARY,
+ MYF(0))))
{
+ sql_print_error("Error while loading database options: '%s':",path);
sql_print_error(ER(ER_UNKNOWN_CHARACTER_SET),pos+1);
}
}
@@ -129,6 +131,7 @@ bool load_db_opt(THD *thd, const char *path, HA_CREATE_INFO *create)
if (!(create->default_table_charset= get_charset_by_name(pos+1,
MYF(0))))
{
+ sql_print_error("Error while loading database options: '%s':",path);
sql_print_error(ER(ER_UNKNOWN_COLLATION),pos+1);
}
}
@@ -164,9 +167,9 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
bool silent)
{
char path[FN_REFLEN+16];
- MY_DIR *dirp;
long result=1;
int error = 0;
+ MY_STAT stat_info;
uint create_options = create_info ? create_info->options : 0;
DBUG_ENTER("mysql_create_db");
@@ -180,12 +183,12 @@ int mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info,
}
/* Check directory */
- (void)sprintf(path,"%s/%s", mysql_data_home, db);
+ strxmov(path, mysql_data_home, "/", db, NullS);
unpack_dirname(path,path); // Convert if not unix
- if ((dirp = my_dir(path,MYF(MY_DONT_SORT))))
+
+ if (my_stat(path,&stat_info,MYF(MY_WME)))
{
- my_dirend(dirp);
- if (!(create_options & HA_LEX_CREATE_IF_NOT_EXISTS))
+ if (!(create_options & HA_LEX_CREATE_IF_NOT_EXISTS))
{
my_error(ER_DB_CREATE_EXISTS,MYF(0),db);
error = -1;
@@ -306,11 +309,19 @@ exit2:
/*
- Drop all tables in a database.
+ Drop all tables in a database and the database itself
- db-name is already validated when we come here
- If thd == 0, do not write any messages; This is useful in replication
- when we want to remove a stale database before replacing it with the new one
+ SYNOPSIS
+ mysql_rm_db()
+ thd Thread handle
+ db Database name in the case given by user
+ It's already validated when we come here
+ if_exists Don't give error if database doesn't exists
+ silent Don't generate errors
+
+ RETURN
+ 0 ok (Database dropped)
+ -1 Error generated
*/
@@ -318,7 +329,7 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
{
long deleted=0;
int error = 0;
- char path[FN_REFLEN+16];
+ char path[FN_REFLEN+16], tmp_db[NAME_LEN+1];
MY_DIR *dirp;
DBUG_ENTER("mysql_rm_db");
@@ -350,6 +361,14 @@ int mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent)
}
goto exit;
}
+ if (lower_case_table_names)
+ {
+ /* Convert database to lower case */
+ strmov(tmp_db, db);
+ my_casedn_str(system_charset_info, tmp_db);
+ db= tmp_db;
+ }
+
pthread_mutex_lock(&LOCK_open);
remove_db_from_cache(db);
pthread_mutex_unlock(&LOCK_open);
@@ -425,7 +444,7 @@ exit2:
/*
Removes files with known extensions plus all found subdirectories that
- are 2 digits (raid directories).
+ are 2 hex digits (raid directories).
thd MUST be set when calling this function!
*/
@@ -447,88 +466,83 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
idx++)
{
FILEINFO *file=dirp->dir_entry+idx;
+ char *extension;
DBUG_PRINT("info",("Examining: %s", file->name));
/* Check if file is a raid directory */
- if (my_isdigit(&my_charset_latin1,file->name[0]) &&
- my_isdigit(&my_charset_latin1,file->name[1]) &&
+ if ((my_isdigit(&my_charset_latin1, file->name[0]) ||
+ (file->name[0] >= 'a' && file->name[0] <= 'f')) &&
+ (my_isdigit(&my_charset_latin1, file->name[1]) ||
+ (file->name[1] >= 'a' && file->name[1] <= 'f')) &&
!file->name[2] && !level)
{
- char newpath[FN_REFLEN];
+ char newpath[FN_REFLEN], *copy_of_path;
MY_DIR *new_dirp;
String *dir;
+ uint length;
strxmov(newpath,org_path,"/",file->name,NullS);
- unpack_filename(newpath,newpath);
+ length= unpack_filename(newpath,newpath);
if ((new_dirp = my_dir(newpath,MYF(MY_DONT_SORT))))
{
DBUG_PRINT("my",("New subdir found: %s", newpath));
if ((mysql_rm_known_files(thd, new_dirp, NullS, newpath,1)) < 0)
- {
- my_dirend(dirp);
- DBUG_RETURN(-1);
- }
- raid_dirs.push_back(dir=new String(newpath, &my_charset_latin1));
- dir->copy();
+ goto err;
+ if (!(copy_of_path= thd->memdup(newpath, length+1)) ||
+ !(dir= new (&thd->mem_root) String(copy_of_path, length,
+ &my_charset_bin)) ||
+ raid_dirs.push_back(dir))
+ goto err;
continue;
}
found_other_files++;
continue;
}
- if (find_type(fn_ext(file->name),&deletable_extentions,1+2) <= 0)
+ extension= fn_ext(file->name);
+ if (find_type(extension, &deletable_extentions,1+2) <= 0)
{
- if (find_type(fn_ext(file->name),&known_extentions,1+2) <= 0)
+ if (find_type(extension, &known_extentions,1+2) <= 0)
found_other_files++;
continue;
}
- strxmov(filePath,org_path,"/",file->name,NullS);
- if (db && !my_strcasecmp(&my_charset_latin1,
- fn_ext(file->name), reg_ext))
+ // just for safety we use files_charset_info
+ if (db && !my_strcasecmp(files_charset_info,
+ extension, reg_ext))
{
/* Drop the table nicely */
- *fn_ext(file->name)=0; // Remove extension
+ *extension= 0; // Remove extension
TABLE_LIST *table_list=(TABLE_LIST*)
thd->calloc(sizeof(*table_list)+ strlen(db)+strlen(file->name)+2);
if (!table_list)
- {
- my_dirend(dirp);
- DBUG_RETURN(-1);
- }
+ goto err;
table_list->db= (char*) (table_list+1);
- strmov(table_list->real_name=strmov(table_list->db,db)+1,
- file->name);
+ strmov(table_list->real_name= strmov(table_list->db,db)+1, file->name);
+ table_list->alias= table_list->real_name; // If lower_case_table_names=2
/* Link into list */
(*tot_list_next)= table_list;
tot_list_next= &table_list->next;
+ deleted++;
}
else
{
-
+ strxmov(filePath, org_path, "/", file->name, NullS);
if (my_delete_with_symlink(filePath,MYF(MY_WME)))
{
- my_dirend(dirp);
- DBUG_RETURN(-1);
+ goto err;
}
- deleted++;
}
}
- List_iterator<String> it(raid_dirs);
- String *dir;
-
if (thd->killed ||
(tot_list && mysql_rm_table_part2_with_lock(thd, tot_list, 1, 0, 1)))
+ goto err;
+
+ /* Remove RAID directories */
{
- /* Free memory for allocated raid dirs */
+ List_iterator<String> it(raid_dirs);
+ String *dir;
while ((dir= it++))
- delete dir;
- my_dirend(dirp);
- DBUG_RETURN(-1);
- }
- while ((dir= it++))
- {
- if (rmdir(dir->c_ptr()) < 0)
- found_other_files++;
- delete dir;
+ if (rmdir(dir->c_ptr()) < 0)
+ found_other_files++;
}
my_dirend(dirp);
@@ -539,7 +553,8 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
if (!found_other_files)
{
char tmp_path[FN_REFLEN], *pos;
- char *path=unpack_filename(tmp_path,org_path);
+ char *path= tmp_path;
+ unpack_filename(tmp_path,org_path);
#ifdef HAVE_READLINK
int error;
@@ -576,6 +591,10 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
}
}
DBUG_RETURN(deleted);
+
+err:
+ my_dirend(dirp);
+ DBUG_RETURN(-1);
}
@@ -606,13 +625,13 @@ bool mysql_change_db(THD *thd, const char *name)
HA_CREATE_INFO create;
DBUG_ENTER("mysql_change_db");
- if (!dbname || !(db_length=strip_sp(dbname)))
+ if (!dbname || !(db_length= strlen(dbname)))
{
x_free(dbname); /* purecov: inspected */
send_error(thd,ER_NO_DB_ERROR); /* purecov: inspected */
DBUG_RETURN(1); /* purecov: inspected */
}
- if ((db_length > NAME_LEN) || check_db_name(dbname))
+ if (check_db_name(dbname))
{
net_printf(thd, ER_WRONG_DB_NAME, dbname);
x_free(dbname);
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 7ebe9cb6002..ad6de901f56 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -194,6 +194,8 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, SQL_LIST *order,
else
table->file->unlock_row(); // Row failed selection, release lock on it
}
+ if (thd->killed && !error)
+ error= 1; // Aborted
thd->proc_info="end";
end_read_record(&info);
free_io_cache(table); // Will not do any harm
@@ -376,7 +378,7 @@ bool multi_delete::send_data(List<Item> &values)
table->status|= STATUS_DELETED;
if (!(error=table->file->delete_row(table->record[0])))
deleted++;
- else if (!table_being_deleted->next)
+ else if (!table_being_deleted->next || table_being_deleted->table->file->has_transactions())
{
table->file->print_error(error,MYF(0));
DBUG_RETURN(1);
@@ -395,6 +397,7 @@ bool multi_delete::send_data(List<Item> &values)
DBUG_RETURN(0);
}
+
void multi_delete::send_error(uint errcode,const char *err)
{
DBUG_ENTER("multi_delete::send_error");
@@ -484,6 +487,8 @@ int multi_delete::do_deletes(bool from_send_error)
deleted++;
}
end_read_record(&info);
+ if (thd->killed && !local_error)
+ local_error= 1;
if (local_error == -1) // End of file
local_error = 0;
}
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index d0ed71ecfdd..4a9bf3f1348 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -115,7 +115,6 @@ static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
TABLE *table;
int res;
select_union *derived_result;
- TABLE_LIST *tables= (TABLE_LIST *)first_select->table_list.first;
bool is_union= first_select->next_select() &&
first_select->next_select()->linkage == UNION_TYPE;
bool is_subsel= first_select->first_inner_unit() ? 1: 0;
@@ -138,7 +137,7 @@ static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
*/
if (!(table= create_tmp_table(thd, &derived_result->tmp_table_param,
unit->types, (ORDER*) 0,
- is_union && !unit->union_option, 1,
+ is_union && unit->union_distinct, 1,
(first_select->options | thd->options |
TMP_TABLE_ALL_COLUMNS),
HA_POS_ERROR,
@@ -151,7 +150,11 @@ static int mysql_derived(THD *thd, LEX *lex, SELECT_LEX_UNIT *unit,
if (is_union)
- res= mysql_union(thd, lex, derived_result, unit);
+ {
+ // execute union without clean up
+ if (!(res= unit->prepare(thd, derived_result, SELECT_NO_UNLOCK)))
+ res= unit->exec();
+ }
else
{
unit->set_limit(first_select, first_select);
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 897aa37ba11..1579ac3b5c8 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -35,7 +35,7 @@
But !!! do_command calls free_root at the end of every query and frees up
all the sql_alloc'ed memory. It's harder to work around...
- */
+*/
#define HANDLER_TABLES_HACK(thd) { \
TABLE *tmp=thd->open_tables; \
@@ -207,11 +207,13 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
MYF(0),keyinfo->key_parts);
goto err;
}
- List_iterator_fast<Item> it_ke(*key_expr);
+ List_iterator<Item> it_ke(*key_expr);
Item *item;
for (key_len=0 ; (item=it_ke++) ; key_part++)
{
- if (item->fix_fields(thd, tables, &item))
+ // 'item' can be changed by fix_fields() call
+ if (item->fix_fields(thd, tables, it_ke.ref()) ||
+ (item= *it_ke.ref())->check_cols(1))
goto err;
if (item->used_tables() & ~RAND_TABLE_BIT)
{
@@ -287,14 +289,13 @@ static TABLE **find_table_ptr_by_name(THD *thd, const char *db,
int dblen;
TABLE **ptr;
- if (!db || ! *db)
- db= thd->db ? thd->db : "";
- dblen=strlen(db)+1;
+ DBUG_ASSERT(db);
+ dblen= strlen(db);
ptr= &(thd->handler_tables);
for (TABLE *table= *ptr; table ; table= *ptr)
{
- if (!memcmp(table->table_cache_key, db, dblen) &&
+ if ((db == any_db || !memcmp(table->table_cache_key, db, dblen)) &&
!my_strcasecmp(system_charset_info,
(is_alias ? table->table_name : table->real_name),
table_name))
diff --git a/sql/sql_help.cc b/sql/sql_help.cc
index 3c98b7b0bb4..44293b8214f 100644
--- a/sql/sql_help.cc
+++ b/sql/sql_help.cc
@@ -140,7 +140,7 @@ void memorize_variant_topic(THD *thd, TABLE *topics, int count,
{
if (count == 1)
names->push_back(name);
- String *new_name= new String;
+ String *new_name= new (&thd->mem_root) String;
get_field(mem_root,find_fields[help_topic_name].field,new_name);
names->push_back(new_name);
}
@@ -391,7 +391,7 @@ int search_categories(THD *thd, TABLE *categories,
{
if (select && !select->cond->val_int())
continue;
- String *lname= new String;
+ String *lname= new (&thd->mem_root) String;
get_field(&thd->mem_root,pfname,lname);
if (++count == 1 && res_id)
*res_id= (int16) pcat_id->val_int();
@@ -425,7 +425,7 @@ void get_all_items_for_category(THD *thd, TABLE *items, Field *pfname,
{
if (!select->cond->val_int())
continue;
- String *name= new String();
+ String *name= new (&thd->mem_root) String();
get_field(&thd->mem_root,pfname,name);
res->push_back(name);
}
@@ -659,20 +659,17 @@ int mysqld_help(THD *thd, const char *mask)
bzero((gptr)tables,sizeof(tables));
tables[0].alias= tables[0].real_name= (char*) "help_topic";
tables[0].lock_type= TL_READ;
- tables[0].db= (char*) "mysql";
tables[0].next= &tables[1];
tables[1].alias= tables[1].real_name= (char*) "help_category";
tables[1].lock_type= TL_READ;
- tables[1].db= (char*) "mysql";
tables[1].next= &tables[2];
tables[2].alias= tables[2].real_name= (char*) "help_relation";
tables[2].lock_type= TL_READ;
- tables[2].db= (char*) "mysql";
tables[2].next= &tables[3];
tables[3].alias= tables[3].real_name= (char*) "help_keyword";
tables[3].lock_type= TL_READ;
- tables[3].db= (char*) "mysql";
tables[3].next= 0;
+ tables[0].db= tables[1].db= tables[2].db= tables[3].db= (char*) "mysql";
List<String> topics_list, categories_list, subcategories_list;
String name, description, example;
@@ -686,7 +683,7 @@ int mysqld_help(THD *thd, const char *mask)
goto end;
}
/* Init tables and fields to be usable from items */
- setup_tables(tables, 0);
+ setup_tables(tables);
memcpy((char*) used_fields, (char*) init_used_fields, sizeof(used_fields));
if (init_fields(thd, tables, used_fields, array_elements(used_fields)))
{
@@ -731,27 +728,30 @@ int mysqld_help(THD *thd, const char *mask)
&categories_list,&category_id);
if (!count_categories)
{
- if (send_header_2(protocol,false))
+ if (send_header_2(protocol,FALSE))
goto end;
}
else if (count_categories > 1)
{
- if (send_header_2(protocol,false) ||
+ if (send_header_2(protocol,FALSE) ||
send_variant_2_list(mem_root,protocol,&categories_list,"Y",0))
goto end;
}
else
{
Field *topic_cat_id= used_fields[help_topic_help_category_id].field;
- Item *cond_topic_by_cat= new Item_func_equal(new Item_field(topic_cat_id),
- new Item_int((int32)category_id));
- Item *cond_cat_by_cat= new Item_func_equal(new Item_field(cat_cat_id),
- new Item_int((int32)category_id));
+ Item *cond_topic_by_cat=
+ new Item_func_equal(new Item_field(topic_cat_id),
+ new Item_int((int32)category_id));
+ Item *cond_cat_by_cat=
+ new Item_func_equal(new Item_field(cat_cat_id),
+ new Item_int((int32)category_id));
if (!(select_topics_by_cat= prepare_simple_select(thd,cond_topic_by_cat,
tables,tables[0].table,
&error)) ||
- !(select_cat_by_cat= prepare_simple_select(thd,cond_cat_by_cat,tables,
- tables[1].table,&error)))
+ !(select_cat_by_cat=
+ prepare_simple_select(thd,cond_cat_by_cat,tables,
+ tables[1].table,&error)))
{
res= -1;
goto end;
@@ -777,7 +777,7 @@ int mysqld_help(THD *thd, const char *mask)
else
{
/* First send header and functions */
- if (send_header_2(protocol, false) ||
+ if (send_header_2(protocol, FALSE) ||
send_variant_2_list(mem_root,protocol, &topics_list, "N", 0))
goto end;
search_categories(thd, tables[1].table, used_fields,
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 3a7e2a8d285..3e1a41ed049 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -21,12 +21,14 @@
#include "sql_acl.h"
static int check_null_fields(THD *thd,TABLE *entry);
+#ifndef EMBEDDED_LIBRARY
static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list);
static int write_delayed(THD *thd,TABLE *table, enum_duplicates dup,
char *query, uint query_length, bool log_on);
static void end_delayed_insert(THD *thd);
extern "C" pthread_handler_decl(handle_delayed_insert,arg);
static void unlink_blobs(register TABLE *table);
+#endif
/* Define to force use of my_malloc() if the allocated memory block is big */
@@ -39,9 +41,9 @@ static void unlink_blobs(register TABLE *table);
#endif
/*
- Check if insert fields are correct
- Updates table->time_stamp to point to timestamp field or 0, depending on
- if timestamp should be updated or not.
+ Check if insert fields are correct.
+ Sets table->timestamp_default_now/on_update_now to 0 o leaves it to point
+ to timestamp field, depending on if timestamp should be updated or not.
*/
int
@@ -62,7 +64,7 @@ check_insert_fields(THD *thd,TABLE *table,List<Item> &fields,
check_grant_all_columns(thd,INSERT_ACL,table))
return -1;
#endif
- table->time_stamp=0; // This is saved by caller
+ table->timestamp_default_now= table->timestamp_on_update_now= 0;
}
else
{ // Part field list
@@ -81,18 +83,18 @@ check_insert_fields(THD *thd,TABLE *table,List<Item> &fields,
table_list.grant=table->grant;
thd->dupp_field=0;
- if (setup_tables(&table_list, 0) ||
+ if (setup_tables(&table_list) ||
setup_fields(thd, 0, &table_list,fields,1,0,0))
return -1;
+
if (thd->dupp_field)
{
my_error(ER_FIELD_SPECIFIED_TWICE,MYF(0), thd->dupp_field->field_name);
return -1;
}
- table->time_stamp=0;
if (table->timestamp_field && // Don't set timestamp if used
- table->timestamp_field->query_id != thd->query_id)
- table->time_stamp= table->timestamp_field->offset()+1;
+ table->timestamp_field->query_id == thd->query_id)
+ table->timestamp_default_now= table->timestamp_on_update_now= 0;
}
// For the values we need select_priv
#ifndef NO_EMBEDDED_ACCESS_CHECKS
@@ -109,7 +111,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
List<Item> &update_values,
enum_duplicates duplic)
{
- int error;
+ int error, res;
/*
log_on is about delayed inserts only.
By default, both logs are enabled (this won't cause problems if the server
@@ -124,7 +126,9 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
TABLE *table;
List_iterator_fast<List_item> its(values_list);
List_item *values;
- char *query=thd->query;
+#ifndef EMBEDDED_LIBRARY
+ char *query= thd->query;
+#endif
thr_lock_type lock_type = table_list->lock_type;
TABLE_LIST *insert_table_list= (TABLE_LIST*)
thd->lex->select_lex.table_list.first;
@@ -135,15 +139,20 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
if we are told to replace duplicates, the insert cannot be concurrent
delayed insert changed to regular in slave thread
*/
+#ifdef EMBEDDED_LIBRARY
+ if (lock_type == TL_WRITE_DELAYED)
+ lock_type=TL_WRITE;
+#else
if ((lock_type == TL_WRITE_DELAYED &&
((specialflag & (SPECIAL_NO_NEW_FUNC | SPECIAL_SAFE_MODE)) ||
- thd->slave_thread || !max_insert_delayed_threads)) ||
+ thd->slave_thread || !thd->variables.max_insert_delayed_threads)) ||
(lock_type == TL_WRITE_CONCURRENT_INSERT && duplic == DUP_REPLACE) ||
(duplic == DUP_UPDATE))
lock_type=TL_WRITE;
+#endif
table_list->lock_type= lock_type;
- int res;
+#ifndef EMBEDDED_LIBRARY
if (lock_type == TL_WRITE_DELAYED)
{
if (thd->locked_tables)
@@ -172,6 +181,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
}
}
else
+#endif /* EMBEDDED_LIBRARY */
res= open_and_lock_tables(thd, table_list);
if (res)
DBUG_RETURN(-1);
@@ -191,7 +201,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
}
if (check_insert_fields(thd,table,fields,*values,1) ||
- setup_tables(insert_table_list, 0) ||
+ setup_tables(insert_table_list) ||
setup_fields(thd, 0, insert_table_list, *values, 0, 0, 0) ||
(duplic == DUP_UPDATE &&
(setup_fields(thd, 0, insert_table_list, update_fields, 0, 0, 0) ||
@@ -223,7 +233,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
Fill in the given fields and dump it to the table file
*/
- info.records=info.deleted=info.copied=0;
+ info.records= info.deleted= info.copied= info.updated= 0;
info.handle_duplicates=duplic;
info.update_fields=&update_fields;
info.update_values=&update_values;
@@ -289,12 +299,14 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
break;
}
}
+#ifndef EMBEDDED_LIBRARY
if (lock_type == TL_WRITE_DELAYED)
{
error=write_delayed(thd,table,duplic,query, thd->query_length, log_on);
query=0;
}
else
+#endif
error=write_record(table,&info);
if (error)
break;
@@ -315,6 +327,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
Now all rows are inserted. Time to update logs and sends response to
user
*/
+#ifndef EMBEDDED_LIBRARY
if (lock_type == TL_WRITE_DELAYED)
{
if (!error)
@@ -326,6 +339,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
query_cache_invalidate3(thd, table_list, 1);
}
else
+#endif
{
if (bulk_insert)
{
@@ -356,7 +370,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
For the transactional algorithm to work the invalidation must be
before binlog writing and ha_autocommit_...
*/
- if (info.copied || info.deleted)
+ if (info.copied || info.deleted || info.updated)
{
query_cache_invalidate3(thd, table_list, 1);
}
@@ -364,7 +378,8 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
transactional_table= table->file->has_transactions();
log_delayed= (transactional_table || table->tmp_table);
- if ((info.copied || info.deleted) && (error <= 0 || !transactional_table))
+ if ((info.copied || info.deleted || info.updated) &&
+ (error <= 0 || !transactional_table))
{
if (mysql_bin_log.is_open())
{
@@ -404,7 +419,7 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
goto abort;
if (values_list.elements == 1 && (!(thd->options & OPTION_WARNINGS) ||
!thd->cuted_fields))
- send_ok(thd,info.copied+info.deleted,id);
+ send_ok(thd,info.copied+info.deleted+info.updated,id);
else
{
char buff[160];
@@ -414,16 +429,18 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
(ulong) (info.records - info.copied), (ulong) thd->cuted_fields);
else
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
- (ulong) info.deleted, (ulong) thd->cuted_fields);
- ::send_ok(thd,info.copied+info.deleted,(ulonglong)id,buff);
+ (ulong) info.deleted+info.updated, (ulong) thd->cuted_fields);
+ ::send_ok(thd,info.copied+info.deleted+info.updated,(ulonglong)id,buff);
}
free_underlaid_joins(thd, &thd->lex->select_lex);
table->insert_values=0;
DBUG_RETURN(0);
abort:
+#ifndef EMBEDDED_LIBRARY
if (lock_type == TL_WRITE_DELAYED)
end_delayed_insert(thd);
+#endif
free_underlaid_joins(thd, &thd->lex->select_lex);
table->insert_values=0;
DBUG_RETURN(-1);
@@ -517,12 +534,22 @@ int write_record(TABLE *table,COPY_INFO *info)
goto err;
if ((error=table->file->update_row(table->record[1],table->record[0])))
goto err;
- info->deleted++;
+ info->updated++;
break;
}
else /* DUP_REPLACE */
{
- if (last_uniq_key(table,key_nr))
+ /*
+ The manual defines the REPLACE semantics that it is either
+ an INSERT or DELETE(s) + INSERT; FOREIGN KEY checks in
+ InnoDB do not function in the defined way if we allow MySQL
+ to convert the latter operation internally to an UPDATE.
+ We also should not perform this conversion if we have
+ timestamp field with ON UPDATE which is different from DEFAULT.
+ */
+ if (last_uniq_key(table,key_nr) &&
+ !table->file->referenced_by_foreign_key() &&
+ table->timestamp_default_now == table->timestamp_on_update_now)
{
if ((error=table->file->update_row(table->record[1],
table->record[0])))
@@ -588,6 +615,8 @@ static int check_null_fields(THD *thd __attribute__((unused)),
A thread is created for each table that one uses with the DELAYED attribute.
*****************************************************************************/
+#ifndef EMBEDDED_LIBRARY
+
class delayed_row :public ilink {
public:
char *record,*query;
@@ -595,7 +624,8 @@ public:
time_t start_time;
bool query_start_used,last_insert_id_used,insert_id_used, log_query;
ulonglong last_insert_id;
- ulong time_stamp;
+ ulong timestamp_default_now;
+ ulong timestamp_on_update_now;
uint query_length;
delayed_row(enum_duplicates dup_arg, bool log_query_arg)
@@ -729,7 +759,7 @@ static TABLE *delayed_get_table(THD *thd,TABLE_LIST *table_list)
if (!(tmp=find_handler(thd,table_list)))
{
/* Don't create more than max_insert_delayed_threads */
- if (delayed_insert_threads >= max_insert_delayed_threads)
+ if (delayed_insert_threads >= thd->variables.max_insert_delayed_threads)
DBUG_RETURN(0);
thd->proc_info="Creating delayed handler";
pthread_mutex_lock(&LOCK_delayed_create);
@@ -875,6 +905,7 @@ TABLE *delayed_insert::get_local_table(THD* client_thd)
{
if (!(*field= (*org_field)->new_field(&client_thd->mem_root,copy)))
return 0;
+ (*field)->orig_table= copy; // Remove connection
(*field)->move_field(adjust_ptrs); // Point at copy->record[0]
if (*org_field == found_next_number_field)
(*field)->table->found_next_number_field= *field;
@@ -885,9 +916,10 @@ TABLE *delayed_insert::get_local_table(THD* client_thd)
if (table->timestamp_field)
{
/* Restore offset as this may have been reset in handle_inserts */
- copy->time_stamp=table->timestamp_field->offset()+1;
copy->timestamp_field=
(Field_timestamp*) copy->field[table->timestamp_field_offset];
+ copy->timestamp_field->unireg_check= table->timestamp_field->unireg_check;
+ copy->timestamp_field->set_timestamp_offsets();
}
/* _rowid is not used with delayed insert */
@@ -938,7 +970,8 @@ static int write_delayed(THD *thd,TABLE *table,enum_duplicates duplic,
row->last_insert_id_used= thd->last_insert_id_used;
row->insert_id_used= thd->insert_id_used;
row->last_insert_id= thd->last_insert_id;
- row->time_stamp= table->time_stamp;
+ row->timestamp_default_now= table->timestamp_default_now;
+ row->timestamp_on_update_now= table->timestamp_on_update_now;
di->rows.push_back(row);
di->stacked_inserts++;
@@ -1277,7 +1310,8 @@ bool delayed_insert::handle_inserts(void)
thd.last_insert_id=row->last_insert_id;
thd.last_insert_id_used=row->last_insert_id_used;
thd.insert_id_used=row->insert_id_used;
- table->time_stamp=row->time_stamp;
+ table->timestamp_default_now= row->timestamp_default_now;
+ table->timestamp_on_update_now= row->timestamp_on_update_now;
info.handle_duplicates= row->dup;
if (info.handle_duplicates == DUP_IGNORE ||
@@ -1310,8 +1344,15 @@ bool delayed_insert::handle_inserts(void)
pthread_mutex_lock(&mutex);
delete row;
- /* Let READ clients do something once in a while */
- if (group_count++ == max_rows)
+ /*
+ Let READ clients do something once in a while
+ We should however not break in the middle of a multi-line insert
+ if we have binary logging enabled as we don't want other commands
+ on this table until all entries has been processed
+ */
+ if (group_count++ >= max_rows && (row= rows.head()) &&
+ (!(row->log_query & DELAYED_LOG_BIN && using_bin_log) ||
+ row->query))
{
group_count=0;
if (stacked_inserts || tables_in_use) // Let these wait a while
@@ -1368,8 +1409,7 @@ bool delayed_insert::handle_inserts(void)
pthread_mutex_lock(&mutex);
DBUG_RETURN(1);
}
-
-
+#endif /* EMBEDDED_LIBRARY */
/***************************************************************************
Store records in INSERT ... SELECT *
@@ -1454,7 +1494,8 @@ void select_insert::send_error(uint errcode,const char *err)
error while inserting into a MyISAM table) we must write to the binlog (and
the error code will make the slave stop).
*/
- if ((info.copied || info.deleted) && !table->file->has_transactions())
+ if ((info.copied || info.deleted || info.updated) &&
+ !table->file->has_transactions())
{
if (last_insert_id)
thd->insert_id(last_insert_id); // For binary log
@@ -1467,7 +1508,7 @@ void select_insert::send_error(uint errcode,const char *err)
if (!table->tmp_table)
thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
}
- if (info.copied || info.deleted)
+ if (info.copied || info.deleted || info.updated)
{
query_cache_invalidate3(thd, table, 1);
}
@@ -1490,7 +1531,7 @@ bool select_insert::send_eof()
and ha_autocommit_...
*/
- if (info.copied || info.deleted)
+ if (info.copied || info.deleted || info.updated)
{
query_cache_invalidate3(thd, table, 1);
if (!(table->file->has_transactions() || table->tmp_table))
@@ -1523,8 +1564,8 @@ bool select_insert::send_eof()
(ulong) (info.records - info.copied), (ulong) thd->cuted_fields);
else
sprintf(buff, ER(ER_INSERT_INFO), (ulong) info.records,
- (ulong) info.deleted, (ulong) thd->cuted_fields);
- ::send_ok(thd,info.copied+info.deleted,last_insert_id,buff);
+ (ulong) info.deleted+info.updated, (ulong) thd->cuted_fields);
+ ::send_ok(thd,info.copied+info.deleted+info.updated,last_insert_id,buff);
DBUG_RETURN(0);
}
@@ -1539,8 +1580,8 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
DBUG_ENTER("select_create::prepare");
unit= u;
- table=create_table_from_items(thd, create_info, db, name,
- extra_fields, keys, &values, &lock);
+ table= create_table_from_items(thd, create_info, db, name,
+ extra_fields, keys, &values, &lock);
if (!table)
DBUG_RETURN(-1); // abort() deletes table
@@ -1555,11 +1596,9 @@ select_create::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
/* First field to copy */
field=table->field+table->fields - values.elements;
- if (table->timestamp_field) // Don't set timestamp if used
- {
- table->timestamp_field->set_time();
- table->time_stamp=0; // This should be saved
- }
+ /* Don't set timestamp if used */
+ table->timestamp_default_now= table->timestamp_on_update_now= 0;
+
table->next_number_field=table->found_next_number_field;
restore_record(table,default_values); // Get empty record
@@ -1645,7 +1684,9 @@ void select_create::abort()
#ifdef __GNUC__
template class List_iterator_fast<List_item>;
+#ifndef EMBEDDED_LIBRARY
template class I_List<delayed_insert>;
template class I_List_iterator<delayed_insert>;
template class I_List<delayed_row>;
-#endif
+#endif /* EMBEDDED_LIBRARY */
+#endif /* __GNUC__ */
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 1b2457724de..071e41b1247 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -678,16 +678,15 @@ int yylex(void *arg, void *yythd)
yylval->lex_str= get_token(lex,yyLength());
return(result_state);
- case MY_LEX_USER_VARIABLE_DELIMITER:
+ case MY_LEX_USER_VARIABLE_DELIMITER: // Found quote char
{
uint double_quotes= 0;
char quote_char= c; // Used char
lex->tok_start=lex->ptr; // Skip first `
while ((c=yyGet()))
- {
-#ifdef USE_MB
- if (my_mbcharlen(cs, c) == 1)
-#endif
+ {
+ int length;
+ if ((length= my_mbcharlen(cs, c)) == 1)
{
if (c == (uchar) NAMES_SEP_CHAR)
break; /* Old .frm format can't handle this char */
@@ -701,15 +700,9 @@ int yylex(void *arg, void *yythd)
}
}
#ifdef USE_MB
- else
- {
- int l;
- if ((l = my_ismbchar(cs,
- (const char *)lex->ptr-1,
- (const char *)lex->end_of_query)) == 0)
- break;
- lex->ptr += l-1;
- }
+ else if (length < 1)
+ break; // Error
+ lex->ptr+= length-1;
#endif
}
if (double_quotes)
@@ -994,13 +987,14 @@ void st_select_lex_unit::init_query()
global_parameters= first_select();
select_limit_cnt= HA_POS_ERROR;
offset_limit_cnt= 0;
- union_option= 0;
+ union_distinct= 0;
prepared= optimized= executed= 0;
item= 0;
union_result= 0;
table= 0;
fake_select_lex= 0;
cleaned= 0;
+ item_list.empty();
found_rows_for_union= 0;
}
@@ -1319,8 +1313,8 @@ bool st_select_lex_unit::create_total_list(THD *thd_arg, st_lex *lex,
DESCRIPTION
This is used for UNION & subselect to create a new table list of all used
tables.
- The table_list->table entry in all used tables are set to point
- to the entries in this list.
+ The table_list->table_list in all tables of global list are set to point
+ to the local SELECT_LEX entries.
RETURN
0 - OK
@@ -1371,33 +1365,22 @@ create_total_list_n_last_return(THD *thd_arg,
{
TABLE_LIST *cursor;
next_table= aux->next;
- for (cursor= **result_arg; cursor; cursor= cursor->next)
- if (!strcmp(cursor->db, aux->db) &&
- !strcmp(cursor->real_name, aux->real_name) &&
- !strcmp(cursor->alias, aux->alias))
- break;
- if (!cursor)
+ /* Add to the total table list */
+ if (!(cursor= (TABLE_LIST *) thd->memdup((char*) aux,
+ sizeof(*aux))))
{
- /* Add not used table to the total table list */
- if (!(cursor= (TABLE_LIST *) thd->memdup((char*) aux,
- sizeof(*aux))))
- {
- send_error(thd,0);
- return 1;
- }
- *new_table_list= cursor;
- cursor->table_list= aux; //to be able mark this table as shared
- new_table_list= &cursor->next;
- *new_table_list= 0; // end result list
+ send_error(thd,0);
+ return 1;
}
- else
- // Mark that it's used twice
- cursor->table_list->shared= aux->shared= 1;
+ *new_table_list= cursor;
+ cursor->table_list= aux;
+ new_table_list= &cursor->next;
+ *new_table_list= 0; // end result list
aux->table_list= cursor;
}
}
}
-end:
+
if (slave_list_first)
{
*new_table_list= slave_list_first;
@@ -1509,11 +1492,17 @@ bool st_select_lex::setup_ref_array(THD *thd, uint order_group_num)
{
if (ref_pointer_array)
return 0;
+
+ /*
+ We have to create array in prepared statement memory if it is
+ prepared statement
+ */
+ Statement *stmt= thd->current_statement ? thd->current_statement : thd;
return (ref_pointer_array=
- (Item **)thd->alloc(sizeof(Item*) *
- (item_list.elements +
- select_n_having_items +
- order_group_num)* 5)) == 0;
+ (Item **)stmt->alloc(sizeof(Item*) *
+ (item_list.elements +
+ select_n_having_items +
+ order_group_num)* 5)) == 0;
}
@@ -1575,7 +1564,7 @@ void st_select_lex_unit::print(String *str)
if (sl != first_select())
{
str->append(" union ", 7);
- if (union_option & UNION_ALL)
+ if (!union_distinct)
str->append("all ", 4);
}
if (sl->braces)
@@ -1616,8 +1605,9 @@ void st_select_lex::print_limit(THD *thd, String *str)
if (!thd)
thd= current_thd;
- if (select_limit != thd->variables.select_limit ||
- select_limit != HA_POS_ERROR ||
+ if ((select_limit != thd->variables.select_limit &&
+ this == &thd->lex->select_lex) ||
+ (select_limit != HA_POS_ERROR && this != &thd->lex->select_lex) ||
offset_limit != 0L)
{
str->append(" limit ", 7);
@@ -1656,7 +1646,11 @@ void st_select_lex_unit::set_limit(SELECT_LEX *values,
/*
There are st_select_lex::add_table_to_list &
- st_select_lex::set_lock_for_tables in sql_parse.cc
+ st_select_lex::set_lock_for_tables are in sql_parse.cc
st_select_lex::print is in sql_select.h
+
+ st_select_lex_unit::prepare, st_select_lex_unit::exec,
+ st_select_lex_unit::cleanup, st_select_lex_unit::reinit_exec_mechanism
+ are in sql_union.cc
*/
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 43d9b013239..7a5a1c13f80 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -347,7 +347,7 @@ public:
/* fake SELECT_LEX for union processing */
st_select_lex *fake_select_lex;
- uint union_option;
+ st_select_lex *union_distinct; /* pointer to the last UNION DISTINCT */
void init_query();
bool create_total_list(THD *thd, st_lex *lex, TABLE_LIST **result);
@@ -367,6 +367,8 @@ public:
int prepare(THD *thd, select_result *result, ulong additional_options);
int exec();
int cleanup();
+ inline void unclean() { cleaned= 0; }
+ void reinit_exec_mechanism();
bool check_updateable(char *db, char *table);
void print(String *str);
@@ -409,6 +411,7 @@ public:
SQL_LIST order_list; /* ORDER clause */
List<List_item> expr_list;
List<List_item> when_list; /* WHEN clause (expression) */
+ SQL_LIST *gorder_list;
ha_rows select_limit, offset_limit; /* LIMIT clause parameters */
// Arrays of pointers to top elements of all_fields list
Item **ref_pointer_array;
@@ -553,13 +556,12 @@ typedef struct st_lex
String *wild;
sql_exchange *exchange;
select_result *result;
- Item *default_value;
+ Item *default_value, *on_update_value;
LEX_STRING *comment, name_and_length;
LEX_USER *grant_user;
gptr yacc_yyss,yacc_yyvs;
THD *thd;
CHARSET_INFO *charset;
- SQL_LIST *gorder_list;
List<key_part_spec> col_list;
List<key_part_spec> ref_list;
@@ -573,7 +575,7 @@ typedef struct st_lex
List<Item> *insert_list,field_list,value_list;
List<List_item> many_values;
List<set_var_base> var_list;
- List<Item> param_list;
+ List<Item_param> param_list;
SQL_LIST proc_list, auxilliary_table_list, save_list;
TYPELIB *interval;
create_field *last_field;
@@ -598,7 +600,6 @@ typedef struct st_lex
uint uint_geom_type;
uint grant, grant_tot_col, which_columns;
uint fk_delete_opt, fk_update_opt, fk_match_option;
- uint param_count;
uint slave_thd_opt;
uint8 describe;
bool drop_if_exists, drop_temporary, local_file;
diff --git a/sql/sql_list.h b/sql/sql_list.h
index 8faa7109174..6dee38e9192 100644
--- a/sql/sql_list.h
+++ b/sql/sql_list.h
@@ -293,7 +293,7 @@ protected:
inline T** ref(void) { return (T**) 0; }
public:
- List_iterator_fast(List<T> &a) : base_list_iterator(a) {}
+ inline List_iterator_fast(List<T> &a) : base_list_iterator(a) {}
inline T* operator++(int) { return (T*) base_list_iterator::next_fast(); }
inline void rewind(void) { base_list_iterator::rewind(); }
void sublist(List<T> &list_arg, uint el_arg)
@@ -364,6 +364,10 @@ class base_ilist
first_link->unlink(); // Unlink from list
return first_link;
}
+ inline struct ilink *head()
+ {
+ return (first != &last) ? first : 0;
+ }
friend class base_list_iterator;
};
@@ -396,6 +400,7 @@ public:
inline void append(T* a) { base_ilist::append(a); }
inline void push_back(T* a) { base_ilist::push_back(a); }
inline T* get() { return (T*) base_ilist::get(); }
+ inline T* head() { return (T*) base_ilist::head(); }
#ifndef _lint
friend class I_List_iterator<T>;
#endif
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index f128601d281..377f41958c5 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -93,8 +93,12 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
LOAD_FILE_INFO lf_info;
#endif
char *db = table_list->db; // This is never null
- /* If no current database, use database where table is located */
- char *tdb= thd->db ? thd->db : db;
+ /*
+ If path for file is not defined, we will use the current database.
+ If this is not set, we will use the directory where the table to be
+ loaded is located
+ */
+ char *tdb= thd->db ? thd->db : db; // Result is never null
bool transactional_table, log_delayed;
ulong skip_lines= ex->skip_lines;
DBUG_ENTER("mysql_load");
@@ -123,7 +127,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
else
{ // Part field list
thd->dupp_field=0;
- if (setup_tables(table_list, 0) ||
+ if (setup_tables(table_list) ||
setup_fields(thd, 0, table_list, fields, 1, 0, 0))
DBUG_RETURN(-1);
if (thd->dupp_field)
@@ -237,7 +241,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
}
#ifndef EMBEDDED_LIBRARY
- if (!opt_old_rpl_compat && mysql_bin_log.is_open())
+ if (mysql_bin_log.is_open())
{
lf_info.thd = thd;
lf_info.ex = ex;
@@ -270,13 +274,12 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
if (!(error=test(read_info.error)))
{
- uint save_time_stamp=table->time_stamp;
if (use_timestamp)
- table->time_stamp=0;
+ table->timestamp_default_now= table->timestamp_on_update_now= 0;
+
table->next_number_field=table->found_next_number_field;
VOID(table->file->extra_opt(HA_EXTRA_WRITE_CACHE,
thd->variables.read_buff_size));
- table->bulk_insert= 1;
if (handle_duplicates == DUP_IGNORE ||
handle_duplicates == DUP_REPLACE)
table->file->extra(HA_EXTRA_IGNORE_DUP_KEY);
@@ -293,7 +296,6 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
if (table->file->activate_all_index(thd))
error=1; /* purecov: inspected */
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
- table->time_stamp=save_time_stamp;
table->next_number_field=0;
}
if (file >= 0)
@@ -313,7 +315,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
if (transactional_table)
ha_autocommit_or_rollback(thd,error);
#ifndef EMBEDDED_LIBRARY
- if (!opt_old_rpl_compat && mysql_bin_log.is_open())
+ if (mysql_bin_log.is_open())
{
/*
Make sure last block (the one which caused the error) gets logged.
@@ -357,28 +359,16 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
#ifndef EMBEDDED_LIBRARY
if (mysql_bin_log.is_open())
{
- if (opt_old_rpl_compat)
- {
- if (!read_file_from_client)
- {
- Load_log_event qinfo(thd, ex, db, table->table_name, fields,
- handle_duplicates, log_delayed);
- mysql_bin_log.write(&qinfo);
- }
- }
- else
+ /*
+ As already explained above, we need to call end_io_cache() or the last
+ block will be logged only after Execute_load_log_event (which is wrong),
+ when read_info is destroyed.
+ */
+ read_info.end_io_cache();
+ if (lf_info.wrote_create_file)
{
- /*
- As already explained above, we need to call end_io_cache() or the last
- block will be logged only after Execute_load_log_event (which is wrong),
- when read_info is destroyed.
- */
- read_info.end_io_cache();
- if (lf_info.wrote_create_file)
- {
- Execute_load_log_event e(thd, db, log_delayed);
- mysql_bin_log.write(&e);
- }
+ Execute_load_log_event e(thd, db, log_delayed);
+ mysql_bin_log.write(&e);
}
}
#endif /*!EMBEDDED_LIBRARY*/
@@ -695,7 +685,7 @@ READ_INFO::READ_INFO(File file_par, uint tot_length, CHARSET_INFO *cs,
if (get_it_from_net)
cache.read_function = _my_b_net_read;
- if (!opt_old_rpl_compat && mysql_bin_log.is_open())
+ if (mysql_bin_log.is_open())
cache.pre_read = cache.pre_close =
(IO_CACHE_CALLBACK) log_loaded_block;
#endif
diff --git a/sql/sql_olap.cc b/sql/sql_olap.cc
index efc4cf0921d..46f1e6c156e 100644
--- a/sql/sql_olap.cc
+++ b/sql/sql_olap.cc
@@ -64,7 +64,7 @@ static int make_new_olap_select(LEX *lex, SELECT_LEX *select_lex, List<Item> new
while ((item=list_it++))
{
- bool not_found=true;
+ bool not_found= TRUE;
if (item->type()==Item::FIELD_ITEM)
{
Item_field *iif = (Item_field *)item;
@@ -152,7 +152,7 @@ int handle_olaps(LEX *lex, SELECT_LEX *select_lex)
List<Item> all_fields(select_lex->item_list);
- if (setup_tables((TABLE_LIST *)select_lex->table_list.first, 0) ||
+ if (setup_tables((TABLE_LIST *)select_lex->table_list.first) ||
setup_fields(lex->thd, 0, (TABLE_LIST *)select_lex->table_list.first,
select_lex->item_list, 1, &all_fields,1) ||
setup_fields(lex->thd, 0, (TABLE_LIST *)select_lex->table_list.first,
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 53405eb6fcd..5f52b8d6aac 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -60,16 +60,18 @@
extern "C" int gethostname(char *name, int namelen);
#endif
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
static int check_for_max_user_connections(THD *thd, USER_CONN *uc);
+#endif
static void decrease_user_connections(USER_CONN *uc);
static bool check_db_used(THD *thd,TABLE_LIST *tables);
static bool check_merge_table_access(THD *thd, char *db, TABLE_LIST *tables);
-static bool single_table_command_access(THD *thd, ulong privilege,
- TABLE_LIST *tables, int *res);
static void remove_escape(char *name);
static void refresh_status(void);
-static bool append_file_to_dir(THD *thd, char **filename_ptr,
- char *table_name);
+static bool append_file_to_dir(THD *thd, const char **filename_ptr,
+ const char *table_name);
+static int check_one_table_access(THD *thd, ulong privilege,
+ TABLE_LIST *tables, bool no_errors);
const char *any_db="*any*"; // Special symbol for check_access
@@ -113,6 +115,7 @@ static void unlock_locked_tables(THD *thd)
}
}
+
static bool end_active_trans(THD *thd)
{
int error=0;
@@ -128,6 +131,17 @@ static bool end_active_trans(THD *thd)
}
+#ifdef HAVE_REPLICATION
+inline bool all_tables_not_ok(THD *thd, TABLE_LIST *tables)
+{
+ return (table_rules_on && tables && !tables_ok(thd,tables) &&
+ ((thd->lex->sql_command != SQLCOM_DELETE_MULTI) ||
+ !tables_ok(thd,
+ (TABLE_LIST *)thd->lex->auxilliary_table_list.first)));
+}
+#endif
+
+
static HASH hash_user_connections;
static int get_or_create_user_conn(THD *thd, const char *user,
@@ -218,7 +232,21 @@ int check_user(THD *thd, enum enum_server_command command,
#ifdef NO_EMBEDDED_ACCESS_CHECKS
thd->master_access= GLOBAL_ACLS; // Full rights
- return 0;
+ /* Change database if necessary: OK or FAIL is sent in mysql_change_db */
+ if (db && db[0])
+ {
+ thd->db= 0;
+ thd->db_length= 0;
+ if (mysql_change_db(thd, db))
+ {
+ if (thd->user_connect)
+ decrease_user_connections(thd->user_connect);
+ DBUG_RETURN(-1);
+ }
+ }
+ else
+ send_ok(thd);
+ DBUG_RETURN(0);
#else
my_bool opt_secure_auth_local;
@@ -412,6 +440,8 @@ void init_max_user_conn(void)
1 error
*/
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+
static int check_for_max_user_connections(THD *thd, USER_CONN *uc)
{
int error=0;
@@ -442,7 +472,7 @@ static int check_for_max_user_connections(THD *thd, USER_CONN *uc)
(void) pthread_mutex_unlock(&LOCK_user_conn);
DBUG_RETURN(error);
}
-
+#endif /* NO_EMBEDDED_ACCESS_CHECKS */
/*
Decrease user connection count
@@ -531,15 +561,15 @@ bool is_update_query(enum enum_sql_command command)
static bool check_mqh(THD *thd, uint check_command)
{
+#ifdef NO_EMBEDDED_ACCESS_CHECKS
+ return(0);
+#else
bool error=0;
time_t check_time = thd->start_time ? thd->start_time : time(NULL);
USER_CONN *uc=thd->user_connect;
DBUG_ENTER("check_mqh");
DBUG_ASSERT(uc != 0);
-#ifdef NO_EMBEDDED_ACCESS_CHECKS
- DBUG_RETURN(0);
-#else
/* If more than a hour since last check, reset resource checking */
if (check_time - uc->intime >= 3600)
{
@@ -986,7 +1016,7 @@ pthread_handler_decl(handle_one_connection,arg)
net->compress=1; // Use compression
thd->version= refresh_version;
- if (sys_init_connect.value && !(thd->master_access & SUPER_ACL))
+ if (sys_init_connect.value_length && !(thd->master_access & SUPER_ACL))
{
execute_init_command(thd, &sys_init_connect, &LOCK_sys_init_connect);
if (thd->query_error)
@@ -1161,9 +1191,7 @@ int mysql_table_dump(THD* thd, char* db, char* tbl_name, int fd)
if (!(table=open_ltable(thd, table_list, TL_READ_NO_INSERT)))
DBUG_RETURN(1);
- if (check_access(thd, SELECT_ACL, db, &table_list->grant.privilege,0,0))
- goto err;
- if (grant_option && check_grant(thd, SELECT_ACL, table_list, 0, 0))
+ if (check_one_table_access(thd, SELECT_ACL, table_list, 0))
goto err;
thd->free_list = 0;
thd->query_length=(uint) strlen(tbl_name);
@@ -1183,9 +1211,18 @@ err:
}
- /* Execute one command from socket (query or simple command) */
-
#ifndef EMBEDDED_LIBRARY
+
+/*
+ Read one command from socket and execute it (query or simple command).
+ This function is called in loop from thread function.
+ SYNOPSIS
+ do_command()
+ RETURN VALUE
+ 0 success
+ 1 request of thread shutdown (see dispatch_command() description)
+*/
+
bool do_command(THD *thd)
{
char *packet;
@@ -1238,10 +1275,34 @@ bool do_command(THD *thd)
command_name[command]));
}
net->read_timeout=old_timeout; // restore it
+ /*
+ packet_length contains length of data, as it was stored in packet
+ header. In case of malformed header, packet_length can be zero.
+ If packet_length is not zero, my_net_read ensures that this number
+ of bytes was actually read from network. Additionally my_net_read
+ sets packet[packet_length]= 0 (thus if packet_length == 0,
+ command == packet[0] == COM_SLEEP).
+ In dispatch_command packet[packet_length] points beyond the end of packet.
+ */
DBUG_RETURN(dispatch_command(command,thd, packet+1, (uint) packet_length));
}
#endif /* EMBEDDED_LIBRARY */
+/*
+ Perform one connection-level (COM_XXXX) command.
+ SYNOPSIS
+ dispatch_command()
+ thd connection handle
+ command type of command to perform
+ packet data for the command, packet is always null-terminated
+ packet_length length of packet + 1 (to show that data is
+ null-terminated) except for COM_SLEEP, where it
+ can be zero.
+ RETURN VALUE
+ 0 ok
+ 1 request of thread shutdown, i. e. if command is
+ COM_QUIT/COM_SHUTDOWN
+*/
bool dispatch_command(enum enum_server_command command, THD *thd,
char* packet, uint packet_length)
@@ -1300,7 +1361,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
send_error(thd); // dump to NET
break;
}
-#ifndef EMBEDDED_LIBRARY
case COM_CHANGE_USER:
{
thd->change_user();
@@ -1319,13 +1379,14 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
uint passwd_len= thd->client_capabilities & CLIENT_SECURE_CONNECTION ?
*passwd++ : strlen(passwd);
db+= passwd_len + 1;
+#ifndef EMBEDDED_LIBRARY
/* Small check for incomming packet */
if ((uint) ((uchar*) db - net->read_pos) > packet_length)
{
send_error(thd, ER_UNKNOWN_COM_ERROR);
break;
}
-
+#endif
/* Convert database name to utf8 */
db_buff[copy_and_convert(db_buff, sizeof(db_buff)-1,
system_charset_info, db, strlen(db),
@@ -1350,7 +1411,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
/* Clear variables that are allocated */
thd->user_connect= 0;
- int res= check_user(thd, COM_CHANGE_USER, passwd, passwd_len, db, false);
+ int res= check_user(thd, COM_CHANGE_USER, passwd, passwd_len, db, FALSE);
if (res)
{
@@ -1376,10 +1437,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
}
break;
}
-#endif /* EMBEDDED_LIBRARY */
case COM_EXECUTE:
{
- mysql_stmt_execute(thd, packet);
+ mysql_stmt_execute(thd, packet, packet_length);
break;
}
case COM_LONG_DATA:
@@ -1488,9 +1548,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
my_casedn_str(files_charset_info, table_list.real_name);
remove_escape(table_list.real_name); // This can't have wildcards
- if (check_access(thd,SELECT_ACL,table_list.db,&thd->col_access,0,0))
+ if (check_access(thd,SELECT_ACL,table_list.db,&table_list.grant.privilege,
+ 0, 0))
break;
- table_list.grant.privilege=thd->col_access;
if (grant_option && check_grant(thd,SELECT_ACL,&table_list,2,0))
break;
mysqld_list_fields(thd,&table_list,fields);
@@ -1507,10 +1567,11 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
case COM_CREATE_DB: // QQ: To be removed
{
+ char *db=thd->strdup(packet), *alias;
+
statistic_increment(com_stat[SQLCOM_CREATE_DB],&LOCK_status);
- char *db=thd->strdup(packet);
// null test to handle EOM
- if (!db || !strip_sp(db) || check_db_name(db))
+ if (!db || !(alias= thd->strdup(db)) || check_db_name(db))
{
net_printf(thd,ER_WRONG_DB_NAME, db ? db : "NULL");
break;
@@ -1518,15 +1579,15 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
if (check_access(thd,CREATE_ACL,db,0,1,0))
break;
mysql_log.write(thd,command,packet);
- mysql_create_db(thd,db,0,0);
+ mysql_create_db(thd,(lower_case_table_names == 2 ? alias : db),0,0);
break;
}
case COM_DROP_DB: // QQ: To be removed
{
statistic_increment(com_stat[SQLCOM_DROP_DB],&LOCK_status);
- char *db=thd->strdup(packet);
+ char *db=thd->strdup(packet), *alias;
// null test to handle EOM
- if (!db || !strip_sp(db) || check_db_name(db))
+ if (!db || !(alias= thd->strdup(db)) || check_db_name(db))
{
net_printf(thd,ER_WRONG_DB_NAME, db ? db : "NULL");
break;
@@ -1539,7 +1600,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
break;
}
mysql_log.write(thd,command,db);
- mysql_rm_db(thd,db,0,0);
+ mysql_rm_db(thd,alias,0,0);
break;
}
#ifndef EMBEDDED_LIBRARY
@@ -1810,7 +1871,7 @@ mysql_execute_command(THD *thd)
Skip if we are in the slave thread, some table rules have been
given and the table list says the query should not be replicated
*/
- if (table_rules_on && tables && !tables_ok(thd,tables))
+ if (all_tables_not_ok(thd,tables))
{
/* we warn the slave SQL thread */
my_error(ER_SLAVE_IGNORED_TABLE, MYF(0));
@@ -1831,7 +1892,6 @@ mysql_execute_command(THD *thd)
}
#endif /* !HAVE_REPLICATION */
if (&lex->select_lex != lex->all_selects_list &&
- lex->sql_command != SQLCOM_CREATE_TABLE &&
lex->unit.create_total_list(thd, lex, &tables))
DBUG_RETURN(0);
@@ -1843,7 +1903,7 @@ mysql_execute_command(THD *thd)
!(thd->slave_thread || (thd->master_access & SUPER_ACL)) &&
(uc_update_queries[lex->sql_command] > 0))
{
- send_error(thd, ER_CANT_UPDATE_WITH_READLOCK);
+ net_printf(thd, ER_OPTION_PREVENTS_STATEMENT, "--read-only");
DBUG_RETURN(-1);
}
@@ -2038,9 +2098,9 @@ mysql_execute_command(THD *thd)
{
if (check_global_access(thd, SUPER_ACL))
goto error;
- LOCK_ACTIVE_MI;
+ pthread_mutex_lock(&LOCK_active_mi);
res = change_master(thd,active_mi);
- UNLOCK_ACTIVE_MI;
+ pthread_mutex_unlock(&LOCK_active_mi);
break;
}
case SQLCOM_SHOW_SLAVE_STAT:
@@ -2048,9 +2108,9 @@ mysql_execute_command(THD *thd)
/* Accept one of two privileges */
if (check_global_access(thd, SUPER_ACL | REPL_CLIENT_ACL))
goto error;
- LOCK_ACTIVE_MI;
+ pthread_mutex_lock(&LOCK_active_mi);
res = show_master_info(thd,active_mi);
- UNLOCK_ACTIVE_MI;
+ pthread_mutex_unlock(&LOCK_active_mi);
break;
}
case SQLCOM_SHOW_MASTER_STAT:
@@ -2102,7 +2162,7 @@ mysql_execute_command(THD *thd)
net_printf(thd,ER_WRONG_TABLE_NAME, tables->real_name);
break;
}
- LOCK_ACTIVE_MI;
+ pthread_mutex_lock(&LOCK_active_mi);
/*
fetch_master_table will send the error to the client on failure.
Give error if the table already exists.
@@ -2112,7 +2172,7 @@ mysql_execute_command(THD *thd)
{
send_ok(thd);
}
- UNLOCK_ACTIVE_MI;
+ pthread_mutex_unlock(&LOCK_active_mi);
break;
}
#endif /* HAVE_REPLICATION */
@@ -2121,24 +2181,29 @@ mysql_execute_command(THD *thd)
{
/* Skip first table, which is the table we are creating */
TABLE_LIST *create_table= tables;
+ TABLE_LIST *create_table_local=
+ (TABLE_LIST*)lex->select_lex.table_list.first;
+ // exclude from global table list
tables= tables->next;
- lex->select_lex.table_list.first= (byte*) (tables);
+ // and from local list if it is not the same
+ if (&lex->select_lex != lex->all_selects_list)
+ lex->select_lex.table_list.first= (gptr)create_table_local->next;
+ else
+ lex->select_lex.table_list.first= (gptr)tables;
create_table->next= 0;
- if (&lex->select_lex != lex->all_selects_list &&
- lex->unit.create_total_list(thd, lex, &tables))
- DBUG_RETURN(-1);
ulong want_priv= ((lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) ?
CREATE_TMP_ACL : CREATE_ACL);
+ lex->create_info.alias= create_table->alias;
if (check_access(thd, want_priv, create_table->db,
&create_table->grant.privilege, 0, 0) ||
check_merge_table_access(thd, create_table->db,
(TABLE_LIST *)
lex->create_info.merge_list.first))
- goto error; /* purecov: inspected */
+ goto create_eror; /* purecov: inspected */
if (grant_option && want_priv != CREATE_TMP_ACL &&
check_grant(thd, want_priv, create_table,0,0))
- goto error;
+ goto create_eror;
#ifndef HAVE_READLINK
lex->create_info.data_file_name=lex->create_info.index_file_name=0;
#else
@@ -2149,7 +2214,7 @@ mysql_execute_command(THD *thd)
create_table->real_name))
{
res=-1;
- break;
+ goto unsent_create_error;
}
#endif
/*
@@ -2174,10 +2239,10 @@ mysql_execute_command(THD *thd)
create_table->real_name))
{
net_printf(thd,ER_UPDATE_TABLE_USED, create_table->real_name);
- DBUG_RETURN(-1);
+ goto create_eror;
}
if (tables && check_table_access(thd, SELECT_ACL, tables,0))
- goto error; // Error message is given
+ goto create_eror; // Error message is given
select_lex->options|= SELECT_NO_UNLOCK;
unit->set_limit(select_lex, select_lex);
@@ -2208,15 +2273,40 @@ mysql_execute_command(THD *thd)
if (!res)
send_ok(thd);
}
+ // put tables back for PS rexecuting
+ create_table->next= tables;
+ tables= create_table;
+ if (&lex->select_lex != lex->all_selects_list)
+ {
+ /*
+ we do not touch local table 'next' field => we need just
+ put the table in the list
+ */
+ lex->select_lex.table_list.first= (gptr) create_table_local;
+ }
+ else
+ lex->select_lex.table_list.first= (gptr) tables;
+ break;
+
+create_eror:
+ res= 1; //error reported
+unsent_create_error:
+ // put tables back for PS rexecuting
+ create_table->next= tables;
+ tables= create_table;
+ if (&lex->select_lex != lex->all_selects_list)
+ {
+ /*
+ we do not touch local table 'next' field => we need just
+ put the table in the list
+ */
+ lex->select_lex.table_list.first= (gptr) create_table_local;
+ }
break;
}
case SQLCOM_CREATE_INDEX:
- if (!tables->db)
- tables->db=thd->db;
- if (check_access(thd,INDEX_ACL,tables->db,&tables->grant.privilege,0,0))
+ if (check_one_table_access(thd, INDEX_ACL, tables, 0))
goto error; /* purecov: inspected */
- if (grant_option && check_grant(thd,INDEX_ACL,tables,0,0))
- goto error;
thd->slow_command=TRUE;
if (end_active_trans(thd))
res= -1;
@@ -2227,9 +2317,9 @@ mysql_execute_command(THD *thd)
#ifdef HAVE_REPLICATION
case SQLCOM_SLAVE_START:
{
- LOCK_ACTIVE_MI;
+ pthread_mutex_lock(&LOCK_active_mi);
start_slave(thd,active_mi,1 /* net report*/);
- UNLOCK_ACTIVE_MI;
+ pthread_mutex_unlock(&LOCK_active_mi);
break;
}
case SQLCOM_SLAVE_STOP:
@@ -2252,9 +2342,9 @@ mysql_execute_command(THD *thd)
goto error;
}
{
- LOCK_ACTIVE_MI;
+ pthread_mutex_lock(&LOCK_active_mi);
stop_slave(thd,active_mi,1/* net report*/);
- UNLOCK_ACTIVE_MI;
+ pthread_mutex_unlock(&LOCK_active_mi);
break;
}
#endif /* HAVE_REPLICATION */
@@ -2272,8 +2362,6 @@ mysql_execute_command(THD *thd)
res=0;
break;
}
- if (!tables->db)
- tables->db=thd->db;
if (!select_lex->db)
select_lex->db=tables->db;
if (check_access(thd,ALTER_ACL,tables->db,&tables->grant.privilege,0,0) ||
@@ -2282,8 +2370,6 @@ mysql_execute_command(THD *thd)
(TABLE_LIST *)
lex->create_info.merge_list.first))
goto error; /* purecov: inspected */
- if (!tables->db)
- tables->db=thd->db;
if (grant_option)
{
if (check_grant(thd,ALTER_ACL,tables,0,0))
@@ -2295,7 +2381,7 @@ mysql_execute_command(THD *thd)
tmp_table.real_name=lex->name;
tmp_table.db=select_lex->db;
tmp_table.grant.privilege=priv;
- if (check_grant(thd,INSERT_ACL | CREATE_ACL,tables,0,0))
+ if (check_grant(thd, INSERT_ACL | CREATE_ACL, &tmp_table, 0, 0))
goto error;
}
}
@@ -2336,8 +2422,10 @@ mysql_execute_command(THD *thd)
if (grant_option)
{
TABLE_LIST old_list,new_list;
- bzero((char*) &old_list, sizeof(old_list));
- bzero((char*) &new_list, sizeof(new_list)); // Safety
+ /*
+ we do not need initialize old_list and new_list because we will
+ come table[0] and table->next[0] there
+ */
old_list=table[0];
new_list=table->next[0];
old_list.next=new_list.next=0;
@@ -2476,16 +2564,15 @@ mysql_execute_command(THD *thd)
break;
}
case SQLCOM_UPDATE:
- if (check_db_used(thd,tables))
- goto error;
-
- if (single_table_command_access(thd, UPDATE_ACL, tables, &res))
- goto error;
if (select_lex->item_list.elements != lex->value_list.elements)
{
send_error(thd,ER_WRONG_VALUE_COUNT);
goto error;
}
+ if (check_db_used(thd,tables))
+ goto error;
+ if (check_one_table_access(thd, UPDATE_ACL, tables, 0))
+ goto error;
res= mysql_update(thd,tables,
select_lex->item_list,
lex->value_list,
@@ -2498,36 +2585,48 @@ mysql_execute_command(THD *thd)
res= -1;
break;
case SQLCOM_UPDATE_MULTI:
- if (check_access(thd,UPDATE_ACL,tables->db,&tables->grant.privilege,0,0))
- goto error;
- if (grant_option && check_grant(thd,UPDATE_ACL,tables,0,0))
- goto error;
+ {
+ const char *msg= 0;
+ TABLE_LIST *table;
+
if (select_lex->item_list.elements != lex->value_list.elements)
{
send_error(thd,ER_WRONG_VALUE_COUNT);
goto error;
}
+ /*
+ Ensure that we have UPDATE or SELECT privilege for each table
+ The exact privilege is checked in mysql_multi_update()
+ */
+ for (table= tables ; table ; table= table->next)
{
- const char *msg= 0;
- if (select_lex->order_list.elements)
- msg= "ORDER BY";
- else if (select_lex->select_limit && select_lex->select_limit !=
- HA_POS_ERROR)
- msg= "LIMIT";
- if (msg)
- {
- net_printf(thd, ER_WRONG_USAGE, "UPDATE", msg);
- res= 1;
- break;
- }
- res= mysql_multi_update(thd,tables,
- &select_lex->item_list,
- &lex->value_list,
- select_lex->where,
- select_lex->options,
- lex->duplicates, unit, select_lex);
+ TABLE_LIST *save= table->next;
+ table->next= 0;
+ if (check_one_table_access(thd, UPDATE_ACL, table, 1) &&
+ check_one_table_access(thd, SELECT_ACL, table, 0))
+ goto error;
+ table->next= save;
+ }
+
+ if (select_lex->order_list.elements)
+ msg= "ORDER BY";
+ else if (select_lex->select_limit && select_lex->select_limit !=
+ HA_POS_ERROR)
+ msg= "LIMIT";
+ if (msg)
+ {
+ net_printf(thd, ER_WRONG_USAGE, "UPDATE", msg);
+ res= 1;
+ break;
}
+ res= mysql_multi_update(thd,tables,
+ &select_lex->item_list,
+ &lex->value_list,
+ select_lex->where,
+ select_lex->options,
+ lex->duplicates, unit, select_lex);
break;
+ }
case SQLCOM_REPLACE:
case SQLCOM_INSERT:
{
@@ -2535,7 +2634,7 @@ mysql_execute_command(THD *thd)
ulong privilege= (lex->duplicates == DUP_REPLACE ?
INSERT_ACL | DELETE_ACL : INSERT_ACL | update);
- if (single_table_command_access(thd, privilege, tables, &res))
+ if (check_one_table_access(thd, privilege, tables, 0))
goto error;
if (select_lex->item_list.elements != lex->value_list.elements)
{
@@ -2559,15 +2658,7 @@ mysql_execute_command(THD *thd)
{
ulong privilege= (lex->duplicates == DUP_REPLACE ?
INSERT_ACL | DELETE_ACL : INSERT_ACL);
- TABLE_LIST *save_next=tables->next;
- tables->next=0;
- if (check_access(thd, privilege,
- tables->db,&tables->grant.privilege,0,0) ||
- (grant_option && check_grant(thd, privilege, tables,0,0)))
- goto error;
-
- tables->next=save_next;
- if ((res=check_table_access(thd, SELECT_ACL, save_next,0)))
+ if (check_one_table_access(thd, privilege, tables, 0))
goto error;
}
@@ -2605,9 +2696,7 @@ mysql_execute_command(THD *thd)
break;
}
case SQLCOM_TRUNCATE:
- if (check_access(thd,DELETE_ACL,tables->db,&tables->grant.privilege,0,0))
- goto error; /* purecov: inspected */
- if (grant_option && check_grant(thd,DELETE_ACL,tables,0,0))
+ if (check_one_table_access(thd, DELETE_ACL, tables, 0))
goto error;
/*
Don't allow this within a transaction because we want to use
@@ -2622,7 +2711,7 @@ mysql_execute_command(THD *thd)
break;
case SQLCOM_DELETE:
{
- if (single_table_command_access(thd, DELETE_ACL, tables, &res))
+ if (check_one_table_access(thd, DELETE_ACL, tables, 0))
goto error;
// Set privilege for the WHERE clause
tables->grant.want_privilege=(SELECT_ACL & ~tables->grant.privilege);
@@ -2657,7 +2746,7 @@ mysql_execute_command(THD *thd)
TABLE_LIST *walk;
for (walk= (TABLE_LIST*) tables; walk; walk= walk->next)
{
- if (!strcmp(auxi->real_name, walk->alias) &&
+ if (!my_strcasecmp(table_alias_charset, auxi->alias, walk->alias) &&
!strcmp(walk->db, auxi->db))
break;
}
@@ -2747,8 +2836,8 @@ mysql_execute_command(THD *thd)
DROP / * 40005 TEMPORARY * / TABLE
that come from parts of binlogs (likely if we use RESET SLAVE or CHANGE
MASTER TO), while the temporary table has already been dropped.
- To not generate such irrelevant "table does not exist errors", we
- silently add IF EXISTS if TEMPORARY was used.
+ To not generate such irrelevant "table does not exist errors",
+ we silently add IF EXISTS if TEMPORARY was used.
*/
if (thd->slave_thread)
lex->drop_if_exists= 1;
@@ -2757,12 +2846,8 @@ mysql_execute_command(THD *thd)
}
break;
case SQLCOM_DROP_INDEX:
- if (!tables->db)
- tables->db=thd->db;
- if (check_access(thd,INDEX_ACL,tables->db,&tables->grant.privilege,0,0))
+ if (check_one_table_access(thd, INDEX_ACL, tables, 0))
goto error; /* purecov: inspected */
- if (grant_option && check_grant(thd,INDEX_ACL,tables,0,0))
- goto error;
if (end_active_trans(thd))
res= -1;
else
@@ -2871,16 +2956,11 @@ mysql_execute_command(THD *thd)
#else
{
char *db=tables->db;
- if (!*db)
- {
- send_error(thd,ER_NO_DB_ERROR); /* purecov: inspected */
- goto error; /* purecov: inspected */
- }
remove_escape(db); // Fix escaped '_'
remove_escape(tables->real_name);
- if (check_access(thd,SELECT_ACL | EXTRA_ACL,db,&thd->col_access,0,0))
+ if (check_access(thd,SELECT_ACL | EXTRA_ACL,db,
+ &tables->grant.privilege, 0, 0))
goto error; /* purecov: inspected */
- tables->grant.privilege=thd->col_access;
if (grant_option && check_grant(thd,SELECT_ACL,tables,2,0))
goto error;
res= mysqld_show_fields(thd,tables,
@@ -2896,18 +2976,11 @@ mysql_execute_command(THD *thd)
#else
{
char *db=tables->db;
- if (!db)
- {
- send_error(thd,ER_NO_DB_ERROR); /* purecov: inspected */
- goto error; /* purecov: inspected */
- }
remove_escape(db); // Fix escaped '_'
remove_escape(tables->real_name);
- if (!tables->db)
- tables->db=thd->db;
- if (check_access(thd,SELECT_ACL,db,&thd->col_access,0,0))
- goto error; /* purecov: inspected */
- tables->grant.privilege=thd->col_access;
+ if (check_access(thd,SELECT_ACL | EXTRA_ACL,db,
+ &tables->grant.privilege, 0, 0))
+ goto error; /* purecov: inspected */
if (grant_option && check_grant(thd,SELECT_ACL,tables,2,0))
goto error;
res= mysqld_show_keys(thd,tables);
@@ -2936,9 +3009,7 @@ mysql_execute_command(THD *thd)
send_error(thd,ER_NOT_ALLOWED_COMMAND);
goto error;
}
- if (check_access(thd,privilege,tables->db,&tables->grant.privilege,0,
- 0) ||
- grant_option && check_grant(thd,privilege,tables,0,0))
+ if (check_one_table_access(thd, privilege, tables, 0))
goto error;
}
res=mysql_load(thd, lex->exchange, tables, lex->field_list,
@@ -2975,8 +3046,12 @@ mysql_execute_command(THD *thd)
goto error;
thd->in_lock_tables=1;
thd->options|= OPTION_TABLE_LOCK;
- if (!(res=open_and_lock_tables(thd,tables)))
+ if (!(res= open_and_lock_tables(thd, tables)))
{
+#ifdef HAVE_QUERY_CACHE
+ if (thd->variables.query_cache_wlock_invalidate)
+ query_cache.invalidate_locked_for_write(tables);
+#endif /*HAVE_QUERY_CACHE*/
thd->locked_tables=thd->lock;
thd->lock=0;
send_ok(thd);
@@ -2987,7 +3062,8 @@ mysql_execute_command(THD *thd)
break;
case SQLCOM_CREATE_DB:
{
- if (!strip_sp(lex->name) || check_db_name(lex->name))
+ char *alias;
+ if (!(alias=thd->strdup(lex->name)) || check_db_name(lex->name))
{
net_printf(thd,ER_WRONG_DB_NAME, lex->name);
break;
@@ -3010,12 +3086,14 @@ mysql_execute_command(THD *thd)
#endif
if (check_access(thd,CREATE_ACL,lex->name,0,1,0))
break;
- res=mysql_create_db(thd,lex->name,&lex->create_info,0);
+ res= mysql_create_db(thd,(lower_case_table_names == 2 ? alias : lex->name),
+ &lex->create_info, 0);
break;
}
case SQLCOM_DROP_DB:
{
- if (!strip_sp(lex->name) || check_db_name(lex->name))
+ char *alias;
+ if (!(alias=thd->strdup(lex->name)) || check_db_name(lex->name))
{
net_printf(thd, ER_WRONG_DB_NAME, lex->name);
break;
@@ -3043,7 +3121,7 @@ mysql_execute_command(THD *thd)
send_error(thd,ER_LOCK_OR_ACTIVE_TRANSACTION);
goto error;
}
- res=mysql_rm_db(thd,lex->name,lex->drop_if_exists,0);
+ res=mysql_rm_db(thd,alias,lex->drop_if_exists,0);
break;
}
case SQLCOM_ALTER_DB:
@@ -3053,6 +3131,22 @@ mysql_execute_command(THD *thd)
net_printf(thd, ER_WRONG_DB_NAME, lex->name);
break;
}
+ /*
+ If in a slave thread :
+ ALTER DATABASE DB may not be preceded by USE DB.
+ For that reason, maybe db_ok() in sql/slave.cc did not check the
+ do_db/ignore_db. And as this query involves no tables, tables_ok()
+ above was not called. So we have to check rules again here.
+ */
+#ifdef HAVE_REPLICATION
+ if (thd->slave_thread &&
+ (!db_ok(lex->name, replicate_do_db, replicate_ignore_db) ||
+ !db_ok_with_wild_table(lex->name)))
+ {
+ my_error(ER_SLAVE_IGNORED_TABLE, MYF(0));
+ break;
+ }
+#endif
if (check_access(thd,ALTER_ACL,lex->name,0,1,0))
break;
if (thd->locked_tables || thd->active_transaction())
@@ -3070,7 +3164,7 @@ mysql_execute_command(THD *thd)
net_printf(thd,ER_WRONG_DB_NAME, lex->name);
break;
}
- if (check_access(thd,DROP_ACL,lex->name,0,1,0))
+ if (check_access(thd,SELECT_ACL,lex->name,0,1,0))
break;
if (thd->locked_tables || thd->active_transaction())
{
@@ -3650,19 +3744,19 @@ error:
tables belong to subselects.
SYNOPSIS
- single_table_command_access()
- thd - Thread handler
- privilege - asked privelage
- tables - table list of command
- res - pointer on result code variable
+ check_one_table_access()
+ thd Thread handler
+ privilege requested privelage
+ tables table list of command
+ no_errors Don't send error to client
RETURN
0 - OK
- 1 - access denied
+ 1 - access denied, error is sent to client
*/
-static bool single_table_command_access(THD *thd, ulong privilege,
- TABLE_LIST *tables, int *res)
+static int check_one_table_access(THD *thd, ulong privilege,
+ TABLE_LIST *tables, bool no_errors)
{
if (check_access(thd, privilege, tables->db, &tables->grant.privilege,0,0))
@@ -3672,13 +3766,16 @@ static bool single_table_command_access(THD *thd, ulong privilege,
TABLE_LIST *subselects_tables= tables->next;
tables->next= 0;
if (grant_option && check_grant(thd, privilege, tables, 0, 0))
+ {
+ tables->next= subselects_tables;
return 1;
+ }
// check rights on tables of subselect (if exists)
if (subselects_tables)
{
tables->next= subselects_tables;
- if ((*res= check_table_access(thd, SELECT_ACL, subselects_tables,0)))
+ if ((check_table_access(thd, SELECT_ACL, subselects_tables,0)))
return 1;
}
return 0;
@@ -3711,7 +3808,10 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv,
DBUG_ENTER("check_access");
DBUG_PRINT("enter",("want_access: %lu master_access: %lu", want_access,
thd->master_access));
- ulong db_access,dummy;
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
+ ulong db_access;
+#endif
+ ulong dummy;
if (save_priv)
*save_priv=0;
else
@@ -3903,6 +4003,10 @@ static bool check_db_used(THD *thd,TABLE_LIST *tables)
#define used_stack(A,B) (long) (B - A)
#endif
+#ifndef DBUG_OFF
+long max_stack_used;
+#endif
+
#ifndef EMBEDDED_LIBRARY
bool check_stack_overrun(THD *thd,char *buf __attribute__((unused)))
{
@@ -3915,6 +4019,9 @@ bool check_stack_overrun(THD *thd,char *buf __attribute__((unused)))
thd->fatal_error();
return 1;
}
+#ifndef DBUG_OFF
+ max_stack_used= max(max_stack_used, stack_used);
+#endif
return 0;
}
#endif /* EMBEDDED_LIBRARY */
@@ -4008,7 +4115,9 @@ mysql_init_select(LEX *lex)
{
SELECT_LEX *select_lex= lex->current_select;
select_lex->init_select();
- select_lex->select_limit= lex->thd->variables.select_limit;
+ select_lex->select_limit= (&lex->select_lex == select_lex) ?
+ lex->thd->variables.select_limit : /* Primry UNION */
+ HA_POS_ERROR; /* subquery */
if (select_lex == &lex->select_lex)
{
lex->exchange= 0;
@@ -4060,7 +4169,9 @@ mysql_new_select(LEX *lex, bool move_down)
fake->select_number= INT_MAX;
fake->make_empty_select();
fake->linkage= GLOBAL_OPTIONS_TYPE;
- fake->select_limit= lex->thd->variables.select_limit;
+ fake->select_limit= (&lex->unit == unit) ?
+ lex->thd->variables.select_limit : /* Primry UNION */
+ HA_POS_ERROR; /* subquery */
}
}
@@ -4114,8 +4225,11 @@ void mysql_init_multi_delete(LEX *lex)
}
-void
-mysql_parse(THD *thd, char *inBuf, uint length)
+/*
+ When you modify mysql_parse(), you may need to mofify
+ mysql_test_parse_for_slave() in this same file.
+*/
+void mysql_parse(THD *thd, char *inBuf, uint length)
{
DBUG_ENTER("mysql_parse");
@@ -4174,6 +4288,33 @@ mysql_parse(THD *thd, char *inBuf, uint length)
}
+#ifdef HAVE_REPLICATION
+/*
+ Usable by the replication SQL thread only: just parse a query to know if it
+ can be ignored because of replicate-*-table rules.
+
+ RETURN VALUES
+ 0 cannot be ignored
+ 1 can be ignored
+*/
+
+bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length)
+{
+ LEX *lex;
+ bool error= 0;
+
+ mysql_init_query(thd);
+ lex= lex_start(thd, (uchar*) inBuf, length);
+ if (!yyparse((void*) thd) && ! thd->is_fatal_error &&
+ all_tables_not_ok(thd,(TABLE_LIST*) lex->select_lex.table_list.first))
+ error= 1; /* Ignore question */
+ free_items(thd->free_list); /* Free strings used by items */
+ lex_end(lex);
+
+ return error;
+}
+#endif
+
/*****************************************************************************
** Store field definition for create
** Return 0 if ok
@@ -4182,7 +4323,8 @@ mysql_parse(THD *thd, char *inBuf, uint length)
bool add_field_to_list(THD *thd, char *field_name, enum_field_types type,
char *length, char *decimals,
uint type_modifier,
- Item *default_value, LEX_STRING *comment,
+ Item *default_value, Item *on_update_value,
+ LEX_STRING *comment,
char *change, TYPELIB *interval, CHARSET_INFO *cs,
uint uint_geom_type)
{
@@ -4214,7 +4356,16 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type,
if (default_value)
{
- if (type == FIELD_TYPE_TIMESTAMP)
+ /*
+ Default value should be literal => basic constants =>
+ no need fix_fields()
+
+ We allow only one function as part of default value -
+ NOW() as default for TIMESTAMP type.
+ */
+ if (default_value->type() == Item::FUNC_ITEM &&
+ !(((Item_func*)default_value)->functype() == Item_func::NOW_FUNC &&
+ type == FIELD_TYPE_TIMESTAMP))
{
net_printf(thd, ER_INVALID_DEFAULT, field_name);
DBUG_RETURN(1);
@@ -4235,6 +4386,13 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type,
DBUG_RETURN(1);
}
}
+
+ if (on_update_value && type != FIELD_TYPE_TIMESTAMP)
+ {
+ net_printf(thd, ER_INVALID_ON_UPDATE, field_name);
+ DBUG_RETURN(1);
+ }
+
if (!(new_field=new create_field()))
DBUG_RETURN(1);
new_field->field=0;
@@ -4398,6 +4556,34 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type,
new_field->length= min(new_field->length,14); /* purecov: inspected */
}
new_field->flags|= ZEROFILL_FLAG | UNSIGNED_FLAG | NOT_NULL_FLAG;
+ if (default_value)
+ {
+ /* Grammar allows only NOW() value for ON UPDATE clause */
+ if (default_value->type() == Item::FUNC_ITEM &&
+ ((Item_func*)default_value)->functype() == Item_func::NOW_FUNC)
+ {
+ new_field->unireg_check= (on_update_value?Field::TIMESTAMP_DNUN_FIELD:
+ Field::TIMESTAMP_DN_FIELD);
+ /*
+ We don't need default value any longer moreover it is dangerous.
+ Everything handled by unireg_check further.
+ */
+ new_field->def= 0;
+ }
+ else
+ new_field->unireg_check= (on_update_value?Field::TIMESTAMP_UN_FIELD:
+ Field::NONE);
+ }
+ else
+ {
+ /*
+ We are setting TIMESTAMP_OLD_FIELD here only temporary, we will
+ replace this value by TIMESTAMP_DNUN_FIELD or NONE later when
+ information about all TIMESTAMP fields in table will be availiable.
+ */
+ new_field->unireg_check= on_update_value?Field::TIMESTAMP_UN_FIELD:
+ Field::TIMESTAMP_OLD_FIELD;
+ }
break;
case FIELD_TYPE_DATE: // Old date type
if (protocol_version != PROTOCOL_VERSION-1)
@@ -4567,11 +4753,10 @@ bool add_to_list(THD *thd, SQL_LIST &list,Item *item,bool asc)
ORDER *order;
Item **item_ptr;
DBUG_ENTER("add_to_list");
- if (!(order = (ORDER *) thd->alloc(sizeof(ORDER)+sizeof(Item*))))
+ if (!(order = (ORDER *) thd->alloc(sizeof(ORDER))))
DBUG_RETURN(1);
- item_ptr = (Item**) (order+1);
- *item_ptr=item;
- order->item= item_ptr;
+ order->item_ptr= item;
+ order->item= &order->item_ptr;
order->asc = asc;
order->free_me=0;
order->used=0;
@@ -4661,6 +4846,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
ptr->force_index= test(table_options & TL_OPTION_FORCE_INDEX);
ptr->ignore_leaves= test(table_options & TL_OPTION_IGNORE_LEAVES);
ptr->derived= table->sel;
+ ptr->cacheable_table= 1;
if (use_index_arg)
ptr->use_index=(List<String> *) thd->memdup((gptr) use_index_arg,
sizeof(*use_index_arg));
@@ -4675,7 +4861,8 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
tables ;
tables=tables->next)
{
- if (!strcmp(alias_str,tables->alias) && !strcmp(ptr->db, tables->db))
+ if (!my_strcasecmp(table_alias_charset, alias_str, tables->alias) &&
+ !strcmp(ptr->db, tables->db))
{
net_printf(thd,ER_NONUNIQ_TABLE,alias_str); /* purecov: tested */
DBUG_RETURN(0); /* purecov: tested */
@@ -4815,9 +5002,9 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
if (purge_time >= 0)
mysql_bin_log.purge_logs_before_date(purge_time);
}
- LOCK_ACTIVE_MI;
+ pthread_mutex_lock(&LOCK_active_mi);
rotate_relay_log(active_mi);
- UNLOCK_ACTIVE_MI;
+ pthread_mutex_unlock(&LOCK_active_mi);
#endif
if (ha_flush_logs())
result=1;
@@ -4878,10 +5065,10 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables,
if (options & REFRESH_SLAVE)
{
tmp_write_to_binlog= 0;
- LOCK_ACTIVE_MI;
+ pthread_mutex_lock(&LOCK_active_mi);
if (reset_slave(thd, active_mi))
result=1;
- UNLOCK_ACTIVE_MI;
+ pthread_mutex_unlock(&LOCK_active_mi);
}
#endif
if (options & REFRESH_USER_RESOURCES)
@@ -4964,7 +5151,8 @@ static void refresh_status(void)
/* If pointer is not a null pointer, append filename to it */
-static bool append_file_to_dir(THD *thd, char **filename_ptr, char *table_name)
+static bool append_file_to_dir(THD *thd, const char **filename_ptr,
+ const char *table_name)
{
char buff[FN_REFLEN],*ptr, *end;
if (!*filename_ptr)
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 43bf3e3651c..af1b85ae8a7 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -39,7 +39,7 @@ Prepare-execute:
- Server gets the command 'COM_EXECUTE' to execute the
previously prepared query. If there is any param markers; then client
- will send the data in the following format:
+ will send the data in the following format:
[COM_EXECUTE:1]
[STMT_ID:4]
[NULL_BITS:(param_count+7)/8)]
@@ -87,16 +87,18 @@ class Prepared_statement: public Statement
{
public:
THD *thd;
- Item_param **param; /* array of all placeholders */
+ Item_param **param_array;
uint param_count;
uint last_errno;
char last_error[MYSQL_ERRMSG_SIZE];
- bool error_in_prepare, long_data_used;
+ bool get_longdata_error;
+ bool long_data_used;
bool log_full_query;
#ifndef EMBEDDED_LIBRARY
- bool (*setup_params)(Prepared_statement *st, uchar *pos, uchar *read_pos);
+ bool (*set_params)(Prepared_statement *st, uchar *data, uchar *data_end,
+ uchar *read_pos);
#else
- bool (*setup_params_data)(Prepared_statement *st);
+ bool (*set_params_data)(Prepared_statement *st);
#endif
public:
Prepared_statement(THD *thd_arg);
@@ -117,14 +119,7 @@ inline bool is_param_null(const uchar *pos, ulong param_no)
enum { STMT_QUERY_LOG_LENGTH= 8192 };
-#ifdef EMBEDDED_LIBRARY
-#define SETUP_PARAM_FUNCTION(fn_name) \
-static void fn_name(Item_param *param, uchar **pos, ulong data_len)
-#else
-#define SETUP_PARAM_FUNCTION(fn_name) \
-static void fn_name(Item_param *param, uchar **pos)
-#endif
-
+enum enum_send_error { DONT_SEND_ERROR= 0, SEND_ERROR };
/*
Seek prepared statement in statement map by id: returns zero if statement
@@ -132,14 +127,16 @@ static void fn_name(Item_param *param, uchar **pos)
*/
static Prepared_statement *
-find_prepared_statement(THD *thd, ulong id, const char *where)
+find_prepared_statement(THD *thd, ulong id, const char *where,
+ enum enum_send_error se)
{
Statement *stmt= thd->stmt_map.find(id);
if (stmt == 0 || stmt->type() != Statement::PREPARED_STATEMENT)
{
my_error(ER_UNKNOWN_STMT_HANDLER, MYF(0), id, where);
- send_error(thd);
+ if (se == SEND_ERROR)
+ send_error(thd);
return 0;
}
return (Prepared_statement *) stmt;
@@ -155,12 +152,20 @@ static bool send_prep_stmt(Prepared_statement *stmt, uint columns)
{
NET *net= &stmt->thd->net;
char buff[9];
- buff[0]= 0;
+ buff[0]= 0; /* OK packet indicator */
int4store(buff+1, stmt->id);
int2store(buff+5, columns);
int2store(buff+7, stmt->param_count);
- /* This should be fixed to work with prepared statements */
- return (my_net_write(net, buff, sizeof(buff)) || net_flush(net));
+ /*
+ Send types and names of placeholders to the client
+ XXX: fix this nasty upcast from List<Item_param> to List<Item>
+ */
+ return my_net_write(net, buff, sizeof(buff)) ||
+ (stmt->param_count &&
+ stmt->thd->protocol_simple.send_fields((List<Item> *)
+ &stmt->lex->param_list, 0)) ||
+ net_flush(net);
+ return 0;
}
#else
static bool send_prep_stmt(Prepared_statement *stmt,
@@ -178,104 +183,138 @@ static bool send_prep_stmt(Prepared_statement *stmt,
/*
- Read the length of the parameter data and retun back to
- caller by positing the pointer to param data
+ Read the length of the parameter data and return back to
+ caller by positing the pointer to param data.
*/
#ifndef EMBEDDED_LIBRARY
-static ulong get_param_length(uchar **packet)
+static ulong get_param_length(uchar **packet, ulong len)
{
reg1 uchar *pos= *packet;
+ if (len < 1)
+ return 0;
if (*pos < 251)
{
(*packet)++;
return (ulong) *pos;
}
+ if (len < 3)
+ return 0;
if (*pos == 252)
{
(*packet)+=3;
return (ulong) uint2korr(pos+1);
}
+ if (len < 4)
+ return 0;
if (*pos == 253)
{
(*packet)+=4;
return (ulong) uint3korr(pos+1);
}
+ if (len < 5)
+ return 0;
(*packet)+=9; // Must be 254 when here
+ /* TODO: why uint4korr here? (should be uint8korr) */
return (ulong) uint4korr(pos+1);
}
#else
-#define get_param_length(A) data_len
+#define get_param_length(packet, len) len
#endif /*!EMBEDDED_LIBRARY*/
/*
- Setup param conversion routines
-
- setup_param_xx()
- param Parameter Item
- pos Input data buffer
+ Data conversion routines
+ SYNOPSIS
+ set_param_xx()
+ param parameter item
+ pos input data buffer
+ len length of data in the buffer
- All these functions reads the data from pos and sets up that data
- through 'param' and advances the buffer position to predifined
- length position.
+ All these functions read the data from pos, convert it to requested type
+ and assign to param; pos is advanced to predefined length.
Make a note that the NULL handling is examined at first execution
(i.e. when input types altered) and for all subsequent executions
we don't read any values for this.
- RETURN VALUES
-
+ RETURN VALUE
+ none
*/
-SETUP_PARAM_FUNCTION(setup_param_tiny)
+void set_param_tiny(Item_param *param, uchar **pos, ulong len)
{
+#ifndef EMBEDDED_LIBRARY
+ if (len < 1)
+ return;
+#endif
param->set_int((longlong)(**pos));
*pos+= 1;
}
-SETUP_PARAM_FUNCTION(setup_param_short)
+void set_param_short(Item_param *param, uchar **pos, ulong len)
{
+#ifndef EMBEDDED_LIBRARY
+ if (len < 2)
+ return;
+#endif
param->set_int((longlong)sint2korr(*pos));
*pos+= 2;
}
-SETUP_PARAM_FUNCTION(setup_param_int32)
+void set_param_int32(Item_param *param, uchar **pos, ulong len)
{
+#ifndef EMBEDDED_LIBRARY
+ if (len < 4)
+ return;
+#endif
param->set_int((longlong)sint4korr(*pos));
*pos+= 4;
}
-SETUP_PARAM_FUNCTION(setup_param_int64)
+void set_param_int64(Item_param *param, uchar **pos, ulong len)
{
+#ifndef EMBEDDED_LIBRARY
+ if (len < 8)
+ return;
+#endif
param->set_int((longlong)sint8korr(*pos));
*pos+= 8;
}
-SETUP_PARAM_FUNCTION(setup_param_float)
+void set_param_float(Item_param *param, uchar **pos, ulong len)
{
+#ifndef EMBEDDED_LIBRARY
+ if (len < 4)
+ return;
+#endif
float data;
float4get(data,*pos);
param->set_double((double) data);
*pos+= 4;
}
-SETUP_PARAM_FUNCTION(setup_param_double)
+void set_param_double(Item_param *param, uchar **pos, ulong len)
{
+#ifndef EMBEDDED_LIBRARY
+ if (len < 8)
+ return;
+#endif
double data;
float8get(data,*pos);
param->set_double((double) data);
*pos+= 8;
}
-SETUP_PARAM_FUNCTION(setup_param_time)
+void set_param_time(Item_param *param, uchar **pos, ulong len)
{
ulong length;
- if ((length= get_param_length(pos)))
+ if ((length= get_param_length(pos, len)) >= 8)
{
uchar *to= *pos;
- TIME tm;
+ TIME tm;
+ /* TODO: why length is compared with 8 here? */
tm.second_part= (length > 8 ) ? (ulong) sint4korr(to+7): 0;
tm.day= (ulong) sint4korr(to+1);
@@ -291,11 +330,11 @@ SETUP_PARAM_FUNCTION(setup_param_time)
*pos+= length;
}
-SETUP_PARAM_FUNCTION(setup_param_datetime)
+void set_param_datetime(Item_param *param, uchar **pos, ulong len)
{
- uint length= get_param_length(pos);
+ uint length;
- if (length)
+ if ((length= get_param_length(pos, len)) >= 4)
{
uchar *to= *pos;
TIME tm;
@@ -321,11 +360,11 @@ SETUP_PARAM_FUNCTION(setup_param_datetime)
*pos+= length;
}
-SETUP_PARAM_FUNCTION(setup_param_date)
+void set_param_date(Item_param *param, uchar **pos, ulong len)
{
ulong length;
- if ((length= get_param_length(pos)))
+ if ((length= get_param_length(pos, len)) >= 4)
{
uchar *to= *pos;
TIME tm;
@@ -343,55 +382,55 @@ SETUP_PARAM_FUNCTION(setup_param_date)
*pos+= length;
}
-SETUP_PARAM_FUNCTION(setup_param_str)
+void set_param_str(Item_param *param, uchar **pos, ulong len)
{
- ulong len= get_param_length(pos);
- param->set_value((const char *)*pos, len);
- *pos+= len;
+ ulong length= get_param_length(pos, len);
+ param->set_value((const char *)*pos, length);
+ *pos+= length;
}
-void setup_param_functions(Item_param *param, uchar param_type)
+static void setup_one_conversion_function(Item_param *param, uchar param_type)
{
switch (param_type) {
case FIELD_TYPE_TINY:
- param->setup_param_func= setup_param_tiny;
+ param->set_param_func= set_param_tiny;
param->item_result_type= INT_RESULT;
break;
case FIELD_TYPE_SHORT:
- param->setup_param_func= setup_param_short;
+ param->set_param_func= set_param_short;
param->item_result_type= INT_RESULT;
break;
case FIELD_TYPE_LONG:
- param->setup_param_func= setup_param_int32;
+ param->set_param_func= set_param_int32;
param->item_result_type= INT_RESULT;
break;
case FIELD_TYPE_LONGLONG:
- param->setup_param_func= setup_param_int64;
+ param->set_param_func= set_param_int64;
param->item_result_type= INT_RESULT;
break;
case FIELD_TYPE_FLOAT:
- param->setup_param_func= setup_param_float;
+ param->set_param_func= set_param_float;
param->item_result_type= REAL_RESULT;
break;
case FIELD_TYPE_DOUBLE:
- param->setup_param_func= setup_param_double;
+ param->set_param_func= set_param_double;
param->item_result_type= REAL_RESULT;
break;
case FIELD_TYPE_TIME:
- param->setup_param_func= setup_param_time;
+ param->set_param_func= set_param_time;
param->item_result_type= STRING_RESULT;
break;
case FIELD_TYPE_DATE:
- param->setup_param_func= setup_param_date;
+ param->set_param_func= set_param_date;
param->item_result_type= STRING_RESULT;
break;
case MYSQL_TYPE_DATETIME:
case MYSQL_TYPE_TIMESTAMP:
- param->setup_param_func= setup_param_datetime;
+ param->set_param_func= set_param_datetime;
param->item_result_type= STRING_RESULT;
break;
default:
- param->setup_param_func= setup_param_str;
+ param->set_param_func= set_param_str;
param->item_result_type= STRING_RESULT;
}
}
@@ -402,14 +441,14 @@ void setup_param_functions(Item_param *param, uchar param_type)
and if binary/update log is set, generate the valid query.
*/
-static bool insert_params_withlog(Prepared_statement *stmt, uchar *pos,
- uchar *read_pos)
+static bool insert_params_withlog(Prepared_statement *stmt, uchar *null_array,
+ uchar *read_pos, uchar *data_end)
{
- THD *thd= stmt->thd;
- List<Item> &params= stmt->lex->param_list;
- List_iterator<Item> param_iterator(params);
- Item_param *param;
-
+ THD *thd= stmt->thd;
+ Item_param **begin= stmt->param_array;
+ Item_param **end= begin + stmt->param_count;
+ uint32 length= 0;
+
String str, query;
const String *res;
@@ -418,16 +457,14 @@ static bool insert_params_withlog(Prepared_statement *stmt, uchar *pos,
if (query.copy(stmt->query, stmt->query_length, default_charset_info))
DBUG_RETURN(1);
- ulong param_no= 0;
- uint32 length= 0;
-
- while ((param= (Item_param *)param_iterator++))
+ for (Item_param **it= begin; it < end; ++it)
{
+ Item_param *param= *it;
if (param->long_data_supplied)
- res= param->query_val_str(&str);
+ res= param->query_val_str(&str);
else
{
- if (is_param_null(pos,param_no))
+ if (is_param_null(null_array, it - begin))
{
param->maybe_null= param->null_value= 1;
res= &my_null_string;
@@ -435,7 +472,9 @@ static bool insert_params_withlog(Prepared_statement *stmt, uchar *pos,
else
{
param->maybe_null= param->null_value= 0;
- param->setup_param_func(param,&read_pos);
+ if (read_pos >= data_end)
+ DBUG_RETURN(1);
+ param->set_param_func(param, &read_pos, data_end - read_pos);
res= param->query_val_str(&str);
}
}
@@ -443,7 +482,6 @@ static bool insert_params_withlog(Prepared_statement *stmt, uchar *pos,
DBUG_RETURN(1);
length+= res->length()-1;
- param_no++;
}
if (alloc_query(thd, (char *)query.ptr(), query.length()+1))
DBUG_RETURN(1);
@@ -452,76 +490,76 @@ static bool insert_params_withlog(Prepared_statement *stmt, uchar *pos,
}
-static bool insert_params(Prepared_statement *stmt, uchar *pos,
- uchar *read_pos)
+static bool insert_params(Prepared_statement *stmt, uchar *null_array,
+ uchar *read_pos, uchar *data_end)
{
- List<Item> &params= stmt->lex->param_list;
- List_iterator<Item> param_iterator(params);
- Item_param *param;
- ulong param_no= 0;
+ Item_param **begin= stmt->param_array;
+ Item_param **end= begin + stmt->param_count;
DBUG_ENTER("insert_params");
- while ((param= (Item_param *)param_iterator++))
+ for (Item_param **it= begin; it < end; ++it)
{
- if (!param->long_data_supplied)
+ Item_param *param= *it;
+ if (!param->long_data_supplied)
{
- if (is_param_null(pos,param_no))
+ if (is_param_null(null_array, it - begin))
param->maybe_null= param->null_value= 1;
else
{
param->maybe_null= param->null_value= 0;
- param->setup_param_func(param,&read_pos);
+ if (read_pos >= data_end)
+ DBUG_RETURN(1);
+ param->set_param_func(param, &read_pos, data_end - read_pos);
}
}
- param_no++;
}
DBUG_RETURN(0);
}
-static bool setup_params_data(Prepared_statement *stmt)
-{
- List<Item> &params= stmt->lex->param_list;
- List_iterator<Item> param_iterator(params);
- Item_param *param;
- uchar *pos= (uchar*) stmt->thd->net.read_pos + 1 +
- MYSQL_STMT_HEADER; //skip header
- uchar *read_pos= pos+(stmt->param_count+7) / 8; //skip null bits
+static bool setup_conversion_functions(Prepared_statement *stmt,
+ uchar **data, uchar *data_end)
+{
+ /* skip null bits */
+ uchar *read_pos= *data + (stmt->param_count+7) / 8;
- DBUG_ENTER("setup_params_data");
+ DBUG_ENTER("setup_conversion_functions");
if (*read_pos++) //types supplied / first execute
- {
+ {
/*
First execute or types altered by the client, setup the
conversion routines for all parameters (one time)
*/
- while ((param= (Item_param *)param_iterator++))
- {
- setup_param_functions(param,*read_pos);
+ Item_param **it= stmt->param_array;
+ Item_param **end= it + stmt->param_count;
+ for (; it < end; ++it)
+ {
+ if (read_pos >= data_end)
+ DBUG_RETURN(1);
+ setup_one_conversion_function(*it, *read_pos);
read_pos+= 2;
}
- param_iterator.rewind();
- }
- stmt->setup_params(stmt,pos,read_pos);
+ }
+ *data= read_pos;
DBUG_RETURN(0);
}
#else
-bool setup_params_data(Prepared_statement *stmt)
-{
- List<Item> &params= stmt->lex->param_list;
- List_iterator<Item> param_iterator(params);
- Item_param *param;
+static bool emb_insert_params(Prepared_statement *stmt)
+{
+ Item_param **it= stmt->param_array;
+ Item_param **end= it + stmt->param_count;
MYSQL_BIND *client_param= stmt->thd->client_params;
- DBUG_ENTER("setup_params_data");
+ DBUG_ENTER("emb_insert_params");
- for (;(param= (Item_param *)param_iterator++); client_param++)
- {
- setup_param_functions(param, client_param->buffer_type);
+ for (; it < end; ++it, ++client_param)
+ {
+ Item_param *param= *it;
+ setup_one_conversion_function(param, client_param->buffer_type);
if (!param->long_data_supplied)
{
if (*client_param->is_null)
@@ -530,39 +568,39 @@ bool setup_params_data(Prepared_statement *stmt)
{
uchar *buff= (uchar*)client_param->buffer;
param->maybe_null= param->null_value= 0;
- param->setup_param_func(param,&buff,
- client_param->length ?
- *client_param->length :
- client_param->buffer_length);
+ param->set_param_func(param, &buff,
+ client_param->length ?
+ *client_param->length :
+ client_param->buffer_length);
}
}
}
DBUG_RETURN(0);
}
-bool setup_params_data_withlog(Prepared_statement *stmt)
-{
+
+static bool emb_insert_params_withlog(Prepared_statement *stmt)
+{
THD *thd= stmt->thd;
- List<Item> &params= stmt->lex->param_list;
- List_iterator<Item> param_iterator(params);
- Item_param *param;
+ Item_param **it= stmt->param_array;
+ Item_param **end= it + stmt->param_count;
MYSQL_BIND *client_param= thd->client_params;
String str, query;
const String *res;
+ uint32 length= 0;
- DBUG_ENTER("setup_params_data_withlog");
+ DBUG_ENTER("emb_insert_params_withlog");
if (query.copy(stmt->query, stmt->query_length, default_charset_info))
DBUG_RETURN(1);
- uint32 length= 0;
-
- for (;(param= (Item_param *)param_iterator++); client_param++)
- {
- setup_param_functions(param, client_param->buffer_type);
+ for (; it < end; ++it, ++client_param)
+ {
+ Item_param *param= *it;
+ setup_one_conversion_function(param, client_param->buffer_type);
if (param->long_data_supplied)
- res= param->query_val_str(&str);
+ res= param->query_val_str(&str);
else
{
if (*client_param->is_null)
@@ -574,16 +612,15 @@ bool setup_params_data_withlog(Prepared_statement *stmt)
{
uchar *buff= (uchar*)client_param->buffer;
param->maybe_null= param->null_value= 0;
- param->setup_param_func(param,&buff,
- client_param->length ?
- *client_param->length :
- client_param->buffer_length);
+ param->set_param_func(param, &buff,
+ client_param->length ?
+ *client_param->length :
+ client_param->buffer_length);
res= param->query_val_str(&str);
}
}
if (query.replace(param->pos_in_query+length, 1, *res))
DBUG_RETURN(1);
-
length+= res->length()-1;
}
@@ -596,15 +633,21 @@ bool setup_params_data_withlog(Prepared_statement *stmt)
#endif /*!EMBEDDED_LIBRARY*/
/*
- Validate the following information for INSERT statement:
- - field existance
- - fields count
+ Validate the following information for INSERT statement:
+ - field existence
+ - fields count
+ SYNOPSIS
+ mysql_test_insert_fields()
+ RETURN VALUE
+ 0 ok
+ 1 error, sent to the client
+ -1 error, not sent to client
*/
-static bool mysql_test_insert_fields(Prepared_statement *stmt,
- TABLE_LIST *table_list,
- List<Item> &fields,
- List<List_item> &values_list)
+static int mysql_test_insert_fields(Prepared_statement *stmt,
+ TABLE_LIST *table_list,
+ List<Item> &fields,
+ List<List_item> &values_list)
{
THD *thd= stmt->thd;
TABLE *table;
@@ -622,8 +665,18 @@ static bool mysql_test_insert_fields(Prepared_statement *stmt,
(grant_option && check_grant(thd,privilege,table_list,0,0)))
DBUG_RETURN(1);
#endif
+
+ /*
+ open temporary memory pool for temporary data allocated by derived
+ tables & preparation procedure
+ */
+ thd->allocate_temporary_memory_pool_for_ps_preparing();
if (open_and_lock_tables(thd, table_list))
- DBUG_RETURN(1);
+ {
+ thd->free_temporary_memory_pool_for_ps_preparing();
+ DBUG_RETURN(-1);
+ }
+
table= table_list->table;
if ((values= its++))
@@ -632,7 +685,11 @@ static bool mysql_test_insert_fields(Prepared_statement *stmt,
ulong counter= 0;
if (check_insert_fields(thd,table,fields,*values,1))
- DBUG_RETURN(1);
+ {
+ thd->free_temporary_memory_pool_for_ps_preparing();
+ DBUG_RETURN(-1);
+ }
+ thd->free_temporary_memory_pool_for_ps_preparing();
value_count= values->elements;
its.rewind();
@@ -645,29 +702,34 @@ static bool mysql_test_insert_fields(Prepared_statement *stmt,
my_printf_error(ER_WRONG_VALUE_COUNT_ON_ROW,
ER(ER_WRONG_VALUE_COUNT_ON_ROW),
MYF(0), counter);
- DBUG_RETURN(1);
+ DBUG_RETURN(-1);
}
}
}
- if (send_prep_stmt(stmt, 0))
- DBUG_RETURN(1);
+ else
+ {
+ thd->free_temporary_memory_pool_for_ps_preparing();
+ }
DBUG_RETURN(0);
}
/*
- Validate the following information
- UPDATE - set and where clause DELETE - where clause
-
- And send update-set clause column list fields info
- back to client. For DELETE, just validate where clause
- and return no fields information back to client.
+ Validate the following information:
+ UPDATE - set and where clause
+ DELETE - where clause
+ SYNOPSIS
+ mysql_test_upd_fields()
+ RETURN VALUE
+ 0 success
+ 1 error, sent to client
+ -1 error, not sent to client
*/
-static bool mysql_test_upd_fields(Prepared_statement *stmt,
- TABLE_LIST *table_list,
- List<Item> &fields, List<Item> &values,
- COND *conds)
+static int mysql_test_upd_fields(Prepared_statement *stmt,
+ TABLE_LIST *table_list,
+ List<Item> &fields, List<Item> &values,
+ COND *conds)
{
THD *thd= stmt->thd;
@@ -678,48 +740,59 @@ static bool mysql_test_upd_fields(Prepared_statement *stmt,
(grant_option && check_grant(thd,UPDATE_ACL,table_list,0,0)))
DBUG_RETURN(1);
#endif
- if (open_and_lock_tables(thd, table_list))
- DBUG_RETURN(1);
- if (setup_tables(table_list, 0) ||
- setup_fields(thd, 0, table_list, fields, 1, 0, 0) ||
- setup_conds(thd, table_list, &conds) || thd->net.report_error)
- DBUG_RETURN(1);
/*
- Currently return only column list info only, and we are not
- sending any info on where clause.
+ open temporary memory pool for temporary data allocated by derived
+ tables & preparation procedure
*/
- if (send_prep_stmt(stmt, 0))
- DBUG_RETURN(1);
+ thd->allocate_temporary_memory_pool_for_ps_preparing();
+
+ if (open_and_lock_tables(thd, table_list))
+ goto err;
+ if (setup_tables(table_list) ||
+ setup_fields(thd, 0, table_list, fields, 1, 0, 0) ||
+ setup_conds(thd, table_list, &conds) || thd->net.report_error)
+ goto err;
+
+ thd->free_temporary_memory_pool_for_ps_preparing();
+
+ /* TODO: here we should send types of placeholders to the client. */
DBUG_RETURN(0);
+err:
+ thd->free_temporary_memory_pool_for_ps_preparing();
+ DBUG_RETURN(-1);
}
/*
- Validate the following information:
-
+ Validate the following information:
SELECT - column list
- where clause
- order clause
- having clause
- group by clause
- if no column spec i.e. '*', then setup all fields
-
- And send column list fields info back to client.
+ In case of success, if this query is not EXPLAIN, send column list info
+ back to client.
+ SYNOPSIS
+ mysql_test_select_fields()
+ RETURN VALUE
+ 0 success
+ 1 error, sent to client
+ -1 error, not sent to client
*/
-static bool mysql_test_select_fields(Prepared_statement *stmt,
- TABLE_LIST *tables,
- uint wild_num,
- List<Item> &fields, COND *conds,
- uint og_num, ORDER *order, ORDER *group,
- Item *having, ORDER *proc,
- ulong select_options,
- SELECT_LEX_UNIT *unit,
- SELECT_LEX *select_lex)
+static int mysql_test_select_fields(Prepared_statement *stmt,
+ TABLE_LIST *tables,
+ uint wild_num,
+ List<Item> &fields, COND *conds,
+ uint og_num, ORDER *order, ORDER *group,
+ Item *having, ORDER *proc,
+ ulong select_options,
+ SELECT_LEX_UNIT *unit,
+ SELECT_LEX *select_lex)
{
THD *thd= stmt->thd;
LEX *lex= stmt->lex;
- select_result *result= lex->result;
DBUG_ENTER("mysql_test_select_fields");
@@ -730,142 +803,166 @@ static bool mysql_test_select_fields(Prepared_statement *stmt,
if (check_table_access(thd, privilege, tables,0))
DBUG_RETURN(1);
}
- else if (check_access(thd, privilege, "*any*",0,0,0))
+ else if (check_access(thd, privilege, any_db,0,0,0))
DBUG_RETURN(1);
#endif
if ((&lex->select_lex != lex->all_selects_list &&
lex->unit.create_total_list(thd, lex, &tables)))
DBUG_RETURN(1);
-
+
+ /*
+ open temporary memory pool for temporary data allocated by derived
+ tables & preparation procedure
+ */
+ thd->allocate_temporary_memory_pool_for_ps_preparing();
if (open_and_lock_tables(thd, tables))
- DBUG_RETURN(1);
+ {
+ send_error(thd);
+ goto err;
+ }
if (lex->describe)
{
if (send_prep_stmt(stmt, 0))
- DBUG_RETURN(1);
+ goto err;
}
else
{
+ select_result *result= lex->result;
if (!result && !(result= new select_send()))
{
send_error(thd, ER_OUT_OF_RESOURCES);
- DBUG_RETURN(1);
+ goto err;
}
- JOIN *join= new JOIN(thd, fields, select_options, result);
- thd->used_tables= 0; // Updated by setup_fields
+ thd->used_tables= 0; // Updated by setup_fields
+
+ if (unit->prepare(thd, result, 0))
+ {
+ send_error(thd);
+ goto err_prep;
+ }
- if (join->prepare(&select_lex->ref_pointer_array,
- (TABLE_LIST*)select_lex->get_table_list(),
- wild_num, conds, og_num, order, group, having, proc,
- select_lex, unit))
- DBUG_RETURN(1);
if (send_prep_stmt(stmt, fields.elements) ||
thd->protocol_simple.send_fields(&fields, 0)
#ifndef EMBEDDED_LIBRARY
- || net_flush(&thd->net)
+ || net_flush(&thd->net)
#endif
)
- DBUG_RETURN(1);
- join->cleanup();
+ goto err_prep;
+
+ unit->cleanup();
}
- DBUG_RETURN(0);
+ thd->free_temporary_memory_pool_for_ps_preparing();
+ DBUG_RETURN(0);
+
+err_prep:
+ unit->cleanup();
+err:
+ thd->free_temporary_memory_pool_for_ps_preparing();
+ DBUG_RETURN(1);
}
/*
- Send the prepare query results back to client
+ Send the prepare query results back to client
+ SYNOPSIS
+ send_prepare_results()
+ stmt prepared statement
+ RETURN VALUE
+ 0 success
+ 1 error, sent to client
*/
-static bool send_prepare_results(Prepared_statement *stmt)
+static int send_prepare_results(Prepared_statement *stmt)
{
THD *thd= stmt->thd;
LEX *lex= stmt->lex;
+ SELECT_LEX *select_lex= &lex->select_lex;
+ TABLE_LIST *tables=(TABLE_LIST*) select_lex->table_list.first;
enum enum_sql_command sql_command= lex->sql_command;
+ int res;
DBUG_ENTER("send_prepare_results");
DBUG_PRINT("enter",("command: %d, param_count: %ld",
- sql_command, lex->param_count));
-
- /* Setup prepared stmt */
- stmt->param_count= lex->param_count;
-
- SELECT_LEX *select_lex= &lex->select_lex;
- TABLE_LIST *tables=(TABLE_LIST*) select_lex->table_list.first;
+ sql_command, stmt->param_count));
switch (sql_command) {
case SQLCOM_INSERT:
- if (mysql_test_insert_fields(stmt, tables, lex->field_list,
- lex->many_values))
- goto abort;
+ if ((res= mysql_test_insert_fields(stmt, tables, lex->field_list,
+ lex->many_values)))
+ goto error;
break;
case SQLCOM_UPDATE:
- if (mysql_test_upd_fields(stmt, tables, select_lex->item_list,
- lex->value_list, select_lex->where))
- goto abort;
- break;
-
+ /* XXX: fallthrough */
case SQLCOM_DELETE:
- if (mysql_test_upd_fields(stmt, tables, select_lex->item_list,
- lex->value_list, select_lex->where))
- goto abort;
+ if ((res= mysql_test_upd_fields(stmt, tables, select_lex->item_list,
+ lex->value_list, select_lex->where)))
+ goto error;
break;
case SQLCOM_SELECT:
- if (mysql_test_select_fields(stmt, tables, select_lex->with_wild,
- select_lex->item_list,
- select_lex->where,
- select_lex->order_list.elements +
- select_lex->group_list.elements,
- (ORDER*) select_lex->order_list.first,
- (ORDER*) select_lex->group_list.first,
- select_lex->having,
- (ORDER*)lex->proc_list.first,
- select_lex->options | thd->options,
- &(lex->unit), select_lex))
- goto abort;
- break;
+ if ((res= mysql_test_select_fields(stmt, tables, select_lex->with_wild,
+ select_lex->item_list,
+ select_lex->where,
+ select_lex->order_list.elements +
+ select_lex->group_list.elements,
+ (ORDER*) select_lex->order_list.first,
+ (ORDER*) select_lex->group_list.first,
+ select_lex->having,
+ (ORDER*)lex->proc_list.first,
+ select_lex->options | thd->options,
+ &(lex->unit), select_lex)))
+ goto error;
+ /* Statement and field info has already been sent */
+ DBUG_RETURN(0);
default:
- {
- /*
- Rest fall through to default category, no parsing
- for non-DML statements
- */
- if (send_prep_stmt(stmt, 0))
- goto abort;
- }
+ /*
+ Rest fall through to default category, no parsing
+ for non-DML statements
+ */
+ break;
}
- DBUG_RETURN(0);
+ DBUG_RETURN(send_prep_stmt(stmt, 0));
-abort:
- send_error(thd,thd->killed_errno());
+error:
+ if (res < 0)
+ send_error(thd,thd->killed_errno());
DBUG_RETURN(1);
}
/*
- Initialize parameter items in statement
+ Initialize array of parametes in statement from LEX.
+ (We need to have quick access to items by number in mysql_send_longdata).
+ This is to avoid using malloc/realloc in the parser.
*/
-static bool init_param_items(Prepared_statement *stmt)
+static bool init_param_array(Prepared_statement *stmt)
{
- Item_param **to;
-
- if (!stmt->param_count)
- stmt->param= (Item_param **)0;
- else
- {
- if (!(stmt->param= to= (Item_param **)
- my_malloc(sizeof(Item_param *)*(stmt->param_count+1),
- MYF(MY_WME))))
+ LEX *lex= stmt->lex;
+ if ((stmt->param_count= lex->param_list.elements))
+ {
+ Item_param **to;
+ List_iterator<Item_param> param_iterator(lex->param_list);
+ /* Use thd->mem_root as it points at statement mem_root */
+ stmt->param_array= (Item_param **)
+ alloc_root(&stmt->thd->mem_root,
+ sizeof(Item_param*) * stmt->param_count);
+ if (!stmt->param_array)
+ {
+ send_error(stmt->thd, ER_OUT_OF_RESOURCES);
return 1;
-
- List_iterator<Item> param_iterator(stmt->lex->param_list);
- while ((*(to++)= (Item_param *)param_iterator++));
- }
+ }
+ for (to= stmt->param_array;
+ to < stmt->param_array + stmt->param_count;
+ ++to)
+ {
+ *to= param_iterator++;
+ }
+ }
return 0;
}
@@ -873,72 +970,71 @@ static bool init_param_items(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. with out any log/disk
+ 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_list, so that a fast and direct
- retrieval can be made without going through all field
- items.
+ 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.
*/
-bool mysql_stmt_prepare(THD *thd, char *packet, uint packet_length)
+void mysql_stmt_prepare(THD *thd, char *packet, uint packet_length)
{
LEX *lex;
Prepared_statement *stmt= new Prepared_statement(thd);
- SELECT_LEX *sl;
+ int error;
DBUG_ENTER("mysql_stmt_prepare");
+ DBUG_PRINT("prep_query", ("%s", packet));
+
if (stmt == 0)
- DBUG_RETURN(0);
+ {
+ send_error(thd, ER_OUT_OF_RESOURCES);
+ DBUG_VOID_RETURN;
+ }
if (thd->stmt_map.insert(stmt))
- goto insert_stmt_err;
+ {
+ delete stmt;
+ send_error(thd, ER_OUT_OF_RESOURCES);
+ DBUG_VOID_RETURN;
+ }
thd->stmt_backup.set_statement(thd);
+ thd->stmt_backup.set_item_arena(thd);
thd->set_statement(stmt);
+ thd->set_item_arena(stmt);
if (alloc_query(thd, packet, packet_length))
- goto alloc_query_err;
+ {
+ stmt->set_statement(thd);
+ stmt->set_item_arena(thd);
+ thd->set_statement(&thd->stmt_backup);
+ thd->set_item_arena(&thd->stmt_backup);
+ /* Statement map deletes statement on erase */
+ thd->stmt_map.erase(stmt);
+ send_error(thd, ER_OUT_OF_RESOURCES);
+ DBUG_VOID_RETURN;
+ }
- mysql_log.write(thd, COM_PREPARE, "%s", packet);
+ mysql_log.write(thd, COM_PREPARE, "%s", packet);
+ thd->current_statement= stmt;
lex= lex_start(thd, (uchar *) thd->query, thd->query_length);
mysql_init_query(thd);
lex->safe_to_cache_query= 0;
- lex->param_count= 0;
- if (yyparse((void *)thd) || thd->is_fatal_error || send_prepare_results(stmt))
- goto yyparse_err;
-
- lex_end(lex);
+ error= yyparse((void *)thd) || thd->is_fatal_error ||
+ init_param_array(stmt) ||
+ send_prepare_results(stmt);
+ /* restore to WAIT_PRIOR: QUERY_PRIOR is set inside alloc_query */
if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(),WAIT_PRIOR);
-
- // save WHERE clause pointers to avoid damaging they by optimisation
- for (sl= thd->lex->all_selects_list;
- sl;
- sl= sl->next_select_in_list())
- {
- sl->prep_where= sl->where;
- }
-
- cleanup_items(thd->free_list);
- stmt->set_statement(thd);
- thd->set_statement(&thd->stmt_backup);
-
- if (init_param_items(stmt))
- goto init_param_err;
-
- stmt->command= COM_EXECUTE; // set it only once here
-
- DBUG_RETURN(0);
-
-yyparse_err:
- if (thd->lex->sphead)
+ if (error && thd->lex->sphead)
{
if (lex != thd->lex)
thd->lex->sphead->restore_lex(thd);
@@ -947,171 +1043,221 @@ yyparse_err:
}
lex_end(lex);
stmt->set_statement(thd);
+ stmt->set_item_arena(thd);
thd->set_statement(&thd->stmt_backup);
-init_param_err:
-alloc_query_err:
- /* Statement map deletes statement on erase */
- thd->stmt_map.erase(stmt);
- DBUG_RETURN(1);
-insert_stmt_err:
- delete stmt;
- DBUG_RETURN(1);
+ thd->set_item_arena(&thd->stmt_backup);
+ thd->current_statement= 0;
+
+ if (error)
+ {
+ /* Statement map deletes statement on erase */
+ thd->stmt_map.erase(stmt);
+ /* error is sent inside yyparse/send_prepare_results */
+ }
+ else
+ {
+ SELECT_LEX *sl= stmt->lex->all_selects_list;
+ /*
+ Save WHERE clause pointers, because they may be changed during query
+ optimisation.
+ */
+ for (; sl; sl= sl->next_select_in_list())
+ {
+ sl->prep_where= sl->where;
+ }
+ }
+ DBUG_VOID_RETURN;
}
+/* Reinit statement before execution */
-/*
- Executes previously prepared query
+static void reset_stmt_for_execute(Prepared_statement *stmt)
+{
+ THD *thd= stmt->thd;
+ SELECT_LEX *sl= stmt->lex->all_selects_list;
- If there is any parameters (stmt->param_count), then replace
- markers with the data supplied from client, and then
- execute the query
+ for (; sl; sl= sl->next_select_in_list())
+ {
+ /*
+ Copy WHERE clause pointers to avoid damaging they by optimisation
+ */
+ if (sl->prep_where)
+ sl->where= sl->prep_where->copy_andor_structure(thd);
+ DBUG_ASSERT(sl->join == 0);
+ ORDER *order;
+ /* Fix GROUP list */
+ for (order= (ORDER *)sl->group_list.first; order; order= order->next)
+ order->item= &order->item_ptr;
+ /* Fix ORDER list */
+ for (order= (ORDER *)sl->order_list.first; order; order= order->next)
+ order->item= &order->item_ptr;
+
+ /*
+ TODO: When the new table structure is ready, then have a status bit
+ to indicate the table is altered, and re-do the setup_*
+ and open the tables back.
+ */
+ for (TABLE_LIST *tables= (TABLE_LIST*) sl->table_list.first;
+ tables;
+ tables= tables->next)
+ {
+ /*
+ Reset old pointers to TABLEs: they are not valid since the tables
+ were closed in the end of previous prepare or execute call.
+ */
+ tables->table= 0;
+ tables->table_list= 0;
+ }
+
+ {
+ SELECT_LEX_UNIT *unit= sl->master_unit();
+ unit->unclean();
+ unit->types.empty();
+ /* for derived tables & PS (which can't be reset by Item_subquery) */
+ unit->reinit_exec_mechanism();
+ }
+ }
+}
+
+/*
+ Executes previously prepared query.
+ If there is any parameters, then replace markers with the data supplied
+ from client, and then execute the query.
+ SYNOPSYS
+ mysql_stmt_execute()
*/
-void mysql_stmt_execute(THD *thd, char *packet)
+
+void mysql_stmt_execute(THD *thd, char *packet, uint packet_length)
{
ulong stmt_id= uint4korr(packet);
+#ifndef EMBEDDED_LIBRARY
+ uchar *packet_end= (uchar *) packet + packet_length - 1;
+#endif
Prepared_statement *stmt;
-
DBUG_ENTER("mysql_stmt_execute");
+
+ packet+= 9; /* stmt_id + 5 bytes of flags */
- if (!(stmt= find_prepared_statement(thd, stmt_id, "execute")))
+ if (!(stmt= find_prepared_statement(thd, stmt_id, "execute", SEND_ERROR)))
DBUG_VOID_RETURN;
+ DBUG_PRINT("exec_query:", ("%s", stmt->query));
+
/* Check if we got an error when sending long data */
- if (stmt->error_in_prepare)
+ if (stmt->get_longdata_error)
{
send_error(thd, stmt->last_errno, stmt->last_error);
DBUG_VOID_RETURN;
}
- stmt->query_id= thd->query_id;
thd->stmt_backup.set_statement(thd);
thd->set_statement(stmt);
- thd->free_list= 0;
-
- /*
- To make sure that all runtime data is stored in its own memory root and
- does not interfere with data possibly present in thd->mem_root.
- This root is cleaned up in the end of execution.
- FIXME: to be replaced with more efficient approach, and verified why we
- can not use thd->mem_root safely.
- */
- init_sql_alloc(&thd->mem_root,
- thd->variables.query_alloc_block_size,
- thd->variables.query_prealloc_size);
+ reset_stmt_for_execute(stmt);
- for (SELECT_LEX *sl= stmt->lex->all_selects_list;
- sl;
- sl= sl->next_select_in_list())
+#ifndef EMBEDDED_LIBRARY
+ if (stmt->param_count)
{
- /*
- Copy WHERE clause pointers to avoid damaging they by optimisation
- */
- if (sl->prep_where)
- sl->where= sl->prep_where->copy_andor_structure(thd);
- DBUG_ASSERT(sl->join == 0);
- ORDER *order;
- /* Fix GROUP list */
- for (order=(ORDER *)sl->group_list.first ; order ; order=order->next)
- order->item= (Item **)(order+1);
- /* Fix ORDER list */
- for (order=(ORDER *)sl->order_list.first ; order ; order=order->next)
- order->item= (Item **)(order+1);
+ uchar *null_array= (uchar *) packet;
+ if (setup_conversion_functions(stmt, (uchar **) &packet, packet_end) ||
+ stmt->set_params(stmt, null_array, (uchar *) packet, packet_end))
+ goto set_params_data_err;
}
-
+#else
/*
- TODO: When the new table structure is ready, then have a status bit
- to indicate the table is altered, and re-do the setup_*
- and open the tables back.
+ In embedded library we re-install conversion routines each time
+ we set params, and also we don't need to parse packet.
+ So we do it in one function.
*/
- for (TABLE_LIST *tables= (TABLE_LIST*) stmt->lex->select_lex.table_list.first;
- tables;
- tables= tables->next)
- tables->table= 0; // safety - nasty init
-
-#ifndef EMBEDDED_LIBRARY
- if (stmt->param_count && setup_params_data(stmt))
- DBUG_VOID_RETURN;
-#else
- if (stmt->param_count && (*stmt->setup_params_data)(stmt))
- DBUG_VOID_RETURN;
+ if (stmt->param_count && stmt->set_params_data(stmt))
+ goto set_params_data_err;
#endif
if (!(specialflag & SPECIAL_NO_PRIOR))
- my_pthread_setprio(pthread_self(),QUERY_PRIOR);
+ my_pthread_setprio(pthread_self(),QUERY_PRIOR);
/*
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 ..
- */
- thd->protocol= &thd->protocol_prep; // Switch to binary protocol
+ */
+ thd->protocol= &thd->protocol_prep; // Switch to binary protocol
mysql_execute_command(thd);
- thd->protocol= &thd->protocol_simple; // Use normal protocol
+ thd->protocol= &thd->protocol_simple; // Use normal protocol
if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(), WAIT_PRIOR);
- free_items(thd->free_list);
cleanup_items(stmt->free_list);
- free_root(&thd->mem_root, MYF(0));
+ close_thread_tables(thd); // to close derived tables
+ thd->set_statement(&thd->stmt_backup);
+ DBUG_VOID_RETURN;
+
+set_params_data_err:
thd->set_statement(&thd->stmt_backup);
+ my_error(ER_WRONG_ARGUMENTS, MYF(0), "mysql_execute");
+ send_error(thd);
DBUG_VOID_RETURN;
}
/*
- Reset a prepared statement
-
+ Reset a prepared statement, in case there was an error in send_longdata.
+ Note: we don't send any reply to that command.
SYNOPSIS
mysql_stmt_reset()
thd Thread handle
- packet Packet with stmt handle
+ packet Packet with stmt id
DESCRIPTION
This function is useful when one gets an error after calling
- mysql_stmt_getlongdata() and one wants to reset the handle
+ mysql_stmt_getlongdata() and wants to reset the handle
so that one can call execute again.
+ See also bug #1664
*/
void mysql_stmt_reset(THD *thd, char *packet)
{
+ /* There is always space for 4 bytes in buffer */
ulong stmt_id= uint4korr(packet);
Prepared_statement *stmt;
DBUG_ENTER("mysql_stmt_reset");
- if (!(stmt= find_prepared_statement(thd, stmt_id, "reset")))
+ if (!(stmt= find_prepared_statement(thd, stmt_id, "reset", DONT_SEND_ERROR)))
DBUG_VOID_RETURN;
- stmt->error_in_prepare= 0;
- Item_param *item= *stmt->param, *end= item + stmt->param_count;
+ stmt->get_longdata_error= 0;
/* Free long data if used */
if (stmt->long_data_used)
{
+ Item_param **item= stmt->param_array;
+ Item_param **end= item + stmt->param_count;
stmt->long_data_used= 0;
for (; item < end ; item++)
- item->reset();
+ (**item).reset();
}
DBUG_VOID_RETURN;
}
/*
- Delete a prepared statement from memory
+ Delete a prepared statement from memory.
+ Note: we don't send any reply to that command.
*/
void mysql_stmt_free(THD *thd, char *packet)
{
+ /* There is always space for 4 bytes in packet buffer */
ulong stmt_id= uint4korr(packet);
Prepared_statement *stmt;
DBUG_ENTER("mysql_stmt_free");
- if (!(stmt= find_prepared_statement(thd, stmt_id, "close")))
+ if (!(stmt= find_prepared_statement(thd, stmt_id, "close", DONT_SEND_ERROR)))
DBUG_VOID_RETURN;
/* Statement map deletes statement on erase */
@@ -1121,7 +1267,7 @@ void mysql_stmt_free(THD *thd, char *packet)
/*
- Long data in pieces from client
+ Long data in pieces from client
SYNOPSIS
mysql_stmt_get_longdata()
@@ -1157,14 +1303,15 @@ void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length)
ulong stmt_id= uint4korr(pos);
uint param_number= uint2korr(pos+4);
- if (!(stmt=find_prepared_statement(thd, stmt_id, "get_longdata")))
+ if (!(stmt=find_prepared_statement(thd, stmt_id, "get_longdata",
+ DONT_SEND_ERROR)))
DBUG_VOID_RETURN;
#ifndef EMBEDDED_LIBRARY
if (param_number >= stmt->param_count)
{
/* Error will be sent in execute call */
- stmt->error_in_prepare= 1;
+ stmt->get_longdata_error= 1;
stmt->last_errno= ER_WRONG_ARGUMENTS;
sprintf(stmt->last_error, ER(ER_WRONG_ARGUMENTS), "get_longdata");
DBUG_VOID_RETURN;
@@ -1172,7 +1319,7 @@ void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length)
pos+= MYSQL_LONG_DATA_HEADER; // Point to data
#endif
- Item_param *param= *(stmt->param+param_number);
+ Item_param *param= stmt->param_array[param_number];
#ifndef EMBEDDED_LIBRARY
param->set_longdata(pos, packet_length-MYSQL_LONG_DATA_HEADER-1);
#else
@@ -1186,10 +1333,10 @@ void mysql_stmt_get_longdata(THD *thd, char *pos, ulong packet_length)
Prepared_statement::Prepared_statement(THD *thd_arg)
:Statement(thd_arg),
thd(thd_arg),
- param(0),
+ param_array(0),
param_count(0),
last_errno(0),
- error_in_prepare(0),
+ get_longdata_error(0),
long_data_used(0),
log_full_query(0)
{
@@ -1198,23 +1345,22 @@ Prepared_statement::Prepared_statement(THD *thd_arg)
{
log_full_query= 1;
#ifndef EMBEDDED_LIBRARY
- setup_params= insert_params_withlog;
+ set_params= insert_params_withlog;
#else
- setup_params_data= setup_params_data_withlog;
+ set_params_data= emb_insert_params_withlog;
#endif
}
else
#ifndef EMBEDDED_LIBRARY
- setup_params= insert_params; // not fully qualified query
+ set_params= insert_params;
#else
- setup_params_data= ::setup_params_data;
+ set_params_data= emb_insert_params;
#endif
}
Prepared_statement::~Prepared_statement()
{
- my_free((char *) param, MYF(MY_ALLOW_ZERO_PTR));
free_items(free_list);
}
@@ -1224,4 +1370,3 @@ Statement::Type Prepared_statement::type() const
return PREPARED_STATEMENT;
}
-
diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc
index 29b4f2f4a01..a1676aed78d 100644
--- a/sql/sql_rename.cc
+++ b/sql/sql_rename.cc
@@ -24,6 +24,8 @@
static TABLE_LIST *rename_tables(THD *thd, TABLE_LIST *table_list,
bool skip_error);
+static TABLE_LIST *reverse_table_list(TABLE_LIST *table_list);
+
/*
Every second entry in the table_list is the original name and every
second entry is the new name.
@@ -46,6 +48,8 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list)
DBUG_RETURN(1);
}
+ if (wait_if_global_read_lock(thd,0))
+ DBUG_RETURN(1);
VOID(pthread_mutex_lock(&LOCK_open));
if (lock_table_names(thd, table_list))
goto err;
@@ -54,17 +58,10 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list)
if ((ren_table=rename_tables(thd,table_list,0)))
{
/* Rename didn't succeed; rename back the tables in reverse order */
- TABLE_LIST *prev=0,*table;
- /* Reverse the table list */
+ TABLE_LIST *table;
- while (table_list)
- {
- TABLE_LIST *next=table_list->next;
- table_list->next=prev;
- prev=table_list;
- table_list=next;
- }
- table_list=prev;
+ /* Reverse the table list */
+ table_list= reverse_table_list(table_list);
/* Find the last renamed table */
for (table=table_list ;
@@ -73,6 +70,10 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list)
table=table->next->next; // Skip error table
/* Revert to old names */
rename_tables(thd, table, 1);
+
+ /* Revert the table list (for prepared statements) */
+ table_list= reverse_table_list(table_list);
+
error= 1;
}
@@ -92,11 +93,37 @@ bool mysql_rename_tables(THD *thd, TABLE_LIST *table_list)
err:
pthread_mutex_unlock(&LOCK_open);
+ start_waiting_global_read_lock(thd);
DBUG_RETURN(error);
}
/*
+ reverse table list
+
+ SYNOPSIS
+ reverse_table_list()
+ table_list pointer to table _list
+
+ RETURN
+ pointer to new (reversed) list
+*/
+static TABLE_LIST *reverse_table_list(TABLE_LIST *table_list)
+{
+ TABLE_LIST *prev= 0;
+
+ while (table_list)
+ {
+ TABLE_LIST *next= table_list->next;
+ table_list->next= prev;
+ prev= table_list;
+ table_list= next;
+ }
+ return (prev);
+}
+
+
+/*
Rename all tables in list; Return pointer to wrong entry if something goes
wrong. Note that the table_list may be empty!
*/
@@ -111,19 +138,31 @@ rename_tables(THD *thd, TABLE_LIST *table_list, bool skip_error)
{
db_type table_type;
char name[FN_REFLEN];
- new_table=ren_table->next;
+ const char *new_alias, *old_alias;
+ new_table=ren_table->next;
+ if (lower_case_table_names == 2)
+ {
+ old_alias= ren_table->alias;
+ new_alias= new_table->alias;
+ }
+ else
+ {
+ old_alias= ren_table->real_name;
+ new_alias= new_table->real_name;
+ }
sprintf(name,"%s/%s/%s%s",mysql_data_home,
- new_table->db,new_table->real_name,
- reg_ext);
+ new_table->db, new_alias, reg_ext);
+ unpack_filename(name, name);
if (!access(name,F_OK))
{
- my_error(ER_TABLE_EXISTS_ERROR,MYF(0),name);
+ my_error(ER_TABLE_EXISTS_ERROR,MYF(0),new_alias);
DBUG_RETURN(ren_table); // This can't be skipped
}
sprintf(name,"%s/%s/%s%s",mysql_data_home,
- ren_table->db,ren_table->real_name,
+ ren_table->db, old_alias,
reg_ext);
+ unpack_filename(name, name);
if ((table_type=get_table_type(name)) == DB_TYPE_UNKNOWN)
{
my_error(ER_FILE_NOT_FOUND, MYF(0), name, my_errno);
@@ -131,8 +170,8 @@ rename_tables(THD *thd, TABLE_LIST *table_list, bool skip_error)
DBUG_RETURN(ren_table);
}
else if (mysql_rename_table(table_type,
- ren_table->db, ren_table->real_name,
- new_table->db, new_table->real_name))
+ ren_table->db, old_alias,
+ new_table->db, new_alias))
{
if (!skip_error)
DBUG_RETURN(ren_table);
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc
index 5ba2e3178ff..98bf4e86aba 100644
--- a/sql/sql_repl.cc
+++ b/sql/sql_repl.cc
@@ -760,8 +760,6 @@ err:
int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
{
int slave_errno= 0;
- if (!thd)
- thd = current_thd;
int thread_mask;
DBUG_ENTER("start_slave");
diff --git a/sql/sql_repl.h b/sql/sql_repl.h
index 2ff38029b7b..c39ef90114d 100644
--- a/sql/sql_repl.h
+++ b/sql/sql_repl.h
@@ -12,7 +12,7 @@ typedef struct st_slave_info
THD* thd;
} SLAVE_INFO;
-extern my_bool opt_show_slave_auth_info, opt_old_rpl_compat;
+extern my_bool opt_show_slave_auth_info;
extern char *master_host, *master_info_file;
extern bool server_id_supplied;
extern I_List<i_string> binlog_do_db, binlog_ignore_db;
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 8ee0601eb79..6004778781d 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -71,8 +71,10 @@ static int return_zero_rows(JOIN *join, select_result *res,TABLE_LIST *tables,
uint select_options, const char *info,
Item *having, Procedure *proc,
SELECT_LEX_UNIT *unit);
-static COND *optimize_cond(COND *conds,Item::cond_result *cond_value);
-static COND *remove_eq_conds(COND *cond,Item::cond_result *cond_value);
+static COND *optimize_cond(THD *thd, COND *conds,
+ Item::cond_result *cond_value);
+static COND *remove_eq_conds(THD *thd, COND *cond,
+ Item::cond_result *cond_value);
static bool const_expression_in_where(COND *conds,Item *item, Item **comp_item);
static bool open_tmp_table(TABLE *table);
static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param,
@@ -292,6 +294,10 @@ JOIN::prepare(Item ***rref_pointer_array,
{
DBUG_ENTER("JOIN::prepare");
+ // to prevent double initialization on EXPLAIN
+ if (optimized)
+ DBUG_RETURN(0);
+
conds= conds_init;
order= order_init;
group_list= group_init;
@@ -304,7 +310,7 @@ JOIN::prepare(Item ***rref_pointer_array,
/* Check that all tables, fields, conds and order are ok */
- if (setup_tables(tables_list, 0) ||
+ if (setup_tables(tables_list) ||
setup_wild(thd, tables_list, fields_list, &all_fields, wild_num) ||
select_lex->setup_ref_array(thd, og_num) ||
setup_fields(thd, (*rref_pointer_array), tables_list, fields_list, 1,
@@ -321,8 +327,9 @@ JOIN::prepare(Item ***rref_pointer_array,
thd->where="having clause";
thd->allow_sum_func=1;
select_lex->having_fix_field= 1;
- bool having_fix_rc= (having->fix_fields(thd, tables_list, &having) ||
- having->check_cols(1));
+ bool having_fix_rc= (!having->fixed &&
+ (having->fix_fields(thd, tables_list, &having) ||
+ having->check_cols(1)));
select_lex->having_fix_field= 0;
if (having_fix_rc || thd->net.report_error)
DBUG_RETURN(-1); /* purecov: inspected */
@@ -333,8 +340,7 @@ JOIN::prepare(Item ***rref_pointer_array,
// Is it subselect
{
Item_subselect *subselect;
- if ((subselect= select_lex->master_unit()->item) &&
- select_lex->linkage != GLOBAL_OPTIONS_TYPE)
+ if ((subselect= select_lex->master_unit()->item))
{
Item_subselect::trans_res res;
if ((res= subselect->select_transformer(this)) !=
@@ -525,7 +531,7 @@ JOIN::optimize()
}
#endif
- conds= optimize_cond(conds,&cond_value);
+ conds= optimize_cond(thd, conds, &cond_value);
if (thd->net.report_error)
{
error= 1;
@@ -591,7 +597,10 @@ JOIN::optimize()
DBUG_RETURN(1); // error == -1
}
if (const_table_map != found_const_table_map &&
- !(select_options & SELECT_DESCRIBE))
+ !(select_options & SELECT_DESCRIBE) &&
+ (!conds ||
+ !(conds->used_tables() & RAND_TABLE_BIT) ||
+ select_lex->master_unit() == &thd->lex->unit)) // upper level SELECT
{
zero_result_cause= "no matching row in const table";
DBUG_PRINT("error",("Error: %s", zero_result_cause));
@@ -849,8 +858,7 @@ JOIN::optimize()
for (uint i_h = const_tables; i_h < tables; i_h++)
{
TABLE* table_h = join_tab[i_h].table;
- if (table_h->db_type == DB_TYPE_INNODB)
- table_h->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS);
+ table_h->file->extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY);
}
}
#endif
@@ -1015,7 +1023,7 @@ JOIN::reinit()
/* TODO move to unit reinit */
unit->set_limit(select_lex, select_lex);
- if (setup_tables(tables_list, 1))
+ if (setup_tables(tables_list))
DBUG_RETURN(1);
/* Reset of sum functions */
@@ -1082,7 +1090,7 @@ JOIN::exec()
if (!tables_list)
{ // Only test of functions
if (select_options & SELECT_DESCRIBE)
- select_describe(this, false, false, false,
+ select_describe(this, FALSE, FALSE, FALSE,
(zero_result_cause?zero_result_cause:"No tables used"));
else
{
@@ -1421,9 +1429,17 @@ JOIN::exec()
if (!curr_table->select->cond)
curr_table->select->cond= sort_table_cond;
else // This should never happen
+ {
if (!(curr_table->select->cond=
- new Item_cond_and(curr_table->select->cond, sort_table_cond)))
+ new Item_cond_and(curr_table->select->cond,
+ sort_table_cond)))
DBUG_VOID_RETURN;
+ /*
+ Item_cond_and do not need fix_fields for execution, its parameters
+ are fixed or do not need fix_fields, too
+ */
+ curr_table->select->cond->quick_fix_field();
+ }
curr_table->select_cond= curr_table->select->cond;
curr_table->select_cond->top_level_item();
DBUG_EXECUTE("where",print_where(curr_table->select->cond,
@@ -1520,10 +1536,10 @@ JOIN::cleanup()
lock=0; // It's faster to unlock later
join_free(1);
- if (exec_tmp_table1)
- free_tmp_table(thd, exec_tmp_table1);
- if (exec_tmp_table2)
- free_tmp_table(thd, exec_tmp_table2);
+ if (exec_tmp_table1)
+ free_tmp_table(thd, exec_tmp_table1);
+ if (exec_tmp_table2)
+ free_tmp_table(thd, exec_tmp_table2);
delete select;
delete_dynamic(&keyuse);
delete procedure;
@@ -2145,8 +2161,8 @@ add_key_field(KEY_FIELD **key_fields,uint and_level, COND *cond,
bool optimizable=0;
for (uint i=0; i<num_values; i++)
{
- used_tables|=(*value)->used_tables();
- if (!((*value)->used_tables() & (field->table->map | RAND_TABLE_BIT)))
+ used_tables|=(value[i])->used_tables();
+ if (!((value[i])->used_tables() & (field->table->map | RAND_TABLE_BIT)))
optimizable=1;
}
if (!optimizable)
@@ -2638,6 +2654,8 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
ha_rows rec;
double tmp;
THD *thd= join->thd;
+ if (thd->killed) // Abort
+ return;
if (!rest_tables)
{
@@ -2646,7 +2664,8 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
read_time+=record_count/(double) TIME_FOR_COMPARE;
if (join->sort_by_table &&
- join->sort_by_table != join->positions[join->const_tables].table->table)
+ join->sort_by_table !=
+ join->positions[join->const_tables].table->table)
read_time+=record_count; // We have to make a temp table
if (read_time < join->best_read)
{
@@ -2818,7 +2837,7 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
will match
*/
if (table->quick_keys.is_set(key) &&
- table->quick_key_parts[key] <= max_key_part)
+ table->quick_key_parts[key] == max_key_part)
tmp=records= (double) table->quick_rows[key];
else
{
@@ -2860,7 +2879,15 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
}
records=(ulong) tmp;
}
- if (found_ref_or_null)
+ /*
+ If quick_select was used on a part of this key, we know
+ the maximum number of rows that the key can match.
+ */
+ if (table->quick_keys.is_set(key) &&
+ table->quick_key_parts[key] <= max_key_part &&
+ records > (double) table->quick_rows[key])
+ tmp= records= (double) table->quick_rows[key];
+ else if (found_ref_or_null)
{
/* We need to do two key searches to find key */
tmp*= 2.0;
@@ -3259,8 +3286,12 @@ static bool create_ref_for_key(JOIN *join, JOIN_TAB *j, KEYUSE *org_keyuse,
keyuse,join->const_table_map,
&keyinfo->key_part[i],
(char*) key_buff,maybe_null);
- /* Remmeber if we are going to use REF_OR_NULL */
- if (keyuse->optimize & KEY_OPTIMIZE_REF_OR_NULL)
+ /*
+ Remeber if we are going to use REF_OR_NULL
+ But only if field _really_ can be null i.e. we force JT_REF
+ instead of JT_REF_OR_NULL in case if field can't be null
+ */
+ if ((keyuse->optimize & KEY_OPTIMIZE_REF_OR_NULL) && maybe_null)
null_ref_key= key_buff;
key_buff+=keyinfo->key_part[i].store_length;
}
@@ -3336,9 +3367,15 @@ store_val_in_field(Field *field,Item *item)
bool error;
THD *thd=current_thd;
ha_rows cuted_fields=thd->cuted_fields;
+ /*
+ we should restore old value of count_cuted_fields because
+ store_val_in_field can be called from mysql_insert
+ with select_insert, which make count_cuted_fields= 1
+ */
+ enum_check_fields old_count_cuted_fields= thd->count_cuted_fields;
thd->count_cuted_fields= CHECK_FIELD_WARN;
error= item->save_in_field(field, 1);
- thd->count_cuted_fields= CHECK_FIELD_IGNORE;
+ thd->count_cuted_fields= old_count_cuted_fields;
return error || cuted_fields != thd->cuted_fields;
}
@@ -3395,7 +3432,9 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
table_map used_tables;
if (join->tables > 1)
cond->update_used_tables(); // Tablenr may have changed
- if (join->const_tables == join->tables)
+ if (join->const_tables == join->tables &&
+ join->thd->lex->current_select->master_unit() ==
+ &join->thd->lex->unit) // not upper level SELECT
join->const_table_map|=RAND_TABLE_BIT;
{ // Check const tables
COND *const_cond=
@@ -3430,6 +3469,7 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
tab->type=JT_ALL;
use_quick_range=1;
tab->use_quick=1;
+ tab->ref.key= -1;
tab->ref.key_parts=0; // Don't use ref key.
join->best_positions[i].records_read= rows2double(tab->quick->records);
}
@@ -3497,7 +3537,9 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond)
{
/* Join with outer join condition */
COND *orig_cond=sel->cond;
- sel->cond=and_conds(sel->cond,tab->on_expr);
+ sel->cond= and_conds(sel->cond, tab->on_expr);
+ if (sel->cond && !sel->cond->fixed)
+ sel->cond->fix_fields(join->thd, 0, &sel->cond);
if (sel->test_quick_select(join->thd, tab->keys,
used_tables & ~ current_map,
(join->select_options &
@@ -3569,7 +3611,7 @@ static void
make_join_readinfo(JOIN *join, uint options)
{
uint i;
- SELECT_LEX *select_lex= &join->thd->lex->select_lex;
+ bool statistics= test(!(join->select_options & SELECT_DESCRIBE));
DBUG_ENTER("make_join_readinfo");
for (i=join->const_tables ; i < join->tables ; i++)
@@ -3663,7 +3705,8 @@ make_join_readinfo(JOIN *join, uint options)
{
join->thd->server_status|=SERVER_QUERY_NO_GOOD_INDEX_USED;
tab->read_first_record= join_init_quick_read_record;
- statistic_increment(select_range_check_count, &LOCK_status);
+ if (statistics)
+ statistic_increment(select_range_check_count, &LOCK_status);
}
else
{
@@ -3672,24 +3715,28 @@ make_join_readinfo(JOIN *join, uint options)
{
if (tab->select && tab->select->quick)
{
- statistic_increment(select_range_count, &LOCK_status);
+ if (statistics)
+ statistic_increment(select_range_count, &LOCK_status);
}
else
{
join->thd->server_status|=SERVER_QUERY_NO_INDEX_USED;
- statistic_increment(select_scan_count, &LOCK_status);
+ if (statistics)
+ statistic_increment(select_scan_count, &LOCK_status);
}
}
else
{
if (tab->select && tab->select->quick)
{
- statistic_increment(select_full_range_join_count, &LOCK_status);
+ if (statistics)
+ statistic_increment(select_full_range_join_count, &LOCK_status);
}
else
{
join->thd->server_status|=SERVER_QUERY_NO_INDEX_USED;
- statistic_increment(select_full_join_count, &LOCK_status);
+ if (statistics)
+ statistic_increment(select_full_join_count, &LOCK_status);
}
}
if (!table->no_keyread)
@@ -3833,9 +3880,7 @@ JOIN::join_free(bool full)
else
{
for (tab= join_tab, end= tab+tables; tab != end; tab++)
- {
tab->cleanup();
- }
table= 0;
}
}
@@ -4067,7 +4112,7 @@ return_zero_rows(JOIN *join, select_result *result,TABLE_LIST *tables,
if (select_options & SELECT_DESCRIBE)
{
- select_describe(join, false, false, false, info);
+ select_describe(join, FALSE, FALSE, FALSE, info);
DBUG_RETURN(0);
}
@@ -4311,6 +4356,7 @@ propagate_cond_constants(I_List<COND_CMP> *save_list,COND *and_father,
SYNPOSIS
eliminate_not_funcs()
+ thd thread handler
cond condition tree
DESCRIPTION
@@ -4327,7 +4373,7 @@ propagate_cond_constants(I_List<COND_CMP> *save_list,COND *and_father,
New condition tree
*/
-COND *eliminate_not_funcs(COND *cond)
+COND *eliminate_not_funcs(THD *thd, COND *cond)
{
if (!cond)
return cond;
@@ -4337,7 +4383,7 @@ COND *eliminate_not_funcs(COND *cond)
Item *item;
while ((item= li++))
{
- Item *new_item= eliminate_not_funcs(item);
+ Item *new_item= eliminate_not_funcs(thd, item);
if (item != new_item)
VOID(li.replace(new_item)); /* replace item with a new condition */
}
@@ -4345,14 +4391,13 @@ COND *eliminate_not_funcs(COND *cond)
else if (cond->type() == Item::FUNC_ITEM && /* 'NOT' operation? */
((Item_func*) cond)->functype() == Item_func::NOT_FUNC)
{
- COND *new_cond= ((Item_func*) cond)->arguments()[0]->neg_transformer();
+ COND *new_cond= ((Item_func*) cond)->arguments()[0]->neg_transformer(thd);
if (new_cond)
{
/*
Here we can delete the NOT function. Something like: delete cond;
But we don't need to do it. All items will be deleted later at once.
*/
- new_cond->fix_fields(current_thd, 0, &new_cond);
cond= new_cond;
}
}
@@ -4361,7 +4406,7 @@ COND *eliminate_not_funcs(COND *cond)
static COND *
-optimize_cond(COND *conds,Item::cond_result *cond_value)
+optimize_cond(THD *thd, COND *conds, Item::cond_result *cond_value)
{
DBUG_ENTER("optimize_cond");
if (!conds)
@@ -4371,7 +4416,7 @@ optimize_cond(COND *conds,Item::cond_result *cond_value)
}
DBUG_EXECUTE("where",print_where(conds,"original"););
/* eliminate NOT operators */
- conds= eliminate_not_funcs(conds);
+ conds= eliminate_not_funcs(thd, conds);
DBUG_EXECUTE("where", print_where(conds, "after negation elimination"););
/* change field = field to field = const for each found field = const */
propagate_cond_constants((I_List<COND_CMP> *) 0,conds,conds);
@@ -4380,7 +4425,7 @@ optimize_cond(COND *conds,Item::cond_result *cond_value)
Remove all and-levels where CONST item != CONST item
*/
DBUG_EXECUTE("where",print_where(conds,"after const change"););
- conds=remove_eq_conds(conds,cond_value) ;
+ conds= remove_eq_conds(thd, conds, cond_value) ;
DBUG_EXECUTE("info",print_where(conds,"after remove"););
DBUG_RETURN(conds);
}
@@ -4395,7 +4440,7 @@ optimize_cond(COND *conds,Item::cond_result *cond_value)
*/
static COND *
-remove_eq_conds(COND *cond,Item::cond_result *cond_value)
+remove_eq_conds(THD *thd, COND *cond, Item::cond_result *cond_value)
{
if (cond->type() == Item::COND_ITEM)
{
@@ -4409,7 +4454,7 @@ remove_eq_conds(COND *cond,Item::cond_result *cond_value)
Item *item;
while ((item=li++))
{
- Item *new_item=remove_eq_conds(item,&tmp_cond_value);
+ Item *new_item=remove_eq_conds(thd, item, &tmp_cond_value);
if (!new_item)
li.remove();
else if (item != new_item)
@@ -4443,7 +4488,7 @@ remove_eq_conds(COND *cond,Item::cond_result *cond_value)
}
}
if (should_fix_fields)
- cond->fix_fields(current_thd,0, &cond);
+ cond->update_used_tables();
if (!((Item_cond*) cond)->argument_list()->elements ||
*cond_value != Item::COND_OK)
@@ -4470,7 +4515,6 @@ remove_eq_conds(COND *cond,Item::cond_result *cond_value)
Item_func_isnull *func=(Item_func_isnull*) cond;
Item **args= func->arguments();
- THD *thd=current_thd;
if (args[0]->type() == Item::FIELD_ITEM)
{
Field *field=((Item_field*) args[0])->field;
@@ -4743,7 +4787,7 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
else
return new Field_double(item_sum->max_length,maybe_null,
item->name, table, item_sum->decimals);
- case Item_sum::VARIANCE_FUNC: /* Place for sum & count */
+ case Item_sum::VARIANCE_FUNC: /* Place for sum & count */
case Item_sum::STD_FUNC:
if (group)
return new Field_string(sizeof(double)*2+sizeof(longlong),
@@ -4771,17 +4815,19 @@ Field *create_tmp_field(THD *thd, TABLE *table,Item *item, Item::Type type,
default:
// This case should never be choosen
DBUG_ASSERT(0);
+ thd->fatal_error();
return 0;
}
}
- thd->fatal_error();
- return 0; // Error
+ /* We never come here */
}
case Item::FIELD_ITEM:
case Item::DEFAULT_VALUE_ITEM:
- return create_tmp_field_from_field(thd, (*from_field=
- ((Item_field*) item)->field),
+ {
+ Item_field *field= (Item_field*) item;
+ return create_tmp_field_from_field(thd, (*from_field= field->field),
item, table, modify_item);
+ }
case Item::FUNC_ITEM:
case Item::COND_ITEM:
case Item::FIELD_AVG_ITEM:
@@ -5434,13 +5480,22 @@ free_tmp_table(THD *thd, TABLE *entry)
save_proc_info=thd->proc_info;
thd->proc_info="removing tmp table";
free_blobs(entry);
- if (entry->db_stat && entry->file)
+ if (entry->file)
{
- (void) entry->file->close();
+ if (entry->db_stat)
+ {
+ (void) entry->file->close();
+ }
+ /*
+ We can't call ha_delete_table here as the table may created in mixed case
+ here and we have to ensure that delete_table gets the table name in
+ the original case.
+ */
+ if (!(test_flags & TEST_KEEP_TMP_TABLES) || entry->db_type == DB_TYPE_HEAP)
+ entry->file->delete_table(entry->real_name);
delete entry->file;
}
- if (!(test_flags & TEST_KEEP_TMP_TABLES) || entry->db_type == DB_TYPE_HEAP)
- (void) ha_delete_table(entry->db_type,entry->real_name);
+
/* free blobs */
for (Field **ptr=entry->field ; *ptr ; ptr++)
(*ptr)->free();
@@ -5743,7 +5798,15 @@ sub_select(JOIN *join,JOIN_TAB *join_tab,bool end_of_records)
return 0;
}
else
+ {
+ /*
+ This row failed selection, release lock on it.
+ XXX: There is no table handler in MySQL which makes use of this
+ call. It's kept from Gemini times. A lot of new code was added
+ recently (i. e. subselects) without having it in mind.
+ */
info->file->unlock_row();
+ }
}
} while (!(error=info->read_record(info)) && !(*report_error));
}
@@ -5905,8 +5968,8 @@ join_read_const_table(JOIN_TAB *tab, POSITION *pos)
if (tab->on_expr && !table->null_row)
{
if ((table->null_row= test(tab->on_expr->val_int() == 0)))
- empty_record(table);
- }
+ mark_as_null_row(table);
+ }
if (!table->null_row)
table->maybe_null=0;
DBUG_RETURN(0);
@@ -6697,8 +6760,11 @@ static bool test_if_ref(Item_field *left_item,Item *right_item)
/*
We can remove binary fields and numerical fields except float,
as float comparison isn't 100 % secure
+ We have to keep binary strings to be able to check for end spaces
*/
if (field->binary() &&
+ field->real_type() != FIELD_TYPE_STRING &&
+ field->real_type() != FIELD_TYPE_VAR_STRING &&
(field->type() != FIELD_TYPE_FLOAT || field->decimals() == 0))
{
return !store_val_in_field(field,right_item);
@@ -6711,7 +6777,7 @@ static bool test_if_ref(Item_field *left_item,Item *right_item)
static COND *
-make_cond_for_table(COND *cond,table_map tables,table_map used_table)
+make_cond_for_table(COND *cond, table_map tables, table_map used_table)
{
if (used_table && !(cond->used_tables() & used_table))
return (COND*) 0; // Already checked
@@ -6737,7 +6803,13 @@ make_cond_for_table(COND *cond,table_map tables,table_map used_table)
case 1:
return new_cond->argument_list()->head();
default:
- new_cond->used_tables_cache=((Item_cond*) cond)->used_tables_cache &
+ /*
+ Item_cond_and do not need fix_fields for execution, its parameters
+ are fixed or do not need fix_fields, too
+ */
+ new_cond->quick_fix_field();
+ new_cond->used_tables_cache=
+ ((Item_cond_and*) cond)->used_tables_cache &
tables;
return new_cond;
}
@@ -6756,7 +6828,12 @@ make_cond_for_table(COND *cond,table_map tables,table_map used_table)
return (COND*) 0; // Always true
new_cond->argument_list()->push_back(fix);
}
- new_cond->used_tables_cache=((Item_cond_or*) cond)->used_tables_cache;
+ /*
+ Item_cond_and do not need fix_fields for execution, its parameters
+ are fixed or do not need fix_fields, too
+ */
+ new_cond->quick_fix_field();
+ new_cond->used_tables_cache= ((Item_cond_or*) cond)->used_tables_cache;
new_cond->top_level_item();
return new_cond;
}
@@ -6985,7 +7062,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
ref_key= -1;
/* Test if constant range in WHERE */
- if (tab->ref.key >= 0)
+ if (tab->ref.key >= 0 && tab->ref.key_parts)
{
ref_key= tab->ref.key;
ref_key_parts= tab->ref.key_parts;
@@ -7105,13 +7182,20 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
*/
if (select_limit >= table->file->records)
{
- keys=*table->file->keys_to_use_for_scanning();
+ keys= *table->file->keys_to_use_for_scanning();
keys.merge(table->used_keys);
+
+ /*
+ We are adding here also the index speified in FORCE INDEX clause,
+ if any.
+ This is to allow users to use index in ORDER BY.
+ */
+ if (table->force_index)
+ keys.merge(table->keys_in_use_for_query);
+ keys.intersect(usable_keys);
}
else
- keys.set_all();
-
- keys.intersect(usable_keys);
+ keys= usable_keys;
for (nr=0; nr < table->keys ; nr++)
{
@@ -7273,8 +7357,10 @@ static bool fix_having(JOIN *join, Item **having)
if (!table->select->cond)
table->select->cond=sort_table_cond;
else // This should never happen
- if (!(table->select->cond=new Item_cond_and(table->select->cond,
- sort_table_cond)))
+ if (!(table->select->cond= new Item_cond_and(table->select->cond,
+ sort_table_cond)) ||
+ table->select->cond->fix_fields(join->thd, join->tables_list,
+ &table->select->cond))
return 1;
table->select_cond=table->select->cond;
table->select_cond->top_level_item();
@@ -7893,10 +7979,16 @@ find_order_in_list(THD *thd, Item **ref_pointer_array,
}
order->in_field_list=0;
Item *it= *order->item;
- if (it->fix_fields(thd, tables, order->item) ||
- //'it' ressigned because fix_field can change it
- (it= *order->item)->check_cols(1) ||
- thd->is_fatal_error)
+ /*
+ We check it->fixed because Item_func_group_concat can put
+ arguments for which fix_fields already was called.
+
+ 'it' reassigned in if condition because fix_field can change it.
+ */
+ if (!it->fixed &&
+ (it->fix_fields(thd, tables, order->item) ||
+ (it= *order->item)->check_cols(1) ||
+ thd->is_fatal_error))
return 1; // Wrong field
uint el= all_fields.elements;
all_fields.push_front(it); // Add new field to field list
@@ -7924,6 +8016,29 @@ int setup_order(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
}
+/*
+ Intitialize the GROUP BY list.
+
+ SYNOPSIS
+ setup_group()
+ thd Thread handler
+ ref_pointer_array We store references to all fields that was not in
+ 'fields' here.
+ fields All fields in the select part. Any item in 'order'
+ that is part of these list is replaced by a pointer
+ to this fields.
+ all_fields Total list of all unique fields used by the select.
+ All items in 'order' that was not part of fields will
+ be added first to this list.
+ order The fields we should do GROUP BY on.
+ hidden_group_fields Pointer to flag that is set to 1 if we added any fields
+ to all_fields.
+
+ RETURN
+ 0 ok
+ 1 error (probably out of memory)
+*/
+
int
setup_group(THD *thd, Item **ref_pointer_array, TABLE_LIST *tables,
List<Item> &fields, List<Item> &all_fields, ORDER *order,
@@ -8303,12 +8418,11 @@ setup_copy_fields(THD *thd, TMP_TABLE_PARAM *param,
Item *pos;
List_iterator_fast<Item> li(all_fields);
Copy_field *copy;
- DBUG_ENTER("setup_copy_fields");
res_selected_fields.empty();
res_all_fields.empty();
List_iterator_fast<Item> itr(res_all_fields);
-
uint i, border= all_fields.elements - elements;
+ DBUG_ENTER("setup_copy_fields");
if (!(copy=param->copy_field= new Copy_field[param->field_count]))
goto err2;
@@ -8443,6 +8557,23 @@ bool JOIN::alloc_func_list()
}
+/*
+ Initialize 'sum_funcs' array with all Item_sum objects
+
+ SYNOPSIS
+ make_sum_func_list()
+ field_list All items
+ send_fields Items in select list
+ before_group_by Set to 1 if this is called before GROUP BY handling
+
+ NOTES
+ Calls ::setup() for all item_sum objects in field_list
+
+ RETURN
+ 0 ok
+ 1 error
+*/
+
bool JOIN::make_sum_func_list(List<Item> &field_list, List<Item> &send_fields,
bool before_group_by)
{
@@ -8479,7 +8610,7 @@ bool JOIN::make_sum_func_list(List<Item> &field_list, List<Item> &send_fields,
/*
- Change all funcs and sum_funcs to fields in tmp table, and create
+ Change all funcs and sum_funcs to fields in tmp table, and create
new list of all items.
change_to_use_tmp_fields()
@@ -8699,7 +8830,7 @@ static bool add_ref_to_table_cond(THD *thd, JOIN_TAB *join_tab)
Field *field=table->field[table->key_info[join_tab->ref.key].key_part[i].
fieldnr-1];
Item *value=join_tab->ref.items[i];
- cond->add(new Item_func_equal(new Item_field(field),value));
+ cond->add(new Item_func_equal(new Item_field(field), value));
}
if (thd->is_fatal_error)
DBUG_RETURN(TRUE);
@@ -8979,7 +9110,6 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
List<Item> field_list;
List<Item> item_list;
THD *thd=join->thd;
- SELECT_LEX *select_lex= &join->thd->lex->select_lex;
select_result *result=join->result;
Item *item_null= new Item_null();
CHARSET_INFO *cs= &my_charset_latin1;
@@ -9346,7 +9476,7 @@ void st_select_lex::print(THD *thd, String *str)
str->append(table->db);
str->append('.');
str->append(table->real_name);
- if (strcmp(table->real_name, table->alias))
+ if (my_strcasecmp(table_alias_charset, table->real_name, table->alias))
{
str->append(' ');
str->append(table->alias);
diff --git a/sql/sql_select.h b/sql/sql_select.h
index e1fc5d1c1fe..07b94b0afed 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -436,4 +436,4 @@ bool cp_buffer_from_ref(TABLE_REF *ref);
bool error_if_full_join(JOIN *join);
int report_error(TABLE *table, int error);
int safe_index_read(JOIN_TAB *tab);
-COND *eliminate_not_funcs(COND *cond);
+COND *eliminate_not_funcs(THD *thd, COND *cond);
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 158d9b1acb0..2e755c419ff 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -31,9 +31,11 @@ static const char *grant_names[]={
"select","insert","update","delete","create","drop","reload","shutdown",
"process","file","grant","references","index","alter"};
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
static TYPELIB grant_types = { sizeof(grant_names)/sizeof(char **),
"grant_types",
grant_names};
+#endif
static int mysql_find_files(THD *thd,List<char> *files, const char *db,
const char *path, const char *wild, bool dir);
@@ -219,30 +221,32 @@ struct show_privileges_st {
const char *comment;
};
-
-/*
- TODO: Update with new privileges
-*/
static struct show_privileges_st sys_privileges[]=
{
- {"Select", "Tables", "To retrieve rows from table"},
- {"Insert", "Tables", "To insert data into tables"},
- {"Update", "Tables", "To update existing rows "},
- {"Delete", "Tables", "To delete existing rows"},
- {"Index", "Tables", "To create or drop indexes"},
- {"Alter", "Tables", "To alter the table"},
+ {"Alter", "Tables", "To alter the table"},
+ {"Create temporary tables","Databases","To use CREATE TEMPORARY TABLE"},
{"Create", "Databases,Tables,Indexes", "To create new databases and tables"},
- {"Drop", "Databases,Tables", "To drop databases and tables"},
- {"Grant", "Databases,Tables", "To give to other users those privileges you possess"},
+ {"Delete", "Tables", "To delete existing rows"},
+ {"Drop", "Databases,Tables", "To drop databases and tables"},
+ {"File", "File access on server", "To read and write files on the server"},
+ {"Grant option", "Databases,Tables", "To give to other users those privileges you possess"},
+ {"Index", "Tables", "To create or drop indexes"},
+ {"Insert", "Tables", "To insert data into tables"},
+ {"Lock tables","Databases","To use LOCK TABLES (together with SELECT privilege)"},
+ {"Process", "Server Admin", "To view the plain text of currently executing queries"},
{"References", "Databases,Tables", "To have references on tables"},
- {"Reload", "Server Admin", "To reload or refresh tables, logs and privileges"},
+ {"Reload", "Server Admin", "To reload or refresh tables, logs and privileges"},
+ {"Replication client","Server Admin","To ask where the slave or master servers are"},
+ {"Replication slave","Server Admin","To read binary log events from the master"},
+ {"Select", "Tables", "To retrieve rows from table"},
+ {"Show databases","Server Admin","To see all databases with SHOW DATABASES"},
{"Shutdown","Server Admin", "To shutdown the server"},
- {"Process", "Server Admin", "To view the plain text of currently executing queries"},
- {"File", "File access on server", "To read and write files on the server"},
+ {"Super","Server Admin","To use KILL thread, SET GLOBAL, CHANGE MASTER, etc."},
+ {"Update", "Tables", "To update existing rows"},
+ {"Usage","Server Admin","No privileges - allow connect only"},
{NullS, NullS, NullS}
};
-
int mysqld_show_privileges(THD *thd)
{
List<Item> field_list;
@@ -299,11 +303,11 @@ static struct show_column_type_st sys_column_types[]=
{
{"tinyint",
1, "-128", "127", 0, 0, "YES", "YES",
- "NO", "YES", "YES", "NO", "NULL,0",
- "A very small integer"},
+ "NO", "YES", "YES", "NO", "NULL,0",
+ "A very small integer"},
{"tinyint unsigned",
- 1, "0" , "255", 0, 0, "YES", "YES",
- "YES", "YES", "YES", "NO", "NULL,0",
+ 1, "0" , "255", 0, 0, "YES", "YES",
+ "YES", "YES", "YES", "NO", "NULL,0",
"A very small integer"},
};
@@ -365,7 +369,9 @@ mysql_find_files(THD *thd,List<char> *files, const char *db,const char *path,
char *ext;
MY_DIR *dirp;
FILEINFO *file;
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
uint col_access=thd->col_access;
+#endif
TABLE_LIST table_list;
DBUG_ENTER("mysql_find_files");
@@ -692,17 +698,11 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild,
if (!wild || !wild[0] ||
!wild_case_compare(system_charset_info, field->field_name,wild))
{
-#ifdef NOT_USED
- if (thd->col_access & TABLE_ACLS ||
- ! check_grant_column(thd,table,field->field_name,
- (uint) strlen(field->field_name),1))
-#endif
{
byte *pos;
uint flags=field->flags;
String type(tmp,sizeof(tmp), system_charset_info);
uint col_access;
- bool null_default_value=0;
protocol->prepare_for_resend();
protocol->store(field->field_name, system_charset_info);
@@ -711,6 +711,12 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild,
if (verbose)
protocol->store(field->has_charset() ? field->charset()->name : "NULL",
system_charset_info);
+ /*
+ Altough TIMESTAMP fields can't contain NULL as its value they
+ will accept NULL if you will try to insert such value and will
+ convert it to current TIMESTAMP. So YES here means that NULL
+ is allowed for assignment but can't be returned.
+ */
pos=(byte*) ((flags & NOT_NULL_FLAG) &&
field->type() != FIELD_TYPE_TIMESTAMP ?
"" : "YES");
@@ -720,16 +726,24 @@ mysqld_show_fields(THD *thd, TABLE_LIST *table_list,const char *wild,
(field->flags & MULTIPLE_KEY_FLAG) ? "MUL":"");
protocol->store((char*) pos, system_charset_info);
- if (field->type() == FIELD_TYPE_TIMESTAMP ||
- field->unireg_check == Field::NEXT_NUMBER)
- null_default_value=1;
- if (!null_default_value && !field->is_null())
+ if (table->timestamp_field == field &&
+ field->unireg_check != Field::TIMESTAMP_UN_FIELD)
+ {
+ /*
+ We have NOW() as default value but we use CURRENT_TIMESTAMP form
+ because it is more SQL standard comatible
+ */
+ protocol->store("CURRENT_TIMESTAMP", system_charset_info);
+ }
+ else if (field->unireg_check != Field::NEXT_NUMBER &&
+ !field->is_null())
{ // Not null by default
type.set(tmp, sizeof(tmp), field->charset());
field->val_str(&type,&type);
protocol->store(type.ptr(),type.length(),type.charset());
}
- else if (field->maybe_null() || null_default_value)
+ else if (field->unireg_check == Field::NEXT_NUMBER ||
+ field->maybe_null())
protocol->store_null(); // Null as default
else
protocol->store("",0, system_charset_info); // empty string
@@ -819,7 +833,9 @@ int mysqld_show_create_db(THD *thd, char *dbname,
char path[FN_REFLEN];
char buff[2048];
String buffer(buff, sizeof(buff), system_charset_info);
+#ifndef NO_EMBEDDED_ACCESS_CHECKS
uint db_access;
+#endif
bool found_libchar;
HA_CREATE_INFO create;
uint create_options = create_info ? create_info->options : 0;
@@ -916,7 +932,7 @@ mysqld_show_logs(THD *thd)
DBUG_RETURN(1);
#ifdef HAVE_BERKELEY_DB
- if (!berkeley_skip && berkeley_show_logs(protocol))
+ if ((have_berkeley_db == SHOW_OPTION_YES) && berkeley_show_logs(protocol))
DBUG_RETURN(-1);
#endif
@@ -995,9 +1011,8 @@ mysqld_show_keys(THD *thd, TABLE_LIST *table_list)
protocol->store_null();
/* Check if we have a key part that only uses part of the field */
- if (!key_part->field ||
- key_part->length !=
- table->field[key_part->fieldnr-1]->key_length())
+ if (!(key_info->flags & HA_FULLTEXT) && (!key_part->field ||
+ key_part->length != table->field[key_part->fieldnr-1]->key_length()))
protocol->store_tiny((longlong) key_part->length);
else
protocol->store_null();
@@ -1085,100 +1100,85 @@ mysqld_dump_create_info(THD *thd, TABLE *table, int fd)
DBUG_RETURN(0);
}
-static inline const char *require_quotes(const char *name, uint length)
-{
- uint i, d, c;
- for (i=0; i<length; i+=d)
- {
- c=((uchar *)name)[i];
- d=my_mbcharlen(system_charset_info, c);
- if (d==1 && !system_charset_info->ident_map[c])
- return name+i;
- }
- return 0;
-}
-
/*
- Looking for char in multibyte string
+ Go through all character combinations and ensure that sql_lex.cc can
+ parse it as an identifer.
SYNOPSIS
- look_for_char()
- name string for looking at
- length length of name
- q '\'' or '\"' for looking for
-
- RETURN VALUES
- # pointer to found char in string
- 0 string doesn't contain required char
+ require_quotes()
+ name attribute name
+ name_length length of name
+
+ RETURN
+ # Pointer to conflicting character
+ 0 No conflicting character
*/
-static inline const char *look_for_char(const char *name,
- uint length, char q)
+static const char *require_quotes(const char *name, uint name_length)
{
- const char *cur= name;
- const char *end= cur+length;
- uint symbol_length;
- for (; cur<end; cur+= symbol_length)
+ uint length;
+ const char *end= name + name_length;
+
+ for ( ; name < end ; name++)
{
- char c= *cur;
- symbol_length= my_mbcharlen(system_charset_info, c);
- if (symbol_length==1 && c==q)
- return cur;
+ uchar chr= (uchar) *name;
+ length= my_mbcharlen(system_charset_info, chr);
+ if (length == 1 && !system_charset_info->ident_map[chr])
+ return name;
}
return 0;
}
+
+static void append_quoted_simple_identifier(String *packet, char quote_char,
+ const char *name, uint length)
+{
+ packet->append(&quote_char, 1, system_charset_info);
+ packet->append(name, length, system_charset_info);
+ packet->append(&quote_char, 1, system_charset_info);
+}
+
+
void
append_identifier(THD *thd, String *packet, const char *name, uint length)
{
- char qtype;
- uint part_len;
- const char *qplace;
+ const char *name_end;
+ char quote_char;
+
if (thd->variables.sql_mode & MODE_ANSI_QUOTES)
- qtype= '\"';
+ quote_char= '\"';
else
- qtype= '`';
+ quote_char= '`';
if (is_keyword(name,length))
{
- packet->append(&qtype, 1, system_charset_info);
- packet->append(name, length, system_charset_info);
- packet->append(&qtype, 1, system_charset_info);
+ append_quoted_simple_identifier(packet, quote_char, name, length);
+ return;
}
- else
+
+ if (!require_quotes(name, length))
{
- if (!(qplace= require_quotes(name, length)))
- {
- if (!(thd->options & OPTION_QUOTE_SHOW_CREATE))
- packet->append(name, length, system_charset_info);
- else
- {
- packet->append(&qtype, 1, system_charset_info);
- packet->append(name, length, system_charset_info);
- packet->append(&qtype, 1, system_charset_info);
- }
- }
- else
- {
- packet->shrink(packet->length()+length+2);
- packet->append(&qtype, 1, system_charset_info);
- if (*qplace != qtype)
- qplace= look_for_char(qplace+1,length-(qplace-name)-1,qtype);
- while (qplace)
- {
- if ((part_len= qplace-name))
- {
- packet->append(name, part_len, system_charset_info);
- length-= part_len;
- }
- packet->append(qplace, 1, system_charset_info);
- name= qplace;
- qplace= look_for_char(name+1,length-1,qtype);
- }
+ if (!(thd->options & OPTION_QUOTE_SHOW_CREATE))
packet->append(name, length, system_charset_info);
- packet->append(&qtype, 1, system_charset_info);
- }
+ else
+ append_quoted_simple_identifier(packet, quote_char, name, length);
+ return;
+ }
+
+ /* The identifier must be quoted as it includes a quote character */
+
+ packet->reserve(length*2 + 2);
+ packet->append(&quote_char, 1, system_charset_info);
+
+ for (name_end= name+length ; name < name_end ; name+= length)
+ {
+ char chr= *name;
+ length= my_mbcharlen(system_charset_info, chr);
+ if (length == 1 && chr == quote_char)
+ packet->append(&quote_char, 1, system_charset_info);
+ packet->append(name, length, packet->charset());
}
+ packet->append(&quote_char, 1, system_charset_info);
}
@@ -1206,7 +1206,7 @@ static int
store_create_info(THD *thd, TABLE *table, String *packet)
{
List<Item> field_list;
- char tmp[MAX_FIELD_WIDTH], *for_str, buff[128], *end;
+ char tmp[MAX_FIELD_WIDTH], *for_str, buff[128], *end, *alias;
String type(tmp, sizeof(tmp),&my_charset_bin);
Field **ptr,*field;
uint primary_key;
@@ -1232,12 +1232,15 @@ store_create_info(THD *thd, TABLE *table, String *packet)
packet->append("CREATE TEMPORARY TABLE ", 23);
else
packet->append("CREATE TABLE ", 13);
- append_identifier(thd,packet, table->real_name, strlen(table->real_name));
+ alias= (lower_case_table_names == 2 ? table->table_name :
+ table->real_name);
+ append_identifier(thd, packet, alias, strlen(alias));
packet->append(" (\n", 3);
for (ptr=table->field ; (field= *ptr); ptr++)
{
bool has_default;
+ bool has_now_default;
uint flags = field->flags;
if (ptr != table->field)
@@ -1253,40 +1256,46 @@ store_create_info(THD *thd, TABLE *table, String *packet)
field->sql_type(type);
packet->append(type.ptr(),type.length());
- if (field->has_charset())
+ if (field->has_charset() && !limited_mysql_mode && !foreign_db_mode)
{
- if (field->charset() == &my_charset_bin)
- packet->append(" binary", 7);
- else if (!limited_mysql_mode && !foreign_db_mode)
+ if (field->charset() != table->table_charset)
{
- if (field->charset() != table->table_charset)
- {
- packet->append(" character set ", 15);
- packet->append(field->charset()->csname);
- }
- /*
- For string types dump collation name only if
- collation is not primary for the given charset
- */
- if (!(field->charset()->state & MY_CS_PRIMARY))
- {
- packet->append(" collate ", 9);
- packet->append(field->charset()->name);
- }
+ packet->append(" character set ", 15);
+ packet->append(field->charset()->csname);
+ }
+ /*
+ For string types dump collation name only if
+ collation is not primary for the given charset
+ */
+ if (!(field->charset()->state & MY_CS_PRIMARY))
+ {
+ packet->append(" collate ", 9);
+ packet->append(field->charset()->name);
}
}
if (flags & NOT_NULL_FLAG)
packet->append(" NOT NULL", 9);
+
+ /*
+ Again we are using CURRENT_TIMESTAMP instead of NOW because it is
+ more standard
+ */
+ has_now_default= table->timestamp_field == field &&
+ field->unireg_check != Field::TIMESTAMP_UN_FIELD;
+
has_default= (field->type() != FIELD_TYPE_BLOB &&
- field->type() != FIELD_TYPE_TIMESTAMP &&
- field->unireg_check != Field::NEXT_NUMBER);
+ field->unireg_check != Field::NEXT_NUMBER &&
+ !((foreign_db_mode || limited_mysql_mode) &&
+ has_now_default));
if (has_default)
{
packet->append(" default ", 9);
- if (!field->is_null())
+ if (has_now_default)
+ packet->append("CURRENT_TIMESTAMP",17);
+ else if (!field->is_null())
{ // Not null by default
type.set(tmp, sizeof(tmp), field->charset());
field->val_str(&type,&type);
@@ -1307,6 +1316,11 @@ store_create_info(THD *thd, TABLE *table, String *packet)
packet->append(tmp,0);
}
+ if (!foreign_db_mode && !limited_mysql_mode &&
+ table->timestamp_field == field &&
+ field->unireg_check != Field::TIMESTAMP_DN_FIELD)
+ packet->append(" on update CURRENT_TIMESTAMP",28);
+
if (field->unireg_check == Field::NEXT_NUMBER && !foreign_db_mode)
packet->append(" auto_increment", 15 );
@@ -1814,10 +1828,10 @@ int mysqld_show(THD *thd, const char *wild, show_var_st *variables,
break;
case SHOW_SLAVE_RUNNING:
{
- LOCK_ACTIVE_MI;
+ pthread_mutex_lock(&LOCK_active_mi);
end= strmov(buff, (active_mi->slave_running &&
active_mi->rli.slave_running) ? "ON" : "OFF");
- UNLOCK_ACTIVE_MI;
+ pthread_mutex_unlock(&LOCK_active_mi);
break;
}
#endif /* HAVE_REPLICATION */
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index cd25b0c27ec..4c30b14cfe5 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -126,8 +126,8 @@ bool String::set(double num,uint decimals, CHARSET_INFO *cs)
str_charset=cs;
if (decimals >= NOT_FIXED_DEC)
{
- sprintf(buff,"%.14g",num); // Enough for a DATETIME
- return copy(buff, (uint32) strlen(buff), &my_charset_latin1, cs);
+ uint32 len= my_sprintf(buff,(buff, "%.14g",num));// Enough for a DATETIME
+ return copy(buff, len, &my_charset_latin1, cs);
}
#ifdef HAVE_FCONVERT
int decpt,sign;
@@ -453,7 +453,7 @@ bool String::append(const char *s,uint32 arg_length, CHARSET_INFO *cs)
if (!arg_length) // Default argument
if (!(arg_length= (uint32) strlen(s)))
return FALSE;
- if (str_charset->mbmaxlen > 1)
+ if (cs != str_charset && str_charset->mbmaxlen > 1)
{
uint32 add_length=arg_length * str_charset->mbmaxlen;
if (realloc(str_length+ add_length))
@@ -671,9 +671,8 @@ int String::reserve(uint32 space_needed, uint32 grow_by)
return FALSE;
}
-void String::qs_append(const char *str)
+void String::qs_append(const char *str, uint32 len)
{
- int len = strlen(str);
memcpy(Ptr + str_length, str, len + 1);
str_length += len;
}
@@ -681,8 +680,7 @@ void String::qs_append(const char *str)
void String::qs_append(double d)
{
char *buff = Ptr + str_length;
- sprintf(buff,"%.14g", d);
- str_length += strlen(buff);
+ str_length+= my_sprintf(buff, (buff, "%.14g", d));
}
void String::qs_append(double *d)
@@ -692,12 +690,6 @@ void String::qs_append(double *d)
qs_append(ld);
}
-void String::qs_append(const char &c)
-{
- Ptr[str_length] = c;
- str_length += sizeof(c);
-}
-
void String::qs_append(int i)
{
char *buff = Ptr + str_length;
@@ -712,12 +704,56 @@ void String::qs_append(uint i)
str_length += strlen(buff);
}
+/*
+ Compare strings according to collation, without end space.
+
+ SYNOPSIS
+ sortcmp()
+ s First string
+ t Second string
+ cs Collation
+
+ NOTE:
+ Normally this is case sensitive comparison
-int sortcmp(const String *x,const String *y, CHARSET_INFO *cs)
+ RETURN
+ < 0 s < t
+ 0 s == t
+ > 0 s > t
+*/
+
+
+int sortcmp(const String *s,const String *t, CHARSET_INFO *cs)
{
- return cs->coll->strnncollsp(cs,
- (unsigned char *) x->ptr(),x->length(),
- (unsigned char *) y->ptr(),y->length());
+ return cs->coll->strnncollsp(cs,
+ (unsigned char *) s->ptr(),s->length(),
+ (unsigned char *) t->ptr(),t->length());
+}
+
+
+/*
+ Compare strings byte by byte. End spaces are also compared.
+
+ SYNOPSIS
+ stringcmp()
+ s First string
+ t Second string
+
+ NOTE:
+ Strings are compared as a stream of unsigned chars
+
+ RETURN
+ < 0 s < t
+ 0 s == t
+ > 0 s > t
+*/
+
+
+int stringcmp(const String *s,const String *t)
+{
+ uint32 s_len=s->length(),t_len=t->length(),len=min(s_len,t_len);
+ int cmp= memcmp(s->ptr(), t->ptr(), len);
+ return (cmp) ? cmp : (int) (s_len - t_len);
}
@@ -771,10 +807,14 @@ copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
const uchar *from_end= (const uchar*) from+from_length;
char *to_start= to;
uchar *to_end= (uchar*) to+to_length;
+ int (*mb_wc)(struct charset_info_st *, my_wc_t *, const uchar *,
+ const uchar *) = from_cs->cset->mb_wc;
+ int (*wc_mb)(struct charset_info_st *, my_wc_t, uchar *s, uchar *e)=
+ to_cs->cset->wc_mb;
while (1)
{
- if ((cnvres= from_cs->cset->mb_wc(from_cs, &wc, (uchar*) from,
+ if ((cnvres= (*mb_wc)(from_cs, &wc, (uchar*) from,
from_end)) > 0)
from+= cnvres;
else if (cnvres == MY_CS_ILSEQ)
@@ -786,7 +826,7 @@ copy_and_convert(char *to, uint32 to_length, CHARSET_INFO *to_cs,
break; // Impossible char.
outp:
- if ((cnvres= to_cs->cset->wc_mb(to_cs, wc, (uchar*) to, to_end)) > 0)
+ if ((cnvres= (*wc_mb)(to_cs, wc, (uchar*) to, to_end)) > 0)
to+= cnvres;
else if (cnvres == MY_CS_ILUNI && wc != '?')
{
@@ -799,6 +839,7 @@ outp:
return (uint32) (to - to_start);
}
+
void String::print(String *str)
{
char *st= (char*)Ptr, *end= st+str_length;
diff --git a/sql/sql_string.h b/sql/sql_string.h
index d234bf7b507..1c559b597ba 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -69,12 +69,10 @@ public:
Alloced_length=str.Alloced_length; alloced=0;
str_charset=str.str_charset;
}
- static void *operator new(size_t size)
- { return (void*) sql_alloc((uint) size); }
static void *operator new(size_t size, MEM_ROOT *mem_root)
{ return (void*) alloc_root(mem_root, (uint) size); }
static void operator delete(void *ptr_arg,size_t size) /*lint -e715 */
- { sql_element_free(ptr_arg); }
+ {}
~String() { free(); }
inline void set_charset(CHARSET_INFO *charset) { str_charset= charset; }
@@ -221,6 +219,7 @@ public:
inline void caseup() { my_caseup(str_charset,Ptr,str_length); }
inline void casedn() { my_casedn(str_charset,Ptr,str_length); }
friend int sortcmp(const String *a,const String *b, CHARSET_INFO *cs);
+ friend int stringcmp(const String *a,const String *b);
friend String *copy_if_not_alloced(String *a,String *b,uint32 arg_length);
uint32 numchars();
int charpos(int i,uint32 offset=0);
@@ -236,7 +235,7 @@ public:
q_*** methods writes values of parameters itself
qs_*** methods writes string representation of value
*/
- void q_append(const char &c)
+ void q_append(const char c)
{
Ptr[str_length++] = c;
}
@@ -261,15 +260,19 @@ public:
str_length += data_len;
}
- void WriteAtPosition(int position, uint32 value)
+ void write_at_position(int position, uint32 value)
{
int4store(Ptr + position,value);
}
- void qs_append(const char *str);
+ void qs_append(const char *str, uint32 len);
void qs_append(double d);
void qs_append(double *d);
- void qs_append(const char &c);
+ inline void qs_append(const char c)
+ {
+ Ptr[str_length]= c;
+ str_length++;
+ }
void qs_append(int i);
void qs_append(uint i);
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 3b593e57d82..4b0ca67a549 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -179,11 +179,10 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
bool drop_temporary, bool dont_log_query)
{
TABLE_LIST *table;
- char path[FN_REFLEN];
+ char path[FN_REFLEN], *alias;
String wrong_tables;
- db_type table_type;
int error;
- bool some_tables_deleted=0, tmp_table_deleted=0;
+ bool some_tables_deleted=0, tmp_table_deleted=0, foreign_key_error=0;
DBUG_ENTER("mysql_rm_table_part2");
if (lock_table_names(thd, tables))
@@ -212,13 +211,10 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
drop_locked_tables(thd,db,table->real_name);
if (thd->killed)
DBUG_RETURN(-1);
-
+ alias= (lower_case_table_names == 2) ? table->alias : table->real_name;
/* remove form file and isam files */
- strxmov(path, mysql_data_home, "/", db, "/", table->real_name, reg_ext,
- NullS);
+ strxmov(path, mysql_data_home, "/", db, "/", alias, reg_ext, NullS);
(void) unpack_filename(path,path);
-
- table_type=get_table_type(path);
}
if (drop_temporary || access(path,F_OK))
{
@@ -232,10 +228,16 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
else
{
char *end;
- *(end=fn_ext(path))=0; // Remove extension
+ db_type table_type= get_table_type(path);
+ *(end=fn_ext(path))=0; // Remove extension for delete
error=ha_delete_table(table_type, path);
if (error == ENOENT && if_exists)
error = 0;
+ if (error == HA_ERR_ROW_IS_REFERENCED)
+ {
+ /* the table is referenced by a foreign key constraint */
+ foreign_key_error=1;
+ }
if (!error || error == ENOENT)
{
/* Delete the table definition file */
@@ -268,7 +270,10 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
error= 0;
if (wrong_tables.length())
{
- my_error(ER_BAD_TABLE_ERROR,MYF(0),wrong_tables.c_ptr());
+ 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);
@@ -333,6 +338,47 @@ static int sort_keys(KEY *a, KEY *b)
0);
}
+/*
+ Check TYPELIB (set or enum) for duplicates
+
+ SYNOPSIS
+ check_duplicates_in_interval()
+ set_or_name "SET" or "ENUM" string for warning message
+ name name of the checked column
+ typelib list of values for the column
+
+ DESCRIPTION
+ This function prints an warning for each value in list
+ which has some duplicates on its right
+
+ RETURN VALUES
+ void
+*/
+
+void check_duplicates_in_interval(const char *set_or_name,
+ const char *name, TYPELIB *typelib)
+{
+ unsigned int old_count= typelib->count;
+ const char **old_type_names= typelib->type_names;
+
+ old_count= typelib->count;
+ old_type_names= typelib->type_names;
+ const char **cur_value= typelib->type_names;
+ for ( ; typelib->count > 1; cur_value++)
+ {
+ typelib->type_names++;
+ typelib->count--;
+ if (find_type((char*)*cur_value,typelib,1))
+ {
+ push_warning_printf(current_thd,MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_DUPLICATED_VALUE_IN_TYPE,
+ ER(ER_DUPLICATED_VALUE_IN_TYPE),
+ name,*cur_value,set_or_name);
+ }
+ }
+ typelib->count= old_count;
+ typelib->type_names= old_type_names;
+}
/*
Create a table
@@ -369,7 +415,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
uint select_field_count)
{
char path[FN_REFLEN];
- const char *key_name;
+ const char *key_name, *alias;
create_field *sql_field,*dup_field;
int error= -1;
uint db_options,field,null_fields,blob_columns;
@@ -377,15 +423,13 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
KEY *key_info,*key_info_buffer;
KEY_PART_INFO *key_part_info;
int auto_increment=0;
+ int timestamps= 0, timestamps_with_niladic= 0;
handler *file;
int field_no,dup_no;
enum db_type new_db_type;
DBUG_ENTER("mysql_create_table");
- /*
- Check for duplicate fields and check type of table to create
- */
-
+ /* Check for duplicate fields and check type of table to create */
if (!fields.elements)
{
my_error(ER_TABLE_MUST_HAVE_COLUMNS,MYF(0));
@@ -407,6 +451,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
db_options=create_info->table_options;
if (create_info->row_type == ROW_TYPE_DYNAMIC)
db_options|=HA_OPTION_PACK_RECORD;
+ alias= table_case_name(create_info, table_name);
file=get_new_handler((TABLE*) 0, create_info->db_type);
if ((create_info->options & HA_LEX_CREATE_TMP_TABLE) &&
@@ -422,10 +467,24 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
sql_field->charset= create_info->default_table_charset;
/*
table_charset is set in ALTER TABLE if we want change character set
- for all varchar/char columns
+ for all varchar/char columns.
+ But the table charset must not affect the BLOB fields, so don't
+ allow to change my_charset_bin to somethig else.
*/
- if (create_info->table_charset)
+ if (create_info->table_charset && sql_field->charset != &my_charset_bin)
sql_field->charset= create_info->table_charset;
+
+ CHARSET_INFO *savecs= sql_field->charset;
+ if ((sql_field->flags & BINCMP_FLAG) &&
+ !(sql_field->charset= get_charset_by_csname(sql_field->charset->csname,
+ MY_CS_BINSORT,MYF(0))))
+ {
+ char tmp[64];
+ strmake(strmake(tmp, savecs->csname, sizeof(tmp)-4), "_bin", 4);
+ my_error(ER_UNKNOWN_COLLATION, MYF(0), tmp);
+ DBUG_RETURN(-1);
+ }
+
sql_field->create_length_to_internal_length();
/* Don't pack keys in old tables if the user has requested this */
@@ -539,6 +598,8 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
if (sql_field->charset->state & MY_CS_BINSORT)
sql_field->pack_flag|=FIELDFLAG_BINARY;
sql_field->unireg_check=Field::INTERVAL_FIELD;
+ check_duplicates_in_interval("ENUM",sql_field->field_name,
+ sql_field->interval);
break;
case FIELD_TYPE_SET:
sql_field->pack_flag=pack_length_to_packflag(sql_field->pack_length) |
@@ -546,6 +607,8 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
if (sql_field->charset->state & MY_CS_BINSORT)
sql_field->pack_flag|=FIELDFLAG_BINARY;
sql_field->unireg_check=Field::BIT_FIELD;
+ check_duplicates_in_interval("SET",sql_field->field_name,
+ sql_field->interval);
break;
case FIELD_TYPE_DATE: // Rest of string types
case FIELD_TYPE_NEWDATE:
@@ -555,8 +618,22 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
sql_field->pack_flag=f_settype((uint) sql_field->sql_type);
break;
case FIELD_TYPE_TIMESTAMP:
- sql_field->unireg_check=Field::TIMESTAMP_FIELD;
- /* fall through */
+ /* We should replace old TIMESTAMP fields with their newer analogs */
+ if (sql_field->unireg_check == Field::TIMESTAMP_OLD_FIELD)
+ {
+ if (!timestamps)
+ {
+ sql_field->unireg_check= Field::TIMESTAMP_DNUN_FIELD;
+ timestamps_with_niladic++;
+ }
+ else
+ sql_field->unireg_check= Field::NONE;
+ }
+ else if (sql_field->unireg_check != Field::NONE)
+ timestamps_with_niladic++;
+
+ timestamps++;
+ /* fall-through */
default:
sql_field->pack_flag=(FIELDFLAG_NUMBER |
(sql_field->flags & UNSIGNED_FLAG ? 0 :
@@ -574,6 +651,11 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
auto_increment++;
pos+=sql_field->pack_length;
}
+ if (timestamps_with_niladic > 1)
+ {
+ my_error(ER_TOO_MUCH_AUTO_TIMESTAMP_COLS,MYF(0));
+ DBUG_RETURN(-1);
+ }
if (auto_increment > 1)
{
my_error(ER_WRONG_AUTO_KEY,MYF(0));
@@ -632,6 +714,12 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
DBUG_RETURN(-1);
}
key_parts+=key->columns.elements;
+ if (key->name && !tmp_table &&
+ !my_strcasecmp(system_charset_info,key->name,primary_key_name))
+ {
+ my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0), key->name);
+ DBUG_RETURN(-1);
+ }
}
tmp=min(file->max_keys(), MAX_KEY);
if (key_count > tmp)
@@ -846,26 +934,35 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
{
if ((length=column->length) > file->max_key_length() ||
length > file->max_key_part_length())
- {
- my_error(ER_WRONG_SUB_KEY,MYF(0));
- DBUG_RETURN(-1);
- }
- }
- /* TODO HF What's this for??? */
- else if (f_is_geom(sql_field->pack_flag))
- {
- }
- else if (column->length > length ||
- ((f_is_packed(sql_field->pack_flag) ||
- ((file->table_flags() & HA_NO_PREFIX_CHAR_KEYS) &&
- (key_info->flags & HA_NOSAME))) &&
- column->length != length))
- {
- my_error(ER_WRONG_SUB_KEY,MYF(0));
- DBUG_RETURN(-1);
+ {
+ length=min(file->max_key_length(), file->max_key_part_length());
+ if (key->type == Key::MULTIPLE)
+ {
+ /* not a critical problem */
+ char warn_buff[MYSQL_ERRMSG_SIZE];
+ sprintf(warn_buff,ER(ER_TOO_LONG_KEY),length);
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_TOO_LONG_KEY, warn_buff);
+ }
+ else
+ {
+ my_error(ER_TOO_LONG_KEY,MYF(0),length);
+ DBUG_RETURN(-1);
+ }
+ }
}
- if (!(file->table_flags() & HA_NO_PREFIX_CHAR_KEYS))
- length=column->length;
+ else if (!f_is_geom(sql_field->pack_flag) &&
+ (column->length > length ||
+ ((f_is_packed(sql_field->pack_flag) ||
+ ((file->table_flags() & HA_NO_PREFIX_CHAR_KEYS) &&
+ (key_info->flags & HA_NOSAME))) &&
+ column->length != length)))
+ {
+ my_error(ER_WRONG_SUB_KEY,MYF(0));
+ DBUG_RETURN(-1);
+ }
+ else if (!(file->table_flags() & HA_NO_PREFIX_CHAR_KEYS))
+ length=column->length;
}
else if (length == 0)
{
@@ -875,8 +972,20 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
}
if (length > file->max_key_part_length())
{
- my_error(ER_WRONG_SUB_KEY,MYF(0));
- DBUG_RETURN(-1);
+ length=file->max_key_part_length();
+ if (key->type == Key::MULTIPLE)
+ {
+ /* not a critical problem */
+ char warn_buff[MYSQL_ERRMSG_SIZE];
+ sprintf(warn_buff,ER(ER_TOO_LONG_KEY),length);
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_TOO_LONG_KEY, warn_buff);
+ }
+ else
+ {
+ my_error(ER_TOO_LONG_KEY,MYF(0),length);
+ DBUG_RETURN(-1);
+ }
}
key_part_info->length=(uint16) length;
/* Use packed keys for long strings on the first column */
@@ -956,7 +1065,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
create_info->table_options|=HA_CREATE_DELAY_KEY_WRITE;
}
else
- (void) sprintf(path,"%s/%s/%s%s",mysql_data_home,db,table_name,reg_ext);
+ (void) sprintf(path,"%s/%s/%s%s",mysql_data_home,db,alias,reg_ext);
unpack_filename(path,path);
/* Check if table already exists */
if ((create_info->options & HA_LEX_CREATE_TMP_TABLE)
@@ -967,7 +1076,7 @@ int mysql_create_table(THD *thd,const char *db, const char *table_name,
create_info->table_existed= 1; // Mark that table existed
DBUG_RETURN(0);
}
- my_error(ER_TABLE_EXISTS_ERROR,MYF(0),table_name);
+ my_error(ER_TABLE_EXISTS_ERROR, MYF(0), alias);
DBUG_RETURN(-1);
}
if (wait_if_global_read_lock(thd, 0))
@@ -1046,7 +1155,8 @@ make_unique_key_name(const char *field_name,KEY *start,KEY *end)
{
char buff[MAX_FIELD_NAME],*buff_end;
- if (!check_if_keyname_exists(field_name,start,end))
+ if (!check_if_keyname_exists(field_name,start,end) &&
+ my_strcasecmp(system_charset_info,field_name,primary_key_name))
return (char*) field_name; // Use fieldname
buff_end=strmake(buff,field_name,MAX_FIELD_NAME-4);
for (uint i=2 ; ; i++)
@@ -1107,7 +1217,7 @@ TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
DBUG_RETURN(0);
if (!(table=open_table(thd,db,name,name,(bool*) 0)))
{
- quick_rm_table(create_info->db_type,db,name);
+ quick_rm_table(create_info->db_type,db,table_case_name(create_info,name));
DBUG_RETURN(0);
}
table->reginfo.lock_type=TL_WRITE;
@@ -1116,7 +1226,7 @@ TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
VOID(pthread_mutex_lock(&LOCK_open));
hash_delete(&open_cache,(byte*) table);
VOID(pthread_mutex_unlock(&LOCK_open));
- quick_rm_table(create_info->db_type,db,name);
+ quick_rm_table(create_info->db_type,db,table_case_name(create_info, name));
DBUG_RETURN(0);
}
table->file->extra(HA_EXTRA_WRITE_CACHE);
@@ -1131,18 +1241,32 @@ TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
bool
mysql_rename_table(enum db_type base,
const char *old_db,
- const char * old_name,
+ const char *old_name,
const char *new_db,
- const char * new_name)
+ const char *new_name)
{
- char from[FN_REFLEN],to[FN_REFLEN];
+ char from[FN_REFLEN], to[FN_REFLEN];
+ char tmp_from[NAME_LEN+1], tmp_to[NAME_LEN+1];
handler *file=get_new_handler((TABLE*) 0, base);
int error=0;
DBUG_ENTER("mysql_rename_table");
+
+ if (lower_case_table_names == 2 && !(file->table_flags() & HA_FILE_BASED))
+ {
+ /* Table handler expects to get all file names as lower case */
+ strmov(tmp_from, old_name);
+ my_casedn_str(system_charset_info, tmp_from);
+ old_name= tmp_from;
+
+ strmov(tmp_to, new_name);
+ my_casedn_str(system_charset_info, tmp_to);
+ new_name= tmp_to;
+ }
(void) sprintf(from,"%s/%s/%s",mysql_data_home,old_db,old_name);
(void) sprintf(to,"%s/%s/%s",mysql_data_home,new_db,new_name);
fn_format(from,from,"","",4);
fn_format(to,to, "","",4);
+
if (!(error=file->rename_table((const char*) from,(const char *) to)))
{
if (rename_file_ext(from,to,reg_ext))
@@ -1158,6 +1282,7 @@ mysql_rename_table(enum db_type base,
DBUG_RETURN(error != 0);
}
+
/*
Force all other threads to stop using the table
@@ -1202,7 +1327,7 @@ static void wait_while_table_is_used(THD *thd,TABLE *table,
Close a cached table
SYNOPSIS
- clsoe_cached_table()
+ close_cached_table()
thd Thread handler
table Table to remove from cache
@@ -1552,6 +1677,12 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables,
protocol->store("Operation failed",16, system_charset_info);
break;
+ case HA_ADMIN_REJECT:
+ protocol->store("status", 6, system_charset_info);
+ protocol->store("Operation need committed state",30, system_charset_info);
+ open_for_modify= FALSE;
+ break;
+
case HA_ADMIN_ALREADY_DONE:
protocol->store("status", 6, system_charset_info);
protocol->store("Table is already up to date", 27, system_charset_info);
@@ -1762,7 +1893,8 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table,
char *table_name= table->real_name;
char *src_db= thd->db;
char *src_table= table_ident->table.str;
- int err;
+ int err, res= -1;
+ TABLE_LIST src_tables_list;
DBUG_ENTER("mysql_create_like_table");
/*
@@ -1776,6 +1908,13 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table,
my_error(ER_WRONG_TABLE_NAME, MYF(0), src_table);
DBUG_RETURN(-1);
}
+
+ src_tables_list.db= table_ident->db.str ? table_ident->db.str : thd->db;
+ src_tables_list.real_name= table_ident->table.str;
+ src_tables_list.next= 0;
+
+ if (lock_and_wait_for_table_name(thd, &src_tables_list))
+ goto err;
if ((tmp_table= find_temporary_table(thd, src_db, src_table)))
strxmov(src_path, (*tmp_table)->path, reg_ext, NullS);
@@ -1786,7 +1925,7 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table,
if (access(src_path, F_OK))
{
my_error(ER_BAD_TABLE_ERROR, MYF(0), src_table);
- DBUG_RETURN(-1);
+ goto err;
}
}
@@ -1814,9 +1953,9 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table,
/*
Create a new table by copying from source table
- */
- if (my_copy(src_path, dst_path, MYF(MY_WME)))
- DBUG_RETURN(-1);
+ */
+ if (my_copy(src_path, dst_path, MYF(MY_WME|MY_DONT_OVERWRITE_FILE)))
+ goto err;
/*
As mysql_truncate don't work on a new table at this stage of
@@ -1832,16 +1971,28 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table,
{
(void) rm_temporary_table(create_info->db_type,
dst_path); /* purecov: inspected */
- DBUG_RETURN(-1); /* purecov: inspected */
+ goto err; /* purecov: inspected */
}
}
else if (err)
{
(void) quick_rm_table(create_info->db_type, db,
table_name); /* purecov: inspected */
- DBUG_RETURN(-1); /* purecov: inspected */
+ goto err; /* purecov: inspected */
}
- DBUG_RETURN(0);
+
+ // Must be written before unlock
+ mysql_update_log.write(thd,thd->query, thd->query_length);
+ if (mysql_bin_log.is_open())
+ {
+ thd->clear_error();
+ Query_log_event qinfo(thd, thd->query, thd->query_length,
+ test(create_info->options &
+ HA_LEX_CREATE_TMP_TABLE));
+ mysql_bin_log.write(&qinfo);
+ }
+ res= 0;
+ goto err;
table_exists:
if (create_info->options & HA_LEX_CREATE_IF_NOT_EXISTS)
@@ -1850,10 +2001,16 @@ table_exists:
sprintf(warn_buff,ER(ER_TABLE_EXISTS_ERROR),table_name);
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_TABLE_EXISTS_ERROR,warn_buff);
- DBUG_RETURN(0);
+ res= 0;
}
- my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name);
- DBUG_RETURN(-1);
+ else
+ my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name);
+
+err:
+ pthread_mutex_lock(&LOCK_open);
+ unlock_table_name(thd, &src_tables_list);
+ pthread_mutex_unlock(&LOCK_open);
+ DBUG_RETURN(res);
}
@@ -1943,9 +2100,10 @@ int mysql_discard_or_import_tablespace(THD *thd,
err:
close_thread_tables(thd);
thd->tablespace_op=FALSE;
- if (error == 0) {
+ if (error == 0)
+ {
send_ok(thd);
- DBUG_RETURN(0);
+ DBUG_RETURN(0);
}
DBUG_RETURN(error);
}
@@ -1964,21 +2122,24 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
{
TABLE *table,*new_table;
int error;
- char tmp_name[80],old_name[32],new_name_buff[FN_REFLEN],
- *table_name,*db;
+ char tmp_name[80],old_name[32],new_name_buff[FN_REFLEN];
+ char new_alias_buff[FN_REFLEN], *table_name, *db, *new_alias, *alias;
char index_file[FN_REFLEN], data_file[FN_REFLEN];
- bool use_timestamp=0;
ha_rows copied,deleted;
ulonglong next_insert_id;
- uint save_time_stamp,db_create_options, used_fields;
+ uint db_create_options, used_fields;
enum db_type old_db_type,new_db_type;
DBUG_ENTER("mysql_alter_table");
thd->proc_info="init";
table_name=table_list->real_name;
+ alias= (lower_case_table_names == 2) ? table_list->alias : table_name;
+
db=table_list->db;
- if (!new_db || !strcmp(new_db,db))
- new_db=db;
+ if (!new_db || !my_strcasecmp(table_alias_charset, new_db, db))
+ {
+ new_db= db;
+ }
used_fields=create_info->used_fields;
mysql_ha_closeall(thd, table_list);
@@ -1986,7 +2147,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
/* DISCARD/IMPORT TABLESPACE is always alone in an ALTER TABLE */
if (tablespace_op != NO_TABLESPACE_OP)
DBUG_RETURN(mysql_discard_or_import_tablespace(thd,table_list,
- tablespace_op));
+ tablespace_op));
if (!(table=open_ltable(thd,table_list,TL_WRITE_ALLOW_READ)))
DBUG_RETURN(-1);
@@ -1994,18 +2155,32 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
if (new_name)
{
strmov(new_name_buff,new_name);
- fn_same(new_name_buff,table_name,3);
+ strmov(new_alias= new_alias_buff, new_name);
if (lower_case_table_names)
- my_casedn_str(system_charset_info,new_name);
- if (!my_strcasecmp(table_alias_charset, new_name_buff, table_name))
- new_name=table_name; // No. Make later check easier
+ {
+ if (lower_case_table_names != 2)
+ {
+ my_casedn_str(system_charset_info, new_name_buff);
+ new_alias= new_name; // Create lower case table name
+ }
+ my_casedn_str(system_charset_info, new_name);
+ }
+ if (new_db == db &&
+ !my_strcasecmp(table_alias_charset, new_name_buff, table_name))
+ {
+ /*
+ Source and destination table names are equal: make later check
+ easier.
+ */
+ new_alias= new_name= table_name;
+ }
else
{
if (table->tmp_table)
{
if (find_temporary_table(thd,new_db,new_name_buff))
{
- my_error(ER_TABLE_EXISTS_ERROR,MYF(0),new_name);
+ my_error(ER_TABLE_EXISTS_ERROR,MYF(0),new_name_buff);
DBUG_RETURN(-1);
}
}
@@ -2015,14 +2190,14 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
F_OK))
{
/* Table will be closed in do_command() */
- my_error(ER_TABLE_EXISTS_ERROR,MYF(0),new_name);
+ my_error(ER_TABLE_EXISTS_ERROR,MYF(0), new_alias);
DBUG_RETURN(-1);
}
}
}
}
else
- new_name=table_name;
+ new_alias= new_name= table_name;
old_db_type=table->db_type;
if (create_info->db_type == DB_TYPE_DEFAULT)
@@ -2059,7 +2234,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
{
*fn_ext(new_name)=0;
close_cached_table(thd, table);
- if (mysql_rename_table(old_db_type,db,table_name,new_db,new_name))
+ if (mysql_rename_table(old_db_type,db,table_name,new_db,new_alias))
error= -1;
}
VOID(pthread_mutex_unlock(&LOCK_open));
@@ -2084,14 +2259,12 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN);
VOID(pthread_mutex_unlock(&LOCK_open));
table->file->deactivate_non_unique_index(HA_POS_ERROR);
+ /* COND_refresh will be signaled in close_thread_tables() */
}
else
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
ER_ILLEGAL_HA,
ER(ER_ILLEGAL_HA), table->table_name);
- break;
-
- /* COND_refresh will be signaled in close_thread_tables() */
break;
}
}
@@ -2122,7 +2295,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
if (!(used_fields & HA_CREATE_USED_DEFAULT_CHARSET))
create_info->default_table_charset= table->table_charset;
- restore_record(table,default_values); // Empty record for DEFAULT
+ restore_record(table,default_values); // Empty record for DEFAULT
List_iterator<Alter_drop> drop_it(drop_list);
List_iterator<create_field> def_it(fields);
List_iterator<Alter_column> alter_it(alter_list);
@@ -2171,8 +2344,6 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
if (def)
{ // Field is changed
def->field=field;
- if (def->sql_type == FIELD_TYPE_TIMESTAMP)
- use_timestamp=1;
if (!def->after)
{
create_list.push_back(def);
@@ -2182,9 +2353,6 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
else
{ // Use old field value
create_list.push_back(def=new create_field(field,field));
- if (def->sql_type == FIELD_TYPE_TIMESTAMP)
- use_timestamp=1;
-
alter_it.rewind(); // Change default if ALTER
Alter_column *alter;
while ((alter=alter_it++))
@@ -2326,6 +2494,12 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
{
if (key->type != Key::FOREIGN_KEY)
key_list.push_back(key);
+ if (key->name &&
+ !my_strcasecmp(system_charset_info,key->name,primary_key_name))
+ {
+ my_error(ER_WRONG_NAME_FOR_INDEX, MYF(0), key->name);
+ DBUG_RETURN(-1);
+ }
}
}
@@ -2431,9 +2605,13 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
goto err;
}
- save_time_stamp=new_table->time_stamp;
- if (use_timestamp)
- new_table->time_stamp=0;
+
+ /*
+ We don't want update TIMESTAMP fields during ALTER TABLE
+ and copy_data_between_tables uses only write_row() for new_table so
+ don't need to set up timestamp_on_update_now member.
+ */
+ new_table->timestamp_default_now= 0;
new_table->next_number_field=new_table->found_next_number_field;
thd->count_cuted_fields= CHECK_FIELD_WARN; // calc cuted fields
thd->cuted_fields=0L;
@@ -2446,7 +2624,6 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
order_num, order, &copied, &deleted);
thd->last_insert_id=next_insert_id; // Needed for correct log
thd->count_cuted_fields= CHECK_FIELD_IGNORE;
- new_table->time_stamp=save_time_stamp;
if (table->tmp_table)
{
@@ -2468,7 +2645,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
}
/* Remove link to old table and rename the new one */
close_temporary_table(thd,table->table_cache_key,table_name);
- if (rename_temporary_table(thd, new_table, new_db, new_name))
+ if (rename_temporary_table(thd, new_table, new_db, new_alias))
{ // Fatal error
close_temporary_table(thd,new_db,tmp_name);
my_free((gptr) new_table,MYF(0));
@@ -2492,6 +2669,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
VOID(pthread_mutex_unlock(&LOCK_open));
goto err;
}
+
/*
Data is copied. Now we rename the old table to a temp name,
rename the new one to the old name, remove all entries from the old table
@@ -2543,12 +2721,12 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
VOID(quick_rm_table(new_db_type,new_db,tmp_name));
}
else if (mysql_rename_table(new_db_type,new_db,tmp_name,new_db,
- new_name))
+ new_alias))
{ // Try to get everything back
error=1;
- VOID(quick_rm_table(new_db_type,new_db,new_name));
+ VOID(quick_rm_table(new_db_type,new_db,new_alias));
VOID(quick_rm_table(new_db_type,new_db,tmp_name));
- VOID(mysql_rename_table(old_db_type,db,old_name,db,table_name));
+ VOID(mysql_rename_table(old_db_type,db,old_name,db,alias));
}
if (error)
{
@@ -2714,13 +2892,14 @@ copy_data_between_tables(TABLE *from,TABLE *to,
goto err;
};
- /* Turn off recovery logging since rollback of an
- alter table is to delete the new table so there
- is no need to log the changes to it. */
- error = ha_recovery_logging(thd,FALSE);
+ /*
+ Turn off recovery logging since rollback of an alter table is to
+ delete the new table so there is no need to log the changes to it.
+ */
+ error= ha_recovery_logging(thd,FALSE);
if (error)
{
- error = 1;
+ error= 1;
goto err;
}
@@ -2796,7 +2975,7 @@ int mysql_checksum_table(THD *thd, TABLE_LIST *tables, HA_CHECK_OPT *check_opt)
List<Item> field_list;
Item *item;
Protocol *protocol= thd->protocol;
- DBUG_ENTER("mysql_admin_table");
+ DBUG_ENTER("mysql_checksum_table");
field_list.push_back(item = new Item_empty_string("Table", NAME_LEN*2));
item->maybe_null= 1;
@@ -2839,12 +3018,10 @@ int mysql_checksum_table(THD *thd, TABLE_LIST *tables, HA_CHECK_OPT *check_opt)
/* calculating table's checksum */
ha_checksum crc= 0;
- if (t->db_type == DB_TYPE_INNODB) {
- /* InnoDB must be told explicitly to retrieve all columns, because
- this function does not set field->query_id in the columns to the
- current query id */
- t->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS);
- }
+ /* InnoDB must be told explicitly to retrieve all columns, because
+ this function does not set field->query_id in the columns to the
+ current query id */
+ t->file->extra(HA_EXTRA_RETRIEVE_ALL_COLS);
if (t->file->rnd_init(1))
protocol->store_null();
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index cd493fcac30..f2909b93a2a 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -306,10 +306,14 @@ static void display_table_locks(void)
THR_LOCK *lock=(THR_LOCK*) list->data;
VOID(pthread_mutex_lock(&lock->mutex));
- push_locks_into_array(&saved_table_locks, lock->write.data, false, "Locked - write");
- push_locks_into_array(&saved_table_locks, lock->write_wait.data, true, "Waiting - write");
- push_locks_into_array(&saved_table_locks, lock->read.data, false, "Locked - read");
- push_locks_into_array(&saved_table_locks, lock->read_wait.data, true, "Waiting - read");
+ push_locks_into_array(&saved_table_locks, lock->write.data, FALSE,
+ "Locked - write");
+ push_locks_into_array(&saved_table_locks, lock->write_wait.data, TRUE,
+ "Waiting - write");
+ push_locks_into_array(&saved_table_locks, lock->read.data, FALSE,
+ "Locked - read");
+ push_locks_into_array(&saved_table_locks, lock->read_wait.data, TRUE,
+ "Waiting - read");
VOID(pthread_mutex_unlock(&lock->mutex));
}
VOID(pthread_mutex_unlock(&THR_LOCK_lock));
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index 6e8aae54b23..561f79f9de1 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -120,6 +120,7 @@ void udf_init()
udf_func *tmp;
TABLE_LIST tables;
READ_RECORD read_record_info;
+ TABLE *table;
int error;
DBUG_ENTER("ufd_init");
@@ -152,13 +153,11 @@ void udf_init()
if (simple_open_n_lock_tables(new_thd, &tables))
{
DBUG_PRINT("error",("Can't open udf table"));
- sql_print_error("Can't open mysql/func table");
- close_thread_tables(new_thd);
- delete new_thd;
- DBUG_VOID_RETURN;
+ sql_print_error("Can't open the mysql/func table. Please run the mysql_install_db script to create it.");
+ goto end;
}
- TABLE *table = tables.table;
+ table= tables.table;
init_read_record(&read_record_info, new_thd, table, NULL,1,0);
while (!(error = read_record_info.read_record(&read_record_info)))
{
@@ -206,6 +205,8 @@ void udf_init()
sql_print_error(ER(ER_GET_ERRNO), my_errno);
end_read_record(&read_record_info);
new_thd->version--; // Force close to free memory
+
+end:
close_thread_tables(new_thd);
delete new_thd;
/* Remember that we don't have a THD */
@@ -297,7 +298,11 @@ udf_func *find_udf(const char *name,uint length,bool mark_used)
DBUG_ENTER("find_udf");
/* TODO: This should be changed to reader locks someday! */
- rw_rdlock(&THR_LOCK_udf);
+ if (mark_used)
+ rw_wrlock(&THR_LOCK_udf); /* Called during fix_fields */
+ else
+ rw_rdlock(&THR_LOCK_udf); /* Called during parsing */
+
if ((udf=(udf_func*) hash_search(&udf_hash,(byte*) name,
length ? length : (uint) strlen(name))))
{
@@ -473,7 +478,7 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name)
if (!(udf=(udf_func*) hash_search(&udf_hash,(byte*) udf_name->str,
(uint) udf_name->length)))
{
- net_printf(thd, ER_FUNCTION_NOT_DEFINED, udf_name);
+ net_printf(thd, ER_FUNCTION_NOT_DEFINED, udf_name->str);
goto err;
}
del_udf(udf);
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index 303b0990cf7..7ac5c23a54d 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -112,6 +112,7 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
SELECT_LEX *lex_select_save= thd_arg->lex->current_select;
SELECT_LEX *sl, *first_select;
select_result *tmp_result;
+ ORDER *tmp_order;
DBUG_ENTER("st_select_lex_unit::prepare");
/*
@@ -150,6 +151,9 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
JOIN *join= new JOIN(thd_arg, sl->item_list,
sl->options | thd_arg->options | additional_options,
tmp_result);
+ if (!join)
+ goto err;
+
thd_arg->lex->current_select= sl;
set_limit(sl, sl);
if (sl->braces)
@@ -175,6 +179,7 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
Item *item_tmp;
while ((item_tmp= it++))
{
+ /* Error's in 'new' will be detected after loop */
types.push_back(new Item_type_holder(thd_arg, item_tmp));
}
@@ -200,12 +205,14 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
}
}
+ item_list.empty();
+ // it is not single select
if (first_select->next_select())
{
union_result->tmp_table_param.field_count= types.elements;
if (!(table= create_tmp_table(thd_arg,
&union_result->tmp_table_param, types,
- (ORDER*) 0, !union_option, 1,
+ (ORDER*) 0, union_distinct, 1,
(first_select_in_union()->options |
thd_arg->options |
TMP_TABLE_ALL_COLUMNS),
@@ -219,15 +226,25 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
result_table_list.table= table;
union_result->set_table(table);
- item_list.empty();
thd_arg->lex->current_select= lex_select_save;
{
+ Statement *stmt= thd->current_statement;
+ Statement backup;
+ if (stmt)
+ thd->set_n_backup_item_arena(stmt, &backup);
Field **field;
for (field= table->field; *field; field++)
{
- if (item_list.push_back(new Item_field(*field)))
+ Item_field *item= new Item_field(*field);
+ if (!item || item_list.push_back(item))
+ {
+ if (stmt)
+ thd->restore_backup_item_arena(stmt, &backup);
DBUG_RETURN(-1);
+ }
}
+ if (stmt)
+ thd->restore_backup_item_arena(stmt, &backup);
}
}
else
@@ -262,6 +279,8 @@ int st_select_lex_unit::exec()
item->reset();
table->file->delete_all_rows();
}
+ if (union_distinct) // for subselects
+ table->file->extra(HA_EXTRA_CHANGE_KEY_TO_UNIQUE);
for (SELECT_LEX *sl= select_cursor; sl; sl= sl->next_select())
{
ha_rows records_at_start= 0;
@@ -306,33 +325,14 @@ int st_select_lex_unit::exec()
sl->options|= found_rows_for_union;
}
sl->join->select_options=sl->options;
- /*
- As far as union share table space we should reassign table map,
- which can be spoiled by 'prepare' of JOIN of other UNION parts
- if it use same tables
- */
- uint tablenr=0;
- for (TABLE_LIST *table_list= (TABLE_LIST*) sl->table_list.first;
- table_list;
- table_list= table_list->next, tablenr++)
- {
- if (table_list->shared)
- {
- /*
- review notes: Check it carefully. I still can't understand
- why I should not touch table->used_keys. For my point of
- view we should do here same procedura as it was done by
- setup_table
- */
- setup_table_map(table_list->table, table_list, tablenr);
- }
- }
res= sl->join->optimize();
}
if (!res)
{
records_at_start= table->file->records;
sl->join->exec();
+ if (sl == union_distinct)
+ table->file->extra(HA_EXTRA_CHANGE_KEY_TO_DUP);
res= sl->join->error;
offset_limit_cnt= sl->offset_limit;
if (!res && union_result->flush())
@@ -391,8 +391,10 @@ int st_select_lex_unit::exec()
allocate JOIN for fake select only once (privent
mysql_select automatic allocation)
*/
- fake_select_lex->join= new JOIN(thd, item_list,
- fake_select_lex->options, result);
+ if (!(fake_select_lex->join= new JOIN(thd, item_list,
+ fake_select_lex->options, result)))
+ DBUG_RETURN(-1);
+
/*
Fake st_select_lex should have item list for correctref_array
allocation.
@@ -439,7 +441,7 @@ int st_select_lex_unit::cleanup()
{
DBUG_RETURN(0);
}
- cleaned= 0;
+ cleaned= 1;
if (union_result)
{
@@ -467,3 +469,25 @@ int st_select_lex_unit::cleanup()
}
DBUG_RETURN(error);
}
+
+
+void st_select_lex_unit::reinit_exec_mechanism()
+{
+ prepared= optimized= executed= 0;
+#ifndef DBUG_OFF
+ if (first_select()->next_select())
+ {
+ List_iterator_fast<Item> it(item_list);
+ Item *field;
+ while ((field= it++))
+ {
+ /*
+ we can't cleanup here, because it broke link to temporary table field,
+ but have to drop fixed flag to allow next fix_field of this field
+ during re-executing
+ */
+ field->fixed= 0;
+ }
+ }
+#endif
+}
diff --git a/sql/sql_update.cc b/sql/sql_update.cc
index 24199df9b84..277a6b3bf37 100644
--- a/sql/sql_update.cc
+++ b/sql/sql_update.cc
@@ -15,8 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-/* Update of records
- Multi-table updates were introduced by Monty and Sinisa <sinisa@mysql.com>
+/*
+ Single table and multi table updates of tables.
+ Multi-table updates were introduced by Sinisa & Monty
*/
#include "mysql_priv.h"
@@ -94,7 +95,7 @@ int mysql_update(THD *thd,
tables.table= table;
tables.alias= table_list->alias;
- if (setup_tables(update_table_list, 0) ||
+ if (setup_tables(update_table_list) ||
setup_conds(thd,update_table_list,&conds) ||
thd->lex->select_lex.setup_ref_array(thd, order_num) ||
setup_order(thd, thd->lex->select_lex.ref_pointer_array,
@@ -119,7 +120,6 @@ int mysql_update(THD *thd,
{
timestamp_query_id=table->timestamp_field->query_id;
table->timestamp_field->query_id=thd->query_id-1;
- table->time_stamp= table->timestamp_field->offset() +1;
}
/* Check the fields we are going to modify */
@@ -132,7 +132,7 @@ int mysql_update(THD *thd,
{
// Don't set timestamp column if this is modified
if (table->timestamp_field->query_id == thd->query_id)
- table->time_stamp=0;
+ table->timestamp_on_update_now= 0;
else
table->timestamp_field->query_id=timestamp_query_id;
}
@@ -272,6 +272,8 @@ int mysql_update(THD *thd,
}
}
}
+ if (thd->killed && !error)
+ error= 1; // Aborted
limit= tmp_limit;
end_read_record(&info);
/* Change select to use tempfile */
@@ -344,6 +346,8 @@ int mysql_update(THD *thd,
table->file->unlock_row();
thd->row_count++;
}
+ if (thd->killed && !error)
+ error= 1; // Aborted
end_read_record(&info);
free_io_cache(table); // If ORDER BY
thd->proc_info="end";
@@ -436,17 +440,31 @@ int mysql_multi_update(THD *thd,
int res;
multi_update *result;
TABLE_LIST *tl;
+ table_map item_tables= 0, derived_tables= 0;
DBUG_ENTER("mysql_multi_update");
-#ifndef NO_EMBEDDED_ACCESS_CHECKS
- table_list->grant.want_privilege=(SELECT_ACL & ~table_list->grant.privilege);
-#endif
- if ((res=open_and_lock_tables(thd,table_list)))
+ if ((res=open_and_lock_tables(thd,table_list)))
DBUG_RETURN(res);
select_lex->select_limit= HA_POS_ERROR;
- table_map item_tables= 0, derived_tables= 0;
+ /*
+ Ensure that we have update privilege for all tables and columns in the
+ SET part
+ */
+ for (tl= table_list ; tl ; tl=tl->next)
+ {
+ TABLE *table= tl->table;
+ /*
+ Update of derived tables is checked later
+ We don't check privileges here, becasue then we would get error
+ "UPDATE command denided .. for column N" instead of
+ "Target table ... is not updatable"
+ */
+ if (!tl->derived)
+ table->grant.want_privilege= (UPDATE_ACL & ~table->grant.privilege);
+ }
+
if (thd->lex->derived_tables)
{
// Assign table map values to check updatability of derived tables
@@ -477,13 +495,14 @@ int mysql_multi_update(THD *thd,
for (tl= select_lex->get_table_list() ; tl ; tl= tl->next)
{
TABLE *table= tl->table;
- if (table->timestamp_field)
- {
- table->time_stamp=0;
- // Only set timestamp column if this is not modified
- if (table->timestamp_field->query_id != thd->query_id)
- table->time_stamp= table->timestamp_field->offset() +1;
- }
+
+ /* We only need SELECT privilege for columns in the values list */
+ table->grant.want_privilege= (SELECT_ACL & ~table->grant.privilege);
+ // Only set timestamp column if this is not modified
+ if (table->timestamp_field &&
+ table->timestamp_field->query_id == thd->query_id)
+ table->timestamp_on_update_now= 0;
+
if (tl->derived)
derived_tables|= table->map;
}
@@ -680,7 +699,7 @@ multi_update::initialize_tables(JOIN *join)
{
TABLE *table=table_ref->table;
uint cnt= table_ref->shared;
- Item_field *If;
+ Item_field *ifield;
List<Item> temp_fields= *fields_for_table[cnt];
ORDER group;
@@ -704,10 +723,10 @@ multi_update::initialize_tables(JOIN *join)
/* ok to be on stack as this is not referenced outside of this func */
Field_string offset(table->file->ref_length, 0, "offset",
table, &my_charset_bin);
- if (!(If=new Item_field(((Field *) &offset))))
+ if (!(ifield= new Item_field(((Field *) &offset))))
DBUG_RETURN(1);
- If->maybe_null=0;
- if (temp_fields.push_front(If))
+ ifield->maybe_null= 0;
+ if (temp_fields.push_front(ifield))
DBUG_RETURN(1);
/* Make an unique key over the first field to avoid duplicated updates */
@@ -950,14 +969,16 @@ int multi_update::do_updates(bool from_send_error)
DBUG_RETURN(0);
for (cur_table= update_tables; cur_table ; cur_table= cur_table->next)
{
+ byte *ref_pos;
+ TABLE *tmp_table;
+
table = cur_table->table;
if (table == table_to_update)
continue; // Already updated
-
org_updated= updated;
- byte *ref_pos;
- TABLE *tmp_table= tmp_tables[cur_table->shared];
+ tmp_table= tmp_tables[cur_table->shared];
tmp_table->file->extra(HA_EXTRA_CACHE); // Change to read cache
+ (void) table->file->rnd_init(0);
table->file->extra(HA_EXTRA_NO_CACHE);
/*
@@ -1024,6 +1045,7 @@ int multi_update::do_updates(bool from_send_error)
else
trans_safe= 0; // Can't do safe rollback
}
+ (void) table->file->rnd_end();
}
DBUG_RETURN(0);
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 79ede4dbfa7..17236941ceb 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -68,6 +68,7 @@ inline Item *or_or_concat(THD *thd, Item* A, Item* B)
Table_ident *table;
char *simple_string;
Item *item;
+ Item_num *item_num;
List<Item> *item_list;
List<String> *string_list;
String *string;
@@ -224,6 +225,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token CONSTRAINT
%token CONTINUE_SYM
%token CONVERT_SYM
+%token CURRENT_USER
%token DATABASES
%token DATA_SYM
%token DECLARE_SYM
@@ -614,7 +616,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%token BEFORE_SYM
%left SET_VAR
-%left OR_OR_CONCAT OR
+%left OR_OR_CONCAT OR XOR
%left AND
%left BETWEEN_SYM CASE_SYM WHEN_SYM THEN_SYM ELSE
%left EQ EQUAL_SYM GE GT_SYM LE LT NE IS LIKE REGEXP IN_SYM
@@ -623,7 +625,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
%left SHIFT_LEFT SHIFT_RIGHT
%left '-' '+'
%left '*' '/' '%' DIV_SYM MOD_SYM
-%left XOR
%left '^'
%left NEG '~'
%right NOT
@@ -640,7 +641,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
opt_table_alias
%type <table>
- table_ident references
+ table_ident table_ident_ref references
%type <simple_string>
remember_name remember_end opt_ident opt_db text_or_password
@@ -654,7 +655,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
udf_type if_exists opt_local opt_table_options table_options
table_option opt_if_not_exists opt_no_write_to_binlog opt_var_type
opt_var_ident_type delete_option opt_temporary all_or_any opt_distinct
- opt_ignore_leaves fulltext_options spatial_type
+ opt_ignore_leaves fulltext_options spatial_type union_option
%type <ulong_num>
ULONG_NUM raid_types merge_insert_types
@@ -672,10 +673,13 @@ 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 NUM_literal
+ signed_literal now_or_signed_literal
sp_opt_default
simple_ident_nospvar simple_ident_q
+%type <item_num>
+ NUM_literal
+
%type <item_list>
expr_list udf_expr_list udf_expr_list2 when_list
ident_list ident_list_arg
@@ -759,7 +763,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize);
table_to_table_list table_to_table opt_table_list opt_as
handler_rkey_function handler_read_or_scan
single_multi table_wild_list table_wild_one opt_wild
- union_clause union_list union_option
+ union_clause union_list
precision subselect_start opt_and charset
subselect_end select_var_list select_var_list_init help opt_len
opt_extended_describe
@@ -2169,26 +2173,16 @@ create_table_option:
table_list->next=0;
lex->create_info.used_fields|= HA_CREATE_USED_UNION;
}
- | DEFAULT charset opt_equal charset_name_or_default
+ | opt_default charset opt_equal charset_name_or_default
{
Lex->create_info.default_table_charset= $4;
Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
}
- | charset opt_equal charset_name_or_default
- {
- Lex->create_info.table_charset= $3;
- Lex->create_info.used_fields|= HA_CREATE_USED_CHARSET;
- }
- | DEFAULT COLLATE_SYM opt_equal collation_name_or_default
+ | opt_default COLLATE_SYM opt_equal collation_name_or_default
{
- Lex->create_info.table_charset= $4;
+ Lex->create_info.default_table_charset= $4;
Lex->create_info.used_fields|= HA_CREATE_USED_DEFAULT_CHARSET;
}
- | COLLATE_SYM opt_equal collation_name_or_default
- {
- Lex->create_info.table_charset= $3;
- Lex->create_info.used_fields|= HA_CREATE_USED_CHARSET;
- }
| INSERT_METHOD opt_equal merge_insert_types { Lex->create_info.merge_insert_method= $3; Lex->create_info.used_fields|= HA_CREATE_USED_INSERT_METHOD;}
| DATA_SYM DIRECTORY_SYM opt_equal TEXT_STRING_sys
{ Lex->create_info.data_file_name= $4.str; }
@@ -2297,7 +2291,7 @@ field_spec:
{
LEX *lex=Lex;
lex->length=lex->dec=0; lex->type=0; lex->interval=0;
- lex->default_value=0;
+ lex->default_value= lex->on_update_value= 0;
lex->comment=0;
lex->charset=NULL;
}
@@ -2307,7 +2301,8 @@ field_spec:
if (add_field_to_list(lex->thd, $1.str,
(enum enum_field_types) $3,
lex->length,lex->dec,lex->type,
- lex->default_value, lex->comment,
+ lex->default_value, lex->on_update_value,
+ lex->comment,
lex->change,lex->interval,lex->charset,
lex->uint_geom_type))
YYABORT;
@@ -2503,7 +2498,9 @@ opt_attribute_list:
attribute:
NULL_SYM { Lex->type&= ~ NOT_NULL_FLAG; }
| NOT NULL_SYM { Lex->type|= NOT_NULL_FLAG; }
- | DEFAULT signed_literal { Lex->default_value=$2; }
+ | DEFAULT now_or_signed_literal { Lex->default_value=$2; }
+ | ON UPDATE_SYM NOW_SYM optional_braces
+ { Lex->on_update_value= new Item_func_now_local(); }
| AUTO_INC { Lex->type|= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG; }
| SERIAL_SYM DEFAULT VALUE_SYM
{ Lex->type|= AUTO_INCREMENT_FLAG | NOT_NULL_FLAG | UNIQUE_FLAG; }
@@ -2511,6 +2508,7 @@ attribute:
| UNIQUE_SYM { Lex->type|= UNIQUE_FLAG; }
| UNIQUE_SYM KEY_SYM { Lex->type|= UNIQUE_KEY_FLAG; }
| COMMENT_SYM TEXT_STRING_sys { Lex->comment= &$2; }
+ | BINARY { Lex->type|= BINCMP_FLAG; }
| COLLATE_SYM collation_name
{
if (Lex->charset && !my_charset_same(Lex->charset,$2))
@@ -2526,6 +2524,11 @@ attribute:
}
;
+now_or_signed_literal:
+ NOW_SYM optional_braces { $$= new Item_func_now_local(); }
+ | signed_literal { $$=$1; }
+ ;
+
charset:
CHAR_SYM SET {}
| CHARSET {}
@@ -2592,7 +2595,6 @@ opt_binary:
/* empty */ { Lex->charset=NULL; }
| ASCII_SYM { Lex->charset=&my_charset_latin1; }
| BYTE_SYM { Lex->charset=&my_charset_bin; }
- | BINARY { Lex->charset=&my_charset_bin; }
| UNICODE_SYM
{
if (!(Lex->charset=get_charset_by_csname("ucs2",MY_CS_PRIMARY,MYF(0))))
@@ -2826,7 +2828,7 @@ alter_list_item:
{
LEX *lex=Lex;
lex->length=lex->dec=0; lex->type=0; lex->interval=0;
- lex->default_value=0;
+ lex->default_value= lex->on_update_value= 0;
lex->comment=0;
lex->charset= NULL;
lex->simple_alter=0;
@@ -2837,7 +2839,8 @@ alter_list_item:
if (add_field_to_list(lex->thd,$3.str,
(enum enum_field_types) $5,
lex->length,lex->dec,lex->type,
- lex->default_value, lex->comment,
+ lex->default_value, lex->on_update_value,
+ lex->comment,
$3.str, lex->interval, lex->charset,
lex->uint_geom_type))
YYABORT;
@@ -2884,6 +2887,27 @@ alter_list_item:
lex->select_lex.db=$3->db.str;
lex->name= $3->table.str;
}
+ | CONVERT_SYM TO_SYM charset charset_name_or_default opt_collate
+ {
+ if (!$4)
+ {
+ THD *thd= YYTHD;
+ $4= thd->variables.collation_database;
+ }
+ $5= $5 ? $5 : $4;
+ if (!my_charset_same($4,$5))
+ {
+ net_printf(YYTHD,ER_COLLATION_CHARSET_MISMATCH,
+ $5->name,$4->csname);
+ YYABORT;
+ }
+ LEX *lex= Lex;
+ lex->create_info.table_charset=
+ lex->create_info.default_table_charset= $5;
+ lex->create_info.used_fields|= (HA_CREATE_USED_CHARSET |
+ HA_CREATE_USED_DEFAULT_CHARSET);
+ lex->simple_alter= 0;
+ }
| create_table_options_space_separated { Lex->simple_alter=0; }
| order_clause { Lex->simple_alter=0; };
@@ -3246,13 +3270,13 @@ select_init:
SELECT_LEX * sel= lex->current_select;
if (sel->set_braces(1))
{
- send_error(lex->thd, ER_SYNTAX_ERROR);
+ yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
}
if (sel->linkage == UNION_TYPE &&
!sel->master_unit()->first_select()->braces)
{
- send_error(lex->thd, ER_SYNTAX_ERROR);
+ yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
}
/* select in braces, can't contain global parameters */
@@ -3268,13 +3292,13 @@ select_init2:
SELECT_LEX * sel= lex->current_select;
if (lex->current_select->set_braces(0))
{
- send_error(lex->thd, ER_SYNTAX_ERROR);
+ yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
}
if (sel->linkage == UNION_TYPE &&
sel->master_unit()->first_select()->braces)
{
- send_error(lex->thd, ER_SYNTAX_ERROR);
+ yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
}
}
@@ -3603,7 +3627,7 @@ simple_expr:
$$= new Item_func_set_collation($1,
new Item_string($3.str,
$3.length,
- YYTHD->charset()));
+ YYTHD->charset()));
}
| literal
| param_marker
@@ -3619,6 +3643,12 @@ simple_expr:
}
| '@' '@' opt_var_ident_type ident_or_text opt_component
{
+
+ if ($4.str && $5.str && check_reserved_words(&$4))
+ {
+ yyerror(ER(ER_SYNTAX_ERROR));
+ YYABORT;
+ }
if (!($$= get_system_var(YYTHD, (enum_var_type) $3, $4, $5)))
YYABORT;
}
@@ -3751,6 +3781,8 @@ simple_expr:
$$= new Item_func_curtime_local($3);
Lex->safe_to_cache_query=0;
}
+ | CURRENT_USER optional_braces
+ { $$= create_func_current_user(); }
| DATE_ADD_INTERVAL '(' expr ',' interval_expr interval ')'
{ $$= new Item_date_add_interval($3,$5,$6,0); }
| DATE_SUB_INTERVAL '(' expr ',' interval_expr interval ')'
@@ -3830,20 +3862,19 @@ simple_expr:
{
if ($1->type() != Item::ROW_ITEM)
{
- send_error(Lex->thd, ER_SYNTAX_ERROR);
+ yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
}
$$= new Item_func_interval((Item_row *)$1);
}
| LAST_INSERT_ID '(' ')'
{
- $$= get_system_var(YYTHD, OPT_SESSION, "last_insert_id", 14,
- "last_insert_id()");
+ $$= new Item_func_last_insert_id();
Lex->safe_to_cache_query= 0;
}
| LAST_INSERT_ID '(' expr ')'
{
- $$= new Item_func_set_last_insert_id($3);
+ $$= new Item_func_last_insert_id($3);
Lex->safe_to_cache_query= 0;
}
| LEFT '(' expr ',' expr ')'
@@ -4086,14 +4117,14 @@ geometry_function:
{ $$= GEOM_NEW(Item_func_geometry_from_wkb($3, $5)); }
| GEOMETRYCOLLECTION '(' expr_list ')'
{ $$= GEOM_NEW(Item_func_spatial_collection(* $3,
- Geometry::wkbGeometryCollection,
- Geometry::wkbPoint)); }
+ Geometry::wkb_geometrycollection,
+ Geometry::wkb_point)); }
| LINESTRING '(' expr_list ')'
{ $$= GEOM_NEW(Item_func_spatial_collection(* $3,
- Geometry::wkbLineString, Geometry::wkbPoint)); }
+ Geometry::wkb_linestring, Geometry::wkb_point)); }
| MULTILINESTRING '(' expr_list ')'
{ $$= GEOM_NEW( Item_func_spatial_collection(* $3,
- Geometry::wkbMultiLineString, Geometry::wkbLineString)); }
+ Geometry::wkb_multilinestring, Geometry::wkb_linestring)); }
| MLINEFROMTEXT '(' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3)); }
| MLINEFROMTEXT '(' expr ',' expr ')'
@@ -4108,10 +4139,10 @@ geometry_function:
{ $$= GEOM_NEW(Item_func_geometry_from_text($3, $5)); }
| MULTIPOINT '(' expr_list ')'
{ $$= GEOM_NEW(Item_func_spatial_collection(* $3,
- Geometry::wkbMultiPoint, Geometry::wkbPoint)); }
+ Geometry::wkb_multipoint, Geometry::wkb_point)); }
| MULTIPOLYGON '(' expr_list ')'
{ $$= GEOM_NEW(Item_func_spatial_collection(* $3,
- Geometry::wkbMultiPolygon, Geometry::wkbPolygon)); }
+ Geometry::wkb_multipolygon, Geometry::wkb_polygon)); }
| POINT_SYM '(' expr ',' expr ')'
{ $$= GEOM_NEW(Item_func_point($3,$5)); }
| POINTFROMTEXT '(' expr ')'
@@ -4124,7 +4155,7 @@ geometry_function:
{ $$= GEOM_NEW(Item_func_geometry_from_text($3, $5)); }
| POLYGON '(' expr_list ')'
{ $$= GEOM_NEW(Item_func_spatial_collection(* $3,
- Geometry::wkbPolygon, Geometry::wkbLineString)); }
+ Geometry::wkb_polygon, Geometry::wkb_linestring)); }
| GEOMCOLLFROMTEXT '(' expr ')'
{ $$= GEOM_NEW(Item_func_geometry_from_text($3)); }
| GEOMCOLLFROMTEXT '(' expr ',' expr ')'
@@ -4216,11 +4247,15 @@ sum_expr:
{ $$=new Item_sum_sum($3); }
| SUM_SYM '(' DISTINCT in_sum_expr ')'
{ $$=new Item_sum_sum_distinct($4); }
- | GROUP_CONCAT_SYM '(' opt_distinct expr_list opt_gorder_clause
- opt_gconcat_separator ')'
+ | GROUP_CONCAT_SYM '(' opt_distinct
+ { Select->in_sum_expr++; }
+ expr_list opt_gorder_clause
+ opt_gconcat_separator
+ ')'
{
- $$=new Item_func_group_concat($3,$4,Lex->gorder_list,$6);
- $4->empty();
+ Select->in_sum_expr--;
+ $$=new Item_func_group_concat($3,$5,Select->gorder_list,$7);
+ $5->empty();
};
opt_distinct:
@@ -4228,23 +4263,22 @@ opt_distinct:
|DISTINCT { $$ = 1; };
opt_gconcat_separator:
- /* empty */ { $$ = new String(",",1,default_charset_info); }
+ /* empty */ { $$ = new (&YYTHD->mem_root) String(",",1,default_charset_info); }
|SEPARATOR_SYM text_string { $$ = $2; };
opt_gorder_clause:
/* empty */
{
- LEX *lex=Lex;
- lex->gorder_list = NULL;
+ Select->gorder_list = NULL;
}
| order_clause
{
- LEX *lex=Lex;
- lex->gorder_list=
- (SQL_LIST*) sql_memdup((char*) &lex->current_select->order_list,
+ SELECT_LEX *select= Select;
+ select->gorder_list=
+ (SQL_LIST*) sql_memdup((char*) &select->order_list,
sizeof(st_sql_list));
- lex->current_select->order_list.empty();
+ select->order_list.empty();
};
@@ -4254,7 +4288,7 @@ in_sum_expr:
LEX *lex= Lex;
if (lex->current_select->inc_in_sum_expr())
{
- send_error(lex->thd, ER_SYNTAX_ERROR);
+ yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
}
}
@@ -4265,7 +4299,7 @@ in_sum_expr:
};
cast_type:
- BINARY { $$=ITEM_CAST_BINARY; Lex->charset= NULL; Lex->length= (char*)0; }
+ BINARY opt_len { $$=ITEM_CAST_CHAR; Lex->charset= &my_charset_bin; }
| CHAR_SYM opt_len opt_binary { $$=ITEM_CAST_CHAR; }
| NCHAR_SYM opt_len { $$=ITEM_CAST_CHAR; Lex->charset= national_charset_info; }
| SIGNED_SYM { $$=ITEM_CAST_SIGNED_INT; Lex->charset= NULL; Lex->length= (char*)0; }
@@ -4425,8 +4459,8 @@ select_derived:
if (((int)lex->sql_command >= (int)SQLCOM_HA_OPEN &&
lex->sql_command <= (int)SQLCOM_HA_READ) ||
lex->sql_command == (int)SQLCOM_KILL)
- {
- send_error(lex->thd, ER_SYNTAX_ERROR);
+ {
+ yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
}
if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE ||
@@ -4434,8 +4468,13 @@ select_derived:
YYABORT;
mysql_init_select(lex);
lex->current_select->linkage= DERIVED_TABLE_TYPE;
+ lex->current_select->parsing_place= SELECT_LEX_NODE::SELECT_LIST;
+ }
+ select_options select_item_list
+ {
+ Select->parsing_place= SELECT_LEX_NODE::NO_MATTER;
}
- select_options select_item_list opt_select_from union_opt
+ opt_select_from union_opt
;
opt_outer:
@@ -4478,15 +4517,15 @@ key_list_or_empty:
key_usage_list2:
key_usage_list2 ',' ident
{ Select->
- interval_list.push_back(new String((const char*) $3.str, $3.length,
+ interval_list.push_back(new (&YYTHD->mem_root) String((const char*) $3.str, $3.length,
system_charset_info)); }
| ident
{ Select->
- interval_list.push_back(new String((const char*) $1.str, $1.length,
+ interval_list.push_back(new (&YYTHD->mem_root) String((const char*) $1.str, $1.length,
system_charset_info)); }
| PRIMARY_SYM
{ Select->
- interval_list.push_back(new String("PRIMARY", 7,
+ interval_list.push_back(new (&YYTHD->mem_root) String("PRIMARY", 7,
system_charset_info)); };
using_list:
@@ -4663,9 +4702,12 @@ order_dir:
opt_limit_clause_init:
/* empty */
{
- SELECT_LEX *sel= Select;
+ LEX *lex= Lex;
+ SELECT_LEX *sel= lex->current_select;
sel->offset_limit= 0L;
- sel->select_limit= Lex->thd->variables.select_limit;
+ sel->select_limit= (&lex->select_lex == sel) ?
+ Lex->thd->variables.select_limit : /* primary SELECT */
+ HA_POS_ERROR; /* subquery */
}
| limit_clause {}
;
@@ -5094,7 +5136,7 @@ opt_insert_update:
for a moment */
if (Lex->sql_command != SQLCOM_INSERT)
{
- send_error(Lex->thd, ER_SYNTAX_ERROR);
+ yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
}
}
@@ -5351,6 +5393,29 @@ show_param:
{ Lex->sql_command= SQLCOM_SHOW_LOGS; WARN_DEPRECATED("SHOW BDB LOGS", "SHOW ENGINE BDB LOGS"); }
| LOGS_SYM
{ Lex->sql_command= SQLCOM_SHOW_LOGS; WARN_DEPRECATED("SHOW LOGS", "SHOW ENGINE BDB LOGS"); }
+ | GRANTS
+ {
+ LEX *lex=Lex;
+ lex->sql_command= SQLCOM_SHOW_GRANTS;
+ THD *thd= lex->thd;
+ LEX_USER *curr_user;
+ if (!(curr_user= (LEX_USER*) thd->alloc(sizeof(st_lex_user))))
+ YYABORT;
+ curr_user->user.str= thd->priv_user;
+ curr_user->user.length= strlen(thd->priv_user);
+ if (*thd->priv_host != 0)
+ {
+ curr_user->host.str= thd->priv_host;
+ curr_user->host.length= strlen(thd->priv_host);
+ }
+ else
+ {
+ curr_user->host.str= (char *) "%";
+ curr_user->host.length= 1;
+ }
+ curr_user->password.str=NullS;
+ lex->grant_user= curr_user;
+ }
| GRANTS FOR_SYM user
{
LEX *lex=Lex;
@@ -5492,7 +5557,7 @@ opt_describe_column:
/* empty */ {}
| text_string { Lex->wild= $1; }
| ident
- { Lex->wild= new String((const char*) $1.str,$1.length,system_charset_info); };
+ { Lex->wild= new (&YYTHD->mem_root) String((const char*) $1.str,$1.length,system_charset_info); };
/* flush things */
@@ -5574,6 +5639,11 @@ purge_option:
YYABORT;
}
Item *tmp= new Item_func_unix_timestamp($2);
+ /*
+ it is OK only emulate fix_fieds, because we need only
+ value of constant
+ */
+ tmp->quick_fix_field();
Lex->sql_command = SQLCOM_PURGE_BEFORE;
Lex->purge_time= (ulong) tmp->val_int();
}
@@ -5709,26 +5779,38 @@ text_literal:
text_string:
TEXT_STRING_literal
- { $$= new String($1.str,$1.length,YYTHD->variables.collation_connection); }
+ { $$= new (&YYTHD->mem_root) String($1.str,$1.length,YYTHD->variables.collation_connection); }
| HEX_NUM
{
Item *tmp = new Item_varbinary($1.str,$1.length);
- $$= tmp ? tmp->val_str((String*) 0) : (String*) 0;
+ /*
+ it is OK only emulate fix_fieds, because we need only
+ value of constant
+ */
+ $$= tmp ?
+ tmp->quick_fix_field(), tmp->val_str((String*) 0) :
+ (String*) 0;
}
;
param_marker:
'?'
{
- LEX *lex=Lex;
- if (YYTHD->command == COM_PREPARE)
+ THD *thd=YYTHD;
+ LEX *lex= thd->lex;
+ if (thd->command == COM_PREPARE)
{
- lex->param_list.push_back($$=new Item_param((uint)(lex->tok_start-(uchar *)YYTHD->query)));
- lex->param_count++;
+ Item_param *item= new Item_param((uint) (lex->tok_start -
+ (uchar *) thd->query));
+ if (!($$= item) || lex->param_list.push_back(item))
+ {
+ send_error(thd, ER_OUT_OF_RESOURCES);
+ YYABORT;
+ }
}
else
{
- yyerror("You have an error in your SQL syntax");
+ yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
}
}
@@ -5737,7 +5819,11 @@ param_marker:
signed_literal:
literal { $$ = $1; }
| '+' NUM_literal { $$ = $2; }
- | '-' NUM_literal { $$ = new Item_func_neg($2); }
+ | '-' NUM_literal
+ {
+ $2->max_length++;
+ $$= $2->neg();
+ }
;
@@ -5750,7 +5836,13 @@ literal:
| UNDERSCORE_CHARSET HEX_NUM
{
Item *tmp= new Item_varbinary($2.str,$2.length);
- String *str= tmp ? tmp->val_str((String*) 0) : (String*) 0;
+ /*
+ it is OK only emulate fix_fieds, because we need only
+ value of constant
+ */
+ String *str= tmp ?
+ tmp->quick_fix_field(), tmp->val_str((String*) 0) :
+ (String*) 0;
$$= new Item_string(str ? str->ptr() : "",
str ? str->length() : 0,
Lex->charset);
@@ -5897,8 +5989,13 @@ field_ident:
table_ident:
ident { $$=new Table_ident($1); }
| ident '.' ident { $$=new Table_ident(YYTHD, $1,$3,0);}
- | '.' ident { $$=new Table_ident($2);}
- /* For Delphi */;
+ | '.' ident { $$=new Table_ident($2);} /* For Delphi */
+ ;
+
+table_ident_ref:
+ ident { LEX_STRING db={(char*) any_db,3}; $$=new Table_ident(YYTHD, db,$1,0); }
+ | ident '.' ident { $$=new Table_ident(YYTHD, $1,$3,0);}
+ ;
IDENT_sys:
IDENT { $$= $1; }
@@ -5969,7 +6066,25 @@ user:
if (!($$=(LEX_USER*) thd->alloc(sizeof(st_lex_user))))
YYABORT;
$$->user = $1; $$->host=$3;
- };
+ }
+ | CURRENT_USER optional_braces
+ {
+ THD *thd= YYTHD;
+ if (!($$=(LEX_USER*) thd->alloc(sizeof(st_lex_user))))
+ YYABORT;
+ $$->user.str= thd->priv_user;
+ $$->user.length= strlen(thd->priv_user);
+ if (*thd->priv_host != 0)
+ {
+ $$->host.str= thd->priv_host;
+ $$->host.length= strlen(thd->priv_host);
+ }
+ else
+ {
+ $$->host.str= (char *) "%";
+ $$->host.length= 1;
+ }
+ };
/* Keyword that we allow for identifiers */
@@ -6074,6 +6189,7 @@ keyword:
| MASTER_LOG_POS_SYM {}
| MASTER_USER_SYM {}
| MASTER_PASSWORD_SYM {}
+ | MASTER_SERVER_ID_SYM {}
| MASTER_CONNECT_RETRY_SYM {}
| MASTER_SSL_SYM {}
| MASTER_SSL_CA_SYM {}
@@ -6195,7 +6311,7 @@ set:
{
LEX *lex=Lex;
lex->sql_command= SQLCOM_SET_OPTION;
- lex->option_type=OPT_DEFAULT;
+ lex->option_type=OPT_SESSION;
lex->var_list.empty();
}
option_value_list
@@ -6348,6 +6464,11 @@ internal_variable_name:
}
| ident '.' ident
{
+ if (check_reserved_words(&$1))
+ {
+ yyerror(ER(ER_SYNTAX_ERROR));
+ YYABORT;
+ }
sys_var *tmp=find_sys_var($3.str, $3.length);
if (!tmp)
YYABORT;
@@ -6453,14 +6574,14 @@ handler:
if (!lex->current_select->add_table_to_list(lex->thd, $2, $4, 0))
YYABORT;
}
- | HANDLER_SYM table_ident CLOSE_SYM
+ | HANDLER_SYM table_ident_ref CLOSE_SYM
{
LEX *lex= Lex;
lex->sql_command = SQLCOM_HA_CLOSE;
if (!lex->current_select->add_table_to_list(lex->thd, $2, 0, 0))
YYABORT;
}
- | HANDLER_SYM table_ident READ_SYM
+ | HANDLER_SYM table_ident_ref READ_SYM
{
LEX *lex=Lex;
lex->sql_command = SQLCOM_HA_READ;
@@ -6529,7 +6650,7 @@ revoke_command:
grant_privileges ON opt_table FROM user_list
{}
|
- ALL PRIVILEGES ',' GRANT FROM user_list
+ ALL PRIVILEGES ',' GRANT OPTION FROM user_list
{
Lex->sql_command = SQLCOM_REVOKE_ALL;
}
@@ -6738,7 +6859,7 @@ column_list:
column_list_id:
ident
{
- String *new_str = new String((const char*) $1.str,$1.length,system_charset_info);
+ String *new_str = new (&YYTHD->mem_root) String((const char*) $1.str,$1.length,system_charset_info);
List_iterator <LEX_COLUMN> iter(Lex->columns);
class LEX_COLUMN *point;
LEX *lex=Lex;
@@ -6844,7 +6965,7 @@ union_clause:
;
union_list:
- UNION_SYM union_option
+ UNION_SYM union_option
{
LEX *lex=Lex;
if (lex->exchange)
@@ -6855,13 +6976,16 @@ union_list:
}
if (lex->current_select->linkage == GLOBAL_OPTIONS_TYPE)
{
- send_error(lex->thd, ER_SYNTAX_ERROR);
+ yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
}
if (mysql_new_select(lex, 0))
YYABORT;
mysql_init_select(lex);
lex->current_select->linkage=UNION_TYPE;
+ if ($2) /* UNION DISTINCT - remember position */
+ lex->current_select->master_unit()->union_distinct=
+ lex->current_select;
}
select_init {}
;
@@ -6903,9 +7027,10 @@ order_or_limit:
;
union_option:
- /* empty */ {}
- | DISTINCT {}
- | ALL {Select->master_unit()->union_option|= UNION_ALL;};
+ /* empty */ { $$=1; }
+ | DISTINCT { $$=1; }
+ | ALL { $$=0; }
+ ;
singlerow_subselect:
subselect_start singlerow_subselect_init
@@ -6955,8 +7080,8 @@ subselect_start:
if (((int)lex->sql_command >= (int)SQLCOM_HA_OPEN &&
lex->sql_command <= (int)SQLCOM_HA_READ) ||
lex->sql_command == (int)SQLCOM_KILL)
- {
- send_error(lex->thd, ER_SYNTAX_ERROR);
+ {
+ yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
}
if (mysql_new_select(Lex, 1))
diff --git a/sql/structs.h b/sql/structs.h
index 37208e63400..86d754f00d6 100644
--- a/sql/structs.h
+++ b/sql/structs.h
@@ -20,11 +20,21 @@
struct st_table;
class Field;
-typedef struct lex_string {
+typedef struct st_lex_string
+{
char *str;
uint length;
} LEX_STRING;
+typedef struct st_lex_string_with_init :public st_lex_string
+{
+ st_lex_string_with_init(const char *str_arg, uint length_arg)
+ {
+ str= (char*) str_arg;
+ length= length_arg;
+ }
+} LEX_STRING_WITH_INIT;
+
typedef struct st_date_time_format {
uchar positions[8];
@@ -210,7 +220,7 @@ typedef struct user_conn {
#define REG_NEW_RECORD 2 /* Write a new record if not found */
#define REG_UPDATE 4 /* Uppdate record */
#define REG_DELETE 8 /* Delete found record */
-#define REG_PROG 16 /* User is updateing database */
+#define REG_PROG 16 /* User is updating database */
#define REG_CLEAR_AFTER_WRITE 32
#define REG_MAY_BE_UPDATED 64
#define REG_AUTO_UPDATE 64 /* Used in D-forms for scroll-tables */
diff --git a/sql/table.cc b/sql/table.cc
index 8fe061af530..23d99466a83 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -30,11 +30,11 @@ static void fix_type_pointers(const char ***array, TYPELIB *point_to_type,
static uint find_field(TABLE *form,uint start,uint length);
-static byte* get_field_name(Field *buff,uint *length,
+static byte* get_field_name(Field **buff,uint *length,
my_bool not_used __attribute__((unused)))
{
- *length= (uint) strlen(buff->field_name);
- return (byte*) buff->field_name;
+ *length= (uint) strlen((*buff)->field_name);
+ return (byte*) (*buff)->field_name;
}
/*
@@ -101,7 +101,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
if (!outparam->real_name || !outparam->table_name)
goto err_end;
- if ((file=my_open(fn_format(index_file,name,"",reg_ext,4),
+ if ((file=my_open(fn_format(index_file,name,"",reg_ext,MY_UNPACK_FILENAME),
O_RDONLY | O_SHARE,
MYF(0)))
< 0)
@@ -465,7 +465,6 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
goto err_not_open; /* purecov: inspected */
}
reg_field->comment=comment;
- reg_field->set_charset(charset);
if (!(reg_field->flags & NOT_NULL_FLAG))
{
if ((null_bit<<=1) == 256)
@@ -479,7 +478,7 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
if (outparam->timestamp_field == reg_field)
outparam->timestamp_field_offset=i;
if (use_hash)
- (void) my_hash_insert(&outparam->name_hash,(byte*) *field_ptr); // Will never fail
+ (void) my_hash_insert(&outparam->name_hash,(byte*) field_ptr); // Will never fail
}
*field_ptr=0; // End marker
@@ -581,7 +580,8 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
{
if ((index_flags & HA_KEY_READ_ONLY) &&
(field->key_type() != HA_KEYTYPE_TEXT ||
- (!(ha_option & HA_KEY_READ_WRONG_STR) &&
+ (!((ha_option & HA_KEY_READ_WRONG_STR) ||
+ (field->flags & BINARY_FLAG)) &&
!(keyinfo->flags & HA_FULLTEXT))))
field->part_of_key.set_bit(key);
if ((field->key_type() != HA_KEYTYPE_TEXT ||
@@ -700,8 +700,9 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
if (db_stat)
{
int err;
+ unpack_filename(index_file,index_file);
if ((err=(outparam->file->
- ha_open(unpack_filename(index_file,index_file),
+ ha_open(index_file,
(db_stat & HA_READ_ONLY ? O_RDONLY : O_RDWR),
(db_stat & HA_OPEN_TEMPORARY ? HA_OPEN_TMP_TABLE :
((db_stat & HA_WAIT_IF_LOCKED) ||
@@ -1282,14 +1283,17 @@ char *get_field(MEM_ROOT *mem, Field *field)
bool check_db_name(char *name)
{
- char *start=name;
+ char *start=name;
+ /* Used to catch empty names and names with end space */
+ bool last_char_is_space= TRUE;
- if (lower_case_table_names)
+ if (lower_case_table_names && name != any_db)
my_casedn_str(files_charset_info, name);
while (*name)
{
#if defined(USE_MB) && defined(USE_MB_IDENT)
+ last_char_is_space= my_isspace(default_charset_info, *name);
if (use_mb(system_charset_info))
{
int len=my_ismbchar(system_charset_info, name,
@@ -1300,19 +1304,22 @@ bool check_db_name(char *name)
continue;
}
}
+#else
+ last_char_is_space= *name==' ';
#endif
if (*name == '/' || *name == '\\' || *name == FN_LIBCHAR ||
*name == FN_EXTCHAR)
return 1;
name++;
}
- return (uint) (name - start) > NAME_LEN || name == start;
+ return last_char_is_space || (uint) (name - start) > NAME_LEN;
}
/*
Allow anything as a table name, as long as it doesn't contain an
a '/', or a '.' character
+ or ' ' at the end
returns 1 on error
*/
@@ -1322,10 +1329,17 @@ bool check_table_name(const char *name, uint length)
const char *end= name+length;
if (!length || length > NAME_LEN)
return 1;
+#if defined(USE_MB) && defined(USE_MB_IDENT)
+ bool last_char_is_space= FALSE;
+#else
+ if (name[length-1]==' ')
+ return 1;
+#endif
while (name != end)
{
#if defined(USE_MB) && defined(USE_MB_IDENT)
+ last_char_is_space= my_isspace(default_charset_info, *name);
if (use_mb(system_charset_info))
{
int len=my_ismbchar(system_charset_info, name, end);
@@ -1340,16 +1354,23 @@ bool check_table_name(const char *name, uint length)
return 1;
name++;
}
+#if defined(USE_MB) && defined(USE_MB_IDENT)
+ return last_char_is_space;
+#else
return 0;
+#endif
}
+
bool check_column_name(const char *name)
{
const char *start= name;
-
+ bool last_char_is_space= TRUE;
+
while (*name)
{
#if defined(USE_MB) && defined(USE_MB_IDENT)
+ last_char_is_space= my_isspace(default_charset_info, *name);
if (use_mb(system_charset_info))
{
int len=my_ismbchar(system_charset_info, name,
@@ -1360,13 +1381,15 @@ bool check_column_name(const char *name)
continue;
}
}
+#else
+ last_char_is_space= *name==' ';
#endif
if (*name == NAMES_SEP_CHAR)
return 1;
name++;
}
/* Error if empty or too long column name */
- return (name == start || (uint) (name - start) > NAME_LEN);
+ return last_char_is_space || (uint) (name - start) > NAME_LEN;
}
/*
diff --git a/sql/table.h b/sql/table.h
index ba7349d33fc..18155e1568d 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -26,6 +26,7 @@ class st_select_lex_unit;
typedef struct st_order {
struct st_order *next;
Item **item; /* Point at item in select fields */
+ Item *item_ptr; /* Storage for initial item */
Item **item_copy; /* For SPs; the original item ptr */
bool asc; /* true if ascending */
bool free_me; /* true if item isn't shared */
@@ -66,7 +67,8 @@ struct st_table {
handler *file;
Field **field; /* Pointer to fields */
Field_blob **blob_field; /* Pointer to blob fields */
- HASH name_hash; /* hash of field names */
+ /* hash of field names (contains pointers to elements of field array) */
+ HASH name_hash;
byte *record[2]; /* Pointer to records */
byte *default_values; /* Default values for INSERT */
byte *insert_values; /* used by INSERT ... UPDATE */
@@ -97,8 +99,20 @@ struct st_table {
uint raid_type,raid_chunks;
uint status; /* Used by postfix.. */
uint system; /* Set if system record */
- ulong time_stamp; /* Set to offset+1 of record */
+
+ /*
+ These two members hold offset in record + 1 for TIMESTAMP field
+ with NOW() as default value or/and with ON UPDATE NOW() option.
+ If 0 then such field is absent in this table or auto-set for default
+ or/and on update should be temporaly disabled for some reason.
+ These values is setup to offset value for each statement in open_table()
+ and turned off in statement processing code (see mysql_update as example).
+ */
+ ulong timestamp_default_now;
+ ulong timestamp_on_update_now;
+ /* Index of auto-updated TIMESTAMP field in field array */
uint timestamp_field_offset;
+
uint next_number_index;
uint blob_ptr_size; /* 4 or 8 */
uint next_number_key_offset;
@@ -109,7 +123,7 @@ struct st_table {
my_bool maybe_null,outer_join; /* Used with OUTER JOIN */
my_bool force_index;
my_bool distinct,const_table,no_rows;
- my_bool key_read, bulk_insert;
+ my_bool key_read;
my_bool crypted;
my_bool db_low_byte_first; /* Portable row format */
my_bool locked_by_flush;
@@ -119,7 +133,7 @@ struct st_table {
my_bool is_view;
my_bool no_keyread, no_cache;
my_bool clear_query_id; /* To reset query_id for tables and cols */
- my_bool auto_increment_field_not_null;
+ my_bool auto_increment_field_not_null;
Field *next_number_field, /* Set if next_number is activated */
*found_next_number_field, /* Set on open */
*rowid_field;
@@ -174,12 +188,13 @@ typedef struct st_table_list
GRANT_INFO grant;
thr_lock_type lock_type;
uint outer_join; /* Which join type */
- uint shared; /* Used in union or in multi-upd */
+ uint shared; /* Used in multi-upd */
uint32 db_length, real_name_length;
bool straight; /* optimize with prev table */
bool updating; /* for replicate-do/ignore table */
bool force_index; /* Prefer index over table scan */
bool ignore_leaves; /* Preload only non-leaf nodes */
+ bool cacheable_table; /* stop PS caching */
} TABLE_LIST;
typedef struct st_changed_table_list
diff --git a/sql/time.cc b/sql/time.cc
index 9a18a150c50..7fb466f6b97 100644
--- a/sql/time.cc
+++ b/sql/time.cc
@@ -62,6 +62,9 @@ long my_gmt_sec(TIME *t, long *my_timezone)
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;
@@ -124,8 +127,10 @@ long my_gmt_sec(TIME *t, long *my_timezone)
tmp-=t->minute*60 + t->second; // Move to previous hour
}
*my_timezone= current_timezone;
- if (tmp < 0 && t->year <= 1900+YY_PART_YEAR)
+
+ if (tmp < TIMESTAMP_MIN_VALUE || tmp > TIMESTAMP_MAX_VALUE)
tmp= 0;
+
return (long) tmp;
} /* my_gmt_sec */
@@ -386,9 +391,11 @@ 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;
+ uint frac_pos, frac_len;
DBUG_ENTER("str_to_TIME");
DBUG_PRINT("ENTER",("str: %.*s",length,str));
@@ -477,7 +484,7 @@ str_to_TIME(const char *str, uint length, TIME *l_time, uint flags)
tmp_value=tmp_value*10 + (ulong) (uchar) (*str - '0');
str++;
}
- date_len[i]+= (uint) (str - start);
+ date_len[i]= (uint) (str - start);
if (tmp_value > 999999) // Impossible date part
DBUG_RETURN(TIMESTAMP_NONE);
date[i]=tmp_value;
@@ -530,9 +537,9 @@ str_to_TIME(const char *str, uint length, TIME *l_time, uint flags)
{
if (str+2 <= end && (str[1] == 'M' || str[1] == 'm'))
{
- if (str[1] == 'p' || str[1] == 'P')
+ if (str[0] == 'p' || str[0] == 'P')
add_hours= 12;
- else if (str[1] != 'a' || str[1] != 'A')
+ else if (str[0] != 'a' || str[0] != 'A')
continue; // Not AM/PM
str+= 2; // Skip AM/PM
/* Skip space after AM/PM */
@@ -550,7 +557,10 @@ str_to_TIME(const char *str, uint length, TIME *l_time, uint flags)
number_of_fields= i - start_loop;
while (i < MAX_DATE_PARTS)
- date[i++]=0;
+ {
+ date_len[i]= 0;
+ date[i++]= 0;
+ }
if (!is_internal_format)
{
@@ -564,7 +574,13 @@ str_to_TIME(const char *str, uint length, TIME *l_time, uint flags)
l_time->hour= date[(uint) format_position[3]];
l_time->minute= date[(uint) format_position[4]];
l_time->second= date[(uint) format_position[5]];
- l_time->second_part= date[(uint) format_position[6]];
+
+ frac_pos= (uint) format_position[6];
+ frac_len= date_len[frac_pos];
+ if (frac_len < 6)
+ date[frac_pos]*= (uint) log_10_int[6 - frac_len];
+ l_time->second_part= date[frac_pos];
+
if (format_position[7] != (uchar) 255)
{
if (l_time->hour > 12)
@@ -580,6 +596,8 @@ str_to_TIME(const char *str, uint length, TIME *l_time, uint flags)
l_time->hour= date[3];
l_time->minute= date[4];
l_time->second= date[5];
+ if (date_len[6] < 6)
+ date[6]*= (uint) log_10_int[6 - date_len[6]];
l_time->second_part=date[6];
}
l_time->neg= 0;
@@ -609,15 +627,17 @@ str_to_TIME(const char *str, uint length, TIME *l_time, uint flags)
current_thd->cuted_fields++;
goto err;
}
- if (str != end && current_thd->count_cuted_fields)
+
+ l_time->time_type= (number_of_fields <= 3 ?
+ TIMESTAMP_DATE : TIMESTAMP_DATETIME);
+
+ for (; str != end ; str++)
{
- for (; str != end ; str++)
+ if (!my_isspace(&my_charset_latin1,*str))
{
- if (!my_isspace(&my_charset_latin1,*str))
- {
- current_thd->cuted_fields++;
- break;
- }
+ make_truncated_value_warning(current_thd, str_begin, length,
+ l_time->time_type);
+ break;
}
}
@@ -634,15 +654,12 @@ time_t str_to_timestamp(const char *str,uint length)
{
TIME l_time;
long not_used;
+ time_t timestamp= 0;
- if (str_to_TIME(str,length,&l_time,0) <= TIMESTAMP_DATETIME_ERROR)
- return(0);
- if (l_time.year >= TIMESTAMP_MAX_YEAR || l_time.year < 1900+YY_PART_YEAR-1)
- {
+ if (str_to_TIME(str,length,&l_time,0) > TIMESTAMP_DATETIME_ERROR &&
+ !(timestamp= my_gmt_sec(&l_time, &not_used)))
current_thd->cuted_fields++;
- return(0);
- }
- return(my_gmt_sec(&l_time, &not_used));
+ return timestamp;
}
@@ -684,6 +701,7 @@ bool str_to_time(const char *str,uint length,TIME *l_time)
{
long date[5],value;
const char *end=str+length, *end_of_days;
+ const char *str_begin= str;
bool found_days,found_hours;
uint state;
@@ -704,7 +722,7 @@ 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));
if ((int) res >= (int) TIMESTAMP_DATETIME_ERROR)
return res == TIMESTAMP_DATETIME_ERROR;
}
@@ -782,6 +800,8 @@ fractional:
my_isdigit(&my_charset_latin1,str[0]) &&
field_length--)
value=value*10 + (uint) (uchar) (*str - '0');
+ if (field_length)
+ value*= (long) log_10_int[field_length];
date[4]=value;
}
else
@@ -794,12 +814,12 @@ fractional:
str++;
if (str+2 <= end && (str[1] == 'M' || str[1] == 'm'))
{
- if (str[1] == 'p' || str[1] == 'P')
+ if (str[0] == 'p' || str[0] == 'P')
{
str+= 2;
date[1]= date[1]%12 + 12;
}
- else if (str[1] == 'a' || str[1] == 'A')
+ else if (str[0] == 'a' || str[0] == 'A')
str+=2;
}
}
@@ -820,13 +840,14 @@ fractional:
l_time->time_type= TIMESTAMP_TIME;
/* Check if there is garbage at end of the TIME specification */
- if (str != end && current_thd->count_cuted_fields)
+ if (str != end)
{
do
{
if (!my_isspace(&my_charset_latin1,*str))
{
- current_thd->cuted_fields++;
+ make_truncated_value_warning(current_thd, str_begin, length,
+ TIMESTAMP_TIME);
break;
}
} while (++str != end);
@@ -1263,3 +1284,35 @@ void make_datetime(DATE_TIME_FORMAT *format, TIME *l_time, String *str)
str->length(length);
str->set_charset(&my_charset_bin);
}
+
+void make_truncated_value_warning(THD *thd, const char *str_val,
+ uint str_length, timestamp_type time_type)
+{
+ char warn_buff[MYSQL_ERRMSG_SIZE];
+ const char *type_str;
+
+ char buff[128];
+ String str(buff,(uint32) sizeof(buff), system_charset_info);
+ str.length(0);
+ str.append(str_val, str_length);
+ str.append('\0');
+
+ switch (time_type) {
+ case TIMESTAMP_DATE:
+ type_str= "date";
+ break;
+ case TIMESTAMP_DATETIME:
+ type_str= "datetime";
+ break;
+ case TIMESTAMP_TIME:
+ type_str= "time";
+ break;
+ default:
+ type_str= "string";
+ break;
+ }
+ sprintf(warn_buff, ER(ER_TRUNCATED_WRONG_VALUE),
+ type_str, str.ptr());
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_TRUNCATED_WRONG_VALUE, warn_buff);
+}
diff --git a/sql/unireg.cc b/sql/unireg.cc
index 6ebba313442..0e4b449c6a3 100644
--- a/sql/unireg.cc
+++ b/sql/unireg.cc
@@ -29,6 +29,7 @@
#include <m_ctype.h>
#define FCOMP 17 /* Bytes for a packed field */
+#define FCOMP 17 /* Bytes for a packed field */
static uchar * pack_screens(List<create_field> &create_fields,
uint *info_length, uint *screens, bool small_file);
@@ -150,7 +151,9 @@ int rea_create_table(THD *thd, my_string file_name,
my_free((gptr) screen_buff,MYF(0));
my_free((gptr) keybuff, MYF(0));
- if (my_sync(file, MYF(MY_WME)))
+
+ if (opt_sync_frm && !(create_info->options & HA_LEX_CREATE_TMP_TABLE) &&
+ my_sync(file, MYF(MY_WME)))
goto err2;
if (my_close(file,MYF(MY_WME)) ||
ha_create_table(file_name,create_info,0))
@@ -351,8 +354,12 @@ static bool pack_header(uchar *forminfo, enum db_type table_type,
MTYP_NOEMPTY_BIT);
no_empty++;
}
- if ((MTYP_TYPENR(field->unireg_check) == Field::TIMESTAMP_FIELD ||
- f_packtype(field->pack_flag) == (int) FIELD_TYPE_TIMESTAMP) &&
+ /*
+ We mark first TIMESTAMP field with NOW() in DEFAULT or ON UPDATE
+ as auto-update field.
+ */
+ if (field->sql_type == FIELD_TYPE_TIMESTAMP &&
+ MTYP_TYPENR(field->unireg_check) != Field::NONE &&
!time_stamp_pos)
time_stamp_pos=(int) field->offset+1;
length=field->pack_length;
diff --git a/strings/Makefile.am b/strings/Makefile.am
index 61219c8abb9..be51e48ef8d 100644
--- a/strings/Makefile.am
+++ b/strings/Makefile.am
@@ -22,19 +22,19 @@ pkglib_LIBRARIES = libmystrings.a
# Exact one of ASSEMBLER_X
if ASSEMBLER_x86
ASRCS = strings-x86.s longlong2str-x86.s my_strtoll10-x86.s
-CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c ctype-extra.c
+CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c ctype-extra.c
else
if ASSEMBLER_sparc32
# These file MUST all be on the same line!! Otherwise automake
# generats a very broken makefile
ASRCS = bmove_upp-sparc.s strappend-sparc.s strend-sparc.s strinstr-sparc.s strmake-sparc.s strmov-sparc.s strnmov-sparc.s strstr-sparc.s
-CSRCS = strcont.c strfill.c strcend.c is_prefix.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c strxmov.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c ctype-extra.c my_strtoll10.c
+CSRCS = strcont.c strfill.c strcend.c is_prefix.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c strxmov.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c ctype-extra.c my_strtoll10.c
else
#no assembler
ASRCS =
# These file MUST all be on the same line!! Otherwise automake
# generats a very broken makefile
-CSRCS = strxmov.c bmove_upp.c strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c strstr.c strinstr.c strmake.c strnmov.c strmov.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c ctype-extra.c my_strtoll10.c
+CSRCS = strxmov.c bmove_upp.c strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c strstr.c strinstr.c strmake.c strnmov.c strmov.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtod.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c ctype-extra.c my_strtoll10.c
endif
endif
@@ -44,7 +44,7 @@ DISTCLEANFILES = ctype_autoconf.c
# Default charset definitions
EXTRA_DIST = ctype-big5.c ctype-czech.c ctype-euc_kr.c ctype-win1250ch.c \
ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-utf8.c \
- ctype-ucs2.c ctype-tis620.c ctype-ujis.c \
+ ctype-ucs2.c ctype-uca.c ctype-tis620.c ctype-ujis.c \
xml.c strto.c strings-x86.s \
longlong2str.c longlong2str-x86.s \
my_strtoll10.c my_strtoll10-x86.s \
diff --git a/strings/atof.c b/strings/atof.c
deleted file mode 100644
index 0e0aa598718..00000000000
--- a/strings/atof.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/* Copyright (C) 2000 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 */
-
-/*
- A quicker atof. About 2-10 times faster than standard atof on sparc.
- This don't handle iee-options (NaN...) and the presission :s is a little
- less for some high exponential numbers (+-1 at 14th place).
- Returns 0.0 if overflow or wrong number.
- Must be inited with init_my_atof to handle possibly overflows.
-*/
-
-#include <my_global.h>
-#ifdef USE_MY_ATOF /* Skipp if we don't want it */
-#include <m_ctype.h>
-#include <floatingpoint.h>
-#include <signal.h>
-
-/* Read a double. If float is wrong return 0.
- float ::= [space]* [sign] {digit}+ decimal-point {digit}+ [exponent] |
- [sign] {digit}+ [decimal-point {digit}*] exponent |
- [sign] {digit}+ decimal-point [{digit}*] exponent |
- [sign] decimal-point {digit}* exponent |
- exponent :: = exponent-marker [sign] {digit}+
- exponent-marker ::= E e
- */
-
-
-#define is_exponent_marker(ch) (ch == 'E' || ch == 'e')
-
-static void my_atof_overflow _A((int sig,int code, struct sigcontext *scp,
- char *addr));
-static int parse_sign _A((char **str));
-static void parse_float_number_part _A((char **str,double *number, int *length));
-static void parse_decimal_number_part _A((char **str,double *number));
-static int parse_int_number_part _A((char **str,uint *number));
-
-static int volatile overflow,in_my_atof;
-static sigfpe_handler_type old_overflow_handler;
-
-void init_my_atof()
-{
- old_overflow_handler = (sigfpe_handler_type)
- ieee_handler("get", "overflow", old_overflow_handler);
- VOID(ieee_handler("set", "overflow", my_atof_overflow));
- return;
-}
-
-static void my_atof_overflow(sig, code, scp, addr)
-int sig;
-int code;
-struct sigcontext *scp;
-char *addr;
-{
- if (!in_my_atof)
- old_overflow_handler(sig,code,scp,addr);
- else
- overflow=1;
- return;
-}
-
-double my_atof(src)
-const char *src;
-{
- int sign, exp_sign; /* is number negative (+1) or positive (-1) */
- int length_before_point;
- double after_point; /* Number after decimal point and before exp */
- uint exponent; /* Exponent value */
- double exp_log,exp_val;
- char *tmp_src;
- double result_number;
-
- tmp_src = (char*) src;
- while (isspace(tmp_src[0]))
- tmp_src++; /* Skipp pre-space */
- sign = parse_sign(&tmp_src);
- overflow=0;
- in_my_atof=1;
- parse_float_number_part(&tmp_src, &result_number, &length_before_point);
- if (*tmp_src == '.')
- {
- tmp_src++;
- parse_decimal_number_part(&tmp_src, &after_point);
- result_number += after_point;
- }
- else if (length_before_point == 0)
- {
- in_my_atof=0;
- return 0.0;
- }
- if (is_exponent_marker(*tmp_src))
- {
- tmp_src++;
- exp_sign = parse_sign(&tmp_src);
- overflow|=parse_int_number_part(&tmp_src, &exponent);
-
- exp_log=10.0; exp_val=1.0;
- for (;;)
- {
- if (exponent & 1)
- {
- exp_val*= exp_log;
- exponent--;
- }
- if (!exponent)
- break;
- exp_log*=exp_log;
- exponent>>=1;
- }
- if (exp_sign < 0)
- result_number*=exp_val;
- else
- result_number/=exp_val;
- }
- if (sign > 0)
- result_number= -result_number;
-
- in_my_atof=0;
- if (overflow)
- return 0.0;
- return result_number;
-}
-
-
-static int parse_sign(str)
-char **str;
-{
- if (**str == '-')
- {
- (*str)++;
- return 1;
- }
- if (**str == '+')
- (*str)++;
- return -1;
-}
-
- /* Get number with may be separated with ',' */
-
-static void parse_float_number_part(str, number, length)
-char **str;
-double *number;
-int *length;
-{
- *number = 0;
- *length = 0;
-
- for (;;)
- {
- while (isdigit(**str))
- {
- (*length)++;
- *number = (*number * 10) + (**str - '0');
- (*str)++;
- }
- if (**str != ',')
- return; /* Skipp possibly ',' */
- (*str)++;
- }
-}
-
-static void parse_decimal_number_part(str, number)
-char **str;
-double *number;
-{
- double exp_log;
-
- *number = 0;
- exp_log=1/10.0;
- while (isdigit(**str))
- {
- *number+= (**str - '0')*exp_log;
- exp_log/=10;
- (*str)++;
- }
-}
-
- /* Parses int suitably for exponent */
-
-static int parse_int_number_part(str, number)
-char **str;
-uint *number;
-{
- *number = 0;
- while (isdigit(**str))
- {
- if (*number >= ((uint) ~0)/10)
- return 1; /* Don't overflow */
- *number = (*number * 10) + **str - '0';
- (*str)++;
- }
- return 0;
-}
-
-#endif
diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c
index 574156a99ed..2bde29ecc47 100644
--- a/strings/ctype-big5.c
+++ b/strings/ctype-big5.c
@@ -218,40 +218,80 @@ static uint16 big5strokexfrm(uint16 i)
return 0xA140;
}
-static int my_strnncoll_big5(CHARSET_INFO *cs __attribute__((unused)),
- const uchar * s1, uint len1,
- const uchar * s2, uint len2)
+
+
+static int my_strnncoll_big5_internal(const uchar **a_res,
+ const uchar **b_res, uint length)
{
- uint len;
+ const char *a= *a_res, *b= *b_res;
- len = min(len1,len2);
- while (len--)
+ while (length--)
{
- if ((len > 0) && isbig5code(*s1,*(s1+1)) && isbig5code(*s2, *(s2+1)))
+ if ((length > 0) && isbig5code(*a,*(a+1)) && isbig5code(*b, *(b+1)))
{
- if (*s1 != *s2 || *(s1+1) != *(s2+1))
- return ((int) big5code(*s1,*(s1+1)) -
- (int) big5code(*s2,*(s2+1)));
- s1 +=2;
- s2 +=2;
- len--;
- } else if (sort_order_big5[(uchar) *s1++] != sort_order_big5[(uchar) *s2++])
- return ((int) sort_order_big5[(uchar) s1[-1]] -
- (int) sort_order_big5[(uchar) s2[-1]]);
+ if (*a != *b || *(a+1) != *(b+1))
+ return ((int) big5code(*a,*(a+1)) -
+ (int) big5code(*b,*(b+1)));
+ a+= 2;
+ b+= 2;
+ length--;
+ }
+ else if (sort_order_big5[(uchar) *a++] !=
+ sort_order_big5[(uchar) *b++])
+ return ((int) sort_order_big5[(uchar) a[-1]] -
+ (int) sort_order_big5[(uchar) b[-1]]);
}
- return (int) (len1-len2);
+ *a_res= a;
+ *b_res= b;
+ return 0;
}
-static
-int my_strnncollsp_big5(CHARSET_INFO * cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen)
+
+/* Compare strings */
+
+static int my_strnncoll_big5(CHARSET_INFO *cs __attribute__((unused)),
+ const uchar *a, uint a_length,
+ const uchar *b, uint b_length)
{
- for ( ; slen && my_isspace(cs, s[slen-1]) ; slen--);
- for ( ; tlen && my_isspace(cs, t[tlen-1]) ; tlen--);
- return my_strnncoll_big5(cs,s,slen,t,tlen);
+ uint length= min(a_length, b_length);
+ int res= my_strnncoll_big5_internal(&a, &b, length);
+ return res ? res : (int) (a_length - b_length);
}
+
+/* compare strings, ignore end space */
+
+static int my_strnncollsp_big5(CHARSET_INFO * cs __attribute__((unused)),
+ const uchar *a, uint a_length,
+ const uchar *b, uint b_length)
+{
+ uint length= min(a_length, b_length);
+ int res= my_strnncoll_big5_internal(&a, &b, length);
+ if (!res && a_length != b_length)
+ {
+ const uchar *end;
+ int swap= 0;
+ /*
+ Check the next not space character of the longer key. If it's < ' ',
+ then it's smaller than the other key.
+ */
+ if (a_length < b_length)
+ {
+ /* put shorter key in a */
+ a_length= b_length;
+ a= b;
+ swap= -1; /* swap sign of result */
+ }
+ for (end= a + a_length-length; a < end ; a++)
+ {
+ if (*a != ' ')
+ return ((int) *a - (int) ' ') ^ swap;
+ }
+ }
+ return res;
+}
+
+
static int my_strnxfrm_big5(CHARSET_INFO *cs __attribute__((unused)),
uchar * dest, uint len,
const uchar * src, uint srclen)
@@ -343,10 +383,10 @@ static int my_strxfrm_big5(uchar * dest, const uchar * src, int len)
#define max_sort_char ((char) 255)
static my_bool my_like_range_big5(CHARSET_INFO *cs __attribute__((unused)),
- const char *ptr,uint ptr_length,
- int escape, int w_one, int w_many,
- uint res_length, char *min_str,char *max_str,
- uint *min_length,uint *max_length)
+ const char *ptr,uint ptr_length,
+ pbool escape, pbool w_one, pbool w_many,
+ uint res_length, char *min_str,char *max_str,
+ uint *min_length,uint *max_length)
{
const char *end=ptr+ptr_length;
char *min_org=min_str;
@@ -377,7 +417,7 @@ static my_bool my_like_range_big5(CHARSET_INFO *cs __attribute__((unused)),
*min_length= (uint) (min_str-min_org);
*max_length= res_length;
do {
- *min_str++ = ' '; /* Because if key compression */
+ *min_str++ = 0;
*max_str++ = max_sort_char;
} while (min_str != min_end);
return 0;
@@ -6245,7 +6285,7 @@ static MY_CHARSET_HANDLER my_charset_big5_handler=
mbcharlen_big5,
my_numchars_mb,
my_charpos_mb,
- my_wellformedlen_mb,
+ my_well_formed_len_mb,
my_lengthsp_8bit,
my_mb_wc_big5, /* mb_wc */
my_wc_mb_big5, /* wc_mb */
@@ -6284,7 +6324,8 @@ CHARSET_INFO my_charset_big5_chinese_ci=
1, /* strxfrm_multiply */
1, /* mbminlen */
2, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0, /* max_sort_char */
&my_charset_big5_handler,
&my_collation_big5_chinese_ci_handler
};
@@ -6308,7 +6349,8 @@ CHARSET_INFO my_charset_big5_bin=
1, /* strxfrm_multiply */
1, /* mbminlen */
2, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0, /* 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 fc22938d46e..ea0a471ef74 100644
--- a/strings/ctype-bin.c
+++ b/strings/ctype-bin.c
@@ -67,6 +67,28 @@ static uchar bin_char_array[] =
};
+
+/*
+ Compare two strings. Result is sign(first_argument - second_argument)
+
+ SYNOPSIS
+ my_strnncoll_binary()
+ cs Chararacter set
+ s String to compare
+ slen Length of 's'
+ t String to compare
+ tlen Length of 't'
+
+ NOTE
+ This is used also when comparing with end space removal, as end space
+ is significant for binary strings
+
+ RETURN
+ < 0 s < t
+ 0 s == t
+ > 0 s > t
+*/
+
static int my_strnncoll_binary(CHARSET_INFO * cs __attribute__((unused)),
const uchar *s, uint slen,
const uchar *t, uint tlen)
@@ -75,59 +97,39 @@ static int my_strnncoll_binary(CHARSET_INFO * cs __attribute__((unused)),
return cmp ? cmp : (int) (slen - tlen);
}
-static int my_strnncollsp_binary(CHARSET_INFO * cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen)
-{
- int len, cmp;
- for ( ; slen && my_isspace(cs, s[slen-1]) ; slen--);
- for ( ; tlen && my_isspace(cs, t[tlen-1]) ; tlen--);
+/* This function is used for all conversion functions */
- len = ( slen > tlen ) ? tlen : slen;
-
- cmp= memcmp(s,t,len);
- return cmp ? cmp : (int) (slen - tlen);
-}
-
-static void my_caseup_str_bin(CHARSET_INFO *cs __attribute__((unused)),
- char *str __attribute__((unused)))
+static void my_case_str_bin(CHARSET_INFO *cs __attribute__((unused)),
+ char *str __attribute__((unused)))
{
}
-static void my_casedn_str_bin(CHARSET_INFO * cs __attribute__((unused)),
- char *str __attribute__((unused)))
+static void my_case_bin(CHARSET_INFO *cs __attribute__((unused)),
+ char *str __attribute__((unused)),
+ uint length __attribute__((unused)))
{
}
-static void my_caseup_bin(CHARSET_INFO * cs __attribute__((unused)),
- char *str __attribute__((unused)),
- uint length __attribute__((unused)))
-{
-}
-
-static void my_casedn_bin(CHARSET_INFO * cs __attribute__((unused)),
- char *str __attribute__((unused)),
- uint length __attribute__((unused)))
-{
-}
static int my_strcasecmp_bin(CHARSET_INFO * cs __attribute__((unused)),
- const char *s, const char *t)
+ const char *s, const char *t)
{
return strcmp(s,t);
}
+
int my_mbcharlen_8bit(CHARSET_INFO *cs __attribute__((unused)),
- uint c __attribute__((unused)))
+ uint c __attribute__((unused)))
{
return 1;
}
+
static int my_mb_wc_bin(CHARSET_INFO *cs __attribute__((unused)),
- my_wc_t *wc,
- const unsigned char *str,
- const unsigned char *end __attribute__((unused)))
+ my_wc_t *wc,
+ const unsigned char *str,
+ const unsigned char *end __attribute__((unused)))
{
if (str >= end)
return MY_CS_TOOFEW(0);
@@ -136,10 +138,11 @@ static int my_mb_wc_bin(CHARSET_INFO *cs __attribute__((unused)),
return 1;
}
+
static int my_wc_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
- my_wc_t wc,
- unsigned char *s,
- unsigned char *e __attribute__((unused)))
+ my_wc_t wc,
+ unsigned char *s,
+ unsigned char *e __attribute__((unused)))
{
if (s >= e)
return MY_CS_TOOSMALL;
@@ -169,12 +172,21 @@ void my_hash_sort_bin(CHARSET_INFO *cs __attribute__((unused)),
}
+/*
+ The following defines is here to keep the following code identical to
+ the one in ctype-simple.c
+*/
+
+#define likeconv(s,A) (A)
+#define INC_PTR(cs,A,B) (A)++
+
+
static int my_wildcmp_bin(CHARSET_INFO *cs,
const char *str,const char *str_end,
const char *wildstr,const char *wildend,
int escape, int w_one, int w_many)
{
- int result= -1; /* Not found, using wildcards */
+ int result= -1; /* Not found, using wildcards */
while (wildstr != wildend)
{
@@ -182,31 +194,26 @@ static int my_wildcmp_bin(CHARSET_INFO *cs,
{
if (*wildstr == escape && wildstr+1 != wildend)
wildstr++;
- if (str == str_end || *wildstr++ != *str++)
- {
- return(1);
- }
+ if (str == str_end || likeconv(cs,*wildstr++) != likeconv(cs,*str++))
+ return(1); /* No match */
if (wildstr == wildend)
- {
- return(str != str_end); /* Match if both are at end */
- }
- result=1; /* Found an anchor char */
+ return(str != str_end); /* Match if both are at end */
+ result=1; /* Found an anchor char */
}
if (*wildstr == w_one)
{
do
{
- if (str == str_end) /* Skip one char if possible */
+ if (str == str_end) /* Skip one char if possible */
return(result);
- str++;
- } while (*++wildstr == w_one && wildstr != wildend);
+ INC_PTR(cs,str,str_end);
+ } while (++wildstr < wildend && *wildstr == w_one);
if (wildstr == wildend)
break;
}
if (*wildstr == w_many)
- { /* Found w_many */
- char cmp;
-
+ { /* Found w_many */
+ uchar cmp;
wildstr++;
/* Remove any '%' and '_' from the wild search string */
for (; wildstr != wildend ; wildstr++)
@@ -216,40 +223,33 @@ static int my_wildcmp_bin(CHARSET_INFO *cs,
if (*wildstr == w_one)
{
if (str == str_end)
- {
return(-1);
- }
- str++;
+ INC_PTR(cs,str,str_end);
continue;
}
- break; /* Not a wild character */
+ break; /* Not a wild character */
}
if (wildstr == wildend)
- {
- return(0); /* Ok if w_many is last */
- }
+ return(0); /* match if w_many is last */
if (str == str_end)
- {
return(-1);
- }
if ((cmp= *wildstr) == escape && wildstr+1 != wildend)
cmp= *++wildstr;
- wildstr++; /* This is compared trough cmp */
+
+ INC_PTR(cs,wildstr,wildend); /* This is compared through cmp */
+ cmp=likeconv(cs,cmp);
do
{
- while (str != str_end && *str != cmp)
+ while (str != str_end && (uchar) likeconv(cs,*str) != cmp)
str++;
if (str++ == str_end)
- {
return(-1);
- }
{
- int tmp=my_wildcmp_bin(cs,str,str_end,wildstr,wildend,escape,w_one,w_many);
+ int tmp=my_wildcmp_bin(cs,str,str_end,wildstr,wildend,escape,w_one,
+ w_many);
if (tmp <= 0)
- {
return(tmp);
- }
}
} while (str != str_end && wildstr[0] != w_many);
return(-1);
@@ -258,6 +258,7 @@ static int my_wildcmp_bin(CHARSET_INFO *cs,
return(str != str_end ? 1 : 0);
}
+
static int my_strnxfrm_bin(CHARSET_INFO *cs __attribute__((unused)),
uchar * dest, uint len,
const uchar *src,
@@ -268,11 +269,12 @@ static int my_strnxfrm_bin(CHARSET_INFO *cs __attribute__((unused)),
return len;
}
+
static
uint my_instr_bin(CHARSET_INFO *cs __attribute__((unused)),
- const char *b, uint b_length,
- const char *s, uint s_length,
- my_match_t *match, uint nmatch)
+ const char *b, uint b_length,
+ const char *s, uint s_length,
+ my_match_t *match, uint nmatch)
{
register const uchar *str, *search, *end, *search_end;
@@ -332,7 +334,7 @@ skip:
MY_COLLATION_HANDLER my_collation_8bit_bin_handler =
{
my_strnncoll_binary,
- my_strnncollsp_binary,
+ my_strnncoll_binary,
my_strnxfrm_bin,
my_like_range_simple,
my_wildcmp_bin,
@@ -341,20 +343,21 @@ MY_COLLATION_HANDLER my_collation_8bit_bin_handler =
my_hash_sort_bin
};
+
static MY_CHARSET_HANDLER my_charset_handler=
{
NULL, /* ismbchar */
my_mbcharlen_8bit, /* mbcharlen */
my_numchars_8bit,
my_charpos_8bit,
- my_wellformedlen_8bit,
+ my_well_formed_len_8bit,
my_lengthsp_8bit,
my_mb_wc_bin,
my_wc_mb_bin,
- my_caseup_str_bin,
- my_casedn_str_bin,
- my_caseup_bin,
- my_casedn_bin,
+ my_case_str_bin,
+ my_case_str_bin,
+ my_case_bin,
+ my_case_bin,
my_snprintf_8bit,
my_long10_to_str_8bit,
my_longlong10_to_str_8bit,
@@ -367,6 +370,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
my_scan_8bit
};
+
CHARSET_INFO my_charset_bin =
{
63,0,0, /* number */
@@ -384,7 +388,8 @@ CHARSET_INFO my_charset_bin =
1, /* strxfrm_multiply */
1, /* mbminlen */
1, /* mbmaxlen */
- (char) 255, /* max_sort_char */
+ 0, /* min_sort_char */
+ 255, /* max_sort_char */
&my_charset_handler,
&my_collation_8bit_bin_handler
};
diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c
index 1a07a5eba7e..5094a7c45da 100644
--- a/strings/ctype-czech.c
+++ b/strings/ctype-czech.c
@@ -165,169 +165,144 @@ static struct wordvalue doubles[] = {
Na konci pøipojíme znak 0
*/
-#define ADD_TO_RESULT(dest, len, totlen, value) \
- if ((totlen) < (len)) { dest[totlen] = value; } (totlen++);
-
-#define NEXT_CMP_VALUE(src, p, store, pass, value, len) \
- while (1) /* we will make a loop */ \
- { \
- if (IS_END(p, src, len)) \
- /* when we are at the end of string */ \
- { /* return either 0 for end of string */ \
- /* or 1 for end of pass */ \
- if (pass == 3) { value = 0; break; } \
- if (pass == 0) p = store; \
- else p = src; \
- value = 1; pass++; break; \
- } \
- /* not at end of string */ \
- value = CZ_SORT_TABLE[pass][*p]; \
- \
- if (value == 0) { p++; continue; } /* ignore value */ \
- if (value == 2) /* space */ \
- { \
- const uchar * tmp; \
- const uchar * runner = ++p; \
- while (!(IS_END(runner, src, len)) && (CZ_SORT_TABLE[pass][*runner] == 2)) \
- runner++; /* skip all spaces */ \
- if (IS_END(runner, src, len) && SKIP_TRAILING_SPACES) \
- p = runner; \
- if ((pass <= 2) && !(IS_END(runner, src, len))) \
- p = runner; \
- if (IS_END(p, src, len)) \
- continue; \
- /* we switch passes */ \
- if (pass > 1) \
- break; \
- tmp = p; \
- if (pass == 0) pass = 1; \
- else pass = 0; \
- p = store; store = tmp; \
- break; \
- } \
- if (value == 255) \
- { \
- int i; \
- for (i = 0; i < (int) sizeof(doubles); i++) \
- { \
- const char * pattern = doubles[i].word; \
- const char * q = (const char *) p; \
- int j = 0; \
- while (pattern[j]) \
- { \
- if (IS_END(q, src, len) || (*q != pattern[j])) \
- { break ; } \
- j++; q++; \
- } \
- if (!(pattern[j])) \
- { \
- value = (int)(doubles[i].outvalue[pass]); \
- p = (const uchar *) q - 1; \
- break; \
- } \
- } \
- } \
- p++; \
- break; \
- }
-
-#define IS_END(p, src, len) (!(*p))
-
-#if 0
-/* Function strcoll, with Czech sorting, for zero terminated strings */
-static int my_strcoll_czech(const uchar * s1, const uchar * s2)
- {
- int v1, v2;
- const uchar * p1, * p2, * store1, * store2;
- int pass1 = 0, pass2 = 0;
- int diff;
-
- p1 = s1; p2 = s2;
- store1 = s1; store2 = s2;
-
- do
- {
- NEXT_CMP_VALUE(s1, p1, store1, pass1, v1, 0);
- NEXT_CMP_VALUE(s2, p2, store2, pass2, v2, 0);
- diff = v1 - v2;
- if (diff != 0) return diff;
- }
- while (v1);
- return 0;
- }
-#endif
+#define ADD_TO_RESULT(dest, len, totlen, value) \
+if ((totlen) < (len)) { dest[totlen] = value; } (totlen++);
+#define IS_END(p, src, len) (((char *)p - (char *)src) >= (len))
+
+#define NEXT_CMP_VALUE(src, p, store, pass, value, len) \
+while (1) \
+{ \
+ if (IS_END(p, src, len)) \
+ { \
+ /* when we are at the end of string */ \
+ /* return either 0 for end of string */ \
+ /* or 1 for end of pass */ \
+ value= 0; \
+ if (pass != 3) \
+ { \
+ p= (pass++ == 0) ? store : src; \
+ value = 1; \
+ } \
+ break; \
+ } \
+ /* not at end of string */ \
+ value = CZ_SORT_TABLE[pass][*p]; \
+ if (value == 0) \
+ { p++; continue; } /* ignore value */ \
+ if (value == 2) /* space */ \
+ { \
+ const uchar * tmp; \
+ const uchar * runner = ++p; \
+ while (!(IS_END(runner, src, len)) && (CZ_SORT_TABLE[pass][*runner] == 2)) \
+ runner++; /* skip all spaces */ \
+ if (IS_END(runner, src, len) && SKIP_TRAILING_SPACES) \
+ p = runner; \
+ if ((pass <= 2) && !(IS_END(runner, src, len))) \
+ p = runner; \
+ if (IS_END(p, src, len)) \
+ continue; \
+ /* we switch passes */ \
+ if (pass > 1) \
+ break; \
+ tmp = p; \
+ pass= 1-pass; \
+ p = store; store = tmp; \
+ break; \
+ } \
+ if (value == 255) \
+ { \
+ int i; \
+ for (i = 0; i < (int) sizeof(doubles); i++) \
+ { \
+ const char * pattern = doubles[i].word; \
+ const char * q = (const char *) p; \
+ int j = 0; \
+ while (pattern[j]) \
+ { \
+ if (IS_END(q, src, len) || (*q != pattern[j])) \
+ break; \
+ j++; q++; \
+ } \
+ if (!(pattern[j])) \
+ { \
+ value = (int)(doubles[i].outvalue[pass]); \
+ p= (const uchar *) q - 1; \
+ break; \
+ } \
+ } \
+ } \
+ p++; \
+ break; \
+}
+
+/*
+ Function strnncoll, actually strcoll, with Czech sorting, which expect
+ the length of the strings being specified
+*/
-#if 0
-/* Function strxfrm, with Czech sorting, for zero terminated strings */
-static int my_strxfrm_czech(uchar * dest, const uchar * src, int len)
+static int my_strnncoll_czech(CHARSET_INFO *cs __attribute__((unused)),
+ const uchar * s1, uint len1,
+ const uchar * s2, uint len2)
{
- int value;
- const uchar * p, * store;
- int pass = 0;
- int totlen = 0;
- p = store = src;
-
- do
- {
- NEXT_CMP_VALUE(src, p, store, pass, value, 0);
- ADD_TO_RESULT(dest, len, totlen, value);
- }
- while (value);
- return totlen;
- }
-#endif
+ int v1, v2;
+ const uchar * p1, * p2, * store1, * store2;
+ int pass1 = 0, pass2 = 0;
+ p1 = s1; p2 = s2;
+ store1 = s1; store2 = s2;
-#undef IS_END
+ do
+ {
+ int diff;
+ NEXT_CMP_VALUE(s1, p1, store1, pass1, v1, (int)len1);
+ NEXT_CMP_VALUE(s2, p2, store2, pass2, v2, (int)len2);
+ if ((diff = v1 - v2))
+ return diff;
+ }
+ while (v1);
+ return 0;
+}
-#define IS_END(p, src, len) (((char *)p - (char *)src) >= (len))
-/* Function strnncoll, actually strcoll, with Czech sorting, which expect
- the length of the strings being specified */
-static int my_strnncoll_czech(CHARSET_INFO *cs __attribute__((unused)),
- const uchar * s1, uint len1,
- const uchar * s2, uint len2)
- {
- int v1, v2;
- const uchar * p1, * p2, * store1, * store2;
- int pass1 = 0, pass2 = 0;
- int diff;
-
- p1 = s1; p2 = s2;
- store1 = s1; store2 = s2;
-
- do
- {
- NEXT_CMP_VALUE(s1, p1, store1, pass1, v1, (int)len1);
- NEXT_CMP_VALUE(s2, p2, store2, pass2, v2, (int)len2);
- diff = v1 - v2;
-
- if (diff != 0) return diff;
- }
- while (v1);
- return 0;
- }
-
-/* Function strnxfrm, actually strxfrm, with Czech sorting, which expect
- the length of the strings being specified */
+
+/*
+ TODO: Fix this one to compare strings as they are done in ctype-simple1
+*/
+
+static
+int my_strnncollsp_czech(CHARSET_INFO * cs,
+ const uchar *s, uint slen,
+ const uchar *t, uint tlen)
+{
+ for ( ; slen && s[slen-1] == ' ' ; slen--);
+ for ( ; tlen && t[tlen-1] == ' ' ; tlen--);
+ return my_strnncoll_czech(cs,s,slen,t,tlen);
+}
+
+
+/*
+ Function strnxfrm, actually strxfrm, with Czech sorting, which expect
+ the length of the strings being specified
+*/
+
static int my_strnxfrm_czech(CHARSET_INFO *cs __attribute__((unused)),
- uchar * dest, uint len,
- const uchar * src, uint srclen)
- {
- int value;
- const uchar * p, * store;
- int pass = 0;
- int totlen = 0;
- p = src; store = src;
-
- do
- {
- NEXT_CMP_VALUE(src, p, store, pass, value, (int)srclen);
- ADD_TO_RESULT(dest, (int)len, totlen, value);
- }
- while (value);
- return totlen;
- }
+ uchar * dest, uint len,
+ const uchar * src, uint srclen)
+{
+ int value;
+ const uchar * p, * store;
+ int pass = 0;
+ int totlen = 0;
+ p = src; store = src;
+
+ do
+ {
+ NEXT_CMP_VALUE(src, p, store, pass, value, (int)srclen);
+ ADD_TO_RESULT(dest, (int)len, totlen, value);
+ }
+ while (value);
+ return totlen;
+}
#undef IS_END
@@ -379,10 +354,11 @@ static int my_strnxfrm_czech(CHARSET_INFO *cs __attribute__((unused)),
#define EXAMPLE
static my_bool my_like_range_czech(CHARSET_INFO *cs __attribute__((unused)),
- const char *ptr,uint ptr_length,
- int escape, int w_one, int w_many,
- uint res_length, char *min_str,char *max_str,
- uint *min_length,uint *max_length)
+ const char *ptr,uint ptr_length,
+ pbool escape, pbool w_one, pbool w_many,
+ uint res_length, char *min_str,
+ char *max_str,
+ uint *min_length,uint *max_length)
{
#ifdef EXAMPLE
uchar value;
@@ -594,16 +570,6 @@ static MY_UNI_IDX idx_uni_8859_2[]={
};
-static
-int my_strnncollsp_czech(CHARSET_INFO * cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen)
-{
- for ( ; slen && my_isspace(cs, s[slen-1]) ; slen--);
- for ( ; tlen && my_isspace(cs, t[tlen-1]) ; tlen--);
- return my_strnncoll_czech(cs,s,slen,t,tlen);
-}
-
static MY_COLLATION_HANDLER my_collation_latin2_czech_ci_handler =
{
my_strnncoll_czech,
@@ -633,7 +599,8 @@ CHARSET_INFO my_charset_latin2_czech_ci =
4, /* strxfrm_multiply */
1, /* mbminlen */
1, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0, /* max_sort_char */
&my_charset_8bit_handler,
&my_collation_latin2_czech_ci_handler
};
diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c
index 278e8529e83..7f89b8152e8 100644
--- a/strings/ctype-euc_kr.c
+++ b/strings/ctype-euc_kr.c
@@ -8653,7 +8653,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
mbcharlen_euc_kr,
my_numchars_mb,
my_charpos_mb,
- my_wellformedlen_mb,
+ my_well_formed_len_mb,
my_lengthsp_8bit,
my_mb_wc_euc_kr, /* mb_wc */
my_wc_mb_euc_kr, /* wc_mb */
@@ -8692,7 +8692,8 @@ CHARSET_INFO my_charset_euckr_korean_ci=
1, /* strxfrm_multiply */
1, /* mbminlen */
2, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0, /* max_sort_char */
&my_charset_handler,
&my_collation_ci_handler
};
@@ -8716,7 +8717,8 @@ CHARSET_INFO my_charset_euckr_bin=
1, /* strxfrm_multiply */
1, /* mbminlen */
2, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0, /* max_sort_char */
&my_charset_handler,
&my_collation_mb_bin_handler
};
diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c
index 0085d264416..55dab3ca2a8 100644
--- a/strings/ctype-extra.c
+++ b/strings/ctype-extra.c
@@ -35,6 +35,7 @@ CHARSET_INFO compiled_charsets[] = {
0,
0,
0,
+ 0,
NULL,
NULL
}
diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c
index 722f00f0f7a..e5dfaf45276 100644
--- a/strings/ctype-gb2312.c
+++ b/strings/ctype-gb2312.c
@@ -5704,7 +5704,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
mbcharlen_gb2312,
my_numchars_mb,
my_charpos_mb,
- my_wellformedlen_mb,
+ my_well_formed_len_mb,
my_lengthsp_8bit,
my_mb_wc_gb2312, /* mb_wc */
my_wc_mb_gb2312, /* wc_mb */
@@ -5743,7 +5743,8 @@ CHARSET_INFO my_charset_gb2312_chinese_ci=
1, /* strxfrm_multiply */
1, /* mbminlen */
2, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0, /* max_sort_char */
&my_charset_handler,
&my_collation_ci_handler
};
@@ -5766,7 +5767,8 @@ CHARSET_INFO my_charset_gb2312_bin=
1, /* strxfrm_multiply */
1, /* mbminlen */
2, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0, /* max_sort_char */
&my_charset_handler,
&my_collation_mb_bin_handler
};
diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c
index 9e71a18e531..1990060e67b 100644
--- a/strings/ctype-gbk.c
+++ b/strings/ctype-gbk.c
@@ -2582,40 +2582,74 @@ static uint16 gbksortorder(uint16 i)
}
-int my_strnncoll_gbk(CHARSET_INFO *cs __attribute__((unused)),
- const uchar * s1, uint len1,
- const uchar * s2, uint len2)
+int my_strnncoll_gbk_internal(const uchar **a_res, const uchar **b_res,
+ uint length)
{
- uint len,c1,c2;
+ const char *a= *a_res, *b= *b_res;
+ uint a_char,b_char;
- len = min(len1,len2);
- while (len--)
+ while (length--)
{
- if ((len > 0) && isgbkcode(*s1,*(s1+1)) && isgbkcode(*s2, *(s2+1)))
+ if ((length > 0) && isgbkcode(*a,*(a+1)) && isgbkcode(*b, *(b+1)))
{
- c1=gbkcode(*s1,*(s1+1));
- c2=gbkcode(*s2,*(s2+1));
- if (c1!=c2)
- return ((int) gbksortorder((uint16) c1) -
- (int) gbksortorder((uint16) c2));
- s1+=2;
- s2+=2;
- --len;
- } else if (sort_order_gbk[(uchar) *s1++] != sort_order_gbk[(uchar) *s2++])
- return ((int) sort_order_gbk[(uchar) s1[-1]] -
- (int) sort_order_gbk[(uchar) s2[-1]]);
+ a_char= gbkcode(*a,*(a+1));
+ b_char= gbkcode(*b,*(b+1));
+ if (a_char != b_char)
+ return ((int) gbksortorder((uint16) a_char) -
+ (int) gbksortorder((uint16) b_char));
+ a+= 2;
+ b+= 2;
+ length--;
+ }
+ else if (sort_order_gbk[(uchar) *a++] != sort_order_gbk[(uchar) *b++])
+ return ((int) sort_order_gbk[(uchar) a[-1]] -
+ (int) sort_order_gbk[(uchar) b[-1]]);
}
- return (int) (len1-len2);
+ *a_res= a;
+ *b_res= b;
+ return 0;
}
-static
-int my_strnncollsp_gbk(CHARSET_INFO * cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen)
+
+
+int my_strnncoll_gbk(CHARSET_INFO *cs __attribute__((unused)),
+ const uchar *a, uint a_length,
+ const uchar *b, uint b_length)
{
- for ( ; slen && my_isspace(cs, s[slen-1]) ; slen--);
- for ( ; tlen && my_isspace(cs, t[tlen-1]) ; tlen--);
- return my_strnncoll_gbk(cs,s,slen,t,tlen);
+ uint length= min(a_length, b_length);
+ int res= my_strnncoll_gbk_internal(&a, &b, length);
+ return res ? res : (int) (a_length - b_length);
+}
+
+
+static int my_strnncollsp_gbk(CHARSET_INFO * cs __attribute__((unused)),
+ const uchar *a, uint a_length,
+ const uchar *b, uint b_length)
+{
+ uint length= min(a_length, b_length);
+ int res= my_strnncoll_gbk_internal(&a, &b, length);
+ if (!res && a_length != b_length)
+ {
+ const uchar *end;
+ int swap= 0;
+ /*
+ Check the next not space character of the longer key. If it's < ' ',
+ then it's smaller than the other key.
+ */
+ if (a_length < b_length)
+ {
+ /* put shorter key in a */
+ a_length= b_length;
+ a= b;
+ swap= -1; /* swap sign of result */
+ }
+ for (end= a + a_length-length; a < end ; a++)
+ {
+ if (*a != ' ')
+ return ((int) *a - (int) ' ') ^ swap;
+ }
+ }
+ return res;
}
@@ -2663,7 +2697,7 @@ static int my_strnxfrm_gbk(CHARSET_INFO *cs __attribute__((unused)),
static my_bool my_like_range_gbk(CHARSET_INFO *cs __attribute__((unused)),
const char *ptr,uint ptr_length,
- int escape, int w_one, int w_many,
+ pbool escape, pbool w_one, pbool w_many,
uint res_length, char *min_str,char *max_str,
uint *min_length,uint *max_length)
{
@@ -2696,7 +2730,7 @@ static my_bool my_like_range_gbk(CHARSET_INFO *cs __attribute__((unused)),
*min_length= (uint) (min_str - min_org);
*max_length= res_length;
do {
- *min_str++ = '\0'; /* Because if key compression */
+ *min_str++= 0;
*max_str++ = max_sort_char;
} while (min_str != min_end);
return 0;
@@ -9900,7 +9934,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
mbcharlen_gbk,
my_numchars_mb,
my_charpos_mb,
- my_wellformedlen_mb,
+ my_well_formed_len_mb,
my_lengthsp_8bit,
my_mb_wc_gbk,
my_wc_mb_gbk,
@@ -9939,7 +9973,8 @@ CHARSET_INFO my_charset_gbk_chinese_ci=
1, /* strxfrm_multiply */
1, /* mbminlen */
2, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0, /* max_sort_char */
&my_charset_handler,
&my_collation_ci_handler
};
@@ -9962,7 +9997,8 @@ CHARSET_INFO my_charset_gbk_bin=
1, /* strxfrm_multiply */
1, /* mbminlen */
2, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0, /* max_sort_char */
&my_charset_handler,
&my_collation_mb_bin_handler
};
diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c
index 933737b5f61..7a010c3bef8 100644
--- a/strings/ctype-latin1.c
+++ b/strings/ctype-latin1.c
@@ -180,7 +180,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
my_mbcharlen_8bit,
my_numchars_8bit,
my_charpos_8bit,
- my_wellformedlen_8bit,
+ my_well_formed_len_8bit,
my_lengthsp_8bit,
my_mb_wc_latin1,
my_wc_mb_latin1,
@@ -218,7 +218,8 @@ CHARSET_INFO my_charset_latin1=
1, /* strxfrm_multiply */
1, /* mbminlen */
1, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0, /* max_sort_char */
&my_charset_handler,
&my_collation_8bit_simple_ci_handler
};
@@ -318,51 +319,105 @@ uchar combo2map[]={
static int my_strnncoll_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
- const uchar *s1, uint len1,
- const uchar *s2, uint len2)
+ const uchar *a, uint a_length,
+ const uchar *b, uint b_length)
{
- const uchar *e1 = s1 + len1;
- const uchar *e2 = s2 + len2;
- uchar c1, c12=0, c2, c22=0;
+ const uchar *a_end= a + a_length;
+ const uchar *b_end= b + b_length;
+ uchar a_char, a_extend= 0, b_char, b_extend= 0;
- while ((s1 < e1 || c12) && (s2 < e2 || c22))
+ while ((a < a_end || a_extend) && (b < b_end || b_extend))
{
- if (c12)
+ if (a_extend)
{
- c1=c12; c12=0;
+ a_char=a_extend; a_extend=0;
}
else
{
- c12=combo2map[*s1];
- c1=combo1map[*s1++];
+ a_extend=combo2map[*a];
+ a_char=combo1map[*a++];
}
- if (c22)
+ if (b_extend)
{
- c2=c22; c22=0;
+ b_char=b_extend; b_extend=0;
}
else
{
- c22=combo2map[*s2];
- c2=combo1map[*s2++];
+ b_extend=combo2map[*b];
+ b_char=combo1map[*b++];
}
- if (c1 != c2) return (int)c1 - (int)c2;
+ if (a_char != b_char)
+ return (int) a_char - (int) b_char;
}
-
/*
A simple test of string lengths won't work -- we test to see
which string ran out first
*/
- return (s1 < e1 || c12) ? 1 : (s2 < e2 || c22) ? -1 : 0;
+ return ((a < a_end || a_extend) ? 1 :
+ (b < b_end || b_extend) ? -1 : 0);
}
-static int my_strnncollsp_latin1_de(CHARSET_INFO *cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen)
+static int my_strnncollsp_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
+ const uchar *a, uint a_length,
+ const uchar *b, uint b_length)
{
- for ( ; slen && my_isspace(cs, s[slen-1]) ; slen--);
- for ( ; tlen && my_isspace(cs, t[tlen-1]) ; tlen--);
- return my_strnncoll_latin1_de(cs,s,slen,t,tlen);
+ const uchar *a_end= a + a_length;
+ const uchar *b_end= b + b_length;
+ uchar a_char, a_extend= 0, b_char, b_extend= 0;
+
+ while ((a < a_end || a_extend) && (b < b_end || b_extend))
+ {
+ if (a_extend)
+ {
+ a_char=a_extend;
+ a_extend= 0;
+ }
+ else
+ {
+ a_extend= combo2map[*a];
+ a_char= combo1map[*a++];
+ }
+ if (b_extend)
+ {
+ b_char= b_extend;
+ b_extend= 0;
+ }
+ else
+ {
+ b_extend= combo2map[*b];
+ b_char= combo1map[*b++];
+ }
+ if (a_char != b_char)
+ return (int) a_char - (int) b_char;
+ }
+ /* Check if double character last */
+ if (a_extend)
+ return 1;
+ if (b_extend)
+ return -1;
+
+ if (a != a_end || b != b_end)
+ {
+ int swap= 0;
+ /*
+ Check the next not space character of the longer key. If it's < ' ',
+ then it's smaller than the other key.
+ */
+ if (a == a_end)
+ {
+ /* put shorter key in a */
+ a_end= b_end;
+ a= b;
+ swap= -1; /* swap sign of result */
+ }
+ for ( ; a < a_end ; a++)
+ {
+ if (*a != ' ')
+ return ((int) *a - (int) ' ') ^ swap;
+ }
+ }
+ return 0;
}
@@ -384,6 +439,32 @@ static int my_strnxfrm_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
}
+void my_hash_sort_latin1_de(CHARSET_INFO *cs __attribute__((unused)),
+ const uchar *key, uint len,
+ ulong *nr1, ulong *nr2)
+{
+ const uchar *end= key+len;
+ /*
+ Remove end space. We have to do this to be able to compare
+ 'AE' and 'Ä' as identical
+ */
+ while (end > key && end[-1] == ' ')
+ end--;
+
+ for (; key < end ; key++)
+ {
+ uint X= (uint) combo1map[(uint) *key];
+ nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) * X) + (nr1[0] << 8);
+ nr2[0]+=3;
+ if ((X= combo2map[*key]))
+ {
+ nr1[0]^=(ulong) ((((uint) nr1[0] & 63)+nr2[0]) * X) + (nr1[0] << 8);
+ nr2[0]+=3;
+ }
+ }
+}
+
+
static MY_COLLATION_HANDLER my_collation_german2_ci_handler=
{
my_strnncoll_latin1_de,
@@ -393,7 +474,7 @@ static MY_COLLATION_HANDLER my_collation_german2_ci_handler=
my_wildcmp_8bit,
my_strcasecmp_8bit,
my_instr_simple,
- my_hash_sort_simple
+ my_hash_sort_latin1_de
};
@@ -414,7 +495,8 @@ CHARSET_INFO my_charset_latin1_german2_ci=
2, /* strxfrm_multiply */
1, /* mbminlen */
1, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0, /* max_sort_char */
&my_charset_handler,
&my_collation_german2_ci_handler
};
@@ -438,7 +520,8 @@ CHARSET_INFO my_charset_latin1_bin=
1, /* strxfrm_multiply */
1, /* mbminlen */
1, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0, /* max_sort_char */
&my_charset_handler,
&my_collation_8bit_bin_handler
};
diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c
index 46f3e2f4fc3..ed772a68845 100644
--- a/strings/ctype-mb.c
+++ b/strings/ctype-mb.c
@@ -274,12 +274,12 @@ uint my_charpos_mb(CHARSET_INFO *cs __attribute__((unused)),
return pos ? e+2-b0 : b-b0;
}
-uint my_wellformedlen_mb(CHARSET_INFO *cs,
- const char *b, const char *e, uint pos)
+uint my_well_formed_len_mb(CHARSET_INFO *cs,
+ const char *b, const char *e, uint pos)
{
my_wc_t wc;
int mblen;
- const char *b0= b;
+ const char *b_start= b;
while (pos)
{
@@ -288,7 +288,7 @@ uint my_wellformedlen_mb(CHARSET_INFO *cs,
b+= mblen;
pos--;
}
- return b - b0;
+ return b - b_start;
}
@@ -347,6 +347,7 @@ uint my_instr_mb(CHARSET_INFO *cs,
return 0;
}
+
/* BINARY collations handlers for MB charsets */
static int my_strnncoll_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
@@ -357,20 +358,6 @@ static int my_strnncoll_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
return cmp ? cmp : (int) (slen - tlen);
}
-static int my_strnncollsp_mb_bin(CHARSET_INFO * cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen)
-{
- int len, cmp;
-
- for ( ; slen && my_isspace(cs, s[slen-1]) ; slen--);
- for ( ; tlen && my_isspace(cs, t[tlen-1]) ; tlen--);
-
- len = ( slen > tlen ) ? tlen : slen;
-
- cmp= memcmp(s,t,len);
- return cmp ? cmp : (int) (slen - tlen);
-}
static int my_strnxfrm_mb_bin(CHARSET_INFO *cs __attribute__((unused)),
uchar * dest, uint len,
@@ -526,7 +513,7 @@ static int my_wildcmp_mb_bin(CHARSET_INFO *cs,
MY_COLLATION_HANDLER my_collation_mb_bin_handler =
{
my_strnncoll_mb_bin,
- my_strnncollsp_mb_bin,
+ my_strnncoll_mb_bin,
my_strnxfrm_mb_bin,
my_like_range_simple,
my_wildcmp_mb_bin,
diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c
index 233251e16a8..c8eb3c07a3f 100644
--- a/strings/ctype-simple.c
+++ b/strings/ctype-simple.c
@@ -60,25 +60,69 @@ int my_strnncoll_simple(CHARSET_INFO * cs, const uchar *s, uint slen,
}
-int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *s, uint slen,
- const uchar *t, uint tlen)
+/*
+ Compare strings, discarding end space
+
+ SYNOPSIS
+ my_strnncollsp_simple()
+ cs character set handler
+ a First string to compare
+ a_length Length of 'a'
+ b Second string to compare
+ b_length Length of 'b'
+
+ IMPLEMENTATION
+ If one string is shorter as the other, then we space extend the other
+ so that the strings have equal length.
+
+ This will ensure that the following things hold:
+
+ "a" == "a "
+ "a\0" < "a"
+ "a\0" < "a "
+
+ RETURN
+ < 0 a < b
+ = 0 a == b
+ > 0 a > b
+*/
+
+int my_strnncollsp_simple(CHARSET_INFO * cs, const uchar *a, uint a_length,
+ const uchar *b, uint b_length)
{
- uchar *map= cs->sort_order;
- int len;
-
- for ( ; slen && my_isspace(cs, s[slen-1]) ; slen--);
- for ( ; tlen && my_isspace(cs, t[tlen-1]) ; tlen--);
-
- len = ( slen > tlen ) ? tlen : slen;
-
- while (len--)
+ const uchar *map= cs->sort_order, *end;
+ uint length;
+
+ end= a + (length= min(a_length, b_length));
+ while (a < end)
{
- if (map[*s++] != map[*t++])
- return ((int) map[s[-1]] - (int) map[t[-1]]);
+ if (map[*a++] != map[*b++])
+ return ((int) map[a[-1]] - (int) map[b[-1]]);
}
- return (int) (slen-tlen);
+ if (a_length != b_length)
+ {
+ int swap= 0;
+ /*
+ Check the next not space character of the longer key. If it's < ' ',
+ then it's smaller than the other key.
+ */
+ if (a_length < b_length)
+ {
+ /* put shorter key in s */
+ a_length= b_length;
+ a= b;
+ swap= -1; /* swap sign of result */
+ }
+ for (end= a + a_length-length; a < end ; a++)
+ {
+ if (*a != ' ')
+ return ((int) *a - (int) ' ') ^ swap;
+ }
+ }
+ return 0;
}
+
void my_caseup_str_8bit(CHARSET_INFO * cs,char *str)
{
register uchar *map=cs->to_upper;
@@ -169,8 +213,8 @@ int my_snprintf_8bit(CHARSET_INFO *cs __attribute__((unused)),
void my_hash_sort_simple(CHARSET_INFO *cs,
- const uchar *key, uint len,
- ulong *nr1, ulong *nr2)
+ const uchar *key, uint len,
+ ulong *nr1, ulong *nr2)
{
register uchar *sort_order=cs->sort_order;
const uchar *pos = key;
@@ -186,9 +230,9 @@ void my_hash_sort_simple(CHARSET_INFO *cs,
}
-long my_strntol_8bit(CHARSET_INFO *cs,
- const char *nptr, uint l, int base,
- char **endptr, int *err)
+long my_strntol_8bit(CHARSET_INFO *cs,
+ const char *nptr, uint l, int base,
+ char **endptr, int *err)
{
int negative;
register ulong cutoff;
@@ -262,9 +306,9 @@ long my_strntol_8bit(CHARSET_INFO *cs,
{
if (c>='0' && c<='9')
c -= '0';
- else if (c>='A' && c<='F')
+ else if (c>='A' && c<='Z')
c = c - 'A' + 10;
- else if (c>='a' && c<='f')
+ else if (c>='a' && c<='z')
c = c - 'a' + 10;
else
break;
@@ -309,9 +353,9 @@ noconv:
}
-ulong my_strntoul_8bit(CHARSET_INFO *cs,
- const char *nptr, uint l, int base,
- char **endptr, int *err)
+ulong my_strntoul_8bit(CHARSET_INFO *cs,
+ const char *nptr, uint l, int base,
+ char **endptr, int *err)
{
int negative;
register ulong cutoff;
@@ -384,9 +428,9 @@ ulong my_strntoul_8bit(CHARSET_INFO *cs,
{
if (c>='0' && c<='9')
c -= '0';
- else if (c>='A' && c<='F')
+ else if (c>='A' && c<='Z')
c = c - 'A' + 10;
- else if (c>='a' && c<='f')
+ else if (c>='a' && c<='z')
c = c - 'a' + 10;
else
break;
@@ -423,9 +467,9 @@ noconv:
}
-longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)),
- const char *nptr, uint l, int base,
- char **endptr,int *err)
+longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)),
+ const char *nptr, uint l, int base,
+ char **endptr,int *err)
{
int negative;
register ulonglong cutoff;
@@ -499,9 +543,9 @@ longlong my_strntoll_8bit(CHARSET_INFO *cs __attribute__((unused)),
{
if (c>='0' && c<='9')
c -= '0';
- else if (c>='A' && c<='F')
+ else if (c>='A' && c<='Z')
c = c - 'A' + 10;
- else if (c>='a' && c<='f')
+ else if (c>='a' && c<='z')
c = c - 'a' + 10;
else
break;
@@ -622,9 +666,9 @@ ulonglong my_strntoull_8bit(CHARSET_INFO *cs,
{
if (c>='0' && c<='9')
c -= '0';
- else if (c>='A' && c<='F')
+ else if (c>='A' && c<='Z')
c = c - 'A' + 10;
- else if (c>='a' && c<='f')
+ else if (c>='a' && c<='z')
c = c - 'a' + 10;
else
break;
@@ -684,7 +728,7 @@ noconv:
double my_strntod_8bit(CHARSET_INFO *cs __attribute__((unused)),
- char *str, uint length,
+ char *str, uint length,
char **end, int *err)
{
char end_char;
@@ -702,12 +746,12 @@ double my_strntod_8bit(CHARSET_INFO *cs __attribute__((unused)),
#else
if (length == INT_MAX32 || str[length] == 0)
#endif
- result= strtod(str, end);
+ result= my_strtod(str, end);
else
{
end_char= str[length];
str[length]= 0;
- result= strtod(str, end);
+ result= my_strtod(str, end);
str[length]= end_char; /* Restore end char */
}
*err= errno;
@@ -825,7 +869,7 @@ cnv:
#define likeconv(s,A) (uchar) (s)->sort_order[(uchar) (A)]
#endif
-#define INC_PTR(cs,A,B) A++
+#define INC_PTR(cs,A,B) (A)++
int my_wildcmp_8bit(CHARSET_INFO *cs,
@@ -833,7 +877,7 @@ int my_wildcmp_8bit(CHARSET_INFO *cs,
const char *wildstr,const char *wildend,
int escape, int w_one, int w_many)
{
- int result= -1; /* Not found, using wildcards */
+ int result= -1; /* Not found, using wildcards */
while (wildstr != wildend)
{
@@ -845,7 +889,7 @@ int my_wildcmp_8bit(CHARSET_INFO *cs,
if (str == str_end || likeconv(cs,*wildstr++) != likeconv(cs,*str++))
return(1); /* No match */
if (wildstr == wildend)
- return (str != str_end); /* Match if both are at end */
+ return(str != str_end); /* Match if both are at end */
result=1; /* Found an anchor char */
}
if (*wildstr == w_one)
@@ -853,7 +897,7 @@ int my_wildcmp_8bit(CHARSET_INFO *cs,
do
{
if (str == str_end) /* Skip one char if possible */
- return (result);
+ return(result);
INC_PTR(cs,str,str_end);
} while (++wildstr < wildend && *wildstr == w_one);
if (wildstr == wildend)
@@ -872,7 +916,7 @@ int my_wildcmp_8bit(CHARSET_INFO *cs,
if (*wildstr == w_one)
{
if (str == str_end)
- return (-1);
+ return(-1);
INC_PTR(cs,str,str_end);
continue;
}
@@ -881,28 +925,29 @@ int my_wildcmp_8bit(CHARSET_INFO *cs,
if (wildstr == wildend)
return(0); /* Ok if w_many is last */
if (str == str_end)
- return -1;
+ return(-1);
if ((cmp= *wildstr) == escape && wildstr+1 != wildend)
cmp= *++wildstr;
- INC_PTR(cs,wildstr,wildend); /* This is compared trough cmp */
- cmp=likeconv(cs,cmp);
+ INC_PTR(cs,wildstr,wildend); /* This is compared trough cmp */
+ cmp=likeconv(cs,cmp);
do
{
- while (str != str_end && likeconv(cs,*str) != cmp)
- str++;
- if (str++ == str_end) return (-1);
+ while (str != str_end && (uchar) likeconv(cs,*str) != cmp)
+ str++;
+ if (str++ == str_end) return(-1);
{
- int tmp=my_wildcmp_8bit(cs,str,str_end,wildstr,wildend,escape,w_one,w_many);
+ int tmp=my_wildcmp_8bit(cs,str,str_end,wildstr,wildend,escape,w_one,
+ w_many);
if (tmp <= 0)
- return (tmp);
+ return(tmp);
}
} while (str != str_end && wildstr[0] != w_many);
return(-1);
}
}
- return (str != str_end ? 1 : 0);
+ return(str != str_end ? 1 : 0);
}
@@ -924,11 +969,11 @@ int my_wildcmp_8bit(CHARSET_INFO *cs,
*/
my_bool my_like_range_simple(CHARSET_INFO *cs,
- const char *ptr,uint ptr_length,
- int escape, int w_one, int w_many,
- uint res_length,
- char *min_str,char *max_str,
- uint *min_length,uint *max_length)
+ const char *ptr,uint ptr_length,
+ pbool escape, pbool w_one, pbool w_many,
+ uint res_length,
+ char *min_str,char *max_str,
+ uint *min_length,uint *max_length)
{
const char *end=ptr+ptr_length;
char *min_org=min_str;
@@ -945,16 +990,17 @@ my_bool my_like_range_simple(CHARSET_INFO *cs,
if (*ptr == w_one) /* '_' in SQL */
{
*min_str++='\0'; /* This should be min char */
- *max_str++=cs->max_sort_char;
+ *max_str++= (char) cs->max_sort_char;
continue;
}
if (*ptr == w_many) /* '%' in SQL */
{
*min_length= (uint) (min_str - min_org);
*max_length=res_length;
- do {
- *min_str++ = ' '; /* Because if key compression */
- *max_str++ = cs->max_sort_char;
+ do
+ {
+ *min_str++= 0;
+ *max_str++= (char) cs->max_sort_char;
} while (min_str != min_end);
return 0;
}
@@ -962,15 +1008,8 @@ my_bool my_like_range_simple(CHARSET_INFO *cs,
}
*min_length= *max_length = (uint) (min_str - min_org);
- /* Temporary fix for handling w_one at end of string (key compression) */
- {
- char *tmp;
- for (tmp= min_str ; tmp > min_org && tmp[-1] == '\0';)
- *--tmp=' ';
- }
-
while (min_str != min_end)
- *min_str++ = *max_str++ = ' '; /* Because if key compression */
+ *min_str++ = *max_str++ = ' '; /* Because if key compression */
return 0;
}
@@ -1000,18 +1039,21 @@ ulong my_scan_8bit(CHARSET_INFO *cs, const char *str, const char *end, int sq)
}
}
+
void my_fill_8bit(CHARSET_INFO *cs __attribute__((unused)),
char *s, uint l, int fill)
{
bfill(s,l,fill);
}
+
uint my_numchars_8bit(CHARSET_INFO *cs __attribute__((unused)),
const char *b, const char *e)
{
return e-b;
}
+
uint my_charpos_8bit(CHARSET_INFO *cs __attribute__((unused)),
const char *b __attribute__((unused)),
const char *e __attribute__((unused)),
@@ -1020,15 +1062,17 @@ uint my_charpos_8bit(CHARSET_INFO *cs __attribute__((unused)),
return pos;
}
-uint my_wellformedlen_8bit(CHARSET_INFO *cs __attribute__((unused)),
- const char *start,
- const char *end,
- uint nchars)
+
+uint my_well_formed_len_8bit(CHARSET_INFO *cs __attribute__((unused)),
+ const char *start,
+ const char *end,
+ uint nchars)
{
uint nbytes= (uint) (end-start);
- return nbytes < nchars ? nbytes : nchars;
+ return min(nbytes, nchars);
}
+
uint my_lengthsp_8bit(CHARSET_INFO *cs __attribute__((unused)),
const char *ptr, uint length)
{
@@ -1105,7 +1149,7 @@ MY_CHARSET_HANDLER my_charset_8bit_handler=
my_mbcharlen_8bit, /* mbcharlen */
my_numchars_8bit,
my_charpos_8bit,
- my_wellformedlen_8bit,
+ my_well_formed_len_8bit,
my_lengthsp_8bit,
my_mb_wc_8bit,
my_wc_mb_8bit,
diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c
index feff0fff227..68cd77f96fc 100644
--- a/strings/ctype-sjis.c
+++ b/strings/ctype-sjis.c
@@ -184,7 +184,7 @@ static uchar NEAR sort_order_sjis[]=
static int ismbchar_sjis(CHARSET_INFO *cs __attribute__((unused)),
- const char* p, const char *e)
+ const char* p, const char *e)
{
return (issjishead((uchar) *p) && (e-p)>1 && issjistail((uchar)p[1]) ? 2: 0);
}
@@ -197,59 +197,101 @@ static int mbcharlen_sjis(CHARSET_INFO *cs __attribute__((unused)),uint c)
#define sjiscode(c,d) ((((uint) (uchar)(c)) << 8) | (uint) (uchar) (d))
-static int my_strnncoll_sjis(CHARSET_INFO *cs __attribute__((unused)),
- const uchar *s1, uint len1,
- const uchar *s2, uint len2)
+
+static int my_strnncoll_sjis_internal(CHARSET_INFO *cs,
+ const uchar **a_res, uint a_length,
+ const uchar **b_res, uint b_length)
{
- const uchar *e1 = s1 + len1;
- const uchar *e2 = s2 + len2;
- while (s1 < e1 && s2 < e2) {
- if (ismbchar_sjis(cs,(char*) s1, (char*) e1) &&
- ismbchar_sjis(cs,(char*) s2, (char*) e2)) {
- uint c1 = sjiscode(*s1, *(s1+1));
- uint c2 = sjiscode(*s2, *(s2+1));
- if (c1 != c2)
- return c1 - c2;
- s1 += 2;
- s2 += 2;
- } else {
- if (sort_order_sjis[(uchar)*s1] != sort_order_sjis[(uchar)*s2])
- return sort_order_sjis[(uchar)*s1] - sort_order_sjis[(uchar)*s2];
- s1++;
- s2++;
+ const uchar *a= *a_res, *b= *b_res;
+ const uchar *a_end= a + a_length;
+ const uchar *b_end= b + b_length;
+ while (a < a_end && b < b_end)
+ {
+ if (ismbchar_sjis(cs,(char*) a, (char*) a_end) &&
+ ismbchar_sjis(cs,(char*) b, (char*) b_end))
+ {
+ uint a_char= sjiscode(*a, *(a+1));
+ uint b_char= sjiscode(*b, *(b+1));
+ if (a_char != b_char)
+ return a_char - b_char;
+ a += 2;
+ b += 2;
+ } else
+ {
+ if (sort_order_sjis[(uchar)*a] != sort_order_sjis[(uchar)*b])
+ return sort_order_sjis[(uchar)*a] - sort_order_sjis[(uchar)*b];
+ a++;
+ b++;
}
}
- return len1 - len2;
+ *a_res= a;
+ *b_res= b;
+ return 0;
+}
+
+
+static int my_strnncoll_sjis(CHARSET_INFO *cs __attribute__((unused)),
+ const uchar *a, uint a_length,
+ const uchar *b, uint b_length)
+{
+ int res= my_strnncoll_sjis_internal(cs, &a, a_length, &b, b_length);
+ return res ? res : (int) (a_length - b_length);
}
-static
-int my_strnncollsp_sjis(CHARSET_INFO * cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen)
+
+static int my_strnncollsp_sjis(CHARSET_INFO *cs __attribute__((unused)),
+ const uchar *a, uint a_length,
+ const uchar *b, uint b_length)
{
- for ( ; slen && my_isspace(cs, s[slen-1]) ; slen--);
- for ( ; tlen && my_isspace(cs, t[tlen-1]) ; tlen--);
- return my_strnncoll_sjis(cs,s,slen,t,tlen);
+ const uchar *a_end= a + a_length;
+ const uchar *b_end= b + b_length;
+ int res= my_strnncoll_sjis_internal(cs, &a, a_length, &b, b_length);
+ if (!res && (a != a_end || b != b_end))
+ {
+ int swap= 0;
+ /*
+ Check the next not space character of the longer key. If it's < ' ',
+ then it's smaller than the other key.
+ */
+ if (a == a_end)
+ {
+ /* put shorter key in a */
+ a_end= b_end;
+ a= b;
+ swap= -1; /* swap sign of result */
+ }
+ for (; a < a_end ; a++)
+ {
+ if (*a != ' ')
+ return ((int) *a - (int) ' ') ^ swap;
+ }
+ }
+ return res;
}
+
+
static int my_strnxfrm_sjis(CHARSET_INFO *cs __attribute__((unused)),
uchar *dest, uint len,
const uchar *src, uint srclen)
{
uchar *d_end = dest + len;
uchar *s_end = (uchar*) src + srclen;
- while (dest < d_end && src < s_end) {
- if (ismbchar_sjis(cs,(char*) src, (char*) s_end)) {
+ while (dest < d_end && src < s_end)
+ {
+ if (ismbchar_sjis(cs,(char*) src, (char*) s_end))
+ {
*dest++ = *src++;
if (dest < d_end && src < s_end)
*dest++ = *src++;
- } else {
- *dest++ = sort_order_sjis[(uchar)*src++];
}
+ else
+ *dest++ = sort_order_sjis[(uchar)*src++];
}
return srclen;
}
+
/*
** Calculate min_str and max_str that ranges a LIKE string.
** Arguments:
@@ -270,10 +312,10 @@ static int my_strnxfrm_sjis(CHARSET_INFO *cs __attribute__((unused)),
#define max_sort_char ((char) 255)
static my_bool my_like_range_sjis(CHARSET_INFO *cs __attribute__((unused)),
- const char *ptr,uint ptr_length,
- int escape, int w_one, int w_many,
- uint res_length, char *min_str,char *max_str,
- uint *min_length,uint *max_length)
+ const char *ptr,uint ptr_length,
+ pbool escape, pbool w_one, pbool w_many,
+ uint res_length, char *min_str,char *max_str,
+ uint *min_length,uint *max_length)
{
const char *end=ptr+ptr_length;
char *min_org=min_str;
@@ -300,12 +342,14 @@ static my_bool my_like_range_sjis(CHARSET_INFO *cs __attribute__((unused)),
ptr++;
continue;
}
- if (*ptr == w_many) { /* '%' in SQL */
+ if (*ptr == w_many)
+ { /* '%' in SQL */
*min_length = (uint)(min_str - min_org);
*max_length = res_length;
- do {
- *min_str++ = ' '; /* Because if key compression */
- *max_str++ = max_sort_char;
+ do
+ {
+ *min_str++= 0;
+ *max_str++= max_sort_char;
} while (min_str < min_end);
return 0;
}
@@ -4437,6 +4481,12 @@ my_wc_mb_sjis(CHARSET_INFO *cs __attribute__((unused)),
if (!(code=func_uni_sjis_onechar(wc)))
return MY_CS_ILUNI;
+ if (code>=0xA1 && code <= 0xDF)
+ {
+ s[0]= code;
+ return 1;
+ }
+
if (s+2>e)
return MY_CS_TOOSMALL;
@@ -4454,12 +4504,18 @@ my_mb_wc_sjis(CHARSET_INFO *cs __attribute__((unused)),
if (s >= e)
return MY_CS_TOOFEW(0);
- if (hi<0x80)
+ if (hi < 0x80)
{
pwc[0]=hi;
return 1;
}
+ if (hi >= 0xA1 && hi <= 0xDF)
+ {
+ pwc[0]= func_sjis_uni_onechar(hi);
+ return 1;
+ }
+
if (s+2>e)
return MY_CS_TOOFEW(0);
@@ -4489,7 +4545,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
mbcharlen_sjis,
my_numchars_mb,
my_charpos_mb,
- my_wellformedlen_mb,
+ my_well_formed_len_mb,
my_lengthsp_8bit,
my_mb_wc_sjis, /* mb_wc */
my_wc_mb_sjis, /* wc_mb */
@@ -4528,7 +4584,8 @@ CHARSET_INFO my_charset_sjis_japanese_ci=
1, /* strxfrm_multiply */
1, /* mbminlen */
2, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0, /* max_sort_char */
&my_charset_handler,
&my_collation_ci_handler
};
@@ -4551,7 +4608,8 @@ CHARSET_INFO my_charset_sjis_bin=
1, /* strxfrm_multiply */
1, /* mbminlen */
2, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0, /* max_sort_char */
&my_charset_handler,
&my_collation_mb_bin_handler
};
diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c
index d577b964405..e04a4dfdc96 100644
--- a/strings/ctype-tis620.c
+++ b/strings/ctype-tis620.c
@@ -15,6 +15,11 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
+ Copyright (C) 2003 by Sathit Jittanupat
+ <jsat66@hotmail.com,jsat66@yahoo.com>
+ * solving bug crash with long text field string
+ * sorting with different number of space or sign char. within string
+
Copyright (C) 2001 by Korakot Chaovavanich <korakot@iname.com> and
Apisilp Trunganont <apisilp@pantip.inet.co.th>
Copyright (C) 1998, 1999 by Pruet Boonma <pruet@eng.cmu.ac.th>
@@ -59,7 +64,7 @@
#define X L_MIDDLE
-int t_ctype[][TOT_LEVELS] = {
+static int t_ctype[][TOT_LEVELS] = {
/*0x00*/ { IGNORE, IGNORE, IGNORE, IGNORE, X },
/*0x01*/ { IGNORE, IGNORE, IGNORE, IGNORE, X },
/*0x02*/ { IGNORE, IGNORE, IGNORE, IGNORE, X },
@@ -319,7 +324,7 @@ int t_ctype[][TOT_LEVELS] = {
/*0xFF*/ { 255 /*IGNORE*/, IGNORE, IGNORE, IGNORE, X },
};
-uchar NEAR ctype_tis620[257] =
+static uchar NEAR ctype_tis620[257] =
{
0, /* For standard library */
32,32,32,32,32,32,32,32,32,40,40,40,40,40,32,32,
@@ -340,7 +345,7 @@ uchar NEAR ctype_tis620[257] =
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
};
-uchar NEAR to_lower_tis620[]=
+static uchar NEAR to_lower_tis620[]=
{
'\000','\001','\002','\003','\004','\005','\006','\007',
'\010','\011','\012','\013','\014','\015','\016','\017',
@@ -376,7 +381,7 @@ uchar NEAR to_lower_tis620[]=
(uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377',
};
-uchar NEAR to_upper_tis620[]=
+static uchar NEAR to_upper_tis620[]=
{
'\000','\001','\002','\003','\004','\005','\006','\007',
'\010','\011','\012','\013','\014','\015','\016','\017',
@@ -412,7 +417,7 @@ uchar NEAR to_upper_tis620[]=
(uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377',
};
-uchar NEAR sort_order_tis620[]=
+static uchar NEAR sort_order_tis620[]=
{
'\000','\001','\002','\003','\004','\005','\006','\007',
'\010','\011','\012','\013','\014','\015','\016','\017',
@@ -448,6 +453,7 @@ uchar NEAR sort_order_tis620[]=
(uchar) '\370',(uchar) '\371',(uchar) '\372',(uchar) '\373',(uchar) '\374',(uchar) '\375',(uchar) '\376',(uchar) '\377',
};
+
/*
Convert thai string to "Standard C String Function" sortable string
@@ -455,167 +461,190 @@ uchar NEAR sort_order_tis620[]=
thai2sortable()
tstr String to convert. Does not have to end with \0
len Length of tstr
- out_length Will contain length of sortable string
-
- NOTE
- We use only 3 levels (neglect capitalization).
-
- OPTIMIZE SUGGESTION
- Should be faster to alloc buffer in calling function.
-
- RETURN
- Pointer to sortable string. Should be freed with 'free'
*/
-static uchar *thai2sortable(const uchar *tstr, uint len, uint *out_length)
+static uint thai2sortable(uchar *tstr, uint len)
{
- const uchar *p= tstr;
- uchar *outBuf;
- uchar *pRight1, *pRight2, *pRight3;
- uchar *pLeft2, *pLeft3;
- uint bufSize;
- uint RightSize;
-
- bufSize= (uint) (len + 1) * BUFFER_MULTIPLY;
- RightSize= sizeof(uchar) * (len + 1);
- if (!(outBuf= pRight1=
- (uchar *)malloc(sizeof(uchar) * bufSize + RightSize*2)))
- {
- /*
- Can't allocate buffer; Use original string for sorting
- This is not perfect, but better than nothing...
- */
- *out_length= len;
- return (uchar*) tstr;
- }
- pLeft2= pRight2= pRight1 + sizeof(uchar) * bufSize;
- pLeft3= pRight3= pRight2 + RightSize;
+ uchar *p;
+ int tlen;
+ uchar l2bias;
- while ((int) --len > 0)
+ tlen= len;
+ l2bias= 256 - 8;
+ for (p= tstr; tlen > 0; p++, tlen--)
{
- int *t_ctype0= t_ctype[p[0]];
- if (isldvowel(*p) && isconsnt(p[1]))
+ uchar c= *p;
+
+ if (isthai(c))
{
- int *t_ctype1= t_ctype[p[1]];
- *pRight1++= t_ctype1[0];
- *pRight2++= t_ctype1[1];
- *pRight3++= t_ctype1[2];
- *pRight1++= t_ctype0[0];
- *pRight2++= t_ctype0[1];
- *pRight3++= t_ctype0[2];
- p+= 2;
- len--;
+ int *t_ctype0= t_ctype[c];
+
+ if (isconsnt(c))
+ l2bias -= 8;
+ if (isldvowel(c) && tlen != 1 && isconsnt(p[1]))
+ {
+ /* simply swap between leading-vowel and consonant */
+ *p= p[1];
+ p[1]= c;
+ tlen--;
+ p++;
+ continue;
+ }
+
+ /* if found level 2 char (L2_GARAN,L2_TONE*,L2_TYKHU) move to last */
+ if (t_ctype0[1] >= L2_GARAN)
+ {
+ /*
+ l2bias use to control position weight of l2char
+ example (*=l2char) XX*X must come before X*XX
+ */
+ memcpy_overlap(p, p+1, tlen-1);
+ tstr[len-1]= l2bias + t_ctype0[1]- L2_GARAN +1;
+ p--;
+ continue;
+ }
}
else
{
- *pRight1= t_ctype0[0];
- if(*pRight1 != IGNORE)
- pRight1++;
- *pRight2= t_ctype0[1];
- if (*pRight2 != IGNORE)
- pRight2++;
- *pRight3= t_ctype0[2];
- if(*pRight3 != IGNORE)
- pRight3++;
- p++;
+ l2bias-= 8;
+ *p= to_lower_tis620[c];
}
}
- if (!len) /* If last was not double byte */
- {
- int *t_ctype0= t_ctype[p[0]];
- if ((*pRight1= t_ctype0[0] != IGNORE))
- pRight1++;
- if ((*pRight2= t_ctype0[1]) != IGNORE)
- pRight2++;
- if ((*pRight3= t_ctype0[2]) != IGNORE)
- pRight3++;
- }
- *pRight1++= L2_BLANK;
- *pRight2++= L3_BLANK;
- *pRight3++= '\0';
- memcpy(pRight1, pLeft2, pRight2 - pLeft2);
- pRight1+= pRight2 - pLeft2;
- memcpy(pRight1, pLeft3, pRight3 - pLeft3);
- *out_length= (uint) ((pRight1+ (uint) (pRight3 - pLeft3)) - outBuf);
- return outBuf;
+ return len;
}
/*
- strncoll() replacement, compare 2 string, both are conveted to sortable
+ strncoll() replacement, compare 2 string, both are converted to sortable
string
+ NOTE:
+ We can't cut strings at end \0 as this would break comparision with
+ LIKE characters, where the min range is stored as end \0
+
Arg: 2 Strings and it compare length
Ret: strcmp result
*/
+static
int my_strnncoll_tis620(CHARSET_INFO *cs __attribute__((unused)),
const uchar * s1, uint len1,
const uchar * s2, uint len2)
{
+ uchar buf[80] ;
uchar *tc1, *tc2;
- uint tc1_length, tc2_length, length;
- int res;
-
- tc1= thai2sortable(s1, len1, &tc1_length);
- tc2= thai2sortable(s2, len2, &tc2_length);
- length= min(tc1_length, tc2_length);
-
- res= memcmp((char*)tc1, (char*) tc2, length);
- if (tc1 != s1)
+ int i;
+
+ tc1= buf;
+ if ((len1 + len2 +2) > (int) sizeof(buf))
+ tc1= (uchar*) malloc(len1+len2);
+ tc2= tc1 + len1+1;
+ memcpy((char*) tc1, (char*) s1, len1);
+ tc1[len1]= 0; /* if length(s1)> len1, need to put 'end of string' */
+ memcpy((char *)tc2, (char *)s2, len2);
+ tc2[len2]= 0; /* put end of string */
+ thai2sortable(tc1, len1);
+ thai2sortable(tc2, len2);
+ i= strcmp((char*)tc1, (char*)tc2);
+ if (tc1 != buf)
free(tc1);
- if (tc2 != s2)
- free(tc2);
- return (res || tc1_length == tc2_length ? res :
- (tc1_length < tc2_length ? -1 : 1));
+ return i;
}
static
-int my_strnncollsp_tis620(CHARSET_INFO * cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen)
+int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)),
+ const uchar *a0, uint a_length,
+ const uchar *b0, uint b_length)
{
- for ( ; slen && my_isspace(cs, s[slen-1]) ; slen--);
- for ( ; tlen && my_isspace(cs, t[tlen-1]) ; tlen--);
- return my_strnncoll_tis620(cs,s,slen,t,tlen);
+ uchar buf[80] ;
+ uchar *end, *a, *b;
+ uint length;
+ int res= 0;
+ int alloced= 0;
+
+ a= buf;
+ if ((a_length + b_length +2) > (int) sizeof(buf))
+ {
+ a= (uchar*) malloc(a_length+b_length);
+ alloced= 1;
+ }
+
+ b= a + a_length+1;
+ memcpy((char*) a, (char*) a0, a_length);
+ a[a_length]= 0; /* if length(a0)> len1, need to put 'end of string' */
+ memcpy((char *)b, (char *)b0, b_length);
+ b[b_length]= 0; /* put end of string */
+ a_length= thai2sortable(a, a_length);
+ b_length= thai2sortable(b, b_length);
+
+ end= a + (length= min(a_length, b_length));
+ while (a < end)
+ {
+ if (*a++ != *b++)
+ {
+ res= ((int) a[-1] - (int) b[-1]);
+ goto ret;
+ }
+ }
+ if (a_length != b_length)
+ {
+ int swap= 0;
+ /*
+ Check the next not space character of the longer key. If it's < ' ',
+ then it's smaller than the other key.
+ */
+ if (a_length < b_length)
+ {
+ /* put shorter key in s */
+ a_length= b_length;
+ a= b;
+ swap= -1; /* swap sign of result */
+ }
+ for (end= a + a_length-length; a < end ; a++)
+ {
+ if (*a != ' ')
+ {
+ res= ((int) *a - (int) ' ') ^ swap;
+ goto ret;
+ }
+ }
+ }
+
+ret:
+
+ if (alloced)
+ free(a);
+ return res;
}
-/* strnxfrm replacment, convert Thai string to sortable string
- Arg: Destination buffer, source string, dest length and source length
- Ret: Conveted string size
+/*
+ strnxfrm replacment, convert Thai string to sortable string
+
+ Arg: Destination buffer, source string, dest length and source length
+ Ret: Conveted string size
*/
+
+static
int my_strnxfrm_tis620(CHARSET_INFO *cs __attribute__((unused)),
uchar * dest, uint len,
const uchar * src, uint srclen)
{
- uint out_length;
- uchar *tmp= thai2sortable(src, srclen, &out_length);
-
- set_if_smaller(out_length, len);
- memcpy(dest, tmp, out_length);
- if (tmp != src)
- free(tmp);
- return (int) out_length;
+ len= (uint) (strmake((char*) dest, (char*) src, min(len, srclen)) -
+ (char*) dest);
+ return (int) thai2sortable(dest, len);
}
-/* strcoll replacment, compare 2 strings
- Arg: 2 strings
- Ret: memcmp result
-*/
-
-int my_strcoll_tis620(const uchar * s1, const uchar * s2)
-{
- return my_strnncoll_tis620((CHARSET_INFO *) 0, s1, strlen((char*) s1),
- s2, strlen((char*) s1));
-}
-
/*
Convert SQL LIKE string to C string
+ Arg: String, its length, escape character, resource length,
+ minimal string and maximum string
+ Ret: Always 0
+
IMPLEMENTATION
We just copy this function from opt_range.cc. No need to convert to
thai2sortable string. min_str and max_str will be use for comparison and
@@ -627,9 +656,10 @@ int my_strcoll_tis620(const uchar * s1, const uchar * s2)
#define max_sort_chr ((char) 255)
+static
my_bool my_like_range_tis620(CHARSET_INFO *cs __attribute__((unused)),
const char *ptr, uint ptr_length,
- int escape, int w_one, int w_many,
+ pbool escape, pbool w_one, pbool w_many,
uint res_length, char *min_str, char *max_str,
uint *min_length, uint *max_length)
{
@@ -655,8 +685,9 @@ my_bool my_like_range_tis620(CHARSET_INFO *cs __attribute__((unused)),
{
*min_length= (uint) (min_str - min_org);
*max_length=res_length;
- do {
- *min_str++ = ' '; /* For key compression */
+ do
+ {
+ *min_str++ = 0;
*max_str++ = max_sort_chr;
} while (min_str != min_end);
return 0;
@@ -666,40 +697,10 @@ my_bool my_like_range_tis620(CHARSET_INFO *cs __attribute__((unused)),
*min_length= *max_length = (uint) (min_str - min_org);
while (min_str != min_end)
- *min_str++ = *max_str++ = ' '; /* For key compression */
+ *min_str++ = *max_str++ = ' '; /* Because of key compression */
return 0;
}
-#ifdef NOT_NEEDED
-
-/*
- Thai normalization for input sub system
- Arg: Buffer, 's length, String, 'length
- Ret: Void
-*/
-
-void ThNormalize(uchar* ptr, uint field_length, const uchar* from, uint length)
-{
- const uchar* fr= from;
- uchar* p= ptr;
-
- if (length > field_length)
- length= field_length;
-
- while (length--)
- if ((istone(*fr) || isdiacrt1(*fr)) &&
- (islwrvowel(fr[1]) || isuprvowel(fr[1])))
- {
- *p= fr[1];
- p[1]= *fr;
- fr+= 2;
- p+= 2;
- length--;
- }
- else
- *p++ = *fr++;
-}
-#endif /* NOT_NEEDED */
static unsigned short cs_to_uni[256]={
0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,
@@ -911,7 +912,7 @@ static MY_COLLATION_HANDLER my_collation_ci_handler =
my_like_range_tis620,
my_wildcmp_8bit, /* wildcmp */
my_strcasecmp_8bit,
- NULL,
+ my_instr_simple, /* QQ: To be fixed */
my_hash_sort_simple,
};
@@ -921,7 +922,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
my_mbcharlen_8bit, /* mbcharlen */
my_numchars_8bit,
my_charpos_8bit,
- my_wellformedlen_8bit,
+ my_well_formed_len_8bit,
my_lengthsp_8bit,
my_mb_wc_tis620, /* mb_wc */
my_wc_mb_tis620, /* wc_mb */
@@ -961,7 +962,8 @@ CHARSET_INFO my_charset_tis620_thai_ci=
4, /* strxfrm_multiply */
1, /* mbminlen */
1, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0, /* max_sort_char */
&my_charset_handler,
&my_collation_ci_handler
};
@@ -984,7 +986,8 @@ CHARSET_INFO my_charset_tis620_bin=
1, /* strxfrm_multiply */
1, /* mbminlen */
1, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0, /* max_sort_char */
&my_charset_handler,
&my_collation_8bit_bin_handler
};
diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c
new file mode 100644
index 00000000000..ac805bf0a5a
--- /dev/null
+++ b/strings/ctype-uca.c
@@ -0,0 +1,7042 @@
+/* Copyright (C) 2004 MySQL AB
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA */
+
+/*
+ UCA (Unicode Collation Algorithm) support.
+ Written by Alexander Barkov <bar@mysql.com>
+
+ Currently supports only subset of the full UCA.
+
+ - Only Primary level key comparison
+ - Variable weighting is done for Non-ignorable option
+ - 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
+*/
+
+
+#include <my_global.h>
+#include "m_string.h"
+#include "m_ctype.h"
+
+
+#ifdef HAVE_CHARSET_ucs2
+
+#define MY_UCA_NPAGES 256
+#define MY_UCA_NCHARS 256
+#define MY_UCA_CMASK 255
+#define MY_UCA_PSHIFT 8
+
+uint16 page000data[]= { /* 0000 (4 weights per char) */
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0201,0x0000,0x0000,0x0000,
+0x0202,0x0000,0x0000,0x0000, 0x0203,0x0000,0x0000,0x0000,
+0x0204,0x0000,0x0000,0x0000, 0x0205,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000, 0x0251,0x0000,0x0000,0x0000,
+0x027E,0x0000,0x0000,0x0000, 0x02D2,0x0000,0x0000,0x0000,
+0x0E0F,0x0000,0x0000,0x0000, 0x02D3,0x0000,0x0000,0x0000,
+0x02CF,0x0000,0x0000,0x0000, 0x0277,0x0000,0x0000,0x0000,
+0x0288,0x0000,0x0000,0x0000, 0x0289,0x0000,0x0000,0x0000,
+0x02C8,0x0000,0x0000,0x0000, 0x0428,0x0000,0x0000,0x0000,
+0x022F,0x0000,0x0000,0x0000, 0x0221,0x0000,0x0000,0x0000,
+0x025D,0x0000,0x0000,0x0000, 0x02CC,0x0000,0x0000,0x0000,
+0x0E29,0x0000,0x0000,0x0000, 0x0E2A,0x0000,0x0000,0x0000,
+0x0E2B,0x0000,0x0000,0x0000, 0x0E2C,0x0000,0x0000,0x0000,
+0x0E2D,0x0000,0x0000,0x0000, 0x0E2E,0x0000,0x0000,0x0000,
+0x0E2F,0x0000,0x0000,0x0000, 0x0E30,0x0000,0x0000,0x0000,
+0x0E31,0x0000,0x0000,0x0000, 0x0E32,0x0000,0x0000,0x0000,
+0x023D,0x0000,0x0000,0x0000, 0x023A,0x0000,0x0000,0x0000,
+0x042C,0x0000,0x0000,0x0000, 0x042D,0x0000,0x0000,0x0000,
+0x042E,0x0000,0x0000,0x0000, 0x0255,0x0000,0x0000,0x0000,
+0x02C7,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000,
+0x0E4A,0x0000,0x0000,0x0000, 0x0E60,0x0000,0x0000,0x0000,
+0x0E6D,0x0000,0x0000,0x0000, 0x0E8B,0x0000,0x0000,0x0000,
+0x0EB9,0x0000,0x0000,0x0000, 0x0EC1,0x0000,0x0000,0x0000,
+0x0EE1,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000,
+0x0F10,0x0000,0x0000,0x0000, 0x0F21,0x0000,0x0000,0x0000,
+0x0F2E,0x0000,0x0000,0x0000, 0x0F5B,0x0000,0x0000,0x0000,
+0x0F64,0x0000,0x0000,0x0000, 0x0F82,0x0000,0x0000,0x0000,
+0x0FA7,0x0000,0x0000,0x0000, 0x0FB4,0x0000,0x0000,0x0000,
+0x0FC0,0x0000,0x0000,0x0000, 0x0FEA,0x0000,0x0000,0x0000,
+0x1002,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000,
+0x1044,0x0000,0x0000,0x0000, 0x1051,0x0000,0x0000,0x0000,
+0x105A,0x0000,0x0000,0x0000, 0x105E,0x0000,0x0000,0x0000,
+0x106A,0x0000,0x0000,0x0000, 0x028A,0x0000,0x0000,0x0000,
+0x02CE,0x0000,0x0000,0x0000, 0x028B,0x0000,0x0000,0x0000,
+0x020F,0x0000,0x0000,0x0000, 0x021B,0x0000,0x0000,0x0000,
+0x020C,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000,
+0x0E4A,0x0000,0x0000,0x0000, 0x0E60,0x0000,0x0000,0x0000,
+0x0E6D,0x0000,0x0000,0x0000, 0x0E8B,0x0000,0x0000,0x0000,
+0x0EB9,0x0000,0x0000,0x0000, 0x0EC1,0x0000,0x0000,0x0000,
+0x0EE1,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000,
+0x0F10,0x0000,0x0000,0x0000, 0x0F21,0x0000,0x0000,0x0000,
+0x0F2E,0x0000,0x0000,0x0000, 0x0F5B,0x0000,0x0000,0x0000,
+0x0F64,0x0000,0x0000,0x0000, 0x0F82,0x0000,0x0000,0x0000,
+0x0FA7,0x0000,0x0000,0x0000, 0x0FB4,0x0000,0x0000,0x0000,
+0x0FC0,0x0000,0x0000,0x0000, 0x0FEA,0x0000,0x0000,0x0000,
+0x1002,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000,
+0x1044,0x0000,0x0000,0x0000, 0x1051,0x0000,0x0000,0x0000,
+0x105A,0x0000,0x0000,0x0000, 0x105E,0x0000,0x0000,0x0000,
+0x106A,0x0000,0x0000,0x0000, 0x028C,0x0000,0x0000,0x0000,
+0x0430,0x0000,0x0000,0x0000, 0x028D,0x0000,0x0000,0x0000,
+0x0433,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0206,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000, 0x0252,0x0000,0x0000,0x0000,
+0x0E0E,0x0000,0x0000,0x0000, 0x0E10,0x0000,0x0000,0x0000,
+0x0E0D,0x0000,0x0000,0x0000, 0x0E11,0x0000,0x0000,0x0000,
+0x0431,0x0000,0x0000,0x0000, 0x02C2,0x0000,0x0000,0x0000,
+0x0214,0x0000,0x0000,0x0000, 0x02C5,0x0000,0x0000,0x0000,
+0x0E33,0x0000,0x0000,0x0000, 0x0286,0x0000,0x0000,0x0000,
+0x042F,0x0000,0x0000,0x0000, 0x0220,0x0000,0x0000,0x0000,
+0x02C6,0x0000,0x0000,0x0000, 0x0210,0x0000,0x0000,0x0000,
+0x034A,0x0000,0x0000,0x0000, 0x0429,0x0000,0x0000,0x0000,
+0x0E2B,0x0000,0x0000,0x0000, 0x0E2C,0x0000,0x0000,0x0000,
+0x020D,0x0000,0x0000,0x0000, 0x10F8,0x0000,0x0000,0x0000,
+0x02C3,0x0000,0x0000,0x0000, 0x0267,0x0000,0x0000,0x0000,
+0x0219,0x0000,0x0000,0x0000, 0x0E2A,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000, 0x0287,0x0000,0x0000,0x0000,
+0x0E2A,0x02CD,0x0E2D,0x0000, 0x0E2A,0x02CD,0x0E2B,0x0000,
+0x0E2C,0x02CD,0x0E2D,0x0000, 0x0256,0x0000,0x0000,0x0000,
+0x0E33,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000,
+0x0E33,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000,
+0x0E33,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000,
+0x0E38,0x0000,0x0000,0x0000, 0x0E60,0x0000,0x0000,0x0000,
+0x0E8B,0x0000,0x0000,0x0000, 0x0E8B,0x0000,0x0000,0x0000,
+0x0E8B,0x0000,0x0000,0x0000, 0x0E8B,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000,
+0x0E86,0x0000,0x0000,0x0000, 0x0F64,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000, 0x0F82,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000, 0x0F82,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000, 0x042B,0x0000,0x0000,0x0000,
+0x0F8D,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000,
+0x101F,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000,
+0x101F,0x0000,0x0000,0x0000, 0x105E,0x0000,0x0000,0x0000,
+0x1094,0x0000,0x0000,0x0000, 0x0FEA,0x0FEA,0x0000,0x0000,
+0x0E33,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000,
+0x0E33,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000,
+0x0E33,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000,
+0x0E38,0x0000,0x0000,0x0000, 0x0E60,0x0000,0x0000,0x0000,
+0x0E8B,0x0000,0x0000,0x0000, 0x0E8B,0x0000,0x0000,0x0000,
+0x0E8B,0x0000,0x0000,0x0000, 0x0E8B,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000,
+0x0E86,0x0000,0x0000,0x0000, 0x0F64,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000, 0x0F82,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000, 0x0F82,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000, 0x042A,0x0000,0x0000,0x0000,
+0x0F8D,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000,
+0x101F,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000,
+0x101F,0x0000,0x0000,0x0000, 0x105E,0x0000,0x0000,0x0000,
+0x1094,0x0000,0x0000,0x0000, 0x105E,0x0000,0x0000,0x0000
+};
+
+uint16 page001data[]= { /* 0100 (3 weights per char) */
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E60,0x0000,0x0000, 0x0E60,0x0000,0x0000, 0x0E60,0x0000,0x0000,
+0x0E60,0x0000,0x0000, 0x0E60,0x0000,0x0000, 0x0E60,0x0000,0x0000,
+0x0E60,0x0000,0x0000, 0x0E60,0x0000,0x0000, 0x0E6D,0x0000,0x0000,
+0x0E6D,0x0000,0x0000, 0x0E72,0x0000,0x0000, 0x0E72,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0EC1,0x0000,0x0000, 0x0EC1,0x0000,0x0000,
+0x0EC1,0x0000,0x0000, 0x0EC1,0x0000,0x0000, 0x0EC1,0x0000,0x0000,
+0x0EC1,0x0000,0x0000, 0x0EC1,0x0000,0x0000, 0x0EC1,0x0000,0x0000,
+0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EED,0x0000,0x0000,
+0x0EED,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0EFB,0x0000,0x0000, 0x0EFF,0x0000,0x0000, 0x0EFB,0x0F10,0x0000,
+0x0EFB,0x0F10,0x0000, 0x0F10,0x0000,0x0000, 0x0F10,0x0000,0x0000,
+0x0F21,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0FBC,0x0000,0x0000,
+0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000,
+0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000,
+0x0F2E,0x0267,0x0000, 0x0F2E,0x0267,0x0000, 0x0F36,0x0000,0x0000,
+0x0F36,0x0000,0x0000, 0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000,
+0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000,
+0x0F64,0x0000,0x0000, 0x10B1,0x0F64,0x0000, 0x0F7E,0x0000,0x0000,
+0x0F7E,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0E8B,0x0000, 0x0F82,0x0E8B,0x0000,
+0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000,
+0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000,
+0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000,
+0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000,
+0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x1002,0x0000,0x0000,
+0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000,
+0x1007,0x0000,0x0000, 0x1007,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x1051,0x0000,0x0000,
+0x1051,0x0000,0x0000, 0x105E,0x0000,0x0000, 0x105E,0x0000,0x0000,
+0x105E,0x0000,0x0000, 0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000,
+0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000,
+0x106A,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x0E52,0x0000,0x0000,
+0x0E58,0x0000,0x0000, 0x0E5C,0x0000,0x0000, 0x0E5C,0x0000,0x0000,
+0x10A8,0x0000,0x0000, 0x10A8,0x0000,0x0000, 0x0F92,0x0000,0x0000,
+0x0E65,0x0000,0x0000, 0x0E65,0x0000,0x0000, 0x0E76,0x0000,0x0000,
+0x0E7A,0x0000,0x0000, 0x0E7E,0x0000,0x0000, 0x0E7E,0x0000,0x0000,
+0x106A,0x1051,0x0000, 0x0E90,0x0000,0x0000, 0x0E94,0x0000,0x0000,
+0x0E98,0x0000,0x0000, 0x0EBD,0x0000,0x0000, 0x0EBD,0x0000,0x0000,
+0x0ED1,0x0000,0x0000, 0x0ED9,0x0000,0x0000, 0x0EE9,0x0000,0x0000,
+0x0F0C,0x0000,0x0000, 0x0F08,0x0000,0x0000, 0x0F26,0x0000,0x0000,
+0x0F26,0x0000,0x0000, 0x0F3B,0x0000,0x0000, 0x0F53,0x0000,0x0000,
+0x1037,0x0000,0x0000, 0x0F6E,0x0000,0x0000, 0x0F72,0x0000,0x0000,
+0x0F9A,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0EDD,0x0000,0x0000, 0x0EDD,0x0000,0x0000, 0x0FAC,0x0000,0x0000,
+0x0FAC,0x0000,0x0000, 0x0FC4,0x0000,0x0000, 0x10A0,0x0000,0x0000,
+0x10A0,0x0000,0x0000, 0x0FF2,0x0000,0x0000, 0x0FF6,0x0000,0x0000,
+0x100B,0x0000,0x0000, 0x100F,0x0000,0x0000, 0x100F,0x0000,0x0000,
+0x1013,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x1040,0x0000,0x0000, 0x1049,0x0000,0x0000, 0x1066,0x0000,0x0000,
+0x1066,0x0000,0x0000, 0x106F,0x0000,0x0000, 0x106F,0x0000,0x0000,
+0x107F,0x0000,0x0000, 0x1084,0x0000,0x0000, 0x1084,0x0000,0x0000,
+0x1088,0x0000,0x0000, 0x109C,0x0000,0x0000, 0x10A4,0x0000,0x0000,
+0x10A4,0x0000,0x0000, 0x1002,0x0FEA,0x0000, 0x1098,0x0000,0x0000,
+0x10C8,0x0000,0x0000, 0x10CC,0x0000,0x0000, 0x10D0,0x0000,0x0000,
+0x10D4,0x0000,0x0000, 0x0E6D,0x106A,0x0000, 0x0E6D,0x106A,0x0000,
+0x0E6D,0x106A,0x0000, 0x0F2E,0x0F10,0x0000, 0x0F2E,0x0F10,0x0000,
+0x0F2E,0x0F10,0x0000, 0x0F64,0x0F10,0x0000, 0x0F64,0x0F10,0x0000,
+0x0F64,0x0F10,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x0E90,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E38,0x0000,0x0000, 0x0E38,0x0000,0x0000,
+0x0ECD,0x0000,0x0000, 0x0ECD,0x0000,0x0000, 0x0EC1,0x0000,0x0000,
+0x0EC1,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0F21,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x107F,0x0000,0x0000, 0x107F,0x0000,0x0000,
+0x0F10,0x0000,0x0000, 0x0E6D,0x106A,0x0000, 0x0E6D,0x106A,0x0000,
+0x0E6D,0x106A,0x0000, 0x0EC1,0x0000,0x0000, 0x0EC1,0x0000,0x0000,
+0x0EE9,0x0000,0x0000, 0x1098,0x0000,0x0000, 0x0F64,0x0000,0x0000,
+0x0F64,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E38,0x0000,0x0000, 0x0E38,0x0000,0x0000, 0x0F8D,0x0000,0x0000,
+0x0F8D,0x0000,0x0000 };
+
+uint16 page002data[]= { /* 0200 (3 weights per char) */
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000,
+0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x1002,0x0000,0x0000,
+0x1002,0x0000,0x0000, 0x1090,0x0000,0x0000, 0x1090,0x0000,0x0000,
+0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0F72,0x0000,0x0000,
+0x0E82,0x0000,0x0000, 0x0FA2,0x0000,0x0000, 0x0FA2,0x0000,0x0000,
+0x1073,0x0000,0x0000, 0x1073,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x105E,0x0000,0x0000,
+0x105E,0x0000,0x0000, 0x0F4B,0x0000,0x0000, 0x0F7A,0x0000,0x0000,
+0x1017,0x0000,0x0000, 0xFBC0,0x8237,0x0000, 0xFBC0,0x8238,0x0000,
+0xFBC0,0x8239,0x0000, 0xFBC0,0x823A,0x0000, 0xFBC0,0x823B,0x0000,
+0xFBC0,0x823C,0x0000, 0xFBC0,0x823D,0x0000, 0xFBC0,0x823E,0x0000,
+0xFBC0,0x823F,0x0000, 0xFBC0,0x8240,0x0000, 0xFBC0,0x8241,0x0000,
+0xFBC0,0x8242,0x0000, 0xFBC0,0x8243,0x0000, 0xFBC0,0x8244,0x0000,
+0xFBC0,0x8245,0x0000, 0xFBC0,0x8246,0x0000, 0xFBC0,0x8247,0x0000,
+0xFBC0,0x8248,0x0000, 0xFBC0,0x8249,0x0000, 0xFBC0,0x824A,0x0000,
+0xFBC0,0x824B,0x0000, 0xFBC0,0x824C,0x0000, 0xFBC0,0x824D,0x0000,
+0xFBC0,0x824E,0x0000, 0xFBC0,0x824F,0x0000, 0x0E3E,0x0000,0x0000,
+0x0E42,0x0000,0x0000, 0x0E46,0x0000,0x0000, 0x0E58,0x0000,0x0000,
+0x0F92,0x0000,0x0000, 0x0E69,0x0000,0x0000, 0x0E76,0x0000,0x0000,
+0x0E7A,0x0000,0x0000, 0x0E9C,0x0000,0x0000, 0x0E94,0x0000,0x0000,
+0x0EA0,0x0000,0x0000, 0x0E98,0x0000,0x0000, 0x0EA4,0x0000,0x0000,
+0x0EA9,0x0000,0x0000, 0x0EAD,0x0000,0x0000, 0x0F19,0x0000,0x0000,
+0x0ED1,0x0000,0x0000, 0x0EC5,0x0000,0x0000, 0x0EC9,0x0000,0x0000,
+0x0ED9,0x0000,0x0000, 0x0EB5,0x0000,0x0000, 0x102B,0x0000,0x0000,
+0x0EF1,0x0000,0x0000, 0x0EF5,0x0000,0x0000, 0x0F08,0x0000,0x0000,
+0x0F0C,0x0000,0x0000, 0x0F03,0x0000,0x0000, 0x0F3F,0x0000,0x0000,
+0x0F43,0x0000,0x0000, 0x0F47,0x0000,0x0000, 0x0F4F,0x0000,0x0000,
+0x1037,0x0000,0x0000, 0x103C,0x0000,0x0000, 0x0F60,0x0000,0x0000,
+0x0F6E,0x0000,0x0000, 0x0F76,0x0000,0x0000, 0x0F68,0x0000,0x0000,
+0x0F9A,0x0000,0x0000, 0x0F88,0x0000,0x0000, 0x0F9E,0x0000,0x0000,
+0x0FB0,0x0000,0x0000, 0x0FC9,0x0000,0x0000, 0x0FCE,0x0000,0x0000,
+0x0FD2,0x0000,0x0000, 0x0FD6,0x0000,0x0000, 0x0FDA,0x0000,0x0000,
+0x0FDE,0x0000,0x0000, 0x0FE2,0x0000,0x0000, 0x0FC4,0x0000,0x0000,
+0x0FE6,0x0000,0x0000, 0x0FEE,0x0000,0x0000, 0x0FF2,0x0000,0x0000,
+0x0F1D,0x0000,0x0000, 0x0FFA,0x0000,0x0000, 0x0FFE,0x0000,0x0000,
+0x101B,0x0000,0x0000, 0x1013,0x0000,0x0000, 0x1027,0x0000,0x0000,
+0x1040,0x0000,0x0000, 0x1049,0x0000,0x0000, 0x104D,0x0000,0x0000,
+0x1056,0x0000,0x0000, 0x0F57,0x0000,0x0000, 0x1062,0x0000,0x0000,
+0x1077,0x0000,0x0000, 0x107B,0x0000,0x0000, 0x107F,0x0000,0x0000,
+0x108C,0x0000,0x0000, 0x10AC,0x0000,0x0000, 0x10B4,0x0000,0x0000,
+0x10C4,0x0000,0x0000, 0x10D8,0x0000,0x0000, 0x10DC,0x0000,0x0000,
+0x0E4E,0x0000,0x0000, 0x0EB1,0x0000,0x0000, 0x0ED5,0x0000,0x0000,
+0x0EE5,0x0000,0x0000, 0x0F15,0x0000,0x0000, 0x0F2A,0x0000,0x0000,
+0x0F32,0x0000,0x0000, 0x0FB8,0x0000,0x0000, 0x10BC,0x0000,0x0000,
+0x10C0,0x0000,0x0000, 0x0E6D,0x106A,0x0000, 0x0E6D,0x107F,0x0000,
+0x0E6D,0x107B,0x0000, 0x1002,0x0FEA,0x0000, 0x1002,0x0FF2,0x0000,
+0x1002,0x0E69,0x0000, 0x0EB9,0x0F7E,0x0000, 0x0F2E,0x0FEA,0x0000,
+0x0F2E,0x106A,0x0000, 0x10E0,0x0000,0x0000, 0x10E4,0x0000,0x0000,
+0x102F,0x0000,0x0000, 0x1033,0x0000,0x0000, 0x0EE1,0x0000,0x0000,
+0x0EF1,0x0000,0x0000, 0x0F10,0x0000,0x0000, 0x0FC0,0x0000,0x0000,
+0x0FC9,0x0000,0x0000, 0x0FD2,0x0000,0x0000, 0x0FE6,0x0000,0x0000,
+0x1051,0x0000,0x0000, 0x105E,0x0000,0x0000, 0x0317,0x0000,0x0000,
+0x0319,0x0000,0x0000, 0x0EF9,0x0000,0x0000, 0x10B1,0x0000,0x0000,
+0x0EFA,0x0000,0x0000, 0x10B3,0x0000,0x0000, 0x10B8,0x0000,0x0000,
+0x10B0,0x0000,0x0000, 0x10B9,0x0000,0x0000, 0x031A,0x0000,0x0000,
+0x031B,0x0000,0x0000, 0x031C,0x0000,0x0000, 0x031D,0x0000,0x0000,
+0x031E,0x0000,0x0000, 0x031F,0x0000,0x0000, 0x0320,0x0000,0x0000,
+0x0321,0x0000,0x0000, 0x0322,0x0000,0x0000, 0x0323,0x0000,0x0000,
+0x0324,0x0000,0x0000, 0x0325,0x0000,0x0000, 0x0326,0x0000,0x0000,
+0x0327,0x0000,0x0000, 0x0E01,0x0000,0x0000, 0x0E02,0x0000,0x0000,
+0x0328,0x0000,0x0000, 0x0329,0x0000,0x0000, 0x032A,0x0000,0x0000,
+0x032B,0x0000,0x0000, 0x032C,0x0000,0x0000, 0x032D,0x0000,0x0000,
+0x0212,0x0000,0x0000, 0x0213,0x0000,0x0000, 0x0215,0x0000,0x0000,
+0x021A,0x0000,0x0000, 0x020E,0x0000,0x0000, 0x0216,0x0000,0x0000,
+0x032E,0x0000,0x0000, 0x032F,0x0000,0x0000, 0x0ED9,0x0000,0x0000,
+0x0F2E,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x105A,0x0000,0x0000,
+0x10B4,0x0000,0x0000, 0x0330,0x0000,0x0000, 0x0331,0x0000,0x0000,
+0x0332,0x0000,0x0000, 0x0333,0x0000,0x0000, 0x0334,0x0000,0x0000,
+0x0335,0x0000,0x0000, 0x0336,0x0000,0x0000, 0x0337,0x0000,0x0000,
+0x0338,0x0000,0x0000, 0x10B2,0x0000,0x0000, 0x0339,0x0000,0x0000,
+0x033A,0x0000,0x0000, 0x033B,0x0000,0x0000, 0x033C,0x0000,0x0000,
+0x033D,0x0000,0x0000, 0x033E,0x0000,0x0000, 0x033F,0x0000,0x0000,
+0x0340,0x0000,0x0000, 0x0341,0x0000,0x0000, 0x0342,0x0000,0x0000,
+0x0343,0x0000,0x0000, 0x0344,0x0000,0x0000, 0x0345,0x0000,0x0000,
+0x0346,0x0000,0x0000, 0x0347,0x0000,0x0000, 0x0348,0x0000,0x0000,
+0x0349,0x0000,0x0000 };
+
+uint16 page003data[]= { /* 0300 (4 weights per char) */
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0x8358,0x0000,0x0000, 0xFBC0,0x8359,0x0000,0x0000,
+0xFBC0,0x835A,0x0000,0x0000, 0xFBC0,0x835B,0x0000,0x0000,
+0xFBC0,0x835C,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x0E33,0x0000,0x0000,0x0000,
+0x0E8B,0x0000,0x0000,0x0000, 0x0EFB,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000, 0x101F,0x0000,0x0000,0x0000,
+0x0E60,0x0000,0x0000,0x0000, 0x0E6D,0x0000,0x0000,0x0000,
+0x0EE1,0x0000,0x0000,0x0000, 0x0F5B,0x0000,0x0000,0x0000,
+0x0FC0,0x0000,0x0000,0x0000, 0x1002,0x0000,0x0000,0x0000,
+0x1044,0x0000,0x0000,0x0000, 0x105A,0x0000,0x0000,0x0000,
+0xFBC0,0x8370,0x0000,0x0000, 0xFBC0,0x8371,0x0000,0x0000,
+0xFBC0,0x8372,0x0000,0x0000, 0xFBC0,0x8373,0x0000,0x0000,
+0x0317,0x0000,0x0000,0x0000, 0x0318,0x0000,0x0000,0x0000,
+0xFBC0,0x8376,0x0000,0x0000, 0xFBC0,0x8377,0x0000,0x0000,
+0xFBC0,0x8378,0x0000,0x0000, 0xFBC0,0x8379,0x0000,0x0000,
+0x10F3,0x0000,0x0000,0x0000, 0xFBC0,0x837B,0x0000,0x0000,
+0xFBC0,0x837C,0x0000,0x0000, 0xFBC0,0x837D,0x0000,0x0000,
+0x023A,0x0000,0x0000,0x0000, 0xFBC0,0x837F,0x0000,0x0000,
+0xFBC0,0x8380,0x0000,0x0000, 0xFBC0,0x8381,0x0000,0x0000,
+0xFBC0,0x8382,0x0000,0x0000, 0xFBC0,0x8383,0x0000,0x0000,
+0x020D,0x0000,0x0000,0x0000, 0x0214,0x0000,0x0000,0x0000,
+0x10E8,0x0000,0x0000,0x0000, 0x0267,0x0000,0x0000,0x0000,
+0x10ED,0x0000,0x0000,0x0000, 0x10F1,0x0000,0x0000,0x0000,
+0x10F3,0x0000,0x0000,0x0000, 0xFBC0,0x838B,0x0000,0x0000,
+0x10FB,0x0000,0x0000,0x0000, 0xFBC0,0x838D,0x0000,0x0000,
+0x1104,0x0000,0x0000,0x0000, 0x1109,0x0000,0x0000,0x0000,
+0x10F3,0x0000,0x0000,0x0000, 0x10E8,0x0000,0x0000,0x0000,
+0x10E9,0x0000,0x0000,0x0000, 0x10EA,0x0000,0x0000,0x0000,
+0x10EC,0x0000,0x0000,0x0000, 0x10ED,0x0000,0x0000,0x0000,
+0x10F0,0x0000,0x0000,0x0000, 0x10F1,0x0000,0x0000,0x0000,
+0x10F2,0x0000,0x0000,0x0000, 0x10F3,0x0000,0x0000,0x0000,
+0x10F5,0x0000,0x0000,0x0000, 0x10F6,0x0000,0x0000,0x0000,
+0x10F8,0x0000,0x0000,0x0000, 0x10F9,0x0000,0x0000,0x0000,
+0x10FA,0x0000,0x0000,0x0000, 0x10FB,0x0000,0x0000,0x0000,
+0x10FC,0x0000,0x0000,0x0000, 0x1100,0x0000,0x0000,0x0000,
+0xFBC0,0x83A2,0x0000,0x0000, 0x1102,0x0000,0x0000,0x0000,
+0x1103,0x0000,0x0000,0x0000, 0x1104,0x0000,0x0000,0x0000,
+0x1105,0x0000,0x0000,0x0000, 0x1106,0x0000,0x0000,0x0000,
+0x1107,0x0000,0x0000,0x0000, 0x1109,0x0000,0x0000,0x0000,
+0x10F3,0x0000,0x0000,0x0000, 0x1104,0x0000,0x0000,0x0000,
+0x10E8,0x0000,0x0000,0x0000, 0x10ED,0x0000,0x0000,0x0000,
+0x10F1,0x0000,0x0000,0x0000, 0x10F3,0x0000,0x0000,0x0000,
+0x1104,0x0000,0x0000,0x0000, 0x10E8,0x0000,0x0000,0x0000,
+0x10E9,0x0000,0x0000,0x0000, 0x10EA,0x0000,0x0000,0x0000,
+0x10EC,0x0000,0x0000,0x0000, 0x10ED,0x0000,0x0000,0x0000,
+0x10F0,0x0000,0x0000,0x0000, 0x10F1,0x0000,0x0000,0x0000,
+0x10F2,0x0000,0x0000,0x0000, 0x10F3,0x0000,0x0000,0x0000,
+0x10F5,0x0000,0x0000,0x0000, 0x10F6,0x0000,0x0000,0x0000,
+0x10F8,0x0000,0x0000,0x0000, 0x10F9,0x0000,0x0000,0x0000,
+0x10FA,0x0000,0x0000,0x0000, 0x10FB,0x0000,0x0000,0x0000,
+0x10FC,0x0000,0x0000,0x0000, 0x1100,0x0000,0x0000,0x0000,
+0x1102,0x0000,0x0000,0x0000, 0x1102,0x0000,0x0000,0x0000,
+0x1103,0x0000,0x0000,0x0000, 0x1104,0x0000,0x0000,0x0000,
+0x1105,0x0000,0x0000,0x0000, 0x1106,0x0000,0x0000,0x0000,
+0x1107,0x0000,0x0000,0x0000, 0x1109,0x0000,0x0000,0x0000,
+0x10F3,0x0000,0x0000,0x0000, 0x1104,0x0000,0x0000,0x0000,
+0x10FB,0x0000,0x0000,0x0000, 0x1104,0x0000,0x0000,0x0000,
+0x1109,0x0000,0x0000,0x0000, 0xFBC0,0x83CF,0x0000,0x0000,
+0x10E9,0x0000,0x0000,0x0000, 0x10F2,0x0000,0x0000,0x0000,
+0x1104,0x0000,0x0000,0x0000, 0x1104,0x0000,0x0000,0x0000,
+0x1104,0x0000,0x0000,0x0000, 0x1105,0x0000,0x0000,0x0000,
+0x10FC,0x0000,0x0000,0x0000, 0x10F5,0x10E8,0x10F3,0x0000,
+0x10FF,0x0000,0x0000,0x0000, 0x10FF,0x0000,0x0000,0x0000,
+0x10EF,0x0000,0x0000,0x0000, 0x10EF,0x0000,0x0000,0x0000,
+0x10EE,0x0000,0x0000,0x0000, 0x10EE,0x0000,0x0000,0x0000,
+0x10FE,0x0000,0x0000,0x0000, 0x10FE,0x0000,0x0000,0x0000,
+0x110A,0x0000,0x0000,0x0000, 0x110A,0x0000,0x0000,0x0000,
+0x110D,0x0000,0x0000,0x0000, 0x110D,0x0000,0x0000,0x0000,
+0x110E,0x0000,0x0000,0x0000, 0x110E,0x0000,0x0000,0x0000,
+0x110F,0x0000,0x0000,0x0000, 0x110F,0x0000,0x0000,0x0000,
+0x1110,0x0000,0x0000,0x0000, 0x1110,0x0000,0x0000,0x0000,
+0x1111,0x0000,0x0000,0x0000, 0x1111,0x0000,0x0000,0x0000,
+0x1112,0x0000,0x0000,0x0000, 0x1112,0x0000,0x0000,0x0000,
+0x1113,0x0000,0x0000,0x0000, 0x1113,0x0000,0x0000,0x0000,
+0x10F5,0x0000,0x0000,0x0000, 0x1100,0x0000,0x0000,0x0000,
+0x1102,0x0000,0x0000,0x0000, 0x10F4,0x0000,0x0000,0x0000,
+0x10F2,0x0000,0x0000,0x0000, 0x10ED,0x0000,0x0000,0x0000,
+0x0423,0x0000,0x0000,0x0000, 0x110B,0x0000,0x0000,0x0000,
+0x110B,0x0000,0x0000,0x0000, 0x1102,0x0000,0x0000,0x0000,
+0x110C,0x0000,0x0000,0x0000, 0x110C,0x0000,0x0000,0x0000,
+0xFBC0,0x83FC,0x0000,0x0000, 0xFBC0,0x83FD,0x0000,0x0000,
+0xFBC0,0x83FE,0x0000,0x0000, 0xFBC0,0x83FF,0x0000,0x0000
+};
+
+uint16 page004data[]= { /* 0400 (3 weights per char) */
+0x1152,0x0000,0x0000, 0x1152,0x0000,0x0000, 0x1145,0x0000,0x0000,
+0x114A,0x0000,0x0000, 0x115A,0x0000,0x0000, 0x1173,0x0000,0x0000,
+0x1188,0x0000,0x0000, 0x118C,0x0000,0x0000, 0x1194,0x0000,0x0000,
+0x11B9,0x0000,0x0000, 0x11DA,0x0000,0x0000, 0x1215,0x0000,0x0000,
+0x1219,0x0000,0x0000, 0x117C,0x0000,0x0000, 0x1221,0x0000,0x0000,
+0x127D,0x0000,0x0000, 0x1114,0x0000,0x0000, 0x112C,0x0000,0x0000,
+0x1130,0x0000,0x0000, 0x1134,0x0000,0x0000, 0x1140,0x0000,0x0000,
+0x1152,0x0000,0x0000, 0x115E,0x0000,0x0000, 0x116A,0x0000,0x0000,
+0x117C,0x0000,0x0000, 0x1190,0x0000,0x0000, 0x1198,0x0000,0x0000,
+0x11B0,0x0000,0x0000, 0x11BE,0x0000,0x0000, 0x11C6,0x0000,0x0000,
+0x11DF,0x0000,0x0000, 0x11EF,0x0000,0x0000, 0x11FB,0x0000,0x0000,
+0x1203,0x0000,0x0000, 0x120C,0x0000,0x0000, 0x121D,0x0000,0x0000,
+0x1239,0x0000,0x0000, 0x123D,0x0000,0x0000, 0x1259,0x0000,0x0000,
+0x1261,0x0000,0x0000, 0x1281,0x0000,0x0000, 0x1285,0x0000,0x0000,
+0x1289,0x0000,0x0000, 0x128D,0x0000,0x0000, 0x1295,0x0000,0x0000,
+0x12A1,0x0000,0x0000, 0x12A9,0x0000,0x0000, 0x12AD,0x0000,0x0000,
+0x1114,0x0000,0x0000, 0x112C,0x0000,0x0000, 0x1130,0x0000,0x0000,
+0x1134,0x0000,0x0000, 0x1140,0x0000,0x0000, 0x1152,0x0000,0x0000,
+0x115E,0x0000,0x0000, 0x116A,0x0000,0x0000, 0x117C,0x0000,0x0000,
+0x1190,0x0000,0x0000, 0x1198,0x0000,0x0000, 0x11B0,0x0000,0x0000,
+0x11BE,0x0000,0x0000, 0x11C6,0x0000,0x0000, 0x11DF,0x0000,0x0000,
+0x11EF,0x0000,0x0000, 0x11FB,0x0000,0x0000, 0x1203,0x0000,0x0000,
+0x120C,0x0000,0x0000, 0x121D,0x0000,0x0000, 0x1239,0x0000,0x0000,
+0x123D,0x0000,0x0000, 0x1259,0x0000,0x0000, 0x1261,0x0000,0x0000,
+0x1281,0x0000,0x0000, 0x1285,0x0000,0x0000, 0x1289,0x0000,0x0000,
+0x128D,0x0000,0x0000, 0x1295,0x0000,0x0000, 0x12A1,0x0000,0x0000,
+0x12A9,0x0000,0x0000, 0x12AD,0x0000,0x0000, 0x1152,0x0000,0x0000,
+0x1152,0x0000,0x0000, 0x1145,0x0000,0x0000, 0x114A,0x0000,0x0000,
+0x115A,0x0000,0x0000, 0x1173,0x0000,0x0000, 0x1188,0x0000,0x0000,
+0x118C,0x0000,0x0000, 0x1194,0x0000,0x0000, 0x11B9,0x0000,0x0000,
+0x11DA,0x0000,0x0000, 0x1215,0x0000,0x0000, 0x1219,0x0000,0x0000,
+0x117C,0x0000,0x0000, 0x1221,0x0000,0x0000, 0x127D,0x0000,0x0000,
+0x1249,0x0000,0x0000, 0x1249,0x0000,0x0000, 0x129D,0x0000,0x0000,
+0x129D,0x0000,0x0000, 0x12B1,0x0000,0x0000, 0x12B1,0x0000,0x0000,
+0x12B5,0x0000,0x0000, 0x12B5,0x0000,0x0000, 0x12BD,0x0000,0x0000,
+0x12BD,0x0000,0x0000, 0x12B9,0x0000,0x0000, 0x12B9,0x0000,0x0000,
+0x12C1,0x0000,0x0000, 0x12C1,0x0000,0x0000, 0x12C5,0x0000,0x0000,
+0x12C5,0x0000,0x0000, 0x12C9,0x0000,0x0000, 0x12C9,0x0000,0x0000,
+0x12CD,0x0000,0x0000, 0x12CD,0x0000,0x0000, 0x12D1,0x0000,0x0000,
+0x12D1,0x0000,0x0000, 0x12D5,0x0000,0x0000, 0x12D5,0x0000,0x0000,
+0x1235,0x0000,0x0000, 0x1235,0x0000,0x0000, 0x1255,0x0000,0x0000,
+0x1255,0x0000,0x0000, 0x1251,0x0000,0x0000, 0x1251,0x0000,0x0000,
+0x124D,0x0000,0x0000, 0x124D,0x0000,0x0000, 0x11F7,0x0000,0x0000,
+0x11F7,0x0000,0x0000, 0x034B,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x8487,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x1180,0x0000,0x0000, 0x1180,0x0000,0x0000, 0x1299,0x0000,0x0000,
+0x1299,0x0000,0x0000, 0x11FF,0x0000,0x0000, 0x11FF,0x0000,0x0000,
+0x1134,0x0000,0x0000, 0x1134,0x0000,0x0000, 0x1138,0x0000,0x0000,
+0x1138,0x0000,0x0000, 0x113C,0x0000,0x0000, 0x113C,0x0000,0x0000,
+0x1166,0x0000,0x0000, 0x1166,0x0000,0x0000, 0x114E,0x0000,0x0000,
+0x114E,0x0000,0x0000, 0x119C,0x0000,0x0000, 0x119C,0x0000,0x0000,
+0x11AC,0x0000,0x0000, 0x11AC,0x0000,0x0000, 0x11A8,0x0000,0x0000,
+0x11A8,0x0000,0x0000, 0x11A4,0x0000,0x0000, 0x11A4,0x0000,0x0000,
+0x11CE,0x0000,0x0000, 0x11CE,0x0000,0x0000, 0x11D6,0x0000,0x0000,
+0x11D6,0x0000,0x0000, 0x11F3,0x0000,0x0000, 0x11F3,0x0000,0x0000,
+0x12D9,0x0000,0x0000, 0x12D9,0x0000,0x0000, 0x1208,0x0000,0x0000,
+0x1208,0x0000,0x0000, 0x1211,0x0000,0x0000, 0x1211,0x0000,0x0000,
+0x122D,0x0000,0x0000, 0x122D,0x0000,0x0000, 0x1231,0x0000,0x0000,
+0x1231,0x0000,0x0000, 0x1241,0x0000,0x0000, 0x1241,0x0000,0x0000,
+0x125D,0x0000,0x0000, 0x125D,0x0000,0x0000, 0x1269,0x0000,0x0000,
+0x1269,0x0000,0x0000, 0x1271,0x0000,0x0000, 0x1271,0x0000,0x0000,
+0x1245,0x0000,0x0000, 0x1245,0x0000,0x0000, 0x1275,0x0000,0x0000,
+0x1275,0x0000,0x0000, 0x1279,0x0000,0x0000, 0x1279,0x0000,0x0000,
+0x12DD,0x0000,0x0000, 0x115E,0x0000,0x0000, 0x115E,0x0000,0x0000,
+0x11A0,0x0000,0x0000, 0x11A0,0x0000,0x0000, 0x11B5,0x0000,0x0000,
+0x11B5,0x0000,0x0000, 0x11D2,0x0000,0x0000, 0x11D2,0x0000,0x0000,
+0x11CA,0x0000,0x0000, 0x11CA,0x0000,0x0000, 0x126D,0x0000,0x0000,
+0x126D,0x0000,0x0000, 0x11C2,0x0000,0x0000, 0x11C2,0x0000,0x0000,
+0xFBC0,0x84CF,0x0000, 0x1118,0x0000,0x0000, 0x1118,0x0000,0x0000,
+0x111C,0x0000,0x0000, 0x111C,0x0000,0x0000, 0x1128,0x0000,0x0000,
+0x1128,0x0000,0x0000, 0x1156,0x0000,0x0000, 0x1156,0x0000,0x0000,
+0x1120,0x0000,0x0000, 0x1120,0x0000,0x0000, 0x1124,0x0000,0x0000,
+0x1124,0x0000,0x0000, 0x1162,0x0000,0x0000, 0x1162,0x0000,0x0000,
+0x116F,0x0000,0x0000, 0x116F,0x0000,0x0000, 0x1177,0x0000,0x0000,
+0x1177,0x0000,0x0000, 0x117C,0x0000,0x0000, 0x117C,0x0000,0x0000,
+0x1184,0x0000,0x0000, 0x1184,0x0000,0x0000, 0x11E3,0x0000,0x0000,
+0x11E3,0x0000,0x0000, 0x11E7,0x0000,0x0000, 0x11E7,0x0000,0x0000,
+0x11EB,0x0000,0x0000, 0x11EB,0x0000,0x0000, 0x12A5,0x0000,0x0000,
+0x12A5,0x0000,0x0000, 0x121D,0x0000,0x0000, 0x121D,0x0000,0x0000,
+0x1225,0x0000,0x0000, 0x1225,0x0000,0x0000, 0x1229,0x0000,0x0000,
+0x1229,0x0000,0x0000, 0x1265,0x0000,0x0000, 0x1265,0x0000,0x0000,
+0xFBC0,0x84F6,0x0000, 0xFBC0,0x84F7,0x0000, 0x1291,0x0000,0x0000,
+0x1291,0x0000,0x0000, 0xFBC0,0x84FA,0x0000, 0xFBC0,0x84FB,0x0000,
+0xFBC0,0x84FC,0x0000, 0xFBC0,0x84FD,0x0000, 0xFBC0,0x84FE,0x0000,
+0xFBC0,0x84FF,0x0000 };
+
+uint16 page005data[]= { /* 0500 (3 weights per char) */
+0x1144,0x0000,0x0000, 0x1144,0x0000,0x0000, 0x1149,0x0000,0x0000,
+0x1149,0x0000,0x0000, 0x116E,0x0000,0x0000, 0x116E,0x0000,0x0000,
+0x117B,0x0000,0x0000, 0x117B,0x0000,0x0000, 0x11BD,0x0000,0x0000,
+0x11BD,0x0000,0x0000, 0x11DE,0x0000,0x0000, 0x11DE,0x0000,0x0000,
+0x1207,0x0000,0x0000, 0x1207,0x0000,0x0000, 0x1210,0x0000,0x0000,
+0x1210,0x0000,0x0000, 0xFBC0,0x8510,0x0000, 0xFBC0,0x8511,0x0000,
+0xFBC0,0x8512,0x0000, 0xFBC0,0x8513,0x0000, 0xFBC0,0x8514,0x0000,
+0xFBC0,0x8515,0x0000, 0xFBC0,0x8516,0x0000, 0xFBC0,0x8517,0x0000,
+0xFBC0,0x8518,0x0000, 0xFBC0,0x8519,0x0000, 0xFBC0,0x851A,0x0000,
+0xFBC0,0x851B,0x0000, 0xFBC0,0x851C,0x0000, 0xFBC0,0x851D,0x0000,
+0xFBC0,0x851E,0x0000, 0xFBC0,0x851F,0x0000, 0xFBC0,0x8520,0x0000,
+0xFBC0,0x8521,0x0000, 0xFBC0,0x8522,0x0000, 0xFBC0,0x8523,0x0000,
+0xFBC0,0x8524,0x0000, 0xFBC0,0x8525,0x0000, 0xFBC0,0x8526,0x0000,
+0xFBC0,0x8527,0x0000, 0xFBC0,0x8528,0x0000, 0xFBC0,0x8529,0x0000,
+0xFBC0,0x852A,0x0000, 0xFBC0,0x852B,0x0000, 0xFBC0,0x852C,0x0000,
+0xFBC0,0x852D,0x0000, 0xFBC0,0x852E,0x0000, 0xFBC0,0x852F,0x0000,
+0xFBC0,0x8530,0x0000, 0x130A,0x0000,0x0000, 0x130B,0x0000,0x0000,
+0x130C,0x0000,0x0000, 0x130D,0x0000,0x0000, 0x130E,0x0000,0x0000,
+0x130F,0x0000,0x0000, 0x1310,0x0000,0x0000, 0x1311,0x0000,0x0000,
+0x1312,0x0000,0x0000, 0x1313,0x0000,0x0000, 0x1314,0x0000,0x0000,
+0x1315,0x0000,0x0000, 0x1316,0x0000,0x0000, 0x1317,0x0000,0x0000,
+0x1318,0x0000,0x0000, 0x1319,0x0000,0x0000, 0x131A,0x0000,0x0000,
+0x131B,0x0000,0x0000, 0x131C,0x0000,0x0000, 0x131D,0x0000,0x0000,
+0x131E,0x0000,0x0000, 0x131F,0x0000,0x0000, 0x1320,0x0000,0x0000,
+0x1321,0x0000,0x0000, 0x1322,0x0000,0x0000, 0x1323,0x0000,0x0000,
+0x1324,0x0000,0x0000, 0x1325,0x0000,0x0000, 0x1326,0x0000,0x0000,
+0x1327,0x0000,0x0000, 0x1328,0x0000,0x0000, 0x1329,0x0000,0x0000,
+0x132A,0x0000,0x0000, 0x132B,0x0000,0x0000, 0x132C,0x0000,0x0000,
+0x132D,0x0000,0x0000, 0x132E,0x0000,0x0000, 0x132F,0x0000,0x0000,
+0xFBC0,0x8557,0x0000, 0xFBC0,0x8558,0x0000, 0x1330,0x0000,0x0000,
+0x02EC,0x0000,0x0000, 0x02ED,0x0000,0x0000, 0x0253,0x0000,0x0000,
+0x0230,0x0000,0x0000, 0x0257,0x0000,0x0000, 0x02EE,0x0000,0x0000,
+0xFBC0,0x8560,0x0000, 0x130A,0x0000,0x0000, 0x130B,0x0000,0x0000,
+0x130C,0x0000,0x0000, 0x130D,0x0000,0x0000, 0x130E,0x0000,0x0000,
+0x130F,0x0000,0x0000, 0x1310,0x0000,0x0000, 0x1311,0x0000,0x0000,
+0x1312,0x0000,0x0000, 0x1313,0x0000,0x0000, 0x1314,0x0000,0x0000,
+0x1315,0x0000,0x0000, 0x1316,0x0000,0x0000, 0x1317,0x0000,0x0000,
+0x1318,0x0000,0x0000, 0x1319,0x0000,0x0000, 0x131A,0x0000,0x0000,
+0x131B,0x0000,0x0000, 0x131C,0x0000,0x0000, 0x131D,0x0000,0x0000,
+0x131E,0x0000,0x0000, 0x131F,0x0000,0x0000, 0x1320,0x0000,0x0000,
+0x1321,0x0000,0x0000, 0x1322,0x0000,0x0000, 0x1323,0x0000,0x0000,
+0x1324,0x0000,0x0000, 0x1325,0x0000,0x0000, 0x1326,0x0000,0x0000,
+0x1327,0x0000,0x0000, 0x1328,0x0000,0x0000, 0x1329,0x0000,0x0000,
+0x132A,0x0000,0x0000, 0x132B,0x0000,0x0000, 0x132C,0x0000,0x0000,
+0x132D,0x0000,0x0000, 0x132E,0x0000,0x0000, 0x132F,0x0000,0x0000,
+0x130E,0x132B,0x0000, 0xFBC0,0x8588,0x0000, 0x023E,0x0000,0x0000,
+0x0222,0x0000,0x0000, 0xFBC0,0x858B,0x0000, 0xFBC0,0x858C,0x0000,
+0xFBC0,0x858D,0x0000, 0xFBC0,0x858E,0x0000, 0xFBC0,0x858F,0x0000,
+0xFBC0,0x8590,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x85A2,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x85BA,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x02EF,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x02F0,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x02F1,0x0000,0x0000, 0x0000,0x0000,0x0000, 0xFBC0,0x85C5,0x0000,
+0xFBC0,0x85C6,0x0000, 0xFBC0,0x85C7,0x0000, 0xFBC0,0x85C8,0x0000,
+0xFBC0,0x85C9,0x0000, 0xFBC0,0x85CA,0x0000, 0xFBC0,0x85CB,0x0000,
+0xFBC0,0x85CC,0x0000, 0xFBC0,0x85CD,0x0000, 0xFBC0,0x85CE,0x0000,
+0xFBC0,0x85CF,0x0000, 0x1331,0x0000,0x0000, 0x1332,0x0000,0x0000,
+0x1333,0x0000,0x0000, 0x1334,0x0000,0x0000, 0x1335,0x0000,0x0000,
+0x1336,0x0000,0x0000, 0x1337,0x0000,0x0000, 0x1338,0x0000,0x0000,
+0x1339,0x0000,0x0000, 0x133A,0x0000,0x0000, 0x133B,0x0000,0x0000,
+0x133B,0x0000,0x0000, 0x133C,0x0000,0x0000, 0x133D,0x0000,0x0000,
+0x133D,0x0000,0x0000, 0x133E,0x0000,0x0000, 0x133E,0x0000,0x0000,
+0x133F,0x0000,0x0000, 0x1340,0x0000,0x0000, 0x1341,0x0000,0x0000,
+0x1341,0x0000,0x0000, 0x1342,0x0000,0x0000, 0x1342,0x0000,0x0000,
+0x1343,0x0000,0x0000, 0x1344,0x0000,0x0000, 0x1345,0x0000,0x0000,
+0x1346,0x0000,0x0000, 0xFBC0,0x85EB,0x0000, 0xFBC0,0x85EC,0x0000,
+0xFBC0,0x85ED,0x0000, 0xFBC0,0x85EE,0x0000, 0xFBC0,0x85EF,0x0000,
+0x1336,0x1336,0x0000, 0x1336,0x133A,0x0000, 0x133A,0x133A,0x0000,
+0x02F2,0x0000,0x0000, 0x02F3,0x0000,0x0000, 0xFBC0,0x85F5,0x0000,
+0xFBC0,0x85F6,0x0000, 0xFBC0,0x85F7,0x0000, 0xFBC0,0x85F8,0x0000,
+0xFBC0,0x85F9,0x0000, 0xFBC0,0x85FA,0x0000, 0xFBC0,0x85FB,0x0000,
+0xFBC0,0x85FC,0x0000, 0xFBC0,0x85FD,0x0000, 0xFBC0,0x85FE,0x0000,
+0xFBC0,0x85FF,0x0000 };
+
+uint16 page006data[]= { /* 0600 (3 weights per char) */
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0xFBC0,0x8604,0x0000, 0xFBC0,0x8605,0x0000,
+0xFBC0,0x8606,0x0000, 0xFBC0,0x8607,0x0000, 0xFBC0,0x8608,0x0000,
+0xFBC0,0x8609,0x0000, 0xFBC0,0x860A,0x0000, 0xFBC0,0x860B,0x0000,
+0x0231,0x0000,0x0000, 0x0232,0x0000,0x0000, 0x034C,0x0000,0x0000,
+0x034D,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0xFBC0,0x8616,0x0000, 0xFBC0,0x8617,0x0000,
+0xFBC0,0x8618,0x0000, 0xFBC0,0x8619,0x0000, 0xFBC0,0x861A,0x0000,
+0x023B,0x0000,0x0000, 0xFBC0,0x861C,0x0000, 0xFBC0,0x861D,0x0000,
+0xFBC0,0x861E,0x0000, 0x0258,0x0000,0x0000, 0xFBC0,0x8620,0x0000,
+0x1347,0x0000,0x0000, 0x1348,0x0000,0x0000, 0x1349,0x0000,0x0000,
+0x134C,0x0000,0x0000, 0x134D,0x0000,0x0000, 0x134F,0x0000,0x0000,
+0x1350,0x0000,0x0000, 0x1352,0x0000,0x0000, 0x1356,0x0000,0x0000,
+0x1357,0x0000,0x0000, 0x1358,0x0000,0x0000, 0x135E,0x0000,0x0000,
+0x1364,0x0000,0x0000, 0x1365,0x0000,0x0000, 0x1369,0x0000,0x0000,
+0x136A,0x0000,0x0000, 0x1375,0x0000,0x0000, 0x1376,0x0000,0x0000,
+0x1381,0x0000,0x0000, 0x1382,0x0000,0x0000, 0x1387,0x0000,0x0000,
+0x1388,0x0000,0x0000, 0x138C,0x0000,0x0000, 0x138D,0x0000,0x0000,
+0x138F,0x0000,0x0000, 0x1390,0x0000,0x0000, 0xFBC0,0x863B,0x0000,
+0xFBC0,0x863C,0x0000, 0xFBC0,0x863D,0x0000, 0xFBC0,0x863E,0x0000,
+0xFBC0,0x863F,0x0000, 0x020B,0x0000,0x0000, 0x1393,0x0000,0x0000,
+0x139B,0x0000,0x0000, 0x139E,0x0000,0x0000, 0x13AB,0x0000,0x0000,
+0x13B0,0x0000,0x0000, 0x13B1,0x0000,0x0000, 0x13B7,0x0000,0x0000,
+0x13BD,0x0000,0x0000, 0x13C7,0x0000,0x0000, 0x13C8,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0xFBC0,0x8659,0x0000,
+0xFBC0,0x865A,0x0000, 0xFBC0,0x865B,0x0000, 0xFBC0,0x865C,0x0000,
+0xFBC0,0x865D,0x0000, 0xFBC0,0x865E,0x0000, 0xFBC0,0x865F,0x0000,
+0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000,
+0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000,
+0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000,
+0x0E32,0x0000,0x0000, 0x02D4,0x0000,0x0000, 0x0233,0x0000,0x0000,
+0x0234,0x0000,0x0000, 0x02CB,0x0000,0x0000, 0x1351,0x0000,0x0000,
+0x139A,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x134B,0x0000,0x0000,
+0x134A,0x0000,0x0000, 0x134E,0x0000,0x0000, 0x1347,0x0000,0x0000,
+0x1350,0x1347,0x0000, 0x13BD,0x1347,0x0000, 0x13C1,0x1347,0x0000,
+0x13C8,0x1347,0x0000, 0x1359,0x0000,0x0000, 0x135A,0x0000,0x0000,
+0x1353,0x0000,0x0000, 0x135B,0x0000,0x0000, 0x135C,0x0000,0x0000,
+0x1354,0x0000,0x0000, 0x135D,0x0000,0x0000, 0x1355,0x0000,0x0000,
+0x1366,0x0000,0x0000, 0x1367,0x0000,0x0000, 0x135F,0x0000,0x0000,
+0x1360,0x0000,0x0000, 0x1368,0x0000,0x0000, 0x1361,0x0000,0x0000,
+0x1363,0x0000,0x0000, 0x136B,0x0000,0x0000, 0x136C,0x0000,0x0000,
+0x136D,0x0000,0x0000, 0x136E,0x0000,0x0000, 0x136F,0x0000,0x0000,
+0x1370,0x0000,0x0000, 0x1371,0x0000,0x0000, 0x1372,0x0000,0x0000,
+0x1373,0x0000,0x0000, 0x1377,0x0000,0x0000, 0x1378,0x0000,0x0000,
+0x1379,0x0000,0x0000, 0x137A,0x0000,0x0000, 0x137B,0x0000,0x0000,
+0x137C,0x0000,0x0000, 0x137D,0x0000,0x0000, 0x137E,0x0000,0x0000,
+0x137F,0x0000,0x0000, 0x1383,0x0000,0x0000, 0x1384,0x0000,0x0000,
+0x1385,0x0000,0x0000, 0x1389,0x0000,0x0000, 0x138A,0x0000,0x0000,
+0x138E,0x0000,0x0000, 0x1391,0x0000,0x0000, 0x1394,0x0000,0x0000,
+0x1395,0x0000,0x0000, 0x1396,0x0000,0x0000, 0x1397,0x0000,0x0000,
+0x1398,0x0000,0x0000, 0x1399,0x0000,0x0000, 0x139C,0x0000,0x0000,
+0x139D,0x0000,0x0000, 0x139F,0x0000,0x0000, 0x13A0,0x0000,0x0000,
+0x13A1,0x0000,0x0000, 0x13A2,0x0000,0x0000, 0x13A3,0x0000,0x0000,
+0x13A4,0x0000,0x0000, 0x13A5,0x0000,0x0000, 0x13A6,0x0000,0x0000,
+0x13A7,0x0000,0x0000, 0x13A8,0x0000,0x0000, 0x13A9,0x0000,0x0000,
+0x13AA,0x0000,0x0000, 0x13AC,0x0000,0x0000, 0x13AD,0x0000,0x0000,
+0x13AE,0x0000,0x0000, 0x13AF,0x0000,0x0000, 0x13B6,0x0000,0x0000,
+0x13B2,0x0000,0x0000, 0x13B3,0x0000,0x0000, 0x13B4,0x0000,0x0000,
+0x13B5,0x0000,0x0000, 0x13B8,0x0000,0x0000, 0x1362,0x0000,0x0000,
+0x13BC,0x0000,0x0000, 0x13B9,0x0000,0x0000, 0x13B9,0x0000,0x0000,
+0x13BA,0x0000,0x0000, 0x13BE,0x0000,0x0000, 0x13BF,0x0000,0x0000,
+0x13C0,0x0000,0x0000, 0x13C1,0x0000,0x0000, 0x13C2,0x0000,0x0000,
+0x13C3,0x0000,0x0000, 0x13C4,0x0000,0x0000, 0x13C5,0x0000,0x0000,
+0x13C9,0x0000,0x0000, 0x13CA,0x0000,0x0000, 0x13CB,0x0000,0x0000,
+0x13C6,0x0000,0x0000, 0x13CC,0x0000,0x0000, 0x13CD,0x0000,0x0000,
+0x13CE,0x0000,0x0000, 0x13CE,0x0000,0x0000, 0x025F,0x0000,0x0000,
+0x13BC,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x13BD,0x0000,0x0000, 0x13C8,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x034E,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x1374,0x0000,0x0000, 0x1380,0x0000,0x0000,
+0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000,
+0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000,
+0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000,
+0x0E32,0x0000,0x0000, 0x1386,0x0000,0x0000, 0x138B,0x0000,0x0000,
+0x1392,0x0000,0x0000, 0x1347,0x0000,0x0000, 0x13B0,0x0000,0x0000,
+0x13BB,0x0000,0x0000 };
+
+uint16 page007data[]= { /* 0700 (3 weights per char) */
+0x0270,0x0000,0x0000, 0x0260,0x0000,0x0000, 0x0261,0x0000,0x0000,
+0x023F,0x0000,0x0000, 0x0240,0x0000,0x0000, 0x0241,0x0000,0x0000,
+0x0242,0x0000,0x0000, 0x0243,0x0000,0x0000, 0x0244,0x0000,0x0000,
+0x0259,0x0000,0x0000, 0x02F4,0x0000,0x0000, 0x02F5,0x0000,0x0000,
+0x02F6,0x0000,0x0000, 0x02F7,0x0000,0x0000, 0xFBC0,0x870E,0x0000,
+0x0000,0x0000,0x0000, 0x13CF,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x13D0,0x0000,0x0000, 0x13D1,0x0000,0x0000, 0x13D1,0x0000,0x0000,
+0x13D3,0x0000,0x0000, 0x13D2,0x0000,0x0000, 0x13D4,0x0000,0x0000,
+0x13D5,0x0000,0x0000, 0x13D6,0x0000,0x0000, 0x13D8,0x0000,0x0000,
+0x13D9,0x0000,0x0000, 0x13D9,0x0000,0x0000, 0x13DA,0x0000,0x0000,
+0x13DB,0x0000,0x0000, 0x13DC,0x0000,0x0000, 0x13DE,0x0000,0x0000,
+0x13DF,0x0000,0x0000, 0x13E0,0x0000,0x0000, 0x13E1,0x0000,0x0000,
+0x13E1,0x0000,0x0000, 0x13E2,0x0000,0x0000, 0x13E3,0x0000,0x0000,
+0x13E3,0x0000,0x0000, 0x13E5,0x0000,0x0000, 0x13E6,0x0000,0x0000,
+0x13E7,0x0000,0x0000, 0x13E8,0x0000,0x0000, 0x13E9,0x0000,0x0000,
+0x13D0,0x0000,0x0000, 0x13D1,0x0000,0x0000, 0x13D3,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x874B,0x0000, 0xFBC0,0x874C,0x0000, 0x13D7,0x0000,0x0000,
+0x13DD,0x0000,0x0000, 0x13E4,0x0000,0x0000, 0xFBC0,0x8750,0x0000,
+0xFBC0,0x8751,0x0000, 0xFBC0,0x8752,0x0000, 0xFBC0,0x8753,0x0000,
+0xFBC0,0x8754,0x0000, 0xFBC0,0x8755,0x0000, 0xFBC0,0x8756,0x0000,
+0xFBC0,0x8757,0x0000, 0xFBC0,0x8758,0x0000, 0xFBC0,0x8759,0x0000,
+0xFBC0,0x875A,0x0000, 0xFBC0,0x875B,0x0000, 0xFBC0,0x875C,0x0000,
+0xFBC0,0x875D,0x0000, 0xFBC0,0x875E,0x0000, 0xFBC0,0x875F,0x0000,
+0xFBC0,0x8760,0x0000, 0xFBC0,0x8761,0x0000, 0xFBC0,0x8762,0x0000,
+0xFBC0,0x8763,0x0000, 0xFBC0,0x8764,0x0000, 0xFBC0,0x8765,0x0000,
+0xFBC0,0x8766,0x0000, 0xFBC0,0x8767,0x0000, 0xFBC0,0x8768,0x0000,
+0xFBC0,0x8769,0x0000, 0xFBC0,0x876A,0x0000, 0xFBC0,0x876B,0x0000,
+0xFBC0,0x876C,0x0000, 0xFBC0,0x876D,0x0000, 0xFBC0,0x876E,0x0000,
+0xFBC0,0x876F,0x0000, 0xFBC0,0x8770,0x0000, 0xFBC0,0x8771,0x0000,
+0xFBC0,0x8772,0x0000, 0xFBC0,0x8773,0x0000, 0xFBC0,0x8774,0x0000,
+0xFBC0,0x8775,0x0000, 0xFBC0,0x8776,0x0000, 0xFBC0,0x8777,0x0000,
+0xFBC0,0x8778,0x0000, 0xFBC0,0x8779,0x0000, 0xFBC0,0x877A,0x0000,
+0xFBC0,0x877B,0x0000, 0xFBC0,0x877C,0x0000, 0xFBC0,0x877D,0x0000,
+0xFBC0,0x877E,0x0000, 0xFBC0,0x877F,0x0000, 0x13EA,0x0000,0x0000,
+0x13ED,0x0000,0x0000, 0x13EE,0x0000,0x0000, 0x13EF,0x0000,0x0000,
+0x13F1,0x0000,0x0000, 0x13F2,0x0000,0x0000, 0x13F3,0x0000,0x0000,
+0x13F4,0x0000,0x0000, 0x13F7,0x0000,0x0000, 0x13F9,0x0000,0x0000,
+0x13FA,0x0000,0x0000, 0x13FB,0x0000,0x0000, 0x13FD,0x0000,0x0000,
+0x1401,0x0000,0x0000, 0x1402,0x0000,0x0000, 0x1404,0x0000,0x0000,
+0x1405,0x0000,0x0000, 0x1409,0x0000,0x0000, 0x140A,0x0000,0x0000,
+0x140B,0x0000,0x0000, 0x140C,0x0000,0x0000, 0x140D,0x0000,0x0000,
+0x140E,0x0000,0x0000, 0x140F,0x0000,0x0000, 0x13FE,0x0000,0x0000,
+0x13EB,0x0000,0x0000, 0x13EC,0x0000,0x0000, 0x13FC,0x0000,0x0000,
+0x13F0,0x0000,0x0000, 0x1406,0x0000,0x0000, 0x1407,0x0000,0x0000,
+0x1408,0x0000,0x0000, 0x13FF,0x0000,0x0000, 0x1400,0x0000,0x0000,
+0x13F5,0x0000,0x0000, 0x13F6,0x0000,0x0000, 0x1403,0x0000,0x0000,
+0x13F8,0x0000,0x0000, 0x1411,0x0000,0x0000, 0x1412,0x0000,0x0000,
+0x1413,0x0000,0x0000, 0x1414,0x0000,0x0000, 0x1415,0x0000,0x0000,
+0x1416,0x0000,0x0000, 0x1417,0x0000,0x0000, 0x1418,0x0000,0x0000,
+0x1419,0x0000,0x0000, 0x141A,0x0000,0x0000, 0x141B,0x0000,0x0000,
+0x1410,0x0000,0x0000, 0xFBC0,0x87B2,0x0000, 0xFBC0,0x87B3,0x0000,
+0xFBC0,0x87B4,0x0000, 0xFBC0,0x87B5,0x0000, 0xFBC0,0x87B6,0x0000,
+0xFBC0,0x87B7,0x0000, 0xFBC0,0x87B8,0x0000, 0xFBC0,0x87B9,0x0000,
+0xFBC0,0x87BA,0x0000, 0xFBC0,0x87BB,0x0000, 0xFBC0,0x87BC,0x0000,
+0xFBC0,0x87BD,0x0000, 0xFBC0,0x87BE,0x0000, 0xFBC0,0x87BF,0x0000,
+0xFBC0,0x87C0,0x0000, 0xFBC0,0x87C1,0x0000, 0xFBC0,0x87C2,0x0000,
+0xFBC0,0x87C3,0x0000, 0xFBC0,0x87C4,0x0000, 0xFBC0,0x87C5,0x0000,
+0xFBC0,0x87C6,0x0000, 0xFBC0,0x87C7,0x0000, 0xFBC0,0x87C8,0x0000,
+0xFBC0,0x87C9,0x0000, 0xFBC0,0x87CA,0x0000, 0xFBC0,0x87CB,0x0000,
+0xFBC0,0x87CC,0x0000, 0xFBC0,0x87CD,0x0000, 0xFBC0,0x87CE,0x0000,
+0xFBC0,0x87CF,0x0000, 0xFBC0,0x87D0,0x0000, 0xFBC0,0x87D1,0x0000,
+0xFBC0,0x87D2,0x0000, 0xFBC0,0x87D3,0x0000, 0xFBC0,0x87D4,0x0000,
+0xFBC0,0x87D5,0x0000, 0xFBC0,0x87D6,0x0000, 0xFBC0,0x87D7,0x0000,
+0xFBC0,0x87D8,0x0000, 0xFBC0,0x87D9,0x0000, 0xFBC0,0x87DA,0x0000,
+0xFBC0,0x87DB,0x0000, 0xFBC0,0x87DC,0x0000, 0xFBC0,0x87DD,0x0000,
+0xFBC0,0x87DE,0x0000, 0xFBC0,0x87DF,0x0000, 0xFBC0,0x87E0,0x0000,
+0xFBC0,0x87E1,0x0000, 0xFBC0,0x87E2,0x0000, 0xFBC0,0x87E3,0x0000,
+0xFBC0,0x87E4,0x0000, 0xFBC0,0x87E5,0x0000, 0xFBC0,0x87E6,0x0000,
+0xFBC0,0x87E7,0x0000, 0xFBC0,0x87E8,0x0000, 0xFBC0,0x87E9,0x0000,
+0xFBC0,0x87EA,0x0000, 0xFBC0,0x87EB,0x0000, 0xFBC0,0x87EC,0x0000,
+0xFBC0,0x87ED,0x0000, 0xFBC0,0x87EE,0x0000, 0xFBC0,0x87EF,0x0000,
+0xFBC0,0x87F0,0x0000, 0xFBC0,0x87F1,0x0000, 0xFBC0,0x87F2,0x0000,
+0xFBC0,0x87F3,0x0000, 0xFBC0,0x87F4,0x0000, 0xFBC0,0x87F5,0x0000,
+0xFBC0,0x87F6,0x0000, 0xFBC0,0x87F7,0x0000, 0xFBC0,0x87F8,0x0000,
+0xFBC0,0x87F9,0x0000, 0xFBC0,0x87FA,0x0000, 0xFBC0,0x87FB,0x0000,
+0xFBC0,0x87FC,0x0000, 0xFBC0,0x87FD,0x0000, 0xFBC0,0x87FE,0x0000,
+0xFBC0,0x87FF,0x0000 };
+
+uint16 page009data[]= { /* 0900 (3 weights per char) */
+0xFBC0,0x8900,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x155A,0x0000,0x0000, 0x155B,0x0000,0x0000,
+0x155C,0x0000,0x0000, 0x155D,0x0000,0x0000, 0x155E,0x0000,0x0000,
+0x155F,0x0000,0x0000, 0x1560,0x0000,0x0000, 0x1561,0x0000,0x0000,
+0x1563,0x0000,0x0000, 0x1565,0x0000,0x0000, 0x1566,0x0000,0x0000,
+0x1567,0x0000,0x0000, 0x1568,0x0000,0x0000, 0x1569,0x0000,0x0000,
+0x156A,0x0000,0x0000, 0x156B,0x0000,0x0000, 0x156C,0x0000,0x0000,
+0x156D,0x0000,0x0000, 0x156E,0x0000,0x0000, 0x156F,0x0000,0x0000,
+0x1570,0x0000,0x0000, 0x1571,0x0000,0x0000, 0x1572,0x0000,0x0000,
+0x1573,0x0000,0x0000, 0x1574,0x0000,0x0000, 0x1575,0x0000,0x0000,
+0x1576,0x0000,0x0000, 0x1577,0x0000,0x0000, 0x1578,0x0000,0x0000,
+0x1579,0x0000,0x0000, 0x157A,0x0000,0x0000, 0x157B,0x0000,0x0000,
+0x157C,0x0000,0x0000, 0x157D,0x0000,0x0000, 0x157E,0x0000,0x0000,
+0x157F,0x0000,0x0000, 0x1580,0x0000,0x0000, 0x1580,0x0000,0x0000,
+0x1581,0x0000,0x0000, 0x1582,0x0000,0x0000, 0x1583,0x0000,0x0000,
+0x1584,0x0000,0x0000, 0x1585,0x0000,0x0000, 0x1586,0x0000,0x0000,
+0x1587,0x0000,0x0000, 0x1587,0x0000,0x0000, 0x1588,0x0000,0x0000,
+0x1589,0x0000,0x0000, 0x1589,0x0000,0x0000, 0x158A,0x0000,0x0000,
+0x158B,0x0000,0x0000, 0x158C,0x0000,0x0000, 0x158D,0x0000,0x0000,
+0x158E,0x0000,0x0000, 0xFBC0,0x893A,0x0000, 0xFBC0,0x893B,0x0000,
+0x0000,0x0000,0x0000, 0x158F,0x0000,0x0000, 0x1590,0x0000,0x0000,
+0x1591,0x0000,0x0000, 0x1592,0x0000,0x0000, 0x1593,0x0000,0x0000,
+0x1594,0x0000,0x0000, 0x1595,0x0000,0x0000, 0x1596,0x0000,0x0000,
+0x1599,0x0000,0x0000, 0x159A,0x0000,0x0000, 0x159B,0x0000,0x0000,
+0x159C,0x0000,0x0000, 0x159D,0x0000,0x0000, 0x159E,0x0000,0x0000,
+0x159F,0x0000,0x0000, 0x15A0,0x0000,0x0000, 0x15A1,0x0000,0x0000,
+0xFBC0,0x894E,0x0000, 0xFBC0,0x894F,0x0000, 0x1559,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0xFBC0,0x8955,0x0000, 0xFBC0,0x8956,0x0000,
+0xFBC0,0x8957,0x0000, 0x156D,0x0000,0x0000, 0x156E,0x0000,0x0000,
+0x156F,0x0000,0x0000, 0x1574,0x0000,0x0000, 0x1579,0x0000,0x0000,
+0x157A,0x0000,0x0000, 0x1582,0x0000,0x0000, 0x1586,0x0000,0x0000,
+0x1562,0x0000,0x0000, 0x1564,0x0000,0x0000, 0x1597,0x0000,0x0000,
+0x1598,0x0000,0x0000, 0x0268,0x0000,0x0000, 0x0269,0x0000,0x0000,
+0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000,
+0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000,
+0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000,
+0x0E32,0x0000,0x0000, 0x02FA,0x0000,0x0000, 0xFBC0,0x8971,0x0000,
+0xFBC0,0x8972,0x0000, 0xFBC0,0x8973,0x0000, 0xFBC0,0x8974,0x0000,
+0xFBC0,0x8975,0x0000, 0xFBC0,0x8976,0x0000, 0xFBC0,0x8977,0x0000,
+0xFBC0,0x8978,0x0000, 0xFBC0,0x8979,0x0000, 0xFBC0,0x897A,0x0000,
+0xFBC0,0x897B,0x0000, 0xFBC0,0x897C,0x0000, 0xFBC0,0x897D,0x0000,
+0xFBC0,0x897E,0x0000, 0xFBC0,0x897F,0x0000, 0xFBC0,0x8980,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x8984,0x0000, 0x15A2,0x0000,0x0000, 0x15A3,0x0000,0x0000,
+0x15A4,0x0000,0x0000, 0x15A5,0x0000,0x0000, 0x15A6,0x0000,0x0000,
+0x15A7,0x0000,0x0000, 0x15A8,0x0000,0x0000, 0x15AA,0x0000,0x0000,
+0xFBC0,0x898D,0x0000, 0xFBC0,0x898E,0x0000, 0x15AC,0x0000,0x0000,
+0x15AD,0x0000,0x0000, 0xFBC0,0x8991,0x0000, 0xFBC0,0x8992,0x0000,
+0x15AE,0x0000,0x0000, 0x15AF,0x0000,0x0000, 0x15B0,0x0000,0x0000,
+0x15B1,0x0000,0x0000, 0x15B2,0x0000,0x0000, 0x15B3,0x0000,0x0000,
+0x15B4,0x0000,0x0000, 0x15B5,0x0000,0x0000, 0x15B6,0x0000,0x0000,
+0x15B7,0x0000,0x0000, 0x15B8,0x0000,0x0000, 0x15B9,0x0000,0x0000,
+0x15BA,0x0000,0x0000, 0x15BB,0x0000,0x0000, 0x15BC,0x0000,0x0000,
+0x15BD,0x0000,0x0000, 0x15BE,0x0000,0x0000, 0x15BF,0x0000,0x0000,
+0x15C0,0x0000,0x0000, 0x15C1,0x0000,0x0000, 0x15C2,0x0000,0x0000,
+0x15C3,0x0000,0x0000, 0xFBC0,0x89A9,0x0000, 0x15C4,0x0000,0x0000,
+0x15C5,0x0000,0x0000, 0x15C6,0x0000,0x0000, 0x15C7,0x0000,0x0000,
+0x15C8,0x0000,0x0000, 0x15C9,0x0000,0x0000, 0x15CA,0x0000,0x0000,
+0xFBC0,0x89B1,0x0000, 0x15CC,0x0000,0x0000, 0xFBC0,0x89B3,0x0000,
+0xFBC0,0x89B4,0x0000, 0xFBC0,0x89B5,0x0000, 0x15CE,0x0000,0x0000,
+0x15CF,0x0000,0x0000, 0x15D0,0x0000,0x0000, 0x15D1,0x0000,0x0000,
+0xFBC0,0x89BA,0x0000, 0xFBC0,0x89BB,0x0000, 0x0000,0x0000,0x0000,
+0x15D2,0x0000,0x0000, 0x15D3,0x0000,0x0000, 0x15D4,0x0000,0x0000,
+0x15D5,0x0000,0x0000, 0x15D6,0x0000,0x0000, 0x15D7,0x0000,0x0000,
+0x15D8,0x0000,0x0000, 0x15D9,0x0000,0x0000, 0xFBC0,0x89C5,0x0000,
+0xFBC0,0x89C6,0x0000, 0x15DC,0x0000,0x0000, 0x15DD,0x0000,0x0000,
+0xFBC0,0x89C9,0x0000, 0xFBC0,0x89CA,0x0000, 0x15DE,0x0000,0x0000,
+0x15DF,0x0000,0x0000, 0x15E0,0x0000,0x0000, 0xFBC0,0x89CE,0x0000,
+0xFBC0,0x89CF,0x0000, 0xFBC0,0x89D0,0x0000, 0xFBC0,0x89D1,0x0000,
+0xFBC0,0x89D2,0x0000, 0xFBC0,0x89D3,0x0000, 0xFBC0,0x89D4,0x0000,
+0xFBC0,0x89D5,0x0000, 0xFBC0,0x89D6,0x0000, 0x15E1,0x0000,0x0000,
+0xFBC0,0x89D8,0x0000, 0xFBC0,0x89D9,0x0000, 0xFBC0,0x89DA,0x0000,
+0xFBC0,0x89DB,0x0000, 0x15BC,0x0000,0x0000, 0x15BD,0x0000,0x0000,
+0xFBC0,0x89DE,0x0000, 0x15C9,0x0000,0x0000, 0x15A9,0x0000,0x0000,
+0x15AB,0x0000,0x0000, 0x15DA,0x0000,0x0000, 0x15DB,0x0000,0x0000,
+0xFBC0,0x89E4,0x0000, 0xFBC0,0x89E5,0x0000, 0x0E29,0x0000,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0x15CB,0x0000,0x0000, 0x15CD,0x0000,0x0000, 0x0E12,0x0000,0x0000,
+0x0E13,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000,
+0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0DC7,0x0000,0x0000,
+0x0DC8,0x0000,0x0000, 0x0350,0x0000,0x0000, 0xFBC0,0x89FB,0x0000,
+0xFBC0,0x89FC,0x0000, 0xFBC0,0x89FD,0x0000, 0xFBC0,0x89FE,0x0000,
+0xFBC0,0x89FF,0x0000 };
+
+uint16 page00Adata[]= { /* 0A00 (3 weights per char) */
+0xFBC0,0x8A00,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0xFBC0,0x8A04,0x0000, 0x15E7,0x0000,0x0000,
+0x15E8,0x0000,0x0000, 0x15EC,0x0000,0x0000, 0x15ED,0x0000,0x0000,
+0x15E4,0x0000,0x0000, 0x15E5,0x0000,0x0000, 0xFBC0,0x8A0B,0x0000,
+0xFBC0,0x8A0C,0x0000, 0xFBC0,0x8A0D,0x0000, 0xFBC0,0x8A0E,0x0000,
+0x15EE,0x0000,0x0000, 0x15E9,0x0000,0x0000, 0xFBC0,0x8A11,0x0000,
+0xFBC0,0x8A12,0x0000, 0x15E6,0x0000,0x0000, 0x15EA,0x0000,0x0000,
+0x15F1,0x0000,0x0000, 0x15F2,0x0000,0x0000, 0x15F3,0x0000,0x0000,
+0x15F4,0x0000,0x0000, 0x15F5,0x0000,0x0000, 0x15F6,0x0000,0x0000,
+0x15F7,0x0000,0x0000, 0x15F8,0x0000,0x0000, 0x15F9,0x0000,0x0000,
+0x15FA,0x0000,0x0000, 0x15FB,0x0000,0x0000, 0x15FC,0x0000,0x0000,
+0x15FD,0x0000,0x0000, 0x15FE,0x0000,0x0000, 0x15FF,0x0000,0x0000,
+0x1600,0x0000,0x0000, 0x1601,0x0000,0x0000, 0x1602,0x0000,0x0000,
+0x1603,0x0000,0x0000, 0x1604,0x0000,0x0000, 0xFBC0,0x8A29,0x0000,
+0x1605,0x0000,0x0000, 0x1606,0x0000,0x0000, 0x1607,0x0000,0x0000,
+0x1608,0x0000,0x0000, 0x1609,0x0000,0x0000, 0x160A,0x0000,0x0000,
+0x160B,0x0000,0x0000, 0xFBC0,0x8A31,0x0000, 0x160C,0x0000,0x0000,
+0x160C,0x0000,0x0000, 0xFBC0,0x8A34,0x0000, 0x160D,0x0000,0x0000,
+0x15EF,0x0000,0x0000, 0xFBC0,0x8A37,0x0000, 0x15EF,0x0000,0x0000,
+0x15F0,0x0000,0x0000, 0xFBC0,0x8A3A,0x0000, 0xFBC0,0x8A3B,0x0000,
+0x0000,0x0000,0x0000, 0xFBC0,0x8A3D,0x0000, 0x160F,0x0000,0x0000,
+0x1610,0x0000,0x0000, 0x1611,0x0000,0x0000, 0x1612,0x0000,0x0000,
+0x1613,0x0000,0x0000, 0xFBC0,0x8A43,0x0000, 0xFBC0,0x8A44,0x0000,
+0xFBC0,0x8A45,0x0000, 0xFBC0,0x8A46,0x0000, 0x1614,0x0000,0x0000,
+0x1615,0x0000,0x0000, 0xFBC0,0x8A49,0x0000, 0xFBC0,0x8A4A,0x0000,
+0x1616,0x0000,0x0000, 0x1617,0x0000,0x0000, 0x1618,0x0000,0x0000,
+0xFBC0,0x8A4E,0x0000, 0xFBC0,0x8A4F,0x0000, 0xFBC0,0x8A50,0x0000,
+0xFBC0,0x8A51,0x0000, 0xFBC0,0x8A52,0x0000, 0xFBC0,0x8A53,0x0000,
+0xFBC0,0x8A54,0x0000, 0xFBC0,0x8A55,0x0000, 0xFBC0,0x8A56,0x0000,
+0xFBC0,0x8A57,0x0000, 0xFBC0,0x8A58,0x0000, 0x15F2,0x0000,0x0000,
+0x15F3,0x0000,0x0000, 0x15F8,0x0000,0x0000, 0x160E,0x0000,0x0000,
+0xFBC0,0x8A5D,0x0000, 0x1606,0x0000,0x0000, 0xFBC0,0x8A5F,0x0000,
+0xFBC0,0x8A60,0x0000, 0xFBC0,0x8A61,0x0000, 0xFBC0,0x8A62,0x0000,
+0xFBC0,0x8A63,0x0000, 0xFBC0,0x8A64,0x0000, 0xFBC0,0x8A65,0x0000,
+0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000,
+0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000,
+0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000,
+0x0E32,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x15EB,0x0000,0x0000, 0x15E3,0x0000,0x0000, 0x15E2,0x0000,0x0000,
+0xFBC0,0x8A75,0x0000, 0xFBC0,0x8A76,0x0000, 0xFBC0,0x8A77,0x0000,
+0xFBC0,0x8A78,0x0000, 0xFBC0,0x8A79,0x0000, 0xFBC0,0x8A7A,0x0000,
+0xFBC0,0x8A7B,0x0000, 0xFBC0,0x8A7C,0x0000, 0xFBC0,0x8A7D,0x0000,
+0xFBC0,0x8A7E,0x0000, 0xFBC0,0x8A7F,0x0000, 0xFBC0,0x8A80,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x8A84,0x0000, 0x161A,0x0000,0x0000, 0x161B,0x0000,0x0000,
+0x161C,0x0000,0x0000, 0x161D,0x0000,0x0000, 0x161E,0x0000,0x0000,
+0x161F,0x0000,0x0000, 0x1620,0x0000,0x0000, 0x1622,0x0000,0x0000,
+0x1624,0x0000,0x0000, 0xFBC0,0x8A8E,0x0000, 0x1625,0x0000,0x0000,
+0x1626,0x0000,0x0000, 0x1627,0x0000,0x0000, 0xFBC0,0x8A92,0x0000,
+0x1628,0x0000,0x0000, 0x1629,0x0000,0x0000, 0x162A,0x0000,0x0000,
+0x162B,0x0000,0x0000, 0x162C,0x0000,0x0000, 0x162D,0x0000,0x0000,
+0x162E,0x0000,0x0000, 0x162F,0x0000,0x0000, 0x1630,0x0000,0x0000,
+0x1631,0x0000,0x0000, 0x1632,0x0000,0x0000, 0x1633,0x0000,0x0000,
+0x1634,0x0000,0x0000, 0x1635,0x0000,0x0000, 0x1636,0x0000,0x0000,
+0x1637,0x0000,0x0000, 0x1638,0x0000,0x0000, 0x1639,0x0000,0x0000,
+0x163A,0x0000,0x0000, 0x163B,0x0000,0x0000, 0x163C,0x0000,0x0000,
+0x163D,0x0000,0x0000, 0xFBC0,0x8AA9,0x0000, 0x163E,0x0000,0x0000,
+0x163F,0x0000,0x0000, 0x1640,0x0000,0x0000, 0x1641,0x0000,0x0000,
+0x1642,0x0000,0x0000, 0x1643,0x0000,0x0000, 0x1644,0x0000,0x0000,
+0xFBC0,0x8AB1,0x0000, 0x1645,0x0000,0x0000, 0x1646,0x0000,0x0000,
+0xFBC0,0x8AB4,0x0000, 0x1647,0x0000,0x0000, 0x1648,0x0000,0x0000,
+0x1649,0x0000,0x0000, 0x164A,0x0000,0x0000, 0x164B,0x0000,0x0000,
+0xFBC0,0x8ABA,0x0000, 0xFBC0,0x8ABB,0x0000, 0x0000,0x0000,0x0000,
+0x164C,0x0000,0x0000, 0x164D,0x0000,0x0000, 0x164E,0x0000,0x0000,
+0x164F,0x0000,0x0000, 0x1650,0x0000,0x0000, 0x1651,0x0000,0x0000,
+0x1652,0x0000,0x0000, 0x1653,0x0000,0x0000, 0x1656,0x0000,0x0000,
+0xFBC0,0x8AC6,0x0000, 0x1657,0x0000,0x0000, 0x1658,0x0000,0x0000,
+0x1659,0x0000,0x0000, 0xFBC0,0x8ACA,0x0000, 0x165A,0x0000,0x0000,
+0x165B,0x0000,0x0000, 0x165C,0x0000,0x0000, 0xFBC0,0x8ACE,0x0000,
+0xFBC0,0x8ACF,0x0000, 0x1619,0x0000,0x0000, 0xFBC0,0x8AD1,0x0000,
+0xFBC0,0x8AD2,0x0000, 0xFBC0,0x8AD3,0x0000, 0xFBC0,0x8AD4,0x0000,
+0xFBC0,0x8AD5,0x0000, 0xFBC0,0x8AD6,0x0000, 0xFBC0,0x8AD7,0x0000,
+0xFBC0,0x8AD8,0x0000, 0xFBC0,0x8AD9,0x0000, 0xFBC0,0x8ADA,0x0000,
+0xFBC0,0x8ADB,0x0000, 0xFBC0,0x8ADC,0x0000, 0xFBC0,0x8ADD,0x0000,
+0xFBC0,0x8ADE,0x0000, 0xFBC0,0x8ADF,0x0000, 0x1621,0x0000,0x0000,
+0x1623,0x0000,0x0000, 0x1654,0x0000,0x0000, 0x1655,0x0000,0x0000,
+0xFBC0,0x8AE4,0x0000, 0xFBC0,0x8AE5,0x0000, 0x0E29,0x0000,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0xFBC0,0x8AF0,0x0000, 0x0E14,0x0000,0x0000, 0xFBC0,0x8AF2,0x0000,
+0xFBC0,0x8AF3,0x0000, 0xFBC0,0x8AF4,0x0000, 0xFBC0,0x8AF5,0x0000,
+0xFBC0,0x8AF6,0x0000, 0xFBC0,0x8AF7,0x0000, 0xFBC0,0x8AF8,0x0000,
+0xFBC0,0x8AF9,0x0000, 0xFBC0,0x8AFA,0x0000, 0xFBC0,0x8AFB,0x0000,
+0xFBC0,0x8AFC,0x0000, 0xFBC0,0x8AFD,0x0000, 0xFBC0,0x8AFE,0x0000,
+0xFBC0,0x8AFF,0x0000 };
+
+uint16 page00Bdata[]= { /* 0B00 (3 weights per char) */
+0xFBC0,0x8B00,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0xFBC0,0x8B04,0x0000, 0x165D,0x0000,0x0000,
+0x165E,0x0000,0x0000, 0x165F,0x0000,0x0000, 0x1660,0x0000,0x0000,
+0x1661,0x0000,0x0000, 0x1662,0x0000,0x0000, 0x1663,0x0000,0x0000,
+0x1665,0x0000,0x0000, 0xFBC0,0x8B0D,0x0000, 0xFBC0,0x8B0E,0x0000,
+0x1667,0x0000,0x0000, 0x1668,0x0000,0x0000, 0xFBC0,0x8B11,0x0000,
+0xFBC0,0x8B12,0x0000, 0x1669,0x0000,0x0000, 0x166A,0x0000,0x0000,
+0x166B,0x0000,0x0000, 0x166C,0x0000,0x0000, 0x166D,0x0000,0x0000,
+0x166E,0x0000,0x0000, 0x166F,0x0000,0x0000, 0x1670,0x0000,0x0000,
+0x1671,0x0000,0x0000, 0x1672,0x0000,0x0000, 0x1673,0x0000,0x0000,
+0x1674,0x0000,0x0000, 0x1675,0x0000,0x0000, 0x1676,0x0000,0x0000,
+0x1677,0x0000,0x0000, 0x1678,0x0000,0x0000, 0x1679,0x0000,0x0000,
+0x167A,0x0000,0x0000, 0x167B,0x0000,0x0000, 0x167C,0x0000,0x0000,
+0x167D,0x0000,0x0000, 0x167E,0x0000,0x0000, 0xFBC0,0x8B29,0x0000,
+0x167F,0x0000,0x0000, 0x1680,0x0000,0x0000, 0x1681,0x0000,0x0000,
+0x1682,0x0000,0x0000, 0x1683,0x0000,0x0000, 0x1684,0x0000,0x0000,
+0x1686,0x0000,0x0000, 0xFBC0,0x8B31,0x0000, 0x1687,0x0000,0x0000,
+0x1688,0x0000,0x0000, 0xFBC0,0x8B34,0x0000, 0x1689,0x0000,0x0000,
+0x168B,0x0000,0x0000, 0x168C,0x0000,0x0000, 0x168D,0x0000,0x0000,
+0x168E,0x0000,0x0000, 0xFBC0,0x8B3A,0x0000, 0xFBC0,0x8B3B,0x0000,
+0x0000,0x0000,0x0000, 0x168F,0x0000,0x0000, 0x1690,0x0000,0x0000,
+0x1691,0x0000,0x0000, 0x1692,0x0000,0x0000, 0x1693,0x0000,0x0000,
+0x1694,0x0000,0x0000, 0x1695,0x0000,0x0000, 0xFBC0,0x8B44,0x0000,
+0xFBC0,0x8B45,0x0000, 0xFBC0,0x8B46,0x0000, 0x1696,0x0000,0x0000,
+0x1697,0x0000,0x0000, 0xFBC0,0x8B49,0x0000, 0xFBC0,0x8B4A,0x0000,
+0x1698,0x0000,0x0000, 0x1699,0x0000,0x0000, 0x169A,0x0000,0x0000,
+0xFBC0,0x8B4E,0x0000, 0xFBC0,0x8B4F,0x0000, 0xFBC0,0x8B50,0x0000,
+0xFBC0,0x8B51,0x0000, 0xFBC0,0x8B52,0x0000, 0xFBC0,0x8B53,0x0000,
+0xFBC0,0x8B54,0x0000, 0xFBC0,0x8B55,0x0000, 0x169B,0x0000,0x0000,
+0x169C,0x0000,0x0000, 0xFBC0,0x8B58,0x0000, 0xFBC0,0x8B59,0x0000,
+0xFBC0,0x8B5A,0x0000, 0xFBC0,0x8B5B,0x0000, 0x1677,0x0000,0x0000,
+0x1678,0x0000,0x0000, 0xFBC0,0x8B5E,0x0000, 0x1685,0x0000,0x0000,
+0x1664,0x0000,0x0000, 0x1666,0x0000,0x0000, 0xFBC0,0x8B62,0x0000,
+0xFBC0,0x8B63,0x0000, 0xFBC0,0x8B64,0x0000, 0xFBC0,0x8B65,0x0000,
+0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000,
+0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000,
+0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000,
+0x0E32,0x0000,0x0000, 0x0351,0x0000,0x0000, 0x168A,0x0000,0x0000,
+0xFBC0,0x8B72,0x0000, 0xFBC0,0x8B73,0x0000, 0xFBC0,0x8B74,0x0000,
+0xFBC0,0x8B75,0x0000, 0xFBC0,0x8B76,0x0000, 0xFBC0,0x8B77,0x0000,
+0xFBC0,0x8B78,0x0000, 0xFBC0,0x8B79,0x0000, 0xFBC0,0x8B7A,0x0000,
+0xFBC0,0x8B7B,0x0000, 0xFBC0,0x8B7C,0x0000, 0xFBC0,0x8B7D,0x0000,
+0xFBC0,0x8B7E,0x0000, 0xFBC0,0x8B7F,0x0000, 0xFBC0,0x8B80,0x0000,
+0xFBC0,0x8B81,0x0000, 0x0000,0x0000,0x0000, 0x169D,0x0000,0x0000,
+0xFBC0,0x8B84,0x0000, 0x169E,0x0000,0x0000, 0x169F,0x0000,0x0000,
+0x16A0,0x0000,0x0000, 0x16A1,0x0000,0x0000, 0x16A2,0x0000,0x0000,
+0x16A3,0x0000,0x0000, 0xFBC0,0x8B8B,0x0000, 0xFBC0,0x8B8C,0x0000,
+0xFBC0,0x8B8D,0x0000, 0x16A4,0x0000,0x0000, 0x16A5,0x0000,0x0000,
+0x16A6,0x0000,0x0000, 0xFBC0,0x8B91,0x0000, 0x16A7,0x0000,0x0000,
+0x16A8,0x0000,0x0000, 0x16A9,0x0000,0x0000, 0x16AA,0x0000,0x0000,
+0xFBC0,0x8B96,0x0000, 0xFBC0,0x8B97,0x0000, 0xFBC0,0x8B98,0x0000,
+0x16AB,0x0000,0x0000, 0x16AC,0x0000,0x0000, 0xFBC0,0x8B9B,0x0000,
+0x16AD,0x0000,0x0000, 0xFBC0,0x8B9D,0x0000, 0x16AE,0x0000,0x0000,
+0x16AF,0x0000,0x0000, 0xFBC0,0x8BA0,0x0000, 0xFBC0,0x8BA1,0x0000,
+0xFBC0,0x8BA2,0x0000, 0x16B0,0x0000,0x0000, 0x16B1,0x0000,0x0000,
+0xFBC0,0x8BA5,0x0000, 0xFBC0,0x8BA6,0x0000, 0xFBC0,0x8BA7,0x0000,
+0x16B2,0x0000,0x0000, 0x16B3,0x0000,0x0000, 0x16B4,0x0000,0x0000,
+0xFBC0,0x8BAB,0x0000, 0xFBC0,0x8BAC,0x0000, 0xFBC0,0x8BAD,0x0000,
+0x16B5,0x0000,0x0000, 0x16B6,0x0000,0x0000, 0x16B7,0x0000,0x0000,
+0x16B8,0x0000,0x0000, 0x16B9,0x0000,0x0000, 0x16BA,0x0000,0x0000,
+0x16BB,0x0000,0x0000, 0x16BC,0x0000,0x0000, 0xFBC0,0x8BB6,0x0000,
+0x16BD,0x0000,0x0000, 0x16BE,0x0000,0x0000, 0x16BF,0x0000,0x0000,
+0xFBC0,0x8BBA,0x0000, 0xFBC0,0x8BBB,0x0000, 0xFBC0,0x8BBC,0x0000,
+0xFBC0,0x8BBD,0x0000, 0x16C0,0x0000,0x0000, 0x16C1,0x0000,0x0000,
+0x16C2,0x0000,0x0000, 0x16C3,0x0000,0x0000, 0x16C4,0x0000,0x0000,
+0xFBC0,0x8BC3,0x0000, 0xFBC0,0x8BC4,0x0000, 0xFBC0,0x8BC5,0x0000,
+0x16C5,0x0000,0x0000, 0x16C6,0x0000,0x0000, 0x16C7,0x0000,0x0000,
+0xFBC0,0x8BC9,0x0000, 0x16C8,0x0000,0x0000, 0x16C9,0x0000,0x0000,
+0x16CA,0x0000,0x0000, 0x16CB,0x0000,0x0000, 0xFBC0,0x8BCE,0x0000,
+0xFBC0,0x8BCF,0x0000, 0xFBC0,0x8BD0,0x0000, 0xFBC0,0x8BD1,0x0000,
+0xFBC0,0x8BD2,0x0000, 0xFBC0,0x8BD3,0x0000, 0xFBC0,0x8BD4,0x0000,
+0xFBC0,0x8BD5,0x0000, 0xFBC0,0x8BD6,0x0000, 0x16CC,0x0000,0x0000,
+0xFBC0,0x8BD8,0x0000, 0xFBC0,0x8BD9,0x0000, 0xFBC0,0x8BDA,0x0000,
+0xFBC0,0x8BDB,0x0000, 0xFBC0,0x8BDC,0x0000, 0xFBC0,0x8BDD,0x0000,
+0xFBC0,0x8BDE,0x0000, 0xFBC0,0x8BDF,0x0000, 0xFBC0,0x8BE0,0x0000,
+0xFBC0,0x8BE1,0x0000, 0xFBC0,0x8BE2,0x0000, 0xFBC0,0x8BE3,0x0000,
+0xFBC0,0x8BE4,0x0000, 0xFBC0,0x8BE5,0x0000, 0xFBC0,0x8BE6,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0x0DC9,0x0000,0x0000, 0x0DCA,0x0000,0x0000, 0x0DCB,0x0000,0x0000,
+0x0352,0x0000,0x0000, 0x0353,0x0000,0x0000, 0x0354,0x0000,0x0000,
+0x0355,0x0000,0x0000, 0x0356,0x0000,0x0000, 0x0357,0x0000,0x0000,
+0x0E15,0x0000,0x0000, 0x0358,0x0000,0x0000, 0xFBC0,0x8BFB,0x0000,
+0xFBC0,0x8BFC,0x0000, 0xFBC0,0x8BFD,0x0000, 0xFBC0,0x8BFE,0x0000,
+0xFBC0,0x8BFF,0x0000 };
+
+uint16 page00Cdata[]= { /* 0C00 (3 weights per char) */
+0xFBC0,0x8C00,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0xFBC0,0x8C04,0x0000, 0x16CD,0x0000,0x0000,
+0x16CE,0x0000,0x0000, 0x16CF,0x0000,0x0000, 0x16D0,0x0000,0x0000,
+0x16D1,0x0000,0x0000, 0x16D2,0x0000,0x0000, 0x16D3,0x0000,0x0000,
+0x16D5,0x0000,0x0000, 0xFBC0,0x8C0D,0x0000, 0x16D7,0x0000,0x0000,
+0x16D8,0x0000,0x0000, 0x16D9,0x0000,0x0000, 0xFBC0,0x8C11,0x0000,
+0x16DA,0x0000,0x0000, 0x16DB,0x0000,0x0000, 0x16DC,0x0000,0x0000,
+0x16DD,0x0000,0x0000, 0x16DE,0x0000,0x0000, 0x16DF,0x0000,0x0000,
+0x16E0,0x0000,0x0000, 0x16E1,0x0000,0x0000, 0x16E2,0x0000,0x0000,
+0x16E3,0x0000,0x0000, 0x16E4,0x0000,0x0000, 0x16E5,0x0000,0x0000,
+0x16E6,0x0000,0x0000, 0x16E7,0x0000,0x0000, 0x16E8,0x0000,0x0000,
+0x16E9,0x0000,0x0000, 0x16EA,0x0000,0x0000, 0x16EB,0x0000,0x0000,
+0x16EC,0x0000,0x0000, 0x16ED,0x0000,0x0000, 0x16EE,0x0000,0x0000,
+0x16EF,0x0000,0x0000, 0x16F0,0x0000,0x0000, 0xFBC0,0x8C29,0x0000,
+0x16F1,0x0000,0x0000, 0x16F2,0x0000,0x0000, 0x16F3,0x0000,0x0000,
+0x16F4,0x0000,0x0000, 0x16F5,0x0000,0x0000, 0x16F6,0x0000,0x0000,
+0x16F7,0x0000,0x0000, 0x16F8,0x0000,0x0000, 0x16F9,0x0000,0x0000,
+0x16FA,0x0000,0x0000, 0xFBC0,0x8C34,0x0000, 0x16FB,0x0000,0x0000,
+0x16FC,0x0000,0x0000, 0x16FD,0x0000,0x0000, 0x16FE,0x0000,0x0000,
+0x16FF,0x0000,0x0000, 0xFBC0,0x8C3A,0x0000, 0xFBC0,0x8C3B,0x0000,
+0xFBC0,0x8C3C,0x0000, 0xFBC0,0x8C3D,0x0000, 0x1700,0x0000,0x0000,
+0x1701,0x0000,0x0000, 0x1702,0x0000,0x0000, 0x1703,0x0000,0x0000,
+0x1704,0x0000,0x0000, 0x1705,0x0000,0x0000, 0x1706,0x0000,0x0000,
+0xFBC0,0x8C45,0x0000, 0x1707,0x0000,0x0000, 0x1708,0x0000,0x0000,
+0x1709,0x0000,0x0000, 0xFBC0,0x8C49,0x0000, 0x170A,0x0000,0x0000,
+0x170B,0x0000,0x0000, 0x170C,0x0000,0x0000, 0x170D,0x0000,0x0000,
+0xFBC0,0x8C4E,0x0000, 0xFBC0,0x8C4F,0x0000, 0xFBC0,0x8C50,0x0000,
+0xFBC0,0x8C51,0x0000, 0xFBC0,0x8C52,0x0000, 0xFBC0,0x8C53,0x0000,
+0xFBC0,0x8C54,0x0000, 0x170E,0x0000,0x0000, 0x170F,0x0000,0x0000,
+0xFBC0,0x8C57,0x0000, 0xFBC0,0x8C58,0x0000, 0xFBC0,0x8C59,0x0000,
+0xFBC0,0x8C5A,0x0000, 0xFBC0,0x8C5B,0x0000, 0xFBC0,0x8C5C,0x0000,
+0xFBC0,0x8C5D,0x0000, 0xFBC0,0x8C5E,0x0000, 0xFBC0,0x8C5F,0x0000,
+0x16D4,0x0000,0x0000, 0x16D6,0x0000,0x0000, 0xFBC0,0x8C62,0x0000,
+0xFBC0,0x8C63,0x0000, 0xFBC0,0x8C64,0x0000, 0xFBC0,0x8C65,0x0000,
+0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000,
+0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000,
+0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000,
+0x0E32,0x0000,0x0000, 0xFBC0,0x8C70,0x0000, 0xFBC0,0x8C71,0x0000,
+0xFBC0,0x8C72,0x0000, 0xFBC0,0x8C73,0x0000, 0xFBC0,0x8C74,0x0000,
+0xFBC0,0x8C75,0x0000, 0xFBC0,0x8C76,0x0000, 0xFBC0,0x8C77,0x0000,
+0xFBC0,0x8C78,0x0000, 0xFBC0,0x8C79,0x0000, 0xFBC0,0x8C7A,0x0000,
+0xFBC0,0x8C7B,0x0000, 0xFBC0,0x8C7C,0x0000, 0xFBC0,0x8C7D,0x0000,
+0xFBC0,0x8C7E,0x0000, 0xFBC0,0x8C7F,0x0000, 0xFBC0,0x8C80,0x0000,
+0xFBC0,0x8C81,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x8C84,0x0000, 0x1710,0x0000,0x0000, 0x1711,0x0000,0x0000,
+0x1712,0x0000,0x0000, 0x1713,0x0000,0x0000, 0x1714,0x0000,0x0000,
+0x1715,0x0000,0x0000, 0x1716,0x0000,0x0000, 0x1718,0x0000,0x0000,
+0xFBC0,0x8C8D,0x0000, 0x171A,0x0000,0x0000, 0x171B,0x0000,0x0000,
+0x171C,0x0000,0x0000, 0xFBC0,0x8C91,0x0000, 0x171D,0x0000,0x0000,
+0x171E,0x0000,0x0000, 0x171F,0x0000,0x0000, 0x1720,0x0000,0x0000,
+0x1721,0x0000,0x0000, 0x1722,0x0000,0x0000, 0x1723,0x0000,0x0000,
+0x1724,0x0000,0x0000, 0x1725,0x0000,0x0000, 0x1726,0x0000,0x0000,
+0x1727,0x0000,0x0000, 0x1728,0x0000,0x0000, 0x1729,0x0000,0x0000,
+0x172A,0x0000,0x0000, 0x172B,0x0000,0x0000, 0x172C,0x0000,0x0000,
+0x172D,0x0000,0x0000, 0x172E,0x0000,0x0000, 0x172F,0x0000,0x0000,
+0x1730,0x0000,0x0000, 0x1731,0x0000,0x0000, 0x1732,0x0000,0x0000,
+0x1733,0x0000,0x0000, 0xFBC0,0x8CA9,0x0000, 0x1734,0x0000,0x0000,
+0x1735,0x0000,0x0000, 0x1736,0x0000,0x0000, 0x1737,0x0000,0x0000,
+0x1738,0x0000,0x0000, 0x1739,0x0000,0x0000, 0x173A,0x0000,0x0000,
+0x173B,0x0000,0x0000, 0x173C,0x0000,0x0000, 0x1743,0x0000,0x0000,
+0xFBC0,0x8CB4,0x0000, 0x173D,0x0000,0x0000, 0x173E,0x0000,0x0000,
+0x173F,0x0000,0x0000, 0x1740,0x0000,0x0000, 0x1741,0x0000,0x0000,
+0xFBC0,0x8CBA,0x0000, 0xFBC0,0x8CBB,0x0000, 0x0000,0x0000,0x0000,
+0x1742,0x0000,0x0000, 0x1745,0x0000,0x0000, 0x1746,0x0000,0x0000,
+0x1747,0x0000,0x0000, 0x1748,0x0000,0x0000, 0x1749,0x0000,0x0000,
+0x174A,0x0000,0x0000, 0x174B,0x0000,0x0000, 0xFBC0,0x8CC5,0x0000,
+0x174C,0x0000,0x0000, 0x174D,0x0000,0x0000, 0x174E,0x0000,0x0000,
+0xFBC0,0x8CC9,0x0000, 0x174F,0x0000,0x0000, 0x1750,0x0000,0x0000,
+0x1751,0x0000,0x0000, 0x1752,0x0000,0x0000, 0xFBC0,0x8CCE,0x0000,
+0xFBC0,0x8CCF,0x0000, 0xFBC0,0x8CD0,0x0000, 0xFBC0,0x8CD1,0x0000,
+0xFBC0,0x8CD2,0x0000, 0xFBC0,0x8CD3,0x0000, 0xFBC0,0x8CD4,0x0000,
+0x1753,0x0000,0x0000, 0x1754,0x0000,0x0000, 0xFBC0,0x8CD7,0x0000,
+0xFBC0,0x8CD8,0x0000, 0xFBC0,0x8CD9,0x0000, 0xFBC0,0x8CDA,0x0000,
+0xFBC0,0x8CDB,0x0000, 0xFBC0,0x8CDC,0x0000, 0xFBC0,0x8CDD,0x0000,
+0x1744,0x0000,0x0000, 0xFBC0,0x8CDF,0x0000, 0x1717,0x0000,0x0000,
+0x1719,0x0000,0x0000, 0xFBC0,0x8CE2,0x0000, 0xFBC0,0x8CE3,0x0000,
+0xFBC0,0x8CE4,0x0000, 0xFBC0,0x8CE5,0x0000, 0x0E29,0x0000,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0xFBC0,0x8CF0,0x0000, 0xFBC0,0x8CF1,0x0000, 0xFBC0,0x8CF2,0x0000,
+0xFBC0,0x8CF3,0x0000, 0xFBC0,0x8CF4,0x0000, 0xFBC0,0x8CF5,0x0000,
+0xFBC0,0x8CF6,0x0000, 0xFBC0,0x8CF7,0x0000, 0xFBC0,0x8CF8,0x0000,
+0xFBC0,0x8CF9,0x0000, 0xFBC0,0x8CFA,0x0000, 0xFBC0,0x8CFB,0x0000,
+0xFBC0,0x8CFC,0x0000, 0xFBC0,0x8CFD,0x0000, 0xFBC0,0x8CFE,0x0000,
+0xFBC0,0x8CFF,0x0000 };
+
+uint16 page00Ddata[]= { /* 0D00 (3 weights per char) */
+0xFBC0,0x8D00,0x0000, 0xFBC0,0x8D01,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0xFBC0,0x8D04,0x0000, 0x1755,0x0000,0x0000,
+0x1756,0x0000,0x0000, 0x1757,0x0000,0x0000, 0x1758,0x0000,0x0000,
+0x1759,0x0000,0x0000, 0x175A,0x0000,0x0000, 0x175B,0x0000,0x0000,
+0x175D,0x0000,0x0000, 0xFBC0,0x8D0D,0x0000, 0x175F,0x0000,0x0000,
+0x1760,0x0000,0x0000, 0x1761,0x0000,0x0000, 0xFBC0,0x8D11,0x0000,
+0x1762,0x0000,0x0000, 0x1763,0x0000,0x0000, 0x1764,0x0000,0x0000,
+0x1765,0x0000,0x0000, 0x1766,0x0000,0x0000, 0x1767,0x0000,0x0000,
+0x1768,0x0000,0x0000, 0x1769,0x0000,0x0000, 0x176A,0x0000,0x0000,
+0x176B,0x0000,0x0000, 0x176C,0x0000,0x0000, 0x176D,0x0000,0x0000,
+0x176E,0x0000,0x0000, 0x176F,0x0000,0x0000, 0x1770,0x0000,0x0000,
+0x1771,0x0000,0x0000, 0x1772,0x0000,0x0000, 0x1773,0x0000,0x0000,
+0x1774,0x0000,0x0000, 0x1775,0x0000,0x0000, 0x1776,0x0000,0x0000,
+0x1777,0x0000,0x0000, 0x1778,0x0000,0x0000, 0xFBC0,0x8D29,0x0000,
+0x1779,0x0000,0x0000, 0x177A,0x0000,0x0000, 0x177B,0x0000,0x0000,
+0x177C,0x0000,0x0000, 0x177D,0x0000,0x0000, 0x177E,0x0000,0x0000,
+0x177F,0x0000,0x0000, 0x1780,0x0000,0x0000, 0x1781,0x0000,0x0000,
+0x1782,0x0000,0x0000, 0x1783,0x0000,0x0000, 0x1784,0x0000,0x0000,
+0x1785,0x0000,0x0000, 0x1786,0x0000,0x0000, 0x1787,0x0000,0x0000,
+0x1788,0x0000,0x0000, 0xFBC0,0x8D3A,0x0000, 0xFBC0,0x8D3B,0x0000,
+0xFBC0,0x8D3C,0x0000, 0xFBC0,0x8D3D,0x0000, 0x1789,0x0000,0x0000,
+0x178A,0x0000,0x0000, 0x178B,0x0000,0x0000, 0x178C,0x0000,0x0000,
+0x178D,0x0000,0x0000, 0x178E,0x0000,0x0000, 0xFBC0,0x8D44,0x0000,
+0xFBC0,0x8D45,0x0000, 0x178F,0x0000,0x0000, 0x1790,0x0000,0x0000,
+0x1791,0x0000,0x0000, 0xFBC0,0x8D49,0x0000, 0x1792,0x0000,0x0000,
+0x1793,0x0000,0x0000, 0x1794,0x0000,0x0000, 0x1795,0x0000,0x0000,
+0xFBC0,0x8D4E,0x0000, 0xFBC0,0x8D4F,0x0000, 0xFBC0,0x8D50,0x0000,
+0xFBC0,0x8D51,0x0000, 0xFBC0,0x8D52,0x0000, 0xFBC0,0x8D53,0x0000,
+0xFBC0,0x8D54,0x0000, 0xFBC0,0x8D55,0x0000, 0xFBC0,0x8D56,0x0000,
+0x1796,0x0000,0x0000, 0xFBC0,0x8D58,0x0000, 0xFBC0,0x8D59,0x0000,
+0xFBC0,0x8D5A,0x0000, 0xFBC0,0x8D5B,0x0000, 0xFBC0,0x8D5C,0x0000,
+0xFBC0,0x8D5D,0x0000, 0xFBC0,0x8D5E,0x0000, 0xFBC0,0x8D5F,0x0000,
+0x175C,0x0000,0x0000, 0x175E,0x0000,0x0000, 0xFBC0,0x8D62,0x0000,
+0xFBC0,0x8D63,0x0000, 0xFBC0,0x8D64,0x0000, 0xFBC0,0x8D65,0x0000,
+0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000,
+0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000,
+0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000,
+0x0E32,0x0000,0x0000, 0xFBC0,0x8D70,0x0000, 0xFBC0,0x8D71,0x0000,
+0xFBC0,0x8D72,0x0000, 0xFBC0,0x8D73,0x0000, 0xFBC0,0x8D74,0x0000,
+0xFBC0,0x8D75,0x0000, 0xFBC0,0x8D76,0x0000, 0xFBC0,0x8D77,0x0000,
+0xFBC0,0x8D78,0x0000, 0xFBC0,0x8D79,0x0000, 0xFBC0,0x8D7A,0x0000,
+0xFBC0,0x8D7B,0x0000, 0xFBC0,0x8D7C,0x0000, 0xFBC0,0x8D7D,0x0000,
+0xFBC0,0x8D7E,0x0000, 0xFBC0,0x8D7F,0x0000, 0xFBC0,0x8D80,0x0000,
+0xFBC0,0x8D81,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x8D84,0x0000, 0x1797,0x0000,0x0000, 0x1798,0x0000,0x0000,
+0x1799,0x0000,0x0000, 0x179A,0x0000,0x0000, 0x179B,0x0000,0x0000,
+0x179C,0x0000,0x0000, 0x179D,0x0000,0x0000, 0x179E,0x0000,0x0000,
+0x179F,0x0000,0x0000, 0x17A0,0x0000,0x0000, 0x17A1,0x0000,0x0000,
+0x17A2,0x0000,0x0000, 0x17A3,0x0000,0x0000, 0x17A4,0x0000,0x0000,
+0x17A5,0x0000,0x0000, 0x17A6,0x0000,0x0000, 0x17A7,0x0000,0x0000,
+0x17A8,0x0000,0x0000, 0xFBC0,0x8D97,0x0000, 0xFBC0,0x8D98,0x0000,
+0xFBC0,0x8D99,0x0000, 0x17A9,0x0000,0x0000, 0x17AA,0x0000,0x0000,
+0x17AB,0x0000,0x0000, 0x17AC,0x0000,0x0000, 0x17AD,0x0000,0x0000,
+0x17AE,0x0000,0x0000, 0x17AF,0x0000,0x0000, 0x17B0,0x0000,0x0000,
+0x17B1,0x0000,0x0000, 0x17B2,0x0000,0x0000, 0x17B3,0x0000,0x0000,
+0x17B4,0x0000,0x0000, 0x17B5,0x0000,0x0000, 0x17B6,0x0000,0x0000,
+0x17B7,0x0000,0x0000, 0x17B8,0x0000,0x0000, 0x17B9,0x0000,0x0000,
+0x17BA,0x0000,0x0000, 0x17BB,0x0000,0x0000, 0x17BC,0x0000,0x0000,
+0x17BD,0x0000,0x0000, 0x17BE,0x0000,0x0000, 0x17BF,0x0000,0x0000,
+0x17C0,0x0000,0x0000, 0xFBC0,0x8DB2,0x0000, 0x17C1,0x0000,0x0000,
+0x17C2,0x0000,0x0000, 0x17C3,0x0000,0x0000, 0x17C4,0x0000,0x0000,
+0x17C5,0x0000,0x0000, 0x17C6,0x0000,0x0000, 0x17C7,0x0000,0x0000,
+0x17C8,0x0000,0x0000, 0x17C9,0x0000,0x0000, 0xFBC0,0x8DBC,0x0000,
+0x17CA,0x0000,0x0000, 0xFBC0,0x8DBE,0x0000, 0xFBC0,0x8DBF,0x0000,
+0x17CB,0x0000,0x0000, 0x17CC,0x0000,0x0000, 0x17CD,0x0000,0x0000,
+0x17CE,0x0000,0x0000, 0x17CF,0x0000,0x0000, 0x17D0,0x0000,0x0000,
+0x17D1,0x0000,0x0000, 0xFBC0,0x8DC7,0x0000, 0xFBC0,0x8DC8,0x0000,
+0xFBC0,0x8DC9,0x0000, 0x17D2,0x0000,0x0000, 0xFBC0,0x8DCB,0x0000,
+0xFBC0,0x8DCC,0x0000, 0xFBC0,0x8DCD,0x0000, 0xFBC0,0x8DCE,0x0000,
+0x17D3,0x0000,0x0000, 0x17D4,0x0000,0x0000, 0x17D5,0x0000,0x0000,
+0x17D6,0x0000,0x0000, 0x17D7,0x0000,0x0000, 0x17D8,0x0000,0x0000,
+0xFBC0,0x8DD5,0x0000, 0x17D9,0x0000,0x0000, 0xFBC0,0x8DD7,0x0000,
+0x17DA,0x0000,0x0000, 0x17DB,0x0000,0x0000, 0x17DC,0x0000,0x0000,
+0x17DD,0x0000,0x0000, 0x17DE,0x0000,0x0000, 0x17DF,0x0000,0x0000,
+0x17E0,0x0000,0x0000, 0x17E1,0x0000,0x0000, 0xFBC0,0x8DE0,0x0000,
+0xFBC0,0x8DE1,0x0000, 0xFBC0,0x8DE2,0x0000, 0xFBC0,0x8DE3,0x0000,
+0xFBC0,0x8DE4,0x0000, 0xFBC0,0x8DE5,0x0000, 0xFBC0,0x8DE6,0x0000,
+0xFBC0,0x8DE7,0x0000, 0xFBC0,0x8DE8,0x0000, 0xFBC0,0x8DE9,0x0000,
+0xFBC0,0x8DEA,0x0000, 0xFBC0,0x8DEB,0x0000, 0xFBC0,0x8DEC,0x0000,
+0xFBC0,0x8DED,0x0000, 0xFBC0,0x8DEE,0x0000, 0xFBC0,0x8DEF,0x0000,
+0xFBC0,0x8DF0,0x0000, 0xFBC0,0x8DF1,0x0000, 0x17E2,0x0000,0x0000,
+0x17E3,0x0000,0x0000, 0x02FB,0x0000,0x0000, 0xFBC0,0x8DF5,0x0000,
+0xFBC0,0x8DF6,0x0000, 0xFBC0,0x8DF7,0x0000, 0xFBC0,0x8DF8,0x0000,
+0xFBC0,0x8DF9,0x0000, 0xFBC0,0x8DFA,0x0000, 0xFBC0,0x8DFB,0x0000,
+0xFBC0,0x8DFC,0x0000, 0xFBC0,0x8DFD,0x0000, 0xFBC0,0x8DFE,0x0000,
+0xFBC0,0x8DFF,0x0000 };
+
+uint16 page00Edata[]= { /* 0E00 (3 weights per char) */
+0xFBC0,0x8E00,0x0000, 0x17E4,0x0000,0x0000, 0x17E5,0x0000,0x0000,
+0x17E6,0x0000,0x0000, 0x17E7,0x0000,0x0000, 0x17E8,0x0000,0x0000,
+0x17E9,0x0000,0x0000, 0x17EA,0x0000,0x0000, 0x17EB,0x0000,0x0000,
+0x17EC,0x0000,0x0000, 0x17ED,0x0000,0x0000, 0x17EE,0x0000,0x0000,
+0x17EF,0x0000,0x0000, 0x17F0,0x0000,0x0000, 0x17F1,0x0000,0x0000,
+0x17F2,0x0000,0x0000, 0x17F3,0x0000,0x0000, 0x17F4,0x0000,0x0000,
+0x17F5,0x0000,0x0000, 0x17F6,0x0000,0x0000, 0x17F7,0x0000,0x0000,
+0x17F8,0x0000,0x0000, 0x17F9,0x0000,0x0000, 0x17FA,0x0000,0x0000,
+0x17FB,0x0000,0x0000, 0x17FC,0x0000,0x0000, 0x17FD,0x0000,0x0000,
+0x17FE,0x0000,0x0000, 0x17FF,0x0000,0x0000, 0x1800,0x0000,0x0000,
+0x1801,0x0000,0x0000, 0x1802,0x0000,0x0000, 0x1803,0x0000,0x0000,
+0x1804,0x0000,0x0000, 0x1805,0x0000,0x0000, 0x1806,0x0000,0x0000,
+0x1807,0x0000,0x0000, 0x1808,0x0000,0x0000, 0x1809,0x0000,0x0000,
+0x180A,0x0000,0x0000, 0x180B,0x0000,0x0000, 0x180C,0x0000,0x0000,
+0x180D,0x0000,0x0000, 0x180E,0x0000,0x0000, 0x180F,0x0000,0x0000,
+0x1810,0x0000,0x0000, 0x1811,0x0000,0x0000, 0x1812,0x0000,0x0000,
+0x1813,0x0000,0x0000, 0x1814,0x0000,0x0000, 0x1815,0x0000,0x0000,
+0x1816,0x0000,0x0000, 0x1817,0x0000,0x0000, 0x1818,0x0000,0x0000,
+0x1819,0x0000,0x0000, 0x181A,0x0000,0x0000, 0x181B,0x0000,0x0000,
+0x181C,0x0000,0x0000, 0x181D,0x0000,0x0000, 0xFBC0,0x8E3B,0x0000,
+0xFBC0,0x8E3C,0x0000, 0xFBC0,0x8E3D,0x0000, 0xFBC0,0x8E3E,0x0000,
+0x0E16,0x0000,0x0000, 0x181E,0x0000,0x0000, 0x181F,0x0000,0x0000,
+0x1820,0x0000,0x0000, 0x1821,0x0000,0x0000, 0x1822,0x0000,0x0000,
+0x1823,0x0000,0x0000, 0x0E03,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x1824,0x0000,0x0000, 0x1825,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0359,0x0000,0x0000, 0x0E29,0x0000,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0x02FC,0x0000,0x0000, 0x02FD,0x0000,0x0000, 0xFBC0,0x8E5C,0x0000,
+0xFBC0,0x8E5D,0x0000, 0xFBC0,0x8E5E,0x0000, 0xFBC0,0x8E5F,0x0000,
+0xFBC0,0x8E60,0x0000, 0xFBC0,0x8E61,0x0000, 0xFBC0,0x8E62,0x0000,
+0xFBC0,0x8E63,0x0000, 0xFBC0,0x8E64,0x0000, 0xFBC0,0x8E65,0x0000,
+0xFBC0,0x8E66,0x0000, 0xFBC0,0x8E67,0x0000, 0xFBC0,0x8E68,0x0000,
+0xFBC0,0x8E69,0x0000, 0xFBC0,0x8E6A,0x0000, 0xFBC0,0x8E6B,0x0000,
+0xFBC0,0x8E6C,0x0000, 0xFBC0,0x8E6D,0x0000, 0xFBC0,0x8E6E,0x0000,
+0xFBC0,0x8E6F,0x0000, 0xFBC0,0x8E70,0x0000, 0xFBC0,0x8E71,0x0000,
+0xFBC0,0x8E72,0x0000, 0xFBC0,0x8E73,0x0000, 0xFBC0,0x8E74,0x0000,
+0xFBC0,0x8E75,0x0000, 0xFBC0,0x8E76,0x0000, 0xFBC0,0x8E77,0x0000,
+0xFBC0,0x8E78,0x0000, 0xFBC0,0x8E79,0x0000, 0xFBC0,0x8E7A,0x0000,
+0xFBC0,0x8E7B,0x0000, 0xFBC0,0x8E7C,0x0000, 0xFBC0,0x8E7D,0x0000,
+0xFBC0,0x8E7E,0x0000, 0xFBC0,0x8E7F,0x0000, 0xFBC0,0x8E80,0x0000,
+0x1826,0x0000,0x0000, 0x1827,0x0000,0x0000, 0xFBC0,0x8E83,0x0000,
+0x1828,0x0000,0x0000, 0xFBC0,0x8E85,0x0000, 0xFBC0,0x8E86,0x0000,
+0x1829,0x0000,0x0000, 0x182A,0x0000,0x0000, 0xFBC0,0x8E89,0x0000,
+0x182B,0x0000,0x0000, 0xFBC0,0x8E8B,0x0000, 0xFBC0,0x8E8C,0x0000,
+0x182C,0x0000,0x0000, 0xFBC0,0x8E8E,0x0000, 0xFBC0,0x8E8F,0x0000,
+0xFBC0,0x8E90,0x0000, 0xFBC0,0x8E91,0x0000, 0xFBC0,0x8E92,0x0000,
+0xFBC0,0x8E93,0x0000, 0x182D,0x0000,0x0000, 0x182E,0x0000,0x0000,
+0x182F,0x0000,0x0000, 0x1830,0x0000,0x0000, 0xFBC0,0x8E98,0x0000,
+0x1831,0x0000,0x0000, 0x1832,0x0000,0x0000, 0x1833,0x0000,0x0000,
+0x1834,0x0000,0x0000, 0x1835,0x0000,0x0000, 0x1836,0x0000,0x0000,
+0x1837,0x0000,0x0000, 0xFBC0,0x8EA0,0x0000, 0x1838,0x0000,0x0000,
+0x1839,0x0000,0x0000, 0x183A,0x0000,0x0000, 0xFBC0,0x8EA4,0x0000,
+0x183B,0x0000,0x0000, 0xFBC0,0x8EA6,0x0000, 0x183C,0x0000,0x0000,
+0xFBC0,0x8EA8,0x0000, 0xFBC0,0x8EA9,0x0000, 0x183D,0x0000,0x0000,
+0x183E,0x0000,0x0000, 0xFBC0,0x8EAC,0x0000, 0x183F,0x0000,0x0000,
+0x1840,0x0000,0x0000, 0x1841,0x0000,0x0000, 0x1842,0x0000,0x0000,
+0x1843,0x0000,0x0000, 0x1844,0x0000,0x0000, 0x1845,0x0000,0x0000,
+0x1846,0x0000,0x0000, 0x1847,0x0000,0x0000, 0x1848,0x0000,0x0000,
+0x1849,0x0000,0x0000, 0x184A,0x0000,0x0000, 0x184B,0x0000,0x0000,
+0xFBC0,0x8EBA,0x0000, 0x184C,0x0000,0x0000, 0x184D,0x0000,0x0000,
+0x184E,0x0000,0x0000, 0xFBC0,0x8EBE,0x0000, 0xFBC0,0x8EBF,0x0000,
+0x184F,0x0000,0x0000, 0x1850,0x0000,0x0000, 0x1851,0x0000,0x0000,
+0x1852,0x0000,0x0000, 0x1853,0x0000,0x0000, 0xFBC0,0x8EC5,0x0000,
+0x0E04,0x0000,0x0000, 0xFBC0,0x8EC7,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x1854,0x0000,0x0000, 0x1855,0x0000,0x0000, 0xFBC0,0x8ECE,0x0000,
+0xFBC0,0x8ECF,0x0000, 0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000,
+0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000,
+0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000,
+0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, 0xFBC0,0x8EDA,0x0000,
+0xFBC0,0x8EDB,0x0000, 0x183E,0x1831,0x0000, 0x183E,0x1838,0x0000,
+0xFBC0,0x8EDE,0x0000, 0xFBC0,0x8EDF,0x0000, 0xFBC0,0x8EE0,0x0000,
+0xFBC0,0x8EE1,0x0000, 0xFBC0,0x8EE2,0x0000, 0xFBC0,0x8EE3,0x0000,
+0xFBC0,0x8EE4,0x0000, 0xFBC0,0x8EE5,0x0000, 0xFBC0,0x8EE6,0x0000,
+0xFBC0,0x8EE7,0x0000, 0xFBC0,0x8EE8,0x0000, 0xFBC0,0x8EE9,0x0000,
+0xFBC0,0x8EEA,0x0000, 0xFBC0,0x8EEB,0x0000, 0xFBC0,0x8EEC,0x0000,
+0xFBC0,0x8EED,0x0000, 0xFBC0,0x8EEE,0x0000, 0xFBC0,0x8EEF,0x0000,
+0xFBC0,0x8EF0,0x0000, 0xFBC0,0x8EF1,0x0000, 0xFBC0,0x8EF2,0x0000,
+0xFBC0,0x8EF3,0x0000, 0xFBC0,0x8EF4,0x0000, 0xFBC0,0x8EF5,0x0000,
+0xFBC0,0x8EF6,0x0000, 0xFBC0,0x8EF7,0x0000, 0xFBC0,0x8EF8,0x0000,
+0xFBC0,0x8EF9,0x0000, 0xFBC0,0x8EFA,0x0000, 0xFBC0,0x8EFB,0x0000,
+0xFBC0,0x8EFC,0x0000, 0xFBC0,0x8EFD,0x0000, 0xFBC0,0x8EFE,0x0000,
+0xFBC0,0x8EFF,0x0000 };
+
+uint16 page00Fdata[]= { /* 0F00 (3 weights per char) */
+0x189A,0x18AD,0x0000, 0x035A,0x0000,0x0000, 0x035B,0x0000,0x0000,
+0x035C,0x0000,0x0000, 0x02FE,0x0000,0x0000, 0x02FF,0x0000,0x0000,
+0x0300,0x0000,0x0000, 0x0301,0x0000,0x0000, 0x0302,0x0000,0x0000,
+0x0303,0x0000,0x0000, 0x0304,0x0000,0x0000, 0x0305,0x0000,0x0000,
+0x0305,0x0000,0x0000, 0x0306,0x0000,0x0000, 0x0307,0x0000,0x0000,
+0x0308,0x0000,0x0000, 0x0309,0x0000,0x0000, 0x030A,0x0000,0x0000,
+0x030B,0x0000,0x0000, 0x035D,0x0000,0x0000, 0x024C,0x0000,0x0000,
+0x035E,0x0000,0x0000, 0x035F,0x0000,0x0000, 0x0360,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0361,0x0000,0x0000,
+0x0362,0x0000,0x0000, 0x0363,0x0000,0x0000, 0x0364,0x0000,0x0000,
+0x0365,0x0000,0x0000, 0x0366,0x0000,0x0000, 0x0E29,0x0000,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0x0E29,0x0000,0x0000, 0x0367,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0368,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0369,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x028E,0x0000,0x0000, 0x028F,0x0000,0x0000,
+0x0290,0x0000,0x0000, 0x0291,0x0000,0x0000, 0x036A,0x0000,0x0000,
+0x036B,0x0000,0x0000, 0x1856,0x0000,0x0000, 0x1858,0x0000,0x0000,
+0x185A,0x0000,0x0000, 0x185A,0x1899,0x0000, 0x185C,0x0000,0x0000,
+0x185E,0x0000,0x0000, 0x1860,0x0000,0x0000, 0x1862,0x0000,0x0000,
+0xFBC0,0x8F48,0x0000, 0x1864,0x0000,0x0000, 0x1866,0x0000,0x0000,
+0x1868,0x0000,0x0000, 0x186A,0x0000,0x0000, 0x186A,0x1899,0x0000,
+0x186C,0x0000,0x0000, 0x186E,0x0000,0x0000, 0x1870,0x0000,0x0000,
+0x1872,0x0000,0x0000, 0x1872,0x1899,0x0000, 0x1874,0x0000,0x0000,
+0x1876,0x0000,0x0000, 0x1878,0x0000,0x0000, 0x187A,0x0000,0x0000,
+0x187A,0x1899,0x0000, 0x187C,0x0000,0x0000, 0x187E,0x0000,0x0000,
+0x1880,0x0000,0x0000, 0x1882,0x0000,0x0000, 0x1882,0x1899,0x0000,
+0x1884,0x0000,0x0000, 0x1886,0x0000,0x0000, 0x1888,0x0000,0x0000,
+0x188A,0x0000,0x0000, 0x188C,0x0000,0x0000, 0x188E,0x0000,0x0000,
+0x1890,0x0000,0x0000, 0x1892,0x0000,0x0000, 0x1894,0x0000,0x0000,
+0x1896,0x0000,0x0000, 0x1898,0x0000,0x0000, 0x189A,0x0000,0x0000,
+0x1856,0x1895,0x0000, 0x188E,0x0000,0x0000, 0xFBC0,0x8F6B,0x0000,
+0xFBC0,0x8F6C,0x0000, 0xFBC0,0x8F6D,0x0000, 0xFBC0,0x8F6E,0x0000,
+0xFBC0,0x8F6F,0x0000, 0xFBC0,0x8F70,0x0000, 0x18A0,0x0000,0x0000,
+0x18A1,0x0000,0x0000, 0x18A2,0x0000,0x0000, 0x18A5,0x0000,0x0000,
+0x18A6,0x0000,0x0000, 0x18A7,0x0000,0x0000, 0x18A8,0x0000,0x0000,
+0x18A9,0x0000,0x0000, 0x18AA,0x0000,0x0000, 0x18AB,0x0000,0x0000,
+0x18AC,0x0000,0x0000, 0x18AD,0x0000,0x0000, 0x18AE,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x18A3,0x0000,0x0000,
+0x18A4,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x18AF,0x0000,0x0000, 0x030C,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x189C,0x0000,0x0000, 0x189D,0x0000,0x0000,
+0x189E,0x0000,0x0000, 0x189F,0x0000,0x0000, 0xFBC0,0x8F8C,0x0000,
+0xFBC0,0x8F8D,0x0000, 0xFBC0,0x8F8E,0x0000, 0xFBC0,0x8F8F,0x0000,
+0x1857,0x0000,0x0000, 0x1859,0x0000,0x0000, 0x185B,0x0000,0x0000,
+0x185B,0x1899,0x0000, 0x185D,0x0000,0x0000, 0x185F,0x0000,0x0000,
+0x1861,0x0000,0x0000, 0x1863,0x0000,0x0000, 0xFBC0,0x8F98,0x0000,
+0x1865,0x0000,0x0000, 0x1867,0x0000,0x0000, 0x1869,0x0000,0x0000,
+0x186B,0x0000,0x0000, 0x186B,0x1899,0x0000, 0x186D,0x0000,0x0000,
+0x186F,0x0000,0x0000, 0x1871,0x0000,0x0000, 0x1873,0x0000,0x0000,
+0x1873,0x1899,0x0000, 0x1875,0x0000,0x0000, 0x1877,0x0000,0x0000,
+0x1879,0x0000,0x0000, 0x187B,0x0000,0x0000, 0x187B,0x1899,0x0000,
+0x187D,0x0000,0x0000, 0x187F,0x0000,0x0000, 0x1881,0x0000,0x0000,
+0x1883,0x0000,0x0000, 0x1883,0x1899,0x0000, 0x1885,0x0000,0x0000,
+0x1887,0x0000,0x0000, 0x1889,0x0000,0x0000, 0x188B,0x0000,0x0000,
+0x188D,0x0000,0x0000, 0x188F,0x0000,0x0000, 0x1891,0x0000,0x0000,
+0x1893,0x0000,0x0000, 0x1895,0x0000,0x0000, 0x1897,0x0000,0x0000,
+0x1899,0x0000,0x0000, 0x189B,0x0000,0x0000, 0x1857,0x1895,0x0000,
+0x1885,0x0000,0x0000, 0x188D,0x0000,0x0000, 0x188F,0x0000,0x0000,
+0xFBC0,0x8FBD,0x0000, 0x036C,0x0000,0x0000, 0x036D,0x0000,0x0000,
+0x036E,0x0000,0x0000, 0x036F,0x0000,0x0000, 0x0370,0x0000,0x0000,
+0x0371,0x0000,0x0000, 0x0372,0x0000,0x0000, 0x0373,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0374,0x0000,0x0000, 0x0375,0x0000,0x0000,
+0x0376,0x0000,0x0000, 0x0377,0x0000,0x0000, 0x0378,0x0000,0x0000,
+0x0379,0x0000,0x0000, 0xFBC0,0x8FCD,0x0000, 0xFBC0,0x8FCE,0x0000,
+0x037A,0x0000,0x0000, 0xFBC0,0x8FD0,0x0000, 0xFBC0,0x8FD1,0x0000,
+0xFBC0,0x8FD2,0x0000, 0xFBC0,0x8FD3,0x0000, 0xFBC0,0x8FD4,0x0000,
+0xFBC0,0x8FD5,0x0000, 0xFBC0,0x8FD6,0x0000, 0xFBC0,0x8FD7,0x0000,
+0xFBC0,0x8FD8,0x0000, 0xFBC0,0x8FD9,0x0000, 0xFBC0,0x8FDA,0x0000,
+0xFBC0,0x8FDB,0x0000, 0xFBC0,0x8FDC,0x0000, 0xFBC0,0x8FDD,0x0000,
+0xFBC0,0x8FDE,0x0000, 0xFBC0,0x8FDF,0x0000, 0xFBC0,0x8FE0,0x0000,
+0xFBC0,0x8FE1,0x0000, 0xFBC0,0x8FE2,0x0000, 0xFBC0,0x8FE3,0x0000,
+0xFBC0,0x8FE4,0x0000, 0xFBC0,0x8FE5,0x0000, 0xFBC0,0x8FE6,0x0000,
+0xFBC0,0x8FE7,0x0000, 0xFBC0,0x8FE8,0x0000, 0xFBC0,0x8FE9,0x0000,
+0xFBC0,0x8FEA,0x0000, 0xFBC0,0x8FEB,0x0000, 0xFBC0,0x8FEC,0x0000,
+0xFBC0,0x8FED,0x0000, 0xFBC0,0x8FEE,0x0000, 0xFBC0,0x8FEF,0x0000,
+0xFBC0,0x8FF0,0x0000, 0xFBC0,0x8FF1,0x0000, 0xFBC0,0x8FF2,0x0000,
+0xFBC0,0x8FF3,0x0000, 0xFBC0,0x8FF4,0x0000, 0xFBC0,0x8FF5,0x0000,
+0xFBC0,0x8FF6,0x0000, 0xFBC0,0x8FF7,0x0000, 0xFBC0,0x8FF8,0x0000,
+0xFBC0,0x8FF9,0x0000, 0xFBC0,0x8FFA,0x0000, 0xFBC0,0x8FFB,0x0000,
+0xFBC0,0x8FFC,0x0000, 0xFBC0,0x8FFD,0x0000, 0xFBC0,0x8FFE,0x0000,
+0xFBC0,0x8FFF,0x0000 };
+
+uint16 page010data[]= { /* 1000 (3 weights per char) */
+0x1931,0x0000,0x0000, 0x1932,0x0000,0x0000, 0x1933,0x0000,0x0000,
+0x1934,0x0000,0x0000, 0x1935,0x0000,0x0000, 0x1936,0x0000,0x0000,
+0x1937,0x0000,0x0000, 0x1938,0x0000,0x0000, 0x1939,0x0000,0x0000,
+0x193A,0x0000,0x0000, 0x193B,0x0000,0x0000, 0x193C,0x0000,0x0000,
+0x193D,0x0000,0x0000, 0x193E,0x0000,0x0000, 0x193F,0x0000,0x0000,
+0x1940,0x0000,0x0000, 0x1941,0x0000,0x0000, 0x1942,0x0000,0x0000,
+0x1943,0x0000,0x0000, 0x1944,0x0000,0x0000, 0x1945,0x0000,0x0000,
+0x1946,0x0000,0x0000, 0x1947,0x0000,0x0000, 0x1948,0x0000,0x0000,
+0x1949,0x0000,0x0000, 0x194A,0x0000,0x0000, 0x194B,0x0000,0x0000,
+0x194C,0x0000,0x0000, 0x194D,0x0000,0x0000, 0x194E,0x0000,0x0000,
+0x1951,0x0000,0x0000, 0x1952,0x0000,0x0000, 0x1953,0x0000,0x0000,
+0x1954,0x0000,0x0000, 0xFBC0,0x9022,0x0000, 0x1955,0x0000,0x0000,
+0x1956,0x0000,0x0000, 0x1957,0x0000,0x0000, 0x1958,0x0000,0x0000,
+0x1959,0x0000,0x0000, 0xFBC0,0x9028,0x0000, 0x195A,0x0000,0x0000,
+0x195B,0x0000,0x0000, 0xFBC0,0x902B,0x0000, 0x1960,0x0000,0x0000,
+0x1961,0x0000,0x0000, 0x1962,0x0000,0x0000, 0x1963,0x0000,0x0000,
+0x1964,0x0000,0x0000, 0x1965,0x0000,0x0000, 0x1966,0x0000,0x0000,
+0xFBC0,0x9033,0x0000, 0xFBC0,0x9034,0x0000, 0xFBC0,0x9035,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x196B,0x0000,0x0000, 0xFBC0,0x903A,0x0000, 0xFBC0,0x903B,0x0000,
+0xFBC0,0x903C,0x0000, 0xFBC0,0x903D,0x0000, 0xFBC0,0x903E,0x0000,
+0xFBC0,0x903F,0x0000, 0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000,
+0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000,
+0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000,
+0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, 0x026C,0x0000,0x0000,
+0x026D,0x0000,0x0000, 0x030E,0x0000,0x0000, 0x030F,0x0000,0x0000,
+0x0310,0x0000,0x0000, 0x0311,0x0000,0x0000, 0x194F,0x0000,0x0000,
+0x1950,0x0000,0x0000, 0x195C,0x0000,0x0000, 0x195D,0x0000,0x0000,
+0x195E,0x0000,0x0000, 0x195F,0x0000,0x0000, 0x1967,0x0000,0x0000,
+0x1968,0x0000,0x0000, 0x1969,0x0000,0x0000, 0x196A,0x0000,0x0000,
+0xFBC0,0x905A,0x0000, 0xFBC0,0x905B,0x0000, 0xFBC0,0x905C,0x0000,
+0xFBC0,0x905D,0x0000, 0xFBC0,0x905E,0x0000, 0xFBC0,0x905F,0x0000,
+0xFBC0,0x9060,0x0000, 0xFBC0,0x9061,0x0000, 0xFBC0,0x9062,0x0000,
+0xFBC0,0x9063,0x0000, 0xFBC0,0x9064,0x0000, 0xFBC0,0x9065,0x0000,
+0xFBC0,0x9066,0x0000, 0xFBC0,0x9067,0x0000, 0xFBC0,0x9068,0x0000,
+0xFBC0,0x9069,0x0000, 0xFBC0,0x906A,0x0000, 0xFBC0,0x906B,0x0000,
+0xFBC0,0x906C,0x0000, 0xFBC0,0x906D,0x0000, 0xFBC0,0x906E,0x0000,
+0xFBC0,0x906F,0x0000, 0xFBC0,0x9070,0x0000, 0xFBC0,0x9071,0x0000,
+0xFBC0,0x9072,0x0000, 0xFBC0,0x9073,0x0000, 0xFBC0,0x9074,0x0000,
+0xFBC0,0x9075,0x0000, 0xFBC0,0x9076,0x0000, 0xFBC0,0x9077,0x0000,
+0xFBC0,0x9078,0x0000, 0xFBC0,0x9079,0x0000, 0xFBC0,0x907A,0x0000,
+0xFBC0,0x907B,0x0000, 0xFBC0,0x907C,0x0000, 0xFBC0,0x907D,0x0000,
+0xFBC0,0x907E,0x0000, 0xFBC0,0x907F,0x0000, 0xFBC0,0x9080,0x0000,
+0xFBC0,0x9081,0x0000, 0xFBC0,0x9082,0x0000, 0xFBC0,0x9083,0x0000,
+0xFBC0,0x9084,0x0000, 0xFBC0,0x9085,0x0000, 0xFBC0,0x9086,0x0000,
+0xFBC0,0x9087,0x0000, 0xFBC0,0x9088,0x0000, 0xFBC0,0x9089,0x0000,
+0xFBC0,0x908A,0x0000, 0xFBC0,0x908B,0x0000, 0xFBC0,0x908C,0x0000,
+0xFBC0,0x908D,0x0000, 0xFBC0,0x908E,0x0000, 0xFBC0,0x908F,0x0000,
+0xFBC0,0x9090,0x0000, 0xFBC0,0x9091,0x0000, 0xFBC0,0x9092,0x0000,
+0xFBC0,0x9093,0x0000, 0xFBC0,0x9094,0x0000, 0xFBC0,0x9095,0x0000,
+0xFBC0,0x9096,0x0000, 0xFBC0,0x9097,0x0000, 0xFBC0,0x9098,0x0000,
+0xFBC0,0x9099,0x0000, 0xFBC0,0x909A,0x0000, 0xFBC0,0x909B,0x0000,
+0xFBC0,0x909C,0x0000, 0xFBC0,0x909D,0x0000, 0xFBC0,0x909E,0x0000,
+0xFBC0,0x909F,0x0000, 0x12E1,0x0000,0x0000, 0x12E2,0x0000,0x0000,
+0x12E3,0x0000,0x0000, 0x12E4,0x0000,0x0000, 0x12E5,0x0000,0x0000,
+0x12E6,0x0000,0x0000, 0x12E7,0x0000,0x0000, 0x12E9,0x0000,0x0000,
+0x12EA,0x0000,0x0000, 0x12EB,0x0000,0x0000, 0x12EC,0x0000,0x0000,
+0x12ED,0x0000,0x0000, 0x12EE,0x0000,0x0000, 0x12F0,0x0000,0x0000,
+0x12F1,0x0000,0x0000, 0x12F2,0x0000,0x0000, 0x12F3,0x0000,0x0000,
+0x12F4,0x0000,0x0000, 0x12F5,0x0000,0x0000, 0x12F7,0x0000,0x0000,
+0x12F8,0x0000,0x0000, 0x12F9,0x0000,0x0000, 0x12FA,0x0000,0x0000,
+0x12FB,0x0000,0x0000, 0x12FC,0x0000,0x0000, 0x12FD,0x0000,0x0000,
+0x12FE,0x0000,0x0000, 0x12FF,0x0000,0x0000, 0x1300,0x0000,0x0000,
+0x1301,0x0000,0x0000, 0x1302,0x0000,0x0000, 0x1304,0x0000,0x0000,
+0x1305,0x0000,0x0000, 0x12E8,0x0000,0x0000, 0x12EF,0x0000,0x0000,
+0x12F6,0x0000,0x0000, 0x1303,0x0000,0x0000, 0x1306,0x0000,0x0000,
+0xFBC0,0x90C6,0x0000, 0xFBC0,0x90C7,0x0000, 0xFBC0,0x90C8,0x0000,
+0xFBC0,0x90C9,0x0000, 0xFBC0,0x90CA,0x0000, 0xFBC0,0x90CB,0x0000,
+0xFBC0,0x90CC,0x0000, 0xFBC0,0x90CD,0x0000, 0xFBC0,0x90CE,0x0000,
+0xFBC0,0x90CF,0x0000, 0x12E1,0x0000,0x0000, 0x12E2,0x0000,0x0000,
+0x12E3,0x0000,0x0000, 0x12E4,0x0000,0x0000, 0x12E5,0x0000,0x0000,
+0x12E6,0x0000,0x0000, 0x12E7,0x0000,0x0000, 0x12E9,0x0000,0x0000,
+0x12EA,0x0000,0x0000, 0x12EB,0x0000,0x0000, 0x12EC,0x0000,0x0000,
+0x12ED,0x0000,0x0000, 0x12EE,0x0000,0x0000, 0x12F0,0x0000,0x0000,
+0x12F1,0x0000,0x0000, 0x12F2,0x0000,0x0000, 0x12F3,0x0000,0x0000,
+0x12F4,0x0000,0x0000, 0x12F5,0x0000,0x0000, 0x12F7,0x0000,0x0000,
+0x12F8,0x0000,0x0000, 0x12F9,0x0000,0x0000, 0x12FA,0x0000,0x0000,
+0x12FB,0x0000,0x0000, 0x12FC,0x0000,0x0000, 0x12FD,0x0000,0x0000,
+0x12FE,0x0000,0x0000, 0x12FF,0x0000,0x0000, 0x1300,0x0000,0x0000,
+0x1301,0x0000,0x0000, 0x1302,0x0000,0x0000, 0x1304,0x0000,0x0000,
+0x1305,0x0000,0x0000, 0x12E8,0x0000,0x0000, 0x12EF,0x0000,0x0000,
+0x12F6,0x0000,0x0000, 0x1303,0x0000,0x0000, 0x1306,0x0000,0x0000,
+0x1307,0x0000,0x0000, 0x1308,0x0000,0x0000, 0x1309,0x0000,0x0000,
+0xFBC0,0x90F9,0x0000, 0xFBC0,0x90FA,0x0000, 0x0271,0x0000,0x0000,
+0xFBC0,0x90FC,0x0000, 0xFBC0,0x90FD,0x0000, 0xFBC0,0x90FE,0x0000,
+0xFBC0,0x90FF,0x0000 };
+
+uint16 page011data[]= { /* 1100 (3 weights per char) */
+0x1D62,0x0000,0x0000, 0x1D63,0x0000,0x0000, 0x1D64,0x0000,0x0000,
+0x1D65,0x0000,0x0000, 0x1D66,0x0000,0x0000, 0x1D67,0x0000,0x0000,
+0x1D68,0x0000,0x0000, 0x1D69,0x0000,0x0000, 0x1D6A,0x0000,0x0000,
+0x1D6B,0x0000,0x0000, 0x1D6C,0x0000,0x0000, 0x1D6D,0x0000,0x0000,
+0x1D6E,0x0000,0x0000, 0x1D6F,0x0000,0x0000, 0x1D70,0x0000,0x0000,
+0x1D71,0x0000,0x0000, 0x1D72,0x0000,0x0000, 0x1D73,0x0000,0x0000,
+0x1D74,0x0000,0x0000, 0x1D75,0x0000,0x0000, 0x1D76,0x0000,0x0000,
+0x1D77,0x0000,0x0000, 0x1D78,0x0000,0x0000, 0x1D79,0x0000,0x0000,
+0x1D7A,0x0000,0x0000, 0x1D7B,0x0000,0x0000, 0x1D7C,0x0000,0x0000,
+0x1D7D,0x0000,0x0000, 0x1D7E,0x0000,0x0000, 0x1D7F,0x0000,0x0000,
+0x1D80,0x0000,0x0000, 0x1D81,0x0000,0x0000, 0x1D82,0x0000,0x0000,
+0x1D83,0x0000,0x0000, 0x1D84,0x0000,0x0000, 0x1D85,0x0000,0x0000,
+0x1D86,0x0000,0x0000, 0x1D87,0x0000,0x0000, 0x1D88,0x0000,0x0000,
+0x1D89,0x0000,0x0000, 0x1D8A,0x0000,0x0000, 0x1D8B,0x0000,0x0000,
+0x1D8C,0x0000,0x0000, 0x1D8D,0x0000,0x0000, 0x1D8E,0x0000,0x0000,
+0x1D8F,0x0000,0x0000, 0x1D90,0x0000,0x0000, 0x1D91,0x0000,0x0000,
+0x1D92,0x0000,0x0000, 0x1D93,0x0000,0x0000, 0x1D94,0x0000,0x0000,
+0x1D95,0x0000,0x0000, 0x1D96,0x0000,0x0000, 0x1D97,0x0000,0x0000,
+0x1D98,0x0000,0x0000, 0x1D99,0x0000,0x0000, 0x1D9A,0x0000,0x0000,
+0x1D9B,0x0000,0x0000, 0x1D9C,0x0000,0x0000, 0x1D9D,0x0000,0x0000,
+0x1D9E,0x0000,0x0000, 0x1D9F,0x0000,0x0000, 0x1DA0,0x0000,0x0000,
+0x1DA1,0x0000,0x0000, 0x1DA2,0x0000,0x0000, 0x1DA3,0x0000,0x0000,
+0x1DA4,0x0000,0x0000, 0x1DA5,0x0000,0x0000, 0x1DA6,0x0000,0x0000,
+0x1DA7,0x0000,0x0000, 0x1DA8,0x0000,0x0000, 0x1DA9,0x0000,0x0000,
+0x1DAA,0x0000,0x0000, 0x1DAB,0x0000,0x0000, 0x1DAC,0x0000,0x0000,
+0x1DAD,0x0000,0x0000, 0x1DAE,0x0000,0x0000, 0x1DAF,0x0000,0x0000,
+0x1DB0,0x0000,0x0000, 0x1DB1,0x0000,0x0000, 0x1DB2,0x0000,0x0000,
+0x1DB3,0x0000,0x0000, 0x1DB4,0x0000,0x0000, 0x1DB5,0x0000,0x0000,
+0x1DB6,0x0000,0x0000, 0x1DB7,0x0000,0x0000, 0x1DB8,0x0000,0x0000,
+0x1DB9,0x0000,0x0000, 0x1DBA,0x0000,0x0000, 0x1DBB,0x0000,0x0000,
+0xFBC0,0x915A,0x0000, 0xFBC0,0x915B,0x0000, 0xFBC0,0x915C,0x0000,
+0xFBC0,0x915D,0x0000, 0xFBC0,0x915E,0x0000, 0x1DBC,0x0000,0x0000,
+0x1DBD,0x0000,0x0000, 0x1DBE,0x0000,0x0000, 0x1DBF,0x0000,0x0000,
+0x1DC0,0x0000,0x0000, 0x1DC1,0x0000,0x0000, 0x1DC2,0x0000,0x0000,
+0x1DC3,0x0000,0x0000, 0x1DC4,0x0000,0x0000, 0x1DC5,0x0000,0x0000,
+0x1DC6,0x0000,0x0000, 0x1DC7,0x0000,0x0000, 0x1DC8,0x0000,0x0000,
+0x1DC9,0x0000,0x0000, 0x1DCA,0x0000,0x0000, 0x1DCB,0x0000,0x0000,
+0x1DCC,0x0000,0x0000, 0x1DCD,0x0000,0x0000, 0x1DCE,0x0000,0x0000,
+0x1DCF,0x0000,0x0000, 0x1DD0,0x0000,0x0000, 0x1DD1,0x0000,0x0000,
+0x1DD2,0x0000,0x0000, 0x1DD3,0x0000,0x0000, 0x1DD4,0x0000,0x0000,
+0x1DD5,0x0000,0x0000, 0x1DD6,0x0000,0x0000, 0x1DD7,0x0000,0x0000,
+0x1DD8,0x0000,0x0000, 0x1DD9,0x0000,0x0000, 0x1DDA,0x0000,0x0000,
+0x1DDB,0x0000,0x0000, 0x1DDC,0x0000,0x0000, 0x1DDD,0x0000,0x0000,
+0x1DDE,0x0000,0x0000, 0x1DDF,0x0000,0x0000, 0x1DE0,0x0000,0x0000,
+0x1DE1,0x0000,0x0000, 0x1DE2,0x0000,0x0000, 0x1DE3,0x0000,0x0000,
+0x1DE4,0x0000,0x0000, 0x1DE5,0x0000,0x0000, 0x1DE6,0x0000,0x0000,
+0x1DE7,0x0000,0x0000, 0x1DE8,0x0000,0x0000, 0x1DE9,0x0000,0x0000,
+0x1DEA,0x0000,0x0000, 0x1DEB,0x0000,0x0000, 0x1DEC,0x0000,0x0000,
+0x1DED,0x0000,0x0000, 0x1DEE,0x0000,0x0000, 0x1DEF,0x0000,0x0000,
+0x1DF0,0x0000,0x0000, 0x1DF1,0x0000,0x0000, 0x1DF2,0x0000,0x0000,
+0x1DF3,0x0000,0x0000, 0x1DF4,0x0000,0x0000, 0x1DF5,0x0000,0x0000,
+0x1DF6,0x0000,0x0000, 0x1DF7,0x0000,0x0000, 0x1DF8,0x0000,0x0000,
+0x1DF9,0x0000,0x0000, 0x1DFA,0x0000,0x0000, 0x1DFB,0x0000,0x0000,
+0x1DFC,0x0000,0x0000, 0x1DFD,0x0000,0x0000, 0x1DFE,0x0000,0x0000,
+0x1DFF,0x0000,0x0000, 0xFBC0,0x91A3,0x0000, 0xFBC0,0x91A4,0x0000,
+0xFBC0,0x91A5,0x0000, 0xFBC0,0x91A6,0x0000, 0xFBC0,0x91A7,0x0000,
+0x1E00,0x0000,0x0000, 0x1E01,0x0000,0x0000, 0x1E02,0x0000,0x0000,
+0x1E03,0x0000,0x0000, 0x1E04,0x0000,0x0000, 0x1E05,0x0000,0x0000,
+0x1E06,0x0000,0x0000, 0x1E07,0x0000,0x0000, 0x1E08,0x0000,0x0000,
+0x1E09,0x0000,0x0000, 0x1E0A,0x0000,0x0000, 0x1E0B,0x0000,0x0000,
+0x1E0C,0x0000,0x0000, 0x1E0D,0x0000,0x0000, 0x1E0E,0x0000,0x0000,
+0x1E0F,0x0000,0x0000, 0x1E10,0x0000,0x0000, 0x1E11,0x0000,0x0000,
+0x1E12,0x0000,0x0000, 0x1E13,0x0000,0x0000, 0x1E14,0x0000,0x0000,
+0x1E15,0x0000,0x0000, 0x1E16,0x0000,0x0000, 0x1E17,0x0000,0x0000,
+0x1E18,0x0000,0x0000, 0x1E19,0x0000,0x0000, 0x1E1A,0x0000,0x0000,
+0x1E1B,0x0000,0x0000, 0x1E1C,0x0000,0x0000, 0x1E1D,0x0000,0x0000,
+0x1E1E,0x0000,0x0000, 0x1E1F,0x0000,0x0000, 0x1E20,0x0000,0x0000,
+0x1E21,0x0000,0x0000, 0x1E22,0x0000,0x0000, 0x1E23,0x0000,0x0000,
+0x1E24,0x0000,0x0000, 0x1E25,0x0000,0x0000, 0x1E26,0x0000,0x0000,
+0x1E27,0x0000,0x0000, 0x1E28,0x0000,0x0000, 0x1E29,0x0000,0x0000,
+0x1E2A,0x0000,0x0000, 0x1E2B,0x0000,0x0000, 0x1E2C,0x0000,0x0000,
+0x1E2D,0x0000,0x0000, 0x1E2E,0x0000,0x0000, 0x1E2F,0x0000,0x0000,
+0x1E30,0x0000,0x0000, 0x1E31,0x0000,0x0000, 0x1E32,0x0000,0x0000,
+0x1E33,0x0000,0x0000, 0x1E34,0x0000,0x0000, 0x1E35,0x0000,0x0000,
+0x1E36,0x0000,0x0000, 0x1E37,0x0000,0x0000, 0x1E38,0x0000,0x0000,
+0x1E39,0x0000,0x0000, 0x1E3A,0x0000,0x0000, 0x1E3B,0x0000,0x0000,
+0x1E3C,0x0000,0x0000, 0x1E3D,0x0000,0x0000, 0x1E3E,0x0000,0x0000,
+0x1E3F,0x0000,0x0000, 0x1E40,0x0000,0x0000, 0x1E41,0x0000,0x0000,
+0x1E42,0x0000,0x0000, 0x1E43,0x0000,0x0000, 0x1E44,0x0000,0x0000,
+0x1E45,0x0000,0x0000, 0x1E46,0x0000,0x0000, 0x1E47,0x0000,0x0000,
+0x1E48,0x0000,0x0000, 0x1E49,0x0000,0x0000, 0x1E4A,0x0000,0x0000,
+0x1E4B,0x0000,0x0000, 0x1E4C,0x0000,0x0000, 0x1E4D,0x0000,0x0000,
+0x1E4E,0x0000,0x0000, 0x1E4F,0x0000,0x0000, 0x1E50,0x0000,0x0000,
+0x1E51,0x0000,0x0000, 0xFBC0,0x91FA,0x0000, 0xFBC0,0x91FB,0x0000,
+0xFBC0,0x91FC,0x0000, 0xFBC0,0x91FD,0x0000, 0xFBC0,0x91FE,0x0000,
+0xFBC0,0x91FF,0x0000 };
+
+uint16 page012data[]= { /* 1200 (3 weights per char) */
+0x141C,0x0000,0x0000, 0x141D,0x0000,0x0000, 0x141E,0x0000,0x0000,
+0x141F,0x0000,0x0000, 0x1420,0x0000,0x0000, 0x1421,0x0000,0x0000,
+0x1422,0x0000,0x0000, 0xFBC0,0x9207,0x0000, 0x1423,0x0000,0x0000,
+0x1424,0x0000,0x0000, 0x1425,0x0000,0x0000, 0x1426,0x0000,0x0000,
+0x1427,0x0000,0x0000, 0x1428,0x0000,0x0000, 0x1429,0x0000,0x0000,
+0x142A,0x0000,0x0000, 0x142B,0x0000,0x0000, 0x142C,0x0000,0x0000,
+0x142D,0x0000,0x0000, 0x142E,0x0000,0x0000, 0x142F,0x0000,0x0000,
+0x1430,0x0000,0x0000, 0x1431,0x0000,0x0000, 0x1432,0x0000,0x0000,
+0x1433,0x0000,0x0000, 0x1434,0x0000,0x0000, 0x1435,0x0000,0x0000,
+0x1436,0x0000,0x0000, 0x1437,0x0000,0x0000, 0x1438,0x0000,0x0000,
+0x1439,0x0000,0x0000, 0x143A,0x0000,0x0000, 0x143B,0x0000,0x0000,
+0x143C,0x0000,0x0000, 0x143D,0x0000,0x0000, 0x143E,0x0000,0x0000,
+0x143F,0x0000,0x0000, 0x1440,0x0000,0x0000, 0x1441,0x0000,0x0000,
+0x1442,0x0000,0x0000, 0x1443,0x0000,0x0000, 0x1444,0x0000,0x0000,
+0x1445,0x0000,0x0000, 0x1446,0x0000,0x0000, 0x1447,0x0000,0x0000,
+0x1448,0x0000,0x0000, 0x1449,0x0000,0x0000, 0x144A,0x0000,0x0000,
+0x144B,0x0000,0x0000, 0x144C,0x0000,0x0000, 0x144D,0x0000,0x0000,
+0x144E,0x0000,0x0000, 0x144F,0x0000,0x0000, 0x1450,0x0000,0x0000,
+0x1451,0x0000,0x0000, 0x1452,0x0000,0x0000, 0x1453,0x0000,0x0000,
+0x1454,0x0000,0x0000, 0x1455,0x0000,0x0000, 0x1456,0x0000,0x0000,
+0x1457,0x0000,0x0000, 0x1458,0x0000,0x0000, 0x1459,0x0000,0x0000,
+0x145A,0x0000,0x0000, 0x145B,0x0000,0x0000, 0x145C,0x0000,0x0000,
+0x145D,0x0000,0x0000, 0x145E,0x0000,0x0000, 0x145F,0x0000,0x0000,
+0x1460,0x0000,0x0000, 0x1461,0x0000,0x0000, 0xFBC0,0x9247,0x0000,
+0x1462,0x0000,0x0000, 0xFBC0,0x9249,0x0000, 0x1463,0x0000,0x0000,
+0x1464,0x0000,0x0000, 0x1465,0x0000,0x0000, 0x1466,0x0000,0x0000,
+0xFBC0,0x924E,0x0000, 0xFBC0,0x924F,0x0000, 0x1467,0x0000,0x0000,
+0x1468,0x0000,0x0000, 0x1469,0x0000,0x0000, 0x146A,0x0000,0x0000,
+0x146B,0x0000,0x0000, 0x146C,0x0000,0x0000, 0x146D,0x0000,0x0000,
+0xFBC0,0x9257,0x0000, 0x146E,0x0000,0x0000, 0xFBC0,0x9259,0x0000,
+0x146F,0x0000,0x0000, 0x1470,0x0000,0x0000, 0x1471,0x0000,0x0000,
+0x1472,0x0000,0x0000, 0xFBC0,0x925E,0x0000, 0xFBC0,0x925F,0x0000,
+0x1473,0x0000,0x0000, 0x1474,0x0000,0x0000, 0x1475,0x0000,0x0000,
+0x1476,0x0000,0x0000, 0x1477,0x0000,0x0000, 0x1478,0x0000,0x0000,
+0x1479,0x0000,0x0000, 0x147A,0x0000,0x0000, 0x147B,0x0000,0x0000,
+0x147C,0x0000,0x0000, 0x147D,0x0000,0x0000, 0x147E,0x0000,0x0000,
+0x147F,0x0000,0x0000, 0x1480,0x0000,0x0000, 0x1481,0x0000,0x0000,
+0x1482,0x0000,0x0000, 0x1483,0x0000,0x0000, 0x1484,0x0000,0x0000,
+0x1485,0x0000,0x0000, 0x1486,0x0000,0x0000, 0x1487,0x0000,0x0000,
+0x1488,0x0000,0x0000, 0x1489,0x0000,0x0000, 0x148A,0x0000,0x0000,
+0x148B,0x0000,0x0000, 0x148C,0x0000,0x0000, 0x148D,0x0000,0x0000,
+0x148E,0x0000,0x0000, 0x148F,0x0000,0x0000, 0x1490,0x0000,0x0000,
+0x1491,0x0000,0x0000, 0x1492,0x0000,0x0000, 0x1493,0x0000,0x0000,
+0x1494,0x0000,0x0000, 0x1495,0x0000,0x0000, 0x1496,0x0000,0x0000,
+0x1497,0x0000,0x0000, 0x1498,0x0000,0x0000, 0x1499,0x0000,0x0000,
+0xFBC0,0x9287,0x0000, 0x149A,0x0000,0x0000, 0xFBC0,0x9289,0x0000,
+0x149B,0x0000,0x0000, 0x149C,0x0000,0x0000, 0x149D,0x0000,0x0000,
+0x149E,0x0000,0x0000, 0xFBC0,0x928E,0x0000, 0xFBC0,0x928F,0x0000,
+0x149F,0x0000,0x0000, 0x14A0,0x0000,0x0000, 0x14A1,0x0000,0x0000,
+0x14A2,0x0000,0x0000, 0x14A3,0x0000,0x0000, 0x14A4,0x0000,0x0000,
+0x14A5,0x0000,0x0000, 0x14A6,0x0000,0x0000, 0x14A7,0x0000,0x0000,
+0x14A8,0x0000,0x0000, 0x14A9,0x0000,0x0000, 0x14AA,0x0000,0x0000,
+0x14AB,0x0000,0x0000, 0x14AC,0x0000,0x0000, 0x14AD,0x0000,0x0000,
+0x14AE,0x0000,0x0000, 0x14AF,0x0000,0x0000, 0x14B0,0x0000,0x0000,
+0x14B1,0x0000,0x0000, 0x14B2,0x0000,0x0000, 0x14B3,0x0000,0x0000,
+0x14B4,0x0000,0x0000, 0x14B5,0x0000,0x0000, 0x14B6,0x0000,0x0000,
+0x14B7,0x0000,0x0000, 0x14B8,0x0000,0x0000, 0x14B9,0x0000,0x0000,
+0x14BA,0x0000,0x0000, 0x14BB,0x0000,0x0000, 0x14BC,0x0000,0x0000,
+0x14BD,0x0000,0x0000, 0xFBC0,0x92AF,0x0000, 0x14BE,0x0000,0x0000,
+0xFBC0,0x92B1,0x0000, 0x14BF,0x0000,0x0000, 0x14C0,0x0000,0x0000,
+0x14C1,0x0000,0x0000, 0x14C2,0x0000,0x0000, 0xFBC0,0x92B6,0x0000,
+0xFBC0,0x92B7,0x0000, 0x14C3,0x0000,0x0000, 0x14C4,0x0000,0x0000,
+0x14C5,0x0000,0x0000, 0x14C6,0x0000,0x0000, 0x14C7,0x0000,0x0000,
+0x14C8,0x0000,0x0000, 0x14C9,0x0000,0x0000, 0xFBC0,0x92BF,0x0000,
+0x14CA,0x0000,0x0000, 0xFBC0,0x92C1,0x0000, 0x14CB,0x0000,0x0000,
+0x14CC,0x0000,0x0000, 0x14CD,0x0000,0x0000, 0x14CE,0x0000,0x0000,
+0xFBC0,0x92C6,0x0000, 0xFBC0,0x92C7,0x0000, 0x14CF,0x0000,0x0000,
+0x14D0,0x0000,0x0000, 0x14D1,0x0000,0x0000, 0x14D2,0x0000,0x0000,
+0x14D3,0x0000,0x0000, 0x14D4,0x0000,0x0000, 0x14D5,0x0000,0x0000,
+0xFBC0,0x92CF,0x0000, 0x14D6,0x0000,0x0000, 0x14D7,0x0000,0x0000,
+0x14D8,0x0000,0x0000, 0x14D9,0x0000,0x0000, 0x14DA,0x0000,0x0000,
+0x14DB,0x0000,0x0000, 0x14DC,0x0000,0x0000, 0xFBC0,0x92D7,0x0000,
+0x14DD,0x0000,0x0000, 0x14DE,0x0000,0x0000, 0x14DF,0x0000,0x0000,
+0x14E0,0x0000,0x0000, 0x14E1,0x0000,0x0000, 0x14E2,0x0000,0x0000,
+0x14E3,0x0000,0x0000, 0x14E4,0x0000,0x0000, 0x14E5,0x0000,0x0000,
+0x14E6,0x0000,0x0000, 0x14E7,0x0000,0x0000, 0x14E8,0x0000,0x0000,
+0x14E9,0x0000,0x0000, 0x14EA,0x0000,0x0000, 0x14EB,0x0000,0x0000,
+0x14EC,0x0000,0x0000, 0x14ED,0x0000,0x0000, 0x14EE,0x0000,0x0000,
+0x14EF,0x0000,0x0000, 0x14F0,0x0000,0x0000, 0x14F1,0x0000,0x0000,
+0x14F2,0x0000,0x0000, 0x14F3,0x0000,0x0000, 0xFBC0,0x92EF,0x0000,
+0x14F4,0x0000,0x0000, 0x14F5,0x0000,0x0000, 0x14F6,0x0000,0x0000,
+0x14F7,0x0000,0x0000, 0x14F8,0x0000,0x0000, 0x14F9,0x0000,0x0000,
+0x14FA,0x0000,0x0000, 0x14FB,0x0000,0x0000, 0x14FC,0x0000,0x0000,
+0x14FD,0x0000,0x0000, 0x14FE,0x0000,0x0000, 0x14FF,0x0000,0x0000,
+0x1500,0x0000,0x0000, 0x1501,0x0000,0x0000, 0x1502,0x0000,0x0000,
+0x1503,0x0000,0x0000 };
+
+uint16 page013data[]= { /* 1300 (3 weights per char) */
+0x1504,0x0000,0x0000, 0x1505,0x0000,0x0000, 0x1506,0x0000,0x0000,
+0x1507,0x0000,0x0000, 0x1508,0x0000,0x0000, 0x1509,0x0000,0x0000,
+0x150A,0x0000,0x0000, 0x150B,0x0000,0x0000, 0x150C,0x0000,0x0000,
+0x150D,0x0000,0x0000, 0x150E,0x0000,0x0000, 0x150F,0x0000,0x0000,
+0x1510,0x0000,0x0000, 0x1511,0x0000,0x0000, 0x1512,0x0000,0x0000,
+0xFBC0,0x930F,0x0000, 0x1513,0x0000,0x0000, 0xFBC0,0x9311,0x0000,
+0x1514,0x0000,0x0000, 0x1515,0x0000,0x0000, 0x1516,0x0000,0x0000,
+0x1517,0x0000,0x0000, 0xFBC0,0x9316,0x0000, 0xFBC0,0x9317,0x0000,
+0x1518,0x0000,0x0000, 0x1519,0x0000,0x0000, 0x151A,0x0000,0x0000,
+0x151B,0x0000,0x0000, 0x151C,0x0000,0x0000, 0x151D,0x0000,0x0000,
+0x151E,0x0000,0x0000, 0xFBC0,0x931F,0x0000, 0x151F,0x0000,0x0000,
+0x1520,0x0000,0x0000, 0x1521,0x0000,0x0000, 0x1522,0x0000,0x0000,
+0x1523,0x0000,0x0000, 0x1524,0x0000,0x0000, 0x1525,0x0000,0x0000,
+0x1526,0x0000,0x0000, 0x1527,0x0000,0x0000, 0x1528,0x0000,0x0000,
+0x1529,0x0000,0x0000, 0x152A,0x0000,0x0000, 0x152B,0x0000,0x0000,
+0x152C,0x0000,0x0000, 0x152D,0x0000,0x0000, 0x152E,0x0000,0x0000,
+0x152F,0x0000,0x0000, 0x1530,0x0000,0x0000, 0x1531,0x0000,0x0000,
+0x1532,0x0000,0x0000, 0x1533,0x0000,0x0000, 0x1534,0x0000,0x0000,
+0x1535,0x0000,0x0000, 0x1536,0x0000,0x0000, 0x1537,0x0000,0x0000,
+0x1538,0x0000,0x0000, 0x1539,0x0000,0x0000, 0x153A,0x0000,0x0000,
+0x153B,0x0000,0x0000, 0x153C,0x0000,0x0000, 0x153D,0x0000,0x0000,
+0x153E,0x0000,0x0000, 0x153F,0x0000,0x0000, 0x1540,0x0000,0x0000,
+0x1541,0x0000,0x0000, 0x1542,0x0000,0x0000, 0x1543,0x0000,0x0000,
+0x1544,0x0000,0x0000, 0x1545,0x0000,0x0000, 0xFBC0,0x9347,0x0000,
+0x1546,0x0000,0x0000, 0x1547,0x0000,0x0000, 0x1548,0x0000,0x0000,
+0x1549,0x0000,0x0000, 0x154A,0x0000,0x0000, 0x154B,0x0000,0x0000,
+0x154C,0x0000,0x0000, 0x154D,0x0000,0x0000, 0x154E,0x0000,0x0000,
+0x154F,0x0000,0x0000, 0x1550,0x0000,0x0000, 0x1551,0x0000,0x0000,
+0x1552,0x0000,0x0000, 0x1553,0x0000,0x0000, 0x1554,0x0000,0x0000,
+0x1555,0x0000,0x0000, 0x1556,0x0000,0x0000, 0x1557,0x0000,0x0000,
+0x1558,0x0000,0x0000, 0xFBC0,0x935B,0x0000, 0xFBC0,0x935C,0x0000,
+0xFBC0,0x935D,0x0000, 0xFBC0,0x935E,0x0000, 0xFBC0,0x935F,0x0000,
+0xFBC0,0x9360,0x0000, 0x0245,0x0000,0x0000, 0x0262,0x0000,0x0000,
+0x0246,0x0000,0x0000, 0x0247,0x0000,0x0000, 0x0248,0x0000,0x0000,
+0x0249,0x0000,0x0000, 0x025A,0x0000,0x0000, 0x0272,0x0000,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0x0DCC,0x0000,0x0000, 0x0DCD,0x0000,0x0000, 0x0DCE,0x0000,0x0000,
+0x0DCF,0x0000,0x0000, 0x0DD0,0x0000,0x0000, 0x0DD1,0x0000,0x0000,
+0x0DD2,0x0000,0x0000, 0x0DD3,0x0000,0x0000, 0x0DD4,0x0000,0x0000,
+0x0DD5,0x0000,0x0000, 0x0DD6,0x0000,0x0000, 0xFBC0,0x937D,0x0000,
+0xFBC0,0x937E,0x0000, 0xFBC0,0x937F,0x0000, 0xFBC0,0x9380,0x0000,
+0xFBC0,0x9381,0x0000, 0xFBC0,0x9382,0x0000, 0xFBC0,0x9383,0x0000,
+0xFBC0,0x9384,0x0000, 0xFBC0,0x9385,0x0000, 0xFBC0,0x9386,0x0000,
+0xFBC0,0x9387,0x0000, 0xFBC0,0x9388,0x0000, 0xFBC0,0x9389,0x0000,
+0xFBC0,0x938A,0x0000, 0xFBC0,0x938B,0x0000, 0xFBC0,0x938C,0x0000,
+0xFBC0,0x938D,0x0000, 0xFBC0,0x938E,0x0000, 0xFBC0,0x938F,0x0000,
+0xFBC0,0x9390,0x0000, 0xFBC0,0x9391,0x0000, 0xFBC0,0x9392,0x0000,
+0xFBC0,0x9393,0x0000, 0xFBC0,0x9394,0x0000, 0xFBC0,0x9395,0x0000,
+0xFBC0,0x9396,0x0000, 0xFBC0,0x9397,0x0000, 0xFBC0,0x9398,0x0000,
+0xFBC0,0x9399,0x0000, 0xFBC0,0x939A,0x0000, 0xFBC0,0x939B,0x0000,
+0xFBC0,0x939C,0x0000, 0xFBC0,0x939D,0x0000, 0xFBC0,0x939E,0x0000,
+0xFBC0,0x939F,0x0000, 0x1A59,0x0000,0x0000, 0x1A5A,0x0000,0x0000,
+0x1A5B,0x0000,0x0000, 0x1A5C,0x0000,0x0000, 0x1A5D,0x0000,0x0000,
+0x1A5E,0x0000,0x0000, 0x1A5F,0x0000,0x0000, 0x1A60,0x0000,0x0000,
+0x1A61,0x0000,0x0000, 0x1A62,0x0000,0x0000, 0x1A63,0x0000,0x0000,
+0x1A64,0x0000,0x0000, 0x1A65,0x0000,0x0000, 0x1A66,0x0000,0x0000,
+0x1A67,0x0000,0x0000, 0x1A68,0x0000,0x0000, 0x1A69,0x0000,0x0000,
+0x1A6A,0x0000,0x0000, 0x1A6B,0x0000,0x0000, 0x1A6C,0x0000,0x0000,
+0x1A6D,0x0000,0x0000, 0x1A6E,0x0000,0x0000, 0x1A6F,0x0000,0x0000,
+0x1A70,0x0000,0x0000, 0x1A71,0x0000,0x0000, 0x1A72,0x0000,0x0000,
+0x1A73,0x0000,0x0000, 0x1A74,0x0000,0x0000, 0x1A75,0x0000,0x0000,
+0x1A76,0x0000,0x0000, 0x1A77,0x0000,0x0000, 0x1A78,0x0000,0x0000,
+0x1A79,0x0000,0x0000, 0x1A7A,0x0000,0x0000, 0x1A7B,0x0000,0x0000,
+0x1A7C,0x0000,0x0000, 0x1A7D,0x0000,0x0000, 0x1A7E,0x0000,0x0000,
+0x1A7F,0x0000,0x0000, 0x1A80,0x0000,0x0000, 0x1A81,0x0000,0x0000,
+0x1A82,0x0000,0x0000, 0x1A83,0x0000,0x0000, 0x1A84,0x0000,0x0000,
+0x1A85,0x0000,0x0000, 0x1A86,0x0000,0x0000, 0x1A87,0x0000,0x0000,
+0x1A88,0x0000,0x0000, 0x1A89,0x0000,0x0000, 0x1A8A,0x0000,0x0000,
+0x1A8B,0x0000,0x0000, 0x1A8C,0x0000,0x0000, 0x1A8D,0x0000,0x0000,
+0x1A8E,0x0000,0x0000, 0x1A8F,0x0000,0x0000, 0x1A90,0x0000,0x0000,
+0x1A91,0x0000,0x0000, 0x1A92,0x0000,0x0000, 0x1A93,0x0000,0x0000,
+0x1A94,0x0000,0x0000, 0x1A95,0x0000,0x0000, 0x1A96,0x0000,0x0000,
+0x1A97,0x0000,0x0000, 0x1A98,0x0000,0x0000, 0x1A99,0x0000,0x0000,
+0x1A9A,0x0000,0x0000, 0x1A9B,0x0000,0x0000, 0x1A9C,0x0000,0x0000,
+0x1A9D,0x0000,0x0000, 0x1A9E,0x0000,0x0000, 0x1A9F,0x0000,0x0000,
+0x1AA0,0x0000,0x0000, 0x1AA1,0x0000,0x0000, 0x1AA2,0x0000,0x0000,
+0x1AA3,0x0000,0x0000, 0x1AA4,0x0000,0x0000, 0x1AA5,0x0000,0x0000,
+0x1AA6,0x0000,0x0000, 0x1AA7,0x0000,0x0000, 0x1AA8,0x0000,0x0000,
+0x1AA9,0x0000,0x0000, 0x1AAA,0x0000,0x0000, 0x1AAB,0x0000,0x0000,
+0x1AAC,0x0000,0x0000, 0x1AAD,0x0000,0x0000, 0xFBC0,0x93F5,0x0000,
+0xFBC0,0x93F6,0x0000, 0xFBC0,0x93F7,0x0000, 0xFBC0,0x93F8,0x0000,
+0xFBC0,0x93F9,0x0000, 0xFBC0,0x93FA,0x0000, 0xFBC0,0x93FB,0x0000,
+0xFBC0,0x93FC,0x0000, 0xFBC0,0x93FD,0x0000, 0xFBC0,0x93FE,0x0000,
+0xFBC0,0x93FF,0x0000 };
+
+uint16 page014data[]= { /* 1400 (3 weights per char) */
+0xFBC0,0x9400,0x0000, 0x1AAE,0x0000,0x0000, 0x1AAF,0x0000,0x0000,
+0x1AB0,0x0000,0x0000, 0x1AB1,0x0000,0x0000, 0x1AB2,0x0000,0x0000,
+0x1AB3,0x0000,0x0000, 0x1AB4,0x0000,0x0000, 0x1AB5,0x0000,0x0000,
+0x1AB6,0x0000,0x0000, 0x1AB7,0x0000,0x0000, 0x1AB8,0x0000,0x0000,
+0x1AB9,0x0000,0x0000, 0x1ABA,0x0000,0x0000, 0x1ABB,0x0000,0x0000,
+0x1ABC,0x0000,0x0000, 0x1ABD,0x0000,0x0000, 0x1ABE,0x0000,0x0000,
+0x1ABF,0x0000,0x0000, 0x1AC0,0x0000,0x0000, 0x1AC1,0x0000,0x0000,
+0x1AC2,0x0000,0x0000, 0x1AC3,0x0000,0x0000, 0x1AC4,0x0000,0x0000,
+0x1AC5,0x0000,0x0000, 0x1AC6,0x0000,0x0000, 0x1AC7,0x0000,0x0000,
+0x1AC8,0x0000,0x0000, 0x1AC9,0x0000,0x0000, 0x1ACA,0x0000,0x0000,
+0x1ACB,0x0000,0x0000, 0x1ACC,0x0000,0x0000, 0x1ACD,0x0000,0x0000,
+0x1ACE,0x0000,0x0000, 0x1ACF,0x0000,0x0000, 0x1AD0,0x0000,0x0000,
+0x1AD1,0x0000,0x0000, 0x1AD2,0x0000,0x0000, 0x1AD3,0x0000,0x0000,
+0x1AD4,0x0000,0x0000, 0x1AD5,0x0000,0x0000, 0x1AD6,0x0000,0x0000,
+0x1AD7,0x0000,0x0000, 0x1AD8,0x0000,0x0000, 0x1AD9,0x0000,0x0000,
+0x1ADA,0x0000,0x0000, 0x1ADB,0x0000,0x0000, 0x1ADC,0x0000,0x0000,
+0x1ADD,0x0000,0x0000, 0x1ADE,0x0000,0x0000, 0x1ADF,0x0000,0x0000,
+0x1AE0,0x0000,0x0000, 0x1AE1,0x0000,0x0000, 0x1AE2,0x0000,0x0000,
+0x1AE3,0x0000,0x0000, 0x1AE4,0x0000,0x0000, 0x1AE5,0x0000,0x0000,
+0x1AE6,0x0000,0x0000, 0x1AE7,0x0000,0x0000, 0x1AE8,0x0000,0x0000,
+0x1AE9,0x0000,0x0000, 0x1AEA,0x0000,0x0000, 0x1AEB,0x0000,0x0000,
+0x1AEC,0x0000,0x0000, 0x1AED,0x0000,0x0000, 0x1AEE,0x0000,0x0000,
+0x1AEF,0x0000,0x0000, 0x1AF0,0x0000,0x0000, 0x1AF1,0x0000,0x0000,
+0x1AF2,0x0000,0x0000, 0x1AF3,0x0000,0x0000, 0x1AF4,0x0000,0x0000,
+0x1AF5,0x0000,0x0000, 0x1AF6,0x0000,0x0000, 0x1AF7,0x0000,0x0000,
+0x1AF8,0x0000,0x0000, 0x1AF9,0x0000,0x0000, 0x1AFA,0x0000,0x0000,
+0x1AFB,0x0000,0x0000, 0x1AFC,0x0000,0x0000, 0x1AFD,0x0000,0x0000,
+0x1AFE,0x0000,0x0000, 0x1AFF,0x0000,0x0000, 0x1B00,0x0000,0x0000,
+0x1B01,0x0000,0x0000, 0x1B02,0x0000,0x0000, 0x1B03,0x0000,0x0000,
+0x1B04,0x0000,0x0000, 0x1B05,0x0000,0x0000, 0x1B06,0x0000,0x0000,
+0x1B07,0x0000,0x0000, 0x1B08,0x0000,0x0000, 0x1B09,0x0000,0x0000,
+0x1B0A,0x0000,0x0000, 0x1B0B,0x0000,0x0000, 0x1B0C,0x0000,0x0000,
+0x1B0D,0x0000,0x0000, 0x1B0E,0x0000,0x0000, 0x1B0F,0x0000,0x0000,
+0x1B10,0x0000,0x0000, 0x1B11,0x0000,0x0000, 0x1B12,0x0000,0x0000,
+0x1B13,0x0000,0x0000, 0x1B14,0x0000,0x0000, 0x1B15,0x0000,0x0000,
+0x1B16,0x0000,0x0000, 0x1B17,0x0000,0x0000, 0x1B18,0x0000,0x0000,
+0x1B19,0x0000,0x0000, 0x1B1A,0x0000,0x0000, 0x1B1B,0x0000,0x0000,
+0x1B1C,0x0000,0x0000, 0x1B1D,0x0000,0x0000, 0x1B1E,0x0000,0x0000,
+0x1B1F,0x0000,0x0000, 0x1B20,0x0000,0x0000, 0x1B21,0x0000,0x0000,
+0x1B22,0x0000,0x0000, 0x1B23,0x0000,0x0000, 0x1B24,0x0000,0x0000,
+0x1B25,0x0000,0x0000, 0x1B26,0x0000,0x0000, 0x1B27,0x0000,0x0000,
+0x1B28,0x0000,0x0000, 0x1B29,0x0000,0x0000, 0x1B2A,0x0000,0x0000,
+0x1B2B,0x0000,0x0000, 0x1B2C,0x0000,0x0000, 0x1B2D,0x0000,0x0000,
+0x1B2E,0x0000,0x0000, 0x1B2F,0x0000,0x0000, 0x1B30,0x0000,0x0000,
+0x1B31,0x0000,0x0000, 0x1B32,0x0000,0x0000, 0x1B33,0x0000,0x0000,
+0x1B34,0x0000,0x0000, 0x1B35,0x0000,0x0000, 0x1B36,0x0000,0x0000,
+0x1B37,0x0000,0x0000, 0x1B38,0x0000,0x0000, 0x1B39,0x0000,0x0000,
+0x1B3A,0x0000,0x0000, 0x1B3B,0x0000,0x0000, 0x1B3C,0x0000,0x0000,
+0x1B3D,0x0000,0x0000, 0x1B3E,0x0000,0x0000, 0x1B3F,0x0000,0x0000,
+0x1B40,0x0000,0x0000, 0x1B41,0x0000,0x0000, 0x1B42,0x0000,0x0000,
+0x1B43,0x0000,0x0000, 0x1B44,0x0000,0x0000, 0x1B45,0x0000,0x0000,
+0x1B46,0x0000,0x0000, 0x1B47,0x0000,0x0000, 0x1B48,0x0000,0x0000,
+0x1B49,0x0000,0x0000, 0x1B4A,0x0000,0x0000, 0x1B4B,0x0000,0x0000,
+0x1B4C,0x0000,0x0000, 0x1B4D,0x0000,0x0000, 0x1B4E,0x0000,0x0000,
+0x1B4F,0x0000,0x0000, 0x1B50,0x0000,0x0000, 0x1B51,0x0000,0x0000,
+0x1B52,0x0000,0x0000, 0x1B53,0x0000,0x0000, 0x1B54,0x0000,0x0000,
+0x1B55,0x0000,0x0000, 0x1B56,0x0000,0x0000, 0x1B57,0x0000,0x0000,
+0x1B58,0x0000,0x0000, 0x1B59,0x0000,0x0000, 0x1B5A,0x0000,0x0000,
+0x1B5B,0x0000,0x0000, 0x1B5C,0x0000,0x0000, 0x1B5D,0x0000,0x0000,
+0x1B5E,0x0000,0x0000, 0x1B5F,0x0000,0x0000, 0x1B60,0x0000,0x0000,
+0x1B61,0x0000,0x0000, 0x1B62,0x0000,0x0000, 0x1B63,0x0000,0x0000,
+0x1B64,0x0000,0x0000, 0x1B65,0x0000,0x0000, 0x1B66,0x0000,0x0000,
+0x1B67,0x0000,0x0000, 0x1B68,0x0000,0x0000, 0x1B69,0x0000,0x0000,
+0x1B6A,0x0000,0x0000, 0x1B6B,0x0000,0x0000, 0x1B6C,0x0000,0x0000,
+0x1B6D,0x0000,0x0000, 0x1B6E,0x0000,0x0000, 0x1B6F,0x0000,0x0000,
+0x1B70,0x0000,0x0000, 0x1B71,0x0000,0x0000, 0x1B72,0x0000,0x0000,
+0x1B73,0x0000,0x0000, 0x1B74,0x0000,0x0000, 0x1B75,0x0000,0x0000,
+0x1B76,0x0000,0x0000, 0x1B77,0x0000,0x0000, 0x1B78,0x0000,0x0000,
+0x1B79,0x0000,0x0000, 0x1B7A,0x0000,0x0000, 0x1B7B,0x0000,0x0000,
+0x1B7C,0x0000,0x0000, 0x1B7D,0x0000,0x0000, 0x1B7E,0x0000,0x0000,
+0x1B7F,0x0000,0x0000, 0x1B80,0x0000,0x0000, 0x1B81,0x0000,0x0000,
+0x1B82,0x0000,0x0000, 0x1B83,0x0000,0x0000, 0x1B84,0x0000,0x0000,
+0x1B85,0x0000,0x0000, 0x1B86,0x0000,0x0000, 0x1B87,0x0000,0x0000,
+0x1B88,0x0000,0x0000, 0x1B89,0x0000,0x0000, 0x1B8A,0x0000,0x0000,
+0x1B8B,0x0000,0x0000, 0x1B8C,0x0000,0x0000, 0x1B8D,0x0000,0x0000,
+0x1B8E,0x0000,0x0000, 0x1B8F,0x0000,0x0000, 0x1B90,0x0000,0x0000,
+0x1B91,0x0000,0x0000, 0x1B92,0x0000,0x0000, 0x1B93,0x0000,0x0000,
+0x1B94,0x0000,0x0000, 0x1B95,0x0000,0x0000, 0x1B96,0x0000,0x0000,
+0x1B97,0x0000,0x0000, 0x1B98,0x0000,0x0000, 0x1B99,0x0000,0x0000,
+0x1B9A,0x0000,0x0000, 0x1B9B,0x0000,0x0000, 0x1B9C,0x0000,0x0000,
+0x1B9D,0x0000,0x0000, 0x1B9E,0x0000,0x0000, 0x1B9F,0x0000,0x0000,
+0x1BA0,0x0000,0x0000, 0x1BA1,0x0000,0x0000, 0x1BA2,0x0000,0x0000,
+0x1BA3,0x0000,0x0000, 0x1BA4,0x0000,0x0000, 0x1BA5,0x0000,0x0000,
+0x1BA6,0x0000,0x0000, 0x1BA7,0x0000,0x0000, 0x1BA8,0x0000,0x0000,
+0x1BA9,0x0000,0x0000, 0x1BAA,0x0000,0x0000, 0x1BAB,0x0000,0x0000,
+0x1BAC,0x0000,0x0000 };
+
+uint16 page015data[]= { /* 1500 (2 weights per char) */
+0x1BAD,0x0000, 0x1BAE,0x0000, 0x1BAF,0x0000, 0x1BB0,0x0000,
+0x1BB1,0x0000, 0x1BB2,0x0000, 0x1BB3,0x0000, 0x1BB4,0x0000,
+0x1BB5,0x0000, 0x1BB6,0x0000, 0x1BB7,0x0000, 0x1BB8,0x0000,
+0x1BB9,0x0000, 0x1BBA,0x0000, 0x1BBB,0x0000, 0x1BBC,0x0000,
+0x1BBD,0x0000, 0x1BBE,0x0000, 0x1BBF,0x0000, 0x1BC0,0x0000,
+0x1BC1,0x0000, 0x1BC2,0x0000, 0x1BC3,0x0000, 0x1BC4,0x0000,
+0x1BC5,0x0000, 0x1BC6,0x0000, 0x1BC7,0x0000, 0x1BC8,0x0000,
+0x1BC9,0x0000, 0x1BCA,0x0000, 0x1BCB,0x0000, 0x1BCC,0x0000,
+0x1BCD,0x0000, 0x1BCE,0x0000, 0x1BCF,0x0000, 0x1BD0,0x0000,
+0x1BD1,0x0000, 0x1BD2,0x0000, 0x1BD3,0x0000, 0x1BD4,0x0000,
+0x1BD5,0x0000, 0x1BD6,0x0000, 0x1BD7,0x0000, 0x1BD8,0x0000,
+0x1BD9,0x0000, 0x1BDA,0x0000, 0x1BDB,0x0000, 0x1BDC,0x0000,
+0x1BDD,0x0000, 0x1BDE,0x0000, 0x1BDF,0x0000, 0x1BE0,0x0000,
+0x1BE1,0x0000, 0x1BE2,0x0000, 0x1BE3,0x0000, 0x1BE4,0x0000,
+0x1BE5,0x0000, 0x1BE6,0x0000, 0x1BE7,0x0000, 0x1BE8,0x0000,
+0x1BE9,0x0000, 0x1BEA,0x0000, 0x1BEB,0x0000, 0x1BEC,0x0000,
+0x1BED,0x0000, 0x1BEE,0x0000, 0x1BEF,0x0000, 0x1BF0,0x0000,
+0x1BF1,0x0000, 0x1BF2,0x0000, 0x1BF3,0x0000, 0x1BF4,0x0000,
+0x1BF5,0x0000, 0x1BF6,0x0000, 0x1BF7,0x0000, 0x1BF8,0x0000,
+0x1BF9,0x0000, 0x1BFA,0x0000, 0x1BFB,0x0000, 0x1BFC,0x0000,
+0x1BFD,0x0000, 0x1BFE,0x0000, 0x1BFF,0x0000, 0x1C00,0x0000,
+0x1C01,0x0000, 0x1C02,0x0000, 0x1C03,0x0000, 0x1C04,0x0000,
+0x1C05,0x0000, 0x1C06,0x0000, 0x1C07,0x0000, 0x1C08,0x0000,
+0x1C09,0x0000, 0x1C0A,0x0000, 0x1C0B,0x0000, 0x1C0C,0x0000,
+0x1C0D,0x0000, 0x1C0E,0x0000, 0x1C0F,0x0000, 0x1C10,0x0000,
+0x1C11,0x0000, 0x1C12,0x0000, 0x1C13,0x0000, 0x1C14,0x0000,
+0x1C15,0x0000, 0x1C16,0x0000, 0x1C17,0x0000, 0x1C18,0x0000,
+0x1C19,0x0000, 0x1C1A,0x0000, 0x1C1B,0x0000, 0x1C1C,0x0000,
+0x1C1D,0x0000, 0x1C1E,0x0000, 0x1C1F,0x0000, 0x1C20,0x0000,
+0x1C21,0x0000, 0x1C22,0x0000, 0x1C23,0x0000, 0x1C24,0x0000,
+0x1C25,0x0000, 0x1C26,0x0000, 0x1C27,0x0000, 0x1C28,0x0000,
+0x1C5B,0x0000, 0x1C29,0x0000, 0x1C2B,0x0000, 0x1C2C,0x0000,
+0x1C2D,0x0000, 0x1C2E,0x0000, 0x1C2F,0x0000, 0x1C30,0x0000,
+0x1C31,0x0000, 0x1C32,0x0000, 0x1C33,0x0000, 0x1C34,0x0000,
+0x1C35,0x0000, 0x1C36,0x0000, 0x1C37,0x0000, 0x1C38,0x0000,
+0x1C39,0x0000, 0x1C3A,0x0000, 0x1C3C,0x0000, 0x1C3D,0x0000,
+0x1C3E,0x0000, 0x1C3F,0x0000, 0x1C40,0x0000, 0x1C41,0x0000,
+0x1C42,0x0000, 0x1C43,0x0000, 0x1C4A,0x0000, 0x1C4B,0x0000,
+0x1C4C,0x0000, 0x1C4D,0x0000, 0x1C4E,0x0000, 0x1C4F,0x0000,
+0x1C50,0x0000, 0x1C51,0x0000, 0x1C52,0x0000, 0x1C53,0x0000,
+0x1C54,0x0000, 0x1C55,0x0000, 0x1C56,0x0000, 0x1C57,0x0000,
+0x1C58,0x0000, 0x1C59,0x0000, 0x1C5A,0x0000, 0x1C5C,0x0000,
+0x1C5D,0x0000, 0x1C5E,0x0000, 0x1C5F,0x0000, 0x1C60,0x0000,
+0x1C61,0x0000, 0x1C62,0x0000, 0x1C63,0x0000, 0x1C64,0x0000,
+0x1C65,0x0000, 0x1C66,0x0000, 0x1C67,0x0000, 0x1C68,0x0000,
+0x1C69,0x0000, 0x1C6A,0x0000, 0x1C6B,0x0000, 0x1C6C,0x0000,
+0x1C6D,0x0000, 0x1C6E,0x0000, 0x1C6F,0x0000, 0x1C70,0x0000,
+0x1C71,0x0000, 0x1C72,0x0000, 0x1C73,0x0000, 0x1C74,0x0000,
+0x1C75,0x0000, 0x1C76,0x0000, 0x1C77,0x0000, 0x1C78,0x0000,
+0x1C79,0x0000, 0x1C7A,0x0000, 0x1C7B,0x0000, 0x1C7C,0x0000,
+0x1C7D,0x0000, 0x1C7E,0x0000, 0x1C7F,0x0000, 0x1C80,0x0000,
+0x1C81,0x0000, 0x1C82,0x0000, 0x1C83,0x0000, 0x1C84,0x0000,
+0x1C85,0x0000, 0x1C86,0x0000, 0x1C87,0x0000, 0x1C88,0x0000,
+0x1C89,0x0000, 0x1C8A,0x0000, 0x1C8B,0x0000, 0x1C8C,0x0000,
+0x1C8D,0x0000, 0x1C8E,0x0000, 0x1C8F,0x0000, 0x1C90,0x0000,
+0x1C91,0x0000, 0x1C92,0x0000, 0x1C93,0x0000, 0x1C94,0x0000,
+0x1C95,0x0000, 0x1C96,0x0000, 0x1C97,0x0000, 0x1C98,0x0000,
+0x1C99,0x0000, 0x1C9A,0x0000, 0x1C9B,0x0000, 0x1C9C,0x0000,
+0x1C9D,0x0000, 0x1C9E,0x0000, 0x1C9F,0x0000, 0x1CA0,0x0000,
+0x1CA1,0x0000, 0x1CA2,0x0000, 0x1CA3,0x0000, 0x1CA4,0x0000,
+0x1CA5,0x0000, 0x1CA6,0x0000, 0x1CA7,0x0000, 0x1CA8,0x0000,
+0x1CA9,0x0000, 0x1CAA,0x0000, 0x1CAB,0x0000, 0x1CAC,0x0000,
+0x1CAD,0x0000, 0x1CAE,0x0000, 0x1CAF,0x0000, 0x1CB0,0x0000,
+0x1CB1,0x0000, 0x1CB2,0x0000, 0x1CB3,0x0000, 0x1CB4,0x0000
+};
+
+uint16 page016data[]= { /* 1600 (3 weights per char) */
+0x1CB5,0x0000,0x0000, 0x1CB6,0x0000,0x0000, 0x1CB7,0x0000,0x0000,
+0x1CB8,0x0000,0x0000, 0x1CB9,0x0000,0x0000, 0x1CBA,0x0000,0x0000,
+0x1CBB,0x0000,0x0000, 0x1CBC,0x0000,0x0000, 0x1CBD,0x0000,0x0000,
+0x1CBE,0x0000,0x0000, 0x1CBF,0x0000,0x0000, 0x1CC0,0x0000,0x0000,
+0x1CC1,0x0000,0x0000, 0x1CC2,0x0000,0x0000, 0x1CC3,0x0000,0x0000,
+0x1CC4,0x0000,0x0000, 0x1CC5,0x0000,0x0000, 0x1CC6,0x0000,0x0000,
+0x1CC7,0x0000,0x0000, 0x1CC8,0x0000,0x0000, 0x1CC9,0x0000,0x0000,
+0x1CCA,0x0000,0x0000, 0x1CCB,0x0000,0x0000, 0x1CCC,0x0000,0x0000,
+0x1CCD,0x0000,0x0000, 0x1CCE,0x0000,0x0000, 0x1CCF,0x0000,0x0000,
+0x1CD0,0x0000,0x0000, 0x1CD1,0x0000,0x0000, 0x1CD2,0x0000,0x0000,
+0x1CD3,0x0000,0x0000, 0x1CD4,0x0000,0x0000, 0x1CD5,0x0000,0x0000,
+0x1CD6,0x0000,0x0000, 0x1CD7,0x0000,0x0000, 0x1CD8,0x0000,0x0000,
+0x1CD9,0x0000,0x0000, 0x1CDA,0x0000,0x0000, 0x1CDB,0x0000,0x0000,
+0x1CDC,0x0000,0x0000, 0x1CDD,0x0000,0x0000, 0x1CDE,0x0000,0x0000,
+0x1CDF,0x0000,0x0000, 0x1CE0,0x0000,0x0000, 0x1CE1,0x0000,0x0000,
+0x1CE2,0x0000,0x0000, 0x1CE3,0x0000,0x0000, 0x1CE4,0x0000,0x0000,
+0x1CE5,0x0000,0x0000, 0x1CE6,0x0000,0x0000, 0x1CE7,0x0000,0x0000,
+0x1CE8,0x0000,0x0000, 0x1CE9,0x0000,0x0000, 0x1CEA,0x0000,0x0000,
+0x1CEB,0x0000,0x0000, 0x1CEC,0x0000,0x0000, 0x1CED,0x0000,0x0000,
+0x1CEE,0x0000,0x0000, 0x1CEF,0x0000,0x0000, 0x1CF0,0x0000,0x0000,
+0x1CF1,0x0000,0x0000, 0x1CF2,0x0000,0x0000, 0x1CF3,0x0000,0x0000,
+0x1CF4,0x0000,0x0000, 0x1CF5,0x0000,0x0000, 0x1CF6,0x0000,0x0000,
+0x1CF7,0x0000,0x0000, 0x1CF8,0x0000,0x0000, 0x1CF9,0x0000,0x0000,
+0x1CFA,0x0000,0x0000, 0x1CFB,0x0000,0x0000, 0x1CFC,0x0000,0x0000,
+0x1CFD,0x0000,0x0000, 0x1CFE,0x0000,0x0000, 0x1CFF,0x0000,0x0000,
+0x1D00,0x0000,0x0000, 0x1D01,0x0000,0x0000, 0x1D02,0x0000,0x0000,
+0x1D03,0x0000,0x0000, 0x1D04,0x0000,0x0000, 0x1D05,0x0000,0x0000,
+0x1D06,0x0000,0x0000, 0x1D07,0x0000,0x0000, 0x1D08,0x0000,0x0000,
+0x1D09,0x0000,0x0000, 0x1D0A,0x0000,0x0000, 0x1D0B,0x0000,0x0000,
+0x1D0C,0x0000,0x0000, 0x1D0D,0x0000,0x0000, 0x1D0E,0x0000,0x0000,
+0x1D0F,0x0000,0x0000, 0x1D10,0x0000,0x0000, 0x1D11,0x0000,0x0000,
+0x1D12,0x0000,0x0000, 0x1D13,0x0000,0x0000, 0x1D14,0x0000,0x0000,
+0x1D15,0x0000,0x0000, 0x1D16,0x0000,0x0000, 0x1D17,0x0000,0x0000,
+0x1D18,0x0000,0x0000, 0x1D19,0x0000,0x0000, 0x1D1A,0x0000,0x0000,
+0x1D1B,0x0000,0x0000, 0x1D1C,0x0000,0x0000, 0x1D1D,0x0000,0x0000,
+0x1D1E,0x0000,0x0000, 0x1D1F,0x0000,0x0000, 0x1D20,0x0000,0x0000,
+0x1D21,0x0000,0x0000, 0x0316,0x0000,0x0000, 0x0265,0x0000,0x0000,
+0x1C2A,0x0000,0x0000, 0x1C3B,0x0000,0x0000, 0x1C44,0x0000,0x0000,
+0x1C45,0x0000,0x0000, 0x1C46,0x0000,0x0000, 0x1C47,0x0000,0x0000,
+0x1C48,0x0000,0x0000, 0x1C49,0x0000,0x0000, 0xFBC0,0x9677,0x0000,
+0xFBC0,0x9678,0x0000, 0xFBC0,0x9679,0x0000, 0xFBC0,0x967A,0x0000,
+0xFBC0,0x967B,0x0000, 0xFBC0,0x967C,0x0000, 0xFBC0,0x967D,0x0000,
+0xFBC0,0x967E,0x0000, 0xFBC0,0x967F,0x0000, 0x020A,0x0000,0x0000,
+0x1D22,0x0000,0x0000, 0x1D23,0x0000,0x0000, 0x1D24,0x0000,0x0000,
+0x1D25,0x0000,0x0000, 0x1D26,0x0000,0x0000, 0x1D27,0x0000,0x0000,
+0x1D28,0x0000,0x0000, 0x1D29,0x0000,0x0000, 0x1D2A,0x0000,0x0000,
+0x1D2B,0x0000,0x0000, 0x1D2C,0x0000,0x0000, 0x1D2D,0x0000,0x0000,
+0x1D2E,0x0000,0x0000, 0x1D2F,0x0000,0x0000, 0x1D30,0x0000,0x0000,
+0x1D31,0x0000,0x0000, 0x1D32,0x0000,0x0000, 0x1D33,0x0000,0x0000,
+0x1D34,0x0000,0x0000, 0x1D35,0x0000,0x0000, 0x1D36,0x0000,0x0000,
+0x1D37,0x0000,0x0000, 0x1D38,0x0000,0x0000, 0x1D39,0x0000,0x0000,
+0x1D3A,0x0000,0x0000, 0x1D3B,0x0000,0x0000, 0x0292,0x0000,0x0000,
+0x0293,0x0000,0x0000, 0xFBC0,0x969D,0x0000, 0xFBC0,0x969E,0x0000,
+0xFBC0,0x969F,0x0000, 0x1D3C,0x0000,0x0000, 0x1D3C,0x0000,0x0000,
+0x1D3D,0x0000,0x0000, 0x1D59,0x0000,0x0000, 0x1D3D,0x0000,0x0000,
+0x1D3D,0x0000,0x0000, 0x1D3E,0x0000,0x0000, 0x1D3E,0x0000,0x0000,
+0x1D3F,0x0000,0x0000, 0x1D3F,0x0000,0x0000, 0x1D57,0x0000,0x0000,
+0x1D58,0x0000,0x0000, 0x1D3F,0x0000,0x0000, 0x1D3F,0x0000,0x0000,
+0x1D3F,0x0000,0x0000, 0x1D40,0x0000,0x0000, 0x1D41,0x0000,0x0000,
+0x1D42,0x0000,0x0000, 0x1D43,0x0000,0x0000, 0x1D43,0x0000,0x0000,
+0x1D43,0x0000,0x0000, 0x1D43,0x0000,0x0000, 0x1D43,0x0000,0x0000,
+0x1D44,0x0000,0x0000, 0x1D5C,0x0000,0x0000, 0x1D45,0x0000,0x0000,
+0x1D46,0x0000,0x0000, 0x1D46,0x0000,0x0000, 0x1D46,0x0000,0x0000,
+0x1D46,0x0000,0x0000, 0x1D47,0x0000,0x0000, 0x1D47,0x0000,0x0000,
+0x1D47,0x0000,0x0000, 0x1D48,0x0000,0x0000, 0x1D48,0x0000,0x0000,
+0x1D49,0x0000,0x0000, 0x1D49,0x0000,0x0000, 0x1D4A,0x0000,0x0000,
+0x1D4A,0x0000,0x0000, 0x1D4B,0x0000,0x0000, 0x1D4C,0x0000,0x0000,
+0x1D4D,0x0000,0x0000, 0x1D4E,0x0000,0x0000, 0x1D4E,0x0000,0x0000,
+0x1D4E,0x0000,0x0000, 0x1D4E,0x0000,0x0000, 0x1D4E,0x0000,0x0000,
+0x1D4F,0x0000,0x0000, 0x1D4F,0x0000,0x0000, 0x1D4F,0x0000,0x0000,
+0x1D50,0x0000,0x0000, 0x1D50,0x0000,0x0000, 0x1D50,0x0000,0x0000,
+0x1D4C,0x0000,0x0000, 0x1D51,0x0000,0x0000, 0x1D52,0x0000,0x0000,
+0x1D52,0x0000,0x0000, 0x1D52,0x0000,0x0000, 0x1D53,0x0000,0x0000,
+0x1D53,0x0000,0x0000, 0x1D54,0x0000,0x0000, 0x1D54,0x0000,0x0000,
+0x1D55,0x0000,0x0000, 0x1D56,0x0000,0x0000, 0x1D5A,0x0000,0x0000,
+0x1D5E,0x0000,0x0000, 0x1D5F,0x0000,0x0000, 0x1D5B,0x0000,0x0000,
+0x1D5D,0x0000,0x0000, 0x1D60,0x0000,0x0000, 0x1D61,0x0000,0x0000,
+0x1D61,0x0000,0x0000, 0x1D61,0x0000,0x0000, 0x1D45,0x0000,0x0000,
+0x1D4E,0x0000,0x0000, 0x024E,0x0000,0x0000, 0x024F,0x0000,0x0000,
+0x0250,0x0000,0x0000, 0x1D4A,0x1D53,0x0000, 0x1D52,0x1D52,0x0000,
+0x1D3E,0x1D3E,0x0000, 0xFBC0,0x96F1,0x0000, 0xFBC0,0x96F2,0x0000,
+0xFBC0,0x96F3,0x0000, 0xFBC0,0x96F4,0x0000, 0xFBC0,0x96F5,0x0000,
+0xFBC0,0x96F6,0x0000, 0xFBC0,0x96F7,0x0000, 0xFBC0,0x96F8,0x0000,
+0xFBC0,0x96F9,0x0000, 0xFBC0,0x96FA,0x0000, 0xFBC0,0x96FB,0x0000,
+0xFBC0,0x96FC,0x0000, 0xFBC0,0x96FD,0x0000, 0xFBC0,0x96FE,0x0000,
+0xFBC0,0x96FF,0x0000 };
+
+uint16 page017data[]= { /* 1700 (3 weights per char) */
+0x18E2,0x0000,0x0000, 0x18E3,0x0000,0x0000, 0x18E4,0x0000,0x0000,
+0x18E5,0x0000,0x0000, 0x18E6,0x0000,0x0000, 0x18E7,0x0000,0x0000,
+0x18E8,0x0000,0x0000, 0x18E9,0x0000,0x0000, 0x18EA,0x0000,0x0000,
+0x18EB,0x0000,0x0000, 0x18EC,0x0000,0x0000, 0x18ED,0x0000,0x0000,
+0x18EE,0x0000,0x0000, 0xFBC0,0x970D,0x0000, 0x18EF,0x0000,0x0000,
+0x18F0,0x0000,0x0000, 0x18F1,0x0000,0x0000, 0x18F2,0x0000,0x0000,
+0x18F3,0x0000,0x0000, 0x18F4,0x0000,0x0000, 0x18F5,0x0000,0x0000,
+0xFBC0,0x9715,0x0000, 0xFBC0,0x9716,0x0000, 0xFBC0,0x9717,0x0000,
+0xFBC0,0x9718,0x0000, 0xFBC0,0x9719,0x0000, 0xFBC0,0x971A,0x0000,
+0xFBC0,0x971B,0x0000, 0xFBC0,0x971C,0x0000, 0xFBC0,0x971D,0x0000,
+0xFBC0,0x971E,0x0000, 0xFBC0,0x971F,0x0000, 0x18F6,0x0000,0x0000,
+0x18F7,0x0000,0x0000, 0x18F8,0x0000,0x0000, 0x18F9,0x0000,0x0000,
+0x18FA,0x0000,0x0000, 0x18FB,0x0000,0x0000, 0x18FC,0x0000,0x0000,
+0x18FD,0x0000,0x0000, 0x18FE,0x0000,0x0000, 0x18FF,0x0000,0x0000,
+0x1900,0x0000,0x0000, 0x1901,0x0000,0x0000, 0x1902,0x0000,0x0000,
+0x1903,0x0000,0x0000, 0x1904,0x0000,0x0000, 0x1905,0x0000,0x0000,
+0x1906,0x0000,0x0000, 0x1907,0x0000,0x0000, 0x1908,0x0000,0x0000,
+0x1909,0x0000,0x0000, 0x190A,0x0000,0x0000, 0x026A,0x0000,0x0000,
+0x026B,0x0000,0x0000, 0xFBC0,0x9737,0x0000, 0xFBC0,0x9738,0x0000,
+0xFBC0,0x9739,0x0000, 0xFBC0,0x973A,0x0000, 0xFBC0,0x973B,0x0000,
+0xFBC0,0x973C,0x0000, 0xFBC0,0x973D,0x0000, 0xFBC0,0x973E,0x0000,
+0xFBC0,0x973F,0x0000, 0x190B,0x0000,0x0000, 0x190C,0x0000,0x0000,
+0x190D,0x0000,0x0000, 0x190E,0x0000,0x0000, 0x190F,0x0000,0x0000,
+0x1910,0x0000,0x0000, 0x1911,0x0000,0x0000, 0x1912,0x0000,0x0000,
+0x1913,0x0000,0x0000, 0x1914,0x0000,0x0000, 0x1915,0x0000,0x0000,
+0x1916,0x0000,0x0000, 0x1917,0x0000,0x0000, 0x1918,0x0000,0x0000,
+0x1919,0x0000,0x0000, 0x191A,0x0000,0x0000, 0x191B,0x0000,0x0000,
+0x191C,0x0000,0x0000, 0x191D,0x0000,0x0000, 0x191E,0x0000,0x0000,
+0xFBC0,0x9754,0x0000, 0xFBC0,0x9755,0x0000, 0xFBC0,0x9756,0x0000,
+0xFBC0,0x9757,0x0000, 0xFBC0,0x9758,0x0000, 0xFBC0,0x9759,0x0000,
+0xFBC0,0x975A,0x0000, 0xFBC0,0x975B,0x0000, 0xFBC0,0x975C,0x0000,
+0xFBC0,0x975D,0x0000, 0xFBC0,0x975E,0x0000, 0xFBC0,0x975F,0x0000,
+0x191F,0x0000,0x0000, 0x1920,0x0000,0x0000, 0x1921,0x0000,0x0000,
+0x1922,0x0000,0x0000, 0x1923,0x0000,0x0000, 0x1924,0x0000,0x0000,
+0x1925,0x0000,0x0000, 0x1926,0x0000,0x0000, 0x1927,0x0000,0x0000,
+0x1928,0x0000,0x0000, 0x1929,0x0000,0x0000, 0x192A,0x0000,0x0000,
+0x192B,0x0000,0x0000, 0xFBC0,0x976D,0x0000, 0x192C,0x0000,0x0000,
+0x192D,0x0000,0x0000, 0x192E,0x0000,0x0000, 0xFBC0,0x9771,0x0000,
+0x192F,0x0000,0x0000, 0x1930,0x0000,0x0000, 0xFBC0,0x9774,0x0000,
+0xFBC0,0x9775,0x0000, 0xFBC0,0x9776,0x0000, 0xFBC0,0x9777,0x0000,
+0xFBC0,0x9778,0x0000, 0xFBC0,0x9779,0x0000, 0xFBC0,0x977A,0x0000,
+0xFBC0,0x977B,0x0000, 0xFBC0,0x977C,0x0000, 0xFBC0,0x977D,0x0000,
+0xFBC0,0x977E,0x0000, 0xFBC0,0x977F,0x0000, 0x196C,0x0000,0x0000,
+0x196D,0x0000,0x0000, 0x196E,0x0000,0x0000, 0x196F,0x0000,0x0000,
+0x1970,0x0000,0x0000, 0x1971,0x0000,0x0000, 0x1972,0x0000,0x0000,
+0x1973,0x0000,0x0000, 0x1974,0x0000,0x0000, 0x1975,0x0000,0x0000,
+0x1976,0x0000,0x0000, 0x1977,0x0000,0x0000, 0x1978,0x0000,0x0000,
+0x1979,0x0000,0x0000, 0x197A,0x0000,0x0000, 0x197B,0x0000,0x0000,
+0x197C,0x0000,0x0000, 0x197D,0x0000,0x0000, 0x197E,0x0000,0x0000,
+0x197F,0x0000,0x0000, 0x1980,0x0000,0x0000, 0x1981,0x0000,0x0000,
+0x1982,0x0000,0x0000, 0x1983,0x0000,0x0000, 0x1984,0x0000,0x0000,
+0x1985,0x0000,0x0000, 0x1986,0x0000,0x0000, 0x1987,0x0000,0x0000,
+0x1988,0x0000,0x0000, 0x1989,0x0000,0x0000, 0x198A,0x0000,0x0000,
+0x198B,0x0000,0x0000, 0x198C,0x0000,0x0000, 0x198D,0x0000,0x0000,
+0x198E,0x0000,0x0000, 0x1990,0x0000,0x0000, 0x1991,0x0000,0x0000,
+0x1992,0x0000,0x0000, 0x1993,0x0000,0x0000, 0x1994,0x0000,0x0000,
+0x1995,0x0000,0x0000, 0x1996,0x0000,0x0000, 0x1997,0x0000,0x0000,
+0x1998,0x0000,0x0000, 0x1999,0x0000,0x0000, 0x199A,0x0000,0x0000,
+0x199B,0x0000,0x0000, 0x199C,0x0000,0x0000, 0x199D,0x0000,0x0000,
+0x199E,0x0000,0x0000, 0x199F,0x0000,0x0000, 0x19A0,0x0000,0x0000,
+0x19A1,0x0000,0x0000, 0x19A2,0x0000,0x0000, 0x19A3,0x0000,0x0000,
+0x19A4,0x0000,0x0000, 0x19A5,0x0000,0x0000, 0x19A6,0x0000,0x0000,
+0x19A7,0x0000,0x0000, 0x19A8,0x0000,0x0000, 0x19A9,0x0000,0x0000,
+0x19AA,0x0000,0x0000, 0x19AB,0x0000,0x0000, 0x19AC,0x0000,0x0000,
+0x19AD,0x0000,0x0000, 0x19AE,0x0000,0x0000, 0x19AF,0x0000,0x0000,
+0x19B0,0x0000,0x0000, 0x19B1,0x0000,0x0000, 0x19B2,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x19B3,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x026E,0x0000,0x0000,
+0x026F,0x0000,0x0000, 0x024D,0x0000,0x0000, 0x0312,0x0000,0x0000,
+0x0313,0x0000,0x0000, 0x0314,0x0000,0x0000, 0x0315,0x0000,0x0000,
+0x0E17,0x0000,0x0000, 0x198F,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x97DE,0x0000, 0xFBC0,0x97DF,0x0000, 0x0E29,0x0000,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0xFBC0,0x97EA,0x0000, 0xFBC0,0x97EB,0x0000, 0xFBC0,0x97EC,0x0000,
+0xFBC0,0x97ED,0x0000, 0xFBC0,0x97EE,0x0000, 0xFBC0,0x97EF,0x0000,
+0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000,
+0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000,
+0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000,
+0x0E32,0x0000,0x0000, 0xFBC0,0x97FA,0x0000, 0xFBC0,0x97FB,0x0000,
+0xFBC0,0x97FC,0x0000, 0xFBC0,0x97FD,0x0000, 0xFBC0,0x97FE,0x0000,
+0xFBC0,0x97FF,0x0000 };
+
+uint16 page018data[]= { /* 1800 (3 weights per char) */
+0x02F8,0x0000,0x0000, 0x025E,0x0000,0x0000, 0x0235,0x0000,0x0000,
+0x0263,0x0000,0x0000, 0x024A,0x0000,0x0000, 0x024B,0x0000,0x0000,
+0x0223,0x0000,0x0000, 0x0224,0x0000,0x0000, 0x0236,0x0000,0x0000,
+0x0264,0x0000,0x0000, 0x02F9,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x980F,0x0000, 0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000,
+0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000,
+0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000,
+0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, 0xFBC0,0x981A,0x0000,
+0xFBC0,0x981B,0x0000, 0xFBC0,0x981C,0x0000, 0xFBC0,0x981D,0x0000,
+0xFBC0,0x981E,0x0000, 0xFBC0,0x981F,0x0000, 0x19DF,0x0000,0x0000,
+0x19E1,0x0000,0x0000, 0x19E4,0x0000,0x0000, 0x19EA,0x0000,0x0000,
+0x19EC,0x0000,0x0000, 0x19EF,0x0000,0x0000, 0x19F1,0x0000,0x0000,
+0x19F4,0x0000,0x0000, 0x19F5,0x0000,0x0000, 0x19F6,0x0000,0x0000,
+0x19FB,0x0000,0x0000, 0x19FD,0x0000,0x0000, 0x1A00,0x0000,0x0000,
+0x1A02,0x0000,0x0000, 0x1A07,0x0000,0x0000, 0x1A09,0x0000,0x0000,
+0x1A0A,0x0000,0x0000, 0x1A0B,0x0000,0x0000, 0x1A12,0x0000,0x0000,
+0x1A15,0x0000,0x0000, 0x1A18,0x0000,0x0000, 0x1A1D,0x0000,0x0000,
+0x1A21,0x0000,0x0000, 0x1A24,0x0000,0x0000, 0x1A26,0x0000,0x0000,
+0x1A28,0x0000,0x0000, 0x1A2B,0x0000,0x0000, 0x1A30,0x0000,0x0000,
+0x1A31,0x0000,0x0000, 0x1A34,0x0000,0x0000, 0x1A38,0x0000,0x0000,
+0x1A3B,0x0000,0x0000, 0x1A3C,0x0000,0x0000, 0x1A3D,0x0000,0x0000,
+0x1A3E,0x0000,0x0000, 0x19DE,0x0000,0x0000, 0x19E2,0x0000,0x0000,
+0x19E5,0x0000,0x0000, 0x19EB,0x0000,0x0000, 0x19ED,0x0000,0x0000,
+0x19F0,0x0000,0x0000, 0x19F2,0x0000,0x0000, 0x19F7,0x0000,0x0000,
+0x19FC,0x0000,0x0000, 0x19FE,0x0000,0x0000, 0x1A01,0x0000,0x0000,
+0x1A03,0x0000,0x0000, 0x1A08,0x0000,0x0000, 0x1A13,0x0000,0x0000,
+0x1A16,0x0000,0x0000, 0x1A19,0x0000,0x0000, 0x1A1E,0x0000,0x0000,
+0x1A32,0x0000,0x0000, 0x1A22,0x0000,0x0000, 0x1A27,0x0000,0x0000,
+0x1A2C,0x0000,0x0000, 0x1A36,0x0000,0x0000, 0x1A39,0x0000,0x0000,
+0x1A3F,0x0000,0x0000, 0x1A40,0x0000,0x0000, 0x1A1B,0x0000,0x0000,
+0x19E3,0x0000,0x0000, 0x19E6,0x0000,0x0000, 0x19E9,0x0000,0x0000,
+0x19F3,0x0000,0x0000, 0x19EE,0x0000,0x0000, 0x19F8,0x0000,0x0000,
+0x1A2D,0x0000,0x0000, 0x1A04,0x0000,0x0000, 0x1A06,0x0000,0x0000,
+0x19FF,0x0000,0x0000, 0x1A0C,0x0000,0x0000, 0x1A14,0x0000,0x0000,
+0x1A17,0x0000,0x0000, 0x1A1F,0x0000,0x0000, 0x1A29,0x0000,0x0000,
+0x1A37,0x0000,0x0000, 0x1A3A,0x0000,0x0000, 0x1A33,0x0000,0x0000,
+0x1A35,0x0000,0x0000, 0x1A41,0x0000,0x0000, 0x1A1A,0x0000,0x0000,
+0x1A23,0x0000,0x0000, 0x19E7,0x0000,0x0000, 0x1A2E,0x0000,0x0000,
+0x1A25,0x0000,0x0000, 0x1A2A,0x0000,0x0000, 0x1A20,0x0000,0x0000,
+0xFBC0,0x9878,0x0000, 0xFBC0,0x9879,0x0000, 0xFBC0,0x987A,0x0000,
+0xFBC0,0x987B,0x0000, 0xFBC0,0x987C,0x0000, 0xFBC0,0x987D,0x0000,
+0xFBC0,0x987E,0x0000, 0xFBC0,0x987F,0x0000, 0x19D7,0x0000,0x0000,
+0x19D8,0x0000,0x0000, 0x19D9,0x0000,0x0000, 0x19DA,0x0000,0x0000,
+0x19DB,0x0000,0x0000, 0x19DC,0x0000,0x0000, 0x19DD,0x0000,0x0000,
+0x19E0,0x0000,0x0000, 0x19E8,0x0000,0x0000, 0x1A2F,0x0000,0x0000,
+0x19F9,0x0000,0x0000, 0x1A1C,0x0000,0x0000, 0x1A42,0x0000,0x0000,
+0x1A44,0x0000,0x0000, 0x1A45,0x0000,0x0000, 0x1A47,0x0000,0x0000,
+0x1A48,0x0000,0x0000, 0x1A4B,0x0000,0x0000, 0x1A4D,0x0000,0x0000,
+0x1A4E,0x0000,0x0000, 0x1A50,0x0000,0x0000, 0x1A52,0x0000,0x0000,
+0x1A54,0x0000,0x0000, 0x1A55,0x0000,0x0000, 0x1A49,0x0000,0x0000,
+0x1A53,0x0000,0x0000, 0x1A05,0x0000,0x0000, 0x19FA,0x0000,0x0000,
+0x1A0D,0x0000,0x0000, 0x1A0E,0x0000,0x0000, 0x1A43,0x0000,0x0000,
+0x1A46,0x0000,0x0000, 0x1A4A,0x0000,0x0000, 0x1A4C,0x0000,0x0000,
+0x1A0F,0x0000,0x0000, 0x1A51,0x0000,0x0000, 0x1A10,0x0000,0x0000,
+0x1A11,0x0000,0x0000, 0x1A56,0x0000,0x0000, 0x1A57,0x0000,0x0000,
+0x1A4F,0x0000,0x0000, 0x1A58,0x0000,0x0000, 0xFBC0,0x98AA,0x0000,
+0xFBC0,0x98AB,0x0000, 0xFBC0,0x98AC,0x0000, 0xFBC0,0x98AD,0x0000,
+0xFBC0,0x98AE,0x0000, 0xFBC0,0x98AF,0x0000, 0xFBC0,0x98B0,0x0000,
+0xFBC0,0x98B1,0x0000, 0xFBC0,0x98B2,0x0000, 0xFBC0,0x98B3,0x0000,
+0xFBC0,0x98B4,0x0000, 0xFBC0,0x98B5,0x0000, 0xFBC0,0x98B6,0x0000,
+0xFBC0,0x98B7,0x0000, 0xFBC0,0x98B8,0x0000, 0xFBC0,0x98B9,0x0000,
+0xFBC0,0x98BA,0x0000, 0xFBC0,0x98BB,0x0000, 0xFBC0,0x98BC,0x0000,
+0xFBC0,0x98BD,0x0000, 0xFBC0,0x98BE,0x0000, 0xFBC0,0x98BF,0x0000,
+0xFBC0,0x98C0,0x0000, 0xFBC0,0x98C1,0x0000, 0xFBC0,0x98C2,0x0000,
+0xFBC0,0x98C3,0x0000, 0xFBC0,0x98C4,0x0000, 0xFBC0,0x98C5,0x0000,
+0xFBC0,0x98C6,0x0000, 0xFBC0,0x98C7,0x0000, 0xFBC0,0x98C8,0x0000,
+0xFBC0,0x98C9,0x0000, 0xFBC0,0x98CA,0x0000, 0xFBC0,0x98CB,0x0000,
+0xFBC0,0x98CC,0x0000, 0xFBC0,0x98CD,0x0000, 0xFBC0,0x98CE,0x0000,
+0xFBC0,0x98CF,0x0000, 0xFBC0,0x98D0,0x0000, 0xFBC0,0x98D1,0x0000,
+0xFBC0,0x98D2,0x0000, 0xFBC0,0x98D3,0x0000, 0xFBC0,0x98D4,0x0000,
+0xFBC0,0x98D5,0x0000, 0xFBC0,0x98D6,0x0000, 0xFBC0,0x98D7,0x0000,
+0xFBC0,0x98D8,0x0000, 0xFBC0,0x98D9,0x0000, 0xFBC0,0x98DA,0x0000,
+0xFBC0,0x98DB,0x0000, 0xFBC0,0x98DC,0x0000, 0xFBC0,0x98DD,0x0000,
+0xFBC0,0x98DE,0x0000, 0xFBC0,0x98DF,0x0000, 0xFBC0,0x98E0,0x0000,
+0xFBC0,0x98E1,0x0000, 0xFBC0,0x98E2,0x0000, 0xFBC0,0x98E3,0x0000,
+0xFBC0,0x98E4,0x0000, 0xFBC0,0x98E5,0x0000, 0xFBC0,0x98E6,0x0000,
+0xFBC0,0x98E7,0x0000, 0xFBC0,0x98E8,0x0000, 0xFBC0,0x98E9,0x0000,
+0xFBC0,0x98EA,0x0000, 0xFBC0,0x98EB,0x0000, 0xFBC0,0x98EC,0x0000,
+0xFBC0,0x98ED,0x0000, 0xFBC0,0x98EE,0x0000, 0xFBC0,0x98EF,0x0000,
+0xFBC0,0x98F0,0x0000, 0xFBC0,0x98F1,0x0000, 0xFBC0,0x98F2,0x0000,
+0xFBC0,0x98F3,0x0000, 0xFBC0,0x98F4,0x0000, 0xFBC0,0x98F5,0x0000,
+0xFBC0,0x98F6,0x0000, 0xFBC0,0x98F7,0x0000, 0xFBC0,0x98F8,0x0000,
+0xFBC0,0x98F9,0x0000, 0xFBC0,0x98FA,0x0000, 0xFBC0,0x98FB,0x0000,
+0xFBC0,0x98FC,0x0000, 0xFBC0,0x98FD,0x0000, 0xFBC0,0x98FE,0x0000,
+0xFBC0,0x98FF,0x0000 };
+
+uint16 page019data[]= { /* 1900 (3 weights per char) */
+0x18B0,0x0000,0x0000, 0x18B1,0x0000,0x0000, 0x18B2,0x0000,0x0000,
+0x18B3,0x0000,0x0000, 0x18B4,0x0000,0x0000, 0x18B5,0x0000,0x0000,
+0x18B6,0x0000,0x0000, 0x18B7,0x0000,0x0000, 0x18B8,0x0000,0x0000,
+0x18B9,0x0000,0x0000, 0x18BA,0x0000,0x0000, 0x18BB,0x0000,0x0000,
+0x18BC,0x0000,0x0000, 0x18BD,0x0000,0x0000, 0x18BE,0x0000,0x0000,
+0x18BF,0x0000,0x0000, 0x18C0,0x0000,0x0000, 0x18C1,0x0000,0x0000,
+0x18C2,0x0000,0x0000, 0x18C3,0x0000,0x0000, 0x18C4,0x0000,0x0000,
+0x18C5,0x0000,0x0000, 0x18C6,0x0000,0x0000, 0x18C7,0x0000,0x0000,
+0x18C8,0x0000,0x0000, 0x18C9,0x0000,0x0000, 0x18CA,0x0000,0x0000,
+0x18CB,0x0000,0x0000, 0x18CC,0x0000,0x0000, 0xFBC0,0x991D,0x0000,
+0xFBC0,0x991E,0x0000, 0xFBC0,0x991F,0x0000, 0x18CD,0x0000,0x0000,
+0x18CE,0x0000,0x0000, 0x18CF,0x0000,0x0000, 0x18D0,0x0000,0x0000,
+0x18D1,0x0000,0x0000, 0x18D2,0x0000,0x0000, 0x18D3,0x0000,0x0000,
+0x18D4,0x0000,0x0000, 0x18D5,0x0000,0x0000, 0x18D6,0x0000,0x0000,
+0x18D7,0x0000,0x0000, 0x18D8,0x0000,0x0000, 0xFBC0,0x992C,0x0000,
+0xFBC0,0x992D,0x0000, 0xFBC0,0x992E,0x0000, 0xFBC0,0x992F,0x0000,
+0x18D9,0x0000,0x0000, 0x18DA,0x0000,0x0000, 0x18DB,0x0000,0x0000,
+0x18DC,0x0000,0x0000, 0x18DD,0x0000,0x0000, 0x18DE,0x0000,0x0000,
+0x18DF,0x0000,0x0000, 0x18E0,0x0000,0x0000, 0x18E1,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC0,0x993C,0x0000, 0xFBC0,0x993D,0x0000, 0xFBC0,0x993E,0x0000,
+0xFBC0,0x993F,0x0000, 0x030D,0x0000,0x0000, 0xFBC0,0x9941,0x0000,
+0xFBC0,0x9942,0x0000, 0xFBC0,0x9943,0x0000, 0x0254,0x0000,0x0000,
+0x025B,0x0000,0x0000, 0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000,
+0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000,
+0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000,
+0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, 0x19B4,0x0000,0x0000,
+0x19B5,0x0000,0x0000, 0x19B6,0x0000,0x0000, 0x19B7,0x0000,0x0000,
+0x19B8,0x0000,0x0000, 0x19B9,0x0000,0x0000, 0x19BA,0x0000,0x0000,
+0x19BB,0x0000,0x0000, 0x19BC,0x0000,0x0000, 0x19BD,0x0000,0x0000,
+0x19BE,0x0000,0x0000, 0x19BF,0x0000,0x0000, 0x19C0,0x0000,0x0000,
+0x19C1,0x0000,0x0000, 0x19C2,0x0000,0x0000, 0x19C3,0x0000,0x0000,
+0x19C4,0x0000,0x0000, 0x19C5,0x0000,0x0000, 0x19C6,0x0000,0x0000,
+0x19C7,0x0000,0x0000, 0x19C8,0x0000,0x0000, 0x19C9,0x0000,0x0000,
+0x19CA,0x0000,0x0000, 0x19CB,0x0000,0x0000, 0x19CC,0x0000,0x0000,
+0x19CD,0x0000,0x0000, 0x19CE,0x0000,0x0000, 0x19CF,0x0000,0x0000,
+0x19D0,0x0000,0x0000, 0x19D1,0x0000,0x0000, 0xFBC0,0x996E,0x0000,
+0xFBC0,0x996F,0x0000, 0x19D2,0x0000,0x0000, 0x19D3,0x0000,0x0000,
+0x19D4,0x0000,0x0000, 0x19D5,0x0000,0x0000, 0x19D6,0x0000,0x0000,
+0xFBC0,0x9975,0x0000, 0xFBC0,0x9976,0x0000, 0xFBC0,0x9977,0x0000,
+0xFBC0,0x9978,0x0000, 0xFBC0,0x9979,0x0000, 0xFBC0,0x997A,0x0000,
+0xFBC0,0x997B,0x0000, 0xFBC0,0x997C,0x0000, 0xFBC0,0x997D,0x0000,
+0xFBC0,0x997E,0x0000, 0xFBC0,0x997F,0x0000, 0xFBC0,0x9980,0x0000,
+0xFBC0,0x9981,0x0000, 0xFBC0,0x9982,0x0000, 0xFBC0,0x9983,0x0000,
+0xFBC0,0x9984,0x0000, 0xFBC0,0x9985,0x0000, 0xFBC0,0x9986,0x0000,
+0xFBC0,0x9987,0x0000, 0xFBC0,0x9988,0x0000, 0xFBC0,0x9989,0x0000,
+0xFBC0,0x998A,0x0000, 0xFBC0,0x998B,0x0000, 0xFBC0,0x998C,0x0000,
+0xFBC0,0x998D,0x0000, 0xFBC0,0x998E,0x0000, 0xFBC0,0x998F,0x0000,
+0xFBC0,0x9990,0x0000, 0xFBC0,0x9991,0x0000, 0xFBC0,0x9992,0x0000,
+0xFBC0,0x9993,0x0000, 0xFBC0,0x9994,0x0000, 0xFBC0,0x9995,0x0000,
+0xFBC0,0x9996,0x0000, 0xFBC0,0x9997,0x0000, 0xFBC0,0x9998,0x0000,
+0xFBC0,0x9999,0x0000, 0xFBC0,0x999A,0x0000, 0xFBC0,0x999B,0x0000,
+0xFBC0,0x999C,0x0000, 0xFBC0,0x999D,0x0000, 0xFBC0,0x999E,0x0000,
+0xFBC0,0x999F,0x0000, 0xFBC0,0x99A0,0x0000, 0xFBC0,0x99A1,0x0000,
+0xFBC0,0x99A2,0x0000, 0xFBC0,0x99A3,0x0000, 0xFBC0,0x99A4,0x0000,
+0xFBC0,0x99A5,0x0000, 0xFBC0,0x99A6,0x0000, 0xFBC0,0x99A7,0x0000,
+0xFBC0,0x99A8,0x0000, 0xFBC0,0x99A9,0x0000, 0xFBC0,0x99AA,0x0000,
+0xFBC0,0x99AB,0x0000, 0xFBC0,0x99AC,0x0000, 0xFBC0,0x99AD,0x0000,
+0xFBC0,0x99AE,0x0000, 0xFBC0,0x99AF,0x0000, 0xFBC0,0x99B0,0x0000,
+0xFBC0,0x99B1,0x0000, 0xFBC0,0x99B2,0x0000, 0xFBC0,0x99B3,0x0000,
+0xFBC0,0x99B4,0x0000, 0xFBC0,0x99B5,0x0000, 0xFBC0,0x99B6,0x0000,
+0xFBC0,0x99B7,0x0000, 0xFBC0,0x99B8,0x0000, 0xFBC0,0x99B9,0x0000,
+0xFBC0,0x99BA,0x0000, 0xFBC0,0x99BB,0x0000, 0xFBC0,0x99BC,0x0000,
+0xFBC0,0x99BD,0x0000, 0xFBC0,0x99BE,0x0000, 0xFBC0,0x99BF,0x0000,
+0xFBC0,0x99C0,0x0000, 0xFBC0,0x99C1,0x0000, 0xFBC0,0x99C2,0x0000,
+0xFBC0,0x99C3,0x0000, 0xFBC0,0x99C4,0x0000, 0xFBC0,0x99C5,0x0000,
+0xFBC0,0x99C6,0x0000, 0xFBC0,0x99C7,0x0000, 0xFBC0,0x99C8,0x0000,
+0xFBC0,0x99C9,0x0000, 0xFBC0,0x99CA,0x0000, 0xFBC0,0x99CB,0x0000,
+0xFBC0,0x99CC,0x0000, 0xFBC0,0x99CD,0x0000, 0xFBC0,0x99CE,0x0000,
+0xFBC0,0x99CF,0x0000, 0xFBC0,0x99D0,0x0000, 0xFBC0,0x99D1,0x0000,
+0xFBC0,0x99D2,0x0000, 0xFBC0,0x99D3,0x0000, 0xFBC0,0x99D4,0x0000,
+0xFBC0,0x99D5,0x0000, 0xFBC0,0x99D6,0x0000, 0xFBC0,0x99D7,0x0000,
+0xFBC0,0x99D8,0x0000, 0xFBC0,0x99D9,0x0000, 0xFBC0,0x99DA,0x0000,
+0xFBC0,0x99DB,0x0000, 0xFBC0,0x99DC,0x0000, 0xFBC0,0x99DD,0x0000,
+0xFBC0,0x99DE,0x0000, 0xFBC0,0x99DF,0x0000, 0x037B,0x0000,0x0000,
+0x037C,0x0000,0x0000, 0x037D,0x0000,0x0000, 0x037E,0x0000,0x0000,
+0x037F,0x0000,0x0000, 0x0380,0x0000,0x0000, 0x0381,0x0000,0x0000,
+0x0382,0x0000,0x0000, 0x0383,0x0000,0x0000, 0x0384,0x0000,0x0000,
+0x0385,0x0000,0x0000, 0x0386,0x0000,0x0000, 0x0387,0x0000,0x0000,
+0x0388,0x0000,0x0000, 0x0389,0x0000,0x0000, 0x038A,0x0000,0x0000,
+0x038B,0x0000,0x0000, 0x038C,0x0000,0x0000, 0x038D,0x0000,0x0000,
+0x038E,0x0000,0x0000, 0x038F,0x0000,0x0000, 0x0390,0x0000,0x0000,
+0x0391,0x0000,0x0000, 0x0392,0x0000,0x0000, 0x0393,0x0000,0x0000,
+0x0394,0x0000,0x0000, 0x0395,0x0000,0x0000, 0x0396,0x0000,0x0000,
+0x0397,0x0000,0x0000, 0x0398,0x0000,0x0000, 0x0399,0x0000,0x0000,
+0x039A,0x0000,0x0000 };
+
+uint16 page01Ddata[]= { /* 1D00 (3 weights per char) */
+0x0E37,0x0000,0x0000, 0x0E3C,0x0000,0x0000, 0x0E3D,0x0000,0x0000,
+0x0E57,0x0000,0x0000, 0x0E64,0x0000,0x0000, 0x0E71,0x0000,0x0000,
+0x0E8A,0x0000,0x0000, 0x0E8F,0x0000,0x0000, 0x0EA8,0x0000,0x0000,
+0x0F07,0x0000,0x0000, 0x0F14,0x0000,0x0000, 0x0F25,0x0000,0x0000,
+0x0F3A,0x0000,0x0000, 0x0F5F,0x0000,0x0000, 0x0F6D,0x0000,0x0000,
+0x0F86,0x0000,0x0000, 0x0F96,0x0000,0x0000, 0x0F87,0x0000,0x0000,
+0x0F97,0x0000,0x0000, 0x0F91,0x0000,0x0000, 0x0F8C,0x0000,0x0000,
+0x0FA6,0x0000,0x0000, 0x0F98,0x0000,0x0000, 0x0F99,0x0000,0x0000,
+0x0FAB,0x0000,0x0000, 0x0FC8,0x0000,0x0000, 0x0FCD,0x0000,0x0000,
+0x1006,0x0000,0x0000, 0x1023,0x0000,0x0000, 0x1024,0x0000,0x0000,
+0x1025,0x0000,0x0000, 0x103B,0x0000,0x0000, 0x1048,0x0000,0x0000,
+0x1055,0x0000,0x0000, 0x106E,0x0000,0x0000, 0x1083,0x0000,0x0000,
+0x10BA,0x0000,0x0000, 0x10BB,0x0000,0x0000, 0x10EB,0x0000,0x0000,
+0x10F7,0x0000,0x0000, 0x10FD,0x0000,0x0000, 0x1101,0x0000,0x0000,
+0x1108,0x0000,0x0000, 0x11B4,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E38,0x0000,0x0000, 0x0E4A,0x0000,0x0000, 0x0E56,0x0000,0x0000,
+0x0E6D,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E90,0x0000,0x0000,
+0x0EC1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0F10,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0F2E,0x0000,0x0000,
+0x0F5B,0x0000,0x0000, 0x0F64,0x0000,0x0000, 0x0F6C,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0FA2,0x0000,0x0000, 0x0FA7,0x0000,0x0000,
+0x0FC0,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x1051,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E3E,0x0000,0x0000,
+0x0E42,0x0000,0x0000, 0x0E3D,0x0000,0x0000, 0x0E4A,0x0000,0x0000,
+0x0E6D,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E94,0x0000,0x0000,
+0x0E98,0x0000,0x0000, 0x0EA8,0x0000,0x0000, 0x0EC1,0x0000,0x0000,
+0x0F07,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0F5B,0x0000,0x0000,
+0x0F7E,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F92,0x0000,0x0000,
+0x0F98,0x0000,0x0000, 0x0F99,0x0000,0x0000, 0x0FA7,0x0000,0x0000,
+0x1002,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x1024,0x0000,0x0000,
+0x1037,0x0000,0x0000, 0x1044,0x0000,0x0000, 0x10BB,0x0000,0x0000,
+0x10E9,0x0000,0x0000, 0x10EA,0x0000,0x0000, 0x10EC,0x0000,0x0000,
+0x1105,0x0000,0x0000, 0x1106,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0FC0,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x1044,0x0000,0x0000,
+0x10E9,0x0000,0x0000, 0x10EA,0x0000,0x0000, 0x1100,0x0000,0x0000,
+0x1105,0x0000,0x0000, 0x1106,0x0000,0x0000, 0x1026,0x0000,0x0000,
+0xFBC0,0x9D6C,0x0000, 0xFBC0,0x9D6D,0x0000, 0xFBC0,0x9D6E,0x0000,
+0xFBC0,0x9D6F,0x0000, 0xFBC0,0x9D70,0x0000, 0xFBC0,0x9D71,0x0000,
+0xFBC0,0x9D72,0x0000, 0xFBC0,0x9D73,0x0000, 0xFBC0,0x9D74,0x0000,
+0xFBC0,0x9D75,0x0000, 0xFBC0,0x9D76,0x0000, 0xFBC0,0x9D77,0x0000,
+0xFBC0,0x9D78,0x0000, 0xFBC0,0x9D79,0x0000, 0xFBC0,0x9D7A,0x0000,
+0xFBC0,0x9D7B,0x0000, 0xFBC0,0x9D7C,0x0000, 0xFBC0,0x9D7D,0x0000,
+0xFBC0,0x9D7E,0x0000, 0xFBC0,0x9D7F,0x0000, 0xFBC0,0x9D80,0x0000,
+0xFBC0,0x9D81,0x0000, 0xFBC0,0x9D82,0x0000, 0xFBC0,0x9D83,0x0000,
+0xFBC0,0x9D84,0x0000, 0xFBC0,0x9D85,0x0000, 0xFBC0,0x9D86,0x0000,
+0xFBC0,0x9D87,0x0000, 0xFBC0,0x9D88,0x0000, 0xFBC0,0x9D89,0x0000,
+0xFBC0,0x9D8A,0x0000, 0xFBC0,0x9D8B,0x0000, 0xFBC0,0x9D8C,0x0000,
+0xFBC0,0x9D8D,0x0000, 0xFBC0,0x9D8E,0x0000, 0xFBC0,0x9D8F,0x0000,
+0xFBC0,0x9D90,0x0000, 0xFBC0,0x9D91,0x0000, 0xFBC0,0x9D92,0x0000,
+0xFBC0,0x9D93,0x0000, 0xFBC0,0x9D94,0x0000, 0xFBC0,0x9D95,0x0000,
+0xFBC0,0x9D96,0x0000, 0xFBC0,0x9D97,0x0000, 0xFBC0,0x9D98,0x0000,
+0xFBC0,0x9D99,0x0000, 0xFBC0,0x9D9A,0x0000, 0xFBC0,0x9D9B,0x0000,
+0xFBC0,0x9D9C,0x0000, 0xFBC0,0x9D9D,0x0000, 0xFBC0,0x9D9E,0x0000,
+0xFBC0,0x9D9F,0x0000, 0xFBC0,0x9DA0,0x0000, 0xFBC0,0x9DA1,0x0000,
+0xFBC0,0x9DA2,0x0000, 0xFBC0,0x9DA3,0x0000, 0xFBC0,0x9DA4,0x0000,
+0xFBC0,0x9DA5,0x0000, 0xFBC0,0x9DA6,0x0000, 0xFBC0,0x9DA7,0x0000,
+0xFBC0,0x9DA8,0x0000, 0xFBC0,0x9DA9,0x0000, 0xFBC0,0x9DAA,0x0000,
+0xFBC0,0x9DAB,0x0000, 0xFBC0,0x9DAC,0x0000, 0xFBC0,0x9DAD,0x0000,
+0xFBC0,0x9DAE,0x0000, 0xFBC0,0x9DAF,0x0000, 0xFBC0,0x9DB0,0x0000,
+0xFBC0,0x9DB1,0x0000, 0xFBC0,0x9DB2,0x0000, 0xFBC0,0x9DB3,0x0000,
+0xFBC0,0x9DB4,0x0000, 0xFBC0,0x9DB5,0x0000, 0xFBC0,0x9DB6,0x0000,
+0xFBC0,0x9DB7,0x0000, 0xFBC0,0x9DB8,0x0000, 0xFBC0,0x9DB9,0x0000,
+0xFBC0,0x9DBA,0x0000, 0xFBC0,0x9DBB,0x0000, 0xFBC0,0x9DBC,0x0000,
+0xFBC0,0x9DBD,0x0000, 0xFBC0,0x9DBE,0x0000, 0xFBC0,0x9DBF,0x0000,
+0xFBC0,0x9DC0,0x0000, 0xFBC0,0x9DC1,0x0000, 0xFBC0,0x9DC2,0x0000,
+0xFBC0,0x9DC3,0x0000, 0xFBC0,0x9DC4,0x0000, 0xFBC0,0x9DC5,0x0000,
+0xFBC0,0x9DC6,0x0000, 0xFBC0,0x9DC7,0x0000, 0xFBC0,0x9DC8,0x0000,
+0xFBC0,0x9DC9,0x0000, 0xFBC0,0x9DCA,0x0000, 0xFBC0,0x9DCB,0x0000,
+0xFBC0,0x9DCC,0x0000, 0xFBC0,0x9DCD,0x0000, 0xFBC0,0x9DCE,0x0000,
+0xFBC0,0x9DCF,0x0000, 0xFBC0,0x9DD0,0x0000, 0xFBC0,0x9DD1,0x0000,
+0xFBC0,0x9DD2,0x0000, 0xFBC0,0x9DD3,0x0000, 0xFBC0,0x9DD4,0x0000,
+0xFBC0,0x9DD5,0x0000, 0xFBC0,0x9DD6,0x0000, 0xFBC0,0x9DD7,0x0000,
+0xFBC0,0x9DD8,0x0000, 0xFBC0,0x9DD9,0x0000, 0xFBC0,0x9DDA,0x0000,
+0xFBC0,0x9DDB,0x0000, 0xFBC0,0x9DDC,0x0000, 0xFBC0,0x9DDD,0x0000,
+0xFBC0,0x9DDE,0x0000, 0xFBC0,0x9DDF,0x0000, 0xFBC0,0x9DE0,0x0000,
+0xFBC0,0x9DE1,0x0000, 0xFBC0,0x9DE2,0x0000, 0xFBC0,0x9DE3,0x0000,
+0xFBC0,0x9DE4,0x0000, 0xFBC0,0x9DE5,0x0000, 0xFBC0,0x9DE6,0x0000,
+0xFBC0,0x9DE7,0x0000, 0xFBC0,0x9DE8,0x0000, 0xFBC0,0x9DE9,0x0000,
+0xFBC0,0x9DEA,0x0000, 0xFBC0,0x9DEB,0x0000, 0xFBC0,0x9DEC,0x0000,
+0xFBC0,0x9DED,0x0000, 0xFBC0,0x9DEE,0x0000, 0xFBC0,0x9DEF,0x0000,
+0xFBC0,0x9DF0,0x0000, 0xFBC0,0x9DF1,0x0000, 0xFBC0,0x9DF2,0x0000,
+0xFBC0,0x9DF3,0x0000, 0xFBC0,0x9DF4,0x0000, 0xFBC0,0x9DF5,0x0000,
+0xFBC0,0x9DF6,0x0000, 0xFBC0,0x9DF7,0x0000, 0xFBC0,0x9DF8,0x0000,
+0xFBC0,0x9DF9,0x0000, 0xFBC0,0x9DFA,0x0000, 0xFBC0,0x9DFB,0x0000,
+0xFBC0,0x9DFC,0x0000, 0xFBC0,0x9DFD,0x0000, 0xFBC0,0x9DFE,0x0000,
+0xFBC0,0x9DFF,0x0000 };
+
+uint16 page01Edata[]= { /* 1E00 (3 weights per char) */
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E4A,0x0000,0x0000,
+0x0E4A,0x0000,0x0000, 0x0E4A,0x0000,0x0000, 0x0E4A,0x0000,0x0000,
+0x0E4A,0x0000,0x0000, 0x0E4A,0x0000,0x0000, 0x0E60,0x0000,0x0000,
+0x0E60,0x0000,0x0000, 0x0E6D,0x0000,0x0000, 0x0E6D,0x0000,0x0000,
+0x0E6D,0x0000,0x0000, 0x0E6D,0x0000,0x0000, 0x0E6D,0x0000,0x0000,
+0x0E6D,0x0000,0x0000, 0x0E6D,0x0000,0x0000, 0x0E6D,0x0000,0x0000,
+0x0E6D,0x0000,0x0000, 0x0E6D,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0EB9,0x0000,0x0000, 0x0EB9,0x0000,0x0000, 0x0EC1,0x0000,0x0000,
+0x0EC1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000,
+0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000,
+0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000,
+0x0EE1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0F21,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0F21,0x0000,0x0000,
+0x0F21,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0F21,0x0000,0x0000,
+0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000,
+0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000,
+0x0F2E,0x0000,0x0000, 0x0F2E,0x0000,0x0000, 0x0F5B,0x0000,0x0000,
+0x0F5B,0x0000,0x0000, 0x0F5B,0x0000,0x0000, 0x0F5B,0x0000,0x0000,
+0x0F5B,0x0000,0x0000, 0x0F5B,0x0000,0x0000, 0x0F64,0x0000,0x0000,
+0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000,
+0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000, 0x0F64,0x0000,0x0000,
+0x0F64,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0FA7,0x0000,0x0000, 0x0FA7,0x0000,0x0000, 0x0FA7,0x0000,0x0000,
+0x0FA7,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000,
+0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000,
+0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FC0,0x0000,0x0000,
+0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000,
+0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000,
+0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000, 0x0FEA,0x0000,0x0000,
+0x0FEA,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000,
+0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000,
+0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x1002,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x1044,0x0000,0x0000, 0x1044,0x0000,0x0000,
+0x1044,0x0000,0x0000, 0x1044,0x0000,0x0000, 0x1051,0x0000,0x0000,
+0x1051,0x0000,0x0000, 0x1051,0x0000,0x0000, 0x1051,0x0000,0x0000,
+0x1051,0x0000,0x0000, 0x1051,0x0000,0x0000, 0x1051,0x0000,0x0000,
+0x1051,0x0000,0x0000, 0x1051,0x0000,0x0000, 0x1051,0x0000,0x0000,
+0x105A,0x0000,0x0000, 0x105A,0x0000,0x0000, 0x105A,0x0000,0x0000,
+0x105A,0x0000,0x0000, 0x105E,0x0000,0x0000, 0x105E,0x0000,0x0000,
+0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000,
+0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000, 0x106A,0x0000,0x0000,
+0x0EE1,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x1051,0x0000,0x0000,
+0x105E,0x0000,0x0000, 0x0E33,0x10B3,0x0000, 0x0FEA,0x0000,0x0000,
+0xFBC0,0x9E9C,0x0000, 0xFBC0,0x9E9D,0x0000, 0xFBC0,0x9E9E,0x0000,
+0xFBC0,0x9E9F,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x101F,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x105E,0x0000,0x0000,
+0x105E,0x0000,0x0000, 0x105E,0x0000,0x0000, 0x105E,0x0000,0x0000,
+0x105E,0x0000,0x0000, 0x105E,0x0000,0x0000, 0x105E,0x0000,0x0000,
+0x105E,0x0000,0x0000, 0xFBC0,0x9EFA,0x0000, 0xFBC0,0x9EFB,0x0000,
+0xFBC0,0x9EFC,0x0000, 0xFBC0,0x9EFD,0x0000, 0xFBC0,0x9EFE,0x0000,
+0xFBC0,0x9EFF,0x0000 };
+
+uint16 page01Fdata[]= { /* 1F00 (3 weights per char) */
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000,
+0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000,
+0x10ED,0x0000,0x0000, 0xFBC0,0x9F16,0x0000, 0xFBC0,0x9F17,0x0000,
+0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000,
+0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000,
+0xFBC0,0x9F1E,0x0000, 0xFBC0,0x9F1F,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000,
+0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000,
+0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000,
+0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000,
+0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000,
+0x10F3,0x0000,0x0000, 0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000,
+0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000,
+0x10FB,0x0000,0x0000, 0xFBC0,0x9F46,0x0000, 0xFBC0,0x9F47,0x0000,
+0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000,
+0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000,
+0xFBC0,0x9F4E,0x0000, 0xFBC0,0x9F4F,0x0000, 0x1104,0x0000,0x0000,
+0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000,
+0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000,
+0x1104,0x0000,0x0000, 0xFBC0,0x9F58,0x0000, 0x1104,0x0000,0x0000,
+0xFBC0,0x9F5A,0x0000, 0x1104,0x0000,0x0000, 0xFBC0,0x9F5C,0x0000,
+0x1104,0x0000,0x0000, 0xFBC0,0x9F5E,0x0000, 0x1104,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10ED,0x0000,0x0000, 0x10ED,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000,
+0x10FB,0x0000,0x0000, 0x10FB,0x0000,0x0000, 0x1104,0x0000,0x0000,
+0x1104,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0xFBC0,0x9F7E,0x0000, 0xFBC0,0x9F7F,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0xFBC0,0x9FB5,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000, 0x10E8,0x0000,0x0000,
+0x0217,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x0217,0x0000,0x0000,
+0x021D,0x0000,0x0000, 0x0214,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0xFBC0,0x9FC5,0x0000,
+0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10ED,0x0000,0x0000,
+0x10ED,0x0000,0x0000, 0x10F1,0x0000,0x0000, 0x10F1,0x0000,0x0000,
+0x10F1,0x0000,0x0000, 0x0217,0x0000,0x0000, 0x0217,0x0000,0x0000,
+0x0217,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000,
+0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0xFBC0,0x9FD4,0x0000,
+0xFBC0,0x9FD5,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000,
+0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000, 0x10F3,0x0000,0x0000,
+0x10F3,0x0000,0x0000, 0xFBC0,0x9FDC,0x0000, 0x0218,0x0000,0x0000,
+0x0218,0x0000,0x0000, 0x0218,0x0000,0x0000, 0x1104,0x0000,0x0000,
+0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000,
+0x1100,0x0000,0x0000, 0x1100,0x0000,0x0000, 0x1104,0x0000,0x0000,
+0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000,
+0x1104,0x0000,0x0000, 0x1104,0x0000,0x0000, 0x1100,0x0000,0x0000,
+0x0214,0x0000,0x0000, 0x0214,0x0000,0x0000, 0x020C,0x0000,0x0000,
+0xFBC0,0x9FF0,0x0000, 0xFBC0,0x9FF1,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0xFBC0,0x9FF5,0x0000,
+0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x10FB,0x0000,0x0000,
+0x10FB,0x0000,0x0000, 0x1109,0x0000,0x0000, 0x1109,0x0000,0x0000,
+0x1109,0x0000,0x0000, 0x020D,0x0000,0x0000, 0x0218,0x0000,0x0000,
+0xFBC0,0x9FFF,0x0000 };
+
+uint16 page020data[]= { /* 2000 (5 weights per char) */
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0225,0x0000,0x0000,0x0000,0x0000,
+0x0225,0x0000,0x0000,0x0000,0x0000,
+0x0226,0x0000,0x0000,0x0000,0x0000,
+0x0227,0x0000,0x0000,0x0000,0x0000,
+0x0228,0x0000,0x0000,0x0000,0x0000,
+0x0229,0x0000,0x0000,0x0000,0x0000,
+0x0432,0x0000,0x0000,0x0000,0x0000,
+0x021C,0x0000,0x0000,0x0000,0x0000,
+0x0278,0x0000,0x0000,0x0000,0x0000,
+0x0279,0x0000,0x0000,0x0000,0x0000,
+0x027A,0x0000,0x0000,0x0000,0x0000,
+0x027B,0x0000,0x0000,0x0000,0x0000,
+0x027F,0x0000,0x0000,0x0000,0x0000,
+0x0280,0x0000,0x0000,0x0000,0x0000,
+0x0281,0x0000,0x0000,0x0000,0x0000,
+0x0282,0x0000,0x0000,0x0000,0x0000,
+0x02D8,0x0000,0x0000,0x0000,0x0000,
+0x02D9,0x0000,0x0000,0x0000,0x0000,
+0x02DA,0x0000,0x0000,0x0000,0x0000,
+0x02DB,0x0000,0x0000,0x0000,0x0000,
+0x025D,0x0000,0x0000,0x0000,0x0000,
+0x025D,0x025D,0x0000,0x0000,0x0000,
+0x025D,0x025D,0x025D,0x0000,0x0000,
+0x02DC,0x0000,0x0000,0x0000,0x0000,
+0x0207,0x0000,0x0000,0x0000,0x0000,
+0x0208,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x02D5,0x0000,0x0000,0x0000,0x0000,
+0x02D6,0x0000,0x0000,0x0000,0x0000,
+0x02E0,0x0000,0x0000,0x0000,0x0000,
+0x02E0,0x02E0,0x0000,0x0000,0x0000,
+0x02E0,0x02E0,0x02E0,0x0000,0x0000,
+0x02E1,0x0000,0x0000,0x0000,0x0000,
+0x02E1,0x02E1,0x0000,0x0000,0x0000,
+0x02E1,0x02E1,0x02E1,0x0000,0x0000,
+0x02E4,0x0000,0x0000,0x0000,0x0000,
+0x027C,0x0000,0x0000,0x0000,0x0000,
+0x027D,0x0000,0x0000,0x0000,0x0000,
+0x02E5,0x0000,0x0000,0x0000,0x0000,
+0x0251,0x0251,0x0000,0x0000,0x0000,
+0x025C,0x0000,0x0000,0x0000,0x0000,
+0x0211,0x0000,0x0000,0x0000,0x0000,
+0x02E6,0x0000,0x0000,0x0000,0x0000,
+0x02E8,0x0000,0x0000,0x0000,0x0000,
+0x02EA,0x0000,0x0000,0x0000,0x0000,
+0x02EB,0x0000,0x0000,0x0000,0x0000,
+0x02DD,0x0000,0x0000,0x0000,0x0000,
+0x02CD,0x0000,0x0000,0x0000,0x0000,
+0x0294,0x0000,0x0000,0x0000,0x0000,
+0x0295,0x0000,0x0000,0x0000,0x0000,
+0x0255,0x0255,0x0000,0x0000,0x0000,
+0x0255,0x0251,0x0000,0x0000,0x0000,
+0x0251,0x0255,0x0000,0x0000,0x0000,
+0x02D1,0x0000,0x0000,0x0000,0x0000,
+0x02C4,0x0000,0x0000,0x0000,0x0000,
+0x02DE,0x0000,0x0000,0x0000,0x0000,
+0x02DF,0x0000,0x0000,0x0000,0x0000,
+0x02C9,0x0000,0x0000,0x0000,0x0000,
+0x023C,0x0000,0x0000,0x0000,0x0000,
+0x02E9,0x0000,0x0000,0x0000,0x0000,
+0x02CA,0x0000,0x0000,0x0000,0x0000,
+0x02D7,0x0000,0x0000,0x0000,0x0000,
+0x022A,0x0000,0x0000,0x0000,0x0000,
+0x02E7,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xA055,0x0000,0x0000,0x0000,
+0xFBC0,0xA056,0x0000,0x0000,0x0000,
+0x02E0,0x02E0,0x02E0,0x02E0,0x0000,
+0xFBC0,0xA058,0x0000,0x0000,0x0000,
+0xFBC0,0xA059,0x0000,0x0000,0x0000,
+0xFBC0,0xA05A,0x0000,0x0000,0x0000,
+0xFBC0,0xA05B,0x0000,0x0000,0x0000,
+0xFBC0,0xA05C,0x0000,0x0000,0x0000,
+0xFBC0,0xA05D,0x0000,0x0000,0x0000,
+0xFBC0,0xA05E,0x0000,0x0000,0x0000,
+0x0209,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xA064,0x0000,0x0000,0x0000,
+0xFBC0,0xA065,0x0000,0x0000,0x0000,
+0xFBC0,0xA066,0x0000,0x0000,0x0000,
+0xFBC0,0xA067,0x0000,0x0000,0x0000,
+0xFBC0,0xA068,0x0000,0x0000,0x0000,
+0xFBC0,0xA069,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E29,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xA072,0x0000,0x0000,0x0000,
+0xFBC0,0xA073,0x0000,0x0000,0x0000,
+0x0E2D,0x0000,0x0000,0x0000,0x0000,
+0x0E2E,0x0000,0x0000,0x0000,0x0000,
+0x0E2F,0x0000,0x0000,0x0000,0x0000,
+0x0E30,0x0000,0x0000,0x0000,0x0000,
+0x0E31,0x0000,0x0000,0x0000,0x0000,
+0x0E32,0x0000,0x0000,0x0000,0x0000,
+0x0428,0x0000,0x0000,0x0000,0x0000,
+0x0434,0x0000,0x0000,0x0000,0x0000,
+0x042D,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x0000,0x0000,0x0000,0x0000,
+0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x0000,0x0000,0x0000,0x0000,
+0x0E29,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0000,0x0000,0x0000,0x0000,
+0x0E2E,0x0000,0x0000,0x0000,0x0000,
+0x0E2F,0x0000,0x0000,0x0000,0x0000,
+0x0E30,0x0000,0x0000,0x0000,0x0000,
+0x0E31,0x0000,0x0000,0x0000,0x0000,
+0x0E32,0x0000,0x0000,0x0000,0x0000,
+0x0428,0x0000,0x0000,0x0000,0x0000,
+0x0434,0x0000,0x0000,0x0000,0x0000,
+0x042D,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x0000,0x0000,0x0000,0x0000,
+0x0289,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xA08F,0x0000,0x0000,0x0000,
+0xFBC0,0xA090,0x0000,0x0000,0x0000,
+0xFBC0,0xA091,0x0000,0x0000,0x0000,
+0xFBC0,0xA092,0x0000,0x0000,0x0000,
+0xFBC0,0xA093,0x0000,0x0000,0x0000,
+0xFBC0,0xA094,0x0000,0x0000,0x0000,
+0xFBC0,0xA095,0x0000,0x0000,0x0000,
+0xFBC0,0xA096,0x0000,0x0000,0x0000,
+0xFBC0,0xA097,0x0000,0x0000,0x0000,
+0xFBC0,0xA098,0x0000,0x0000,0x0000,
+0xFBC0,0xA099,0x0000,0x0000,0x0000,
+0xFBC0,0xA09A,0x0000,0x0000,0x0000,
+0xFBC0,0xA09B,0x0000,0x0000,0x0000,
+0xFBC0,0xA09C,0x0000,0x0000,0x0000,
+0xFBC0,0xA09D,0x0000,0x0000,0x0000,
+0xFBC0,0xA09E,0x0000,0x0000,0x0000,
+0xFBC0,0xA09F,0x0000,0x0000,0x0000,
+0x0E18,0x0000,0x0000,0x0000,0x0000,
+0x0E19,0x0000,0x0000,0x0000,0x0000,
+0x0E1A,0x0000,0x0000,0x0000,0x0000,
+0x0E1B,0x0000,0x0000,0x0000,0x0000,
+0x0E1C,0x0000,0x0000,0x0000,0x0000,
+0x0E1D,0x0000,0x0000,0x0000,0x0000,
+0x0E1E,0x0000,0x0000,0x0000,0x0000,
+0x0E1F,0x0000,0x0000,0x0000,0x0000,
+0x0FC0,0x0FEA,0x0000,0x0000,0x0000,
+0x0E20,0x0000,0x0000,0x0000,0x0000,
+0x0E21,0x0000,0x0000,0x0000,0x0000,
+0x0E22,0x0000,0x0000,0x0000,0x0000,
+0x0E23,0x0000,0x0000,0x0000,0x0000,
+0x0E24,0x0000,0x0000,0x0000,0x0000,
+0x0E25,0x0000,0x0000,0x0000,0x0000,
+0x0E26,0x0000,0x0000,0x0000,0x0000,
+0x0E27,0x0000,0x0000,0x0000,0x0000,
+0x0E28,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xA0B2,0x0000,0x0000,0x0000,
+0xFBC0,0xA0B3,0x0000,0x0000,0x0000,
+0xFBC0,0xA0B4,0x0000,0x0000,0x0000,
+0xFBC0,0xA0B5,0x0000,0x0000,0x0000,
+0xFBC0,0xA0B6,0x0000,0x0000,0x0000,
+0xFBC0,0xA0B7,0x0000,0x0000,0x0000,
+0xFBC0,0xA0B8,0x0000,0x0000,0x0000,
+0xFBC0,0xA0B9,0x0000,0x0000,0x0000,
+0xFBC0,0xA0BA,0x0000,0x0000,0x0000,
+0xFBC0,0xA0BB,0x0000,0x0000,0x0000,
+0xFBC0,0xA0BC,0x0000,0x0000,0x0000,
+0xFBC0,0xA0BD,0x0000,0x0000,0x0000,
+0xFBC0,0xA0BE,0x0000,0x0000,0x0000,
+0xFBC0,0xA0BF,0x0000,0x0000,0x0000,
+0xFBC0,0xA0C0,0x0000,0x0000,0x0000,
+0xFBC0,0xA0C1,0x0000,0x0000,0x0000,
+0xFBC0,0xA0C2,0x0000,0x0000,0x0000,
+0xFBC0,0xA0C3,0x0000,0x0000,0x0000,
+0xFBC0,0xA0C4,0x0000,0x0000,0x0000,
+0xFBC0,0xA0C5,0x0000,0x0000,0x0000,
+0xFBC0,0xA0C6,0x0000,0x0000,0x0000,
+0xFBC0,0xA0C7,0x0000,0x0000,0x0000,
+0xFBC0,0xA0C8,0x0000,0x0000,0x0000,
+0xFBC0,0xA0C9,0x0000,0x0000,0x0000,
+0xFBC0,0xA0CA,0x0000,0x0000,0x0000,
+0xFBC0,0xA0CB,0x0000,0x0000,0x0000,
+0xFBC0,0xA0CC,0x0000,0x0000,0x0000,
+0xFBC0,0xA0CD,0x0000,0x0000,0x0000,
+0xFBC0,0xA0CE,0x0000,0x0000,0x0000,
+0xFBC0,0xA0CF,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xA0EB,0x0000,0x0000,0x0000,
+0xFBC0,0xA0EC,0x0000,0x0000,0x0000,
+0xFBC0,0xA0ED,0x0000,0x0000,0x0000,
+0xFBC0,0xA0EE,0x0000,0x0000,0x0000,
+0xFBC0,0xA0EF,0x0000,0x0000,0x0000,
+0xFBC0,0xA0F0,0x0000,0x0000,0x0000,
+0xFBC0,0xA0F1,0x0000,0x0000,0x0000,
+0xFBC0,0xA0F2,0x0000,0x0000,0x0000,
+0xFBC0,0xA0F3,0x0000,0x0000,0x0000,
+0xFBC0,0xA0F4,0x0000,0x0000,0x0000,
+0xFBC0,0xA0F5,0x0000,0x0000,0x0000,
+0xFBC0,0xA0F6,0x0000,0x0000,0x0000,
+0xFBC0,0xA0F7,0x0000,0x0000,0x0000,
+0xFBC0,0xA0F8,0x0000,0x0000,0x0000,
+0xFBC0,0xA0F9,0x0000,0x0000,0x0000,
+0xFBC0,0xA0FA,0x0000,0x0000,0x0000,
+0xFBC0,0xA0FB,0x0000,0x0000,0x0000,
+0xFBC0,0xA0FC,0x0000,0x0000,0x0000,
+0xFBC0,0xA0FD,0x0000,0x0000,0x0000,
+0xFBC0,0xA0FE,0x0000,0x0000,0x0000,
+0xFBC0,0xA0FF,0x0000,0x0000,0x0000
+};
+
+uint16 page021data[]= { /* 2100 (5 weights per char) */
+0x0E33,0x02CC,0x0E60,0x0000,0x0000,
+0x0E33,0x02CC,0x0FEA,0x0000,0x0000,
+0x0E60,0x0000,0x0000,0x0000,0x0000,
+0x034A,0x0E60,0x0000,0x0000,0x0000,
+0x039B,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x02CC,0x0F82,0x0000,0x0000,
+0x0E60,0x02CC,0x101F,0x0000,0x0000,
+0x0E98,0x0000,0x0000,0x0000,0x0000,
+0x039C,0x0000,0x0000,0x0000,0x0000,
+0x034A,0x0EB9,0x0000,0x0000,0x0000,
+0x0EC1,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x0000,0x0000,0x0000,0x0000,
+0x0EED,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000,0x0000,
+0x0F2E,0x0000,0x0000,0x0000,0x0000,
+0x0F2E,0x0000,0x0000,0x0000,0x0000,
+0x039D,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x0F82,0x0000,0x0000,0x0000,
+0x039E,0x0000,0x0000,0x0000,0x0000,
+0x039F,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x0000,0x0000,0x0000,0x0000,
+0x0FB4,0x0000,0x0000,0x0000,0x0000,
+0x0FC0,0x0000,0x0000,0x0000,0x0000,
+0x0FC0,0x0000,0x0000,0x0000,0x0000,
+0x0FC0,0x0000,0x0000,0x0000,0x0000,
+0x03A0,0x0000,0x0000,0x0000,0x0000,
+0x03A1,0x0000,0x0000,0x0000,0x0000,
+0x0FEA,0x0F5B,0x0000,0x0000,0x0000,
+0x1002,0x0E8B,0x0F2E,0x0000,0x0000,
+0x1002,0x0F5B,0x0000,0x0000,0x0000,
+0x03A2,0x0000,0x0000,0x0000,0x0000,
+0x106A,0x0000,0x0000,0x0000,0x0000,
+0x03A3,0x0000,0x0000,0x0000,0x0000,
+0x1109,0x0000,0x0000,0x0000,0x0000,
+0x03A4,0x0000,0x0000,0x0000,0x0000,
+0x106A,0x0000,0x0000,0x0000,0x0000,
+0x03A5,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0000,0x0000,0x0000,0x0000,
+0x0E33,0x0000,0x0000,0x0000,0x0000,
+0x0E4A,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0000,0x0000,0x0000,0x0000,
+0x03A6,0x0000,0x0000,0x0000,0x0000,
+0x0E8B,0x0000,0x0000,0x0000,0x0000,
+0x0E8B,0x0000,0x0000,0x0000,0x0000,
+0x0EB9,0x0000,0x0000,0x0000,0x0000,
+0x03A7,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0000,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000,0x0000,
+0x1331,0x0000,0x0000,0x0000,0x0000,
+0x1332,0x0000,0x0000,0x0000,0x0000,
+0x1333,0x0000,0x0000,0x0000,0x0000,
+0x1334,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000,0x0000,
+0x03A8,0x0000,0x0000,0x0000,0x0000,
+0x0EB9,0x0E33,0x105A,0x0000,0x0000,
+0xFBC0,0xA13C,0x0000,0x0000,0x0000,
+0x10EA,0x0000,0x0000,0x0000,0x0000,
+0x10EA,0x0000,0x0000,0x0000,0x0000,
+0x10FC,0x0000,0x0000,0x0000,0x0000,
+0x0427,0x0000,0x0000,0x0000,0x0000,
+0x03A9,0x0000,0x0000,0x0000,0x0000,
+0x03AA,0x0000,0x0000,0x0000,0x0000,
+0x03AB,0x0000,0x0000,0x0000,0x0000,
+0x03AC,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0000,0x0000,0x0000,0x0000,
+0x0E8B,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000,0x0000,
+0x0F10,0x0000,0x0000,0x0000,0x0000,
+0x03AD,0x0000,0x0000,0x0000,0x0000,
+0x02D0,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xA14C,0x0000,0x0000,0x0000,
+0xFBC0,0xA14D,0x0000,0x0000,0x0000,
+0xFBC0,0xA14E,0x0000,0x0000,0x0000,
+0xFBC0,0xA14F,0x0000,0x0000,0x0000,
+0xFBC0,0xA150,0x0000,0x0000,0x0000,
+0xFBC0,0xA151,0x0000,0x0000,0x0000,
+0xFBC0,0xA152,0x0000,0x0000,0x0000,
+0x0E2A,0x02CD,0x0E2C,0x0000,0x0000,
+0x0E2B,0x02CD,0x0E2C,0x0000,0x0000,
+0x0E2A,0x02CD,0x0E2E,0x0000,0x0000,
+0x0E2B,0x02CD,0x0E2E,0x0000,0x0000,
+0x0E2C,0x02CD,0x0E2E,0x0000,0x0000,
+0x0E2D,0x02CD,0x0E2E,0x0000,0x0000,
+0x0E2A,0x02CD,0x0E2F,0x0000,0x0000,
+0x0E2E,0x02CD,0x0E2F,0x0000,0x0000,
+0x0E2A,0x02CD,0x0E31,0x0000,0x0000,
+0x0E2C,0x02CD,0x0E31,0x0000,0x0000,
+0x0E2E,0x02CD,0x0E31,0x0000,0x0000,
+0x0E30,0x02CD,0x0E31,0x0000,0x0000,
+0x0E2A,0x02CD,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0EFB,0x0000,0x0000,0x0000,
+0x0EFB,0x0EFB,0x0EFB,0x0000,0x0000,
+0x0EFB,0x1044,0x0000,0x0000,0x0000,
+0x1044,0x0000,0x0000,0x0000,0x0000,
+0x1044,0x0EFB,0x0000,0x0000,0x0000,
+0x1044,0x0EFB,0x0EFB,0x0000,0x0000,
+0x1044,0x0EFB,0x0EFB,0x0EFB,0x0000,
+0x0EFB,0x105A,0x0000,0x0000,0x0000,
+0x105A,0x0000,0x0000,0x0000,0x0000,
+0x105A,0x0EFB,0x0000,0x0000,0x0000,
+0x105A,0x0EFB,0x0EFB,0x0000,0x0000,
+0x0F2E,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0EFB,0x0000,0x0000,0x0000,
+0x0EFB,0x0EFB,0x0EFB,0x0000,0x0000,
+0x0EFB,0x1044,0x0000,0x0000,0x0000,
+0x1044,0x0000,0x0000,0x0000,0x0000,
+0x1044,0x0EFB,0x0000,0x0000,0x0000,
+0x1044,0x0EFB,0x0EFB,0x0000,0x0000,
+0x1044,0x0EFB,0x0EFB,0x0EFB,0x0000,
+0x0EFB,0x105A,0x0000,0x0000,0x0000,
+0x105A,0x0000,0x0000,0x0000,0x0000,
+0x105A,0x0EFB,0x0000,0x0000,0x0000,
+0x105A,0x0EFB,0x0EFB,0x0000,0x0000,
+0x0F2E,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0000,0x0000,0x0000,0x0000,
+0x0DD7,0x0000,0x0000,0x0000,0x0000,
+0x0DD8,0x0000,0x0000,0x0000,0x0000,
+0x0DD9,0x0000,0x0000,0x0000,0x0000,
+0x0DDA,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xA184,0x0000,0x0000,0x0000,
+0xFBC0,0xA185,0x0000,0x0000,0x0000,
+0xFBC0,0xA186,0x0000,0x0000,0x0000,
+0xFBC0,0xA187,0x0000,0x0000,0x0000,
+0xFBC0,0xA188,0x0000,0x0000,0x0000,
+0xFBC0,0xA189,0x0000,0x0000,0x0000,
+0xFBC0,0xA18A,0x0000,0x0000,0x0000,
+0xFBC0,0xA18B,0x0000,0x0000,0x0000,
+0xFBC0,0xA18C,0x0000,0x0000,0x0000,
+0xFBC0,0xA18D,0x0000,0x0000,0x0000,
+0xFBC0,0xA18E,0x0000,0x0000,0x0000,
+0xFBC0,0xA18F,0x0000,0x0000,0x0000,
+0x03AE,0x0000,0x0000,0x0000,0x0000,
+0x03B0,0x0000,0x0000,0x0000,0x0000,
+0x03AF,0x0000,0x0000,0x0000,0x0000,
+0x03B1,0x0000,0x0000,0x0000,0x0000,
+0x03B2,0x0000,0x0000,0x0000,0x0000,
+0x03B3,0x0000,0x0000,0x0000,0x0000,
+0x03B4,0x0000,0x0000,0x0000,0x0000,
+0x03B5,0x0000,0x0000,0x0000,0x0000,
+0x03B6,0x0000,0x0000,0x0000,0x0000,
+0x03B7,0x0000,0x0000,0x0000,0x0000,
+0x03AE,0x0000,0x0000,0x0000,0x0000,
+0x03AF,0x0000,0x0000,0x0000,0x0000,
+0x03B8,0x0000,0x0000,0x0000,0x0000,
+0x03B9,0x0000,0x0000,0x0000,0x0000,
+0x03BA,0x0000,0x0000,0x0000,0x0000,
+0x03BB,0x0000,0x0000,0x0000,0x0000,
+0x03BC,0x0000,0x0000,0x0000,0x0000,
+0x03BD,0x0000,0x0000,0x0000,0x0000,
+0x03BE,0x0000,0x0000,0x0000,0x0000,
+0x03BF,0x0000,0x0000,0x0000,0x0000,
+0x03C0,0x0000,0x0000,0x0000,0x0000,
+0x03C1,0x0000,0x0000,0x0000,0x0000,
+0x03C2,0x0000,0x0000,0x0000,0x0000,
+0x03C3,0x0000,0x0000,0x0000,0x0000,
+0x03C4,0x0000,0x0000,0x0000,0x0000,
+0x03C5,0x0000,0x0000,0x0000,0x0000,
+0x03C6,0x0000,0x0000,0x0000,0x0000,
+0x03C7,0x0000,0x0000,0x0000,0x0000,
+0x03C8,0x0000,0x0000,0x0000,0x0000,
+0x03C9,0x0000,0x0000,0x0000,0x0000,
+0x03B2,0x0000,0x0000,0x0000,0x0000,
+0x03CA,0x0000,0x0000,0x0000,0x0000,
+0x03CB,0x0000,0x0000,0x0000,0x0000,
+0x03CC,0x0000,0x0000,0x0000,0x0000,
+0x03CD,0x0000,0x0000,0x0000,0x0000,
+0x03CE,0x0000,0x0000,0x0000,0x0000,
+0x03CF,0x0000,0x0000,0x0000,0x0000,
+0x03D0,0x0000,0x0000,0x0000,0x0000,
+0x03D1,0x0000,0x0000,0x0000,0x0000,
+0x03D2,0x0000,0x0000,0x0000,0x0000,
+0x03D3,0x0000,0x0000,0x0000,0x0000,
+0x03D4,0x0000,0x0000,0x0000,0x0000,
+0x03D5,0x0000,0x0000,0x0000,0x0000,
+0x03D6,0x0000,0x0000,0x0000,0x0000,
+0x03D7,0x0000,0x0000,0x0000,0x0000,
+0x03D8,0x0000,0x0000,0x0000,0x0000,
+0x03D9,0x0000,0x0000,0x0000,0x0000,
+0x03DA,0x0000,0x0000,0x0000,0x0000,
+0x03DB,0x0000,0x0000,0x0000,0x0000,
+0x03DC,0x0000,0x0000,0x0000,0x0000,
+0x03DD,0x0000,0x0000,0x0000,0x0000,
+0x03DE,0x0000,0x0000,0x0000,0x0000,
+0x03DF,0x0000,0x0000,0x0000,0x0000,
+0x03E0,0x0000,0x0000,0x0000,0x0000,
+0x03E1,0x0000,0x0000,0x0000,0x0000,
+0x03E2,0x0000,0x0000,0x0000,0x0000,
+0x03E3,0x0000,0x0000,0x0000,0x0000,
+0x03E4,0x0000,0x0000,0x0000,0x0000,
+0x03E5,0x0000,0x0000,0x0000,0x0000,
+0x03E6,0x0000,0x0000,0x0000,0x0000,
+0x03E7,0x0000,0x0000,0x0000,0x0000,
+0x03E8,0x0000,0x0000,0x0000,0x0000,
+0x03EC,0x0000,0x0000,0x0000,0x0000,
+0x03EA,0x0000,0x0000,0x0000,0x0000,
+0x03E8,0x0000,0x0000,0x0000,0x0000,
+0x03E9,0x0000,0x0000,0x0000,0x0000,
+0x03EA,0x0000,0x0000,0x0000,0x0000,
+0x03EB,0x0000,0x0000,0x0000,0x0000,
+0x03EC,0x0000,0x0000,0x0000,0x0000,
+0x03ED,0x0000,0x0000,0x0000,0x0000,
+0x03EE,0x0000,0x0000,0x0000,0x0000,
+0x03EF,0x0000,0x0000,0x0000,0x0000,
+0x03F0,0x0000,0x0000,0x0000,0x0000,
+0x03F1,0x0000,0x0000,0x0000,0x0000,
+0x03F2,0x0000,0x0000,0x0000,0x0000,
+0x03F3,0x0000,0x0000,0x0000,0x0000,
+0x03F4,0x0000,0x0000,0x0000,0x0000,
+0x03F5,0x0000,0x0000,0x0000,0x0000,
+0x03F6,0x0000,0x0000,0x0000,0x0000,
+0x03F7,0x0000,0x0000,0x0000,0x0000,
+0x03F8,0x0000,0x0000,0x0000,0x0000,
+0x03F9,0x0000,0x0000,0x0000,0x0000,
+0x03FA,0x0000,0x0000,0x0000,0x0000,
+0x03FB,0x0000,0x0000,0x0000,0x0000,
+0x03FC,0x0000,0x0000,0x0000,0x0000,
+0x03FD,0x0000,0x0000,0x0000,0x0000,
+0x03FE,0x0000,0x0000,0x0000,0x0000,
+0x03FF,0x0000,0x0000,0x0000,0x0000,
+0x0400,0x0000,0x0000,0x0000,0x0000,
+0x0401,0x0000,0x0000,0x0000,0x0000,
+0x0402,0x0000,0x0000,0x0000,0x0000,
+0x0403,0x0000,0x0000,0x0000,0x0000,
+0x0404,0x0000,0x0000,0x0000,0x0000,
+0x0405,0x0000,0x0000,0x0000,0x0000,
+0x0406,0x0000,0x0000,0x0000,0x0000,
+0x0407,0x0000,0x0000,0x0000,0x0000,
+0x0408,0x0000,0x0000,0x0000,0x0000,
+0x0409,0x0000,0x0000,0x0000,0x0000,
+0x040A,0x0000,0x0000,0x0000,0x0000,
+0x040B,0x0000,0x0000,0x0000,0x0000,
+0x040C,0x0000,0x0000,0x0000,0x0000,
+0x040D,0x0000,0x0000,0x0000,0x0000,
+0x040E,0x0000,0x0000,0x0000,0x0000,
+0x040F,0x0000,0x0000,0x0000,0x0000,
+0x0410,0x0000,0x0000,0x0000,0x0000,
+0x0411,0x0000,0x0000,0x0000,0x0000,
+0x0412,0x0000,0x0000,0x0000,0x0000,
+0x0413,0x0000,0x0000,0x0000,0x0000,
+0x0414,0x0000,0x0000,0x0000,0x0000,
+0x0415,0x0000,0x0000,0x0000,0x0000,
+0x0416,0x0000,0x0000,0x0000,0x0000,
+0x0417,0x0000,0x0000,0x0000,0x0000
+};
+
+uint16 page022data[]= { /* 2200 (4 weights per char) */
+0x0418,0x0000,0x0000,0x0000, 0x0419,0x0000,0x0000,0x0000,
+0x041A,0x0000,0x0000,0x0000, 0x041B,0x0000,0x0000,0x0000,
+0x041B,0x0000,0x0000,0x0000, 0x041C,0x0000,0x0000,0x0000,
+0x041D,0x0000,0x0000,0x0000, 0x041E,0x0000,0x0000,0x0000,
+0x041F,0x0000,0x0000,0x0000, 0x041F,0x0000,0x0000,0x0000,
+0x0420,0x0000,0x0000,0x0000, 0x0421,0x0000,0x0000,0x0000,
+0x0421,0x0000,0x0000,0x0000, 0x0422,0x0000,0x0000,0x0000,
+0x0424,0x0000,0x0000,0x0000, 0x0425,0x0000,0x0000,0x0000,
+0x0426,0x0000,0x0000,0x0000, 0x0427,0x0000,0x0000,0x0000,
+0x0434,0x0000,0x0000,0x0000, 0x0435,0x0000,0x0000,0x0000,
+0x0436,0x0000,0x0000,0x0000, 0x0437,0x0000,0x0000,0x0000,
+0x0438,0x0000,0x0000,0x0000, 0x0439,0x0000,0x0000,0x0000,
+0x043A,0x0000,0x0000,0x0000, 0x043B,0x0000,0x0000,0x0000,
+0x043C,0x0000,0x0000,0x0000, 0x043D,0x0000,0x0000,0x0000,
+0x043E,0x0000,0x0000,0x0000, 0x043F,0x0000,0x0000,0x0000,
+0x0440,0x0000,0x0000,0x0000, 0x0441,0x0000,0x0000,0x0000,
+0x0442,0x0000,0x0000,0x0000, 0x0443,0x0000,0x0000,0x0000,
+0x0444,0x0000,0x0000,0x0000, 0x0445,0x0000,0x0000,0x0000,
+0x0445,0x0000,0x0000,0x0000, 0x0446,0x0000,0x0000,0x0000,
+0x0446,0x0000,0x0000,0x0000, 0x0447,0x0000,0x0000,0x0000,
+0x0448,0x0000,0x0000,0x0000, 0x0449,0x0000,0x0000,0x0000,
+0x044A,0x0000,0x0000,0x0000, 0x044B,0x0000,0x0000,0x0000,
+0x044B,0x044B,0x0000,0x0000, 0x044B,0x044B,0x044B,0x0000,
+0x044C,0x0000,0x0000,0x0000, 0x044C,0x044C,0x0000,0x0000,
+0x044C,0x044C,0x044C,0x0000, 0x044D,0x0000,0x0000,0x0000,
+0x044E,0x0000,0x0000,0x0000, 0x044F,0x0000,0x0000,0x0000,
+0x0450,0x0000,0x0000,0x0000, 0x0451,0x0000,0x0000,0x0000,
+0x0452,0x0000,0x0000,0x0000, 0x0453,0x0000,0x0000,0x0000,
+0x0454,0x0000,0x0000,0x0000, 0x0455,0x0000,0x0000,0x0000,
+0x0456,0x0000,0x0000,0x0000, 0x0457,0x0000,0x0000,0x0000,
+0x0458,0x0000,0x0000,0x0000, 0x0459,0x0000,0x0000,0x0000,
+0x045A,0x0000,0x0000,0x0000, 0x045B,0x0000,0x0000,0x0000,
+0x045C,0x0000,0x0000,0x0000, 0x0458,0x0000,0x0000,0x0000,
+0x045D,0x0000,0x0000,0x0000, 0x045E,0x0000,0x0000,0x0000,
+0x045E,0x0000,0x0000,0x0000, 0x045F,0x0000,0x0000,0x0000,
+0x0460,0x0000,0x0000,0x0000, 0x045F,0x0000,0x0000,0x0000,
+0x0461,0x0000,0x0000,0x0000, 0x0461,0x0000,0x0000,0x0000,
+0x0462,0x0000,0x0000,0x0000, 0x0463,0x0000,0x0000,0x0000,
+0x0464,0x0000,0x0000,0x0000, 0x0465,0x0000,0x0000,0x0000,
+0x0466,0x0000,0x0000,0x0000, 0x0467,0x0000,0x0000,0x0000,
+0x0468,0x0000,0x0000,0x0000, 0x0469,0x0000,0x0000,0x0000,
+0x046A,0x0000,0x0000,0x0000, 0x046B,0x0000,0x0000,0x0000,
+0x046C,0x0000,0x0000,0x0000, 0x046D,0x0000,0x0000,0x0000,
+0x046E,0x0000,0x0000,0x0000, 0x046F,0x0000,0x0000,0x0000,
+0x0470,0x0000,0x0000,0x0000, 0x0471,0x0000,0x0000,0x0000,
+0x0472,0x0000,0x0000,0x0000, 0x0473,0x0000,0x0000,0x0000,
+0x0474,0x0000,0x0000,0x0000, 0x0475,0x0000,0x0000,0x0000,
+0x0476,0x0000,0x0000,0x0000, 0x0477,0x0000,0x0000,0x0000,
+0x042D,0x0000,0x0000,0x0000, 0x0478,0x0000,0x0000,0x0000,
+0x0478,0x0000,0x0000,0x0000, 0x0479,0x0000,0x0000,0x0000,
+0x047A,0x0000,0x0000,0x0000, 0x047B,0x0000,0x0000,0x0000,
+0x047C,0x0000,0x0000,0x0000, 0x047D,0x0000,0x0000,0x0000,
+0x047E,0x0000,0x0000,0x0000, 0x047F,0x0000,0x0000,0x0000,
+0x0480,0x0000,0x0000,0x0000, 0x0481,0x0000,0x0000,0x0000,
+0x0482,0x0000,0x0000,0x0000, 0x0465,0x0000,0x0000,0x0000,
+0x042C,0x0000,0x0000,0x0000, 0x042E,0x0000,0x0000,0x0000,
+0x047A,0x0000,0x0000,0x0000, 0x047B,0x0000,0x0000,0x0000,
+0x0483,0x0000,0x0000,0x0000, 0x0484,0x0000,0x0000,0x0000,
+0x0483,0x0000,0x0000,0x0000, 0x0484,0x0000,0x0000,0x0000,
+0x0485,0x0000,0x0000,0x0000, 0x0486,0x0000,0x0000,0x0000,
+0x0485,0x0000,0x0000,0x0000, 0x0486,0x0000,0x0000,0x0000,
+0x0487,0x0000,0x0000,0x0000, 0x0488,0x0000,0x0000,0x0000,
+0x0489,0x0000,0x0000,0x0000, 0x048A,0x0000,0x0000,0x0000,
+0x048B,0x0000,0x0000,0x0000, 0x048C,0x0000,0x0000,0x0000,
+0x0487,0x0000,0x0000,0x0000, 0x0488,0x0000,0x0000,0x0000,
+0x048D,0x0000,0x0000,0x0000, 0x048E,0x0000,0x0000,0x0000,
+0x048D,0x0000,0x0000,0x0000, 0x048E,0x0000,0x0000,0x0000,
+0x048F,0x0000,0x0000,0x0000, 0x0490,0x0000,0x0000,0x0000,
+0x048F,0x0000,0x0000,0x0000, 0x0490,0x0000,0x0000,0x0000,
+0x0491,0x0000,0x0000,0x0000, 0x0492,0x0000,0x0000,0x0000,
+0x0493,0x0000,0x0000,0x0000, 0x0494,0x0000,0x0000,0x0000,
+0x0495,0x0000,0x0000,0x0000, 0x0496,0x0000,0x0000,0x0000,
+0x0497,0x0000,0x0000,0x0000, 0x0498,0x0000,0x0000,0x0000,
+0x0499,0x0000,0x0000,0x0000, 0x049A,0x0000,0x0000,0x0000,
+0x049B,0x0000,0x0000,0x0000, 0x049C,0x0000,0x0000,0x0000,
+0x049D,0x0000,0x0000,0x0000, 0x049E,0x0000,0x0000,0x0000,
+0x049F,0x0000,0x0000,0x0000, 0x04A0,0x0000,0x0000,0x0000,
+0x04A1,0x0000,0x0000,0x0000, 0x04A2,0x0000,0x0000,0x0000,
+0x04A3,0x0000,0x0000,0x0000, 0x04A4,0x0000,0x0000,0x0000,
+0x04A5,0x0000,0x0000,0x0000, 0x04A6,0x0000,0x0000,0x0000,
+0x04A7,0x0000,0x0000,0x0000, 0x04A8,0x0000,0x0000,0x0000,
+0x04A9,0x0000,0x0000,0x0000, 0x04AA,0x0000,0x0000,0x0000,
+0x04AB,0x0000,0x0000,0x0000, 0x04AC,0x0000,0x0000,0x0000,
+0x04AD,0x0000,0x0000,0x0000, 0x04AE,0x0000,0x0000,0x0000,
+0x04AF,0x0000,0x0000,0x0000, 0x04B0,0x0000,0x0000,0x0000,
+0x04B1,0x0000,0x0000,0x0000, 0x04B2,0x0000,0x0000,0x0000,
+0x04A9,0x0000,0x0000,0x0000, 0x04AF,0x0000,0x0000,0x0000,
+0x04B0,0x0000,0x0000,0x0000, 0x04B2,0x0000,0x0000,0x0000,
+0x04B3,0x0000,0x0000,0x0000, 0x04B4,0x0000,0x0000,0x0000,
+0x04B5,0x0000,0x0000,0x0000, 0x04B6,0x0000,0x0000,0x0000,
+0x04B7,0x0000,0x0000,0x0000, 0x04B8,0x0000,0x0000,0x0000,
+0x04B9,0x0000,0x0000,0x0000, 0x04BA,0x0000,0x0000,0x0000,
+0x04BB,0x0000,0x0000,0x0000, 0x04BC,0x0000,0x0000,0x0000,
+0x04BD,0x0000,0x0000,0x0000, 0x04BE,0x0000,0x0000,0x0000,
+0x04BF,0x0000,0x0000,0x0000, 0x04C0,0x0000,0x0000,0x0000,
+0x04C1,0x0000,0x0000,0x0000, 0x04C2,0x0000,0x0000,0x0000,
+0x04C3,0x0000,0x0000,0x0000, 0x04C4,0x0000,0x0000,0x0000,
+0x04C5,0x0000,0x0000,0x0000, 0x04C6,0x0000,0x0000,0x0000,
+0x04C7,0x0000,0x0000,0x0000, 0x04C8,0x0000,0x0000,0x0000,
+0x04C9,0x0000,0x0000,0x0000, 0x04CA,0x0000,0x0000,0x0000,
+0x04CB,0x0000,0x0000,0x0000, 0x04CC,0x0000,0x0000,0x0000,
+0x04CD,0x0000,0x0000,0x0000, 0x04CE,0x0000,0x0000,0x0000,
+0x04CF,0x0000,0x0000,0x0000, 0x04D0,0x0000,0x0000,0x0000,
+0x04D1,0x0000,0x0000,0x0000, 0x04D2,0x0000,0x0000,0x0000,
+0x04D3,0x0000,0x0000,0x0000, 0x04D4,0x0000,0x0000,0x0000,
+0x04D5,0x0000,0x0000,0x0000, 0x04D6,0x0000,0x0000,0x0000,
+0x04D7,0x0000,0x0000,0x0000, 0x04D8,0x0000,0x0000,0x0000,
+0x04D9,0x0000,0x0000,0x0000, 0x04DA,0x0000,0x0000,0x0000,
+0x04DB,0x0000,0x0000,0x0000, 0x04DC,0x0000,0x0000,0x0000,
+0x04DD,0x0000,0x0000,0x0000, 0x04DE,0x0000,0x0000,0x0000,
+0x04DF,0x0000,0x0000,0x0000, 0x04E0,0x0000,0x0000,0x0000,
+0x04E1,0x0000,0x0000,0x0000, 0x04E2,0x0000,0x0000,0x0000,
+0x0489,0x0000,0x0000,0x0000, 0x048A,0x0000,0x0000,0x0000,
+0x0498,0x0000,0x0000,0x0000, 0x0499,0x0000,0x0000,0x0000,
+0x04E3,0x0000,0x0000,0x0000, 0x04E4,0x0000,0x0000,0x0000,
+0x04E5,0x0000,0x0000,0x0000, 0x04E6,0x0000,0x0000,0x0000,
+0x04E7,0x0000,0x0000,0x0000, 0x04E8,0x0000,0x0000,0x0000,
+0x04B5,0x0000,0x0000,0x0000, 0x04B6,0x0000,0x0000,0x0000,
+0x04B7,0x0000,0x0000,0x0000, 0x04B8,0x0000,0x0000,0x0000,
+0x04E9,0x0000,0x0000,0x0000, 0x04EA,0x0000,0x0000,0x0000,
+0x04EB,0x0000,0x0000,0x0000, 0x04EC,0x0000,0x0000,0x0000,
+0x04ED,0x0000,0x0000,0x0000, 0x04EE,0x0000,0x0000,0x0000,
+0x04EF,0x0000,0x0000,0x0000, 0x04F0,0x0000,0x0000,0x0000,
+0x04F1,0x0000,0x0000,0x0000, 0x04F2,0x0000,0x0000,0x0000,
+0x04F3,0x0000,0x0000,0x0000, 0x04F4,0x0000,0x0000,0x0000,
+0x04F5,0x0000,0x0000,0x0000, 0x04F6,0x0000,0x0000,0x0000,
+0x04F7,0x0000,0x0000,0x0000, 0x04F8,0x0000,0x0000,0x0000,
+0x04F9,0x0000,0x0000,0x0000, 0x04FA,0x0000,0x0000,0x0000
+};
+
+uint16 page023data[]= { /* 2300 (3 weights per char) */
+0x04FB,0x0000,0x0000, 0x04FC,0x0000,0x0000, 0x04FD,0x0000,0x0000,
+0x04FE,0x0000,0x0000, 0x04FF,0x0000,0x0000, 0x0500,0x0000,0x0000,
+0x0501,0x0000,0x0000, 0x0502,0x0000,0x0000, 0x0503,0x0000,0x0000,
+0x0504,0x0000,0x0000, 0x0505,0x0000,0x0000, 0x0506,0x0000,0x0000,
+0x0507,0x0000,0x0000, 0x0508,0x0000,0x0000, 0x0509,0x0000,0x0000,
+0x050A,0x0000,0x0000, 0x050B,0x0000,0x0000, 0x050C,0x0000,0x0000,
+0x050D,0x0000,0x0000, 0x050E,0x0000,0x0000, 0x050F,0x0000,0x0000,
+0x0510,0x0000,0x0000, 0x0511,0x0000,0x0000, 0x0512,0x0000,0x0000,
+0x0513,0x0000,0x0000, 0x0514,0x0000,0x0000, 0x0515,0x0000,0x0000,
+0x0516,0x0000,0x0000, 0x0517,0x0000,0x0000, 0x0518,0x0000,0x0000,
+0x0519,0x0000,0x0000, 0x051A,0x0000,0x0000, 0x051B,0x0000,0x0000,
+0x051C,0x0000,0x0000, 0x051D,0x0000,0x0000, 0x051E,0x0000,0x0000,
+0x051F,0x0000,0x0000, 0x0520,0x0000,0x0000, 0x0521,0x0000,0x0000,
+0x0522,0x0000,0x0000, 0x0523,0x0000,0x0000, 0x02AE,0x0000,0x0000,
+0x02AF,0x0000,0x0000, 0x0524,0x0000,0x0000, 0x0525,0x0000,0x0000,
+0x0526,0x0000,0x0000, 0x0527,0x0000,0x0000, 0x0528,0x0000,0x0000,
+0x0529,0x0000,0x0000, 0x052A,0x0000,0x0000, 0x052B,0x0000,0x0000,
+0x052C,0x0000,0x0000, 0x052D,0x0000,0x0000, 0x052E,0x0000,0x0000,
+0x052F,0x0000,0x0000, 0x0530,0x0000,0x0000, 0x0531,0x0000,0x0000,
+0x0532,0x0000,0x0000, 0x0533,0x0000,0x0000, 0x0534,0x0000,0x0000,
+0x0535,0x0000,0x0000, 0x0536,0x0000,0x0000, 0x0537,0x0000,0x0000,
+0x0538,0x0000,0x0000, 0x0539,0x0000,0x0000, 0x053A,0x0000,0x0000,
+0x053B,0x0000,0x0000, 0x053C,0x0000,0x0000, 0x053D,0x0000,0x0000,
+0x053E,0x0000,0x0000, 0x053F,0x0000,0x0000, 0x0540,0x0000,0x0000,
+0x0541,0x0000,0x0000, 0x0542,0x0000,0x0000, 0x0543,0x0000,0x0000,
+0x0544,0x0000,0x0000, 0x0545,0x0000,0x0000, 0x0546,0x0000,0x0000,
+0x0547,0x0000,0x0000, 0x0548,0x0000,0x0000, 0x0549,0x0000,0x0000,
+0x054A,0x0000,0x0000, 0x054B,0x0000,0x0000, 0x054C,0x0000,0x0000,
+0x054D,0x0000,0x0000, 0x054E,0x0000,0x0000, 0x054F,0x0000,0x0000,
+0x0550,0x0000,0x0000, 0x0551,0x0000,0x0000, 0x0552,0x0000,0x0000,
+0x0553,0x0000,0x0000, 0x0554,0x0000,0x0000, 0x0555,0x0000,0x0000,
+0x0556,0x0000,0x0000, 0x0557,0x0000,0x0000, 0x0558,0x0000,0x0000,
+0x0559,0x0000,0x0000, 0x055A,0x0000,0x0000, 0x055B,0x0000,0x0000,
+0x055C,0x0000,0x0000, 0x055D,0x0000,0x0000, 0x055E,0x0000,0x0000,
+0x055F,0x0000,0x0000, 0x0560,0x0000,0x0000, 0x0561,0x0000,0x0000,
+0x0562,0x0000,0x0000, 0x0563,0x0000,0x0000, 0x0564,0x0000,0x0000,
+0x0565,0x0000,0x0000, 0x0566,0x0000,0x0000, 0x0567,0x0000,0x0000,
+0x0568,0x0000,0x0000, 0x0569,0x0000,0x0000, 0x056A,0x0000,0x0000,
+0x056B,0x0000,0x0000, 0x056C,0x0000,0x0000, 0x056D,0x0000,0x0000,
+0x056E,0x0000,0x0000, 0x056F,0x0000,0x0000, 0x0570,0x0000,0x0000,
+0x0571,0x0000,0x0000, 0x0572,0x0000,0x0000, 0x0573,0x0000,0x0000,
+0x0574,0x0000,0x0000, 0x0575,0x0000,0x0000, 0x0576,0x0000,0x0000,
+0x0577,0x0000,0x0000, 0x0578,0x0000,0x0000, 0x0579,0x0000,0x0000,
+0x057A,0x0000,0x0000, 0x057B,0x0000,0x0000, 0x057C,0x0000,0x0000,
+0x057D,0x0000,0x0000, 0x057E,0x0000,0x0000, 0x057F,0x0000,0x0000,
+0x0580,0x0000,0x0000, 0x0581,0x0000,0x0000, 0x0582,0x0000,0x0000,
+0x0583,0x0000,0x0000, 0x0584,0x0000,0x0000, 0x0585,0x0000,0x0000,
+0x0586,0x0000,0x0000, 0x0587,0x0000,0x0000, 0x0588,0x0000,0x0000,
+0x0589,0x0000,0x0000, 0x058A,0x0000,0x0000, 0x058B,0x0000,0x0000,
+0x058C,0x0000,0x0000, 0x058D,0x0000,0x0000, 0x058E,0x0000,0x0000,
+0x058F,0x0000,0x0000, 0x0590,0x0000,0x0000, 0x0591,0x0000,0x0000,
+0x0592,0x0000,0x0000, 0x0593,0x0000,0x0000, 0x0594,0x0000,0x0000,
+0x0595,0x0000,0x0000, 0x0596,0x0000,0x0000, 0x0597,0x0000,0x0000,
+0x0598,0x0000,0x0000, 0x0599,0x0000,0x0000, 0x059A,0x0000,0x0000,
+0x059B,0x0000,0x0000, 0x059C,0x0000,0x0000, 0x059D,0x0000,0x0000,
+0x059E,0x0000,0x0000, 0x059F,0x0000,0x0000, 0x05A0,0x0000,0x0000,
+0x05A1,0x0000,0x0000, 0x05A2,0x0000,0x0000, 0x05A3,0x0000,0x0000,
+0x05A4,0x0000,0x0000, 0x05A5,0x0000,0x0000, 0x05A6,0x0000,0x0000,
+0x05A7,0x0000,0x0000, 0x05A8,0x0000,0x0000, 0x05A9,0x0000,0x0000,
+0x05AA,0x0000,0x0000, 0x05AB,0x0000,0x0000, 0x05AC,0x0000,0x0000,
+0x05AD,0x0000,0x0000, 0x05AE,0x0000,0x0000, 0x05AF,0x0000,0x0000,
+0x05B0,0x0000,0x0000, 0x05B1,0x0000,0x0000, 0x05B2,0x0000,0x0000,
+0x05B3,0x0000,0x0000, 0x05B4,0x0000,0x0000, 0x05B5,0x0000,0x0000,
+0x05B6,0x0000,0x0000, 0x05B7,0x0000,0x0000, 0x05B8,0x0000,0x0000,
+0x05B9,0x0000,0x0000, 0x05BA,0x0000,0x0000, 0x05BB,0x0000,0x0000,
+0x05BC,0x0000,0x0000, 0x05BD,0x0000,0x0000, 0x05BE,0x0000,0x0000,
+0x05BF,0x0000,0x0000, 0x05C0,0x0000,0x0000, 0x05C1,0x0000,0x0000,
+0x05C2,0x0000,0x0000, 0x05C3,0x0000,0x0000, 0x05C4,0x0000,0x0000,
+0x05C5,0x0000,0x0000, 0x05C6,0x0000,0x0000, 0x05C7,0x0000,0x0000,
+0x05C8,0x0000,0x0000, 0x05C9,0x0000,0x0000, 0xFBC0,0xA3D1,0x0000,
+0xFBC0,0xA3D2,0x0000, 0xFBC0,0xA3D3,0x0000, 0xFBC0,0xA3D4,0x0000,
+0xFBC0,0xA3D5,0x0000, 0xFBC0,0xA3D6,0x0000, 0xFBC0,0xA3D7,0x0000,
+0xFBC0,0xA3D8,0x0000, 0xFBC0,0xA3D9,0x0000, 0xFBC0,0xA3DA,0x0000,
+0xFBC0,0xA3DB,0x0000, 0xFBC0,0xA3DC,0x0000, 0xFBC0,0xA3DD,0x0000,
+0xFBC0,0xA3DE,0x0000, 0xFBC0,0xA3DF,0x0000, 0xFBC0,0xA3E0,0x0000,
+0xFBC0,0xA3E1,0x0000, 0xFBC0,0xA3E2,0x0000, 0xFBC0,0xA3E3,0x0000,
+0xFBC0,0xA3E4,0x0000, 0xFBC0,0xA3E5,0x0000, 0xFBC0,0xA3E6,0x0000,
+0xFBC0,0xA3E7,0x0000, 0xFBC0,0xA3E8,0x0000, 0xFBC0,0xA3E9,0x0000,
+0xFBC0,0xA3EA,0x0000, 0xFBC0,0xA3EB,0x0000, 0xFBC0,0xA3EC,0x0000,
+0xFBC0,0xA3ED,0x0000, 0xFBC0,0xA3EE,0x0000, 0xFBC0,0xA3EF,0x0000,
+0xFBC0,0xA3F0,0x0000, 0xFBC0,0xA3F1,0x0000, 0xFBC0,0xA3F2,0x0000,
+0xFBC0,0xA3F3,0x0000, 0xFBC0,0xA3F4,0x0000, 0xFBC0,0xA3F5,0x0000,
+0xFBC0,0xA3F6,0x0000, 0xFBC0,0xA3F7,0x0000, 0xFBC0,0xA3F8,0x0000,
+0xFBC0,0xA3F9,0x0000, 0xFBC0,0xA3FA,0x0000, 0xFBC0,0xA3FB,0x0000,
+0xFBC0,0xA3FC,0x0000, 0xFBC0,0xA3FD,0x0000, 0xFBC0,0xA3FE,0x0000,
+0xFBC0,0xA3FF,0x0000 };
+
+uint16 page024data[]= { /* 2400 (5 weights per char) */
+0x05CA,0x0000,0x0000,0x0000,0x0000,
+0x05CB,0x0000,0x0000,0x0000,0x0000,
+0x05CC,0x0000,0x0000,0x0000,0x0000,
+0x05CD,0x0000,0x0000,0x0000,0x0000,
+0x05CE,0x0000,0x0000,0x0000,0x0000,
+0x05CF,0x0000,0x0000,0x0000,0x0000,
+0x05D0,0x0000,0x0000,0x0000,0x0000,
+0x05D1,0x0000,0x0000,0x0000,0x0000,
+0x05D2,0x0000,0x0000,0x0000,0x0000,
+0x05D3,0x0000,0x0000,0x0000,0x0000,
+0x05D4,0x0000,0x0000,0x0000,0x0000,
+0x05D5,0x0000,0x0000,0x0000,0x0000,
+0x05D6,0x0000,0x0000,0x0000,0x0000,
+0x05D7,0x0000,0x0000,0x0000,0x0000,
+0x05D8,0x0000,0x0000,0x0000,0x0000,
+0x05D9,0x0000,0x0000,0x0000,0x0000,
+0x05DA,0x0000,0x0000,0x0000,0x0000,
+0x05DB,0x0000,0x0000,0x0000,0x0000,
+0x05DC,0x0000,0x0000,0x0000,0x0000,
+0x05DD,0x0000,0x0000,0x0000,0x0000,
+0x05DE,0x0000,0x0000,0x0000,0x0000,
+0x05DF,0x0000,0x0000,0x0000,0x0000,
+0x05E0,0x0000,0x0000,0x0000,0x0000,
+0x05E1,0x0000,0x0000,0x0000,0x0000,
+0x05E2,0x0000,0x0000,0x0000,0x0000,
+0x05E3,0x0000,0x0000,0x0000,0x0000,
+0x05E4,0x0000,0x0000,0x0000,0x0000,
+0x05E5,0x0000,0x0000,0x0000,0x0000,
+0x05E6,0x0000,0x0000,0x0000,0x0000,
+0x05E7,0x0000,0x0000,0x0000,0x0000,
+0x05E8,0x0000,0x0000,0x0000,0x0000,
+0x05E9,0x0000,0x0000,0x0000,0x0000,
+0x05EA,0x0000,0x0000,0x0000,0x0000,
+0x05EB,0x0000,0x0000,0x0000,0x0000,
+0x05EC,0x0000,0x0000,0x0000,0x0000,
+0x05ED,0x0000,0x0000,0x0000,0x0000,
+0x05EE,0x0000,0x0000,0x0000,0x0000,
+0x05EF,0x0000,0x0000,0x0000,0x0000,
+0x05F0,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xA427,0x0000,0x0000,0x0000,
+0xFBC0,0xA428,0x0000,0x0000,0x0000,
+0xFBC0,0xA429,0x0000,0x0000,0x0000,
+0xFBC0,0xA42A,0x0000,0x0000,0x0000,
+0xFBC0,0xA42B,0x0000,0x0000,0x0000,
+0xFBC0,0xA42C,0x0000,0x0000,0x0000,
+0xFBC0,0xA42D,0x0000,0x0000,0x0000,
+0xFBC0,0xA42E,0x0000,0x0000,0x0000,
+0xFBC0,0xA42F,0x0000,0x0000,0x0000,
+0xFBC0,0xA430,0x0000,0x0000,0x0000,
+0xFBC0,0xA431,0x0000,0x0000,0x0000,
+0xFBC0,0xA432,0x0000,0x0000,0x0000,
+0xFBC0,0xA433,0x0000,0x0000,0x0000,
+0xFBC0,0xA434,0x0000,0x0000,0x0000,
+0xFBC0,0xA435,0x0000,0x0000,0x0000,
+0xFBC0,0xA436,0x0000,0x0000,0x0000,
+0xFBC0,0xA437,0x0000,0x0000,0x0000,
+0xFBC0,0xA438,0x0000,0x0000,0x0000,
+0xFBC0,0xA439,0x0000,0x0000,0x0000,
+0xFBC0,0xA43A,0x0000,0x0000,0x0000,
+0xFBC0,0xA43B,0x0000,0x0000,0x0000,
+0xFBC0,0xA43C,0x0000,0x0000,0x0000,
+0xFBC0,0xA43D,0x0000,0x0000,0x0000,
+0xFBC0,0xA43E,0x0000,0x0000,0x0000,
+0xFBC0,0xA43F,0x0000,0x0000,0x0000,
+0x05F1,0x0000,0x0000,0x0000,0x0000,
+0x05F2,0x0000,0x0000,0x0000,0x0000,
+0x05F3,0x0000,0x0000,0x0000,0x0000,
+0x05F4,0x0000,0x0000,0x0000,0x0000,
+0x05F5,0x0000,0x0000,0x0000,0x0000,
+0x05F6,0x0000,0x0000,0x0000,0x0000,
+0x05F7,0x0000,0x0000,0x0000,0x0000,
+0x05F8,0x0000,0x0000,0x0000,0x0000,
+0x05F9,0x0000,0x0000,0x0000,0x0000,
+0x05FA,0x0000,0x0000,0x0000,0x0000,
+0x05FB,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xA44B,0x0000,0x0000,0x0000,
+0xFBC0,0xA44C,0x0000,0x0000,0x0000,
+0xFBC0,0xA44D,0x0000,0x0000,0x0000,
+0xFBC0,0xA44E,0x0000,0x0000,0x0000,
+0xFBC0,0xA44F,0x0000,0x0000,0x0000,
+0xFBC0,0xA450,0x0000,0x0000,0x0000,
+0xFBC0,0xA451,0x0000,0x0000,0x0000,
+0xFBC0,0xA452,0x0000,0x0000,0x0000,
+0xFBC0,0xA453,0x0000,0x0000,0x0000,
+0xFBC0,0xA454,0x0000,0x0000,0x0000,
+0xFBC0,0xA455,0x0000,0x0000,0x0000,
+0xFBC0,0xA456,0x0000,0x0000,0x0000,
+0xFBC0,0xA457,0x0000,0x0000,0x0000,
+0xFBC0,0xA458,0x0000,0x0000,0x0000,
+0xFBC0,0xA459,0x0000,0x0000,0x0000,
+0xFBC0,0xA45A,0x0000,0x0000,0x0000,
+0xFBC0,0xA45B,0x0000,0x0000,0x0000,
+0xFBC0,0xA45C,0x0000,0x0000,0x0000,
+0xFBC0,0xA45D,0x0000,0x0000,0x0000,
+0xFBC0,0xA45E,0x0000,0x0000,0x0000,
+0xFBC0,0xA45F,0x0000,0x0000,0x0000,
+0x0E2A,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0000,0x0000,0x0000,0x0000,
+0x0E2E,0x0000,0x0000,0x0000,0x0000,
+0x0E2F,0x0000,0x0000,0x0000,0x0000,
+0x0E30,0x0000,0x0000,0x0000,0x0000,
+0x0E31,0x0000,0x0000,0x0000,0x0000,
+0x0E32,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E29,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2A,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2B,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2C,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2D,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2E,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2F,0x0000,0x0000,0x0000,
+0x0E2A,0x0E30,0x0000,0x0000,0x0000,
+0x0E2A,0x0E31,0x0000,0x0000,0x0000,
+0x0E2A,0x0E32,0x0000,0x0000,0x0000,
+0x0E2B,0x0E29,0x0000,0x0000,0x0000,
+0x0288,0x0E2A,0x0289,0x0000,0x0000,
+0x0288,0x0E2B,0x0289,0x0000,0x0000,
+0x0288,0x0E2C,0x0289,0x0000,0x0000,
+0x0288,0x0E2D,0x0289,0x0000,0x0000,
+0x0288,0x0E2E,0x0289,0x0000,0x0000,
+0x0288,0x0E2F,0x0289,0x0000,0x0000,
+0x0288,0x0E30,0x0289,0x0000,0x0000,
+0x0288,0x0E31,0x0289,0x0000,0x0000,
+0x0288,0x0E32,0x0289,0x0000,0x0000,
+0x0288,0x0E2A,0x0E29,0x0289,0x0000,
+0x0288,0x0E2A,0x0E2A,0x0289,0x0000,
+0x0288,0x0E2A,0x0E2B,0x0289,0x0000,
+0x0288,0x0E2A,0x0E2C,0x0289,0x0000,
+0x0288,0x0E2A,0x0E2D,0x0289,0x0000,
+0x0288,0x0E2A,0x0E2E,0x0289,0x0000,
+0x0288,0x0E2A,0x0E2F,0x0289,0x0000,
+0x0288,0x0E2A,0x0E30,0x0289,0x0000,
+0x0288,0x0E2A,0x0E31,0x0289,0x0000,
+0x0288,0x0E2A,0x0E32,0x0289,0x0000,
+0x0288,0x0E2B,0x0E29,0x0289,0x0000,
+0x0E2A,0x025D,0x0000,0x0000,0x0000,
+0x0E2B,0x025D,0x0000,0x0000,0x0000,
+0x0E2C,0x025D,0x0000,0x0000,0x0000,
+0x0E2D,0x025D,0x0000,0x0000,0x0000,
+0x0E2E,0x025D,0x0000,0x0000,0x0000,
+0x0E2F,0x025D,0x0000,0x0000,0x0000,
+0x0E30,0x025D,0x0000,0x0000,0x0000,
+0x0E31,0x025D,0x0000,0x0000,0x0000,
+0x0E32,0x025D,0x0000,0x0000,0x0000,
+0x0E2A,0x0E29,0x025D,0x0000,0x0000,
+0x0E2A,0x0E2A,0x025D,0x0000,0x0000,
+0x0E2A,0x0E2B,0x025D,0x0000,0x0000,
+0x0E2A,0x0E2C,0x025D,0x0000,0x0000,
+0x0E2A,0x0E2D,0x025D,0x0000,0x0000,
+0x0E2A,0x0E2E,0x025D,0x0000,0x0000,
+0x0E2A,0x0E2F,0x025D,0x0000,0x0000,
+0x0E2A,0x0E30,0x025D,0x0000,0x0000,
+0x0E2A,0x0E31,0x025D,0x0000,0x0000,
+0x0E2A,0x0E32,0x025D,0x0000,0x0000,
+0x0E2B,0x0E29,0x025D,0x0000,0x0000,
+0x0288,0x0E33,0x0289,0x0000,0x0000,
+0x0288,0x0E4A,0x0289,0x0000,0x0000,
+0x0288,0x0E60,0x0289,0x0000,0x0000,
+0x0288,0x0E6D,0x0289,0x0000,0x0000,
+0x0288,0x0E8B,0x0289,0x0000,0x0000,
+0x0288,0x0EB9,0x0289,0x0000,0x0000,
+0x0288,0x0EC1,0x0289,0x0000,0x0000,
+0x0288,0x0EE1,0x0289,0x0000,0x0000,
+0x0288,0x0EFB,0x0289,0x0000,0x0000,
+0x0288,0x0F10,0x0289,0x0000,0x0000,
+0x0288,0x0F21,0x0289,0x0000,0x0000,
+0x0288,0x0F2E,0x0289,0x0000,0x0000,
+0x0288,0x0F5B,0x0289,0x0000,0x0000,
+0x0288,0x0F64,0x0289,0x0000,0x0000,
+0x0288,0x0F82,0x0289,0x0000,0x0000,
+0x0288,0x0FA7,0x0289,0x0000,0x0000,
+0x0288,0x0FB4,0x0289,0x0000,0x0000,
+0x0288,0x0FC0,0x0289,0x0000,0x0000,
+0x0288,0x0FEA,0x0289,0x0000,0x0000,
+0x0288,0x1002,0x0289,0x0000,0x0000,
+0x0288,0x101F,0x0289,0x0000,0x0000,
+0x0288,0x1044,0x0289,0x0000,0x0000,
+0x0288,0x1051,0x0289,0x0000,0x0000,
+0x0288,0x105A,0x0289,0x0000,0x0000,
+0x0288,0x105E,0x0289,0x0000,0x0000,
+0x0288,0x106A,0x0289,0x0000,0x0000,
+0x0E33,0x0000,0x0000,0x0000,0x0000,
+0x0E4A,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0000,0x0000,0x0000,0x0000,
+0x0E8B,0x0000,0x0000,0x0000,0x0000,
+0x0EB9,0x0000,0x0000,0x0000,0x0000,
+0x0EC1,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000,0x0000,
+0x0F10,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0000,0x0000,0x0000,0x0000,
+0x0F2E,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x0000,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x0000,0x0000,0x0000,0x0000,
+0x0FB4,0x0000,0x0000,0x0000,0x0000,
+0x0FC0,0x0000,0x0000,0x0000,0x0000,
+0x0FEA,0x0000,0x0000,0x0000,0x0000,
+0x1002,0x0000,0x0000,0x0000,0x0000,
+0x101F,0x0000,0x0000,0x0000,0x0000,
+0x1044,0x0000,0x0000,0x0000,0x0000,
+0x1051,0x0000,0x0000,0x0000,0x0000,
+0x105A,0x0000,0x0000,0x0000,0x0000,
+0x105E,0x0000,0x0000,0x0000,0x0000,
+0x106A,0x0000,0x0000,0x0000,0x0000,
+0x0E33,0x0000,0x0000,0x0000,0x0000,
+0x0E4A,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0000,0x0000,0x0000,0x0000,
+0x0E8B,0x0000,0x0000,0x0000,0x0000,
+0x0EB9,0x0000,0x0000,0x0000,0x0000,
+0x0EC1,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0000,0x0000,0x0000,0x0000,
+0x0F10,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0000,0x0000,0x0000,0x0000,
+0x0F2E,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x0000,0x0000,0x0000,0x0000,
+0x0F82,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x0000,0x0000,0x0000,0x0000,
+0x0FB4,0x0000,0x0000,0x0000,0x0000,
+0x0FC0,0x0000,0x0000,0x0000,0x0000,
+0x0FEA,0x0000,0x0000,0x0000,0x0000,
+0x1002,0x0000,0x0000,0x0000,0x0000,
+0x101F,0x0000,0x0000,0x0000,0x0000,
+0x1044,0x0000,0x0000,0x0000,0x0000,
+0x1051,0x0000,0x0000,0x0000,0x0000,
+0x105A,0x0000,0x0000,0x0000,0x0000,
+0x105E,0x0000,0x0000,0x0000,0x0000,
+0x106A,0x0000,0x0000,0x0000,0x0000,
+0x0E29,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2A,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2B,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2C,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2D,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2E,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2F,0x0000,0x0000,0x0000,
+0x0E2A,0x0E30,0x0000,0x0000,0x0000,
+0x0E2A,0x0E31,0x0000,0x0000,0x0000,
+0x0E2A,0x0E32,0x0000,0x0000,0x0000,
+0x0E2B,0x0E29,0x0000,0x0000,0x0000,
+0x0E2A,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0000,0x0000,0x0000,0x0000,
+0x0E2E,0x0000,0x0000,0x0000,0x0000,
+0x0E2F,0x0000,0x0000,0x0000,0x0000,
+0x0E30,0x0000,0x0000,0x0000,0x0000,
+0x0E31,0x0000,0x0000,0x0000,0x0000,
+0x0E32,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E29,0x0000,0x0000,0x0000,
+0x0E29,0x0000,0x0000,0x0000,0x0000
+};
+
+uint16 page025data[]= { /* 2500 (2 weights per char) */
+0x05FC,0x0000, 0x05FD,0x0000, 0x05FE,0x0000, 0x05FF,0x0000,
+0x0600,0x0000, 0x0601,0x0000, 0x0602,0x0000, 0x0603,0x0000,
+0x0604,0x0000, 0x0605,0x0000, 0x0606,0x0000, 0x0607,0x0000,
+0x0608,0x0000, 0x0609,0x0000, 0x060A,0x0000, 0x060B,0x0000,
+0x060C,0x0000, 0x060D,0x0000, 0x060E,0x0000, 0x060F,0x0000,
+0x0610,0x0000, 0x0611,0x0000, 0x0612,0x0000, 0x0613,0x0000,
+0x0614,0x0000, 0x0615,0x0000, 0x0616,0x0000, 0x0617,0x0000,
+0x0618,0x0000, 0x0619,0x0000, 0x061A,0x0000, 0x061B,0x0000,
+0x061C,0x0000, 0x061D,0x0000, 0x061E,0x0000, 0x061F,0x0000,
+0x0620,0x0000, 0x0621,0x0000, 0x0622,0x0000, 0x0623,0x0000,
+0x0624,0x0000, 0x0625,0x0000, 0x0626,0x0000, 0x0627,0x0000,
+0x0628,0x0000, 0x0629,0x0000, 0x062A,0x0000, 0x062B,0x0000,
+0x062C,0x0000, 0x062D,0x0000, 0x062E,0x0000, 0x062F,0x0000,
+0x0630,0x0000, 0x0631,0x0000, 0x0632,0x0000, 0x0633,0x0000,
+0x0634,0x0000, 0x0635,0x0000, 0x0636,0x0000, 0x0637,0x0000,
+0x0638,0x0000, 0x0639,0x0000, 0x063A,0x0000, 0x063B,0x0000,
+0x063C,0x0000, 0x063D,0x0000, 0x063E,0x0000, 0x063F,0x0000,
+0x0640,0x0000, 0x0641,0x0000, 0x0642,0x0000, 0x0643,0x0000,
+0x0644,0x0000, 0x0645,0x0000, 0x0646,0x0000, 0x0647,0x0000,
+0x0648,0x0000, 0x0649,0x0000, 0x064A,0x0000, 0x064B,0x0000,
+0x064C,0x0000, 0x064D,0x0000, 0x064E,0x0000, 0x064F,0x0000,
+0x0650,0x0000, 0x0651,0x0000, 0x0652,0x0000, 0x0653,0x0000,
+0x0654,0x0000, 0x0655,0x0000, 0x0656,0x0000, 0x0657,0x0000,
+0x0658,0x0000, 0x0659,0x0000, 0x065A,0x0000, 0x065B,0x0000,
+0x065C,0x0000, 0x065D,0x0000, 0x065E,0x0000, 0x065F,0x0000,
+0x0660,0x0000, 0x0661,0x0000, 0x0662,0x0000, 0x0663,0x0000,
+0x0664,0x0000, 0x0665,0x0000, 0x0666,0x0000, 0x0667,0x0000,
+0x0668,0x0000, 0x0669,0x0000, 0x066A,0x0000, 0x066B,0x0000,
+0x066C,0x0000, 0x066D,0x0000, 0x066E,0x0000, 0x066F,0x0000,
+0x0670,0x0000, 0x0671,0x0000, 0x0672,0x0000, 0x0673,0x0000,
+0x0674,0x0000, 0x0675,0x0000, 0x0676,0x0000, 0x0677,0x0000,
+0x0678,0x0000, 0x0679,0x0000, 0x067A,0x0000, 0x067B,0x0000,
+0x067C,0x0000, 0x067D,0x0000, 0x067E,0x0000, 0x067F,0x0000,
+0x0680,0x0000, 0x0681,0x0000, 0x0682,0x0000, 0x0683,0x0000,
+0x0684,0x0000, 0x0685,0x0000, 0x0686,0x0000, 0x0687,0x0000,
+0x0688,0x0000, 0x0689,0x0000, 0x068A,0x0000, 0x068B,0x0000,
+0x068C,0x0000, 0x068D,0x0000, 0x068E,0x0000, 0x068F,0x0000,
+0x0690,0x0000, 0x0691,0x0000, 0x0692,0x0000, 0x0693,0x0000,
+0x0694,0x0000, 0x0695,0x0000, 0x0696,0x0000, 0x0697,0x0000,
+0x0698,0x0000, 0x0699,0x0000, 0x069A,0x0000, 0x069B,0x0000,
+0x069C,0x0000, 0x069D,0x0000, 0x069E,0x0000, 0x069F,0x0000,
+0x06A0,0x0000, 0x06A1,0x0000, 0x06A2,0x0000, 0x06A3,0x0000,
+0x06A4,0x0000, 0x06A5,0x0000, 0x06A6,0x0000, 0x06A7,0x0000,
+0x06A8,0x0000, 0x06A9,0x0000, 0x06AA,0x0000, 0x06AB,0x0000,
+0x06AC,0x0000, 0x06AD,0x0000, 0x06AE,0x0000, 0x06AF,0x0000,
+0x06B0,0x0000, 0x06B1,0x0000, 0x06B2,0x0000, 0x06B3,0x0000,
+0x06B4,0x0000, 0x06B5,0x0000, 0x06B6,0x0000, 0x06B7,0x0000,
+0x06B8,0x0000, 0x06B9,0x0000, 0x06BA,0x0000, 0x06BB,0x0000,
+0x06BC,0x0000, 0x06BD,0x0000, 0x06BE,0x0000, 0x06BF,0x0000,
+0x06C0,0x0000, 0x06C1,0x0000, 0x06C2,0x0000, 0x06C3,0x0000,
+0x06C4,0x0000, 0x06C5,0x0000, 0x06C6,0x0000, 0x06C7,0x0000,
+0x06C8,0x0000, 0x06C9,0x0000, 0x06CA,0x0000, 0x06CB,0x0000,
+0x06CC,0x0000, 0x06CD,0x0000, 0x06CE,0x0000, 0x06CF,0x0000,
+0x06D0,0x0000, 0x06D1,0x0000, 0x06D2,0x0000, 0x06D3,0x0000,
+0x06D4,0x0000, 0x06D5,0x0000, 0x06D6,0x0000, 0x06D7,0x0000,
+0x06D8,0x0000, 0x06D9,0x0000, 0x06DA,0x0000, 0x06DB,0x0000,
+0x06DC,0x0000, 0x06DD,0x0000, 0x06DE,0x0000, 0x06DF,0x0000,
+0x06E0,0x0000, 0x06E1,0x0000, 0x06E2,0x0000, 0x06E3,0x0000,
+0x06E4,0x0000, 0x06E5,0x0000, 0x06E6,0x0000, 0x06E7,0x0000,
+0x06E8,0x0000, 0x06E9,0x0000, 0x06EA,0x0000, 0x06EB,0x0000,
+0x06EC,0x0000, 0x06ED,0x0000, 0x06EE,0x0000, 0x06EF,0x0000,
+0x06F0,0x0000, 0x06F1,0x0000, 0x06F2,0x0000, 0x06F3,0x0000,
+0x06F4,0x0000, 0x06F5,0x0000, 0x06F6,0x0000, 0x06F7,0x0000,
+0x06F8,0x0000, 0x06F9,0x0000, 0x06FA,0x0000, 0x06FB,0x0000
+};
+
+uint16 page026data[]= { /* 2600 (3 weights per char) */
+0x06FC,0x0000,0x0000, 0x06FD,0x0000,0x0000, 0x06FE,0x0000,0x0000,
+0x06FF,0x0000,0x0000, 0x0700,0x0000,0x0000, 0x0701,0x0000,0x0000,
+0x0702,0x0000,0x0000, 0x0703,0x0000,0x0000, 0x0704,0x0000,0x0000,
+0x0705,0x0000,0x0000, 0x0706,0x0000,0x0000, 0x0707,0x0000,0x0000,
+0x0708,0x0000,0x0000, 0x0709,0x0000,0x0000, 0x070A,0x0000,0x0000,
+0x070B,0x0000,0x0000, 0x070C,0x0000,0x0000, 0x070D,0x0000,0x0000,
+0x070E,0x0000,0x0000, 0x070F,0x0000,0x0000, 0x0710,0x0000,0x0000,
+0x0711,0x0000,0x0000, 0x0712,0x0000,0x0000, 0x0713,0x0000,0x0000,
+0xFBC0,0xA618,0x0000, 0x0714,0x0000,0x0000, 0x0715,0x0000,0x0000,
+0x0716,0x0000,0x0000, 0x0717,0x0000,0x0000, 0x0718,0x0000,0x0000,
+0x0719,0x0000,0x0000, 0x071A,0x0000,0x0000, 0x071B,0x0000,0x0000,
+0x071C,0x0000,0x0000, 0x071D,0x0000,0x0000, 0x071E,0x0000,0x0000,
+0x071F,0x0000,0x0000, 0x0720,0x0000,0x0000, 0x0721,0x0000,0x0000,
+0x0722,0x0000,0x0000, 0x0723,0x0000,0x0000, 0x0724,0x0000,0x0000,
+0x0725,0x0000,0x0000, 0x0726,0x0000,0x0000, 0x0727,0x0000,0x0000,
+0x0728,0x0000,0x0000, 0x0729,0x0000,0x0000, 0x072A,0x0000,0x0000,
+0x0B2F,0x0000,0x0000, 0x0B30,0x0000,0x0000, 0x0B31,0x0000,0x0000,
+0x0B32,0x0000,0x0000, 0x0B33,0x0000,0x0000, 0x0B34,0x0000,0x0000,
+0x0B35,0x0000,0x0000, 0x0B36,0x0000,0x0000, 0x072B,0x0000,0x0000,
+0x072C,0x0000,0x0000, 0x072D,0x0000,0x0000, 0x072E,0x0000,0x0000,
+0x072F,0x0000,0x0000, 0x0730,0x0000,0x0000, 0x0731,0x0000,0x0000,
+0x0732,0x0000,0x0000, 0x0733,0x0000,0x0000, 0x0734,0x0000,0x0000,
+0x0735,0x0000,0x0000, 0x0736,0x0000,0x0000, 0x0737,0x0000,0x0000,
+0x0738,0x0000,0x0000, 0x0739,0x0000,0x0000, 0x073A,0x0000,0x0000,
+0x073B,0x0000,0x0000, 0x073C,0x0000,0x0000, 0x073D,0x0000,0x0000,
+0x073E,0x0000,0x0000, 0x073F,0x0000,0x0000, 0x0740,0x0000,0x0000,
+0x0741,0x0000,0x0000, 0x0742,0x0000,0x0000, 0x0743,0x0000,0x0000,
+0x0744,0x0000,0x0000, 0x0745,0x0000,0x0000, 0x0746,0x0000,0x0000,
+0x0747,0x0000,0x0000, 0x0748,0x0000,0x0000, 0x0749,0x0000,0x0000,
+0x074A,0x0000,0x0000, 0x074B,0x0000,0x0000, 0x074C,0x0000,0x0000,
+0x074D,0x0000,0x0000, 0x074E,0x0000,0x0000, 0x074F,0x0000,0x0000,
+0x0750,0x0000,0x0000, 0x0751,0x0000,0x0000, 0x0752,0x0000,0x0000,
+0x0753,0x0000,0x0000, 0x0754,0x0000,0x0000, 0x0755,0x0000,0x0000,
+0x0756,0x0000,0x0000, 0x0757,0x0000,0x0000, 0x0758,0x0000,0x0000,
+0x0759,0x0000,0x0000, 0x075A,0x0000,0x0000, 0x075B,0x0000,0x0000,
+0x075C,0x0000,0x0000, 0x075D,0x0000,0x0000, 0x075E,0x0000,0x0000,
+0x075F,0x0000,0x0000, 0x0D2B,0x0000,0x0000, 0x0D2C,0x0000,0x0000,
+0x0D2D,0x0000,0x0000, 0x0760,0x0000,0x0000, 0x0761,0x0000,0x0000,
+0x0762,0x0000,0x0000, 0x0763,0x0000,0x0000, 0x0764,0x0000,0x0000,
+0x0765,0x0000,0x0000, 0x0766,0x0000,0x0000, 0x0767,0x0000,0x0000,
+0x0768,0x0000,0x0000, 0x0769,0x0000,0x0000, 0x076A,0x0000,0x0000,
+0x076B,0x0000,0x0000, 0x076C,0x0000,0x0000, 0x076D,0x0000,0x0000,
+0xFBC0,0xA67E,0x0000, 0xFBC0,0xA67F,0x0000, 0x076E,0x0000,0x0000,
+0x076F,0x0000,0x0000, 0x0770,0x0000,0x0000, 0x0771,0x0000,0x0000,
+0x0772,0x0000,0x0000, 0x0773,0x0000,0x0000, 0x0774,0x0000,0x0000,
+0x0775,0x0000,0x0000, 0x0776,0x0000,0x0000, 0x0777,0x0000,0x0000,
+0x0B29,0x0000,0x0000, 0x0B2A,0x0000,0x0000, 0x0B2B,0x0000,0x0000,
+0x0B2C,0x0000,0x0000, 0x0B2D,0x0000,0x0000, 0x0B2E,0x0000,0x0000,
+0x0778,0x0000,0x0000, 0x0779,0x0000,0x0000, 0xFBC0,0xA692,0x0000,
+0xFBC0,0xA693,0x0000, 0xFBC0,0xA694,0x0000, 0xFBC0,0xA695,0x0000,
+0xFBC0,0xA696,0x0000, 0xFBC0,0xA697,0x0000, 0xFBC0,0xA698,0x0000,
+0xFBC0,0xA699,0x0000, 0xFBC0,0xA69A,0x0000, 0xFBC0,0xA69B,0x0000,
+0xFBC0,0xA69C,0x0000, 0xFBC0,0xA69D,0x0000, 0xFBC0,0xA69E,0x0000,
+0xFBC0,0xA69F,0x0000, 0x077A,0x0000,0x0000, 0x077B,0x0000,0x0000,
+0xFBC0,0xA6A2,0x0000, 0xFBC0,0xA6A3,0x0000, 0xFBC0,0xA6A4,0x0000,
+0xFBC0,0xA6A5,0x0000, 0xFBC0,0xA6A6,0x0000, 0xFBC0,0xA6A7,0x0000,
+0xFBC0,0xA6A8,0x0000, 0xFBC0,0xA6A9,0x0000, 0xFBC0,0xA6AA,0x0000,
+0xFBC0,0xA6AB,0x0000, 0xFBC0,0xA6AC,0x0000, 0xFBC0,0xA6AD,0x0000,
+0xFBC0,0xA6AE,0x0000, 0xFBC0,0xA6AF,0x0000, 0xFBC0,0xA6B0,0x0000,
+0xFBC0,0xA6B1,0x0000, 0xFBC0,0xA6B2,0x0000, 0xFBC0,0xA6B3,0x0000,
+0xFBC0,0xA6B4,0x0000, 0xFBC0,0xA6B5,0x0000, 0xFBC0,0xA6B6,0x0000,
+0xFBC0,0xA6B7,0x0000, 0xFBC0,0xA6B8,0x0000, 0xFBC0,0xA6B9,0x0000,
+0xFBC0,0xA6BA,0x0000, 0xFBC0,0xA6BB,0x0000, 0xFBC0,0xA6BC,0x0000,
+0xFBC0,0xA6BD,0x0000, 0xFBC0,0xA6BE,0x0000, 0xFBC0,0xA6BF,0x0000,
+0xFBC0,0xA6C0,0x0000, 0xFBC0,0xA6C1,0x0000, 0xFBC0,0xA6C2,0x0000,
+0xFBC0,0xA6C3,0x0000, 0xFBC0,0xA6C4,0x0000, 0xFBC0,0xA6C5,0x0000,
+0xFBC0,0xA6C6,0x0000, 0xFBC0,0xA6C7,0x0000, 0xFBC0,0xA6C8,0x0000,
+0xFBC0,0xA6C9,0x0000, 0xFBC0,0xA6CA,0x0000, 0xFBC0,0xA6CB,0x0000,
+0xFBC0,0xA6CC,0x0000, 0xFBC0,0xA6CD,0x0000, 0xFBC0,0xA6CE,0x0000,
+0xFBC0,0xA6CF,0x0000, 0xFBC0,0xA6D0,0x0000, 0xFBC0,0xA6D1,0x0000,
+0xFBC0,0xA6D2,0x0000, 0xFBC0,0xA6D3,0x0000, 0xFBC0,0xA6D4,0x0000,
+0xFBC0,0xA6D5,0x0000, 0xFBC0,0xA6D6,0x0000, 0xFBC0,0xA6D7,0x0000,
+0xFBC0,0xA6D8,0x0000, 0xFBC0,0xA6D9,0x0000, 0xFBC0,0xA6DA,0x0000,
+0xFBC0,0xA6DB,0x0000, 0xFBC0,0xA6DC,0x0000, 0xFBC0,0xA6DD,0x0000,
+0xFBC0,0xA6DE,0x0000, 0xFBC0,0xA6DF,0x0000, 0xFBC0,0xA6E0,0x0000,
+0xFBC0,0xA6E1,0x0000, 0xFBC0,0xA6E2,0x0000, 0xFBC0,0xA6E3,0x0000,
+0xFBC0,0xA6E4,0x0000, 0xFBC0,0xA6E5,0x0000, 0xFBC0,0xA6E6,0x0000,
+0xFBC0,0xA6E7,0x0000, 0xFBC0,0xA6E8,0x0000, 0xFBC0,0xA6E9,0x0000,
+0xFBC0,0xA6EA,0x0000, 0xFBC0,0xA6EB,0x0000, 0xFBC0,0xA6EC,0x0000,
+0xFBC0,0xA6ED,0x0000, 0xFBC0,0xA6EE,0x0000, 0xFBC0,0xA6EF,0x0000,
+0xFBC0,0xA6F0,0x0000, 0xFBC0,0xA6F1,0x0000, 0xFBC0,0xA6F2,0x0000,
+0xFBC0,0xA6F3,0x0000, 0xFBC0,0xA6F4,0x0000, 0xFBC0,0xA6F5,0x0000,
+0xFBC0,0xA6F6,0x0000, 0xFBC0,0xA6F7,0x0000, 0xFBC0,0xA6F8,0x0000,
+0xFBC0,0xA6F9,0x0000, 0xFBC0,0xA6FA,0x0000, 0xFBC0,0xA6FB,0x0000,
+0xFBC0,0xA6FC,0x0000, 0xFBC0,0xA6FD,0x0000, 0xFBC0,0xA6FE,0x0000,
+0xFBC0,0xA6FF,0x0000 };
+
+uint16 page027data[]= { /* 2700 (3 weights per char) */
+0xFBC0,0xA700,0x0000, 0x077C,0x0000,0x0000, 0x077D,0x0000,0x0000,
+0x077E,0x0000,0x0000, 0x077F,0x0000,0x0000, 0xFBC0,0xA705,0x0000,
+0x0780,0x0000,0x0000, 0x0781,0x0000,0x0000, 0x0782,0x0000,0x0000,
+0x0783,0x0000,0x0000, 0xFBC0,0xA70A,0x0000, 0xFBC0,0xA70B,0x0000,
+0x0784,0x0000,0x0000, 0x0785,0x0000,0x0000, 0x0786,0x0000,0x0000,
+0x0787,0x0000,0x0000, 0x0788,0x0000,0x0000, 0x0789,0x0000,0x0000,
+0x078A,0x0000,0x0000, 0x078B,0x0000,0x0000, 0x078C,0x0000,0x0000,
+0x078D,0x0000,0x0000, 0x078E,0x0000,0x0000, 0x078F,0x0000,0x0000,
+0x0790,0x0000,0x0000, 0x0791,0x0000,0x0000, 0x0792,0x0000,0x0000,
+0x0793,0x0000,0x0000, 0x0794,0x0000,0x0000, 0x0795,0x0000,0x0000,
+0x0796,0x0000,0x0000, 0x0797,0x0000,0x0000, 0x0798,0x0000,0x0000,
+0x0799,0x0000,0x0000, 0x079A,0x0000,0x0000, 0x079B,0x0000,0x0000,
+0x079C,0x0000,0x0000, 0x079D,0x0000,0x0000, 0x079E,0x0000,0x0000,
+0x079F,0x0000,0x0000, 0xFBC0,0xA728,0x0000, 0x07A0,0x0000,0x0000,
+0x07A1,0x0000,0x0000, 0x07A2,0x0000,0x0000, 0x07A3,0x0000,0x0000,
+0x07A4,0x0000,0x0000, 0x07A5,0x0000,0x0000, 0x07A6,0x0000,0x0000,
+0x07A7,0x0000,0x0000, 0x07A8,0x0000,0x0000, 0x07A9,0x0000,0x0000,
+0x07AA,0x0000,0x0000, 0x07AB,0x0000,0x0000, 0x07AC,0x0000,0x0000,
+0x07AD,0x0000,0x0000, 0x07AE,0x0000,0x0000, 0x07AF,0x0000,0x0000,
+0x07B0,0x0000,0x0000, 0x07B1,0x0000,0x0000, 0x07B2,0x0000,0x0000,
+0x07B3,0x0000,0x0000, 0x07B4,0x0000,0x0000, 0x07B5,0x0000,0x0000,
+0x07B6,0x0000,0x0000, 0x07B7,0x0000,0x0000, 0x07B8,0x0000,0x0000,
+0x07B9,0x0000,0x0000, 0x07BA,0x0000,0x0000, 0x07BB,0x0000,0x0000,
+0x07BC,0x0000,0x0000, 0x07BD,0x0000,0x0000, 0x07BE,0x0000,0x0000,
+0x07BF,0x0000,0x0000, 0x07C0,0x0000,0x0000, 0x07C1,0x0000,0x0000,
+0x07C2,0x0000,0x0000, 0xFBC0,0xA74C,0x0000, 0x07C3,0x0000,0x0000,
+0xFBC0,0xA74E,0x0000, 0x07C4,0x0000,0x0000, 0x07C5,0x0000,0x0000,
+0x07C6,0x0000,0x0000, 0x07C7,0x0000,0x0000, 0xFBC0,0xA753,0x0000,
+0xFBC0,0xA754,0x0000, 0xFBC0,0xA755,0x0000, 0x07C8,0x0000,0x0000,
+0xFBC0,0xA757,0x0000, 0x07C9,0x0000,0x0000, 0x07CA,0x0000,0x0000,
+0x07CB,0x0000,0x0000, 0x07CC,0x0000,0x0000, 0x07CD,0x0000,0x0000,
+0x07CE,0x0000,0x0000, 0x07CF,0x0000,0x0000, 0xFBC0,0xA75F,0x0000,
+0xFBC0,0xA760,0x0000, 0x07D0,0x0000,0x0000, 0x07D1,0x0000,0x0000,
+0x07D2,0x0000,0x0000, 0x07D3,0x0000,0x0000, 0x07D4,0x0000,0x0000,
+0x07D5,0x0000,0x0000, 0x07D6,0x0000,0x0000, 0x07D7,0x0000,0x0000,
+0x07D8,0x0000,0x0000, 0x07D9,0x0000,0x0000, 0x07DA,0x0000,0x0000,
+0x07DB,0x0000,0x0000, 0x07DC,0x0000,0x0000, 0x07DD,0x0000,0x0000,
+0x07DE,0x0000,0x0000, 0x07DF,0x0000,0x0000, 0x07E0,0x0000,0x0000,
+0x07E1,0x0000,0x0000, 0x07E2,0x0000,0x0000, 0x07E3,0x0000,0x0000,
+0x07E4,0x0000,0x0000, 0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000,
+0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000,
+0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000,
+0x0E32,0x0000,0x0000, 0x0E2A,0x0E29,0x0000, 0x0E2A,0x0000,0x0000,
+0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000,
+0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000,
+0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, 0x0E2A,0x0E29,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0x0E2A,0x0E29,0x0000, 0x07E5,0x0000,0x0000, 0xFBC0,0xA795,0x0000,
+0xFBC0,0xA796,0x0000, 0xFBC0,0xA797,0x0000, 0x07E6,0x0000,0x0000,
+0x07E7,0x0000,0x0000, 0x07E8,0x0000,0x0000, 0x07E9,0x0000,0x0000,
+0x07EA,0x0000,0x0000, 0x07EB,0x0000,0x0000, 0x07EC,0x0000,0x0000,
+0x07ED,0x0000,0x0000, 0x07EE,0x0000,0x0000, 0x07EF,0x0000,0x0000,
+0x07F0,0x0000,0x0000, 0x07F1,0x0000,0x0000, 0x07F2,0x0000,0x0000,
+0x07F3,0x0000,0x0000, 0x07F4,0x0000,0x0000, 0x07F5,0x0000,0x0000,
+0x07F6,0x0000,0x0000, 0x07F7,0x0000,0x0000, 0x07F8,0x0000,0x0000,
+0x07F9,0x0000,0x0000, 0x07FA,0x0000,0x0000, 0x07FB,0x0000,0x0000,
+0x07FC,0x0000,0x0000, 0x07FD,0x0000,0x0000, 0xFBC0,0xA7B0,0x0000,
+0x07FE,0x0000,0x0000, 0x07FF,0x0000,0x0000, 0x0800,0x0000,0x0000,
+0x0801,0x0000,0x0000, 0x0802,0x0000,0x0000, 0x0803,0x0000,0x0000,
+0x0804,0x0000,0x0000, 0x0805,0x0000,0x0000, 0x0806,0x0000,0x0000,
+0x0807,0x0000,0x0000, 0x0808,0x0000,0x0000, 0x0809,0x0000,0x0000,
+0x080A,0x0000,0x0000, 0x080B,0x0000,0x0000, 0xFBC0,0xA7BF,0x0000,
+0xFBC0,0xA7C0,0x0000, 0xFBC0,0xA7C1,0x0000, 0xFBC0,0xA7C2,0x0000,
+0xFBC0,0xA7C3,0x0000, 0xFBC0,0xA7C4,0x0000, 0xFBC0,0xA7C5,0x0000,
+0xFBC0,0xA7C6,0x0000, 0xFBC0,0xA7C7,0x0000, 0xFBC0,0xA7C8,0x0000,
+0xFBC0,0xA7C9,0x0000, 0xFBC0,0xA7CA,0x0000, 0xFBC0,0xA7CB,0x0000,
+0xFBC0,0xA7CC,0x0000, 0xFBC0,0xA7CD,0x0000, 0xFBC0,0xA7CE,0x0000,
+0xFBC0,0xA7CF,0x0000, 0x080C,0x0000,0x0000, 0x080D,0x0000,0x0000,
+0x080E,0x0000,0x0000, 0x080F,0x0000,0x0000, 0x0810,0x0000,0x0000,
+0x0811,0x0000,0x0000, 0x0812,0x0000,0x0000, 0x0813,0x0000,0x0000,
+0x0814,0x0000,0x0000, 0x0815,0x0000,0x0000, 0x0816,0x0000,0x0000,
+0x0817,0x0000,0x0000, 0x0818,0x0000,0x0000, 0x0819,0x0000,0x0000,
+0x081A,0x0000,0x0000, 0x081B,0x0000,0x0000, 0x081C,0x0000,0x0000,
+0x081D,0x0000,0x0000, 0x081E,0x0000,0x0000, 0x081F,0x0000,0x0000,
+0x0820,0x0000,0x0000, 0x0821,0x0000,0x0000, 0x0822,0x0000,0x0000,
+0x0823,0x0000,0x0000, 0x0824,0x0000,0x0000, 0x0825,0x0000,0x0000,
+0x0826,0x0000,0x0000, 0x0827,0x0000,0x0000, 0xFBC0,0xA7EC,0x0000,
+0xFBC0,0xA7ED,0x0000, 0xFBC0,0xA7EE,0x0000, 0xFBC0,0xA7EF,0x0000,
+0x0828,0x0000,0x0000, 0x0829,0x0000,0x0000, 0x082A,0x0000,0x0000,
+0x082B,0x0000,0x0000, 0x082C,0x0000,0x0000, 0x082D,0x0000,0x0000,
+0x082E,0x0000,0x0000, 0x082F,0x0000,0x0000, 0x0830,0x0000,0x0000,
+0x0831,0x0000,0x0000, 0x0832,0x0000,0x0000, 0x0833,0x0000,0x0000,
+0x0834,0x0000,0x0000, 0x0835,0x0000,0x0000, 0x0836,0x0000,0x0000,
+0x0837,0x0000,0x0000 };
+
+uint16 page028data[]= { /* 2800 (2 weights per char) */
+0x0A29,0x0000, 0x0A2A,0x0000, 0x0A2B,0x0000, 0x0A2C,0x0000,
+0x0A2D,0x0000, 0x0A2E,0x0000, 0x0A2F,0x0000, 0x0A30,0x0000,
+0x0A31,0x0000, 0x0A32,0x0000, 0x0A33,0x0000, 0x0A34,0x0000,
+0x0A35,0x0000, 0x0A36,0x0000, 0x0A37,0x0000, 0x0A38,0x0000,
+0x0A39,0x0000, 0x0A3A,0x0000, 0x0A3B,0x0000, 0x0A3C,0x0000,
+0x0A3D,0x0000, 0x0A3E,0x0000, 0x0A3F,0x0000, 0x0A40,0x0000,
+0x0A41,0x0000, 0x0A42,0x0000, 0x0A43,0x0000, 0x0A44,0x0000,
+0x0A45,0x0000, 0x0A46,0x0000, 0x0A47,0x0000, 0x0A48,0x0000,
+0x0A49,0x0000, 0x0A4A,0x0000, 0x0A4B,0x0000, 0x0A4C,0x0000,
+0x0A4D,0x0000, 0x0A4E,0x0000, 0x0A4F,0x0000, 0x0A50,0x0000,
+0x0A51,0x0000, 0x0A52,0x0000, 0x0A53,0x0000, 0x0A54,0x0000,
+0x0A55,0x0000, 0x0A56,0x0000, 0x0A57,0x0000, 0x0A58,0x0000,
+0x0A59,0x0000, 0x0A5A,0x0000, 0x0A5B,0x0000, 0x0A5C,0x0000,
+0x0A5D,0x0000, 0x0A5E,0x0000, 0x0A5F,0x0000, 0x0A60,0x0000,
+0x0A61,0x0000, 0x0A62,0x0000, 0x0A63,0x0000, 0x0A64,0x0000,
+0x0A65,0x0000, 0x0A66,0x0000, 0x0A67,0x0000, 0x0A68,0x0000,
+0x0A69,0x0000, 0x0A6A,0x0000, 0x0A6B,0x0000, 0x0A6C,0x0000,
+0x0A6D,0x0000, 0x0A6E,0x0000, 0x0A6F,0x0000, 0x0A70,0x0000,
+0x0A71,0x0000, 0x0A72,0x0000, 0x0A73,0x0000, 0x0A74,0x0000,
+0x0A75,0x0000, 0x0A76,0x0000, 0x0A77,0x0000, 0x0A78,0x0000,
+0x0A79,0x0000, 0x0A7A,0x0000, 0x0A7B,0x0000, 0x0A7C,0x0000,
+0x0A7D,0x0000, 0x0A7E,0x0000, 0x0A7F,0x0000, 0x0A80,0x0000,
+0x0A81,0x0000, 0x0A82,0x0000, 0x0A83,0x0000, 0x0A84,0x0000,
+0x0A85,0x0000, 0x0A86,0x0000, 0x0A87,0x0000, 0x0A88,0x0000,
+0x0A89,0x0000, 0x0A8A,0x0000, 0x0A8B,0x0000, 0x0A8C,0x0000,
+0x0A8D,0x0000, 0x0A8E,0x0000, 0x0A8F,0x0000, 0x0A90,0x0000,
+0x0A91,0x0000, 0x0A92,0x0000, 0x0A93,0x0000, 0x0A94,0x0000,
+0x0A95,0x0000, 0x0A96,0x0000, 0x0A97,0x0000, 0x0A98,0x0000,
+0x0A99,0x0000, 0x0A9A,0x0000, 0x0A9B,0x0000, 0x0A9C,0x0000,
+0x0A9D,0x0000, 0x0A9E,0x0000, 0x0A9F,0x0000, 0x0AA0,0x0000,
+0x0AA1,0x0000, 0x0AA2,0x0000, 0x0AA3,0x0000, 0x0AA4,0x0000,
+0x0AA5,0x0000, 0x0AA6,0x0000, 0x0AA7,0x0000, 0x0AA8,0x0000,
+0x0AA9,0x0000, 0x0AAA,0x0000, 0x0AAB,0x0000, 0x0AAC,0x0000,
+0x0AAD,0x0000, 0x0AAE,0x0000, 0x0AAF,0x0000, 0x0AB0,0x0000,
+0x0AB1,0x0000, 0x0AB2,0x0000, 0x0AB3,0x0000, 0x0AB4,0x0000,
+0x0AB5,0x0000, 0x0AB6,0x0000, 0x0AB7,0x0000, 0x0AB8,0x0000,
+0x0AB9,0x0000, 0x0ABA,0x0000, 0x0ABB,0x0000, 0x0ABC,0x0000,
+0x0ABD,0x0000, 0x0ABE,0x0000, 0x0ABF,0x0000, 0x0AC0,0x0000,
+0x0AC1,0x0000, 0x0AC2,0x0000, 0x0AC3,0x0000, 0x0AC4,0x0000,
+0x0AC5,0x0000, 0x0AC6,0x0000, 0x0AC7,0x0000, 0x0AC8,0x0000,
+0x0AC9,0x0000, 0x0ACA,0x0000, 0x0ACB,0x0000, 0x0ACC,0x0000,
+0x0ACD,0x0000, 0x0ACE,0x0000, 0x0ACF,0x0000, 0x0AD0,0x0000,
+0x0AD1,0x0000, 0x0AD2,0x0000, 0x0AD3,0x0000, 0x0AD4,0x0000,
+0x0AD5,0x0000, 0x0AD6,0x0000, 0x0AD7,0x0000, 0x0AD8,0x0000,
+0x0AD9,0x0000, 0x0ADA,0x0000, 0x0ADB,0x0000, 0x0ADC,0x0000,
+0x0ADD,0x0000, 0x0ADE,0x0000, 0x0ADF,0x0000, 0x0AE0,0x0000,
+0x0AE1,0x0000, 0x0AE2,0x0000, 0x0AE3,0x0000, 0x0AE4,0x0000,
+0x0AE5,0x0000, 0x0AE6,0x0000, 0x0AE7,0x0000, 0x0AE8,0x0000,
+0x0AE9,0x0000, 0x0AEA,0x0000, 0x0AEB,0x0000, 0x0AEC,0x0000,
+0x0AED,0x0000, 0x0AEE,0x0000, 0x0AEF,0x0000, 0x0AF0,0x0000,
+0x0AF1,0x0000, 0x0AF2,0x0000, 0x0AF3,0x0000, 0x0AF4,0x0000,
+0x0AF5,0x0000, 0x0AF6,0x0000, 0x0AF7,0x0000, 0x0AF8,0x0000,
+0x0AF9,0x0000, 0x0AFA,0x0000, 0x0AFB,0x0000, 0x0AFC,0x0000,
+0x0AFD,0x0000, 0x0AFE,0x0000, 0x0AFF,0x0000, 0x0B00,0x0000,
+0x0B01,0x0000, 0x0B02,0x0000, 0x0B03,0x0000, 0x0B04,0x0000,
+0x0B05,0x0000, 0x0B06,0x0000, 0x0B07,0x0000, 0x0B08,0x0000,
+0x0B09,0x0000, 0x0B0A,0x0000, 0x0B0B,0x0000, 0x0B0C,0x0000,
+0x0B0D,0x0000, 0x0B0E,0x0000, 0x0B0F,0x0000, 0x0B10,0x0000,
+0x0B11,0x0000, 0x0B12,0x0000, 0x0B13,0x0000, 0x0B14,0x0000,
+0x0B15,0x0000, 0x0B16,0x0000, 0x0B17,0x0000, 0x0B18,0x0000,
+0x0B19,0x0000, 0x0B1A,0x0000, 0x0B1B,0x0000, 0x0B1C,0x0000,
+0x0B1D,0x0000, 0x0B1E,0x0000, 0x0B1F,0x0000, 0x0B20,0x0000,
+0x0B21,0x0000, 0x0B22,0x0000, 0x0B23,0x0000, 0x0B24,0x0000,
+0x0B25,0x0000, 0x0B26,0x0000, 0x0B27,0x0000, 0x0B28,0x0000
+};
+
+uint16 page029data[]= { /* 2900 (2 weights per char) */
+0x0838,0x0000, 0x0839,0x0000, 0x083A,0x0000, 0x083B,0x0000,
+0x083C,0x0000, 0x083D,0x0000, 0x083E,0x0000, 0x083F,0x0000,
+0x0840,0x0000, 0x0841,0x0000, 0x0842,0x0000, 0x0843,0x0000,
+0x0844,0x0000, 0x0845,0x0000, 0x0846,0x0000, 0x0847,0x0000,
+0x0848,0x0000, 0x0849,0x0000, 0x084A,0x0000, 0x084B,0x0000,
+0x084C,0x0000, 0x084D,0x0000, 0x084E,0x0000, 0x084F,0x0000,
+0x0850,0x0000, 0x0851,0x0000, 0x0852,0x0000, 0x0853,0x0000,
+0x0854,0x0000, 0x0855,0x0000, 0x0856,0x0000, 0x0857,0x0000,
+0x0858,0x0000, 0x0859,0x0000, 0x085A,0x0000, 0x085B,0x0000,
+0x085C,0x0000, 0x085D,0x0000, 0x085E,0x0000, 0x085F,0x0000,
+0x0860,0x0000, 0x0861,0x0000, 0x0862,0x0000, 0x0863,0x0000,
+0x0864,0x0000, 0x0865,0x0000, 0x0866,0x0000, 0x0867,0x0000,
+0x0868,0x0000, 0x0869,0x0000, 0x086A,0x0000, 0x086B,0x0000,
+0x086C,0x0000, 0x086D,0x0000, 0x086E,0x0000, 0x086F,0x0000,
+0x0870,0x0000, 0x0871,0x0000, 0x0872,0x0000, 0x0873,0x0000,
+0x0874,0x0000, 0x0875,0x0000, 0x0876,0x0000, 0x0877,0x0000,
+0x0878,0x0000, 0x0879,0x0000, 0x087A,0x0000, 0x087B,0x0000,
+0x087C,0x0000, 0x087D,0x0000, 0x087E,0x0000, 0x087F,0x0000,
+0x0880,0x0000, 0x0881,0x0000, 0x0882,0x0000, 0x0883,0x0000,
+0x0884,0x0000, 0x0885,0x0000, 0x0886,0x0000, 0x0887,0x0000,
+0x0888,0x0000, 0x0889,0x0000, 0x088A,0x0000, 0x088B,0x0000,
+0x088C,0x0000, 0x088D,0x0000, 0x088E,0x0000, 0x088F,0x0000,
+0x0890,0x0000, 0x0891,0x0000, 0x0892,0x0000, 0x0893,0x0000,
+0x0894,0x0000, 0x0895,0x0000, 0x0896,0x0000, 0x0897,0x0000,
+0x0898,0x0000, 0x0899,0x0000, 0x089A,0x0000, 0x089B,0x0000,
+0x089C,0x0000, 0x089D,0x0000, 0x089E,0x0000, 0x089F,0x0000,
+0x08A0,0x0000, 0x08A1,0x0000, 0x08A2,0x0000, 0x08A3,0x0000,
+0x08A4,0x0000, 0x08A5,0x0000, 0x08A6,0x0000, 0x08A7,0x0000,
+0x08A8,0x0000, 0x08A9,0x0000, 0x08AA,0x0000, 0x08AB,0x0000,
+0x08AC,0x0000, 0x08AD,0x0000, 0x08AE,0x0000, 0x08AF,0x0000,
+0x08B0,0x0000, 0x08B1,0x0000, 0x08B2,0x0000, 0x08B3,0x0000,
+0x08B4,0x0000, 0x08B5,0x0000, 0x08B6,0x0000, 0x08B7,0x0000,
+0x08B8,0x0000, 0x08B9,0x0000, 0x08BA,0x0000, 0x0298,0x0000,
+0x0299,0x0000, 0x029A,0x0000, 0x029B,0x0000, 0x029C,0x0000,
+0x029D,0x0000, 0x029E,0x0000, 0x029F,0x0000, 0x02A0,0x0000,
+0x02A1,0x0000, 0x02A2,0x0000, 0x02A3,0x0000, 0x02A4,0x0000,
+0x02A5,0x0000, 0x02A6,0x0000, 0x02A7,0x0000, 0x02A8,0x0000,
+0x02A9,0x0000, 0x02AA,0x0000, 0x02AB,0x0000, 0x02AC,0x0000,
+0x02AD,0x0000, 0x08BB,0x0000, 0x08BC,0x0000, 0x08BD,0x0000,
+0x08BE,0x0000, 0x08BF,0x0000, 0x08C0,0x0000, 0x08C1,0x0000,
+0x08C2,0x0000, 0x08C3,0x0000, 0x08C4,0x0000, 0x08C5,0x0000,
+0x08C6,0x0000, 0x08C7,0x0000, 0x08C8,0x0000, 0x08C9,0x0000,
+0x08CA,0x0000, 0x08CB,0x0000, 0x08CC,0x0000, 0x08CD,0x0000,
+0x08CE,0x0000, 0x08CF,0x0000, 0x08D0,0x0000, 0x08D1,0x0000,
+0x08D2,0x0000, 0x08D3,0x0000, 0x08D4,0x0000, 0x08D5,0x0000,
+0x08D6,0x0000, 0x08D7,0x0000, 0x08D8,0x0000, 0x08D9,0x0000,
+0x08DA,0x0000, 0x08DB,0x0000, 0x08DC,0x0000, 0x08DD,0x0000,
+0x08DE,0x0000, 0x08DF,0x0000, 0x08E0,0x0000, 0x08E1,0x0000,
+0x08E2,0x0000, 0x08E3,0x0000, 0x08E4,0x0000, 0x08E5,0x0000,
+0x08E6,0x0000, 0x08E7,0x0000, 0x08E8,0x0000, 0x08E9,0x0000,
+0x08EA,0x0000, 0x08EB,0x0000, 0x08EC,0x0000, 0x08ED,0x0000,
+0x08EE,0x0000, 0x08EF,0x0000, 0x08F0,0x0000, 0x08F1,0x0000,
+0x08F2,0x0000, 0x08F3,0x0000, 0x08F4,0x0000, 0x08F5,0x0000,
+0x08F6,0x0000, 0x08F7,0x0000, 0x08F8,0x0000, 0x08F9,0x0000,
+0x08FA,0x0000, 0x08FB,0x0000, 0x08FC,0x0000, 0x08FD,0x0000,
+0x08FE,0x0000, 0x08FF,0x0000, 0x0900,0x0000, 0x0901,0x0000,
+0x0902,0x0000, 0x0903,0x0000, 0x0904,0x0000, 0x0905,0x0000,
+0x0906,0x0000, 0x0907,0x0000, 0x0908,0x0000, 0x0909,0x0000,
+0x090A,0x0000, 0x090B,0x0000, 0x090C,0x0000, 0x090D,0x0000,
+0x090E,0x0000, 0x090F,0x0000, 0x0910,0x0000, 0x0911,0x0000,
+0x0912,0x0000, 0x0913,0x0000, 0x0914,0x0000, 0x0915,0x0000,
+0x0916,0x0000, 0x0917,0x0000, 0x0918,0x0000, 0x0919,0x0000,
+0x091A,0x0000, 0x091B,0x0000, 0x091C,0x0000, 0x091D,0x0000,
+0x0296,0x0000, 0x0297,0x0000, 0x091E,0x0000, 0x091F,0x0000
+};
+
+uint16 page02Adata[]= { /* 2A00 (5 weights per char) */
+0x0920,0x0000,0x0000,0x0000,0x0000,
+0x0921,0x0000,0x0000,0x0000,0x0000,
+0x0922,0x0000,0x0000,0x0000,0x0000,
+0x0923,0x0000,0x0000,0x0000,0x0000,
+0x0924,0x0000,0x0000,0x0000,0x0000,
+0x0925,0x0000,0x0000,0x0000,0x0000,
+0x0926,0x0000,0x0000,0x0000,0x0000,
+0x0927,0x0000,0x0000,0x0000,0x0000,
+0x0928,0x0000,0x0000,0x0000,0x0000,
+0x0929,0x0000,0x0000,0x0000,0x0000,
+0x092A,0x0000,0x0000,0x0000,0x0000,
+0x092B,0x0000,0x0000,0x0000,0x0000,
+0x044B,0x044B,0x044B,0x044B,0x0000,
+0x092C,0x0000,0x0000,0x0000,0x0000,
+0x092D,0x0000,0x0000,0x0000,0x0000,
+0x092E,0x0000,0x0000,0x0000,0x0000,
+0x092F,0x0000,0x0000,0x0000,0x0000,
+0x0930,0x0000,0x0000,0x0000,0x0000,
+0x0931,0x0000,0x0000,0x0000,0x0000,
+0x0932,0x0000,0x0000,0x0000,0x0000,
+0x0933,0x0000,0x0000,0x0000,0x0000,
+0x0934,0x0000,0x0000,0x0000,0x0000,
+0x0935,0x0000,0x0000,0x0000,0x0000,
+0x0936,0x0000,0x0000,0x0000,0x0000,
+0x0937,0x0000,0x0000,0x0000,0x0000,
+0x0938,0x0000,0x0000,0x0000,0x0000,
+0x0939,0x0000,0x0000,0x0000,0x0000,
+0x093A,0x0000,0x0000,0x0000,0x0000,
+0x093B,0x0000,0x0000,0x0000,0x0000,
+0x093C,0x0000,0x0000,0x0000,0x0000,
+0x093D,0x0000,0x0000,0x0000,0x0000,
+0x093E,0x0000,0x0000,0x0000,0x0000,
+0x093F,0x0000,0x0000,0x0000,0x0000,
+0x0940,0x0000,0x0000,0x0000,0x0000,
+0x0941,0x0000,0x0000,0x0000,0x0000,
+0x0942,0x0000,0x0000,0x0000,0x0000,
+0x0943,0x0000,0x0000,0x0000,0x0000,
+0x0944,0x0000,0x0000,0x0000,0x0000,
+0x0945,0x0000,0x0000,0x0000,0x0000,
+0x0946,0x0000,0x0000,0x0000,0x0000,
+0x0947,0x0000,0x0000,0x0000,0x0000,
+0x0948,0x0000,0x0000,0x0000,0x0000,
+0x0949,0x0000,0x0000,0x0000,0x0000,
+0x094A,0x0000,0x0000,0x0000,0x0000,
+0x094B,0x0000,0x0000,0x0000,0x0000,
+0x094C,0x0000,0x0000,0x0000,0x0000,
+0x094D,0x0000,0x0000,0x0000,0x0000,
+0x094E,0x0000,0x0000,0x0000,0x0000,
+0x094F,0x0000,0x0000,0x0000,0x0000,
+0x0950,0x0000,0x0000,0x0000,0x0000,
+0x0951,0x0000,0x0000,0x0000,0x0000,
+0x0952,0x0000,0x0000,0x0000,0x0000,
+0x0953,0x0000,0x0000,0x0000,0x0000,
+0x0954,0x0000,0x0000,0x0000,0x0000,
+0x0955,0x0000,0x0000,0x0000,0x0000,
+0x0956,0x0000,0x0000,0x0000,0x0000,
+0x0957,0x0000,0x0000,0x0000,0x0000,
+0x0958,0x0000,0x0000,0x0000,0x0000,
+0x0959,0x0000,0x0000,0x0000,0x0000,
+0x095A,0x0000,0x0000,0x0000,0x0000,
+0x095B,0x0000,0x0000,0x0000,0x0000,
+0x095C,0x0000,0x0000,0x0000,0x0000,
+0x095D,0x0000,0x0000,0x0000,0x0000,
+0x095E,0x0000,0x0000,0x0000,0x0000,
+0x095F,0x0000,0x0000,0x0000,0x0000,
+0x0960,0x0000,0x0000,0x0000,0x0000,
+0x0961,0x0000,0x0000,0x0000,0x0000,
+0x0962,0x0000,0x0000,0x0000,0x0000,
+0x0963,0x0000,0x0000,0x0000,0x0000,
+0x0964,0x0000,0x0000,0x0000,0x0000,
+0x0965,0x0000,0x0000,0x0000,0x0000,
+0x0966,0x0000,0x0000,0x0000,0x0000,
+0x0967,0x0000,0x0000,0x0000,0x0000,
+0x0968,0x0000,0x0000,0x0000,0x0000,
+0x0969,0x0000,0x0000,0x0000,0x0000,
+0x096A,0x0000,0x0000,0x0000,0x0000,
+0x096B,0x0000,0x0000,0x0000,0x0000,
+0x096C,0x0000,0x0000,0x0000,0x0000,
+0x096D,0x0000,0x0000,0x0000,0x0000,
+0x096E,0x0000,0x0000,0x0000,0x0000,
+0x096F,0x0000,0x0000,0x0000,0x0000,
+0x0970,0x0000,0x0000,0x0000,0x0000,
+0x0971,0x0000,0x0000,0x0000,0x0000,
+0x0972,0x0000,0x0000,0x0000,0x0000,
+0x0973,0x0000,0x0000,0x0000,0x0000,
+0x0974,0x0000,0x0000,0x0000,0x0000,
+0x0975,0x0000,0x0000,0x0000,0x0000,
+0x0976,0x0000,0x0000,0x0000,0x0000,
+0x0977,0x0000,0x0000,0x0000,0x0000,
+0x0978,0x0000,0x0000,0x0000,0x0000,
+0x0979,0x0000,0x0000,0x0000,0x0000,
+0x097A,0x0000,0x0000,0x0000,0x0000,
+0x097B,0x0000,0x0000,0x0000,0x0000,
+0x097C,0x0000,0x0000,0x0000,0x0000,
+0x097D,0x0000,0x0000,0x0000,0x0000,
+0x097E,0x0000,0x0000,0x0000,0x0000,
+0x097F,0x0000,0x0000,0x0000,0x0000,
+0x0980,0x0000,0x0000,0x0000,0x0000,
+0x0981,0x0000,0x0000,0x0000,0x0000,
+0x0982,0x0000,0x0000,0x0000,0x0000,
+0x0983,0x0000,0x0000,0x0000,0x0000,
+0x0984,0x0000,0x0000,0x0000,0x0000,
+0x0985,0x0000,0x0000,0x0000,0x0000,
+0x0986,0x0000,0x0000,0x0000,0x0000,
+0x0987,0x0000,0x0000,0x0000,0x0000,
+0x0988,0x0000,0x0000,0x0000,0x0000,
+0x0989,0x0000,0x0000,0x0000,0x0000,
+0x098A,0x0000,0x0000,0x0000,0x0000,
+0x098B,0x0000,0x0000,0x0000,0x0000,
+0x098C,0x0000,0x0000,0x0000,0x0000,
+0x098D,0x0000,0x0000,0x0000,0x0000,
+0x098E,0x0000,0x0000,0x0000,0x0000,
+0x098F,0x0000,0x0000,0x0000,0x0000,
+0x0990,0x0000,0x0000,0x0000,0x0000,
+0x0991,0x0000,0x0000,0x0000,0x0000,
+0x0992,0x0000,0x0000,0x0000,0x0000,
+0x023D,0x023D,0x042D,0x0000,0x0000,
+0x042D,0x042D,0x0000,0x0000,0x0000,
+0x042D,0x042D,0x042D,0x0000,0x0000,
+0x0993,0x0000,0x0000,0x0000,0x0000,
+0x0994,0x0000,0x0000,0x0000,0x0000,
+0x0995,0x0000,0x0000,0x0000,0x0000,
+0x0996,0x0000,0x0000,0x0000,0x0000,
+0x0997,0x0000,0x0000,0x0000,0x0000,
+0x0998,0x0000,0x0000,0x0000,0x0000,
+0x0999,0x0000,0x0000,0x0000,0x0000,
+0x099A,0x0000,0x0000,0x0000,0x0000,
+0x099B,0x0000,0x0000,0x0000,0x0000,
+0x099C,0x0000,0x0000,0x0000,0x0000,
+0x099D,0x0000,0x0000,0x0000,0x0000,
+0x099E,0x0000,0x0000,0x0000,0x0000,
+0x099F,0x0000,0x0000,0x0000,0x0000,
+0x09A0,0x0000,0x0000,0x0000,0x0000,
+0x09A1,0x0000,0x0000,0x0000,0x0000,
+0x09A2,0x0000,0x0000,0x0000,0x0000,
+0x09A3,0x0000,0x0000,0x0000,0x0000,
+0x09A4,0x0000,0x0000,0x0000,0x0000,
+0x09A5,0x0000,0x0000,0x0000,0x0000,
+0x09A6,0x0000,0x0000,0x0000,0x0000,
+0x09A7,0x0000,0x0000,0x0000,0x0000,
+0x09A8,0x0000,0x0000,0x0000,0x0000,
+0x09A9,0x0000,0x0000,0x0000,0x0000,
+0x09AA,0x0000,0x0000,0x0000,0x0000,
+0x09AB,0x0000,0x0000,0x0000,0x0000,
+0x09AC,0x0000,0x0000,0x0000,0x0000,
+0x09AD,0x0000,0x0000,0x0000,0x0000,
+0x09AE,0x0000,0x0000,0x0000,0x0000,
+0x09AF,0x0000,0x0000,0x0000,0x0000,
+0x09B0,0x0000,0x0000,0x0000,0x0000,
+0x09B1,0x0000,0x0000,0x0000,0x0000,
+0x09B2,0x0000,0x0000,0x0000,0x0000,
+0x09B3,0x0000,0x0000,0x0000,0x0000,
+0x09B4,0x0000,0x0000,0x0000,0x0000,
+0x09B5,0x0000,0x0000,0x0000,0x0000,
+0x09B6,0x0000,0x0000,0x0000,0x0000,
+0x09B7,0x0000,0x0000,0x0000,0x0000,
+0x09B8,0x0000,0x0000,0x0000,0x0000,
+0x09B9,0x0000,0x0000,0x0000,0x0000,
+0x09BA,0x0000,0x0000,0x0000,0x0000,
+0x09BB,0x0000,0x0000,0x0000,0x0000,
+0x09BC,0x0000,0x0000,0x0000,0x0000,
+0x09BD,0x0000,0x0000,0x0000,0x0000,
+0x09BE,0x0000,0x0000,0x0000,0x0000,
+0x09BF,0x0000,0x0000,0x0000,0x0000,
+0x09C0,0x0000,0x0000,0x0000,0x0000,
+0x09C1,0x0000,0x0000,0x0000,0x0000,
+0x09C2,0x0000,0x0000,0x0000,0x0000,
+0x09C3,0x0000,0x0000,0x0000,0x0000,
+0x09C4,0x0000,0x0000,0x0000,0x0000,
+0x09C5,0x0000,0x0000,0x0000,0x0000,
+0x09C6,0x0000,0x0000,0x0000,0x0000,
+0x09C7,0x0000,0x0000,0x0000,0x0000,
+0x09C8,0x0000,0x0000,0x0000,0x0000,
+0x09C9,0x0000,0x0000,0x0000,0x0000,
+0x09CA,0x0000,0x0000,0x0000,0x0000,
+0x09CB,0x0000,0x0000,0x0000,0x0000,
+0x09CC,0x0000,0x0000,0x0000,0x0000,
+0x09CD,0x0000,0x0000,0x0000,0x0000,
+0x09CE,0x0000,0x0000,0x0000,0x0000,
+0x09CF,0x0000,0x0000,0x0000,0x0000,
+0x09D0,0x0000,0x0000,0x0000,0x0000,
+0x09D1,0x0000,0x0000,0x0000,0x0000,
+0x09D2,0x0000,0x0000,0x0000,0x0000,
+0x09D3,0x0000,0x0000,0x0000,0x0000,
+0x09D4,0x0000,0x0000,0x0000,0x0000,
+0x09D5,0x0000,0x0000,0x0000,0x0000,
+0x09D6,0x0000,0x0000,0x0000,0x0000,
+0x09D7,0x0000,0x0000,0x0000,0x0000,
+0x09D8,0x0000,0x0000,0x0000,0x0000,
+0x09D9,0x0000,0x0000,0x0000,0x0000,
+0x09DA,0x0000,0x0000,0x0000,0x0000,
+0x09DB,0x0000,0x0000,0x0000,0x0000,
+0x09DC,0x0000,0x0000,0x0000,0x0000,
+0x09DD,0x0000,0x0000,0x0000,0x0000,
+0x09DE,0x0000,0x0000,0x0000,0x0000,
+0x09DF,0x0000,0x0000,0x0000,0x0000,
+0x09E0,0x0000,0x0000,0x0000,0x0000,
+0x09E1,0x0000,0x0000,0x0000,0x0000,
+0x09E2,0x0000,0x0000,0x0000,0x0000,
+0x09E3,0x0000,0x0000,0x0000,0x0000,
+0x09E4,0x0000,0x0000,0x0000,0x0000,
+0x09E5,0x0000,0x0000,0x0000,0x0000,
+0x09E6,0x0000,0x0000,0x0000,0x0000,
+0x09E7,0x0000,0x0000,0x0000,0x0000,
+0x09E8,0x0000,0x0000,0x0000,0x0000,
+0x09E9,0x0000,0x0000,0x0000,0x0000,
+0x09EA,0x0000,0x0000,0x0000,0x0000,
+0x09EB,0x0000,0x0000,0x0000,0x0000,
+0x09EC,0x0000,0x0000,0x0000,0x0000,
+0x09ED,0x0000,0x0000,0x0000,0x0000,
+0x09EE,0x0000,0x0000,0x0000,0x0000,
+0x09EF,0x0000,0x0000,0x0000,0x0000,
+0x09F0,0x0000,0x0000,0x0000,0x0000,
+0x09F1,0x0000,0x0000,0x0000,0x0000,
+0x09F2,0x0000,0x0000,0x0000,0x0000,
+0x09F3,0x0000,0x0000,0x0000,0x0000,
+0x09F4,0x0000,0x0000,0x0000,0x0000,
+0x09F5,0x0000,0x0000,0x0000,0x0000,
+0x09F6,0x0000,0x0000,0x0000,0x0000,
+0x09F7,0x0000,0x0000,0x0000,0x0000,
+0x09F8,0x0000,0x0000,0x0000,0x0000,
+0x09F8,0x0000,0x0000,0x0000,0x0000,
+0x09F9,0x0000,0x0000,0x0000,0x0000,
+0x09FA,0x0000,0x0000,0x0000,0x0000,
+0x09FB,0x0000,0x0000,0x0000,0x0000,
+0x09FC,0x0000,0x0000,0x0000,0x0000,
+0x09FD,0x0000,0x0000,0x0000,0x0000,
+0x09FE,0x0000,0x0000,0x0000,0x0000,
+0x09FF,0x0000,0x0000,0x0000,0x0000,
+0x0A00,0x0000,0x0000,0x0000,0x0000,
+0x0A01,0x0000,0x0000,0x0000,0x0000,
+0x0A02,0x0000,0x0000,0x0000,0x0000,
+0x0A03,0x0000,0x0000,0x0000,0x0000,
+0x0A04,0x0000,0x0000,0x0000,0x0000,
+0x0A05,0x0000,0x0000,0x0000,0x0000,
+0x0A06,0x0000,0x0000,0x0000,0x0000,
+0x0A07,0x0000,0x0000,0x0000,0x0000,
+0x0A08,0x0000,0x0000,0x0000,0x0000,
+0x0A09,0x0000,0x0000,0x0000,0x0000,
+0x0A0A,0x0000,0x0000,0x0000,0x0000,
+0x0A0B,0x0000,0x0000,0x0000,0x0000,
+0x0A0C,0x0000,0x0000,0x0000,0x0000,
+0x0A0D,0x0000,0x0000,0x0000,0x0000,
+0x0A0E,0x0000,0x0000,0x0000,0x0000,
+0x0A0F,0x0000,0x0000,0x0000,0x0000,
+0x0A10,0x0000,0x0000,0x0000,0x0000,
+0x0A11,0x0000,0x0000,0x0000,0x0000,
+0x0A12,0x0000,0x0000,0x0000,0x0000,
+0x0A13,0x0000,0x0000,0x0000,0x0000,
+0x0A14,0x0000,0x0000,0x0000,0x0000,
+0x0A15,0x0000,0x0000,0x0000,0x0000,
+0x0A16,0x0000,0x0000,0x0000,0x0000,
+0x0A17,0x0000,0x0000,0x0000,0x0000,
+0x0A18,0x0000,0x0000,0x0000,0x0000,
+0x0A19,0x0000,0x0000,0x0000,0x0000,
+0x0A1A,0x0000,0x0000,0x0000,0x0000
+};
+
+uint16 page02Bdata[]= { /* 2B00 (3 weights per char) */
+0x0A1B,0x0000,0x0000, 0x0A1C,0x0000,0x0000, 0x0A1D,0x0000,0x0000,
+0x0A1E,0x0000,0x0000, 0x0A1F,0x0000,0x0000, 0x0A20,0x0000,0x0000,
+0x0A21,0x0000,0x0000, 0x0A22,0x0000,0x0000, 0x0A23,0x0000,0x0000,
+0x0A24,0x0000,0x0000, 0x0A25,0x0000,0x0000, 0x0A26,0x0000,0x0000,
+0x0A27,0x0000,0x0000, 0x0A28,0x0000,0x0000, 0xFBC0,0xAB0E,0x0000,
+0xFBC0,0xAB0F,0x0000, 0xFBC0,0xAB10,0x0000, 0xFBC0,0xAB11,0x0000,
+0xFBC0,0xAB12,0x0000, 0xFBC0,0xAB13,0x0000, 0xFBC0,0xAB14,0x0000,
+0xFBC0,0xAB15,0x0000, 0xFBC0,0xAB16,0x0000, 0xFBC0,0xAB17,0x0000,
+0xFBC0,0xAB18,0x0000, 0xFBC0,0xAB19,0x0000, 0xFBC0,0xAB1A,0x0000,
+0xFBC0,0xAB1B,0x0000, 0xFBC0,0xAB1C,0x0000, 0xFBC0,0xAB1D,0x0000,
+0xFBC0,0xAB1E,0x0000, 0xFBC0,0xAB1F,0x0000, 0xFBC0,0xAB20,0x0000,
+0xFBC0,0xAB21,0x0000, 0xFBC0,0xAB22,0x0000, 0xFBC0,0xAB23,0x0000,
+0xFBC0,0xAB24,0x0000, 0xFBC0,0xAB25,0x0000, 0xFBC0,0xAB26,0x0000,
+0xFBC0,0xAB27,0x0000, 0xFBC0,0xAB28,0x0000, 0xFBC0,0xAB29,0x0000,
+0xFBC0,0xAB2A,0x0000, 0xFBC0,0xAB2B,0x0000, 0xFBC0,0xAB2C,0x0000,
+0xFBC0,0xAB2D,0x0000, 0xFBC0,0xAB2E,0x0000, 0xFBC0,0xAB2F,0x0000,
+0xFBC0,0xAB30,0x0000, 0xFBC0,0xAB31,0x0000, 0xFBC0,0xAB32,0x0000,
+0xFBC0,0xAB33,0x0000, 0xFBC0,0xAB34,0x0000, 0xFBC0,0xAB35,0x0000,
+0xFBC0,0xAB36,0x0000, 0xFBC0,0xAB37,0x0000, 0xFBC0,0xAB38,0x0000,
+0xFBC0,0xAB39,0x0000, 0xFBC0,0xAB3A,0x0000, 0xFBC0,0xAB3B,0x0000,
+0xFBC0,0xAB3C,0x0000, 0xFBC0,0xAB3D,0x0000, 0xFBC0,0xAB3E,0x0000,
+0xFBC0,0xAB3F,0x0000, 0xFBC0,0xAB40,0x0000, 0xFBC0,0xAB41,0x0000,
+0xFBC0,0xAB42,0x0000, 0xFBC0,0xAB43,0x0000, 0xFBC0,0xAB44,0x0000,
+0xFBC0,0xAB45,0x0000, 0xFBC0,0xAB46,0x0000, 0xFBC0,0xAB47,0x0000,
+0xFBC0,0xAB48,0x0000, 0xFBC0,0xAB49,0x0000, 0xFBC0,0xAB4A,0x0000,
+0xFBC0,0xAB4B,0x0000, 0xFBC0,0xAB4C,0x0000, 0xFBC0,0xAB4D,0x0000,
+0xFBC0,0xAB4E,0x0000, 0xFBC0,0xAB4F,0x0000, 0xFBC0,0xAB50,0x0000,
+0xFBC0,0xAB51,0x0000, 0xFBC0,0xAB52,0x0000, 0xFBC0,0xAB53,0x0000,
+0xFBC0,0xAB54,0x0000, 0xFBC0,0xAB55,0x0000, 0xFBC0,0xAB56,0x0000,
+0xFBC0,0xAB57,0x0000, 0xFBC0,0xAB58,0x0000, 0xFBC0,0xAB59,0x0000,
+0xFBC0,0xAB5A,0x0000, 0xFBC0,0xAB5B,0x0000, 0xFBC0,0xAB5C,0x0000,
+0xFBC0,0xAB5D,0x0000, 0xFBC0,0xAB5E,0x0000, 0xFBC0,0xAB5F,0x0000,
+0xFBC0,0xAB60,0x0000, 0xFBC0,0xAB61,0x0000, 0xFBC0,0xAB62,0x0000,
+0xFBC0,0xAB63,0x0000, 0xFBC0,0xAB64,0x0000, 0xFBC0,0xAB65,0x0000,
+0xFBC0,0xAB66,0x0000, 0xFBC0,0xAB67,0x0000, 0xFBC0,0xAB68,0x0000,
+0xFBC0,0xAB69,0x0000, 0xFBC0,0xAB6A,0x0000, 0xFBC0,0xAB6B,0x0000,
+0xFBC0,0xAB6C,0x0000, 0xFBC0,0xAB6D,0x0000, 0xFBC0,0xAB6E,0x0000,
+0xFBC0,0xAB6F,0x0000, 0xFBC0,0xAB70,0x0000, 0xFBC0,0xAB71,0x0000,
+0xFBC0,0xAB72,0x0000, 0xFBC0,0xAB73,0x0000, 0xFBC0,0xAB74,0x0000,
+0xFBC0,0xAB75,0x0000, 0xFBC0,0xAB76,0x0000, 0xFBC0,0xAB77,0x0000,
+0xFBC0,0xAB78,0x0000, 0xFBC0,0xAB79,0x0000, 0xFBC0,0xAB7A,0x0000,
+0xFBC0,0xAB7B,0x0000, 0xFBC0,0xAB7C,0x0000, 0xFBC0,0xAB7D,0x0000,
+0xFBC0,0xAB7E,0x0000, 0xFBC0,0xAB7F,0x0000, 0xFBC0,0xAB80,0x0000,
+0xFBC0,0xAB81,0x0000, 0xFBC0,0xAB82,0x0000, 0xFBC0,0xAB83,0x0000,
+0xFBC0,0xAB84,0x0000, 0xFBC0,0xAB85,0x0000, 0xFBC0,0xAB86,0x0000,
+0xFBC0,0xAB87,0x0000, 0xFBC0,0xAB88,0x0000, 0xFBC0,0xAB89,0x0000,
+0xFBC0,0xAB8A,0x0000, 0xFBC0,0xAB8B,0x0000, 0xFBC0,0xAB8C,0x0000,
+0xFBC0,0xAB8D,0x0000, 0xFBC0,0xAB8E,0x0000, 0xFBC0,0xAB8F,0x0000,
+0xFBC0,0xAB90,0x0000, 0xFBC0,0xAB91,0x0000, 0xFBC0,0xAB92,0x0000,
+0xFBC0,0xAB93,0x0000, 0xFBC0,0xAB94,0x0000, 0xFBC0,0xAB95,0x0000,
+0xFBC0,0xAB96,0x0000, 0xFBC0,0xAB97,0x0000, 0xFBC0,0xAB98,0x0000,
+0xFBC0,0xAB99,0x0000, 0xFBC0,0xAB9A,0x0000, 0xFBC0,0xAB9B,0x0000,
+0xFBC0,0xAB9C,0x0000, 0xFBC0,0xAB9D,0x0000, 0xFBC0,0xAB9E,0x0000,
+0xFBC0,0xAB9F,0x0000, 0xFBC0,0xABA0,0x0000, 0xFBC0,0xABA1,0x0000,
+0xFBC0,0xABA2,0x0000, 0xFBC0,0xABA3,0x0000, 0xFBC0,0xABA4,0x0000,
+0xFBC0,0xABA5,0x0000, 0xFBC0,0xABA6,0x0000, 0xFBC0,0xABA7,0x0000,
+0xFBC0,0xABA8,0x0000, 0xFBC0,0xABA9,0x0000, 0xFBC0,0xABAA,0x0000,
+0xFBC0,0xABAB,0x0000, 0xFBC0,0xABAC,0x0000, 0xFBC0,0xABAD,0x0000,
+0xFBC0,0xABAE,0x0000, 0xFBC0,0xABAF,0x0000, 0xFBC0,0xABB0,0x0000,
+0xFBC0,0xABB1,0x0000, 0xFBC0,0xABB2,0x0000, 0xFBC0,0xABB3,0x0000,
+0xFBC0,0xABB4,0x0000, 0xFBC0,0xABB5,0x0000, 0xFBC0,0xABB6,0x0000,
+0xFBC0,0xABB7,0x0000, 0xFBC0,0xABB8,0x0000, 0xFBC0,0xABB9,0x0000,
+0xFBC0,0xABBA,0x0000, 0xFBC0,0xABBB,0x0000, 0xFBC0,0xABBC,0x0000,
+0xFBC0,0xABBD,0x0000, 0xFBC0,0xABBE,0x0000, 0xFBC0,0xABBF,0x0000,
+0xFBC0,0xABC0,0x0000, 0xFBC0,0xABC1,0x0000, 0xFBC0,0xABC2,0x0000,
+0xFBC0,0xABC3,0x0000, 0xFBC0,0xABC4,0x0000, 0xFBC0,0xABC5,0x0000,
+0xFBC0,0xABC6,0x0000, 0xFBC0,0xABC7,0x0000, 0xFBC0,0xABC8,0x0000,
+0xFBC0,0xABC9,0x0000, 0xFBC0,0xABCA,0x0000, 0xFBC0,0xABCB,0x0000,
+0xFBC0,0xABCC,0x0000, 0xFBC0,0xABCD,0x0000, 0xFBC0,0xABCE,0x0000,
+0xFBC0,0xABCF,0x0000, 0xFBC0,0xABD0,0x0000, 0xFBC0,0xABD1,0x0000,
+0xFBC0,0xABD2,0x0000, 0xFBC0,0xABD3,0x0000, 0xFBC0,0xABD4,0x0000,
+0xFBC0,0xABD5,0x0000, 0xFBC0,0xABD6,0x0000, 0xFBC0,0xABD7,0x0000,
+0xFBC0,0xABD8,0x0000, 0xFBC0,0xABD9,0x0000, 0xFBC0,0xABDA,0x0000,
+0xFBC0,0xABDB,0x0000, 0xFBC0,0xABDC,0x0000, 0xFBC0,0xABDD,0x0000,
+0xFBC0,0xABDE,0x0000, 0xFBC0,0xABDF,0x0000, 0xFBC0,0xABE0,0x0000,
+0xFBC0,0xABE1,0x0000, 0xFBC0,0xABE2,0x0000, 0xFBC0,0xABE3,0x0000,
+0xFBC0,0xABE4,0x0000, 0xFBC0,0xABE5,0x0000, 0xFBC0,0xABE6,0x0000,
+0xFBC0,0xABE7,0x0000, 0xFBC0,0xABE8,0x0000, 0xFBC0,0xABE9,0x0000,
+0xFBC0,0xABEA,0x0000, 0xFBC0,0xABEB,0x0000, 0xFBC0,0xABEC,0x0000,
+0xFBC0,0xABED,0x0000, 0xFBC0,0xABEE,0x0000, 0xFBC0,0xABEF,0x0000,
+0xFBC0,0xABF0,0x0000, 0xFBC0,0xABF1,0x0000, 0xFBC0,0xABF2,0x0000,
+0xFBC0,0xABF3,0x0000, 0xFBC0,0xABF4,0x0000, 0xFBC0,0xABF5,0x0000,
+0xFBC0,0xABF6,0x0000, 0xFBC0,0xABF7,0x0000, 0xFBC0,0xABF8,0x0000,
+0xFBC0,0xABF9,0x0000, 0xFBC0,0xABFA,0x0000, 0xFBC0,0xABFB,0x0000,
+0xFBC0,0xABFC,0x0000, 0xFBC0,0xABFD,0x0000, 0xFBC0,0xABFE,0x0000,
+0xFBC0,0xABFF,0x0000 };
+
+uint16 page02Edata[]= { /* 2E00 (3 weights per char) */
+0xFBC0,0xAE00,0x0000, 0xFBC0,0xAE01,0x0000, 0xFBC0,0xAE02,0x0000,
+0xFBC0,0xAE03,0x0000, 0xFBC0,0xAE04,0x0000, 0xFBC0,0xAE05,0x0000,
+0xFBC0,0xAE06,0x0000, 0xFBC0,0xAE07,0x0000, 0xFBC0,0xAE08,0x0000,
+0xFBC0,0xAE09,0x0000, 0xFBC0,0xAE0A,0x0000, 0xFBC0,0xAE0B,0x0000,
+0xFBC0,0xAE0C,0x0000, 0xFBC0,0xAE0D,0x0000, 0xFBC0,0xAE0E,0x0000,
+0xFBC0,0xAE0F,0x0000, 0xFBC0,0xAE10,0x0000, 0xFBC0,0xAE11,0x0000,
+0xFBC0,0xAE12,0x0000, 0xFBC0,0xAE13,0x0000, 0xFBC0,0xAE14,0x0000,
+0xFBC0,0xAE15,0x0000, 0xFBC0,0xAE16,0x0000, 0xFBC0,0xAE17,0x0000,
+0xFBC0,0xAE18,0x0000, 0xFBC0,0xAE19,0x0000, 0xFBC0,0xAE1A,0x0000,
+0xFBC0,0xAE1B,0x0000, 0xFBC0,0xAE1C,0x0000, 0xFBC0,0xAE1D,0x0000,
+0xFBC0,0xAE1E,0x0000, 0xFBC0,0xAE1F,0x0000, 0xFBC0,0xAE20,0x0000,
+0xFBC0,0xAE21,0x0000, 0xFBC0,0xAE22,0x0000, 0xFBC0,0xAE23,0x0000,
+0xFBC0,0xAE24,0x0000, 0xFBC0,0xAE25,0x0000, 0xFBC0,0xAE26,0x0000,
+0xFBC0,0xAE27,0x0000, 0xFBC0,0xAE28,0x0000, 0xFBC0,0xAE29,0x0000,
+0xFBC0,0xAE2A,0x0000, 0xFBC0,0xAE2B,0x0000, 0xFBC0,0xAE2C,0x0000,
+0xFBC0,0xAE2D,0x0000, 0xFBC0,0xAE2E,0x0000, 0xFBC0,0xAE2F,0x0000,
+0xFBC0,0xAE30,0x0000, 0xFBC0,0xAE31,0x0000, 0xFBC0,0xAE32,0x0000,
+0xFBC0,0xAE33,0x0000, 0xFBC0,0xAE34,0x0000, 0xFBC0,0xAE35,0x0000,
+0xFBC0,0xAE36,0x0000, 0xFBC0,0xAE37,0x0000, 0xFBC0,0xAE38,0x0000,
+0xFBC0,0xAE39,0x0000, 0xFBC0,0xAE3A,0x0000, 0xFBC0,0xAE3B,0x0000,
+0xFBC0,0xAE3C,0x0000, 0xFBC0,0xAE3D,0x0000, 0xFBC0,0xAE3E,0x0000,
+0xFBC0,0xAE3F,0x0000, 0xFBC0,0xAE40,0x0000, 0xFBC0,0xAE41,0x0000,
+0xFBC0,0xAE42,0x0000, 0xFBC0,0xAE43,0x0000, 0xFBC0,0xAE44,0x0000,
+0xFBC0,0xAE45,0x0000, 0xFBC0,0xAE46,0x0000, 0xFBC0,0xAE47,0x0000,
+0xFBC0,0xAE48,0x0000, 0xFBC0,0xAE49,0x0000, 0xFBC0,0xAE4A,0x0000,
+0xFBC0,0xAE4B,0x0000, 0xFBC0,0xAE4C,0x0000, 0xFBC0,0xAE4D,0x0000,
+0xFBC0,0xAE4E,0x0000, 0xFBC0,0xAE4F,0x0000, 0xFBC0,0xAE50,0x0000,
+0xFBC0,0xAE51,0x0000, 0xFBC0,0xAE52,0x0000, 0xFBC0,0xAE53,0x0000,
+0xFBC0,0xAE54,0x0000, 0xFBC0,0xAE55,0x0000, 0xFBC0,0xAE56,0x0000,
+0xFBC0,0xAE57,0x0000, 0xFBC0,0xAE58,0x0000, 0xFBC0,0xAE59,0x0000,
+0xFBC0,0xAE5A,0x0000, 0xFBC0,0xAE5B,0x0000, 0xFBC0,0xAE5C,0x0000,
+0xFBC0,0xAE5D,0x0000, 0xFBC0,0xAE5E,0x0000, 0xFBC0,0xAE5F,0x0000,
+0xFBC0,0xAE60,0x0000, 0xFBC0,0xAE61,0x0000, 0xFBC0,0xAE62,0x0000,
+0xFBC0,0xAE63,0x0000, 0xFBC0,0xAE64,0x0000, 0xFBC0,0xAE65,0x0000,
+0xFBC0,0xAE66,0x0000, 0xFBC0,0xAE67,0x0000, 0xFBC0,0xAE68,0x0000,
+0xFBC0,0xAE69,0x0000, 0xFBC0,0xAE6A,0x0000, 0xFBC0,0xAE6B,0x0000,
+0xFBC0,0xAE6C,0x0000, 0xFBC0,0xAE6D,0x0000, 0xFBC0,0xAE6E,0x0000,
+0xFBC0,0xAE6F,0x0000, 0xFBC0,0xAE70,0x0000, 0xFBC0,0xAE71,0x0000,
+0xFBC0,0xAE72,0x0000, 0xFBC0,0xAE73,0x0000, 0xFBC0,0xAE74,0x0000,
+0xFBC0,0xAE75,0x0000, 0xFBC0,0xAE76,0x0000, 0xFBC0,0xAE77,0x0000,
+0xFBC0,0xAE78,0x0000, 0xFBC0,0xAE79,0x0000, 0xFBC0,0xAE7A,0x0000,
+0xFBC0,0xAE7B,0x0000, 0xFBC0,0xAE7C,0x0000, 0xFBC0,0xAE7D,0x0000,
+0xFBC0,0xAE7E,0x0000, 0xFBC0,0xAE7F,0x0000, 0xFB40,0xCE36,0x0000,
+0xFB40,0xD382,0x0000, 0xFB40,0xCE5B,0x0000, 0xFB40,0xCE5A,0x0000,
+0xFB40,0xCE59,0x0000, 0xFB40,0xCEBB,0x0000, 0xFB40,0xD182,0x0000,
+0xFB40,0xD1E0,0x0000, 0xFB40,0xD200,0x0000, 0xFB40,0xD202,0x0000,
+0xFB40,0xD35C,0x0000, 0xFB40,0xD369,0x0000, 0xFB40,0xDC0F,0x0000,
+0xFB40,0xDC0F,0x0000, 0xFB40,0xDC22,0x0000, 0xFB40,0xDC23,0x0000,
+0xFB40,0xDC22,0x0000, 0xFB40,0xDC23,0x0000, 0xFB40,0xDDF3,0x0000,
+0xFB40,0xDE7A,0x0000, 0xFB40,0xDF51,0x0000, 0xFB40,0xDF50,0x0000,
+0xFB40,0xDFC4,0x0000, 0xFB40,0xDFC3,0x0000, 0xFB40,0xE24C,0x0000,
+0xFB40,0xE535,0x0000, 0xFBC0,0xAE9A,0x0000, 0xFB40,0xE5E1,0x0000,
+0xFB40,0xE5E5,0x0000, 0xFB40,0xE708,0x0000, 0xFB40,0xEB7A,0x0000,
+0xFB40,0xEBCD,0x0000, 0xFB40,0xEC11,0x0000, 0xFB40,0xEC35,0x0000,
+0xFB40,0xEC3A,0x0000, 0xFB40,0xF06C,0x0000, 0xFB40,0xF22B,0x0000,
+0xFB40,0xF22B,0x0000, 0xFB40,0xCE2C,0x0000, 0xFB40,0xF25B,0x0000,
+0xFB40,0xF2AD,0x0000, 0xFB40,0xF38B,0x0000, 0xFB40,0xF58B,0x0000,
+0xFB40,0xF6EE,0x0000, 0xFB40,0xF93A,0x0000, 0xFB40,0xF93B,0x0000,
+0xFB40,0xFAF9,0x0000, 0xFB40,0xFCF9,0x0000, 0xFB40,0xFE9F,0x0000,
+0xFB40,0xFF53,0x0000, 0xFB40,0xFF52,0x0000, 0xFB40,0xFF53,0x0000,
+0xFB40,0xFF53,0x0000, 0xFB40,0xFF52,0x0000, 0xFB40,0xFF8A,0x0000,
+0xFB40,0xFF8A,0x0000, 0xFB40,0xFF8B,0x0000, 0xFB41,0x8002,0x0000,
+0xFB41,0x8080,0x0000, 0xFB41,0x807F,0x0000, 0xFB41,0x8089,0x0000,
+0xFB41,0x81FC,0x0000, 0xFB41,0x8279,0x0000, 0xFB41,0x8279,0x0000,
+0xFB41,0x8279,0x0000, 0xFB41,0x864E,0x0000, 0xFB41,0x8864,0x0000,
+0xFB41,0x8980,0x0000, 0xFB41,0x897F,0x0000, 0xFB41,0x89C1,0x0000,
+0xFB41,0x89D2,0x0000, 0xFB41,0x89D2,0x0000, 0xFB41,0x8BA0,0x0000,
+0xFB41,0x8D1D,0x0000, 0xFB41,0x8DB3,0x0000, 0xFB41,0x8F66,0x0000,
+0xFB41,0x8FB6,0x0000, 0xFB41,0x8FB6,0x0000, 0xFB41,0x8FB6,0x0000,
+0xFB41,0x9091,0x0000, 0xFB41,0x9485,0x0000, 0xFB41,0x9577,0x0000,
+0xFB41,0x9578,0x0000, 0xFB41,0x957F,0x0000, 0xFB41,0x95E8,0x0000,
+0xFB41,0x961C,0x0000, 0xFB41,0x961D,0x0000, 0xFB41,0x96E8,0x0000,
+0xFB41,0x9752,0x0000, 0xFB41,0x97E6,0x0000, 0xFB41,0x9875,0x0000,
+0xFB41,0x98CE,0x0000, 0xFB41,0x98DE,0x0000, 0xFB41,0x98DF,0x0000,
+0xFB41,0x98E0,0x0000, 0xFB41,0x98E0,0x0000, 0xFB41,0x9963,0x0000,
+0xFB41,0x9996,0x0000, 0xFB41,0x9A6C,0x0000, 0xFB41,0x9AA8,0x0000,
+0xFB41,0x9B3C,0x0000, 0xFB41,0x9C7C,0x0000, 0xFB41,0x9E1F,0x0000,
+0xFB41,0x9E75,0x0000, 0xFB41,0x9EA6,0x0000, 0xFB41,0x9EC4,0x0000,
+0xFB41,0x9EFE,0x0000, 0xFB41,0x9F4A,0x0000, 0xFB41,0x9F50,0x0000,
+0xFB41,0x9F52,0x0000, 0xFB41,0x9F7F,0x0000, 0xFB41,0x9F8D,0x0000,
+0xFB41,0x9F99,0x0000, 0xFB41,0x9F9C,0x0000, 0xFB41,0x9F9C,0x0000,
+0xFB41,0x9F9F,0x0000, 0xFBC0,0xAEF4,0x0000, 0xFBC0,0xAEF5,0x0000,
+0xFBC0,0xAEF6,0x0000, 0xFBC0,0xAEF7,0x0000, 0xFBC0,0xAEF8,0x0000,
+0xFBC0,0xAEF9,0x0000, 0xFBC0,0xAEFA,0x0000, 0xFBC0,0xAEFB,0x0000,
+0xFBC0,0xAEFC,0x0000, 0xFBC0,0xAEFD,0x0000, 0xFBC0,0xAEFE,0x0000,
+0xFBC0,0xAEFF,0x0000 };
+
+uint16 page02Fdata[]= { /* 2F00 (3 weights per char) */
+0xFB40,0xCE00,0x0000, 0xFB40,0xCE28,0x0000, 0xFB40,0xCE36,0x0000,
+0xFB40,0xCE3F,0x0000, 0xFB40,0xCE59,0x0000, 0xFB40,0xCE85,0x0000,
+0xFB40,0xCE8C,0x0000, 0xFB40,0xCEA0,0x0000, 0xFB40,0xCEBA,0x0000,
+0xFB40,0xD13F,0x0000, 0xFB40,0xD165,0x0000, 0xFB40,0xD16B,0x0000,
+0xFB40,0xD182,0x0000, 0xFB40,0xD196,0x0000, 0xFB40,0xD1AB,0x0000,
+0xFB40,0xD1E0,0x0000, 0xFB40,0xD1F5,0x0000, 0xFB40,0xD200,0x0000,
+0xFB40,0xD29B,0x0000, 0xFB40,0xD2F9,0x0000, 0xFB40,0xD315,0x0000,
+0xFB40,0xD31A,0x0000, 0xFB40,0xD338,0x0000, 0xFB40,0xD341,0x0000,
+0xFB40,0xD35C,0x0000, 0xFB40,0xD369,0x0000, 0xFB40,0xD382,0x0000,
+0xFB40,0xD3B6,0x0000, 0xFB40,0xD3C8,0x0000, 0xFB40,0xD3E3,0x0000,
+0xFB40,0xD6D7,0x0000, 0xFB40,0xD71F,0x0000, 0xFB40,0xD8EB,0x0000,
+0xFB40,0xD902,0x0000, 0xFB40,0xD90A,0x0000, 0xFB40,0xD915,0x0000,
+0xFB40,0xD927,0x0000, 0xFB40,0xD973,0x0000, 0xFB40,0xDB50,0x0000,
+0xFB40,0xDB80,0x0000, 0xFB40,0xDBF8,0x0000, 0xFB40,0xDC0F,0x0000,
+0xFB40,0xDC22,0x0000, 0xFB40,0xDC38,0x0000, 0xFB40,0xDC6E,0x0000,
+0xFB40,0xDC71,0x0000, 0xFB40,0xDDDB,0x0000, 0xFB40,0xDDE5,0x0000,
+0xFB40,0xDDF1,0x0000, 0xFB40,0xDDFE,0x0000, 0xFB40,0xDE72,0x0000,
+0xFB40,0xDE7A,0x0000, 0xFB40,0xDE7F,0x0000, 0xFB40,0xDEF4,0x0000,
+0xFB40,0xDEFE,0x0000, 0xFB40,0xDF0B,0x0000, 0xFB40,0xDF13,0x0000,
+0xFB40,0xDF50,0x0000, 0xFB40,0xDF61,0x0000, 0xFB40,0xDF73,0x0000,
+0xFB40,0xDFC3,0x0000, 0xFB40,0xE208,0x0000, 0xFB40,0xE236,0x0000,
+0xFB40,0xE24B,0x0000, 0xFB40,0xE52F,0x0000, 0xFB40,0xE534,0x0000,
+0xFB40,0xE587,0x0000, 0xFB40,0xE597,0x0000, 0xFB40,0xE5A4,0x0000,
+0xFB40,0xE5B9,0x0000, 0xFB40,0xE5E0,0x0000, 0xFB40,0xE5E5,0x0000,
+0xFB40,0xE6F0,0x0000, 0xFB40,0xE708,0x0000, 0xFB40,0xE728,0x0000,
+0xFB40,0xEB20,0x0000, 0xFB40,0xEB62,0x0000, 0xFB40,0xEB79,0x0000,
+0xFB40,0xEBB3,0x0000, 0xFB40,0xEBCB,0x0000, 0xFB40,0xEBD4,0x0000,
+0xFB40,0xEBDB,0x0000, 0xFB40,0xEC0F,0x0000, 0xFB40,0xEC14,0x0000,
+0xFB40,0xEC34,0x0000, 0xFB40,0xF06B,0x0000, 0xFB40,0xF22A,0x0000,
+0xFB40,0xF236,0x0000, 0xFB40,0xF23B,0x0000, 0xFB40,0xF23F,0x0000,
+0xFB40,0xF247,0x0000, 0xFB40,0xF259,0x0000, 0xFB40,0xF25B,0x0000,
+0xFB40,0xF2AC,0x0000, 0xFB40,0xF384,0x0000, 0xFB40,0xF389,0x0000,
+0xFB40,0xF4DC,0x0000, 0xFB40,0xF4E6,0x0000, 0xFB40,0xF518,0x0000,
+0xFB40,0xF51F,0x0000, 0xFB40,0xF528,0x0000, 0xFB40,0xF530,0x0000,
+0xFB40,0xF58B,0x0000, 0xFB40,0xF592,0x0000, 0xFB40,0xF676,0x0000,
+0xFB40,0xF67D,0x0000, 0xFB40,0xF6AE,0x0000, 0xFB40,0xF6BF,0x0000,
+0xFB40,0xF6EE,0x0000, 0xFB40,0xF7DB,0x0000, 0xFB40,0xF7E2,0x0000,
+0xFB40,0xF7F3,0x0000, 0xFB40,0xF93A,0x0000, 0xFB40,0xF9B8,0x0000,
+0xFB40,0xF9BE,0x0000, 0xFB40,0xFA74,0x0000, 0xFB40,0xFACB,0x0000,
+0xFB40,0xFAF9,0x0000, 0xFB40,0xFC73,0x0000, 0xFB40,0xFCF8,0x0000,
+0xFB40,0xFF36,0x0000, 0xFB40,0xFF51,0x0000, 0xFB40,0xFF8A,0x0000,
+0xFB40,0xFFBD,0x0000, 0xFB41,0x8001,0x0000, 0xFB41,0x800C,0x0000,
+0xFB41,0x8012,0x0000, 0xFB41,0x8033,0x0000, 0xFB41,0x807F,0x0000,
+0xFB41,0x8089,0x0000, 0xFB41,0x81E3,0x0000, 0xFB41,0x81EA,0x0000,
+0xFB41,0x81F3,0x0000, 0xFB41,0x81FC,0x0000, 0xFB41,0x820C,0x0000,
+0xFB41,0x821B,0x0000, 0xFB41,0x821F,0x0000, 0xFB41,0x826E,0x0000,
+0xFB41,0x8272,0x0000, 0xFB41,0x8278,0x0000, 0xFB41,0x864D,0x0000,
+0xFB41,0x866B,0x0000, 0xFB41,0x8840,0x0000, 0xFB41,0x884C,0x0000,
+0xFB41,0x8863,0x0000, 0xFB41,0x897E,0x0000, 0xFB41,0x898B,0x0000,
+0xFB41,0x89D2,0x0000, 0xFB41,0x8A00,0x0000, 0xFB41,0x8C37,0x0000,
+0xFB41,0x8C46,0x0000, 0xFB41,0x8C55,0x0000, 0xFB41,0x8C78,0x0000,
+0xFB41,0x8C9D,0x0000, 0xFB41,0x8D64,0x0000, 0xFB41,0x8D70,0x0000,
+0xFB41,0x8DB3,0x0000, 0xFB41,0x8EAB,0x0000, 0xFB41,0x8ECA,0x0000,
+0xFB41,0x8F9B,0x0000, 0xFB41,0x8FB0,0x0000, 0xFB41,0x8FB5,0x0000,
+0xFB41,0x9091,0x0000, 0xFB41,0x9149,0x0000, 0xFB41,0x91C6,0x0000,
+0xFB41,0x91CC,0x0000, 0xFB41,0x91D1,0x0000, 0xFB41,0x9577,0x0000,
+0xFB41,0x9580,0x0000, 0xFB41,0x961C,0x0000, 0xFB41,0x96B6,0x0000,
+0xFB41,0x96B9,0x0000, 0xFB41,0x96E8,0x0000, 0xFB41,0x9751,0x0000,
+0xFB41,0x975E,0x0000, 0xFB41,0x9762,0x0000, 0xFB41,0x9769,0x0000,
+0xFB41,0x97CB,0x0000, 0xFB41,0x97ED,0x0000, 0xFB41,0x97F3,0x0000,
+0xFB41,0x9801,0x0000, 0xFB41,0x98A8,0x0000, 0xFB41,0x98DB,0x0000,
+0xFB41,0x98DF,0x0000, 0xFB41,0x9996,0x0000, 0xFB41,0x9999,0x0000,
+0xFB41,0x99AC,0x0000, 0xFB41,0x9AA8,0x0000, 0xFB41,0x9AD8,0x0000,
+0xFB41,0x9ADF,0x0000, 0xFB41,0x9B25,0x0000, 0xFB41,0x9B2F,0x0000,
+0xFB41,0x9B32,0x0000, 0xFB41,0x9B3C,0x0000, 0xFB41,0x9B5A,0x0000,
+0xFB41,0x9CE5,0x0000, 0xFB41,0x9E75,0x0000, 0xFB41,0x9E7F,0x0000,
+0xFB41,0x9EA5,0x0000, 0xFB41,0x9EBB,0x0000, 0xFB41,0x9EC3,0x0000,
+0xFB41,0x9ECD,0x0000, 0xFB41,0x9ED1,0x0000, 0xFB41,0x9EF9,0x0000,
+0xFB41,0x9EFD,0x0000, 0xFB41,0x9F0E,0x0000, 0xFB41,0x9F13,0x0000,
+0xFB41,0x9F20,0x0000, 0xFB41,0x9F3B,0x0000, 0xFB41,0x9F4A,0x0000,
+0xFB41,0x9F52,0x0000, 0xFB41,0x9F8D,0x0000, 0xFB41,0x9F9C,0x0000,
+0xFB41,0x9FA0,0x0000, 0xFBC0,0xAFD6,0x0000, 0xFBC0,0xAFD7,0x0000,
+0xFBC0,0xAFD8,0x0000, 0xFBC0,0xAFD9,0x0000, 0xFBC0,0xAFDA,0x0000,
+0xFBC0,0xAFDB,0x0000, 0xFBC0,0xAFDC,0x0000, 0xFBC0,0xAFDD,0x0000,
+0xFBC0,0xAFDE,0x0000, 0xFBC0,0xAFDF,0x0000, 0xFBC0,0xAFE0,0x0000,
+0xFBC0,0xAFE1,0x0000, 0xFBC0,0xAFE2,0x0000, 0xFBC0,0xAFE3,0x0000,
+0xFBC0,0xAFE4,0x0000, 0xFBC0,0xAFE5,0x0000, 0xFBC0,0xAFE6,0x0000,
+0xFBC0,0xAFE7,0x0000, 0xFBC0,0xAFE8,0x0000, 0xFBC0,0xAFE9,0x0000,
+0xFBC0,0xAFEA,0x0000, 0xFBC0,0xAFEB,0x0000, 0xFBC0,0xAFEC,0x0000,
+0xFBC0,0xAFED,0x0000, 0xFBC0,0xAFEE,0x0000, 0xFBC0,0xAFEF,0x0000,
+0x0DAF,0x0000,0x0000, 0x0DB0,0x0000,0x0000, 0x0DB1,0x0000,0x0000,
+0x0DB2,0x0000,0x0000, 0x0DB3,0x0000,0x0000, 0x0DB4,0x0000,0x0000,
+0x0DB5,0x0000,0x0000, 0x0DB6,0x0000,0x0000, 0x0DB7,0x0000,0x0000,
+0x0DB8,0x0000,0x0000, 0x0DB9,0x0000,0x0000, 0x0DBA,0x0000,0x0000,
+0xFBC0,0xAFFC,0x0000, 0xFBC0,0xAFFD,0x0000, 0xFBC0,0xAFFE,0x0000,
+0xFBC0,0xAFFF,0x0000 };
+
+uint16 page030data[]= { /* 3000 (3 weights per char) */
+0x0209,0x0000,0x0000, 0x0237,0x0000,0x0000, 0x0266,0x0000,0x0000,
+0x02E2,0x0000,0x0000, 0x0DBB,0x0000,0x0000, 0x0E05,0x0000,0x0000,
+0x1E5D,0x1E73,0x0000, 0x0E29,0x0000,0x0000, 0x02AE,0x0000,0x0000,
+0x02AF,0x0000,0x0000, 0x02B0,0x0000,0x0000, 0x02B1,0x0000,0x0000,
+0x02B2,0x0000,0x0000, 0x02B3,0x0000,0x0000, 0x02B4,0x0000,0x0000,
+0x02B5,0x0000,0x0000, 0x02B6,0x0000,0x0000, 0x02B7,0x0000,0x0000,
+0x0DBC,0x0000,0x0000, 0x0DBD,0x0000,0x0000, 0x02B8,0x0000,0x0000,
+0x02B9,0x0000,0x0000, 0x02BA,0x0000,0x0000, 0x02BB,0x0000,0x0000,
+0x02BC,0x0000,0x0000, 0x02BD,0x0000,0x0000, 0x02BE,0x0000,0x0000,
+0x02BF,0x0000,0x0000, 0x022B,0x0000,0x0000, 0x0283,0x0000,0x0000,
+0x0284,0x0000,0x0000, 0x0285,0x0000,0x0000, 0x0DBE,0x0000,0x0000,
+0x0E2A,0x0000,0x0000, 0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000,
+0x0E2D,0x0000,0x0000, 0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000,
+0x0E30,0x0000,0x0000, 0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x022C,0x0000,0x0000, 0x0E07,0x0000,0x0000, 0x0E07,0x0000,0x0000,
+0x0E08,0x0000,0x0000, 0x0E08,0x0000,0x0000, 0x0E09,0x0000,0x0000,
+0x0DBC,0x0000,0x0000, 0x0DBF,0x0000,0x0000, 0xFB40,0xD341,0x0000,
+0xFB40,0xD344,0x0000, 0xFB40,0xD345,0x0000, 0x0E06,0x0000,0x0000,
+0x1E70,0x1E5E,0x0000, 0x02E3,0x0000,0x0000, 0x0DC0,0x0000,0x0000,
+0x0DC1,0x0000,0x0000, 0xFBC0,0xB040,0x0000, 0x1E52,0x0000,0x0000,
+0x1E52,0x0000,0x0000, 0x1E53,0x0000,0x0000, 0x1E53,0x0000,0x0000,
+0x1E54,0x0000,0x0000, 0x1E54,0x0000,0x0000, 0x1E55,0x0000,0x0000,
+0x1E55,0x0000,0x0000, 0x1E56,0x0000,0x0000, 0x1E56,0x0000,0x0000,
+0x1E57,0x0000,0x0000, 0x1E57,0x0000,0x0000, 0x1E58,0x0000,0x0000,
+0x1E58,0x0000,0x0000, 0x1E59,0x0000,0x0000, 0x1E59,0x0000,0x0000,
+0x1E5A,0x0000,0x0000, 0x1E5A,0x0000,0x0000, 0x1E5B,0x0000,0x0000,
+0x1E5B,0x0000,0x0000, 0x1E5C,0x0000,0x0000, 0x1E5C,0x0000,0x0000,
+0x1E5D,0x0000,0x0000, 0x1E5D,0x0000,0x0000, 0x1E5E,0x0000,0x0000,
+0x1E5E,0x0000,0x0000, 0x1E5F,0x0000,0x0000, 0x1E5F,0x0000,0x0000,
+0x1E60,0x0000,0x0000, 0x1E60,0x0000,0x0000, 0x1E61,0x0000,0x0000,
+0x1E61,0x0000,0x0000, 0x1E62,0x0000,0x0000, 0x1E62,0x0000,0x0000,
+0x1E63,0x0000,0x0000, 0x1E63,0x0000,0x0000, 0x1E63,0x0000,0x0000,
+0x1E64,0x0000,0x0000, 0x1E64,0x0000,0x0000, 0x1E65,0x0000,0x0000,
+0x1E65,0x0000,0x0000, 0x1E66,0x0000,0x0000, 0x1E67,0x0000,0x0000,
+0x1E68,0x0000,0x0000, 0x1E69,0x0000,0x0000, 0x1E6A,0x0000,0x0000,
+0x1E6B,0x0000,0x0000, 0x1E6B,0x0000,0x0000, 0x1E6B,0x0000,0x0000,
+0x1E6C,0x0000,0x0000, 0x1E6C,0x0000,0x0000, 0x1E6C,0x0000,0x0000,
+0x1E6D,0x0000,0x0000, 0x1E6D,0x0000,0x0000, 0x1E6D,0x0000,0x0000,
+0x1E6E,0x0000,0x0000, 0x1E6E,0x0000,0x0000, 0x1E6E,0x0000,0x0000,
+0x1E6F,0x0000,0x0000, 0x1E6F,0x0000,0x0000, 0x1E6F,0x0000,0x0000,
+0x1E70,0x0000,0x0000, 0x1E71,0x0000,0x0000, 0x1E72,0x0000,0x0000,
+0x1E73,0x0000,0x0000, 0x1E74,0x0000,0x0000, 0x1E75,0x0000,0x0000,
+0x1E75,0x0000,0x0000, 0x1E76,0x0000,0x0000, 0x1E76,0x0000,0x0000,
+0x1E77,0x0000,0x0000, 0x1E77,0x0000,0x0000, 0x1E78,0x0000,0x0000,
+0x1E79,0x0000,0x0000, 0x1E7A,0x0000,0x0000, 0x1E7B,0x0000,0x0000,
+0x1E7C,0x0000,0x0000, 0x1E7D,0x0000,0x0000, 0x1E7D,0x0000,0x0000,
+0x1E7E,0x0000,0x0000, 0x1E7F,0x0000,0x0000, 0x1E80,0x0000,0x0000,
+0x1E81,0x0000,0x0000, 0x1E54,0x0000,0x0000, 0x1E57,0x0000,0x0000,
+0x1E5A,0x0000,0x0000, 0xFBC0,0xB097,0x0000, 0xFBC0,0xB098,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x021E,0x0000,0x0000,
+0x021F,0x0000,0x0000, 0x0E0A,0x0000,0x0000, 0x0E0A,0x0000,0x0000,
+0x1E77,0x1E79,0x0000, 0x022D,0x0000,0x0000, 0x1E52,0x0000,0x0000,
+0x1E52,0x0000,0x0000, 0x1E53,0x0000,0x0000, 0x1E53,0x0000,0x0000,
+0x1E54,0x0000,0x0000, 0x1E54,0x0000,0x0000, 0x1E55,0x0000,0x0000,
+0x1E55,0x0000,0x0000, 0x1E56,0x0000,0x0000, 0x1E56,0x0000,0x0000,
+0x1E57,0x0000,0x0000, 0x1E57,0x0000,0x0000, 0x1E58,0x0000,0x0000,
+0x1E58,0x0000,0x0000, 0x1E59,0x0000,0x0000, 0x1E59,0x0000,0x0000,
+0x1E5A,0x0000,0x0000, 0x1E5A,0x0000,0x0000, 0x1E5B,0x0000,0x0000,
+0x1E5B,0x0000,0x0000, 0x1E5C,0x0000,0x0000, 0x1E5C,0x0000,0x0000,
+0x1E5D,0x0000,0x0000, 0x1E5D,0x0000,0x0000, 0x1E5E,0x0000,0x0000,
+0x1E5E,0x0000,0x0000, 0x1E5F,0x0000,0x0000, 0x1E5F,0x0000,0x0000,
+0x1E60,0x0000,0x0000, 0x1E60,0x0000,0x0000, 0x1E61,0x0000,0x0000,
+0x1E61,0x0000,0x0000, 0x1E62,0x0000,0x0000, 0x1E62,0x0000,0x0000,
+0x1E63,0x0000,0x0000, 0x1E63,0x0000,0x0000, 0x1E63,0x0000,0x0000,
+0x1E64,0x0000,0x0000, 0x1E64,0x0000,0x0000, 0x1E65,0x0000,0x0000,
+0x1E65,0x0000,0x0000, 0x1E66,0x0000,0x0000, 0x1E67,0x0000,0x0000,
+0x1E68,0x0000,0x0000, 0x1E69,0x0000,0x0000, 0x1E6A,0x0000,0x0000,
+0x1E6B,0x0000,0x0000, 0x1E6B,0x0000,0x0000, 0x1E6B,0x0000,0x0000,
+0x1E6C,0x0000,0x0000, 0x1E6C,0x0000,0x0000, 0x1E6C,0x0000,0x0000,
+0x1E6D,0x0000,0x0000, 0x1E6D,0x0000,0x0000, 0x1E6D,0x0000,0x0000,
+0x1E6E,0x0000,0x0000, 0x1E6E,0x0000,0x0000, 0x1E6E,0x0000,0x0000,
+0x1E6F,0x0000,0x0000, 0x1E6F,0x0000,0x0000, 0x1E6F,0x0000,0x0000,
+0x1E70,0x0000,0x0000, 0x1E71,0x0000,0x0000, 0x1E72,0x0000,0x0000,
+0x1E73,0x0000,0x0000, 0x1E74,0x0000,0x0000, 0x1E75,0x0000,0x0000,
+0x1E75,0x0000,0x0000, 0x1E76,0x0000,0x0000, 0x1E76,0x0000,0x0000,
+0x1E77,0x0000,0x0000, 0x1E77,0x0000,0x0000, 0x1E78,0x0000,0x0000,
+0x1E79,0x0000,0x0000, 0x1E7A,0x0000,0x0000, 0x1E7B,0x0000,0x0000,
+0x1E7C,0x0000,0x0000, 0x1E7D,0x0000,0x0000, 0x1E7D,0x0000,0x0000,
+0x1E7E,0x0000,0x0000, 0x1E7F,0x0000,0x0000, 0x1E80,0x0000,0x0000,
+0x1E81,0x0000,0x0000, 0x1E54,0x0000,0x0000, 0x1E57,0x0000,0x0000,
+0x1E5A,0x0000,0x0000, 0x1E7D,0x0000,0x0000, 0x1E7E,0x0000,0x0000,
+0x1E7F,0x0000,0x0000, 0x1E80,0x0000,0x0000, 0x022E,0x0000,0x0000,
+0x0E0B,0x0000,0x0000, 0x0E0C,0x0000,0x0000, 0x0E0C,0x0000,0x0000,
+0x1E5B,0x1E65,0x0000 };
+
+uint16 page031data[]= { /* 3100 (3 weights per char) */
+0xFBC0,0xB100,0x0000, 0xFBC0,0xB101,0x0000, 0xFBC0,0xB102,0x0000,
+0xFBC0,0xB103,0x0000, 0xFBC0,0xB104,0x0000, 0x1E82,0x0000,0x0000,
+0x1E83,0x0000,0x0000, 0x1E84,0x0000,0x0000, 0x1E85,0x0000,0x0000,
+0x1E87,0x0000,0x0000, 0x1E88,0x0000,0x0000, 0x1E89,0x0000,0x0000,
+0x1E8A,0x0000,0x0000, 0x1E8B,0x0000,0x0000, 0x1E8C,0x0000,0x0000,
+0x1E8F,0x0000,0x0000, 0x1E90,0x0000,0x0000, 0x1E91,0x0000,0x0000,
+0x1E92,0x0000,0x0000, 0x1E94,0x0000,0x0000, 0x1E95,0x0000,0x0000,
+0x1E96,0x0000,0x0000, 0x1E97,0x0000,0x0000, 0x1E98,0x0000,0x0000,
+0x1E99,0x0000,0x0000, 0x1E9A,0x0000,0x0000, 0x1E9B,0x0000,0x0000,
+0x1E9C,0x0000,0x0000, 0x1E9E,0x0000,0x0000, 0x1E9F,0x0000,0x0000,
+0x1EA1,0x0000,0x0000, 0x1EA2,0x0000,0x0000, 0x1EA3,0x0000,0x0000,
+0x1EA4,0x0000,0x0000, 0x1EA5,0x0000,0x0000, 0x1EA6,0x0000,0x0000,
+0x1EA7,0x0000,0x0000, 0x1EA9,0x0000,0x0000, 0x1EAD,0x0000,0x0000,
+0x1EAE,0x0000,0x0000, 0x1EAF,0x0000,0x0000, 0x1EB0,0x0000,0x0000,
+0x1E86,0x0000,0x0000, 0x1E8D,0x0000,0x0000, 0x1E93,0x0000,0x0000,
+0xFBC0,0xB12D,0x0000, 0xFBC0,0xB12E,0x0000, 0xFBC0,0xB12F,0x0000,
+0xFBC0,0xB130,0x0000, 0x1D62,0x0000,0x0000, 0x1D63,0x0000,0x0000,
+0x1E02,0x0000,0x0000, 0x1D64,0x0000,0x0000, 0x1E04,0x0000,0x0000,
+0x1E05,0x0000,0x0000, 0x1D65,0x0000,0x0000, 0x1D66,0x0000,0x0000,
+0x1D67,0x0000,0x0000, 0x1E08,0x0000,0x0000, 0x1E09,0x0000,0x0000,
+0x1E0A,0x0000,0x0000, 0x1E0B,0x0000,0x0000, 0x1E0C,0x0000,0x0000,
+0x1E0D,0x0000,0x0000, 0x1D7C,0x0000,0x0000, 0x1D68,0x0000,0x0000,
+0x1D69,0x0000,0x0000, 0x1D6A,0x0000,0x0000, 0x1D83,0x0000,0x0000,
+0x1D6B,0x0000,0x0000, 0x1D6C,0x0000,0x0000, 0x1D6D,0x0000,0x0000,
+0x1D6E,0x0000,0x0000, 0x1D6F,0x0000,0x0000, 0x1D70,0x0000,0x0000,
+0x1D71,0x0000,0x0000, 0x1D72,0x0000,0x0000, 0x1D73,0x0000,0x0000,
+0x1D74,0x0000,0x0000, 0x1DBE,0x0000,0x0000, 0x1DBF,0x0000,0x0000,
+0x1DC0,0x0000,0x0000, 0x1DC1,0x0000,0x0000, 0x1DC2,0x0000,0x0000,
+0x1DC3,0x0000,0x0000, 0x1DC4,0x0000,0x0000, 0x1DC5,0x0000,0x0000,
+0x1DC6,0x0000,0x0000, 0x1DC7,0x0000,0x0000, 0x1DC8,0x0000,0x0000,
+0x1DC9,0x0000,0x0000, 0x1DCA,0x0000,0x0000, 0x1DCB,0x0000,0x0000,
+0x1DCC,0x0000,0x0000, 0x1DCD,0x0000,0x0000, 0x1DCE,0x0000,0x0000,
+0x1DCF,0x0000,0x0000, 0x1DD0,0x0000,0x0000, 0x1DD1,0x0000,0x0000,
+0x1DD2,0x0000,0x0000, 0x1DBD,0x0000,0x0000, 0x1D76,0x0000,0x0000,
+0x1D77,0x0000,0x0000, 0x1E1F,0x0000,0x0000, 0x1E20,0x0000,0x0000,
+0x1E24,0x0000,0x0000, 0x1E26,0x0000,0x0000, 0x1E2B,0x0000,0x0000,
+0x1E2F,0x0000,0x0000, 0x1E31,0x0000,0x0000, 0x1D7E,0x0000,0x0000,
+0x1E35,0x0000,0x0000, 0x1E37,0x0000,0x0000, 0x1D7F,0x0000,0x0000,
+0x1D80,0x0000,0x0000, 0x1D82,0x0000,0x0000, 0x1D84,0x0000,0x0000,
+0x1D85,0x0000,0x0000, 0x1D89,0x0000,0x0000, 0x1D8B,0x0000,0x0000,
+0x1D8D,0x0000,0x0000, 0x1D8E,0x0000,0x0000, 0x1D8F,0x0000,0x0000,
+0x1D90,0x0000,0x0000, 0x1D91,0x0000,0x0000, 0x1D94,0x0000,0x0000,
+0x1D98,0x0000,0x0000, 0x1DA2,0x0000,0x0000, 0x1DA9,0x0000,0x0000,
+0x1DAE,0x0000,0x0000, 0x1E49,0x0000,0x0000, 0x1E4A,0x0000,0x0000,
+0x1DB9,0x0000,0x0000, 0x1DBA,0x0000,0x0000, 0x1DBB,0x0000,0x0000,
+0x1DE1,0x0000,0x0000, 0x1DE2,0x0000,0x0000, 0x1DE5,0x0000,0x0000,
+0x1DEE,0x0000,0x0000, 0x1DEF,0x0000,0x0000, 0x1DF1,0x0000,0x0000,
+0x1DFB,0x0000,0x0000, 0x1DFE,0x0000,0x0000, 0xFBC0,0xB18F,0x0000,
+0x0DC2,0x0000,0x0000, 0x0DC3,0x0000,0x0000, 0xFB40,0xCE00,0x0000,
+0xFB40,0xCE8C,0x0000, 0xFB40,0xCE09,0x0000, 0xFB40,0xD6DB,0x0000,
+0xFB40,0xCE0A,0x0000, 0xFB40,0xCE2D,0x0000, 0xFB40,0xCE0B,0x0000,
+0xFB40,0xF532,0x0000, 0xFB40,0xCE59,0x0000, 0xFB40,0xCE19,0x0000,
+0xFB40,0xCE01,0x0000, 0xFB40,0xD929,0x0000, 0xFB40,0xD730,0x0000,
+0xFB40,0xCEBA,0x0000, 0x1E82,0x0000,0x0000, 0x1E98,0x0000,0x0000,
+0x1E90,0x0000,0x0000, 0x1E8B,0x0000,0x0000, 0x1EA0,0x0000,0x0000,
+0x1EA0,0x0000,0x0000, 0x1E9D,0x0000,0x0000, 0x1E9C,0x0000,0x0000,
+0x1EAF,0x0000,0x0000, 0x1E9B,0x0000,0x0000, 0x1EAE,0x0000,0x0000,
+0x1EAF,0x0000,0x0000, 0x1EAC,0x0000,0x0000, 0x1E8E,0x0000,0x0000,
+0x1EA1,0x0000,0x0000, 0x1EA3,0x0000,0x0000, 0x1EAA,0x0000,0x0000,
+0x1EAB,0x0000,0x0000, 0x1EA8,0x0000,0x0000, 0x1EAE,0x0000,0x0000,
+0x1E83,0x0000,0x0000, 0x1E88,0x0000,0x0000, 0x1E8C,0x0000,0x0000,
+0x1E8F,0x0000,0x0000, 0xFBC0,0xB1B8,0x0000, 0xFBC0,0xB1B9,0x0000,
+0xFBC0,0xB1BA,0x0000, 0xFBC0,0xB1BB,0x0000, 0xFBC0,0xB1BC,0x0000,
+0xFBC0,0xB1BD,0x0000, 0xFBC0,0xB1BE,0x0000, 0xFBC0,0xB1BF,0x0000,
+0xFBC0,0xB1C0,0x0000, 0xFBC0,0xB1C1,0x0000, 0xFBC0,0xB1C2,0x0000,
+0xFBC0,0xB1C3,0x0000, 0xFBC0,0xB1C4,0x0000, 0xFBC0,0xB1C5,0x0000,
+0xFBC0,0xB1C6,0x0000, 0xFBC0,0xB1C7,0x0000, 0xFBC0,0xB1C8,0x0000,
+0xFBC0,0xB1C9,0x0000, 0xFBC0,0xB1CA,0x0000, 0xFBC0,0xB1CB,0x0000,
+0xFBC0,0xB1CC,0x0000, 0xFBC0,0xB1CD,0x0000, 0xFBC0,0xB1CE,0x0000,
+0xFBC0,0xB1CF,0x0000, 0xFBC0,0xB1D0,0x0000, 0xFBC0,0xB1D1,0x0000,
+0xFBC0,0xB1D2,0x0000, 0xFBC0,0xB1D3,0x0000, 0xFBC0,0xB1D4,0x0000,
+0xFBC0,0xB1D5,0x0000, 0xFBC0,0xB1D6,0x0000, 0xFBC0,0xB1D7,0x0000,
+0xFBC0,0xB1D8,0x0000, 0xFBC0,0xB1D9,0x0000, 0xFBC0,0xB1DA,0x0000,
+0xFBC0,0xB1DB,0x0000, 0xFBC0,0xB1DC,0x0000, 0xFBC0,0xB1DD,0x0000,
+0xFBC0,0xB1DE,0x0000, 0xFBC0,0xB1DF,0x0000, 0xFBC0,0xB1E0,0x0000,
+0xFBC0,0xB1E1,0x0000, 0xFBC0,0xB1E2,0x0000, 0xFBC0,0xB1E3,0x0000,
+0xFBC0,0xB1E4,0x0000, 0xFBC0,0xB1E5,0x0000, 0xFBC0,0xB1E6,0x0000,
+0xFBC0,0xB1E7,0x0000, 0xFBC0,0xB1E8,0x0000, 0xFBC0,0xB1E9,0x0000,
+0xFBC0,0xB1EA,0x0000, 0xFBC0,0xB1EB,0x0000, 0xFBC0,0xB1EC,0x0000,
+0xFBC0,0xB1ED,0x0000, 0xFBC0,0xB1EE,0x0000, 0xFBC0,0xB1EF,0x0000,
+0x1E59,0x0000,0x0000, 0x1E5D,0x0000,0x0000, 0x1E5E,0x0000,0x0000,
+0x1E65,0x0000,0x0000, 0x1E68,0x0000,0x0000, 0x1E6B,0x0000,0x0000,
+0x1E6C,0x0000,0x0000, 0x1E6D,0x0000,0x0000, 0x1E6E,0x0000,0x0000,
+0x1E6F,0x0000,0x0000, 0x1E72,0x0000,0x0000, 0x1E78,0x0000,0x0000,
+0x1E79,0x0000,0x0000, 0x1E7A,0x0000,0x0000, 0x1E7B,0x0000,0x0000,
+0x1E7C,0x0000,0x0000 };
+
+uint16 page032data[]= { /* 3200 (8 weights per char) */
+0x0288,0x1D62,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D64,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D65,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D67,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D68,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D69,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D6B,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D6D,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D6E,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D70,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D71,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D72,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D73,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D74,0x0289,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D62,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D64,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D65,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D67,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D68,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D69,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D6B,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D6D,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D6E,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D70,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D71,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D72,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D73,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D74,0x1DBE,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D6E,0x1DCB,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0x1D6D,0x1DC6,0x1D6E,0x1DC2,0x1E03,0x0289,0x0000,
+0x0288,0x1D6D,0x1DC6,0x1D74,0x1DCB,0x0289,0x0000,0x0000,
+0xFBC0,0xB21F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xCE00,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xCE8C,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xCE09,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xD6DB,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xCE94,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xD16D,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xCE03,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xD16B,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xCE5D,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xD341,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xE708,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xF06B,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xEC34,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xE728,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB41,0x91D1,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xD71F,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xE5E5,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xE82A,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xE709,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xF93E,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xD40D,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xF279,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB41,0x8CA1,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xF95D,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xD2B4,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xCEE3,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xD47C,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xDB66,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xF6E3,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xCF01,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB41,0x8CC7,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xD354,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xF96D,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB40,0xCF11,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB41,0x81EA,0x0289,0x0000,0x0000,0x0000,0x0000,
+0x0288,0xFB41,0x81F3,0x0289,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB244,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB245,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB246,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB247,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB248,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB249,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB24A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB24B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB24C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB24D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB24E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB24F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x1002,0x0E8B,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E30,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E31,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E32,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E29,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E2A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E2D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D62,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D64,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D67,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D68,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D69,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D6B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D6D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D6E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D70,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D71,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D72,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D73,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D74,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D62,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D64,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D65,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D67,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D68,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D69,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D6B,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D6D,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D6E,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D70,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D71,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D72,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D73,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D74,0x1DBE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1D70,0x1DBE,0x1E0F,0x1D62,0x1DC6,0x0000,0x0000,0x0000,
+0x1D6E,0x1DCB,0x1D6D,0x1DD1,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB27E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0DC4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCE00,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCE8C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCE09,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD6DB,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCE94,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD16D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCE03,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD16B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCE5D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD341,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xF06B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xEC34,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xE728,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB41,0x91D1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD71F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xE82A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xE709,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xF93E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD40D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xF279,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB41,0x8CA1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xF95D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD2B4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xF9D8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xF537,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD973,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB41,0x9069,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD12A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD370,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xECE8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB41,0x9805,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCF11,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD199,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xEB63,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCE0A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCE2D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCE0B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xDDE6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD3F3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD33B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xDB97,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xDB66,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xF6E3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xCF01,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB41,0x8CC7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD354,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD91C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E2F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E30,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E31,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E32,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0E29,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0E2A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0E2D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0E2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0E2F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0E30,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0E31,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0x0E32,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2E,0x0E29,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2E,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2F,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E30,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E31,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E32,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E29,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2A,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2B,0xFB40,0xE708,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E8B,0x0FC0,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E8B,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F2E,0x1002,0x0E6D,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E52,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E53,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E54,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E55,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E56,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E57,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E58,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E59,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E60,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E61,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E62,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E63,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E64,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E66,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E67,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E68,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E69,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E70,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E71,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E72,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E73,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E74,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E75,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E76,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E77,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E78,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E79,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E7B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E7C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E7D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E7E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E7F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E80,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC0,0xB2FF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
+};
+
+uint16 page033data[]= { /* 3300 (9 weights per char) */
+0x1E52,0x1E6B,0x0E0B,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E52,0x1E7A,0x1E6D,0x1E52,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E52,0x1E81,0x1E6E,0x1E52,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E52,0x0E0B,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E53,0x1E67,0x1E81,0x1E59,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E53,0x1E81,0x1E62,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E54,0x1E56,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E55,0x1E5E,0x1E59,0x0E0B,0x1E65,0x0000,0x0000,0x0000,0x0000,
+0x1E55,0x0E0B,0x1E57,0x0E0B,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E56,0x1E81,0x1E5E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E56,0x0E0B,0x1E72,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E57,0x1E53,0x1E79,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E57,0x1E78,0x1E63,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E57,0x1E7C,0x1E79,0x0E0B,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E57,0x1E7C,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E57,0x1E81,0x1E70,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E58,0x1E57,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E58,0x1E67,0x0E0B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E58,0x1E76,0x1E79,0x0E0B,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E58,0x1E7A,0x1E61,0x0E0B,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E58,0x1E7C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E58,0x1E7C,0x1E59,0x1E78,0x1E72,0x0000,0x0000,0x0000,0x0000,
+0x1E58,0x1E7C,0x1E73,0x0E0B,0x1E65,0x1E7A,0x0000,0x0000,0x0000,
+0x1E58,0x1E7C,0x1E7D,0x1E63,0x1E65,0x0000,0x0000,0x0000,0x0000,
+0x1E59,0x1E78,0x1E72,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E59,0x1E78,0x1E72,0x1E65,0x1E81,0x0000,0x0000,0x0000,0x0000,
+0x1E59,0x1E7A,0x1E5F,0x1E53,0x1E7C,0x0000,0x0000,0x0000,0x0000,
+0x1E59,0x1E7C,0x0E0B,0x1E69,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5A,0x0E0B,0x1E5E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5B,0x1E7A,0x1E66,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5B,0x0E0B,0x1E6F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5C,0x1E53,0x1E59,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5C,0x1E81,0x1E62,0x0E0B,0x1E72,0x0000,0x0000,0x0000,0x0000,
+0x1E5D,0x1E79,0x1E81,0x1E59,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5F,0x1E81,0x1E62,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E5F,0x1E81,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E61,0x0E0B,0x1E5E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E64,0x1E5D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E65,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E65,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E66,0x1E6A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6A,0x1E63,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6B,0x1E53,0x1E63,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6B,0x0E0B,0x1E5F,0x1E81,0x1E65,0x0000,0x0000,0x0000,0x0000,
+0x1E6B,0x0E0B,0x1E63,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6B,0x0E0B,0x1E7B,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6C,0x1E52,0x1E5E,0x1E65,0x1E7A,0x0000,0x0000,0x0000,0x0000,
+0x1E6C,0x1E59,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6C,0x1E5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6C,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6D,0x1E52,0x1E78,0x1E63,0x1E65,0x0000,0x0000,0x0000,0x0000,
+0x1E6D,0x1E53,0x0E0B,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6D,0x1E63,0x1E5D,0x1E55,0x1E7A,0x0000,0x0000,0x0000,0x0000,
+0x1E6D,0x1E78,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6E,0x1E59,0x1E61,0x0E0B,0x1E7A,0x0000,0x0000,0x0000,0x0000,
+0x1E6E,0x1E60,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6E,0x1E67,0x1E6C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6E,0x1E7A,0x1E63,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6E,0x1E81,0x1E5E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6E,0x0E0B,0x1E5D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6E,0x0E0B,0x1E61,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6F,0x1E53,0x1E81,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6F,0x1E7A,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6F,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6F,0x1E81,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6F,0x0E0B,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E6F,0x0E0B,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E70,0x1E53,0x1E59,0x1E7C,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E70,0x1E53,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E70,0x1E63,0x1E6B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E70,0x1E7A,0x1E59,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E70,0x1E81,0x1E5D,0x1E77,0x1E81,0x0000,0x0000,0x0000,0x0000,
+0x1E71,0x1E59,0x1E7C,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E71,0x1E79,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E71,0x1E79,0x1E6B,0x0E0B,0x1E7A,0x0000,0x0000,0x0000,0x0000,
+0x1E73,0x1E57,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E73,0x1E57,0x1E65,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E73,0x0E0B,0x1E65,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E75,0x0E0B,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E75,0x0E0B,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E76,0x1E52,0x1E81,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E79,0x1E63,0x1E65,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E79,0x1E78,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E7A,0x1E6C,0x0E0B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E7A,0x0E0B,0x1E6D,0x1E7A,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E7B,0x1E72,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1E7B,0x1E81,0x1E65,0x1E5A,0x1E81,0x0000,0x0000,0x0000,0x0000,
+0x1E7D,0x1E63,0x1E65,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E29,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2E,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2F,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E30,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E31,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E32,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E29,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2A,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2B,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2C,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2D,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2E,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2F,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E30,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E31,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E32,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E29,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2A,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2B,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2C,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2D,0xFB40,0xF0B9,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x0FA7,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E33,0x101F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E4A,0x0E33,0x0FC0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F82,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x0E60,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0F5B,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0F5B,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x101F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xDE73,0xFB40,0xE210,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xE62D,0xFB40,0xD48C,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xD927,0xFB40,0xEB63,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xE60E,0xFB40,0xECBB,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFB40,0xE82A,0xFB40,0xDF0F,0xFB40,0xCF1A,0xFB40,0xF93E,0x0000,
+0x0FA7,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x10F8,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0E4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0E4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EC1,0x0E4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0E33,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0E60,0x0E33,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x0EB9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x0EB9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x10F8,0x0EB9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x10F8,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x106A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0EE1,0x106A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0EE1,0x106A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EC1,0x0EE1,0x106A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1002,0x0EE1,0x106A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x10F8,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EB9,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x10F8,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0F5B,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0F5B,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0F5B,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0F5B,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0F5B,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0F5B,0x0E2C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0437,0x0FEA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0437,0x0FEA,0x0E2B,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0FA7,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0FA7,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EC1,0x0FA7,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FC0,0x0E33,0x0E6D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FC0,0x0E33,0x0E6D,0x0437,0x0FEA,0x0000,0x0000,0x0000,0x0000,
+0x0FC0,0x0E33,0x0E6D,0x0437,0x0FEA,0x0E2B,0x0000,0x0000,0x0000,
+0x0FA7,0x0FEA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x0FEA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x10F8,0x0FEA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0FEA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x10F8,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x1051,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F64,0x1051,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x10F8,0x1051,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x1051,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x1051,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x1051,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x1109,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x1109,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E33,0x025D,0x0F5B,0x025D,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E4A,0x0FB4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0E60,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0E6D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0437,0x0F21,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E60,0x0F82,0x025D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E6D,0x0E4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EC1,0x105E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x0E33,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EE1,0x0FA7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EFB,0x0F64,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0F21,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F21,0x1002,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F2E,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F2E,0x0F64,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F2E,0x0F82,0x0EC1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F2E,0x105A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0E4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0EFB,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0F5B,0x0F82,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x0EE1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x025D,0x0F5B,0x025D,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x0FA7,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FA7,0x0FC0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FEA,0x0FC0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0FEA,0x1044,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1051,0x0E4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1044,0x0437,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E33,0x0437,0x0F5B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2D,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2E,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2F,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E30,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E31,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E32,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E29,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2A,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2B,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2C,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2D,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2E,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E2F,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E30,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E31,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2A,0x0E32,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E29,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2A,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2B,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2C,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2D,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2E,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E2F,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E30,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E31,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2B,0x0E32,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E29,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0E2C,0x0E2A,0xFB40,0xE5E5,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x0EC1,0x0E33,0x0F2E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
+};
+
+uint16 page04Ddata[]= { /* 4D00 (3 weights per char) */
+0xFB80,0xCD00,0x0000, 0xFB80,0xCD01,0x0000, 0xFB80,0xCD02,0x0000,
+0xFB80,0xCD03,0x0000, 0xFB80,0xCD04,0x0000, 0xFB80,0xCD05,0x0000,
+0xFB80,0xCD06,0x0000, 0xFB80,0xCD07,0x0000, 0xFB80,0xCD08,0x0000,
+0xFB80,0xCD09,0x0000, 0xFB80,0xCD0A,0x0000, 0xFB80,0xCD0B,0x0000,
+0xFB80,0xCD0C,0x0000, 0xFB80,0xCD0D,0x0000, 0xFB80,0xCD0E,0x0000,
+0xFB80,0xCD0F,0x0000, 0xFB80,0xCD10,0x0000, 0xFB80,0xCD11,0x0000,
+0xFB80,0xCD12,0x0000, 0xFB80,0xCD13,0x0000, 0xFB80,0xCD14,0x0000,
+0xFB80,0xCD15,0x0000, 0xFB80,0xCD16,0x0000, 0xFB80,0xCD17,0x0000,
+0xFB80,0xCD18,0x0000, 0xFB80,0xCD19,0x0000, 0xFB80,0xCD1A,0x0000,
+0xFB80,0xCD1B,0x0000, 0xFB80,0xCD1C,0x0000, 0xFB80,0xCD1D,0x0000,
+0xFB80,0xCD1E,0x0000, 0xFB80,0xCD1F,0x0000, 0xFB80,0xCD20,0x0000,
+0xFB80,0xCD21,0x0000, 0xFB80,0xCD22,0x0000, 0xFB80,0xCD23,0x0000,
+0xFB80,0xCD24,0x0000, 0xFB80,0xCD25,0x0000, 0xFB80,0xCD26,0x0000,
+0xFB80,0xCD27,0x0000, 0xFB80,0xCD28,0x0000, 0xFB80,0xCD29,0x0000,
+0xFB80,0xCD2A,0x0000, 0xFB80,0xCD2B,0x0000, 0xFB80,0xCD2C,0x0000,
+0xFB80,0xCD2D,0x0000, 0xFB80,0xCD2E,0x0000, 0xFB80,0xCD2F,0x0000,
+0xFB80,0xCD30,0x0000, 0xFB80,0xCD31,0x0000, 0xFB80,0xCD32,0x0000,
+0xFB80,0xCD33,0x0000, 0xFB80,0xCD34,0x0000, 0xFB80,0xCD35,0x0000,
+0xFB80,0xCD36,0x0000, 0xFB80,0xCD37,0x0000, 0xFB80,0xCD38,0x0000,
+0xFB80,0xCD39,0x0000, 0xFB80,0xCD3A,0x0000, 0xFB80,0xCD3B,0x0000,
+0xFB80,0xCD3C,0x0000, 0xFB80,0xCD3D,0x0000, 0xFB80,0xCD3E,0x0000,
+0xFB80,0xCD3F,0x0000, 0xFB80,0xCD40,0x0000, 0xFB80,0xCD41,0x0000,
+0xFB80,0xCD42,0x0000, 0xFB80,0xCD43,0x0000, 0xFB80,0xCD44,0x0000,
+0xFB80,0xCD45,0x0000, 0xFB80,0xCD46,0x0000, 0xFB80,0xCD47,0x0000,
+0xFB80,0xCD48,0x0000, 0xFB80,0xCD49,0x0000, 0xFB80,0xCD4A,0x0000,
+0xFB80,0xCD4B,0x0000, 0xFB80,0xCD4C,0x0000, 0xFB80,0xCD4D,0x0000,
+0xFB80,0xCD4E,0x0000, 0xFB80,0xCD4F,0x0000, 0xFB80,0xCD50,0x0000,
+0xFB80,0xCD51,0x0000, 0xFB80,0xCD52,0x0000, 0xFB80,0xCD53,0x0000,
+0xFB80,0xCD54,0x0000, 0xFB80,0xCD55,0x0000, 0xFB80,0xCD56,0x0000,
+0xFB80,0xCD57,0x0000, 0xFB80,0xCD58,0x0000, 0xFB80,0xCD59,0x0000,
+0xFB80,0xCD5A,0x0000, 0xFB80,0xCD5B,0x0000, 0xFB80,0xCD5C,0x0000,
+0xFB80,0xCD5D,0x0000, 0xFB80,0xCD5E,0x0000, 0xFB80,0xCD5F,0x0000,
+0xFB80,0xCD60,0x0000, 0xFB80,0xCD61,0x0000, 0xFB80,0xCD62,0x0000,
+0xFB80,0xCD63,0x0000, 0xFB80,0xCD64,0x0000, 0xFB80,0xCD65,0x0000,
+0xFB80,0xCD66,0x0000, 0xFB80,0xCD67,0x0000, 0xFB80,0xCD68,0x0000,
+0xFB80,0xCD69,0x0000, 0xFB80,0xCD6A,0x0000, 0xFB80,0xCD6B,0x0000,
+0xFB80,0xCD6C,0x0000, 0xFB80,0xCD6D,0x0000, 0xFB80,0xCD6E,0x0000,
+0xFB80,0xCD6F,0x0000, 0xFB80,0xCD70,0x0000, 0xFB80,0xCD71,0x0000,
+0xFB80,0xCD72,0x0000, 0xFB80,0xCD73,0x0000, 0xFB80,0xCD74,0x0000,
+0xFB80,0xCD75,0x0000, 0xFB80,0xCD76,0x0000, 0xFB80,0xCD77,0x0000,
+0xFB80,0xCD78,0x0000, 0xFB80,0xCD79,0x0000, 0xFB80,0xCD7A,0x0000,
+0xFB80,0xCD7B,0x0000, 0xFB80,0xCD7C,0x0000, 0xFB80,0xCD7D,0x0000,
+0xFB80,0xCD7E,0x0000, 0xFB80,0xCD7F,0x0000, 0xFB80,0xCD80,0x0000,
+0xFB80,0xCD81,0x0000, 0xFB80,0xCD82,0x0000, 0xFB80,0xCD83,0x0000,
+0xFB80,0xCD84,0x0000, 0xFB80,0xCD85,0x0000, 0xFB80,0xCD86,0x0000,
+0xFB80,0xCD87,0x0000, 0xFB80,0xCD88,0x0000, 0xFB80,0xCD89,0x0000,
+0xFB80,0xCD8A,0x0000, 0xFB80,0xCD8B,0x0000, 0xFB80,0xCD8C,0x0000,
+0xFB80,0xCD8D,0x0000, 0xFB80,0xCD8E,0x0000, 0xFB80,0xCD8F,0x0000,
+0xFB80,0xCD90,0x0000, 0xFB80,0xCD91,0x0000, 0xFB80,0xCD92,0x0000,
+0xFB80,0xCD93,0x0000, 0xFB80,0xCD94,0x0000, 0xFB80,0xCD95,0x0000,
+0xFB80,0xCD96,0x0000, 0xFB80,0xCD97,0x0000, 0xFB80,0xCD98,0x0000,
+0xFB80,0xCD99,0x0000, 0xFB80,0xCD9A,0x0000, 0xFB80,0xCD9B,0x0000,
+0xFB80,0xCD9C,0x0000, 0xFB80,0xCD9D,0x0000, 0xFB80,0xCD9E,0x0000,
+0xFB80,0xCD9F,0x0000, 0xFB80,0xCDA0,0x0000, 0xFB80,0xCDA1,0x0000,
+0xFB80,0xCDA2,0x0000, 0xFB80,0xCDA3,0x0000, 0xFB80,0xCDA4,0x0000,
+0xFB80,0xCDA5,0x0000, 0xFB80,0xCDA6,0x0000, 0xFB80,0xCDA7,0x0000,
+0xFB80,0xCDA8,0x0000, 0xFB80,0xCDA9,0x0000, 0xFB80,0xCDAA,0x0000,
+0xFB80,0xCDAB,0x0000, 0xFB80,0xCDAC,0x0000, 0xFB80,0xCDAD,0x0000,
+0xFB80,0xCDAE,0x0000, 0xFB80,0xCDAF,0x0000, 0xFB80,0xCDB0,0x0000,
+0xFB80,0xCDB1,0x0000, 0xFB80,0xCDB2,0x0000, 0xFB80,0xCDB3,0x0000,
+0xFB80,0xCDB4,0x0000, 0xFB80,0xCDB5,0x0000, 0xFBC0,0xCDB6,0x0000,
+0xFBC0,0xCDB7,0x0000, 0xFBC0,0xCDB8,0x0000, 0xFBC0,0xCDB9,0x0000,
+0xFBC0,0xCDBA,0x0000, 0xFBC0,0xCDBB,0x0000, 0xFBC0,0xCDBC,0x0000,
+0xFBC0,0xCDBD,0x0000, 0xFBC0,0xCDBE,0x0000, 0xFBC0,0xCDBF,0x0000,
+0x0B37,0x0000,0x0000, 0x0B38,0x0000,0x0000, 0x0B39,0x0000,0x0000,
+0x0B3A,0x0000,0x0000, 0x0B3B,0x0000,0x0000, 0x0B3C,0x0000,0x0000,
+0x0B3D,0x0000,0x0000, 0x0B3E,0x0000,0x0000, 0x0B3F,0x0000,0x0000,
+0x0B40,0x0000,0x0000, 0x0B41,0x0000,0x0000, 0x0B42,0x0000,0x0000,
+0x0B43,0x0000,0x0000, 0x0B44,0x0000,0x0000, 0x0B45,0x0000,0x0000,
+0x0B46,0x0000,0x0000, 0x0B47,0x0000,0x0000, 0x0B48,0x0000,0x0000,
+0x0B49,0x0000,0x0000, 0x0B4A,0x0000,0x0000, 0x0B4B,0x0000,0x0000,
+0x0B4C,0x0000,0x0000, 0x0B4D,0x0000,0x0000, 0x0B4E,0x0000,0x0000,
+0x0B4F,0x0000,0x0000, 0x0B50,0x0000,0x0000, 0x0B51,0x0000,0x0000,
+0x0B52,0x0000,0x0000, 0x0B53,0x0000,0x0000, 0x0B54,0x0000,0x0000,
+0x0B55,0x0000,0x0000, 0x0B56,0x0000,0x0000, 0x0B57,0x0000,0x0000,
+0x0B58,0x0000,0x0000, 0x0B59,0x0000,0x0000, 0x0B5A,0x0000,0x0000,
+0x0B5B,0x0000,0x0000, 0x0B5C,0x0000,0x0000, 0x0B5D,0x0000,0x0000,
+0x0B5E,0x0000,0x0000, 0x0B5F,0x0000,0x0000, 0x0B60,0x0000,0x0000,
+0x0B61,0x0000,0x0000, 0x0B62,0x0000,0x0000, 0x0B63,0x0000,0x0000,
+0x0B64,0x0000,0x0000, 0x0B65,0x0000,0x0000, 0x0B66,0x0000,0x0000,
+0x0B67,0x0000,0x0000, 0x0B68,0x0000,0x0000, 0x0B69,0x0000,0x0000,
+0x0B6A,0x0000,0x0000, 0x0B6B,0x0000,0x0000, 0x0B6C,0x0000,0x0000,
+0x0B6D,0x0000,0x0000, 0x0B6E,0x0000,0x0000, 0x0B6F,0x0000,0x0000,
+0x0B70,0x0000,0x0000, 0x0B71,0x0000,0x0000, 0x0B72,0x0000,0x0000,
+0x0B73,0x0000,0x0000, 0x0B74,0x0000,0x0000, 0x0B75,0x0000,0x0000,
+0x0B76,0x0000,0x0000 };
+
+uint16 page0A0data[]= { /* A000 (2 weights per char) */
+0x1EB1,0x0000, 0x1EB2,0x0000, 0x1EB3,0x0000, 0x1EB4,0x0000,
+0x1EB5,0x0000, 0x1EB6,0x0000, 0x1EB7,0x0000, 0x1EB8,0x0000,
+0x1EB9,0x0000, 0x1EBA,0x0000, 0x1EBB,0x0000, 0x1EBC,0x0000,
+0x1EBD,0x0000, 0x1EBE,0x0000, 0x1EBF,0x0000, 0x1EC0,0x0000,
+0x1EC1,0x0000, 0x1EC2,0x0000, 0x1EC3,0x0000, 0x1EC4,0x0000,
+0x1EC5,0x0000, 0x1EC6,0x0000, 0x1EC7,0x0000, 0x1EC8,0x0000,
+0x1EC9,0x0000, 0x1ECA,0x0000, 0x1ECB,0x0000, 0x1ECC,0x0000,
+0x1ECD,0x0000, 0x1ECE,0x0000, 0x1ECF,0x0000, 0x1ED0,0x0000,
+0x1ED1,0x0000, 0x1ED2,0x0000, 0x1ED3,0x0000, 0x1ED4,0x0000,
+0x1ED5,0x0000, 0x1ED6,0x0000, 0x1ED7,0x0000, 0x1ED8,0x0000,
+0x1ED9,0x0000, 0x1EDA,0x0000, 0x1EDB,0x0000, 0x1EDC,0x0000,
+0x1EDD,0x0000, 0x1EDE,0x0000, 0x1EDF,0x0000, 0x1EE0,0x0000,
+0x1EE1,0x0000, 0x1EE2,0x0000, 0x1EE3,0x0000, 0x1EE4,0x0000,
+0x1EE5,0x0000, 0x1EE6,0x0000, 0x1EE7,0x0000, 0x1EE8,0x0000,
+0x1EE9,0x0000, 0x1EEA,0x0000, 0x1EEB,0x0000, 0x1EEC,0x0000,
+0x1EED,0x0000, 0x1EEE,0x0000, 0x1EEF,0x0000, 0x1EF0,0x0000,
+0x1EF1,0x0000, 0x1EF2,0x0000, 0x1EF3,0x0000, 0x1EF4,0x0000,
+0x1EF5,0x0000, 0x1EF6,0x0000, 0x1EF7,0x0000, 0x1EF8,0x0000,
+0x1EF9,0x0000, 0x1EFA,0x0000, 0x1EFB,0x0000, 0x1EFC,0x0000,
+0x1EFD,0x0000, 0x1EFE,0x0000, 0x1EFF,0x0000, 0x1F00,0x0000,
+0x1F01,0x0000, 0x1F02,0x0000, 0x1F03,0x0000, 0x1F04,0x0000,
+0x1F05,0x0000, 0x1F06,0x0000, 0x1F07,0x0000, 0x1F08,0x0000,
+0x1F09,0x0000, 0x1F0A,0x0000, 0x1F0B,0x0000, 0x1F0C,0x0000,
+0x1F0D,0x0000, 0x1F0E,0x0000, 0x1F0F,0x0000, 0x1F10,0x0000,
+0x1F11,0x0000, 0x1F12,0x0000, 0x1F13,0x0000, 0x1F14,0x0000,
+0x1F15,0x0000, 0x1F16,0x0000, 0x1F17,0x0000, 0x1F18,0x0000,
+0x1F19,0x0000, 0x1F1A,0x0000, 0x1F1B,0x0000, 0x1F1C,0x0000,
+0x1F1D,0x0000, 0x1F1E,0x0000, 0x1F1F,0x0000, 0x1F20,0x0000,
+0x1F21,0x0000, 0x1F22,0x0000, 0x1F23,0x0000, 0x1F24,0x0000,
+0x1F25,0x0000, 0x1F26,0x0000, 0x1F27,0x0000, 0x1F28,0x0000,
+0x1F29,0x0000, 0x1F2A,0x0000, 0x1F2B,0x0000, 0x1F2C,0x0000,
+0x1F2D,0x0000, 0x1F2E,0x0000, 0x1F2F,0x0000, 0x1F30,0x0000,
+0x1F31,0x0000, 0x1F32,0x0000, 0x1F33,0x0000, 0x1F34,0x0000,
+0x1F35,0x0000, 0x1F36,0x0000, 0x1F37,0x0000, 0x1F38,0x0000,
+0x1F39,0x0000, 0x1F3A,0x0000, 0x1F3B,0x0000, 0x1F3C,0x0000,
+0x1F3D,0x0000, 0x1F3E,0x0000, 0x1F3F,0x0000, 0x1F40,0x0000,
+0x1F41,0x0000, 0x1F42,0x0000, 0x1F43,0x0000, 0x1F44,0x0000,
+0x1F45,0x0000, 0x1F46,0x0000, 0x1F47,0x0000, 0x1F48,0x0000,
+0x1F49,0x0000, 0x1F4A,0x0000, 0x1F4B,0x0000, 0x1F4C,0x0000,
+0x1F4D,0x0000, 0x1F4E,0x0000, 0x1F4F,0x0000, 0x1F50,0x0000,
+0x1F51,0x0000, 0x1F52,0x0000, 0x1F53,0x0000, 0x1F54,0x0000,
+0x1F55,0x0000, 0x1F56,0x0000, 0x1F57,0x0000, 0x1F58,0x0000,
+0x1F59,0x0000, 0x1F5A,0x0000, 0x1F5B,0x0000, 0x1F5C,0x0000,
+0x1F5D,0x0000, 0x1F5E,0x0000, 0x1F5F,0x0000, 0x1F60,0x0000,
+0x1F61,0x0000, 0x1F62,0x0000, 0x1F63,0x0000, 0x1F64,0x0000,
+0x1F65,0x0000, 0x1F66,0x0000, 0x1F67,0x0000, 0x1F68,0x0000,
+0x1F69,0x0000, 0x1F6A,0x0000, 0x1F6B,0x0000, 0x1F6C,0x0000,
+0x1F6D,0x0000, 0x1F6E,0x0000, 0x1F6F,0x0000, 0x1F70,0x0000,
+0x1F71,0x0000, 0x1F72,0x0000, 0x1F73,0x0000, 0x1F74,0x0000,
+0x1F75,0x0000, 0x1F76,0x0000, 0x1F77,0x0000, 0x1F78,0x0000,
+0x1F79,0x0000, 0x1F7A,0x0000, 0x1F7B,0x0000, 0x1F7C,0x0000,
+0x1F7D,0x0000, 0x1F7E,0x0000, 0x1F7F,0x0000, 0x1F80,0x0000,
+0x1F81,0x0000, 0x1F82,0x0000, 0x1F83,0x0000, 0x1F84,0x0000,
+0x1F85,0x0000, 0x1F86,0x0000, 0x1F87,0x0000, 0x1F88,0x0000,
+0x1F89,0x0000, 0x1F8A,0x0000, 0x1F8B,0x0000, 0x1F8C,0x0000,
+0x1F8D,0x0000, 0x1F8E,0x0000, 0x1F8F,0x0000, 0x1F90,0x0000,
+0x1F91,0x0000, 0x1F92,0x0000, 0x1F93,0x0000, 0x1F94,0x0000,
+0x1F95,0x0000, 0x1F96,0x0000, 0x1F97,0x0000, 0x1F98,0x0000,
+0x1F99,0x0000, 0x1F9A,0x0000, 0x1F9B,0x0000, 0x1F9C,0x0000,
+0x1F9D,0x0000, 0x1F9E,0x0000, 0x1F9F,0x0000, 0x1FA0,0x0000,
+0x1FA1,0x0000, 0x1FA2,0x0000, 0x1FA3,0x0000, 0x1FA4,0x0000,
+0x1FA5,0x0000, 0x1FA6,0x0000, 0x1FA7,0x0000, 0x1FA8,0x0000,
+0x1FA9,0x0000, 0x1FAA,0x0000, 0x1FAB,0x0000, 0x1FAC,0x0000,
+0x1FAD,0x0000, 0x1FAE,0x0000, 0x1FAF,0x0000, 0x1FB0,0x0000
+};
+
+uint16 page0A1data[]= { /* A100 (2 weights per char) */
+0x1FB1,0x0000, 0x1FB2,0x0000, 0x1FB3,0x0000, 0x1FB4,0x0000,
+0x1FB5,0x0000, 0x1FB6,0x0000, 0x1FB7,0x0000, 0x1FB8,0x0000,
+0x1FB9,0x0000, 0x1FBA,0x0000, 0x1FBB,0x0000, 0x1FBC,0x0000,
+0x1FBD,0x0000, 0x1FBE,0x0000, 0x1FBF,0x0000, 0x1FC0,0x0000,
+0x1FC1,0x0000, 0x1FC2,0x0000, 0x1FC3,0x0000, 0x1FC4,0x0000,
+0x1FC5,0x0000, 0x1FC6,0x0000, 0x1FC7,0x0000, 0x1FC8,0x0000,
+0x1FC9,0x0000, 0x1FCA,0x0000, 0x1FCB,0x0000, 0x1FCC,0x0000,
+0x1FCD,0x0000, 0x1FCE,0x0000, 0x1FCF,0x0000, 0x1FD0,0x0000,
+0x1FD1,0x0000, 0x1FD2,0x0000, 0x1FD3,0x0000, 0x1FD4,0x0000,
+0x1FD5,0x0000, 0x1FD6,0x0000, 0x1FD7,0x0000, 0x1FD8,0x0000,
+0x1FD9,0x0000, 0x1FDA,0x0000, 0x1FDB,0x0000, 0x1FDC,0x0000,
+0x1FDD,0x0000, 0x1FDE,0x0000, 0x1FDF,0x0000, 0x1FE0,0x0000,
+0x1FE1,0x0000, 0x1FE2,0x0000, 0x1FE3,0x0000, 0x1FE4,0x0000,
+0x1FE5,0x0000, 0x1FE6,0x0000, 0x1FE7,0x0000, 0x1FE8,0x0000,
+0x1FE9,0x0000, 0x1FEA,0x0000, 0x1FEB,0x0000, 0x1FEC,0x0000,
+0x1FED,0x0000, 0x1FEE,0x0000, 0x1FEF,0x0000, 0x1FF0,0x0000,
+0x1FF1,0x0000, 0x1FF2,0x0000, 0x1FF3,0x0000, 0x1FF4,0x0000,
+0x1FF5,0x0000, 0x1FF6,0x0000, 0x1FF7,0x0000, 0x1FF8,0x0000,
+0x1FF9,0x0000, 0x1FFA,0x0000, 0x1FFB,0x0000, 0x1FFC,0x0000,
+0x1FFD,0x0000, 0x1FFE,0x0000, 0x1FFF,0x0000, 0x2000,0x0000,
+0x2001,0x0000, 0x2002,0x0000, 0x2003,0x0000, 0x2004,0x0000,
+0x2005,0x0000, 0x2006,0x0000, 0x2007,0x0000, 0x2008,0x0000,
+0x2009,0x0000, 0x200A,0x0000, 0x200B,0x0000, 0x200C,0x0000,
+0x200D,0x0000, 0x200E,0x0000, 0x200F,0x0000, 0x2010,0x0000,
+0x2011,0x0000, 0x2012,0x0000, 0x2013,0x0000, 0x2014,0x0000,
+0x2015,0x0000, 0x2016,0x0000, 0x2017,0x0000, 0x2018,0x0000,
+0x2019,0x0000, 0x201A,0x0000, 0x201B,0x0000, 0x201C,0x0000,
+0x201D,0x0000, 0x201E,0x0000, 0x201F,0x0000, 0x2020,0x0000,
+0x2021,0x0000, 0x2022,0x0000, 0x2023,0x0000, 0x2024,0x0000,
+0x2025,0x0000, 0x2026,0x0000, 0x2027,0x0000, 0x2028,0x0000,
+0x2029,0x0000, 0x202A,0x0000, 0x202B,0x0000, 0x202C,0x0000,
+0x202D,0x0000, 0x202E,0x0000, 0x202F,0x0000, 0x2030,0x0000,
+0x2031,0x0000, 0x2032,0x0000, 0x2033,0x0000, 0x2034,0x0000,
+0x2035,0x0000, 0x2036,0x0000, 0x2037,0x0000, 0x2038,0x0000,
+0x2039,0x0000, 0x203A,0x0000, 0x203B,0x0000, 0x203C,0x0000,
+0x203D,0x0000, 0x203E,0x0000, 0x203F,0x0000, 0x2040,0x0000,
+0x2041,0x0000, 0x2042,0x0000, 0x2043,0x0000, 0x2044,0x0000,
+0x2045,0x0000, 0x2046,0x0000, 0x2047,0x0000, 0x2048,0x0000,
+0x2049,0x0000, 0x204A,0x0000, 0x204B,0x0000, 0x204C,0x0000,
+0x204D,0x0000, 0x204E,0x0000, 0x204F,0x0000, 0x2050,0x0000,
+0x2051,0x0000, 0x2052,0x0000, 0x2053,0x0000, 0x2054,0x0000,
+0x2055,0x0000, 0x2056,0x0000, 0x2057,0x0000, 0x2058,0x0000,
+0x2059,0x0000, 0x205A,0x0000, 0x205B,0x0000, 0x205C,0x0000,
+0x205D,0x0000, 0x205E,0x0000, 0x205F,0x0000, 0x2060,0x0000,
+0x2061,0x0000, 0x2062,0x0000, 0x2063,0x0000, 0x2064,0x0000,
+0x2065,0x0000, 0x2066,0x0000, 0x2067,0x0000, 0x2068,0x0000,
+0x2069,0x0000, 0x206A,0x0000, 0x206B,0x0000, 0x206C,0x0000,
+0x206D,0x0000, 0x206E,0x0000, 0x206F,0x0000, 0x2070,0x0000,
+0x2071,0x0000, 0x2072,0x0000, 0x2073,0x0000, 0x2074,0x0000,
+0x2075,0x0000, 0x2076,0x0000, 0x2077,0x0000, 0x2078,0x0000,
+0x2079,0x0000, 0x207A,0x0000, 0x207B,0x0000, 0x207C,0x0000,
+0x207D,0x0000, 0x207E,0x0000, 0x207F,0x0000, 0x2080,0x0000,
+0x2081,0x0000, 0x2082,0x0000, 0x2083,0x0000, 0x2084,0x0000,
+0x2085,0x0000, 0x2086,0x0000, 0x2087,0x0000, 0x2088,0x0000,
+0x2089,0x0000, 0x208A,0x0000, 0x208B,0x0000, 0x208C,0x0000,
+0x208D,0x0000, 0x208E,0x0000, 0x208F,0x0000, 0x2090,0x0000,
+0x2091,0x0000, 0x2092,0x0000, 0x2093,0x0000, 0x2094,0x0000,
+0x2095,0x0000, 0x2096,0x0000, 0x2097,0x0000, 0x2098,0x0000,
+0x2099,0x0000, 0x209A,0x0000, 0x209B,0x0000, 0x209C,0x0000,
+0x209D,0x0000, 0x209E,0x0000, 0x209F,0x0000, 0x20A0,0x0000,
+0x20A1,0x0000, 0x20A2,0x0000, 0x20A3,0x0000, 0x20A4,0x0000,
+0x20A5,0x0000, 0x20A6,0x0000, 0x20A7,0x0000, 0x20A8,0x0000,
+0x20A9,0x0000, 0x20AA,0x0000, 0x20AB,0x0000, 0x20AC,0x0000,
+0x20AD,0x0000, 0x20AE,0x0000, 0x20AF,0x0000, 0x20B0,0x0000
+};
+
+uint16 page0A2data[]= { /* A200 (2 weights per char) */
+0x20B1,0x0000, 0x20B2,0x0000, 0x20B3,0x0000, 0x20B4,0x0000,
+0x20B5,0x0000, 0x20B6,0x0000, 0x20B7,0x0000, 0x20B8,0x0000,
+0x20B9,0x0000, 0x20BA,0x0000, 0x20BB,0x0000, 0x20BC,0x0000,
+0x20BD,0x0000, 0x20BE,0x0000, 0x20BF,0x0000, 0x20C0,0x0000,
+0x20C1,0x0000, 0x20C2,0x0000, 0x20C3,0x0000, 0x20C4,0x0000,
+0x20C5,0x0000, 0x20C6,0x0000, 0x20C7,0x0000, 0x20C8,0x0000,
+0x20C9,0x0000, 0x20CA,0x0000, 0x20CB,0x0000, 0x20CC,0x0000,
+0x20CD,0x0000, 0x20CE,0x0000, 0x20CF,0x0000, 0x20D0,0x0000,
+0x20D1,0x0000, 0x20D2,0x0000, 0x20D3,0x0000, 0x20D4,0x0000,
+0x20D5,0x0000, 0x20D6,0x0000, 0x20D7,0x0000, 0x20D8,0x0000,
+0x20D9,0x0000, 0x20DA,0x0000, 0x20DB,0x0000, 0x20DC,0x0000,
+0x20DD,0x0000, 0x20DE,0x0000, 0x20DF,0x0000, 0x20E0,0x0000,
+0x20E1,0x0000, 0x20E2,0x0000, 0x20E3,0x0000, 0x20E4,0x0000,
+0x20E5,0x0000, 0x20E6,0x0000, 0x20E7,0x0000, 0x20E8,0x0000,
+0x20E9,0x0000, 0x20EA,0x0000, 0x20EB,0x0000, 0x20EC,0x0000,
+0x20ED,0x0000, 0x20EE,0x0000, 0x20EF,0x0000, 0x20F0,0x0000,
+0x20F1,0x0000, 0x20F2,0x0000, 0x20F3,0x0000, 0x20F4,0x0000,
+0x20F5,0x0000, 0x20F6,0x0000, 0x20F7,0x0000, 0x20F8,0x0000,
+0x20F9,0x0000, 0x20FA,0x0000, 0x20FB,0x0000, 0x20FC,0x0000,
+0x20FD,0x0000, 0x20FE,0x0000, 0x20FF,0x0000, 0x2100,0x0000,
+0x2101,0x0000, 0x2102,0x0000, 0x2103,0x0000, 0x2104,0x0000,
+0x2105,0x0000, 0x2106,0x0000, 0x2107,0x0000, 0x2108,0x0000,
+0x2109,0x0000, 0x210A,0x0000, 0x210B,0x0000, 0x210C,0x0000,
+0x210D,0x0000, 0x210E,0x0000, 0x210F,0x0000, 0x2110,0x0000,
+0x2111,0x0000, 0x2112,0x0000, 0x2113,0x0000, 0x2114,0x0000,
+0x2115,0x0000, 0x2116,0x0000, 0x2117,0x0000, 0x2118,0x0000,
+0x2119,0x0000, 0x211A,0x0000, 0x211B,0x0000, 0x211C,0x0000,
+0x211D,0x0000, 0x211E,0x0000, 0x211F,0x0000, 0x2120,0x0000,
+0x2121,0x0000, 0x2122,0x0000, 0x2123,0x0000, 0x2124,0x0000,
+0x2125,0x0000, 0x2126,0x0000, 0x2127,0x0000, 0x2128,0x0000,
+0x2129,0x0000, 0x212A,0x0000, 0x212B,0x0000, 0x212C,0x0000,
+0x212D,0x0000, 0x212E,0x0000, 0x212F,0x0000, 0x2130,0x0000,
+0x2131,0x0000, 0x2132,0x0000, 0x2133,0x0000, 0x2134,0x0000,
+0x2135,0x0000, 0x2136,0x0000, 0x2137,0x0000, 0x2138,0x0000,
+0x2139,0x0000, 0x213A,0x0000, 0x213B,0x0000, 0x213C,0x0000,
+0x213D,0x0000, 0x213E,0x0000, 0x213F,0x0000, 0x2140,0x0000,
+0x2141,0x0000, 0x2142,0x0000, 0x2143,0x0000, 0x2144,0x0000,
+0x2145,0x0000, 0x2146,0x0000, 0x2147,0x0000, 0x2148,0x0000,
+0x2149,0x0000, 0x214A,0x0000, 0x214B,0x0000, 0x214C,0x0000,
+0x214D,0x0000, 0x214E,0x0000, 0x214F,0x0000, 0x2150,0x0000,
+0x2151,0x0000, 0x2152,0x0000, 0x2153,0x0000, 0x2154,0x0000,
+0x2155,0x0000, 0x2156,0x0000, 0x2157,0x0000, 0x2158,0x0000,
+0x2159,0x0000, 0x215A,0x0000, 0x215B,0x0000, 0x215C,0x0000,
+0x215D,0x0000, 0x215E,0x0000, 0x215F,0x0000, 0x2160,0x0000,
+0x2161,0x0000, 0x2162,0x0000, 0x2163,0x0000, 0x2164,0x0000,
+0x2165,0x0000, 0x2166,0x0000, 0x2167,0x0000, 0x2168,0x0000,
+0x2169,0x0000, 0x216A,0x0000, 0x216B,0x0000, 0x216C,0x0000,
+0x216D,0x0000, 0x216E,0x0000, 0x216F,0x0000, 0x2170,0x0000,
+0x2171,0x0000, 0x2172,0x0000, 0x2173,0x0000, 0x2174,0x0000,
+0x2175,0x0000, 0x2176,0x0000, 0x2177,0x0000, 0x2178,0x0000,
+0x2179,0x0000, 0x217A,0x0000, 0x217B,0x0000, 0x217C,0x0000,
+0x217D,0x0000, 0x217E,0x0000, 0x217F,0x0000, 0x2180,0x0000,
+0x2181,0x0000, 0x2182,0x0000, 0x2183,0x0000, 0x2184,0x0000,
+0x2185,0x0000, 0x2186,0x0000, 0x2187,0x0000, 0x2188,0x0000,
+0x2189,0x0000, 0x218A,0x0000, 0x218B,0x0000, 0x218C,0x0000,
+0x218D,0x0000, 0x218E,0x0000, 0x218F,0x0000, 0x2190,0x0000,
+0x2191,0x0000, 0x2192,0x0000, 0x2193,0x0000, 0x2194,0x0000,
+0x2195,0x0000, 0x2196,0x0000, 0x2197,0x0000, 0x2198,0x0000,
+0x2199,0x0000, 0x219A,0x0000, 0x219B,0x0000, 0x219C,0x0000,
+0x219D,0x0000, 0x219E,0x0000, 0x219F,0x0000, 0x21A0,0x0000,
+0x21A1,0x0000, 0x21A2,0x0000, 0x21A3,0x0000, 0x21A4,0x0000,
+0x21A5,0x0000, 0x21A6,0x0000, 0x21A7,0x0000, 0x21A8,0x0000,
+0x21A9,0x0000, 0x21AA,0x0000, 0x21AB,0x0000, 0x21AC,0x0000,
+0x21AD,0x0000, 0x21AE,0x0000, 0x21AF,0x0000, 0x21B0,0x0000
+};
+
+uint16 page0A3data[]= { /* A300 (2 weights per char) */
+0x21B1,0x0000, 0x21B2,0x0000, 0x21B3,0x0000, 0x21B4,0x0000,
+0x21B5,0x0000, 0x21B6,0x0000, 0x21B7,0x0000, 0x21B8,0x0000,
+0x21B9,0x0000, 0x21BA,0x0000, 0x21BB,0x0000, 0x21BC,0x0000,
+0x21BD,0x0000, 0x21BE,0x0000, 0x21BF,0x0000, 0x21C0,0x0000,
+0x21C1,0x0000, 0x21C2,0x0000, 0x21C3,0x0000, 0x21C4,0x0000,
+0x21C5,0x0000, 0x21C6,0x0000, 0x21C7,0x0000, 0x21C8,0x0000,
+0x21C9,0x0000, 0x21CA,0x0000, 0x21CB,0x0000, 0x21CC,0x0000,
+0x21CD,0x0000, 0x21CE,0x0000, 0x21CF,0x0000, 0x21D0,0x0000,
+0x21D1,0x0000, 0x21D2,0x0000, 0x21D3,0x0000, 0x21D4,0x0000,
+0x21D5,0x0000, 0x21D6,0x0000, 0x21D7,0x0000, 0x21D8,0x0000,
+0x21D9,0x0000, 0x21DA,0x0000, 0x21DB,0x0000, 0x21DC,0x0000,
+0x21DD,0x0000, 0x21DE,0x0000, 0x21DF,0x0000, 0x21E0,0x0000,
+0x21E1,0x0000, 0x21E2,0x0000, 0x21E3,0x0000, 0x21E4,0x0000,
+0x21E5,0x0000, 0x21E6,0x0000, 0x21E7,0x0000, 0x21E8,0x0000,
+0x21E9,0x0000, 0x21EA,0x0000, 0x21EB,0x0000, 0x21EC,0x0000,
+0x21ED,0x0000, 0x21EE,0x0000, 0x21EF,0x0000, 0x21F0,0x0000,
+0x21F1,0x0000, 0x21F2,0x0000, 0x21F3,0x0000, 0x21F4,0x0000,
+0x21F5,0x0000, 0x21F6,0x0000, 0x21F7,0x0000, 0x21F8,0x0000,
+0x21F9,0x0000, 0x21FA,0x0000, 0x21FB,0x0000, 0x21FC,0x0000,
+0x21FD,0x0000, 0x21FE,0x0000, 0x21FF,0x0000, 0x2200,0x0000,
+0x2201,0x0000, 0x2202,0x0000, 0x2203,0x0000, 0x2204,0x0000,
+0x2205,0x0000, 0x2206,0x0000, 0x2207,0x0000, 0x2208,0x0000,
+0x2209,0x0000, 0x220A,0x0000, 0x220B,0x0000, 0x220C,0x0000,
+0x220D,0x0000, 0x220E,0x0000, 0x220F,0x0000, 0x2210,0x0000,
+0x2211,0x0000, 0x2212,0x0000, 0x2213,0x0000, 0x2214,0x0000,
+0x2215,0x0000, 0x2216,0x0000, 0x2217,0x0000, 0x2218,0x0000,
+0x2219,0x0000, 0x221A,0x0000, 0x221B,0x0000, 0x221C,0x0000,
+0x221D,0x0000, 0x221E,0x0000, 0x221F,0x0000, 0x2220,0x0000,
+0x2221,0x0000, 0x2222,0x0000, 0x2223,0x0000, 0x2224,0x0000,
+0x2225,0x0000, 0x2226,0x0000, 0x2227,0x0000, 0x2228,0x0000,
+0x2229,0x0000, 0x222A,0x0000, 0x222B,0x0000, 0x222C,0x0000,
+0x222D,0x0000, 0x222E,0x0000, 0x222F,0x0000, 0x2230,0x0000,
+0x2231,0x0000, 0x2232,0x0000, 0x2233,0x0000, 0x2234,0x0000,
+0x2235,0x0000, 0x2236,0x0000, 0x2237,0x0000, 0x2238,0x0000,
+0x2239,0x0000, 0x223A,0x0000, 0x223B,0x0000, 0x223C,0x0000,
+0x223D,0x0000, 0x223E,0x0000, 0x223F,0x0000, 0x2240,0x0000,
+0x2241,0x0000, 0x2242,0x0000, 0x2243,0x0000, 0x2244,0x0000,
+0x2245,0x0000, 0x2246,0x0000, 0x2247,0x0000, 0x2248,0x0000,
+0x2249,0x0000, 0x224A,0x0000, 0x224B,0x0000, 0x224C,0x0000,
+0x224D,0x0000, 0x224E,0x0000, 0x224F,0x0000, 0x2250,0x0000,
+0x2251,0x0000, 0x2252,0x0000, 0x2253,0x0000, 0x2254,0x0000,
+0x2255,0x0000, 0x2256,0x0000, 0x2257,0x0000, 0x2258,0x0000,
+0x2259,0x0000, 0x225A,0x0000, 0x225B,0x0000, 0x225C,0x0000,
+0x225D,0x0000, 0x225E,0x0000, 0x225F,0x0000, 0x2260,0x0000,
+0x2261,0x0000, 0x2262,0x0000, 0x2263,0x0000, 0x2264,0x0000,
+0x2265,0x0000, 0x2266,0x0000, 0x2267,0x0000, 0x2268,0x0000,
+0x2269,0x0000, 0x226A,0x0000, 0x226B,0x0000, 0x226C,0x0000,
+0x226D,0x0000, 0x226E,0x0000, 0x226F,0x0000, 0x2270,0x0000,
+0x2271,0x0000, 0x2272,0x0000, 0x2273,0x0000, 0x2274,0x0000,
+0x2275,0x0000, 0x2276,0x0000, 0x2277,0x0000, 0x2278,0x0000,
+0x2279,0x0000, 0x227A,0x0000, 0x227B,0x0000, 0x227C,0x0000,
+0x227D,0x0000, 0x227E,0x0000, 0x227F,0x0000, 0x2280,0x0000,
+0x2281,0x0000, 0x2282,0x0000, 0x2283,0x0000, 0x2284,0x0000,
+0x2285,0x0000, 0x2286,0x0000, 0x2287,0x0000, 0x2288,0x0000,
+0x2289,0x0000, 0x228A,0x0000, 0x228B,0x0000, 0x228C,0x0000,
+0x228D,0x0000, 0x228E,0x0000, 0x228F,0x0000, 0x2290,0x0000,
+0x2291,0x0000, 0x2292,0x0000, 0x2293,0x0000, 0x2294,0x0000,
+0x2295,0x0000, 0x2296,0x0000, 0x2297,0x0000, 0x2298,0x0000,
+0x2299,0x0000, 0x229A,0x0000, 0x229B,0x0000, 0x229C,0x0000,
+0x229D,0x0000, 0x229E,0x0000, 0x229F,0x0000, 0x22A0,0x0000,
+0x22A1,0x0000, 0x22A2,0x0000, 0x22A3,0x0000, 0x22A4,0x0000,
+0x22A5,0x0000, 0x22A6,0x0000, 0x22A7,0x0000, 0x22A8,0x0000,
+0x22A9,0x0000, 0x22AA,0x0000, 0x22AB,0x0000, 0x22AC,0x0000,
+0x22AD,0x0000, 0x22AE,0x0000, 0x22AF,0x0000, 0x22B0,0x0000
+};
+
+uint16 page0A4data[]= { /* A400 (3 weights per char) */
+0x22B1,0x0000,0x0000, 0x22B2,0x0000,0x0000, 0x22B3,0x0000,0x0000,
+0x22B4,0x0000,0x0000, 0x22B5,0x0000,0x0000, 0x22B6,0x0000,0x0000,
+0x22B7,0x0000,0x0000, 0x22B8,0x0000,0x0000, 0x22B9,0x0000,0x0000,
+0x22BA,0x0000,0x0000, 0x22BB,0x0000,0x0000, 0x22BC,0x0000,0x0000,
+0x22BD,0x0000,0x0000, 0x22BE,0x0000,0x0000, 0x22BF,0x0000,0x0000,
+0x22C0,0x0000,0x0000, 0x22C1,0x0000,0x0000, 0x22C2,0x0000,0x0000,
+0x22C3,0x0000,0x0000, 0x22C4,0x0000,0x0000, 0x22C5,0x0000,0x0000,
+0x22C6,0x0000,0x0000, 0x22C7,0x0000,0x0000, 0x22C8,0x0000,0x0000,
+0x22C9,0x0000,0x0000, 0x22CA,0x0000,0x0000, 0x22CB,0x0000,0x0000,
+0x22CC,0x0000,0x0000, 0x22CD,0x0000,0x0000, 0x22CE,0x0000,0x0000,
+0x22CF,0x0000,0x0000, 0x22D0,0x0000,0x0000, 0x22D1,0x0000,0x0000,
+0x22D2,0x0000,0x0000, 0x22D3,0x0000,0x0000, 0x22D4,0x0000,0x0000,
+0x22D5,0x0000,0x0000, 0x22D6,0x0000,0x0000, 0x22D7,0x0000,0x0000,
+0x22D8,0x0000,0x0000, 0x22D9,0x0000,0x0000, 0x22DA,0x0000,0x0000,
+0x22DB,0x0000,0x0000, 0x22DC,0x0000,0x0000, 0x22DD,0x0000,0x0000,
+0x22DE,0x0000,0x0000, 0x22DF,0x0000,0x0000, 0x22E0,0x0000,0x0000,
+0x22E1,0x0000,0x0000, 0x22E2,0x0000,0x0000, 0x22E3,0x0000,0x0000,
+0x22E4,0x0000,0x0000, 0x22E5,0x0000,0x0000, 0x22E6,0x0000,0x0000,
+0x22E7,0x0000,0x0000, 0x22E8,0x0000,0x0000, 0x22E9,0x0000,0x0000,
+0x22EA,0x0000,0x0000, 0x22EB,0x0000,0x0000, 0x22EC,0x0000,0x0000,
+0x22ED,0x0000,0x0000, 0x22EE,0x0000,0x0000, 0x22EF,0x0000,0x0000,
+0x22F0,0x0000,0x0000, 0x22F1,0x0000,0x0000, 0x22F2,0x0000,0x0000,
+0x22F3,0x0000,0x0000, 0x22F4,0x0000,0x0000, 0x22F5,0x0000,0x0000,
+0x22F6,0x0000,0x0000, 0x22F7,0x0000,0x0000, 0x22F8,0x0000,0x0000,
+0x22F9,0x0000,0x0000, 0x22FA,0x0000,0x0000, 0x22FB,0x0000,0x0000,
+0x22FC,0x0000,0x0000, 0x22FD,0x0000,0x0000, 0x22FE,0x0000,0x0000,
+0x22FF,0x0000,0x0000, 0x2300,0x0000,0x0000, 0x2301,0x0000,0x0000,
+0x2302,0x0000,0x0000, 0x2303,0x0000,0x0000, 0x2304,0x0000,0x0000,
+0x2305,0x0000,0x0000, 0x2306,0x0000,0x0000, 0x2307,0x0000,0x0000,
+0x2308,0x0000,0x0000, 0x2309,0x0000,0x0000, 0x230A,0x0000,0x0000,
+0x230B,0x0000,0x0000, 0x230C,0x0000,0x0000, 0x230D,0x0000,0x0000,
+0x230E,0x0000,0x0000, 0x230F,0x0000,0x0000, 0x2310,0x0000,0x0000,
+0x2311,0x0000,0x0000, 0x2312,0x0000,0x0000, 0x2313,0x0000,0x0000,
+0x2314,0x0000,0x0000, 0x2315,0x0000,0x0000, 0x2316,0x0000,0x0000,
+0x2317,0x0000,0x0000, 0x2318,0x0000,0x0000, 0x2319,0x0000,0x0000,
+0x231A,0x0000,0x0000, 0x231B,0x0000,0x0000, 0x231C,0x0000,0x0000,
+0x231D,0x0000,0x0000, 0x231E,0x0000,0x0000, 0x231F,0x0000,0x0000,
+0x2320,0x0000,0x0000, 0x2321,0x0000,0x0000, 0x2322,0x0000,0x0000,
+0x2323,0x0000,0x0000, 0x2324,0x0000,0x0000, 0x2325,0x0000,0x0000,
+0x2326,0x0000,0x0000, 0x2327,0x0000,0x0000, 0x2328,0x0000,0x0000,
+0x2329,0x0000,0x0000, 0x232A,0x0000,0x0000, 0x232B,0x0000,0x0000,
+0x232C,0x0000,0x0000, 0x232D,0x0000,0x0000, 0x232E,0x0000,0x0000,
+0x232F,0x0000,0x0000, 0x2330,0x0000,0x0000, 0x2331,0x0000,0x0000,
+0x2332,0x0000,0x0000, 0x2333,0x0000,0x0000, 0x2334,0x0000,0x0000,
+0x2335,0x0000,0x0000, 0x2336,0x0000,0x0000, 0x2337,0x0000,0x0000,
+0x2338,0x0000,0x0000, 0x2339,0x0000,0x0000, 0x233A,0x0000,0x0000,
+0x233B,0x0000,0x0000, 0x233C,0x0000,0x0000, 0x233D,0x0000,0x0000,
+0xFBC1,0xA48D,0x0000, 0xFBC1,0xA48E,0x0000, 0xFBC1,0xA48F,0x0000,
+0x0BCE,0x0000,0x0000, 0x0BCF,0x0000,0x0000, 0x0BD0,0x0000,0x0000,
+0x0BD1,0x0000,0x0000, 0x0BD2,0x0000,0x0000, 0x0BD3,0x0000,0x0000,
+0x0BD4,0x0000,0x0000, 0x0BD5,0x0000,0x0000, 0x0BD6,0x0000,0x0000,
+0x0BD7,0x0000,0x0000, 0x0BD8,0x0000,0x0000, 0x0BD9,0x0000,0x0000,
+0x0BDA,0x0000,0x0000, 0x0BDB,0x0000,0x0000, 0x0BDC,0x0000,0x0000,
+0x0BDD,0x0000,0x0000, 0x0BDE,0x0000,0x0000, 0x0BDF,0x0000,0x0000,
+0x0BE0,0x0000,0x0000, 0x0BE1,0x0000,0x0000, 0x0BE2,0x0000,0x0000,
+0x0BE3,0x0000,0x0000, 0x0BE4,0x0000,0x0000, 0x0BE5,0x0000,0x0000,
+0x0BE6,0x0000,0x0000, 0x0BE7,0x0000,0x0000, 0x0BE8,0x0000,0x0000,
+0x0BE9,0x0000,0x0000, 0x0BEA,0x0000,0x0000, 0x0BEB,0x0000,0x0000,
+0x0BEC,0x0000,0x0000, 0x0BED,0x0000,0x0000, 0x0BEE,0x0000,0x0000,
+0x0BEF,0x0000,0x0000, 0x0BF0,0x0000,0x0000, 0x0BF1,0x0000,0x0000,
+0x0BF2,0x0000,0x0000, 0x0BF3,0x0000,0x0000, 0x0BF4,0x0000,0x0000,
+0x0BF5,0x0000,0x0000, 0x0BF6,0x0000,0x0000, 0x0BF7,0x0000,0x0000,
+0x0BF8,0x0000,0x0000, 0x0BF9,0x0000,0x0000, 0x0BFA,0x0000,0x0000,
+0x0BFB,0x0000,0x0000, 0x0BFC,0x0000,0x0000, 0x0BFD,0x0000,0x0000,
+0x0BFE,0x0000,0x0000, 0x0BFF,0x0000,0x0000, 0x0C00,0x0000,0x0000,
+0x0C01,0x0000,0x0000, 0x0C02,0x0000,0x0000, 0x0C03,0x0000,0x0000,
+0x0C04,0x0000,0x0000, 0xFBC1,0xA4C7,0x0000, 0xFBC1,0xA4C8,0x0000,
+0xFBC1,0xA4C9,0x0000, 0xFBC1,0xA4CA,0x0000, 0xFBC1,0xA4CB,0x0000,
+0xFBC1,0xA4CC,0x0000, 0xFBC1,0xA4CD,0x0000, 0xFBC1,0xA4CE,0x0000,
+0xFBC1,0xA4CF,0x0000, 0xFBC1,0xA4D0,0x0000, 0xFBC1,0xA4D1,0x0000,
+0xFBC1,0xA4D2,0x0000, 0xFBC1,0xA4D3,0x0000, 0xFBC1,0xA4D4,0x0000,
+0xFBC1,0xA4D5,0x0000, 0xFBC1,0xA4D6,0x0000, 0xFBC1,0xA4D7,0x0000,
+0xFBC1,0xA4D8,0x0000, 0xFBC1,0xA4D9,0x0000, 0xFBC1,0xA4DA,0x0000,
+0xFBC1,0xA4DB,0x0000, 0xFBC1,0xA4DC,0x0000, 0xFBC1,0xA4DD,0x0000,
+0xFBC1,0xA4DE,0x0000, 0xFBC1,0xA4DF,0x0000, 0xFBC1,0xA4E0,0x0000,
+0xFBC1,0xA4E1,0x0000, 0xFBC1,0xA4E2,0x0000, 0xFBC1,0xA4E3,0x0000,
+0xFBC1,0xA4E4,0x0000, 0xFBC1,0xA4E5,0x0000, 0xFBC1,0xA4E6,0x0000,
+0xFBC1,0xA4E7,0x0000, 0xFBC1,0xA4E8,0x0000, 0xFBC1,0xA4E9,0x0000,
+0xFBC1,0xA4EA,0x0000, 0xFBC1,0xA4EB,0x0000, 0xFBC1,0xA4EC,0x0000,
+0xFBC1,0xA4ED,0x0000, 0xFBC1,0xA4EE,0x0000, 0xFBC1,0xA4EF,0x0000,
+0xFBC1,0xA4F0,0x0000, 0xFBC1,0xA4F1,0x0000, 0xFBC1,0xA4F2,0x0000,
+0xFBC1,0xA4F3,0x0000, 0xFBC1,0xA4F4,0x0000, 0xFBC1,0xA4F5,0x0000,
+0xFBC1,0xA4F6,0x0000, 0xFBC1,0xA4F7,0x0000, 0xFBC1,0xA4F8,0x0000,
+0xFBC1,0xA4F9,0x0000, 0xFBC1,0xA4FA,0x0000, 0xFBC1,0xA4FB,0x0000,
+0xFBC1,0xA4FC,0x0000, 0xFBC1,0xA4FD,0x0000, 0xFBC1,0xA4FE,0x0000,
+0xFBC1,0xA4FF,0x0000 };
+
+uint16 page0F9data[]= { /* F900 (3 weights per char) */
+0xFB41,0x8C48,0x0000, 0xFB40,0xE6F4,0x0000, 0xFB41,0x8ECA,0x0000,
+0xFB41,0x8CC8,0x0000, 0xFB40,0xEED1,0x0000, 0xFB40,0xCE32,0x0000,
+0xFB40,0xD3E5,0x0000, 0xFB41,0x9F9C,0x0000, 0xFB41,0x9F9C,0x0000,
+0xFB40,0xD951,0x0000, 0xFB41,0x91D1,0x0000, 0xFB40,0xD587,0x0000,
+0xFB40,0xD948,0x0000, 0xFB40,0xE1F6,0x0000, 0xFB40,0xF669,0x0000,
+0xFB40,0xFF85,0x0000, 0xFB41,0x863F,0x0000, 0xFB41,0x87BA,0x0000,
+0xFB41,0x88F8,0x0000, 0xFB41,0x908F,0x0000, 0xFB40,0xEA02,0x0000,
+0xFB40,0xED1B,0x0000, 0xFB40,0xF0D9,0x0000, 0xFB40,0xF3DE,0x0000,
+0xFB41,0x843D,0x0000, 0xFB41,0x916A,0x0000, 0xFB41,0x99F1,0x0000,
+0xFB40,0xCE82,0x0000, 0xFB40,0xD375,0x0000, 0xFB40,0xEB04,0x0000,
+0xFB40,0xF21B,0x0000, 0xFB41,0x862D,0x0000, 0xFB41,0x9E1E,0x0000,
+0xFB40,0xDD50,0x0000, 0xFB40,0xEFEB,0x0000, 0xFB41,0x85CD,0x0000,
+0xFB41,0x8964,0x0000, 0xFB40,0xE2C9,0x0000, 0xFB41,0x81D8,0x0000,
+0xFB41,0x881F,0x0000, 0xFB40,0xDECA,0x0000, 0xFB40,0xE717,0x0000,
+0xFB40,0xED6A,0x0000, 0xFB40,0xF2FC,0x0000, 0xFB41,0x90CE,0x0000,
+0xFB40,0xCF86,0x0000, 0xFB40,0xD1B7,0x0000, 0xFB40,0xD2DE,0x0000,
+0xFB40,0xE4C4,0x0000, 0xFB40,0xEAD3,0x0000, 0xFB40,0xF210,0x0000,
+0xFB40,0xF6E7,0x0000, 0xFB41,0x8001,0x0000, 0xFB41,0x8606,0x0000,
+0xFB41,0x865C,0x0000, 0xFB41,0x8DEF,0x0000, 0xFB41,0x9732,0x0000,
+0xFB41,0x9B6F,0x0000, 0xFB41,0x9DFA,0x0000, 0xFB40,0xF88C,0x0000,
+0xFB40,0xF97F,0x0000, 0xFB40,0xFDA0,0x0000, 0xFB41,0x83C9,0x0000,
+0xFB41,0x9304,0x0000, 0xFB41,0x9E7F,0x0000, 0xFB41,0x8AD6,0x0000,
+0xFB40,0xD8DF,0x0000, 0xFB40,0xDF04,0x0000, 0xFB40,0xFC60,0x0000,
+0xFB41,0x807E,0x0000, 0xFB40,0xF262,0x0000, 0xFB40,0xF8CA,0x0000,
+0xFB41,0x8CC2,0x0000, 0xFB41,0x96F7,0x0000, 0xFB40,0xD8D8,0x0000,
+0xFB40,0xDC62,0x0000, 0xFB40,0xEA13,0x0000, 0xFB40,0xEDDA,0x0000,
+0xFB40,0xEF0F,0x0000, 0xFB40,0xFD2F,0x0000, 0xFB40,0xFE37,0x0000,
+0xFB41,0x964B,0x0000, 0xFB40,0xD2D2,0x0000, 0xFB41,0x808B,0x0000,
+0xFB40,0xD1DC,0x0000, 0xFB40,0xD1CC,0x0000, 0xFB40,0xFA1C,0x0000,
+0xFB40,0xFDBE,0x0000, 0xFB41,0x83F1,0x0000, 0xFB41,0x9675,0x0000,
+0xFB41,0x8B80,0x0000, 0xFB40,0xE2CF,0x0000, 0xFB40,0xEA02,0x0000,
+0xFB41,0x8AFE,0x0000, 0xFB40,0xCE39,0x0000, 0xFB40,0xDBE7,0x0000,
+0xFB40,0xE012,0x0000, 0xFB40,0xF387,0x0000, 0xFB40,0xF570,0x0000,
+0xFB40,0xD317,0x0000, 0xFB40,0xF8FB,0x0000, 0xFB40,0xCFBF,0x0000,
+0xFB40,0xDFA9,0x0000, 0xFB40,0xCE0D,0x0000, 0xFB40,0xECCC,0x0000,
+0xFB40,0xE578,0x0000, 0xFB40,0xFD22,0x0000, 0xFB40,0xD3C3,0x0000,
+0xFB40,0xD85E,0x0000, 0xFB40,0xF701,0x0000, 0xFB41,0x8449,0x0000,
+0xFB41,0x8AAA,0x0000, 0xFB40,0xEBBA,0x0000, 0xFB41,0x8FB0,0x0000,
+0xFB40,0xEC88,0x0000, 0xFB40,0xE2FE,0x0000, 0xFB41,0x82E5,0x0000,
+0xFB40,0xE3A0,0x0000, 0xFB40,0xF565,0x0000, 0xFB40,0xCEAE,0x0000,
+0xFB40,0xD169,0x0000, 0xFB40,0xD1C9,0x0000, 0xFB40,0xE881,0x0000,
+0xFB40,0xFCE7,0x0000, 0xFB41,0x826F,0x0000, 0xFB41,0x8AD2,0x0000,
+0xFB41,0x91CF,0x0000, 0xFB40,0xD2F5,0x0000, 0xFB40,0xD442,0x0000,
+0xFB40,0xD973,0x0000, 0xFB40,0xDEEC,0x0000, 0xFB40,0xE5C5,0x0000,
+0xFB40,0xEFFE,0x0000, 0xFB40,0xF92A,0x0000, 0xFB41,0x95AD,0x0000,
+0xFB41,0x9A6A,0x0000, 0xFB41,0x9E97,0x0000, 0xFB41,0x9ECE,0x0000,
+0xFB40,0xD29B,0x0000, 0xFB40,0xE6C6,0x0000, 0xFB40,0xEB77,0x0000,
+0xFB41,0x8F62,0x0000, 0xFB40,0xDE74,0x0000, 0xFB40,0xE190,0x0000,
+0xFB40,0xE200,0x0000, 0xFB40,0xE49A,0x0000, 0xFB40,0xEF23,0x0000,
+0xFB40,0xF149,0x0000, 0xFB40,0xF489,0x0000, 0xFB40,0xF9CA,0x0000,
+0xFB40,0xFDF4,0x0000, 0xFB41,0x806F,0x0000, 0xFB41,0x8F26,0x0000,
+0xFB41,0x84EE,0x0000, 0xFB41,0x9023,0x0000, 0xFB41,0x934A,0x0000,
+0xFB40,0xD217,0x0000, 0xFB40,0xD2A3,0x0000, 0xFB40,0xD4BD,0x0000,
+0xFB40,0xF0C8,0x0000, 0xFB41,0x88C2,0x0000, 0xFB41,0x8AAA,0x0000,
+0xFB40,0xDEC9,0x0000, 0xFB40,0xDFF5,0x0000, 0xFB40,0xE37B,0x0000,
+0xFB40,0xEBAE,0x0000, 0xFB40,0xFC3E,0x0000, 0xFB40,0xF375,0x0000,
+0xFB40,0xCEE4,0x0000, 0xFB40,0xD6F9,0x0000, 0xFB40,0xDBE7,0x0000,
+0xFB40,0xDDBA,0x0000, 0xFB40,0xE01C,0x0000, 0xFB40,0xF3B2,0x0000,
+0xFB40,0xF469,0x0000, 0xFB40,0xFF9A,0x0000, 0xFB41,0x8046,0x0000,
+0xFB41,0x9234,0x0000, 0xFB41,0x96F6,0x0000, 0xFB41,0x9748,0x0000,
+0xFB41,0x9818,0x0000, 0xFB40,0xCF8B,0x0000, 0xFB40,0xF9AE,0x0000,
+0xFB41,0x91B4,0x0000, 0xFB41,0x96B8,0x0000, 0xFB40,0xE0E1,0x0000,
+0xFB40,0xCE86,0x0000, 0xFB40,0xD0DA,0x0000, 0xFB40,0xDBEE,0x0000,
+0xFB40,0xDC3F,0x0000, 0xFB40,0xE599,0x0000, 0xFB40,0xEA02,0x0000,
+0xFB40,0xF1CE,0x0000, 0xFB40,0xF642,0x0000, 0xFB41,0x84FC,0x0000,
+0xFB41,0x907C,0x0000, 0xFB41,0x9F8D,0x0000, 0xFB40,0xE688,0x0000,
+0xFB41,0x962E,0x0000, 0xFB40,0xD289,0x0000, 0xFB40,0xE77B,0x0000,
+0xFB40,0xE7F3,0x0000, 0xFB40,0xED41,0x0000, 0xFB40,0xEE9C,0x0000,
+0xFB40,0xF409,0x0000, 0xFB40,0xF559,0x0000, 0xFB40,0xF86B,0x0000,
+0xFB40,0xFD10,0x0000, 0xFB41,0x985E,0x0000, 0xFB40,0xD16D,0x0000,
+0xFB40,0xE22E,0x0000, 0xFB41,0x9678,0x0000, 0xFB40,0xD02B,0x0000,
+0xFB40,0xDD19,0x0000, 0xFB40,0xEDEA,0x0000, 0xFB41,0x8F2A,0x0000,
+0xFB40,0xDF8B,0x0000, 0xFB40,0xE144,0x0000, 0xFB40,0xE817,0x0000,
+0xFB40,0xF387,0x0000, 0xFB41,0x9686,0x0000, 0xFB40,0xD229,0x0000,
+0xFB40,0xD40F,0x0000, 0xFB40,0xDC65,0x0000, 0xFB40,0xE613,0x0000,
+0xFB40,0xE74E,0x0000, 0xFB40,0xE8A8,0x0000, 0xFB40,0xECE5,0x0000,
+0xFB40,0xF406,0x0000, 0xFB40,0xF5E2,0x0000, 0xFB40,0xFF79,0x0000,
+0xFB41,0x88CF,0x0000, 0xFB41,0x88E1,0x0000, 0xFB41,0x91CC,0x0000,
+0xFB41,0x96E2,0x0000, 0xFB40,0xD33F,0x0000, 0xFB40,0xEEBA,0x0000,
+0xFB40,0xD41D,0x0000, 0xFB40,0xF1D0,0x0000, 0xFB40,0xF498,0x0000,
+0xFB41,0x85FA,0x0000, 0xFB41,0x96A3,0x0000, 0xFB41,0x9C57,0x0000,
+0xFB41,0x9E9F,0x0000, 0xFB40,0xE797,0x0000, 0xFB40,0xEDCB,0x0000,
+0xFB41,0x81E8,0x0000, 0xFB40,0xFACB,0x0000, 0xFB40,0xFB20,0x0000,
+0xFB40,0xFC92,0x0000, 0xFB40,0xF2C0,0x0000, 0xFB40,0xF099,0x0000,
+0xFB41,0x8B58,0x0000, 0xFB40,0xCEC0,0x0000, 0xFB41,0x8336,0x0000,
+0xFB40,0xD23A,0x0000 };
+
+uint16 page0FAdata[]= { /* FA00 (3 weights per char) */
+0xFB40,0xD207,0x0000, 0xFB40,0xDEA6,0x0000, 0xFB40,0xE2D3,0x0000,
+0xFB40,0xFCD6,0x0000, 0xFB40,0xDB85,0x0000, 0xFB40,0xED1E,0x0000,
+0xFB40,0xE6B4,0x0000, 0xFB41,0x8F3B,0x0000, 0xFB41,0x884C,0x0000,
+0xFB41,0x964D,0x0000, 0xFB41,0x898B,0x0000, 0xFB40,0xDED3,0x0000,
+0xFB40,0xD140,0x0000, 0xFB40,0xD5C0,0x0000, 0xFB41,0xFA0E,0x0000,
+0xFB41,0xFA0F,0x0000, 0xFB40,0xD85A,0x0000, 0xFB41,0xFA11,0x0000,
+0xFB40,0xE674,0x0000, 0xFB41,0xFA13,0x0000, 0xFB41,0xFA14,0x0000,
+0xFB40,0xD1DE,0x0000, 0xFB40,0xF32A,0x0000, 0xFB40,0xF6CA,0x0000,
+0xFB40,0xF93C,0x0000, 0xFB40,0xF95E,0x0000, 0xFB40,0xF965,0x0000,
+0xFB40,0xF98F,0x0000, 0xFB41,0x9756,0x0000, 0xFB40,0xFCBE,0x0000,
+0xFB40,0xFFBD,0x0000, 0xFB41,0xFA1F,0x0000, 0xFB41,0x8612,0x0000,
+0xFB41,0xFA21,0x0000, 0xFB41,0x8AF8,0x0000, 0xFB41,0xFA23,0x0000,
+0xFB41,0xFA24,0x0000, 0xFB41,0x9038,0x0000, 0xFB41,0x90FD,0x0000,
+0xFB41,0xFA27,0x0000, 0xFB41,0xFA28,0x0000, 0xFB41,0xFA29,0x0000,
+0xFB41,0x98EF,0x0000, 0xFB41,0x98FC,0x0000, 0xFB41,0x9928,0x0000,
+0xFB41,0x9DB4,0x0000, 0xFBC1,0xFA2E,0x0000, 0xFBC1,0xFA2F,0x0000,
+0xFB40,0xCFAE,0x0000, 0xFB40,0xD0E7,0x0000, 0xFB40,0xD14D,0x0000,
+0xFB40,0xD2C9,0x0000, 0xFB40,0xD2E4,0x0000, 0xFB40,0xD351,0x0000,
+0xFB40,0xD59D,0x0000, 0xFB40,0xD606,0x0000, 0xFB40,0xD668,0x0000,
+0xFB40,0xD840,0x0000, 0xFB40,0xD8A8,0x0000, 0xFB40,0xDC64,0x0000,
+0xFB40,0xDC6E,0x0000, 0xFB40,0xE094,0x0000, 0xFB40,0xE168,0x0000,
+0xFB40,0xE18E,0x0000, 0xFB40,0xE1F2,0x0000, 0xFB40,0xE54F,0x0000,
+0xFB40,0xE5E2,0x0000, 0xFB40,0xE691,0x0000, 0xFB40,0xE885,0x0000,
+0xFB40,0xED77,0x0000, 0xFB40,0xEE1A,0x0000, 0xFB40,0xEF22,0x0000,
+0xFB40,0xF16E,0x0000, 0xFB40,0xF22B,0x0000, 0xFB40,0xF422,0x0000,
+0xFB40,0xF891,0x0000, 0xFB40,0xF93E,0x0000, 0xFB40,0xF949,0x0000,
+0xFB40,0xF948,0x0000, 0xFB40,0xF950,0x0000, 0xFB40,0xF956,0x0000,
+0xFB40,0xF95D,0x0000, 0xFB40,0xF98D,0x0000, 0xFB40,0xF98E,0x0000,
+0xFB40,0xFA40,0x0000, 0xFB40,0xFA81,0x0000, 0xFB40,0xFBC0,0x0000,
+0xFB40,0xFDF4,0x0000, 0xFB40,0xFE09,0x0000, 0xFB40,0xFE41,0x0000,
+0xFB40,0xFF72,0x0000, 0xFB41,0x8005,0x0000, 0xFB41,0x81ED,0x0000,
+0xFB41,0x8279,0x0000, 0xFB41,0x8279,0x0000, 0xFB41,0x8457,0x0000,
+0xFB41,0x8910,0x0000, 0xFB41,0x8996,0x0000, 0xFB41,0x8B01,0x0000,
+0xFB41,0x8B39,0x0000, 0xFB41,0x8CD3,0x0000, 0xFB41,0x8D08,0x0000,
+0xFB41,0x8FB6,0x0000, 0xFB41,0x9038,0x0000, 0xFB41,0x96E3,0x0000,
+0xFB41,0x97FF,0x0000, 0xFB41,0x983B,0x0000, 0xFBC1,0xFA6B,0x0000,
+0xFBC1,0xFA6C,0x0000, 0xFBC1,0xFA6D,0x0000, 0xFBC1,0xFA6E,0x0000,
+0xFBC1,0xFA6F,0x0000, 0xFBC1,0xFA70,0x0000, 0xFBC1,0xFA71,0x0000,
+0xFBC1,0xFA72,0x0000, 0xFBC1,0xFA73,0x0000, 0xFBC1,0xFA74,0x0000,
+0xFBC1,0xFA75,0x0000, 0xFBC1,0xFA76,0x0000, 0xFBC1,0xFA77,0x0000,
+0xFBC1,0xFA78,0x0000, 0xFBC1,0xFA79,0x0000, 0xFBC1,0xFA7A,0x0000,
+0xFBC1,0xFA7B,0x0000, 0xFBC1,0xFA7C,0x0000, 0xFBC1,0xFA7D,0x0000,
+0xFBC1,0xFA7E,0x0000, 0xFBC1,0xFA7F,0x0000, 0xFBC1,0xFA80,0x0000,
+0xFBC1,0xFA81,0x0000, 0xFBC1,0xFA82,0x0000, 0xFBC1,0xFA83,0x0000,
+0xFBC1,0xFA84,0x0000, 0xFBC1,0xFA85,0x0000, 0xFBC1,0xFA86,0x0000,
+0xFBC1,0xFA87,0x0000, 0xFBC1,0xFA88,0x0000, 0xFBC1,0xFA89,0x0000,
+0xFBC1,0xFA8A,0x0000, 0xFBC1,0xFA8B,0x0000, 0xFBC1,0xFA8C,0x0000,
+0xFBC1,0xFA8D,0x0000, 0xFBC1,0xFA8E,0x0000, 0xFBC1,0xFA8F,0x0000,
+0xFBC1,0xFA90,0x0000, 0xFBC1,0xFA91,0x0000, 0xFBC1,0xFA92,0x0000,
+0xFBC1,0xFA93,0x0000, 0xFBC1,0xFA94,0x0000, 0xFBC1,0xFA95,0x0000,
+0xFBC1,0xFA96,0x0000, 0xFBC1,0xFA97,0x0000, 0xFBC1,0xFA98,0x0000,
+0xFBC1,0xFA99,0x0000, 0xFBC1,0xFA9A,0x0000, 0xFBC1,0xFA9B,0x0000,
+0xFBC1,0xFA9C,0x0000, 0xFBC1,0xFA9D,0x0000, 0xFBC1,0xFA9E,0x0000,
+0xFBC1,0xFA9F,0x0000, 0xFBC1,0xFAA0,0x0000, 0xFBC1,0xFAA1,0x0000,
+0xFBC1,0xFAA2,0x0000, 0xFBC1,0xFAA3,0x0000, 0xFBC1,0xFAA4,0x0000,
+0xFBC1,0xFAA5,0x0000, 0xFBC1,0xFAA6,0x0000, 0xFBC1,0xFAA7,0x0000,
+0xFBC1,0xFAA8,0x0000, 0xFBC1,0xFAA9,0x0000, 0xFBC1,0xFAAA,0x0000,
+0xFBC1,0xFAAB,0x0000, 0xFBC1,0xFAAC,0x0000, 0xFBC1,0xFAAD,0x0000,
+0xFBC1,0xFAAE,0x0000, 0xFBC1,0xFAAF,0x0000, 0xFBC1,0xFAB0,0x0000,
+0xFBC1,0xFAB1,0x0000, 0xFBC1,0xFAB2,0x0000, 0xFBC1,0xFAB3,0x0000,
+0xFBC1,0xFAB4,0x0000, 0xFBC1,0xFAB5,0x0000, 0xFBC1,0xFAB6,0x0000,
+0xFBC1,0xFAB7,0x0000, 0xFBC1,0xFAB8,0x0000, 0xFBC1,0xFAB9,0x0000,
+0xFBC1,0xFABA,0x0000, 0xFBC1,0xFABB,0x0000, 0xFBC1,0xFABC,0x0000,
+0xFBC1,0xFABD,0x0000, 0xFBC1,0xFABE,0x0000, 0xFBC1,0xFABF,0x0000,
+0xFBC1,0xFAC0,0x0000, 0xFBC1,0xFAC1,0x0000, 0xFBC1,0xFAC2,0x0000,
+0xFBC1,0xFAC3,0x0000, 0xFBC1,0xFAC4,0x0000, 0xFBC1,0xFAC5,0x0000,
+0xFBC1,0xFAC6,0x0000, 0xFBC1,0xFAC7,0x0000, 0xFBC1,0xFAC8,0x0000,
+0xFBC1,0xFAC9,0x0000, 0xFBC1,0xFACA,0x0000, 0xFBC1,0xFACB,0x0000,
+0xFBC1,0xFACC,0x0000, 0xFBC1,0xFACD,0x0000, 0xFBC1,0xFACE,0x0000,
+0xFBC1,0xFACF,0x0000, 0xFBC1,0xFAD0,0x0000, 0xFBC1,0xFAD1,0x0000,
+0xFBC1,0xFAD2,0x0000, 0xFBC1,0xFAD3,0x0000, 0xFBC1,0xFAD4,0x0000,
+0xFBC1,0xFAD5,0x0000, 0xFBC1,0xFAD6,0x0000, 0xFBC1,0xFAD7,0x0000,
+0xFBC1,0xFAD8,0x0000, 0xFBC1,0xFAD9,0x0000, 0xFBC1,0xFADA,0x0000,
+0xFBC1,0xFADB,0x0000, 0xFBC1,0xFADC,0x0000, 0xFBC1,0xFADD,0x0000,
+0xFBC1,0xFADE,0x0000, 0xFBC1,0xFADF,0x0000, 0xFBC1,0xFAE0,0x0000,
+0xFBC1,0xFAE1,0x0000, 0xFBC1,0xFAE2,0x0000, 0xFBC1,0xFAE3,0x0000,
+0xFBC1,0xFAE4,0x0000, 0xFBC1,0xFAE5,0x0000, 0xFBC1,0xFAE6,0x0000,
+0xFBC1,0xFAE7,0x0000, 0xFBC1,0xFAE8,0x0000, 0xFBC1,0xFAE9,0x0000,
+0xFBC1,0xFAEA,0x0000, 0xFBC1,0xFAEB,0x0000, 0xFBC1,0xFAEC,0x0000,
+0xFBC1,0xFAED,0x0000, 0xFBC1,0xFAEE,0x0000, 0xFBC1,0xFAEF,0x0000,
+0xFBC1,0xFAF0,0x0000, 0xFBC1,0xFAF1,0x0000, 0xFBC1,0xFAF2,0x0000,
+0xFBC1,0xFAF3,0x0000, 0xFBC1,0xFAF4,0x0000, 0xFBC1,0xFAF5,0x0000,
+0xFBC1,0xFAF6,0x0000, 0xFBC1,0xFAF7,0x0000, 0xFBC1,0xFAF8,0x0000,
+0xFBC1,0xFAF9,0x0000, 0xFBC1,0xFAFA,0x0000, 0xFBC1,0xFAFB,0x0000,
+0xFBC1,0xFAFC,0x0000, 0xFBC1,0xFAFD,0x0000, 0xFBC1,0xFAFE,0x0000,
+0xFBC1,0xFAFF,0x0000 };
+
+uint16 page0FBdata[]= { /* FB00 (4 weights per char) */
+0x0EB9,0x0EB9,0x0000,0x0000, 0x0EB9,0x0EFB,0x0000,0x0000,
+0x0EB9,0x0F2E,0x0000,0x0000, 0x0EB9,0x0EB9,0x0EFB,0x0000,
+0x0EB9,0x0EB9,0x0F2E,0x0000, 0x0FEA,0x1002,0x0000,0x0000,
+0x0FEA,0x1002,0x0000,0x0000, 0xFBC1,0xFB07,0x0000,0x0000,
+0xFBC1,0xFB08,0x0000,0x0000, 0xFBC1,0xFB09,0x0000,0x0000,
+0xFBC1,0xFB0A,0x0000,0x0000, 0xFBC1,0xFB0B,0x0000,0x0000,
+0xFBC1,0xFB0C,0x0000,0x0000, 0xFBC1,0xFB0D,0x0000,0x0000,
+0xFBC1,0xFB0E,0x0000,0x0000, 0xFBC1,0xFB0F,0x0000,0x0000,
+0xFBC1,0xFB10,0x0000,0x0000, 0xFBC1,0xFB11,0x0000,0x0000,
+0xFBC1,0xFB12,0x0000,0x0000, 0x131D,0x131F,0x0000,0x0000,
+0x131D,0x130E,0x0000,0x0000, 0x131D,0x1314,0x0000,0x0000,
+0x1327,0x131F,0x0000,0x0000, 0x131D,0x1316,0x0000,0x0000,
+0xFBC1,0xFB18,0x0000,0x0000, 0xFBC1,0xFB19,0x0000,0x0000,
+0xFBC1,0xFB1A,0x0000,0x0000, 0xFBC1,0xFB1B,0x0000,0x0000,
+0xFBC1,0xFB1C,0x0000,0x0000, 0x133A,0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000,0x0000, 0x133A,0x133A,0x0000,0x0000,
+0x1340,0x0000,0x0000,0x0000, 0x1331,0x0000,0x0000,0x0000,
+0x1334,0x0000,0x0000,0x0000, 0x1335,0x0000,0x0000,0x0000,
+0x133B,0x0000,0x0000,0x0000, 0x133C,0x0000,0x0000,0x0000,
+0x133D,0x0000,0x0000,0x0000, 0x1344,0x0000,0x0000,0x0000,
+0x1346,0x0000,0x0000,0x0000, 0x0428,0x0000,0x0000,0x0000,
+0x1345,0x0000,0x0000,0x0000, 0x1345,0x0000,0x0000,0x0000,
+0x1345,0x0000,0x0000,0x0000, 0x1345,0x0000,0x0000,0x0000,
+0x1331,0x0000,0x0000,0x0000, 0x1331,0x0000,0x0000,0x0000,
+0x1331,0x0000,0x0000,0x0000, 0x1332,0x0000,0x0000,0x0000,
+0x1333,0x0000,0x0000,0x0000, 0x1334,0x0000,0x0000,0x0000,
+0x1335,0x0000,0x0000,0x0000, 0x1336,0x0000,0x0000,0x0000,
+0x1337,0x0000,0x0000,0x0000, 0xFBC1,0xFB37,0x0000,0x0000,
+0x1339,0x0000,0x0000,0x0000, 0x133A,0x0000,0x0000,0x0000,
+0x133B,0x0000,0x0000,0x0000, 0x133B,0x0000,0x0000,0x0000,
+0x133C,0x0000,0x0000,0x0000, 0xFBC1,0xFB3D,0x0000,0x0000,
+0x133D,0x0000,0x0000,0x0000, 0xFBC1,0xFB3F,0x0000,0x0000,
+0x133E,0x0000,0x0000,0x0000, 0x133F,0x0000,0x0000,0x0000,
+0xFBC1,0xFB42,0x0000,0x0000, 0x1341,0x0000,0x0000,0x0000,
+0x1341,0x0000,0x0000,0x0000, 0xFBC1,0xFB45,0x0000,0x0000,
+0x1342,0x0000,0x0000,0x0000, 0x1343,0x0000,0x0000,0x0000,
+0x1344,0x0000,0x0000,0x0000, 0x1345,0x0000,0x0000,0x0000,
+0x1346,0x0000,0x0000,0x0000, 0x1336,0x0000,0x0000,0x0000,
+0x1332,0x0000,0x0000,0x0000, 0x133B,0x0000,0x0000,0x0000,
+0x1341,0x0000,0x0000,0x0000, 0x1331,0x133C,0x0000,0x0000,
+0x134B,0x0000,0x0000,0x0000, 0x134B,0x0000,0x0000,0x0000,
+0x1353,0x0000,0x0000,0x0000, 0x1353,0x0000,0x0000,0x0000,
+0x1353,0x0000,0x0000,0x0000, 0x1353,0x0000,0x0000,0x0000,
+0x1354,0x0000,0x0000,0x0000, 0x1354,0x0000,0x0000,0x0000,
+0x1354,0x0000,0x0000,0x0000, 0x1354,0x0000,0x0000,0x0000,
+0x1355,0x0000,0x0000,0x0000, 0x1355,0x0000,0x0000,0x0000,
+0x1355,0x0000,0x0000,0x0000, 0x1355,0x0000,0x0000,0x0000,
+0x135A,0x0000,0x0000,0x0000, 0x135A,0x0000,0x0000,0x0000,
+0x135A,0x0000,0x0000,0x0000, 0x135A,0x0000,0x0000,0x0000,
+0x135D,0x0000,0x0000,0x0000, 0x135D,0x0000,0x0000,0x0000,
+0x135D,0x0000,0x0000,0x0000, 0x135D,0x0000,0x0000,0x0000,
+0x1359,0x0000,0x0000,0x0000, 0x1359,0x0000,0x0000,0x0000,
+0x1359,0x0000,0x0000,0x0000, 0x1359,0x0000,0x0000,0x0000,
+0x1397,0x0000,0x0000,0x0000, 0x1397,0x0000,0x0000,0x0000,
+0x1397,0x0000,0x0000,0x0000, 0x1397,0x0000,0x0000,0x0000,
+0x1399,0x0000,0x0000,0x0000, 0x1399,0x0000,0x0000,0x0000,
+0x1399,0x0000,0x0000,0x0000, 0x1399,0x0000,0x0000,0x0000,
+0x1360,0x0000,0x0000,0x0000, 0x1360,0x0000,0x0000,0x0000,
+0x1360,0x0000,0x0000,0x0000, 0x1360,0x0000,0x0000,0x0000,
+0x135F,0x0000,0x0000,0x0000, 0x135F,0x0000,0x0000,0x0000,
+0x135F,0x0000,0x0000,0x0000, 0x135F,0x0000,0x0000,0x0000,
+0x1361,0x0000,0x0000,0x0000, 0x1361,0x0000,0x0000,0x0000,
+0x1361,0x0000,0x0000,0x0000, 0x1361,0x0000,0x0000,0x0000,
+0x1363,0x0000,0x0000,0x0000, 0x1363,0x0000,0x0000,0x0000,
+0x1363,0x0000,0x0000,0x0000, 0x1363,0x0000,0x0000,0x0000,
+0x1370,0x0000,0x0000,0x0000, 0x1370,0x0000,0x0000,0x0000,
+0x136F,0x0000,0x0000,0x0000, 0x136F,0x0000,0x0000,0x0000,
+0x1371,0x0000,0x0000,0x0000, 0x1371,0x0000,0x0000,0x0000,
+0x136B,0x0000,0x0000,0x0000, 0x136B,0x0000,0x0000,0x0000,
+0x137E,0x0000,0x0000,0x0000, 0x137E,0x0000,0x0000,0x0000,
+0x1377,0x0000,0x0000,0x0000, 0x1377,0x0000,0x0000,0x0000,
+0x139F,0x0000,0x0000,0x0000, 0x139F,0x0000,0x0000,0x0000,
+0x139F,0x0000,0x0000,0x0000, 0x139F,0x0000,0x0000,0x0000,
+0x13A5,0x0000,0x0000,0x0000, 0x13A5,0x0000,0x0000,0x0000,
+0x13A5,0x0000,0x0000,0x0000, 0x13A5,0x0000,0x0000,0x0000,
+0x13A9,0x0000,0x0000,0x0000, 0x13A9,0x0000,0x0000,0x0000,
+0x13A9,0x0000,0x0000,0x0000, 0x13A9,0x0000,0x0000,0x0000,
+0x13A7,0x0000,0x0000,0x0000, 0x13A7,0x0000,0x0000,0x0000,
+0x13A7,0x0000,0x0000,0x0000, 0x13A7,0x0000,0x0000,0x0000,
+0x13B2,0x0000,0x0000,0x0000, 0x13B2,0x0000,0x0000,0x0000,
+0x13B3,0x0000,0x0000,0x0000, 0x13B3,0x0000,0x0000,0x0000,
+0x13B3,0x0000,0x0000,0x0000, 0x13B3,0x0000,0x0000,0x0000,
+0x13BC,0x0000,0x0000,0x0000, 0x13BC,0x0000,0x0000,0x0000,
+0x13B9,0x0000,0x0000,0x0000, 0x13B9,0x0000,0x0000,0x0000,
+0x13B9,0x0000,0x0000,0x0000, 0x13B9,0x0000,0x0000,0x0000,
+0x13B8,0x0000,0x0000,0x0000, 0x13B8,0x0000,0x0000,0x0000,
+0x13B8,0x0000,0x0000,0x0000, 0x13B8,0x0000,0x0000,0x0000,
+0x13CE,0x0000,0x0000,0x0000, 0x13CE,0x0000,0x0000,0x0000,
+0x13CE,0x0000,0x0000,0x0000, 0x13CE,0x0000,0x0000,0x0000,
+0xFBC1,0xFBB2,0x0000,0x0000, 0xFBC1,0xFBB3,0x0000,0x0000,
+0xFBC1,0xFBB4,0x0000,0x0000, 0xFBC1,0xFBB5,0x0000,0x0000,
+0xFBC1,0xFBB6,0x0000,0x0000, 0xFBC1,0xFBB7,0x0000,0x0000,
+0xFBC1,0xFBB8,0x0000,0x0000, 0xFBC1,0xFBB9,0x0000,0x0000,
+0xFBC1,0xFBBA,0x0000,0x0000, 0xFBC1,0xFBBB,0x0000,0x0000,
+0xFBC1,0xFBBC,0x0000,0x0000, 0xFBC1,0xFBBD,0x0000,0x0000,
+0xFBC1,0xFBBE,0x0000,0x0000, 0xFBC1,0xFBBF,0x0000,0x0000,
+0xFBC1,0xFBC0,0x0000,0x0000, 0xFBC1,0xFBC1,0x0000,0x0000,
+0xFBC1,0xFBC2,0x0000,0x0000, 0xFBC1,0xFBC3,0x0000,0x0000,
+0xFBC1,0xFBC4,0x0000,0x0000, 0xFBC1,0xFBC5,0x0000,0x0000,
+0xFBC1,0xFBC6,0x0000,0x0000, 0xFBC1,0xFBC7,0x0000,0x0000,
+0xFBC1,0xFBC8,0x0000,0x0000, 0xFBC1,0xFBC9,0x0000,0x0000,
+0xFBC1,0xFBCA,0x0000,0x0000, 0xFBC1,0xFBCB,0x0000,0x0000,
+0xFBC1,0xFBCC,0x0000,0x0000, 0xFBC1,0xFBCD,0x0000,0x0000,
+0xFBC1,0xFBCE,0x0000,0x0000, 0xFBC1,0xFBCF,0x0000,0x0000,
+0xFBC1,0xFBD0,0x0000,0x0000, 0xFBC1,0xFBD1,0x0000,0x0000,
+0xFBC1,0xFBD2,0x0000,0x0000, 0x13A3,0x0000,0x0000,0x0000,
+0x13A3,0x0000,0x0000,0x0000, 0x13A3,0x0000,0x0000,0x0000,
+0x13A3,0x0000,0x0000,0x0000, 0x13C1,0x0000,0x0000,0x0000,
+0x13C1,0x0000,0x0000,0x0000, 0x13C0,0x0000,0x0000,0x0000,
+0x13C0,0x0000,0x0000,0x0000, 0x13C2,0x0000,0x0000,0x0000,
+0x13C2,0x0000,0x0000,0x0000, 0x13C1,0x1347,0x0000,0x0000,
+0x13C5,0x0000,0x0000,0x0000, 0x13C5,0x0000,0x0000,0x0000,
+0x13BF,0x0000,0x0000,0x0000, 0x13BF,0x0000,0x0000,0x0000,
+0x13C3,0x0000,0x0000,0x0000, 0x13C3,0x0000,0x0000,0x0000,
+0x13CC,0x0000,0x0000,0x0000, 0x13CC,0x0000,0x0000,0x0000,
+0x13CC,0x0000,0x0000,0x0000, 0x13CC,0x0000,0x0000,0x0000,
+0x13C7,0x0000,0x0000,0x0000, 0x13C7,0x0000,0x0000,0x0000,
+0x134F,0x1350,0x0000,0x0000, 0x134F,0x1350,0x0000,0x0000,
+0x134F,0x13BC,0x0000,0x0000, 0x134F,0x13BC,0x0000,0x0000,
+0x134F,0x13BD,0x0000,0x0000, 0x134F,0x13BD,0x0000,0x0000,
+0x134F,0x13C1,0x0000,0x0000, 0x134F,0x13C1,0x0000,0x0000,
+0x134F,0x13C0,0x0000,0x0000, 0x134F,0x13C0,0x0000,0x0000,
+0x134F,0x13C2,0x0000,0x0000, 0x134F,0x13C2,0x0000,0x0000,
+0x134F,0x13CC,0x0000,0x0000, 0x134F,0x13CC,0x0000,0x0000,
+0x134F,0x13CC,0x0000,0x0000, 0x134F,0x13C7,0x0000,0x0000,
+0x134F,0x13C7,0x0000,0x0000, 0x134F,0x13C7,0x0000,0x0000,
+0x13C9,0x0000,0x0000,0x0000, 0x13C9,0x0000,0x0000,0x0000,
+0x13C9,0x0000,0x0000,0x0000, 0x13C9,0x0000,0x0000,0x0000
+};
+
+uint16 page0FCdata[]= { /* FC00 (3 weights per char) */
+0x134F,0x135E,0x0000, 0x134F,0x1364,0x0000, 0x134F,0x13B0,0x0000,
+0x134F,0x13C7,0x0000, 0x134F,0x13C8,0x0000, 0x1352,0x135E,0x0000,
+0x1352,0x1364,0x0000, 0x1352,0x1365,0x0000, 0x1352,0x13B0,0x0000,
+0x1352,0x13C7,0x0000, 0x1352,0x13C8,0x0000, 0x1357,0x135E,0x0000,
+0x1357,0x1364,0x0000, 0x1357,0x1365,0x0000, 0x1357,0x13B0,0x0000,
+0x1357,0x13C7,0x0000, 0x1357,0x13C8,0x0000, 0x1358,0x135E,0x0000,
+0x1358,0x13B0,0x0000, 0x1358,0x13C7,0x0000, 0x1358,0x13C8,0x0000,
+0x135E,0x1364,0x0000, 0x135E,0x13B0,0x0000, 0x1364,0x135E,0x0000,
+0x1364,0x13B0,0x0000, 0x1365,0x135E,0x0000, 0x1365,0x1364,0x0000,
+0x1365,0x13B0,0x0000, 0x1381,0x135E,0x0000, 0x1381,0x1364,0x0000,
+0x1381,0x1365,0x0000, 0x1381,0x13B0,0x0000, 0x1387,0x1364,0x0000,
+0x1387,0x13B0,0x0000, 0x1388,0x135E,0x0000, 0x1388,0x1364,0x0000,
+0x1388,0x1365,0x0000, 0x1388,0x13B0,0x0000, 0x138C,0x1364,0x0000,
+0x138C,0x13B0,0x0000, 0x138D,0x13B0,0x0000, 0x138F,0x135E,0x0000,
+0x138F,0x13B0,0x0000, 0x1390,0x135E,0x0000, 0x1390,0x13B0,0x0000,
+0x1393,0x135E,0x0000, 0x1393,0x1364,0x0000, 0x1393,0x1365,0x0000,
+0x1393,0x13B0,0x0000, 0x1393,0x13C7,0x0000, 0x1393,0x13C8,0x0000,
+0x139B,0x1364,0x0000, 0x139B,0x13B0,0x0000, 0x139B,0x13C7,0x0000,
+0x139B,0x13C8,0x0000, 0x139E,0x1350,0x0000, 0x139E,0x135E,0x0000,
+0x139E,0x1364,0x0000, 0x139E,0x1365,0x0000, 0x139E,0x13AB,0x0000,
+0x139E,0x13B0,0x0000, 0x139E,0x13C7,0x0000, 0x139E,0x13C8,0x0000,
+0x13AB,0x135E,0x0000, 0x13AB,0x1364,0x0000, 0x13AB,0x1365,0x0000,
+0x13AB,0x13B0,0x0000, 0x13AB,0x13C7,0x0000, 0x13AB,0x13C8,0x0000,
+0x13B0,0x135E,0x0000, 0x13B0,0x1364,0x0000, 0x13B0,0x1365,0x0000,
+0x13B0,0x13B0,0x0000, 0x13B0,0x13C7,0x0000, 0x13B0,0x13C8,0x0000,
+0x13B1,0x135E,0x0000, 0x13B1,0x1364,0x0000, 0x13B1,0x1365,0x0000,
+0x13B1,0x13B0,0x0000, 0x13B1,0x13C7,0x0000, 0x13B1,0x13C8,0x0000,
+0x13B7,0x135E,0x0000, 0x13B7,0x13B0,0x0000, 0x13B7,0x13C7,0x0000,
+0x13B7,0x13C8,0x0000, 0x13C8,0x135E,0x0000, 0x13C8,0x1364,0x0000,
+0x13C8,0x1365,0x0000, 0x13C8,0x13B0,0x0000, 0x13C8,0x13C7,0x0000,
+0x13C8,0x13C8,0x0000, 0x136A,0x0000,0x0000, 0x1375,0x0000,0x0000,
+0x13C7,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x134F,0x1375,0x0000, 0x134F,0x1376,0x0000,
+0x134F,0x13B0,0x0000, 0x134F,0x13B1,0x0000, 0x134F,0x13C7,0x0000,
+0x134F,0x13C8,0x0000, 0x1352,0x1375,0x0000, 0x1352,0x1376,0x0000,
+0x1352,0x13B0,0x0000, 0x1352,0x13B1,0x0000, 0x1352,0x13C7,0x0000,
+0x1352,0x13C8,0x0000, 0x1357,0x1375,0x0000, 0x1357,0x1376,0x0000,
+0x1357,0x13B0,0x0000, 0x1357,0x13B1,0x0000, 0x1357,0x13C7,0x0000,
+0x1357,0x13C8,0x0000, 0x1358,0x1375,0x0000, 0x1358,0x1376,0x0000,
+0x1358,0x13B0,0x0000, 0x1358,0x13B1,0x0000, 0x1358,0x13C7,0x0000,
+0x1358,0x13C8,0x0000, 0x1393,0x13C7,0x0000, 0x1393,0x13C8,0x0000,
+0x139B,0x13C7,0x0000, 0x139B,0x13C8,0x0000, 0x139E,0x1350,0x0000,
+0x139E,0x13AB,0x0000, 0x139E,0x13B0,0x0000, 0x139E,0x13C7,0x0000,
+0x139E,0x13C8,0x0000, 0x13AB,0x13B0,0x0000, 0x13AB,0x13C7,0x0000,
+0x13AB,0x13C8,0x0000, 0x13B0,0x1350,0x0000, 0x13B0,0x13B0,0x0000,
+0x13B1,0x1375,0x0000, 0x13B1,0x1376,0x0000, 0x13B1,0x13B0,0x0000,
+0x13B1,0x13B1,0x0000, 0x13B1,0x13C7,0x0000, 0x13B1,0x13C8,0x0000,
+0x13C7,0x0000,0x0000, 0x13C8,0x1375,0x0000, 0x13C8,0x1376,0x0000,
+0x13C8,0x13B0,0x0000, 0x13C8,0x13B1,0x0000, 0x13C8,0x13C7,0x0000,
+0x13C8,0x13C8,0x0000, 0x134F,0x135E,0x0000, 0x134F,0x1364,0x0000,
+0x134F,0x1365,0x0000, 0x134F,0x13B0,0x0000, 0x134F,0x13B7,0x0000,
+0x1352,0x135E,0x0000, 0x1352,0x1364,0x0000, 0x1352,0x1365,0x0000,
+0x1352,0x13B0,0x0000, 0x1352,0x13B7,0x0000, 0x1357,0x135E,0x0000,
+0x1357,0x1364,0x0000, 0x1357,0x1365,0x0000, 0x1357,0x13B0,0x0000,
+0x1357,0x13B7,0x0000, 0x1358,0x13B0,0x0000, 0x135E,0x1364,0x0000,
+0x135E,0x13B0,0x0000, 0x1364,0x135E,0x0000, 0x1364,0x13B0,0x0000,
+0x1365,0x135E,0x0000, 0x1365,0x13B0,0x0000, 0x1381,0x135E,0x0000,
+0x1381,0x1364,0x0000, 0x1381,0x1365,0x0000, 0x1381,0x13B0,0x0000,
+0x1387,0x1364,0x0000, 0x1387,0x1365,0x0000, 0x1387,0x13B0,0x0000,
+0x1388,0x135E,0x0000, 0x1388,0x1364,0x0000, 0x1388,0x1365,0x0000,
+0x1388,0x13B0,0x0000, 0x138C,0x1364,0x0000, 0x138D,0x13B0,0x0000,
+0x138F,0x135E,0x0000, 0x138F,0x13B0,0x0000, 0x1390,0x135E,0x0000,
+0x1390,0x13B0,0x0000, 0x1393,0x135E,0x0000, 0x1393,0x1364,0x0000,
+0x1393,0x1365,0x0000, 0x1393,0x13B0,0x0000, 0x139B,0x1364,0x0000,
+0x139B,0x13B0,0x0000, 0x139E,0x135E,0x0000, 0x139E,0x1364,0x0000,
+0x139E,0x1365,0x0000, 0x139E,0x13AB,0x0000, 0x139E,0x13B0,0x0000,
+0x13AB,0x135E,0x0000, 0x13AB,0x1364,0x0000, 0x13AB,0x1365,0x0000,
+0x13AB,0x13B0,0x0000, 0x13AB,0x13B7,0x0000, 0x13B0,0x135E,0x0000,
+0x13B0,0x1364,0x0000, 0x13B0,0x1365,0x0000, 0x13B0,0x13B0,0x0000,
+0x13B1,0x135E,0x0000, 0x13B1,0x1364,0x0000, 0x13B1,0x1365,0x0000,
+0x13B1,0x13B0,0x0000, 0x13B1,0x13B7,0x0000, 0x13B7,0x135E,0x0000,
+0x13B7,0x13B0,0x0000, 0x13B7,0x0000,0x0000, 0x13C8,0x135E,0x0000,
+0x13C8,0x1364,0x0000, 0x13C8,0x1365,0x0000, 0x13C8,0x13B0,0x0000,
+0x13C8,0x13B7,0x0000, 0x134F,0x13B0,0x0000, 0x134F,0x13B7,0x0000,
+0x1352,0x13B0,0x0000, 0x1352,0x13B7,0x0000, 0x1357,0x13B0,0x0000,
+0x1357,0x13B7,0x0000, 0x1358,0x13B0,0x0000, 0x1358,0x13B7,0x0000,
+0x1381,0x13B0,0x0000, 0x1381,0x13B7,0x0000, 0x1382,0x13B0,0x0000,
+0x1382,0x13B7,0x0000, 0x139E,0x13AB,0x0000, 0x139E,0x13B0,0x0000,
+0x13AB,0x13B0,0x0000, 0x13B1,0x13B0,0x0000, 0x13B1,0x13B7,0x0000,
+0x13C8,0x13B0,0x0000, 0x13C8,0x13B7,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x138C,0x13C7,0x0000,
+0x138C,0x13C8,0x0000, 0x138F,0x13C7,0x0000, 0x138F,0x13C8,0x0000,
+0x1390,0x13C7,0x0000, 0x1390,0x13C8,0x0000, 0x1381,0x13C7,0x0000,
+0x1381,0x13C8,0x0000, 0x1382,0x13C7,0x0000, 0x1382,0x13C8,0x0000,
+0x1364,0x13C7,0x0000 };
+
+uint16 page0FDdata[]= { /* FD00 (9 weights per char) */
+0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1365,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1365,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1388,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1388,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1388,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138C,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138C,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138F,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138F,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1390,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1390,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1364,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1365,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1365,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1388,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1388,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1388,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x13B7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x13B7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138C,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138C,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138D,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1350,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1350,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x02C0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x02C1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD40,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD41,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD42,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD43,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD44,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD45,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD46,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD47,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD48,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD49,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD4A,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD4B,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD4C,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD4D,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD4E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD4F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x1364,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x1364,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x13B0,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x13B0,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1364,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1364,0x13B0,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x1364,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x135E,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x135E,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x13B0,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x1364,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x1364,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x13B0,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x13B0,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1388,0x1364,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1388,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1388,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138C,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138C,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138C,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138C,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138F,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138F,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138F,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138F,0x13B0,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1390,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1390,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1390,0x13B0,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1393,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1393,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x139B,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x139B,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x1364,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x135E,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x135E,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x1364,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x135E,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x1365,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x1365,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD90,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFD91,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x135E,0x1365,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B7,0x13B0,0x135E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B7,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x1364,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x135E,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x13B0,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13C8,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13C8,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1352,0x1365,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x135E,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x1365,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x1365,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1357,0x13B0,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x1364,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x13B0,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x1365,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1382,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1388,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13C8,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13C8,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13C8,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x139B,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x139B,0x13B0,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x1364,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138F,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x139E,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x135E,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x1365,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x139E,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13AB,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x135E,0x1364,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1364,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1393,0x13B0,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1352,0x1364,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x139E,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138F,0x135E,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x13B0,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1381,0x1365,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B1,0x135E,0x13C8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDC8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDC9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDCA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDCB,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDCC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDCD,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDCE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDCF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDD0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDD1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDD2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDD3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDD4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDD5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDD6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDD7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDD8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDD9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDDA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDDB,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDDC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDDD,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDDE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDDF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDE0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDE1,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDE2,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDE3,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDE4,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDE5,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDE6,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDE7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDE8,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDE9,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDEA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDEB,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDEC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDED,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDEE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDEF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x13AB,0x13CE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x139B,0x13AB,0x13CE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1350,0x13AB,0x13AB,0x13B7,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1350,0x139E,0x1352,0x1375,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13B0,0x1364,0x13B0,0x1369,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x13AB,0x138F,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1375,0x1381,0x13BD,0x13AB,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x138F,0x13AB,0x13C8,0x13B7,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x13BD,0x1381,0x13AB,0x13B0,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x1387,0x13AB,0x13C7,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDFA,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x135E,0x13AB,0x0209,0x135E,0x13AB,0x1350,0x13AB,0x13B7,0x0000,
+0x1375,0x13C9,0x1350,0x13AB,0x0000,0x0000,0x0000,0x0000,0x0000,
+0x034F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDFE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+0xFBC1,0xFDFF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
+};
+
+uint16 page0FEdata[]= { /* FE00 (3 weights per char) */
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0xFBC1,0xFE10,0x0000, 0xFBC1,0xFE11,0x0000,
+0xFBC1,0xFE12,0x0000, 0xFBC1,0xFE13,0x0000, 0xFBC1,0xFE14,0x0000,
+0xFBC1,0xFE15,0x0000, 0xFBC1,0xFE16,0x0000, 0xFBC1,0xFE17,0x0000,
+0xFBC1,0xFE18,0x0000, 0xFBC1,0xFE19,0x0000, 0xFBC1,0xFE1A,0x0000,
+0xFBC1,0xFE1B,0x0000, 0xFBC1,0xFE1C,0x0000, 0xFBC1,0xFE1D,0x0000,
+0xFBC1,0xFE1E,0x0000, 0xFBC1,0xFE1F,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC1,0xFE24,0x0000, 0xFBC1,0xFE25,0x0000, 0xFBC1,0xFE26,0x0000,
+0xFBC1,0xFE27,0x0000, 0xFBC1,0xFE28,0x0000, 0xFBC1,0xFE29,0x0000,
+0xFBC1,0xFE2A,0x0000, 0xFBC1,0xFE2B,0x0000, 0xFBC1,0xFE2C,0x0000,
+0xFBC1,0xFE2D,0x0000, 0xFBC1,0xFE2E,0x0000, 0xFBC1,0xFE2F,0x0000,
+0x025D,0x025D,0x0000, 0x0228,0x0000,0x0000, 0x0227,0x0000,0x0000,
+0x021B,0x0000,0x0000, 0x021B,0x0000,0x0000, 0x0288,0x0000,0x0000,
+0x0289,0x0000,0x0000, 0x028C,0x0000,0x0000, 0x028D,0x0000,0x0000,
+0x02B8,0x0000,0x0000, 0x02B9,0x0000,0x0000, 0x02B6,0x0000,0x0000,
+0x02B7,0x0000,0x0000, 0x02B0,0x0000,0x0000, 0x02B1,0x0000,0x0000,
+0x02AE,0x0000,0x0000, 0x02AF,0x0000,0x0000, 0x02B2,0x0000,0x0000,
+0x02B3,0x0000,0x0000, 0x02B4,0x0000,0x0000, 0x02B5,0x0000,0x0000,
+0x0238,0x0000,0x0000, 0x0239,0x0000,0x0000, 0x028A,0x0000,0x0000,
+0x028B,0x0000,0x0000, 0x0211,0x0000,0x0000, 0x0211,0x0000,0x0000,
+0x0211,0x0000,0x0000, 0x0211,0x0000,0x0000, 0x021B,0x0000,0x0000,
+0x021B,0x0000,0x0000, 0x021B,0x0000,0x0000, 0x022F,0x0000,0x0000,
+0x0237,0x0000,0x0000, 0x025D,0x0000,0x0000, 0xFBC1,0xFE53,0x0000,
+0x023A,0x0000,0x0000, 0x023D,0x0000,0x0000, 0x0255,0x0000,0x0000,
+0x0251,0x0000,0x0000, 0x0228,0x0000,0x0000, 0x0288,0x0000,0x0000,
+0x0289,0x0000,0x0000, 0x028C,0x0000,0x0000, 0x028D,0x0000,0x0000,
+0x02B8,0x0000,0x0000, 0x02B9,0x0000,0x0000, 0x02D2,0x0000,0x0000,
+0x02CF,0x0000,0x0000, 0x02C8,0x0000,0x0000, 0x0428,0x0000,0x0000,
+0x0221,0x0000,0x0000, 0x042C,0x0000,0x0000, 0x042E,0x0000,0x0000,
+0x042D,0x0000,0x0000, 0xFBC1,0xFE67,0x0000, 0x02CE,0x0000,0x0000,
+0x0E0F,0x0000,0x0000, 0x02D3,0x0000,0x0000, 0x02C7,0x0000,0x0000,
+0xFBC1,0xFE6C,0x0000, 0xFBC1,0xFE6D,0x0000, 0xFBC1,0xFE6E,0x0000,
+0xFBC1,0xFE6F,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0xFBC1,0xFE75,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x1347,0x0000,0x0000,
+0x1348,0x0000,0x0000, 0x1348,0x0000,0x0000, 0x1349,0x0000,0x0000,
+0x1349,0x0000,0x0000, 0x134C,0x0000,0x0000, 0x134C,0x0000,0x0000,
+0x134D,0x0000,0x0000, 0x134D,0x0000,0x0000, 0x134F,0x0000,0x0000,
+0x134F,0x0000,0x0000, 0x134F,0x0000,0x0000, 0x134F,0x0000,0x0000,
+0x1350,0x0000,0x0000, 0x1350,0x0000,0x0000, 0x1352,0x0000,0x0000,
+0x1352,0x0000,0x0000, 0x1352,0x0000,0x0000, 0x1352,0x0000,0x0000,
+0x1356,0x0000,0x0000, 0x1356,0x0000,0x0000, 0x1357,0x0000,0x0000,
+0x1357,0x0000,0x0000, 0x1357,0x0000,0x0000, 0x1357,0x0000,0x0000,
+0x1358,0x0000,0x0000, 0x1358,0x0000,0x0000, 0x1358,0x0000,0x0000,
+0x1358,0x0000,0x0000, 0x135E,0x0000,0x0000, 0x135E,0x0000,0x0000,
+0x135E,0x0000,0x0000, 0x135E,0x0000,0x0000, 0x1364,0x0000,0x0000,
+0x1364,0x0000,0x0000, 0x1364,0x0000,0x0000, 0x1364,0x0000,0x0000,
+0x1365,0x0000,0x0000, 0x1365,0x0000,0x0000, 0x1365,0x0000,0x0000,
+0x1365,0x0000,0x0000, 0x1369,0x0000,0x0000, 0x1369,0x0000,0x0000,
+0x136A,0x0000,0x0000, 0x136A,0x0000,0x0000, 0x1375,0x0000,0x0000,
+0x1375,0x0000,0x0000, 0x1376,0x0000,0x0000, 0x1376,0x0000,0x0000,
+0x1381,0x0000,0x0000, 0x1381,0x0000,0x0000, 0x1381,0x0000,0x0000,
+0x1381,0x0000,0x0000, 0x1382,0x0000,0x0000, 0x1382,0x0000,0x0000,
+0x1382,0x0000,0x0000, 0x1382,0x0000,0x0000, 0x1387,0x0000,0x0000,
+0x1387,0x0000,0x0000, 0x1387,0x0000,0x0000, 0x1387,0x0000,0x0000,
+0x1388,0x0000,0x0000, 0x1388,0x0000,0x0000, 0x1388,0x0000,0x0000,
+0x1388,0x0000,0x0000, 0x138C,0x0000,0x0000, 0x138C,0x0000,0x0000,
+0x138C,0x0000,0x0000, 0x138C,0x0000,0x0000, 0x138D,0x0000,0x0000,
+0x138D,0x0000,0x0000, 0x138D,0x0000,0x0000, 0x138D,0x0000,0x0000,
+0x138F,0x0000,0x0000, 0x138F,0x0000,0x0000, 0x138F,0x0000,0x0000,
+0x138F,0x0000,0x0000, 0x1390,0x0000,0x0000, 0x1390,0x0000,0x0000,
+0x1390,0x0000,0x0000, 0x1390,0x0000,0x0000, 0x1393,0x0000,0x0000,
+0x1393,0x0000,0x0000, 0x1393,0x0000,0x0000, 0x1393,0x0000,0x0000,
+0x139B,0x0000,0x0000, 0x139B,0x0000,0x0000, 0x139B,0x0000,0x0000,
+0x139B,0x0000,0x0000, 0x139E,0x0000,0x0000, 0x139E,0x0000,0x0000,
+0x139E,0x0000,0x0000, 0x139E,0x0000,0x0000, 0x13AB,0x0000,0x0000,
+0x13AB,0x0000,0x0000, 0x13AB,0x0000,0x0000, 0x13AB,0x0000,0x0000,
+0x13B0,0x0000,0x0000, 0x13B0,0x0000,0x0000, 0x13B0,0x0000,0x0000,
+0x13B0,0x0000,0x0000, 0x13B1,0x0000,0x0000, 0x13B1,0x0000,0x0000,
+0x13B1,0x0000,0x0000, 0x13B1,0x0000,0x0000, 0x13B7,0x0000,0x0000,
+0x13B7,0x0000,0x0000, 0x13B7,0x0000,0x0000, 0x13B7,0x0000,0x0000,
+0x13BD,0x0000,0x0000, 0x13BD,0x0000,0x0000, 0x13C7,0x0000,0x0000,
+0x13C7,0x0000,0x0000, 0x13C8,0x0000,0x0000, 0x13C8,0x0000,0x0000,
+0x13C8,0x0000,0x0000, 0x13C8,0x0000,0x0000, 0x13AB,0x1348,0x0000,
+0x13AB,0x1348,0x0000, 0x13AB,0x1349,0x0000, 0x13AB,0x1349,0x0000,
+0x13AB,0x134D,0x0000, 0x13AB,0x134D,0x0000, 0x13AB,0x1350,0x0000,
+0x13AB,0x1350,0x0000, 0xFBC1,0xFEFD,0x0000, 0xFBC1,0xFEFE,0x0000,
+0x0000,0x0000,0x0000 };
+
+uint16 page0FFdata[]= { /* FF00 (3 weights per char) */
+0xFBC1,0xFF00,0x0000, 0x0251,0x0000,0x0000, 0x027E,0x0000,0x0000,
+0x02D2,0x0000,0x0000, 0x0E0F,0x0000,0x0000, 0x02D3,0x0000,0x0000,
+0x02CF,0x0000,0x0000, 0x0277,0x0000,0x0000, 0x0288,0x0000,0x0000,
+0x0289,0x0000,0x0000, 0x02C8,0x0000,0x0000, 0x0428,0x0000,0x0000,
+0x022F,0x0000,0x0000, 0x0221,0x0000,0x0000, 0x025D,0x0000,0x0000,
+0x02CC,0x0000,0x0000, 0x0E29,0x0000,0x0000, 0x0E2A,0x0000,0x0000,
+0x0E2B,0x0000,0x0000, 0x0E2C,0x0000,0x0000, 0x0E2D,0x0000,0x0000,
+0x0E2E,0x0000,0x0000, 0x0E2F,0x0000,0x0000, 0x0E30,0x0000,0x0000,
+0x0E31,0x0000,0x0000, 0x0E32,0x0000,0x0000, 0x023D,0x0000,0x0000,
+0x023A,0x0000,0x0000, 0x042C,0x0000,0x0000, 0x042D,0x0000,0x0000,
+0x042E,0x0000,0x0000, 0x0255,0x0000,0x0000, 0x02C7,0x0000,0x0000,
+0x0E33,0x0000,0x0000, 0x0E4A,0x0000,0x0000, 0x0E60,0x0000,0x0000,
+0x0E6D,0x0000,0x0000, 0x0E8B,0x0000,0x0000, 0x0EB9,0x0000,0x0000,
+0x0EC1,0x0000,0x0000, 0x0EE1,0x0000,0x0000, 0x0EFB,0x0000,0x0000,
+0x0F10,0x0000,0x0000, 0x0F21,0x0000,0x0000, 0x0F2E,0x0000,0x0000,
+0x0F5B,0x0000,0x0000, 0x0F64,0x0000,0x0000, 0x0F82,0x0000,0x0000,
+0x0FA7,0x0000,0x0000, 0x0FB4,0x0000,0x0000, 0x0FC0,0x0000,0x0000,
+0x0FEA,0x0000,0x0000, 0x1002,0x0000,0x0000, 0x101F,0x0000,0x0000,
+0x1044,0x0000,0x0000, 0x1051,0x0000,0x0000, 0x105A,0x0000,0x0000,
+0x105E,0x0000,0x0000, 0x106A,0x0000,0x0000, 0x028A,0x0000,0x0000,
+0x02CE,0x0000,0x0000, 0x028B,0x0000,0x0000, 0x020F,0x0000,0x0000,
+0x021B,0x0000,0x0000, 0x020C,0x0000,0x0000, 0x0E33,0x0000,0x0000,
+0x0E4A,0x0000,0x0000, 0x0E60,0x0000,0x0000, 0x0E6D,0x0000,0x0000,
+0x0E8B,0x0000,0x0000, 0x0EB9,0x0000,0x0000, 0x0EC1,0x0000,0x0000,
+0x0EE1,0x0000,0x0000, 0x0EFB,0x0000,0x0000, 0x0F10,0x0000,0x0000,
+0x0F21,0x0000,0x0000, 0x0F2E,0x0000,0x0000, 0x0F5B,0x0000,0x0000,
+0x0F64,0x0000,0x0000, 0x0F82,0x0000,0x0000, 0x0FA7,0x0000,0x0000,
+0x0FB4,0x0000,0x0000, 0x0FC0,0x0000,0x0000, 0x0FEA,0x0000,0x0000,
+0x1002,0x0000,0x0000, 0x101F,0x0000,0x0000, 0x1044,0x0000,0x0000,
+0x1051,0x0000,0x0000, 0x105A,0x0000,0x0000, 0x105E,0x0000,0x0000,
+0x106A,0x0000,0x0000, 0x028C,0x0000,0x0000, 0x0430,0x0000,0x0000,
+0x028D,0x0000,0x0000, 0x0433,0x0000,0x0000, 0x029A,0x0000,0x0000,
+0x029B,0x0000,0x0000, 0x0266,0x0000,0x0000, 0x02B2,0x0000,0x0000,
+0x02B3,0x0000,0x0000, 0x0237,0x0000,0x0000, 0x022E,0x0000,0x0000,
+0x1E80,0x0000,0x0000, 0x1E52,0x0000,0x0000, 0x1E53,0x0000,0x0000,
+0x1E54,0x0000,0x0000, 0x1E55,0x0000,0x0000, 0x1E56,0x0000,0x0000,
+0x1E75,0x0000,0x0000, 0x1E76,0x0000,0x0000, 0x1E77,0x0000,0x0000,
+0x1E63,0x0000,0x0000, 0x0E0B,0x0000,0x0000, 0x1E52,0x0000,0x0000,
+0x1E53,0x0000,0x0000, 0x1E54,0x0000,0x0000, 0x1E55,0x0000,0x0000,
+0x1E56,0x0000,0x0000, 0x1E57,0x0000,0x0000, 0x1E58,0x0000,0x0000,
+0x1E59,0x0000,0x0000, 0x1E5A,0x0000,0x0000, 0x1E5B,0x0000,0x0000,
+0x1E5C,0x0000,0x0000, 0x1E5D,0x0000,0x0000, 0x1E5E,0x0000,0x0000,
+0x1E5F,0x0000,0x0000, 0x1E60,0x0000,0x0000, 0x1E61,0x0000,0x0000,
+0x1E62,0x0000,0x0000, 0x1E63,0x0000,0x0000, 0x1E64,0x0000,0x0000,
+0x1E65,0x0000,0x0000, 0x1E66,0x0000,0x0000, 0x1E67,0x0000,0x0000,
+0x1E68,0x0000,0x0000, 0x1E69,0x0000,0x0000, 0x1E6A,0x0000,0x0000,
+0x1E6B,0x0000,0x0000, 0x1E6C,0x0000,0x0000, 0x1E6D,0x0000,0x0000,
+0x1E6E,0x0000,0x0000, 0x1E6F,0x0000,0x0000, 0x1E70,0x0000,0x0000,
+0x1E71,0x0000,0x0000, 0x1E72,0x0000,0x0000, 0x1E73,0x0000,0x0000,
+0x1E74,0x0000,0x0000, 0x1E75,0x0000,0x0000, 0x1E76,0x0000,0x0000,
+0x1E77,0x0000,0x0000, 0x1E78,0x0000,0x0000, 0x1E79,0x0000,0x0000,
+0x1E7A,0x0000,0x0000, 0x1E7B,0x0000,0x0000, 0x1E7C,0x0000,0x0000,
+0x1E7D,0x0000,0x0000, 0x1E81,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0000,0x0000,0x0000, 0x1DBD,0x0000,0x0000, 0x1D62,0x0000,0x0000,
+0x1D63,0x0000,0x0000, 0x1E02,0x0000,0x0000, 0x1D64,0x0000,0x0000,
+0x1E04,0x0000,0x0000, 0x1E05,0x0000,0x0000, 0x1D65,0x0000,0x0000,
+0x1D66,0x0000,0x0000, 0x1D67,0x0000,0x0000, 0x1E08,0x0000,0x0000,
+0x1E09,0x0000,0x0000, 0x1E0A,0x0000,0x0000, 0x1E0B,0x0000,0x0000,
+0x1E0C,0x0000,0x0000, 0x1E0D,0x0000,0x0000, 0x1D7C,0x0000,0x0000,
+0x1D68,0x0000,0x0000, 0x1D69,0x0000,0x0000, 0x1D6A,0x0000,0x0000,
+0x1D83,0x0000,0x0000, 0x1D6B,0x0000,0x0000, 0x1D6C,0x0000,0x0000,
+0x1D6D,0x0000,0x0000, 0x1D6E,0x0000,0x0000, 0x1D6F,0x0000,0x0000,
+0x1D70,0x0000,0x0000, 0x1D71,0x0000,0x0000, 0x1D72,0x0000,0x0000,
+0x1D73,0x0000,0x0000, 0x1D74,0x0000,0x0000, 0xFBC1,0xFFBF,0x0000,
+0xFBC1,0xFFC0,0x0000, 0xFBC1,0xFFC1,0x0000, 0x1DBE,0x0000,0x0000,
+0x1DBF,0x0000,0x0000, 0x1DC0,0x0000,0x0000, 0x1DC1,0x0000,0x0000,
+0x1DC2,0x0000,0x0000, 0x1DC3,0x0000,0x0000, 0xFBC1,0xFFC8,0x0000,
+0xFBC1,0xFFC9,0x0000, 0x1DC4,0x0000,0x0000, 0x1DC5,0x0000,0x0000,
+0x1DC6,0x0000,0x0000, 0x1DC7,0x0000,0x0000, 0x1DC8,0x0000,0x0000,
+0x1DC9,0x0000,0x0000, 0xFBC1,0xFFD0,0x0000, 0xFBC1,0xFFD1,0x0000,
+0x1DCA,0x0000,0x0000, 0x1DCB,0x0000,0x0000, 0x1DCC,0x0000,0x0000,
+0x1DCD,0x0000,0x0000, 0x1DCE,0x0000,0x0000, 0x1DCF,0x0000,0x0000,
+0xFBC1,0xFFD8,0x0000, 0xFBC1,0xFFD9,0x0000, 0x1DD0,0x0000,0x0000,
+0x1DD1,0x0000,0x0000, 0x1DD2,0x0000,0x0000, 0xFBC1,0xFFDD,0x0000,
+0xFBC1,0xFFDE,0x0000, 0xFBC1,0xFFDF,0x0000, 0x0E0E,0x0000,0x0000,
+0x0E10,0x0000,0x0000, 0x042F,0x0000,0x0000, 0x0210,0x0000,0x0000,
+0x0431,0x0000,0x0000, 0x0E11,0x0000,0x0000, 0x0E20,0x0000,0x0000,
+0xFBC1,0xFFE7,0x0000, 0x05FE,0x0000,0x0000, 0x03AE,0x0000,0x0000,
+0x03B0,0x0000,0x0000, 0x03AF,0x0000,0x0000, 0x03B1,0x0000,0x0000,
+0x069C,0x0000,0x0000, 0x06C7,0x0000,0x0000, 0xFBC1,0xFFEF,0x0000,
+0xFBC1,0xFFF0,0x0000, 0xFBC1,0xFFF1,0x0000, 0xFBC1,0xFFF2,0x0000,
+0xFBC1,0xFFF3,0x0000, 0xFBC1,0xFFF4,0x0000, 0xFBC1,0xFFF5,0x0000,
+0xFBC1,0xFFF6,0x0000, 0xFBC1,0xFFF7,0x0000, 0xFBC1,0xFFF8,0x0000,
+0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000, 0x0000,0x0000,0x0000,
+0x0DC5,0x0000,0x0000, 0x0DC6,0x0000,0x0000, 0xFBC1,0xFFFE,0x0000,
+0xFBC1,0xFFFF,0x0000 };
+
+uchar ucal[256]={
+4,3,3,4,3,3,3,3,0,3,3,3,3,3,3,3,
+3,3,3,3,3,2,3,3,3,3,0,0,0,3,3,3,
+5,5,4,3,5,2,3,3,2,2,5,3,0,0,3,3,
+3,3,8,9,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,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,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+2,2,2,2,3,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,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,3,3,4,3,9,3,3
+};
+uint16 *ucaw[256]={
+page000data,page001data,page002data,page003data,
+page004data,page005data,page006data,page007data,
+NULL ,page009data,page00Adata,page00Bdata,
+page00Cdata,page00Ddata,page00Edata,page00Fdata,
+page010data,page011data,page012data,page013data,
+page014data,page015data,page016data,page017data,
+page018data,page019data,NULL ,NULL ,
+NULL ,page01Ddata,page01Edata,page01Fdata,
+page020data,page021data,page022data,page023data,
+page024data,page025data,page026data,page027data,
+page028data,page029data,page02Adata,page02Bdata,
+NULL ,NULL ,page02Edata,page02Fdata,
+page030data,page031data,page032data,page033data,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,page04Ddata,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+page0A0data,page0A1data,page0A2data,page0A3data,
+page0A4data,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,NULL ,NULL ,NULL ,
+NULL ,page0F9data,page0FAdata,page0FBdata,
+page0FCdata,page0FDdata,page0FEdata,page0FFdata
+};
+
+
+/*
+ Unicode Collation Algorithm:
+ Collation element (weight) scanner,
+ for consequent scan of collations
+ weights from a string.
+*/
+typedef struct my_uca_scanner_st
+{
+ const uint16 *wbeg; /* Beginning of the current weight string */
+ const uchar *sbeg; /* Beginning of the input string */
+ const uchar *send; /* End of the input string */
+ uint16 implicit[2];
+ int page;
+ int code;
+} my_uca_scanner;
+
+
+/*
+ Initialize collation weight scanner
+
+ SYNOPSIS:
+ my_uca_scanner_init()
+ scanner Pointer to an initialized scanner structure
+ cs Character set + collation information
+ str Beginning of the string
+ length Length of the string.
+
+ NOTES:
+
+ 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)
+{
+ /* Note, no needs to initialize scanner->wbeg */
+ scanner->sbeg= str;
+ scanner->send= str + length - 2;
+ scanner->wbeg= nochar;
+}
+
+
+/*
+ Read next collation element (weight), i.e. converts
+ a stream of characters into a stream of their weights.
+
+ SYNOPSIS:
+ my_uca_scanner_next()
+ scanner Address of a previously initialized scanner strucuture
+
+ NOTES:
+ 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.
+
+ Each character can have number weights from 0 to 8.
+
+ Some characters do not have weights at all, 0 weights.
+ It means they are ignored during comparison.
+
+ Examples:
+ 1. 0x0001 START OF HEADING, has no weights, ignored, does
+ not produce any weights.
+ 2. 0x0061 LATIN SMALL LETTER A, has one weight.
+ 0x0E33 will be returned
+ 3. 0x00DF LATIN SMALL LETTER SHARP S, aka SZ ligature,
+ has two weights. It will return 0x0FEA twice for two
+ consequent calls.
+ 4. 0x247D PATENTHESIZED NUMBER TEN, has four weights,
+ this function will return these numbers in four
+ consequent calls: 0x0288, 0x0E2A, 0x0E29, 0x0289
+ 5. A string consisting of the above characters:
+ 0x0001 0x0061 0x00DF 0x247D
+ will return the following weights, one weight per call:
+ 0x0E33 0x0FEA 0x0FEA 0x0288, 0x0E2A, 0x0E29, 0x0289
+
+ RETURN
+ Next weight, a number between 0x0000 and 0xFFFF
+ Or -1 on error (END-OF-STRING or ILLEGAL MULTIBYTE SEQUENCE)
+*/
+
+static int my_uca_scanner_next(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
+ {
+ if (scanner->sbeg > scanner->send)
+ return -1;
+
+ scanner->page= (unsigned char)scanner->sbeg[0];
+ scanner->code= (unsigned char)scanner->sbeg[1];
+ scanner->sbeg+= 2;
+
+ 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;
+}
+
+
+/*
+ Compares two strings according to the collation
+
+ SYNOPSIS:
+ my_strnncoll_uca()
+ cs Character set information
+ s First string
+ slen First string length
+ t Second string
+ tlen Seconf string length
+
+ NOTES:
+ Initializes two weight scanners and gets weights
+ corresponding to two strings in a loop. If weights are not
+ the same at some step then returns their difference.
+
+ In the while() comparison these situations are possible:
+ 1. (s_res>0) and (t_res>0) and (s_res == t_res)
+ Weights are the same so far, continue comparison
+ 2. (s_res>0) and (t_res>0) and (s_res!=t_res)
+ A difference has been found, return.
+ 3. (s_res>0) and (t_res<0)
+ We have reached the end of the second string, or found
+ an illegal multibyte sequence in the second string.
+ Return a positive number, i.e. the first string is bigger.
+ 4. (s_res<0) and (t_res>0)
+ We have reached the end of the first string, or found
+ an illegal multibyte sequence in the first string.
+ Return a negative number, i.e. the second string is bigger.
+ 5. (s_res<0) and (t_res<0)
+ Both scanners returned -1. It means we have riched
+ the end-of-string of illegal-sequence in both strings
+ at the same time. Return 0, strings are equal.
+
+ RETURN
+ Difference between two strings, according to the collation:
+ 0 - means strings are equal
+ negative number - means the first string is smaller
+ positive number - means the first string is bigger
+*/
+
+static int my_strnncoll_uca(CHARSET_INFO *cs,
+ const uchar *s, uint slen,
+ const uchar *t, uint tlen)
+{
+ my_uca_scanner sscanner;
+ my_uca_scanner tscanner;
+ int s_res;
+ int t_res;
+
+ my_uca_scanner_init(&sscanner, cs, s, slen);
+ my_uca_scanner_init(&tscanner, cs, t, tlen);
+
+ do
+ {
+ s_res= my_uca_scanner_next(&sscanner);
+ t_res= my_uca_scanner_next(&tscanner);
+ } while ( s_res == t_res && s_res >0);
+
+ return ( s_res - t_res );
+}
+
+
+
+/*
+ Compares two strings according to the collation,
+ ignoring trailing spaces.
+
+ SYNOPSIS:
+ my_strnncollsp_uca()
+ cs Character set information
+ s First string
+ slen First string length
+ t Second string
+ tlen Seconf string length
+
+ NOTES:
+ Works exactly the same with my_strnncoll_uca(),
+ but ignores trailing spaces.
+
+ RETURN
+ Difference between two strings, according to the collation:
+ 0 - means strings are equal
+ negative number - means the first string is smaller
+ positive number - means the first string is bigger
+*/
+
+static int my_strnncollsp_uca(CHARSET_INFO *cs,
+ const uchar *s, uint slen,
+ const uchar *t, uint tlen)
+{
+ my_uca_scanner sscanner;
+ my_uca_scanner tscanner;
+ int s_res;
+ int t_res;
+
+ slen= cs->cset->lengthsp(cs, s, slen);
+ tlen= cs->cset->lengthsp(cs, t, tlen);
+
+ my_uca_scanner_init(&sscanner, cs, s, slen);
+ my_uca_scanner_init(&tscanner, cs, t, tlen);
+
+ do
+ {
+ s_res= my_uca_scanner_next(&sscanner);
+ t_res= my_uca_scanner_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.
+
+ SYNOPSIS:
+ my_hash_sort_uca()
+ cs Character set information
+ s String
+ slen String's length
+ n1 First hash parameter
+ n2 Second hash parameter
+
+ NOTES:
+ Scans consequently weights and updates
+ hash parameters n1 and n2. In a case insensitive collation,
+ upper and lower case of the same letter will return the same
+ weight sequence, and thus will produce the same hash values
+ in n1 and n2.
+
+ RETURN
+ N/A
+*/
+
+static void my_hash_sort_uca(CHARSET_INFO *cs,
+ const uchar *s, uint slen,
+ ulong *n1, ulong *n2)
+{
+ int s_res;
+ my_uca_scanner scanner;
+
+ slen= cs->cset->lengthsp(cs, s, slen);
+ my_uca_scanner_init(&scanner, cs, s, slen);
+
+ while ((s_res= my_uca_scanner_next(&scanner)) >0)
+ {
+ n1[0]^= (((n1[0] & 63)+n2[0])*(s_res >> 8))+ (n1[0] << 8);
+ n2[0]+=3;
+ n1[0]^= (((n1[0] & 63)+n2[0])*(s_res & 0xFF))+ (n1[0] << 8);
+ n2[0]+=3;
+ }
+}
+
+
+/*
+ For the given string creates its "binary image", suitable
+ to be used in binary comparison, i.e. in memcmp().
+
+ SYNOPSIS:
+ my_strnxfrm_uca()
+ cs Character set information
+ dst Where to write the image
+ dstlen Space available for the image, in bytes
+ src The source string
+ srclen Length of the source string, in bytes
+
+ NOTES:
+ In a loop, scans weights from the source string and writes
+ them into the binary image. In a case insensitive collation,
+ upper and lower cases of the same letter will produce the
+ same image subsequences. When we have reached the end-of-string
+ or found an illegal multibyte sequence, the loop stops.
+
+ It is impossible to restore the original string using its
+ binary image.
+
+ Binary images are used for bulk comparison purposes,
+ e.g. in ORDER BY, when it is more efficient to create
+ a binary image and use it instead of weight scanner
+ for the original strings for every comparison.
+
+ RETURN
+ Number of bytes that have been written into the binary image.
+*/
+
+static int my_strnxfrm_uca(CHARSET_INFO *cs,
+ 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);
+
+ while (dst < de && (s_res= my_uca_scanner_next(&scanner)) >0)
+ {
+ dst[0]= s_res >> 8;
+ dst[1]= s_res & 0xFF;
+ dst+= 2;
+ }
+ return dst - dst_orig;
+}
+
+/*
+ This function compares if two characters are the same.
+ The sign +1 or -1 does not matter. The only
+ important thing is that the result is 0 or not 0.
+ This fact allows us to use memcmp() safely, on both
+ little-endian and big-endian machines.
+*/
+static int my_uca_charcmp(my_wc_t wc1, my_wc_t wc2)
+{
+ size_t page1= wc1 >> MY_UCA_PSHIFT;
+ size_t page2= wc2 >> MY_UCA_PSHIFT;
+ size_t length1= ucal[page1];
+ size_t length2= ucal[page2];
+ uint16 *weight1= ucaw[page1] + (wc1 & MY_UCA_CMASK) * ucal[page1];
+ uint16 *weight2= ucaw[page2] + (wc2 & MY_UCA_CMASK) * ucal[page2];
+
+ if (!weight1 || !weight2)
+ return wc1 != wc2;
+
+ if (length1 > length2)
+ return memcmp((const void*)weight1, (const void*)weight2, length2*2) ?
+ 1: weight1[length2];
+
+ if (length1 < length2)
+ return memcmp((const void*)weight1, (const void*)weight2, length1*2) ?
+ 1 : weight2[length1];
+
+ return memcmp((const void*)weight1, (const void*)weight2, length1*2);
+}
+
+/*
+** Compare string against string with wildcard
+** 0 if matched
+** -1 if not matched with wildcard
+** 1 if matched with wildcard
+*/
+
+static
+int my_wildcmp_uca(CHARSET_INFO *cs,
+ const char *str,const char *str_end,
+ const char *wildstr,const char *wildend,
+ int escape, int w_one, int w_many)
+{
+ int result= -1; /* Not found, using wildcards */
+ my_wc_t s_wc, w_wc;
+ int scan;
+ int (*mb_wc)(struct charset_info_st *cs, my_wc_t *wc,
+ const unsigned char *s,const unsigned char *e);
+ mb_wc= cs->cset->mb_wc;
+
+ while (wildstr != wildend)
+ {
+ while (1)
+ {
+ if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr,
+ (const uchar*)wildend)) <= 0)
+ return 1;
+
+ if (w_wc == (my_wc_t)w_many)
+ {
+ result= 1; /* Found an anchor char */
+ break;
+ }
+
+ wildstr+= scan;
+ if (w_wc == (my_wc_t)escape)
+ {
+ if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr,
+ (const uchar*)wildend)) <= 0)
+ return 1;
+ wildstr+= scan;
+ }
+
+ if ((scan= mb_wc(cs, &s_wc, (const uchar*)str,
+ (const uchar*)str_end)) <= 0)
+ return 1;
+ str+= scan;
+
+ if (w_wc == (my_wc_t)w_one)
+ {
+ result= 1; /* Found an anchor char */
+ }
+ else
+ {
+ if (my_uca_charcmp(s_wc,w_wc))
+ return 1;
+ }
+ if (wildstr == wildend)
+ return (str != str_end); /* Match if both are at end */
+ }
+
+
+ if (w_wc == (my_wc_t)w_many)
+ { /* Found w_many */
+
+ /* Remove any '%' and '_' from the wild search string */
+ for ( ; wildstr != wildend ; )
+ {
+ if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr,
+ (const uchar*)wildend)) <= 0)
+ return 1;
+
+ if (w_wc == (my_wc_t)w_many)
+ {
+ wildstr+= scan;
+ continue;
+ }
+
+ if (w_wc == (my_wc_t)w_one)
+ {
+ wildstr+= scan;
+ if ((scan= mb_wc(cs, &s_wc, (const uchar*)str,
+ (const uchar*)str_end)) <= 0)
+ return 1;
+ str+= scan;
+ continue;
+ }
+ break; /* Not a wild character */
+ }
+
+ if (wildstr == wildend)
+ return 0; /* Ok if w_many is last */
+
+ if (str == str_end)
+ return -1;
+
+ if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr,
+ (const uchar*)wildend)) <= 0)
+ return 1;
+
+ if (w_wc == (my_wc_t)escape)
+ {
+ wildstr+= scan;
+ if ((scan= mb_wc(cs, &w_wc, (const uchar*)wildstr,
+ (const uchar*)wildend)) <= 0)
+ return 1;
+ }
+
+ while (1)
+ {
+ /* Skip until the first character from wildstr is found */
+ while (str != str_end)
+ {
+ if ((scan= mb_wc(cs, &s_wc, (const uchar*)str,
+ (const uchar*)str_end)) <= 0)
+ return 1;
+
+ if (!my_uca_charcmp(s_wc,w_wc))
+ break;
+ str+= scan;
+ }
+ if (str == str_end)
+ return -1;
+
+ result= my_wildcmp_uca(cs, str, str_end, wildstr, wildend,
+ escape, w_one, w_many);
+
+ if (result <= 0)
+ return result;
+
+ str+= scan;
+ }
+ }
+ }
+ return (str != str_end ? 1 : 0);
+}
+
+
+MY_COLLATION_HANDLER my_collation_ucs2_uca_handler =
+{
+ my_strnncoll_uca,
+ my_strnncollsp_uca,
+ my_strnxfrm_uca,
+ my_like_range_simple,
+ my_wildcmp_uca,
+ NULL,
+ my_instr_mb,
+ my_hash_sort_uca
+};
+
+#endif
diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c
index bb74e0cf56b..99d97a9614b 100644
--- a/strings/ctype-ucs2.c
+++ b/strings/ctype-ucs2.c
@@ -90,8 +90,8 @@ static uchar to_upper_ucs2[] = {
};
-static int my_ucs2_uni (CHARSET_INFO *cs __attribute__((unused)),
- my_wc_t * pwc, const uchar *s, const uchar *e)
+static int my_ucs2_uni(CHARSET_INFO *cs __attribute__((unused)),
+ my_wc_t * pwc, const uchar *s, const uchar *e)
{
if (s+2 > e) /* Need 2 characters */
return MY_CS_TOOFEW(0);
@@ -100,8 +100,8 @@ static int my_ucs2_uni (CHARSET_INFO *cs __attribute__((unused)),
return 2;
}
-static int my_uni_ucs2 (CHARSET_INFO *cs __attribute__((unused)) ,
- my_wc_t wc, uchar *r, uchar *e)
+static int my_uni_ucs2(CHARSET_INFO *cs __attribute__((unused)) ,
+ my_wc_t wc, uchar *r, uchar *e)
{
if ( r+2 > e )
return MY_CS_TOOSMALL;
@@ -128,13 +128,15 @@ static void my_caseup_ucs2(CHARSET_INFO *cs, char *s, uint slen)
}
}
-static void my_hash_sort_ucs2(CHARSET_INFO *cs, const uchar *s, uint slen, ulong *n1, ulong *n2)
+
+static void my_hash_sort_ucs2(CHARSET_INFO *cs, const uchar *s, uint slen,
+ ulong *n1, ulong *n2)
{
my_wc_t wc;
int res;
const uchar *e=s+slen;
- while ((s < e) && (res=my_ucs2_uni(cs,&wc, (uchar *)s, (uchar*)e))>0 )
+ while ((s < e) && (res=my_ucs2_uni(cs,&wc, (uchar *)s, (uchar*)e)) >0)
{
int plane = (wc>>8) & 0xFF;
wc = uni_plane[plane] ? uni_plane[plane][wc & 0xFF].sort : wc;
@@ -148,7 +150,7 @@ static void my_hash_sort_ucs2(CHARSET_INFO *cs, const uchar *s, uint slen, ulong
static void my_caseup_str_ucs2(CHARSET_INFO * cs __attribute__((unused)),
- char * s __attribute__((unused)))
+ char * s __attribute__((unused)))
{
}
@@ -173,13 +175,14 @@ static void my_casedn_ucs2(CHARSET_INFO *cs, char *s, uint slen)
}
static void my_casedn_str_ucs2(CHARSET_INFO *cs __attribute__((unused)),
- char * s __attribute__((unused)))
+ char * s __attribute__((unused)))
{
}
static int my_strnncoll_ucs2(CHARSET_INFO *cs,
- const uchar *s, uint slen, const uchar *t, uint tlen)
+ const uchar *s, uint slen,
+ const uchar *t, uint tlen)
{
int s_res,t_res;
my_wc_t s_wc,t_wc;
@@ -213,8 +216,9 @@ static int my_strnncoll_ucs2(CHARSET_INFO *cs,
return ( (se-s) - (te-t) );
}
+
static int my_strncasecmp_ucs2(CHARSET_INFO *cs,
- const char *s, const char *t, uint len)
+ const char *s, const char *t, uint len)
{
int s_res,t_res;
my_wc_t s_wc,t_wc;
@@ -249,6 +253,7 @@ static int my_strncasecmp_ucs2(CHARSET_INFO *cs,
return ( (se-s) - (te-t) );
}
+
static int my_strcasecmp_ucs2(CHARSET_INFO *cs, const char *s, const char *t)
{
uint s_len=strlen(s);
@@ -257,6 +262,7 @@ static int my_strcasecmp_ucs2(CHARSET_INFO *cs, const char *s, const char *t)
return my_strncasecmp_ucs2(cs, s, t, len);
}
+
static int my_strnxfrm_ucs2(CHARSET_INFO *cs,
uchar *dst, uint dstlen, const uchar *src, uint srclen)
{
@@ -288,6 +294,7 @@ static int my_strnxfrm_ucs2(CHARSET_INFO *cs,
return dst - dst_orig;
}
+
static int my_ismbchar_ucs2(CHARSET_INFO *cs __attribute__((unused)),
const char *b __attribute__((unused)),
const char *e __attribute__((unused)))
@@ -295,6 +302,7 @@ static int my_ismbchar_ucs2(CHARSET_INFO *cs __attribute__((unused)),
return 2;
}
+
static int my_mbcharlen_ucs2(CHARSET_INFO *cs __attribute__((unused)) ,
uint c __attribute__((unused)))
{
@@ -380,8 +388,8 @@ static int my_vsnprintf_ucs2(char *dst, uint n, const char* fmt, va_list ap)
return (uint) (dst - start);
}
-static int my_snprintf_ucs2(CHARSET_INFO *cs __attribute__((unused))
- ,char* to, uint n, const char* fmt, ...)
+static int my_snprintf_ucs2(CHARSET_INFO *cs __attribute__((unused)),
+ char* to, uint n, const char* fmt, ...)
{
va_list args;
va_start(args,fmt);
@@ -389,9 +397,9 @@ static int my_snprintf_ucs2(CHARSET_INFO *cs __attribute__((unused))
}
-long my_strntol_ucs2(CHARSET_INFO *cs,
- const char *nptr, uint l, int base,
- char **endptr, int *err)
+long my_strntol_ucs2(CHARSET_INFO *cs,
+ const char *nptr, uint l, int base,
+ char **endptr, int *err)
{
int negative=0;
int overflow;
@@ -504,9 +512,9 @@ bs:
}
-ulong my_strntoul_ucs2(CHARSET_INFO *cs,
- const char *nptr, uint l, int base,
- char **endptr, int *err)
+ulong my_strntoul_ucs2(CHARSET_INFO *cs,
+ const char *nptr, uint l, int base,
+ char **endptr, int *err)
{
int negative=0;
int overflow;
@@ -856,7 +864,7 @@ double my_strntod_ucs2(CHARSET_INFO *cs __attribute__((unused)),
if (length >= sizeof(buf))
length= sizeof(buf)-1;
end= s+length;
-
+
while ((cnv=cs->cset->mb_wc(cs,&wc,s,end)) > 0)
{
s+=cnv;
@@ -865,9 +873,9 @@ double my_strntod_ucs2(CHARSET_INFO *cs __attribute__((unused)),
*b++= (char) wc;
}
*b= 0;
-
+
errno= 0;
- res=strtod(buf, endptr);
+ res=my_strtod(buf, endptr);
*err= errno;
if (endptr)
*endptr=(char*) (*endptr-buf+nptr);
@@ -985,6 +993,7 @@ cnv:
return (int) (dst-db);
}
+
static
uint my_numchars_ucs2(CHARSET_INFO *cs __attribute__((unused)),
const char *b, const char *e)
@@ -992,6 +1001,7 @@ uint my_numchars_ucs2(CHARSET_INFO *cs __attribute__((unused)),
return (e-b)/2;
}
+
static
uint my_charpos_ucs2(CHARSET_INFO *cs __attribute__((unused)),
const char *b __attribute__((unused)),
@@ -1001,17 +1011,19 @@ uint my_charpos_ucs2(CHARSET_INFO *cs __attribute__((unused)),
return pos*2;
}
+
static
-uint my_wellformedlen_ucs2(CHARSET_INFO *cs __attribute__((unused)),
- const char *b,
- const char *e,
- uint nchars)
+uint my_well_formed_len_ucs2(CHARSET_INFO *cs __attribute__((unused)),
+ const char *b,
+ const char *e,
+ uint nchars)
{
uint nbytes= (e-b) & ~ (uint)1;
nchars*= 2;
- return nbytes < nchars ? nbytes : nchars;
+ return min(nbytes, nchars);
}
+
static
void my_fill_ucs2(CHARSET_INFO *cs __attribute__((unused)),
char *s, uint l, int fill)
@@ -1019,6 +1031,7 @@ void my_fill_ucs2(CHARSET_INFO *cs __attribute__((unused)),
for ( ; l >= 2; s[0]= 0, s[1]= fill, s+=2, l-=2);
}
+
static
uint my_lengthsp_ucs2(CHARSET_INFO *cs __attribute__((unused)),
const char *ptr, uint length)
@@ -1029,6 +1042,7 @@ uint my_lengthsp_ucs2(CHARSET_INFO *cs __attribute__((unused)),
return (uint) (end-ptr);
}
+
/*
** Compare string against string with wildcard
** 0 if matched
@@ -1043,7 +1057,7 @@ int my_wildcmp_ucs2(CHARSET_INFO *cs,
int escape, int w_one, int w_many,
MY_UNICASE_INFO **weights)
{
- int result= -1; /* Not found, using wildcards */
+ int result= -1; /* Not found, using wildcards */
my_wc_t s_wc, w_wc;
int scan, plane;
@@ -1052,21 +1066,23 @@ int my_wildcmp_ucs2(CHARSET_INFO *cs,
while (1)
{
- scan= my_ucs2_uni(cs,&w_wc, (const uchar*)wildstr, (const uchar*)wildend);
+ scan= my_ucs2_uni(cs,&w_wc, (const uchar*)wildstr,
+ (const uchar*)wildend);
if (scan <= 0)
return 1;
if (w_wc == (my_wc_t)escape)
{
wildstr+= scan;
- scan= my_ucs2_uni(cs,&w_wc, (const uchar*)wildstr, (const uchar*)wildend);
+ scan= my_ucs2_uni(cs,&w_wc, (const uchar*)wildstr,
+ (const uchar*)wildend);
if (scan <= 0)
return 1;
}
if (w_wc == (my_wc_t)w_many)
{
- result= 1; /* Found an anchor char */
+ result= 1; /* Found an anchor char */
break;
}
@@ -1078,7 +1094,7 @@ int my_wildcmp_ucs2(CHARSET_INFO *cs,
if (w_wc == (my_wc_t)w_one)
{
- result= 1; /* Found an anchor char */
+ result= 1; /* Found an anchor char */
}
else
{
@@ -1103,7 +1119,8 @@ int my_wildcmp_ucs2(CHARSET_INFO *cs,
/* Remove any '%' and '_' from the wild search string */
for ( ; wildstr != wildend ; )
{
- scan= my_ucs2_uni(cs,&w_wc, (const uchar*)wildstr, (const uchar*)wildend);
+ scan= my_ucs2_uni(cs,&w_wc, (const uchar*)wildstr,
+ (const uchar*)wildend);
if (scan <= 0)
return 1;
@@ -1116,7 +1133,8 @@ int my_wildcmp_ucs2(CHARSET_INFO *cs,
if (w_wc == (my_wc_t)w_one)
{
wildstr+= scan;
- scan= my_ucs2_uni(cs, &s_wc, (const uchar*)str, (const uchar*)str_end);
+ scan= my_ucs2_uni(cs, &s_wc, (const uchar*)str,
+ (const uchar*)str_end);
if (scan <=0)
return 1;
str+= scan;
@@ -1131,14 +1149,16 @@ int my_wildcmp_ucs2(CHARSET_INFO *cs,
if (str == str_end)
return -1;
- scan= my_ucs2_uni(cs,&w_wc, (const uchar*)wildstr, (const uchar*)wildend);
+ scan= my_ucs2_uni(cs,&w_wc, (const uchar*)wildstr,
+ (const uchar*)wildend);
if (scan <= 0)
return 1;
if (w_wc == (my_wc_t)escape)
{
wildstr+= scan;
- scan= my_ucs2_uni(cs,&w_wc, (const uchar*)wildstr, (const uchar*)wildend);
+ scan= my_ucs2_uni(cs,&w_wc, (const uchar*)wildstr,
+ (const uchar*)wildend);
if (scan <= 0)
return 1;
}
@@ -1148,7 +1168,8 @@ int my_wildcmp_ucs2(CHARSET_INFO *cs,
/* Skip until the first character from wildstr is found */
while (str != str_end)
{
- scan= my_ucs2_uni(cs,&s_wc, (const uchar*)str, (const uchar*)str_end);
+ scan= my_ucs2_uni(cs,&s_wc, (const uchar*)str,
+ (const uchar*)str_end);
if (scan <= 0)
return 1;
if (weights)
@@ -1190,6 +1211,7 @@ int my_wildcmp_ucs2_ci(CHARSET_INFO *cs,
escape,w_one,w_many,uni_plane);
}
+
static
int my_wildcmp_ucs2_bin(CHARSET_INFO *cs,
const char *str,const char *str_end,
@@ -1232,6 +1254,7 @@ int my_strnncoll_ucs2_bin(CHARSET_INFO *cs,
return ( (se-s) - (te-t) );
}
+
static
int my_strcasecmp_ucs2_bin(CHARSET_INFO *cs, const char *s, const char *t)
{
@@ -1241,6 +1264,7 @@ int my_strcasecmp_ucs2_bin(CHARSET_INFO *cs, const char *s, const char *t)
return my_strncasecmp_ucs2(cs, s, t, len);
}
+
static
int my_strnxfrm_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)),
uchar *dst, uint dstlen,
@@ -1251,6 +1275,7 @@ int my_strnxfrm_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)),
return srclen;
}
+
static
void my_hash_sort_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)),
const uchar *key, uint len,ulong *nr1, ulong *nr2)
@@ -1267,19 +1292,99 @@ void my_hash_sort_ucs2_bin(CHARSET_INFO *cs __attribute__((unused)),
}
}
+/*
+** Calculate min_str and max_str that ranges a LIKE string.
+** Arguments:
+** ptr Pointer to LIKE string.
+** ptr_length Length of LIKE string.
+** escape Escape character in LIKE. (Normally '\').
+** All escape characters should be removed from min_str and max_str
+** res_length Length of min_str and max_str.
+** min_str Smallest case sensitive string that ranges LIKE.
+** Should be space padded to res_length.
+** max_str Largest case sensitive string that ranges LIKE.
+** Normally padded with the biggest character sort value.
+**
+** The function should return 0 if ok and 1 if the LIKE string can't be
+** optimized !
+*/
+
+my_bool my_like_range_ucs2(CHARSET_INFO *cs,
+ const char *ptr,uint ptr_length,
+ pbool escape, pbool w_one, pbool w_many,
+ uint res_length,
+ char *min_str,char *max_str,
+ uint *min_length,uint *max_length)
+{
+ const char *end=ptr+ptr_length;
+ char *min_org=min_str;
+ char *min_end=min_str+res_length;
+
+ for (; ptr + 1 < end && min_str + 1 < min_end ; ptr+=2)
+ {
+ if (ptr[0] == '\0' && ptr[1] == escape && ptr+2 < end)
+ {
+ ptr+=2; /* Skip escape */
+ *min_str++= *max_str++ = ptr[0];
+ *min_str++= *max_str++ = ptr[1];
+ continue;
+ }
+ if (ptr[0] == '\0' && ptr[1] == w_one) /* '_' in SQL */
+ {
+ *min_str++= (char) cs->min_sort_char >> 8;
+ *min_str++= (char) cs->min_sort_char & 255;
+ *max_str++= (char) cs->max_sort_char >> 8;
+ *max_str++= (char) cs->max_sort_char & 255;
+ continue;
+ }
+ if (ptr[0] == '\0' && ptr[1] == w_many) /* '%' in SQL */
+ {
+ *min_length= (uint) (min_str - min_org);
+ *max_length=res_length;
+ do {
+ *min_str++ = 0;
+ *min_str++ = 0;
+ *max_str++ = (char) cs->max_sort_char >>8;
+ *max_str++ = (char) cs->max_sort_char & 255;
+ } while (min_str + 1 < min_end);
+ return 0;
+ }
+ *min_str++= *max_str++ = ptr[0];
+ *min_str++= *max_str++ = ptr[1];
+ }
+ *min_length= *max_length = (uint) (min_str - min_org);
+
+ /* Temporary fix for handling w_one at end of string (key compression) */
+ {
+ char *tmp;
+ for (tmp= min_str ; tmp-1 > min_org && tmp[-1] == '\0' && tmp[-2]=='\0';)
+ {
+ *--tmp=' ';
+ *--tmp='\0';
+ }
+ }
+
+ while (min_str + 1 < min_end)
+ {
+ *min_str++ = *max_str++ = '\0';
+ *min_str++ = *max_str++ = ' '; /* Because if key compression */
+ }
+ return 0;
+}
static MY_COLLATION_HANDLER my_collation_ucs2_general_ci_handler =
{
my_strnncoll_ucs2,
my_strnncoll_ucs2,
my_strnxfrm_ucs2,
- my_like_range_simple,
+ my_like_range_ucs2,
my_wildcmp_ucs2_ci,
my_strcasecmp_ucs2,
my_instr_mb,
my_hash_sort_ucs2
};
+
static MY_COLLATION_HANDLER my_collation_ucs2_bin_handler =
{
my_strnncoll_ucs2_bin,
@@ -1292,13 +1397,14 @@ static MY_COLLATION_HANDLER my_collation_ucs2_bin_handler =
my_hash_sort_ucs2_bin
};
+
static MY_CHARSET_HANDLER my_charset_ucs2_handler=
{
my_ismbchar_ucs2, /* ismbchar */
my_mbcharlen_ucs2, /* mbcharlen */
my_numchars_ucs2,
my_charpos_ucs2,
- my_wellformedlen_ucs2,
+ my_well_formed_len_ucs2,
my_lengthsp_ucs2,
my_ucs2_uni, /* mb_wc */
my_uni_ucs2, /* wc_mb */
@@ -1319,7 +1425,6 @@ static MY_CHARSET_HANDLER my_charset_ucs2_handler=
};
-
CHARSET_INFO my_charset_ucs2_general_ci=
{
35,0,0, /* number */
@@ -1338,11 +1443,35 @@ CHARSET_INFO my_charset_ucs2_general_ci=
1, /* strxfrm_multiply */
2, /* mbminlen */
2, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0xFFFF, /* max_sort_char */
&my_charset_ucs2_handler,
&my_collation_ucs2_general_ci_handler
};
+CHARSET_INFO my_charset_ucs2_general_uca=
+{
+ 45,0,0, /* number */
+ MY_CS_COMPILED|MY_CS_STRNXFRM|MY_CS_UNICODE|MY_CS_NONTEXT,
+ "ucs2", /* cs name */
+ "ucs2_general_uca", /* name */
+ "", /* comment */
+ ctype_ucs2, /* ctype */
+ to_lower_ucs2, /* to_lower */
+ to_upper_ucs2, /* to_upper */
+ to_upper_ucs2, /* sort_order */
+ NULL, /* tab_to_uni */
+ NULL, /* tab_from_uni */
+ "",
+ "",
+ 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_bin=
{
@@ -1362,7 +1491,8 @@ CHARSET_INFO my_charset_ucs2_bin=
1, /* strxfrm_multiply */
2, /* mbminlen */
2, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0xFFFF, /* max_sort_char */
&my_charset_ucs2_handler,
&my_collation_ucs2_bin_handler
};
diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c
index f27ddcf3e30..51b7cd4f7d7 100644
--- a/strings/ctype-ujis.c
+++ b/strings/ctype-ujis.c
@@ -8342,18 +8342,14 @@ my_mb_wc_euc_jp(CHARSET_INFO *cs,my_wc_t *pwc, const uchar *s, const uchar *e)
static int
my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, unsigned char *s, unsigned char *e)
{
- unsigned char buf[2];
unsigned char c1;
- int ret,jp;
-
+ int jp;
+
if (s >= e)
return MY_CS_TOOSMALL;
if ((int) wc < 0x80)
{
- if (s>e)
- return MY_CS_TOOSMALL;
-
*s= (uchar) wc;
return 1;
}
@@ -8368,22 +8364,21 @@ my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, unsigned char *s, unsigned char *e)
s[1]=jp&0xFF;
return 2;
}
-
- ret=my_wc_mb_jisx0201(c,wc,buf,buf+2);
- if (ret==1)
+
+ /* Half width Katakana */
+ if (my_wc_mb_jisx0201(c,wc,s,e) == 1)
{
- if (s+1>e)
+ if (s+2>e)
return MY_CS_TOOSMALL;
-
- s[0]=0x8E;
- s[1]=buf[0];
- return 1;
+ s[1]= s[0];
+ s[0]= 0x8E;
+ return 2;
}
-
+
if ((jp=my_uni_jisx0212_onechar(wc)))
{
- if (s+2>e)
+ if (s+3>e)
return MY_CS_TOOSMALL;
jp+=0x8080;
@@ -8393,7 +8388,7 @@ my_wc_mb_euc_jp(CHARSET_INFO *c,my_wc_t wc, unsigned char *s, unsigned char *e)
return 3;
}
-
+
/* User defined range */
if (wc>=0xE000 && wc<0xE3AC)
{
@@ -8444,7 +8439,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
mbcharlen_ujis,
my_numchars_mb,
my_charpos_mb,
- my_wellformedlen_mb,
+ my_well_formed_len_mb,
my_lengthsp_8bit,
my_mb_wc_euc_jp, /* mb_wc */
my_wc_mb_euc_jp, /* wc_mb */
@@ -8483,7 +8478,8 @@ CHARSET_INFO my_charset_ujis_japanese_ci=
1, /* strxfrm_multiply */
1, /* mbminlen */
3, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0, /* max_sort_char */
&my_charset_handler,
&my_collation_ci_handler
};
@@ -8506,7 +8502,8 @@ CHARSET_INFO my_charset_ujis_bin=
1, /* strxfrm_multiply */
1, /* mbminlen */
3, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0, /* max_sort_char */
&my_charset_handler,
&my_collation_mb_bin_handler
};
diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c
index ef9719bf040..82787f2b65f 100644
--- a/strings/ctype-utf8.c
+++ b/strings/ctype-utf8.c
@@ -1801,7 +1801,8 @@ static void my_casedn_str_utf8(CHARSET_INFO *cs, char * s)
static int my_strnncoll_utf8(CHARSET_INFO *cs,
- const uchar *s, uint slen, const uchar *t, uint tlen)
+ const uchar *s, uint slen,
+ const uchar *t, uint tlen)
{
int s_res,t_res;
my_wc_t s_wc,t_wc;
@@ -1835,14 +1836,99 @@ static int my_strnncoll_utf8(CHARSET_INFO *cs,
return ( (se-s) - (te-t) );
}
-static
-int my_strnncollsp_utf8(CHARSET_INFO * cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen)
+
+
+/*
+ Compare strings, discarding end space
+
+ SYNOPSIS
+ my_strnncollsp_utf8()
+ cs character set handler
+ a First string to compare
+ a_length Length of 'a'
+ b Second string to compare
+ b_length Length of 'b'
+
+ IMPLEMENTATION
+ If one string is shorter as the other, then we space extend the other
+ so that the strings have equal length.
+
+ This will ensure that the following things hold:
+
+ "a" == "a "
+ "a\0" < "a"
+ "a\0" < "a "
+
+ RETURN
+ < 0 a < b
+ = 0 a == b
+ > 0 a > b
+*/
+
+static int my_strnncollsp_utf8(CHARSET_INFO *cs,
+ const uchar *s, uint slen,
+ const uchar *t, uint tlen)
{
- for ( ; slen && my_isspace(cs, s[slen-1]) ; slen--);
- for ( ; tlen && my_isspace(cs, t[tlen-1]) ; tlen--);
- return my_strnncoll_utf8(cs,s,slen,t,tlen);
+ int s_res,t_res;
+ my_wc_t s_wc,t_wc;
+ const uchar *se= s+slen;
+ const uchar *te= t+tlen;
+
+ while ( s < se && t < te )
+ {
+ int plane;
+ s_res=my_utf8_uni(cs,&s_wc, s, se);
+ t_res=my_utf8_uni(cs,&t_wc, t, te);
+
+ if ( s_res <= 0 || t_res <= 0 )
+ {
+ /* Incorrect string, compare by char value */
+ return ((int)s[0]-(int)t[0]);
+ }
+
+ plane=(s_wc>>8) & 0xFF;
+ s_wc = uni_plane[plane] ? uni_plane[plane][s_wc & 0xFF].sort : s_wc;
+ plane=(t_wc>>8) & 0xFF;
+ t_wc = uni_plane[plane] ? uni_plane[plane][t_wc & 0xFF].sort : t_wc;
+ if ( s_wc != t_wc )
+ {
+ return ((int) s_wc) - ((int) t_wc);
+ }
+
+ s+=s_res;
+ t+=t_res;
+ }
+
+ slen= se-s;
+ tlen= te-t;
+
+ if (slen != tlen)
+ {
+ int swap= 0;
+ if (slen < tlen)
+ {
+ slen= tlen;
+ s= t;
+ se= te;
+ swap= -1;
+ }
+ /*
+ This following loop uses the fact that in UTF-8
+ all multibyte characters are greater than space,
+ and all multibyte head characters are greater than
+ space. It means if we meet a character greater
+ than space, it always means that the longer string
+ is greater. So we can reuse the same loop from the
+ 8bit version, without having to process full multibute
+ sequences.
+ */
+ for ( ; s < se; s++)
+ {
+ if (*s != ' ')
+ return ((int)*s - (int) ' ') ^ swap;
+ }
+ }
+ return 0;
}
@@ -1969,7 +2055,7 @@ static MY_CHARSET_HANDLER my_charset_handler=
my_mbcharlen_utf8,
my_numchars_mb,
my_charpos_mb,
- my_wellformedlen_mb,
+ my_well_formed_len_mb,
my_lengthsp_8bit,
my_utf8_uni,
my_uni_utf8,
@@ -2009,7 +2095,8 @@ CHARSET_INFO my_charset_utf8_general_ci=
1, /* strxfrm_multiply */
1, /* mbminlen */
3, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0, /* max_sort_char */
&my_charset_handler,
&my_collation_ci_handler
};
@@ -2033,7 +2120,8 @@ CHARSET_INFO my_charset_utf8_bin=
1, /* strxfrm_multiply */
1, /* mbminlen */
3, /* mbmaxlen */
- 0,
+ 0, /* min_sort_char */
+ 0, /* max_sort_char */
&my_charset_handler,
&my_collation_mb_bin_handler
};
diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c
index d3b5c9d1796..8fd4e612713 100644
--- a/strings/ctype-win1250ch.c
+++ b/strings/ctype-win1250ch.c
@@ -38,7 +38,6 @@
*/
#define REAL_MYSQL
-
#ifdef REAL_MYSQL
#include "my_global.h"
@@ -445,103 +444,69 @@ static struct wordvalue doubles[] = {
break; \
}
-#define IS_END(p, src, len) (!(*p))
-
-#if UNUSED
-static int my_strcoll_win1250ch(const uchar * s1, const uchar * s2) {
- int v1, v2;
- const uchar * p1, * p2;
- int pass1 = 0, pass2 = 0;
- int diff;
-
- p1 = s1; p2 = s2;
-
- do {
- NEXT_CMP_VALUE(s1, p1, pass1, v1, 0);
- NEXT_CMP_VALUE(s2, p2, pass2, v2, 0);
- diff = v1 - v2;
- if (diff != 0) return diff;
- } while (v1);
- return 0;
-}
-#endif
-
-#ifdef UNUSED
-static int my_strxfrm_win1250ch(uchar * dest, const uchar * src, int len) {
- int value;
- const uchar * p;
- int pass = 0;
- int totlen = 0;
- p = src;
-
- do {
- NEXT_CMP_VALUE(src, p, pass, value, 0);
- if (totlen <= len)
- dest[totlen] = value;
- totlen++;
- } while (value);
- return totlen;
-}
-#endif
-
-#undef IS_END
-
#define IS_END(p, src, len) (((char *)p - (char *)src) >= (len))
static int my_strnncoll_win1250ch(CHARSET_INFO *cs __attribute__((unused)),
- const uchar * s1, uint len1,
- const uchar * s2, uint len2) {
- int v1, v2;
- const uchar * p1, * p2;
- int pass1 = 0, pass2 = 0;
- int diff;
-
- p1 = s1; p2 = s2;
-
- do {
- NEXT_CMP_VALUE(s1, p1, pass1, v1, (int)len1);
- NEXT_CMP_VALUE(s2, p2, pass2, v2, (int)len2);
- diff = v1 - v2;
- if (diff != 0) return diff;
- } while (v1);
- return 0;
+ const uchar * s1, uint len1,
+ const uchar * s2, uint len2)
+{
+ int v1, v2;
+ const uchar * p1, * p2;
+ int pass1 = 0, pass2 = 0;
+ int diff;
+
+ p1 = s1; p2 = s2;
+
+ do {
+ NEXT_CMP_VALUE(s1, p1, pass1, v1, (int)len1);
+ NEXT_CMP_VALUE(s2, p2, pass2, v2, (int)len2);
+ diff = v1 - v2;
+ if (diff != 0) return diff;
+ } while (v1);
+ return 0;
}
+
+/*
+ TODO: Has to be fixed as strnncollsp in ctype-simple
+*/
+
static
int my_strnncollsp_win1250ch(CHARSET_INFO * cs,
- const uchar *s, uint slen,
- const uchar *t, uint tlen)
+ const uchar *s, uint slen,
+ const uchar *t, uint tlen)
{
- for ( ; slen && my_isspace(cs, s[slen-1]) ; slen--);
- for ( ; tlen && my_isspace(cs, t[tlen-1]) ; tlen--);
+ for ( ; slen && s[slen-1] == ' ' ; slen--);
+ for ( ; tlen && t[tlen-1] == ' ' ; tlen--);
return my_strnncoll_win1250ch(cs,s,slen,t,tlen);
}
static int my_strnxfrm_win1250ch(CHARSET_INFO * cs __attribute__((unused)),
- uchar * dest, uint len,
- const uchar * src, uint srclen) {
- int value;
- const uchar * p;
- int pass = 0;
- uint totlen = 0;
- p = src;
-
- do {
- NEXT_CMP_VALUE(src, p, pass, value, (int)srclen);
- if (totlen <= len)
- dest[totlen] = value;
- totlen++;
- } while (value) ;
- return totlen;
+ uchar * dest, uint len,
+ const uchar * src, uint srclen)
+{
+ int value;
+ const uchar * p;
+ int pass = 0;
+ uint totlen = 0;
+ p = src;
+
+ do {
+ NEXT_CMP_VALUE(src, p, pass, value, (int)srclen);
+ if (totlen <= len)
+ dest[totlen] = value;
+ totlen++;
+ } while (value) ;
+ return totlen;
}
#undef IS_END
-
#ifdef REAL_MYSQL
-static uchar NEAR like_range_prefix_min_win1250ch[] = {
+static uchar NEAR like_range_prefix_min_win1250ch[] =
+{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
@@ -598,87 +563,83 @@ static uchar NEAR like_range_prefix_max_win1250ch[] = {
** optimized !
*/
-static my_bool my_like_range_win1250ch(CHARSET_INFO *cs __attribute__((unused)),
- const char *ptr, uint ptr_length,
- int escape, int w_one, int w_many,
- uint res_length,
- char *min_str, char *max_str,
- uint *min_length, uint *max_length) {
-
- int was_other_than_min = 0;
- const char *end = ptr + ptr_length;
- char *min_org = min_str;
- char *min_end = min_str + res_length;
-
- /* return 1; */
-
- for (; ptr != end && min_str != min_end ; ptr++) {
- if (*ptr == w_one) { /* '_' in SQL */
- break;
- }
- if (*ptr == w_many) { /* '%' in SQL */
- break;
- }
- if (*ptr == escape && ptr + 1 != end) { /* Skip escape */
- ptr++;
- }
- *min_str = like_range_prefix_min_win1250ch[(uint)(*ptr)];
- if (*min_str != min_sort_char) {
- was_other_than_min = 1;
- }
- min_str++;
- *max_str++ = like_range_prefix_max_win1250ch[(uint)(*ptr)];
- }
-
- *min_length = (uint) (min_str - min_org);
- *max_length = res_length;
- while (min_str != min_end) {
- *min_str++ = min_sort_char;
- *max_str++ = max_sort_char;
- }
- if (! was_other_than_min) {
- return 1;
- }
+static my_bool
+my_like_range_win1250ch(CHARSET_INFO *cs __attribute__((unused)),
+ const char *ptr, uint ptr_length,
+ pbool escape, pbool w_one, pbool w_many,
+ uint res_length,
+ char *min_str, char *max_str,
+ uint *min_length, uint *max_length)
+{
- return 0;
+ int only_min_found= 1;
+ const char *end = ptr + ptr_length;
+ char *min_org = min_str;
+ char *min_end = min_str + res_length;
+
+ /* return 1; */
+
+ for (; ptr != end && min_str != min_end ; ptr++)
+ {
+ if (*ptr == escape && ptr+1 != end)
+ ptr++; /* Skip escape */
+ else if (*ptr == w_one || *ptr == w_many) /* '_' or '%' in SQL */
+ break;
+ *min_str = like_range_prefix_min_win1250ch[(uint)(*ptr)];
+ if (*min_str != min_sort_char)
+ only_min_found= 0;
+ min_str++;
+ *max_str++ = like_range_prefix_max_win1250ch[(uint)(*ptr)];
+ }
+
+ *min_length = (uint) (min_str - min_org);
+ *max_length = res_length;
+ while (min_str != min_end)
+ {
+ *min_str++ = min_sort_char;
+ *max_str++ = max_sort_char;
+ }
+ return (only_min_found);
}
static MY_COLLATION_HANDLER my_collation_czech_ci_handler =
{
- my_strnncoll_win1250ch,
- my_strnncollsp_win1250ch,
- my_strnxfrm_win1250ch,
- my_like_range_win1250ch,
- my_wildcmp_8bit,
- my_strcasecmp_8bit,
- my_instr_simple,
- my_hash_sort_simple
+ my_strnncoll_win1250ch,
+ my_strnncollsp_win1250ch,
+ my_strnxfrm_win1250ch,
+ my_like_range_win1250ch,
+ my_wildcmp_8bit,
+ my_strcasecmp_8bit,
+ my_instr_simple,
+ my_hash_sort_simple
};
+
CHARSET_INFO my_charset_cp1250_czech_ci =
{
- 34,0,0, /* number */
- MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */
- "cp1250", /* cs name */
- "cp1250_czech_ci", /* name */
- "", /* comment */
- ctype_win1250ch,
- to_lower_win1250ch,
- to_upper_win1250ch,
- sort_order_win1250ch,
- tab_cp1250_uni, /* tab_to_uni */
- idx_uni_cp1250, /* tab_from_uni */
- "","",
- 2, /* strxfrm_multiply */
- 1, /* mbminlen */
- 1, /* mbmaxlen */
- 0,
- &my_charset_8bit_handler,
- &my_collation_czech_ci_handler
+ 34,0,0, /* number */
+ MY_CS_COMPILED|MY_CS_STRNXFRM, /* state */
+ "cp1250", /* cs name */
+ "cp1250_czech_ci", /* name */
+ "", /* comment */
+ ctype_win1250ch,
+ to_lower_win1250ch,
+ to_upper_win1250ch,
+ sort_order_win1250ch,
+ tab_cp1250_uni, /* tab_to_uni */
+ idx_uni_cp1250, /* tab_from_uni */
+ "","",
+ 2, /* strxfrm_multiply */
+ 1, /* mbminlen */
+ 1, /* mbmaxlen */
+ 0, /* min_sort_char */
+ 0, /* max_sort_char */
+ &my_charset_8bit_handler,
+ &my_collation_czech_ci_handler
};
-#endif
+#endif /* REAL_MYSQL */
-#endif
+#endif /* HAVE_CHARSET_cp1250 */
diff --git a/strings/strto.c b/strings/strto.c
index 6f12656cb20..52efec6e087 100644
--- a/strings/strto.c
+++ b/strings/strto.c
@@ -95,7 +95,7 @@ function (const char *nptr,char **endptr,int base)
s = nptr;
/* Skip white space. */
- while (my_isspace (&my_charset_latin1, *s))
+ while (my_isspace(&my_charset_latin1, *s))
++s;
if (*s == '\0')
{
diff --git a/strings/strtod.c b/strings/strtod.c
new file mode 100644
index 00000000000..bc8105b8040
--- /dev/null
+++ b/strings/strtod.c
@@ -0,0 +1,132 @@
+/*
+ An alternative implementation of "strtod()" that is both
+ simplier, and thread-safe.
+
+ From mit-threads as bundled with MySQL 3.23
+
+ SQL:2003 specifies a number as
+
+<signed numeric literal> ::= [ <sign> ] <unsigned numeric literal>
+
+<unsigned numeric literal> ::=
+ <exact numeric literal>
+ | <approximate numeric literal>
+
+<exact numeric literal> ::=
+ <unsigned integer> [ <period> [ <unsigned integer> ] ]
+ | <period> <unsigned integer>
+
+<approximate numeric literal> ::= <mantissa> E <exponent>
+
+<mantissa> ::= <exact numeric literal>
+
+<exponent> ::= <signed integer>
+
+ So do we.
+
+ */
+
+#include "my_base.h" /* Includes errno.h */
+#include "m_ctype.h"
+
+static double scaler10[] = {
+ 1.0, 1e10, 1e20, 1e30, 1e40, 1e50, 1e60, 1e70, 1e80, 1e90
+};
+static double scaler1[] = {
+ 1.0, 10.0, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9
+};
+
+
+double my_strtod(const char *str, char **end)
+{
+ double result= 0.0;
+ int negative, ndigits;
+ const char *old_str;
+ my_bool overflow=0;
+
+ while (my_isspace(&my_charset_latin1, *str))
+ str++;
+
+ if ((negative= (*str == '-')) || *str=='+')
+ str++;
+
+ old_str= str;
+ while (my_isdigit (&my_charset_latin1, *str))
+ {
+ result= result*10.0 + (*str - '0');
+ str++;
+ }
+ ndigits= str-old_str;
+
+ if (*str == '.')
+ {
+ double p10=10;
+ str++;
+ old_str= str;
+ while (my_isdigit (&my_charset_latin1, *str))
+ {
+ result+= (*str++ - '0')/p10;
+ p10*=10;
+ }
+ ndigits+= str-old_str;
+ if (!ndigits) str--;
+ }
+ if (ndigits && (*str=='e' || *str=='E'))
+ {
+ int exp= 0;
+ int neg= 0;
+ const char *old_str= str++;
+
+ if ((neg= (*str == '-')) || *str == '+')
+ str++;
+
+ if (!my_isdigit (&my_charset_latin1, *str))
+ str= old_str;
+ else
+ {
+ double scaler= 1.0;
+ while (my_isdigit (&my_charset_latin1, *str))
+ {
+ if (exp < 9999) /* protection against exp overflow */
+ exp= exp*10 + *str - '0';
+ str++;
+ }
+ if (exp >= 1000)
+ {
+ if (neg)
+ result= 0.0;
+ else
+ overflow= 1;
+ goto done;
+ }
+ while (exp >= 100)
+ {
+ scaler*= 1.0e100;
+ exp-= 100;
+ }
+ scaler*= scaler10[exp/10]*scaler1[exp%10];
+ if (neg)
+ result/= scaler;
+ else
+ result*= scaler;
+ }
+ }
+
+done:
+ if (end)
+ *end = (char *)str;
+
+ if (overflow || isinf(result))
+ {
+ result= DBL_MAX;
+ errno= EOVERFLOW;
+ }
+
+ return negative ? -result : result;
+}
+
+double my_atof(const char *nptr)
+{
+ return (my_strtod(nptr, 0));
+}
+
diff --git a/strings/uca-dump.c b/strings/uca-dump.c
new file mode 100644
index 00000000000..6836c321526
--- /dev/null
+++ b/strings/uca-dump.c
@@ -0,0 +1,276 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+typedef unsigned char uchar;
+typedef unsigned short uint16;
+
+struct uca_item_st
+{
+ uchar num;
+ uint16 weight[4][9];
+};
+
+#if 0
+#define MY_UCA_NPAGES 1024
+#define MY_UCA_NCHARS 64
+#define MY_UCA_CMASK 63
+#define MY_UCA_PSHIFT 6
+#else
+#define MY_UCA_NPAGES 256
+#define MY_UCA_NCHARS 256
+#define MY_UCA_CMASK 255
+#define MY_UCA_PSHIFT 8
+#endif
+
+int main(int ac, char **av)
+{
+ char str[256];
+ char *weights[64];
+ struct uca_item_st uca[64*1024];
+ size_t code, page, w;
+ int pagemaxlen[MY_UCA_NPAGES];
+ int pageloaded[MY_UCA_NPAGES];
+
+ bzero(uca, sizeof(uca));
+ bzero(pageloaded, sizeof(pageloaded));
+
+ while (fgets(str,sizeof(str),stdin))
+ {
+ char *comment;
+ char *weight;
+ char *s;
+ size_t codenum;
+
+ code= strtol(str,NULL,16);
+
+ if (str[0]=='#' || (code > 0xFFFF))
+ continue;
+ if ((comment=strchr(str,'#')))
+ {
+ *comment++= '\0';
+ for ( ; *comment==' ' ; comment++);
+ }else
+ continue;
+
+ if ((weight=strchr(str,';')))
+ {
+ *weight++= '\0';
+ for ( ; *weight==' ' ; weight++);
+ }
+ else
+ continue;
+
+ codenum= 0;
+ s= strtok(str, " \t");
+ while (s)
+ {
+ s= strtok(NULL, " \t");
+ codenum++;
+ }
+
+ if (codenum>1)
+ {
+ /* Multi-character weight,
+ i.e. contraction.
+ Not supported yet.
+ */
+ continue;
+ }
+
+ uca[code].num= 0;
+ s= strtok(weight, " []");
+ while (s)
+ {
+ weights[uca[code].num]= s;
+ s= strtok(NULL, " []");
+ uca[code].num++;
+ }
+
+ for (w=0; w < uca[code].num; w++)
+ {
+ size_t partnum;
+
+ partnum= 0;
+ s= weights[w];
+ while (*s)
+ {
+ char *endptr;
+ size_t part;
+ part= strtol(s+1,&endptr,16);
+ uca[code].weight[partnum][w]= part;
+ s= endptr;
+ partnum++;
+ }
+ }
+ /* Mark that a character from this page was loaded */
+ pageloaded[code >> MY_UCA_PSHIFT]++;
+ }
+
+
+
+ /* Now set implicit weights */
+ for (code=0; code <= 0xFFFF; code++)
+ {
+ size_t base, aaaa, bbbb;
+
+ if (uca[code].num)
+ continue;
+
+ /*
+ 3400;<CJK Ideograph Extension A, First>
+ 4DB5;<CJK Ideograph Extension A, Last>
+ 4E00;<CJK Ideograph, First>
+ 9FA5;<CJK Ideograph, Last>
+ */
+
+ if (code >= 0x3400 && code <= 0x4DB5)
+ base= 0xFB80;
+ else if (code >= 0x4E00 && code <= 0x9FA5)
+ base= 0xFB40;
+ else
+ base= 0xFBC0;
+
+ aaaa= base + (code >> 15);
+ bbbb= (code & 0x7FFF) | 0x8000;
+ uca[code].weight[0][0]= aaaa;
+ uca[code].weight[0][1]= bbbb;
+
+ uca[code].weight[1][0]= 0x0020;
+ uca[code].weight[1][1]= 0x0000;
+
+ uca[code].weight[2][0]= 0x0002;
+ uca[code].weight[2][1]= 0x0000;
+
+ uca[code].weight[3][0]= 0x0001;
+ uca[code].weight[3][2]= 0x0000;
+
+ uca[code].num= 2;
+ }
+
+ printf("#include \"my_uca.h\"\n");
+
+ printf("#define MY_UCA_NPAGES %d\n",MY_UCA_NPAGES);
+ printf("#define MY_UCA_NCHARS %d\n",MY_UCA_NCHARS);
+ printf("#define MY_UCA_CMASK %d\n",MY_UCA_CMASK);
+ printf("#define MY_UCA_PSHIFT %d\n",MY_UCA_PSHIFT);
+
+ for (w=0; w<1; w++)
+ {
+ for (page=0; page < MY_UCA_NPAGES; page++)
+ {
+ size_t offs;
+ size_t maxnum= 0;
+ size_t nchars= 0;
+ size_t mchars;
+
+ /*
+ Skip this page if no weights were loaded
+ */
+
+ if (!pageloaded[page])
+ continue;
+
+ /*
+ Calculate maximum weight
+ length for this page
+ */
+
+ for (offs=0; offs < MY_UCA_NCHARS; offs++)
+ {
+ size_t i, num;
+
+ code= page*MY_UCA_NCHARS+offs;
+
+ /* Calculate only non-zero weights */
+ num=0;
+ for (i=0; i < uca[code].num; i++)
+ if (uca[code].weight[w][i])
+ num++;
+
+ maxnum= maxnum < num ? num : maxnum;
+ }
+ maxnum++;
+
+ switch (maxnum)
+ {
+ case 0: mchars= 8; break;
+ case 1: mchars= 8; break;
+ case 2: mchars= 8; break;
+ case 3: mchars= 9; break;
+ case 4: mchars= 8; break;
+ default: mchars= uca[code].num;
+ }
+
+ pagemaxlen[page]= maxnum;
+
+
+ /*
+ Now print this page
+ */
+
+
+ printf("uint16 page%03Xdata[]= { /* %04X (%d weights per char) */\n",
+ page, page*MY_UCA_NCHARS, maxnum);
+
+ for (offs=0; offs < MY_UCA_NCHARS; offs++)
+ {
+ uint16 weight[8];
+ size_t num, i;
+
+ code= page*MY_UCA_NCHARS+offs;
+
+ bzero(weight,sizeof(weight));
+
+ /* Copy non-zero weights */
+ for (num=0, i=0; i < uca[code].num; i++)
+ {
+ if (uca[code].weight[w][i])
+ {
+ weight[num]= uca[code].weight[w][i];
+ num++;
+ }
+ }
+
+ for (i=0; i < maxnum; i++)
+ {
+ printf("0x%04X",(int)weight[i]);
+ if ((offs+1 != MY_UCA_NCHARS) || (i+1!=maxnum))
+ printf(",");
+ nchars++;
+ }
+ if (nchars >=mchars)
+ {
+ printf("\n");
+ nchars=0;
+ }
+ else
+ {
+ printf(" ");
+ }
+ }
+ printf("};\n\n");
+ }
+ }
+
+ printf("uchar ucal[%d]={\n",MY_UCA_NPAGES);
+ for (page=0; page < MY_UCA_NPAGES; page++)
+ {
+ printf("%d%s%s",pagemaxlen[page],page<MY_UCA_NPAGES-1?",":"",(page+1) % 16 ? "":"\n");
+ }
+ printf("};\n");
+
+
+ printf("uint16 *ucaw[%d]={\n",MY_UCA_NPAGES);
+ for (page=0; page < MY_UCA_NPAGES; page++)
+ {
+ if (!pageloaded[page])
+ printf("NULL %s%s",page<MY_UCA_NPAGES-1?",":"", (page+1) % 4 ? "":"\n");
+ else
+ printf("page%03Xdata%s%s",page,page<MY_UCA_NPAGES-1?",":"", (page+1) % 4 ? "":"\n");
+ }
+ printf("};\n");
+
+ printf("int main(void){ return 0;};\n");
+ return 0;
+}
diff --git a/support-files/Makefile.am b/support-files/Makefile.am
index 58808b5e255..196da3d8744 100644
--- a/support-files/Makefile.am
+++ b/support-files/Makefile.am
@@ -35,6 +35,7 @@ pkgdata_DATA = my-small.cnf \
my-large.cnf \
my-huge.cnf \
mysql-log-rotate \
+ mysql-@VERSION@.spec \
MySQL-shared-compat.spec
pkgdata_SCRIPTS = mysql.server
diff --git a/support-files/MySQL-shared-compat.spec.sh b/support-files/MySQL-shared-compat.spec.sh
index 06dfec1f6f9..2a257a601a1 100644
--- a/support-files/MySQL-shared-compat.spec.sh
+++ b/support-files/MySQL-shared-compat.spec.sh
@@ -42,8 +42,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
Obsoletes: MySQL-shared, mysql-shared
Provides: MySQL-shared
Summary: MySQL shared libraries for MySQL %{version4} and %{version3}
-Source0: MySQL-shared-%{version4}-0.i386.rpm
-Source1: MySQL-shared-%{version3}-1.i386.rpm
+Source0: MySQL-shared-%{version4}-0.%{_arch}.rpm
+Source1: MySQL-shared-%{version3}-1.%{_arch}.rpm
# No need to include the RPMs once more - they can be downloaded seperately
# if you want to rebuild this package
NoSource: 0
diff --git a/support-files/my-innodb-heavy-4G.cnf.sh b/support-files/my-innodb-heavy-4G.cnf.sh
index 9c772269749..54df6a8bfe6 100644
--- a/support-files/my-innodb-heavy-4G.cnf.sh
+++ b/support-files/my-innodb-heavy-4G.cnf.sh
@@ -71,7 +71,7 @@ max_connections = 100
# the host will be blocked from connecting to the MySQL server until
# "FLUSH HOSTS" has been run or the server was restarted. Invalid
# passwords and other errors during the connect phase result in
-# increasing this value. See the "Aborted_Connects" status variable for
+# increasing this value. See the "Aborted_connects" status variable for
# global counter.
max_connect_errors = 10
@@ -111,14 +111,14 @@ max_heap_table_size = 64M
# Sort buffer is used to perform sorts for some ORDER BY and GROUP BY
# queries. If sorted data does not fit into the sort buffer, a disk
-# based merge sort is used instead - See "sort_merge_passes". Allocated
-# per thread if sort is needed.
+# based merge sort is used instead - See the "Sort_merge_passes"
+# status variable. Allocated per thread if sort is needed.
sort_buffer_size = 8M
# This buffer is used for the optimization of full JOINs (JOINs without
# indexes). Such JOINs are very bad for performance in most cases
# anyway, but setting this variable to a large value reduces the
-# performance impact. See the "select_full_join" status variable for a
+# performance impact. See the "Select_full_join" status variable for a
# count of full JOINs. Allocated per thread if full join is found
join_buffer_size = 8M
diff --git a/support-files/mysql.server.sh b/support-files/mysql.server.sh
index 5911ecd942b..849f913bf6c 100644
--- a/support-files/mysql.server.sh
+++ b/support-files/mysql.server.sh
@@ -59,6 +59,12 @@ export PATH
mode=$1 # start or stop
+case `echo "testing\c"`,`echo -n testing` in
+ *c*,-n*) echo_n= echo_c= ;;
+ *c*,*) echo_n=-n echo_c= ;;
+ *) echo_n= echo_c='\c' ;;
+esac
+
parse_arguments() {
for arg do
case "$arg" in
@@ -169,7 +175,7 @@ case "$mode" in
sleep 1
while [ -s $pid_file -a "$flags" != aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ]
do
- [ -z "$flags" ] && echo "Wait for mysqld to exit\c" || echo ".\c"
+ [ -z "$flags" ] && echo $echo_n "Wait for mysqld to exit$echo_c" || echo $echo_n ".$echo_c"
flags=a$flags
sleep 1
done
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index 1ee88096def..fe5dae3dbf6 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -16,7 +16,7 @@ Summary(pt_BR): MySQL: Um servidor SQL rápido e confiável.
Group(pt_BR): Aplicações/Banco_de_Dados
Version: @MYSQL_NO_DASH_VERSION@
Release: %{release}
-Copyright: GPL
+License: GPL
Source: http://www.mysql.com/Downloads/MySQL-@MYSQL_BASE_VERSION@/mysql-%{mysql_version}.tar.gz
URL: http://www.mysql.com/
Packager: Lenz Grimmer <build@mysql.com>
@@ -259,10 +259,11 @@ export PATH
# Build the 4.0 Max binary (includes BDB and UDFs and therefore
# cannot be linked statically against the patched glibc)
-# If we want to compile with RAID using gcc 3, we need to use
-# gcc instead of g++ to avoid linking problems (RAID code is written in C++)
-test -z $CXX && test -z $CC && if gcc -v 2>&1 | grep 'gcc version 3' > /dev/null 2>&1
+# Use gcc for C and C++ code (to avoid a dependency on libstdc++ and
+# including exceptions into the code
+if [ -z "$CXX" -a -z "$CC" ]
then
+ export CC="gcc"
export CXX="gcc"
fi
@@ -469,6 +470,7 @@ fi
%attr(755, root, root) %{_bindir}/isamlog
%attr(755, root, root) %{_bindir}/my_print_defaults
%attr(755, root, root) %{_bindir}/myisamchk
+%attr(755, root, root) %{_bindir}/myisam_ftdump
%attr(755, root, root) %{_bindir}/myisamlog
%attr(755, root, root) %{_bindir}/myisampack
%attr(755, root, root) %{_bindir}/mysql_convert_table_format
@@ -496,7 +498,7 @@ fi
%attr(755, root, root) %{_sbindir}/rcmysql
%attr(644, root, root) %{_libdir}/mysql/mysqld.sym
-%attr(644, root, root) %{_sysconfdir}/logrotate.d/mysql
+%attr(644, root, root) %config(noreplace,missingok) %{_sysconfdir}/logrotate.d/mysql
%attr(755, root, root) %{_sysconfdir}/init.d/mysql
%attr(755, root, root) %{_datadir}/mysql/
@@ -575,10 +577,23 @@ fi
# The spec file changelog only includes changes made to the spec file
# itself
%changelog
+* Thu Feb 12 2004 Lenz Grimmer <lenz@mysql.com>
+
+- when using gcc, _always_ use CXX=gcc
+- replaced Copyright with License field (Copyright is obsolete)
+
+* Tue Feb 03 2004 Lenz Grimmer <lenz@mysql.com>
+
+- added myisam_ftdump to the Server package
+
* Tue Jan 13 2004 Lenz Grimmer <lenz@mysql.com>
- link the mysql client against libreadline instead of libedit (BUG 2289)
+* Mon Dec 22 2003 Lenz Grimmer <lenz@mysql.com>
+
+- marked /etc/logrotate.d/mysql as a config file (BUG 2156)
+
* Fri Dec 13 2003 Lenz Grimmer <lenz@mysql.com>
- fixed file permissions (BUG 1672)
diff --git a/tests/client_test.c b/tests/client_test.c
index 6792652b708..d19f7cbbb2f 100644
--- a/tests/client_test.c
+++ b/tests/client_test.c
@@ -16,7 +16,7 @@
/***************************************************************************
This is a test sample to test the new features in MySQL client-server
- protocol
+ protocol
Main author: venu ( venu@mysql.com )
@@ -160,7 +160,10 @@ static void print_st_error(MYSQL_STMT *stmt, const char *msg)
MYSQL_STMT *STDCALL
mysql_simple_prepare(MYSQL *mysql, const char *query)
{
- return mysql_prepare(mysql, query, strlen(query));
+ MYSQL_STMT *stmt= mysql_stmt_init(mysql);
+ if (mysql_stmt_prepare(stmt, query, strlen(query)))
+ return 0;
+ return stmt;
}
@@ -2963,6 +2966,8 @@ static void test_bind_result_ext()
fprintf(stdout, "\n data (double) : %f", d_data);
fprintf(stdout, "\n data (str) : %s(%lu)", szData, szLength);
+
+ bData[bLength]= '\0'; /* bData is binary */
fprintf(stdout, "\n data (bin) : %s(%lu)", bData, bLength);
@@ -3939,6 +3944,7 @@ static void test_prepare_resultset()
result = mysql_get_metadata(stmt);
mytest(result);
my_print_result_metadata(result);
+ mysql_free_result(result);
mysql_stmt_close(stmt);
}
@@ -4070,18 +4076,18 @@ static void test_stmt_close()
fprintf(stdout,"\n mysql_close_stmt(1) returned: %d", rc);
assert(rc == 0);
- mysql_close(lmysql); /* it should free all open stmts(stmt3, 2 and 1) */
+ /*
+ Originally we were going to close all statements automatically in
+ mysql_close(). This proved to not work well - users weren't able to
+ close statements by hand once mysql_close() had been called.
+ Now mysql_close() doesn't free any statements, so this test doesn't
+ serve its original destination any more.
+ Here we free stmt2 and stmt3 by hande to avoid memory leaks.
+ */
+ mysql_stmt_close(stmt2);
+ mysql_stmt_close(stmt3);
+ mysql_close(lmysql);
-#if NOT_VALID
- rc= mysql_stmt_close(stmt3);
- fprintf(stdout,"\n mysql_close_stmt(3) returned: %d", rc);
- assert( rc == 1);
-
- rc= mysql_stmt_close(stmt2);
- fprintf(stdout,"\n mysql_close_stmt(2) returned: %d", rc);
- assert( rc == 1);
-#endif
-
count= 100;
bind[0].buffer=(char *)&count;
bind[0].buffer_type=MYSQL_TYPE_LONG;
@@ -4871,7 +4877,10 @@ DROP TABLE IF EXISTS test_multi_tab";
{
fprintf(stdout,"\n Query %d: ", count);
if ((result= mysql_store_result(mysql_local)))
+ {
my_process_result_set(result);
+ mysql_free_result(result);
+ }
else
fprintf(stdout,"OK, %lld row(s) affected, %d warning(s)\n",
mysql_affected_rows(mysql_local),
@@ -5768,6 +5777,7 @@ static void test_open_direct()
mytest(result);
assert(0 == my_process_result_set(result));
+ mysql_free_result(result);
rc = mysql_execute(stmt);
mystmt(stmt, rc);
@@ -5781,6 +5791,7 @@ static void test_open_direct()
mytest(result);
assert(1 == my_process_result_set(result));
+ mysql_free_result(result);
rc = mysql_execute(stmt);
mystmt(stmt, rc);
@@ -5794,6 +5805,8 @@ static void test_open_direct()
mytest(result);
assert(2 == my_process_result_set(result));
+ mysql_free_result(result);
+
mysql_stmt_close(stmt);
/* run a direct query in the middle of a fetch */
@@ -6446,6 +6459,7 @@ static void test_prepare_grant()
assert(4 == my_stmt_result("SELECT * FROM test_grant"));
+ mysql_stmt_close(stmt);
mysql_close(lmysql);
mysql= org_mysql;
@@ -6553,7 +6567,7 @@ static void test_decimal_bug()
{
MYSQL_STMT *stmt;
MYSQL_BIND bind[1];
- double data;
+ char data[30];
int rc;
my_bool is_null;
@@ -6573,9 +6587,9 @@ static void test_decimal_bug()
stmt = mysql_simple_prepare(mysql,"select c1 from test_decimal_bug where c1= ?");
mystmt_init(stmt);
- bind[0].buffer_type= MYSQL_TYPE_DOUBLE;
- bind[0].buffer= (char *)&data;
- bind[0].buffer_length= 0;
+ bind[0].buffer_type= MYSQL_TYPE_STRING;
+ bind[0].buffer= (char *)data;
+ bind[0].buffer_length= 25;
bind[0].is_null= &is_null;
bind[0].length= 0;
@@ -6583,36 +6597,36 @@ static void test_decimal_bug()
rc = mysql_bind_param(stmt, bind);
mystmt(stmt,rc);
- data= 8.0;
+ strcpy(data, "8.0");
rc = mysql_execute(stmt);
mystmt(stmt,rc);
- data=0;
+ data[0]=0;
rc = mysql_bind_result(stmt, bind);
mystmt(stmt,rc);
rc = mysql_fetch(stmt);
mystmt(stmt,rc);
- fprintf(stdout, "\n data: %g", data);
- assert(data == 8.0);
+ fprintf(stdout, "\n data: %s", data);
+ assert(strcmp(data, "8.00")==0);
rc = mysql_fetch(stmt);
assert(rc == MYSQL_NO_DATA);
- data= 5.61;
+ strcpy(data, "5.61");
rc = mysql_execute(stmt);
mystmt(stmt,rc);
- data=0;
+ data[0]=0;
rc = mysql_bind_result(stmt, bind);
mystmt(stmt,rc);
rc = mysql_fetch(stmt);
mystmt(stmt,rc);
- fprintf(stdout, "\n data: %g", data);
- assert(data == 5.61);
+ fprintf(stdout, "\n data: %s", data);
+ assert(strcmp(data, "5.61")==0);
rc = mysql_fetch(stmt);
assert(rc == MYSQL_NO_DATA);
@@ -6624,19 +6638,19 @@ static void test_decimal_bug()
rc = mysql_fetch(stmt);
assert(rc == MYSQL_NO_DATA);
- data= 10.22; is_null= 0;
+ strcpy(data, "10.22"); is_null= 0;
rc = mysql_execute(stmt);
mystmt(stmt,rc);
- data=0;
+ data[0]=0;
rc = mysql_bind_result(stmt, bind);
mystmt(stmt,rc);
rc = mysql_fetch(stmt);
mystmt(stmt,rc);
- fprintf(stdout, "\n data: %g", data);
- assert(data == 10.22);
+ fprintf(stdout, "\n data: %s", data);
+ assert(strcmp(data, "10.22")==0);
rc = mysql_fetch(stmt);
assert(rc == MYSQL_NO_DATA);
@@ -7552,6 +7566,8 @@ static void test_mem_overun()
rc = mysql_fetch(stmt);
assert(rc == MYSQL_NO_DATA);
+ mysql_free_result(field_res);
+
mysql_stmt_close(stmt);
}
@@ -7876,6 +7892,7 @@ static void test_ts()
ts.hour= 21;
ts.minute= 07;
ts.second= 46;
+ ts.second_part= 0;
length= (long)(strmov(strts,"2003-07-12 21:07:46") - strts);
bind[0].buffer_type= MYSQL_TYPE_TIMESTAMP;
@@ -7984,6 +8001,8 @@ static void test_bug1500()
bind[0].buffer= (char *)int_data;
bind[0].buffer_type= FIELD_TYPE_LONG;
bind[0].is_null= 0;
+ bind[0].length= NULL;
+ bind[0].buffer_length= 0;
bind[2]= bind[1]= bind[0];
bind[1].buffer= (char *)(int_data + 1);
bind[2].buffer= (char *)(int_data + 2);
@@ -8189,6 +8208,89 @@ static void test_bug2247()
fprintf(stdout, "OK");
}
+
+static void test_subqueries()
+{
+ MYSQL_STMT *stmt;
+ int rc, i;
+ const char *query= "SELECT (SELECT SUM(a+b) FROM t2 where t1.b=t2.b GROUP BY t1.a LIMIT 1) as scalar_s, exists (select 1 from t2 where t2.a/2=t1.a) as exists_s, a in (select a+3 from t2) as in_s, (a-1,b-1) in (select a,b from t2) as in_row_s FROM t1, (select a x, b y from t2) tt WHERE x=a";
+
+ myheader("test_subquery");
+
+ rc = mysql_query(mysql, "DROP TABLE IF EXISTS t1,t2");
+ myquery(rc);
+
+ rc= mysql_query(mysql,"CREATE TABLE t1 (a int , b int);");
+ myquery(rc);
+
+ rc= mysql_query(mysql,
+ "insert into t1 values (1,1), (2, 2), (3,3), (4,4), (5,5);");
+ myquery(rc);
+
+ rc= mysql_query(mysql,"create table t2 select * from t1;");
+ myquery(rc);
+
+ stmt= mysql_prepare(mysql, query, strlen(query));
+ mystmt_init(stmt);
+ for (i= 0; i < 3; i++)
+ {
+ rc= mysql_execute(stmt);
+ mystmt(stmt, rc);
+ assert(5 == my_process_stmt_result(stmt));
+ }
+ mysql_stmt_close(stmt);
+
+ rc= mysql_query(mysql, "DROP TABLE t1,t2");
+ myquery(rc);
+}
+
+
+static void test_bad_union()
+{
+ MYSQL_STMT *stmt;
+ const char *query= "SELECT 1, 2 union SELECT 1";
+
+ myheader("test_bad_union");
+
+ stmt= mysql_prepare(mysql, query, strlen(query));
+ assert(stmt == 0);
+ myerror(NULL);
+}
+
+static void test_distinct()
+{
+ MYSQL_STMT *stmt;
+ int rc, i;
+ const char *query=
+ "SELECT 2+count(distinct b), group_concat(a) FROM t1 group by a";
+
+ myheader("test_subquery");
+
+ rc = mysql_query(mysql, "DROP TABLE IF EXISTS t1");
+ myquery(rc);
+
+ rc= mysql_query(mysql,"CREATE TABLE t1 (a int , b int);");
+ myquery(rc);
+
+ rc= mysql_query(mysql,
+ "insert into t1 values (1,1), (2, 2), (3,3), (4,4), (5,5),\
+(1,10), (2, 20), (3,30), (4,40), (5,50);");
+ myquery(rc);
+
+ for (i= 0; i < 3; i++)
+ {
+ stmt= mysql_prepare(mysql, query, strlen(query));
+ mystmt_init(stmt);
+ rc= mysql_execute(stmt);
+ mystmt(stmt, rc);
+ assert(5 == my_process_stmt_result(stmt));
+ mysql_stmt_close(stmt);
+ }
+
+ rc= mysql_query(mysql, "DROP TABLE t1");
+ myquery(rc);
+}
+
/*
Test for bug#2248 "mysql_fetch without prior mysql_execute hangs"
*/
@@ -8246,6 +8348,326 @@ static void test_bug2248()
myquery(rc);
}
+static void test_subqueries_ref()
+{
+ MYSQL_STMT *stmt;
+ int rc, i;
+ const char *query= "SELECT a as ccc from t1 where a+1=(SELECT 1+ccc from t1 where ccc+1=a+1 and a=1)";
+
+ myheader("test_subquery_ref");
+
+ rc = mysql_query(mysql, "DROP TABLE IF EXISTS t1");
+ myquery(rc);
+
+ rc= mysql_query(mysql,"CREATE TABLE t1 (a int);");
+ myquery(rc);
+
+ rc= mysql_query(mysql,
+ "insert into t1 values (1), (2), (3), (4), (5);");
+ myquery(rc);
+
+ stmt= mysql_prepare(mysql, query, strlen(query));
+ mystmt_init(stmt);
+ for (i= 0; i < 3; i++)
+ {
+ rc= mysql_execute(stmt);
+ mystmt(stmt, rc);
+ assert(1 == my_process_stmt_result(stmt));
+ }
+ mysql_stmt_close(stmt);
+
+ rc= mysql_query(mysql, "DROP TABLE t1");
+ myquery(rc);
+}
+
+
+static void test_union()
+{
+ MYSQL_STMT *stmt;
+ int rc;
+
+ myheader("test_union");
+
+ rc= mysql_query(mysql, "DROP TABLE IF EXISTS t1, t2");
+ myquery(rc);
+
+ rc= mysql_query(mysql,
+ "CREATE TABLE t1 "
+ "(id INTEGER NOT NULL PRIMARY KEY, "
+ " name VARCHAR(20) NOT NULL)");
+ myquery(rc);
+ rc= mysql_query(mysql,
+ "INSERT INTO t1 (id, name) VALUES "
+ "(2, 'Ja'), (3, 'Ede'), "
+ "(4, 'Haag'), (5, 'Kabul'), "
+ "(6, 'Almere'), (7, 'Utrecht'), "
+ "(8, 'Qandahar'), (9, 'Amsterdam'), "
+ "(10, 'Amersfoort'), (11, 'Constantine')");
+ myquery(rc);
+ rc= mysql_query(mysql,
+ "CREATE TABLE t2 "
+ "(id INTEGER NOT NULL PRIMARY KEY, "
+ " name VARCHAR(20) NOT NULL)");
+ myquery(rc);
+ rc= mysql_query(mysql,
+ "INSERT INTO t2 (id, name) VALUES "
+ "(4, 'Guam'), (5, 'Aruba'), "
+ "(6, 'Angola'), (7, 'Albania'), "
+ "(8, 'Anguilla'), (9, 'Argentina'), "
+ "(10, 'Azerbaijan'), (11, 'Afghanistan'), "
+ "(12, 'Burkina Faso'), (13, 'Faroe Islands')");
+ myquery(rc);
+
+ stmt= mysql_simple_prepare(mysql,
+ "SELECT t1.name FROM t1 UNION "
+ "SELECT t2.name FROM t2");
+ mystmt_init(stmt);
+
+ rc= mysql_stmt_execute(stmt);
+ mystmt(stmt,rc);
+ assert(20 == my_process_stmt_result(stmt));
+ mysql_stmt_close(stmt);
+
+ rc= mysql_query(mysql, "DROP TABLE t1, t2");
+ myquery(rc);
+}
+
+static void test_bug3117()
+{
+ MYSQL_STMT *stmt;
+ MYSQL_BIND buffer;
+ longlong lii;
+ ulong length;
+ my_bool is_null;
+ int rc;
+
+ myheader("test_bug3117");
+
+ rc = mysql_query(mysql, "DROP TABLE IF EXISTS t1");
+ myquery(rc);
+
+ rc= mysql_query(mysql,"CREATE TABLE t1 (id int auto_increment primary key)");
+ myquery(rc);
+
+ stmt = mysql_simple_prepare(mysql, "SELECT LAST_INSERT_ID()");
+ mystmt_init(stmt);
+
+ rc= mysql_query(mysql, "INSERT INTO t1 VALUES (NULL)");
+ myquery(rc);
+
+ rc = mysql_execute(stmt);
+ mystmt(stmt,rc);
+
+ buffer.buffer_type= MYSQL_TYPE_LONGLONG;
+ buffer.buffer_length= sizeof(lii);
+ buffer.buffer= (char *)&lii;
+ buffer.length= &length;
+ buffer.is_null= &is_null;
+
+ rc= mysql_bind_result(stmt, &buffer);
+ mystmt(stmt,rc);
+
+ rc= mysql_stmt_store_result(stmt);
+ mystmt(stmt,rc);
+
+ rc = mysql_fetch(stmt);
+ mystmt(stmt, rc);
+
+ assert(is_null == 0 && lii == 1);
+ fprintf(stdout, "\n\tLAST_INSERT_ID() = 1 ok\n");
+
+ rc= mysql_query(mysql, "INSERT INTO t1 VALUES (NULL)");
+ myquery(rc);
+
+ rc = mysql_execute(stmt);
+ mystmt(stmt,rc);
+
+ rc = mysql_fetch(stmt);
+ mystmt(stmt, rc);
+
+ assert(is_null == 0 && lii == 2);
+ fprintf(stdout, "\tLAST_INSERT_ID() = 2 ok\n");
+
+ mysql_stmt_close(stmt);
+
+ rc= mysql_query(mysql, "DROP TABLE t1");
+ myquery(rc);
+}
+
+
+static void test_join()
+{
+ MYSQL_STMT *stmt;
+ int rc, i, j;
+ const char *query[]={"SELECT * FROM t2 join t1 on (t1.a=t2.a)",
+ "SELECT * FROM t2 natural join t1",
+ "SELECT * FROM t2 join t1 using(a)",
+ "SELECT * FROM t2 left join t1 on(t1.a=t2.a)",
+ "SELECT * FROM t2 natural left join t1",
+ "SELECT * FROM t2 left join t1 using(a)",
+ "SELECT * FROM t2 right join t1 on(t1.a=t2.a)",
+ "SELECT * FROM t2 natural right join t1",
+ "SELECT * FROM t2 right join t1 using(a)"};
+
+ myheader("test_join");
+
+ rc = mysql_query(mysql, "DROP TABLE IF EXISTS t1,t2");
+ myquery(rc);
+
+ rc= mysql_query(mysql,"CREATE TABLE t1 (a int , b int);");
+ myquery(rc);
+
+ rc= mysql_query(mysql,
+ "insert into t1 values (1,1), (2, 2), (3,3), (4,4), (5,5);");
+ myquery(rc);
+
+ rc= mysql_query(mysql,"CREATE TABLE t2 (a int , c int);");
+ myquery(rc);
+
+ rc= mysql_query(mysql,
+ "insert into t2 values (1,1), (2, 2), (3,3), (4,4), (5,5);");
+ myquery(rc);
+
+ for (j= 0; j < 9; j++)
+ {
+ stmt= mysql_prepare(mysql, query[j], strlen(query[j]));
+ mystmt_init(stmt);
+ for (i= 0; i < 3; i++)
+ {
+ rc= mysql_execute(stmt);
+ mystmt(stmt, rc);
+ assert(5 == my_process_stmt_result(stmt));
+ }
+ mysql_stmt_close(stmt);
+ }
+
+ rc= mysql_query(mysql, "DROP TABLE t1,t2");
+ myquery(rc);
+}
+
+
+static void test_selecttmp()
+{
+ MYSQL_STMT *stmt;
+ int rc, i;
+ const char *query= "select a,(select count(distinct t1.b) as sum from t1,t2 where t1.a=t2.a and t2.b > 0 and t1.a <= t3.b group by t1.a order by sum limit 1) from t3";
+
+ myheader("test_select_tmp");
+
+ rc = mysql_query(mysql, "DROP TABLE IF EXISTS t1,t2,t3");
+ myquery(rc);
+
+ rc= mysql_query(mysql,"CREATE TABLE t1 (a int , b int);");
+ myquery(rc);
+
+ rc= mysql_query(mysql,"create table t2 (a int, b int);");
+ myquery(rc);
+
+ rc= mysql_query(mysql,"create table t3 (a int, b int);");
+ myquery(rc);
+
+ rc= mysql_query(mysql,
+ "insert into t1 values (0,100),(1,2), (1,3), (2,2), (2,7), \
+(2,-1), (3,10);");
+ myquery(rc);
+ rc= mysql_query(mysql,
+ "insert into t2 values (0,0), (1,1), (2,1), (3,1), (4,1);");
+ myquery(rc);
+ rc= mysql_query(mysql,
+ "insert into t3 values (3,3), (2,2), (1,1);");
+ myquery(rc);
+
+ stmt= mysql_prepare(mysql, query, strlen(query));
+ mystmt_init(stmt);
+ for (i= 0; i < 3; i++)
+ {
+ rc= mysql_execute(stmt);
+ mystmt(stmt, rc);
+ assert(3 == my_process_stmt_result(stmt));
+ }
+ mysql_stmt_close(stmt);
+
+ rc= mysql_query(mysql, "DROP TABLE t1,t2,t3");
+ myquery(rc);
+}
+
+
+static void test_create_drop()
+{
+ MYSQL_STMT *stmt_create, *stmt_drop;
+ char *query;
+ int rc, i;
+ myheader("test_table_manipulation");
+
+ rc = mysql_query(mysql, "DROP TABLE IF EXISTS t1,t2");
+ myquery(rc);
+
+ query= (char*)"create table t1 (a int)";
+ stmt_create= mysql_prepare(mysql, query, strlen(query));
+ mystmt_init(stmt_create);
+
+ query= (char*)"drop table t1";
+ stmt_drop= mysql_prepare(mysql, query, strlen(query));
+ mystmt_init(stmt_drop);
+
+ for (i= 0; i < 3; i++)
+ {
+ rc= mysql_execute(stmt_create);
+ mystmt(stmt_create, rc);
+ fprintf(stdout, "created %i\n", i);
+ rc= mysql_execute(stmt_drop);
+ mystmt(stmt_drop, rc);
+ fprintf(stdout, "droped %i\n", i);
+ }
+
+ mysql_stmt_close(stmt_create);
+ mysql_stmt_close(stmt_drop);
+}
+
+
+static void test_rename()
+{
+ MYSQL_STMT *stmt;
+ const char *query= "rename table t1 to t2, t3 to t4";
+ int rc;
+ myheader("test_table_manipulation");
+
+ rc = mysql_query(mysql, "DROP TABLE IF EXISTS t1,t2,t3,t4");
+ myquery(rc);
+
+ stmt= mysql_prepare(mysql, query, strlen(query));
+ mystmt_init(stmt);
+
+ rc= mysql_query(mysql,"create table t1 (a int)");
+ myquery(rc);
+
+ rc= mysql_execute(stmt);
+ mystmt_r(stmt, rc);
+ fprintf(stdout, "rename without t3\n");
+
+ rc= mysql_query(mysql,"create table t3 (a int)");
+ myquery(rc);
+
+ rc= mysql_execute(stmt);
+ mystmt(stmt, rc);
+ fprintf(stdout, "rename with t3\n");
+
+ rc= mysql_execute(stmt);
+ mystmt_r(stmt, rc);
+ fprintf(stdout, "rename renamed\n");
+
+ rc= mysql_query(mysql,"rename table t2 to t1, t4 to t3");
+ myquery(rc);
+
+ rc= mysql_execute(stmt);
+ mystmt(stmt, rc);
+ fprintf(stdout, "rename reverted\n");
+
+ mysql_stmt_close(stmt);
+
+ rc= mysql_query(mysql, "DROP TABLE t2,t4");
+ myquery(rc);
+}
/*
Read and parse arguments and MySQL options from my.cnf
@@ -8338,9 +8760,8 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
static void get_options(int argc, char **argv)
{
int ho_error;
- load_defaults("my",client_test_load_default_groups,&argc,&argv);
- if ((ho_error= handle_options(&argc,&argv, client_test_long_options,
+ if ((ho_error= handle_options(&argc, &argv, client_test_long_options,
get_one_option)))
exit(ho_error);
@@ -8370,6 +8791,7 @@ static void print_test_output()
*********************************************************/
int main(int argc, char **argv)
{
+ DEBUGGER_OFF;
MY_INIT(argv[0]);
load_defaults("my",client_test_load_default_groups,&argc,&argv);
@@ -8385,6 +8807,7 @@ int main(int argc, char **argv)
test_count= 1;
start_time= time((time_t *)0);
+
client_query(); /* simple client query test */
#if NOT_YET_WORKING
/* Used for internal new development debugging */
@@ -8437,7 +8860,8 @@ int main(int argc, char **argv)
client_use_result(); /* usage of mysql_use_result() */
test_tran_bdb(); /* transaction test on BDB table type */
test_tran_innodb(); /* transaction test on InnoDB table type */
- test_prepare_ext(); /* test prepare with all types conversion -- TODO */
+ test_prepare_ext(); /* test prepare with all types
+ conversion -- TODO */
test_prepare_syntax(); /* syntax check for prepares */
test_field_names(); /* test for field names */
test_field_flags(); /* test to help .NET provider team */
@@ -8450,7 +8874,7 @@ int main(int argc, char **argv)
test_stmt_close(); /* mysql_stmt_close() test -- hangs */
test_prepare_field_result(); /* prepare meta info */
test_multi_stmt(); /* multi stmt test */
- test_multi_statements(); /* test multi statement execution */
+ test_multi_statements();/* test multi statement execution */
test_store_result(); /* test the store_result */
test_store_result1(); /* test store result without buffers */
test_store_result2(); /* test store result for misc case */
@@ -8497,6 +8921,17 @@ int main(int argc, char **argv)
test_bug2247(); /* test that mysql_stmt_affected_rows() returns
number of rows affected by last prepared
statement execution */
+ test_subqueries(); /* repeatable subqueries */
+ test_bad_union(); /* correct setup of UNION */
+ test_distinct(); /* distinct aggregate functions */
+ test_subqueries_ref(); /* outer reference in subqueries converted
+ Item_field -> Item_ref */
+ test_union(); /* test union with prepared statements */
+ test_bug3117(); /* BUG#3117: LAST_INSERT_ID() */
+ test_join(); /* different kinds of join, BUG#2794 */
+ test_selecttmp(); /* temporary table used in select execution */
+ test_create_drop(); /* some table manipulation BUG#2811 */
+ test_rename(); /* rename test */
end_time= time((time_t *)0);
total_time+= difftime(end_time, start_time);
@@ -8507,6 +8942,7 @@ int main(int argc, char **argv)
client_disconnect(); /* disconnect from server */
free_defaults(defaults_argv);
print_test_output();
-
+ my_end(0);
+
return(0);
}
diff --git a/tests/grant.pl b/tests/grant.pl
index 3146b7b6c25..eb2d00f3e1d 100644
--- a/tests/grant.pl
+++ b/tests/grant.pl
@@ -54,7 +54,7 @@ safe_query("delete from columns_priv");
safe_query("lock tables mysql.user write"); # Test lock tables
safe_query("flush privileges");
safe_query("unlock tables"); # should already be unlocked
-safe_query("drop database $opt_database",2);
+safe_query("drop database $opt_database",3); # Don't print possible error
safe_query("create database $opt_database");
# check that the user can't login yet
@@ -186,6 +186,7 @@ user_query("delete from $opt_database.test where a=3");
user_query("create table $opt_database.test2 (a int not null)");
user_query("alter table $opt_database.test2 add b int");
user_query("create index dummy on $opt_database.test2 (a)");
+user_query("update test,test2 SET test.a=test2.a where test.a=test2.a");
user_query("drop table $opt_database.test2");
user_query("show tables from grant_test");
# These should fail
@@ -195,6 +196,20 @@ user_query("insert into mysql.user (host,user) values ('error','$opt_user',0)",1
safe_query("revoke ALL PRIVILEGES on $opt_database.* from $user");
safe_query("select * from mysql.user where user = '$opt_user'");
safe_query("select * from mysql.db where user = '$opt_user'");
+
+# Test multi-updates
+safe_query("grant CREATE,UPDATE,DROP on $opt_database.* to $user");
+user_connect(0);
+user_query("create table $opt_database.test2 (a int not null)");
+user_query("update test,test2 SET test.a=1 where 1");
+user_query("update test,test2 SET test.a=test2.a where 1",1);
+safe_query("grant SELECT on $opt_database.* to $user");
+user_connect(0);
+user_query("update test,test2 SET test.a=test2.a where test2.a=test.a");
+user_query("drop table $opt_database.test2");
+
+# Revoke database privileges
+safe_query("revoke ALL PRIVILEGES on $opt_database.* from $user");
user_connect(1);
#
@@ -216,11 +231,18 @@ user_query("insert into $opt_database.test values (8,0)");
user_query("update $opt_database.test set b=1",1);
safe_query("grant update on $opt_database.test to $user");
user_query("update $opt_database.test set b=2");
+
+user_query("update $opt_database.test,test2 SET test.b=3",1);
+safe_query("grant select on $opt_database.test2 to $user");
+user_query("update $opt_database.test,test2 SET test.b=3");
+safe_query("revoke select on $opt_database.test2 from $user");
+
user_query("delete from $opt_database.test",1);
safe_query("grant delete on $opt_database.test to $user");
user_query("delete from $opt_database.test where a=1",1);
user_query("update $opt_database.test set b=3 where b=1",1);
user_query("update $opt_database.test set b=b+1",1);
+user_query("update $opt_database.test,test2 SET test.a=test2.a",1);
#
# Test global SELECT privilege combined with table level privileges
@@ -230,6 +252,8 @@ safe_query("grant SELECT on *.* to $user");
user_connect(0);
user_query("update $opt_database.test set b=b+1");
user_query("update $opt_database.test set b=b+1 where a > 0");
+user_query("update $opt_database.test,test2 SET test.a=test2.a");
+user_query("update $opt_database.test,test2 SET test2.a=test.a",1);
safe_query("revoke SELECT on *.* from $user");
safe_query("grant SELECT on $opt_database.* to $user");
user_connect(0);
@@ -252,6 +276,9 @@ user_query("delete from $opt_database.test where a=1");
user_query("update $opt_database.test set b=2 where b=1");
user_query("update $opt_database.test set b=b+1");
user_query("select count(*) from test");
+user_query("update test,test2 SET test.b=4",1);
+user_query("update test,test2 SET test2.a=test.a",1);
+user_query("update test,test2 SET test.a=test2.a",1);
user_query("create table $opt_database.test3 (a int)",1);
user_query("alter table $opt_database.test2 add c int",1);
@@ -270,10 +297,27 @@ user_query("select count(*) from test2,test",1);
user_query("select count(*) from test,test2",1);
user_query("replace into test2 SELECT a from test",1);
safe_query("grant update on $opt_database.test2 to $user");
+user_query("update test,test2 SET test2.a=test.a");
+user_query("update test,test2 SET test.b=test2.a where 0",1);
+user_query("update test,test2 SET test.a=2 where test2.a>100",1);
+user_query("update test,test2 SET test.a=test2.a",1);
user_query("replace into test2 SELECT a,a from test",1);
safe_query("grant DELETE on $opt_database.test2 to $user");
user_query("replace into test2 SELECT a,a from test");
user_query("insert into test (a) SELECT a from test2",1);
+safe_query("grant SELECT on $opt_database.test2 to $user");
+user_query("update test,test2 SET test.b=test2.a where 0");
+user_query("update test,test2 SET test.a=test2.a where test2.a>100");
+
+safe_query("revoke UPDATE on $opt_database.test2 from $user");
+safe_query("grant UPDATE (c) on $opt_database.test2 to $user");
+user_query("update test,test2 SET test.b=test2.a where 0");
+user_query("update test,test2 SET test.a=test2.a where test2.a>100");
+user_query("update test,test2 SET test2.a=test2.a where test2.a>100",1);
+user_query("update test,test2 SET test2.c=test2.a where test2.a>100");
+
+safe_query("revoke SELECT,UPDATE on $opt_database.test2 from $user");
+safe_query("grant UPDATE on $opt_database.test2 to $user");
user_query("drop table $opt_database.test2",1);
user_query("grant select on $opt_database.test2 to $user with grant option",1);
@@ -315,9 +359,13 @@ user_query("select count(a) from test",1);
# Test some grants on column level
#
+safe_query("grant create,update on $opt_database.test2 to $user");
+user_query("create table $opt_database.test2 (a int not null)");
user_query("delete from $opt_database.test where a=2",1);
user_query("delete from $opt_database.test where A=2",1);
user_query("update test set b=5 where b>0",1);
+user_query("update test,test2 SET test.b=5 where b>0",1);
+
safe_query("grant update(b),delete on $opt_database.test to $user");
safe_query("revoke update(a) on $opt_database.test from $user",1);
user_query("delete from $opt_database.test where a=2",1);
@@ -327,12 +375,18 @@ user_query("delete from $opt_database.test where a=2");
user_query("delete from $opt_database.test where A=2");
user_query("update test set b=5 where b>0");
user_query("update test set a=11 where b>5",1);
+user_query("update test,test2 SET test.b=5 where b>0");
+user_query("update test,test2 SET test.a=11 where b>0",1);
+user_query("update test,test2 SET test.b=test2.a where b>0",1);
+user_query("update test,test2 SET test.b=11 where test2.a>0",1);
user_query("select a,A from test");
safe_query("select $tables_cols from mysql.tables_priv");
safe_query("revoke ALL PRIVILEGES on $opt_database.test from $user");
safe_query("select $tables_cols from mysql.tables_priv");
safe_query("revoke GRANT OPTION on $opt_database.test from $user",1);
+safe_query("drop table $opt_database.test2");
+safe_query("revoke create,update on $opt_database.test2 from $user");
#
# Test grants on database level
@@ -412,7 +466,7 @@ safe_query("select $columns_cols from mysql.columns_priv where user = '$opt_user
safe_query("revoke ALL PRIVILEGES on $opt_database.test from $user");
user_query("select count(a) from test",1);
-user_query("select * from mysql.user",1);
+user_query("select * from mysql.user order by hostname",1);
safe_query("select * from mysql.db where user = '$opt_user'");
safe_query("select $tables_cols from mysql.tables_priv where user = '$opt_user'");
safe_query("select $columns_cols from mysql.columns_priv where user = '$opt_user'");
@@ -625,7 +679,7 @@ sub user_query
{
if (!defined($ignore_error))
{
- die "The above should not have failed!";
+ die "Query '$query' should not have failed!";
}
}
elsif (defined($ignore_error) && $ignore_error == 1)
@@ -649,7 +703,7 @@ sub do_query
if (!$sth->execute)
{
$fatal_error= ($DBI::errstr =~ /parse error/);
- if (!$ignore_error || $opt_verbose || $fatal_error)
+ if (!$ignore_error || ($opt_verbose && $ignore_error != 3) || $fatal_error)
{
print "Error in execute: $DBI::errstr\n";
}
diff --git a/tests/grant.res b/tests/grant.res
index 7b244f099f8..a4deafe29b7 100644
--- a/tests/grant.res
+++ b/tests/grant.res
@@ -6,10 +6,9 @@ lock tables mysql.user write
flush privileges
unlock tables
drop database grant_test
-Error in execute: Can't drop database 'grant_test'. Database doesn't exist
create database grant_test
Connecting grant_user
-Error on connect: Access denied for user: '@localhost' to database 'grant_test'
+Error on connect: Access denied for user: ''@'localhost' to database 'grant_test'
grant select(user) on mysql.user to grant_user@localhost
revoke select(user) on mysql.user from grant_user@localhost
grant select on *.* to grant_user@localhost
@@ -17,7 +16,7 @@ set password FOR grant_user2@localhost = password('test')
Error in execute: Can't find any matching row in the user table
set password FOR grant_user=password('test')
Connecting grant_user
-Error on connect: Access denied for user: 'grant_user@localhost' (Using password: NO)
+Error on connect: Access denied for user: 'grant_user'@'localhost' (Using password: NO)
set password FOR grant_user=''
Connecting grant_user
select * from mysql.user where user = 'grant_user'
@@ -30,13 +29,13 @@ GRANT SELECT ON *.* TO 'grant_user'@'localhost'
Connecting grant_user
insert into mysql.user (host,user) values ('error','grant_user')
-Error in execute: Access denied for user: 'grant_user@localhost' to database 'mysql'
+Error in execute: insert command denied to user: 'grant_user'@'localhost' for table 'user'
update mysql.user set host='error' WHERE user='grant_user'
-Error in execute: Access denied for user: 'grant_user@localhost' to database 'mysql'
+Error in execute: update command denied to user: 'grant_user'@'localhost' for table 'user'
create table grant_test.test (a int,b int)
-Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
+Error in execute: create command denied to user: 'grant_user'@'localhost' for table 'test'
grant select on *.* to grant_user2@localhost
-Error in execute: Access denied for user: 'grant_user@localhost' (Using password: NO)
+Error in execute: Access denied for user: 'grant_user'@'localhost' (Using password: NO)
revoke select on grant_test.test from grant_user@opt_host
Error in execute: There is no such grant defined for user 'grant_user' on host 'opt_host'
revoke select on grant_test.* from grant_user@opt_host
@@ -46,25 +45,25 @@ Error in execute: There is no such grant defined for user 'grant_user' on host '
grant select on grant_test.not_exists to grant_user
Error in execute: Table 'grant_test.not_exists' doesn't exist
grant FILE on grant_test.test to grant_user
-Error in execute: Illegal GRANT/REVOKE command. Please consult the manual which privileges can be used.
+Error in execute: Illegal GRANT/REVOKE command. Please consult the manual which privileges can be used
grant select on *.* to wrong___________user_name
Error in execute: The host or user argument to GRANT is too long
grant select on grant_test.* to wrong___________user_name
Error in execute: The host or user argument to GRANT is too long
Connecting grant_user
grant select on grant_test.test to grant_user with grant option
-Error in execute: grant command denied to user: 'grant_user@localhost' for table 'test'
+Error in execute: grant command denied to user: 'grant_user'@'localhost' for table 'test'
set password FOR ''@''=''
Error in execute: Can't find any matching row in the user table
set password FOR root@localhost = password('test')
-Error in execute: Access denied for user: 'grant_user@localhost' to database 'mysql'
+Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'mysql'
revoke select on *.* from grant_user@localhost
grant create,update on *.* to grant_user@localhost
Connecting grant_user
flush privileges
create table grant_test.test (a int,b int)
update grant_test.test set b=b+1 where a > 0
-Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'a' in table 'test'
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test'
show grants for grant_user@localhost
GRANT UPDATE, CREATE ON *.* TO 'grant_user'@'localhost'
@@ -77,12 +76,12 @@ Error in execute: There is no such grant defined for user 'grant_user' on host '
grant select on grant_test.test to wrong___________user_name
Error in execute: The host or user argument to GRANT is too long
INSERT INTO grant_test.test values (2,0)
-Error in execute: insert command denied to user: 'grant_user@localhost' for table 'test'
+Error in execute: insert command denied to user: 'grant_user'@'localhost' for table 'test'
grant ALL PRIVILEGES on *.* to grant_user@localhost
REVOKE INSERT on *.* from grant_user@localhost
Connecting grant_user
INSERT INTO grant_test.test values (1,0)
-Error in execute: insert command denied to user: 'grant_user@localhost' for table 'test'
+Error in execute: insert command denied to user: 'grant_user'@'localhost' for table 'test'
grant INSERT on *.* to grant_user@localhost
Connecting grant_user
INSERT INTO grant_test.test values (2,0)
@@ -92,7 +91,7 @@ select count(*) from grant_test.test
revoke SELECT on *.* from grant_user@localhost
Connecting grant_user
select count(*) from grant_test.test
-Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test'
INSERT INTO grant_test.test values (3,0)
grant SELECT on *.* to grant_user@localhost
Connecting grant_user
@@ -101,7 +100,7 @@ select count(*) from grant_test.test
revoke ALL PRIVILEGES on *.* from grant_user@localhost
Connecting grant_user
-Error on connect: Access denied for user: 'grant_user@localhost' to database 'grant_test'
+Error on connect: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
delete from user where user='grant_user'
flush privileges
delete from user where user='grant_user'
@@ -118,23 +117,23 @@ select count(*) from grant_test.test
2
select * from mysql.user where user = 'grant_user'
-Error in execute: Access denied for user: 'grant_user@localhost' to database 'mysql'
+Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'mysql'
insert into grant_test.test values (4,0)
-Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
+Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
update grant_test.test set a=1
-Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
+Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
delete from grant_test.test
-Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
+Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
create table grant_test.test2 (a int)
-Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
+Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
ALTER TABLE grant_test.test add c int
-Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
+Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
CREATE INDEX dummy ON grant_test.test (a)
-Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
+Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
drop table grant_test.test
-Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
+Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
grant ALL PRIVILEGES on grant_test.* to grant_user2@localhost
-Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
+Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
grant ALL PRIVILEGES on grant_test.* to grant_user@localhost WITH GRANT OPTION
Connecting grant_user
insert into grant_test.test values (5,0)
@@ -145,33 +144,45 @@ REVOKE ALL PRIVILEGES on grant_test.* from grant_user@localhost
REVOKE ALL PRIVILEGES on grant_test.* from grant_user@localhost
Connecting grant_user
insert into grant_test.test values (6,0)
-Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
+Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
REVOKE GRANT OPTION on grant_test.* from grant_user@localhost
Connecting grant_user
-Error on connect: Access denied for user: 'grant_user@localhost' to database 'grant_test'
+Error on connect: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
grant ALL PRIVILEGES on grant_test.* to grant_user@localhost
Connecting grant_user
select * from mysql.user where user = 'grant_user'
-Error in execute: Access denied for user: 'grant_user@localhost' to database 'mysql'
+Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'mysql'
insert into grant_test.test values (7,0)
update grant_test.test set a=3 where a=2
delete from grant_test.test where a=3
create table grant_test.test2 (a int not null)
alter table grant_test.test2 add b int
create index dummy on grant_test.test2 (a)
+update test,test2 SET test.a=test2.a where test.a=test2.a
drop table grant_test.test2
show tables from grant_test
test
insert into mysql.user (host,user) values ('error','grant_user',0)
-Error in execute: Access denied for user: 'grant_user@localhost' to database 'mysql'
+Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'mysql'
revoke ALL PRIVILEGES on grant_test.* from grant_user@localhost
select * from mysql.user where user = 'grant_user'
localhost grant_user N N N N N N N N N N N N N N N N N N N N N 0 0 0
select * from mysql.db where user = 'grant_user'
+grant CREATE,UPDATE,DROP on grant_test.* to grant_user@localhost
Connecting grant_user
-Error on connect: Access denied for user: 'grant_user@localhost' to database 'grant_test'
+create table grant_test.test2 (a int not null)
+update test,test2 SET test.a=1 where 1
+update test,test2 SET test.a=test2.a where 1
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test2'
+grant SELECT on grant_test.* to grant_user@localhost
+Connecting grant_user
+update test,test2 SET test.a=test2.a where test2.a=test.a
+drop table grant_test.test2
+revoke ALL PRIVILEGES on grant_test.* from grant_user@localhost
+Connecting grant_user
+Error on connect: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
grant create on grant_test.test2 to grant_user@localhost
Connecting grant_user
create table grant_test.test2 (a int not null)
@@ -179,15 +190,15 @@ show tables
test2
show columns from test
-Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test'
show keys from test
-Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test'
show columns from test2
a int(11) binary 0
show keys from test2
select * from test
-Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test'
grant insert on grant_test.test to grant_user@localhost
show tables
test
@@ -195,22 +206,32 @@ test2
insert into grant_test.test values (8,0)
update grant_test.test set b=1
-Error in execute: update command denied to user: 'grant_user@localhost' for table 'test'
+Error in execute: update command denied to user: 'grant_user'@'localhost' for table 'test'
grant update on grant_test.test to grant_user@localhost
update grant_test.test set b=2
+update grant_test.test,test2 SET test.b=3
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test2'
+grant select on grant_test.test2 to grant_user@localhost
+update grant_test.test,test2 SET test.b=3
+revoke select on grant_test.test2 from grant_user@localhost
delete from grant_test.test
-Error in execute: delete command denied to user: 'grant_user@localhost' for table 'test'
+Error in execute: delete command denied to user: 'grant_user'@'localhost' for table 'test'
grant delete on grant_test.test to grant_user@localhost
delete from grant_test.test where a=1
-Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'a' in table 'test'
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test'
update grant_test.test set b=3 where b=1
-Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
update grant_test.test set b=b+1
-Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
+update grant_test.test,test2 SET test.a=test2.a
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test2'
grant SELECT on *.* to grant_user@localhost
Connecting grant_user
update grant_test.test set b=b+1
update grant_test.test set b=b+1 where a > 0
+update grant_test.test,test2 SET test.a=test2.a
+update grant_test.test,test2 SET test2.a=test.a
+Error in execute: UPDATE command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test2'
revoke SELECT on *.* from grant_user@localhost
grant SELECT on grant_test.* to grant_user@localhost
Connecting grant_user
@@ -224,11 +245,11 @@ revoke UPDATE on *.* from grant_user@localhost
revoke SELECT on grant_test.* from grant_user@localhost
Connecting grant_user
update grant_test.test set b=b+1 where a > 0
-Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'a' in table 'test'
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test'
update grant_test.test set b=b+1
-Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
select * from test
-Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test'
grant select on grant_test.test to grant_user@localhost
delete from grant_test.test where a=1
update grant_test.test set b=2 where b=1
@@ -236,68 +257,93 @@ update grant_test.test set b=b+1
select count(*) from test
3
+update test,test2 SET test.b=4
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test2'
+update test,test2 SET test2.a=test.a
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test2'
+update test,test2 SET test.a=test2.a
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test2'
create table grant_test.test3 (a int)
-Error in execute: create command denied to user: 'grant_user@localhost' for table 'test3'
+Error in execute: create command denied to user: 'grant_user'@'localhost' for table 'test3'
alter table grant_test.test2 add c int
-Error in execute: alter command denied to user: 'grant_user@localhost' for table 'test2'
+Error in execute: alter command denied to user: 'grant_user'@'localhost' for table 'test2'
grant alter on grant_test.test2 to grant_user@localhost
alter table grant_test.test2 add c int
create index dummy ON grant_test.test (a)
-Error in execute: index command denied to user: 'grant_user@localhost' for table 'test'
+Error in execute: index command denied to user: 'grant_user'@'localhost' for table 'test'
grant index on grant_test.test2 to grant_user@localhost
create index dummy ON grant_test.test2 (a)
insert into test2 SELECT a,a from test
-Error in execute: insert command denied to user: 'grant_user@localhost' for table 'test2'
+Error in execute: insert command denied to user: 'grant_user'@'localhost' for table 'test2'
grant insert on test2 to grant_user@localhost
Error in execute: Table 'mysql.test2' doesn't exist
grant insert(a) on grant_test.test2 to grant_user@localhost
insert into test2 SELECT a,a from test
-Error in execute: insert command denied to user: 'grant_user@localhost' for column 'c' in table 'test2'
+Error in execute: insert command denied to user: 'grant_user'@'localhost' for column 'c' in table 'test2'
grant insert(c) on grant_test.test2 to grant_user@localhost
insert into test2 SELECT a,a from test
select count(*) from test2,test
-Error in execute: select command denied to user: 'grant_user@localhost' for table 'test2'
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test2'
select count(*) from test,test2
-Error in execute: select command denied to user: 'grant_user@localhost' for table 'test2'
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test2'
replace into test2 SELECT a from test
-Error in execute: delete command denied to user: 'grant_user@localhost' for table 'test2'
+Error in execute: delete command denied to user: 'grant_user'@'localhost' for table 'test2'
grant update on grant_test.test2 to grant_user@localhost
+update test,test2 SET test2.a=test.a
+update test,test2 SET test.b=test2.a where 0
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test2'
+update test,test2 SET test.a=2 where test2.a>100
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test2'
+update test,test2 SET test.a=test2.a
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test2'
replace into test2 SELECT a,a from test
-Error in execute: delete command denied to user: 'grant_user@localhost' for table 'test2'
+Error in execute: delete command denied to user: 'grant_user'@'localhost' for table 'test2'
grant DELETE on grant_test.test2 to grant_user@localhost
replace into test2 SELECT a,a from test
insert into test (a) SELECT a from test2
-Error in execute: select command denied to user: 'grant_user@localhost' for table 'test2'
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test2'
+grant SELECT on grant_test.test2 to grant_user@localhost
+update test,test2 SET test.b=test2.a where 0
+update test,test2 SET test.a=test2.a where test2.a>100
+revoke UPDATE on grant_test.test2 from grant_user@localhost
+grant UPDATE (c) on grant_test.test2 to grant_user@localhost
+update test,test2 SET test.b=test2.a where 0
+update test,test2 SET test.a=test2.a where test2.a>100
+update test,test2 SET test2.a=test2.a where test2.a>100
+Error in execute: UPDATE command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test2'
+update test,test2 SET test2.c=test2.a where test2.a>100
+revoke SELECT,UPDATE on grant_test.test2 from grant_user@localhost
+grant UPDATE on grant_test.test2 to grant_user@localhost
drop table grant_test.test2
-Error in execute: drop command denied to user: 'grant_user@localhost' for table 'test2'
+Error in execute: drop command denied to user: 'grant_user'@'localhost' for table 'test2'
grant select on grant_test.test2 to grant_user@localhost with grant option
-Error in execute: select command denied to user: 'grant_user@localhost' for table 'test2'
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test2'
grant drop on grant_test.test2 to grant_user@localhost with grant option
grant drop on grant_test.test2 to grant_user@localhost with grant option
grant select on grant_test.test2 to grant_user@localhost with grant option
-Error in execute: select command denied to user: 'grant_user@localhost' for table 'test2'
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test2'
rename table grant_test.test2 to grant_test.test3
-Error in execute: insert command denied to user: 'grant_user@localhost' for table 'test3'
+Error in execute: insert command denied to user: 'grant_user'@'localhost' for table 'test3'
grant CREATE,DROP on grant_test.test3 to grant_user@localhost
rename table grant_test.test2 to grant_test.test3
-Error in execute: insert command denied to user: 'grant_user@localhost' for table 'test3'
+Error in execute: insert command denied to user: 'grant_user'@'localhost' for table 'test3'
create table grant_test.test3 (a int)
grant INSERT on grant_test.test3 to grant_user@localhost
drop table grant_test.test3
rename table grant_test.test2 to grant_test.test3
rename table grant_test.test3 to grant_test.test2
-Error in execute: alter command denied to user: 'grant_user@localhost' for table 'test3'
+Error in execute: alter command denied to user: 'grant_user'@'localhost' for table 'test3'
grant ALTER on grant_test.test3 to grant_user@localhost
rename table grant_test.test3 to grant_test.test2
revoke DROP on grant_test.test2 from grant_user@localhost
rename table grant_test.test2 to grant_test.test3
drop table if exists grant_test.test2,grant_test.test3
-Error in execute: drop command denied to user: 'grant_user@localhost' for table 'test2'
+Error in execute: drop command denied to user: 'grant_user'@'localhost' for table 'test2'
drop table if exists grant_test.test2,grant_test.test3
create database grant_test
-Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
+Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
drop database grant_test
-Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
+Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
flush tables
Error in execute: Access denied. You need the RELOAD privilege for this operation
flush privileges
@@ -312,38 +358,54 @@ revoke ALL PRIVILEGES on grant_test.test3 from grant_user@localhost
revoke GRANT OPTION on grant_test.test2 from grant_user@localhost
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
select count(a) from test
-Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test'
+grant create,update on grant_test.test2 to grant_user@localhost
+create table grant_test.test2 (a int not null)
delete from grant_test.test where a=2
-Error in execute: delete command denied to user: 'grant_user@localhost' for table 'test'
+Error in execute: delete command denied to user: 'grant_user'@'localhost' for table 'test'
delete from grant_test.test where A=2
-Error in execute: delete command denied to user: 'grant_user@localhost' for table 'test'
+Error in execute: delete command denied to user: 'grant_user'@'localhost' for table 'test'
update test set b=5 where b>0
-Error in execute: update command denied to user: 'grant_user@localhost' for table 'test'
+Error in execute: update command denied to user: 'grant_user'@'localhost' for table 'test'
+update test,test2 SET test.b=5 where b>0
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test'
grant update(b),delete on grant_test.test to grant_user@localhost
revoke update(a) on grant_test.test from grant_user@localhost
Error in execute: There is no such grant defined for user 'grant_user' on host 'localhost' on table 'test'
delete from grant_test.test where a=2
-Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'a' in table 'test'
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test'
update test set b=5 where b>0
-Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
grant select(a),select(b) on grant_test.test to grant_user@localhost
delete from grant_test.test where a=2
delete from grant_test.test where A=2
update test set b=5 where b>0
update test set a=11 where b>5
-Error in execute: UPDATE command denied to user: 'grant_user@localhost' for column 'a' in table 'test'
+Error in execute: UPDATE command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test'
+update test,test2 SET test.b=5 where b>0
+update test,test2 SET test.a=11 where b>0
+Error in execute: UPDATE command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test'
+update test,test2 SET test.b=test2.a where b>0
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test2'
+update test,test2 SET test.b=11 where test2.a>0
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test2'
select a,A from test
8 8
5 5
7 7
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
+localhost grant_test grant_user test2 root@localhost Update,Create
localhost grant_test grant_user test root@localhost Delete Select,Update
revoke ALL PRIVILEGES on grant_test.test from grant_user@localhost
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
+localhost grant_test grant_user test2 root@localhost Update,Create
+
revoke GRANT OPTION on grant_test.test from grant_user@localhost
Error in execute: There is no such grant defined for user 'grant_user' on host 'localhost' on table 'test'
+drop table grant_test.test2
+revoke create,update on grant_test.test2 from grant_user@localhost
grant select(a) on grant_test.test to grant_user@localhost
show full columns from test
a int(11) binary YES NULL select
@@ -363,21 +425,21 @@ insert into test (b) values (5)
insert into test (b) values (a)
update test set b=3 where a > 0
select * from test
-Error in execute: select command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
+Error in execute: select command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
select b from test
-Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
select a from test where b > 0
-Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
insert into test (a) values (10)
-Error in execute: INSERT command denied to user: 'grant_user@localhost' for column 'a' in table 'test'
+Error in execute: INSERT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test'
insert into test (b) values (b)
-Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
insert into test (a,b) values (1,5)
-Error in execute: INSERT command denied to user: 'grant_user@localhost' for column 'a' in table 'test'
+Error in execute: INSERT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test'
insert into test (b) values (1),(b)
-Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
update test set b=3 where b > 0
-Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
select Host, Db, User, Table_name, Grantor, Table_priv, Column_priv from mysql.tables_priv
localhost grant_test grant_user test root@localhost Select,Insert,Update
@@ -393,9 +455,9 @@ select Host, Db, User, Table_name, Column_name, Column_priv from mysql.columns_p
localhost grant_test grant_user test b Insert
select count(a) from test
-Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test'
update test set b=4
-Error in execute: update command denied to user: 'grant_user@localhost' for table 'test'
+Error in execute: update command denied to user: 'grant_user'@'localhost' for table 'test'
grant select(a,b), update (a,b) on grant_test.test to grant_user@localhost
select count(a),count(b) from test where a+b > 0
3 3
@@ -411,13 +473,13 @@ localhost grant_test grant_user test b Select,Insert,Update
localhost grant_test grant_user test a Select,Update
insert into test (a,b) values (12,12)
-Error in execute: INSERT command denied to user: 'grant_user@localhost' for column 'a' in table 'test'
+Error in execute: INSERT command denied to user: 'grant_user'@'localhost' for column 'a' in table 'test'
grant insert on grant_test.* to grant_user@localhost
Connecting grant_user
insert into test (a,b) values (13,13)
revoke select(b) on grant_test.test from grant_user@localhost
select count(a) from test where a+b > 0
-Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
update test set b=5 where a=2
grant select on grant_test.test to grant_user@localhost
Connecting grant_user
@@ -431,10 +493,10 @@ select count(a) from test where a+b > 0
revoke select on grant_test.test from grant_user@localhost
Connecting grant_user
select count(a) from test where a+b > 0
-Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test'
grant select(a) on grant_test.test to grant_user@localhost
select count(a) from test where a+b > 0
-Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'b' in table 'test'
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test'
grant select on *.* to grant_user@localhost
Connecting grant_user
select count(a) from test where a+b > 0
@@ -458,9 +520,9 @@ localhost grant_test grant_user test a Select,Update
revoke ALL PRIVILEGES on grant_test.test from grant_user@localhost
select count(a) from test
-Error in execute: select command denied to user: 'grant_user@localhost' for table 'test'
-select * from mysql.user
-Error in execute: select command denied to user: 'grant_user@localhost' for table 'user'
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'test'
+select * from mysql.user order by hostname
+Error in execute: select command denied to user: 'grant_user'@'localhost' for table 'user'
select * from mysql.db where user = 'grant_user'
localhost grant_test grant_user N Y N N N N N N N N N N
@@ -492,25 +554,25 @@ select a from grant_test.test3
1
select * from grant_test.test3
-Error in execute: select command denied to user: 'grant_user@localhost' for column 'b' in table 'test3'
+Error in execute: select command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test3'
select a,b from grant_test.test3
-Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'b' in table 'test3'
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test3'
select b from grant_test.test3
-Error in execute: SELECT command denied to user: 'grant_user@localhost' for column 'b' in table 'test3'
+Error in execute: SELECT command denied to user: 'grant_user'@'localhost' for column 'b' in table 'test3'
revoke SELECT(a) on grant_test.test3 from grant_user@localhost
revoke FILE on *.* from grant_user@localhost
drop table grant_test.test3
create table grant_test.test3 (a int)
Connecting grant_user
-Error on connect: Access denied for user: 'grant_user@localhost' to database 'grant_test'
+Error on connect: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
grant INSERT on grant_test.test3 to grant_user@localhost
Connecting grant_user
select * into outfile '/tmp/mysql-grant.test' from grant_test.test3
-Error in execute: Access denied for user: 'grant_user@localhost' (Using password: NO)
+Error in execute: Access denied for user: 'grant_user'@'localhost' (Using password: NO)
grant SELECT on grant_test.test3 to grant_user@localhost
Connecting grant_user
LOCK TABLES grant_test.test3 READ
-Error in execute: Access denied for user: 'grant_user@localhost' to database 'grant_test'
+Error in execute: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
grant LOCK TABLES on *.* to grant_user@localhost
show grants for grant_user@localhost
GRANT LOCK TABLES ON *.* TO 'grant_user'@'localhost'
@@ -527,7 +589,7 @@ revoke SELECT,INSERT,UPDATE,DELETE on grant_test.test3 from grant_user@localhost
Connecting grant_user
revoke LOCK TABLES on *.* from grant_user@localhost
Connecting grant_user
-Error on connect: Access denied for user: 'grant_user@localhost' to database 'grant_test'
+Error on connect: Access denied for user: 'grant_user'@'localhost' to database 'grant_test'
drop table grant_test.test3
show grants for grant_user@localhost
GRANT USAGE ON *.* TO 'grant_user'@'localhost'
diff --git a/tests/thread_test.c b/tests/thread_test.c
index c201cbb9b83..06f335fe1a6 100644
--- a/tests/thread_test.c
+++ b/tests/thread_test.c
@@ -104,7 +104,7 @@ static struct my_option my_long_options[] =
{"query", 'Q', "Query to execute in each threads", (gptr*) &query,
(gptr*) &query, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"port", 'P', "Port number to use for connection", (gptr*) &tcp_port,
- (gptr*) &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (gptr*) &tcp_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, 0},
{"socket", 'S', "Socket file to use for connection", (gptr*) &unix_socket,
(gptr*) &unix_socket, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"test-count", 'c', "Run test count times (default %d)",